Procházet zdrojové kódy

测试问题解决

cz před 2 roky
rodič
revize
58a8d5a3e5

+ 7 - 2
src/views/purchase-management/purchase/addPurchase.vue

@@ -77,13 +77,13 @@
                     v-model="scope.row.unitPrice"
                     placeholder="请输入"
                     size="mini"
+                    @change="handleChange"
                   >
                   </el-input>
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column label="小计" prop="stockQuantity">
-            </el-table-column>
+            <el-table-column label="小计" prop="sum"> </el-table-column>
 
             <el-table-column label="操作" width="100" align="left">
               <template slot-scope="scope">
@@ -170,6 +170,11 @@ export default {
     handleCancel() {
       this.$emit("cancel");
     },
+    handleChange() {
+      this.form.goodsList.forEach((x) => {
+        x.sum = (x.quantity * (Number(x.unitPrice) * 100)) / 100;
+      });
+    },
   },
 };
 </script>

+ 1 - 1
src/views/purchase-management/purchase/index.vue

@@ -140,7 +140,7 @@ export default {
       this.selectData = arr;
     },
     handlePurchase(row) {
-      const goodsList = [{ ...row, unitPrice: "" }];
+      const goodsList = [{ ...row, unitPrice: "", sum: "" }];
       this.form = {
         flowId: "",
         flowRemark: "",