Browse Source

贸易代理 购汇付汇

Qukatie 1 year ago
parent
commit
0348f40367

+ 1 - 0
public/MP_verify_R8LYsujgTdxHH0wM.txt

@@ -0,0 +1 @@
+R8LYsujgTdxHH0wM

+ 20 - 0
src/api/dicSelect/index.js

@@ -0,0 +1,20 @@
+import request from '@/router/axios';
+
+
+//获取公共下拉数据接口
+export function getDicinit(method, url, data) {
+    if (method == 'get' || method == 'GET') {
+        return request({
+            url: '/api' + url,
+            method: method,
+            params: data
+        })
+    } else {
+        return request({
+            url: '/api' + url,
+            method: method,
+            data: data
+        })
+    }
+
+}

+ 154 - 0
src/api/tradeAgency/exchangePurchasing.js

@@ -0,0 +1,154 @@
+import request from '@/router/axios';
+//贸易代理列表
+export const getList = (current, size, params) => {
+    return request({
+        url: '/api/blade-los/agent/list',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size
+        }
+    })
+}
+//贸易代理明细
+export const getDetail = (data) => {
+    return request({
+        url: '/api/blade-los/agent/detail',
+        method: 'get',
+        params: data
+    })
+}
+
+//贸易代理保存
+export const submit = (data) => {
+    return request({
+        url: '/api/blade-los/agent/submit',
+        method: 'post',
+        data: data
+    })
+}
+//生成首付款费用应收
+export const generateDownPaymentBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/generateDownPaymentBill',
+        method: 'post',
+        data: data
+    })
+}
+//生成尾款费用应收
+export const generateBalancePaymentBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/generateBalancePaymentBill',
+        method: 'post',
+        data: data
+    })
+}
+//申请付款
+export const ApplyForPayment = (data) => {
+    return request({
+        url: '/api/blade-los/agent/ApplyForPayment',
+        method: 'post',
+        data: data
+    })
+}
+//撤销申请付款
+export const revokeApplyForPayment = (data) => {
+    return request({
+        url: '/api/blade-los/agent/revokeApplyForPayment',
+        method: 'post',
+        data: data
+    })
+}
+//贸易代理删除
+export const remove = (data) => {
+    return request({
+        url: '/api/blade-los/agent/remove',
+        method: 'post',
+        params: data
+    })
+}
+//单据请核
+export const checkAgent = (data) => {
+    return request({
+        url: '/api/blade-los/agent/checkAgent',
+        method: 'post',
+        data: data
+    })
+}
+//撤销单据请核
+export const revokeCheckAgent = (data) => {
+    return request({
+        url: '/api/blade-los/agent/revokeCheckAgent',
+        method: 'post',
+        data: data
+    })
+}
+//单据复制
+export const copyAgent = (data) => {
+    return request({
+        url: '/api/blade-los/agent/copyAgent',
+        method: 'get',
+        params: data
+    })
+}
+//贸易代理明细保存-批量
+export const submitListTrade = (data) => {
+    return request({
+        url: '/api/blade-los/feecenter/submitListTrade',
+        method: 'post',
+        data: data
+    })
+}
+
+//贸易代理费用明细删除
+export const feeRemove = (data) => {
+    return request({
+        url: '/api/blade-los/feecenter/remove',
+        method: 'post',
+        params: data
+    })
+}
+
+//生成账单
+export const generateBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/generateBill',
+        method: 'post',
+        data: data
+    })
+}
+//撤销账单
+export const revokeBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/revokeBill',
+        method: 'post',
+        data: data
+    })
+}
+
+
+//确认收款首款/尾款
+export const confirmCollectionOfPayments = (data) => {
+    return request({
+        url: '/api/blade-los/agent/confirmCollectionOfPayments',
+        method: 'post',
+        data: data
+    })
+}
+//确认付款首款/尾款
+export const confirmThePayment = (data) => {
+    return request({
+        url: '/api/blade-los/agent/confirmThePayment',
+        method: 'post',
+        data: data
+    })
+}
+//确认付款-是否实收已收
+export const confirmReceived = (data) => {
+    return request({
+        url: '/api/blade-los/agent/confirmReceived',
+        method: 'post',
+        data: data
+    })
+}

+ 136 - 0
src/api/tradeAgency/tradeAgency.js

@@ -0,0 +1,136 @@
+import request from '@/router/axios';
+//贸易代理列表
+export const getList = (current, size, params) => {
+    return request({
+        url: '/api/blade-los/agentview/list',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size
+        }
+    })
+}
+//贸易代理明细
+export const getDetail = (data) => {
+    return request({
+        url: '/api/blade-los/agent/detail',
+        method: 'get',
+        params: data
+    })
+}
+
+//贸易代理保存
+export const submit = (data) => {
+    return request({
+        url: '/api/blade-los/agent/submit',
+        method: 'post',
+        data: data
+    })
+}
+//生成首付款费用应收
+export const generateDownPaymentBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/generateDownPaymentBill',
+        method: 'post',
+        data: data
+    })
+}
+//生成尾款费用应收
+export const generateBalancePaymentBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/generateBalancePaymentBill',
+        method: 'post',
+        data: data
+    })
+}
+//申请付款
+export const ApplyForPayment = (data) => {
+    return request({
+        url: '/api/blade-los/agent/ApplyForPayment',
+        method: 'post',
+        data: data
+    })
+}
+//撤销申请付款
+export const revokeApplyForPayment = (data) => {
+    return request({
+        url: '/api/blade-los/agent/revokeApplyForPayment',
+        method: 'post',
+        data: data
+    })
+}
+//贸易代理删除
+export const remove = (data) => {
+    return request({
+        url: '/api/blade-los/agent/remove',
+        method: 'post',
+        params: data
+    })
+}
+//单据请核
+export const checkAgent = (data) => {
+    return request({
+        url: '/api/blade-los/agent/checkAgent',
+        method: 'post',
+        data: data
+    })
+}
+//撤销单据请核
+export const revokeCheckAgent = (data) => {
+    return request({
+        url: '/api/blade-los/agent/revokeCheckAgent',
+        method: 'post',
+        data: data
+    })
+}
+//单据复制
+export const copyAgent = (data) => {
+    return request({
+        url: '/api/blade-los/agent/copyAgent',
+        method: 'get',
+        params: data
+    })
+}
+//贸易代理明细保存-批量
+export const submitListTrade = (data) => {
+    return request({
+        url: '/api/blade-los/feecenter/submitListTrade',
+        method: 'post',
+        data: data
+    })
+}
+
+//贸易代理费用明细删除
+export const feeRemove = (data) => {
+    return request({
+        url: '/api/blade-los/feecenter/remove',
+        method: 'post',
+        params: data
+    })
+}
+
+//生成账单
+export const generateBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/generateBill',
+        method: 'post',
+        data: data
+    })
+}
+//撤销账单
+export const revokeBill = (data) => {
+    return request({
+        url: '/api/blade-los/agent/revokeBill',
+        method: 'post',
+        data: data
+    })
+}
+//首款/尾款应收待确认通知
+export const confirmationNotification = (data) => {
+    return request({
+        url: '/api/blade-los/agent/confirmationNotification',
+        method: 'post',
+        data: data
+    })
+}

+ 147 - 0
src/components/dicSelect/main.vue

