Commit b6f3afae by wusiyi

feat: 工厂接单后取消的退款逻辑 #1005797

parent 2219553e
...@@ -655,7 +655,7 @@ export function interceptUpdateApi(ids: (string | number)[]) { ...@@ -655,7 +655,7 @@ export function interceptUpdateApi(ids: (string | number)[]) {
} }
export function interceptSuccessApi( export function interceptSuccessApi(
data: { factoryOrderNumber: string; suspendSussessType: number }[], data: { factoryOrderNumber: string; blockSuccessType: number }[],
) { ) {
return axios.post<never, BaseRespData<ResultInfoDataItem[]>>( return axios.post<never, BaseRespData<ResultInfoDataItem[]>>(
'factory/podOrder/factoryOrderBlockSuccess', 'factory/podOrder/factoryOrderBlockSuccess',
......
...@@ -646,12 +646,12 @@ ...@@ -646,12 +646,12 @@
</span> </span>
<span v-if="suspendedSubTab === 1" class="item"> <span v-if="suspendedSubTab === 1" class="item">
<ElButton type="success" @click="() => handleInterceptionSuccess()" <ElButton type="success" @click="() => handleInterceptionSuccess()"
>拦截成功</ElButton >处理拦截</ElButton
> >
</span> </span>
<span v-if="suspendedSubTab === 1" class="item"> <span v-if="suspendedSubTab === 1" class="item">
<ElButton type="danger" @click="() => handleInterceptionFail()" <ElButton type="danger" @click="() => handleInterceptionFail()"
>拦截失败</ElButton >取消拦截</ElButton
> >
</span> </span>
<span class="item"> <span class="item">
...@@ -888,7 +888,7 @@ ...@@ -888,7 +888,7 @@
size="small" size="small"
@click.stop="handleInterceptionSuccess(row)" @click.stop="handleInterceptionSuccess(row)"
> >
拦截成功 处理拦截
</ElButton> </ElButton>
</span> </span>
<span <span
...@@ -901,7 +901,7 @@ ...@@ -901,7 +901,7 @@
size="small" size="small"
@click.stop="handleInterceptionFail(row)" @click.stop="handleInterceptionFail(row)"
> >
拦截失败 取消拦截
</ElButton> </ElButton>
</span> </span>
</div> </div>
...@@ -1107,24 +1107,24 @@ ...@@ -1107,24 +1107,24 @@
/> />
<ElDialog <ElDialog
v-model="interceptSuccessDialogVisible" v-model="interceptSuccessDialogVisible"
title="拦截成功" title="处理拦截"
width="480px" width="480px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<ElForm ref="interceptSuccessFormRef" :model="interceptSuccessForm"> <ElForm ref="interceptSuccessFormRef" :model="interceptSuccessForm">
<ElFormItem <ElFormItem
label="拦截成功类型" label="处理拦截类型"
prop="suspendSussessType" prop=" blockSuccessType"
:rules="[ :rules="[
{ {
required: true, required: true,
message: '请选择拦截成功类型', message: '请选择处理拦截类型',
trigger: 'change', trigger: 'change',
}, },
]" ]"
> >
<ElSelect <ElSelect
v-model="interceptSuccessForm.suspendSussessType" v-model="interceptSuccessForm.blockSuccessType"
placeholder="请选择" placeholder="请选择"
style="width: 100%" style="width: 100%"
clearable clearable
...@@ -1299,8 +1299,8 @@ const interceptSuccessTypeOptions = [ ...@@ -1299,8 +1299,8 @@ const interceptSuccessTypeOptions = [
{ label: '生产拦截成功', value: 1 }, { label: '生产拦截成功', value: 1 },
{ label: '发货拦截成功', value: 2 }, { label: '发货拦截成功', value: 2 },
] ]
const interceptSuccessForm = ref<{ suspendSussessType: number | undefined }>({ const interceptSuccessForm = ref<{ blockSuccessType: number | undefined }>({
suspendSussessType: undefined, blockSuccessType: undefined,
}) })
const interceptSuccessRows = ref<FactoryOrderNewListData[]>([]) const interceptSuccessRows = ref<FactoryOrderNewListData[]>([])
const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL'] const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL']
...@@ -3102,7 +3102,7 @@ const handleInterceptionSuccess = (row?: FactoryOrderNewListData) => { ...@@ -3102,7 +3102,7 @@ const handleInterceptionSuccess = (row?: FactoryOrderNewListData) => {
if (!ensureSelection()) return if (!ensureSelection()) return
interceptSuccessRows.value = [...selectedRows.value] interceptSuccessRows.value = [...selectedRows.value]
} }
interceptSuccessForm.value.suspendSussessType = undefined interceptSuccessForm.value.blockSuccessType = undefined
interceptSuccessDialogVisible.value = true interceptSuccessDialogVisible.value = true
nextTick(() => interceptSuccessFormRef.value?.clearValidate()) nextTick(() => interceptSuccessFormRef.value?.clearValidate())
} }
...@@ -3115,8 +3115,8 @@ const submitInterceptSuccess = async () => { ...@@ -3115,8 +3115,8 @@ const submitInterceptSuccess = async () => {
} catch { } catch {
return return
} }
const suspendSussessType = interceptSuccessForm.value.suspendSussessType const blockSuccessType = interceptSuccessForm.value.blockSuccessType
if (suspendSussessType === undefined) return if (blockSuccessType === undefined) return
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
...@@ -3127,9 +3127,9 @@ const submitInterceptSuccess = async () => { ...@@ -3127,9 +3127,9 @@ const submitInterceptSuccess = async () => {
const data = rows.map((item: FactoryOrderNewListData) => { const data = rows.map((item: FactoryOrderNewListData) => {
return { return {
factoryOrderNumber: item.factoryOrderNumber as string, factoryOrderNumber: item.factoryOrderNumber as string,
suspendSussessType, blockSuccessType,
} }
}) as { factoryOrderNumber: string; suspendSussessType: number }[] }) as { factoryOrderNumber: string; blockSuccessType: number }[]
try { try {
const res = await interceptSuccessApi(data) const res = await interceptSuccessApi(data)
if (res.code !== 200) return if (res.code !== 200) return
...@@ -3155,7 +3155,7 @@ const handleInterceptionFail = async (row?: FactoryOrderNewListData) => { ...@@ -3155,7 +3155,7 @@ const handleInterceptionFail = async (row?: FactoryOrderNewListData) => {
item.factoryOrderNumber as string, item.factoryOrderNumber as string,
), ),
api: (ids) => interceptUpdateApi(ids as string[]), api: (ids) => interceptUpdateApi(ids as string[]),
confirmText: '拦截失败,订单会恢复到拦截前的状态,确认是否拒绝拦截申请?', confirmText: '取消拦截,订单会恢复到拦截前的状态,确认是否拒绝拦截申请?',
onSuccess: (res) => { onSuccess: (res) => {
const data = Array.isArray(res.data) const data = Array.isArray(res.data)
? (res.data as ResultInfoDataItem[]) ? (res.data as ResultInfoDataItem[])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment