Browse Source

新加出纳功能模块

Qukatie 2 months ago
parent
commit
c9f4f6f3e9

+ 91 - 0
src/api/iosBasicData/cashier.js

@@ -0,0 +1,91 @@
+import request from "@/router/axios";
+
+// 申请出纳
+export const applyCashier = (data) => {
+  return request({
+    url: "/api/blade-los/finstlbills/applyCashier",
+    method: "get",
+    params: data
+  });
+};
+// 撤销申请出纳
+export const revokeCashier = (data) => {
+  return request({
+    url: "/api/blade-los/finstlbills/revokeCashier",
+    method: "get",
+    params: data
+  });
+};
+// 确认出纳
+export const confirmCashier = (data) => {
+  return request({
+    url: "/api/blade-los/finstlbills/confirmCashier",
+    method: "post",
+    data: data
+  });
+};
+// 撤销出纳
+export const revokeConfirmCashier = (data) => {
+  return request({
+    url: "/api/blade-los/finstlbills/revokeConfirmCashier",
+    method: "post",
+    data: data
+  });
+};
+
+// 申请出纳
+export const applyCashier2 = (data) => {
+  return request({
+    url: "/api/blade-los/fininvoices/applyCashier",
+    method: "get",
+    params: data
+  });
+};
+// 撤销申请出纳
+export const revokeCashier2 = (data) => {
+  return request({
+    url: "/api/blade-los/fininvoices/revokeCashier",
+    method: "get",
+    params: data
+  });
+};
+// 确认出纳
+export const confirmCashier2 = (data) => {
+  return request({
+    url: "/api/blade-los/fininvoices/confirmCashier",
+    method: "post",
+    data: data
+  });
+};
+// 撤销出纳
+export const revokeConfirmCashier2 = (data) => {
+  return request({
+    url: "/api/blade-los/fininvoices/revokeConfirmCashier",
+    method: "post",
+    data: data
+  });
+};
+// 出纳明细列表
+export const getListAll = (data) => {
+  return request({
+    url: "/api/blade-los/applycashier/listAll",
+    method: "get",
+    params: data
+  });
+};
+// 增加出纳明细
+export const submit = (data) => {
+  return request({
+    url: "/api/blade-los/applycashier/submit",
+    method: "post",
+    data: data
+  });
+};
+// 增加出纳明细
+export const remove = (data) => {
+  return request({
+    url: "/api/blade-los/applycashier/remove",
+    method: "post",
+    params: data
+  });
+};

+ 499 - 0
src/views/iosBasicData/PaymentApplication/assembly/cashierItem.vue

@@ -0,0 +1,499 @@
+<template>
+  <div>
+    <el-dialog title="指示" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <el-tag type="success" style="margin-right: 10px;">剩余出纳收费(RMB){{ Number(form.amountDr - form.actualAmountDr).toFixed(2) }}</el-tag>
+      <el-tag type="info" style="margin-right: 10px;">剩余出纳收费(USD){{ Number(form.amountDrUsd - form.actualAmountDrUsd).toFixed(2) }}</el-tag>
+      <el-tag type="warning" style="margin-right: 10px;">剩余出纳付费(RMB){{ Number(form.amountCr - form.actualAmountCr).toFixed(2) }}</el-tag>
+      <el-tag type="danger">剩余出纳付费(USD){{ Number(form.amountCrUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
+      <avue-crud
+        v-if="dialogVisible"
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        id="out-table"
+        :header-cell-class-name="headerClassName"
+        @on-load="onLoad"
+      >
+        <template slot="indexHeader" slot-scope="{ row }">
+          <el-button
+            type="primary"
+            size="small"
+            icon="el-icon-plus"
+            circle
+            @click="addRow"
+            :disabled="form.cashierStatus == 2 || disabled"
+          ></el-button>
+        </template>
+        <template slot="index" slot-scope="{ row, index }">
+          <span>{{ index + 1 }}</span>
+        </template>
+        <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?type=2&date=' + form.billDate + ' 00:00:00' + '&dc=' + form.dc"
+            :filterable="true"
+            @selectChange="rowDicChange('curCode', $event, row)"
+          ></dic-select>
+          <span v-else>{{ row.curCode }}</span>
+        </template>
+        <template slot="exrate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.exrate"
+            @change="calculateChange(row)"
+            label="请输入汇率"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.exrate }}</span>
+        </template>
+        <template slot="amount" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.amount"
+            @change="calculateChange(row)"
+            label="请输入金额"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.amount }}</span>
+        </template>
+        <template slot="dc" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.dc" placeholder="请选择" size="small" @change="dcChange(row)">
+            <el-option v-for="item in dcOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+         <span v-else>{{ row.dc == "D" ? "收" : "付" }}</span>
+        </template>
+        <template slot="isTax" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.isTax" placeholder="请选择" size="small" @change="isTaxChange(row)">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+          <span v-else>{{ row.isTax == 1 ? "含税" : "不含税" }}</span>
+        </template>
+        <template slot="taxRate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.taxRate"
+            @change="calculateChange(row)"
+            label="请输入税率"
+            size="small"
+            :controls="false"
+            :min="0"
+            :disabled="row.isTax == 0"
+          ></el-input-number>
+          <span v-else>{{ row.taxRate }}</span>
+        </template>
+        <template slot="menu" slot-scope="{ row, index }">
+          <el-button type="text" size="small" @click="rowEdit(row)" :disabled="row.status == 1 || disabled">{{
+            row.$cellEdit ? "保存" : "编辑"
+          }}</el-button>
+          <el-button type="text" size="small" @click="rowDel(row, index)" :disabled="row.status == 1 || disabled">删除</el-button>
+        </template>
+      </avue-crud>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button v-if="form.cashierStatus == 0" size="mini" type="success" @click="allClick('申请出纳')" :disabled="disabled">申请出纳</el-button>
+        <el-button v-if="form.cashierStatus == 1" size="mini" type="danger" @click="allClick('撤销申请出纳')" :disabled="disabled"
+          >撤销申请出纳</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { MktSlotQuotation, quotationImportBatch } from "@/api/iosBasicData/bills";
+import dicSelect from "@/components/dicSelect/main";
+import { getListAll, submit, remove, applyCashier, revokeCashier } from "@/api/iosBasicData/cashier.js";
+import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
+export default {
+  props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: { dicSelect },
+  data() {
+    return {
+      form: {},
+      data: [],
+      options: [
+        {
+          value: 0,
+          label: "不含税"
+        },
+        {
+          value: 1,
+          label: "含税"
+        }
+      ],
+      dcOptions: [
+        {
+          value: "D",
+          label: "收"
+        },
+        {
+          value: "C",
+          label: "付"
+        }
+      ],
+      dialogVisible: false,
+      loading: false,
+      option: {
+        height: 500,
+        calcHeight: 30,
+        border: true,
+        // index: true,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        // menu: false,
+        menuWidth: 100,
+        header: false,
+        align: "center",
+        column: [
+          {
+            label: "index",
+            prop: "index",
+            width: "55",
+            headerslot: true
+          },
+          {
+            label: "状态",
+            prop: "status",
+            width: "100",
+            type: "select",
+            dicData: [
+              {
+                label: "未出纳",
+                value: "0"
+              },
+              {
+                label: "已出纳",
+                value: "1"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "收/付",
+            prop: "dc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "币别",
+            prop: "curCode",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "汇率",
+            prop: "exrate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "金额",
+            prop: "amount",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "转汇后金额",
+            prop: "amountLoc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "是否含税",
+            prop: "isTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税率",
+            prop: "taxRate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税额",
+            prop: "amountTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "净额",
+            prop: "amountNet",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳人",
+            prop: "cashierName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳时间",
+            prop: "cashierTime",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建人",
+            prop: "createUserName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建时间",
+            prop: "createTime",
+            width: "100",
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
+  },
+  methods: {
+    rowEdit(row) {
+      if (row.$cellEdit) {
+        if (!row.curCode) {
+          return this.$message.error("币别不能为空");
+        }
+        if (!row.exrate) {
+          return this.$message.error("汇率不能为空");
+        }
+        if (!row.amount) {
+          return this.$message.error("金额不能为空或0");
+        }
+        if (row.dc == "D" && row.curCode == "CNY") {
+          if (Number(row.amount) > Number(this.form.amountDr - this.form.actualAmountDr)) {
+            return this.$message.error("金额不能超过剩余出纳收费(RMB):" + Number(this.form.amountDr - this.form.actualAmountDr));
+          }
+        }
+        if (row.dc == "D" && row.curCode == "USD") {
+          if (Number(row.amount) > Number(this.form.amountDrUsd - this.form.actualAmountDrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳收费(USD):" + Number(this.form.amountDrUsd - this.form.actualAmountDrUsd));
+          }
+        }
+        if (row.dc == "C" && row.curCode == "CNY") {
+          if (Number(row.amount) > Number(this.form.amountCr - this.form.actualAmountCr)) {
+            return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountCr - this.form.actualAmountCr));
+          }
+        }
+        if (row.dc == "C" && row.curCode == "USD") {
+          if (Number(row.amount) > Number(this.form.amountCrUsd - this.form.actualAmountCrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountCrUsd - this.form.actualAmountCrUsd));
+          }
+        }
+        submit(row).then(res => {
+          this.$set(row, "$cellEdit", false);
+          this.$message({
+            type: "success",
+            message: "保存成功!"
+          });
+          for (let [key, value] of Object.entries(res.data.data)) {
+            this.$set(row, key, value);
+          }
+        });
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    allClick(name) {
+      if (name == "申请出纳") {
+        for (let item of this.data) {
+          if (!item.id) {
+            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)"
+          });
+          applyCashier({ id: this.form.id })
+            .then(res => {
+              this.$emit("update");
+            })
+            .finally(() => {
+              loading.close();
+            });
+        });
+      }
+      if (name == "撤销申请出纳") {
+        for (let item of this.data) {
+          if (item.status == 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)"
+          });
+          revokeCashier({ id: this.form.id })
+            .then(res => {
+              this.$emit("update");
+            })
+            .finally(() => {
+              loading.close();
+            });
+        });
+      }
+    },
+    rowDel(row, index) {
+      if (row.id) {
+        this.$confirm("确定删除数据?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          remove({ ids: row.id }).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.data.splice(index, 1);
+          });
+        });
+      } else {
+        this.data.splice(index, 1);
+      }
+    },
+    calculateChange(row) {
+      row.amountLoc = Number(Number(row.amount ? row.amount : 0) * Number(row.exrate ? row.exrate : 0)).toFixed(2);
+      row.amountTax = Number(Number(row.amountLoc ? row.amountLoc : 0) * Number(row.taxRate ? row.taxRate / 100 : 0)).toFixed(2);
+      row.amountNet = Number(Number(row.amountLoc ? row.amountLoc : 0) - Number(row.amountTax ? row.amountTax : 0)).toFixed(2);
+    },
+    isTaxChange(row) {
+      row.taxRate = 0;
+      this.calculateChange(row);
+    },
+    dcChange(row) {
+      if (row.dc == "D" && row.curCode == "CNY") {
+        row.amount = Number(this.form.amountDr - this.form.actualAmountDr).toFixed(2);
+      }
+      if (row.dc == "D" && row.curCode == "USD") {
+        row.amount = Number(this.form.amountDrUsd - this.form.actualAmountDrUsd).toFixed(2);
+      }
+      if (row.dc == "C" && row.curCode == "CNY") {
+        row.amount = Number(this.form.amountCr - this.form.actualAmountCr).toFixed(2);
+      }
+      if (row.dc == "C" && row.curCode == "USD") {
+        row.amount = Number(this.form.amountCrUsd - this.form.actualAmountCrUsd).toFixed(2);
+      }
+      this.calculateChange(row);
+    },
+    rowDicChange(name, row, el) {
+      if (name == "curCode") {
+        if (row) {
+          el.exrate = row.exrate;
+          this.dcChange(el);
+        } else {
+          el.exrate = null;
+          this.dcChange(el);
+        }
+      }
+    },
+    addRow() {
+      this.data.push({ $cellEdit: true, isTax: 1, srcId: this.form.id, dc: "C" });
+    },
+    openDialog(row) {
+      this.dialogVisible = true;
+      this.form = row;
+      let obj = {
+        srcId: row.id
+      };
+      this.loading = true;
+      getListAll(obj)
+        .then(res => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    }
+  }
+};
+</script>
+
+<style scoped>
+::v-deep#out-table .back-one {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+
+::v-deep#out-table .back-two {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+</style>

