From d24b706b7f1b88e0982346dd2afa4f083ae7cb0e Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 23 九月 2025 10:03:41 +0800
Subject: [PATCH] PDA核磅录入页面创建时客户名称选择逻辑修改,至少选择一个客户,解决叉车工选择弹框不能滚动问题
---
pages/wareHouse/nuclearScale/createwriteoffform.vue | 75 +++++++++++++++++++------------------
pages/wareHouse/nuclearScale/index.vue | 4 +-
2 files changed, 41 insertions(+), 38 deletions(-)
diff --git a/pages/wareHouse/nuclearScale/createwriteoffform.vue b/pages/wareHouse/nuclearScale/createwriteoffform.vue
index 29fcb08..2a2b921 100644
--- a/pages/wareHouse/nuclearScale/createwriteoffform.vue
+++ b/pages/wareHouse/nuclearScale/createwriteoffform.vue
@@ -98,7 +98,7 @@
:border-bottom="false"
prop="shippingNoticeNo1"
style="font-size: small"
- :label-width="245"
+ :label-width="245"
>
<u-input v-model="form.shippingNoticeNo1" placeholder="" disabled />
</u-form-item>
@@ -141,7 +141,7 @@
:border-bottom="false"
prop="shippingNoticeNo2"
style="font-size: small"
- :label-width="245"
+ :label-width="245"
>
<u-input v-model="form.shippingNoticeNo2" placeholder="" disabled />
</u-form-item>
@@ -247,22 +247,25 @@
@confirm="confirmSelection"
@cancel="cancel"
>
- <scroll-view scroll-y="true" style="height: 100%; transform: translateZ(0); -webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;"></scroll-view>
- <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>
- <scroll-view/>
</u-modal>
</div>
</template>
@@ -564,21 +567,21 @@
const selectedIndex = e.target.value;
const selectedCustomer = storage[selectedIndex];
- // 妫�鏌ユ槸鍚﹂�夋嫨浜嗙浉鍚岀殑瀹㈡埛
- if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
- uni.showToast({
- title: "涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�",
- icon: "none",
- });
- return;
- }
- if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
- uni.showToast({
- title: "涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�",
- icon: "none",
- });
- return;
- }
+ // // 妫�鏌ユ槸鍚﹂�夋嫨浜嗙浉鍚岀殑瀹㈡埛
+ // if (code === "customerName1" && this.selClientIndex2 === selectedIndex) {
+ // uni.showToast({
+ // title: "涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�",
+ // icon: "none",
+ // });
+ // return;
+ // }
+ // if (code === "customerName2" && this.selClientIndex1 === selectedIndex) {
+ // uni.showToast({
+ // title: "涓嶈兘閫夋嫨鐩稿悓鐨勫鎴�",
+ // icon: "none",
+ // });
+ // return;
+ // }
if (code === "customerName2") {
this.selClientIndex2 = selectedIndex;
@@ -658,7 +661,7 @@
try {
// 缁熶竴琛ㄥ崟楠岃瘉
if (!(await this.validateForm())) return;
-
+ // 绉婚櫎鍐椾綑鐨勯獙璇佷唬鐮�
// 鏋勫缓鎻愪氦鏁版嵁
const submitData = this.buildSubmitData().customerList;
console.log("鎻愪氦鐨勬暟鎹�", submitData);
@@ -705,9 +708,9 @@
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;
diff --git a/pages/wareHouse/nuclearScale/index.vue b/pages/wareHouse/nuclearScale/index.vue
index 4f8a5c4..2b122f4 100644
--- a/pages/wareHouse/nuclearScale/index.vue
+++ b/pages/wareHouse/nuclearScale/index.vue
@@ -417,9 +417,9 @@
.then((res) => {
this.$u.toast("鎻愪氦鎴愬姛");
})
- .catch(() => {
+ .catch((err) => {
uni.hideLoading();
- this.$u.toast("缃戠粶寮傚父锛岃閲嶈瘯");
+ this.$u.toast(err.message || "缃戠粶寮傚父锛岃閲嶈瘯");
});
},
--
Gitblit v1.9.3