给单据增加订金字段和页面功能逻辑

This commit is contained in:
季圣华
2022-05-29 18:19:16 +08:00
parent 3939106bee
commit 5e536d7bbd
17 changed files with 237 additions and 34 deletions

View File

@@ -155,6 +155,11 @@
</a-tooltip>
</a-form-item>
</a-col>
<a-col v-if="depositStatus" :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="扣除订金">
<a-input v-decorator.trim="[ 'deposit' ]" @keyup="onKeyUpDeposit"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次付款">
<a-input placeholder="请输入本次付款" v-decorator.trim="[ 'changeAmount' ]" @keyup="onKeyUpChangeAmount"/>
@@ -166,8 +171,6 @@
<a-input placeholder="请输入本次欠款" v-decorator.trim="[ 'debt' ]" :readOnly="true"/>
</a-form-item>
</a-col>
<a-col :lg="6" :md="12" :sm="24">
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
@@ -234,6 +237,7 @@
visible: false,
operTimeStr: '',
prefixNo: 'CGRK',
depositStatus: false,
fileList:[],
rowCanEdit: true,
model: {},
@@ -324,6 +328,7 @@
this.changeFormTypes(this.materialTable.columns, 'preNumber', 0)
this.changeFormTypes(this.materialTable.columns, 'finishNumber', 0)
if (this.action === 'add') {
this.depositStatus = false
this.addInit(this.prefixNo)
this.fileList = []
this.$nextTick(() => {
@@ -335,7 +340,13 @@
this.materialTable.columns[1].type = FormTypes.normal
}
this.model.operTime = this.model.operTimeStr
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
if(this.model.deposit) {
this.depositStatus = true
} else {
this.depositStatus = false
this.model.deposit = 0
}
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.deposit - this.model.changeAmount).toFixed(2)
if(this.model.accountId == null) {
this.model.accountId = 0
this.manyAccountBtnStatus = true
@@ -347,7 +358,7 @@
this.fileList = this.model.fileName
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
'discount','discountMoney','discountLastMoney','otherMoney','accountId','deposit','changeAmount','debt'))
});
// 加载子表数据
let params = {
@@ -409,7 +420,7 @@
this.$refs.linkBillList.show('其它', '采购订单', '供应商', "1,3")
this.$refs.linkBillList.title = "选择采购订单"
},
linkBillListOk(selectBillDetailRows, linkNumber, organId, discount, remark) {
linkBillListOk(selectBillDetailRows, linkNumber, organId, discount, deposit, remark) {
this.rowCanEdit = false
this.materialTable.columns[1].type = FormTypes.normal
this.changeFormTypes(this.materialTable.columns, 'preNumber', 1)
@@ -436,6 +447,11 @@
if(allTaxLastMoney) {
let discountMoney = (discount*allTaxLastMoney/100).toFixed(2)-0
let discountLastMoney = (allTaxLastMoney - discountMoney).toFixed(2)-0
let changeAmount = discountLastMoney
if(deposit) {
this.depositStatus = true
changeAmount = (discountLastMoney - deposit).toFixed(2)-0
}
this.$nextTick(() => {
this.form.setFieldsValue({
'organId': organId,
@@ -443,7 +459,8 @@
'discount': discount,
'discountMoney': discountMoney,
'discountLastMoney': discountLastMoney,
'changeAmount': discountLastMoney,
'deposit': deposit,
'changeAmount': changeAmount,
'remark': remark
})
})