Commit 456565a2 authored by 我在何方's avatar 我在何方

收款单开票bug修复

parent 64a5dc81
......@@ -30,12 +30,12 @@
<el-descriptions-item :label="$t('开户行')">{{ invoiceData.accountBank }}</el-descriptions-item>
<el-descriptions-item :label="$t('税率%')">
<el-form-item label="">
<el-input v-model="invoiceData.taxRate"></el-input>
<el-input v-model="invoiceData.taxRate"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item :label="$t('项目')">
<el-form-item label="">
<el-input v-model="invoiceData.projectName"></el-input>
<el-input v-model="invoiceData.projectName"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
......@@ -56,7 +56,11 @@
</template>
</el-table-column>
<el-table-column :label="$t('箱数')" align="center" prop="num" />
<el-table-column :label="$t('体积/重量')" align="center" prop="weight"></el-table-column>
<el-table-column :label="$t('体积/重量')" align="center" prop="weight">
<template slot-scope="scope">
{{ scope.row.volume?(scope.row.volume + '/'+scope.row.weight):'' }}
</template>
</el-table-column>
<el-table-column :label="$t('收入类型')" align="center" prop="feeType">
<template slot-scope="scope">
<dict-tag
......@@ -76,6 +80,16 @@
<span>{{ scope.row.totalAmount }}{{getCurrencyLabel(scope.row.currencyId)}}</span>
<!-- <dict-tag :type="DICT_TYPE.BOX_SHIPPING_PRICE_UNIT" :value="scope.row.currencyId" /> -->
</template>
</el-table-column>
<el-table-column :label="$t('优惠金额')" align="center">
<template slot-scope="scope">
{{ scope.row.discountTotal ?scope.row.discountTotal : '' }}
</template>
</el-table-column>
<el-table-column :label="$t('优惠后金额')" align="center">
<template slot-scope="scope">
{{ scope.row.disCountAmount ?scope.row.disCountAmount :0 }}
</template>
</el-table-column>
<el-table-column :label="$t('税额')" align="center" prop="tax">
<template slot-scope="scope">
......@@ -157,14 +171,22 @@ export default {
res.data.map(v => {
v.tax = NP.times(v.totalAmount, this.invoiceData.taxRate/100)
v.taxAndTotalAmount = NP.plus(v.totalAmount, NP.times(v.totalAmount, this.invoiceData.taxRate/100))
if(v.discountTotal){
v.disCountAmount = NP.minus(v.totalAmount,v.discountTotal)
}else{
v.disCountAmount = v.totalAmount
}
})
const t = {
orderNo: this.$t('合计'),
totalAmount: res.data.reduce((total, curr) => NP.plus(total, curr.totalAmount), 0),
disCountAmount:res.data.reduce((total, curr) => NP.plus(total, curr.disCountAmount), 0),
tax: res.data.reduce((total, curr) => NP.plus(total, curr.tax), 0),
taxAndTotalAmount: res.data.reduce((total, curr) => NP.plus(total, curr.taxAndTotalAmount), 0)
}
this.list = [...res.data, t]
console.log(this.list)
})
},
submitForm() {
......@@ -180,7 +202,7 @@ export default {
},
getSummaries(param) {
const t = this.list[this.list.length - 1].taxAndTotalAmount
return [this.$t('收款人'), this.invoiceData.payeeName, this.$t('核销人'), this.invoiceData.writeOffName, this.$t('开票人'), this.invoiceData.issuerName, '', this.$t('价税合计大写'), this.convertCurrency(t)];
return [this.$t('收款人'), this.invoiceData.salesmanName, this.$t('核销人'), this.invoiceData.writeOffName, this.$t('开票人'), this.invoiceData.issuerName, '', this.$t('价税合计大写'), this.convertCurrency(t)];
},
convertCurrency(money) {
//汉字的数字
......@@ -205,7 +227,7 @@ export default {
var chineseStr = '';
//分离金额后用的数组,预定义
var parts;
// 传入的参数为空情况
// 传入的参数为空情况
if(money === '') {
return '';
}
......@@ -213,7 +235,7 @@ export default {
if(money >= maxNum){
return ''
}
// 传入的参数为0情况
// 传入的参数为0情况
if (money === 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger;
return chineseStr
......@@ -248,7 +270,7 @@ export default {
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m];
}
if(m == 0 && zeroCount < 4){
chineseStr += cnIntUnits[q];
chineseStr += cnIntUnits[q];
}
}
// 最后+ 元
......
......@@ -508,7 +508,9 @@ export default {
writeOffAmount(){
let total = 0
this.detailed.forEach(item => {
total = NP.plus(total, item.writeOffAmount)
if(item.status){
total = NP.plus(total, item.writeOffAmount)
}
})
return total.toFixed(2)
},
......
......@@ -52,9 +52,10 @@
<el-col style="width: 592px">
<el-form-item :label="$t('创建时间')">
<el-date-picker
v-model="queryParams.beginCreateTime"
v-model="dateFilter"
type="datetimerange"
range-separator="-"
value-format="yyyy-MM-dd HH:mm:ss"
:start-placeholder="$t('请选择日期')"
:end-placeholder="$t('请选择日期')"
>
......@@ -301,6 +302,7 @@ export default {
productRecord: null,
followUpSalesmanId: null,
},
dateFilter:[],
downloading: false, // 导出状态
};
},
......@@ -368,7 +370,14 @@ export default {
},
/** 搜索按钮操作 */
handleQuery() {
console.log(11)
if(this.dateFilter&&this.dateFilter.length>0){
this.queryParams.beginCreateTime = this.dateFilter[0]
this.queryParams.endCreateTime = this.dateFilter[1]
}else{
this.queryParams.beginCreateTime = ''
this.queryParams.endCreateTime = ''
}
this.queryParams.pageNo = 1;
this.getList();
},
......
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