| | |
| | | v-hasPermi="['tms:tmsDispatchOrder:export']" |
| | | >导出 |
| | | </el-button> |
| | | <el-button |
| | | type="info" |
| | | icon="Upload" |
| | | @click="handleImport" |
| | | v-hasPermi="['tms:tmsDispatchOrder:import']">导入</el-button> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- icon="Promotion"--> |
| | |
| | | @click="handleZZ" |
| | | v-hasPermi="['tms:tmsDispatchOrder:zzdj']" |
| | | >增值作业登记 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="Printer" |
| | | :disabled="pageF.single" |
| | | @click="handlePrint" |
| | | v-hasPermi="['tms:tmsDispatchOrder:print']" |
| | | >承运单打印 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | icon="UserFilled" |
| | | :disabled="!zxhdjSingle" |
| | | @click="handleZXHDJ" |
| | | v-hasPermi="['tms:tmsDispatchOrder:zzdj']" |
| | | >装卸货点登记 |
| | | </el-button> |
| | | </template> |
| | | <template #menu-before="{row}"> |
| | |
| | | </div> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" :loading="pageF.isUploading" @click="submitForm2"> |
| | | <el-button type="primary" v-if="optionType != 'view'" :loading="pageF.isUploading" @click="submitForm2"> |
| | | {{ pageF.isUploading ? '提交中' : '确 定' }} |
| | | </el-button> |
| | | <el-button @click="cancelBox2">取 消</el-button> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="承运单打印" v-model="open6" class="avue-dialog avue-dialog--top cydprint" width="80%"> |
| | | <div v-if="print == 0"> |
| | | <el-descriptions :column="3" border> |
| | | <el-descriptions-item label="订单号">{{form.dispatchNo}}</el-descriptions-item> |
| | | <el-descriptions-item label="承运日期">{{form.orderTime}}</el-descriptions-item> |
| | | <el-descriptions-item label="车牌">{{form.licensePlate}}</el-descriptions-item> |
| | | <el-descriptions-item label="订车类型">{{form.$actualVehicleType}}</el-descriptions-item> |
| | | |
| | | <el-descriptions-item label="司机姓名">{{form.mainDriverName}}</el-descriptions-item> |
| | | <el-descriptions-item label="电话">{{form.mainDriverMobile}}</el-descriptions-item> |
| | | <el-descriptions-item label="托架号/柜号">{{form.shelfCode}}/ {{form.containerNo}}</el-descriptions-item> |
| | | <el-descriptions-item label="客户名称">{{form.customerName}}</el-descriptions-item> |
| | | <el-descriptions-item label="起止路线">{{form.transportLine}}</el-descriptions-item> |
| | | <el-descriptions-item label="调度员">{{form.createBy}}</el-descriptions-item> |
| | | <el-descriptions-item label="是否打印">{{form.$isPrint}}</el-descriptions-item> |
| | | <el-descriptions-item label="历史打印次数">{{form.printCount}}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <h3 class="title" style="color: #333;font-weight: bold;">单据信息</h3> |
| | | <avue-form v-model="boxForm" ref="boxFormRef" |
| | | :option="boxFormOption"> |
| | | |
| | | </avue-form> |
| | | </div> |
| | | <div v-else> |
| | | <div id="print"> |
| | | <img src="@/assets/img.png" alt="" style="width: 168px;height: 68px"> |
| | | <h3 class="title" >珠海市汇畅交通投资有限公司</h3> |
| | | <div class="header"> |
| | | <div class="order">订单号:{{boxForm.dispatchNo}}</div> |
| | | <div class="sub-title">货物承运单证</div> |
| | | </div> |
| | | <table> |
| | | <tr> |
| | | <td>承运日期:{{ boxForm.orderTime }}</td> |
| | | <td>六联单号码:{{ boxForm.sixLinkNo }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td>车牌:{{ boxForm.licensePlate }}</td> |
| | | <td>订车车型: {{boxForm.$actualVehicleType}}</td> |
| | | </tr> |
| | | <tr> |
| | | <td>司机姓名:{{ boxForm.mainDriverName }}</td> |
| | | <td>电话:{{ boxForm.mainDriverMobile }}</td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td>托架号/柜号:{{boxForm.shelfCode}}/ {{boxForm.containerNo}}</td> |
| | | <td>行驶口岸:{{ boxForm.portName }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td>提单号S/O:{{ boxForm.billNo }}</td> |
| | | <td>码头名:{{ boxForm.terminalName }}</td> |
| | | </tr> |
| | | |
| | | <tr> |
| | | <td>客户:{{ boxForm.customerName }}</td> |
| | | <td>联络人:{{ boxForm.contactName }} {{ boxForm.contactPhone }} </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2"> |
| | | <span style="margin-right: 40px">货物名称:{{ boxForm.cargoName }} </span> |
| | | <span style="margin-right: 40px">件数:{{ boxForm.pieceCount }} </span> |
| | | <span style="margin-right: 40px">重量:{{ boxForm.weight }}KG</span> |
| | | </td> |
| | | </tr> |
| | | <tr> |
| | | <td colspan="2">起止路线:{{ boxForm.transportLine }}</td> |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <div style="line-height: 24px">调度员:{{boxForm.createBy}}</div> |
| | | <div style="line-height: 42px">承运司机:{{boxForm.mainDriverName}}</div> |
| | | </td> |
| | | <td>收货人签字/盖章:</td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <div>托运须知:</div> |
| | | <div>1.如因托运者携带违规禁品,违反当地法例而引致车辆及司机扣留或处罚,托人人必赔偿一切损失,直至事件完满解决为止。</div> |
| | | <div>2.货物装卸及运输期间,一切交通意外引致路不能行驶或车辆损失而令货物不能如期交货及一切风、火、盗窃及其它意外均由货主负责。</div> |
| | | <div>3.一切交易均按本公司之标准经营条款为准,本公司之责任在某些情况下会被豁免或限 (制如有须要,欢迎索取)!</div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button @click="print = 0" v-if="print == 1">重新填写</el-button> |
| | | <el-button type="primary" |
| | | :loading="pageF.isUploading" @click="submitForm6"> |
| | | {{ pageF.isUploading ? '提交中' : '确 定' }} |
| | | </el-button> |
| | | |
| | | <el-button @click="open6 = false">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 用户导入对话框 --> |
| | | <el-dialog title="调度单导入" v-model="upload.open" width="400px" append-to-body> |
| | | <el-upload |
| | | ref="uploadRef" |
| | | :limit="1" |
| | | accept=".xlsx, .xls" |
| | | :headers="upload.headers" |
| | | :action="upload.url + '?updateSupport=' + upload.updateSupport" |
| | | :disabled="upload.isUploading" |
| | | :on-progress="handleFileUploadProgress" |
| | | :on-success="handleFileSuccess" |
| | | :auto-upload="false" |
| | | drag |
| | | > |
| | | <el-icon class="el-icon--upload"><upload-filled /></el-icon> |
| | | <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
| | | <template #tip> |
| | | <div class="el-upload__tip text-center"> |
| | | <span>仅允许导入xls、xlsx格式文件。</span> |
| | | <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link> |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="submitFileForm">确 定</el-button> |
| | | <el-button @click="upload.open = false">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog title="预配订单装卸货点登记" v-model="open7" class="avue-dialog avue-dialog--top" width="80%"> |
| | | <avue-form v-model="shipperReceiverForm" |
| | | ref="shipperReceiverFormRef" |
| | | :option="shipperReceiverFormOption"> |
| | | <template #dispatchNos="{disabled}"> |
| | | <div class="dispatchNos"> |
| | | <el-tag |
| | | v-for="tag in shipperReceiverForm.dispatchNos" |
| | | :key="tag" |
| | | closable |
| | | @close="handleCloseDispatchNo(tag)" |
| | | > |
| | | {{ tag }} |
| | | </el-tag> |
| | | </div> |
| | | |
| | | </template> |
| | | <template #shipperId="{disabled}"> |
| | | <div style="display:flex; align-items: center;justify-content: space-between"> |
| | | <avue-input-table :props="consignorProps" dataType="string" |
| | | :children="consignorOption" :disabled="disabled" |
| | | :on-load="onShipperLoad" suffixIcon="search" |
| | | v-model="shipperReceiverForm.shipperId" style="width: 80%" |
| | | @change="changeShipper2" |
| | | placeholder="请选择装货点"></avue-input-table> |
| | | <el-button icon="plus" :disabled="disabled" @click="handleAddShipper2"></el-button> |
| | | </div> |
| | | </template> |
| | | <template #receiverId="{disabled}"> |
| | | <div style="display:flex; align-items: center;justify-content: space-between"> |
| | | <avue-input-table :props="consignorProps" |
| | | :children="consignorOption" dataType="string" |
| | | :on-load="onConsignorLoad" suffixIcon="search" |
| | | v-model="shipperReceiverForm.receiverId" :disabled="disabled" |
| | | @change="changeReceiver2" style="width: 80%" |
| | | placeholder="请选择卸货点"></avue-input-table> |
| | | <el-button icon="plus" :disabled="disabled" @click="handleAddReceiver2"></el-button> |
| | | </div> |
| | | </template> |
| | | </avue-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | :loading="pageF.isUploading" @click="submitZxForm"> |
| | | {{ pageF.isUploading ? '提交中' : '确 定' }} |
| | | </el-button> |
| | | |
| | | <el-button @click="open7 = false">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | </basicContainer> |
| | | </template> |
| | |
| | | getTmsDispatchOrder, |
| | | listTmsDispatchOrder, |
| | | updateTmsDispatchOrder, |
| | | confirmOrder, copyOrder, okOrder, initGenerate, generateTmsDispatchOrder, dropHook, |
| | | connectHang,customsOrder,loadingOrder,checkCloseOrder,closeOrder |
| | | confirmOrder, |
| | | copyOrder, |
| | | okOrder, |
| | | initGenerate, |
| | | generateTmsDispatchOrder, |
| | | dropHook, |
| | | connectHang, |
| | | customsOrder, |
| | | loadingOrder, |
| | | checkCloseOrder, |
| | | closeOrder, |
| | | printDispatchOrder, |
| | | importTemplateTmsDispatchOrder,ypdddjSumbit |
| | | } from "@/api/tms/tmsDispatchOrder"; |
| | | import useCurrentInstance from "@/utils/useCurrentInstance"; |
| | | import {computed, onMounted, reactive, ref, toRefs, watch, getCurrentInstance, nextTick} from "vue"; |
| | |
| | | import {getTmsContainer, listTmsContainer} from "@/api/tms/tmsContainer"; |
| | | import {getTmsShelf, listTmsShelf} from "@/api/tms/tmsShelf"; |
| | | import {addTmsConsignor, getTmsConsignor, listTmsConsignor} from "@/api/tms/tmsConsignor"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {ElMessage, ElMessageBox, type ElUpload} from "element-plus"; |
| | | import {addTmsTrip, listTmsTrip} from "@/api/tms/tmsTrip"; |
| | | import { |
| | | addTmsFinanceDetail, |
| | |
| | | import {mapRegeo} from "@/api/common"; |
| | | import {getDicts} from "@/api/system/dict/data"; |
| | | import {pushTmsQuoteFee} from "@/api/tms/tmsQuoteFee"; |
| | | import { $Print } from '@smallwei/avue' |
| | | import {getToken} from "@/utils/auth"; |
| | | |
| | | const {appContext} = getCurrentInstance(); |
| | | |
| | |
| | | isCustoms:<any> -1, |
| | | isLoad: -1, |
| | | open5:false, |
| | | open6:false, |
| | | open7:false, |
| | | zxhdjSingle:false, |
| | | }) |
| | | const { |
| | | queryParams, form, page, selectionList, open3, |
| | | boxTableData, optionType, |
| | | boxFormOption, boxForm, boxTableOption, title, open, open2, |
| | | goodsTableData, goodsForm, actualForm, selectionList2,isCustoms,isLoad,open5 |
| | | goodsTableData, goodsForm, actualForm, selectionList2,isCustoms,isLoad,open5,open6,open7,zxhdjSingle |
| | | } = toRefs(data); |
| | | const option = ref({ |
| | | pageKey: 'TmsDispatchOrder', |
| | |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "下单时间不能为空", trigger: "blur" |
| | | } |
| | | ], |
| | | }, |
| | | latestDeparture: { |
| | | label: '要求最晚出发时间', |
| | |
| | | }, |
| | | isfk: { |
| | | label: '是否放空', |
| | | display: false, minWidth: 100, |
| | | search: true, |
| | | type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string', |
| | | |
| | | }, |
| | | isPrint: { |
| | | label: '是否打印承运单', |
| | | display: false, minWidth: 100, |
| | | search: true, |
| | | type: 'select', dicUrl: '/system/dict/data/type/sys_number_is', dataType: 'string', |
| | |
| | | } |
| | | isCustoms.value = isCustoms.value == 0 && !pageF.single ? 0 : -1; |
| | | isLoad.value = isLoad.value == 0 && !pageF.single ? 0 : -1; |
| | | console.log(pageF.single) |
| | | zxhdjSingle.value = pageF.multiple|| true; |
| | | let yp = selection.filter((item:any) =>{ |
| | | return item.orderType == 0 |
| | | }); |
| | | if(yp.length > 0){ |
| | | zxhdjSingle.value = false; |
| | | } |
| | | }, |
| | | getBeginListFunc: (params = {}) => { |
| | | queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.createTimeRange, 'createTime') || {}; |
| | |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | if (shipperReceiverForm.value.customerId ){ |
| | | form.value.customerId = shipperReceiverForm.value.customerId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data,customerId: form.value.customerId}).then(res => { |
| | | return callback({ |
| | | total: res.total, |
| | |
| | | if (cityId) data.cityId = cityId; |
| | | if (districtId) data.districtId = districtId; |
| | | if (streetId) data.streetId = streetId; |
| | | } |
| | | if (shipperReceiverForm.value.customerId ){ |
| | | form.value.customerId = shipperReceiverForm.value.customerId; |
| | | } |
| | | listTmsConsignor({pageSize: page.pageSize, pageNum: page.currentPage, ...data,customerId: form.value.customerId}).then(res => { |
| | | return callback({ |
| | |
| | | } |
| | | }) |
| | | } |
| | | const printOption = ref({ |
| | | menuBtn: false, |
| | | labelWidth: 120, |
| | | column: { |
| | | sixLinkNo:{ |
| | | label: '六联单号', |
| | | }, |
| | | portName:{ |
| | | label: '行驶口岸', |
| | | type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_port', |
| | | }, |
| | | billNo:{ |
| | | label: '提单号S/O', |
| | | }, |
| | | terminalName:{ |
| | | label: '码头名', |
| | | }, |
| | | cargoName:{ |
| | | label: '货物名', |
| | | }, |
| | | pieceCount:{ |
| | | label: '件数', |
| | | }, |
| | | weight:{ |
| | | label: '重量', |
| | | }, |
| | | contactName:{ |
| | | label: '客户联络人', |
| | | }, |
| | | contactPhone:{ |
| | | label: '联络人手机号', |
| | | } |
| | | } |
| | | }) |
| | | const print =ref(0) |
| | | const handlePrint = () => { |
| | | form.value = selectionList.value[0]; |
| | | boxFormOption.value = printOption.value; |
| | | boxForm.value = form.value |
| | | |
| | | </script> |
| | | getTmsDriver(boxForm.value.mainDriverId).then(res=>{ |
| | | open6.value = true; |
| | | const driver = res.data || {}; |
| | | boxForm.value.mainDriverMobile = driver.mobile; |
| | | print.value = 0 |
| | | }) |
| | | |
| | | } |
| | | |
| | | const submitForm6 = ()=>{ |
| | | print.value = 1; |
| | | printDispatchOrder(boxForm.value).then(res=>{ |
| | | $Print('#print'); |
| | | onLoad(page.value) |
| | | }) |
| | | |
| | | |
| | | } |
| | | const upload = reactive({ |
| | | // 是否显示弹出层(用户导入) |
| | | open: false, |
| | | // 是否禁用上传 |
| | | isUploading: false, |
| | | // 是否更新已经存在的用户数据 |
| | | updateSupport: 0, |
| | | // 设置上传的请求头部 |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | // 上传的地址 |
| | | url: import.meta.env.VITE_APP_BASE_API + "/tms/tmsDispatchOrder/importData" |
| | | }); |
| | | |
| | | |
| | | const uploadRef = ref(); |
| | | |
| | | function handleImport() { |
| | | upload.open = true; |
| | | } |
| | | |
| | | |
| | | /** 下载模板操作 */ |
| | | function importTemplate() { |
| | | importTemplateTmsDispatchOrder(); |
| | | |
| | | } |
| | | const handleFileUploadProgress = (event:any, file:any) => { |
| | | upload.isUploading = true; |
| | | }; |
| | | /** 文件上传成功处理 */ |
| | | const handleFileSuccess = (response:any, file:any) => { |
| | | upload.open = false; |
| | | upload.isUploading = false; |
| | | uploadRef.value!.clearFiles(); |
| | | proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true }); |
| | | onLoad(page.value); |
| | | }; |
| | | /** 提交上传文件 */ |
| | | function submitFileForm() { |
| | | uploadRef.value!.submit(); |
| | | } |
| | | const shipperReceiverForm = ref<any>({}); |
| | | const shipperReceiverFormRef = ref(); |
| | | const shipperReceiverFormOption = ref({ |
| | | menuBtn: false, labelWidth: 140, |
| | | column: { |
| | | dispatchNos:{ |
| | | label: '调度单号',span:24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "调度单号不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | }, |
| | | shipperId: { |
| | | label: '装货点', dataType: 'string',disabled:false, |
| | | display: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "装货点不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | |
| | | }, |
| | | shipperRegionLabel: { |
| | | label: '装货点行政区域', |
| | | display: true, disabled: true |
| | | |
| | | }, |
| | | shipperAddress: { |
| | | label: '装货点详细地址', |
| | | display: true, disabled: true |
| | | }, |
| | | shipperMobile: { |
| | | label: '装货点联系方式', |
| | | display: true, disabled: true |
| | | }, |
| | | receiverId: { |
| | | label: '卸货点', |
| | | display: true, dataType: 'string',disabled:false, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "卸货点不能为空", trigger: "change" |
| | | } |
| | | ], |
| | | }, |
| | | receiverRegionLabel: { |
| | | label: '卸货点行政区域', |
| | | display: true, disabled: true |
| | | }, |
| | | receiverAddress: { |
| | | label: '卸货点详细地址', |
| | | display: true, disabled: true |
| | | }, |
| | | receiverMobile: { |
| | | label: '卸货点联系方式', |
| | | display: true, disabled: true |
| | | }, |
| | | } |
| | | }); |
| | | |
| | | const changeShipper2 = ({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(shipperReceiverForm.value, { |
| | | shipperId: active.id, |
| | | shipperName: active.consignorName, |
| | | shipperRegionLabel: active.regionLabel, |
| | | shipperAddress: active.addressDetail, |
| | | shipperMobile: active.contactPhone, |
| | | shipperRegionCode: shipperRegionCode |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | const changeReceiver2 = ({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(shipperReceiverForm.value, { |
| | | receiverId: active.id, |
| | | receiverName: active.consignorName, |
| | | receiverRegionLabel: active.regionLabel, |
| | | receiverAddress: active.addressDetail, |
| | | receiverMobile: active.contactPhone, |
| | | receiverRegionCode: receiverRegionCode, |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const hasDifferentCustomer = (() => { |
| | | const customerSet = new Set( |
| | | selectionList.value.map((item:any) => item.customerId) |
| | | ); |
| | | return customerSet.size > 1; |
| | | })(); |
| | | const handleZXHDJ = ()=>{ |
| | | if(hasDifferentCustomer){ |
| | | ElMessage.error('单次操作只能操作一个客户的数据'); |
| | | return; |
| | | } |
| | | let filter = selectionList.value.filter((item:any)=> !item.shipperId); |
| | | let filter2 = selectionList.value.filter((item:any)=> !item.receiverId); |
| | | let zLen = filter.length || 0; |
| | | let xLen = filter2.length || 0; |
| | | if (zLen == 0 && xLen == 0){ |
| | | ElMessage.error('选择的数据已完成对装卸货点登记'); |
| | | return; |
| | | } |
| | | if(zLen >0 && xLen >0){ |
| | | if (zLen > xLen){ |
| | | ElMessage.error('选择的数据已填写卸货点数据,请单独编辑'); |
| | | return; |
| | | } |
| | | if (zLen < xLen){ |
| | | ElMessage.error('选择的数据已填写装货点数据,请单独编辑'); |
| | | return; |
| | | } |
| | | } |
| | | let item:any = selectionList.value[0]; |
| | | shipperReceiverForm.value.customerId = item?.customerId |
| | | shipperReceiverForm.value.customerCode = item?.customerCode |
| | | shipperReceiverForm.value.customerName = item?.customerName; |
| | | shipperReceiverForm.value.dispatchNos = selectionList.value.map((item:any)=> item.dispatchNo) || []; |
| | | |
| | | shipperReceiverFormOption.value.column.shipperId.disabled = zLen ==0; |
| | | shipperReceiverFormOption.value.column.shipperId.rules[0].required = zLen !=0; |
| | | shipperReceiverFormOption.value.column.receiverId.disabled = xLen ==0; |
| | | shipperReceiverFormOption.value.column.receiverId.rules[0].required = xLen !=0; |
| | | |
| | | |
| | | open7.value = true; |
| | | } |
| | | |
| | | const handleAddShipper2 = () => { |
| | | |
| | | form2.value = { |
| | | customerId: shipperReceiverForm.value.customerId, |
| | | customerSysCode: shipperReceiverForm.value.customerCode, |
| | | customerName: shipperReceiverForm.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(shipperReceiverForm.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 handleAddReceiver2 = () => { |
| | | if (!form.value.customerId){ |
| | | return ElMessage.error('请先选择运输路线'); |
| | | } |
| | | form2.value = { |
| | | customerId: shipperReceiverForm.value.customerId, |
| | | customerSysCode: shipperReceiverForm.value.customerCode, |
| | | customerName: shipperReceiverForm.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(shipperReceiverForm.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(); |
| | | }) |
| | | }, |
| | | }) |
| | | } |
| | | |
| | | const handleCloseDispatchNo = (tag:string)=>{ |
| | | let indexOf = shipperReceiverForm.value.dispatchNos.indexOf(tag); |
| | | shipperReceiverForm.value.dispatchNos.splice(indexOf,1); |
| | | } |
| | | |
| | | const submitZxForm = ()=>{ |
| | | shipperReceiverFormRef.value.validate((valid: boolean,done:any) => { |
| | | if(valid){ |
| | | ypdddjSumbit(shipperReceiverForm.value).then(res=>{ |
| | | ElMessage.success('登记成功'); |
| | | open7.value = false; |
| | | onLoad(page.value); |
| | | |
| | | done(); |
| | | }).catch(err=>{ |
| | | done(); |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | |
| | | ::v-deep .cydprint .el-dialog__body{ |
| | | overflow: hidden; |
| | | //padding: 0; |
| | | margin: 0; |
| | | } |
| | | #print{ |
| | | .title{ |
| | | text-align: center; |
| | | font-size: 14pt; |
| | | color: #000; |
| | | line-height:23pt; |
| | | font-weight: bold; |
| | | margin: 0; |
| | | } |
| | | .header{ |
| | | position: relative; |
| | | .order{ |
| | | font-size: 12pt; |
| | | color: #000; |
| | | line-height: 23pt; |
| | | } |
| | | .sub-title{ |
| | | position: absolute; |
| | | left: 50%; |
| | | transform: translateX(-50%); |
| | | top: 0; |
| | | font-size: 12pt; |
| | | color: #000; |
| | | line-height: 23pt; |
| | | text-decoration: underline; |
| | | } |
| | | |
| | | } |
| | | |
| | | table { |
| | | width: 100%; |
| | | border-collapse: collapse; /* 合并边框 */ |
| | | font-size: 12px; |
| | | table-layout: fixed; /* 关键点 */ |
| | | } |
| | | table, td { |
| | | border: 1px solid #000; |
| | | |
| | | } |
| | | td { |
| | | padding: 4px; |
| | | vertical-align: middle; |
| | | width: 50%; /* 强制等宽 */ |
| | | word-break: break-all; |
| | | } |
| | | } |
| | | .dispatchNos{ |
| | | //border: 1px solid #ebeef5; |
| | | border-radius: 4px; |
| | | min-height: 73px; |
| | | padding: 1px 11px; |
| | | box-shadow: 0 0 0 1px var(--el-disabled-border-color) inset; |
| | | } |
| | | </style> |