|
@@ -0,0 +1,528 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <basic-container>
|
|
|
+ <avue-crud :option="option"
|
|
|
+ :table-loading="loading"
|
|
|
+ :data="data"
|
|
|
+ :page.sync="page"
|
|
|
+ :permission="permissionList"
|
|
|
+ id="out-table"
|
|
|
+ :header-cell-class-name="headerClassName"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ v-model="form"
|
|
|
+ ref="crud"
|
|
|
+ @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"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 314)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 314)"
|
|
|
+ @on-load="onLoad" >
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-button type="success"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ plain
|
|
|
+ @click="newbillFun">新建账单
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ plain
|
|
|
+ v-if="permission.finstlbills_delete"
|
|
|
+ @click="handleDelete">删 除
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ </basic-container>
|
|
|
+
|
|
|
+ <finstlbills_details v-if=""></finstlbills_details>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import {finstlbillsList, finstlbillsDetail, finstlbillsSubmit, finstlbillsRemove} from "@/api/iosBasicData/finstlbills";
|
|
|
+ import {mapGetters} from "vuex";
|
|
|
+ import finstlbillsDetails from '@/views/iosBasicData/finstlbills/finstlbillsDetails.vue'
|
|
|
+
|
|
|
+ export default {
|
|
|
+ components:{finstlbillsDetails},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ query: {},
|
|
|
+ loading: true,
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ selectionList: [],
|
|
|
+ option:{},
|
|
|
+ optionBack: {
|
|
|
+ height:'auto',
|
|
|
+ calcHeight: 30,
|
|
|
+ tip: false,
|
|
|
+ searchShow: true,
|
|
|
+ searchMenuSpan: 6,
|
|
|
+ border: true,
|
|
|
+ index: true,
|
|
|
+ viewBtn: true,
|
|
|
+ selection: true,
|
|
|
+ dialogClickModal: false,
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "业务类型",
|
|
|
+ prop: "businessType",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "单据编号",
|
|
|
+ prop: "billNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "对账/结算日期",
|
|
|
+ prop: "billDate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户 id",
|
|
|
+ prop: "corpId",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户中文名称",
|
|
|
+ prop: "corpCnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户英文名称",
|
|
|
+ prop: "corpEnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户是否已签约",
|
|
|
+ prop: "corpIsSigned",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户约号",
|
|
|
+ prop: "corpArgreementNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "客户账期备注",
|
|
|
+ prop: "corpAccRemarks",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务类型,用于检索费用",
|
|
|
+ prop: "businessTypes",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务单据编号,用于检索费用",
|
|
|
+ prop: "businessNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "账单编号,用于检索费用",
|
|
|
+ prop: "accountNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "对账单编号,用于检索费用",
|
|
|
+ prop: "checkNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务所在部门 Id,用于检索费用",
|
|
|
+ prop: "deptId",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务所在部门",
|
|
|
+ prop: "deptName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务操作 Id,用于检索费用",
|
|
|
+ prop: "operatorId",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务操作",
|
|
|
+ prop: "operatorName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务员 Id,用于检索费用",
|
|
|
+ prop: "salesId",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务员",
|
|
|
+ prop: "salesName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用收付 empty=ALL D-Debit C=Credit",
|
|
|
+ prop: "dc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "币种 empty=ALL",
|
|
|
+ prop: "curCode",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "船名 id",
|
|
|
+ prop: "vesselId",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "中文船名",
|
|
|
+ prop: "vesselCnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "英文船名",
|
|
|
+ prop: "vesselEnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "航次",
|
|
|
+ prop: "voyageNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "MB/L NO",
|
|
|
+ prop: "mblno",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "HB/L NO",
|
|
|
+ prop: "hblno",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "财务开始日期",
|
|
|
+ prop: "accountDateFrom",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "财务结束日期",
|
|
|
+ prop: "accountDateTo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核开始日期",
|
|
|
+ prop: "auditDateFrom",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "审核结束日期",
|
|
|
+ prop: "auditDateTo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "发票号",
|
|
|
+ prop: "invoiceNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "检验检疫 NO",
|
|
|
+ prop: "iqNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用 Id,用于查询费用",
|
|
|
+ prop: "feeId",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用中文名称,用于查询费用",
|
|
|
+ prop: "feeCode",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用中文名称,用于查询费用",
|
|
|
+ prop: "feeCnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "费用英文名称,用于查询费用",
|
|
|
+ prop: "feeEnName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否审核,用于查询费用, 0 全部, 1 是, 2 否",
|
|
|
+ prop: "isApproved",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否签收,用于查询费用, 0 全部, 1 是, 2 否",
|
|
|
+ prop: "isSignfor",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否对账,用于查询费用, 0 全部, 1 是, 2 否",
|
|
|
+ prop: "isChecked",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否销账(结算),用于查询费用(0 全部, 1 是, 2 否)",
|
|
|
+ prop: "isCleared",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否开发票,用于查询费用, 0 全部, 1 待开 2 已开 2 不开",
|
|
|
+ prop: "isInvoice",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否含税价计算, 0 否, 1 是",
|
|
|
+ prop: "isTax",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "凭证类型,记 转",
|
|
|
+ prop: "voucherType",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "凭证号",
|
|
|
+ prop: "voucherNo",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "凭证日期",
|
|
|
+ prop: "voucherDate",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本位币应收(CNY)",
|
|
|
+ prop: "amountDr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本位币应付(CNY)",
|
|
|
+ prop: "amountCr",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "综合 USD 应收(USD) - 非 USD 外币转换为 USD",
|
|
|
+ prop: "amountDrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "综合 USD 应付(USD) - 非 USD 外币转换为 USD",
|
|
|
+ prop: "amountCrUsd",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "合计本位币应收(CNY )",
|
|
|
+ prop: "amountDrLoc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "合计本位币应付(CNY)",
|
|
|
+ prop: "amountCrLoc",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本位币税后应收(CNY)",
|
|
|
+ prop: "amountDrNet",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本位币税后应付(CNY)",
|
|
|
+ prop: "amountCrNet",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "综合 USD 税后应收(USD) - 非 USD 外币转换为 USD",
|
|
|
+ prop: "amountDrUsdNet",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "综合 USD 税后应付(USD) - 非 USD 外币转换为 USD",
|
|
|
+ prop: "amountCrUsdNet",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "合计本位币税后应收(CNY )",
|
|
|
+ prop: "amountDrLocNet",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "合计本位币税后应付(CNY)",
|
|
|
+ prop: "amountCrLocNet",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "版本",
|
|
|
+ prop: "version",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "状态(0 正常 1停用)",
|
|
|
+ prop: "status",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "是否已删除(0 否 1是)",
|
|
|
+ prop: "isDeleted",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ data: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["permission"]),
|
|
|
+ permissionList() {
|
|
|
+ return {
|
|
|
+ addBtn: this.vaildData(this.permission.finstlbills_add, false),
|
|
|
+ viewBtn: this.vaildData(this.permission.finstlbills_view, false),
|
|
|
+ delBtn: this.vaildData(this.permission.finstlbills_delete, false),
|
|
|
+ editBtn: this.vaildData(this.permission.finstlbills_edit, false)
|
|
|
+ };
|
|
|
+ },
|
|
|
+ ids() {
|
|
|
+ let ids = [];
|
|
|
+ this.selectionList.forEach(ele => {
|
|
|
+ ids.push(ele.id);
|
|
|
+ });
|
|
|
+ return ids.join(",");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async created() {
|
|
|
+ this.option = await this.getColumnData(this.getColumnName(314), this.optionBack);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 新建账单
|
|
|
+ newbillFun(){
|
|
|
+
|
|
|
+ },
|
|
|
+ // 添加
|
|
|
+ rowSave(row, done, loading) {
|
|
|
+ finstlbillsSubmit(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ window.console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 保存
|
|
|
+ rowUpdate(row, index, done, loading) {
|
|
|
+ finstlbillsSubmit(row).then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ done();
|
|
|
+ }, error => {
|
|
|
+ loading();
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ rowDel(row) {
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return finstlbillsRemove(row.id);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 批量删除
|
|
|
+ handleDelete() {
|
|
|
+ if (this.selectionList.length === 0) {
|
|
|
+ this.$message.warning("请选择至少一条数据");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm("确定将选择数据删除?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return finstlbillsRemove(this.ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.onLoad(this.page);
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
+ });
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 详情
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ if (["edit", "view"].includes(type)) {
|
|
|
+ finstlbillsDetail(this.form.id).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ searchReset() {
|
|
|
+ this.query = {};
|
|
|
+ this.onLoad(this.page);
|
|
|
+ },
|
|
|
+ searchChange(params, done) {
|
|
|
+ this.query = params;
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page, params);
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ selectionClear() {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.$refs.crud.toggleSelection();
|
|
|
+ },
|
|
|
+ currentChange(currentPage){
|
|
|
+ this.page.currentPage = currentPage;
|
|
|
+ },
|
|
|
+ sizeChange(pageSize){
|
|
|
+ this.page.pageSize = pageSize;
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad(this.page, this.query);
|
|
|
+ },
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ this.loading = true;
|
|
|
+ finstlbillsList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.data = data.records;
|
|
|
+ this.loading = false;
|
|
|
+ this.selectionClear();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //自定义列保存
|
|
|
+ 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;
|
|
|
+}
|
|
|
+</style>
|