+ 19 - 1
src/views/iosBasicData/PaymentApplication/finstlbillsDetails.vue

@@ -7,6 +7,7 @@
         <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
       </div>
       <div class="add-customer-btn">
+        <el-button v-if="form.id" size="small" type="success" @click="allClick('指示')">指示</el-button>
         <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览 </el-button>
         <el-button
           size="small"
@@ -581,6 +582,7 @@
     </el-dialog>
     <!--报表组件-->
     <reportContainer ref="reportContainer"></reportContainer>
+    <cashier-item ref="cashier" @update="updateCashier" :disabled="editSave"></cashier-item>
   </div>
 </template>
 
@@ -612,6 +614,7 @@ import { getBvesselsList } from "@/api/iosBasicData/bvessels";
 import bcorps from "@/views/iosBasicData/bcorps/index.vue";
 import checkSchedule from "@/components/checkH/checkSchedule.vue";
 import dicSelect from "@/components/dicSelect/main";
+import cashierItem from "./assembly/cashierItem.vue";
 export default {
   components: {
     checkSchedule,
@@ -623,7 +626,8 @@ export default {
     expand,
     finstlbillsitems,
     dicSelect,
-    queryFinstlbillsitems
+    queryFinstlbillsitems,
+    cashierItem
   },
   props: {
     // 编辑还是保存
@@ -981,7 +985,18 @@ export default {
         this.$set(this.form, name, value);
       }
     },
+    allClick(name) {
+      if (name == "指示") {
+        this.$refs.cashier.openDialog(this.form);
+      }
+    },
+    updateCashier() {
+      this.finstlbillsDetailfun(this.form.id, "updateCashier");
+    },
     submit(type) {
+      if (this.form.cashierStatus == 0) {
+        return this.$message.error("请申请出纳!");
+      }
       this.$confirm("确定进行申请操作?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -1158,6 +1173,9 @@ export default {
             this.$set(item, "costDate", []);
             return item;
           });
+          if (type == "updateCashier") {
+            this.$refs.cashier.openDialog(this.form);
+          }
           if (type == "选定行") {
             this.finstlbillslistAccBillV1fun();
           }

+ 396 - 0
src/views/iosBasicData/cashier/components/cashierItem.vue

@@ -0,0 +1,396 @@
+<template>
+  <div>
+    <el-dialog title="指示" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <avue-crud
+        v-if="dialogVisible"
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        id="out-table"
+        :header-cell-class-name="headerClassName"
+        @selection-change="selectionChange"
+        @on-load="onLoad"
+      >
+        <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?type=2&date=' + form.billDate + ' 00:00:00' + '&dc=' + form.dc"
+            :filterable="true"
+            @selectChange="rowDicChange('curCode', $event, row)"
+          ></dic-select>
+          <span v-else>{{ row.curCode }}</span>
+        </template>
+        <template slot="exrate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.exrate"
+            @change="calculateChange(row)"
+            label="请输入汇率"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.exrate }}</span>
+        </template>
+        <template slot="amount" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.amount"
+            @change="calculateChange(row)"
+            label="请输入金额"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.amount }}</span>
+        </template>
+        <template slot="isTax" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.isTax" placeholder="请选择" size="small" @change="isTaxChange(row)">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+          <span v-else>{{ row.isTax == 1 ? "含税" : "不含税" }}</span>
+        </template>
+      </avue-crud>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button size="mini" type="danger" @click="allClick('撤销出纳')" :disabled="selectionList.length == 0">撤销出纳</el-button>
+        <el-button size="mini" type="success" @click="allClick('确认出纳')" :disabled="selectionList.length == 0">确认出纳</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { MktSlotQuotation, quotationImportBatch } from "@/api/iosBasicData/bills";
+import dicSelect from "@/components/dicSelect/main";
+import { getListAll, confirmCashier, revokeConfirmCashier, confirmCashier2, revokeConfirmCashier2 } from "@/api/iosBasicData/cashier.js";
+import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
+export default {
+  props: {},
+  components: { dicSelect },
+  data() {
+    return {
+      selectionList: [],
+      form: {},
+      data: [],
+      options: [
+        {
+          value: 0,
+          label: "不含税"
+        },
+        {
+          value: 1,
+          label: "含税"
+        }
+      ],
+      dialogVisible: false,
+      loading: false,
+      option: {
+        height: 500,
+        calcHeight: 30,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        menu: false,
+        menuWidth: 100,
+        header: false,
+        align: "center",
+        selection: true,
+        tip: false,
+        column: [
+          {
+            label: "状态",
+            prop: "status",
+            width: "100",
+            type: "select",
+            dicData: [
+              {
+                label: "未出纳",
+                value: "0"
+              },
+              {
+                label: "已出纳",
+                value: "1"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "收/付",
+            prop: "dc",
+            width: "100",
+            type: "select",
+            dicData: [
+              {
+                label: "收",
+                value: "D"
+              },
+              {
+                label: "付",
+                value: "C"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "币别",
+            prop: "curCode",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "汇率",
+            prop: "exrate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "金额",
+            prop: "amount",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "转汇后金额",
+            prop: "amountLoc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "是否含税",
+            prop: "isTax",
+            width: "100",
+            type: "select",
+            dicData: [
+              {
+                label: "不含税",
+                value: "0"
+              },
+              {
+                label: "含税",
+                value: "1"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "税率",
+            prop: "taxRate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税额",
+            prop: "amountTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "净额",
+            prop: "amountNet",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳人",
+            prop: "cashierName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳时间",
+            prop: "cashierTime",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建人",
+            prop: "createUserName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建时间",
+            prop: "createTime",
+            width: "100",
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
+  },
+  methods: {
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    allClick(name) {
+      if (name == "确认出纳") {
+        for (let item of this.selectionList) {
+          if (item.status == 1) {
+            return this.$message.error("请选择未出纳的数据");
+          }
+        }
+        this.$confirm("是否确认出纳?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          let obj = {
+            ...this.form,
+            billDate: this.form.billDate + " 00:00:00",
+            applyCashierList: this.selectionList
+          };
+          const loading = this.$loading({
+            lock: true,
+            text: "加载中",
+            spinner: "el-icon-loading",
+            background: "rgba(255,255,255,0.7)"
+          });
+          // 对账和付费申请
+          if (!this.form.type) {
+            confirmCashier(obj)
+              .then(res => {
+                this.openDialog(this.form);
+              })
+              .finally(() => {
+                loading.close();
+              });
+          }
+          // 发票申请
+          if (this.form.type == "申请") {
+            confirmCashier2(obj)
+              .then(res => {
+                this.openDialog(this.form);
+              })
+              .finally(() => {
+                loading.close();
+              });
+          }
+        });
+      }
+      if (name == "撤销出纳") {
+        for (let item of this.selectionList) {
+          if (item.status == 0) {
+            return this.$message.error("请选择已出纳的数据");
+          }
+        }
+        this.$confirm("是否撤销出纳?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          let obj = {
+            ...this.form,
+            billDate: this.form.billDate + " 00:00:00",
+            applyCashierList: this.selectionList
+          };
+          const loading = this.$loading({
+            lock: true,
+            text: "加载中",
+            spinner: "el-icon-loading",
+            background: "rgba(255,255,255,0.7)"
+          });
+          // 对账和付费申请
+          if (!this.form.type) {
+            revokeConfirmCashier(obj)
+              .then(res => {
+                this.openDialog(this.form);
+              })
+              .finally(() => {
+                loading.close();
+              });
+          }
+          // 发票申请
+          if (this.form.type == "申请") {
+            revokeConfirmCashier2(obj)
+              .then(res => {
+                this.openDialog(this.form);
+              })
+              .finally(() => {
+                loading.close();
+              });
+          }
+        });
+      }
+    },
+    openDialog(row) {
+      this.dialogVisible = true;
+      this.form = row;
+      let obj = {
+        srcId: row.id
+      };
+      this.loading = true;
+      getListAll(obj)
+        .then(res => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    }
+  }
+};
+</script>
+
+<style scoped>
+::v-deep#out-table .back-one {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+
+::v-deep#out-table .back-two {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+</style>

+ 701 - 0
src/views/iosBasicData/cashier/index.vue

@@ -0,0 +1,701 @@
+<template>
+  <div>
+    <basic-container v-show="isShow">
+      <div style="margin-top: 10px">
+        <el-tabs type="card" v-model="tabsValue" @tab-click="handleClick">
+          <el-tab-pane label="对账收费" name="对账收费"> </el-tab-pane>
+          <el-tab-pane label="对账付费" name="对账付费"> </el-tab-pane>
+          <el-tab-pane label="付费申请" name="付费申请"> </el-tab-pane>
+          <el-tab-pane label="发票申请" name="发票申请"> </el-tab-pane>
+        </el-tabs>
+      </div>
+      <avue-crud
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        :page.sync="page"
+        id="out-table"
+        :header-cell-class-name="headerClassName"
+        :before-open="beforeOpen"
+        v-model="form"
+        ref="crud"
+        :search.sync="query"
+        @row-update="rowUpdate"
+        @row-save="rowSave"
+        @row-del="rowDel"
+        @search-change="searchChange"
+        @search-reset="searchReset"
+        @selection-change="selectionChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 324)"
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 324)"
+      >
+        <template slot="menu" slot-scope="{ row }">
+          <el-button type="text" size="small" @click="allClick('出纳', row)">出纳</el-button>
+        </template>
+        <template slot="menuLeft">
+          <span style="font-size: 24px;font-weight: 600;">
+            <span style="color: #67C23A;margin-right: 10px;"> CNY:¥{{ amountSubSum.toFixed(2) }}元 </span>
+            <span style="color: #E6A23C;"> USD:${{ amountSubUsdSum.toFixed(2) }}元 </span>
+          </span>
+        </template>
+        <tempalte slot="feeCnNameSearch">
+          <dic-select
+            v-model="query.feeCnName"
+            placeholder="费用名称"
+            key="id"
+            label="cnName"
+            res="records"
+            url="/blade-los/bfees/list"
+            :filterable="true"
+            :remote="true"
+            dataName="cnName"
+          ></dic-select>
+        </tempalte>
+        <template slot="billNo" slot-scope="{ row }">
+          <span class="pointerClick" @click="editfun(row)">{{ row.billNo }} </span>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <cashier-item ref="cashier"></cashier-item>
+  </div>
+</template>
+
+<script>
+import { finstlbillsList, finstlbillsRemove, revokeOffset } from "@/api/iosBasicData/finstlbills";
+import { getBcorpslistByType } from "@/api/iosBasicData/bcorps";
+import { bbusinesstypeList } from "@/api/iosBasicData/bbusinesstype";
+import { fininvoicesList } from "@/api/iosBasicData/fininvoices";
+import dicSelect from "@/components/dicSelect/main";
+import cashierItem from './components/cashierItem.vue'
+export default {
+  components: { dicSelect,cashierItem },
+  data() {
+    return {
+      pageIds: [],
+      amountSubSum: 0,
+      amountSubUsdSum: 0,
+      datekey: Date.now(),
+      selectionList: [], // 多选的数据
+      isShow: true,
+      editSave: false, // 详情是否禁用
+      tabsValue: "对账收费", // tabs切换
+      // 动画
+      loading: false,
+      // 分页
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      query: {}, // 检索条件
+      data: [], // 数据
+      form: {},
+      option: {},
+      optionBack: {
+        height: "auto",
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 24,
+        searchLabelWidth: "100",
+        border: true,
+        index: true,
+        selection: true,
+        dialogClickModal: false,
+        stripe: true,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        searchIcon: true,
+        searchIndex: 3,
+        menuWidth: "100",
+        column: [
+          {
+            label: "往来单位",
+            prop: "corpCnName",
+            search: true,
+            overHidden: true,
+            type: "select",
+            filterable: true,
+            remote: true,
+            dicUrl: "/api/blade-los/bcorps/listByType?cnName={{key}}",
+            dicData: [],
+            searchOrder: 1,
+            props: {
+              label: "cnName",
+              value: "cnName",
+              res: "data.records"
+            }
+          },
+          {
+            label: "MB/L NO",
+            prop: "mblno",
+            search: true,
+            searchOrder: 2,
+            overHidden: true
+          },
+          {
+            label: "JOB NO",
+            prop: "businessNo",
+            width: "120",
+            search: true,
+            searchOrder: 3,
+            overHidden: true
+          },
+          {
+            label: "HB/L NO",
+            prop: "hblno",
+            search: true,
+            searchOrder: 4,
+            overHidden: true
+          },
+          {
+            label: "ACCT NO",
+            prop: "accountNo",
+            width: "100",
+            search: true,
+            searchOrder: 5,
+            overHidden: true
+          },
+          {
+            label: "业务类型",
+            prop: "businessType",
+            hide: false,
+            overHidden: true,
+            type: "select",
+            dicData: [],
+            props: {
+              label: "cnName",
+              value: "code"
+            }
+          },
+          {
+            label: "来源类型",
+            prop: "srcType",
+            overHidden: true
+          },
+          {
+            label: "业务类型",
+            prop: "type",
+            hide: true,
+            overHidden: true
+          },
+          {
+            label: "单据编号",
+            prop: "billNo",
+            search: true,
+            overHidden: true
+          },
+          {
+            label: "来源单号",
+            prop: "requestNo",
+            search: true,
+            overHidden: true
+          },
+          {
+            label: "发票抬头",
+            prop: "invCorpCnName",
+            hide: true,
+            overHidden: true
+          },
+          {
+            label: "费用名称",
+            prop: "feeCnName",
+            search: true,
+            overHidden: true
+          },
+          {
+            label: "申请人",
+            prop: "createUserName",
+            overHidden: true
+          },
+          {
+            label: "结算日期",
+            prop: "billDate",
+            overHidden: true,
+            width: "150"
+          },
+
+          {
+            label: "结算日期起",
+            prop: "billDateStart",
+            search: true,
+            overHidden: true,
+            hide: true,
+            searchLabelWidth: "100",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss"
+          },
+          {
+            label: "结算日期止",
+            prop: "billDateEnd",
+            search: true,
+            overHidden: true,
+            hide: true,
+            searchLabelWidth: "100",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss"
+          },
+          {
+            label: "单据开始日期",
+            prop: "businessDateStart",
+            search: true,
+            overHidden: true,
+            hide: true,
+            searchLabelWidth: "100",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss"
+          },
+          {
+            label: "单据结束日期",
+            prop: "businessDateEnd",
+            search: true,
+            overHidden: true,
+            hide: true,
+            searchLabelWidth: "100",
+            type: "date",
+            format: "yyyy-MM-dd",
+            valueFormat: "yyyy-MM-dd HH:mm:ss"
+          },
+          // {
+          //     label: "单据日期",
+          //     prop: "billDate",
+          //     search:true,
+          //     overHidden:true,
+          //     searchProp: 'billDateList',
+          //     type: "daterange",
+          //     searchRange: true,
+          //     searchDefaultTime: ["00:00:00", "23:59:59"],
+          //     format: "yyyy-MM-dd",
+          //     valueFormat: "yyyy-MM-dd HH:mm:ss"
+          // },
+          {
+            label: "提交日期",
+            prop: "auditDateFrom",
+            width: "140",
+            overHidden: true
+          },
+          {
+            label: "审核日期",
+            prop: "auditDateTo",
+            width: "140",
+            overHidden: true
+          },
+          {
+            label: "收/付",
+            prop: "dc",
+            width: "140",
+            // search: true,
+            type: "select",
+            dicData: [
+              {
+                id: "C",
+                name: "付款"
+              },
+              {
+                id: "D",
+                name: "收款"
+              }
+            ],
+            props: {
+              label: "name",
+              value: "id"
+            },
+            overHidden: true
+          },
+          {
+            label: "对账单号",
+            prop: "checkNo",
+            search: true,
+            width: "100",
+            searchOrder: 6,
+            overHidden: true
+          },
+          {
+            label: "船名",
+            prop: "vesselCnName",
+            search: true,
+            searchOrder: 7,
+            overHidden: true
+          },
+          {
+            label: "航次",
+            prop: "voyageNo",
+            search: true,
+            searchOrder: 8,
+            overHidden: true
+          },
+          {
+            label: "CNY",
+            prop: "amountSub",
+            overHidden: true
+          },
+          {
+            label: "USD",
+            prop: "amountSubUsd",
+            overHidden: true
+          },
+          {
+            label: "事由",
+            prop: "remarks",
+            overHidden: true
+          }
+        ]
+      },
+      saberUserInfo: {} // 当前登录人个人信息
+    };
+  },
+  async created() {
+    // 获取当前登录人个人信息
+    this.saberUserInfo = JSON.parse(localStorage.getItem("saber-userInfo")).content;
+    this.option = await this.getColumnData(this.getColumnName(324), this.optionBack);
+    if (this.$route.query.billId) {
+      // 从审批里查看跳进来的
+      this.editFun({ id: this.$route.query.billId });
+    }
+    this.$store.commit("JSZX_IN_DETAIL");
+    this.getBcorpslistByTypefun();
+    this.bbusinesstypeListfun();
+  },
+  activated() {
+    setTimeout(() => {
+      if (this.$route.query.billNo) {
+        this.isShow = false;
+        this.$nextTick(() => {
+          this.$refs.settlementDetailsRef.finstlbillsDetailfun(this.$route.query.billNo);
+        });
+        this.$store.commit("JSZX_IN_DETAIL");
+      }
+    }, 100);
+  },
+  methods: {
+    allClick(name, row) {
+      if (name == "出纳") {
+        this.$refs.cashier.openDialog(row)
+      }
+    },
+    // 获取业务类型
+    bbusinesstypeListfun() {
+      bbusinesstypeList(1, 50).then(res => {
+        this.findObject(this.option.column, "businessType").dicData = res.data.data.records;
+      });
+    },
+    // 获取往来单位数据
+    getBcorpslistByTypefun() {
+      getBcorpslistByType(1, 10).then(res => {
+        this.findObject(this.option.column, "corpCnName").dicData = res.data.data.records;
+      });
+    },
+    revoke(row) {
+      this.$confirm("是否撤销对抵?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        let obj = {
+          ...row,
+          billDate: row.billDate ? row.billDate.slice(0, 10) + " 00:00:00" : null
+        };
+        revokeOffset(obj).then(res => {
+          this.$message.success("操作成功");
+          this.onLoad(this.page, this.search);
+        });
+      });
+    },
+    // 添加
+    addfun() {
+      this.pageIds = [];
+      this.isShow = false;
+      this.editSave = false;
+    },
+    toAddEdit() {
+      this.datekey = Date.now();
+      this.isShow = false;
+      this.editSave = false;
+    },
+    // 编辑
+    editfun(row) {
+      if (this.tabsValue == "付费申请") {
+        if (this.$store.getters.payAppStatus) {
+          this.$alert("付费申请页面已存在,请关闭付费申请再进行操作", "温馨提示", {
+            confirmButtonText: "确定",
+            type: "warning",
+            callback: action => {}
+          });
+        } else {
+          this.$router.push({
+            path: `/iosBasicData/PaymentApplication/index`,
+            query: {
+              id: row.id
+            }
+          });
+        }
+      } else if (this.tabsValue == "对账收费" || this.tabsValue == "对账付费") {
+        this.$router.push({
+          path: `/iosBasicData/finstlbills/index`,
+          query: {
+            id: row.id
+          }
+        });
+      } else if (this.tabsValue == "发票申请") {
+        this.$router.push({
+          path: `/iosBasicData/fininvoicesApplyfor/index`,
+          query: {
+            id: row.id
+          }
+        });
+      }
+    },
+    // tabs 切换
+    handleClick() {
+      if (this.tabsValue == "付费申请") {
+        this.findObject(this.option.column, "invCorpCnName").hide = false;
+        this.findObject(this.option.column, "type").hide = false;
+        this.findObject(this.option.column, "businessType").hide = true;
+      } else {
+        this.findObject(this.option.column, "invCorpCnName").hide = true;
+        this.findObject(this.option.column, "type").hide = true;
+        this.findObject(this.option.column, "businessType").hide = false;
+      }
+      this.amountSubSum = 0;
+      this.amountSubUsdSum = 0;
+      // this.query = {};
+      this.page.currentPage = 1;
+      this.selectionList = [];
+      this.$set(this.query, "billNo", "");
+      this.$set(this.query, "corpCnName", "");
+      this.$set(this.query, "businessDateStart", "");
+      this.$set(this.query, "businessDateEnd", "");
+      this.onLoad(this.page);
+    },
+    // 刷新回调
+    refreshChange() {
+      console.log("刷新回调");
+      this.onLoad(this.page);
+    },
+    // 分页回调
+    currentChange(currentPage) {
+      console.log(currentPage, "分页回调");
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      console.log(pageSize, "分条回调");
+      this.page.pageSize = pageSize;
+    },
+    // 多选回调
+    selectionChange(list) {
+      this.amountSubSum = 0;
+      this.amountSubUsdSum = 0;
+      if (list.length) {
+        list.forEach(e => {
+          this.amountSubSum += Number(e.amountSub);
+          this.amountSubUsdSum += Number(e.amountSubUsd);
+        });
+      }
+      this.selectionList = list;
+    },
+    // 清空回调
+    searchReset() {
+      console.log("清空回调");
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    // 搜索回调
+    searchChange(params, done) {
+      console.log(params, "搜索回调");
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    // 一键删除
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      // 判断是否可以编辑别人业务 true 就没有权限
+      if (this.ModifyOthersfun()) return;
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        let arrId = this.selectionList.map(item => {
+          return item.id;
+        });
+        finstlbillsRemove(arrId.join(",")).then(res => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        });
+      });
+    },
+    // 行删除回调
+    rowDel(row) {
+      console.log("行删除回调");
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        finstlbillsRemove(row.id).then(res => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+        });
+      });
+    },
+    // 判断是否可以编辑别人业务
+    ModifyOthersfun() {
+      let sumArr = [];
+      const h = this.$createElement;
+      // 判断是否有权限
+      if (this.saberUserInfo.role_name.indexOf("允许修改他人业务") != -1) return false;
+      // 当前登录人和选择的创建人对比是不是一个人
+      for (let item of this.selectionList) {
+        if (this.saberUserInfo.user_id != item.createUser) {
+          sumArr.push(h("p", `你没有"允许修改他人业务"权限,请重新选择数据`));
+        }
+      }
+      if (sumArr.length != 0) {
+        this.$confirm("提示", {
+          message: h("div", sumArr),
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).catch(err => {});
+        return true;
+      }
+    },
+    // 新增弹窗确认回调
+    rowSave(row, done, loading) {
+      console.log("新增弹窗确认回调");
+    },
+    // 编辑弹窗确认回调
+    rowUpdate(row, index, done, loading) {
+      console.log("编辑弹窗确认回调");
+      done();
+      loading();
+    },
+    // 打开弹窗的回调
+    beforeOpen(done, type) {
+      console.log(type, "打开弹窗的回调");
+      done();
+    },
+    // 列表获取数据
+    async onLoad(page, params = {}) {
+      this.loading = true;
+      let res = {};
+      if (this.tabsValue == "对账收费") {
+        // 调用 付费申请数据
+        res = await finstlbillsList(page.currentPage, page.pageSize, {
+          ...Object.assign(params, this.query),
+          businessType: "CHK",
+          dc: "D",
+          cashierStatus: 1
+        });
+      } else if (this.tabsValue == "对账付费") {
+        // 调用 付费申请数据
+        res = await finstlbillsList(page.currentPage, page.pageSize, {
+          ...Object.assign(params, this.query),
+          businessType: "CHK",
+          dc: "C",
+          cashierStatus: 1
+        });
+      } else if (this.tabsValue == "付费申请") {
+        // 调用 销项发票业务数据
+        res = await finstlbillsList(page.currentPage, page.pageSize, {
+          ...Object.assign(params, this.query),
+          businessType: "FFSQ",
+          cashierStatus: 1
+        });
+      } else if (this.tabsValue == "发票申请") {
+        // 应收应付 业务数据
+        res = await fininvoicesList(page.currentPage, page.pageSize, {
+          ...Object.assign(params, this.query),
+          type: "申请",
+          billNoFormat: "FPSQ",
+          businessTypeCode: "FPSQ",
+          cashierStatus: 1
+        });
+      }
+      const data = res.data.data;
+      this.page.total = data.total;
+      this.data = data.records;
+      this.loading = false;
+      this.$refs.crud.refreshTable();
+    },
+    //自定义列保存
+    async saveColumnTwo(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 resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    }
+  }
+};
+</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;
+}
+
+/deep/ .el-col-md-8 {
+  width: 24.33333%;
+}
+
+.pointerClick {
+  cursor: pointer;
+  color: #1e9fff;
+}
+</style>

