|
@@ -133,7 +133,8 @@
|
|
|
<el-button type="warning" size="small" :disabled="selectionList.length == 0"
|
|
|
@click="allClick('生成货代')">生成货代
|
|
|
</el-button>
|
|
|
- <el-button size="small" style="margin-right: 8px" :disabled="!form.id" @click="$refs.print.openDialog()">打印账单
|
|
|
+ <el-button size="small" style="margin-right: 8px" :disabled="!form.id"
|
|
|
+ @click="$refs.print.openDialog()">打印账单
|
|
|
</el-button>
|
|
|
<el-dropdown>
|
|
|
<el-button type="danger" size="small" :disabled="editDisabled">
|
|
@@ -141,7 +142,8 @@
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item @click.native="allClick('生成首款应付')">首款</el-dropdown-item>
|
|
|
- <el-dropdown-item @click.native="allClick('生成尾款应付')">尾款</el-dropdown-item>
|
|
|
+ <el-dropdown-item :disabled="selectionList.length == 0"
|
|
|
+ @click.native="allClick('生成尾款应付')">尾款</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
<!-- <el-dropdown>
|
|
@@ -292,6 +294,7 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ wkType: null,
|
|
|
wkForm: {
|
|
|
agentItemsRList: []
|
|
|
},
|
|
@@ -311,7 +314,7 @@ export default {
|
|
|
disabled: true,
|
|
|
},
|
|
|
{
|
|
|
- label: '应收金额',
|
|
|
+ label:'应收金额',
|
|
|
prop: 'amountD',
|
|
|
disabled: true,
|
|
|
},
|
|
@@ -854,7 +857,7 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
- itemIds:null
|
|
|
+ itemIds: null
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -1084,14 +1087,14 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
selectionChange(list) {
|
|
|
- let ids=[]
|
|
|
- list.forEach(e=>{
|
|
|
+ let ids = []
|
|
|
+ list.forEach(e => {
|
|
|
ids.push(e.id)
|
|
|
})
|
|
|
- if(ids.length){
|
|
|
- this.itemIds=ids.join(',')
|
|
|
- }else{
|
|
|
- this.itemIds=null
|
|
|
+ if (ids.length) {
|
|
|
+ this.itemIds = ids.join(',')
|
|
|
+ } else {
|
|
|
+ this.itemIds = null
|
|
|
}
|
|
|
this.selectionList = list;
|
|
|
},
|
|
@@ -1224,20 +1227,6 @@ export default {
|
|
|
if (this.selectionList[index].whetherBalancePayment == 1) {
|
|
|
return this.$message.error("第" + Number(this.selectionList[index].$index + 1) + "行已生成尾款");
|
|
|
}
|
|
|
- // if (this.selectionList.filter(row => this.selectionList[index].billNo == row.billNo).length != this.form.agentItemsList.filter(row => this.selectionList[index].billNo == row.billNo).length) {
|
|
|
- // this.$confirm("是否收取所选择相同提单号所有明细尾款?", {
|
|
|
- // confirmButtonText: "确定",
|
|
|
- // cancelButtonText: "取消",
|
|
|
- // type: "warning"
|
|
|
- // }).then(() => {
|
|
|
- // console.log(index)
|
|
|
- // this.form.agentItemsList.forEach(row=>{
|
|
|
- // if(row.billNo==this.selectionList[index].billNo){
|
|
|
- // this.$refs.crud.toggleRowSelection(row, true);
|
|
|
- // }
|
|
|
- // })
|
|
|
- // });
|
|
|
- // }
|
|
|
}
|
|
|
let obj = {}
|
|
|
obj = {
|
|
@@ -1259,7 +1248,9 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
+ this.findObject(this.wkOption.column, "amountD").label ='应收金额';
|
|
|
this.wkDialog = true
|
|
|
+ this.wkType = name
|
|
|
}
|
|
|
if (name == '生成首款应付') {
|
|
|
if (this.form.applyForPayment == 1) return this.$message.error("请勿重复生成");
|
|
@@ -1277,19 +1268,47 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
if (name == '生成尾款应付') {
|
|
|
- if (this.form.applyForPaymentBalance == 1) return this.$message.error("请勿重复生成");
|
|
|
+ // if (this.form.applyForPaymentBalance == 1) return this.$message.error("请勿重复生成");
|
|
|
+ // let obj = {}
|
|
|
+ // obj = {
|
|
|
+ // id: this.form.id,
|
|
|
+ // // url: '/tradeAgency/tradeAgency/index',
|
|
|
+ // // pageStatus: '',
|
|
|
+ // // pageLabel: '贸易代理(T)',
|
|
|
+ // paidApplication: 'FFSQ-WK'
|
|
|
+ // }
|
|
|
+ // generatePayment(obj).then(res => {
|
|
|
+ // this.$message.success("生成尾款应付成功");
|
|
|
+ // this.getDetails(this.form.id)
|
|
|
+ // })
|
|
|
+ for (let index in this.selectionList) {
|
|
|
+ if (this.selectionList[index].applyForPaymentBalance == 1) {
|
|
|
+ return this.$message.error("第" + Number(this.selectionList[index].$index + 1) + "行已生成尾款");
|
|
|
+ }
|
|
|
+ }
|
|
|
let obj = {}
|
|
|
obj = {
|
|
|
- id: this.form.id,
|
|
|
- // url: '/tradeAgency/tradeAgency/index',
|
|
|
- // pageStatus: '',
|
|
|
- // pageLabel: '贸易代理(T)',
|
|
|
- paidApplication: 'FFSQ-WK'
|
|
|
+ ...this.form,
|
|
|
+ agentItemsList: this.selectionList
|
|
|
}
|
|
|
- generatePayment(obj).then(res => {
|
|
|
- this.$message.success("生成尾款应付成功");
|
|
|
- this.getDetails(this.form.id)
|
|
|
+ balancePayment(obj).then(res => {
|
|
|
+ this.wkForm = res.data.data
|
|
|
+ this.wkForm.amountD = _.subtract(res.data.data.goodsValue, res.data.data.prepaidAmount)
|
|
|
+ res.data.data.agentItemsRList.forEach(e => {
|
|
|
+ e.$cellEdit = true
|
|
|
+ })
|
|
|
+ this.wkForm.agentItemsRList = res.data.data.agentItemsRList
|
|
|
+ bcurrencyGetExrate({ date: this.form.contractDate, dc: 'C' }).then(res => {
|
|
|
+ res.data.data.forEach(e => {
|
|
|
+ if (this.form.currency == e.code) {
|
|
|
+ this.wkForm.exchangeRate = e.exrate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
+ this.findObject(this.wkOption.column, "amountD").label ='应付金额';
|
|
|
+ this.wkDialog = true
|
|
|
+ this.wkType = name
|
|
|
}
|
|
|
if (name == '首款撤销申请付款') {
|
|
|
if (this.form.applyForPayment == 0) return this.$message.error("未申请付款");
|
|
@@ -1416,14 +1435,24 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
wkSubmit() {
|
|
|
- generateBalancePaymentBill(this.wkForm).then(res => {
|
|
|
- this.$message.success("成功生成尾款账单");
|
|
|
- this.getDetails(this.form.id)
|
|
|
- this.wkDialog = false
|
|
|
- })
|
|
|
+ if (this.wkType == '尾款账单') {
|
|
|
+ generateBalancePaymentBill(this.wkForm).then(res => {
|
|
|
+ this.$message.success("成功生成尾款账单");
|
|
|
+ this.getDetails(this.form.id)
|
|
|
+ this.wkDialog = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (this.wkType == '生成尾款应付') {
|
|
|
+ generatePayment(this.wkForm).then(res => {
|
|
|
+ this.$message.success("生成尾款应付成功");
|
|
|
+ this.getDetails(this.form.id)
|
|
|
+ this.wkDialog = false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
wkClosed() {
|
|
|
this.wkForm = this.$options.data().wkForm
|
|
|
+ this.wkType = null
|
|
|
},
|
|
|
application() {
|
|
|
if (this.form.downPayment != 1) return this.$message.error("未申请首款账单");
|