@@ -0,0 +1,147 @@
+<template>
+    <!-- 中文下拉 -->
+    <el-select v-model="value" @input="$emit('selectedValue', value)" :placeholder="'请输入 ' + placeholder"
+        @change="selectChange" @clear="clear" :clearable="clearable" :multiple="multiple" :filterable="filterable"
+        :remote="remote" :remote-method="remoteMethod" :loading="loading" :size="size" :disabled="disabled">
+        <el-option v-for="item in options" :key="item[key]" :label="item[label]" :value="item[label]">
+        </el-option>
+    </el-select>
+</template>
+
+<script>
+import { getDicinit } from "@/api/dicSelect/index";
+export default {
+    data() {
+        return {
+            options: [],
+            loading: false,
+            data: {}
+        }
+    },
+    props: {
+        activateCreated: {
+            type: Boolean,
+            default: true
+        },
+        key: {
+            type: Number,
+            default: 0
+        },
+        label: {
+            type: String,
+            default: ''
+        },
+        res: {
+            type: String,
+            default: ''
+        },
+        placeholder: {
+            type: String,
+            default: '请输入'
+        },
+        clearable: {
+            type: Boolean,
+            default: true
+        },
+        value: {
+            type: [String, Number],
+            default: ''
+        },
+        method: {
+            type: String,
+            default: 'GET'
+        },
+        url: {
+            type: String,
+            default: ''
+        },
+        dataName: {
+            type: String,
+            default: ''
+        },
+        multiple: {
+            type: Boolean,
+            default: false
+        },
+        filterable: {
+            type: Boolean,
+            default: false
+        },
+        remote: {
+            type: Boolean,
+            default: false
+        },
+        size: {
+            type: String,
+            default: 'small'
+        },
+        disabled: {
+            type: Boolean,
+            default: false
+        },
+    },
+    model: {
+        prop: "value",
+        event: "selectedValue"
+    },
+    created() {
+        if (this.activateCreated) {
+            this.getDicData()
+        }
+    },
+    methods: {
+        remoteMethod(query) {
+            if (query !== '') {
+                setTimeout(() => {
+                    this.data[this.dataName] = query
+                    this.getDicData()
+                }, 200);
+            } else {
+                setTimeout(() => {
+                    this.data = this.$options.data().data
+                    this.getDicData()
+                }, 200);
+            }
+        },
+        getDicData() {
+            this.loading = true
+            getDicinit(this.method, this.url, this.data).then(res => {
+                if (this.res) {
+                    this.options = res.data.data[this.res]
+                } else {
+                    this.options = res.data.data
+                }
+            }).finally(() => {
+                this.loading = false;
+            })
+        },
+        IdGetDicData(data) {
+            this.loading = true
+            getDicinit(this.method, this.url, data).then(res => {
+                if (this.res) {
+                    this.options = res.data.data[this.res]
+                } else {
+                    this.options = res.data.data
+                }
+            }).finally(() => {
+                this.loading = false;
+            })
+        },
+        selectChange(row) {
+            this.options.forEach(e => {
+                if (row == e[this.label]) {
+                    this.$emit('selectChange', e)
+                }
+            })
+        },
+        clear() {
+            if (this.remote) {
+                this.getDicData()
+            }
+            this.$emit('selectChange', null)
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 1 - 1
src/components/fee-info-at/config/feeInfo.json

@@ -22,7 +22,7 @@
   "column": [
     {
         "label": "结算单位",
-        "prop": "corpId",
+        "prop": "corpName",
         "index": 1,
         "overHidden": true,
         "width": 220

+ 62 - 68
src/components/fee-info-at/main.vue

@@ -12,11 +12,8 @@
           </el-tabs>
           <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="rowAdd" :loading="buttonLoading"
             :disabled="disabled">录入明细</el-button>
-          <!--<el-button type="warning" size="small" @click.stop="billingDetails('收费')" :loading="buttonLoading" :disabled="-->
-          <!--  (financeDisabled && disabled) || selectionList.length == 0-->
-          <!--" v-if="selectTab === 1&&billingShow">生成账单</el-button>-->
-          <el-button type="warning" size="small" @click.stop="billingDetails('申请')" :loading="buttonLoading" :disabled="(financeDisabled && disabled) || selectionList.length == 0
-            " v-if="selectTab === 2 && billingShow">申请付费</el-button>
+          <!-- <el-button type="warning" size="small" @click.stop="billingDetails('申请')" :loading="buttonLoading" :disabled="(financeDisabled && disabled) || selectionList.length == 0
+            " v-if="selectTab === 2 && billingShow">申请付费</el-button> -->
         </template>
         <template slot="menu" slot-scope="{ row, index }">
           <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)" :disabled="disabled">{{
@@ -29,9 +26,12 @@
           <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow" :disabled="disabled" circle>
           </el-button>
         </template>
-        <template slot="corpId" slot-scope="{ row, index }">
-          <crop-select ref="corp" v-if="row.$cellEdit" v-model="row.corpId" :cropIndex="index" @getCorpData="getCorpData"
-            corpType="KG"></crop-select>
+        <template slot="corpName" slot-scope="{ row, index }">
+          <!-- <crop-select ref="corp" v-if="row.$cellEdit" v-model="row.corpId" :cropIndex="index" @getCorpData="getCorpData"
+            corpType="KG"></crop-select> -->
+          <dic-select v-if="row.$cellEdit" v-model="row.corpName" placeholder="客户" key="id" label="cnName" res="records"
+            url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
+            @selectChange="dicChange('corpName', $event)"></dic-select>
           <span v-else>{{ row.corpName }}</span>
         </template>
         <template slot="feeName" slot-scope="{ row }">
@@ -50,29 +50,24 @@
         </template>
         <template slot="price" slot-scope="{ row,index }">
           <el-input-number v-if="row.$cellEdit" v-model="row.price" placeholder="请输入" size="small" :controls="false"
-            :precision="2" @input="countChange(row)" style="width: 100%"
-            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
+            :precision="2" @input="countChange(row)" style="width: 100%" :min="0"></el-input-number>
           <span v-else>{{ row.price | micrometerFormat2 }}</span>
         </template>
         <template slot="quantity" slot-scope="{ row }">
           <el-input-number v-if="row.$cellEdit && !isDecimal" v-model="row.quantity" size="small" placeholder="请输入"
-            :controls="false" :precision="0" @input="countChange(row)" style="width: 100%"
-            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
+            :controls="false" :precision="0" @input="countChange(row)" style="width: 100%" :min="0"></el-input-number>
           <el-input-number v-if="row.$cellEdit && isDecimal" v-model="row.quantity" size="small" placeholder="请输入"
-            :controls="false" :precision="6" @input="countChange(row)" style="width: 100%"
-            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
+            :controls="false" :precision="6" @input="countChange(row)" style="width: 100%" :min="0"></el-input-number>
           <span v-else>{{ row.quantity | decimalFormat2 }}</span>
         </template>
         <template slot="amount" slot-scope="{ row }">
           <el-input-number v-if="row.$cellEdit" v-model="row.amount" size="small" placeholder="请输入" :controls="false"
-            :precision="2" @input="countChange(row)" style="width: 100%"
-            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
+            :precision="2" @input="countChange(row)" style="width: 100%" :min="0"></el-input-number>
           <span v-else>{{ row.amount | micrometerFormat2 }}</span>
         </template>
         <template slot="exchangeRate" slot-scope="{ row }">
           <el-input-number v-if="row.$cellEdit" v-model="row.exchangeRate" size="small" :controls="false" :precision="6"
-            @change="rateChange(row)" style="width: 100%" placeholder="请输入"
-            :min="paramValue == 0 ? 0 : '-Infinity'"></el-input-number>
+            @change="rateChange(row)" style="width: 100%" placeholder="请输入" :min="0"></el-input-number>
           <span v-else>{{ row.exchangeRate }}</span>
         </template>
         <template slot="currency" slot-scope="{ row }">
@@ -148,6 +143,7 @@ import { allCropList, paramserviceDetail } from "@/api/basicData/customerInforma
 import { getCustomerCode, getCustomerName } from "@/enums/management-type";
 import { getParities } from "@/api/basicData/customerInquiry";
 import { dateFormat } from "@/util/date";
+import dicSelect from "@/components/dicSelect/main";
 export default {
   name: "feeInfo",
   data() {
@@ -233,7 +229,6 @@ export default {
       tab2: false,
       corpList: [],
       invoiceData: [],
-      paramValue: 1,
     };
   },
   props: {
@@ -265,6 +260,9 @@ export default {
     corpId: {
       type: String
     },
+    form: {
+      type: Object
+    },
     billNoList: {
       type: Array
     },
@@ -335,17 +333,11 @@ export default {
     }).then(res => {
       this.corpList = res.data.data;
     });
-    if (localStorage.getItem("roleName") == "贸易") {
-      this.findObject(this.feeOption.column, "corpId").hide = true;
-      this.findObject(this.feeOption.column, "corpId").showColumn = false;
-    }
-    paramserviceDetail({ paramKey: 'COST_TF_NEG' }).then(res => {
-      this.paramValue = res.data.data.paramValue
-    });
   },
   components: {
     cropDialog,
-    ApplyPayment
+    ApplyPayment,
+    dicSelect
   },
   watch: {
     disabled: function () {
@@ -444,19 +436,7 @@ export default {
     selectValue(value, row) {
       this.$set(row, "feeName", value.cname);
       this.$set(row, "ename", value.ename);
-      if (this.optionType == "GN") {
-        if (!row.currency) {
-          getParities({
-            currency: "CNY",
-            businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
-          }).then(res => {
-            const data = res.data.data;
-            row.exchangeRate = data.receivableParities;
-          });
-        }
-      } else {
-        this.currencyChange(row);
-      }
+      this.currencyChange(row);
     },
     cellStyle() {
       return "padding:0;height:40px;";
@@ -533,6 +513,15 @@ export default {
       this.$set(this.feeData[row.index], 'corpName', row.cname)
       this.$set(this.feeData[row.index], 'corpId', row.id)
     },
+    dicChange(name, row,el) {
+      if (name == 'corpName') {
+        if (row) {
+          el.corpId = row.id
+        } else {
+          el.corpId = null
+        }
+      }
+    },
     countChange(row) {
       if (row.price && row.quantity) {
         row.amount = _.multiply(row.quantity, row.price).toFixed(2);
@@ -579,32 +568,37 @@ export default {
     },
     //新增
     rowAdd() {
-      if (!this.corpId) return this.$message.error("请选择往来单位");
-      let corpName = this.corpList.find(item => this.corpId == item.id).cname;
-      const params = {
-        feesType: this.selectTab,
-        corpId: this.corpId,
-        corpName: corpName
-      };
-      if (this.optionType == "GN") {
-        getParities({
-          currency: "CNY",
-          businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
-        }).then(res => {
-          const data = res.data.data;
-          params.exchangeRate = data.receivableParities;
-          this.$refs.feeCrud.rowCellAdd(params);
-        });
-      } else if (this.optionType == "JK") {
-        getParities({
-          currency: "USD",
-          businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
-        }).then(res => {
-          const data = res.data.data;
-          params.exchangeRate = data.receivableParities;
-          this.$refs.feeCrud.rowCellAdd(params);
-        });
-      }
+      console.log(this.form)
+      if (!this.form.corpName) return this.$message.error("请选择客户");
+      this.$refs.feeCrud.rowCellAdd({
+        corpName:this.form.corpName,
+        corpId:this.form.corpName.corpId,
+      });
+      // let corpName = this.corpList.find(item => this.corpId == item.id).cname;
+      // const params = {
+      //   feesType: this.selectTab,
+      //   corpId: this.corpId,
+      //   corpName: corpName
+      // };
+      // if (this.optionType == "GN") {
+      //   getParities({
+      //     currency: "CNY",
+      //     businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
+      //   }).then(res => {
+      //     const data = res.data.data;
+      //     params.exchangeRate = data.receivableParities;
+      //     this.$refs.feeCrud.rowCellAdd(params);
+      //   });
+      // } else if (this.optionType == "JK") {
+      //   getParities({
+      //     currency: "USD",
+      //     businesDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
+      //   }).then(res => {
+      //     const data = res.data.data;
+      //     params.exchangeRate = data.receivableParities;
+      //     this.$refs.feeCrud.rowCellAdd(params);
+      //   });
+      // }
     },
     addRow() {
       this.rowAdd();
@@ -646,7 +640,6 @@ export default {
       this.reData = null;
     },
     importData() {
-      console.log(123213);
       if (this.reData) {
         this.selectionList.length;
         if (this.selectionList.length != 1) {
@@ -847,4 +840,5 @@ export default {
   color: #f56c6c;
   display: inline-block;
   width: 7%;
-}</style>
+}
+</style>

+ 763 - 0
src/components/tradeAgency/fee-info.vue

@@ -0,0 +1,763 @@
+<template>
+    <div>
+        <avue-crud :option="optionD" :table-loading="loading" :data="form.feeCenterListD" id="out-table" ref="crudD"
+            @selection-change="selectionDChange" @resetColumn="resetColumn('crudD', 'optionD', 'optionDBack', 381)"
+            @saveColumn="saveColumn('crudD', 'optionD', 'optionDBack', 381)">
+            <template slot="menuLeft">
+                <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
+                    <i class="el-icon-coin"></i>
+                    <span>应收费用</span>
+                </div>
+                <el-button type="info" plain size="small" :disabled="disabled"
+                    @click="allClick('一键保存', 'D')">一键保存</el-button>
+                <el-button type="info" plain size="small" :disabled="disabled"
+                    @click="allClick('一键编辑', 'D')">一键编辑</el-button>
+                <el-button type="danger" plain size="small" :disabled="disabled || selectionDList.length == 0"
+                    @click="allClick('批量删除', 'D')">批量删除</el-button>
+                <el-button type="primary" plain size="small" :disabled="disabled || selectionDList.length == 0"
+                    @click="allClick('生成账单', 'D')">生成账单</el-button>
+                <el-button type="danger" plain size="small" :disabled="disabled || selectionDList.length == 0"
+                    @click="allClick('撤销账单', 'D')">撤销账单</el-button>
+                <!-- <el-button type="primary" plain size="small" :disabled="disabled"
+                    @click="allClick('打印账单', 'D')">打印账单</el-button>
+                <el-button type="success" plain size="small" :disabled="disabled"
+                    @click="allClick('应收模板', 'D')">应收模板</el-button>
+                <el-button type="primary" plain size="small" :disabled="disabled"
+                    @click="allClick('生成应收', 'D')">生成应收</el-button> -->
+            </template>
+            <template slot="indexHeader" slot-scope="{row,index}">
+                <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('D')">
+                </el-button>
+            </template>
+            <template slot="index" slot-scope="{row,index}">
+                <span>{{ index + 1 }}</span>
+            </template>
+            <template slot="corpCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
+                    res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.corpCnName }}</span>
+            </template>
+            <template slot="feeCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
+                    res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.feeCnName }}</span>
+            </template>
+            <template slot="unitNo" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
+                    url="/blade-los/bunits/selectList" :filterable="true"
+                    @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
+                <span v-else>{{ row.unitNo }}</span>
+            </template>
+            <tempalte slot="quantity" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.quantity }}</span>
+            </tempalte>
+            <tempalte slot="price" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.price }}</span>
+            </tempalte>
+            <template slot="curCode" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
+                    :url="'/blade-los/bcurrency/getExrate?date=' + form.contractDate + '&dc=' + row.dc" :filterable="true"
+                    @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                <span v-else>{{ row.curCode }}</span>
+            </template>
+            <tempalte slot="exrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.exrate }}</span>
+            </tempalte>
+            <tempalte slot="stlExrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 结算汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.stlExrate }}</span>
+            </tempalte>
+        </avue-crud>
+        <avue-crud style="margin-top: 10px;" :option="optionC" :table-loading="loading" :data="form.feeCenterListC"
+            id="out-table" ref="crudC" @selection-change="selectionCChange"
+            @resetColumn="resetColumn('crudC', 'optionC', 'optionCBack', 382)"
+            @saveColumn="saveColumn('crudC', 'optionC', 'optionCBack', 382)">
+            <template slot="menuLeft">
+                <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
+                    <i class="el-icon-coin"></i>
+                    <span>应付费用</span>
+                </div>
+                <el-button type="info" plain size="small" :disabled="disabled"
+                    @click="allClick('一键保存', 'C')">一键保存</el-button>
+                <el-button type="info" plain size="small" :disabled="disabled"
+                    @click="allClick('一键编辑', 'C')">一键编辑</el-button>
+                <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
+                    @click="allClick('批量删除', 'C')">批量删除</el-button>
+                <el-button type="primary" plain size="small" :disabled="disabled || selectionCList.length == 0"
+                    @click="allClick('生成账单', 'C')">生成账单</el-button>
+                <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
+                    @click="allClick('撤销账单', 'C')">撤销账单</el-button>
+                <!-- <el-button type="primary" plain size="small" :disabled="disabled"
+                    @click="allClick('打印账单', 'C')">打印账单</el-button>
+                <el-button type="success" plain size="small" :disabled="disabled"
+                    @click="allClick('应付模板', 'C')">应付模板</el-button>
+                <el-button type="primary" plain size="small" :disabled="disabled"
+                    @click="allClick('生成应付', 'C')">生成应付</el-button> -->
+            </template>
+            <template slot="indexHeader" slot-scope="{row,index}">
+                <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('C')">
+                </el-button>
+            </template>
+            <template slot="index" slot-scope="{row,index}">
+                <span>{{ index + 1 }}</span>
+            </template>
+            <template slot="corpCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
+                    res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.corpCnName }}</span>
+            </template>
+            <template slot="feeCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
+                    res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.feeCnName }}</span>
+            </template>
+            <template slot="unitNo" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
+                    url="/blade-los/bunits/selectList" :filterable="true"
+                    @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
+                <span v-else>{{ row.unitNo }}</span>
+            </template>
+            <tempalte slot="quantity" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.quantity }}</span>
+            </tempalte>
+            <tempalte slot="price" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.price }}</span>
+            </tempalte>
+            <template slot="curCode" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
+                    :url="'/blade-los/bcurrency/getExrate?date=' + form.contractDate + '&dc=' + row.dc" :filterable="true"
+                    @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                <span v-else>{{ row.curCode }}</span>
+            </template>
+            <tempalte slot="exrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.exrate }}</span>
+            </tempalte>
+            <tempalte slot="stlExrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 结算汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.stlExrate }}</span>
+            </tempalte>
+        </avue-crud>
+    </div>
+</template>
+
+<script>
+import dicSelect from "@/components/dicSelect/main";
+import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
+import { submitListTrade, feeRemove, generateBill, revokeBill } from "@/api/tradeAgency/tradeAgency";
+import _ from "lodash";
+export default {
+    components: {
+        dicSelect
+    },
+    props: {
+        detailData: {},
+        disabled: {
+            type: Boolean,
+            default: false,
+        },
+        form: {
+            type: Object,
+            default: () => {
+            }
+        }
+    },
+    data() {
+        return {
+            optionD: {},
+            optionDBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 140,
+                tip: false,
+                border: true,
+                addBtn: false,
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menu: false,
+                refreshBtn: false,
+                selection: true,
+                align: 'center',
+                column: [
+                    {
+                        label: "index",
+                        prop: "index",
+                        width: "55",
+                        headerslot: true,
+                    },
+                    {
+                        label: "账单",
+                        prop: "accStatus",
+                        width: '80',
+                        overHidden: true,
+                        dicData: [{
+                            label: '否',
+                            value: 0
+                        }, {
+                            label: '是',
+                            value: 1
+                        }]
+                    },
+                    {
+                        label: "往来单位",
+                        prop: "corpCnName",
+                        width: '160',
+                        overHidden: true,
+                    },
+                    {
+                        label: "费用名称",
+                        prop: "feeCnName",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "收费标准",
+                        prop: "unitNo",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "单价",
+                        prop: "price",
+                        overHidden: true,
+                    },
+                    {
+                        label: "数量",
+                        prop: "quantity",
+                        overHidden: true,
+                    },
+                    {
+                        label: "金额",
+                        prop: "amount",
+                        overHidden: true,
+                    },
+                    {
+                        label: "币别",
+                        prop: "curCode",
+                        overHidden: true,
+                    },
+                    {
+                        label: "外币金额",
+                        prop: "amountLoc",
+                        overHidden: true,
+                    },
+                    {
+                        label: "汇率",
+                        prop: "exrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "结算汇率",
+                        prop: "stlExrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        cell: true,
+                        width: '200',
+                        overHidden: true,
+                    },
+                ]
+            },
+            optionC: {},
+            optionCBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 140,
+                tip: false,
+                border: true,
+                addBtn: false,
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menu: false,
+                refreshBtn: false,
+                selection: true,
+                align: 'center',
+                column: [
+                    {
+                        label: "index",
+                        prop: "index",
+                        width: "55",
+                        headerslot: true,
+                    },
+                    {
+                        label: "账单",
+                        prop: "accStatus",
+                        width: '80',
+                        overHidden: true,
+                        dicData: [{
+                            label: '否',
+                            value: 0
+                        }, {
+                            label: '是',
+                            value: 1
+                        }]
+                    },
+                    {
+                        label: "往来单位",
+                        prop: "corpCnName",
+                        width: '160',
+                        overHidden: true,
+                    },
+                    {
+                        label: "费用名称",
+                        prop: "feeCnName",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "收费标准",
+                        prop: "unitNo",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "单价",
+                        prop: "price",
+                        overHidden: true,
+                    },
+                    {
+                        label: "数量",
+                        prop: "quantity",
+                        overHidden: true,
+                    },
+                    {
+                        label: "金额",
+                        prop: "amount",
+                        overHidden: true,
+                    },
+                    {
+                        label: "币别",
+                        prop: "curCode",
+                        overHidden: true,
+                    },
+                    {
+                        label: "外币金额",
+                        prop: "amountLoc",
+                        overHidden: true,
+                    },
+                    {
+                        label: "汇率",
+                        prop: "exrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "结算汇率",
+                        prop: "stlExrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        cell: true,
+                        width: '200',
+                        overHidden: true,
+                    },
+                ]
+            },
+            selectionDList: [],
+            selectionCList: []
+
+        }
+    },
+    async created() {
+        this.optionD = await this.getColumnData(this.getColumnName(381), this.optionDBack);
+        this.optionC = await this.getColumnData(this.getColumnName(382), this.optionCBack);
+    },
+    methods: {
+        addRow(type) {
+            if (!this.form.id) return this.$message.error('请保存数据');
+            if (type == 'D') {
+                this.form.feeCenterListD.push({
+                    $cellEdit: true,
+                    pid: this.form.id,
+                    dc: type,
+                    accStatus: 0,
+                    businessType: 'MYDL',
+                    billNo: this.form.businessNo,
+                    billDate: this.form.businessDate
+                })
+            }
+            if (type == 'C') {
+                this.form.feeCenterListC.push({
+                    $cellEdit: true,
+                    pid: this.form.id,
+                    dc: type,
+                    accStatus: 0,
+                    businessType: 'MYDL',
+                    billNo: this.form.businessNo,
+                    billDate: this.form.businessDate
+                })
+            }
+        },
+        countChange(row) {
+            row.amount = _.multiply(Number(row.quantity ? row.quantity : 0), Number(row.price ? row.price : 0))
+            if (row.feeCnName == '首付款' || row.feeCnName == '尾款') {
+                row.amount = _.multiply(Number(row.amountLoc ? row.amountLoc : 0), Number(row.exrate ? row.exrate : 0))
+            }
+        },
+        selectionDChange(list) {
+            this.selectionDList = list
+        },
+        selectionCChange(list) {
+            this.selectionCList = list
+        },
+        rowDicChange(name, row, el) {
+            if (name == 'corpCnName') {
+                if (row) {
+                    el.corpId = row.id
+                    el.corpEnName = row.enName
+                    el.billCorpId = row.id
+                    el.billCorpCnName = row.cnName
+                } else {
+                    el.corpId = null
+                    el.corpEnName = null
+                    el.billCorpId = null
+                    el.billCorpCnName = null
+                }
+            }
+            if (name == 'feeCnName') {
+                if (row) {
+                    el.feeId = row.id
+                    el.feeCode = row.code
+                    el.feeEnName = row.enName
+                    el.curCode = row.curNo
+                    bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
+                        res.data.data.forEach(e => {
+                            if (row.curNo == e.code) {
+                                this.$set(el, 'exrate', e.exrate)
+                            }
+                        })
+                    })
+                } else {
+                    el.feeId = null
+                    el.feeCode = null
+                    el.feeEnName = null
+                    el.curCode = null
+                }
+            }
+            if (name == 'curCode') {
+                if (row) {
+                    bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
+                        res.data.data.forEach(e => {
+                            if (el.curCode == e.code) {
+                                this.$set(el, 'exrate', e.exrate)
+                            }
+                        })
+                    })
+                } else {
+                    el.exrate = null
+                }
+            }
+        },
+        allClick(name, type) {
+            if (name == '一键保存') {
+                if (type == 'D') {
+                    this.form.feeCenterListD.forEach(e => {
+                        this.$set(e, '$cellEdit', false)
+                    })
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    submitListTrade(this.form.feeCenterListD).then(res => {
+                        this.form.feeCenterListD = res.data.data
+                        this.$message.success("保存成功");
+                    }).finally(() => {
+                        loading.close();
+                    })
+                }
+                if (type == 'C') {
+                    this.form.feeCenterListC.forEach(e => {
+                        this.$set(e, '$cellEdit', false)
+                    })
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    submitListTrade(this.form.feeCenterListC).then(res => {
+                        this.form.feeCenterListC = res.data.data
+                        this.$message.success("保存成功");
+                    }).finally(() => {
+                        loading.close();
+                    })
+                }
+            }
+            if (name == '一键编辑') {
+                if (type == 'D') {
+                    this.form.feeCenterListD.forEach(e => {
+                        this.$set(e, '$cellEdit', true)
+                    })
+                }
+                if (type == 'C') {
+                    this.form.feeCenterListC.forEach(e => {
+                        this.$set(e, '$cellEdit', true)
+                    })
+                }
+            }
+            if (name == '批量删除') {
+                let multiList = []
+                let arr = []
+                for (let index in this.selectionDList) {
+                    if (this.selectionDList[index].accStatus == 1) return this.$message.error("第" + (Number(this.selectionDList[index].$index) + 1) + "行不允许删除");
+                }
+                for (let index in this.selectionCList) {
+                    if (this.selectionCList[index].accStatus == 1) return this.$message.error("第" + (Number(this.selectionCList[index].$index) + 1) + "行不允许删除");
+                }
+                if (type == 'D') {
+                    this.$confirm("确定将选择数据删除?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        multiList = this.selectionDList
+                        arr = this.form.feeCenterListD
+                        // 获取有id 的数据
+                        const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
+                        let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
+                        // 把选中的删除掉
+                        multiList.forEach((item) => {
+                            for (let index in arr) {
+                                if (JSON.stringify(item) == JSON.stringify(arr[index])) {
+                                    arr.splice(Number(index), 1)
+                                }
+                            }
+                        })
+                        if (itemsWithId.length != 0) {
+                            const loading = this.$loading({
+                                lock: true,
+                                text: '加载中',
+                                spinner: 'el-icon-loading',
+                                background: 'rgba(255,255,255,0.7)'
+                            });
+                            feeRemove({ ids: arrIds.join(',') }).then(res => {
+                                this.$message.success("删除成功");
+                            }).finally(() => {
+                                loading.close();
+                            })
+                        }
+                    })
+                }
+                if (type == 'C') {
+                    this.$confirm("确定将选择数据删除?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        multiList = this.selectionCList
+                        arr = this.form.feeCenterListC
+                        // 获取有id 的数据
+                        const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
+                        let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
+                        // 把选中的删除掉
+                        multiList.forEach((item) => {
+                            for (let index in arr) {
+                                if (JSON.stringify(item) == JSON.stringify(arr[index])) {
+                                    arr.splice(Number(index), 1)
+                                }
+                            }
+                        })
+                        if (itemsWithId.length != 0) {
+                            const loading = this.$loading({
+                                lock: true,
+                                text: '加载中',
+                                spinner: 'el-icon-loading',
+                                background: 'rgba(255,255,255,0.7)'
+                            });
+                            feeRemove({ ids: arrIds.join(',') }).then(res => {
+                                this.$message.success("删除成功");
+                            }).finally(() => {
+                                loading.close();
+                            })
+                        }
+                    })
+                }
+            }
+            if (name == '生成账单') {
+                if (type == 'D') {
+                    for (let index in this.selectionDList) {
+                        if (this.selectionDList[index].accStatus != 0) {
+                            return this.$message.error("已生成账单");
+                        }
+                    }
+                    this.$confirm("确定将选择数据生成账单?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        generateBill({ id: this.form.id, feeCenterListD: this.selectionDList }).then(res => {
+                            this.$message.success("成功生成账单");
+                            this.$emit('getDetails', this.form.id)
+                        }).finally(() => {
+                            loading.close();
+                        })
+                    })
+                }
+                if (type == 'C') {
+                    for (let index in this.selectionCList) {
+                        if (this.selectionCList[index].accStatus != 0) {
+                            return this.$message.error("已生成账单");
+                        }
+                    }
+                    this.$confirm("确定将选择数据生成账单?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        generateBill({ id: this.form.id, feeCenterListC: this.selectionCList }).then(res => {
+                            this.$message.success("成功生成账单");
+                            this.$emit('getDetails', this.form.id)
+                        }).finally(() => {
+                            loading.close();
+                        })
+                    })
+                }
+
+
+            }
+            if (name == '撤销账单') {
+                if (type == 'D') {
+                    for (let index in this.selectionDList) {
+                        if (this.selectionDList[index].accStatus != 1) {
+                            return this.$message.error("未生成账单");
+                        }
+                    }
+                    this.$confirm("确定将选择数据撤销账单?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        revokeBill({ id: this.form.id, feeCenterListD: this.selectionDList }).then(res => {
+                            this.$message.success("成功撤销账单");
+                            this.$emit('getDetails', this.form.id)
+                        }).finally(() => {
+                            loading.close();
+                        })
+                    })
+                }
+                if (type == 'C') {
+                    for (let index in this.selectionCList) {
+                        if (this.selectionCList[index].accStatus != 1) {
+                            return this.$message.error("未生成账单");
+                        }
+                    }
+                    this.$confirm("确定将选择数据撤销账单?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        revokeBill({ id: this.form.id, feeCenterListC: this.selectionCList }).then(res => {
+                            this.$message.success("成功撤销账单");
+                            this.$emit('getDetails', this.form.id)
+                        }).finally(() => {
+                            loading.close();
+                        })
+                    })
+                }
+
+            }
+        },
+        //自定义列保存
+        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;
+            }
+        },
+        //自定义列重置
+        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;
+            }
+        },
+
+    },
+}
+</script>
+
+<style scoped lang="scss">
+.disabledBox {
+    display: flex;
+    align-items: center;
+}
+
+.fontSize {
+    font-size: 16px;
+    color: #81B337;
+}
+
+.meetSize {
+    font-size: 16px;
+    color: #54BCBD;
+}
+
+::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;
+}
+</style>

