| | |
| | | <u-radio name="DT02">导体2.6</u-radio> |
| | | </u-radio-group> |
| | | </u-form-item> |
| | | <u-form-item |
| | | <!-- <u-form-item |
| | | label="替换二维码:" |
| | | :border-bottom="false" |
| | | prop="replace" |
| | |
| | | <u-radio name="1">是</u-radio> |
| | | <u-radio name="0">否</u-radio> |
| | | </u-radio-group> |
| | | </u-form-item> |
| | | </u-form-item> --> |
| | | <u-form-item |
| | | label="车牌号:" |
| | | :border-bottom="false" |
| | |
| | | :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> |
| | |
| | | :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> |
| | |
| | | @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> |
| | |
| | | show: false, |
| | | num: 1, |
| | | form: { |
| | | replace: "0", |
| | | // replace: "0", |
| | | productType: "", |
| | | licensePlate: "", |
| | | customerName1: "", |
| | |
| | | trigger: ["change"], |
| | | }, |
| | | ], |
| | | replace: [ |
| | | { |
| | | required: true, |
| | | message: "请选择是否替换二维码", |
| | | trigger: ["change", "blur"], |
| | | }, |
| | | ], |
| | | // replace: [ |
| | | // { |
| | | // required: true, |
| | | // message: "请选择是否替换二维码", |
| | | // trigger: ["change", "blur"], |
| | | // }, |
| | | // ], |
| | | licensePlate: [ |
| | | { |
| | | required: true, |
| | |
| | | onShow() { |
| | | // 重置表单数据 |
| | | this.form = { |
| | | replace: "0", |
| | | // replace: "0", |
| | | productType: "", |
| | | licensePlate: "", |
| | | customerName1: "", |
| | |
| | | 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; |
| | | 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.form.customerNo1 = selectedCustomer.customerNo; |
| | | this.id1 = selectedCustomer.id; |
| | | } |
| | | }, |
| | |
| | | try { |
| | | // 统一表单验证 |
| | | if (!(await this.validateForm())) return; |
| | | |
| | | // 构建提交数据 |
| | | const submitData = this.buildSubmitData().customerList; |
| | | // 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); |
| | |
| | | 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> |