|
|
|
|
@ -63,14 +63,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="部门" prop="deptId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.deptId"
|
|
|
|
|
placeholder="请选择部门"
|
|
|
|
|
filterable
|
|
|
|
|
clearable
|
|
|
|
|
:disabled="!isFormEditable"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-select v-model="form.deptId" placeholder="请选择部门" filterable clearable :disabled="!isFormEditable" style="width: 100%">
|
|
|
|
|
<el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName" :value="item.deptId" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@ -122,9 +115,26 @@
|
|
|
|
|
<el-input v-model="form.expressNo" placeholder="请输入快递单号" :disabled="!isFormEditable" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-col :span="24" v-if="form.mailingType === '1' && (bestSolutionLoading || bestSolution)">
|
|
|
|
|
<el-alert
|
|
|
|
|
v-loading="bestSolutionLoading"
|
|
|
|
|
:title="bestSolution ? `最优惠方案推荐:${bestSolution.solutionName} (预估费用:¥${bestSolution.price})` : '正在查询最优方案...'"
|
|
|
|
|
:type="bestSolution ? 'success' : 'info'"
|
|
|
|
|
:closable="false"
|
|
|
|
|
show-icon
|
|
|
|
|
style="margin-bottom: 20px"
|
|
|
|
|
>
|
|
|
|
|
<template #default v-if="bestSolution && isFormEditable">
|
|
|
|
|
<el-button type="primary" link size="small" @click="applyBestSolution">自动填入邮寄费用</el-button>
|
|
|
|
|
<span v-if="bestSolution.queryCond" style="margin-left: 10px; font-size: 12px; color: #909399">
|
|
|
|
|
(匹配条件: {{ bestSolution.queryCond }})
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-alert>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-divider content-position="left">邮寄物品及事由</el-divider>
|
|
|
|
|
<el-divider content-position="left">邮寄物品及事由</el-divider>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="邮寄物品信息及申请事由" prop="itemInfo" label-width="180px">
|
|
|
|
|
@ -145,6 +155,7 @@
|
|
|
|
|
:disabled="!isFormEditable"
|
|
|
|
|
:isShowTip="true"
|
|
|
|
|
/>
|
|
|
|
|
<div style="color: #f56c6c; font-size: 12px; margin-top: 5px">提示:请上传邮寄实物图片和快递单截图</div>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
@ -266,6 +277,7 @@ import SubmitVerify from '@/components/Process/submitVerify.vue';
|
|
|
|
|
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
|
|
|
|
import approvalButton from '@/components/Process/approvalButton.vue';
|
|
|
|
|
import { useUserStore } from '@/store/modules/user';
|
|
|
|
|
import { getBestSolution, CrmShippingTariffVO } from '@/api/oa/crm/shippingTariff';
|
|
|
|
|
|
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
const { mailing_type, logistics_status, mailing_apply_status, wf_business_status } = toRefs<any>(
|
|
|
|
|
@ -303,6 +315,10 @@ const signTimeForm = reactive<{ signTime: string | undefined }>({ signTime: unde
|
|
|
|
|
// 路由参数(统一使用query方式,与projectInfo保持一致)
|
|
|
|
|
const routeParams = ref<Record<string, any>>({});
|
|
|
|
|
|
|
|
|
|
// 最优资费方案
|
|
|
|
|
const bestSolution = ref<CrmShippingTariffVO | null>(null);
|
|
|
|
|
const bestSolutionLoading = ref(false);
|
|
|
|
|
|
|
|
|
|
// 任务变量
|
|
|
|
|
const taskVariables = ref<any>({});
|
|
|
|
|
|
|
|
|
|
@ -353,8 +369,9 @@ const data = reactive<{ form: CrmMailingApplyForm; rules: any }>({
|
|
|
|
|
mailingFee: [{ required: true, message: '邮寄费用不能为空', trigger: 'blur' }],
|
|
|
|
|
itemInfo: [{ required: true, message: '邮寄物品信息及申请事由不能为空', trigger: 'blur' }],
|
|
|
|
|
expressNo: [{ required: true, message: '快递单号不能为空', trigger: 'blur' }],
|
|
|
|
|
logisticsStatus: [{ required: true, message: '物流状态不能为空', trigger: 'change' }],
|
|
|
|
|
mailingTime: [{ required: true, message: '邮寄时间不能为空', trigger: 'change' }]
|
|
|
|
|
ossId: [{ required: true, message: '附件图片不能为空', trigger: 'blur' }]
|
|
|
|
|
// logisticsStatus: [{ required: true, message: '物流状态不能为空', trigger: 'change' }],
|
|
|
|
|
// mailingTime: [{ required: true, message: '邮寄时间不能为空', trigger: 'change' }]
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@ -423,6 +440,35 @@ watch(
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 监听省份、重量、邮寄类型以计算最优资费
|
|
|
|
|
watch(
|
|
|
|
|
() => [form.value.province, form.value.weight, form.value.mailingType],
|
|
|
|
|
async ([province, weight, type]) => {
|
|
|
|
|
if (type === '1' && province && weight) {
|
|
|
|
|
bestSolutionLoading.value = true;
|
|
|
|
|
try {
|
|
|
|
|
const res = await getBestSolution(province as string, weight as number);
|
|
|
|
|
bestSolution.value = res.data;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
bestSolution.value = null;
|
|
|
|
|
} finally {
|
|
|
|
|
bestSolutionLoading.value = false;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
bestSolution.value = null;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// 应用最优方案
|
|
|
|
|
const applyBestSolution = () => {
|
|
|
|
|
if (bestSolution.value && bestSolution.value.price != null) {
|
|
|
|
|
form.value.mailingFee = bestSolution.value.price as any;
|
|
|
|
|
proxy?.$modal.msgSuccess('已应用最优惠资费方案!');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 经手人变更时自动填充姓名和部门 */
|
|
|
|
|
const onHandlerChange = (userId: number) => {
|
|
|
|
|
const user = userList.value.find((u) => u.userId === userId);
|
|
|
|
|
|