| | |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | icon="Delete" |
| | | icon="Promotion" |
| | | :disabled="pageF.multiple" |
| | | @click="handleGenerate" |
| | | v-hasPermi="['tms:tmsDispatchOrder:generate']" |
| | | >生成应收应付费用 |
| | | </el-button> |
| | | <el-button |
| | | type="warning" |
| | | icon="Female" |
| | | :disabled="pageF.single" |
| | | @click="handleDropHook" |
| | | v-hasPermi="['tms:tmsDispatchOrder:dropHook']" |
| | | >甩挂 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="Male" |
| | | :disabled="pageF.single" |
| | | @click="handleConnectHang" |
| | | v-hasPermi="['tms:tmsDispatchOrder:connectHang']" |
| | | >接挂 |
| | | </el-button> |
| | | |
| | | </template> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog :title="title" v-model="open" class="avue-dialog avue-dialog--top" width="40%"> |
| | | <div v-if="optionType === 'dropHook'"> |
| | | <el-descriptions |
| | | :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.$actualVehicleType}}</el-descriptions-item> |
| | | <el-descriptions-item label="运输工具号码" >{{ form.licensePlate }}</el-descriptions-item> |
| | | <el-descriptions-item label="托架号" >{{ form.shelfCode }}</el-descriptions-item> |
| | | <el-descriptions-item label="主驾驶员" >{{ form.mainDriverName }}</el-descriptions-item> |
| | | <el-descriptions-item label="副驾驶员" >{{ form.assistantDriverName }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | <div v-if="optionType == 'connectHang'"> |
| | | <el-descriptions 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.$actualVehicleType}}</el-descriptions-item> |
| | | <el-descriptions-item label="托架号" >{{ form.shelfCode }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption"> |
| | | |
| | | </avue-form> |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" :loading="pageF.isUploading" @click="submitForm2"> |
| | | {{ pageF.isUploading ? '提交中' : '确 定' }} |
| | | </el-button> |
| | | <el-button @click="cancelBox2">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | </basicContainer> |
| | |
| | | getTmsDispatchOrder, |
| | | listTmsDispatchOrder, |
| | | updateTmsDispatchOrder, |
| | | confirmOrder, copyOrder, okOrder |
| | | confirmOrder, copyOrder, okOrder, initGenerate, generateTmsDispatchOrder, dropHook, connectHang |
| | | } from "@/api/tms/tmsDispatchOrder"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | | import {computed, onMounted, reactive, ref, toRefs, watch} from "vue"; |
| | |
| | | boxTableData: <any>[], |
| | | boxForm: <any>{}, |
| | | boxFormOption: <any>{}, |
| | | boxTableOption: <any>{} |
| | | boxTableOption: <any>{}, |
| | | title: '', |
| | | open: false, |
| | | }) |
| | | const {queryParams, form, page, selectionList, |
| | | boxTableData, optionType, |
| | | boxFormOption,boxForm,boxTableOption |
| | | boxFormOption,boxForm,boxTableOption,title,open |
| | | } = toRefs(data); |
| | | const option = ref({ |
| | | pageKey: 'TmsDispatchOrder', |
| | |
| | | projectName: active.projectName, |
| | | customerId: active.relatedCustomerId, |
| | | customerName: active.relatedCustomerName, |
| | | customerCode: active.relatedCustomerCode, |
| | | contractId: active.relatedContractId, |
| | | contractName: active.relatedContractName, |
| | | }); |
| | |
| | | }, |
| | | mainDriverId: { |
| | | label: '主驾驶员', |
| | | display: true, |
| | | display: true,dataType: 'string', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | licenseType: { |
| | | label: '准驾车型', minWidth: 120, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type', |
| | | search: true, |
| | | search: true,multiple:true, |
| | | }, |
| | | }, |
| | | |
| | |
| | | }, |
| | | assistantDriverId: { |
| | | label: '副驾驶员', |
| | | display: true, |
| | | display: true,dataType: 'string', |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('assistantDriverId')?.$refs?.temp; |
| | | if (!table) return; |
| | |
| | | search: true, |
| | | }, |
| | | licenseType: { |
| | | label: '准驾车型', minWidth: 120, |
| | | label: '准驾车型', minWidth: 120,multiple:true, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type', |
| | | search: true, |
| | | }, |
| | |
| | | |
| | | }, |
| | | requiredVehicleTypes: { |
| | | label: '要求车型', multiple: true, |
| | | label: '要求车型', |
| | | display: true, type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string', |
| | | rules: [ |
| | | { |
| | |
| | | display: true, type: 'select', dicUrl: '/system/dict/data/type/license_type', dataType: 'string', |
| | | }, |
| | | vehicleId: { |
| | | label: '车牌号', |
| | | label: '车牌号',dataType: 'string', |
| | | display: true, |
| | | rules: [ |
| | | { |
| | |
| | | prop: 'shffxrxx', |
| | | column: { |
| | | shipperId: { |
| | | label: '发货人', |
| | | label: '发货人',dataType:'string', |
| | | display: true, |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('shipperId')?.$refs?.temp; |
| | |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | let shipperRegionCode = ''; |
| | | if (active.provinceId){ |
| | | shipperRegionCode = active.provinceId; |
| | | } |
| | | if (active.cityId){ |
| | | shipperRegionCode =shipperRegionCode+ ","+active.cityId; |
| | | |
| | | } |
| | | if (active.districtId){ |
| | | shipperRegionCode =shipperRegionCode+ ","+active.districtId; |
| | | |
| | | } |
| | | if (active.streetId){ |
| | | shipperRegionCode =shipperRegionCode+ ","+active.streetId; |
| | | } |
| | | Object.assign(form.value, { |
| | | shipperId: active.id, |
| | | shipperName: active.consignorName, |
| | | shipperRegionCode: active.regionLabel, |
| | | shipperRegionLabel: active.regionLabel, |
| | | shipperAddress: active.addressDetail, |
| | | shipperMobile: active.contactPhone, |
| | | shipperRegionCode:shipperRegionCode |
| | | }); |
| | | form.value.transportLine = form.value.shipperRegionCode |
| | | + (form.value.receiverRegionCode ? '>' + form.value.receiverRegionCode : ''); |
| | | form.value.transportLine = form.value.shipperRegionLabel |
| | | + (form.value.receiverRegionLabel ? '>' + form.value.receiverRegionLabel : ''); |
| | | } |
| | | }, |
| | | rules: [ |
| | |
| | | } |
| | | |
| | | }, |
| | | shipperRegionCode: { |
| | | shipperRegionLabel: { |
| | | label: '发货人行政区域', |
| | | display: true, disabled: true |
| | | |
| | |
| | | }, |
| | | receiverId: { |
| | | label: '收货人', |
| | | display: true, |
| | | display: true, dataType:'string', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | let receiverRegionCode = ''; |
| | | if (active.provinceId){ |
| | | receiverRegionCode = active.provinceId; |
| | | } |
| | | if (active.cityId){ |
| | | receiverRegionCode =receiverRegionCode+ ","+active.cityId; |
| | | |
| | | } |
| | | if (active.districtId){ |
| | | receiverRegionCode =receiverRegionCode+ ","+active.districtId; |
| | | |
| | | } |
| | | if (active.streetId){ |
| | | receiverRegionCode =receiverRegionCode+ ","+active.streetId; |
| | | } |
| | | |
| | | Object.assign(form.value, { |
| | | receiverId: active.id, |
| | | receiverName: active.consignorName, |
| | | receiverRegionCode: active.regionLabel, |
| | | receiverRegionLabel: active.regionLabel, |
| | | receiverAddress: active.addressDetail, |
| | | receiverMobile: active.contactPhone, |
| | | receiverRegionCode:receiverRegionCode, |
| | | }); |
| | | form.value.transportLine = |
| | | (form.value.shipperRegionCode ? form.value.shipperRegionCode + '>' : '') + form.value.receiverRegionCode; |
| | | (form.value.shipperRegionLabel ? form.value.shipperRegionLabel + '>' : '') + form.value.receiverRegionLabel; |
| | | |
| | | } |
| | | }, |
| | |
| | | } |
| | | |
| | | }, |
| | | receiverRegionCode: { |
| | | receiverRegionLabel: { |
| | | label: '收货人行政区域', |
| | | display: true, disabled: true |
| | | }, |
| | |
| | | column: { |
| | | earliestDeparture: { |
| | | label: '要求最早出发时间', |
| | | type: 'date', valueFormat: 'YYYY-MM-DD', |
| | | type: 'datetime', // 改为 datetime 类型 |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | display: true, |
| | | }, |
| | | latestDeparture: { |
| | | label: '要求最晚出发时间', |
| | | type: 'date', valueFormat: 'YYYY-MM-DD', |
| | | type: 'datetime', // 改为 datetime 类型 |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | display: true, |
| | | }, |
| | | earliestArrival: { |
| | | label: '要求最早到达时间', |
| | | type: 'date', valueFormat: 'YYYY-MM-DD', |
| | | type: 'datetime', // 改为 datetime 类型 |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | display: true, |
| | | }, |
| | | latestArrival: { |
| | | label: '要求最晚到达时间', |
| | | type: 'date', valueFormat: 'YYYY-MM-DD', |
| | | type: 'datetime', // 改为 datetime 类型 |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | display: true, |
| | | }, |
| | | } |
| | |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "应收费用生成状态不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status', |
| | | |
| | | }, |
| | | accountsPayableStatus: { |
| | | label: '应付费用生成状态', minWidth: 160, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "应付费用生成状态不能为空", trigger: "blur" |
| | | } |
| | | ] |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status', |
| | | |
| | | }, |
| | | |
| | | status: { |
| | |
| | | voucherUrl: { |
| | | label: '行程凭证', |
| | | display: true, |
| | | type: 'upload', |
| | | multiple: true, |
| | | span: 24, |
| | | propsHttp: { |
| | | url: 'url', |
| | | name: 'name', |
| | | res: 'data' |
| | | accept:'string',dataType: 'string', |
| | | type: 'upload', |
| | | action: '/common/upload2', |
| | | propsHttp:{ |
| | | home:'url', |
| | | name:'newFileName', |
| | | }, |
| | | }, |
| | | dataSource: { |
| | |
| | | voucherUrl: { |
| | | label: '行程凭证', |
| | | display: true, |
| | | span: 24, |
| | | accept:'string',dataType: 'string', |
| | | type: 'upload', |
| | | action: '/common/upload2', |
| | | propsHttp:{ |
| | | home:'url', |
| | | name:'newFileName', |
| | | }, |
| | | }, |
| | | |
| | | } |
| | |
| | | voucherUrl: { |
| | | label: '行程凭证', |
| | | display: true, |
| | | type: 'upload', |
| | | multiple: true, |
| | | span: 24, |
| | | propsHttp: { |
| | | url: 'url', |
| | | name: 'name', |
| | | res: 'data' |
| | | accept:'string',dataType: 'string', |
| | | type: 'upload', |
| | | action: '/common/upload2', |
| | | propsHttp:{ |
| | | home:'url', |
| | | name:'newFileName', |
| | | }, |
| | | }, |
| | | dataSource: { |
| | |
| | | feeVoucherUrl: { |
| | | label: '费用凭证', |
| | | display: true, |
| | | span: 24, |
| | | accept:'string',dataType: 'string', |
| | | type: 'upload', |
| | | action: '/common/upload2', |
| | | propsHttp:{ |
| | | home:'url', |
| | | name:'newFileName', |
| | | }, |
| | | }, |
| | | |
| | | } |
| | |
| | | addBtn: false, |
| | | header: false, selection: false, |
| | | column: { |
| | | accountsReceivableName: { |
| | | collectionPlanName: { |
| | | label: '匹配应收方案名称', minWidth: 160, |
| | | }, |
| | | accountsPayableName: { |
| | | label: '匹配应付方案名称', minWidth: 160, |
| | | }, |
| | | accountsReceivableStatus: { |
| | | label: '应收费用生成状态', minWidth: 160, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status', |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status', |
| | | }, |
| | | paymentPlanName: { |
| | | label: '匹配应付方案名称', minWidth: 160, |
| | | }, |
| | | |
| | | accountsPayableStatus: { |
| | | label: '应付费用生成状态', minWidth: 160, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/tms_dispatch_order_status', |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/accounts_status', |
| | | }, |
| | | dispatchNo: { |
| | | label: '调度单号', minWidth: 120, |
| | |
| | | |
| | | } |
| | | }) |
| | | const connectHangOption = ref({ |
| | | menuBtn: false, |
| | | labelWidth: 120, |
| | | column: { |
| | | vehicleId: { |
| | | label: '接挂车辆号码', |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "接挂车辆号码不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | serviceProviderName: { |
| | | label: '车辆服务商', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | vehicleType: { |
| | | label: '车辆类型', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | internalCode: { |
| | | label: '车辆内部编码', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | licensePlate: { |
| | | label: '车牌号', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | licenseHk: { |
| | | label: '香港牌照', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | licenseMo: { |
| | | label: '澳门牌照', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'licensePlate', |
| | | value: 'id' |
| | | }, |
| | | onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsVehicle(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsVehicle({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | driverId: { |
| | | label: '接挂司机', |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "接挂司机不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | vehicleProviderName: { |
| | | label: '车辆服务商', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | driverName: { |
| | | label: '驾驶员姓名', minWidth: 120, |
| | | search: true, |
| | | }, |
| | | licenseType: { |
| | | label: '准驾车型', minWidth: 120, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/license_type', |
| | | search: true,multiple:true, |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'driverName', |
| | | value: 'id' |
| | | }, |
| | | onLoad: ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsDriver(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | |
| | | } |
| | | }) |
| | | |
| | | const { |
| | | tableData, |
| | |
| | | } |
| | | |
| | | const handleGenerate = () => { |
| | | optionType.value = 'generate'; |
| | | pageF.open = true; |
| | | pageF.title = '生成应收应付费用数据'; |
| | | boxTableOption.value = generateTableOption.value; |
| | | let ids = selectionList.value.map((item:any) => item.id); |
| | | initGenerate(ids).then(res => { |
| | | boxTableData.value = res.data|| []; |
| | | optionType.value = 'generate'; |
| | | pageF.open = true; |
| | | pageF.title = '生成应收应付费用数据'; |
| | | boxTableOption.value = generateTableOption.value; |
| | | }) |
| | | } |
| | | |
| | | const submitGenerate = () => { |
| | | |
| | | pageF.isUploading = true; |
| | | let ids = selectionList.value.map((item:any) => item.id); |
| | | |
| | | generateTmsDispatchOrder(ids).then(res => { |
| | | pageF.isUploading = false; |
| | | ElMessage({ |
| | | message: "操作成功!", |
| | | type: 'success' |
| | | }) |
| | | cancelBox(); |
| | | onLoad(page.value); |
| | | }).finally(()=>{ |
| | | pageF.isUploading = false; |
| | | }) |
| | | } |
| | | /** |
| | | * 甩挂 |
| | | */ |
| | | const handleDropHook = () => { |
| | | title.value = '调度单甩挂'; |
| | | open.value = true; |
| | | form.value = selectionList.value[0]; |
| | | optionType.value = 'dropHook'; |
| | | |
| | | } |
| | | /** |
| | | * 接挂 |
| | | */ |
| | | const handleConnectHang = () => { |
| | | title.value = '调度单接挂'; |
| | | open.value = true; |
| | | form.value = selectionList.value[0]; |
| | | optionType.value = 'connectHang'; |
| | | boxFormOption.value = connectHangOption.value; |
| | | } |
| | | const submitForm2 = () => { |
| | | pageF.isUploading = true; |
| | | if (optionType.value === 'dropHook') { |
| | | dropHook(form.value.id).then(res => { |
| | | ElMessage({ |
| | | message: "提交成功!", |
| | | type: 'success' |
| | | }) |
| | | cancelBox2(); |
| | | onLoad(page.value); |
| | | }).finally(()=>{ |
| | | pageF.isUploading = false; |
| | | }) |
| | | }else{ |
| | | connectHang({ |
| | | dispatchId:form.value.id, |
| | | vehicleId:form.value.vehicleId, |
| | | driverId:form.value.driverId |
| | | }).then(res => { |
| | | ElMessage({ |
| | | message: "提交成功!", |
| | | type: 'success' |
| | | }) |
| | | cancelBox2(); |
| | | onLoad(page.value); |
| | | }).finally(()=>{ |
| | | pageF.isUploading = false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | onMounted(() => { |
| | | |
| | | |
| | | }); |
| | | const cancelBox2 = () => { |
| | | open.value = false; |
| | | } |
| | | </script> |