From 9cb5cd3735f58bd62c3ad0d20b89646801bc05bf Mon Sep 17 00:00:00 2001 From: yangan <yangan0921@163.com> Date: 星期三, 10 一月 2024 17:20:26 +0800 Subject: [PATCH] 验质页面增加单价 --- pages/public-page/selectSpecifications/selectSpecifications.vue | 65 ++++++++++++++++++++++++-------- 1 files changed, 48 insertions(+), 17 deletions(-) diff --git a/pages/public-page/selectSpecifications/selectSpecifications.vue b/pages/public-page/selectSpecifications/selectSpecifications.vue index 5b2330a..f211140 100644 --- a/pages/public-page/selectSpecifications/selectSpecifications.vue +++ b/pages/public-page/selectSpecifications/selectSpecifications.vue @@ -45,22 +45,32 @@ @input="$u.debounce(specInputHandle, 500)"></u-input> </u-form-item> <!-- 鏂板涓嶅悎鏍肩О閲� --> - <u-form-item label="涓嶅悎鏍肩綒娆�" + <u-form-item label="涓嶅悎鏍奸噸閲�" prop="unqualifiedWeight" borderBottom> <u-input v-model="dataForm.unqualifiedWeight" - placeholder="璇疯緭缃氭" + placeholder="璇疯緭鍏ラ噸閲�" type="digit" border="bottom" - @change="v=>checkNum(v)" + @change="v=>checkNum(v,'unqualifiedWeight')" @input="$u.debounce(specInputHandle, 500)"></u-input> </u-form-item> - <u-form-item label="涓嶅悎鏍煎垽瀹�" prop="unqualifiedType"> + <!-- <u-form-item label="涓嶅悎鏍煎垽瀹�" prop="unqualifiedType"> <u-radio-group size='32' v-model="dataForm.unqualifiedType"> <u-radio :label-size="25" :name="'1'" :label="'瓒呭昂鎵g綒'" :disabled="disabled">闀垮害鎵g綒</u-radio> <u-radio :label-size="25" :name="'2'" :label="'鍘氬害鎵g綒'" :disabled="disabled">鍘氬害鎵g綒</u-radio> <u-radio :label-size="25" :name="'3'" :label="'瀵嗛棴鍣�'" :disabled="disabled">瀵嗛棴鍣�</u-radio> </u-radio-group> + </u-form-item> --> + <u-form-item label="鍗曚环" + prop="penaltyUnitPrice" + borderBottom> + <u-input v-model="dataForm.penaltyUnitPrice" + placeholder="璇疯緭鍏ヤ笉鍚堟牸鍗曚环" + type="digit" + border="bottom" + @change="v=>checkNum(v,'penaltyUnitPrice')" + @input="$u.debounce(specInputHandle, 500)"></u-input> </u-form-item> </u--form> <Transition name="slide-fade"> @@ -109,7 +119,8 @@ secondClass: "", specifications: "", unqualifiedWeight:'', - unqualifiedType:'' + // unqualifiedType:'', + penaltyUnitPrice:'' }, index: '', takeCoalId: "", @@ -150,7 +161,12 @@ message: '璇烽�夋嫨鍊�', trigger: ['blur', 'change'] }, - 'unqualifiedType':{ + // 'unqualifiedType':{ + // required: true, + // message: '璇烽�夋嫨鍊�', + // trigger: ['blur', 'change'] + // }, + 'penaltyUnitPrice':{ required: true, message: '璇烽�夋嫨鍊�', trigger: ['blur', 'change'] @@ -209,7 +225,9 @@ Object.assign(this.dataForm,{firstClass,secondClass,specifications}); this.dataForm.unqualifiedWeight = this.showWeighCopyStorge[params.index].unqualifiedWeights.split(',')[params.indexTo]; //涓嶅悎鏍肩被鍒ゅ畾 - this.dataForm.unqualifiedType = this.showWeighCopyStorge[params.index].unqualifiedType.split(',')[params.indexTo]; + // this.dataForm.unqualifiedType = this.showWeighCopyStorge[params.index].unqualifiedType.split(',')[params.indexTo]; + //鍗曚环 + this.dataForm.penaltyUnitPrice = this.showWeighCopyStorge[params.index].penaltyUnitPrice.split(',')[params.indexTo]; }, //涓�绾у搧绫昏彍鍗� firstClassSelect() { @@ -294,12 +312,15 @@ let tempArr = this.showWeighCopyStorge[this.index].unqualifiedBreed.split(",") let tempWeightArr = this.showWeighCopyStorge[this.index].unqualifiedWeights.split(",") let noPinArr =this.showWeighCopyStorge[this.index].unqualifiedType.split(",") + let noPriceArr = this.showWeighCopyStorge[this.index].penaltyUnitPrice.split(","); tempArr[this.params.indexTo] = str; tempWeightArr[this.params.indexTo] = this.dataForm.unqualifiedWeight; - noPinArr[this.params.indexTo] = this.dataForm.unqualifiedType; + // noPinArr[this.params.indexTo] = this.dataForm.unqualifiedType; + noPriceArr[this.params.indexTo] = this.dataForm.penaltyUnitPrice; this.showWeighCopyStorge[this.index].unqualifiedBreed = tempArr.join(','); this.showWeighCopyStorge[this.index].unqualifiedWeights = tempWeightArr.join(','); this.showWeighCopyStorge[this.index].unqualifiedType = noPinArr.join(','); + this.showWeighCopyStorge[this.index].penaltyUnitPrice = noPriceArr.join(','); this.showWeighCopyStorge[this.index].breed = this.dataForm.secondClass this.showWeighCopyStorge[this.index].spec = this.dataForm.specifications //濡傛灉杩欎釜 tempArr涓嶄负 绌� @@ -337,19 +358,29 @@ tempWeightArr = []; } // 娣诲姞涓嶅悎鏍煎搧绫诲垽瀹� - let noPin; - if(this.showWeighCopyStorge[this.index].unqualifiedType){ - noPin = this.showWeighCopyStorge[this.index].unqualifiedType.split(",").filter(Boolean) + // let noPin; + // if(this.showWeighCopyStorge[this.index].unqualifiedType){ + // noPin = this.showWeighCopyStorge[this.index].unqualifiedType.split(",").filter(Boolean) + // }else{ + // noPin = [] + // } + //娣诲姞涓嶅悎鏍煎崟浠� + let noPrice; + if(this.showWeighCopyStorge[this.index].penaltyUnitPrice){ + noPrice = this.showWeighCopyStorge[this.index].penaltyUnitPrice.split(",").filter(Boolean) }else{ - noPin = [] + noPrice = [] } - + tempWeightArr.push(this.dataForm.unqualifiedWeight); tempArr.push(str); - noPin.push(this.dataForm.unqualifiedType) + // noPin.push(this.dataForm.unqualifiedType) + noPrice.push(this.dataForm.penaltyUnitPrice) this.showWeighCopyStorge[this.index].unqualifiedBreed = tempArr.join(',') this.showWeighCopyStorge[this.index].unqualifiedWeights = tempWeightArr.join(',') - this.showWeighCopyStorge[this.index].unqualifiedType = noPin.join(',') + // this.showWeighCopyStorge[this.index].unqualifiedType = noPin.join(',') + this.showWeighCopyStorge[this.index].penaltyUnitPrice = noPrice.join(',') + this.showWeighCopyStorge[this.index].breed = this.dataForm.secondClass this.showWeighCopyStorge[this.index].spec = this.dataForm.specifications @@ -386,7 +417,7 @@ }) }, - checkNum(value){ + checkNum(value,name){ if ( value && value.indexOf(".") < 0 && @@ -399,7 +430,7 @@ } // 濡傛灉娌℃湁灏忔暟鐐癸紝棣栦綅涓嶈兘涓虹被浼间簬 01銆�02鐨勫�� this.$nextTick(()=>{ - this.dataForm.unqualifiedWeight = value.replace(/[^\d.]/g, ""); + this.dataForm[name] = value.replace(/[^\d.]/g, ""); }); } -- Gitblit v1.9.1