Browse Source

提交费用类别和详情

caojunjie 3 years ago
parent
commit
c5b74d6f05

+ 0 - 1
src/App.vue

@@ -12,7 +12,6 @@ export default {
   },
   watch: {},
   created() {
-
   },
   methods: {},
   computed: {}

+ 44 - 0
src/api/basicData/basicFeesDesc.js

@@ -0,0 +1,44 @@
+import request from '@/router/axios';
+
+//客户类别列表查询
+export function customerList(data) {
+    return request({
+        url: '/api/blade-client/feesdesc/page',
+        method: 'get',
+        params: data
+    })
+}
+export const getDeptLazyTree = (parentId) => {
+    return request({
+        url: '/api/blade-client/feestype/lazy-tree',
+        method: 'get',
+        params: {
+            parentId
+        }
+    })
+}
+//客户类别列表修改和新增
+export function typeSave(data) {
+    return request({
+        url: '/api/blade-client/feesdesc/submit',
+        method: 'post',
+        data: data
+    })
+}
+//客户类别列表查看明细
+export function detail(data) {
+    return request({
+        url: '/api/blade-client/feesdesc/detail?id='+data,
+        method: 'get'
+    })
+}
+//客户类别列表修改和新增
+export function deleteDetails(data) {
+    return request({
+        url: '/api/blade-client/feesdesc/update',
+        method: 'post',
+        data: {
+            id:data
+        }
+    })
+}

+ 3 - 2
src/api/basicData/commodityType.js

@@ -1,6 +1,6 @@
 import request from '@/router/axios';
 
-export const getList = (current, size, params, deptId) => {
+export const getList = (current, size, params, goodsTypeId) => {
     return request({
         url: '/api/blade-client/goodsdesc/list',
         method: 'get',
@@ -8,7 +8,7 @@ export const getList = (current, size, params, deptId) => {
             ...params,
             current,
             size,
-            deptId,
+            goodsTypeId,
         }
     })
 }
@@ -128,6 +128,7 @@ export const getDeptLazyTree = (parentId) => {
         }
     })
 }
+
 export const getDeptTree = (tenantId) => {
     return request({
         url: '/api/blade-system/goodstype/tree',

+ 11 - 0
src/api/basicData/customerInformation.js

@@ -73,6 +73,17 @@ export function corpsitem(data) {
         }
     })
 }