+ 489 - 0
src/views/iosBasicData/fininvoicesApplyfor/assembly/cashierItem.vue

@@ -0,0 +1,489 @@
+<template>
+  <div>
+    <el-dialog title="指示" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <el-tag type="success" style="margin-right: 10px;">剩余出纳收费(RMB){{ Number(form.amountDr - form.actualAmountDr).toFixed(2) }}</el-tag>
+      <el-tag type="info" style="margin-right: 10px;">剩余出纳收费(USD){{ Number(form.amountDrUsd - form.actualAmountDrUsd).toFixed(2) }}</el-tag>
+      <el-tag type="warning" style="margin-right: 10px;">剩余出纳付费(RMB){{ Number(form.amountCr - form.actualAmountCr).toFixed(2) }}</el-tag>
+      <el-tag type="danger">剩余出纳付费(USD){{ Number(form.amountCrUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
+      <avue-crud
+        v-if="dialogVisible"
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        id="out-table"
+        :header-cell-class-name="headerClassName"
+        @on-load="onLoad"
+      >
+        <template slot="indexHeader" slot-scope="{ row }">
+          <el-button type="primary" size="small" icon="el-icon-plus" circle @click="addRow" :disabled="form.cashierStatus == 2||disabled"></el-button>
+        </template>
+        <template slot="index" slot-scope="{ row, index }">
+          <span>{{ index + 1 }}</span>
+        </template>
+        <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?type=2&date=' + form.billDate + ' 00:00:00' + '&dc=' + form.dc"
+            :filterable="true"
+            @selectChange="rowDicChange('curCode', $event, row)"
+          ></dic-select>
+          <span v-else>{{ row.curCode }}</span>
+        </template>
+        <template slot="exrate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.exrate"
+            @change="calculateChange(row)"
+            label="请输入汇率"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.exrate }}</span>
+        </template>
+        <template slot="amount" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.amount"
+            @change="calculateChange(row)"
+            label="请输入金额"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.amount }}</span>
+        </template>
+        <template slot="dc" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.dc" placeholder="请选择" size="small" @change="dcChange(row)">
+            <el-option v-for="item in dcOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+          <span v-else>{{ row.dc == "D" ? "收" : "付" }}</span>
+        </template>
+        <template slot="isTax" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.isTax" placeholder="请选择" size="small" @change="isTaxChange(row)">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+          <span v-else>{{ row.isTax == 1 ? "含税" : "不含税" }}</span>
+        </template>
+        <template slot="taxRate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.taxRate"
+            @change="calculateChange(row)"
+            label="请输入税率"
+            size="small"
+            :controls="false"
+            :min="0"
+            :disabled="row.isTax == 0"
+          ></el-input-number>
+          <span v-else>{{ row.taxRate }}</span>
+        </template>
+        <template slot="menu" slot-scope="{ row, index }">
+          <el-button type="text" size="small" @click="rowEdit(row)" :disabled="row.status == 1||disabled">{{ row.$cellEdit ? "保存" : "编辑" }}</el-button>
+          <el-button type="text" size="small" @click="rowDel(row, index)" :disabled="row.status == 1||disabled">删除</el-button>
+        </template>
+      </avue-crud>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button v-if="form.cashierStatus == 0" size="mini" type="success" @click="allClick('申请出纳')" :disabled="disabled">申请出纳</el-button>
+        <el-button v-if="form.cashierStatus == 1" size="mini" type="danger" @click="allClick('撤销申请出纳')" :disabled="disabled">撤销申请出纳</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { MktSlotQuotation, quotationImportBatch } from "@/api/iosBasicData/bills";
+import dicSelect from "@/components/dicSelect/main";
+import { getListAll, submit, remove, applyCashier2, revokeCashier2 } from "@/api/iosBasicData/cashier.js";
+import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
+export default {
+  props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: { dicSelect },
+  data() {
+    return {
+      form: {},
+      data: [],
+      options: [
+        {
+          value: 0,
+          label: "不含税"
+        },
+        {
+          value: 1,
+          label: "含税"
+        }
+      ],
+      dcOptions: [
+        {
+          value: "D",
+          label: "收"
+        },
+        {
+          value: "C",
+          label: "付"
+        }
+      ],
+      dialogVisible: false,
+      loading: false,
+      option: {
+        height: 500,
+        calcHeight: 30,
+        border: true,
+        // index: true,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        // menu: false,
+        menuWidth: 100,
+        header: false,
+        align: "center",
+        column: [
+          {
+            label: "index",
+            prop: "index",
+            width: "55",
+            headerslot: true
+          },
+          {
+            label: "状态",
+            prop: "status",
+            width: "100",
+            type: "select",
+            dicData: [
+              {
+                label: "未出纳",
+                value: "0"
+              },
+              {
+                label: "已出纳",
+                value: "1"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "收/付",
+            prop: "dc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "币别",
+            prop: "curCode",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "汇率",
+            prop: "exrate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "金额",
+            prop: "amount",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "转汇后金额",
+            prop: "amountLoc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "是否含税",
+            prop: "isTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税率",
+            prop: "taxRate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税额",
+            prop: "amountTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "净额",
+            prop: "amountNet",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳人",
+            prop: "cashierName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳时间",
+            prop: "cashierTime",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建人",
+            prop: "createUserName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建时间",
+            prop: "createTime",
+            width: "100",
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
+  },
+  methods: {
+    rowEdit(row) {
+      if (row.$cellEdit) {
+        if (!row.curCode) {
+          return this.$message.error("币别不能为空");
+        }
+        if (!row.exrate) {
+          return this.$message.error("汇率不能为空");
+        }
+        if (!row.amount) {
+          return this.$message.error("金额不能为空或0");
+        }
+        if (row.dc == "D" && row.curCode == "CNY") {
+          if (Number(row.amount) > Number(this.form.amountDr - this.form.actualAmountDr)) {
+            return this.$message.error("金额不能超过剩余出纳收费(RMB):" + Number(this.form.amountDr - this.form.actualAmountDr));
+          }
+        }
+        if (row.dc == "D" && row.curCode == "USD") {
+          if (Number(row.amount) > Number(this.form.amountDrUsd - this.form.actualAmountDrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳收费(USD):" + Number(this.form.amountDrUsd - this.form.actualAmountDrUsd));
+          }
+        }
+        if (row.dc == "C" && row.curCode == "CNY") {
+          if (Number(row.amount) > Number(this.form.amountCr - this.form.actualAmountCr)) {
+            return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountCr - this.form.actualAmountCr));
+          }
+        }
+        if (row.dc == "C" && row.curCode == "USD") {
+          if (Number(row.amount) > Number(this.form.amountCrUsd - this.form.actualAmountCrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountCrUsd - this.form.actualAmountCrUsd));
+          }
+        }
+        submit(row).then(res => {
+          this.$set(row, "$cellEdit", false);
+          this.$message({
+            type: "success",
+            message: "保存成功!"
+          });
+          
+          for (let [key, value] of Object.entries(res.data.data)) {
+             this.$set(row, key,value);
+          }
+        });
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    allClick(name) {
+      if (name == "申请出纳") {
+        for (let item of this.data) {
+          if (!item.id) {
+            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)"
+          });
+          applyCashier2({ id: this.form.id })
+            .then(res => {
+              this.$emit("update");
+            })
+            .finally(() => {
+              loading.close();
+            });
+        });
+      }
+      if (name == "撤销申请出纳") {
+        for (let item of this.data) {
+          if (item.status == 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)"
+          });
+          revokeCashier2({ id: this.form.id })
+            .then(res => {
+              this.$emit("update");
+            })
+            .finally(() => {
+              loading.close();
+            });
+        });
+      }
+    },
+    rowDel(row, index) {
+      if (row.id) {
+        this.$confirm("确定删除数据?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          remove({ ids: row.id }).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.data.splice(index, 1);
+          });
+        });
+      } else {
+        this.data.splice(index, 1);
+      }
+    },
+    calculateChange(row) {
+      row.amountLoc = Number(Number(row.amount ? row.amount : 0) * Number(row.exrate ? row.exrate : 0)).toFixed(2);
+      row.amountTax = Number(Number(row.amountLoc ? row.amountLoc : 0) * Number(row.taxRate ? row.taxRate / 100 : 0)).toFixed(2);
+      row.amountNet = Number(Number(row.amountLoc ? row.amountLoc : 0) - Number(row.amountTax ? row.amountTax : 0)).toFixed(2);
+    },
+    isTaxChange(row) {
+      row.taxRate = 0;
+      this.calculateChange(row);
+    },
+    dcChange(row) {
+      if (row.dc == "D" && row.curCode == "CNY") {
+        row.amount = Number(this.form.amountDr - this.form.actualAmountDr).toFixed(2);
+      }
+      if (row.dc == "D" && row.curCode == "USD") {
+        row.amount = Number(this.form.amountDrUsd - this.form.actualAmountDrUsd).toFixed(2);
+      }
+      if (row.dc == "C" && row.curCode == "CNY") {
+        row.amount = Number(this.form.amountCr - this.form.actualAmountCr).toFixed(2);
+      }
+      if (row.dc == "C" && row.curCode == "USD") {
+        row.amount = Number(this.form.amountCrUsd - this.form.actualAmountCrUsd).toFixed(2);
+      }
+      this.calculateChange(row);
+    },
+    rowDicChange(name, row, el) {
+      if (name == "curCode") {
+        if (row) {
+          el.exrate = row.exrate;
+          this.dcChange(el);
+        } else {
+          el.exrate = null;
+          this.dcChange(el);
+        }
+      }
+    },
+    addRow() {
+      this.data.push({ $cellEdit: true, isTax: 1, srcId: this.form.id, dc: "D" });
+    },
+    openDialog(row) {
+      this.dialogVisible = true;
+      this.form = row;
+      let obj = {
+        srcId: row.id
+      };
+      this.loading = true;
+      getListAll(obj)
+        .then(res => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    }
+  }
+};
+</script>
+
+<style scoped>
+::v-deep#out-table .back-one {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+
+::v-deep#out-table .back-two {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+</style>