+ 665 - 0
src/components/tradeAgency/fee-infosimple.vue

@@ -0,0 +1,665 @@
+<template>
+    <div>
+        <avue-crud :option="optionD" :table-loading="loading" :data="form.feeCenterListD" id="out-table" ref="crudD"
+            @selection-change="selectionDChange" @resetColumn="resetColumn('crudD', 'optionD', 'optionDBack', 385)"
+            @saveColumn="saveColumn('crudD', 'optionD', 'optionDBack', 385)">
+            <template slot="menuLeft">
+                <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
+                    <i class="el-icon-coin"></i>
+                    <span>应收费用</span>
+                </div>
+                <el-button type="success" plain size="small" :disabled="disabled"
+                    @click="allClick('确认首款', 'D')">确认首款</el-button>
+                <el-button type="primary" plain size="small" :disabled="disabled"
+                    @click="allClick('确认尾款', 'D')">确认尾款</el-button>
+            </template>
+            <template slot="index" slot-scope="{row,index}">
+                <span>{{ index + 1 }}</span>
+            </template>
+            <template slot="corpCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
+                    res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.corpCnName }}</span>
+            </template>
+            <template slot="feeCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
+                    res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.feeCnName }}</span>
+            </template>
+            <template slot="unitNo" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
+                    url="/blade-los/bunits/selectList" :filterable="true"
+                    @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
+                <span v-else>{{ row.unitNo }}</span>
+            </template>
+            <tempalte slot="quantity" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.quantity }}</span>
+            </tempalte>
+            <tempalte slot="price" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.price }}</span>
+            </tempalte>
+            <template slot="curCode" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
+                    :url="'/blade-los/bcurrency/getExrate?date=' + form.contractDate + '&dc=' + row.dc" :filterable="true"
+                    @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                <span v-else>{{ row.curCode }}</span>
+            </template>
+            <tempalte slot="exrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.exrate }}</span>
+            </tempalte>
+            <tempalte slot="stlExrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 结算汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.stlExrate }}</span>
+            </tempalte>
+        </avue-crud>
+        <avue-crud style="margin-top: 10px;" :option="optionC" :table-loading="loading" :data="form.feeCenterListC"
+            id="out-table" ref="crudC" @selection-change="selectionCChange"
+            @resetColumn="resetColumn('crudC', 'optionC', 'optionCBack', 386)"
+            @saveColumn="saveColumn('crudC', 'optionC', 'optionCBack', 386)">
+            <template slot="menuLeft">
+                <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
+                    <i class="el-icon-coin"></i>
+                    <span>应付费用</span>
+                </div>
+                <el-button type="info" plain size="small" :disabled="disabled"
+                    @click="allClick('一键保存', 'C')">一键保存</el-button>
+                <el-button type="info" plain size="small" :disabled="disabled"
+                    @click="allClick('一键编辑', 'C')">一键编辑</el-button>
+                <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
+                    @click="allClick('批量删除', 'C')">批量删除</el-button>
+                <el-button type="success" plain size="small" :disabled="disabled"
+                    @click="allClick('确认首款', 'C')">确认首款</el-button>
+                <el-button type="primary" plain size="small" :disabled="disabled"
+                    @click="allClick('确认尾款', 'C')">确认尾款</el-button>
+            </template>
+            <template slot="indexHeader" slot-scope="{row,index}">
+                <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('C')">
+                </el-button>
+            </template>
+            <template slot="index" slot-scope="{row,index}">
+                <span>{{ index + 1 }}</span>
+            </template>
+            <template slot="corpCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
+                    res="records" url="/blade-los/bcorps/listByType" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.corpCnName }}</span>
+            </template>
+            <template slot="feeCnName" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
+                    res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
+                    @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
+                <span v-else>{{ row.feeCnName }}</span>
+            </template>
+            <template slot="unitNo" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
+                    url="/blade-los/bunits/selectList" :filterable="true"
+                    @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
+                <span v-else>{{ row.unitNo }}</span>
+            </template>
+            <tempalte slot="quantity" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.quantity }}</span>
+            </tempalte>
+            <tempalte slot="price" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.price }}</span>
+            </tempalte>
+            <template slot="curCode" slot-scope="{ row }">
+                <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
+                    :url="'/blade-los/bcurrency/getExrate?date=' + form.contractDate + '&dc=' + row.dc" :filterable="true"
+                    @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
+                <span v-else>{{ row.curCode }}</span>
+            </template>
+            <tempalte slot="exrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.exrate }}</span>
+            </tempalte>
+            <tempalte slot="stlExrate" slot-scope="{ row }">
+                <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" @change="countChange(row)" :controls="false"
+                    placeholder="请输入 结算汇率" size="small" style="width: 100%;"></el-input-number>
+                <span v-else>{{ row.stlExrate }}</span>
+            </tempalte>
+        </avue-crud>
+    </div>
+</template>
+
+<script>
+import dicSelect from "@/components/dicSelect/main";
+import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
+import { submitListTrade, feeRemove, confirmCollectionOfPayments, confirmThePayment, confirmReceived } from "@/api/tradeAgency//exchangePurchasing";
+import _ from "lodash";
+export default {
+    components: {
+        dicSelect
+    },
+    props: {
+        detailData: {},
+        disabled: {
+            type: Boolean,
+            default: false,
+        },
+        form: {
+            type: Object,
+            default: () => {
+            }
+        }
+    },
+    data() {
+        return {
+            optionD: {},
+            optionDBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 140,
+                tip: false,
+                border: true,
+                addBtn: false,
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menu: false,
+                refreshBtn: false,
+                selection: true,
+                align: 'center',
+                column: [
+                    {
+                        label: "账单",
+                        prop: "accStatus",
+                        width: '80',
+                        overHidden: true,
+                        dicData: [{
+                            label: '否',
+                            value: 0
+                        }, {
+                            label: '是',
+                            value: 1
+                        }]
+                    },
+                    {
+                        label: "往来单位",
+                        prop: "corpCnName",
+                        width: '160',
+                        overHidden: true,
+                    },
+                    {
+                        label: "费用名称",
+                        prop: "feeCnName",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "收费标准",
+                        prop: "unitNo",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "单价",
+                        prop: "price",
+                        overHidden: true,
+                    },
+                    {
+                        label: "数量",
+                        prop: "quantity",
+                        overHidden: true,
+                    },
+                    {
+                        label: "金额",
+                        prop: "amount",
+                        overHidden: true,
+                    },
+                    {
+                        label: "币别",
+                        prop: "curCode",
+                        overHidden: true,
+                    },
+                    {
+                        label: "外币金额",
+                        prop: "amountLoc",
+                        overHidden: true,
+                    },
+                    {
+                        label: "汇率",
+                        prop: "exrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "结算汇率",
+                        prop: "stlExrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        cell: true,
+                        width: '200',
+                        overHidden: true,
+                    },
+                    {
+                        label: "收费",
+                        prop: "stlStatus",
+                        overHidden: true,
+                        dicData: [{
+                            label: '未确认',
+                            value: 0
+                        }, {
+                            label: '已确认',
+                            value: 1
+                        }]
+                    },
+                ]
+            },
+            optionC: {},
+            optionCBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 140,
+                tip: false,
+                border: true,
+                addBtn: false,
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menu: false,
+                refreshBtn: false,
+                selection: true,
+                align: 'center',
+                column: [
+                    {
+                        label: "index",
+                        prop: "index",
+                        width: "55",
+                        headerslot: true,
+                    },
+                    {
+                        label: "账单",
+                        prop: "accStatus",
+                        width: '80',
+                        overHidden: true,
+                        dicData: [{
+                            label: '否',
+                            value: 0
+                        }, {
+                            label: '是',
+                            value: 1
+                        }]
+                    },
+                    {
+                        label: "往来单位",
+                        prop: "corpCnName",
+                        width: '160',
+                        overHidden: true,
+                    },
+                    {
+                        label: "费用名称",
+                        prop: "feeCnName",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "收费标准",
+                        prop: "unitNo",
+                        width: '120',
+                        overHidden: true,
+                    },
+                    {
+                        label: "单价",
+                        prop: "price",
+                        overHidden: true,
+                    },
+                    {
+                        label: "数量",
+                        prop: "quantity",
+                        overHidden: true,
+                    },
+                    {
+                        label: "金额",
+                        prop: "amount",
+                        overHidden: true,
+                    },
+                    {
+                        label: "币别",
+                        prop: "curCode",
+                        overHidden: true,
+                    },
+                    {
+                        label: "外币金额",
+                        prop: "amountLoc",
+                        overHidden: true,
+                    },
+                    {
+                        label: "汇率",
+                        prop: "exrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "结算汇率",
+                        prop: "stlExrate",
+                        overHidden: true,
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        cell: true,
+                        width: '200',
+                        overHidden: true,
+                    },
+                    {
+                        label: "收费",
+                        prop: "stlStatus",
+                        overHidden: true,
+                        dicData: [{
+                            label: '未确认',
+                            value: 0
+                        }, {
+                            label: '已确认',
+                            value: 1
+                        }]
+                    },
+                ]
+            },
+            selectionDList: [],
+            selectionCList: []
+
+        }
+    },
+    async created() {
+        this.optionD = await this.getColumnData(this.getColumnName(385), this.optionDBack);
+        this.optionC = await this.getColumnData(this.getColumnName(386), this.optionCBack);
+    },
+    methods: {
+        addRow(type) {
+            if (type == 'C') {
+                this.form.feeCenterListC.push({
+                    $cellEdit: true,
+                    pid: this.form.id,
+                    dc: type,
+                    accStatus: 0,
+                    businessType: 'MYDL',
+                    billNo: this.form.businessNo,
+                    billDate: this.form.businessDate
+                })
+            }
+        },
+        countChange(row) {
+            row.amount = _.multiply(Number(row.quantity ? row.quantity : 0), Number(row.price ? row.price : 0))
+            if (row.feeCnName == '首付款' || row.feeCnName == '尾款') {
+                row.amount = _.multiply(Number(row.amountLoc ? row.amountLoc : 0), Number(row.exrate ? row.exrate : 0))
+            }
+        },
+        selectionDChange(list) {
+            this.selectionDList = list
+        },
+        selectionCChange(list) {
+            this.selectionCList = list
+        },
+        rowDicChange(name, row, el) {
+            if (name == 'corpCnName') {
+                if (row) {
+                    el.corpId = row.id
+                    el.corpEnName = row.enName
+                    el.billCorpId = row.id
+                    el.billCorpCnName = row.cnName
+                } else {
+                    el.corpId = null
+                    el.corpEnName = null
+                    el.billCorpId = null
+                    el.billCorpCnName = null
+                }
+            }
+            if (name == 'feeCnName') {
+                if (row) {
+                    el.feeId = row.id
+                    el.feeCode = row.code
+                    el.feeEnName = row.enName
+                    el.curCode = row.curNo
+                    bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
+                        res.data.data.forEach(e => {
+                            if (row.curNo == e.code) {
+                                this.$set(el, 'exrate', e.exrate)
+                            }
+                        })
+                    })
+                } else {
+                    el.feeId = null
+                    el.feeCode = null
+                    el.feeEnName = null
+                    el.curCode = null
+                }
+            }
+            if (name == 'curCode') {
+                if (row) {
+                    bcurrencyGetExrate({ date: this.form.contractDate, dc: el.dc }).then(res => {
+                        res.data.data.forEach(e => {
+                            if (el.curCode == e.code) {
+                                this.$set(el, 'exrate', e.exrate)
+                            }
+                        })
+                    })
+                } else {
+                    el.exrate = null
+                }
+            }
+        },
+        allClick(name, type) {
+            if (name == '一键保存') {
+                if (type == 'C') {
+                    this.form.feeCenterListC.forEach(e => {
+                        this.$set(e, '$cellEdit', false)
+                    })
+                    submitListTrade(this.form.feeCenterListC).then(res => {
+                        this.form.feeCenterListC = res.data.data
+                        this.$message.success("保存成功");
+                    })
+                }
+            }
+            if (name == '一键编辑') {
+                if (type == 'C') {
+                    this.form.feeCenterListC.forEach(e => {
+                        this.$set(e, '$cellEdit', true)
+                    })
+                }
+            }
+            if (name == '批量删除') {
+                let multiList = []
+                let arr = []
+                for (let index in this.selectionCList) {
+                    if (this.selectionCList[index].feeType == 1 || this.selectionCList[index].feeType == 2) return this.$message.error("第" + (Number(this.selectionCList[index].$index) + 1) + "行不允许删除");
+                }
+                if (type == 'C') {
+                    this.$confirm("确定将选择数据删除?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        multiList = this.selectionCList
+                        arr = this.form.feeCenterListC
+                        const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
+                        let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
+                        multiList.forEach((item) => {
+                            for (let index in arr) {
+                                if (JSON.stringify(item) == JSON.stringify(arr[index])) {
+                                    arr.splice(Number(index), 1)
+                                }
+                            }
+                        })
+                        if (itemsWithId.length != 0) {
+                            console.log(arrIds)
+                            feeRemove({ ids: arrIds.join(',') }).then(res => {
+                                this.$message.success("删除成功");
+                            })
+                        }
+                    })
+                }
+            }
+            if (name == '确认首款') {
+                let obj = {}
+                obj = {
+                    ...this.form,
+                    paidApplication: 'SK'
+                }
+                if (type == 'D') {
+                    this.$confirm("是否确认首款?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        confirmCollectionOfPayments(obj).then(res => {
+                            this.$emit('getDetails', this.form.id)
+                            this.$message.success("确认成功");
+                        }).finally(() => {
+                            loading.close();
+                        })
+                    })
+                }
+                if (type == 'C') {
+                    confirmReceived(obj).then(res => {
+                        this.$confirm(res.data.data, {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(() => {
+                            const loading = this.$loading({
+                                lock: true,
+                                text: '加载中',
+                                spinner: 'el-icon-loading',
+                                background: 'rgba(255,255,255,0.7)'
+                            });
+                            confirmThePayment(obj).then(res => {
+                                this.$emit('getDetails', this.form.id)
+                                this.$message.success("确认成功");
+                            }).finally(() => {
+                                loading.close();
+                            })
+                        })
+                    })
+                }
+            }
+            if (name == '确认尾款') {
+                let obj = {}
+                obj = {
+                    ...this.form,
+                    paidApplication: 'WK'
+                }
+                if (type == 'D') {
+
+                    this.$confirm("是否确认尾款?", {
+                        confirmButtonText: "确定",
+                        cancelButtonText: "取消",
+                        type: "warning"
+                    }).then(() => {
+                        const loading = this.$loading({
+                            lock: true,
+                            text: '加载中',
+                            spinner: 'el-icon-loading',
+                            background: 'rgba(255,255,255,0.7)'
+                        });
+                        confirmCollectionOfPayments(obj).then(res => {
+                            this.$emit('getDetails', this.form.id)
+                            this.$message.success("确认成功");
+                        }).finally(() => {
+                            loading.close();
+                        })
+                    })
+
+                }
+                if (type == 'C') {
+                    confirmReceived(obj).then(res => {
+                        this.$confirm(res.data.data, {
+                            confirmButtonText: "确定",
+                            cancelButtonText: "取消",
+                            type: "warning"
+                        }).then(() => {
+                            const loading = this.$loading({
+                                lock: true,
+                                text: '加载中',
+                                spinner: 'el-icon-loading',
+                                background: 'rgba(255,255,255,0.7)'
+                            });
+                            confirmThePayment(obj).then(res => {
+                                this.$emit('getDetails', this.form.id)
+                                this.$message.success("确认成功");
+                            }).finally(() => {
+                                loading.close();
+                            })
+                        })
+                    })
+
+                }
+            }
+        },
+        //自定义列保存
+        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;
+            }
+        },
+        //自定义列重置
+        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;
+            }
+        },
+
+    },
+}
+</script>
+
+<style scoped lang="scss">
+.disabledBox {
+    display: flex;
+    align-items: center;
+}
+
+.fontSize {
+    font-size: 16px;
+    color: #81B337;
+}
+
+.meetSize {
+    font-size: 16px;
+    color: #54BCBD;
+}
+
+::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;
+}
+</style>

