财务单据优化
This commit is contained in:
parent
f265312ce4
commit
fe4a755d7f
@ -63,6 +63,16 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row class="form-row" :gutter="24">
|
||||
<a-col :span="6">
|
||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠金额">
|
||||
{{model.changeAmount}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6"></a-col>
|
||||
<a-col :span="6"></a-col>
|
||||
<a-col :span="6"></a-col>
|
||||
</a-row>
|
||||
</section>
|
||||
</template>
|
||||
<!--转账-->
|
||||
|
||||
@ -41,14 +41,25 @@ export const FinancialModalMixin = {
|
||||
},
|
||||
methods: {
|
||||
addInit(amountNum) {
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'billTime':getNowFormatDateTime()})
|
||||
});
|
||||
getAction('/sequence/buildNumber').then((res) => {
|
||||
if (res && res.code === 200) {
|
||||
this.form.setFieldsValue({'billNo':amountNum + res.data.defaultNumber})
|
||||
}
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'billTime':getNowFormatDateTime()})
|
||||
})
|
||||
this.$nextTick(() => {
|
||||
getAccount({}).then((res)=>{
|
||||
if(res && res.code === 200) {
|
||||
for (const item of res.data.accountList) {
|
||||
if(item.isDefault){
|
||||
this.form.setFieldsValue({'accountId': item.id})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
initSupplier() {
|
||||
let that = this;
|
||||
@ -133,31 +144,10 @@ export const FinancialModalMixin = {
|
||||
onValueChange(event) {
|
||||
let that = this
|
||||
const { type, row, column, value, target } = event
|
||||
let param,operNumber,unitPrice,allPrice,taxRate,taxMoney,taxLastMoney
|
||||
switch(column.key) {
|
||||
case "operNumber":
|
||||
unitPrice = row.unitPrice
|
||||
taxRate = row.taxRate
|
||||
allPrice = unitPrice*value
|
||||
taxMoney =(taxRate/100)*allPrice
|
||||
taxLastMoney = allPrice + taxMoney
|
||||
target.setValues([{rowKey: row.id, values: {allPrice: allPrice, taxMoney: taxMoney, taxLastMoney: taxLastMoney}}])
|
||||
target.recalcAllStatisticsColumns()
|
||||
let allTaxLastMoney = target.statisticsColumns.taxLastMoney
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'discount':0,'discountMoney':0,'discountLastMoney':allTaxLastMoney,
|
||||
'changeAmount':allTaxLastMoney,'debt':0})
|
||||
});
|
||||
break;
|
||||
case "unitPrice":
|
||||
operNumber = row.operNumber
|
||||
target.setValues([{rowKey: row.id, values: {allPrice: value*operNumber}}])
|
||||
target.recalcAllStatisticsColumns()
|
||||
break;
|
||||
case "allPrice":
|
||||
operNumber = row.operNumber
|
||||
target.setValues([{rowKey: row.id, values: {unitPrice: value/operNumber}}])
|
||||
case "eachAmount":
|
||||
target.recalcAllStatisticsColumns()
|
||||
that.autoChangePrice(target)
|
||||
break;
|
||||
}
|
||||
},
|
||||
@ -169,6 +159,13 @@ export const FinancialModalMixin = {
|
||||
target.recalcAllStatisticsColumns()
|
||||
}
|
||||
})
|
||||
},
|
||||
//改变优惠、本次付款、欠款的值
|
||||
autoChangePrice(target) {
|
||||
let allEachAmount = target.statisticsColumns.eachAmount-0
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue({'changeAmount':allEachAmount})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -52,8 +52,7 @@
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="true"
|
||||
:actionButton="true"
|
||||
@valueChange="onValueChange" />
|
||||
: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="">
|
||||
|
||||
@ -52,8 +52,7 @@
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="true"
|
||||
:actionButton="true"
|
||||
@valueChange="onValueChange" />
|
||||
: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="">
|
||||
|
||||
@ -52,8 +52,7 @@
|
||||
:maxHeight="300"
|
||||
:rowNumber="false"
|
||||
:rowSelection="true"
|
||||
:actionButton="true"
|
||||
@valueChange="onValueChange" />
|
||||
: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="">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user