From 6fdf1bc4b692b7466c57bfc08bfc56735e96286b Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期一, 24 十一月 2025 13:43:53 +0800
Subject: [PATCH] 核磅录入增加直发类型得选择和磅差计算

---
 pages/wareHouse/nuclearScale/createwriteoffform.vue |  206 +++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 166 insertions(+), 40 deletions(-)

diff --git a/pages/wareHouse/nuclearScale/createwriteoffform.vue b/pages/wareHouse/nuclearScale/createwriteoffform.vue
index 8ac0329..9de5390 100644
--- a/pages/wareHouse/nuclearScale/createwriteoffform.vue
+++ b/pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -23,16 +23,17 @@
         label="浜у搧绫诲瀷锛�"
         :border-bottom="false"
         prop="productType"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <u-radio-group
           v-model="form.productType"
           @change="handleProductTypeChange"
-          style="font-size: small"
+          class="radio-group-large"
         >
-          <u-radio name="DT01">瀵间綋</u-radio>
-          <u-radio name="TG01">閾滄潌</u-radio>
-          <u-radio name="DT02">瀵间綋2.6</u-radio>
+          <u-radio name="DT01" class="radio-large">瀵间綋</u-radio>
+          <u-radio name="TG01" class="radio-large">閾滄潌</u-radio>
+          <u-radio name="DT02" class="radio-large">瀵间綋2.6</u-radio>
+          <!-- <u-radio name="ZF01" class="radio-large">鐩村彂</u-radio> -->
         </u-radio-group>
       </u-form-item>
       <!-- <u-form-item
@@ -50,24 +51,34 @@
         label="杞︾墝鍙凤細"
         :border-bottom="false"
         prop="licensePlate"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <u-input
           v-model="form.licensePlate"
           type="select"
           placeholder="璇疯緭鍏ヨ溅鐗屽彿"
           @click="lpn"
+          :custom-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
+          :input-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
         />
       </u-form-item>
       <u-form-item
         label="瀹㈡埛鍚嶇О1锛�"
         :border-bottom="false"
         prop="customerName1"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <picker
           class="item-one item-two"
-          style="width: 100%; text-align: right"
+          style="width: 100%; font-size: 16px; text-align: right"
           @change="selClientChange($event, selClientList, 'customerName1')"
           :value="selClientIndex1"
           :range="selClientList"
@@ -94,23 +105,37 @@
         ></u-icon>
       </u-form-item>
       <u-form-item
-        label="鍙戣揣閫氱煡鍗曞彿1锛�"
+        label="鍙戣揣閫氱煡鍗曞彿锛�"
         :border-bottom="false"
         prop="shippingNoticeNo1"
-        style="font-size: small"
-        :label-width="245"
+        style="font-size: 16px; height: 40px"
+        :label-width="300"
       >
-        <u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
+        <u-input
+          v-model="form.shippingNoticeNo1"
+          placeholder=""
+          disabled
+          :custom-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
+          :input-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
+        />
       </u-form-item>
       <u-form-item
         label="瀹㈡埛鍚嶇О2锛�"
         :border-bottom="false"
         prop="customerName2"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <picker
           class="item-one item-two"
-          style="width: 100%; text-align: right"
+          style="width: 100%; font-size: 16px; text-align: right"
           @change="selClientChange($event, selClientList, 'customerName2')"
           :value="selClientIndex2"
           :range="selClientList"
@@ -137,23 +162,37 @@
         ></u-icon>
       </u-form-item>
       <u-form-item
-        label="鍙戣揣閫氱煡鍗曞彿2锛�"
+        label="鍙戣揣閫氱煡鍗曞彿锛�"
         :border-bottom="false"
         prop="shippingNoticeNo2"
-        style="font-size: small"
-        :label-width="245"
+        style="font-size: 16px; height: 40px"
+        :label-width="300"
       >