+ 16 - 1
src/enums/column-name.js

@@ -1768,7 +1768,22 @@ const columnName = [{
     name: '贸易代理-贸易代理-通关记录'
   },{
     code: 381,
-    name: '贸易代理-贸易代理-费用明细'
+    name: '贸易代理-贸易代理-应收费用明细'
+  },{
+    code: 382,
+    name: '贸易代理-贸易代理-应付费用明细'
+  },{
+    code: 383,
+    name: '贸易代理-购汇付汇-列表'
+  },{
+    code: 384,
+    name: '贸易代理-购汇付汇-明细'
+  },{
+    code: 385,
+    name: '贸易代理-购汇付汇-应收费用明细'
+  },{
+    code: 386,
+    name: '贸易代理-购汇付汇-应付费用明细'
   }
 ]
 export const getColumnName = (key) => {

+ 28 - 0
src/router/views/index.js

@@ -3599,4 +3599,32 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views//iosBasicData/decisionAnalysis/index')
   }]
 },
+{
+  path: '/tradeAgency/tradeAgency/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/tradeAgency/tradeAgency/index',
+    name: '贸易代理(T)',
+    meta: {
+      i18n: '/tradeAgency/tradeAgency/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/tradeAgency/tradeAgency/index')
+  }]
+},
+{
+  path: '/tradeAgency/exchangePurchasing/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/tradeAgency/exchangePurchasing/index',
+    name: '购汇付汇',
+    meta: {
+      i18n: '/tradeAgency/exchangePurchasing/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/tradeAgency/exchangePurchasing/index')
+  }]
+},
 ]

