Commit 9ec367df authored by 我在何方's avatar 我在何方

收款单海运2.2

parent da68387c
...@@ -102,6 +102,7 @@ ...@@ -102,6 +102,7 @@
</el-col> </el-col>
<el-table v-loading="loadings" :data="list" border :key="isUpdate"> <el-table v-loading="loadings" :data="list" border :key="isUpdate">
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" /> <el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
<el-table-column :label="$t('自编号')" align="center" prop="selfNo" />
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('品名')" align="center" prop="title"> <el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -763,7 +764,7 @@ export default { ...@@ -763,7 +764,7 @@ export default {
codePage: { codePage: {
pageNo: 1, pageNo: 1,
pageSize: 100 pageSize: 100
}, },
pages:1 pages:1
}; };
...@@ -780,6 +781,11 @@ export default { ...@@ -780,6 +781,11 @@ export default {
}else{ }else{
this.removeData() this.removeData()
} }
getUserProfile().then(res => {
this.discountForm.author = res.data.username
this.form.departmentId = res.data.deptId
this.form.salesmanId = res.data.id
})
}, },
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
...@@ -798,8 +804,10 @@ export default { ...@@ -798,8 +804,10 @@ export default {
} }
}, },
async created() { async created() {
getUserProfile().then(res => { await getUserProfile().then(res => {
this.discountForm.author = res.data.username this.discountForm.author = res.data.username
this.form.departmentId = res.data.deptId
this.form.salesmanId = res.data.id
}) })
// 获取汇率 // 获取汇率
await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list) await getCurrencyPage(this.params).then(res => this.currencyList = res.data.list)
...@@ -842,20 +850,21 @@ export default { ...@@ -842,20 +850,21 @@ export default {
getTradeCityList().then((res) => (that.tradeCityList = res.data)); getTradeCityList().then((res) => (that.tradeCityList = res.data));
this.getCodeList() this.getCodeList()
listSimpleDepts().then((res) => { listSimpleDepts().then((res) => {
res.data.forEach((item) => { that.deptData = res.data
if (item.parentId == 0) { // res.data.forEach((item) => {
that.deptArr.push(item); // if (item.parentId == 0) {
} else { // that.deptArr.push(item);
that.deptData.push(item); // } else {
} // that.deptData.push(item);
}); // }
// });
that.deptData.forEach((value) => { // that.deptData.forEach((value) => {
var dept = that.deptArr.filter((itt) => itt.id == value.parentId); // var dept = res.data.filter((itt) => itt.id == value.parentId);
if (dept.length > 0) { // if (dept.length > 0) {
value.name = dept[0].name + " | " + value.name; // value.name = dept[0].name + " | " + value.name;
} // }
}); // });
}); });
}, },
computed: { computed: {
...@@ -1004,14 +1013,14 @@ export default { ...@@ -1004,14 +1013,14 @@ export default {
this.rateChange(row, index) this.rateChange(row, index)
}, },
writeOffRateChange(row, index) { writeOffRateChange(row, index) {
row.writeOffAmount = NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal)).toFixed(2) row.writeOffAmount = Math.round(NP.times(row.writeOffRate || 0, NP.minus(row.receivableAmount, row.discountTotal)))
const writeOffAmountTotal = this.form.receiptAccountList.filter(v => v.type !== 'total').reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0) const writeOffAmountTotal = this.form.receiptAccountList.filter(v => v.type !== 'total').reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0)
this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal this.form.receiptAccountList[this.form.receiptAccountList.length -1].writeOffAmount = writeOffAmountTotal
}, },
rateChange(row, index) { rateChange(row, index) {
console.log(row) console.log(row)
row.receivableAmount && (row.collectionAmount = NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0)).toFixed(2)) row.receivableAmount && (row.collectionAmount = Math.round(NP.times(row.collectionRate || 0, NP.minus(row.receivableAmount, row.discountTotal||0))))
this.form.receiptAccountList[index] = {...row} this.form.receiptAccountList[index] = {...row}
setTimeout(() => { setTimeout(() => {
...@@ -1020,7 +1029,7 @@ export default { ...@@ -1020,7 +1029,7 @@ export default {
this.currencyList.forEach((item,index)=>{ this.currencyList.forEach((item,index)=>{
var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id) var dollarList = this.form.receiptAccountList.filter(v => v.collectionCurrencyId == item.id)
if(dollarList.length>0){ if(dollarList.length>0){
var dollar = dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0).toFixed(2) var dollar = Math.round(dollarList.reduce((total, currentValue) => NP.plus(total, currentValue.collectionAmount), 0))
amountList.push({currencyId:item.id,currencyNameEn:item.titleEn,currencyNameZh:item.titleZh,amount:dollar}) amountList.push({currencyId:item.id,currencyNameEn:item.titleEn,currencyNameZh:item.titleZh,amount:dollar})
} }
}) })
...@@ -1084,7 +1093,7 @@ export default { ...@@ -1084,7 +1093,7 @@ export default {
{ {
discountTotal: discountDollar, discountTotal: discountDollar,
currencyId: item.id, currencyId: item.id,
receivableAmount: dollar, receivableAmount: Math.round(dollar),
writeOffRate: item.id==this.showCurrencyId?1: NP.times(this.currencyList.find(v => v.id === item.id).huilv/100, this.currencyList.find(v => v.id === this.showCurrencyId).exchangeToFc/100).toFixed(6), writeOffRate: item.id==this.showCurrencyId?1: NP.times(this.currencyList.find(v => v.id === item.id).huilv/100, this.currencyList.find(v => v.id === this.showCurrencyId).exchangeToFc/100).toFixed(6),
platformAccountId: t?.platformAccountId || '', platformAccountId: t?.platformAccountId || '',
collectionCurrencyId: item.id, collectionCurrencyId: item.id,
...@@ -1159,7 +1168,7 @@ export default { ...@@ -1159,7 +1168,7 @@ export default {
const totalt = this.form.receiptAccountList.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0) const totalt = this.form.receiptAccountList.reduce((total, currentValue) => NP.plus(total, currentValue.writeOffAmount || 0), 0)
this.form.receiptAccountList = [...this.form.receiptAccountList, { this.form.receiptAccountList = [...this.form.receiptAccountList, {
type: 'total', type: 'total',
writeOffAmount: totalt.toFixed(2), writeOffAmount: Math.round(totalt),
collectionAmount: [this.form.receiptAccountList.discountNaira, 0, 0] collectionAmount: [this.form.receiptAccountList.discountNaira, 0, 0]
}] }]
...@@ -1203,7 +1212,7 @@ export default { ...@@ -1203,7 +1212,7 @@ export default {
const index = this.form.receiptAccountList.findIndex(v => v.currencyId == type) const index = this.form.receiptAccountList.findIndex(v => v.currencyId == type)
const t = this.form.receiptAccountList[index] const t = this.form.receiptAccountList[index]
if (t) { if (t) {
t.writeOffAmount = NP.times(t.writeOffRate || 0, usCount).toFixed(2) t.writeOffAmount = Math.round(NP.times(t.writeOffRate || 0, usCount))
this.rateChange(t, index) this.rateChange(t, index)
} }
}, },
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<div slot="header" class="card-title">{{ $t('应收明细') }}</div> <div slot="header" class="card-title">{{ $t('应收明细') }}</div>
<el-table :data="list" border> <el-table :data="list" border>
<el-table-column :label="$t('订单号')" align="center" prop="orderNo" /> <el-table-column :label="$t('订单号')" align="center" prop="orderNo" />
<el-table-column :label="$t('自编号')" align="center" prop="selfNo" />
<el-table-column :label="$t('唛头')" align="center" prop="marks" /> <el-table-column :label="$t('唛头')" align="center" prop="marks" />
<el-table-column :label="$t('品名')" align="center" prop="title"> <el-table-column :label="$t('品名')" align="center" prop="title">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -311,6 +312,7 @@ ...@@ -311,6 +312,7 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<!-- <div style="margin: 20px 0;font-size:16px">备注:收款单已全部核销,总金额差值小于5$,允许全部核销,核销比例应为100%</div> -->
<div slot="footer" style="margin: 20px 0"> <div slot="footer" style="margin: 20px 0">
<el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="toEdit" v-hasPermi="['ecw:payment:detail:edit']">{{ $t('编辑') }}</el-button> <el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="toEdit" v-hasPermi="['ecw:payment:detail:edit']">{{ $t('编辑') }}</el-button>
<el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="verificationAll" v-hasPermi="['ecw:payment:detail:allWriteOff']">{{ $t('全部核销') }}</el-button> <el-button v-if="form.state!=7&&form.state!=9&&form.state!=10&&form.state!=11&&form.state != 4&&form.state != 5 && form.state != 6" type="primary" @click="verificationAll" v-hasPermi="['ecw:payment:detail:allWriteOff']">{{ $t('全部核销') }}</el-button>
...@@ -494,7 +496,6 @@ ...@@ -494,7 +496,6 @@
<el-form-item <el-form-item
:label="$t('水单号')" :label="$t('水单号')"
prop="billNo" prop="billNo"
:rules="{ required: true, trigger: ['blur', 'change'], message: $t('水单号不能为空') }"
> >
<el-input v-if="!isView" v-model="addForm.billNo" style="width: 220px"></el-input> <el-input v-if="!isView" v-model="addForm.billNo" style="width: 220px"></el-input>
<span v-else>{{ addForm.billNo }}</span> <span v-else>{{ addForm.billNo }}</span>
...@@ -679,7 +680,7 @@ export default { ...@@ -679,7 +680,7 @@ export default {
} }
// total = NP.plus(total, item.writeOffAmount) // total = NP.plus(total, item.writeOffAmount)
}) })
let portion = NP.divide(total,amountTotal) let portion = NP.divide(total,amountTotal)
console.log(portion); console.log(portion);
if(!portion) return 0 if(!portion) return 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment