|
|
@@ -0,0 +1,719 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog title="选择数据" :visible.sync="dialogVisible" append-to-body width="80%" :before-close="handleClose"
|
|
|
+ :close-on-click-modal="false">
|
|
|
+ <avue-crud :option="option" :table-loading="loading" :data="data.filter(item=>!item.disabled)" ref="crud" id="out-table"
|
|
|
+ :header-cell-class-name="headerClassName" @search-change="searchChange" @search-reset="searchReset"
|
|
|
+ @selection-change="selectionChange" :search.sync="query" :summary-method="summaryMethod">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="查看数据" name="query" />
|
|
|
+ <el-tab-pane label="已选择数据" name="pick" />
|
|
|
+ </el-tabs>
|
|
|
+ <div style="margin: 10px 0 0 10px;">
|
|
|
+ <el-button v-if="activeName == 'query'" type="success" @click="allPick"
|
|
|
+ size="mini">批量选择</el-button>
|
|
|
+ <el-button v-if="activeName == 'pick'" type="danger" @click="allCancel"
|
|
|
+ size="mini">全部取消</el-button>
|
|
|
+ <span style="font-size: 18px;font-weight: 600;margin-left: 10px;">
|
|
|
+ <span style="color: #67C23A;margin-right: 10px;">
|
|
|
+ 本币:{{ amountSubSum }}元
|
|
|
+ </span>
|
|
|
+ <span style="color: #E6A23C;">
|
|
|
+ 外币:{{ amountSubUsdSum }}元
|
|
|
+ </span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <tempalte slot="currentAmountCNY" slot-scope="{ row }">
|
|
|
+ <el-input-number v-if="editSave" v-model="row.currentAmountCNY" @change="armbChange(row)"
|
|
|
+ :controls="false" placeholder="请输入 本次对账CNY" size="mini" style="width: 100%;"
|
|
|
+ :disabled="row.curCode != getLocalCurrency() || settlementdistar || !(form.status == '0' || form.status == '4' || form.status == null)"></el-input-number>
|
|
|
+ <span v-else>{{ row.currentAmountCNY }}</span>
|
|
|
+ </tempalte>
|
|
|
+ <tempalte slot="currentAmountUSD" slot-scope="{ row }">
|
|
|
+ <el-input-number v-if="editSave" v-model="row.currentAmountUSD" @change="ausdChange(row)"
|
|
|
+ :controls="false" placeholder="请输入 本次对账USD" size="mini" style="width: 100%;"
|
|
|
+ :disabled="row.curCode == getLocalCurrency() || settlementdistar || !(form.status == '0' || form.status == '4' || form.status == null)"></el-input-number>
|
|
|
+ <span v-else>{{ row.currentAmountUSD }}</span>
|
|
|
+ </tempalte>
|
|
|
+ <template slot="menu" slot-scope="{ row, index }">
|
|
|
+ <el-button v-if="activeName == 'query'" size="small" type="text" :disabled="row.disabled"
|
|
|
+ @click="pick(row, index)">选择</el-button>
|
|
|
+ <el-button v-if="activeName == 'pick'" size="small" type="text" :disabled="!row.disabled"
|
|
|
+ @click="cancel(row, index)">取消</el-button>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submit" size="mini">导 入</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ finstlbillsGetByDetail,
|
|
|
+ finstlbillsitemsRemove,
|
|
|
+ finstlbillslistAccBillV1,
|
|
|
+} from '@/api/iosBasicData/finstlbills'
|
|
|
+import {
|
|
|
+ fininvoicesDetail,
|
|
|
+ fininvoicesSubmit,
|
|
|
+ fininvoicesitemsRemove,
|
|
|
+ generateFinInvoicesDetail,
|
|
|
+ fininvoiceitemdetailRemove,
|
|
|
+ revokeFinInvoicesDetail,
|
|
|
+ fininvoiceitemdetailSubmit,
|
|
|
+ fininvoicesGenerateFinInvoices,
|
|
|
+ fininvoicesConfirmFinInvoices, fininvoicesRevokeFinInvoices
|
|
|
+} from "@/api/iosBasicData/fininvoices";
|
|
|
+import _ from "lodash";
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ form: {
|
|
|
+ type: Object,
|
|
|
+ // eslint-disable-next-line vue/require-valid-default-prop
|
|
|
+ default: {},
|
|
|
+ },
|
|
|
+ tableData: {
|
|
|
+ type: Array,
|
|
|
+ // eslint-disable-next-line vue/require-valid-default-prop
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ amountSubSum: 0,
|
|
|
+ amountSubUsdSum: 0,
|
|
|
+ activeName: 'query',
|
|
|
+ editSave: true,
|
|
|
+ selectionList: [],
|
|
|
+ data: [],
|
|
|
+ pickData: [],
|
|
|
+ queryData: [],
|
|
|
+ query: {
|
|
|
+ mblno: null,
|
|
|
+ hblno: null,
|
|
|
+ dc: 'C',
|
|
|
+ businessDateStart: null,
|
|
|
+ businessDateEnd: null,
|
|
|
+ },
|
|
|
+ type: null,
|
|
|
+ dialogVisible: false,
|
|
|
+ loading: false,
|
|
|
+ option: {
|
|
|
+ height: 400,
|
|
|
+ calcHeight: 30,
|
|
|
+ searchShow: true,
|
|
|
+ searchMenuSpan: 24,
|
|
|
+ searchIcon: true,
|
|
|
+ searchIndex: 3,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ addBtn: false,
|
|
|
+ viewBtn: false,
|
|
|
+ delBtn: false,
|
|
|
+ editBtn: false,
|
|
|
+ refreshBtn: false,
|
|
|
+ columnBtn: false,
|
|
|
+ menu: true,
|
|
|
+ menuWidth: 60,
|
|
|
+ // header: false,
|
|
|
+ tip: false,
|
|
|
+ selection: true,
|
|
|
+ showSummary: true,
|
|
|
+ selectable: (row, index) => {
|
|
|
+ return !row.disabled
|
|
|
+ },
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "MB/L NO",
|
|
|
+ prop: "mblno",
|
|
|
+ width: "100",
|
|
|
+ search: true,
|
|
|
+ searchValue: this.form.mblno,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "HB/L NO",
|
|
|
+ prop: "hblno",
|
|
|
+ width: "100",
|
|
|
+ search: true,
|
|
|
+ searchValue: this.form.hblno,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "收/付",
|
|
|
+ prop: "dc",
|
|
|
+ width: "60",
|
|
|
+ search: true,
|
|
|
+ searchValue: this.form.dc,
|
|
|
+ type: 'select',
|
|
|
+ dicData: [{
|
|
|
+ label: '全部',
|
|
|
+ value: null
|
|
|
+ }, {
|
|
|
+ label: '收',
|
|
|
+ value: 'D'
|
|
|
+ }, {
|
|
|
+ label: '付',
|
|
|
+ value: 'C'
|
|
|
+ }],
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "ETD",
|
|
|
+ prop: "etd",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用名称",
|
|
|
+ prop: "feeCnName",
|
|
|
+ width: "100",
|
|
|
+ search: true,
|
|
|
+ searchValue: this.form.feeCnName,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本次本币",
|
|
|
+ prop: "currentAmountCNY",
|
|
|
+ width: "80",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本次外币",
|
|
|
+ prop: "currentAmountUSD",
|
|
|
+ width: "80",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "币别",
|
|
|
+ prop: "currentCurCode",
|
|
|
+ width: "80",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "汇率",
|
|
|
+ prop: "currentExrate",
|
|
|
+ width: "80",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户名称",
|
|
|
+ prop: "corpCnName",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "ETA",
|
|
|
+ prop: "eta",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "起运港",
|
|
|
+ prop: "polCnName",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "目的港",
|
|
|
+ prop: "podCnName",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "船名",
|
|
|
+ prop: "vesselCnName",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ searchValue: this.form.vesselCnName,
|
|
|
+ type: 'select',
|
|
|
+ filterable: true,
|
|
|
+ remote: true,
|
|
|
+ dicUrl: "/api/blade-los/bvessels/list?cnName={{key}}",
|
|
|
+ props: {
|
|
|
+ label: 'cnName',
|
|
|
+ value: 'cnName',
|
|
|
+ res: 'data.records'
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "航次",
|
|
|
+ prop: "voyageNo",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ search: true,
|
|
|
+ searchValue: this.form.voyageNo,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "箱型箱量",
|
|
|
+ prop: "quantityCntrDescr",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "所属公司",
|
|
|
+ prop: "branchName",
|
|
|
+ width: "100",
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务开始",
|
|
|
+ prop: "businessDateStart",
|
|
|
+ width: "100",
|
|
|
+ search: true,
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd 00:00:00",
|
|
|
+ searchValue: this.form.businessDateStart,
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务结束",
|
|
|
+ prop: "businessDateEnd",
|
|
|
+ width: "100",
|
|
|
+ search: true,
|
|
|
+ type: "date",
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd 00:00:00",
|
|
|
+ searchValue: this.form.businessDateEnd,
|
|
|
+ hide: true,
|
|
|
+ showColumn: false,
|
|
|
+ overHidden: true,
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 合计计算
|
|
|
+ summaryMethod({ columns, data }) {
|
|
|
+ const sums = [];
|
|
|
+ if (columns.length > 0) {
|
|
|
+ columns.forEach((item, index) => {
|
|
|
+ let prop = item.property
|
|
|
+ sums[0] = '合计'
|
|
|
+ if (['currentAmountCNY', 'currentAmountUSD'].includes(prop)) {
|
|
|
+ let values = this.selectionList.map(item => Number(item[prop] || 0));
|
|
|
+ let all = values.length !== 0 ? sums[index] = values.reduce((a, b) => {
|
|
|
+ return a + b;
|
|
|
+ }) : 0
|
|
|
+ if (prop == 'currentAmountCNY' || prop == 'currentAmountUSD') {
|
|
|
+ sums[index] = all
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
+ handleClick(val) {
|
|
|
+ if (this.activeName == 'query') {
|
|
|
+ this.data = this.queryData
|
|
|
+ }
|
|
|
+ if (this.activeName == 'pick') {
|
|
|
+ this.data = this.pickData
|
|
|
+ }
|
|
|
+ },
|
|
|
+ allPick() {
|
|
|
+ if (this.selectionList.length == 0) {
|
|
|
+ return this.$message.error("请选择数据");
|
|
|
+ }
|
|
|
+ let list = this.deepClone(this.selectionList)
|
|
|
+ list.forEach((item, index) => {
|
|
|
+ this.$set(item, 'disabled', true)
|
|
|
+ this.pickData.push(item)
|
|
|
+ this.data = this.data.filter(row => row.accBillNo != item.accBillNo);
|
|
|
+ this.queryData = this.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ allCancel() {
|
|
|
+ this.pickData.forEach((item, index) => {
|
|
|
+ this.$set(item, 'disabled', false)
|
|
|
+ this.queryData.push(item)
|
|
|
+ this.data = this.data.filter(row => row.accBillNo != item.accBillNo);
|
|
|
+ this.pickData = this.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ pick(row, index) {
|
|
|
+ this.$set(row, 'disabled', true)
|
|
|
+ this.data.splice(index, 1)
|
|
|
+ // this.queryData.splice(index, 1)
|
|
|
+ this.pickData.push(row)
|
|
|
+ },
|
|
|
+ cancel(row, index) {
|
|
|
+ this.$set(row, 'disabled', false)
|
|
|
+ if (!this.queryData.find(item => item.accBillNo == row.accBillNo)) {
|
|
|
+ this.queryData.push(row)
|
|
|
+ }
|
|
|
+ this.pickData.splice(index, 1)
|
|
|
+ },
|
|
|
+ armbChange(row) {
|
|
|
+ if (row.dc == 'C') {
|
|
|
+ if (Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount) > 0) {
|
|
|
+ if (Number(row.currentAmountCNY) < 0) {
|
|
|
+ row.currentAmountCNY = 0
|
|
|
+ return this.$message.error("本次对账金额不能输入负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountCNY) > Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountCNY = 0
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount) < 0) {
|
|
|
+ if (Number(row.currentAmountCNY) >= 0) {
|
|
|
+ row.currentAmountCNY = Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能输入非负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountCNY) < Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountCNY = Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (row.dc == 'D') {
|
|
|
+ if (Number(row.amount - row.stlTtlAmount) > 0) {
|
|
|
+ if (Number(row.currentAmountCNY) < 0) {
|
|
|
+ row.currentAmountCNY = 0
|
|
|
+ return this.$message.error("本次对账金额不能输入负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountCNY) > Number(row.amount - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountCNY = 0
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Number(row.amount - row.stlTtlAmount) < 0) {
|
|
|
+ if (Number(row.currentAmountCNY) >= 0) {
|
|
|
+ row.currentAmountCNY = Number(row.amount - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能输入非负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountCNY) < Number(row.amount - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountCNY = Number(row.amount - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ausdChange(row) {
|
|
|
+ if (row.dc == 'C') {
|
|
|
+ if (Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount) > 0) {
|
|
|
+ if (Number(row.currentAmountUSD) < 0) {
|
|
|
+ row.currentAmountUSD = 0
|
|
|
+ return this.$message.error("本次对账金额不能输入负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountUSD) > Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountUSD = 0
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount) < 0) {
|
|
|
+ if (Number(row.currentAmountUSD) >= 0) {
|
|
|
+ row.currentAmountUSD = Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能输入非负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountUSD) < Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountUSD = Number(row.amount - (row.appliedAmount - row.appliedAmountStl) - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (row.dc == 'D') {
|
|
|
+ if (Number(row.amount - row.stlTtlAmount) > 0) {
|
|
|
+ if (Number(row.currentAmountUSD) < 0) {
|
|
|
+ row.currentAmountUSD = 0
|
|
|
+ return this.$message.error("本次对账金额不能输入负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountUSD) > Number(row.amount - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountUSD = 0
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (Number(row.amount - row.stlTtlAmount) < 0) {
|
|
|
+ if (Number(row.currentAmountUSD) >= 0) {
|
|
|
+ console.log(row.amount - row.stlTtlAmount)
|
|
|
+ row.currentAmountUSD = Number(row.amount - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能输入非负数");
|
|
|
+ }
|
|
|
+ if (Number(row.currentAmountUSD) < Number(row.amount - row.stlTtlAmount)) {
|
|
|
+ row.currentAmountUSD = Number(row.amount - row.stlTtlAmount)
|
|
|
+ return this.$message.error("本次对账金额不能超过未对账金额");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list
|
|
|
+ },
|
|
|
+ openDialog() {
|
|
|
+ this.data = []
|
|
|
+ this.queryData = []
|
|
|
+ this.pickData = []
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.activeName='query'
|
|
|
+ // this.query = this.deepClone(this.form)
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.query = {
|
|
|
+ mblno: this.form.mblno,
|
|
|
+ hblno: this.form.hblno,
|
|
|
+ dc: this.form.dc,
|
|
|
+ businessDateStart: this.form.businessDateStart,
|
|
|
+ businessDateEnd: this.form.businessDateEnd,
|
|
|
+ voyageNo: this.form.voyageNo,
|
|
|
+ vesselCnName: this.form.vesselCnName,
|
|
|
+ }
|
|
|
+ }, 200);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.finstlbillslistAccBillV1fun()
|
|
|
+ }, 200);
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.activeName = 'query'
|
|
|
+ this.finstlbillslistAccBillV1fun()
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ searchReset() {
|
|
|
+ this.query = {
|
|
|
+ mblno: null,
|
|
|
+ hblno: null,
|
|
|
+ dc: null,
|
|
|
+ businessDateStart: null,
|
|
|
+ businessDateEnd: null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 检索接口
|
|
|
+ finstlbillslistAccBillV1fun() {
|
|
|
+ let obj = {}
|
|
|
+ //开票日期
|
|
|
+ if (this.form.invoiceDate) {
|
|
|
+ obj.invoiceDate = this.form.invoiceDate.slice(0, 10) + ' 00:00:00'
|
|
|
+ }
|
|
|
+ // 业务日期
|
|
|
+ if (this.form.businessDateStart) {
|
|
|
+ obj.businessDateStart = this.form.businessDateStart.slice(0, 10) + ' 00:00:00'
|
|
|
+ }
|
|
|
+ if (this.form.businessDateEnd) {
|
|
|
+ obj.businessDateEnd = this.form.businessDateEnd.slice(0, 10) + ' 00:00:00'
|
|
|
+ }
|
|
|
+
|
|
|
+ obj.type = '3'
|
|
|
+ obj.branchId = this.form.branchId
|
|
|
+ obj.branchName = this.form.branchName
|
|
|
+ obj.billNo = this.form.bookingNo // 账单号
|
|
|
+ obj.businessBillNo = this.form.businessNo // 业务编号
|
|
|
+ obj.mblno = this.form.mblno // 主单编号
|
|
|
+ obj.hblno = this.form.hblno // 分单编号
|
|
|
+ obj.bookingNo = this.form.bookingNo // 订舱号(BOOK NO)
|
|
|
+ obj.curCode = this.form.curCode // 币种
|
|
|
+ obj.businessType = this.form.businessTypes ? this.form.businessTypes.join(',') : '' // 业务类型
|
|
|
+ obj.feeCnName = this.form.feeCnName ? this.form.feeCnName.join(',') : ''
|
|
|
+ obj.dc = this.form.dc
|
|
|
+ obj = { ...Object.assign(obj, this.query) }
|
|
|
+ // 判断是否有对账单号
|
|
|
+ if (this.form.checkNo) {
|
|
|
+ obj.corpId = this.form.corpId // 结算单位
|
|
|
+ obj.checkNo = this.form.checkNo // CHK NO 对账单号
|
|
|
+ // obj.dc='D'
|
|
|
+ finstlbillsGetByDetail(obj).then(res => {
|
|
|
+ let arr = res.data.data.finStlBillsItemsList.map((item, index) => {
|
|
|
+ item.lineNo = Number(index) + 1 // 行号
|
|
|
+ item.currentCurCode = item.curCode
|
|
|
+ item.currentExrate = item.exrate
|
|
|
+ if (item.currentCurCode == this.getLocalCurrency()) {
|
|
|
+ // 本次发票金额
|
|
|
+ item.currentAmountCNY = item.appliedInvoiceCurrentAmount
|
|
|
+ } else {
|
|
|
+ // 本次发票金额
|
|
|
+ item.currentAmountUSD = item.appliedInvoiceCurrentAmount
|
|
|
+ }
|
|
|
+ delete item.id
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ const itemsWithId = this.data.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ finstlbillsitemsRemove(arrIds.join(',')).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (arr.length == 0) {
|
|
|
+ this.$message.warning('当前检索暂无数据!')
|
|
|
+ }
|
|
|
+ this.queryData = arr
|
|
|
+ this.data = arr
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ obj.billNo = this.form.businessNo // 业务编号
|
|
|
+ obj.corpCnName = this.form.corpId // 结算单位
|
|
|
+ obj.checkBillNo = this.form.checkNo // 对账单号
|
|
|
+ // obj.dc='D'
|
|
|
+ finstlbillslistAccBillV1(obj).then(res => {
|
|
|
+ let arr = res.data.data.map((item, index) => {
|
|
|
+ console.log(item)
|
|
|
+ item.lineNo = Number(index) + 1 // 行号
|
|
|
+ item.accBillId = item.id
|
|
|
+ item.accBillNo = item.billNo
|
|
|
+ item.billNo = item.businessBillNo
|
|
|
+ item.accDate = item.createTime
|
|
|
+ item.currentCurCode = item.curCode
|
|
|
+ item.currentExrate = item.exrate
|
|
|
+ item.dc = item.accountDc
|
|
|
+ if (item.currentCurCode == this.getLocalCurrency()) {
|
|
|
+ // 本次发票金额
|
|
|
+ item.currentAmountCNY = item.appliedInvoiceCurrentAmount
|
|
|
+ } else {
|
|
|
+ // 本次发票金额
|
|
|
+ item.currentAmountUSD = item.appliedInvoiceCurrentAmount
|
|
|
+ }
|
|
|
+ delete item.id
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ const itemsWithId = this.data.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ fininvoicesitemsRemove(arrIds.join(',')).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (arr.length == 0) {
|
|
|
+ this.$message.warning('当前检索暂无数据!')
|
|
|
+ }
|
|
|
+ this.queryData = arr
|
|
|
+ this.data = arr
|
|
|
+ }).finally(() => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //debounce为了防止重复点
|
|
|
+ submit: _.debounce(function () {
|
|
|
+ if (this.pickData.length == 0) {
|
|
|
+ return this.$message.error('请选择数据')
|
|
|
+ }
|
|
|
+ this.$emit('importData', this.pickData)
|
|
|
+ this.dialogVisible = false
|
|
|
+ }, 300, {
|
|
|
+ 'leading': true,
|
|
|
+ 'trailing': false
|
|
|
+ }),
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumn(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ this.searchReset()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumn(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 更改表格颜色
|
|
|
+ headerClassName(tab) {
|
|
|
+ //颜色间隔
|
|
|
+ let back = ""
|
|
|
+ if (tab.columnIndex >= 0 && tab.column.level === 1) {
|
|
|
+ if (tab.columnIndex % 2 === 0) {
|
|
|
+ back = "back-one"
|
|
|
+ } else if (tab.columnIndex % 2 === 1) {
|
|
|
+ back = "back-two"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return back;
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ data: {
|
|
|
+ handler(val) {
|
|
|
+ val.forEach(row => {
|
|
|
+ if (this.tableData.some(item => item.accBillNo == row.accBillNo)) {
|
|
|
+ row.disabled = true
|
|
|
+ }
|
|
|
+ if (this.pickData.some(item => item.accBillNo == row.accBillNo)) {
|
|
|
+ row.disabled = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ pickData: {
|
|
|
+ handler(val) {
|
|
|
+ this.amountSubSum = 0
|
|
|
+ this.amountSubUsdSum = 0
|
|
|
+ let CSUMRMB = 0
|
|
|
+ let CSUMUSD = 0
|
|
|
+ let DSUMRMB = 0
|
|
|
+ let DSUMUSD = 0
|
|
|
+ val.forEach(e => {
|
|
|
+ if (e.dc == 'C') {
|
|
|
+ CSUMRMB += Number(e.currentAmountCNY ? e.currentAmountCNY : 0)
|
|
|
+ CSUMUSD += Number(e.currentAmountUSD ? e.currentAmountUSD : 0)
|
|
|
+ }
|
|
|
+ if (e.dc == 'D') {
|
|
|
+ DSUMRMB += Number(e.currentAmountCNY ? e.currentAmountCNY : 0)
|
|
|
+ DSUMUSD += Number(e.currentAmountUSD ? e.currentAmountUSD : 0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.amountSubSum = Number(CSUMRMB - DSUMRMB).toFixed(2)
|
|
|
+ this.amountSubUsdSum = Number(CSUMUSD - DSUMUSD).toFixed(2)
|
|
|
+
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+::v-deep#out-table .back-one {
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+ padding: 4px 0;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep#out-table .back-two {
|
|
|
+ background: #ecf5ff !important;
|
|
|
+ text-align: center;
|
|
|
+ padding: 4px 0;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-col-md-8 {
|
|
|
+ width: 24.33333%;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ padding: 6px 20px !important;
|
|
|
+}
|
|
|
+</style>
|