|
|
@@ -1,10 +1,8 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-dialog title="指示" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
|
|
|
- <el-tag type="success" style="margin-right: 10px;">剩余收费(RMB){{ Number(form.amountDr - form.actualAmountDr).toFixed(2) }}</el-tag>
|
|
|
- <el-tag type="info" style="margin-right: 10px;">剩余收费(USD){{ Number(form.amountDrUsd - form.actualAmountDrUsd).toFixed(2) }}</el-tag>
|
|
|
- <el-tag type="warning" style="margin-right: 10px;">剩余付费(RMB){{ Number(form.amountCr - form.actualAmountCr).toFixed(2) }}</el-tag>
|
|
|
- <el-tag type="danger">剩余付费(USD){{ Number(form.amountCrUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
|
|
|
+ <el-tag type="warning" style="margin-right: 10px;">剩余付费(RMB){{ Number(form.amountSub - form.actualAmountCr).toFixed(2) }}</el-tag>
|
|
|
+ <el-tag type="danger">剩余付费(USD){{ Number(form.amountSubUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
|
|
|
<avue-crud
|
|
|
v-if="dialogVisible"
|
|
|
:option="option"
|
|
|
@@ -278,63 +276,63 @@ export default {
|
|
|
//生成指示
|
|
|
async processData(row, list, dataList) {
|
|
|
this.loading = true;
|
|
|
- let amountDr = 0;
|
|
|
- let amountDrUsd = 0;
|
|
|
- let amountCr = 0;
|
|
|
- let amountCrUsd = 0;
|
|
|
- for (let item of dataList) {
|
|
|
- if (item.dc == "D" && item.currentStlCurCode == "CNY") {
|
|
|
- amountDr += Number(item.currentStlAmountRMB);
|
|
|
- }
|
|
|
- if (item.dc == "D" && item.currentStlCurCode == "USD") {
|
|
|
- amountDrUsd += Number(item.currentStlAmountUSD);
|
|
|
- }
|
|
|
- if (item.dc == "C" && item.currentStlCurCode == "CNY") {
|
|
|
- amountCr += Number(item.currentStlAmountRMB);
|
|
|
- }
|
|
|
- if (item.dc == "C" && item.currentStlCurCode == "USD") {
|
|
|
- amountCrUsd += Number(item.currentStlAmountUSD);
|
|
|
- }
|
|
|
- }
|
|
|
- if (amountDr > 0 || amountDrUsd > 0) {
|
|
|
- let obj = {
|
|
|
- type: 2,
|
|
|
- date: row.billDate + " 00:00:00",
|
|
|
- dc: "D"
|
|
|
- };
|
|
|
- const res = await bcurrencyGetExrate(obj);
|
|
|
- res.data.data.forEach(item => {
|
|
|
- if (amountDr > 0 && item.code == "CNY") {
|
|
|
- this.data.push({
|
|
|
- srcId: row.id,
|
|
|
- dc: "D",
|
|
|
- curCode: item.code,
|
|
|
- exrate: item.exrate,
|
|
|
- amount: amountDr,
|
|
|
- amountLoc: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
|
|
|
- taxRate: 0,
|
|
|
- amountTax: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
|
|
|
- amountNet: 0,
|
|
|
- applyCashierAmount: 0
|
|
|
- });
|
|
|
- }
|
|
|
- if (amountDrUsd > 0 && item.code == "USD") {
|
|
|
- this.data.push({
|
|
|
- srcId: row.id,
|
|
|
- dc: "D",
|
|
|
- curCode: item.code,
|
|
|
- exrate: item.exrate,
|
|
|
- amount: amountDrUsd,
|
|
|
- amountLoc: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
- taxRate: 0,
|
|
|
- amountTax: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
- amountNet: 0,
|
|
|
- applyCashierAmount: 0
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (amountCr > 0 || amountCrUsd > 0) {
|
|
|
+ // let amountDr = 0;
|
|
|
+ // let amountDrUsd = 0;
|
|
|
+ // let amountCr = 0;
|
|
|
+ // let amountCrUsd = 0;
|
|
|
+ // for (let item of dataList) {
|
|
|
+ // if (item.dc == "D" && item.currentStlCurCode == "CNY") {
|
|
|
+ // amountDr += Number(item.currentStlAmountRMB);
|
|
|
+ // }
|
|
|
+ // if (item.dc == "D" && item.currentStlCurCode == "USD") {
|
|
|
+ // amountDrUsd += Number(item.currentStlAmountUSD);
|
|
|
+ // }
|
|
|
+ // if (item.dc == "C" && item.currentStlCurCode == "CNY") {
|
|
|
+ // amountCr += Number(item.currentStlAmountRMB);
|
|
|
+ // }
|
|
|
+ // if (item.dc == "C" && item.currentStlCurCode == "USD") {
|
|
|
+ // amountCrUsd += Number(item.currentStlAmountUSD);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (amountDr > 0 || amountDrUsd > 0) {
|
|
|
+ // let obj = {
|
|
|
+ // type: 2,
|
|
|
+ // date: row.billDate + " 00:00:00",
|
|
|
+ // dc: "D"
|
|
|
+ // };
|
|
|
+ // const res = await bcurrencyGetExrate(obj);
|
|
|
+ // res.data.data.forEach(item => {
|
|
|
+ // if (amountDr > 0 && item.code == "CNY") {
|
|
|
+ // this.data.push({
|
|
|
+ // srcId: row.id,
|
|
|
+ // dc: "D",
|
|
|
+ // curCode: item.code,
|
|
|
+ // exrate: item.exrate,
|
|
|
+ // amount: amountDr,
|
|
|
+ // amountLoc: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
|
|
|
+ // taxRate: 0,
|
|
|
+ // amountTax: Number(Number(amountDr ? amountDr : 0)).toFixed(2),
|
|
|
+ // amountNet: 0,
|
|
|
+ // applyCashierAmount: 0
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // if (amountDrUsd > 0 && item.code == "USD") {
|
|
|
+ // this.data.push({
|
|
|
+ // srcId: row.id,
|
|
|
+ // dc: "D",
|
|
|
+ // curCode: item.code,
|
|
|
+ // exrate: item.exrate,
|
|
|
+ // amount: amountDrUsd,
|
|
|
+ // amountLoc: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
+ // taxRate: 0,
|
|
|
+ // amountTax: Number(Number(amountDrUsd ? amountDrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
+ // amountNet: 0,
|
|
|
+ // applyCashierAmount: 0
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ if (this.form.amountSub > 0 || this.form.amountSubUsd > 0) {
|
|
|
let obj = {
|
|
|
type: 2,
|
|
|
date: row.billDate + " 00:00:00",
|
|
|
@@ -342,30 +340,30 @@ export default {
|
|
|
};
|
|
|
const res = await bcurrencyGetExrate(obj);
|
|
|
res.data.data.forEach(item => {
|
|
|
- if (amountCr > 0 && item.code == "CNY") {
|
|
|
+ if (this.form.amountSub > 0 && item.code == "CNY") {
|
|
|
this.data.push({
|
|
|
srcId: row.id,
|
|
|
dc: "C",
|
|
|
curCode: item.code,
|
|
|
exrate: item.exrate,
|
|
|
- amount: amountCr,
|
|
|
- amountLoc: Number(Number(amountCr ? amountCr : 0)).toFixed(2),
|
|
|
+ amount: this.form.amountSub,
|
|
|
+ amountLoc: Number(Number(this.form.amountSub ? this.form.amountSub : 0)).toFixed(2),
|
|
|
taxRate: 0,
|
|
|
- amountTax: Number(Number(amountCr ? amountCr : 0)).toFixed(2),
|
|
|
+ amountTax: Number(Number(this.form.amountSub ? this.form.amountSub : 0)).toFixed(2),
|
|
|
amountNet: 0,
|
|
|
applyCashierAmount: 0
|
|
|
});
|
|
|
}
|
|
|
- if (amountCrUsd > 0 && item.code == "USD") {
|
|
|
+ if (this.form.amountSubUsd > 0 && item.code == "USD") {
|
|
|
this.data.push({
|
|
|
srcId: row.id,
|
|
|
dc: "C",
|
|
|
curCode: item.code,
|
|
|
exrate: item.exrate,
|
|
|
- amount: amountCrUsd,
|
|
|
- amountLoc: Number(Number(amountCrUsd ? amountCrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
+ amount: this.form.amountSubUsd,
|
|
|
+ amountLoc: Number(Number(this.form.amountSubUsd ? this.form.amountSubUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
taxRate: 0,
|
|
|
- amountTax: Number(Number(amountCrUsd ? amountCrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
+ amountTax: Number(Number(this.form.amountSubUsd ? this.form.amountSubUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
amountNet: 0,
|
|
|
applyCashierAmount: 0
|
|
|
});
|
|
|
@@ -389,24 +387,14 @@ export default {
|
|
|
if (!row.amount || row.amount == 0 || row.amount < 0) {
|
|
|
return this.$message.error("金额不能为非正数");
|
|
|
}
|
|
|
- if (row.dc == "D" && row.curCode == "CNY") {
|
|
|
- if (Number(row.amount) > Number(this.form.amountDr - this.form.actualAmountDr)) {
|
|
|
- return this.$message.error("金额不能超过剩余出纳收费(RMB):" + Number(this.form.amountDr - this.form.actualAmountDr));
|
|
|
- }
|
|
|
- }
|
|
|
- if (row.dc == "D" && row.curCode == "USD") {
|
|
|
- if (Number(row.amount) > Number(this.form.amountDrUsd - this.form.actualAmountDrUsd)) {
|
|
|
- return this.$message.error("金额不能超过剩余出纳收费(USD):" + Number(this.form.amountDrUsd - this.form.actualAmountDrUsd));
|
|
|
- }
|
|
|
- }
|
|
|
if (row.dc == "C" && row.curCode == "CNY") {
|
|
|
- if (Number(row.amount) > Number(this.form.amountCr - this.form.actualAmountCr)) {
|
|
|
- return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountCr - this.form.actualAmountCr));
|
|
|
+ if (Number(row.amount) > Number(this.form.amountSub - this.form.actualAmountCr)) {
|
|
|
+ return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountSub - this.form.actualAmountCr));
|
|
|
}
|
|
|
}
|
|
|
if (row.dc == "C" && row.curCode == "USD") {
|
|
|
- if (Number(row.amount) > Number(this.form.amountCrUsd - this.form.actualAmountCrUsd)) {
|
|
|
- return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountCrUsd - this.form.actualAmountCrUsd));
|
|
|
+ if (Number(row.amount) > Number(this.form.amountSubUsd - this.form.actualAmountCrUsd)) {
|
|
|
+ return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountSubUsd - this.form.actualAmountCrUsd));
|
|
|
}
|
|
|
}
|
|
|
submit(row).then(res => {
|