|
|
@@ -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)
|
|
|
}
|
|
|
})
|