From 7375ea60fa4c8fee428e1eae9c0692f5b09ae281 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期日, 02 十一月 2025 17:24:26 +0800
Subject: [PATCH] 导体计算磅差逻辑变更

---
 pages/wareHouse/nuclearScale/createwriteoffform.vue |  492 ++++++++++++++++++++++++++++++++----------------------
 1 files changed, 290 insertions(+), 202 deletions(-)

diff --git a/pages/wareHouse/nuclearScale/createwriteoffform.vue b/pages/wareHouse/nuclearScale/createwriteoffform.vue
index dfaa5e2..4e65b1f 100644
--- a/pages/wareHouse/nuclearScale/createwriteoffform.vue
+++ b/pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -4,25 +4,30 @@
 		<view class="packing-registration-bg" />
 		<u-navbar title="鏍哥褰曞叆" :background="background" :border-bottom="false" :title-bold="true" title-color="#000"
 			back-icon-color="#000" />
-		<u-form :model="form" ref="uForm" :label-width="210" labelAlign="left" :rules="rules" :error-type="['toast']"
+		<u-form :model="form" ref="uForm" :label-width="235" labelAlign="left" :rules="rules" :error-type="['toast']"
 			class="uForm">
-			<u-form-item label="浜у搧绫诲瀷锛�" :border-bottom="false" prop="productType">
-				<u-radio-group v-model="form.productType" @change="handleProductTypeChange">
-					<u-radio name="1">瀵间綋</u-radio>
-					<u-radio name="2">閾滄潌</u-radio>
-					<u-radio name="3">瀵间綋2.6</u-radio>
+			<u-form-item label="浜у搧绫诲瀷锛�" :border-bottom="false" prop="productType" style="font-size: small">
+				<u-radio-group v-model="form.productType" @change="handleProductTypeChange" style="font-size: small">
+					<u-radio name="DT01">瀵间綋</u-radio>
+					<u-radio name="TG01">閾滄潌</u-radio>
+					<u-radio name="DT02">瀵间綋2.6</u-radio>
 				</u-radio-group>
 			</u-form-item>
-			<u-form-item label="鏇挎崲浜岀淮鐮侊細" :border-bottom="false" prop="replace">
-				<u-radio-group v-model="form.replace">
-					<u-radio name="1">鏄�</u-radio>
-					<u-radio name="0">鍚�</u-radio>
-				</u-radio-group>
-			</u-form-item>
-			<u-form-item label="杞︾墝鍙凤細" :border-bottom="false" prop="licensePlate">
+			<!-- <u-form-item
+        label="鏇挎崲浜岀淮鐮侊細"
+        :border-bottom="false"
+        prop="replace"
+        style="font-size: small"
+      >
+        <u-radio-group v-model="form.replace" style="font-size: small">
+          <u-radio name="1">鏄�</u-radio>
+          <u-radio name="0">鍚�</u-radio>
+        </u-radio-group>
+      </u-form-item> -->
+			<u-form-item label="杞︾墝鍙凤細" :border-bottom="false" prop="licensePlate" style="font-size: small">
 				<u-input v-model="form.licensePlate" type="select" placeholder="璇疯緭鍏ヨ溅鐗屽彿" @click="lpn" />
 			</u-form-item>
-			<u-form-item label="瀹㈡埛鍚嶇О1锛�" :border-bottom="false" prop="customerName1">
+			<u-form-item label="瀹㈡埛鍚嶇О1锛�" :border-bottom="false" prop="customerName1" style="font-size: small">
 				<picker class="item-one item-two" style="width: 100%; text-align: right"
 					@change="selClientChange($event, selClientList, 'customerName1')" :value="selClientIndex1"
 					:range="selClientList" range-key="label">
@@ -38,10 +43,11 @@
 				</picker>
 				<u-icon v-if="selClientIndex1 == null" name="arrow-right" color="#687792" size="28"></u-icon>
 			</u-form-item>
