Qukatie vor 6 Monaten
Ursprung
Commit
714c82849f
1 geänderte Dateien mit 46 neuen und 6 gelöschten Zeilen
  1. 46 6
      src/components/feeModify/main.vue

+ 46 - 6
src/components/feeModify/main.vue

@@ -36,7 +36,7 @@
           <template slot="unitNoUpdate">
             <dic-select v-model="newForm.unitNoUpdate" placeholder="费用名称" label="cnName"
               url="/blade-los/bunits/listAll?status=0" :filterable="true" :slotRight="true" rightLabel="code"
-              :disabled="newOption.disabled"></dic-select>
+              :disabled="newOption.disabled" @selectChange="dicChange('unitNoUpdate', $event)"></dic-select>
           </template>
           <template slot="curCodeUpdate">
             <dic-select v-model="newForm.curCodeUpdate" placeholder="币别" label="code"
@@ -194,6 +194,7 @@ export default {
   },
   created() {
     // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
+    
   },
   methods: {
     openDialog(row, type) {
@@ -220,6 +221,7 @@ export default {
           priceUpdate: row.price,
           amountUpdate: row.amount,
         }
+         this.checkRate(null, (this.form.etd ? this.form.etd + ' 00:00:00' : null), this.oldForm.dc, 1, this.form.branchId)
         this.type = type
         this.title = '费用申请修改'
         this.dialogVisible = true
@@ -276,14 +278,42 @@ export default {
       }
     },
     countChange() {
-      this.newForm.amountUpdate = _.round(_.multiply(this.newForm.priceUpdate, this.newForm.quantityUpdate), 2)
+      this.newForm.amountUpdate = _.round(_.multiply(this.newForm.priceUpdate?this.newForm.priceUpdate:0, this.newForm.quantityUpdate?this.newForm.quantityUpdate:0), 2)
     },
     dicChange(name, row) {
       if (name == 'corpTypeUpdate') {
-        this.newForm.corpIdUpdate = null
-        this.newForm.corpCnNameUpdate = null
-        this.newForm.corpEnNameUpdate = null
-        this.newForm.shortNameUpdate = null
+        console.log(row)
+        if (row.cnName == '国内直接客户' || row.cnName == '国内同行及代理' || row.cnName == '国外直接客户') {
+          this.newForm.corpIdUpdate = this.form.corpId
+          this.newForm.shortNameUpdate = this.form.shortName
+          this.newForm.corpCnNameUpdate = this.form.corpCnName
+          this.newForm.corpEnNameUpdate = this.form.corpEnName
+        } else if (row.cnName == '国外同行及代理') {
+          this.newForm.corpIdUpdate = this.form.foreignAgencyId
+          this.newForm.shortNameUpdate = this.form.foreignAgencyCnName
+          this.newForm.corpCnNameUpdate = this.form.foreignAgencyCnName
+          this.newForm.corpEnNameUpdate = this.form.foreignAgencyEnName
+        } else if (row.cnName == '船公司') {
+          this.newForm.corpIdUpdate = this.form.carrierId
+          this.newForm.shortNameUpdate = this.form.carrierShortName
+          this.newForm.corpCnNameUpdate = this.form.carrierCnName
+          this.newForm.corpEnNameUpdate = this.form.carrierEnName
+        } else if (row.cnName == '场站') {
+          this.newForm.corpIdUpdate = this.form.cyId
+          this.newForm.shortNameUpdate = this.form.cyShortName
+          this.newForm.corpCnNameUpdate = this.form.cyCnName
+          this.newForm.corpEnNameUpdate = this.form.cyEnName
+        } else if (row.cnName == '船代') {
+          this.newForm.corpIdUpdate = this.form.shippingAgencyId
+          this.newForm.shortNameUpdate = this.form.shippingAgencyCname
+          this.newForm.corpCnNameUpdate = this.form.shippingAgencyCname
+          this.newForm.corpEnNameUpdate = this.form.shippingAgencyEname
+        } else {
+          this.newForm.corpIdUpdate = null
+          this.newForm.shortNameUpdate = null
+          this.newForm.corpCnNameUpdate = null
+          this.newForm.corpEnNameUpdate = null
+        }
       }
       if (name == 'shortNameUpdate') {
         if (row) {
@@ -314,11 +344,15 @@ export default {
           this.newForm.feeIdUpdate = row.id
           this.newForm.feeCodeUpdate = row.code
           this.newForm.feeEnNameUpdate = row.enName
+          this.newForm.curCodeUpdate = row.curNo
+          this.newForm.exrateUpdate = this.getExchangeRate(row.curNo, this.oldForm.dc, 1)
         } else {
           this.newForm.feeIdUpdate = null
           this.newForm.feeCodeUpdate = null
           this.newForm.feeEnNameUpdate = null
           this.newForm.feeCnNameUpdate = null
+          this.newForm.exrateUpdate = null
+          this.newForm.exrateUpdate = null
         }
       }
       if (name == 'curCodeUpdate') {
@@ -330,6 +364,12 @@ export default {
         }
 
       }
+      if(name=='unitNoUpdate'){
+        if(row){
+          this.newForm.quantityUpdate=row.quantity
+               this.newForm.amountUpdate = _.round(_.multiply(this.newForm.priceUpdate?this.newForm.priceUpdate:0, this.newForm.quantityUpdate?this.newForm.quantityUpdate:0), 2)
+        }
+      }
     },
     submit() {
       let obj = {