+ 2 - 1
src/views/exportTrade/customerInquiry/detailsPage.vue

@@ -1913,13 +1913,13 @@ export default {
       this.$refs.feeInfo.oceanUSD()
     },
     getDetail(id) {
-      console.log(id)
       this.loading = true;
       this.showBut = false;
       this.pageLoading = true;
       detail(id)
         .then(res => {
           if (this.detailData.status == "copy") {
+            console.log(11111,'copy')
             delete res.data.data.id;
             delete res.data.data.sysNo;
             delete res.data.data.orderNo;
@@ -2086,6 +2086,7 @@ export default {
           //   paySum
           // );
           this.form.totalValue = 0
+          delete this.detailData.status
           this.data.forEach((e, index) => {
             e.sort = Number(index) + 1
             this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)

+ 1 - 0
src/views/exportTrade/salesContract/detailsPage.vue

@@ -2631,6 +2631,7 @@ export default {
           //   paySum
           // );
           this.form.totalValue = 0
+          delete this.detailData.status
           this.data.forEach(async (e, index) => {
             e.sort = Number(index) + 1
             this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)

+ 1 - 1
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -1034,7 +1034,7 @@ export default {
                 billNoFormat = 'HYCK-WXP'
             } else if (this.form.cargoType == 'reefer') {
                 billNoFormat = 'HYCK-DG'
-            } else { }
+            }
             billsGetBillNo({
                 businessTypeCode: 'HYCK',
                 billNoFormat: billNoFormat

+ 423 - 0
src/views/tradeAgency/exchangePurchasing/detailsPage.vue

@@ -0,0 +1,423 @@
+<template>
+    <div>
+        <div class="customer-head">
+            <div class="customer-back">
+                <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                    @click="goBack(0)">返回列表
+                </el-button>
+            </div>
+            <div class="add-customer-btn">
+                <el-button class="el-button--small-yh" style="margin-left: 6px;" type="primary" size="small"
+                    v-if="editDisabled" @click="inEdit">编 辑
+                </el-button>
+                <el-button class="el-button--small-yh" v-else style="margin-left: 6px;" type="primary" size="small"
+                    :disabled="isSaveBtn" @click="submit">保 存
+                </el-button>
+            </div>
+        </div>
+        <div style="margin-top: 50px">
+            <trade-card title="基础信息">
+                <avue-form :option="optionForm" v-model="form" ref="form">
+                </avue-form>
+            </trade-card>
+            <trade-card title="货物明细">
+                <avue-crud :option="option" :data="form.agentItemsList" id="out-table" ref="crud"
+                    @selection-change="selectionChange" @resetColumn="resetColumn('crud', 'option', 'optionBack', 384)"
+                    @saveColumn="saveColumn('crud', 'option', 'optionBack', 384)">
+                    <template slot="menuLeft">
+                    </template>
+                </avue-crud>
+            </trade-card>
+            <trade-card title="费用明细">
+                <fee-infosimple :form="form" :disabled="editDisabled" @getDetails="getDetails"></fee-infosimple>
+            </trade-card>
+            <containerTitle title="上传附件"></containerTitle>
+            <c-upload :data="form.filesCenterList" :enumerationValue="76"
+                deleteUrl="/blade-purchase-sales/orderfiles/update" display :disabled="editDisabled"></c-upload>
+        </div>
+    </div>
+</template>
+
+<script>
+import { submit, getDetail} from "@/api/tradeAgency/exchangePurchasing";
+import feeInfosimple from "@/components/tradeAgency/fee-infosimple";
+import dicSelect from "@/components/dicSelect/main";
+import _ from "lodash";
+export default {
+    name: "detailsPage",
+
+    data() {
+        return {
+            editDisabled: false,
+            form: {},
+            optionForm: {
+                menuBtn: false,
+                span: 8,
+                disabled: true,
+                column: [
+                    {
+                        label: '客户',
+                        prop: "corpName",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '合同号',
+                        prop: "contractNo",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '合同日期',
+                        prop: "contractDate",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 00:00:00",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '原产地',
+                        prop: "countryOfOrigin",
+                        disabled: false,
+                    },
+                    {
+                        label: '国家',
+                        prop: "country",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '运输方式',
+                        prop: "typeOfShipping",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '起运港',
+                        prop: "polCnName",
+                        disabled: false,
+                    },
+                    {
+                        label: '目的港',
+                        prop: "podCnName",
+                        disabled: false,
+                    },
+                    {
+                        label: '币别',
+                        prop: "currency",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '货值',
+                        prop: "goodsValue",
+                        disabled: false,
+                    },
+                    {
+                        label: '预付比例',
+                        prop: "advanceRatio",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '预付金额',
+                        prop: "prepaidAmount",
+                        disabled: false,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: '外国发货人',
+                        prop: "abroadConsignorCname",
+                        disabled: false,
+                    },
+                    {
+                        label: '银行助记码',
+                        prop: "abroadBankMnemonicCode",
+                        disabled: false,
+                    },
+                    {
+                        label: '银行',
+                        prop: "abroadBank",
+                        disabled: false,
+                    },
+                    {
+                        label: '币别',
+                        prop: "abroadCurrency",
+                        disabled: false,
+                    },
+                    {
+                        label: '国内收货人',
+                        prop: "domesticConsigneeCname",
+                        disabled: false,
+                    },
+                    {
+                        label: '银行助记码',
+                        prop: "domesticBankMnemonicCode",
+                        disabled: false,
+                    },
+                    {
+                        label: '银行',
+                        prop: "domesticBank",
+                        disabled: false,
+                    },
+                    {
+                        label: '币别',
+                        prop: "domesticCurrency",
+                        disabled: false,
+                    },
+                    {
+                        label: '单据类型',
+                        prop: "documentType",
+                        disabled: false,
+                    },
+                    {
+                        label: '所属公司',
+                        prop: "affiliatedCompanyName",
+                        disabled: false,
+                    },
+                    {
+                        label: '业务员',
+                        prop: "salesmanName",
+                        disabled: false,
+                    },
+                    {
+                        label: '备注',
+                        prop: "remarks",
+                        type: 'textarea',
+                        disabled: false,
+                        minRows: 2,
+                    },
+                ]
+            },
+            option: {},
+            optionBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 140,
+                border: true,
+                index: true,
+                addBtn: false,
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menu:false,
+                refreshBtn: false,
+                align: 'center',
+                column: [
+                    {
+                        label: "提单号",
+                        prop: "billNo",
+                        overHidden: true
+                    },
+                    {
+                        label: "箱号",
+                        prop: "boxNo",
+                        overHidden: true
+                    },
+                    {
+                        label: "铅封号",
+                        prop: "leadSealNo",
+                        overHidden: true
+                    },
+                    {
+                        label: "开船日期",
+                        prop: "etd",
+                        overHidden: true
+                    },
+                    {
+                        label: "预计到港",
+                        prop: "estimateReachHarbor",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "HSCODE",
+                        prop: "hsCode",
+                        overHidden: true
+                    },
+                    {
+                        label: "厂号",
+                        prop: "factoryNumber",
+                        overHidden: true
+                    },
+                    {
+                        label: "标签品名",
+                        prop: "labelProductName",
+                        overHidden: true
+                    },
+                    {
+                        label: "商品类别",
+                        prop: "goodsType",
+                        overHidden: true
+                    },
+                    {
+                        label: "件数",
+                        prop: "quantity",
+                        overHidden: true
+                    },
+                    {
+                        label: "净重(kg)",
+                        prop: "netWeight",
+                        overHidden: true
+                    },
+                    {
+                        label: "单价",
+                        prop: "price",
+                        overHidden: true
+                    },
+                    {
+                        label: "毛重(kg)",
+                        prop: "grossWeight",
+                        overHidden: true
+                    },
+                    {
+                        label: "金额",
+                        prop: "amount",
+                        overHidden: true
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        overHidden: true
+                    }
+                ]
+            },
+        }
+    },
+    components: {
+        dicSelect,
+        feeInfosimple
+    },
+    props: {
+        detailData: Object
+    },
+    async created() {
+        this.option = await this.getColumnData(this.getColumnName(384), this.optionBack);
+        if (this.detailData.id) {
+            this.editDisabled = true
+            this.getDetails(this.detailData.id)
+        }
+    },
+    methods: {
+        getDetails(id) {
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            });
+            getDetail({ id: id }).then(res => {
+                this.form = res.data.data
+            }).finally(() => {
+                loading.close()
+            })
+        },
+        inEdit() {
+            this.editDisabled = false
+        },
+        submit() {
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    const loading = this.$loading({
+                        lock: true,
+                        text: '加载中',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(255,255,255,0.7)'
+                    });
+                    submit(this.form).then(res => {
+                        this.$message.success("保存成功");
+                        this.getDetails(res.data.data.id)
+                    }).finally(() => {
+                        loading.close();
+                    })
+                } else {
+                    return false;
+                }
+            });
+        },
+        //自定义列保存
+        async saveColumn(ref, option, optionBack, code) {
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        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;
+            }
+        },
+        goBack(type) {
+            this.$emit("goBack", type);
+            this.$emit('updateKey')
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+    margin-bottom: 8px !important;
+}
+
+::v-deep .el-table .cell {
+    padding: 0 2px !important;
+
+    .el-form-item {
+        margin-bottom: 0px !important;
+    }
+
+}
+
+::v-deep .avue-crud .el-table .el-form-item__label {
+    left: -1px;
+}
+
+::v-deep#out-table .back-one {
+    background: #ecf5ff !important;
+}
+
+::v-deep#out-table .back-two {
+    background: #ecf5ff !important;
+}
+</style>

+ 394 - 1
src/views/tradeAgency/exchangePurchasing/index.vue

@@ -1 +1,394 @@
-购汇付汇
+购汇付汇<template>
+    <div>
+        <basic-container v-if="isShow">
+            <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :search.sync="query"
+                v-model="form" id="out-table" :header-cell-class-name="headerClassName" ref="crud" @row-del="rowDel"
+                @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
+                @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
+                @resetColumn="resetColumn('crud', 'option', 'optionBack', 383)"
+                @saveColumn="saveColumn('crud', 'option', 'optionBack', 383)" @on-load="onLoad">
+                <template slot="menu" slot-scope="{ row, index }">
+                    <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">编辑</el-button>
+                </template>
+                <template slot="contractNo" slot-scope="{ row }">
+                    <span style="color: #1e9fff" @click="rowEdit(row)">{{ row.contractNo }}</span>
+                </template>
+            </avue-crud>
+        </basic-container>
+        <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
+    </div>
+</template>
+  
+<script>
+import { getList, remove, copyAgent } from "@/api/tradeAgency/exchangePurchasing";
+import detailsPage from "./detailsPage";
+
+export default {
+    data() {
+        return {
+            detailData: {},
+            isShow: true,
+            form: {},
+            query: { },
+            loading: false,
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0
+            },
+            selectionList: [],
+            option: {},
+            optionBack: {
+                height: 'auto',
+                calcHeight: 30,
+                menuWidth: 80,
+                searchShow: true,
+                searchMenuSpan: 18,
+                border: true,
+                index: true,
+                addBtn: false,
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                searchIcon: true,
+                searchIndex: 3,
+                column: [
+                    {
+                        label: "客户名称",
+                        prop: "corpName",
+                        width: "120",
+                        overHidden: true,
+                        search: true,
+                        type: 'select',
+                        filterable: true,
+                        remote: true,
+                        dicUrl: "/api/blade-los/bcorps/listByType?cnName={{key}}",
+                        props: {
+                            label: 'cnName',
+                            value: 'cnName',
+                            res: 'data.records'
+                        },
+                        searchOrder: 1,
+                    },
+                    {
+                        label: "合同号",
+                        prop: "contractNo",
+                        width: "80",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 2,
+                    },
+                    {
+                        label: "合同日期",
+                        prop: "contractDate",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 00:00:00",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "订单状态",
+                        prop: "orderStatus",
+                        width: "120",
+                        overHidden: true,
+                    },
+                    {
+                        label: "国家",
+                        prop: "country",
+                        width: "80",
+                        overHidden: true
+                    },
+                    {
+                        label: "运输方式",
+                        prop: "typeOfShipping",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "起运港",
+                        prop: "polCnName",
+                        width: "80",
+                        overHidden: true
+                    },
+                    {
+                        label: "目的港",
+                        prop: "podCnName",
+                        width: "80",
+                        overHidden: true
+                    },
+                    {
+                        label: "币别",
+                        prop: "currency",
+                        width: "80",
+                        overHidden: true
+                    },
+                    {
+                        label: "总金额(USD)",
+                        prop: "amount",
+                        width: "100",
+                        overHidden: true
+                    },
+                    {
+                        label: "预付比例",
+                        prop: "advanceRatio",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "预付金额",
+                        prop: "prepaidAmount",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "提单号",
+                        prop: "billNo",
+                        width: "80",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 3,
+                    },
+                    {
+                        label: "订单号",
+                        prop: "orderNo",
+                        width: "80",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 8,
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
+                        label: "箱号",
+                        prop: "boxNo",
+                        width: "80",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 4,
+                    },
+                    {
+                        label: "金额",
+                        prop: "amount",
+                        width: "100",
+                        overHidden: true
+                    },
+                    {
+                        label: "首付实收",
+                        prop: "downPaymentsNetReceipts",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "尾款实收",
+                        prop: "mblno",
+                        width: "120",
+                        overHidden: true
+                    },
+                    {
+                        label: "付汇记录",
+                        prop: "paymentRecord",
+                        width: "120",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 8,
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
+                        label: "开船日期",
+                        prop: "etd",
+                        width: "120",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 5,
+                        searchProp: "etdList",
+                        type: "date",
+                        unlinkPanels: true,
+                        searchRange: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
+                        label: "预计到港",
+                        prop: "estimateReachHarbor",
+                        width: "120",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 6,
+                        searchProp: "estimateReachHarborList",
+                        type: "date",
+                        unlinkPanels: true,
+                        searchRange: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
+                        label: "实际到港",
+                        prop: "actualReachHarbor",
+                        width: "120",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 7,
+                        searchProp: "actualReachHarborList",
+                        type: "date",
+                        unlinkPanels: true,
+                        searchRange: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
+                        hide: true,
+                        showColumn: false,
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        width: "160",
+                        overHidden: true
+                    }
+                ]
+            },
+            data: [],
+        };
+    },
+    components: {
+        detailsPage,
+    },
+    async created() {
+        this.option = await this.getColumnData(this.getColumnName(383), this.optionBack);
+    },
+    methods: {
+        rowEdit(row) {
+            this.detailData = {
+                id: row.id
+            };
+            this.isShow = false
+        },
+        // 编辑
+        inEdit(row) {
+        },
+        searchReset() {
+            this.query = this.$options.data().query;
+            this.onLoad(this.page);
+        },
+        // 搜索按钮点击
+        searchChange(params, done) {
+            this.page.currentPage = 1;
+            this.onLoad(this.page, this.query);
+            done();
+        },
+        selectionChange(list) {
+            this.selectionList = list;
+        },
+        currentChange(currentPage) {
+            this.page.currentPage = currentPage;
+        },
+        sizeChange(pageSize) {
+            this.page.pageSize = pageSize;
+        },
+        refreshChange() {
+            this.onLoad(this.page, this.query);
+        },
+        onLoad(page, params = {}) {
+            let obj = {}
+            obj = {
+                ...Object.assign(params, this.query),
+            }
+            console.log(obj)
+            this.loading = true;
+            getList(page.currentPage, page.pageSize, obj).then(res => {
+                this.data = res.data.data.records;
+                this.page.total = res.data.data.total;
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                    this.$refs.crud.dicInit();
+                });
+            }).finally(() => {
+                this.loading = false;
+            })
+
+        },
+        // 详情的返回列表
+        goBack() {
+            // 初始化数据
+            // if (JSON.stringify(this.$route.query) != "{}") {
+            //     this.$router.$avueRouter.closeTag();
+            //     this.$router.push({
+            //         path: "/iosBasicData/accounts/index"
+            //     });
+            // }
+            this.detailData = {}
+            this.isShow = true;
+            this.onLoad(this.page, this.search);
+        },
+        //自定义列保存
+        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;
+                this.searchReset()
+            }
+        },
+        // 更改表格颜色
+        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;
+        },
+
+    }
+}
+
+</script>
+  
+<style scoped>
+::v-deep#out-table .back-one {
+    background: #ecf5ff !important;
+    text-align: center;
+}
+
+::v-deep#out-table .back-two {
+    background: #ecf5ff !important;
+    text-align: center;
+}
+
+.pointerClick {
+    cursor: pointer;
+    color: #1e9fff;
+}
+
+::v-deep .el-col-md-8 {
+    width: 24.33333%;
+}
+</style>
+  

