给零售增加找零字段

This commit is contained in:
季圣华
2021-12-12 23:19:03 +08:00
parent 19ba6d50fa
commit c2c9a465b6
5 changed files with 45 additions and 15 deletions

View File

@@ -191,7 +191,16 @@
{ title: '单据日期', dataIndex: 'operTimeStr',width:145}, { title: '单据日期', dataIndex: 'operTimeStr',width:145},
{ title: '操作员', dataIndex: 'userName',width:80}, { title: '操作员', dataIndex: 'userName',width:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80}, { title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '付款', dataIndex: 'changeAmount',width:50}, { title: '付款金额', dataIndex: 'getAmount',width:80,
customRender:function (text,record,index) {
if(record.backAmount) {
return record.changeAmount + record.backAmount
} else {
return record.changeAmount
}
}
},
{ title: '找零', dataIndex: 'backAmount',width:50},
{ title: '状态', dataIndex: 'status', width: 80, align: "center", { title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' } scopedSlots: { customRender: 'customRenderStatus' }
}, },

View File

@@ -185,7 +185,16 @@
{ title: '单据日期', dataIndex: 'operTimeStr',width:145}, { title: '单据日期', dataIndex: 'operTimeStr',width:145},
{ title: '操作员', dataIndex: 'userName',width:80}, { title: '操作员', dataIndex: 'userName',width:80},
{ title: '金额合计', dataIndex: 'totalPrice',width:80}, { title: '金额合计', dataIndex: 'totalPrice',width:80},
{ title: '收款', dataIndex: 'changeAmount',width:50}, { title: '收款金额', dataIndex: 'getAmount',width:80,
customRender:function (text,record,index) {
if(record.backAmount) {
return record.changeAmount + record.backAmount
} else {
return record.changeAmount
}
}
},
{ title: '找零', dataIndex: 'backAmount',width:50},
{ title: '状态', dataIndex: 'status', width: 80, align: "center", { title: '状态', dataIndex: 'status', width: 80, align: "center",
scopedSlots: { customRender: 'customRenderStatus' } scopedSlots: { customRender: 'customRenderStatus' }
}, },

View File

@@ -72,18 +72,18 @@
<a-col :span="6"> <a-col :span="6">
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实收金额"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据金额">
{{model.changeAmount}} {{model.changeAmount}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款金额"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款金额">
{{model.changeAmount}} {{model.getAmount}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
0 {{model.backAmount}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
@@ -146,18 +146,18 @@
<a-col :span="6"> <a-col :span="6">
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实付金额"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据金额">
{{model.changeAmount}} {{model.changeAmount}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款金额"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款金额">
{{model.changeAmount}} {{model.getAmount}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
0 {{model.backAmount}}
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
@@ -1260,6 +1260,11 @@
this.fileList = record.fileName this.fileList = record.fileName
this.visible = true; this.visible = true;
this.model = Object.assign({}, record); this.model = Object.assign({}, record);
if(this.model.backAmount) {
this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
} else {
this.model.getAmount = this.model.changeAmount
}
this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2) this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - this.model.changeAmount).toFixed(2)
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'id')) this.form.setFieldsValue(pick(this.model,'id'))

View File

@@ -93,7 +93,7 @@
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="6" :sm="6"><br/><br/></a-col> <a-col :lg="24" :md="6" :sm="6"><br/><br/></a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实付金额"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据金额">
<a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/> <a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -267,8 +267,11 @@
this.fileList = [] this.fileList = []
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr
this.model.getAmount = this.model.changeAmount if(this.model.backAmount) {
this.model.backAmount = 0 this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
} else {
this.model.getAmount = this.model.changeAmount
}
this.fileList = this.model.fileName this.fileList = this.model.fileName
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark', this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark',

View File

@@ -103,8 +103,8 @@
<a-row class="form-row" :gutter="24"> <a-row class="form-row" :gutter="24">
<a-col :lg="24" :md="6" :sm="6"><br/><br/></a-col> <a-col :lg="24" :md="6" :sm="6"><br/><br/></a-col>
<a-col :lg="24" :md="6" :sm="6"> <a-col :lg="24" :md="6" :sm="6">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="实收金额" data-step="5" data-title="实收金额" <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据金额" data-step="5" data-title="单据金额"
data-intro="实收金额等于左侧商品的总金额"> data-intro="单据金额等于左侧商品的总金额">
<a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/> <a-input v-decorator.trim="[ 'changeAmount' ]" :style="{color:'purple'}" :readOnly="true"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -285,7 +285,11 @@
}) })
} else { } else {
this.model.operTime = this.model.operTimeStr this.model.operTime = this.model.operTimeStr
this.model.getAmount = this.model.changeAmount if(this.model.backAmount) {
this.model.getAmount = (this.model.changeAmount + this.model.backAmount).toFixed(2)
} else {
this.model.getAmount = this.model.changeAmount
}
this.fileList = this.model.fileName this.fileList = this.model.fileName
if(this.model.payType === '预付款'){ if(this.model.payType === '预付款'){
this.payTypeList = [] this.payTypeList = []
@@ -294,7 +298,7 @@
} }
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'payType', 'remark', this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'payType', 'remark',
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','getAmount')) 'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','getAmount','backAmount'))
}); });
// 加载子表数据 // 加载子表数据
let params = { let params = {