Commit dfa9ad23 authored by 我在何方's avatar 我在何方

新建收款单税率可输小数

parent ae8588d0
...@@ -375,7 +375,7 @@ ...@@ -375,7 +375,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span> <span v-if="scope.row.type !== 'total'">{{ scope.row.collectionAmount }}</span>
<div v-else> <div v-else>
<div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount.amount}}</div> <div v-for="itemAmount in scope.row.collectionAmount">{{$i18n.locale=='zh_CN'?(itemAmount?itemAmount.currencyNameZh:''):(itemAmount?itemAmount.currencyNameEn:'')}}: {{ itemAmount.amount||''}}</div>
<!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div> <!-- <div v-if="scope.row.collectionAmount[1]">{{ $t('人民币') }}: {{ scope.row.collectionAmount[1].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div> <div v-if="scope.row.collectionAmount[2]">{{ $t('奈拉') }}: {{ scope.row.collectionAmount[2].toFixed(6) }}</div>
<div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> --> <div v-if="scope.row.collectionAmount[3]">{{ $t('西非法郎') }}: {{ scope.row.collectionAmount[3].toFixed(6) }}</div> -->
...@@ -961,10 +961,17 @@ export default { ...@@ -961,10 +961,17 @@ export default {
}, },
//明细改变税率 //明细改变税率
changeTaxRate(row,index){ changeTaxRate(row,index){
var regs=/^\d+$/; var pointArr = []
var regs=/^[1-9]+\d*(\.\d*)?$|^0?\.\d*[1-9]\d*$/;
if(row.taxPoint&&!regs.test(row.taxPoint)){ if(row.taxPoint&&!regs.test(row.taxPoint)){
row.taxPoint = 0 row.taxPoint = ''
this.$modal.msgError(this.$t('输入税率格式不对')); this.$modal.msgError(this.$t('输入税率格式不对'));
}else{
pointArr = row.taxPoint.split('.')
if(pointArr.length>1&&pointArr[1]){
row.taxPoint =Math.round(row.taxPoint*100)/100
}
} }
if(row.taxPoint){ if(row.taxPoint){
var amout = NP.times(NP.divide(row.taxPoint,100), row.totalAmount) var amout = NP.times(NP.divide(row.taxPoint,100), row.totalAmount)
...@@ -976,7 +983,12 @@ export default { ...@@ -976,7 +983,12 @@ export default {
this.list[index] = {...row} this.list[index] = {...row}
let dataArrTemp = JSON.stringify(this.list); let dataArrTemp = JSON.stringify(this.list);
this.list= JSON.parse(dataArrTemp); this.list= JSON.parse(dataArrTemp);
if(pointArr.length>1&&!pointArr[1]){
return
}else{
this.calculation() this.calculation()
}
}, },
calculation() { calculation() {
const copyList = this.form.receiptAccountList const copyList = this.form.receiptAccountList
...@@ -1211,6 +1223,7 @@ export default { ...@@ -1211,6 +1223,7 @@ export default {
// }else{ // }else{
var discount = this.list[this.selectListIndex] var discount = this.list[this.selectListIndex]
discount['discountTotal'] = this.discountForm.discountTotal discount['discountTotal'] = this.discountForm.discountTotal
discount['discountRemark'] = this.discountForm.discountRemark
setTimeout(()=>{ setTimeout(()=>{
// getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => { // getReceivableInfoByIds({ id: this.selectListRow.id }).then(res => {
this.$set(this.list, this.selectListIndex, {...discount}) this.$set(this.list, this.selectListIndex, {...discount})
......
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