| | |
| | | |
| | | </el-link> |
| | | </el-tooltip> |
| | | <!-- |
| | | <!-- |
| | | <el-tooltip content="完成行程" placement="top"> |
| | | <el-link size="small" type="primary" v-if="[2].includes(row.status)" @click="handleOk(row)" class="link-btn" |
| | | v-hasPermi="['tms:tmsDispatchOrder:okOrder']" underline="never" icon="el-icon-circle-check"> |
| | |
| | | </div> |
| | | |
| | | <div v-if="optionType == 'loading'"> |
| | | <el-descriptions v-if="optionNum == 'radio'" style="margin-bottom: 20px" :column="2" border> |
| | | <el-descriptions v-if="optionNum == 'radio'" style="margin-bottom: 20px" :column="2" border> |
| | | <el-descriptions-item label="调度单号">{{ form.dispatchNo }}</el-descriptions-item> |
| | | <el-descriptions-item label="客户">{{ form.customerName }}</el-descriptions-item> |
| | | <el-descriptions-item label="项目名称">{{ form.projectName }}</el-descriptions-item> |
| | |
| | | const boxFormRef = ref(); |
| | | const goodsCrudRef = ref(); |
| | | const actualFormRef = ref(); |
| | | const isAutoSettingVehicle = ref(false); |
| | | /** |
| | | * 字典公共转换函数 |
| | | */ |
| | |
| | | message: "主驾驶员不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | change: (val: any) => { |
| | | // 防止重复执行 |
| | | // 在 mainDriverId 的 change 事件中 |
| | | change: async (val: any) => { |
| | | if (data.isChanging) return; |
| | | data.isChanging = true; |
| | | isAutoSettingVehicle.value = true; |
| | | |
| | | const table = crudRef.value?.getPropRef?.('mainDriverId')?.$refs?.temp; |
| | | if (!table) { |
| | | data.isChanging = false; |
| | | isAutoSettingVehicle.value = false; |
| | | return; |
| | | } |
| | | |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | console.log('自动填充成功:', active); |
| | | if (active && active.driverName) { |
| | | try { |
| | | |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | mainDriverId: active.id, |
| | | mainDriverName: active.driverName, |
| | | }); |
| | | await nextTick(); // 等待清空生效 |
| | | const res = await getLastLicensePlate(active.driverName); |
| | | |
| | | // 获取车牌号并赋值 |
| | | getLastLicensePlate(active.driverName).then(res => { |
| | | if (res.code == 200) { |
| | | form.value.licensePlate = res.data.licensePlate; |
| | | form.value.vehicleId = res.data.vehicleId |
| | | form.value.actualVehicleType = res.data.vehicleType; |
| | | if (res.code === 200 && res.data) { |
| | | const vehicleData = res.data; |
| | | nextTick(() => { |
| | | Object.assign(form.value, { |
| | | licensePlate: vehicleData.licensePlate, |
| | | vehicleId: vehicleData.vehicleId, |
| | | actualVehicleType: vehicleData.actualVehicleType, |
| | | driverName: vehicleData.driverName, |
| | | }); |
| | | }) |
| | | await nextTick(); |
| | | console.log('自动填充成功:', form.value); |
| | | } |
| | | }).finally(() => { |
| | | } catch (e) { |
| | | console.error("自动获取车牌失败", e); |
| | | } finally { |
| | | data.isChanging = false; |
| | | }); |
| | | setTimeout(() => { |
| | | // isAutoSettingVehicle.value = false; |
| | | }, 500); // 稍微延长一点时间,防止 vehicleId 的 change 事件误触 |
| | | } |
| | | } else { |
| | | data.isChanging = false; |
| | | // isAutoSettingVehicle.value = false; |
| | | } |
| | | }, |
| | | // change: (val: any) => { |
| | |
| | | // mainDriverName: active.driverName, |
| | | // }); |
| | | // console.log(active.driverName,'44'); |
| | | // getLastLicensePlate(active.driverName).then(res => { |
| | | // getLastLicensePlate(active.driverName).then(res => { |
| | | // console.log(res); |
| | | |
| | | // }) |
| | |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | vehicleProviderName: { |
| | | label: '车辆服务商1', minWidth: 130, |
| | | label: '车辆服务商', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | driverName: { |
| | |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | console.log(98521); |
| | | |
| | | getTmsDriver(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | |
| | | message: "车牌号不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | // vehicleId 配置中的 change |
| | | change: (val: any) => { |
| | | // 如果是自动填充触发的,直接返回,不执行后续逻辑 |
| | | if (isAutoSettingVehicle.value) { |
| | | return; |
| | | } |
| | | |
| | | const table = crudRef.value?.getPropRef?.('vehicleId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | console.log(9852); |
| | | |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | vehicleId: active.id, |
| | |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | console.log(555, 'xq1'); |
| | | |
| | | getTmsVehicle(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | console.log(444, 'xq1'); |
| | | |
| | | listTmsVehicle({ |
| | | pageSize: page.pageSize, |
| | | pageNum: page.currentPage, ...data, |
| | |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | console.log(998, 'xq1'); |
| | | |
| | | getTmsVehicle(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | console.log(669, 'xq2'); |
| | | |
| | | listTmsVehicle({ pageSize: page.pageSize, pageNum: page.currentPage, ...data }).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | |
| | | customsServiceProviderName: form.value.customsServiceProviderName |
| | | }; |
| | | }); |
| | | }else if (optionNum.value == 'radio') { |
| | | } else if (optionNum.value == 'radio') { |
| | | result = [{ |
| | | id: form.value.id, |
| | | customsServiceProviderId: form.value.customsServiceProviderId, |
| | |
| | | }) |
| | | } else if (optionType.value === 'loading') { |
| | | |
| | | let result = <any>[]; |
| | | let result = <any>[]; |
| | | if (optionNum.value == 'checkbox') { |
| | | result = clearanceList.value.map(item => { |
| | | return { |
| | |
| | | loadingServiceProviderName: form.value.loadingServiceProviderName |
| | | }; |
| | | }); |
| | | }else if (optionNum.value == 'radio') { |
| | | } else if (optionNum.value == 'radio') { |
| | | result = [{ |
| | | id: form.value.id, |
| | | loadingServiceProviderId: form.value.loadingServiceProviderId, |
| | |
| | | const handleCustomsAdd = (row) => { |
| | | title.value = '补充委托装卸信息'; |
| | | |
| | | clearanceList.value = []; |
| | | clearanceList.value = []; |
| | | // 2. 清除表格视觉上的选中状态 |
| | | if (crudRef.value) { |
| | | crudRef.value.clearSelection(); |