|
@@ -26,7 +26,7 @@
|
|
|
</el-input>
|
|
|
</template>
|
|
|
<template slot="corpId">
|
|
|
- <crop-select v-model="form.corpId" corpType="KG" :disabled="(!financeDisabled && form.id) || editDisable"
|
|
|
+ <crop-select v-model="form.corpId" corpType="KC" :disabled="(!financeDisabled && form.id) || editDisable || dataList.length>0"
|
|
|
@getCorpData="returnBack" style="width: 100%"></crop-select>
|
|
|
</template>
|
|
|
<template slot="salesCompany">
|
|
@@ -55,9 +55,12 @@
|
|
|
@selection-change="selectionChange">
|
|
|
<template slot="menuLeft">
|
|
|
<el-button type="primary" size="small" :loading="buttonLoading" icon="el-icon-shopping-cart-2"
|
|
|
- :disabled="!financeButton || editDisable" @click="selectPurchase">选择采购合同
|
|
|
+ :disabled="!financeButton || editDisable" @click="selectPurchase(0)">选择应付
|
|
|
</el-button>
|
|
|
<el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>
|
|
|
+ <el-button type="primary" size="small" :loading="buttonLoading" icon="el-icon-shopping-cart-2"
|
|
|
+ :disabled="!financeButton || editDisable" @click="selectPurchase(1)">选择应收
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template slot-scope="{ row,index }" slot="menu">
|
|
|
<el-button type="text" size="small" icon="el-icon-edit" :disabled="!financeButton || editDisable"
|
|
@@ -88,7 +91,7 @@
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
- <el-dialog title="导入采购" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog" width="60%"
|
|
|
+ <el-dialog :title="title" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog" v-if="billDetailDialog" width="60%"
|
|
|
:close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" top="10vh" v-dialog-drag>
|
|
|
<bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail"
|
|
|
@importProMent="importProMent">
|
|
@@ -128,6 +131,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
form: {},
|
|
|
+ title:'',
|
|
|
switchDialog:false,
|
|
|
itemsForm: {},
|
|
|
itemsOption: option,
|
|
@@ -228,7 +232,7 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: '往来单位',
|
|
|
+ label: '结算单位',
|
|
|
prop: 'corpId',
|
|
|
sort: true,
|
|
|
span: 8,
|
|
@@ -274,6 +278,40 @@ export default {
|
|
|
span: 8,
|
|
|
rules: [
|
|
|
{
|
|
|
+ pattern: /^[+-]?((\d*(\.\d{1,})$)|(\d+$))/,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '应付金额合计',
|
|
|
+ prop: 'payAmount',
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ required: false,
|
|
|
+ message: ' ',
|
|
|
+ trigger: 'blur'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '应收金额合计',
|
|
|
+ prop: 'receivableAmount',
|
|
|
+ span: 8,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
|
|
|
message: ' ',
|
|
|
trigger: 'blur'
|
|
@@ -477,8 +515,9 @@ export default {
|
|
|
this.$message.warning('本次金额不得大于金额!')
|
|
|
this.$set(row, 'thisAmount', '')
|
|
|
}
|
|
|
+ this.calculation(this.dataList)
|
|
|
},
|
|
|
- selectPurchase() {
|
|
|
+ selectPurchase(val) {
|
|
|
if (!this.form.corpId) {
|
|
|
this.$message.warning("请先选择客户!")
|
|
|
return
|
|
@@ -486,6 +525,13 @@ export default {
|
|
|
this.params = {
|
|
|
corpId: this.form.corpId
|
|
|
}
|
|
|
+ if (val === 0){
|
|
|
+ this.title = '导入运费'
|
|
|
+ this.billType = '付费'
|
|
|
+ }else {
|
|
|
+ this.title = '导入销售'
|
|
|
+ this.billType = '收费'
|
|
|
+ }
|
|
|
this.billDetailDialog = true;
|
|
|
},
|
|
|
closeBillDetail() {
|
|
@@ -494,15 +540,33 @@ export default {
|
|
|
importProMent(list) {
|
|
|
list.forEach((item, index) => {
|
|
|
item.accId = item.id;
|
|
|
- item.srcOrderno = item.accSysNo
|
|
|
- item.billNo = item.srcBillNo
|
|
|
- item.thisAmount = item.amount
|
|
|
+ item.fleetName = item.fleetName?item.fleetName:item.corpName
|
|
|
+ item.srcOrderno = item.accSysNo;
|
|
|
+ item.billNo = item.srcBillNo;
|
|
|
+ item.thisAmount = item.amount;
|
|
|
delete item.id;
|
|
|
|
|
|
this.$refs.crud.rowCellAdd(item);
|
|
|
})
|
|
|
this.$set(this.form, 'srcOrderno', Array.from(new Set(this.dataList.map(item => { if (item.srcOrderno) { return item.srcOrderno } }))).join(','))
|
|
|
this.billDetailDialog = false;
|
|
|
+ this.calculation(this.dataList)
|
|
|
+ },
|
|
|
+ calculation(data){
|
|
|
+ let d = 0
|
|
|
+ let c = 0
|
|
|
+ data.forEach(item =>{
|
|
|
+ if (item.dc === "c"){
|
|
|
+ c += Number(item.thisAmount)
|
|
|
+ }else if (item.dc === "D"){
|
|
|
+ d += Number(item.thisAmount)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //应付金额合计
|
|
|
+ this.form.payAmount = c
|
|
|
+ this.form.receivableAmount = d
|
|
|
+ //应收金额合计
|
|
|
+ this.form.amount = c-d
|
|
|
},
|
|
|
rowUpdate(row, index, done) {
|
|
|
done(row);
|
|
@@ -523,9 +587,11 @@ export default {
|
|
|
message: "操作成功!"
|
|
|
});
|
|
|
this.dataList.splice(index, 1);
|
|
|
+ this.calculation(this.dataList)
|
|
|
})
|
|
|
} else {
|
|
|
this.dataList.splice(index, 1);
|
|
|
+ this.calculation(this.dataList)
|
|
|
}
|
|
|
},
|
|
|
searchReset() {
|