-        <u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
+        <u-input
+          v-model="form.shippingNoticeNo2"
+          placeholder=""
+          disabled
+          :custom-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
+          :input-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
+        />
       </u-form-item>
       <u-form-item
         label="鐢熶骇杞﹂棿锛�"
         :border-bottom="false"
         prop="workshop"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <picker
           class="item-one item-two"
-          style="width: 100%; text-align: right"
+          style="width: 100%; text-align: right; font-size: 16px"
           @change="workshopChange($event, workshopList)"
           :value="workshopIndex"
           :range="workshopList"
@@ -182,11 +221,11 @@
         label="鍙哥鍛橈細"
         :border-bottom="false"
         prop="weighingOperator"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <picker
           class="item-one item-two"
-          style="width: 100%; text-align: right"
+          style="width: 100%; text-align: right; font-size: 16px"
           @change="weighmanChange($event, weighmanList)"
           :value="weighmanIndex"
           :range="weighmanList"
@@ -214,12 +253,22 @@
         label="鍙夎溅宸ワ細"
         :border-bottom="false"
         prop="forkliftOperator"
-        style="font-size: small"
+        style="font-size: 16px; height: 40px"
       >
         <u-input
           v-model="form.forkliftOperator"
           type="select"
           placeholder="璇烽�夋嫨"
+          :custom-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
+          :input-style="{
+            fontSize: '16px',
+            height: '40px',
+            lineHeight: '40px',
+          }"
           @click="openForkliftDriverList"
         />
       </u-form-item>
@@ -416,6 +465,9 @@
                 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);
@@ -566,7 +618,8 @@
       }
       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({
@@ -582,7 +635,56 @@
         });
         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;
@@ -607,7 +709,7 @@
 
       const productType = this.form.productType;
       const selectedWorkshop = storage[e.target.value];
-      console.log('閫夋嫨鐨勮溅闂�:', selectedWorkshop);
+      console.log("閫夋嫨鐨勮溅闂�:", selectedWorkshop);
       // 妫�鏌ヤ骇鍝佺被鍨嬫槸鍚︿负閾滄潌(鍊间负TG01)
       if (productType === "TG01") {
         // 閾滄潌鍙兘閫夋嫨閾滄潌鐩稿叧杞﹂棿
@@ -630,7 +732,14 @@
           return;
         }
       }
-
+      if (selectedWorkshop.label.includes("鐩村彂") && productType !== "DT02") {
+        uni.showModal({
+          title: "鎻愮ず",
+          content: "鐩村彂浜у搧鍙兘閫夋嫨瀵间綋2.6杞﹂棿",
+          showCancel: false,
+        });
+        return;
+      }
       this.workshopIndex = e.target.value;
       this.form.workshop = selectedWorkshop.value;
     },
@@ -666,18 +775,18 @@
         // 鏋勫缓鎻愪氦鏁版嵁
         //  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,
-      }
+          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);
@@ -724,7 +833,10 @@
 
       // 瀹㈡埛鍚嶇О楠岃瘉 - 淇敼涓鸿嚦灏戞湁涓�涓湁鍊�
       if (!this.form.customerName1 && !this.form.customerName2) {
-        throw { type: "validation", message: "璇疯嚦灏戦�夋嫨涓�涓鎴峰悕绉�" };
+        throw {
+          type: "validation",
+          message: "璇疯嚦灏戦�夋嫨涓�涓鎴峰悕绉�",
+        };
       }
 
       return true;
@@ -819,4 +931,18 @@
   color: #a5abb4;
   margin-right: 6rpx;
 }
+
+/* 浜у搧绫诲瀷鍗曢�夌粍鏍峰紡 */
+.radio-group-large {
+  font-size: 16px !important;
+  height: 40px !important;
+  display: flex;
+  align-items: center;
+}
+
+.radio-large {
+  font-size: 15px !important;
+  // margin-right: 5px;
+  transform: scale(1.2);
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3