优化收款单

This commit is contained in:
季圣华
2021-06-30 00:54:07 +08:00
parent 4e66aeb98b
commit 344f35b60e
6 changed files with 587 additions and 457 deletions

View File

@@ -49,7 +49,7 @@
<a-col :lg="6" :md="12" :sm="24">
<!-- 操作按钮 -->
<div class="action-button">
<a-button type="primary" icon="plus" @click="handleClickAdd">批量新增</a-button>
<a-button type="primary" icon="plus" @click="handleClickAdd">新增</a-button>
<span class="gap"></span>
<a-button type="primary" icon="minus" @click="handleClear">清空</a-button>
</div>
@@ -76,6 +76,15 @@
</a-col>
</a-row>
<a-row class="form-row" :gutter="24">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款账户">
<a-select placeholder="选择收款账户" v-decorator="[ 'accountId', validatorRules.accountId ]" :dropdownMatchSelectWidth="false">
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</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' ]" />
@@ -85,7 +94,12 @@
</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">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="文件上传">
<j-upload v-model="fileList" bizPath="financial"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
@@ -100,6 +114,8 @@
import { FormTypes } from '@/utils/JEditableTableUtil'
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
import JUpload from '@/components/jeecg/JUpload'
import JEllipsis from '@/components/jeecg/JEllipsis'
import JDate from '@/components/jeecg/JDate'
import Vue from 'vue'
export default {
@@ -107,6 +123,8 @@
mixins: [JEditableTableMixin, FinancialModalMixin],
components: {
DebtBillList,
JUpload,
JEllipsis,
JDate
},
data () {
@@ -118,6 +136,7 @@
addDefaultRowNum: 0,
visible: false,
model: {},
fileList:[],
labelCol: {
xs: { span: 24 },
sm: { span: 8 },
@@ -133,10 +152,12 @@
dataSource: [],
columns: [
{ title: '销售单据编号',key: 'billNumber',width: '20%', type: FormTypes.input, readonly: true },
{ title: '金额',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
{ title: '应收欠款',key: 'needDebt', width: '10%', type: FormTypes.inputNumber, statistics: true, readonly: true },
{ title: '已收欠款', key: 'finishDebt', width: '10%', type: FormTypes.inputNumber, statistics: true, readonly: true },
{ title: '本次收款',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请选择${title}',
validateRules: [{ required: true, message: '${title}不能为空' }]
},
{ title: '备注',key: 'remark', width: '30%', type: FormTypes.input, placeholder: '请选择${title}'}
{ title: '备注',key: 'remark', width: '20%', type: FormTypes.input, placeholder: '请选择${title}'}
]
},
confirmLoading: false,
@@ -150,6 +171,11 @@
rules: [
{ required: true, message: '请选择经手人!' }
]
},
accountId:{
rules: [
{ required: true, message: '请选择收款账户!' }
]
}
},
url: {
@@ -160,7 +186,7 @@
}
},
created () {
this.initDetailAccount()
this.initAccount()
},
methods: {
//调用完edit()方法之后会自动调用此方法
@@ -170,8 +196,10 @@
} else {
this.model.billTime = this.model.billTimeStr
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark', 'changeAmount'))
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
'accountId','changeAmount'))
});
this.fileList = this.model.fileName
// 加载子表数据
let params = {
headerId: this.model.id
@@ -190,6 +218,9 @@
totalPrice += item.eachAmount-0
}
billMain.totalPrice = totalPrice
if(this.fileList && this.fileList.length > 0) {
billMain.fileName = this.fileList
}
if(this.model.id){
billMain.id = this.model.id
}
@@ -199,8 +230,13 @@
}
},
handleClickAdd() {
this.$refs.debtBillList.show('出库', '销售', '客户', "0")
this.$refs.debtBillList.title = "选择销售出库"
let organId = this.form.getFieldValue('organId')
if(organId){
this.$refs.debtBillList.show(organId, '出库', '销售', '客户', "0")
this.$refs.debtBillList.title = "选择销售出库欠款单据"
} else {
this.$message.warning('请选择客户!');
}
},
handleClear() {
this.accountTable.dataSource = []
@@ -217,8 +253,11 @@
for(let i=0; i<selectBillRows.length; i++){
let info = selectBillRows[i]
info.billNumber = info.number
info.eachAmount = info.totalPrice
listEx.push(info)
info.needDebt = (info.discountLastMoney - info.changeAmount).toFixed(2)
info.eachAmount = (info.discountLastMoney - info.changeAmount - info.finishDebt).toFixed(2);
if(info.eachAmount != 0) {
listEx.push(info)
}
}
tab.dataSource = listEx
typeof success === 'function' ? success(res) : ''