+//查询客户类型主页下拉
+export function getDeptLazyTree(parentId){
+    return request({
+        url: '/api/blade-client/corpstype/lazy-tree',
+        method: 'get',
+        params: {
+            parentId
+        }
+    })
+}
+
 //查询客户类型下拉
 export function corpstypeTree() {
     return request({

+ 122 - 0
src/views/basicData/basicFeesDesc/configuration/mainList.json

@@ -0,0 +1,122 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "simplePage": true,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 300,
+  "column": [
+    {
+      "label": "费用编号",
+      "prop": "code",
+      "search": true,
+      "index": 1,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入费用编号",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "费用名称",
+      "prop": "cname",
+      "search": true,
+      "index": 2,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入商品名称",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "币别",
+      "prop": "fcyno",
+      "search": true,
+      "index": 3,
+      "width": 100,
+      "rules": [
+        {
+          "required": false,
+          "message": "请输入币别",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "计量单位",
+      "prop": "unitno",
+      "search": true,
+      "index": 4,
+      "width": 100,
+      "rules": [{
+        "required": false,
+        "message": "请输入计量单位",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "收付",
+      "type": "select",
+      "prop": "dc",
+      "search": true,
+      "index": 5,
+      "width": 100,
+      "dicData": [{
+        "label": "收",
+        "value": "D"
+      }, {
+        "label": "付",
+        "value": "C"
+      }],
+      "rules": [
+        {
+          "required": false,
+          "message": "请选择收付",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "费用类别",
+      "prop": "feesTypeId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "multiple": true,
+      "props": {
+        "label": "title"
+      },
+      "rules": [{
+        "required": true,
+        "message": " ",
+        "trigger": "click"
+      }]
+    },{
+      "label": "备注",
+      "prop": "remarks",
+      "index": 6,
+      "width":100,
+      "rules": [
+        {
+          "required": false,
+          "message": "请输入备注",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 13 - 0
src/views/basicData/basicFeesDesc/detailsPage.vue

@@ -0,0 +1,13 @@
+<template>
+<div>1</div>
+</template>
+
+<script>
+export default {
+name: "detailsPage"
+}
+</script>
+
+<style scoped>
+
+</style>

+ 214 - 0
src/views/basicData/basicFeesDesc/index.vue

@@ -0,0 +1,214 @@
+<template>
+  <el-row>
+    <el-col :span="5">
+      <div class="box">
+        <el-scrollbar>
+          <basic-container>
+            <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+          </basic-container>
+        </el-scrollbar>
+      </div>
+    </el-col>
+    <el-col :span="19">
+      <basic-container>
+        <avue-crud :option="option"
+                   :data="dataList"
+                   ref="crud"
+                   v-model="form"
+                   @row-del="rowDel"
+                   @row-update="rowUpdate"
+                   :before-open="beforeOpen"
+                   :before-close="beforeClose"
+                   @row-save="rowSave"
+                   @search-change="searchChange"
+                   @search-reset="searchReset"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange"
+                   @on-load="onLoad"
+                   @tree-load="treeLoad">
+        </avue-crud>
+      </basic-container>
+    </el-col>
+  </el-row>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import {customerList, typeSave,detail,deleteDetails,getDeptLazyTree} from "@/api/basicData/basicFeesDesc"
+
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      form: {},
+      option: option,
+      treeOption: {
+        nodeKey: 'id',
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = (node.level === 0) ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(res.data.data.map(item => {
+              return {
+                ...item,
+                leaf: !item.hasChildren
+              }
+            }))
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: 'small',
+        props: {
+          labelText: '标题',
+          label: 'title',
+          value: 'value',
+          children: 'children'
+        }
+      },
+      parentId:0,
+      dataList: [],
+      page: {
+        pageSize: 10,
+        pagerCount: 5,
+        total: 0,
+      },
+      treeDeptId:'',
+    }
+  },
+  created() {
+    // customerList({parentId:0}).then(res => {
+    //   console.log(res.data.data.records)
+    //   this.dataList = res.data.data.records
+    // })
+  },
+  methods: {
+    //展开主页左边类型
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+            return deleteDetails(row.id);
+          }).then(() => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            // 数据回调进行刷新
+            done(row);
+          });
+    },
+    //修改时的修改按钮点击触发
+    rowUpdate(row, index, done, loading) {
+      typeSave(row).then(() => {
+        this.$message({
+          type: "success",
+          message: "操作成功!"
+        });
+        // 数据回调进行刷新
+        done(row);
+      }, error => {
+        window.console.log(error);
+        loading();
+      });
+    },
+    //新增修改时保存触发
+    rowSave(row, done, loading) {
+      console.log(row)
+      row.feesTypeId = row.feesTypeId.join(',')
+      typeSave(row).then(res => {
+        console.log(res)
+        done()
+      })
+    },
+    //查询全部
+    initData(){
+      getDeptLazyTree(0).then(res => {
+        console.log(this.form);
+        const column = this.findObject(this.option.column, "feesTypeId");
+        column.dicData = res.data.data;
+      });
+    },
+    //新增子项触发
+    handleAdd(row) {
+      this.parentId = row.id;
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = row.id;
+      // column.addDisabled = true;
+      this.$refs.crud.rowAdd();
+    },
+    //新增子项和新增触发查询所有
+    beforeOpen(done, type) {
+      console.log('1111')
+      if (["add", "edit"].includes(type)) {
+        this.initData();
+      }
+      if (["edit", "view"].includes(type)) {
+        detail(this.form.id).then(res => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    //点击新增时触发
+    beforeClose(done) {
+      this.parentId = "";
+      // const column = this.findObject(this.option.column, "parentId");
+      // column.value = "";
+      // column.addDisabled = false;
+      done();
+    },
+    //点击搜索按钮触发
+    searchChange(params, done) {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done()
+    },
+    searchReset() {
+      this.query = {};
+      this.treeDeptId = '';
+      this.onLoad(this.page);
+    },
+    selectionChange() {
+      console.log('1')
+    },
+    currentChange() {
+      console.log('1')
+    },
+    sizeChange() {
+      console.log('1')
+    },
+    refreshChange() {
+      console.log('1')
+    },
+    onLoad(page, params = {parentId:0}) {
+      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage,parentId:0,feesTypeId:this.treeDeptId})
+      customerList(queryParams).then(res => {
+        this.dataList = res.data.data.records
+        this.page.total = res.data.data.total
+      })
+    },
+    //树桩列点击展开触发
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      customerList({parentId:parentId}).then(res => {
+        resolve(res.data.data.records);
+      });
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 1 - 1
src/views/basicData/basicFeesType/index.vue

@@ -57,7 +57,7 @@ export default {
   },
   methods: {
     //删除列表后面的删除按钮触发触发(row, index, done)
-    rowDel(row, index, donerowDel) {
+    rowDel(row, index, done) {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 2 - 2
src/views/basicData/commodityCategory/index.vue

@@ -96,7 +96,7 @@ export default {
     },
     //查询全部
     initData(){
-      customerList().then(res => {
+      customerList({parentId:0}).then(res => {
         console.log(this.form);
         const column = this.findObject(this.option.column, "parentId");
         column.dicData = res.data.data.records;
@@ -153,7 +153,7 @@ export default {
       console.log('1')
     },
     onLoad(page, params = {parentId:0}) {
-      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage})
+      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage,parentId:0})
       customerList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total

+ 1 - 66
src/views/basicData/commodityType/index.vue

@@ -30,50 +30,6 @@
                    @size-change="sizeChange"
                    @refresh-change="refreshChange"
                    @on-load="onLoad">
-          <template slot="menuLeft">
-            <el-button type="danger"
-                       size="small"
-                       plain
-                       icon="el-icon-delete"
-                       v-if="permission.user_delete"
-                       @click="handleDelete">删 除
-            </el-button>
-            <el-button type="info"
-                       size="small"
-                       plain
-                       v-if="permission.user_role"
-                       icon="el-icon-user"
-                       @click="handleGrant">角色配置
-            </el-button>
-            <el-button type="info"
-                       size="small"
-                       plain
-                       v-if="permission.user_reset"
-                       icon="el-icon-refresh"
-                       @click="handleReset">密码重置
-            </el-button>
-            <el-button type="info"
-                       size="small"
-                       plain
-                       v-if="userInfo.role_name.includes('admin')"
-                       icon="el-icon-setting"
-                       @click="handlePlatform">平台配置
-            </el-button>
-            <el-button type="success"
-                       size="small"
-                       plain
-                       v-if="userInfo.role_name.includes('admin')"
-                       icon="el-icon-upload2"
-                       @click="handleImport">导入
-            </el-button>
-            <el-button type="warning"
-                       size="small"
-                       plain
-                       v-if="userInfo.role_name.includes('admin')"
-                       icon="el-icon-download"
-                       @click="handleExport">导出
-            </el-button>
-          </template>
           <template slot-scope="{row}"
                     slot="tenantName">
             <el-tag>{{row.tenantName}}</el-tag>
@@ -478,7 +434,7 @@ export default {
       // row.deptId = row.deptId.join(",");
       // row.roleId = row.roleId.join(",");
       // row.postId = row.postId.join(",");
-      update(row).then(() => {
+      add(row).then(() => {
         this.initFlag = false;
         this.onLoad(this.page);
         this.$message({
@@ -549,27 +505,6 @@ export default {
             this.$refs.crud.toggleSelection();
           });
     },
-    handleReset() {
-      if (this.selectionList.length === 0) {
-        this.$message.warning("请选择至少一条数据");
-        return;
-      }
-      this.$confirm("确定将选择账号密码重置为123456?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-          .then(() => {
-            return resetPassword(this.ids);
-          })
-          .then(() => {
-            this.$message({
-              type: "success",
-              message: "操作成功!"
-            });
-            this.$refs.crud.toggleSelection();
-          });
-    },
     handleGrant() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");

+ 4 - 4
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -45,6 +45,8 @@
                 <el-switch
                     v-if="item.prop === 'creditstatus'"
                     v-model="form[item.prop]"
+                    active-value="0"
+                    inactive-value="1"
                     active-text="开启"
                     inactive-text="关闭">
                 </el-switch>
@@ -512,14 +514,13 @@ export default {
     editCustomer() {
       console.log(this.form)
       this.$refs["form"].validate((valid) => {
-        console.log(valid)
         if (valid) {
           this.form.corpsAttnList = this.contactsData
           this.form.corpsBankList = this.bankOfDepositData
           this.form.corpsItems = this.advantageProjectData
-          console.log(typeof(this.form.companytype))
+          // console.log(typeof(this.form.companytype))
           // this.form.corpsTypeId = JSON.stringify(this.form.corpsTypeId).replace(/[\[\]]/g,"")
-          this.form.corpsTypeId = this.form.corpsTypeId.join(",")
+          // this.form.corpsTypeId = this.form.corpsTypeId.join(",")
           typeSave(this.form).then(res => {
             console.log(res.data)
             this.$message({
@@ -528,7 +529,6 @@ export default {
             });
           })
         } else {
-          console.log('error submit!!');
           return false;
         }
       });

+ 88 - 46
src/views/basicData/customerInformation/index.vue

@@ -1,53 +1,66 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option"
-               :data="dataList"
-               ref="crud"
-               v-model="form"
-               :page.sync="page"
-               @row-del="rowDel"
-               @row-update="rowUpdate"
-               :before-open="beforeOpen"
-               :before-close="beforeClose"
-               @row-save="rowSave"
-               @search-change="searchChange"
-               @search-reset="searchReset"
-               @selection-change="selectionChange"
-               @current-change="currentChange"
-               @size-change="sizeChange"
-               @refresh-change="refreshChange"
-               @on-load="onLoad"
-               @tree-load="treeLoad">
-      <template slot-scope="scope" slot="menu">
-        <el-button
-            type="text"
-            icon="el-icon-view"
-            size="small"
-            @click.stop="beforeOpenPage(scope.row,scope.index)"
-        >查看
-        </el-button>
-        <el-button
-            type="text"
-            icon="el-icon-edit"
-            size="small"
-            @click.stop="editOpen(scope.row,scope.index)"
-        >编辑
-        </el-button>
-        <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
-            @click.stop="rowDel(scope.row,scope.index)"
-        >删除
-        </el-button>
-      </template>
-    </avue-crud>
-  </basic-container>
+  <el-row>
+    <el-col :span="5">
+      <div class="box">
+        <el-scrollbar>
+          <basic-container>
+            <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+          </basic-container>
+        </el-scrollbar>
+      </div>
+    </el-col>
+    <el-col :span="19">
+      <basic-container>
+        <avue-crud :option="option"
+                   :data="dataList"
+                   ref="crud"
+                   v-model="form"
+                   :page.sync="page"
+                   @row-del="rowDel"
+                   @row-update="rowUpdate"
+                   :before-open="beforeOpen"
+                   :before-close="beforeClose"
+                   @row-save="rowSave"
+                   @search-change="searchChange"
+                   @search-reset="searchReset"
+                   @selection-change="selectionChange"
+                   @current-change="currentChange"
+                   @size-change="sizeChange"
+                   @refresh-change="refreshChange"
+                   @on-load="onLoad"
+                   @tree-load="treeLoad">
+          <template slot-scope="scope" slot="menu">
+            <el-button
+                type="text"
+                icon="el-icon-view"
+                size="small"
+                @click.stop="beforeOpenPage(scope.row,scope.index)"
+            >查看
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                @click.stop="editOpen(scope.row,scope.index)"
+            >编辑
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-delete"
+                size="small"
+                @click.stop="rowDel(scope.row,scope.index)"
+            >删除
+            </el-button>
+          </template>
+        </avue-crud>
+      </basic-container>
+    </el-col>
+  </el-row>
 </template>
 
 <script>
 import option from "./configuration/mainList.json";
-import {customerList, typeSave,detail,deleteDetails} from "@/api/basicData/customerInformation"
+import {customerList, typeSave,detail,deleteDetails,getDeptLazyTree} from "@/api/basicData/customerInformation"
 
 export default {
   name: "customerInformation",
@@ -57,6 +70,30 @@ export default {
       option: option,
       parentId:0,
       dataList: [],
+      treeOption: {
+        nodeKey: 'id',
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = (node.level === 0) ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(res.data.data.map(item => {
+              return {
+                ...item,
+                leaf: !item.hasChildren
+              }
+            }))
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: 'small',
+        props: {
+          labelText: '标题',
+          label: 'title',
+          value: 'value',
+          children: 'children'
+        }
+      },
       page: {
         pageSize: 10,
         pagerCount: 5,
@@ -69,6 +106,11 @@ export default {
     // this.onLoad()
   },
   methods: {
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
     //删除列表后面的删除按钮触发触发(row, index, done)
     rowDel(row, index, done) {
       this.$confirm("确定将选择数据删除?", {
@@ -174,7 +216,7 @@ export default {
       console.log('1')
     },
     onLoad(page, params = {parentId:0}) {
-      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage})
+      let queryParams = Object.assign({}, params, {pageSize: page.pageSize, pageNum: page.currentPage,corpsTypeId:this.treeDeptId})
       customerList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total