| | |
| | | </template> |
| | | <template #menu-before="{row}"> |
| | | <el-link size="small" type="primary" @click="handleAddGoods(row)" class="link-btn" |
| | | v-hasPermi="['tms:tmsGoodsDetail:add']" |
| | | :underline="false" icon="el-icon-document-add">运输货品登记 |
| | | </el-link> |
| | | <el-link size="small" type="primary" @click="handleActual(row)" class="link-btn" |
| | | v-hasPermi="['tms:tmsDispatchOrder:update']" |
| | | :underline="false" icon="el-icon-set-up">实际运输记录 |
| | | </el-link> |
| | | <el-link size="small" type="primary" v-if="row.status == 0" @click="handleConfirm(row)" class="link-btn" |
| | | v-hasPermi="['tms:tmsDispatchOrder:confirmOrder']" |
| | | :underline="false" icon="el-icon-pointer">确定 |
| | | </el-link> |
| | | <el-link size="small" type="primary" @click="handleCopy(row)" class="link-btn" :underline="false" |
| | | v-hasPermi="['tms:tmsDispatchOrder:copyOrder']" |
| | | icon="el-icon-connection">复制 |
| | | </el-link> |
| | | <el-link size="small" type="primary" v-if="[1,2].includes(row.status)" @click="handleUploadItinerary(row)" |
| | | v-hasPermi="['tms:tmsTrip:add']" |
| | | class="link-btn" :underline="false" icon="el-icon-upload">上传行程 |
| | | </el-link> |
| | | <el-link size="small" type="primary" v-if="![0,1].includes(row.status)" @click="handleLogItinerary(row)" |
| | | v-hasPermi="['tms:tmsTrip:list']" |
| | | class="link-btn" :underline="false" icon="el-icon-view">查看行程 |
| | | </el-link> |
| | | <el-link size="small" type="primary" v-if="[2].includes(row.status)" @click="handleOk(row)" class="link-btn" |
| | | v-hasPermi="['tms:tmsDispatchOrder:okOrder']" |
| | | :underline="false" icon="el-icon-circle-check">完成行程 |
| | | </el-link> |
| | | <el-link size="small" type="primary" v-if="[2,3].includes(row.status)" @click="handleAddFinance(row)" class="link-btn" |
| | | <el-link size="small" type="primary" v-if="[2,3].includes(row.status)" @click="handleAddFinance(row)" |
| | | class="link-btn" v-hasPermi="['tms:tmsFinanceDetail:add']" |
| | | :underline="false" icon="el-icon-edit-pen">费用登记 |
| | | </el-link> |
| | | </template> |
| | |
| | | icon="el-icon-tickets">日志 |
| | | </el-link> |
| | | </template> |
| | | |
| | | <template #shipperId-form> |
| | | <div style="display:flex; align-items: center;justify-content: space-between"> |
| | | <avue-input-table :props="consignorProps" |
| | | :children="consignorOption" |
| | | :on-load="onShipperLoad" suffixIcon="search" |
| | | v-model="form.shipperId" style="width: 80%" |
| | | @change="changeShipper" |
| | | placeholder="请选择装货点"></avue-input-table> |
| | | <el-button icon="plus" @click="handleAddShipper"></el-button> |
| | | </div> |
| | | </template> |
| | | <template #receiverId-form> |
| | | <div style="display:flex; align-items: center;justify-content: space-between"> |
| | | <avue-input-table :props="consignorProps" |
| | | :children="consignorOption" |
| | | :on-load="onConsignorLoad" suffixIcon="search" |
| | | v-model="form.receiverId" |
| | | @change="changeReceiver" style="width: 80%" |
| | | placeholder="请选择卸货点"></avue-input-table> |
| | | <el-button icon="plus" @click="handleAddReceiver"></el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | <el-dialog :title="pageF.title" v-model="pageF.open" class="avue-dialog avue-dialog--top" width="80%"> |
| | | <h2 v-if="optionType == 'addFinance'">报价费用</h2> |
| | |
| | | @selection-change="selectionChange2" |
| | | > |
| | | <template #count="{row}"> |
| | | <el-input-number v-model="row.count" @change="countChange(row)" placeholder="请输入计费数量" min="0"></el-input-number> |
| | | <el-input-number v-model="row.count" @change="countChange(row)" placeholder="请输入计费数量" |
| | | min="0"></el-input-number> |
| | | </template> |
| | | </avue-crud> |
| | | <h2 v-if="optionType == 'addFinance'">实报实销费用</h2> |
| | | <avue-form v-if="optionType == 'addItinerary' || optionType == 'addFinance'" v-model="boxForm" ref="boxFormRef" :option="boxFormOption"> |
| | | <avue-form v-if="optionType == 'addItinerary' || optionType == 'addFinance'" v-model="boxForm" ref="boxFormRef" |
| | | :option="boxFormOption"> |
| | | |
| | | </avue-form> |
| | | <avue-crud |
| | |
| | | </avue-crud> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" v-if="optionType == 'addItinerary' || optionType == 'addFinance'" :loading="pageF.isUploading" @click="submitForm"> |
| | | <el-button type="primary" v-if="optionType == 'addItinerary' || optionType == 'addFinance'" |
| | | :loading="pageF.isUploading" @click="submitForm"> |
| | | {{ pageF.isUploading ? '提交中' : '确 定' }} |
| | | </el-button> |
| | | |
| | | <el-button type="primary" v-if="optionType == 'generate' " :loading="pageF.isUploading" @click="submitGenerate"> |
| | | <el-button type="primary" v-if="optionType == 'generate' " :loading="pageF.isUploading" |
| | | @click="submitGenerate"> |
| | | {{ pageF.isUploading ? '生成中' : '生成费用' }} |
| | | </el-button> |
| | | <el-button @click="cancelBox">取 消</el-button> |
| | |
| | | </el-dialog> |
| | | |
| | | |
| | | |
| | | </basicContainer> |
| | | </template> |
| | | |
| | |
| | | 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"; |
| | | import {computed, onMounted, reactive, ref, toRefs, watch, getCurrentInstance} from "vue"; |
| | | import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface"; |
| | | import {usePagePlus} from "@/hooks/usePagePlus"; |
| | | import {hasPermission} from "@/utils/permissionUtils"; |
| | |
| | | import {getTmsVehicle, listTmsVehicle} from "@/api/tms/tmsVehicle"; |
| | | import {getTmsContainer, listTmsContainer} from "@/api/tms/tmsContainer"; |
| | | import {getTmsShelf, listTmsShelf} from "@/api/tms/tmsShelf"; |
| | | import {getTmsConsignor, listTmsConsignor} from "@/api/tms/tmsConsignor"; |
| | | import {addTmsConsignor, getTmsConsignor, listTmsConsignor} from "@/api/tms/tmsConsignor"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {addTmsTrip, listTmsTrip} from "@/api/tms/tmsTrip"; |
| | | import {addTmsFinanceDetail, listTmsFinanceDetail, updateTmsFinanceDetail} from "@/api/tms/tmsFinanceDetail"; |
| | |
| | | import {addTmsGoodsDetail, delTmsGoodsDetail, listTmsGoodsDetail, updateTmsGoodsDetail} from "@/api/tms/tmsGoodsDetail"; |
| | | import {getTransportRouteVi, listTransportRouteVi} from "@/api/tms/tmsTransportRouteVi"; |
| | | import {listTmsQuoteItem} from "@/api/tms/tmsQuotePlanItem"; |
| | | import {$DialogForm} from '@smallwei/avue' |
| | | import {getTmsCustomerInfo, listTmsCustomerInfo} from "@/api/tms/tmsCustomerInfo"; |
| | | import {getAddressCode} from "@/api/tms/tmsRegion"; |
| | | import {mapRegeo} from "@/api/common"; |
| | | |
| | | const {appContext} = getCurrentInstance(); |
| | | |
| | | const {proxy} = useCurrentInstance(); |
| | | const crudRef = ref(); |
| | |
| | | open3: false, |
| | | actualForm:<any>{}, |
| | | }) |
| | | const {queryParams, form, page, selectionList,open3, |
| | | const { |
| | | queryParams, form, page, selectionList, open3, |
| | | boxTableData, optionType, |
| | | boxFormOption,boxForm,boxTableOption,title,open,open2, |
| | | goodsTableData,goodsForm,actualForm,selectionList2 |
| | |
| | | }, |
| | | |
| | | |
| | | |
| | | } |
| | | }, |
| | | { |
| | |
| | | option.value.group.forEach((item:any) =>{ |
| | | if (item.prop == 'pcxx'){ |
| | | item.column.vehicleProviderId.rules.forEach((cItem:any)=>{ |
| | | cItem.required = value != 1; |
| | | cItem.required = value == 1; |
| | | }) ; |
| | | } |
| | | }) |
| | |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data,carrierType:form.value.operationMode}).then(res => { |
| | | listTmsDriver({ |
| | | pageSize: page.pageSize, |
| | | pageNum: page.currentPage, ...data, |
| | | carrierType: form.value.operationMode |
| | | }).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsDriver({pageSize: page.pageSize, pageNum: page.currentPage, ...data,carrierType:form.value.operationMode}).then(res => { |
| | | listTmsDriver({ |
| | | pageSize: page.pageSize, |
| | | pageNum: page.currentPage, ...data, |
| | | carrierType: form.value.operationMode |
| | | }).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsVehicle({pageSize: page.pageSize, pageNum: page.currentPage, ...data,carrierType:form.value.operationMode}).then(res => { |
| | | listTmsVehicle({ |
| | | pageSize: page.pageSize, |
| | | pageNum: page.currentPage, ...data, |
| | | carrierType: form.value.operationMode |
| | | }).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | |
| | | shipperId: { |
| | | label: '装货点',dataType:'string', |
| | | display: true, |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('shipperId')?.$refs?.temp; |
| | | if (!table) return; |
| | | 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, |
| | | shipperRegionLabel: active.regionLabel, |
| | | shipperAddress: active.addressDetail, |
| | | shipperMobile: active.contactPhone, |
| | | shipperRegionCode:shipperRegionCode |
| | | }); |
| | | } |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: false, |
| | | message: "装货点不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | type: 'table', suffixIcon: 'search', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | consignorCode: { |
| | | label: '收装货点编码', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | consignorName: { |
| | | label: '收装货点名称', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | consignorType: { |
| | | label: '收装货点类型', minWidth: 80, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type', |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | contactName: { |
| | | label: '联系人姓名', minWidth: 110, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | contactPhone: { |
| | | label: '联系人电话', minWidth: 110, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | regionLabel: { |
| | | label: '行政区域', minWidth: 180, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'consignorName', |
| | | 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] |
| | | } |
| | | getTmsConsignor(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | if (form.value.startRegionCode) { |
| | | const split = form.value.startRegionCode.split(','); |
| | | const [provinceId, cityId, districtId, streetId] = split; |
| | | |
| | | if (provinceId) data.provinceId = provinceId; |
| | | if (cityId) data.cityId = cityId; |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | console.log(form.value.startRegionCode) |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | |
| | | }, |
| | | shipperRegionLabel: { |
| | |
| | | message: "卸货点不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | change: (val: any) => { |
| | | const table = crudRef.value?.getPropRef?.('receiverId')?.$refs?.temp; |
| | | if (!table) return; |
| | | 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, |
| | | receiverRegionLabel: active.regionLabel, |
| | | receiverAddress: active.addressDetail, |
| | | receiverMobile: active.contactPhone, |
| | | receiverRegionCode:receiverRegionCode, |
| | | }); |
| | | } |
| | | }, |
| | | type: 'table', suffixIcon: 'search', |
| | | children: { |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | consignorCode: { |
| | | label: '收装货点编码', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | consignorName: { |
| | | label: '收装货点名称', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | consignorType: { |
| | | label: '收装货点类型', minWidth: 80, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type', |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | contactName: { |
| | | label: '联系人姓名', minWidth: 110, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | contactPhone: { |
| | | label: '联系人电话', minWidth: 110, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | regionLabel: { |
| | | label: '行政区域', minWidth: 180, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | }, |
| | | |
| | | }, |
| | | props: { |
| | | label: 'consignorName', |
| | | 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] |
| | | } |
| | | getTmsConsignor(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | if (form.value.endRegionCode) { |
| | | const split = form.value.endRegionCode.split(','); |
| | | const [provinceId, cityId, districtId, streetId] = split; |
| | | |
| | | if (provinceId) data.provinceId = provinceId; |
| | | if (cityId) data.cityId = cityId; |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | } |
| | | |
| | | }, |
| | | receiverRegionLabel: { |
| | | label: '卸货点行政区域', |
| | |
| | | hide: false, |
| | | search: false, |
| | | }, |
| | | |
| | | updateTimeRange: { |
| | | label: '更新时间', display: false, search: true, searchRange: true, type: 'date', |
| | | format: 'YYYY-MM-DD', hide: true, searchSpan: 5, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | confirmTimeRange: { |
| | | label: '确认时间', display: false, search: true, searchRange: true, type: 'date', |
| | | format: 'YYYY-MM-DD', hide: true, searchSpan: 5, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | okTimeRange: { |
| | | label: '完成时间', display: false, search: true, searchRange: true, type: 'date', |
| | | format: 'YYYY-MM-DD', hide: true, searchSpan: 5, |
| | | valueFormat: 'YYYY-MM-DD', |
| | | }, |
| | | |
| | | } |
| | | }) |
| | |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | listTmsProductInfo({pageSize: page.pageSize, |
| | | listTmsProductInfo({ |
| | | pageSize: page.pageSize, |
| | | pageNum: page.currentPage, |
| | | ...data, |
| | | customerId:form.value.customerId |
| | | // customerId:form.value.customerId |
| | | }).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | |
| | | editDisplay :true, |
| | | viewDisplay :true, |
| | | } |
| | | }}) |
| | | } |
| | | }) |
| | | |
| | | const actualFormOption = ref({ |
| | | menuBtn: false, labelWidth: 140, |
| | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | const consignorOption = ref({ |
| | | border: true, |
| | | searchLabelWidth: 100, |
| | | searchMenuSpan: 5, |
| | | column: { |
| | | consignorCode: { |
| | | label: '收装货点编码', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | consignorName: { |
| | | label: '收装货点名称', minWidth: 130, |
| | | search: true, |
| | | }, |
| | | consignorType: { |
| | | label: '收装货点类型', minWidth: 80, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type', |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | contactName: { |
| | | label: '联系人姓名', minWidth: 110, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | contactPhone: { |
| | | label: '联系人电话', minWidth: 110, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | regionLabel: { |
| | | label: '行政区域', minWidth: 180, |
| | | display: false, |
| | | hide: false, |
| | | search: true, |
| | | }, |
| | | }, |
| | | }) |
| | | const consignorProps = ref({ |
| | | label: 'consignorName', |
| | | value: 'id' |
| | | }) |
| | | |
| | | |
| | | const itemsCrudRef =ref() |
| | | const itemsTableData = ref<any>([]) |
| | | |
| | |
| | | }, |
| | | handleSelectionChangeFunc: (selection: any) => { |
| | | selectionList.value = selection; |
| | | }, |
| | | 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) => { |
| | |
| | | |
| | | listTmsFinanceDetail({ |
| | | dispatchOrderId: row.id,financeType:2, |
| | | pageNum: 1, pageSize: 999}).then(res => { |
| | | pageNum: 1, pageSize: 999 |
| | | }).then(res => { |
| | | |
| | | |
| | | boxTableData.value = res.rows || []; |
| | |
| | | }) |
| | | } |
| | | const rowGoodsDel = (row:any) => { |
| | | ElMessageBox.confirm("确定将选择数据删除?", '系统提示', {confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning'}).then(() => { |
| | | ElMessageBox.confirm("确定将选择数据删除?", '系统提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | return delTmsGoodsDetail(row.id); |
| | | }).then(() => { |
| | | handleAddGoods(form.value); |
| | |
| | | selectionList2.value = selection; |
| | | } |
| | | |
| | | const onShipperLoad = ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsConsignor(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | if (form.value.startRegionCode) { |
| | | const split = form.value.startRegionCode.split(','); |
| | | const [provinceId, cityId, districtId, streetId] = split; |
| | | |
| | | if (provinceId) data.provinceId = provinceId; |
| | | if (cityId) data.cityId = cityId; |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | const onConsignorLoad = ({page, value, data}: { page: any, value: any, data: any }, callback: any) => { |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsConsignor(id).then(res => { |
| | | return callback(res.data || {}) |
| | | }) |
| | | } else { |
| | | if (form.value.endRegionCode) { |
| | | const split = form.value.endRegionCode.split(','); |
| | | const [provinceId, cityId, districtId, streetId] = split; |
| | | |
| | | if (provinceId) data.provinceId = provinceId; |
| | | if (cityId) data.cityId = cityId; |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | | data: res.rows || [], |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | const changeShipper = ({value}: any) => { |
| | | |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsConsignor(id).then(res => { |
| | | let active = res.data || {}; |
| | | 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, |
| | | shipperRegionLabel: active.regionLabel, |
| | | shipperAddress: active.addressDetail, |
| | | shipperMobile: active.contactPhone, |
| | | shipperRegionCode: shipperRegionCode |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | const changeReceiver = ({value}: any) => { |
| | | |
| | | if (value) { |
| | | let id = value; |
| | | if (Array.isArray(value)) { |
| | | id = value[0] |
| | | } |
| | | getTmsConsignor(id).then(res => { |
| | | let active = res.data || {}; |
| | | 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, |
| | | receiverRegionLabel: active.regionLabel, |
| | | receiverAddress: active.addressDetail, |
| | | receiverMobile: active.contactPhone, |
| | | receiverRegionCode: receiverRegionCode, |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | const consignorAddOption =ref({ |
| | | labelWidth: 120, |
| | | group: [ |
| | | { |
| | | label: '基础信息', |
| | | prop: 'jcxx', |
| | | column:{ |
| | | // consignorCode: { |
| | | // label: '装卸货点编码',minWidth: 150, |
| | | // addDisplay: false, disabled: true, |
| | | // editDisplay: true, |
| | | // viewDisplay: true, |
| | | // hide: false, |
| | | // search: true, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "装卸货点编码不能为空", trigger: "blur" |
| | | // } |
| | | // ], |
| | | // }, |
| | | consignorName: { |
| | | label: '装卸货点名称',minWidth: 150, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "装卸货点名称不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | customerName:{ |
| | | label: '所属客户',minWidth: 150,disabled: true, |
| | | }, |
| | | // customerId: { |
| | | // label: '所属客户',minWidth: 150, |
| | | // addDisplay: true, |
| | | // editDisplay: true,suffixIcon:'search', |
| | | // viewDisplay: true, |
| | | // hide: true, |
| | | // search: true, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "所属客户不能为空", trigger: "change" |
| | | // } |
| | | // ], |
| | | // type: 'table', |
| | | // children:{ |
| | | // border: true, |
| | | // searchMenuSpan: 5, |
| | | // column:{ |
| | | // customerType: { |
| | | // label: '客户类型', minWidth: 120, |
| | | // type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/customer_type', |
| | | // search: true, |
| | | // }, |
| | | // customerShortName: { |
| | | // label: '客户简称', minWidth: 130, |
| | | // search: true, |
| | | // }, |
| | | // customerCode: { |
| | | // label: '客户编号',minWidth: 120, |
| | | // search: true, |
| | | // }, |
| | | // contactName: { |
| | | // label: '联系人姓名',minWidth: 120, |
| | | // }, |
| | | // signCompanyName: { |
| | | // label: '签约公司', minWidth: 150, |
| | | // }, |
| | | // }, |
| | | // |
| | | // }, |
| | | // props:{ |
| | | // label: 'customerShortName', |
| | | // 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] |
| | | // } |
| | | // getTmsCustomerInfo(id).then(res=>{ |
| | | // return callback(res.data||{}) |
| | | // }) |
| | | // }else{ |
| | | // listTmsCustomerInfo({pageSize:page.pageSize,pageNum:page.currentPage,...data}).then(res=>{ |
| | | // return callback({ |
| | | // total: res.total, |
| | | // data: res.rows||[], |
| | | // }) |
| | | // }) |
| | | // } |
| | | // |
| | | // }, |
| | | // change: ({value}: any) => { |
| | | // if(value){ |
| | | // getTmsCustomerInfo(value).then(res=>{ |
| | | // let active = res.data || {}; |
| | | // if (active){ |
| | | // console.log(dialForm.value) |
| | | // form2.value.customerId = active.id |
| | | // form2.value.customerSysCode = active.customerCode |
| | | // form2.value.customerName = active.customerShortName |
| | | // } |
| | | // }) |
| | | // } |
| | | // }, |
| | | // }, |
| | | // customerSysCode: { |
| | | // label: '客户编码',minWidth: 150, |
| | | // addDisplay: true, |
| | | // editDisplay: true, |
| | | // viewDisplay: true, |
| | | // hide: false, |
| | | // search: true, |
| | | // disabled: true, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "客户编码不能为空", trigger: "blur" |
| | | // } |
| | | // ], |
| | | // }, |
| | | consignorType: { |
| | | label: '装卸货点类型',minWidth: 150, |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/consignor_type', |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "装卸货点类型不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | label: '联系人信息', |
| | | prop: 'lxrxx', |
| | | column:{ |
| | | contactName: { |
| | | label: '联系人姓名',minWidth: 150, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "联系人姓名不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | contactPhone: { |
| | | label: '联系人电话',minWidth: 150, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | | }, |
| | | contactEmail: { |
| | | label: '联系人邮箱',minWidth: 150, |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | label: '地址信息', |
| | | prop: 'dzxx', |
| | | column:{ |
| | | |
| | | mapLocationDetail: { |
| | | label: '地图位置',minWidth: 150, |
| | | addDisplay: true, |
| | | editDisplay: true,span:24, |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | | type: 'map', |
| | | // mapChange: async (params:any)=>{ |
| | | // if (params.info === "OK") { |
| | | // let { province, city, district, township } = params.regeocode.addressComponent || {}; |
| | | // const res = await getAddressCode({province, city, district, township}); |
| | | // const {provinceCode, cityCode, districtCode, townshipCode} = res.data || {}; |
| | | // form2.value.regionLabel = province + " / " + city + " / " + district + " / " + township; |
| | | // //form2.value.region = [provinceCode, cityCode, districtCode, townshipCode]; |
| | | // form2.value.provinceId = provinceCode; |
| | | // form2.value.cityId = cityCode; |
| | | // form2.value.districtId = districtCode; |
| | | // form2.value.streetId = townshipCode; |
| | | // form2.value.dispatchTransportArea = params.regeocode.formattedAddress; |
| | | // console.log(form2.value,"form2") |
| | | // } |
| | | // }, |
| | | change: async ({value}:any)=>{ |
| | | if (Array.isArray(value) && value.length === 3){ |
| | | mapRegeo(value[1], value[0]).then(async res => { |
| | | let params = res.data || {}; |
| | | if (params.info === "OK") { |
| | | let {province, city, district, township} = params.regeocode.addressComponent || {}; |
| | | const res = await getAddressCode({province, city, district, township}); |
| | | const {provinceCode, cityCode, districtCode, townshipCode} = res.data || {}; |
| | | form2.value.regionLabel = province + " / " + city + " / " + district + " / " + township; |
| | | form2.value.provinceId = provinceCode; |
| | | form2.value.cityId = cityCode; |
| | | form2.value.districtId = districtCode; |
| | | form2.value.streetId = townshipCode; |
| | | form2.value.dispatchTransportArea = params.regeocode.formatted_address || params.regeocode.formattedAddress; |
| | | console.log(form2.value, "form2") |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | // dispatchTransportArea: { |
| | | // label: '调度单运输地', |
| | | // addDisplay: true,minWidth: 150, |
| | | // editDisplay: true, |
| | | // viewDisplay: true, |
| | | // hide: false, |
| | | // search: true, |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | | // message: "调度单运输地不能为空", trigger: "blur" |
| | | // } |
| | | // ], |
| | | // }, |
| | | electronicFenceRange: { |
| | | label: '电子围栏范围', |
| | | addDisplay: true,minWidth: 150, |
| | | editDisplay: true, |
| | | viewDisplay: true,append:'米', |
| | | hide: false, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "电子围栏范围不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | label: '其他信息', |
| | | prop: 'qtyxx', |
| | | column:{ |
| | | remark: { |
| | | label: '备注',minWidth: 150, |
| | | type: 'textarea', minRows: 3, maxRows: 5, |
| | | addDisplay: true, |
| | | editDisplay: true,span:24, |
| | | viewDisplay: true, |
| | | hide: true, |
| | | search: false, |
| | | }, |
| | | } |
| | | } |
| | | ], |
| | | }) |
| | | const form2 = ref<any>({}); |
| | | const dialForm = ref(); |
| | | |
| | | const handleAddShipper = () => { |
| | | if (!form.value.customerId){ |
| | | return ElMessage.error('请先选择运输路线'); |
| | | } |
| | | form2.value = { |
| | | customerId: form.value.customerId, |
| | | customerSysCode: form.value.customerCode, |
| | | customerName: form.value.customerName, |
| | | }; |
| | | dialForm.value = $DialogForm(appContext)({ |
| | | title: '新增装货地', |
| | | data:form2.value, |
| | | width: '80%', |
| | | option: consignorAddOption.value, |
| | | menuPosition: 'right', |
| | | callback: (res:any,) => { |
| | | let data1 = res.data; |
| | | if (data1.mapLocationDetail){ |
| | | data1.mapLocation = data1.mapLocationDetail[0]+','+data1.mapLocationDetail[1]; |
| | | data1.addressDetail = data1.mapLocationDetail[2] |
| | | } |
| | | addTmsConsignor({...form2.value,...data1}).then(res2=>{ |
| | | let active = res2.data || {}; |
| | | 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, |
| | | shipperRegionLabel: active.regionLabel, |
| | | shipperAddress: active.addressDetail, |
| | | shipperMobile: active.contactPhone, |
| | | shipperRegionCode:shipperRegionCode |
| | | }); |
| | | } |
| | | dialForm.value.close(); |
| | | res.done(); |
| | | }).catch(err=>{ |
| | | res.done(); |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | const handleAddReceiver = () => { |
| | | if (!form.value.customerId){ |
| | | return ElMessage.error('请先选择运输路线'); |
| | | } |
| | | form2.value = { |
| | | customerId: form.value.customerId, |
| | | customerSysCode: form.value.customerCode, |
| | | customerName: form.value.customerName, |
| | | }; |
| | | dialForm.value = $DialogForm(appContext)({ |
| | | title: '新增卸货地', |
| | | data:form2.value, |
| | | width: '80%', |
| | | option: consignorAddOption.value, |
| | | menuPosition: 'right', |
| | | callback: (res:any,) => { |
| | | let data1 = res.data; |
| | | if (data1.mapLocationDetail){ |
| | | data1.mapLocation = data1.mapLocationDetail[0]+','+data1.mapLocationDetail[1]; |
| | | data1.addressDetail = data1.mapLocationDetail[2] |
| | | } |
| | | addTmsConsignor({...form2.value,...data1}).then(res2=>{ |
| | | let active = res2.data || {}; |
| | | 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, |
| | | receiverRegionLabel: active.regionLabel, |
| | | receiverAddress: active.addressDetail, |
| | | receiverMobile: active.contactPhone, |
| | | receiverRegionCode:receiverRegionCode, |
| | | }); |
| | | } |
| | | dialForm.value.close(); |
| | | res.done(); |
| | | }).catch(err=>{ |
| | | res.done(); |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | |
| | | </script> |