+ 40 - 11
src/views/iosBasicData/fininvoicesApplyfor/fininvoicesDetails.vue

@@ -7,6 +7,7 @@
         <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
       </div>
       <div class="add-customer-btn">
+        <el-button v-if="form.id" size="small" type="success" @click="allClick('指示')">指示</el-button>
         <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览 </el-button>
         <el-button
           size="small"
@@ -853,6 +854,7 @@
     </el-dialog>
     <!--报表组件-->
     <reportContainer ref="reportContainer"></reportContainer>
+    <cashier-item ref="cashier" @update="updateCashier" :disabled="editSave"></cashier-item>
   </div>
 </template>
 
@@ -889,6 +891,8 @@ import checkSchedule from "@/components/checkH/checkSchedule.vue";
 import dicSelect from "@/components/dicSelect/main";
 import { finstlbillslistAccBillByCorp } from "@/api/iosBasicData/finstlbills";
 import { getMonthDate, getYearDate } from "@/util/date";
+import cashierItem from "./assembly/cashierItem.vue";
+import { getListAll } from "@/api/iosBasicData/cashier.js";
 export default {
   components: {
     checkSchedule,
@@ -899,7 +903,8 @@ export default {
     fininvoicesitems,
     fininvoiceitemdetail,
     dicSelect,
-    queryFininvoicesitems
+    queryFininvoicesitems,
+    cashierItem
   },
   data() {
     return {
@@ -1547,18 +1552,39 @@ export default {
         });
       }
     },
+    allClick(name) {
+      if (name == "指示") {
+        this.$refs.cashier.openDialog(this.form);
+      }
+    },
+    updateCashier() {
+      this.fininvoicesDetailfun(this.form.id, "updateCashier");
+    },
     submit(type) {
-      this.$confirm("确定进行发票申请操作?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          this.editCustomer(type);
+      if (this.form.cashierStatus == 0) {
+        return this.$message.error("请申请出纳!");
+      }
+      getListAll({ srcId: this.form.id }).then(res => {
+        if (res.data.data.length == 0) {
+          return this.$message.error("请在指示维护出纳数据");
+        }
+        for (let item of res.data.data) {
+          if (item.status == 0) {
+            return this.$message.error("请在指示维护未出纳数据");
+          }
+        }
+        this.$confirm("确定进行发票申请操作?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .finally(() => {
-          this.saveLoading = false;
-        });
+          .then(() => {
+            this.editCustomer(type);
+          })
+          .finally(() => {
+            this.saveLoading = false;
+          });
+      });
     },
     newbillFun() {
       if (this.statusType) {
@@ -1897,6 +1923,9 @@ export default {
             }
             return item;
           });
+          if (type == "updateCashier") {
+            this.$refs.cashier.openDialog(this.form);
+          }
           if (type == "选定行") {
             this.finstlbillslistAccBillV1fun();
           }

+ 489 - 0
src/views/iosBasicData/finstlbills/assembly/cashierItem.vue

@@ -0,0 +1,489 @@
+<template>
+  <div>
+    <el-dialog title="指示" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <el-tag type="success" style="margin-right: 10px;">剩余出纳收费(RMB){{ Number(form.amountDr - form.actualAmountDr).toFixed(2) }}</el-tag>
+      <el-tag type="info" style="margin-right: 10px;">剩余出纳收费(USD){{ Number(form.amountDrUsd - form.actualAmountDrUsd).toFixed(2) }}</el-tag>
+      <el-tag type="warning" style="margin-right: 10px;">剩余出纳付费(RMB){{ Number(form.amountCr - form.actualAmountCr).toFixed(2) }}</el-tag>
+      <el-tag type="danger">剩余出纳付费(USD){{ Number(form.amountCrUsd - form.actualAmountCrUsd).toFixed(2) }}</el-tag>
+      <avue-crud
+        v-if="dialogVisible"
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        id="out-table"
+        :header-cell-class-name="headerClassName"
+        @on-load="onLoad"
+      >
+        <template slot="indexHeader" slot-scope="{ row }">
+          <el-button type="primary" size="small" icon="el-icon-plus" circle @click="addRow" :disabled="form.cashierStatus == 2||disabled"></el-button>
+        </template>
+        <template slot="index" slot-scope="{ row, index }">
+          <span>{{ index + 1 }}</span>
+        </template>
+        <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?type=2&date=' + form.billDate + ' 00:00:00' + '&dc=' + form.dc"
+            :filterable="true"
+            @selectChange="rowDicChange('curCode', $event, row)"
+          ></dic-select>
+          <span v-else>{{ row.curCode }}</span>
+        </template>
+        <template slot="exrate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.exrate"
+            @change="calculateChange(row)"
+            label="请输入汇率"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.exrate }}</span>
+        </template>
+        <template slot="amount" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.amount"
+            @change="calculateChange(row)"
+            label="请输入金额"
+            size="small"
+            :controls="false"
+          ></el-input-number>
+          <span v-else>{{ row.amount }}</span>
+        </template>
+        <template slot="dc" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.dc" placeholder="请选择" size="small" @change="dcChange(row)">
+            <el-option v-for="item in dcOptions" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+            <span v-else>{{ row.dc == "D" ? "收" : "付" }}</span>>
+        </template>
+        <template slot="isTax" slot-scope="{ row }">
+          <el-select v-if="row.$cellEdit" v-model="row.isTax" placeholder="请选择" size="small" @change="isTaxChange(row)">
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
+          </el-select>
+          <span v-else>{{ row.isTax == 1 ? "含税" : "不含税" }}</span>
+        </template>
+        <template slot="taxRate" slot-scope="{ row }">
+          <el-input-number
+            v-if="row.$cellEdit"
+            style="width: 100%;"
+            v-model="row.taxRate"
+            @change="calculateChange(row)"
+            label="请输入税率"
+            size="small"
+            :controls="false"
+            :min="0"
+            :disabled="row.isTax == 0"
+          ></el-input-number>
+          <span v-else>{{ row.taxRate }}</span>
+        </template>
+        <template slot="menu" slot-scope="{ row, index }">
+          <el-button type="text" size="small" @click="rowEdit(row)" :disabled="row.status == 1||disabled">{{ row.$cellEdit ? "保存" : "编辑" }}</el-button>
+          <el-button type="text" size="small" @click="rowDel(row, index)" :disabled="row.status == 1||disabled">删除</el-button>
+        </template>
+      </avue-crud>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button v-if="form.cashierStatus == 0" size="mini" type="success" @click="allClick('申请出纳')" :disabled="disabled">申请出纳</el-button>
+        <el-button v-if="form.cashierStatus == 1" size="mini" type="danger" @click="allClick('撤销申请出纳')" :disabled="disabled">撤销申请出纳</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { MktSlotQuotation, quotationImportBatch } from "@/api/iosBasicData/bills";
+import dicSelect from "@/components/dicSelect/main";
+import { getListAll, submit, remove, applyCashier, revokeCashier } from "@/api/iosBasicData/cashier.js";
+import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
+export default {
+  props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: { dicSelect },
+  data() {
+    return {
+      form: {},
+      data: [],
+      options: [
+        {
+          value: 0,
+          label: "不含税"
+        },
+        {
+          value: 1,
+          label: "含税"
+        }
+      ],
+      dcOptions: [
+        {
+          value: "D",
+          label: "收"
+        },
+        {
+          value: "C",
+          label: "付"
+        }
+      ],
+      dialogVisible: false,
+      loading: false,
+      option: {
+        height: 500,
+        calcHeight: 30,
+        border: true,
+        // index: true,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        // menu: false,
+        menuWidth: 100,
+        header: false,
+        align: "center",
+        column: [
+          {
+            label: "index",
+            prop: "index",
+            width: "55",
+            headerslot: true
+          },
+          {
+            label: "状态",
+            prop: "status",
+            width: "100",
+            type: "select",
+            dicData: [
+              {
+                label: "未出纳",
+                value: "0"
+              },
+              {
+                label: "已出纳",
+                value: "1"
+              }
+            ],
+            overHidden: true
+          },
+          {
+            label: "收/付",
+            prop: "dc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "币别",
+            prop: "curCode",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "汇率",
+            prop: "exrate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "金额",
+            prop: "amount",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "转汇后金额",
+            prop: "amountLoc",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "是否含税",
+            prop: "isTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税率",
+            prop: "taxRate",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "税额",
+            prop: "amountTax",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "净额",
+            prop: "amountNet",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳人",
+            prop: "cashierName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "出纳时间",
+            prop: "cashierTime",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建人",
+            prop: "createUserName",
+            width: "100",
+            overHidden: true
+          },
+          {
+            label: "创建时间",
+            prop: "createTime",
+            width: "100",
+            overHidden: true
+          }
+        ]
+      }
+    };
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(309.6), this.optionBack);
+  },
+  methods: {
+    rowEdit(row) {
+      if (row.$cellEdit) {
+        if (!row.curCode) {
+          return this.$message.error("币别不能为空");
+        }
+        if (!row.exrate) {
+          return this.$message.error("汇率不能为空");
+        }
+        if (!row.amount) {
+          return this.$message.error("金额不能为空或0");
+        }
+        if (row.dc == "D" && row.curCode == "CNY") {
+          if (Number(row.amount) > Number(this.form.amountDr - this.form.actualAmountDr)) {
+            return this.$message.error("金额不能超过剩余出纳收费(RMB):" + Number(this.form.amountDr - this.form.actualAmountDr));
+          }
+        }
+        if (row.dc == "D" && row.curCode == "USD") {
+          if (Number(row.amount) > Number(this.form.amountDrUsd - this.form.actualAmountDrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳收费(USD):" + Number(this.form.amountDrUsd - this.form.actualAmountDrUsd));
+          }
+        }
+        if (row.dc == "C" && row.curCode == "CNY") {
+          if (Number(row.amount) > Number(this.form.amountCr - this.form.actualAmountCr)) {
+            return this.$message.error("金额不能超过剩余出纳付费(RMB):" + Number(this.form.amountCr - this.form.actualAmountCr));
+          }
+        }
+        if (row.dc == "C" && row.curCode == "USD") {
+          if (Number(row.amount) > Number(this.form.amountCrUsd - this.form.actualAmountCrUsd)) {
+            return this.$message.error("金额不能超过剩余出纳付费(USD):" + Number(this.form.amountCrUsd - this.form.actualAmountCrUsd));
+          }
+        }
+        submit(row).then(res => {
+          this.$set(row, "$cellEdit", false);
+          this.$message({
+            type: "success",
+            message: "保存成功!"
+          });
+        
+           for (let [key, value] of Object.entries(res.data.data)) {
+             this.$set(row, key,value);
+          }
+        });
+      } else {
+        this.$set(row, "$cellEdit", true);
+      }
+    },
+    allClick(name) {
+      if (name == "申请出纳") {
+        for (let item of this.data) {
+          if (!item.id) {
+            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)"
+          });
+          applyCashier({ id: this.form.id })
+            .then(res => {
+              this.$emit("update");
+            })
+            .finally(() => {
+              loading.close();
+            });
+        });
+      }
+      if (name == "撤销申请出纳") {
+        for (let item of this.data) {
+          if (item.status == 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)"
+          });
+          revokeCashier({ id: this.form.id })
+            .then(res => {
+              this.$emit("update");
+            })
+            .finally(() => {
+              loading.close();
+            });
+        });
+      }
+    },
+    rowDel(row, index) {
+      if (row.id) {
+        this.$confirm("确定删除数据?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          remove({ ids: row.id }).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.data.splice(index, 1);
+          });
+        });
+      } else {
+        this.data.splice(index, 1);
+      }
+    },
+    calculateChange(row) {
+      row.amountLoc = Number(Number(row.amount ? row.amount : 0) * Number(row.exrate ? row.exrate : 0)).toFixed(2);
+      row.amountTax = Number(Number(row.amountLoc ? row.amountLoc : 0) * Number(row.taxRate ? row.taxRate / 100 : 0)).toFixed(2);
+      row.amountNet = Number(Number(row.amountLoc ? row.amountLoc : 0) - Number(row.amountTax ? row.amountTax : 0)).toFixed(2);
+    },
+    isTaxChange(row) {
+      row.taxRate = 0;
+      this.calculateChange(row);
+    },
+    dcChange(row) {
+      if (row.dc == "D" && row.curCode == "CNY") {
+        row.amount = Number(this.form.amountDr - this.form.actualAmountDr).toFixed(2);
+      }
+      if (row.dc == "D" && row.curCode == "USD") {
+        row.amount = Number(this.form.amountDrUsd - this.form.actualAmountDrUsd).toFixed(2);
+      }
+      if (row.dc == "C" && row.curCode == "CNY") {
+        row.amount = Number(this.form.amountCr - this.form.actualAmountCr).toFixed(2);
+      }
+      if (row.dc == "C" && row.curCode == "USD") {
+        row.amount = Number(this.form.amountCrUsd - this.form.actualAmountCrUsd).toFixed(2);
+      }
+      this.calculateChange(row);
+    },
+    rowDicChange(name, row, el) {
+      if (name == "curCode") {
+        if (row) {
+          el.exrate = row.exrate;
+          this.dcChange(el);
+        } else {
+          el.exrate = null;
+          this.dcChange(el);
+        }
+      }
+    },
+    addRow() {
+      this.data.push({ $cellEdit: true, isTax: 1, srcId: this.form.id, dc: "D" });
+    },
+    openDialog(row) {
+      this.dialogVisible = true;
+      this.form = row;
+      let obj = {
+        srcId: row.id
+      };
+      this.loading = true;
+      getListAll(obj)
+        .then(res => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    }
+  }
+};
+</script>
+
+<style scoped>
+::v-deep#out-table .back-one {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+
+::v-deep#out-table .back-two {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+</style>

