| | |
| | | >接挂 |
| | | </el-button> |
| | | |
| | | <el-button |
| | | type="warning" |
| | | icon="Avatar" |
| | | :disabled="!( isCustoms == 0)" |
| | | @click="handleCustoms" |
| | | v-hasPermi="['tms:tmsDispatchOrder:customs']" |
| | | >委托报关信息 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="UserFilled" |
| | | :disabled="!( isLoad == 0)" |
| | | @click="handleLoading" |
| | | v-hasPermi="['tms:tmsDispatchOrder:loading']" |
| | | >委托卸货信息 |
| | | </el-button> |
| | | </template> |
| | | <template #menu-before="{row}"> |
| | | <el-link size="small" type="primary" @click="handleAddGoods(row)" class="link-btn" |
| | |
| | | |
| | | </avue-form> |
| | | </div> |
| | | |
| | | <div v-if="optionType == 'customs'"> |
| | | <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.projectName }}</el-descriptions-item> |
| | | <el-descriptions-item label="运输路线">{{ form.transportLine }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <avue-form v-model="form" ref="boxFormRef" :option="boxFormOption"> |
| | | |
| | | </avue-form> |
| | | </div> |
| | | |
| | | <div v-if="optionType == 'loading'"> |
| | | <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.projectName }}</el-descriptions-item> |
| | | <el-descriptions-item label="运输路线">{{ form.transportLine }}</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"> |
| | |
| | | getTmsDispatchOrder, |
| | | listTmsDispatchOrder, |
| | | updateTmsDispatchOrder, |
| | | confirmOrder, copyOrder, okOrder, initGenerate, generateTmsDispatchOrder, dropHook, connectHang |
| | | confirmOrder, copyOrder, okOrder, initGenerate, generateTmsDispatchOrder, dropHook, connectHang,customsOrder,loadingOrder, |
| | | } from "@/api/tms/tmsDispatchOrder"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | | import {computed, onMounted, reactive, ref, toRefs, watch, getCurrentInstance} from "vue"; |
| | |
| | | goodsForm: <any>{}, |
| | | open3: false, |
| | | actualForm: <any>{}, |
| | | isCustoms:<any> -1, |
| | | isLoad: -1, |
| | | }) |
| | | const { |
| | | queryParams, form, page, selectionList, open3, |
| | | boxTableData, optionType, |
| | | boxFormOption, boxForm, boxTableOption, title, open, open2, |
| | | goodsTableData, goodsForm, actualForm, selectionList2 |
| | | goodsTableData, goodsForm, actualForm, selectionList2,isCustoms,isLoad |
| | | } = toRefs(data); |
| | | const option = ref({ |
| | | pageKey: 'TmsDispatchOrder', |
| | |
| | | message: "请选择运输路线", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search', |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('quoteDetailId')?.$refs?.temp; |
| | | if (!table) return; |
| | |
| | | } |
| | | ], |
| | | }, |
| | | isLoad: { |
| | | label: '委托装卸', |
| | | display: true, |
| | | type: 'radio', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "委托装卸不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | isUrgent: { |
| | | label: '是否紧急', |
| | | display: true, |
| | |
| | | console.log(value) |
| | | option.value.group.forEach((item: any) => { |
| | | if (item.prop == 'pcxx') { |
| | | item.column.vehicleProviderId.rules.forEach((cItem: any) => { |
| | | cItem.required = value == 1; |
| | | }); |
| | | item.column.commissionModel.display = value != 1; |
| | | item.column.vehicleProviderId.display = value == 1; |
| | | // item.column.vehicleProviderId.rules.forEach((cItem: any) => { |
| | | // cItem.required = value == 1; |
| | | // }); |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | commissionModel:{ |
| | | label: '提成模式', |
| | | display: true, type: 'radio', dicUrl: '/system/dict/data/type/commission_model', dataType: 'string', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "提成模式不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | }, |
| | | vehicleProviderId: { |
| | | label: '车辆服务商', |
| | |
| | | }); |
| | | } |
| | | }, |
| | | type: 'table', suffixIcon: 'search', |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | type: 'table', suffixIcon: 'search', |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | |
| | | }); |
| | | } |
| | | }, |
| | | type: 'table', suffixIcon: 'search', |
| | | type: 'table', suffixIcon: 'search',dataType: 'string', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | |
| | | } |
| | | }) |
| | | |
| | | |
| | | const customsOption = ref({ |
| | | menuBtn: false, |
| | | labelWidth: 120, |
| | | column: { |
| | | customsServiceProviderId: { |
| | | label: '报关服务商', span:24, |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "报关服务商不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search', dataType: 'string', |
| | | change: (val: any) => { |
| | | const table = boxFormRef.value?.getPropRef?.('customsServiceProviderId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | customsServiceProviderId: active.id, |
| | | customsServiceProviderName: active.serviceShortName, |
| | | }); |
| | | } |
| | | }, |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column:{ |
| | | serviceCode: { |
| | | label: '服务商编码', |
| | | search: true, |
| | | }, |
| | | serviceShortName: { |
| | | label: '服务商简称',minWidth:150, |
| | | search: true, |
| | | }, |
| | | serviceName: { |
| | | label: '服务商全称',search: true, |
| | | }, |
| | | serviceType: { |
| | | label: '服务类型',minWidth:150, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type', |
| | | multiple:true, |
| | | search: true, |
| | | }, |
| | | } |
| | | }, |
| | | props: { |
| | | label: 'serviceShortName', |
| | | 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] |
| | | } |
| | | getTmsCustomsServiceProvider(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsCustomsServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | } |
| | | }) |
| | | |
| | | |
| | | const loadingOption = ref({ |
| | | menuBtn: false, |
| | | labelWidth: 120, |
| | | column: { |
| | | loadingServiceProviderId: { |
| | | label: '装卸服务商',span:24, |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "装卸服务商不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search', dataType: 'string', |
| | | change: (val: any) => { |
| | | const table = boxFormRef.value?.getPropRef?.('loadingServiceProviderId')?.$refs?.temp; |
| | | if (!table) return; |
| | | let active = table.active; |
| | | if (Array.isArray(active)) active = active[0]; |
| | | if (active) { |
| | | Object.assign(form.value, { |
| | | loadingServiceProviderId: active.id, |
| | | loadingServiceProviderName: active.serviceShortName, |
| | | }); |
| | | } |
| | | }, |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column:{ |
| | | serviceCode: { |
| | | label: '服务商编码', |
| | | search: true, |
| | | }, |
| | | serviceShortName: { |
| | | label: '服务商简称',minWidth:150, |
| | | search: true, |
| | | }, |
| | | serviceName: { |
| | | label: '服务商全称',search: true, |
| | | }, |
| | | serviceType: { |
| | | label: '服务类型',minWidth:150, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/service_type', |
| | | multiple:true, |
| | | search: true, |
| | | }, |
| | | } |
| | | }, |
| | | props: { |
| | | label: 'serviceShortName', |
| | | 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] |
| | | } |
| | | getTmsLoadingServiceProvider(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsLoadingServiceProvider({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | const goodsTableOption = ref({ |
| | | pageKey: 'TmsGoodsDetail', |
| | | rowKey: 'id', |
| | |
| | | }, |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | | selectionList.value = selection; |
| | | if (selection.length > 0){ |
| | | isCustoms.value = selection[0].isCustoms; |
| | | isLoad.value = selection[0].isLoad ; |
| | | }else{ |
| | | isCustoms.value = -1; |
| | | isLoad.value = -1; |
| | | } |
| | | isCustoms.value = isCustoms.value == 0 && !pageF.single ? 0 : -1; |
| | | isLoad.value = isLoad.value == 0 && !pageF.single ? 0 : -1; |
| | | console.log(pageF.single) |
| | | }, |
| | | getBeginListFunc: () => { |
| | | queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.createTimeRange, 'createTime') || {}; |
| | | queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.updateTimeRange, 'updateTime') || {}; |
| | | queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.confirmTimeRange, 'confirmTime') || {}; |
| | | queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.okTimeRange, 'okTime') || {}; |
| | | } |
| | | }, |
| | | |
| | | }) |
| | | const handleConfirm = (row: any) => { |
| | | ElMessageBox.confirm("是否对调度单号" + row.dispatchNo + "确定 ?", '系统提示', { |
| | |
| | | }).finally(() => { |
| | | pageF.isUploading = false; |
| | | }) |
| | | } else { |
| | | }else if (optionType.value === 'customs') { |
| | | customsOrder(form.value.id).then(res => { |
| | | ElMessage({ |
| | | message: "提交成功!", |
| | | type: 'success' |
| | | }) |
| | | cancelBox2(); |
| | | onLoad(page.value); |
| | | }).finally(() => { |
| | | pageF.isUploading = false; |
| | | }) |
| | | }else if (optionType.value === 'loading') { |
| | | loadingOrder(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, |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | const handleCustoms = () => { |
| | | title.value = '补充委托报关信息'; |
| | | open.value = true; |
| | | form.value = selectionList.value[0]; |
| | | optionType.value = 'customs'; |
| | | boxFormOption.value = customsOption.value; |
| | | } |
| | | const handleLoading = () => { |
| | | title.value = '补充委托装卸信息'; |
| | | open.value = true; |
| | | form.value = selectionList.value[0]; |
| | | optionType.value = 'loading'; |
| | | boxFormOption.value = loadingOption.value; |
| | | } |
| | | </script> |