File diff suppressed because it is too large
+ 753 - 122
src/views/tradeAgency/tradeAgency/detailsPage.vue


+ 180 - 48
src/views/tradeAgency/tradeAgency/index.vue

@@ -1,50 +1,49 @@
 <template>
     <div>
         <basic-container v-if="isShow">
-            <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-                <el-tab-pane label="录入" name="1"></el-tab-pane>
-                <el-tab-pane label="已开船" name="2"></el-tab-pane>
-                <el-tab-pane label="已到港" name="3"></el-tab-pane>
-                <el-tab-pane label="已通关" name="4"></el-tab-pane>
-                <el-tab-pane label="已派车" name="5"></el-tab-pane>
-                <el-tab-pane label="已完成" name="6"></el-tab-pane>
-                <el-tab-pane label="已取消" name="7"></el-tab-pane>
-                <el-tab-pane label="全部" name="8"></el-tab-pane>
-            </el-tabs>
             <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" :search.sync="query"
                 v-model="form" id="out-table" :header-cell-class-name="headerClassName" ref="crud" @row-del="rowDel"
                 @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
                 @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
                 @resetColumn="resetColumn('crud', 'option', 'optionBack', 375)"
                 @saveColumn="saveColumn('crud', 'option', 'optionBack', 375)" @on-load="onLoad">
