From 54e07b96bd7fdae9915fcf06de2a16bcb613aa74 Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期五, 06 三月 2026 16:28:37 +0800
Subject: [PATCH] 新增备注日志
---
ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue | 749 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 738 insertions(+), 11 deletions(-)
diff --git a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
index ac5cbad..051f5ba 100644
--- a/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
+++ b/ui/admin-ui3/src/views/tms/tmsDispatchOrder/index.vue
@@ -44,6 +44,11 @@
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"-->
@@ -92,6 +97,22 @@
@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}">
@@ -208,7 +229,7 @@
>
<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.$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>
@@ -222,7 +243,7 @@
>
<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.$actualVehicleType }}</el-descriptions-item>
<el-descriptions-item label="鎵樻灦鍙�">{{ form.shelfCode }}</el-descriptions-item>
</el-descriptions>
<avue-form v-model="form" ref="boxFormRef" :option="boxFormOption">
@@ -261,7 +282,7 @@
</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>
@@ -385,6 +406,190 @@
</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>琛岄┒鍙e哺锛歿{ boxForm.portName }}</td>
+ </tr>
+ <tr>
+ <td>鎻愬崟鍙稴/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.濡傚洜鎵樿繍鑰呮惡甯﹁繚瑙勭鍝侊紝杩濆弽褰撳湴娉曚緥鑰屽紩鑷磋溅杈嗗強鍙告満鎵g暀鎴栧缃氾紝鎵樹汉浜哄繀璧斿伩涓�鍒囨崯澶憋紝鐩磋嚦浜嬩欢瀹屾弧瑙e喅涓烘銆�</div>
+ <div>2.璐х墿瑁呭嵏鍙婅繍杈撴湡闂达紝涓�鍒囦氦閫氭剰澶栧紩鑷磋矾涓嶈兘琛岄┒鎴栬溅杈嗘崯澶辫�屼护璐х墿涓嶈兘濡傛湡浜よ揣鍙婁竴鍒囬銆佺伀銆佺洍绐冨強鍏跺畠鎰忓鍧囩敱璐т富璐熻矗銆�</div>
+ <div>3.涓�鍒囦氦鏄撳潎鎸夋湰鍏徃涔嬫爣鍑嗙粡钀ユ潯娆句负鍑嗭紝鏈叕鍙镐箣璐d换鍦ㄦ煇浜涙儏鍐典笅浼氳璞佸厤鎴栭檺 (鍒跺鏈夐』瑕侊紝娆㈣繋绱㈠彇)锛�</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>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</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>
@@ -398,8 +603,19 @@
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";
@@ -415,7 +631,7 @@
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,
@@ -433,6 +649,8 @@
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();
@@ -481,12 +699,15 @@
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',
@@ -850,6 +1071,12 @@
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
display: true,
+ rules: [
+ {
+ required: true,
+ message: "涓嬪崟鏃堕棿涓嶈兘涓虹┖", trigger: "blur"
+ }
+ ],
},
latestDeparture: {
label: '瑕佹眰鏈�鏅氬嚭鍙戞椂闂�',
@@ -1588,6 +1815,13 @@
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',
+
+ },
mainDriverName: {
label: '涓婚┚椹跺憳',
display: false, minWidth: 120,
@@ -1599,8 +1833,15 @@
// display: false,
// search: true,
// },
+ requiredVehicleTypes: {
+ label: '涓嬪崟杞﹀瀷',minWidth: 130,
+ display: false, type: 'select', search: true,
+ dicUrl: '/system/dict/data/type/vehicle_type',
+ dataType: 'string',
+
+ },
actualVehicleType: {
- label: '瀹為檯杩愯緭宸ュ叿绫诲瀷', minWidth: 130,
+ label: '娲惧嚭杞﹀瀷', minWidth: 130,
display: false,
search: true,
type: 'select', dicUrl: '/system/dict/data/type/vehicle_type', dataType: 'string',
@@ -2741,13 +2982,21 @@
}
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: () => {
+ getBeginListFunc: (params = {}) => {
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') || {};
+ queryParams.value = proxy.addDateRangeNew(queryParams.value, queryParams.value?.orderTimeRange, 'orderTime') || {};
+ return params;
},
handleBeforeOpenFunc:(type:string)=>{
if(type == 'add'){
@@ -3125,6 +3374,9 @@
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,
@@ -3151,6 +3403,9 @@
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({
@@ -3760,5 +4015,477 @@
}
})
}
+const printOption = ref({
+ menuBtn: false,
+ labelWidth: 120,
+ column: {
+ sixLinkNo:{
+ label: '鍏仈鍗曞彿',
+ },
+ portName:{
+ label: '琛岄┒鍙e哺',
+ type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_port',
+ },
+ billNo:{
+ label: '鎻愬崟鍙稴/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>
\ No newline at end of file
+ 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>
\ No newline at end of file
--
Gitblit v1.8.0