Browse Source

货代凭证 2024-2-27

caojunjie 1 year ago
parent
commit
17e704b765

+ 43 - 0
src/api/bvouchertype/index.js

@@ -0,0 +1,43 @@
+import request from '@/router/axios';
+
+export const bvouchertypelist = (current, size, params) => {
+  return request({
+    url: '/api/blade-los/bvouchertype/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const bvouchertypeDetail = (id) => {
+  return request({
+    url: '/api/blade-los/bvouchertype/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const bvouchertypeSubmit = (ids) => {
+  return request({
+    url: '/api/blade-los/bvouchertype/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const bvouchertypeRemove = (row) => {
+  return request({
+    url: '/api/blade-los/bvouchertype/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+

+ 42 - 0
src/api/vouchertemplate/index.js

@@ -0,0 +1,42 @@
+import request from '@/router/axios';
+
+export const vouchertemplatelist = (current, size, params) => {
+  return request({
+    url: '/api/blade-los/voucherTemplate/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const vouchertemplateDetail = (id) => {
+  return request({
+    url: '/api/blade-los/voucherTemplate/detail',
+    method: 'get',
+    params: {
+      id
+    }
+  })
+}
+
+export const vouchertemplateRemove = (ids) => {
+  return request({
+    url: '/api/blade-los/voucherTemplate/remove',
+    method: 'post',
+    params: {
+      ids,
+    }
+  })
+}
+
+export const vouchertemplateSubmit = (row) => {
+  return request({
+    url: '/api/blade-los/voucherTemplate/submit',
+    method: 'post',
+    data: row
+  })
+}
+

+ 8 - 0
src/enums/column-name.js

@@ -1535,6 +1535,14 @@ const columnName = [{
     code: 326.1,
     name: '货运代理-报关-海运出口报关-详情表格'
   },
+  {
+    code: 327,
+    name: '货运代理-基础资料-凭证模板左侧类型'
+  },
+  {
+    code: 328,
+    name: '货运代理-基础资料-凭证模板列表'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

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

@@ -2877,6 +2877,20 @@ export default [{
     }]
   },
   {
+    path: '/iosBasicData/VoucherTemplates/index',
+    component: Layout,
+    hidden: true,
+    children: [{
+      path: '/iosBasicData/VoucherTemplates/index',
+      name: '凭证模板(F)',
+      meta: {
+        i18n: '/iosBasicData/VoucherTemplates/index',
+        keepAlive: true,
+      },
+      component: () => import( /* webpackChunkName: "views" */ '@/views/iosBasicData/VoucherTemplates/index.vue')
+    }]
+  },
+  {
     path: '/iosBasicData/bcorps/index',
     component: Layout,
     hidden: true,

+ 459 - 0
src/views/iosBasicData/VoucherTemplates/index.vue

@@ -0,0 +1,459 @@
+<template>
+    <div>
+        <el-row>
+            <el-col :span="5">
+                <el-scrollbar>
+                    <basic-container>
+                        <avue-tree :option="treeOption" :data="feesTypeData" @node-click="nodeClick">
+                            <template slot="addBtn">
+                                <el-tooltip class="item" effect="dark" content="新建分类" placement="top">
+                                    <i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
+                                       @click="corpTypeVisible = true"></i>
+                                </el-tooltip>
+                            </template>
+                        </avue-tree>
+                    </basic-container>
+                </el-scrollbar>
+            </el-col>
+            <el-col :span="19">
+                <basic-container>
+                    <avue-crud :option="option"
+                               :table-loading="loading"
+                               :data="data"
+                               :page.sync="page"
+                               :search="search"
+                               :permission="permissionList"
+                               :before-open="beforeOpen"
+                               v-model="form"
+                               ref="crud"
+                               id="out-table"
+                               :header-cell-class-name="headerClassName"
+                               @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', 328)"
+                               @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 328)" >
+                        <template slot="menuLeft">
+                            <!--<el-button-->
+                            <!--    type="primary" icon="el-icon-plus"-->
+                            <!--    @click="addfun"-->
+                            <!--    size="small">新增-->
+                            <!--</el-button>-->
+                            <el-button type="danger"
+                                       size="small"
+                                       icon="el-icon-delete"
+                                       plain
+                                       @click="handleDelete">删 除
+                            </el-button>
+                        </template>
+                    </avue-crud>
+                </basic-container>
+            </el-col>
+        </el-row>
+
+        <!--类别弹窗-->
+        <el-dialog title="类别" :visible.sync="corpTypeVisible" append-to-body width="60%" :before-close="corpTypeClose">
+            <div>
+                <bvouchertype></bvouchertype>
+            </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="corpTypeVisible = false">取 消</el-button>
+                <el-button type="primary" @click="corpTypeVisible = false">确 定</el-button>
+            </span>
+        </el-dialog>
+
+    </div>
+</template>
+
+<script>
+    import bvouchertype from "@/views/iosBasicData/bvouchertype/index.vue";
+    import {bvouchertypelist} from "@/api/bvouchertype/index";
+    import {mapGetters} from "vuex";
+    import {vouchertemplatelist, vouchertemplateDetail, vouchertemplateSubmit, vouchertemplateRemove} from "@/api/vouchertemplate/index";
+    export default {
+        components: {bvouchertype},
+        data() {
+            return {
+                treeOption: {
+                    nodeKey: "id",
+                    // lazy: true,
+                    addBtn: false,
+                    menu: false,
+                    size: "small",
+                    props: {
+                        labelText: "标题",
+                        label: "cnName",
+                        value: "value",
+                        children: "children"
+                    }
+                },
+                feesTypeData: [],
+                corpTypeVisible: false,
+                form: {
+                    // currencyCode:'RMB', // 币种代码
+                },
+                query: {},
+                loading: true,
+                page: {
+                    pageSize: 10,
+                    currentPage: 1,
+                    total: 0
+                },
+                search:{},
+                data:[],
+                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: "currencyCode",
+                            type: 'select',
+                            dicUrl:'/api/blade-los/bcurrency/page?current=1&size=20',
+                            props: {
+                                label: "code",
+                                value: "id",
+                                res:'data.records'
+                            },
+                            overHidden:true,
+                        },
+                        {
+                            label: "币别名称",
+                            prop: "currencyName",
+                            overHidden:true,
+                            display: true
+                        },
+                        {
+                            label: "凭证类型",
+                            prop: "voucherType",
+                            overHidden:true,
+                        },
+                        {
+                            label: "凭证名称",
+                            prop: "voucherName",
+                            overHidden:true,
+                        },
+                        {
+                            label: "类型",
+                            prop: "dcType",
+                            overHidden:true,
+                        },
+                        {
+                            label: "科目代码",
+                            prop: "subjectCode",
+                            overHidden:true,
+                        },
+                        {
+                            label: "科目名称",
+                            prop: "subjectName",
+                            overHidden:true,
+                            display: true
+                        },
+                        {
+                            label: "金额方向",
+                            prop: "amountDirection",
+                            overHidden:true,
+                        },
+                        {
+                            label: "静态值",
+                            prop: "staticValue",
+                            overHidden:true,
+                        },
+                        {
+                            label: "附加公式",
+                            prop: "additionalFormulas",
+                            overHidden:true,
+                        },
+                        {
+                            label: "业务类型",
+                            prop: "businessType",
+                            overHidden:true,
+                            display:false,
+                        },
+                        {
+                            label: "创建人",
+                            prop: "createUserName",
+                            overHidden:true,
+                            display:false,
+                        },
+                        {
+                            label: "创建部门",
+                            prop: "createDeptName",
+                            overHidden:true,
+                            display:false,
+                        },
+                        {
+                            label: "创建时间",
+                            prop: "createTime",
+                            overHidden:true,
+                            display:false,
+                        },
+                        {
+                            label: "修改人",
+                            prop: "updateUserName",
+                            overHidden:true,
+                            display:false,
+                        },
+                        {
+                            label: "修改时间",
+                            prop: "updateTime",
+                            overHidden:true,
+                            display:false,
+                        },
+                        {
+                            label: "状态",
+                            prop: "status",
+                            type: 'select',
+                            overHidden:true,
+                            dicData: [{
+                                label: '启用',
+                                value: 0
+                            }, {
+                                label: '停用',
+                                value: 1
+                            }],
+                            value: 0
+                        },
+                        {
+                            label: "备注",
+                            prop: "remarks",
+                            overHidden:true,
+                        },
+                    ]
+                },
+
+            }
+        },
+        computed: {
+            ...mapGetters(["permission"]),
+            permissionList() {
+                return {
+                    // addBtn: this.vaildData(this.permission.bvouchertype_add, false),
+                    // viewBtn: this.vaildData(this.permission.bvouchertype_view, false),
+                    // delBtn: this.vaildData(this.permission.bvouchertype_delete, false),
+                    // editBtn: this.vaildData(this.permission.bvouchertype_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(328), this.optionBack);
+            this.bvouchertypelistfun()
+        },
+        methods:{
+            // // 新增
+            // addfun(){
+            //     this.$refs.crud
+            // },
+            rowSave(row, done, loading) {
+                vouchertemplateSubmit(row).then(() => {
+                    this.onLoad(this.page);
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                    done();
+                }, error => {
+                    loading();
+                    window.console.log(error);
+                });
+            },
+            rowUpdate(row, index, done, loading) {
+                vouchertemplateSubmit(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 vouchertemplateRemove(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 vouchertemplateRemove(this.ids);
+                    })
+                    .then(() => {
+                        this.onLoad(this.page);
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        });
+                        this.$refs.crud.toggleSelection();
+                    });
+            },
+            beforeOpen(done, type) {
+                console.log(type,324)
+                // 如果是添加判断是否选择了左侧类型
+                if (type == 'add') {
+                    if (!this.search.businessTypeId) {
+                        return this.$message.warning('请选择左侧的类型')
+                    }
+                }
+                if (["edit", "view"].includes(type)) {
+                    vouchertemplateDetail(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;
+                vouchertemplatelist(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();
+                });
+            },
+            // 左侧筛选
+            nodeClick(data) {
+                console.log(data,64)
+                this.search.businessTypeId = data.id
+                // this.detailData.businessTypeId = data.id
+                // this.detailData.businessTypeCnName = data.cnName
+                // this.detailData.businessTypeEnName = data.enName
+                // this.detailData.businessTypeCode = data.code
+                this.onLoad(this.page, this.search);
+            },
+            // 获取左侧业务类别数据
+            bvouchertypelistfun() {
+                bvouchertypelist(1,100,).then(res => {
+                    this.feesTypeData = res.data.data.records
+                })
+            },
+            // 类别弹窗关闭
+            corpTypeClose(done) {
+                this.$confirm('确认关闭?')
+                    .then(_ => {
+                        done();
+                    })
+                    .catch(_ => { });
+            },
+            //自定义列保存
+            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;
+}
+
+::v-deep#out-table .back-two {
+    background: #ecf5ff !important;
+}
+</style>

+ 72 - 70
src/views/iosBasicData/accounts/assembly/accountsDialog.vue

@@ -2,82 +2,84 @@
     <div>
         <el-form :model="form" ref="form" label-width="70px" class="demo-ruleForm">
             <el-row :gutter="20">
-                <el-col :span="12">
-                    <el-form-item label="科目编码:" prop="code">
-                        <el-input style="width: 100%;" v-model="form.code"
-                                  size="small" autocomplete="off"
-                                  clearable placeholder="请输入科目编码" >
-                        </el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="科目名称:" prop="cnName">
-                        <el-input style="width: 100%;" v-model="form.cnName"
-                                  size="small" autocomplete="off"
-                                  clearable placeholder="请输入科目名称" >
-                        </el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="方向:" prop="dc">
-                        <search-query :datalist="dcData"
-                                      :selectValue="form.dc"
-                                      :filterable="true"
-                                      :clearable="true"
-                                      :remote="true"
-                                      :buttonIf="false"
-                                      placeholder="请选择方向"
-                                      @corpChange="corpChange($event,'dc')">
-                        </search-query>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="科目类别:" prop="property">
-                        <search-query :datalist="propertyData"
-                                      :selectValue="form.property"
-                                      :filterable="true"
-                                      :clearable="true"
-                                      :remote="true"
-                                      :buttonIf="false"
-                                      placeholder="请选择科目类别"
-                                      :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
-                                      @remoteMethod="propertyWorkDictsfun"
-                                      @corpChange="corpChange($event,'property')"
-                                      @corpFocus="propertyWorkDictsfun">
-                        </search-query>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="上级科目:" prop="parentCode">
-                        <el-input style="width: 100%;" v-model="form.parentCode"
-                                  size="small" autocomplete="off" :disabled="true"
-                                  clearable placeholder="请输入上级科目" >
-                        </el-input>
-                    </el-form-item>
-                </el-col>
-                <el-col :span="12">
-                    <el-form-item label="币种:" prop="curCode">
-                        <search-query :datalist="curData"
-                                      :selectValue="form.curCode"
-                                      :filterable="true"
-                                      :clearable="true"
-                                      :remote="true"
-                                      :buttonIf="false"
-                                      placeholder="请选择币种"
-                                      :forParameter="{key:'id',label:'code',value:'code'}"
-                                      @remoteMethod="getRateListfun"
-                                      @corpChange="corpChange($event,'curCode')"
-                                      @corpFocus="getRateListfun">
-                        </search-query>
-                    </el-form-item>
-                </el-col>
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item label="科目编码:" prop="code">
+                            <el-input style="width: 100%;" v-model="form.code"
+                                      size="small" autocomplete="off"
+                                      clearable placeholder="请输入科目编码" >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="科目名称:" prop="cnName">
+                            <el-input style="width: 100%;" v-model="form.cnName"
+                                      size="small" autocomplete="off"
+                                      clearable placeholder="请输入科目名称" >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="方向:" prop="dc">
+                            <search-query :datalist="dcData"
+                                          :selectValue="form.dc"
+                                          :filterable="true"
+                                          :clearable="true"
+                                          :remote="true"
+                                          :buttonIf="false"
+                                          placeholder="请选择方向"
+                                          @corpChange="corpChange($event,'dc')">
+                            </search-query>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="科目类别:" prop="property">
+                            <search-query :datalist="propertyData"
+                                          :selectValue="form.property"
+                                          :filterable="true"
+                                          :clearable="true"
+                                          :remote="true"
+                                          :buttonIf="false"
+                                          placeholder="请选择科目类别"
+                                          :forParameter="{key:'dictKey',label:'dictValue',value:'dictKey'}"
+                                          @remoteMethod="propertyWorkDictsfun"
+                                          @corpChange="corpChange($event,'property')"
+                                          @corpFocus="propertyWorkDictsfun">
+                            </search-query>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="上级科目:" prop="parentCode">
+                            <el-input style="width: 100%;" v-model="form.parentCode"
+                                      size="small" autocomplete="off" :disabled="true"
+                                      clearable placeholder="请输入上级科目" >
+                            </el-input>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="币种:" prop="curCode">
+                            <search-query :datalist="curData"
+                                          :selectValue="form.curCode"
+                                          :filterable="true"
+                                          :clearable="true"
+                                          :remote="true"
+                                          :buttonIf="false"
+                                          placeholder="请选择币种"
+                                          :forParameter="{key:'id',label:'code',value:'code'}"
+                                          @remoteMethod="getRateListfun"
+                                          @corpChange="corpChange($event,'curCode')"
+                                          @corpFocus="getRateListfun">
+                            </search-query>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
                 <el-col :span="24">
                     <el-form-item label="辅助核算:">
                         <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isItem">项目</el-checkbox>
                         <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isCorp">客户</el-checkbox>
                         <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isDept">部门</el-checkbox>
                         <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isEmpl">职员</el-checkbox>
-                        <el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isStock">库存</el-checkbox>
+                        <!--<el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isStock">库存</el-checkbox>-->
                     </el-form-item>
                 </el-col>
 

+ 18 - 18
src/views/iosBasicData/accounts/index.vue

@@ -209,24 +209,24 @@
               search: true,
                 width: "50",
             },
-            {
-              label: "数量",
-              prop: "isQuantity",
-              overHidden: true,
-              search: true,
-              type:'select',
-                width: "35",
-              dicData:[
-                  {
-                      label:'否',
-                      value:0,
-                  },
-                  {
-                      label:'是',
-                      value:1,
-                  }
-              ]
-            },
+            // {
+            //   label: "数量",
+            //   prop: "isQuantity",
+            //   overHidden: true,
+            //   search: true,
+            //   type:'select',
+            //     width: "35",
+            //   dicData:[
+            //       {
+            //           label:'否',
+            //           value:0,
+            //       },
+            //       {
+            //           label:'是',
+            //           value:1,
+            //       }
+            //   ]
+            // },
             {
               label: "客户",
               prop: "isCorp",

+ 298 - 0
src/views/iosBasicData/bvouchertype/index.vue

@@ -0,0 +1,298 @@
+<template>
+  <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"
+               @on-load="onLoad"
+               @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 327)"
+               @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 327)" >
+      <template slot="menuLeft">
+        <el-button type="danger"
+                   size="small"
+                   icon="el-icon-delete"
+                   plain
+                   @click="handleDelete">删 除
+        </el-button>
+      </template>
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+  import {bvouchertypelist, bvouchertypeDetail, bvouchertypeSubmit, bvouchertypeRemove} from "@/api/bvouchertype/index";
+  import {mapGetters} from "vuex";
+
+  export default {
+    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: "code",
+              rules: [{
+                required: true,
+                message: "请输入代码",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "中文名称",
+              prop: "cnName",
+              rules: [{
+                required: true,
+                message: "请输入中文名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "英文名称",
+              prop: "enName",
+              rules: [{
+                required: true,
+                message: "请输入英文名称",
+                trigger: "blur"
+              }],
+              overHidden:true
+            },
+            {
+                label: "状态",
+                prop: "status",
+                type: 'select',
+                overHidden:true,
+                dicData: [{
+                    label: '启用',
+                    value: 0
+                }, {
+                    label: '停用',
+                    value: 1
+                }],
+                value: 0
+            },
+            {
+              label: "备注",
+              prop: "remarks",
+              overHidden:true
+            },
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          // addBtn: this.vaildData(this.permission.bvouchertype_add, false),
+          // viewBtn: this.vaildData(this.permission.bvouchertype_view, false),
+          // delBtn: this.vaildData(this.permission.bvouchertype_delete, false),
+          // editBtn: this.vaildData(this.permission.bvouchertype_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(327), this.optionBack);
+    },
+    methods: {
+      rowSave(row, done, loading) {
+        bvouchertypeSubmit(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        bvouchertypeSubmit(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 bvouchertypeRemove(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 bvouchertypeRemove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          bvouchertypeDetail(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;
+        bvouchertypelist(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;
+}
+
+::v-deep#out-table .back-two {
+    background: #ecf5ff !important;
+}
+</style>

+ 1 - 0
src/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue

@@ -188,6 +188,7 @@
                         return;
                     }
                     const values = data.map(item => Number(item[column.property]));
+                    // 显示列的统计
                     let arr = ['amountDr','amountCr','amountDrUsd','amountCrUsd']
                     if (arr.indexOf(column.property) != -1) {
                         if (!values.every(value => isNaN(value))) {

+ 21 - 21
src/views/iosBasicData/finvouchers/finvouchersitems.vue

@@ -281,27 +281,27 @@
                                 </search-query>
                             </el-form-item>
                         </el-col>
-                        <el-col :span="12" v-if="subjectAccount.isItem">
-                            <div>项目核算:</div>
-                            <el-form-item label="项目名称:" prop="itemName">
-                                <el-input style="width: 100%;" v-model="subjectRow.itemName"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入项目名称" >
-                                </el-input>
-                                <search-query :datalist="itemData"
-                                              :selectValue="subjectRow.itemName"
-                                              :clearable="true"
-                                              :buttonIf="false"
-                                              :filterable="true"
-                                              :remote="true"
-                                              placeholder="请选择项目名称"
-                                              :forParameter="{ key:'id', label:'cnName', value:'cnName'}"
-                                              @corpFocus="baccitemstypeListfun"
-                                              @corpChange="corpChange($event,'itemName')"
-                                              @remoteMethod="baccitemstypeListfun" >
-                                </search-query>
-                            </el-form-item>
-                        </el-col>
+                        <!--<el-col :span="12" v-if="subjectAccount.isItem">-->
+                        <!--    <div>项目核算:</div>-->
+                        <!--    <el-form-item label="项目名称:" prop="itemName">-->
+                        <!--        <el-input style="width: 100%;" v-model="subjectRow.itemName"-->
+                        <!--                  size="small" autocomplete="off"-->
+                        <!--                  clearable placeholder="请输入项目名称" >-->
+                        <!--        </el-input>-->
+                        <!--        <search-query :datalist="itemData"-->
+                        <!--                      :selectValue="subjectRow.itemName"-->
+                        <!--                      :clearable="true"-->
+                        <!--                      :buttonIf="false"-->
+                        <!--                      :filterable="true"-->
+                        <!--                      :remote="true"-->
+                        <!--                      placeholder="请选择项目名称"-->
+                        <!--                      :forParameter="{ key:'id', label:'cnName', value:'cnName'}"-->
+                        <!--                      @corpFocus="baccitemstypeListfun"-->
+                        <!--                      @corpChange="corpChange($event,'itemName')"-->
+                        <!--                      @remoteMethod="baccitemstypeListfun" >-->
+                        <!--        </search-query>-->
+                        <!--    </el-form-item>-->
+                        <!--</el-col>-->
                     </el-row>
 
                 </el-form>