+ 47 - 39
src/views/iosBasicData/finstlbills/finstlbillsDetails.vue

@@ -7,17 +7,9 @@
         <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
       </div>
       <div class="add-customer-btn">
-        <!--<el-button  size="small" type="success" style="margin-right: 8px"-->
-        <!--            :loading="saveLoading" >提取利润及放单-->
-        <!--</el-button>-->
-        <el-button size="small" style="margin-right: 8px" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览 </el-button>
-        <el-button
-          size="small"
-          style="margin-right: 8px"
-          v-if="roleName.indexOf('admin') != -1"
-          :loading="saveLoading"
-          :disabled="!form.id"
-          @click="DesignreportDialog = true"
+        <el-button v-if="form.id" size="small" type="success" @click="allClick('指示')">指示</el-button>
+        <el-button size="small" :loading="saveLoading" :disabled="!form.id" @click="previewreportfun">预 览</el-button>
+        <el-button size="small" v-if="roleName.indexOf('admin') != -1" :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true"
           >报表设计
         </el-button>
         <el-button type="success" size="small" :disabled="!form.id" plain @click="newbillFun">新建账单 </el-button>
@@ -25,7 +17,6 @@
           size="small"
           type="danger"
           plain
-          style="margin-right: 8px"
           :disabled="!form.id || editPower"
           v-if="form.status == 3"
           :loading="saveLoading"
