瀏覽代碼

bug解决

cz 2 年之前
父節點
當前提交
a6fe2ab37d
共有 2 個文件被更改,包括 15 次插入10 次删除
  1. 5 4
      src/views/order-management/order/addOrder.vue
  2. 10 6
      src/views/purchase-management/purchase/addPurchase.vue

+ 5 - 4
src/views/order-management/order/addOrder.vue

@@ -222,12 +222,14 @@
 
         <el-row>
           <el-col :span="4">
-            <el-form-item label="订单金额" prop="code">
-              <el-input
+            <el-form-item label="订单金额" prop="money">
+              <el-input-number
                 v-model="form.money"
+                :precision="2"
+                :controls="false"
                 placeholder="请输入"
                 disabled
-              ></el-input>
+              ></el-input-number>
             </el-form-item>
           </el-col>
         </el-row>
@@ -555,7 +557,6 @@ export default {
         this.form.money = this.form.orderDetailsList.reduce((sum, x) => {
           return sum + Number(x.subtotal);
         }, 0);
-        console.log(this.form.orderDetailsList, "sss");
       }
     },
     handleSuccess(response, file, fileList) {

+ 10 - 6
src/views/purchase-management/purchase/addPurchase.vue

@@ -86,7 +86,9 @@
             </el-table-column>
             <el-table-column label="小计" prop="sum">
               <template slot-scope="scope">
-                <span>{{ scope.row.unitPrice * scope.row.quantity }}</span>
+                <div>
+                  {{ (scope.row.quantity * scope.row.unitPrice).toFixed(2) }}
+                </div>
               </template>
             </el-table-column>
 
@@ -199,10 +201,13 @@ export default {
     handleCancel() {
       this.$emit("cancel");
     },
-    handleChange() {
-      this.form.goodsList.forEach((x) => {
-        x.sum = (x.quantity * (Number(x.unitPrice) * 100)) / 100;
-      });
+    handleChange() {},
+    deleteRow(index) {
+      if (this.form.goodsList.length === 1) {
+        return this.msgInfo("已经是最后一条数据啦!");
+      }
+      this.form.goodsList.splice(index, 1);
+      this.msgSuccess("删除成功");
     },
     handleChangeSupply(val) {
       const productIdList = this.form.goodsList.map((x) => {
@@ -220,7 +225,6 @@ export default {
             }
           } else {
             this.form.goodsList[i].unitPrice = "";
-            return;
           }
         }
       });