-			<u-form-item label="鍙戣揣閫氱煡鍗曞彿1锛�" :border-bottom="false" prop="shippingNoticeNo1">
+			<u-form-item label="鍙戣揣閫氱煡鍗曞彿1锛�" :border-bottom="false" prop="shippingNoticeNo1" style="font-size: small"
+				:label-width="245">
 				<u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
 			</u-form-item>
-			<u-form-item label="瀹㈡埛鍚嶇О2锛�" :border-bottom="false" prop="customerName2">
+			<u-form-item label="瀹㈡埛鍚嶇О2锛�" :border-bottom="false" prop="customerName2" style="font-size: small">
 				<picker class="item-one item-two" style="width: 100%; text-align: right"
 					@change="selClientChange($event, selClientList, 'customerName2')" :value="selClientIndex2"
 					:range="selClientList" range-key="label">
@@ -57,10 +63,11 @@
 				</picker>
 				<u-icon v-if="selClientIndex2 == null" name="arrow-right" color="#687792" size="28"></u-icon>
 			</u-form-item>
-			<u-form-item label="鍙戣揣閫氱煡鍗曞彿2锛�" :border-bottom="false" prop="shippingNoticeNo2">
+			<u-form-item label="鍙戣揣閫氱煡鍗曞彿2锛�" :border-bottom="false" prop="shippingNoticeNo2" style="font-size: small"
+				:label-width="245">
 				<u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
 			</u-form-item>
-			<u-form-item label="鐢熶骇杞﹂棿锛�" :border-bottom="false" prop="workshop">
+			<u-form-item label="鐢熶骇杞﹂棿锛�" :border-bottom="false" prop="workshop" style="font-size: small">
 				<picker class="item-one item-two" style="width: 100%; text-align: right"
 					@change="workshopChange($event, workshopList)" :value="workshopIndex" :range="workshopList"
 					range-key="label" :disabled="!form.productType">
@@ -74,7 +81,7 @@
 				</picker>
 				<u-icon v-if="workshopIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
 			</u-form-item>
-			<u-form-item label="鍙哥鍛橈細" :border-bottom="false" prop="weighingOperator">
+			<u-form-item label="鍙哥鍛橈細" :border-bottom="false" prop="weighingOperator" style="font-size: small">
 				<picker class="item-one item-two" style="width: 100%; text-align: right"
 					@change="weighmanChange($event, weighmanList)" :value="weighmanIndex" :range="weighmanList"
 					range-key="label">
@@ -88,7 +95,7 @@
 				</picker>
 				<u-icon v-if="weighmanIndex == null" name="arrow-right" color="#687792" size="28"></u-icon>
 			</u-form-item>
-			<u-form-item label="鍙夎溅宸ワ細" :border-bottom="false" prop="forkliftOperator">
+			<u-form-item label="鍙夎溅宸ワ細" :border-bottom="false" prop="forkliftOperator" style="font-size: small">
 				<u-input v-model="form.forkliftOperator" type="select" placeholder="璇烽�夋嫨"
 					@click="openForkliftDriverList" />
 			</u-form-item>
@@ -103,15 +110,17 @@
 		<!-- 鍙夎溅宸� -->
 		<u-modal v-model="showModal" title="" :show-cancel-button="true" :show-confirm-button="true"
 			@confirm="confirmSelection" @cancel="cancel">
-			<view class="popup-content">
-				<view class="popup-header">
-					<checkbox-group @change="checkboxChange">
-						<label class="checkbox-item" v-for="(item, index) in checkboxList" :key="index">
-							<checkbox :value="item.value" :checked="item.checked" />
-							<text class="label">{{ item.label }}</text>
-						</label>
-					</checkbox-group>
-				</view>
+			<view class="popup-content" style="padding: 20rpx">
+				<scroll-view scroll-y="true" style="height: 400rpx; transform: translateZ(0)">
+					<view class="popup-header">
+						<checkbox-group @change="checkboxChange">
+							<label class="checkbox-item" v-for="(item, index) in checkboxList" :key="index">
+								<checkbox :value="item.value" :checked="item.checked" />
+								<text class="label">{{ item.label }}</text>
+							</label>
+						</checkbox-group>
+					</view>
+				</scroll-view>
 			</view>
 		</u-modal>
 	</div>
