给单据增加订金字段和页面功能逻辑
This commit is contained in:
@@ -369,7 +369,7 @@
|
||||
this.$refs.linkBillList.show('入库', '采购', '供应商', "1")
|
||||
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
|
||||
if(selectBillDetailRows && selectBillDetailRows.length>0) {
|
||||
|
||||
@@ -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
|
||||
})
|
||||
})
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<a-form-item v-if="purchaseBySaleFlag" :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联订单" data-step="3" data-title="关联订单"
|
||||
data-intro="采购订单单据可以通过关联订单来选择已录入的销售订单,选择之后会自动加载订单的内容,
|
||||
提交之后原来的销售订单会对应的改变单据状态。另外本系统支持分批多次关联">
|
||||
<a-input-search placeholder="请选择关联订单" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
|
||||
<a-input-search placeholder="请选择关联销售订单" v-decorator="[ 'linkNumber' ]" @search="onSearchLinkNumber" :readOnly="true"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -115,27 +115,61 @@
|
||||
<a-input placeholder="请输入优惠后金额" v-decorator.trim="[ 'discountLastMoney' ]" :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">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户" data-step="9" data-title="结算账户"
|
||||
data-intro="如果在下拉框中选择多账户,则可以通过多个结算账户进行结算">
|
||||
<a-select style="width:185px;" placeholder="选择结算账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
|
||||
:dropdownMatchSelectWidth="false" allowClear @select="selectAccount">
|
||||
<div slot="dropdownRender" slot-scope="menu">
|
||||
<v-nodes :vnodes="menu" />
|
||||
<a-divider style="margin: 4px 0;" />
|
||||
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
|
||||
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
|
||||
</div>
|
||||
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-tooltip title="多账户明细">
|
||||
<a-button type="default" icon="folder" style="margin-left: 8px;" size="small" v-show="manyAccountBtnStatus" @click="handleManyAccount"/>
|
||||
</a-tooltip>
|
||||
</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"/>
|
||||
</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-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件" data-step="8" data-title="附件" data-intro="可以上传与单据相关的图片、文档,支持多个文件">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="附件" data-step="10" data-title="附件" data-intro="可以上传与单据相关的图片、文档,支持多个文件">
|
||||
<j-upload v-model="fileList" bizPath="bill"></j-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
|
||||
<vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
|
||||
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
|
||||
<link-bill-list ref="linkBillList" @ok="linkBillListOk"></link-bill-list>
|
||||
<history-bill-list ref="historyBillListModalForm"></history-bill-list>
|
||||
</j-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import ManyAccountModal from '../dialog/ManyAccountModal'
|
||||
import LinkBillList from '../dialog/LinkBillList'
|
||||
import VendorModal from '../../system/modules/VendorModal'
|
||||
import AccountModal from '../../system/modules/AccountModal'
|
||||
import HistoryBillList from '../dialog/HistoryBillList'
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
@@ -149,8 +183,10 @@
|
||||
name: "PurchaseOrderModal",
|
||||
mixins: [JEditableTableMixin,BillModalMixin],
|
||||
components: {
|
||||
ManyAccountModal,
|
||||
LinkBillList,
|
||||
VendorModal,
|
||||
AccountModal,
|
||||
HistoryBillList,
|
||||
JUpload,
|
||||
JDate,
|
||||
@@ -263,7 +299,7 @@
|
||||
this.fileList = this.model.fileName
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'linkNumber', 'remark',
|
||||
'discount','discountMoney','discountLastMoney'))
|
||||
'discount','discountMoney','discountLastMoney','accountId','changeAmount'))
|
||||
});
|
||||
// 加载子表数据
|
||||
let params = {
|
||||
@@ -280,6 +316,7 @@
|
||||
this.copyAddInit(this.prefixNo)
|
||||
}
|
||||
this.initSupplier()
|
||||
this.initAccount()
|
||||
},
|
||||
/** 整理成formData */
|
||||
classifyIntoFormData(allValues) {
|
||||
@@ -294,6 +331,7 @@
|
||||
totalPrice += item.allPrice-0
|
||||
}
|
||||
billMain.totalPrice = 0-totalPrice
|
||||
billMain.changeAmount = 0-billMain.changeAmount
|
||||
if(this.fileList && this.fileList.length > 0) {
|
||||
billMain.fileName = this.fileList
|
||||
} else {
|
||||
|
||||
@@ -370,7 +370,7 @@
|
||||
this.$refs.linkBillList.show('出库', '零售', '会员', "1")
|
||||
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
|
||||
if(selectBillDetailRows && selectBillDetailRows.length>0) {
|
||||
|
||||
@@ -382,7 +382,7 @@
|
||||
this.$refs.linkBillList.show('出库', '销售', '客户', "1")
|
||||
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
|
||||
if(selectBillDetailRows && selectBillDetailRows.length>0) {
|
||||
|
||||
@@ -115,6 +115,36 @@
|
||||
<a-input placeholder="请输入优惠后金额" v-decorator.trim="[ 'discountLastMoney' ]" :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">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户" data-step="9" data-title="结算账户"
|
||||
data-intro="如果在下拉框中选择多账户,则可以通过多个结算账户进行结算">
|
||||
<a-select style="width:185px;" placeholder="选择结算账户" v-decorator="[ 'accountId', validatorRules.accountId ]"
|
||||
:dropdownMatchSelectWidth="false" allowClear @select="selectAccount">
|
||||
<div slot="dropdownRender" slot-scope="menu">
|
||||
<v-nodes :vnodes="menu" />
|
||||
<a-divider style="margin: 4px 0;" />
|
||||
<div v-if="isTenant" style="padding: 4px 8px; cursor: pointer;"
|
||||
@mousedown="e => e.preventDefault()" @click="addAccount"><a-icon type="plus" /> 新增结算账户</div>
|
||||
</div>
|
||||
<a-select-option v-for="(item,index) in accountList" :key="index" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-tooltip title="多账户明细">
|
||||
<a-button type="default" icon="folder" style="margin-left: 8px;" size="small" v-show="manyAccountBtnStatus" @click="handleManyAccount"/>
|
||||
</a-tooltip>
|
||||
</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"/>
|
||||
</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-row>
|
||||
@@ -127,13 +157,17 @@
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
|
||||
<customer-modal ref="customerModalForm" @ok="customerModalFormOk"></customer-modal>
|
||||
<account-modal ref="accountModalForm" @ok="accountModalFormOk"></account-modal>
|
||||
<history-bill-list ref="historyBillListModalForm"></history-bill-list>
|
||||
</j-modal>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import ManyAccountModal from '../dialog/ManyAccountModal'
|
||||
import CustomerModal from '../../system/modules/CustomerModal'
|
||||
import AccountModal from '../../system/modules/AccountModal'
|
||||
import HistoryBillList from '../dialog/HistoryBillList'
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
@@ -147,7 +181,9 @@
|
||||
name: "SaleOrderModal",
|
||||
mixins: [JEditableTableMixin, BillModalMixin],
|
||||
components: {
|
||||
ManyAccountModal,
|
||||
CustomerModal,
|
||||
AccountModal,
|
||||
HistoryBillList,
|
||||
JUpload,
|
||||
JDate,
|
||||
@@ -246,7 +282,7 @@
|
||||
this.fileList = this.model.fileName
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
|
||||
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','salesMan'))
|
||||
'discount','discountMoney','discountLastMoney','accountId','changeAmount','salesMan'))
|
||||
});
|
||||
// 加载子表数据
|
||||
let params = {
|
||||
@@ -264,6 +300,7 @@
|
||||
}
|
||||
this.initCustomer()
|
||||
this.initSalesman()
|
||||
this.initAccount()
|
||||
},
|
||||
//提交单据时整理成formData
|
||||
classifyIntoFormData(allValues) {
|
||||
|
||||
@@ -156,6 +156,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' ]" />
|
||||
</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"/>
|
||||
@@ -167,12 +172,20 @@
|
||||
<a-input placeholder="请输入本次欠款" v-decorator.trim="[ 'debt' ]" :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="销售人员" data-step="11" data-title="销售人员"
|
||||
data-intro="销售人员的数据来自【经手人管理】菜单中的业务员">
|
||||
<j-select-multiple placeholder="请选择销售人员" v-model="personList.value" :options="personList.options"/>
|
||||
<j-select-multiple style="width:185px;" placeholder="请选择销售人员" v-model="personList.value" :options="personList.options"/>
|
||||
</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-row class="form-row" :gutter="24">
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
@@ -240,6 +253,7 @@
|
||||
visible: false,
|
||||
operTimeStr: '',
|
||||
prefixNo: 'XSCK',
|
||||
depositStatus: false,
|
||||
fileList:[],
|
||||
rowCanEdit: true,
|
||||
model: {},
|
||||
@@ -328,6 +342,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.personList.value = ''
|
||||
this.fileList = []
|
||||
@@ -340,7 +355,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
|
||||
@@ -353,7 +374,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','salesMan'))
|
||||
'discount','discountMoney','discountLastMoney','otherMoney','accountId','deposit','changeAmount','debt','salesMan'))
|
||||
});
|
||||
// 加载子表数据
|
||||
let params = {
|
||||
@@ -415,7 +436,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)
|
||||
@@ -442,6 +463,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,
|
||||
@@ -449,7 +475,8 @@
|
||||
'discount': discount,
|
||||
'discountMoney': discountMoney,
|
||||
'discountLastMoney': discountLastMoney,
|
||||
'changeAmount': discountLastMoney,
|
||||
'deposit': deposit,
|
||||
'changeAmount': changeAmount,
|
||||
'remark': remark
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user