From 5e10fe06e80c7d146cbb5eb8f7b3e1e447a80b88 Mon Sep 17 00:00:00 2001 From: haoyahui <2032914783@qq.com> Date: 星期五, 17 十一月 2023 17:07:53 +0800 Subject: [PATCH] 部门物品:物品分发,物品报废静态。调拨管理联调,price由元改为分,仓库管理库管员 --- admin-web/src/views/stock/procure/purchaseOrder/edit.vue | 35 +++++++++++++++++++++++++---------- 1 files changed, 25 insertions(+), 10 deletions(-) diff --git a/admin-web/src/views/stock/procure/purchaseOrder/edit.vue b/admin-web/src/views/stock/procure/purchaseOrder/edit.vue index 9ed3d61..7d8cc0c 100644 --- a/admin-web/src/views/stock/procure/purchaseOrder/edit.vue +++ b/admin-web/src/views/stock/procure/purchaseOrder/edit.vue @@ -68,7 +68,7 @@ :rules="rules.baseGoodsTemplateId" > <el-select - v-model="goodsItem.baseGoodsTemplateId" + v-model="goodsItem.baseGoodsTemplateId" placeholder="璇峰厛鎷╃墿鍝佸垎绫�" filterable :disabled="!goodsItem.baseCategoryId" @@ -131,15 +131,19 @@ {{ scope.row.unit }} </template> </el-table-column> - <el-table-column prop="price" label="鍗曚环锛堝厓锛�" align="center"> + <el-table-column prop="priceYuan" label="鍗曚环锛堝厓锛�" align="center"> <template slot-scope="scope"> <el-form-item label-width="0" style="margin-bottom: 0" - :prop="`procureGoods[${goodsIndex}].models[${scope.$index}].price`" - :rules="rules.price" + :prop="`procureGoods[${goodsIndex}].models[${scope.$index}].priceYuan`" + :rules="rules.priceYuan" > - <el-input type="number" v-model.number="scope.row.price"></el-input> + <el-input + type="number" + v-model.number="scope.row.priceYuan" + @change="priceChange($event, goodsIndex, scope.$index)" + ></el-input> </el-form-item> </template> </el-table-column> @@ -218,13 +222,14 @@ return callback(new Error('璇烽�夋嫨')); } let temp = this.formData.procureGoods.filter((v) => v.baseGoodsTemplateId == value); - if (!temp || temp.length!=1) { + if (!temp || temp.length != 1) { return callback(new Error('宸查�夎繃姝ょ墿鍝�')); } callback(); }; // 閲戦鏍¢獙 var checkPrice = (rule, value, callback) => { + console.log(value); if (!value) { return callback(new Error('璇疯緭鍏�')); } @@ -236,7 +241,7 @@ }; // 鏁伴噺鏍¢獙 var checkCounts = (rule, value, callback) => { - console.log(value) + console.log(value); if (!value) { return callback(new Error('璇疯緭鍏�')); } @@ -287,7 +292,8 @@ }, modelsItem: { baseGoodsModelsId: '', // 瑙勬牸鍨嬪彿缂栧彿 - price: null, // 鍗曚环(閲囪喘闇�瑕侊紝璋冩嫧涓嶉渶瑕�) + priceYuan: null, // 鍗曚环(鍏�) + price: null, // 鍗曚环(鍒� 閲囪喘闇�瑕侊紝璋冩嫧涓嶉渶瑕�) counts: null, // 鎿嶄綔鏁伴噺 unit: null, //鍗曚綅 }, @@ -300,7 +306,7 @@ baseCategoryIds: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }], baseGoodsTemplateId: [{ validator: checkGoodsTemplateId, trigger: ['blur', 'change'] }], modelsIds: [{ required: true, message: '璇烽�夋嫨', trigger: 'change' }], - price: [{ validator: checkPrice, trigger: 'blur' }], + priceYuan: [{ validator: checkPrice, trigger: 'blur' }], counts: [{ validator: checkCounts, trigger: 'blur' }], }, @@ -349,6 +355,9 @@ ); this.getgoodsTemplate(item.baseCategoryId, index); this.getgoodsModel(item.baseGoodsTemplateId, index); + item.models.forEach((child, childIndex) => { + this.$set(this.formData.procureGoods[index].models[childIndex], 'priceYuan', child.price / 100); + }); return item; }); } @@ -468,6 +477,11 @@ this.formData.procureGoods[index].models.splice(delIndex, 1); }, + // 浠锋牸input鐩戝惉 杞负鍒� + priceChange(e, goodsIndex, index) { + this.formData.procureGoods[goodsIndex].models[index].price = e * 100; + }, + // 涓婁紶 uploadChange() { let arr = this.$refs.uploadRef.fileList; @@ -488,7 +502,8 @@ handleSubmit() { this.$refs['ruleForm'].validate((valid) => { if (valid) { - console.log('this.formData', this.formData); + console.log('formData', this.formData); + debugger; if (!this.setting.id) { procureAdd(this.formData) .then((res) => { -- Gitblit v1.9.1