Browse Source

1.海运进出口 提交审核以后的主单和分单,不能再次添加
2.海运进出口 打印报表,入货通知 修改船代的值
3.海运进出口 收款角色或者付款角色 费用合计多了一条费用
4.复制单据弹窗,增加单据类型选择,默认被复制的单据类型,允许修改为其他类型
5.费用申请 调整本币判断区分 本币和外币金额
6.费用申请 分公司角色可以查看收费明细
7.箱管 修改所有业务的币别和汇率
8.成本中心 修改所有业务的币别和汇率

Qukatie 9 months ago
parent
commit
b105f382fc
25 changed files with 592 additions and 555 deletions
  1. 46 63
      src/views/boxManagement/agentBox/detailsPage.vue
  2. 15 19
      src/views/boxManagement/boxAdjustment/detailsPage.vue
  3. 91 85
      src/views/boxManagement/boxCost/detailsPage.vue
  4. 15 19
      src/views/boxManagement/boxExit/detailsPage.vue
  5. 36 52
      src/views/boxManagement/buyContainer/detailsPage.vue
  6. 41 57
      src/views/boxManagement/rentalBox/detailsPage.vue
  7. 12 18
      src/views/boxManagement/transferCost/detailsPage.vue
  8. 25 24
      src/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation.vue
  9. 2 1
      src/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue
  10. 1 1
      src/views/iosBasicData/OceanFreightImport/bills/assembly/reportformsFrame/PurchaseNotice.vue
  11. 37 21
      src/views/iosBasicData/OceanFreightImport/bills/billsDetails.vue
  12. 35 5
      src/views/iosBasicData/OceanFreightImport/bills/index.vue
  13. 17 16
      src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue
  14. 2 1
      src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue
  15. 1 1
      src/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsFrame/PurchaseNotice.vue
  16. 21 7
      src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue
  17. 32 2
      src/views/iosBasicData/SeafreightExportF/bills/index.vue
  18. 63 53
      src/views/iosBasicData/costcenter/coc/detailsPage.vue
  19. 64 87
      src/views/iosBasicData/costcenter/soc/detailsPage.vue
  20. 25 14
      src/views/iosBasicData/feeApplication/detailsPage.vue
  21. 1 1
      src/views/iosBasicData/podTemplate/index.vue
  22. 1 1
      src/views/iosBasicData/polTemplate/index.vue
  23. 5 3
      src/views/iosBasicData/rateManagement/detailsPage.vue
  24. 2 2
      src/views/ow/owPut/detailsPage.vue
  25. 2 2
      src/views/ow/owTask/detailsPage.vue

+ 46 - 63
src/views/boxManagement/agentBox/detailsPage.vue

@@ -169,10 +169,10 @@
                 </dic-select>
                 <span v-else>{{ row.agentName }}</span>
               </tempalte>
-              <template slot="currencyForm" slot-scope="{ row }">
+       <template slot="currencyForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('currency', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('currency', $event, row)"></dic-select>
                 <span v-else>{{ row.currency }}</span>
               </template>
               <tempalte slot="originalBoxEastNameForm" slot-scope="{ row }">
@@ -279,10 +279,10 @@
                   disabledLabel="押金,租箱费"></dic-select>
                 <span v-else>{{ row.feeCnName }}</span>
               </template>
-              <template slot="curCodeForm" slot-scope="{ row }">
+                <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
               <template slot="exrateForm" slot-scope="{ row }">
@@ -461,13 +461,11 @@ export default {
             prop: 'curCode',
             cell: true,
             type: 'select',
-            dicData: [{
-              label: 'CNY',
-              value: 'CNY',
-            }, {
-              label: 'USD',
-              value: 'USD',
-            }],
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
             overHidden: true,
           },
         ]
@@ -1252,7 +1250,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1309,7 +1307,7 @@ export default {
             label: "备注",
             prop: "remarks",
             // cell: true,
-            width:150,
+            width: 150,
             overHidden: true
           }
         ]
@@ -1318,6 +1316,7 @@ export default {
       updateSearchKey: new Date().getTime(),
       updateFormKey: new Date().getTime(),
       updateStationKey: new Date().getTime(),
+      deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
     }
   },
   components: {
@@ -1345,6 +1344,7 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId)
     }
