多账户优化
This commit is contained in:
@@ -431,12 +431,12 @@
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="6" :sm="6">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款金额">
|
||||
{{model.getAmount}}
|
||||
{{model.changeAmount}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="6" :sm="6">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
|
||||
{{model.backAmount}}
|
||||
0
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="6" :sm="6">
|
||||
@@ -501,12 +501,12 @@
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="6" :sm="6">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款金额">
|
||||
{{model.getAmount}}
|
||||
{{model.changeAmount}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="6" :sm="6">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
|
||||
{{model.backAmount}}
|
||||
0
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="24" :md="6" :sm="6">
|
||||
|
||||
@@ -71,7 +71,7 @@ export const BillModalMixin = {
|
||||
})
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'payType': '现金'})
|
||||
this.form.setFieldsValue({'payType': '现付'})
|
||||
})
|
||||
this.accountIdList = []
|
||||
this.accountMoneyList = []
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<a-card :bordered="false" class="card-area">
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
@@ -57,7 +58,7 @@
|
||||
<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="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
|
||||
<a-input style="width:185px;" placeholder="请输入优惠率" v-decorator.trim="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
@@ -79,11 +80,15 @@
|
||||
<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' ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select style="width:185px;" placeholder="选择结算账户" v-decorator="[ 'accountId' ]"
|
||||
:dropdownMatchSelectWidth="false" allowClear @select="selectAccount">
|
||||
<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">
|
||||
@@ -102,19 +107,23 @@
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import ManyAccountModal from '../dialog/ManyAccountModal'
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { BillModalMixin } from '../mixins/BillModalMixin'
|
||||
import { getMpListShort } from "@/utils/util"
|
||||
import { getMpListShort, changeListFmtMinus} from "@/utils/util"
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import Vue from 'vue'
|
||||
export default {
|
||||
name: "PurchaseBackModal",
|
||||
mixins: [JEditableTableMixin, BillModalMixin],
|
||||
components: {
|
||||
ManyAccountModal,
|
||||
JDate
|
||||
},
|
||||
data () {
|
||||
@@ -230,6 +239,13 @@
|
||||
rows: JSON.stringify(detailArr),
|
||||
}
|
||||
},
|
||||
manyAccountModalFormOk(idList, moneyList, allPrice) {
|
||||
this.accountIdList = idList
|
||||
this.accountMoneyList = changeListFmtMinus(moneyList)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'changeAmount':allPrice})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
for(let item of detailArr){
|
||||
totalPrice += item.allPrice-0
|
||||
}
|
||||
billMain.totalPrice = totalPrice
|
||||
billMain.totalPrice = 0-totalPrice
|
||||
if(this.model.id){
|
||||
billMain.id = this.model.id
|
||||
}
|
||||
|
||||
@@ -172,10 +172,11 @@
|
||||
this.addInit("LSTH")
|
||||
} else {
|
||||
this.model.operTime = this.model.operTimeStr
|
||||
this.model.debt = this.model.discountLastMoney - this.model.changeAmount
|
||||
this.model.getAmount = this.model.changeAmount
|
||||
this.model.backAmount = 0
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(pick(this.model,'organId', 'operTime', 'number', 'remark',
|
||||
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','debt'))
|
||||
'discount','discountMoney','discountLastMoney','otherMoney','accountId','changeAmount','getAmount','backAmount'))
|
||||
});
|
||||
// 加载子表数据
|
||||
let params = {
|
||||
@@ -197,7 +198,8 @@
|
||||
for(let item of detailArr){
|
||||
totalPrice += item.allPrice-0
|
||||
}
|
||||
billMain.totalPrice = totalPrice
|
||||
billMain.totalPrice = 0-totalPrice
|
||||
billMain.changeAmount = 0-billMain.changeAmount
|
||||
if(this.model.id){
|
||||
billMain.id = this.model.id
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<a-card :bordered="false" class="card-area">
|
||||
<j-modal
|
||||
:title="title"
|
||||
:width="width"
|
||||
@@ -57,7 +58,7 @@
|
||||
<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="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
|
||||
<a-input style="width:185px;" placeholder="请输入优惠率" v-decorator.trim="[ 'discount' ]" suffix="%" @keyup="onKeyUpDiscount"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24">
|
||||
@@ -79,11 +80,15 @@
|
||||
<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' ]" :dropdownMatchSelectWidth="false">
|
||||
<a-select style="width:185px;" placeholder="选择结算账户" v-decorator="[ 'accountId' ]"
|
||||
:dropdownMatchSelectWidth="false" allowClear @select="selectAccount">
|
||||
<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">
|
||||
@@ -105,13 +110,16 @@
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</j-modal>
|
||||
<many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
|
||||
</a-card>
|
||||
</template>
|
||||
<script>
|
||||
import pick from 'lodash.pick'
|
||||
import ManyAccountModal from '../dialog/ManyAccountModal'
|
||||
import { FormTypes } from '@/utils/JEditableTableUtil'
|
||||
import { JEditableTableMixin } from '@/mixins/JEditableTableMixin'
|
||||
import { BillModalMixin } from '../mixins/BillModalMixin'
|
||||
import { getMpListShort } from "@/utils/util"
|
||||
import { getMpListShort, changeListFmtMinus } from "@/utils/util"
|
||||
import JSelectMultiple from '@/components/jeecg/JSelectMultiple'
|
||||
import JDate from '@/components/jeecg/JDate'
|
||||
import Vue from 'vue'
|
||||
@@ -119,6 +127,7 @@
|
||||
name: "SaleBackModal",
|
||||
mixins: [JEditableTableMixin, BillModalMixin],
|
||||
components: {
|
||||
ManyAccountModal,
|
||||
JDate,
|
||||
JSelectMultiple
|
||||
},
|
||||
@@ -228,7 +237,8 @@
|
||||
for(let item of detailArr){
|
||||
totalPrice += item.allPrice-0
|
||||
}
|
||||
billMain.totalPrice = totalPrice
|
||||
billMain.totalPrice = 0-totalPrice
|
||||
billMain.changeAmount = 0-billMain.changeAmount
|
||||
if(this.model.id){
|
||||
billMain.id = this.model.id
|
||||
}
|
||||
@@ -238,6 +248,13 @@
|
||||
rows: JSON.stringify(detailArr),
|
||||
}
|
||||
},
|
||||
manyAccountModalFormOk(idList, moneyList, allPrice) {
|
||||
this.accountIdList = idList
|
||||
this.accountMoneyList = changeListFmtMinus(moneyList)
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'changeAmount':allPrice})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user