+                <template slot="checkboxSearch">
+                    <el-checkbox-group v-model="query.checkbox" @change="handleCheckedChange">
+                        <el-checkbox v-for="item in statusList" :label="item.value" :key="item.value">{{ item.label
+                        }}</el-checkbox>
+                    </el-checkbox-group>
+                    <!-- <avue-form v-model="query.checkbox" :option="checkboxOption"></avue-form> -->
+                </template>
                 <template slot="menuLeft">
                     <el-button type="primary" size="small" icon="el-icon-plus" @click="addButton">新 增
                     </el-button>
                 </template>
                 <template slot="menu" slot-scope="{ row, index }">
-                    <el-button size="small" icon="el-icon-edit" type="text" @click="editfun(row, index)">编辑</el-button>
-                    <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)">删 除</el-button>
+                    <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">编辑</el-button>
+                    <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)" :disabled="row.orderStatus!='录入'">删 除</el-button>
                 </template>
-                <template slot="code" slot-scope="{ row }">
-                    <span style="color: #1e9fff" @click="">{{ row.code }}</span>
+                <template slot="contractNo" slot-scope="{ row }">
+                    <span style="color: #1e9fff" @click="rowEdit(row)">{{ row.contractNo }}</span>
                 </template>
             </avue-crud>
         </basic-container>