@@ -36,26 +27,16 @@
           size="small"
           type="success"
           plain
-          style="margin-right: 8px"
           :disabled="!form.id || editPower"
           v-if="form.status == 2"
           :loading="saveLoading"
           @click="submit('确认完成')"
           >确认完成
         </el-button>
-        <el-button
-          size="small"
-          type="primary"
-          style="margin-right: 8px"
-          v-if="editSave"
-          :disabled="submitType || editPower"
-          :loading="saveLoading"
-          @click="editHandle"
+        <el-button size="small" type="primary" v-if="editSave" :disabled="submitType || editPower" :loading="saveLoading" @click="editHandle"
           >编 辑
         </el-button>
-        <el-button size="small" type="primary" style="margin-right: 8px" v-else :disabled="submitType" :loading="saveLoading" @click="editCustomer()"
-          >保 存
-        </el-button>
+        <el-button size="small" type="primary" v-else :disabled="submitType" :loading="saveLoading" @click="editCustomer()">保 存 </el-button>
       </div>
     </div>
 
@@ -434,7 +415,7 @@
                       :datalist="dcData"
                       :selectValue="form.dc"
                       :clearable="true"
-                      :disabled="editSave"
+                      :disabled="true"
                       :buttonIf="false"
                       placeholder="请选择收/付"
                       @corpChange="corpChange($event, 'dc')"
