Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/dev' into dev

wangzhuo 1 anno fa
parent
commit
d524420f0f

+ 43 - 0
src/api/iosBasicData/losbfeestemplate.js

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

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

@@ -1337,6 +1337,10 @@ const columnName = [{
     code: 302.1,
     name: '货运代理-基础资料-费用类别'
   },
+  {
+    code: 303,
+    name: '货运代理-基础资料-费用模板'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 134 - 30
src/views/iosBasicData/bfeesdefine/index.vue

@@ -5,7 +5,7 @@
                 <div class="box">
                     <el-scrollbar>
                         <basic-container>
-                            <avue-tree :option="treeOption" :data="bfeesdefineType" @node-click="nodeClick" />
+                            <avue-tree :option="treeOption" :data="feesTypeData" @node-click="nodeClick" />
                         </basic-container>
                     </el-scrollbar>
                 </div>
@@ -42,6 +42,48 @@
                                        @click="handleDelete">删 除
                             </el-button>
                         </template>
+                        <template slot="unitNoForm">
+                            <search-query ref="SearchQuery"
+                                          :datalist="unitNoData"
+                                          title="计量单位"
+                                          :filterable="true"
+                                          :clearable="true"
+                                          :remote="true"
+                                          :forParameter="{key:'id',label:'cnName',value:'cnName'}"
+                                          @remoteMethod="getBunitsListfun" @corpChange="unitNoCorpChange" >
+                                <bunits></bunits>
+                            </search-query>
+                        </template>
+                        <template slot="curNoForm">
+                            <search-query ref="SearchQuery"
+                                          :datalist="curNoData"
+                                          title="币别"
+                                          :filterable="true"
+                                          :clearable="true"
+                                          :remote="true"
+                                          :forParameter="{key:'id',label:'cnName',value:'cnName'}"
+                                          @remoteMethod="getRateListfun" @corpChange="curNoCorpChange" >
+                                <rateManagement></rateManagement>
+                            </search-query>
+                        </template>
+                        <template slot="feesTypeNameForm">
+                            <search-query ref="SearchQuery"
+                                          :datalist="feesTypeData"
+                                          title="费用类别"
+                                          :filterable="true"
+                                          :clearable="true"
+                                          :remote="true"
+                                          :forParameter="{key:'id',label:'cnName',value:'id'}"
+                                          @remoteMethod="bfeesdefineListfun" @corpChange="feesTypeCorpChange" >
+                                <bfeesdetype></bfeesdetype>
+                            </search-query>
+                        </template>
+                        <template slot="remarks" slot-scope="scope">
+                            <avue-text-ellipsis :text="scope.row.remarks" :height="30" use-tooltip placement="top">
+                                <small slot="more">...</small>
+                            </avue-text-ellipsis>
+                        </template>
+
                     </avue-crud>
                 </basic-container>
             </el-col>
@@ -53,14 +95,24 @@
   import {bfeesList, bfeesDetail, bfeesSubmit, bfeesRemove} from "@/api/iosBasicData/bfees";
   import {mapGetters} from "vuex";
   import {bfeesdefineList} from "@/api/iosBasicData/bfeesdefine";
-  import {getDeptLazyTree} from "@/api/basicData/customerInformation";
-  import {CDParameter, customerParameter} from "@/enums/management-type";
+  import {getBunitsList} from "@/api/iosBasicData/bunits";
+  import { getRateList } from "@/api/iosBasicData/rateManagement";
+  import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+  import bunits from "@/views/iosBasicData/bunits/index.vue";
+  import bfeesdetype from "@/views/iosBasicData/bfeesdefine/bfeesdetype.vue";
+  import rateManagement from '@/views/iosBasicData/rateManagement/index.vue'
 
   export default {
+      components: {bunits,bfeesdetype,rateManagement, SearchQuery},
     data() {
       return {
           // 费用类别数据
-          bfeesdefineType:[],
+          feesTypeData:[],
+          // 计量单位数据
+          unitNoData:[],
+          // 币别数据
+          curNoData:[],
+
           treeOption: {
               nodeKey: "id",
               lazy: true,
@@ -100,6 +152,16 @@
           selection: true,
           dialogClickModal: false,
           column: [
+              // {
+              //     label: "凭证",
+              //     prop: "code",
+              //     search: true,
+              //     rules: [{
+              //         required: true,
+              //         message: "请输入费用编码",
+              //         trigger: "blur"
+              //     }]
+              // },
             {
               label: "费用编码",
               prop: "code",
@@ -133,7 +195,7 @@
             {
                 label: "费用类别",
                 prop: "feesTypeName",
-
+                formslot:true,
                 rules: [{
                       required: true,
                       message: "请选择费用类别",
@@ -143,6 +205,7 @@
             {
               label: "计量单位",
               prop: "unitNo",
+                formslot:true,
               rules: [{
                 required: true,
                 message: "请输入计量单位",
@@ -152,6 +215,7 @@
             {
               label: "币别",
               prop: "curNo",
+                formslot:true,
               rules: [{
                 required: true,
                 message: "请输入币别",
@@ -159,30 +223,16 @@
               }]
             },
             {
-              label: "收付",
-              prop: "dc",
-                type:'select',
-                dicData:[{
-                    label:'收',
-                    value:'D'
-                },{
-                    label:'付',
-                    value:'C'
-                }],
-              rules: [{
-                required: true,
-                message: "请输入收付",
-                trigger: "blur"
-              }]
-            },
-            {
-              label: "财务核算要素 Id",
+              label: "核算ID",
               prop: "accElementId",
-                hide:true,
-                display:false,
+                rules: [{
+                    required: true,
+                    message: "请输入核算要素ID",
+                    trigger: "blur"
+                }]
             },
             {
-              label: "财务核算要素名称",
+              label: "核算名称",
               prop: "accElementName",
               rules: [{
                 required: true,
@@ -193,8 +243,11 @@
             {
               label: "科目 Id",
               prop: "accId",
-                hide:true,
-                display:false,
+                rules: [{
+                    required: true,
+                    message: "请输入科目 Id",
+                    trigger: "blur"
+                }]
             },
             {
               label: "科目编号",
@@ -220,6 +273,18 @@
                 hide:true,
                 display:false,
             },
+              {
+                  label: "收付",
+                  prop: "dc",
+                  type:'select',
+                  dicData:[{
+                      label:'收',
+                      value:'D'
+                  },{
+                      label:'付',
+                      value:'C'
+                  }],
+              },
             {
               label: "状态",
               prop: "status",
@@ -268,6 +333,7 @@
               {
                   label: "创建时间",
                   prop: "createTime",
+                  width: 160,
                   display:false,
               },
               {
@@ -328,15 +394,49 @@
       async created() {
           this.option = await this.getColumnData(this.getColumnName(302), this.optionBack);
           this.bfeesdefineListfun()
+          this.getBunitsListfun()
+          this.getRateListfun()
       },
     methods: {
         // 获取费用类别数据
         bfeesdefineListfun(){
             bfeesdefineList(1,10).then(res=>{
-                this.bfeesdefineType = res.data.data.records
-                console.log(res,304)
+                this.feesTypeData = res.data.data.records
             })
         },
+        // 获取计算单位数据
+        getBunitsListfun(cnName){
+            getBunitsList(1, 10,{cnName}).then(res=>{
+                this.unitNoData = res.data.data.records
+            })
+        },
+        // 获取币别数据
+        getRateListfun(cnName){
+            getRateList({
+                current:1,
+                size: 10,
+                cnName
+            }).then(res=>{
+                this.curNoData = res.data.data.records
+            })
+        },
+        // 费用信息选中回调
+        feesTypeCorpChange(value){
+            this.feesTypeData.map(item=>{
+                if (item.id == value) {
+                    this.form.feesTypeId = item.id
+                    this.form.feesTypeName = item.cnName
+                }
+            })
+        },
+        // 计量单位选中的回调
+        unitNoCorpChange(value){
+            this.form.unitNo = value
+        },
+        // 币别选中回调
+        curNoCorpChange(value){
+            this.form.curNo = value
+        },
         nodeClick(data) {
             console.log(data,331)
             // this.feesTypeId = data.id;
@@ -345,6 +445,8 @@
         },
 
       rowSave(row, done, loading) {
+          row.accElementId = Number(row.accElementId)
+          row.accId = Number(row.accId)
         bfeesSubmit(row).then(() => {
           this.onLoad(this.page);
           this.$message({
@@ -358,6 +460,8 @@
         });
       },
       rowUpdate(row, index, done, loading) {
+          row.accElementId = Number(row.accElementId)
+          row.accId = Number(row.accId)
         bfeesSubmit(row).then(() => {
           this.onLoad(this.page);
           this.$message({

+ 429 - 0
src/views/iosBasicData/losbfeestemplate/index.vue

@@ -0,0 +1,429 @@
+<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"
+               @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 303)"
+               @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 303)"
+               @on-load="onLoad">
+      <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 {losbfeestemplateList, losbfeestemplateDetail, losbfeestemplateSubmit, losbfeestemplateRemove} from "@/api/iosBasicData/losbfeestemplate.js";
+  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: 24,
+          border: true,
+          index: true,
+          viewBtn: true,
+          selection: true,
+          dialogClickModal: false,
+          column: [
+            {
+              label: "业务类型 Id",
+              prop: "businessTypeId",
+              rules: [{
+                required: true,
+                message: "请输入业务类型 Id",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "业务类型中文名称",
+              prop: "businessTypeCnName",
+              rules: [{
+                required: true,
+                message: "请输入业务类型中文名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "业务类型英文名称",
+              prop: "businessTypeEnName",
+              rules: [{
+                required: true,
+                message: "请输入业务类型英文名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "模版编号",
+              prop: "code",
+                search: true,
+              rules: [{
+                required: true,
+                message: "请输入模版编号",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "模版中文名称",
+              prop: "cnName",
+              rules: [{
+                required: true,
+                message: "请输入模版中文名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "模版英文名称",
+              prop: "enName",
+              rules: [{
+                required: true,
+                message: "请输入模版英文名称",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "收付",
+              prop: "dc",
+                type:'select',
+                dicData:[{
+                    label:'收',
+                    value:'D'
+                },{
+                    label:'付',
+                    value:'C'
+                }],
+              rules: [{
+                required: true,
+                message: "请输入收付",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "是否公开共享",
+              prop: "isShared",
+                type:'select',
+                dicData:[{
+                    label:'否',
+                    value:0
+                },{
+                    label:'是',
+                    value:1
+                }],
+              rules: [{
+                required: true,
+                message: "请输入是否公开共享",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "版本",
+              prop: "version",
+                hide:true,
+                display:false,
+            },
+            {
+              label: "状态",
+              prop: "status",
+                type:'select',
+                dicData:[{
+                    label:'启用',
+                    value:0
+                },{
+                    label:'停用',
+                    value:1
+                }],
+              rules: [{
+                required: true,
+                message: "请输入状态",
+                trigger: "blur"
+              }]
+            },
+            {
+              label: "是否已删除(0 否 1是)",
+              prop: "isDeleted",
+                hide:true,
+                display:false,
+            },
+              {
+                  label: "主键",
+                  prop: "id",
+                  hide:true,
+                  display:false,
+              },
+              {
+                  label: "创建人 Id",
+                  prop: "createUser",
+                  hide:true,
+                  display:false,
+              },
+              {
+                  label: "创建人",
+                  prop: "createUserName",
+                  display:false,
+              },
+              {
+                  label: "创建部门 Id",
+                  prop: "createDept",
+                  hide:true,
+                  display:false,
+              },
+              {
+                  label: "创建部门",
+                  prop: "createDeptName",
+                  display:false,
+              },
+              {
+                  label: "创建时间",
+                  prop: "createTime",
+                  width: 160,
+                  display:false,
+              },
+              {
+                  label: "修改人 Id",
+                  prop: "updateUser",
+                  hide:true,
+                  display:false,
+              },
+              {
+                  label: "修改人",
+                  prop: "updateUserName",
+                  display:false,
+              },
+              {
+                  label: "修改时间",
+                  prop: "updateTime",
+                  width: 160,
+                  display:false,
+              },
+            {
+              label: "备注",
+              prop: "remarks",
+                span:24,
+                type: 'textarea',
+                width: "180",
+                slot: true,
+                minRows: 3,
+            },
+          ]
+        },
+        data: []
+      };
+    },
+    computed: {
+      ...mapGetters(["permission"]),
+      permissionList() {
+        return {
+          addBtn: this.vaildData(this.permission.losbfeestemplate_add, false),
+          viewBtn: this.vaildData(this.permission.losbfeestemplate_view, false),
+          delBtn: this.vaildData(this.permission.losbfeestemplate_delete, false),
+          editBtn: this.vaildData(this.permission.losbfeestemplate_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(303), this.optionBack);
+      },
+    methods: {
+      rowSave(row, done, loading) {
+        losbfeestemplateSubmit(row).then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done();
+        }, error => {
+          loading();
+          window.console.log(error);
+        });
+      },
+      rowUpdate(row, index, done, loading) {
+        losbfeestemplateSubmit(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 losbfeestemplateRemove(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 losbfeestemplateRemove(this.ids);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.$refs.crud.toggleSelection();
+          });
+      },
+      beforeOpen(done, type) {
+        if (["edit", "view"].includes(type)) {
+          losbfeestemplateDetail(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;
+        losbfeestemplateList(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>