-        <detailsPage v-if="!isShow" :detailData="detailData"></detailsPage>
+        <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
     </div>
 </template>
   
 <script>
+import { getList, remove, copyAgent } from "@/api/tradeAgency/tradeAgency";
 import detailsPage from "./detailsPage";
 
 export default {
     data() {
         return {
-            detailData:{},
-            activeName: '1',
+            detailData: {},
             isShow: true,
             form: {},
-            query: {},
+            query: {
+                checkbox: [],
+            },
             loading: false,
             page: {
                 pageSize: 10,
@@ -52,19 +51,47 @@ export default {
                 total: 0
             },
             selectionList: [],
+            statusList: [
+                {
+                    label: '已开船',
+                    value: 'whetherSail'
+                },
+                {
+                    label: '已到港',
+                    value: 'whetherReachHarbor'
+                },
+                {
+                    label: '已通关',
+                    value: 'whetherClearance'
+                },
+                {
+                    label: '已派车',
+                    value: 'whetherDispatchCar'
+                },
+                {
+                    label: '已完成',
+                    value: 'whetherComplete'
+                },
+                {
+                    label: '已取消',
+                    value: 'whetherCancel'
+                }
+            ],
             option: {},
             optionBack: {
                 height: 'auto',
                 calcHeight: 30,
+                menuWidth: 140,
                 tip: false,
                 searchShow: true,
-                searchMenuSpan: 18,
+                searchMenuSpan: 6,
                 border: true,
                 index: true,
                 addBtn: false,
                 viewBtn: false,
+                editBtn: false,
+                delBtn: false,
                 selection: true,
-                simplePage: true,
                 searchIcon: true,
                 searchIndex: 3,
                 column: [
@@ -83,7 +110,6 @@ export default {
                             value: 'cnName',
                             res: 'data.records'
                         },
-                        span: 6,
                         searchOrder: 1,
                     },
                     {
@@ -92,8 +118,7 @@ export default {
                         width: "80",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 4,
+                        searchOrder: 2,
                     },
                     {
                         label: "提单号",
@@ -101,8 +126,7 @@ export default {
                         width: "80",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 3,
                     },
                     {
                         label: "放单方式",
@@ -116,8 +140,7 @@ export default {
                         width: "80",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 9,
                     },
                     {
                         label: "箱号",
@@ -125,12 +148,42 @@ export default {
                         width: "80",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 4,
+                    },
+                    {
+                        label: "订单状态",
+                        prop: "orderStatus",
+                        width: "120",
+                        overHidden: true,
+                    },
+                    {
+                        label: "审核状态",
+                        prop: "businessStatus",
+                        width: "120",
+                        overHidden: true,
+                    },
+                    {
+                        label: "审单状态",
+                        prop: "reviewStatus",
+                        width: "120",
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 5,
+                        type: "select",
+                        dicUrl: "/api/blade-system/dict-biz/dictionary?code=audit_status",
+                        props: {
+                            label: "dictValue",
+                            value: "dictValue"
+                        },
+                        hide: true,
+                        showColumn: false,
                     },
                     {
                         label: "合同日期",
                         prop: "contractDate",
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd 00:00:00",
                         width: "120",
                         overHidden: true
                     },
@@ -144,8 +197,26 @@ export default {
                         label: "通关进度",
                         prop: "clearanceSpeedOfProgress",
                         width: "120",
-                        overHidden: true
+                        overHidden: true,
+                        search: true,
+                        searchOrder: 11,
                     },
+                    // {
+                    //     label: "通关进度",
+                    //     prop: "clearanceSpeedOfProgress",
+                    //     width: "120",
+                    //     overHidden: true,
+                    //     search: true,
+                    //     searchOrder: 12,
+                    // },
+                    // {
+                    //     label: "通关进度",
+                    //     prop: "clearanceSpeedOfProgress",
+                    //     width: "120",
+                    //     overHidden: true,
+                    //     search: true,
+                    //     searchOrder: 13,
+                    // },
                     {
                         label: "付汇记录",
                         prop: "paymentRecord",
@@ -176,8 +247,14 @@ export default {
                         width: "120",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 6,
+                        searchProp: "etdList",
+                        type: "date",
+                        unlinkPanels: true,
+                        searchRange: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
                     },
                     {
                         label: "预计到港",
@@ -185,8 +262,14 @@ export default {
                         width: "120",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 7,
+                        searchProp: "estimateReachHarborList",
+                        type: "date",
+                        unlinkPanels: true,
+                        searchRange: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
                     },
                     {
                         label: "实际到港",
@@ -194,8 +277,14 @@ export default {
                         width: "120",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 8,
+                        searchProp: "actualReachHarborList",
+                        type: "date",
+                        unlinkPanels: true,
+                        searchRange: true,
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss",
+                        searchDefaultTime: ["00:00:00", "23:59:59"],
                     },
                     {
                         label: "PI发票号",
@@ -203,8 +292,7 @@ export default {
                         width: "120",
                         overHidden: true,
                         search: true,
-                        span: 6,
-                        searchOrder: 2,
+                        searchOrder: 10,
                         hide: true,
                         showColumn: false,
                     },
@@ -261,6 +349,16 @@ export default {
                         prop: "remarks",
                         width: "80",
                         overHidden: true
+                    },
+                    {
+                        label: "多选",
+                        prop: "checkbox",
+                        overHidden: true,
+                        search: true,
+                        searchSpan: 18,
+                        searchOrder: 14,
+                        hide: true,
+                        showColumn: false,
                     }
                 ]
             },
@@ -274,21 +372,39 @@ export default {
         this.option = await this.getColumnData(this.getColumnName(375), this.optionBack);
     },
     methods: {
+        handleCheckedChange() {
+            delete this.query.whetherSail
+            delete this.query.whetherReachHarbor
+            delete this.query.whetherClearance
+            delete this.query.whetherDispatchCar
+            delete this.query.whetherComplete
+            delete this.query.whetherCancel
+            if (this.query.checkbox) {
+                this.query.checkbox.forEach(e => {
+                    this.query[e] = 1
+                })
+            }
+        },
         addButton() {
             this.isShow = false
         },
+        rowEdit(row) {
+            this.detailData = {
+                id: row.id
+            };
+            this.isShow = false
+        },
         // 删除
-        rowDel(row) {
+        rowDel(row, index) {
             this.$confirm("确定将选择数据删除?", {
                 confirmButtonText: "确定",
                 cancelButtonText: "取消",
                 type: "warning"
             }).then(() => {
-                this.onLoad(this.page);
-                this.$message({
-                    type: "success",
-                    message: "删除成功!"
-                });
+                remove({ ids: row.id }).then(res => {
+                    this.onLoad(this.page, this.query);
+                    this.$message.success("成功删除");
+                })
             })
 
         },
@@ -296,12 +412,11 @@ export default {
         inEdit(row) {
         },
         searchReset() {
-            this.query = {};
+            this.query = this.$options.data().query;
             this.onLoad(this.page);
         },
         // 搜索按钮点击
         searchChange(params, done) {
-            // this.query = params;
             this.page.currentPage = 1;
             this.onLoad(this.page, this.query);
             done();
@@ -319,9 +434,23 @@ export default {
             this.onLoad(this.page, this.query);
         },
         onLoad(page, params = {}) {
-            this.$nextTick(() => {
-                this.$refs.crud.dicInit()
+            let obj = {}
+            obj = {
+                ...Object.assign(params, this.query),
+            }
+            console.log(obj)
+            this.loading = true;
+            getList(page.currentPage, page.pageSize, obj).then(res => {
+                this.data = res.data.data.records;
+                this.page.total = res.data.data.total;
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                    this.$refs.crud.dicInit();
+                });
+            }).finally(() => {
+                this.loading = false;
             })
+
         },
         // 详情的返回列表
         goBack() {
@@ -332,6 +461,7 @@ export default {
             //         path: "/iosBasicData/accounts/index"
             //     });
             // }
+            this.detailData = {}
             this.isShow = true;
             this.onLoad(this.page, this.search);
         },
@@ -347,6 +477,7 @@ export default {
                 this.$message.success("保存成功");
                 //关闭窗口
                 this.$refs[ref].$refs.dialogColumn.columnBox = false;
+                this.searchReset()
             }
         },
         //自定义列重置
@@ -356,6 +487,7 @@ export default {
             if (inSave) {
                 this.$message.success("重置成功");
                 this.$refs[ref].$refs.dialogColumn.columnBox = false;
+                this.searchReset()
             }
         },
         // 更改表格颜色

Some files were not shown because too many files changed in this diff