@@ -770,6 +751,7 @@
 
     <!--报表组件-->
     <reportContainer ref="reportContainer"></reportContainer>
+    <cashier-item ref="cashier" @update="updateCashier" :disabled="editSave"></cashier-item>
   </div>
 </template>
 
@@ -805,8 +787,10 @@ import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assemb
 import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
 import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
 import dicSelect from "@/components/dicSelect/main";
+import cashierItem from "./assembly/cashierItem.vue";
+import { getListAll } from "@/api/iosBasicData/cashier.js";
 export default {
-  components: { reportContainer, reportformsList, reports, SearchQuery, expand, finstlbillsitems, dicSelect, queryfinstlbillsitems },
+  components: { reportContainer, reportformsList, reports, SearchQuery, expand, finstlbillsitems, dicSelect, queryfinstlbillsitems, cashierItem },
   props: {
     // 编辑还是保存
     editSave: {
@@ -1200,24 +1184,45 @@ export default {
           });
       }
     },
+    allClick(name) {
+      if (name == "指示") {
+        this.$refs.cashier.openDialog(this.form);
+      }
+    },
+    updateCashier() {
+      this.finstlbillsDetailfun(this.form.id, "updateCashier");
+    },
     submit(type) {
       for (let item of this.tableData) {
         if (item.isChecked != 1) {
           return this.$message.error("明细数据未完成对账!");
         }
       }
-      this.$confirm("确定进行确认完成操作?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          this.editCustomer(type);
+      if (this.form.cashierStatus == 0) {
+        return this.$message.error("请申请出纳!");
+      }
+      getListAll({ srcId: this.form.id }).then(res => {
+        if (res.data.data.length == 0) {
+          return this.$message.error("请在指示维护出纳数据");
+        }
+        for (let item of res.data.data) {
+          if (item.status == 0) {
+            return this.$message.error("请在指示维护未出纳数据");
+          }
+        }
+        this.$confirm("确定进行确认完成操作?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .catch(() => {
-          this.pageLoading = false;
-          this.saveLoading = false;
-        });
+          .then(() => {
+            this.editCustomer(type);
+          })
+          .catch(() => {
+            this.pageLoading = false;
+            this.saveLoading = false;
+          });
+      });
     },
     // 详情接口
     finstlbillsDetailfun(id, type) {
@@ -1269,6 +1274,9 @@ export default {
           this.form.isChecked = this.form.isChecked + "";
           this.form.billStatus = this.form.billStatus + "";
           this.form.isInvoice = this.form.isInvoice + "";
+          if (type == "updateCashier") {
+            this.$refs.cashier.openDialog(this.form);
+          }
         })
         .finally(() => {
           this.pageLoading = false;
@@ -1399,8 +1407,8 @@ export default {
           item.accBillNo = item.billNo;
           item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo;
           item.dc = item.accountDc; // 收付
-          item.isSignfor=0
-          item.isChecked=0
+          item.isSignfor = 0;
+          item.isChecked = 0;
           if (item.curCode == "CNY") {
             this.$set(item, "amountRMB", item.amount);
             this.$set(item, "currentInvoiceAmountRMB", Number(item.currentInvoiceAmount ? item.currentInvoiceAmount : 0));