|
|
@@ -98,7 +98,7 @@
|
|
|
</avue-crud>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false" size="mini">取 消</el-button>
|
|
|
- <el-button v-if="form.cashierStatus == 0" size="mini" type="success" @click="allClick('申请出纳')" :disabled="disabled||data.length==0"
|
|
|
+ <el-button v-if="form.cashierStatus == 0" size="mini" type="success" @click="allClick('申请出纳')" :disabled="disabled || data.length == 0"
|
|
|
>{{ form.dc == "D" ? "收费" : "付费" }}申请</el-button
|
|
|
>
|
|
|
<el-button v-if="form.cashierStatus == 1" size="mini" type="danger" @click="allClick('撤销申请出纳')" :disabled="disabled"
|
|
|
@@ -112,7 +112,7 @@
|
|
|
<script>
|
|
|
import { MktSlotQuotation, quotationImportBatch } from "@/api/iosBasicData/bills";
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
-import { getListAllDetail, submit, remove, applyCashier, revokeCashier } from "@/api/iosBasicData/cashier.js";
|
|
|
+import { getListAllDetail, submit, remove, applyCashier, revokeCashier,submitList } from "@/api/iosBasicData/cashier.js";
|
|
|
import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
|
|
|
export default {
|
|
|
props: {
|
|
|
@@ -261,8 +261,116 @@ export default {
|
|
|
// this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
|
|
|
},
|
|
|
methods: {
|
|
|
- oneClickGeneration(){
|
|
|
-
|
|
|
+ async oneClickGeneration(row, list, dataList) {
|
|
|
+ if (list.length == 0) {
|
|
|
+ this.processData(row, list, dataList);
|
|
|
+ }
|
|
|
+ if (list.length) {
|
|
|
+ let ids = [];
|
|
|
+ for (const item of list) {
|
|
|
+ ids.push(item.id);
|
|
|
+ }
|
|
|
+ await remove({ ids: ids.join(",") });
|
|
|
+ this.data = [];
|
|
|
+ this.processData(row, list, dataList);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //处理赋值
|
|
|
+ async processData(row, list, dataList) {
|
|
|
+ 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
|
|
|
+ });
|
|
|
+ }
|
|
|
+ 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
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (amountCr > 0 || amountCrUsd > 0) {
|
|
|
+ let obj = {
|
|
|
+ type: 2,
|
|
|
+ date: row.billDate + " 00:00:00",
|
|
|
+ dc: "C"
|
|
|
+ };
|
|
|
+ const res = await bcurrencyGetExrate(obj);
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ if (amountCr > 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),
|
|
|
+ taxRate: 0,
|
|
|
+ amountTax: Number(Number(amountCr ? amountCr : 0)).toFixed(2),
|
|
|
+ amountNet: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (amountCrUsd > 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),
|
|
|
+ taxRate: 0,
|
|
|
+ amountTax: Number(Number(amountCrUsd ? amountCrUsd : 0) * Number(item.exrate ? item.exrate : 0)).toFixed(2),
|
|
|
+ amountNet: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (this.data.length) {
|
|
|
+ const res = await submitList(this.data);
|
|
|
+ this.data=res.data.data
|
|
|
+ }
|
|
|
},
|
|
|
rowEdit(row) {
|
|
|
if (row.$cellEdit) {
|
|
|
@@ -444,7 +552,7 @@ export default {
|
|
|
addRow() {
|
|
|
this.data.push({ $cellEdit: true, srcId: this.form.id, dc: this.form.dc, taxRate: 0 });
|
|
|
},
|
|
|
- openDialog(row) {
|
|
|
+ openDialog(row, dataList,type) {
|
|
|
this.dialogVisible = true;
|
|
|
this.form = row;
|
|
|
let obj = {
|
|
|
@@ -453,6 +561,9 @@ export default {
|
|
|
this.loading = true;
|
|
|
getListAllDetail(obj)
|
|
|
.then(res => {
|
|
|
+ if (row.cashierStatus == 0&&type=='auto') {
|
|
|
+ this.oneClickGeneration(row, res.data.data, dataList);
|
|
|
+ }
|
|
|
this.data = res.data.data;
|
|
|
})
|
|
|
.finally(() => {
|