From 68da4f6df5fe8510bf8c46aab29f84943e8d56dd Mon Sep 17 00:00:00 2001 From: Yangk Date: Thu, 12 Mar 2026 16:47:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(oa/crm):=20=E7=A7=BB=E9=99=A4=E6=9C=BA?= =?UTF-8?q?=E7=A5=A8=E9=A2=84=E8=AE=A2=E7=BC=96=E5=8F=B7=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/oa/crm/flightBooking/edit.vue | 40 ++++--------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/src/views/oa/crm/flightBooking/edit.vue b/src/views/oa/crm/flightBooking/edit.vue index 574daa5..4e4c78d 100644 --- a/src/views/oa/crm/flightBooking/edit.vue +++ b/src/views/oa/crm/flightBooking/edit.vue @@ -18,11 +18,7 @@ - - - + @@ -175,8 +171,8 @@ const validateAmount = (rule: any, value: any, callback: any) => { callback(); }; -// 机票编号生成状态 -const isCodeGenerated = ref(false); +// // 机票编号生成状态 +// const isCodeGenerated = ref(false); /** 查询用户信息下拉框结构 */ const userInfoList = ref([]); // 存储当前登录用户信息 @@ -285,7 +281,7 @@ const data = reactive>({ }, rules: { passengerId: [{ required: true, message: '乘机人ID不能为空', trigger: 'blur' }], - applyCode: [{ required: true, message: '机票编码不能为空', trigger: 'blur' }], + // applyCode: [{ required: true, message: '机票编码不能为空', trigger: 'blur' }], travelDate: [{ required: true, message: '出行日期不能为空', trigger: 'blur' }], departureLocation: [{ required: true, message: '出发地点不能为空', trigger: 'blur' }], arrivalLocation: [{ required: true, message: '到达地点不能为空', trigger: 'blur' }], @@ -300,20 +296,7 @@ const data = reactive>({ const { queryParams, form, rules } = toRefs(data); const flightBookingFormRef = ref(); -// 生成机票编号 -const generateContractCode = async () => { - if (isCodeGenerated.value) return; // 如果已经生成过,直接返回 - try { - const params = { codeRuleCode: CodeRuleEnum.FLIGHT_BOOKING } as any; - const res = await getRuleGenerateCode(params); - form.value.applyCode = res.msg; - isCodeGenerated.value = true; // 标记为已生成 - proxy?.$modal.msgSuccess('机票编号生成成功'); - } catch (error) { - console.error('生成机票编号失败:', error); - proxy?.$modal.msgError('机票编号生成失败'); - } -}; + watch( () => form.value.passengerId, // 监听 passengerId (newPassengerId) => { @@ -393,12 +376,6 @@ onMounted(async () => { const res = await getFlightBooking(id); Object.assign(form.value, res.data); proxy?.$modal.closeLoading(); - // 编辑模式:如果已有合同编号,禁用生成按钮 - if (form.value.applyCode) { - isCodeGenerated.value = true; - } else { - isCodeGenerated.value = false; - } } else { // 新增模式:获取登录用户部门ID并自动赋值 // try { @@ -410,13 +387,6 @@ onMounted(async () => { // } catch (error) { // console.error('获取用户信息失败:', error); // } - // 新增模式:如果已有机票编号,禁用生成按钮 - if (form.value.applyCode) { - isCodeGenerated.value = true; - } else { - // 如果有合同但没有编号,允许生成 - isCodeGenerated.value = false; - } proxy?.$modal.closeLoading(); } });