Jelajahi Sumber

【修改】退押审批、申请退押 合同金额

howie 2 tahun lalu
induk
melakukan
84b56298e6

+ 26 - 17
src/views/deposit_home/components/deposit-apply-surrender.vue

@@ -210,7 +210,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <template v-if="details.examineStatus !== 'WAIT'">
+                <template v-if="details.examineStatus !== 'SAVE'">
                   {{ scope.row.contractQty }}
                 </template>
                 <el-input
@@ -230,7 +230,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <template v-if="details.examineStatus !== 'WAIT'">
+                <template v-if="details.examineStatus !== 'SAVE'">
                   {{ scope.row.contractPrice }}
                 </template>
                 <el-input
@@ -241,7 +241,8 @@
                   clearable
                 ></el-input>
               </template>
-            </el-table-column>       <el-table-column
+            </el-table-column>
+            <el-table-column
               align="right"
               label="合同金额"
               prop="contractAmount"
@@ -255,14 +256,7 @@
                 <div v-else>
                   {{comTotal(scope.row.contractQty,scope.row.contractPrice)}}
                 </div>
-                <!-- <el-input
 
-                  readonly
-                  class="inpt"
-                  v-model="scope.row.contractAmount"
-                  size="mini"
-                  clearable
-                ></el-input> -->
               </template>
             </el-table-column>
           <el-table-column
@@ -518,19 +512,35 @@ export default {
       restrictFilename: [
         '结算单', '合同', '明细表', '审核表', '收据', '发票', '照片','相片'
       ],
-      comTotal(){
-      return (qty,price)=>{
-        console.log(qty,price);
-        return Number(qty) * Number(price)
-      }
-    }
+
     }
   },
     computed:{
     isCustomer(){
       return this.$store.getters.customerId && this.$store.getters.customerNumber
+    },
+    comTotal(){
+      return (qty,price)=>{
+
+        return Number(qty) * Number(price)
+      }
     }
   },
+  watch:{
+    "details.items": {
+      handler(newValue, oldValue) {
+          if (newValue && newValue.length) {
+            newValue.forEach((item, index) => {
+            item.contractAmount = Number(item.contractQty) * Number(item.contractPrice)
+          });
+
+          }
+        this.details.items = newValue;
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
   created() {
     this.imageURL = this.$imageUrl
     geDetail({ id: this.$parent.depositManageId }).then((res) => {
@@ -561,7 +571,6 @@ export default {
       }
 
       this.details.items.map(e=>{
-          e.contractAmount = e.contractQty * e.contractPrice
           if (!e.contractAmount) {
             return this.$errorMsg('合同单价、合同数量不能为空')
           }

+ 2 - 2
src/views/deposit_home/components/deposit_list-detail.vue

@@ -267,7 +267,7 @@
               min-width="160"
               show-overflow-tooltip
             />
-            <el-table-column
+            <!-- <el-table-column
               align="right"
               label="押金金额"
               prop="depositAmount"
@@ -277,7 +277,7 @@
               <template slot-scope="scope">
                 {{ scope.row.depositAmount | numToFixed }}
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               align="right"
               label="合同数量"

+ 22 - 7
src/views/deposit_home/components/refund_list-detail.vue

@@ -538,7 +538,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <template v-if="detailList.examineStatus !== 'WAIT'">
+                <template v-if="detailList.examineStatus !== 'SAVE'">
                   {{ scope.row.contractQty }}
                 </template>
                 <el-input
@@ -558,7 +558,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <template v-if="detailList.examineStatus !== 'WAIT'">
+                <template v-if="detailList.examineStatus !== 'SAVE'">
                   {{ scope.row.contractPrice }}
                 </template>
                 <el-input
@@ -569,7 +569,8 @@
                   clearable
                 ></el-input>
               </template>
-            </el-table-column>       <el-table-column
+            </el-table-column>
+              <el-table-column
               align="right"
               label="合同金额"
               prop="contractAmount"
@@ -577,7 +578,7 @@
               show-overflow-tooltip
             >
               <template slot-scope="scope">
-                <template v-if="detailList.examineStatus !== 'WAIT'">
+                <template v-if="detailList.examineStatus !== 'SAVE'">
                   {{ comTotal(scope.row.contractQty,scope.row.contractPrice) }}
                 </template>
                 <div v-else>
@@ -1023,6 +1024,21 @@ export default {
     this.checkBy = this.name;
     this.getData({ id: this.detailId });
   },
+  watch:{
+    "detailList.items": {
+      handler(newValue, oldValue) {
+          if (newValue && newValue.length) {
+            newValue.forEach((item, index) => {
+            item.contractAmount = Number(item.contractQty) * Number(item.contractPrice)
+          });
+
+          }
+        this.detailList.items = newValue;
+      },
+      immediate: true,
+      deep: true,
+    },
+  },
   methods: {
     //审批通过后可以编辑
     async saveFn() {
@@ -1149,7 +1165,6 @@ export default {
             return;
           }
           this.detailList.items.map(e=>{
-          e.contractAmount = e.contractQty * e.contractPrice
           if (!e.contractAmount) {
             return this.$errorMsg('合同单价、合同数量不能为空')
           }
@@ -1220,8 +1235,8 @@ export default {
         }
         // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
         item.sums1 = ['orderHasSendQty', 'dataQty', 'qty',"hasSendQty","contractQty"]
-        item.sums2 = ['totalAmount', 'diffAmount', 'price','depositAmount',"contractPrice","comTotal",
-          "contractAmount",]
+        item.sums2 = ['totalAmount', 'diffAmount', 'price','depositAmount',"contractPrice","comTotal","contractAmount",
+          ]
       });
       res.data.items = arr;
       this.detailList = res.data;

+ 2 - 2
src/views/deposit_home/refund_list.vue

@@ -511,7 +511,7 @@
                 <span>{{ scope.row.refRegionWork }}</span>
               </template>
             </el-table-column>
-            <el-table-column
+            <!-- <el-table-column
               v-if="!isCustomer"
               align="left"
               label="格力内部备注"
@@ -522,7 +522,7 @@
               <template slot-scope="scope">
                 <span>{{ scope.row.geLiInerNote }}</span>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column
               align="left"
               label="物料编码"