@@ -136,16 +145,16 @@
 				show: false,
 				num: 1,
 				form: {
-					replace: '0',
-					productType: '',
-					licensePlate: '',
-					customerName1: '',
-					shippingNoticeNo1: '',
-					customerName2: '',
-					shippingNoticeNo2: '',
-					workshop: '',
-					weighingOperator: '',
-					forkliftOperator: '',
+					// replace: "0",
+					productType: "",
+					licensePlate: "",
+					customerName1: "",
+					shippingNoticeNo1: "",
+					customerName2: "",
+					shippingNoticeNo2: "",
+					workshop: "",
+					weighingOperator: "",
+					forkliftOperator: "",
 				},
 				rules: {
 					productType: [{
@@ -153,11 +162,13 @@
 						message: "璇烽�夋嫨浜у搧绫诲瀷",
 						trigger: ["change"],
 					}, ],
-					replace: [{
-						required: true,
-						message: "璇烽�夋嫨鏄惁鏇挎崲浜岀淮鐮�",
-						trigger: ["change", "blur"],
-					}, ],
+					// replace: [
+					//   {
+					//     required: true,
+					//     message: "璇烽�夋嫨鏄惁鏇挎崲浜岀淮鐮�",
+					//     trigger: ["change", "blur"],
+					//   },
+					// ],
 					licensePlate: [{
 						required: true,
 						message: "璇疯緭鍏ヨ溅鐗屽彿",
@@ -192,9 +203,9 @@
 				weighmanIndex: null,
 				showModal: false,
 				selectedItems: [],
-				id1: '',
-				id2: '',
-				isSubmitting: false
+				id1: "",
+				id2: "",
+				isSubmitting: false,
 			};
 		},
 		onReady() {
@@ -216,24 +227,24 @@
 		onShow() {
 			// 閲嶇疆琛ㄥ崟鏁版嵁
 			this.form = {
-				replace: '0',
-				productType: '',
-				licensePlate: '',
-				customerName1: '',
-				shippingNoticeNo1: '',
-				customerName2: '',
-				shippingNoticeNo2: '',
-				workshop: '',
-				weighingOperator: '',
-				forkliftOperator: '',
+				// replace: "0",
+				productType: "",
+				licensePlate: "",
+				customerName1: "",
+				shippingNoticeNo1: "",
+				customerName2: "",
+				shippingNoticeNo2: "",
+				workshop: "",
+				weighingOperator: "",
+				forkliftOperator: "",
 			};
 			this.selClientIndex1 = null;
 			this.selClientIndex2 = null;
 			this.workshopIndex = null;
 			this.weighmanIndex = null;
-			this.checkboxList = this.checkboxList.map(item => ({
+			this.checkboxList = this.checkboxList.map((item) => ({
 				...item,
-				checked: false
+				checked: false,
 			}));
 			this.$refs.uForm && this.$refs.uForm.resetValidation();
 		},
@@ -242,121 +253,135 @@
 			 * 鑾峰彇瀹㈡埛鍒楄〃
 			 */
 			fetchClients() {
-				this.$u.api.NuclearScaleEntry.selClient().then((res) => {
-					console.log('瀹㈡埛鍚嶇О', res)
-					if (res.code === 0) {
-						res.data.forEach((i) => {
-							const obj = Object.assign({
-								label: i.customerName,
-								value: i.customerName,
-								shippingNoticeNo: i.shippingNoticeNo,
-								id: i.id
+				this.$u.api.NuclearScaleEntry.selClient()
+					.then((res) => {
+						console.log("瀹㈡埛鍚嶇О", res);
+						if (res.code === 0) {
+							res.data.forEach((i) => {
+								const obj = Object.assign({
+									label: i.customerName,
+									value: i.customerName,
+                  shippingNoticeNo: i.shippingNoticeNo,
+                  receiverAddress: i.receiverAddress,
+                  contactPerson: i.contactPerson,
+                  contactPhone: i.contactPhone,
+									id: i.id,
+								});
+								this.selClientList.push(obj);
 							});
-							this.selClientList.push(obj);
-						});
-					} else {
+						} else {
+							uni.showToast({
+								title: res.msg || "鑾峰彇瀹㈡埛鍚嶇О澶辫触",
+								icon: "none",
+							});
+						}
+					})
+					.catch((err) => {
 						uni.showToast({
-							title: res.msg || '鑾峰彇瀹㈡埛鍚嶇О澶辫触',
-							icon: 'none'
+							title: "缃戠粶閿欒锛岃幏鍙栧鎴峰悕绉板け璐�",
+							icon: "none",
 						});
-					}
-				}).catch(err => {
-					uni.showToast({
-						title: '缃戠粶閿欒锛岃幏鍙栧鎴峰悕绉板け璐�',
-						icon: 'none'
+						console.error("鑾峰彇瀹㈡埛鍚嶇О閿欒:", err);
 					});
-					console.error('鑾峰彇瀹㈡埛鍚嶇О閿欒:', err);
-				});
 			},
 
 			/**
 			 * 鑾峰彇杞﹂棿鍒楄〃
 			 */
 			fetchWorkshops() {
-				this.$u.api.dictData({
-					dictType: 'workshop'
-				}).then(res => {
-					if (res.code === 0 && res.data.length > 0) {
-						res.data.forEach(i => {
-							const obj = Object.assign({
-								label: i.label,
-								value: i.value,
-							})
-							this.workshopList.push(obj)
-						})
-					} else {
+				this.$u.api
+					.dictData({
+						dictType: "workshop",
+					})
+					.then((res) => {
+						if (res.code === 0 && res.data.length > 0) {
+							res.data.forEach((i) => {
+								const obj = Object.assign({
+									label: i.label,
+									value: i.value,
+								});
+								this.workshopList.push(obj);
+							});
+						} else {
+							uni.showToast({
+								title: res.msg || "鑾峰彇杞﹂棿鍒楄〃澶辫触",
+								icon: "none",
+							});
+						}
+					})
+					.catch((err) => {
 						uni.showToast({
-							title: res.msg || '鑾峰彇杞﹂棿鍒楄〃澶辫触',
-							icon: 'none'
+							title: "缃戠粶閿欒锛岃幏鍙栬溅闂村垪琛ㄥけ璐�",
+							icon: "none",
 						});
-					}
-				}).catch(err => {
-					uni.showToast({
-						title: '缃戠粶閿欒锛岃幏鍙栬溅闂村垪琛ㄥけ璐�',
-						icon: 'none'
+						console.error("鑾峰彇杞﹂棿鍒楄〃閿欒:", err);
 					});
-					console.error('鑾峰彇杞﹂棿鍒楄〃閿欒:', err);
-				});
 			},
 
 			/**
 			 * 鑾峰彇鍙夎溅宸ュ垪琛�
 			 */
 			fetchForkliftOperators() {
-				this.$u.api.dictData({
-					dictType: 'forklift'
-				}).then(res => {
-					if (res.code === 0 && res.data.length > 0) {
-						res.data.forEach(i => {
-							const obj = Object.assign({
-								label: i.label,
-								value: i.label,
-							})
-							this.checkboxList.push(obj)
-						})
-					} else {
+				this.$u.api
+					.dictData({
+						dictType: "forklift",
+					})
+					.then((res) => {
+						if (res.code === 0 && res.data.length > 0) {
+							res.data.forEach((i) => {
+								const obj = Object.assign({
+									label: i.label,
+									value: i.label,
+								});
+								this.checkboxList.push(obj);
+							});
+						} else {
+							uni.showToast({
+								title: res.msg || "鑾峰彇鍙夎溅宸ュ垪琛ㄥけ璐�",
+								icon: "none",
+							});
+						}
+					})
+					.catch((err) => {
 						uni.showToast({
-							title: res.msg || '鑾峰彇鍙夎溅宸ュ垪琛ㄥけ璐�',
-							icon: 'none'
+							title: "缃戠粶閿欒锛岃幏鍙栧弶杞﹀伐鍒楄〃澶辫触",
+							icon: "none",
 						});
-					}
-				}).catch(err => {
-					uni.showToast({
-						title: '缃戠粶閿欒锛岃幏鍙栧弶杞﹀伐鍒楄〃澶辫触',
-						icon: 'none'
+						console.error("鑾峰彇鍙夎溅宸ュ垪琛ㄩ敊璇�:", err);
 					});
-					console.error('鑾峰彇鍙夎溅宸ュ垪琛ㄩ敊璇�:', err);
-				});
 			},
 
 			/**
 			 * 鑾峰彇鍙哥鍛樺垪琛�
 			 */
 			fetchWeighmen() {
-				this.$u.api.dictData({
-					dictType: 'weighing'
-				}).then(res => {
-					if (res.code === 0 && res.data.length > 0) {
-						res.data.forEach(i => {
-							const obj = Object.assign({
-								label: i.label,
-								value: i.label,
-							})
-							this.weighmanList.push(obj)
-						})
-					} else {
+				this.$u.api
+					.dictData({
+						dictType: "weighing",
+					})
+					.then((res) => {
+						if (res.code === 0 && res.data.length > 0) {
+							res.data.forEach((i) => {
+								const obj = Object.assign({
+									label: i.label,
+									value: i.label,
+								});
+								this.weighmanList.push(obj);
+							});
+						} else {
+							uni.showToast({
+								title: res.msg || "鑾峰彇鍙哥鍛樺垪琛ㄥけ璐�",
+								icon: "none",
+							});
+						}
+					})
+					.catch((err) => {
 						uni.showToast({
-							title: res.msg || '鑾峰彇鍙哥鍛樺垪琛ㄥけ璐�',
-							icon: 'none'
+							title: "缃戠粶閿欒锛岃幏鍙栧徃纾呭憳鍒楄〃澶辫触",
+							icon: "none",
 						});
-					}
-				}).catch(err => {
-					uni.showToast({
-						title: '缃戠粶閿欒锛岃幏鍙栧徃纾呭憳鍒楄〃澶辫触',
-						icon: 'none'
+						console.error("鑾峰彇鍙哥鍛樺垪琛ㄩ敊璇�:", err);
 					});
-					console.error('鑾峰彇鍙哥鍛樺垪琛ㄩ敊璇�:', err);
-				});
 			},
 			// 澶嶉�夋鍙樺寲浜嬩欢
 			checkboxChange(e) {
@@ -375,7 +400,7 @@
 				this.form.forkliftOperator = this.checkboxList
 					.filter((item) => item.checked)
 					.map((item) => item.label)
-					.join(',');
+					.join(",");
 			},
 			cancel() {},
 			openForkliftDriverList() {
@@ -390,34 +415,82 @@
 				}
 				const selectedIndex = e.target.value;
 				const selectedCustomer = storage[selectedIndex];
-
+        console.log("selectedCustomer", selectedCustomer);
+        console.log("selectedIndex", selectedIndex);
 				// 妫�鏌ユ槸鍚﹂�夋嫨浜嗙浉鍚岀殑瀹㈡埛
 				if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
 					uni.showToast({
-						title: '涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�',
-						icon: 'none'
+						title: "涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�",
+						icon: "none",
 					});
 					return;
 				}
 				if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
 					uni.showToast({
-						title: '涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�',
-						icon: 'none'
+						title: "涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�",
+						icon: "none",
 					});
 					return;
 				}
-
+				// 妫�鏌ユ槸鍚﹂�夋嫨浜嗗鎴峰悕绉扮浉鍚岀殑瀹㈡埛
+				if (code === "customerName1" && this.selClientIndex2 !== null) {
+					const otherCustomer = storage[this.selClientIndex2];
+					if (selectedCustomer.label === otherCustomer.label) {
+						uni.showToast({
+							title: "涓嶈兘閫夋嫨瀹㈡埛鍚嶇О鐩稿悓鐨勫鎴�",
+							icon: "none",
+						});
+						return;
+					}
+				}
+				if (code === "customerName2" && this.selClientIndex1 !== null) {
+					const otherCustomer = storage[this.selClientIndex1];
+					if (selectedCustomer.label === otherCustomer.label) {
+						uni.showToast({
+							title: "涓嶈兘閫夋嫨瀹㈡埛鍚嶇О鐩稿悓鐨勫鎴�",
+							icon: "none",
+						});
+						return;
+					}
+				}
+				// 妫�鏌ヤ笉鍚屽鎴风殑鏀惰揣鍦板潃銆佽仈绯讳汉銆佽仈绯荤數璇濇槸鍚︾浉鍚�
+				if (code === "customerName1" && this.selClientIndex2 !== null) {
+					const otherCustomer = storage[this.selClientIndex2];
+					if (selectedCustomer.receiverAddress !== otherCustomer.receiverAddress ||
+						selectedCustomer.contactPerson !== otherCustomer.contactPerson ||
+						selectedCustomer.contactPhone !== otherCustomer.contactPhone) {
+						uni.showToast({
+							title: "涓や釜瀹㈡埛鐨勬敹璐у湴鍧�銆佽仈绯讳汉鎴栬仈绯荤數璇濅笉鐩稿悓锛屼笉鑳藉悓鏃堕�夋嫨",
+							icon: "none",
+						});
+						return;
+					}
+				}
+				if (code === "customerName2" && this.selClientIndex1 !== null) {
+					const otherCustomer = storage[this.selClientIndex1];
+					if (selectedCustomer.receiverAddress !== otherCustomer.receiverAddress ||
+						selectedCustomer.contactPerson !== otherCustomer.contactPerson ||
+						selectedCustomer.contactPhone !== otherCustomer.contactPhone) {
+						uni.showToast({
+							title: "涓や釜瀹㈡埛鐨勬敹璐у湴鍧�銆佽仈绯讳汉鎴栬仈绯荤數璇濅笉鐩稿悓锛屼笉鑳藉悓鏃堕�夋嫨",
+							icon: "none",
+						});
+						return;
+					}
+				}
 				if (code === "customerName2") {
 					this.selClientIndex2 = selectedIndex;
 					this.form.customerName2 = selectedCustomer.label;
 					this.form.shippingNoticeNo2 = selectedCustomer.shippingNoticeNo;
+					this.form.customerNo2 = selectedCustomer.customerNo;
 					this.id2 = selectedCustomer.id;
 				}
 				if (code === "customerName1") {
 					this.selClientIndex1 = selectedIndex;
 					this.form.customerName1 = selectedCustomer.label;
 					this.form.shippingNoticeNo1 = selectedCustomer.shippingNoticeNo;
-					this.id1 = selectedCustomer.id
+					this.form.customerNo1 = selectedCustomer.customerNo;
+					this.id1 = selectedCustomer.id;
 				}
 			},
 			// 鐢熶骇杞﹂棿
@@ -429,32 +502,32 @@
 
 				const productType = this.form.productType;
 				const selectedWorkshop = storage[e.target.value];
-
-				// 妫�鏌ヤ骇鍝佺被鍨嬫槸鍚︿负閾滄潌(鍊间负2)
-				if (productType === '2') {
+				console.log('閫夋嫨鐨勮溅闂�:', selectedWorkshop);
+				// 妫�鏌ヤ骇鍝佺被鍨嬫槸鍚︿负閾滄潌(鍊间负TG01)
+				if (productType === "TG01") {
 					// 閾滄潌鍙兘閫夋嫨閾滄潌鐩稿叧杞﹂棿
-					if (!selectedWorkshop.label.includes('閾滄潌')) {
+					if (!selectedWorkshop.label.includes("閾滄潌")) {
 						uni.showModal({
 							title: "鎻愮ず",
 							content: "閾滄潌浜у搧鍙兘閫夋嫨閾滄潌鐩稿叧杞﹂棿",
-							showCancel: false
+							showCancel: false,
 						});
 						return;
 					}
 				} else {
 					// 瀵间綋浜у搧涓嶈兘閫夋嫨閾滄潌杞﹂棿
-					if (selectedWorkshop.label.includes('閾滄潌')) {
+					if (selectedWorkshop.label.includes("閾滄潌")) {
 						uni.showModal({
 							title: "鎻愮ず",
 							content: "瀵间綋浜у搧涓嶈兘閫夋嫨閾滄潌杞﹂棿",
-							showCancel: false
+							showCancel: false,
 						});
 						return;
 					}
 				}
 
 				this.workshopIndex = e.target.value;
-				this.form.workshop = selectedWorkshop.label;
+				this.form.workshop = selectedWorkshop.value;
 			},
 			// 鍙哥鍛�
 			weighmanChange(e, storage) {
@@ -476,7 +549,7 @@
 			 */
 			handleProductTypeChange() {
 				this.workshopIndex = null;
-				this.form.workshop = '';
+				this.form.workshop = "";
 			},
 			// 鎻愪氦鎸夐挳
 			async submit() {
@@ -484,11 +557,23 @@
 
 				try {
 					// 缁熶竴琛ㄥ崟楠岃瘉
-					if (!await this.validateForm()) return;
-
+					if (!(await this.validateForm())) return;
 					// 鏋勫缓鎻愪氦鏁版嵁
-					const submitData = this.buildSubmitData().customerList;
-					console.log('鎻愪氦鐨勬暟鎹�',submitData)
+					//  const submitData = this.buildSubmitData().customerList;
+					const submitData = {
+						customerName1: this.form.customerName1,
+						shippingNoticeNo1: this.form.shippingNoticeNo1,
+						customerName2: this.form.customerName2,
+						shippingNoticeNo2: this.form.shippingNoticeNo2,
+						customerNo1: this.form.customerNo1,
+						customerNo2: this.form.customerNo2,
+						productType: this.form.productType,
+						licensePlate: this.form.licensePlate,
+						workshop: this.form.workshop,
+						weighingOperator: this.form.weighingOperator,
+						forkliftOperator: this.form.forkliftOperator,
+					}
+					console.log("鎻愪氦鐨勬暟鎹�", submitData);
 					this.isSubmitting = true;
 					const res = await this.$u.api.NuclearScaleEntry.createMain(submitData);
 
@@ -497,29 +582,29 @@
 						uni.navigateBack();
 					} else {
 						uni.showToast({
-							title: res.msg || '鎻愪氦澶辫触锛氫笟鍔″鐞嗛敊璇�',
-							icon: 'none'
+							title: res.msg || "鎻愪氦澶辫触锛氫笟鍔″鐞嗛敊璇�",
+							icon: "none",
 						});
-						console.error('涓氬姟閿欒:', res);
+						console.error("涓氬姟閿欒:", res);
 					}
 				} catch (err) {
-					if (err.type === 'validation') {
+					if (err.type === "validation") {
 						uni.showToast({
 							title: err.message,
-							icon: 'none'
+							icon: "none",
 						});
-					} else if (err.message.includes('Network Error')) {
+					} else if (err.message.includes("Network Error")) {
 						uni.showToast({
-							title: '缃戠粶杩炴帴閿欒锛岃妫�鏌ョ綉缁滃悗閲嶈瘯',
-							icon: 'none'
+							title: "缃戠粶杩炴帴閿欒锛岃妫�鏌ョ綉缁滃悗閲嶈瘯",
+							icon: "none",
 						});
 					} else {
 						uni.showToast({
-							title: '绯荤粺閿欒锛岃绋嶅悗閲嶈瘯',
-							icon: 'none'
+							title: "绯荤粺閿欒锛岃绋嶅悗閲嶈瘯",
+							icon: "none",
 						});
 					}
-					console.error('鎻愪氦琛ㄥ崟閿欒:', err);
+					console.error("鎻愪氦琛ㄥ崟閿欒:", err);
 				} finally {
 					this.isSubmitting = false;
 				}
@@ -528,40 +613,43 @@
 			// 缁熶竴琛ㄥ崟楠岃瘉
 			async validateForm() {
 				// 浣跨敤uView琛ㄥ崟楠岃瘉
-				if (!await this.$refs.uForm.validate()) {
+				if (!(await this.$refs.uForm.validate())) {
 					return false;
 				}
 
-				// 瀹㈡埛鍚嶇О楠岃瘉
-				if (!this.form.customerName1 || !this.form.customerName2) {
-					throw { type: 'validation', message: '璇峰厛閫夋嫨瀹㈡埛鍚嶇О' };
+				// 瀹㈡埛鍚嶇О楠岃瘉 - 淇敼涓鸿嚦灏戞湁涓�涓湁鍊�
+				if (!this.form.customerName1 && !this.form.customerName2) {
+					throw {
+						type: "validation",
+						message: "璇疯嚦灏戦�夋嫨涓�涓鎴峰悕绉�"
+					};
 				}
 
 				return true;
 			},
 
-			// 鏋勫缓鎻愪氦鏁版嵁
-			buildSubmitData() {
-				// 鍒涘缓瀹㈡埛鏁版嵁鐨勮緟鍔╁嚱鏁�
-				const createCustomerItem = (customerIndex) => ({
-					customerName: this.form[`customerName${customerIndex}`],
-					shippingNoticeNo: this.form[`shippingNoticeNo${customerIndex}`],
-					shippingNoticeId: this[`id${customerIndex}`],
-					replace: this.form.replace,
-					productType: this.form.productType,
-					licensePlate: this.form.licensePlate,
-					workshop: this.form.workshop,
-					weighingOperator: this.form.weighingOperator,
-					forkliftOperator: this.form.forkliftOperator,
-				});
+			// // 鏋勫缓鎻愪氦鏁版嵁
+			// buildSubmitData() {
+			//   // 鍒涘缓瀹㈡埛鏁版嵁鐨勮緟鍔╁嚱鏁�
+			//   const createCustomerItem = (customerIndex) => ({
+			//     customerName: this.form[`customerName${customerIndex}`],
+			//     shippingNoticeNo: this.form[`shippingNoticeNo${customerIndex}`],
+			//     shippingNoticeId: this[`id${customerIndex}`],
+			//     replace: this.form.replace,
+			//     productType: this.form.productType,
+			//     licensePlate: this.form.licensePlate,
+			//     workshop: this.form.workshop,
+			//     weighingOperator: this.form.weighingOperator,
+			//     forkliftOperator: this.form.forkliftOperator,
+			//   });
 
-				// 鏋勫缓瀹㈡埛鍒楄〃
-				const customerList = [1, 2].map(createCustomerItem);
+			//   // 鏋勫缓瀹㈡埛鍒楄〃
+			//   const customerList = [1, 2].map(createCustomerItem);
 
-				return {
-					customerList
-				};
-			},
+			//   return {
+			//     customerList,
+			//   };
+			// },
 		},
 	};
 </script>
@@ -592,7 +680,7 @@
 
 	.confirm-btn {
 		color: #007aff;
-		font-size: 28rpx;
+		font-size: small;
 	}
 
 	/* 澶嶉�夋鏍峰紡 */
@@ -619,13 +707,13 @@
 	}
 
 	.item-one {
-		font-size: 30rpx;
+		font-size: small;
 		color: #0c0c0c;
 		margin-right: 6rpx;
 	}
 
 	.item-two {
-		font-size: 30rpx;
+		font-size: small;
 		color: #a5abb4;
 		margin-right: 6rpx;
 	}

--
Gitblit v1.9.3