优化财务单据
This commit is contained in:
@@ -52,7 +52,8 @@
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="true"
|
||||
:actionButton="true" />
|
||||
:actionButton="true"
|
||||
@valueChange="onValueChange" />
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="24" :md="24" :sm="24">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
|
||||
@@ -62,13 +63,19 @@
|
||||
</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-input placeholder="请输入优惠金额" v-decorator.trim="[ 'changeAmount' ]" />
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="合计金额">
|
||||
<a-input placeholder="请输入合计收款" v-decorator.trim="[ 'totalPrice' ]" :readOnly="true"/>
|
||||
</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="[ 'discountMoney' ]" @keyup="onKeyUpDiscountMoney" />
|
||||
</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' ]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
</a-col>
|
||||
@@ -152,7 +159,8 @@
|
||||
} 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',
|
||||
'totalPrice', 'discountMoney', 'changeAmount'))
|
||||
});
|
||||
// 加载子表数据
|
||||
let params = {
|
||||
|
||||
@@ -188,6 +188,13 @@
|
||||
info: JSON.stringify(billMain),
|
||||
rows: JSON.stringify(detailArr),
|
||||
}
|
||||
},
|
||||
//改变本次欠款的值
|
||||
autoChangeAmount(target) {
|
||||
let allEachAmount = target.statisticsColumns.eachAmount-0
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'changeAmount':allEachAmount})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,6 +199,13 @@
|
||||
info: JSON.stringify(billMain),
|
||||
rows: JSON.stringify(detailArr),
|
||||
}
|
||||
},
|
||||
//改变本次欠款的值
|
||||
autoChangeAmount(target) {
|
||||
let allEachAmount = target.statisticsColumns.eachAmount-0
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'changeAmount':allEachAmount})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,6 +200,13 @@
|
||||
info: JSON.stringify(billMain),
|
||||
rows: JSON.stringify(detailArr),
|
||||
}
|
||||
},
|
||||
//改变本次欠款的值
|
||||
autoChangeAmount(target) {
|
||||
let allEachAmount = target.statisticsColumns.eachAmount-0
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'changeAmount':allEachAmount})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="false"
|
||||
:actionButton="false" />
|
||||
:actionButton="false"
|
||||
@valueChange="onValueChange" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
@@ -86,18 +87,24 @@
|
||||
</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' ]" />
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="合计收款">
|
||||
<a-input placeholder="请输入合计收款" v-decorator.trim="[ 'totalPrice' ]" :readOnly="true"/>
|
||||
</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="[ 'discountMoney', validatorRules.discountMoney ]" @keyup="onKeyUpDiscountMoney" />
|
||||
</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' ]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
</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-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件">
|
||||
<j-upload v-model="fileList" bizPath="financial"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -115,16 +122,13 @@
|
||||
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 {
|
||||
name: "MoneyInModal",
|
||||
mixins: [JEditableTableMixin, FinancialModalMixin],
|
||||
components: {
|
||||
DebtBillList,
|
||||
JUpload,
|
||||
JEllipsis,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
@@ -154,28 +158,25 @@
|
||||
{ title: '销售单据编号',key: 'billNumber',width: '20%', type: FormTypes.input, readonly: true },
|
||||
{ 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}',
|
||||
{ title: '本次收款',key: 'eachAmount', width: '10%', type: FormTypes.inputNumber, statistics: true, placeholder: '请输入${title}',
|
||||
validateRules: [{ required: true, message: '${title}不能为空' }]
|
||||
},
|
||||
{ title: '备注',key: 'remark', width: '20%', type: FormTypes.input, placeholder: '请选择${title}'}
|
||||
{ title: '备注',key: 'remark', width: '20%', type: FormTypes.input, placeholder: '请输入${title}'}
|
||||
]
|
||||
},
|
||||
confirmLoading: false,
|
||||
validatorRules:{
|
||||
organId:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择客户!' }
|
||||
]
|
||||
rules: [{ required: true, message: '请选择客户!' }]
|
||||
},
|
||||
handsPersonId:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择经手人!' }
|
||||
]
|
||||
rules: [{ required: true, message: '请选择经手人!' }]
|
||||
},
|
||||
accountId:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择收款账户!' }
|
||||
]
|
||||
rules: [{ required: true, message: '请选择收款账户!' }]
|
||||
},
|
||||
discountMoney:{
|
||||
rules: [{ required: true, message: '请输入优惠金额!' }]
|
||||
}
|
||||
},
|
||||
url: {
|
||||
@@ -198,7 +199,7 @@
|
||||
this.model.billTime = this.model.billTimeStr
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'organId', 'handsPersonId', 'billTime', 'billNo', 'remark',
|
||||
'accountId','changeAmount'))
|
||||
'accountId', 'totalPrice', 'discountMoney', 'changeAmount'))
|
||||
});
|
||||
this.fileList = this.model.fileName
|
||||
// 加载子表数据
|
||||
@@ -241,28 +242,6 @@
|
||||
},
|
||||
handleClear() {
|
||||
this.accountTable.dataSource = []
|
||||
},
|
||||
debtBillListOk(selectBillRows) {
|
||||
if(selectBillRows && selectBillRows.length>0) {
|
||||
this.requestSubTableDataEx(selectBillRows, this.accountTable);
|
||||
}
|
||||
},
|
||||
/** 查询某个tab的数据,给明细里面的价税合计赋值 */
|
||||
requestSubTableDataEx(selectBillRows, tab, success) {
|
||||
tab.loading = true
|
||||
let listEx = []
|
||||
for(let i=0; i<selectBillRows.length; i++){
|
||||
let info = selectBillRows[i]
|
||||
info.billNumber = info.number
|
||||
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) : ''
|
||||
tab.loading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,92 +1,134 @@
|
||||
<template>
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
:maskClosable="false"
|
||||
:keyboard="false"
|
||||
:forceRender="true"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 100%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<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="[ 'organId', validatorRules.organId ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
|
||||
{{ item.supplier }}
|
||||
</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-select placeholder="选择经手人" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select-option v-for="(item,index) in personList" :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="单据日期">
|
||||
<j-date v-decorator="['billTime']" :show-time="true"/>
|
||||
</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="[ 'billNo' ]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<j-editable-table
|
||||
:ref="refKeys[0]"
|
||||
:loading="accountTable.loading"
|
||||
:columns="accountTable.columns"
|
||||
:dataSource="accountTable.dataSource"
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="true"
|
||||
:actionButton="true" />
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="24" :md="24" :sm="24">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" style="margin-top:8px;"/>
|
||||
</a-form-item>
|
||||
</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-input placeholder="请输入优惠金额" v-decorator.trim="[ 'changeAmount' ]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
<a-card :bordered="false">
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
:visible="visible"
|
||||
:confirmLoading="confirmLoading"
|
||||
:maskClosable="false"
|
||||
:keyboard="false"
|
||||
:forceRender="true"
|
||||
switchFullscreen
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
wrapClassName="ant-modal-cust-warp"
|
||||
style="top:5%;height: 100%;overflow-y: hidden">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form :form="form">
|
||||
<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="[ 'organId', validatorRules.organId ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
|
||||
{{ item.supplier }}
|
||||
</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-select placeholder="选择经手人" v-decorator="[ 'handsPersonId', validatorRules.handsPersonId ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select-option v-for="(item,index) in personList" :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="单据日期">
|
||||
<j-date v-decorator="['billTime']" :show-time="true"/>
|
||||
</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="[ 'billNo' ]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
<!-- 操作按钮 -->
|
||||
<div class="action-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>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :span="24">
|
||||
<j-editable-table
|
||||
:ref="refKeys[0]"
|
||||
:loading="accountTable.loading"
|
||||
:columns="accountTable.columns"
|
||||
:dataSource="accountTable.dataSource"
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="false"
|
||||
:actionButton="false"
|
||||
@valueChange="onValueChange" />
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="24" :md="24" :sm="24">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="{xs: { span: 24 },sm: { span: 24 }}" label="">
|
||||
<a-textarea :rows="2" placeholder="请输入备注" v-decorator="[ 'remark' ]" style="margin-top:8px;"/>
|
||||
</a-form-item>
|
||||
</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="[ 'totalPrice' ]" :readOnly="true"/>
|
||||
</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="[ 'discountMoney', validatorRules.discountMoney ]" @keyup="onKeyUpDiscountMoney" />
|
||||
</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' ]" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
</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>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
<debt-bill-list ref="debtBillList" @ok="debtBillListOk"></debt-bill-list>
|
||||
</a-card>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import DebtBillList from '../dialog/DebtBillList'
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { FinancialModalMixin } from '../mixins/FinancialModalMixin'
|
||||
import JUpload from '@/components/jeecg/JUpload'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
export default {
|
||||
name: "MoneyInModal",
|
||||
mixins: [JEditableTableMixin, FinancialModalMixin],
|
||||
components: {
|
||||
DebtBillList,
|
||||
JUpload,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
@@ -95,9 +137,10 @@
|
||||
width: '1200px',
|
||||
moreStatus: false,
|
||||
// 新增时子表默认添加几行空数据
|
||||
addDefaultRowNum: 1,
|
||||
addDefaultRowNum: 0,
|
||||
visible: false,
|
||||
model: {},
|
||||
fileList:[],
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 8 },
|
||||
@@ -112,26 +155,31 @@
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
columns: [
|
||||
{ title: '账户名称',key: 'accountId',width: '20%', type: FormTypes.select, placeholder: '请选择${title}', options: [],
|
||||
{ title: '销售单据编号',key: 'billNumber',width: '20%', type: FormTypes.input, readonly: true },
|
||||
{ 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: '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,
|
||||
validatorRules:{
|
||||
organId:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择供应商!' }
|
||||
]
|
||||
rules: [{ required: true, message: '请选择供应商!' }]
|
||||
},
|
||||
handsPersonId:{
|
||||
rules: [
|
||||
{ required: true, message: '请选择经手人!' }
|
||||
]
|
||||
rules: [{ required: true, message: '请选择经手人!' }]
|
||||
},
|
||||
accountId:{
|
||||
rules: [{ required: true, message: '请选择付款账户!' }]
|
||||
},
|
||||
discountMoney:{
|
||||
rules: [{ required: true, message: '请输入优惠金额!' }]
|
||||
},
|
||||
changeAmount:{
|
||||
rules: [{ required: true, message: '请输入收款金额!' }]
|
||||
}
|
||||
},
|
||||
url: {
|
||||
@@ -142,18 +190,21 @@
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.initDetailAccount()
|
||||
this.initAccount()
|
||||
},
|
||||
methods: {
|
||||
//调用完edit()方法之后会自动调用此方法
|
||||
editAfter() {
|
||||
if (this.action === 'add') {
|
||||
this.addInit("FK")
|
||||
this.fileList = []
|
||||
} 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', 'totalPrice', 'discountMoney', 'changeAmount'))
|
||||
});
|
||||
this.fileList = this.model.fileName
|
||||
// 加载子表数据
|
||||
let params = {
|
||||
headerId: this.model.id
|
||||
@@ -172,6 +223,9 @@
|
||||
totalPrice += item.eachAmount-0
|
||||
}
|
||||
billMain.totalPrice = 0-totalPrice
|
||||
if(this.fileList && this.fileList.length > 0) {
|
||||
billMain.fileName = this.fileList
|
||||
}
|
||||
if(this.model.id){
|
||||
billMain.id = this.model.id
|
||||
}
|
||||
@@ -179,10 +233,27 @@
|
||||
info: JSON.stringify(billMain),
|
||||
rows: JSON.stringify(detailArr),
|
||||
}
|
||||
},
|
||||
handleClickAdd() {
|
||||
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 = []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.action-button {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.gap {
|
||||
padding-left: 8px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user