+    this.saveLocalCurrency(this.deptId)
   },
   methods: {
     openRtDialog(row) {
@@ -1357,7 +1357,7 @@ export default {
       this.rtDialog = false
     },
     countChange(row) {
-      if (row.curCode == 'CNY') {
+      if (row.curCode == this.getLocalCurrency()) {
         row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
         row.amountUSD = 0
       } else {
@@ -1532,29 +1532,16 @@ export default {
       }
     },
     rowDicChange(name, row, el, index) {
-      if (name == 'currency') {
+        if (name == 'currency') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.currency == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
       }
-      if (name == 'curCode') {
+      if (name == 'curCodeC') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.curCode == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-                this.countChange(el)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
@@ -1676,48 +1663,44 @@ export default {
       )
     },
     rtAddRow() {
-      this.rulesList.push({ curCode: 'CNY', $cellEdit: true })
+      this.rulesList.push({ curCode: this.getLocalCurrency(), $cellEdit: true })
     },
-    addRow() {
+    async addRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.effectiveDate, null, 1, this.deptId)
       this.$refs.crud.dicInit();
-      bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
-        res.data.data.forEach(e => {
-          if (e.code == 'USD') {
-            this.form.tradingBoxItemsList.push({
-              pid: this.form.id,
-              boxBelongsTo: 'SOC',
-              boxCategory: '自有箱',
-              boxStatus: '好',
-              boxCondition: this.form.boxCondition,
-              stationId: this.form.stationId,
-              stationCode: this.form.stationCode,
-              stationCname: this.form.stationCname,
-              stationEname: this.form.stationEname,
-              currency: 'USD',
-              exrate: e.exrate,
-              status: '空箱入场',
-              $cellEdit: true
-            })
-          }
-        })
+      this.form.tradingBoxItemsList.push({
+        pid: this.form.id,
+        boxBelongsTo: 'SOC',
+        boxCategory: '自有箱',
+        boxStatus: '好',
+        boxCondition: this.form.boxCondition,
+        stationId: this.form.stationId,
+        stationCode: this.form.stationCode,
+        stationCname: this.form.stationCname,
+        stationEname: this.form.stationEname,
+        currency: 'USD',
+        exrate: this.getExchangeRate('USD', 'C', 1),
+        status: '空箱入场',
+        $cellEdit: true
       })
 
 
     },
-    feecAddRow() {
+    async feecAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.effectiveDate, null, 1, this.deptId)
       this.form.feeCenterList.push({
         pid: this.form.id,
         feesType: 1,
         dc: 'C',
         billType: '船公司',
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'C', 1),
         $cellEdit: true
       })
     },
@@ -1748,11 +1731,11 @@ export default {
       });
       detail({ id: id }).then(res => {
         res.data.data.feeCenterList.forEach(row => {
-          if (row.curCode == 'CNY') {
+          if (row.curCode == this.getLocalCurrency()) {
             row.amountCNY = row.amount
             row.amountUSD = 0
           }
-          if (row.curCode == 'USD') {
+          if (row.curCode != this.getLocalCurrency()) {
             row.amountUSD = row.amount
             row.amountCNY = 0
           }
@@ -2182,7 +2165,7 @@ export default {
             }
           }
           for (let row of this.form.feeCenterList) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud2.rowCell(row, row.$index)
               return this.$message.error("请完善费用明细");
@@ -2319,10 +2302,10 @@ export default {
         this.CNYSUM = 0
         this.USDSUM = 0
         this.form.tradingBoxItemsList.forEach(item => {
-          if (item.currency == 'CNY') {
+          if (item.currency == this.getLocalCurrency()) {
             this.CNYSUM = _.round(_.add(this.CNYSUM ? Number(this.CNYSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
           }
-          if (item.currency == 'USD') {
+          if (item.currency != this.getLocalCurrency()) {
             this.USDSUM = _.round(_.add(this.USDSUM ? Number(this.USDSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
           }
         })

+ 15 - 19
src/views/boxManagement/boxAdjustment/detailsPage.vue

@@ -249,8 +249,8 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.purchaseDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
               <template slot="exrateForm" slot-scope="{ row }">
@@ -1130,7 +1130,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1196,6 +1196,7 @@ export default {
       updateSearchKey: new Date().getTime(),
       updateFormKey: new Date().getTime(),
       updateFormKey2: new Date().getTime(),
+      deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
     }
   },
   components: {
@@ -1223,10 +1224,11 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId)
     }
+    this.saveLocalCurrency(this.deptId)
   },
   methods: {
     countChange(row) {
-      if (row.curCode == 'CNY') {
+      if (row.curCode == this.getLocalCurrency()) {
         row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
         row.amountUSD = 0
       } else {
@@ -1365,16 +1367,9 @@ export default {
       }
     },
     rowDicChange(name, row, el, index) {
-      if (name == 'curCode') {
+      if (name == 'curCodeC') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.curCode == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-                this.countChange(el)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
@@ -1470,17 +1465,18 @@ export default {
         }
       )
     },
-    feecAddRow() {
+    async feecAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.purchaseDate, null, 1, this.deptId)
       this.form.feeCenterList.push({
         pid: this.form.id,
         feesType: 1,
         dc: 'C',
         billType: '船公司',
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'C', 1),
         $cellEdit: true
       })
     },
@@ -1511,11 +1507,11 @@ export default {
       });
       detail({ id: id }).then(res => {
         res.data.data.feeCenterList.forEach(row => {
-          if (row.curCode == 'CNY') {
+          if (row.curCode == this.getLocalCurrency()) {
             row.amountCNY = row.amount
             row.amountUSD = 0
           }
-          if (row.curCode == 'USD') {
+          if (row.curCode != this.getLocalCurrency()) {
             row.amountUSD = row.amount
             row.amountCNY = 0
           }
@@ -1881,7 +1877,7 @@ export default {
             }
           }
           for (let row of this.form.feeCenterList) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud2.rowCell(row, row.$index)
               return this.$message.error("请完善费用明细");

+ 91 - 85
src/views/boxManagement/boxCost/detailsPage.vue

@@ -114,8 +114,8 @@
               </template>
               <template slot="currencyForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('currency', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.purchaseDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('currency', $event, row)"></dic-select>
                 <span v-else>{{ row.currency }}</span>
               </template>
               <tempalte slot="originalBoxEastNameForm" slot-scope="{ row }">
@@ -222,8 +222,8 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=D'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.purchaseDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeD', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
               <template slot="exrateForm" slot-scope="{ row }">
@@ -320,8 +320,8 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.purchaseDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
               <template slot="exrateForm" slot-scope="{ row }">
@@ -364,61 +364,76 @@
             <div style="width: 30%">
               <div style="display: flex;align-items: center;justify-content: space-around">
                 <div>
+                  <div>
+                    <span>本币:</span>
+                  </div>
+                </div>
+                <div>
                   <div style="color: #81B337">
                     <span>应收:</span>
-                    <span class="weightnum">¥{{ form.amountD ? form.amountD : 0 }}元</span>
+                    <span class="weightnum">{{ form.amountD ? form.amountD : 0 }}元</span>
                   </div>
                 </div>
                 <div>
                   <div style="color: #6BBCD1">
                     <span>应付:</span>
-                    <span class="weightnum">¥{{ form.amountC ? form.amountC : 0 }}元</span>
+                    <span class="weightnum">{{ form.amountC ? form.amountC : 0 }}元</span>
                   </div>
                 </div>
                 <div class="bottomFlex">
                   <span>利润</span>
-                  <span>¥{{ form.profit ? form.profit : 0 }}元</span>
+                  <span>{{ form.profit ? form.profit : 0 }}元</span>
                 </div>
               </div>
             </div>
             <div style="width: 30%">
               <div style="display: flex;align-items: center;justify-content: space-around">
+               <div>
+                  <div>
+                    <span>外币:</span>
+                  </div>
+                </div>
                 <div>
                   <div style="color: #81B337">
                     <span>应收:</span>
-                    <span class="weightnum">${{ form.amountDUsd ? form.amountDUsd : 0 }}元</span>
+                    <span class="weightnum">{{ form.amountDUsd ? form.amountDUsd : 0 }}元</span>
                   </div>
                 </div>
                 <div>
                   <div style="color: #6BBCD1">
                     <span>应付:</span>
-                    <span class="weightnum">${{ form.amountCUsd ? form.amountCUsd : 0 }}元</span>
+                    <span class="weightnum">{{ form.amountCUsd ? form.amountCUsd : 0 }}元</span>
                   </div>
                 </div>
                 <div class="bottomFlex">
                   <span>利润</span>
-                  <span>${{ form.profitUsd ? form.profitUsd : 0 }}元</span>
+                  <span>{{ form.profitUsd ? form.profitUsd : 0 }}元</span>
                 </div>
               </div>
             </div>
             <div style="width: 30%">
               <div style="display: flex;align-items: center;justify-content: space-around">
+                 <div>
+                  <div>
+                    <span>本币:</span>
+                  </div>
+                </div>
                 <div>
                   <div style="color: #81B337">
                     <span>应收:</span>
-                    <span class="weightnum">¥{{ form.totalAmountD ? form.totalAmountD : 0 }}元</span>
+                    <span class="weightnum">{{ form.totalAmountD ? form.totalAmountD : 0 }}元</span>
                   </div>
 
                 </div>
                 <div>
                   <div style="color: #6BBCD1">
                     <span>应付:</span>
-                    <span class="weightnum">¥{{ form.totalAmountC ? form.totalAmountC : 0 }}元</span>
+                    <span class="weightnum">{{ form.totalAmountC ? form.totalAmountC : 0 }}元</span>
                   </div>
                 </div>
                 <div class="bottomFlex">
                   <span>利润</span>
-                  <span>¥{{ form.totalProfit ? form.totalProfit : 0 }}元</span>
+                  <span>{{ form.totalProfit ? form.totalProfit : 0 }}元</span>
                 </div>
               </div>
             </div>
@@ -525,19 +540,19 @@ export default {
             prop: 'corpCnName',
             overHidden: true,
           }, {
-            label: 'RMB应收',
+            label: '本币应收',
             prop: 'rmbD',
             overHidden: true,
           }, {
-            label: 'RMB应付',
+            label: '本币应付',
             prop: 'rmbC',
             overHidden: true,
           }, {
-            label: 'USD应收',
+            label: '外币应收',
             prop: 'usdD',
             overHidden: true,
           }, {
-            label: 'USD应付',
+            label: '外币应付',
             prop: 'usdC',
             overHidden: true,
           }, {
@@ -599,13 +614,11 @@ export default {
             prop: 'curCode',
             cell: true,
             type: 'select',
-            dicData: [{
-              label: 'CNY',
-              value: 'CNY',
-            }, {
-              label: 'USD',
-              value: 'USD',
-            }],
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
             overHidden: true,
           },
         ]
@@ -1280,7 +1293,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1337,7 +1350,7 @@ export default {
             label: "备注",
             prop: "remarks",
             // cell: true,
-            width:150,
+            width: 150,
             overHidden: true
           }
         ]
@@ -1552,7 +1565,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1609,7 +1622,7 @@ export default {
             label: "备注",
             prop: "remarks",
             // cell: true,
-            width:150,
+            width: 150,
             overHidden: true
           }
         ]
@@ -1619,6 +1632,7 @@ export default {
       roleName: [],
       updateSearchKey: new Date().getTime(),
       updateFormKey: new Date().getTime(),
+      deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
     }
   },
   components: {
@@ -1647,6 +1661,7 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId)
     }
+    this.saveLocalCurrency(this.deptId)
   },
   methods: {
     openRtDialog(row) {
@@ -1659,7 +1674,7 @@ export default {
       this.rtDialog = false
     },
     countChange(row) {
-      if (row.curCode == 'CNY') {
+      if (row.curCode == this.getLocalCurrency()) {
         row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
         row.amountUSD = 0
       } else {
@@ -1843,27 +1858,21 @@ export default {
       }
       if (name == 'currency') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.currency == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
       }
-      if (name == 'curCode') {
+      if (name == 'curCodeD') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'D' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.curCode == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-                this.countChange(el)
-              }
-            })
-          })
+          el.exrate = row.exrateReceivable
+        } else {
+          el.exrate = null
+        }
+      }
+      if (name == 'curCodeC') {
+        if (row) {
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
@@ -1976,62 +1985,59 @@ export default {
       });
     },
     rtAddRow() {
-      this.rulesList.push({ curCode: 'CNY', $cellEdit: true })
+      this.rulesList.push({ curCode: this.getLocalCurrency(), $cellEdit: true })
     },
-    addRow() {
+    async addRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.purchaseDate, null, 1, this.deptId)
       this.$refs.crud.dicInit();
-      bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-        res.data.data.forEach(e => {
-          if (e.code == 'USD') {
-            this.form.tradingBoxItemsList.push({
-              pid: this.form.id,
-              boxBelongsTo: 'SOC',
-              boxCategory: '自有箱',
-              boxStatus: '好',
-              boxCondition: this.form.boxCondition,
-              stationId: this.form.stationId,
-              stationCode: this.form.stationCode,
-              stationCname: this.form.stationCname,
-              stationEname: this.form.stationEname,
-              currency: 'USD',
-              exrate: e.exrate,
-              status: '空箱入场',
-              $cellEdit: true
-            })
-          }
-        })
+      this.form.tradingBoxItemsList.push({
+        pid: this.form.id,
+        boxBelongsTo: 'SOC',
+        boxCategory: '自有箱',
+        boxStatus: '好',
+        boxCondition: this.form.boxCondition,
+        stationId: this.form.stationId,
+        stationCode: this.form.stationCode,
+        stationCname: this.form.stationCname,
+        stationEname: this.form.stationEname,
+        currency: 'USD',
+        exrate: this.getExchangeRate('USD', 'C', 1),
+        status: '空箱入场',
+        $cellEdit: true
       })
 
 
     },
-    feedAddRow() {
+    async feedAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.purchaseDate, null, 1, this.deptId)
       this.feeCenterListD.push({
         pid: this.form.id,
         feesType: 1,
         dc: 'D',
         billType: '箱东',
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
         $cellEdit: true
       })
     },
-    feecAddRow() {
+    async feecAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.purchaseDate, null, 1, this.deptId)
       this.feeCenterListC.push({
         pid: this.form.id,
         feesType: 1,
         dc: 'C',
         billType: '箱东',
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'C', 1),
         $cellEdit: true
       })
     },
@@ -2074,11 +2080,11 @@ export default {
       });
       detail({ id: id }).then(res => {
         res.data.data.feeCenterList.forEach(row => {
-          if (row.curCode == 'CNY') {
+          if (row.curCode == this.getLocalCurrency()) {
             row.amountCNY = row.amount
             row.amountUSD = 0
           }
-          if (row.curCode == 'USD') {
+          if (row.curCode != this.getLocalCurrency()) {
             row.amountUSD = row.amount
             row.amountCNY = 0
           }
@@ -2516,14 +2522,14 @@ export default {
             }
           }
           for (let row of this.feeCenterListD) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud2.rowCell(row, row.$index)
               return this.$message.error("请完善应收费用明细");
             }
           }
           for (let row of this.feeCenterListC) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud3.rowCell(row, row.$index)
               return this.$message.error("请完善应付费用明细");
@@ -2699,19 +2705,19 @@ export default {
         let sumC = 0
         sumArr.forEach(item => {
           if (e == item.shortName) {
-            if (item.curCode == 'CNY' && item.dc == 'D') {
+            if (item.curCode == this.getLocalCurrency() && item.dc == 'D') {
               rmbD += Number(item.amount)
               sumD += Number(item.amount)
             }
-            if (item.curCode == 'CNY' && item.dc == 'C') {
+            if (item.curCode == this.getLocalCurrency() && item.dc == 'C') {
               rmbC += Number(item.amount)
               sumC += Number(item.amount)
             }
-            if (item.curCode == 'USD' && item.dc == 'D') {
+            if (item.curCode != this.getLocalCurrency() && item.dc == 'D') {
               usdD += Number(item.amountLoc)
               sumD += Number(item.amountLoc) * Number(item.exrate)
             }
-            if (item.curCode == 'USD' && item.dc == 'C') {
+            if (item.curCode != this.getLocalCurrency() && item.dc == 'C') {
               usdC += Number(item.amountLoc)
               sumC += Number(item.amountLoc) * Number(item.exrate)
             }
@@ -2750,10 +2756,10 @@ export default {
         this.CNYSUM = 0
         this.USDSUM = 0
         this.form.tradingBoxItemsList.forEach(item => {
-          if (item.currency == 'CNY') {
+          if (item.currency == this.getLocalCurrency()) {
             this.CNYSUM = _.round(_.add(this.CNYSUM ? Number(this.CNYSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
           }
-          if (item.currency == 'USD') {
+          if (item.currency != this.getLocalCurrency()) {
             this.USDSUM = _.round(_.add(this.USDSUM ? Number(this.USDSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
           }
         })

+ 15 - 19
src/views/boxManagement/boxExit/detailsPage.vue

@@ -261,8 +261,8 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.createTime + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.createTime + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
               <template slot="exrateForm" slot-scope="{ row }">
@@ -1183,7 +1183,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1249,6 +1249,7 @@ export default {
       updateSearchKey: new Date().getTime(),
       updateFormKey: new Date().getTime(),
       updateFormKey2: new Date().getTime(),
+      deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
     }
   },
   components: {
@@ -1276,10 +1277,11 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId)
     }
+    this.saveLocalCurrency(this.deptId)
   },
   methods: {
     countChange(row) {
-      if (row.curCode == 'CNY') {
+      if (row.curCode == this.getLocalCurrency()) {
         row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
         row.amountUSD = 0
       } else {
@@ -1381,16 +1383,9 @@ export default {
       }
     },
     rowDicChange(name, row, el, index) {
-      if (name == 'curCode') {
+      if (name == 'curCodeC') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.curCode == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-                this.countChange(el)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
@@ -1518,17 +1513,18 @@ export default {
         }
       )
     },
-    feecAddRow() {
+    async feecAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.createTime, null, 1, this.deptId)
       this.form.feeCenterList.push({
         pid: this.form.id,
         feesType: 1,
         dc: 'C',
         billType: '船公司',
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'C', 1),
         $cellEdit: true
       })
     },
@@ -1559,11 +1555,11 @@ export default {
       });
       detail({ id: id }).then(res => {
         res.data.data.feeCenterList.forEach(row => {
-          if (row.curCode == 'CNY') {
+          if (row.curCode == this.getLocalCurrency()) {
             row.amountCNY = row.amount
             row.amountUSD = 0
           }
-          if (row.curCode == 'USD') {
+          if (row.curCode != this.getLocalCurrency()) {
             row.amountUSD = row.amount
             row.amountCNY = 0
           }
@@ -1929,7 +1925,7 @@ export default {
             }
           }
           for (let row of this.form.feeCenterList) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud2.rowCell(row, row.$index)
               return this.$message.error("请完善费用明细");

+ 36 - 52
src/views/boxManagement/buyContainer/detailsPage.vue

@@ -105,8 +105,8 @@
               </template>
               <template slot="currencyForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('currency', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.purchaseDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('currency', $event, row)"></dic-select>
                 <span v-else>{{ row.currency }}</span>
               </template>
               <tempalte slot="originalBoxEastNameForm" slot-scope="{ row }">
@@ -217,8 +217,8 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.purchaseDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.purchaseDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
               <template slot="exrateForm" slot-scope="{ row }">
@@ -1086,7 +1086,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1152,6 +1152,7 @@ export default {
       updateSearchKey: new Date().getTime(),
       updateFormKey: new Date().getTime(),
       updateStationKey: new Date().getTime(),
+      deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
     }
   },
   components: {
@@ -1176,10 +1177,11 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId)
     }
+    this.saveLocalCurrency(this.deptId)
   },
   methods: {
     countChange(row) {
-      if (row.curCode == 'CNY') {
+      if (row.curCode == this.getLocalCurrency()) {
         row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
         row.amountUSD = 0
       } else {
@@ -1345,27 +1347,14 @@ export default {
     rowDicChange(name, row, el, index) {
       if (name == 'currency') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.currency == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
       }
-      if (name == 'curCode') {
+      if (name == 'curCodeC') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.curCode == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-                this.countChange(el)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
@@ -1449,39 +1438,34 @@ export default {
     },
     rowEdit(row) {
     },
-    addRow() {
+    async addRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.purchaseDate, null, 1, this.deptId)
       this.$refs.crud.dicInit();
-      bcurrencyGetExrate({ date: this.form.purchaseDate, dc: 'C' }).then(res => {
-        res.data.data.forEach(e => {
-          if (e.code == 'USD') {
-            this.form.tradingBoxItemsList.push({
-              pid: this.form.id,
-              boxBelongsTo: 'SOC',
-              boxCategory: '自有箱',
-              boxStatus: '好',
-              boxCondition: this.form.boxCondition,
-              stationId: this.form.stationId,
-              stationCode: this.form.stationCode,
-              stationCname: this.form.stationCname,
-              stationEname: this.form.stationEname,
-              currency: 'USD',
-              exrate: e.exrate,
-              status: '空箱入场',
-              $cellEdit: true
-            })
-          }
-        })
+      this.form.tradingBoxItemsList.push({
+        pid: this.form.id,
+        boxBelongsTo: 'SOC',
+        boxCategory: '自有箱',
+        boxStatus: '好',
+        boxCondition: this.form.boxCondition,
+        stationId: this.form.stationId,
+        stationCode: this.form.stationCode,
+        stationCname: this.form.stationCname,
+        stationEname: this.form.stationEname,
+        currency: 'USD',
+        exrate: this.getExchangeRate('USD', 'C', 1),
+        status: '空箱入场',
+        $cellEdit: true
       })
 
-
     },
-    feecAddRow() {
+    async feecAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.purchaseDate, null, 1, this.deptId)
       this.form.feeCenterList.push({
         pid: this.form.id,
         feesType: 1,
@@ -1490,8 +1474,8 @@ export default {
         corpId: this.form.purchaseCompanyId,
         shortName: this.form.purchaseCompanyName,
         corpCnName: this.form.purchaseCompanyName,
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'C', 1),
         $cellEdit: true
       })
     },
@@ -1519,11 +1503,11 @@ export default {
       });
       detail({ id: id }).then(res => {
         res.data.data.feeCenterList.forEach(row => {
-          if (row.curCode == 'CNY') {
+          if (row.curCode == this.getLocalCurrency()) {
             row.amountCNY = row.amount
             row.amountUSD = 0
           }
-          if (row.curCode == 'USD') {
+          if (row.curCode != this.getLocalCurrency()) {
             row.amountUSD = row.amount
             row.amountCNY = 0
           }
@@ -1838,7 +1822,7 @@ export default {
             }
           }
           for (let row of this.form.feeCenterList) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud2.rowCell(row, row.$index)
               return this.$message.error("请完善费用明细");
@@ -1976,10 +1960,10 @@ export default {
         this.CNYSUM = 0
         this.USDSUM = 0
         this.form.tradingBoxItemsList.forEach(item => {
-          if (item.currency == 'CNY') {
+          if (item.currency == this.getLocalCurrency()) {
             this.CNYSUM = _.round(_.add(this.CNYSUM ? Number(this.CNYSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
           }
-          if (item.currency == 'USD') {
+          if (item.currency != this.getLocalCurrency()) {
             this.USDSUM = _.round(_.add(this.USDSUM ? Number(this.USDSUM) : 0, item.amount ? Number(item.amount) : 0), 2)
           }
         })

+ 41 - 57
src/views/boxManagement/rentalBox/detailsPage.vue

@@ -148,8 +148,8 @@
               </template>
               <template slot="currencyForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.currency" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('currency', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('currency', $event, row)"></dic-select>
                 <span v-else>{{ row.currency }}</span>
               </template>
               <tempalte slot="originalBoxEastNameForm" slot-scope="{ row }">
@@ -260,10 +260,11 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/getExrate?date=' + form.effectiveDate + '&dc=C'" :filterable="true"
-                  @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
+                  :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
+
               <template slot="exrateForm" slot-scope="{ row }">
                 <el-input-number v-if="row.$cellEdit && !(row.feeCode == 'BOX-YJ' || row.feeCode == 'BOX-ZJ')"
                   v-model="row.exrate" :controls="false" placeholder="请输入 汇率" size="small"
@@ -444,13 +445,11 @@ export default {
             prop: 'curCode',
             cell: true,
             type: 'select',
-            dicData: [{
-              label: 'CNY',
-              value: 'CNY',
-            }, {
-              label: 'USD',
-              value: 'USD',
-            }],
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
             overHidden: true,
           },
         ]
@@ -1274,7 +1273,7 @@ export default {
             ]
           },
           {
-            label: "CNY",
+            label: "本币",
             prop: "amountCNY",
             width: "100",
             overHidden: true,
@@ -1364,6 +1363,7 @@ export default {
       updateSearchKey: new Date().getTime(),
       updateFormKey: new Date().getTime(),
       updateStationKey: new Date().getTime(),
+      deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
     }
   },
   components: {
@@ -1391,6 +1391,7 @@ export default {
     if (this.detailData.copyId) {
       this.getCopydate(this.detailData.copyId)
     }
+    this.saveLocalCurrency(this.deptId)
   },
   methods: {
     openRtDialog(row) {
@@ -1403,7 +1404,7 @@ export default {
       this.rtDialog = false
     },
     countChange(row) {
-      if (row.curCode == 'CNY') {
+      if (row.curCode == this.getLocalCurrency()) {
         row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
         row.amountUSD = 0
       } else {
@@ -1580,27 +1581,14 @@ export default {
     rowDicChange(name, row, el, index) {
       if (name == 'currency') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.currency == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
       }
-      if (name == 'curCode') {
+      if (name == 'curCodeC') {
         if (row) {
-          bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
-            res.data.data.forEach(e => {
-              if (el.curCode == e.code) {
-                this.$set(el, 'exrate', e.exrate)
-                this.countChange(el)
-              }
-            })
-          })
+          el.exrate = row.exratePayable
         } else {
           el.exrate = null
         }
@@ -1722,41 +1710,37 @@ export default {
       )
     },
     rtAddRow() {
-      this.rulesList.push({ curCode: 'CNY', $cellEdit: true })
+      this.rulesList.push({ curCode: this.getLocalCurrency(), $cellEdit: true })
     },
-    addRow() {
+    async addRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.effectiveDate, null, 1, this.deptId)
       this.$refs.crud.dicInit();
-      bcurrencyGetExrate({ date: this.form.effectiveDate, dc: 'C' }).then(res => {
-        res.data.data.forEach(e => {
-          if (e.code == 'USD') {
-            this.form.tradingBoxItemsList.push({
-              pid: this.form.id,
-              boxBelongsTo: 'SOC',
-              boxCategory: '自有箱',
-              boxStatus: '好',
-              boxCondition: this.form.boxCondition,
-              stationId: this.form.stationId,
-              stationCode: this.form.stationCode,
-              stationCname: this.form.stationCname,
-              stationEname: this.form.stationEname,
-              currency: 'USD',
-              exrate: e.exrate,
-              status: '空箱入场',
-              $cellEdit: true
-            })
-          }
-        })
+      this.form.tradingBoxItemsList.push({
+        pid: this.form.id,
+        boxBelongsTo: 'SOC',
+        boxCategory: '自有箱',
+        boxStatus: '好',
+        boxCondition: this.form.boxCondition,
+        stationId: this.form.stationId,
+        stationCode: this.form.stationCode,
+        stationCname: this.form.stationCname,
+        stationEname: this.form.stationEname,
+        currency: 'USD',
+        exrate: this.getExchangeRate('USD', 'C', 1),
+        status: '空箱入场',
+        $cellEdit: true
       })
 
 
     },
-    feecAddRow() {
+    async feecAddRow() {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+      await this.checkRate(null, this.form.effectiveDate, null, 1, this.deptId)
       this.form.feeCenterList.push({
         pid: this.form.id,
         feesType: 1,
@@ -1765,8 +1749,8 @@ export default {
         corpId: this.form.purchaseCompanyId,
         shortName: this.form.purchaseCompanyName,
         corpCnName: this.form.purchaseCompanyName,
-        curCode: 'CNY',
-        exrate: 1,
+        curCode: this.getLocalCurrency(),
+        exrate: this.getExchangeRate(this.getLocalCurrency(), 'C', 1),
         $cellEdit: true
       })
     },
@@ -1797,11 +1781,11 @@ export default {
       });
       detail({ id: id }).then(res => {
         res.data.data.feeCenterList.forEach(row => {
-          if (row.curCode == 'CNY') {
+          if (row.curCode == this.getLocalCurrency()) {
             row.amountCNY = row.amount
             row.amountUSD = 0
           }
-          if (row.curCode == 'USD') {
+          if (row.curCode != this.getLocalCurrency()) {
             row.amountUSD = row.amount
             row.amountCNY = 0
           }
@@ -2430,7 +2414,7 @@ export default {
             }
           }
           for (let row of this.form.feeCenterList) {
-            row.amount = row.curCode == 'CNY' ? row.amountCNY : row.amountUSD
+            row.amount = row.curCode == this.getLocalCurrency() ? row.amountCNY : row.amountUSD
             if (!row.billType || !row.corpCnName || !row.feeCnName || !row.curCode || !row.price || !row.quantity) {
               this.$refs.crud2.rowCell(row, row.$index)
               return this.$message.error("请完善费用明细");

+ 12 - 18
src/views/boxManagement/transferCost/detailsPage.vue

@@ -53,16 +53,13 @@
           <template slot="menuLeft">
             <el-button type="info" plain size="small" :disabled="editDisabled || !form.id"
               @click="allClick('一键保存')">一键保存</el-button>
-            <el-button type="info" plain size="small"
-              :disabled="editDisabled || form.boxAdjustmentCostList.length == 0"
+            <el-button type="info" plain size="small" :disabled="editDisabled || form.boxAdjustmentCostList.length == 0"
               @click="allClick('一键编辑')">一键编辑</el-button>
-            <el-button type="danger" plain size="small"
-              :disabled="editDisabled || selectionList.length == 0"
+            <el-button type="danger" plain size="small" :disabled="editDisabled || selectionList.length == 0"
               @click="allClick('批量删除')">批量删除</el-button>
           </template>
           <template slot="indexHeader" slot-scope="{row,index}">
-            <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled"
-              circle @click="addRow()">
+            <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle @click="addRow()">
             </el-button>
           </template>
           <template slot="index" slot-scope="{row,index}">
@@ -361,16 +358,11 @@ export default {
             prop: 'curCode',
             cell: true,
             type: 'select',
-            dicData: [
-              {
-                label: 'CNY',
-                value: 'CNY',
-              },
-              {
-                label: 'USD',
-                value: 'USD',
-              }
-            ],
+            dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
             rules: [{
               required: true,
               message: "请选择币别",
@@ -1021,6 +1013,8 @@ export default {
       if (!this.form.id) {
         return this.$message.error("请保存数据");
       }
+
+      this.$refs.crud.dicInit();
       this.form.boxAdjustmentCostList.push({
         pid: this.form.id,
         $cellEdit: true
@@ -1156,7 +1150,7 @@ export default {
           return this.$message.error("请添加数据");
         }
         for (let row of this.form.boxAdjustmentCostList) {
-          if (!row.boxType || !row.curCode || !row.oceanFreight || !row.inlandFreight || !row.lolo ) {
+          if (!row.boxType || !row.curCode || !row.oceanFreight || !row.inlandFreight || !row.lolo) {
             this.$refs.crud.rowCell(row, row.$index)
             return this.$message.error("请完善箱明细信息");
           }
@@ -1407,7 +1401,7 @@ export default {
         done();
         if (valid) {
           for (let row of this.form.boxAdjustmentCostList) {
-            if (!row.boxType || !row.curCode || !row.oceanFreight || !row.inlandFreight || !row.lolo ) {
+            if (!row.boxType || !row.curCode || !row.oceanFreight || !row.inlandFreight || !row.lolo) {
               this.$refs.crud.rowCell(row, row.$index)
               return this.$message.error("请完善箱明细信息");
             }

+ 25 - 24
src/views/iosBasicData/OceanFreightImport/bills/assembly/EntrustmentLnformation.vue

@@ -436,7 +436,7 @@
                             </span>
                             <el-date-picker v-model="assemblyForm.actualEta" clearable style="width: 100%" type="date"
                                 size="small"
-                                :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0)|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
+                                :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0) || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                 value-format="yyyy-MM-dd" :picker-options="etdPickerOptions" placeholder="请选择ATA日期"
                                 @change="handlePick">
                             </el-date-picker>
@@ -501,7 +501,7 @@
                                 </span>
                                 <search-query :datalist="vesselData" :selectValue="assemblyForm.vesselEnName"
                                     :filterable="true" :clearable="true" :remote="true" :allowCreate="true"
-                                    :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0)|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
+                                    :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0) || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                     :buttonIf="false" placeholder="请选择船名"
                                     :forParameter="{ key: 'id', label: 'enName', value: 'enName' }"
                                     @remoteMethod="remoteMethod($event, 'vessel')"
@@ -515,7 +515,7 @@
                                 </span>
                                 <el-input type="age" style="width: 100%;" v-model="assemblyForm.voyageNo" size="small"
                                     autocomplete="off"
-                                    :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0)|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
+                                    :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0) || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                     clearable placeholder="请输入航次"></el-input>
                             </el-form-item>
                         </div>
@@ -551,7 +551,7 @@
                                     </span>
                                     <search-query :datalist="carrierData" :selectValue="assemblyForm.carrierCnName"
                                         :filterable="true" :clearable="true" :remote="true" :joinData="true"
-                                        :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0)|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
+                                        :disabled="detailData.seeDisabled || generateBillsfalse || (assemblyForm.billType == 'MH' && assemblyForm.masterBillNo > 0) || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                         :buttonIf="false" placeholder="请选择船公司"
                                         :forParameter="{ key: 'id', short: 'shortName', label: 'cnName', value: 'cnName' }"
                                         @remoteMethod="remoteMethod($event, 'carrier')"
@@ -667,17 +667,31 @@
                             </el-col>
                         </div>
                         <div>
+                            <el-col>
+                                <el-form-item label="所属公司" prop="branchName" label-width="80px">
+                                    <span slot="label">
+                                        <span style="color: #1e9fff">所属公司</span>
+                                    </span>
+                                    <dic-select v-model="assemblyForm.branchName" placeholder="所属公司" key="id"
+                                        label="deptName" url="/blade-system/dept/top-list" :filterable="true"
+                                        :remote="true" dataName="deptName"
+                                        @selectChange="dicChange('branchName', $event)"
+                                        :disabled="detailData.seeDisabled || !(roleName.includes('admin') || roleName.includes('总部')) || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
+                                </el-form-item>
+                            </el-col>
+                        </div>
+                        <div>
                             <el-col :span="13">
                                 <el-form-item label="OP" prop="operatorName" label-width="80px">
                                     <span slot="label">
                                         <span style="color: #1e9fff">OP</span>
                                     </span>
-                                    <dic-select v-model="assemblyForm.operatorName" placeholder="OP" key="id"
-                                        label="realName"
+                                    <dic-select v-model="assemblyForm.operatorName" placeholder="OP"
+                                        :key="assemblyForm.branchId" label="realName"
                                         :url="'/blade-user/userListAll?roleAlias=操作员&deptId=' + saberUserInfo.dept_pid.split(',')[0]"
                                         :filterable="true" dataName="realName"
                                         @selectChange="dicChange('operatorName', $event)"
-                                        :disabled="detailData.seeDisabled|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
+                                        :disabled="detailData.seeDisabled || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
                                 </el-form-item>
                             </el-col>
                             <el-col :span="11">
@@ -685,29 +699,16 @@
                                     <span slot="label">
                                         <span style="color: #1e9fff">客服</span>
                                     </span>
-                                    <dic-select v-model="assemblyForm.accDeptName" placeholder="客服" key="id"
-                                        label="realName"
+                                    <dic-select v-model="assemblyForm.accDeptName" placeholder="客服"
+                                        :key="assemblyForm.branchId" label="realName"
                                         :url="'/blade-user/userListAll?roleAlias=客服&deptId=' + saberUserInfo.dept_pid.split(',')[0]"
                                         :filterable="true" dataName="realName"
                                         @selectChange="dicChange('accDeptName', $event)"
-                                        :disabled="detailData.seeDisabled|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
-                                </el-form-item>
-                            </el-col>
-                        </div>
-                        <div>
-                            <el-col>
-                                <el-form-item label="所属公司" prop="branchName" label-width="80px">
-                                    <span slot="label">
-                                        <span style="color: #1e9fff">所属公司</span>
-                                    </span>
-                                    <dic-select v-model="assemblyForm.branchName" placeholder="所属公司" key="id"
-                                        label="deptName" url="/blade-system/dept/top-list" :filterable="true"
-                                        :remote="true" dataName="deptName"
-                                        @selectChange="dicChange('branchName', $event)"
-                                        :disabled="detailData.seeDisabled||!(roleName.includes('admin')||roleName.includes('总部'))|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
+                                        :disabled="detailData.seeDisabled || assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
                                 </el-form-item>
                             </el-col>
                         </div>
+
                         <div>
                             <el-col>
                                 <el-form-item label="设备单指示" prop="equipmentListIndication" label-width="90px">

+ 2 - 1
src/views/iosBasicData/OceanFreightImport/bills/assembly/feecenter.vue

@@ -1914,7 +1914,8 @@ export default {
             losbfeestemplateGetListTemplate(1, 50, {
                 dc: dc,
                 status: 0,
-                type: 'HYCK'
+                type: 'HYJK',
+                shippingCompanyId: this.assemblyForm.carrierId
             }).then(res => {
                 this.templateData = res.data.data.records
                 // 查第一条的明细

+ 1 - 1
src/views/iosBasicData/OceanFreightImport/bills/assembly/reportformsFrame/PurchaseNotice.vue

@@ -108,7 +108,7 @@
             </el-col>
             <el-col :span="24">
                 <el-form-item label="船代:" prop="corpCnName">
-                    <el-input type="age" style="width: 50%;" v-model="documentForm.bookingAgentCnName" size="small"
+                    <el-input type="age" style="width: 50%;" v-model="documentForm.shippingAgencyCname" size="small"
                         autocomplete="off" clearable placeholder="船代">
                     </el-input>
                 </el-form-item>

+ 37 - 21
src/views/iosBasicData/OceanFreightImport/bills/billsDetails.vue

@@ -174,23 +174,23 @@
                                                                             .text ||
                                                                             ''}`
                                                                             " :forParameter="item[0]
-                                                                                    .forParameter
-                                                                                    " @remoteMethod="
+                                                                                .forParameter
+                                                                                " @remoteMethod="
                                                                                     remoteMethod(
                                                                                         $event,
                                                                                         item[0].prop
                                                                                     )
                                                                                     " @corpChange="
-                                                                                    corpChange(
-                                                                                        $event,
-                                                                                        item[0].prop
-                                                                                    )
-                                                                                    " @corpFocus="
-                                                                                    remoteMethod(
-                                                                                        $event,
-                                                                                        item[0].prop
-                                                                                    )
-                                                                                    ">
+                                                                                        corpChange(
+                                                                                            $event,
+                                                                                            item[0].prop
+                                                                                        )
+                                                                                        " @corpFocus="
+                                                                                                remoteMethod(
+                                                                                                    $event,
+                                                                                                    item[0].prop
+                                                                                                )
+                                                                                                ">
                                                         </search-query>
                                                         <el-input v-else type="age" style="width: 100%;" v-model="form[item[0].prop]
                                                             " size="small" autocomplete="off"
@@ -224,10 +224,13 @@
                                                                 " value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
                                                         </el-date-picker>
                                                         <search-query v-else-if="item[1].type == 'select'"
-                                                            :datalist="item[1].dicData" :selectValue="form[item[1].prop]" :filterable="true" :remote="true"
+                                                            :datalist="item[1].dicData"
+                                                            :selectValue="form[item[1].prop]" :filterable="true"
+                                                            :remote="true"
                                                             :disabled="detailData.seeDisabled || item[1].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                                             :buttonIf="false" :placeholder="`${item[1].text || ''}`"
-                                                            :forParameter="item[1].forParameter" @remoteMethod="remoteMethod($event, item[1].prop)"
+                                                            :forParameter="item[1].forParameter"
+                                                            @remoteMethod="remoteMethod($event, item[1].prop)"
                                                             @corpChange="corpChange($event, item[1].prop)"
                                                             @corpFocus="remoteMethod($event, item[1].prop)">
                                                         </search-query>
@@ -350,11 +353,11 @@
                                                                         item.prop
                                                                     )
                                                                     " @corpFocus="
-                                                                            remoteMethod(
-                                                                                $event,
-                                                                                item.prop
-                                                                            )
-                                                                            " @eldialogConfirm="
+                                                                        remoteMethod(
+                                                                            $event,
+                                                                            item.prop
+                                                                        )
+                                                                        " @eldialogConfirm="
                                                                             eldialogConfirm(
                                                                                 item.slot
                                                                             )
@@ -2847,7 +2850,7 @@ export default {
                 });
         },
         // 复制单据接口
-        async billsCopyBillsfun(id, type) {
+        async billsCopyBillsfun(id, type,billType) {
             const loading = this.$loading({
                 lock: true,
                 text: "加载中",
@@ -2873,6 +2876,13 @@ export default {
                 res.data.data.feeCenterListD = [];
                 res.data.data.feeCenterListC = [];
             }
+            res.data.data.billType = billType
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
+                res.data.data.feeCenterListC = []
+            }
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
+                res.data.data.feeCenterListD = []
+            }
             await this.saveLocalCurrency(res.data.data.branchId);
             this.form = res.data.data;
             this.pageLoading = false;
@@ -2940,6 +2950,12 @@ export default {
         async billsDetailfun(id, status) {
             const res = await billsDetail(id);
             // this.form = res.data.data;
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
+                res.data.data.feeCenterListC = []
+            }
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
+                res.data.data.feeCenterListD = []
+            }
             this.$set(this, "form", res.data.data);
             this.inLock();
             //   console.log('form', this.form)
@@ -2949,7 +2965,7 @@ export default {
             // 如果已经请核就禁用按钮
             if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
                 this.detailData.seeDisabled = true
-            }else {
+            } else {
                 this.detailData.seeDisabled = false
             }
             // this.columnforfun('teamName').disabled = true

+ 35 - 5
src/views/iosBasicData/OceanFreightImport/bills/index.vue

@@ -50,8 +50,7 @@
                     </el-button>
                     <el-button type="warning" size="small" @click="outExport">导 出
                     </el-button>
-                    <el-button
-                        type="success" size="small" @click="checkBills" :disabled="!selectionList.length">单据请核
+                    <el-button type="success" size="small" @click="checkBills" :disabled="!selectionList.length">单据请核
                     </el-button>
                     <div style="margin-top: 10px">
                         <el-tabs type="card" v-model="query.billStatus" @tab-click="handleClick">
@@ -125,7 +124,7 @@
                 <template slot="eta" slot-scope="scope">
                     <span>{{
                         scope.row.eta ? scope.row.eta.slice(0, 10) : ""
-                    }}</span>
+                        }}</span>
                 </template>
                 <template slot="updateTime" slot-scope="scope">
                     <span>{{
@@ -1348,7 +1347,8 @@ export default {
             billStatusData: [],
             // 财务状态
             accountStatusData: [],
-            saberUserInfo: {} // 当前登录人个人信息
+            saberUserInfo: {}, // 当前登录人个人信息
+            radioRow: {}
         };
     },
     computed: {
@@ -1788,6 +1788,7 @@ export default {
         },
         // 添加到主单
         increaseMawb() {
+            this.radioRow = {}
             if (this.selectionList.length === 0) {
                 this.$message.warning("请选择至少一条数据");
                 return;
@@ -1870,6 +1871,8 @@ export default {
         // 弹窗单选
         radioInput(row) {
             console.log(row, 2134);
+
+            this.radioRow = row
             console.log(this.dialogRadio, 2083);
         },
         // 弹窗确认
@@ -1878,6 +1881,10 @@ export default {
                 this.$message.warning("请选择一条数据");
                 return;
             }
+            if (this.radioRow.status == 3) {
+                this.$message.error("此单据已审核通过,请重新选择!");
+                return;
+            }
             this.billsIncreaseReinsurancePolicyfun(this.ids, this.dialogRadio);
         },
         // 添加到主单接口
@@ -1937,6 +1944,28 @@ export default {
                     span: 24,
                     column: [
                         {
+                            label: "单据类型",
+                            prop: "billType",
+                            type: "select",
+                            value: this.selectionList[0].billType,
+                            dicData: [
+                                {
+                                    label: '直单',
+                                    value: 'DD'
+                                },
+                                {
+                                    label: '主单',
+                                    value: 'MM'
+                                },
+                                {
+                                    label: '分单',
+                                    value: 'MH'
+                                }
+                            ],
+                            dataType: "string",
+                            span: 24
+                        },
+                        {
                             label: "复制类型",
                             prop: "checkbox",
                             type: "checkbox",
@@ -1967,7 +1996,8 @@ export default {
                         this.$refs.billsDetails.pageLoading = true;
                         this.$refs.billsDetails.billsCopyBillsfun(
                             this.selectionList[0].id,
-                            res.data.checkbox
+                            res.data.checkbox,
+                            res.data.billType
                         );
                     });
                     this.$store.commit("IN_OCEANFI_DETAIL");

+ 17 - 16
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue

@@ -648,12 +648,26 @@
                             </el-col>
                         </div>
                         <div>
+                            <el-col>
+                                <el-form-item label="所属公司" prop="branchName" label-width="80px">
+                                    <span slot="label">
+                                        <span style="color: #1e9fff">所属公司</span>
+                                    </span>
+                                    <dic-select v-model="assemblyForm.branchName" placeholder="所属公司" key="id"
+                                        label="deptName" url="/blade-system/dept/top-list" :filterable="true"
+                                        :remote="true" dataName="deptName"
+                                        @selectChange="dicChange('branchName', $event)"
+                                        :disabled="detailData.seeDisabled || !(roleName.includes('admin') || roleName.includes('总部'))|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
+                                </el-form-item>
+                            </el-col>
+                        </div>
+                        <div>
                             <el-col :span="13">
                                 <el-form-item label="OP" prop="operatorName" label-width="80px">
                                     <span slot="label">
                                         <span style="color: #1e9fff">OP</span>
                                     </span>
-                                    <dic-select v-model="assemblyForm.operatorName" placeholder="OP" key="id"
+                                    <dic-select v-model="assemblyForm.operatorName" placeholder="OP" :key="assemblyForm.branchId"
                                         label="realName"
                                         :url="'/blade-user/userListAll?roleAlias=操作员&deptId=' + saberUserInfo.dept_pid.split(',')[0]"
                                         :filterable="true" dataName="realName"
@@ -666,7 +680,7 @@
                                     <span slot="label">
                                         <span style="color: #1e9fff">客服</span>
                                     </span>
-                                    <dic-select v-model="assemblyForm.accDeptName" placeholder="客服" key="id"
+                                    <dic-select v-model="assemblyForm.accDeptName" placeholder="客服" :key="assemblyForm.branchId"
                                         label="realName"
                                         :url="'/blade-user/userListAll?roleAlias=客服&deptId=' + saberUserInfo.dept_pid.split(',')[0]"
                                         :filterable="true" dataName="realName"
@@ -675,20 +689,7 @@
                                 </el-form-item>
                             </el-col>
                         </div>
-                        <div>
-                            <el-col>
-                                <el-form-item label="所属公司" prop="branchName" label-width="80px">
-                                    <span slot="label">
-                                        <span style="color: #1e9fff">所属公司</span>
-                                    </span>
-                                    <dic-select v-model="assemblyForm.branchName" placeholder="所属公司" key="id"
-                                        label="deptName" url="/blade-system/dept/top-list" :filterable="true"
-                                        :remote="true" dataName="deptName"
-                                        @selectChange="dicChange('branchName', $event)"
-                                        :disabled="detailData.seeDisabled || !(roleName.includes('admin') || roleName.includes('总部'))|| assemblyForm.feeCenterListD.filter(item => item.auditStatus > 0).length || assemblyForm.feeCenterListC.filter(item => item.auditStatus > 0).length"></dic-select>
-                                </el-form-item>
-                            </el-col>
-                        </div>
+                        
                         <div>
                             <el-col>
                                 <el-form-item label="付款方式" prop="hpaymode" label-width="80px">

+ 2 - 1
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -1887,7 +1887,8 @@ export default {
             losbfeestemplateGetListTemplate(1, 50, {
                 dc: dc,
                 status: 0,
-                type: 'HYCK'
+                type: 'HYCK',
+                shippingCompanyId:this.assemblyForm.carrierId
             }).then(res => {
                 this.templateData = res.data.data.records
                 // 查第一条的明细

+ 1 - 1
src/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsFrame/PurchaseNotice.vue

@@ -114,7 +114,7 @@
             </el-col>
             <el-col :span="24">
                 <el-form-item label="船代:" prop="corpCnName">
-                    <el-input type="age" style="width: 50%;" v-model="documentForm.bookingAgentCnName" size="small"
+                    <el-input type="age" style="width: 50%;" v-model="documentForm.shippingAgencyCname" size="small"
                         autocomplete="off" clearable placeholder="船代">
                     </el-input>
                 </el-form-item>

+ 21 - 7
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -114,7 +114,7 @@
                                                                 }} {{ item[0].label }}
                                                             </span>
                                                             <span v-else style="color: #1e9fff">{{ item[0].label
-                                                                }}</span>
+                                                            }}</span>
                                                         </span>
                                                         <span v-if="item[0].type == 'button'"></span>
                                                         <!--<el-button v-if="item[0].type == 'button'" :disabled="detailData.seeDisabled || item[0].disabled"-->
@@ -125,7 +125,7 @@
                                                             :datalist="item[0].dicData"
                                                             :selectValue="form[item[0].prop]" :filterable="true"
                                                             :allowCreate="item[0].allowCreate || false" :remote="true"
-                                                            :disabled="detailData.seeDisabled || item[0].disabled|| form.feeCenterListD.filter(item=>item.auditStatus>0).length||form.feeCenterListC.filter(item=>item.auditStatus>0).length"
+                                                            :disabled="detailData.seeDisabled || item[0].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                                             :buttonIf="false" :placeholder="`${item[0].text || ''}`"
                                                             :forParameter="item[0].forParameter"
                                                             @remoteMethod="remoteMethod($event, item[0].prop)"
@@ -134,7 +134,7 @@
                                                         </search-query>
                                                         <el-input v-else type="age" style="width: 100%;"
                                                             v-model="form[item[0].prop]" size="small" autocomplete="off"
-                                                            :disabled="detailData.seeDisabled || item[0].disabled|| form.feeCenterListD.filter(item=>item.auditStatus>0).length||form.feeCenterListC.filter(item=>item.auditStatus>0).length"
+                                                            :disabled="detailData.seeDisabled || item[0].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                                             :placeholder="item[0].text || ''"></el-input>
                                                     </el-form-item>
                                                 </el-col>
@@ -154,7 +154,7 @@
                                                             :datalist="item[1].dicData"
                                                             :selectValue="form[item[1].prop]" :filterable="true"
                                                             :remote="true"
-                                                            :disabled="detailData.seeDisabled || item[1].disabled|| form.feeCenterListD.filter(item=>item.auditStatus>0).length||form.feeCenterListC.filter(item=>item.auditStatus>0).length"
+                                                            :disabled="detailData.seeDisabled || item[1].disabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                                             :buttonIf="false" :placeholder="`${item[1].text || ''}`"
                                                             :forParameter="item[1].forParameter"
                                                             @remoteMethod="remoteMethod($event, item[1].prop)"
@@ -212,7 +212,7 @@
                                                 <search-query v-if="item.type == 'select'" ref="searchQueryRef"
                                                     :datalist="item.dicData" :selectValue="form[item.prop]"
                                                     :filterable="true" :clearable="false" :remote="true"
-                                                    :disabled="detailData.seeDisabled|| form.feeCenterListD.filter(item=>item.auditStatus>0).length||form.feeCenterListC.filter(item=>item.auditStatus>0).length"
+                                                    :disabled="detailData.seeDisabled || form.feeCenterListD.filter(item => item.auditStatus > 0).length || form.feeCenterListC.filter(item => item.auditStatus > 0).length"
                                                     :buttonIf="item.buttonIf" :forParameter="item.forParameter"
                                                     :placeholder="`${item.text || ''}`" :joinData="item.joinData"
                                                     @remoteMethod="remoteMethod($event, item.prop)"
@@ -2378,7 +2378,7 @@ export default {
             })
         },
         // 复制单据接口
-        async billsCopyBillsfun(id, type) {
+        async billsCopyBillsfun(id, type,billType) {
             const loading = this.$loading({
                 lock: true,
                 text: '加载中',
@@ -2386,6 +2386,7 @@ export default {
                 background: 'rgba(255,255,255,0.7)'
             });
             let res = await billsCopyBills({ id })
+
             loading.close();
             let types = typeof type == "string" ? type.split(",") : []
             // if (type == '复制费用' || type == '') {
@@ -2402,6 +2403,13 @@ export default {
                 res.data.data.feeCenterListD = []
                 res.data.data.feeCenterListC = []
             }
+            res.data.data.billType=billType
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
+                res.data.data.feeCenterListC = []
+            }
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
+                res.data.data.feeCenterListD = []
+            }
             await this.saveLocalCurrency(res.data.data.branchId)
             this.form = res.data.data;
             this.pageLoading = false
@@ -2472,6 +2480,12 @@ export default {
             const res = await billsDetail(id)
             // this.form = res.data.data;
             await this.saveLocalCurrency(res.data.data.branchId)
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应收修改') || this.roleName.includes('应收查看')) && !(this.roleName.includes('应付修改') || this.roleName.includes('应付查看'))) {
+                res.data.data.feeCenterListC = []
+            }
+            if (!this.roleName.includes('admin') && (this.roleName.includes('应付修改') || this.roleName.includes('应付查看')) && !(this.roleName.includes('应收修改') || this.roleName.includes('应收查看'))) {
+                res.data.data.feeCenterListD = []
+            }
             this.$set(this, 'form', res.data.data)
             this.inLock()
             //   console.log('form', this.form)
@@ -2481,7 +2495,7 @@ export default {
             // 如果已经请核就禁用按钮
             if (this.form.status == 1 || this.form.status == 2 || this.form.status == 3) {
                 this.detailData.seeDisabled = true
-            }else {
+            } else {
                 this.detailData.seeDisabled = false
             }
             // this.columnforfun('teamName').disabled = true

+ 32 - 2
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -150,7 +150,7 @@
                 <template slot="eta" slot-scope="scope">
                     <span>{{
                         scope.row.eta ? scope.row.eta.slice(0, 10) : ""
-                        }}</span>
+                    }}</span>
                 </template>
                 <template slot="updateTime" slot-scope="scope">
                     <span>{{
@@ -351,6 +351,7 @@ export default {
     },
     data() {
         return {
+            radioRow: {},
             roleName: [], // 当前登录人的角色权限
             dcDic: [
                 {
@@ -1940,6 +1941,7 @@ export default {
         },
         // 添加到主单
         increaseMawb() {
+            this.radioRow = {}
             if (this.selectionList.length === 0) {
                 this.$message.warning("请选择至少一条数据");
                 return;
@@ -2053,6 +2055,7 @@ export default {
         // 弹窗单选
         radioInput(row) {
             console.log(row, 2134);
+            this.radioRow = row
             console.log(this.dialogRadio, 2083);
         },
         // 弹窗确认
@@ -2061,6 +2064,10 @@ export default {
                 this.$message.warning("请选择一条数据");
                 return;
             }
+            if (this.radioRow.status == 3) {
+                this.$message.error("此单据已审核通过,请重新选择!");
+                return;
+            }
             this.billsIncreaseReinsurancePolicyfun(this.ids, this.dialogRadio);
         },
         // 添加到主单接口
@@ -2120,6 +2127,28 @@ export default {
                     span: 24,
                     column: [
                         {
+                            label: "单据类型",
+                            prop: "billType",
+                            type: "select",
+                            value: this.selectionList[0].billType,
+                            dicData: [
+                                {
+                                    label: '直单',
+                                    value: 'DD'
+                                },
+                                {
+                                    label: '主单',
+                                    value: 'MM'
+                                },
+                                {
+                                    label: '分单',
+                                    value: 'MH'
+                                }
+                            ],
+                            dataType: "string",
+                            span: 24
+                        },
+                        {
                             label: "复制类型",
                             prop: "checkbox",
                             type: "checkbox",
@@ -2150,7 +2179,8 @@ export default {
                         this.$refs.billsDetails.pageLoading = true;
                         this.$refs.billsDetails.billsCopyBillsfun(
                             this.selectionList[0].id,
-                            res.data.checkbox
+                            res.data.checkbox,
+                            res.data.billType
                         );
                     });
                     this.$store.commit("IN_SEAFE_DETAIL");

+ 63 - 53
src/views/iosBasicData/costcenter/coc/detailsPage.vue

@@ -42,6 +42,12 @@
         <div style="margin-top: 50px">
             <trade-card title="基础信息">
                 <avue-form :option="optionForm" v-model="form" ref="form">
+                    <tempalte slot="belongingCompanyName">
+                        <dic-select v-model="form.belongingCompanyName" placeholder="所属公司" key="id" label="deptName"
+                            url="/blade-system/dept/top-list" :filterable="true" :remote="true" dataName="deptName"
+                            @selectChange="dicChange('belongingCompanyName', $event)" :default="true"
+                            :disabled="editDisabled"></dic-select>
+                    </tempalte>
                     <tempalte slot="podCname">
                         <dic-select v-model="form.podCname" placeholder="起运港" key="id" label="cnName" res="records"
                             url="/blade-los/bports/list?current=1&size=5" :filterable="true" :remote="true"
@@ -134,8 +140,8 @@
                     </template>
                     <template slot="curCodeForm" slot-scope="{ row }">
                         <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                            :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'" :filterable="true"
-                            @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                            :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
+                            :filterable="true" @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
                         <span v-else>{{ row.curCode }}</span>
                     </template>
                     <template slot="exrateForm" slot-scope="{ row }">
@@ -206,8 +212,8 @@
                     </template>
                     <template slot="curCodeForm" slot-scope="{ row }">
                         <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                            :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'" :filterable="true"
-                            @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                            :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
+                            :filterable="true" @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
                         <span v-else>{{ row.curCode }}</span>
                     </template>
                     <template slot="exrateForm" slot-scope="{ row }">
@@ -217,8 +223,8 @@
                     </template>
                     <template slot="localCurCodeForm" slot-scope="{ row }">
                         <dic-select v-if="row.$cellEdit" v-model="row.localCurCode" placeholder="币别" label="code"
-                            :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'" :filterable="true"
-                            @selectChange="rowDicChange('localCurCode', $event, row)"></dic-select>
+                            :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
+                            :filterable="true" @selectChange="rowDicChange('localCurCode', $event, row)"></dic-select>
                         <span v-else>{{ row.localCurCode }}</span>
                     </template>
                     <template slot="localExrateForm" slot-scope="{ row }">
@@ -296,8 +302,8 @@
                     </template>
                     <template slot="curCodeForm" slot-scope="{ row }">
                         <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                            :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'" :filterable="true"
-                            @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                            :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
+                            :filterable="true" @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
                         <span v-else>{{ row.curCode }}</span>
                     </template>
                     <template slot="exrateForm" slot-scope="{ row }">
@@ -307,8 +313,8 @@
                     </template>
                     <template slot="localCurCodeForm" slot-scope="{ row }">
                         <dic-select v-if="row.$cellEdit" v-model="row.localCurCode" placeholder="币别" label="code"
-                            :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'" :filterable="true"
-                            @selectChange="rowDicChange('localCurCode', $event, row)"></dic-select>
+                            :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
+                            :filterable="true" @selectChange="rowDicChange('localCurCode', $event, row)"></dic-select>
                         <span v-else>{{ row.localCurCode }}</span>
                     </template>
                     <template slot="localExrateForm" slot-scope="{ row }">
@@ -468,6 +474,16 @@ export default {
                 labelWidth: 100,
                 column: [
                     {
+                        label: '所属公司',
+                        prop: "belongingCompanyName",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
                         label: '起运港',
                         prop: "podCname",
                         disabled: false,
@@ -1158,7 +1174,7 @@ export default {
                     }
                 ]
             },
-            roleName: []
+            roleName: [],
         }
     },
     components: {
@@ -1229,6 +1245,15 @@ export default {
 
         },
         dicChange(name, row) {
+            if (name == 'belongingCompanyName') {
+                if (row) {
+                    this.form.belongingCompanyId = row.id
+                    this.saveLocalCurrency(row.id)
+                } else {
+                    this.form.belongingCompanyId = null
+                    this.form.belongingCompanyName = null
+                }
+            }
             if (name == 'podCname') {
                 if (row) {
                     this.form.podId = row.id
@@ -1295,29 +1320,17 @@ export default {
         rowDicChange(name, row, el) {
             if (name == 'curCode') {
                 if (row) {
-                    bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                        res.data.data.forEach(e => {
-                            if (el.curCode == e.code) {
-                                this.$set(el, 'exrate', e.exrate)
-                                this.countChange(el)
-                            }
-                        })
-                    })
+                    el.exrate = row.exrateReceivable
+                    this.countChange()
                 } else {
                     el.exrate = null
                 }
             }
             if (name == 'localCurCode') {
                 if (row) {
-                    bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                        res.data.data.forEach(e => {
-                            if (el.curCode == e.code) {
-                                this.$set(el, 'localExrate', e.exrate)
-                            }
-                        })
-                    })
+                    el.localExrate = row.exrateReceivable
                 } else {
-                    el.exrate = null
+                    el.localExrate = null
                 }
             }
             if (name == 'feeName') {
@@ -1348,46 +1361,42 @@ export default {
         },
         rowEdit(row) {
         },
-        addRow() {
+        async addRow() {
             if (!this.form.id) {
                 return this.$message.error("请保存数据");
             }
-            bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                res.data.data.forEach(item => {
-                    if (item.code == 'USD') {
-                        this.form.costItemList.push({
-                            pid: this.form.id,
-                            curCode: 'USD',
-                            exrate: item.exrate,
-                            salesPrice: 0,
-                            costPrice: 0,
-                            totalProfit: 0,
-                            $cellEdit: true
-                        })
-                    }
-                })
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
+            this.form.costItemList.push({
+                pid: this.form.id,
+                curCode: 'USD',
+                exrate: this.getExchangeRate('USD', 'D', 1),
+                salesPrice: 0,
+                costPrice: 0,
+                totalProfit: 0,
+                $cellEdit: true
             })
-
         },
-        polAddRow() {
+        async polAddRow() {
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
             this.polFeeList.push({
                 pid: this.form.id,
                 srcType: 0,
                 busType: 'POL',
                 type: '船公司',
-                curCode: 'CNY',
-                exrate: 1,
+                curCode: this.getLocalCurrency(),
+                exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
                 $cellEdit: true
             })
         },
-        podAddRow() {
+        async podAddRow() {
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
             this.podFeeList.push({
                 pid: this.form.id,
                 srcType: 0,
                 busType: 'POD',
                 type: '船公司',
-                curCode: 'CNY',
-                exrate: 1,
+                curCode: this.getLocalCurrency(),
+                exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
                 $cellEdit: true
             })
         },
@@ -1413,6 +1422,7 @@ export default {
             getDetail({ id: id }).then(res => {
                 this.polFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POL')
                 this.podFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POD')
+                this.saveLocalCurrency(res.data.data.belongingCompanyId)
                 this.form = res.data.data
                 if (res.data.data.status != '录入') {
                     this.editButton = true
@@ -1566,7 +1576,7 @@ export default {
                     return this.$message.error("请添加数据");
                 }
                 for (let row of this.polFeeList) {
-                    if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice==null || row.costPrice==null) {
+                    if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice == null || row.costPrice == null) {
                         this.$refs.crud2.rowCell(row, row.$index)
                         return this.$message.error("请完善POL杂费明细");
                     }
@@ -1632,7 +1642,7 @@ export default {
                     return this.$message.error("请添加数据");
                 }
                 for (let row of this.podFeeList) {
-                    if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice==null || row.costPrice==null) {
+                    if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice == null || row.costPrice == null) {
                         this.$refs.crud3.rowCell(row, row.$index)
                         return this.$message.error("请完善POL杂费明细");
                     }
@@ -1818,13 +1828,13 @@ export default {
                         }
                     }
                     for (let row of this.polFeeList) {
-                        if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice==null || row.costPrice==null) {
+                        if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice == null || row.costPrice == null) {
                             this.$refs.crud2.rowCell(row, row.$index)
                             return this.$message.error("请完善POL杂费明细");
                         }
                     }
                     for (let row of this.podFeeList) {
-                        if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice==null || row.costPrice==null) {
+                        if (!row.type || !row.feeName || !row.curCode || !row.curCode || row.salesPrice == null || row.costPrice == null) {
                             this.$refs.crud3.rowCell(row, row.$index)
                             return this.$message.error("请完善POD杂费明细");
                         }

+ 64 - 87
src/views/iosBasicData/costcenter/soc/detailsPage.vue

@@ -193,7 +193,7 @@
                             </template>
                             <template slot="curCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
                                 <span v-else>{{ row.curCode }}</span>
@@ -276,7 +276,7 @@
                             </template>
                             <template slot="curCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
                                 <span v-else>{{ row.curCode }}</span>
@@ -289,7 +289,7 @@
                             <template slot="localCurCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.localCurCode" placeholder="币别"
                                     label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('localCurCode', $event, row)"></dic-select>
                                 <span v-else>{{ row.localCurCode }}</span>
@@ -365,7 +365,7 @@
                             </template>
                             <template slot="curCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
                                 <span v-else>{{ row.curCode }}</span>
@@ -378,7 +378,7 @@
                             <template slot="localCurCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.localCurCode" placeholder="币别"
                                     label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('localCurCode', $event, row)"></dic-select>
                                 <span v-else>{{ row.localCurCode }}</span>
@@ -441,7 +441,7 @@
                             </template>
                             <template slot="curCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('curCode2', $event, row)"></dic-select>
                                 <span v-else>{{ row.curCode }}</span>
@@ -515,7 +515,7 @@
                             </template>
                             <template slot="curCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('curCode2', $event, row)"></dic-select>
                                 <span v-else>{{ row.curCode }}</span>
@@ -528,7 +528,7 @@
                             <template slot="localCurCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.localCurCode" placeholder="币别"
                                     label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('localCurCode2', $event, row)"></dic-select>
                                 <span v-else>{{ row.localCurCode }}</span>
@@ -605,7 +605,7 @@
                             </template>
                             <template slot="curCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('curCode2', $event, row)"></dic-select>
                                 <span v-else>{{ row.curCode }}</span>
@@ -618,7 +618,7 @@
                             <template slot="localCurCodeForm" slot-scope="{ row }">
                                 <dic-select v-if="row.$cellEdit" v-model="row.localCurCode" placeholder="币别"
                                     label="code"
-                                    :url="'/blade-los/bcurrency/getExrate?date=' + form.exrateDate + '&dc=D'"
+                                    :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.belongingCompanyId + '&date=' + form.exrateDate + '&type=1'"
                                     :filterable="true"
                                     @selectChange="rowDicChange('localCurCode2', $event, row)"></dic-select>
                                 <span v-else>{{ row.localCurCode }}</span>
@@ -1805,7 +1805,7 @@ export default {
 
                 }
             })
-            getBcorpsList(1,10,{ shortName: '青岛永发船务' }).then(res => {
+            getBcorpsList(1, 10, { shortName: '青岛永发船务' }).then(res => {
                 if (res.data.data.records.length > 0) {
                     res.data.data.records.forEach(item => {
                         if (item.shortName == '青岛永发船务') {
@@ -1919,6 +1919,7 @@ export default {
             if (name == 'belongingCompanyName') {
                 if (row) {
                     this.form.belongingCompanyId = row.id
+                    this.saveLocalCurrency(row.id)
                 } else {
                     this.form.belongingCompanyId = null
                     this.form.belongingCompanyName = null
@@ -2162,56 +2163,32 @@ export default {
         rowDicChange(name, row, el) {
             if (name == 'curCode') {
                 if (row) {
-                    bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                        res.data.data.forEach(e => {
-                            if (el.curCode == e.code) {
-                                this.$set(el, 'exrate', e.exrate)
-                                this.countChange(el)
-                            }
-                        })
-                    })
+                    el.exrate = row.exrateReceivable
+                     this.countChange()
                 } else {
-                    el.exrate = 0
+                    el.exrate = null
                 }
             }
             if (name == 'localCurCode') {
                 if (row) {
-                    bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                        res.data.data.forEach(e => {
-                            if (el.curCode == e.code) {
-                                this.$set(el, 'localExrate', e.exrate)
-                            }
-                        })
-                    })
+                    el.localExrate = row.exrateReceivable
                 } else {
-                    el.localExrate = 0
+                    el.localExrate = null
                 }
             }
             if (name == 'curCode2') {
                 if (row) {
-                    bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                        res.data.data.forEach(e => {
-                            if (el.curCode == e.code) {
-                                this.$set(el, 'exrate', e.exrate)
-                                this.countChange2(el)
-                            }
-                        })
-                    })
+                    el.exrate = row.exrateReceivable
+                    this.countChange2()
                 } else {
-                    el.exrate = 0
+                    el.exrate = null
                 }
             }
             if (name == 'localCurCode2') {
                 if (row) {
-                    bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                        res.data.data.forEach(e => {
-                            if (el.curCode == e.code) {
-                                this.$set(el, 'localExrate', e.exrate)
-                            }
-                        })
-                    })
+                    el.localExrate = row.exrateReceivable
                 } else {
-                    el.localExrate = 0
+                    el.localExrate = null
                 }
             }
             if (name == 'feeName') {
@@ -2254,82 +2231,81 @@ export default {
         },
         rowEdit(row) {
         },
-        addRow() {
+        async addRow() {
             if (!this.form.id) {
                 return this.$message.error("请保存数据");
             }
-            bcurrencyGetExrate({ date: this.form.exrateDate, dc: 'D' }).then(res => {
-                res.data.data.forEach(item => {
-                    if (item.code == 'USD') {
-                        this.form.costItemList.push({
-                            pid: this.form.id,
-                            curCode: 'USD',
-                            exrate: item.exrate,
-                            salesPrice: 0,
-                            costPrice: 0,
-                            totalProfit: 0,
-                            oceanFreight: 0,
-                            boxCost: 0,
-                            useBoxCost: 0,
-                            polCost: 0,
-                            polIncome: 0,
-                            podCost: 0,
-                            podIncome: 0,
-                            salesPriceTwo: 0,
-                            costPriceTwo: 0,
-                            totalProfitTwo: 0,
-                            oceanFreightTwo: 0,
-                            polCostTwo: 0,
-                            polIncomeTwo: 0,
-                            podCostTwo: 0,
-                            podIncomeTwo: 0,
-                            $cellEdit: true
-                        })
-                    }
-                })
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
+            this.form.costItemList.push({
+                pid: this.form.id,
+                curCode: 'USD',
+                exrate: this.getExchangeRate('USD', 'D', 1),
+                salesPrice: 0,
+                costPrice: 0,
+                totalProfit: 0,
+                oceanFreight: 0,
+                boxCost: 0,
+                useBoxCost: 0,
+                polCost: 0,
+                polIncome: 0,
+                podCost: 0,
+                podIncome: 0,
+                salesPriceTwo: 0,
+                costPriceTwo: 0,
+                totalProfitTwo: 0,
+                oceanFreightTwo: 0,
+                polCostTwo: 0,
+                polIncomeTwo: 0,
+                podCostTwo: 0,
+                podIncomeTwo: 0,
+                $cellEdit: true
             })
         },
-        polAddRow() {
+        async polAddRow() {
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
             this.polFeeList.push({
                 pid: this.form.id,
                 srcType: 0,
                 busType: 'POL',
                 type: '船公司',
-                curCode: 'CNY',
-                exrate: 1,
+                curCode: this.getLocalCurrency(),
+                exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
                 $cellEdit: true
             })
         },
-        podAddRow() {
+        async podAddRow() {
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
             this.podFeeList.push({
                 pid: this.form.id,
                 srcType: 0,
                 busType: 'POD',
                 type: '船公司',
-                curCode: 'CNY',
-                exrate: 1,
+                curCode: this.getLocalCurrency(),
+                exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
                 $cellEdit: true
             })
         },
-        polAddRow2() {
+        async polAddRow2() {
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
             this.polFeeList2.push({
                 pid: this.form.id,
                 srcType: 1,
                 busType: 'POL',
                 type: '船公司',
-                curCode: 'CNY',
-                exrate: 1,
+                curCode: this.getLocalCurrency(),
+                exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
                 $cellEdit: true
             })
         },
-        podAddRow2() {
+        async podAddRow2() {
+            await this.checkRate(null, this.form.exrateDate, null, 1, this.form.belongingCompanyId)
             this.podFeeList2.push({
                 pid: this.form.id,
                 srcType: 1,
                 busType: 'POD',
                 type: '船公司',
-                curCode: 'CNY',
-                exrate: 1,
+                curCode: this.getLocalCurrency(),
+                exrate: this.getExchangeRate(this.getLocalCurrency(), 'D', 1),
                 $cellEdit: true
             })
         },
@@ -2357,6 +2333,7 @@ export default {
                 this.podFeeList = res.data.data.costFeeList.filter(item => item.busType == 'POD' && item.srcType == 0)
                 this.polFeeList2 = res.data.data.costFeeList.filter(item => item.busType == 'POL' && item.srcType == 1)
                 this.podFeeList2 = res.data.data.costFeeList.filter(item => item.busType == 'POD' && item.srcType == 1)
+                this.saveLocalCurrency(res.data.data.belongingCompanyId)
                 if (res.data.data.changeShipType == '自转') {
                     this.optionForm.column.forEach(item => {
                         if (item.prop == 'actualShippingCompanyCnameTwo' || item.prop == 'transportationTermsTwo' || item.prop == 'shipCnameTwo' || item.prop == 'voyageTwo') {

+ 25 - 14
src/views/iosBasicData/feeApplication/detailsPage.vue

@@ -28,7 +28,7 @@
       </trade-card>
       <trade-card title="费用明细">
         <el-card
-          v-show="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1 ? true : roleName.indexOf('应付查看') != -1"
+          v-show="roleName.indexOf('admin') != -1||roleName.indexOf('secondaryAdmin') != -1 || roleName.indexOf('应付修改') != -1 ? true : roleName.indexOf('应付查看') != -1"
           class="box-card" style="margin: 2px 0">
           <avue-crud :option="feedOption" :data="feeCenterListD" id="out-table" ref="crud2"
             :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
@@ -51,7 +51,7 @@
           </avue-crud>
         </el-card>
         <el-card
-          v-show="roleName.indexOf('admin') != -1 || roleName.indexOf('应付修改') != -1 ? true : roleName.indexOf('应付查看') != -1"
+          v-show="roleName.indexOf('admin') != -1|| roleName.indexOf('应付修改') != -1 ? true : roleName.indexOf('应付查看') != -1"
           class="box-card" style="margin: 2px 0">
           <avue-crud :option="feecOption" :data="feeCenterListC" id="out-table" ref="crud3"
             :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
@@ -341,12 +341,12 @@ export default {
         showSummary: true,
         sumColumnList: [
           {
-            name: 'amount',
+            name: 'amountCNY',
             type: 'sum',
             decimals: 2
           },
           {
-            name: 'amountLoc',
+            name: 'amountUSD',
             type: 'sum',
             decimals: 2
           }
@@ -408,14 +408,14 @@ export default {
             overHidden: true,
           },
           {
-            label: "金额",
-            prop: "amount",
+            label: "本币",
+            prop: "amountCNY",
             width: "100",
             overHidden: true,
           },
           {
-            label: "外币金额",
-            prop: "amountLoc",
+            label: "外币",
+            prop: "amountUSD",
             width: "100",
             overHidden: true,
           },
@@ -472,12 +472,12 @@ export default {
         showSummary: true,
         sumColumnList: [
           {
-            name: 'amount',
+            name: 'amountCNY',
             type: 'sum',
             decimals: 2
           },
           {
-            name: 'amountLoc',
+            name: 'amountUSD',
             type: 'sum',
             decimals: 2
           }
@@ -539,14 +539,14 @@ export default {
             overHidden: true,
           },
           {
-            label: "金额",
-            prop: "amount",
+            label: "本币",
+            prop: "amountCNY",
             width: "100",
             overHidden: true,
           },
           {
-            label: "外币金额",
-            prop: "amountLoc",
+            label: "外币",
+            prop: "amountUSD",
             width: "100",
             overHidden: true,
           },
@@ -600,6 +600,7 @@ export default {
     this.roleName = localStorage.getItem('roleName').split(',')
     this.feedOption = await this.getColumnData(this.getColumnName(485), this.feedOptionBack);
     this.feecOption = await this.getColumnData(this.getColumnName(486), this.feecOptionBack);
+    await this.saveLocalCurrency()
     if (this.detailData.id) {
       this.getDetail(this.detailData.id)
     }
@@ -613,6 +614,16 @@ export default {
         background: 'rgba(255,255,255,0.7)'
       });
       detail({ id: id }).then(res => {
+        res.data.data.feeCenterList.forEach(row => {
+          if (row.curCode == this.getLocalCurrency()) {
+            row.amountCNY = row.amount
+            row.amountUSD = 0
+          }
+          if (row.curCode != this.getLocalCurrency()) {
+            row.amountUSD = row.amount
+            row.amountCNY = 0
+          }
+        })
         this.feeCenterListD = res.data.data.feeCenterList.filter(item => item.dc == "D")
         this.feeCenterListC = res.data.data.feeCenterList.filter(item => item.dc == "C")
         this.form = res.data.data

+ 1 - 1
src/views/iosBasicData/podTemplate/index.vue

@@ -391,7 +391,7 @@ export default {
     // 获取左侧业务类别数据
     bbusinesstypeListfun() {
       this.loadingBtn = true,
-        bbusinesstypeList(1, 100, { enableFee: '1', cnName: '成本中心模板(POD)' }).then(res => {
+        bbusinesstypeList(1, 100, { enableFee: '0', cnName: '成本中心模板(POD)' }).then(res => {
           this.feesTypeData = res.data.data.records
         }).finally(() => {
           this.loadingBtn = false

+ 1 - 1
src/views/iosBasicData/polTemplate/index.vue

@@ -391,7 +391,7 @@ export default {
     // 获取左侧业务类别数据
     bbusinesstypeListfun() {
       this.loadingBtn = true,
-        bbusinesstypeList(1, 100, { enableFee: '1', cnName: '成本中心模板(POL)' }).then(res => {
+        bbusinesstypeList(1, 100, { enableFee: '0', cnName: '成本中心模板(POL)' }).then(res => {
           this.feesTypeData = res.data.data.records
         }).finally(() => {
           this.loadingBtn = false

+ 5 - 3
src/views/iosBasicData/rateManagement/detailsPage.vue

@@ -22,7 +22,8 @@
           <template slot="branchName">
             <dic-select v-model="form.branchName" placeholder="所属公司" key="id" label="deptName"
               url="/blade-system/dept/top-list" :filterable="true" :remote="true" dataName="deptName"
-              @selectChange="dicChange('branchName', $event)" :disabled="!roleName.includes('总公司')||detailData.status == 1"></dic-select>
+              @selectChange="dicChange('branchName', $event)"
+              :disabled="!roleName.includes('总公司') || detailData.status == 1"></dic-select>
           </template>
           <template slot="parities">
             <el-input-number v-model="form.parities" size="small" :controls="false" style="width: 100%"
@@ -416,7 +417,8 @@ export default {
         type: params.paritiesType,
         code: this.form.code,
         exrateYear: params.annual,
-        exrateMonth: params.moon
+        exrateMonth: params.moon,
+        branchId: this.form.branchId,
       }
       bcurexrateList(obj).then(res => {
         this.dataList = res.data.data.records;
@@ -760,7 +762,7 @@ export default {
           // this.findObject(this.option.column, "annual").display = true;
         }
 
-        if (this.form.code&&this.form.isLocal==0) {
+        if (this.form.code && this.form.isLocal == 0) {
           // 查明细信息
           obj = { ...obj, ...this.search }
           this.searchChange(obj)

+ 2 - 2
src/views/ow/owPut/detailsPage.vue

@@ -274,7 +274,7 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=1' + form.effectiveDate + '&type=1'"
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
                   :filterable="true" @selectChange="rowDicChange('curCodeD', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
@@ -372,7 +372,7 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=1' + form.effectiveDate + '&type=1'"
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
                   :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>

+ 2 - 2
src/views/ow/owTask/detailsPage.vue

@@ -277,7 +277,7 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=1' + form.effectiveDate + '&type=1'"
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
                   :filterable="true" @selectChange="rowDicChange('curCodeD', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>
@@ -375,7 +375,7 @@
               </template>
               <template slot="curCodeForm" slot-scope="{ row }">
                 <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" label="code"
-                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=1' + form.effectiveDate + '&type=1'"
+                  :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=' + form.effectiveDate + '&type=1'"
                   :filterable="true" @selectChange="rowDicChange('curCodeC', $event, row)"></dic-select>
                 <span v-else>{{ row.curCode }}</span>
               </template>