diff --git a/src/views/oa/crm/businessTripApply/edit.vue b/src/views/oa/crm/businessTripApply/edit.vue index cf391c7..bd4f1a7 100644 --- a/src/views/oa/crm/businessTripApply/edit.vue +++ b/src/views/oa/crm/businessTripApply/edit.vue @@ -395,9 +395,6 @@ const isFormDisabled = computed(() => { // 计算动态校验规则 const computedRules = computed(() => { const baseRules = { ...rules.value }; - // 根据 tripType 过滤不需要的规则 (简单处理:校验时 el-form-item 不渲染则不校验,或者在这里动态调整) - // Element Plus Form 组件通常只校验渲染出来的 Item,所以只要 v-if 控制好了,rules 可以放全集。 - // 但是为了保险,可以在提交时做更严格的检查。 return baseRules; }); @@ -420,9 +417,7 @@ const setDefaultCopyUsers = () => { } // 根据名字查找ID - const copyIds = userList.value - .filter((u: any) => targetNames.includes(u.nickName)) - .map((u: any) => String(u.userId)); + const copyIds = userList.value.filter((u: any) => targetNames.includes(u.nickName)).map((u: any) => String(u.userId)); // 如果包含部门经理 if (includeDeptLeader) { diff --git a/src/views/oa/crm/crmMailingApply/edit.vue b/src/views/oa/crm/crmMailingApply/edit.vue index 9e90694..384bca4 100644 --- a/src/views/oa/crm/crmMailingApply/edit.vue +++ b/src/views/oa/crm/crmMailingApply/edit.vue @@ -63,14 +63,7 @@ - + @@ -122,9 +115,26 @@ - + + + + + + - 邮寄物品及事由 + 邮寄物品及事由 @@ -145,6 +155,7 @@ :disabled="!isFormEditable" :isShowTip="true" /> +
提示:请上传邮寄实物图片和快递单截图
@@ -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( @@ -303,6 +315,10 @@ const signTimeForm = reactive<{ signTime: string | undefined }>({ signTime: unde // 路由参数(统一使用query方式,与projectInfo保持一致) const routeParams = ref>({}); +// 最优资费方案 +const bestSolution = ref(null); +const bestSolutionLoading = ref(false); + // 任务变量 const taskVariables = ref({}); @@ -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); diff --git a/src/views/oa/crm/flightBooking/edit.vue b/src/views/oa/crm/flightBooking/edit.vue index eb0015c..42851ae 100644 --- a/src/views/oa/crm/flightBooking/edit.vue +++ b/src/views/oa/crm/flightBooking/edit.vue @@ -77,6 +77,7 @@ :fileType="['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx']" :isShowTip="true" /> +
提示:请上传机票折扣信息页面截图