Ver Fonte

修改收、付费用名称不同问题

lichao há 3 anos atrás
pai
commit
50106516a1

+ 62 - 25
src/views/Warehousing/costModify/AddOrUpdate.vue

@@ -245,7 +245,7 @@
                   placeholder="费用名称"
                 >
                     <el-option
-                      v-for="(dict, index) in fCNameOptions"
+                      v-for="(dict, index) in fNameOptions"
                       :key="index.fId"
                       :label="dict.fName"
                       :value="dict.fId"
@@ -374,6 +374,14 @@
                   @click="handleSave"
                   v-hasPermi="['warehouse:modify:remove']"
                 >保 存</el-button>
+                <el-button
+                  type="primary"
+                  icon="el-icon-plus"
+                  size="mini"
+                  @click="hanldeAdd"
+                  v-hasPermi="['warehouse:modify:remove']"
+                  :disabled="form.fStatus > 3"
+                >新 行</el-button>
               </div>
             </div>
           </div>
@@ -418,7 +426,7 @@
                   placeholder="费用名称"
                 >
                   <el-option
-                    v-for="(dict, index) in fCNameOptions"
+                    v-for="(dict, index) in fNameOptions"
                     :key="index.fId"
                     :label="dict.fName"
                     :value="dict.fId"
@@ -426,12 +434,12 @@
                 </el-select>
               </template>
             </el-table-column>
-            <el-table-column prop="fdc" label="收付" align="center" width="100">
+            <el-table-column prop="fDc" label="收付" align="center" width="100">
               <template slot-scope="scope">
                 <el-select
                   v-model="scope.row.fDc"
                   placeholder="请选择"
-                  :disabled="disabledtwo"
+                  disabled
                 >
                   <el-option label="收" value="D"></el-option>
                   <el-option label="付" value="C"></el-option>
@@ -803,7 +811,7 @@ export default {
       //自定义列宽
       allCheck: false,
       drag: false,
-      fCNameOptions: [],
+      fNameOptions: [],
       jFeetunitOptions: [],
       veiwVisible: false,
       addOrUpdateVisib: false
@@ -827,9 +835,18 @@ export default {
     listCorps().then((response) => {
       this.fMblnoOptions = response.rows;
     });
-    listFees().then((response) => {
-      this.fCNameOptions = response.rows;
-    });
+    // this.$nextTick(() => {
+    //   console.log(this.fDc)
+    //   if (this.fDc == 'D') {
+    //     listFees({fDc: "D"}).then((response) => {
+    //       this.fNameOptions = response.rows;
+    //     });
+    //   } else if(this.fDc == 'C') {
+    //     listFees({fDc: "C"}).then((response) => {
+    //       this.fNameOptions = response.rows;
+    //     });
+    //   }
+    // })
   },
   watch: {
     addOrUpdateVisible(oldVal, newWal) {
@@ -837,6 +854,17 @@ export default {
     }
   },
   methods: {
+    init() {
+      let fDc = '';
+      if (this.fDc) {
+        fDc = this.fDc
+      } else {
+        fDc = this.form.fDc
+      }
+      listFees({fDc: fDc}).then((response) => {
+        this.fNameOptions = response.rows;
+      });
+    },
     // 弹出框关闭后触发
     handleClose() {
       // 子组件调用父组件方法,并传递参数
@@ -844,31 +872,40 @@ export default {
       this.$emit("changeShow", "false");
       this.collapses = [];
     },
+    // 添加新行
+    hanldeAdd() {
+      let DC = null
+      if (this.form.fDc) {
+        DC = this.form.fDc
+      } else {
+        DC = this.fDc
+      }
+      let list = {
+        fId: null,
+        fCorpid: null,
+        fDc: DC,
+        fFeeunitid: null,
+        fQty: null,
+        fUnitprice: null,
+        fCurrency: null,
+        fExrate: null,
+        fAmount: null,
+        fTaxrate: null,
+        fSrcTypeId: 10,
+        fBillstatus: null,
+        actId: 1000,
+      }
+      console.log(list)
+      this.formfeesList.push(list)
+    },
     //变更按钮
     change(row){
       console.log(row)
       let list = JSON.parse(JSON.stringify(row))
-      // let list1 = {
-      //   fid: null,
-      //   fcorpid: list.fCorpid,
-      //   ffeeid: list.fFeeid,
-      //   fdc: list.fDc,
-      //   ffeeunitid: list.fFeeunitid,
-      //   fqty: list.fQty,
-      //   funitprice: list.fUnitprice,
-      //   fcurrency: list.fCurrency,
-      //   fexrate: list.fExrate,
-      //   famount: list.fAmount,
-      //   ftaxrate: list.fTaxrate,
-      //   remarks: list.remarks,
-      //   fbillstatus: '',
-      //   actid: ''
-      // }
       list.fId = ''
       list.fBillstatus = ''
       list.actId = 1100
       list.fSrcTypeId = 10
-      // list1 = Object.assign(list, list1)
       this.formfeesList.push(list)
       // for (let item in this.formfeesList){
       //   if (scope.row.fId === this.formfeesList[item].fId) {

+ 5 - 0
src/views/Warehousing/costModify/index.vue

@@ -560,6 +560,7 @@ export default {
       })
       this.$nextTick(() => {
         this.openDialog()
+        this.$refs.addOrUpdateRef.init()
       })
     }
     if (this.$route.query.id) {
@@ -577,6 +578,7 @@ export default {
       this.form.id = id;
       this.formDisabled = true
       this.approVal = true
+      this.$refs.addOrUpdateRef.init()
       this.$router.push({query: {}});
     }
   },
@@ -735,6 +737,9 @@ export default {
         this.form = res.data
         this.feeList = res.data.tWarehousebillsfees
         this.formfeesList = res.data.warehousebillsfeesModifyList
+        this.$nextTick(() => {
+          this.$refs.addOrUpdateRef.init()
+        })
       })
       this.disabledtwo = true
       this.title = "查看订单";