|
|
@@ -277,8 +277,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.effectiveDate + '&dc=D'" :filterable="true"
|
|
|
- @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
|
|
|
+ :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=1' + form.effectiveDate + '&type=1'"
|
|
|
+ :filterable="true" @selectChange="rowDicChange('curCodeD', $event, row)"></dic-select>
|
|
|
<span v-else>{{ row.curCode }}</span>
|
|
|
</template>
|
|
|
<template slot="exrateForm" slot-scope="{ row }">
|
|
|
@@ -370,8 +370,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.effectiveDate + '&dc=C'" :filterable="true"
|
|
|
- @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
|
|
|
+ :url="'/blade-los/bcurrency/obtainRate?deptId=' + deptId + '&date=1' + 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 }">
|
|
|
@@ -534,21 +534,26 @@
|
|
|
:header-cell-class-name="headerClassName" :row-style="{ height: '20px', padding: '0px' }"
|
|
|
:cell-style="{ height: '20px', padding: '0px' }">
|
|
|
<template slot="indexHeader" slot-scope="{row,index}">
|
|
|
- <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="editDisabled" circle @click="rtAddRow()">
|
|
|
+ <el-button type="primary" size="mini" icon="el-icon-plus"
|
|
|
+ :disabled="editDisabled || feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0" circle
|
|
|
+ @click="rtAddRow()">
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template slot="index" slot-scope="{row,index}">
|
|
|
<span>{{ index + 1 }}</span>
|
|
|
</template>
|
|
|
<template slot="menu" slot-scope="{ row, index }">
|
|
|
- <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row, index)">{{ row.$cellEdit ? '保存' :
|
|
|
- '编辑'
|
|
|
- }}</el-button>
|
|
|
- <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)">删除</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row, index)"
|
|
|
+ :disabled="feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0">{{ row.$cellEdit ? '保存' :
|
|
|
+ '编辑'
|
|
|
+ }}</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
|
|
|
+ :disabled="feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0">删除</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="rtSubmit" size="mini">保 存</el-button>
|
|
|
+ <el-button type="primary" @click="rtSubmit" size="mini"
|
|
|
+ :disabled="feeCenterListD.filter(item => item.feeCnName == '租箱费').length > 0">保 存</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
@@ -1277,6 +1282,15 @@ export default {
|
|
|
width: 120
|
|
|
},
|
|
|
{
|
|
|
+ label: 'POL空箱提箱进场日期',
|
|
|
+ prop: 'polPickUpDate',
|
|
|
+ overHidden: true,
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ width: 130
|
|
|
+ },
|
|
|
+ {
|
|
|
label: 'POD场站',
|
|
|
prop: "podStationCname",
|
|
|
cell: true,
|
|
|
@@ -1537,7 +1551,7 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: "CNY",
|
|
|
+ label: "本币",
|
|
|
prop: "amountCNY",
|
|
|
width: "100",
|
|
|
overHidden: true,
|
|
|
@@ -1769,7 +1783,7 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: "CNY",
|
|
|
+ label: "本币",
|
|
|
prop: "amountCNY",
|
|
|
width: "100",
|
|
|
overHidden: true,
|
|
|
@@ -1845,19 +1859,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,
|
|
|
}, {
|
|
|
@@ -1940,6 +1954,7 @@ export default {
|
|
|
updateSearchKey: new Date().getTime(),
|
|
|
updateFormKey: new Date().getTime(),
|
|
|
updateStationKey: new Date().getTime(),
|
|
|
+ deptId: JSON.parse(localStorage.getItem('sysitemData')).deptId
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -1968,6 +1983,8 @@ export default {
|
|
|
if (this.detailData.copyId) {
|
|
|
this.getCopydate(this.detailData.copyId)
|
|
|
}
|
|
|
+ this.saveLocalCurrency(this.deptId)
|
|
|
+
|
|
|
},
|
|
|
methods: {
|
|
|
openRtDialog() {
|
|
|
@@ -1997,21 +2014,21 @@ export default {
|
|
|
let sumC = 0
|
|
|
sumArr.forEach(item => {
|
|
|
if (e == item.shortName) {
|
|
|
- if (item.curCode == 'CNY' && item.dc == 'D') {
|
|
|
- rmbD += Number(item.amount)
|
|
|
- sumD += Number(item.amount)
|
|
|
+ if (item.curCode == this.getLocalCurrency() && item.dc == 'D') {
|
|
|
+ rmbD += Number(item.amount?item.amount:0)
|
|
|
+ sumD += Number(item.amount?item.amount:0)
|
|
|
}
|
|
|
- if (item.curCode == 'CNY' && item.dc == 'C') {
|
|
|
- rmbC += Number(item.amount)
|
|
|
- sumC += Number(item.amount)
|
|
|
+ if (item.curCode == this.getLocalCurrency() && item.dc == 'C') {
|
|
|
+ rmbC += Number(item.amount?item.amount:0)
|
|
|
+ sumC += Number(item.amount?item.amount:0)
|
|
|
}
|
|
|
- if (item.curCode == 'USD' && item.dc == 'D') {
|
|
|
- usdD += Number(item.amountLoc)
|
|
|
- sumD += Number(item.amountLoc) * Number(item.exrate)
|
|
|
+ if (item.curCode == this.getLocalCurrency() && item.dc == 'D') {
|
|
|
+ usdD += Number(item.amountLoc?item.amountLoc:0)
|
|
|
+ sumD += Number(item.amountLoc?item.amountLoc:0) * Number(item.exrate?item.exrate:0)
|
|
|
}
|
|
|
- if (item.curCode == 'USD' && item.dc == 'C') {
|
|
|
- usdC += Number(item.amountLoc)
|
|
|
- sumC += Number(item.amountLoc) * Number(item.exrate)
|
|
|
+ if (item.curCode == this.getLocalCurrency() && item.dc == 'C') {
|
|
|
+ usdC += Number(item.amountLoc?item.amountLoc:0)
|
|
|
+ sumC += Number(item.amountLoc?item.amountLoc:0) * Number(item.exrate?item.exrate:0)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -2027,7 +2044,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
countChange(row) {
|
|
|
- if (row.curCode == 'CNY') {
|
|
|
+ if (row.curCode == this.getLocalCurrency()) {
|
|
|
row.amountCNY = _.round(_.multiply(row.price, row.quantity), 2)
|
|
|
row.amountUSD = 0
|
|
|
} else {
|
|
|
@@ -2263,16 +2280,16 @@ export default {
|
|
|
el.podStationCname = null
|
|
|
}
|
|
|
}
|
|
|
- if (name == 'curCode') {
|
|
|
+ if (name == 'curCodeD') {
|
|
|
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.exrateReceivable
|
|
|
+ } else {
|
|
|
+ el.exrate = null
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (name == 'curCodeC') {
|
|
|
+ if (row) {
|
|
|
+ el.exrate = row.exratePayable
|
|
|
} else {
|
|
|
el.exrate = null
|
|
|
}
|
|
|
@@ -2363,10 +2380,11 @@ export default {
|
|
|
loading.close();
|
|
|
})
|
|
|
},
|
|
|
- feedAddRow() {
|
|
|
+ async feedAddRow() {
|
|
|
if (!this.form.id) {
|
|
|
return this.$message.error("请保存数据");
|
|
|
}
|
|
|
+ await this.checkRate(null, this.form.effectiveDate, null, 1, this.deptId)
|
|
|
this.feeCenterListD.push({
|
|
|
pid: this.form.id,
|
|
|
feesType: 1,
|
|
|
@@ -2375,15 +2393,16 @@ 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(), 'D', 1),
|
|
|
$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.feeCenterListC.push({
|
|
|
pid: this.form.id,
|
|
|
feesType: 1,
|
|
|
@@ -2392,8 +2411,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
|
|
|
})
|
|
|
},
|
|
|
@@ -2433,11 +2452,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
|
|
|
}
|
|
|
@@ -2932,14 +2951,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("请完善应付费用明细");
|