Qukatie 2 tahun lalu
induk
melakukan
710aec0039

+ 18 - 9
src/api/basicData/client.js

@@ -23,50 +23,50 @@ export const pageStatistics = (data) => {
   return request({
     url: '/api/blade-client/partsCorps/pageStatistics',
     method: 'get',
-    params:data
+    params: data
   })
 }
 export const getDetails = (data) => {
   return request({
     url: '/api/blade-client/partsCorps/getDetails',
     method: 'get',
-    params:data
+    params: data
   })
 }
 export const addCorpType = (data) => {
   return request({
     url: '/api/blade-client/corpstype/submit',
     method: 'POST',
-    data:data
+    data: data
   })
 }
 export const getCorpType = (data) => {
   return request({
     url: '/api/blade-client/corpstype/tree',
     method: 'get',
-    params:data
+    params: data
   })
 }
 export const submit = (data) => {
   return request({
     url: '/api/blade-client/corpsdesc/submit',
     method: 'POST',
-    data:data
+    data: data
   })
 }
 export const remove = (data) => {
   return request({
     url: '/api/blade-client/corpsdesc/update',
     method: 'POST',
-    data:data
+    data: data
   })
 }
 
 export function customerList(data) {
   return request({
-      url: '/api/blade-client/corpstype/page',
-      method: 'get',
-      params: data
+    url: '/api/blade-client/corpstype/page',
+    method: 'get',
+    params: data
   })
 }
 export const getSellList = (current, size, params) => {
@@ -79,4 +79,13 @@ export const getSellList = (current, size, params) => {
       size,
     }
   })
+}
+export const itemDel = (data) => {
+  return request({
+    url: '/api/blade-client/corpsAddr/remove',
+    method: 'POST',
+    params: {
+      ids:data
+    }
+  })
 }

+ 105 - 0
src/components/corpType/configuration/mainList.json

@@ -0,0 +1,105 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "stripe": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 300,
+  "column": [
+    {
+      "label": "类型",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 280,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入客户类型",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTimeA",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "searchRange":true,
+      "hide": true,
+      "addDisplay": false,
+      "viewDisplay": false,
+      "search": true,
+      "editDisplay":false,
+      "index": 2,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入创建时间",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "上级类型",
+      "prop": "parentId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "rules": [{
+        "required": false,
+        "message": "请选择上级机构",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 5,
+      "width": 60,
+      "rules": [{
+        "required": true,
+        "message": "请输入排序",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "状态",
+      "type": "select",
+      "prop": "status",
+      "search": true,
+      "index": 4,
+      "width": 100,
+      "value":0,
+      "dicData": [{
+        "label": "正常",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入状态",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 13 - 0
src/components/corpType/detailsPage.vue

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

+ 260 - 0
src/components/corpType/index.vue

@@ -0,0 +1,260 @@
+<template>
+    <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"
+      :table-loading="loading"
+      @row-save="rowSave"
+      :search.sync="search"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @selection-change="selectionChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @saveColumn="saveColumn"
+      @resetColumn="resetColumn"
+      @on-load="onLoad"
+      @tree-load="treeLoad"
+    >
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-circle-plus-outline"
+          size="small"
+          @click.stop="handleAdd(scope.row, scope.index)"
+          >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import {
+  customerList,
+  typeSave,
+  detail,
+  deleteDetails
+} from "@/api/basicData/customerCategory";
+import { customerParameter } from "@/enums/management-type";
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      form: {},
+      search:{},
+      option: option,
+      loading: false,
+      parentId: 0,
+      dataList: [],
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      query: {}
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(141), option);
+    this.option.height = window.innerHeight - 500;
+  },
+  methods: {
+    //删除列表后面的删除按钮触发触发(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) {
+      row.corpType = customerParameter.code;
+      typeSave(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+          this.onLoad(this.page);
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //新增修改时保存触发
+    rowSave(row, done, loading) {
+      row.corpType = customerParameter.code;
+      typeSave(row).then(
+        res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done(row);
+          this.onLoad(this.page);
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //查询全部
+    initData() {
+      customerList({ corpType: customerParameter.code }).then(res => {
+        const column = this.findObject(this.option.column, "parentId");
+        column.dicData = res.data.data.records;
+      });
+    },
+    //新增子项触发
+    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) {
+      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.query = params;
+      this.page.currentPage = 1;
+      params.parentId = 0;
+      this.onLoad(this.page, params);
+      done();
+    },
+    searchReset() {
+      console.log("1");
+    },
+    selectionChange() {
+      console.log("1");
+    },
+    currentChange() {
+      console.log("1");
+    },
+    sizeChange() {
+      console.log("1");
+    },
+    refreshChange() {
+      console.log("1");
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      const { createTimeA } = this.query;
+      let values = {
+        ...params,
+        corpType: customerParameter.code,
+        size: this.page.pageSize,
+        current: this.page.currentPage
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + " 00:00:00",
+          endTime: createTimeA[1] + " 23:59:59",
+          ...this.query,
+          size: this.page.pageSize,
+          current: this.page.currentPage
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0;
+      customerList(values)
+        .then(res => {
+          this.dataList = res.data.data.records;
+          this.page.total = res.data.data.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    async saveColumn() {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(
+        this.getColumnName(141),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(141), option);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //树桩列点击展开触发
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      customerList({ parentId: parentId }).then(res => {
+        resolve(res.data.data.records);
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.8vh;
+}
+</style>

+ 105 - 0
src/components/supplierType/configuration/mainList.json

@@ -0,0 +1,105 @@
+{
+  "headerAlign": "center",
+  "align": "center",
+  "border": true,
+  "stripe": true,
+  "index": true,
+  "lazy": true,
+  "tip": false,
+  "searchShow": true,
+  "searchMenuSpan": 6,
+  "tree": true,
+  "selection": true,
+  "viewBtn": true,
+  "menuWidth": 300,
+  "column": [
+    {
+      "label": "类型",
+      "prop": "cname",
+      "search": true,
+      "index": 1,
+      "width": 280,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入客户类型",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "创建时间",
+      "prop": "createTimeA",
+      "type": "date",
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd",
+      "searchRange":true,
+      "hide": true,
+      "addDisplay": false,
+      "viewDisplay": false,
+      "search": true,
+      "editDisplay":false,
+      "index": 2,
+      "width": 100,
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入创建时间",
+          "trigger": "blur"
+        }
+      ]
+    },
+    {
+      "label": "上级类型",
+      "prop": "parentId",
+      "dicData": [],
+      "type": "tree",
+      "hide": true,
+      "addDisabled": false,
+      "props": {
+        "label": "cname",
+        "value": "id"
+      },
+      "rules": [{
+        "required": false,
+        "message": "请选择上级机构",
+        "trigger": "click"
+      }]
+    },
+    {
+      "label": "排序",
+      "prop": "sort",
+      "type": "number",
+      "index": 5,
+      "width": 60,
+      "rules": [{
+        "required": true,
+        "message": "请输入排序",
+        "trigger": "blur"
+      }]
+    },
+    {
+      "label": "状态",
+      "type": "select",
+      "prop": "status",
+      "search": true,
+      "index": 4,
+      "width": 100,
+      "value":0,
+      "dicData": [{
+        "label": "正常",
+        "value": 0
+      }, {
+        "label": "关闭",
+        "value": 1
+      }],
+      "rules": [
+        {
+          "required": true,
+          "message": "请输入状态",
+          "trigger": "blur"
+        }
+      ]
+    }
+  ]
+}

+ 13 - 0
src/components/supplierType/detailsPage.vue

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

+ 255 - 0
src/components/supplierType/index.vue

@@ -0,0 +1,255 @@
+<template>
+    <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"
+      :table-loading="loading"
+      @row-save="rowSave"
+      :search.sync="search"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @selection-change="selectionChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @saveColumn="saveColumn"
+      @resetColumn="resetColumn"
+      @on-load="onLoad"
+      @tree-load="treeLoad"
+    >
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-circle-plus-outline"
+          size="small"
+          @click.stop="handleAdd(scope.row, scope.index)"
+          >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+</template>
+
+<script>
+import option from "./configuration/mainList.json";
+import {
+  customerList,
+  typeSave,
+  detail,
+  deleteDetails
+} from "@/api/basicData/customerCategory";
+import { supplierParameter } from "@/enums/management-type";
+export default {
+  name: "customerInformation",
+  data() {
+    return {
+      form: {},
+      search:{},
+      option: option,
+      loading: false,
+      parentId: 0,
+      dataList: [],
+      page: {
+        pageSize: 20,
+        currentPage: 1,
+        total: 0,
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+      },
+      query: {}
+    };
+  },
+  async created() {
+    this.option = await this.getColumnData(this.getColumnName(155), option);
+    this.option.height = window.innerHeight - 500;
+  },
+  methods: {
+    //删除列表后面的删除按钮触发触发(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) {
+      row.corpType = supplierParameter.code;
+      typeSave(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          // 数据回调进行刷新
+          done(row);
+          this.onLoad(this.page);
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //新增修改时保存触发
+    rowSave(row, done, loading) {
+      row.corpType = supplierParameter.code;
+      typeSave(row).then(
+        res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          done(row);
+          this.onLoad(this.page);
+        },
+        error => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    //查询全部
+    initData() {
+      customerList({ corpType: supplierParameter.code }).then(res => {
+        const column = this.findObject(this.option.column, "parentId");
+        column.dicData = res.data.data.records;
+      });
+    },
+    //新增子项触发
+    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) {
+      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.query = params;
+      this.page.currentPage = 1;
+      params.parentId = 0;
+      this.onLoad(this.page, params);
+      done();
+    },
+    searchReset() {
+      console.log("1");
+    },
+    selectionChange() {
+      console.log("1");
+    },
+    currentChange() {
+      console.log("1");
+    },
+    sizeChange() {
+      console.log("1");
+    },
+    refreshChange() {
+      console.log("1");
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      const { createTimeA } = this.query;
+      let values = {
+        ...params,
+        corpType: supplierParameter.code,
+        size: this.page.pageSize,
+        current: this.page.currentPage
+      };
+      if (createTimeA) {
+        values = {
+          ...params,
+          createTime: createTimeA[0] + " 00:00:00",
+          endTime: createTimeA[1] + " 23:59:59",
+          ...this.query,
+          size: this.page.pageSize,
+          current: this.page.currentPage
+        };
+        values.createTimeA = null;
+      }
+      values.parentId = 0;
+      customerList(values)
+        .then(res => {
+          this.dataList = res.data.data.records;
+          this.page.total = res.data.data.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(155),
+        this.option
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumn() {
+      this.option = option;
+      const inSave = await this.delColumnData(this.getColumnName(155), option);
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout();
+        });
+        this.$message.success("重置成功");
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    //树桩列点击展开触发
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      customerList({ parentId: parentId }).then(res => {
+        resolve(res.data.data.records);
+      });
+    }
+  }
+};
+</script>
+
+<style scoped>
+.page-crad ::v-deep .basic-container__card {
+  height: 94.8vh;
+}
+</style>

+ 3 - 0
src/views/client/detailsInfo.vue

@@ -417,6 +417,9 @@ export default {
                     this.loading = false;
                 });
         },
+        editCustomer(){
+            this.$emit('editOpen',this.form,1)
+        },
         async saveColumn() {
             const inSave = await this.saveColumnData(
                 this.getColumnName(208.1),

+ 65 - 57
src/views/client/detailsPage.vue

@@ -17,10 +17,10 @@
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
           <template slot="corpsTypeId">
             <div style="display:flex;">
-              <avue-input-tree default-expand-all v-model="form.corpsTypeId"
-                placeholder="请选择客户分类" :dic="corpTypeList" :props="props">
+              <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择客户分类" :dic="corpTypeList"
+                :props="props">
               </avue-input-tree>
-              <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
+              <i class="el-icon-setting" style="font-size:18px;line-height: 32px;margin-left:4px"
                 @click="corpTypeVisible = true"></i>
             </div>
           </template>
@@ -28,19 +28,19 @@
       </trade-card>
       <trade-card title="地址管理" v-loading="loadingBtn">
         <avue-crud ref="crud" :option="option2" :data="data" :table-loading="loading" @saveColumn="saveColumn"
-              @resetColumn="resetColumn" :cell-style="cellStyle" class="address">
-              <template slot="headerSerial">
-                <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
-                  :disabled="detailData.status == 1" circle></el-button>
-              </template>
-              <template slot="menu" slot-scope="{ row, index }">
-                <el-button size="small" type="text" @click="rowCell(row, index)">{{
-                    row.$cellEdit ? "保存" : "修改"
-                }}</el-button>
-                <el-button size="small" type="text" @click="rowDel(row, index)">删除
-                </el-button>
-              </template>
-            </avue-crud>
+          @resetColumn="resetColumn" :cell-style="cellStyle" class="address">
+          <template slot="headerSerial">
+            <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
+              :disabled="detailData.status == 1" circle></el-button>
+          </template>
+          <template slot="menu" slot-scope="{ row, index }">
+            <el-button size="small" type="text" @click="rowCell(row, index)">{{
+                row.$cellEdit ? "保存" : "修改"
+            }}</el-button>
+            <el-button size="small" type="text" @click="rowDel(row, index)">删除
+            </el-button>
+          </template>
+        </avue-crud>
         <!-- <el-tabs v-model="activeName">
           <el-tab-pane label="客户地址" name="first">
             <avue-crud ref="crud" :option="option2" :data="data1" :table-loading="loading" @saveColumn="saveColumn"
@@ -81,11 +81,12 @@
       <c-upload v-loading="loadingBtn" typeUpload="CD"
         deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
         :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
-      <el-dialog title="添加客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
-        width="30%" append-to-body @closed="corpTypeClosed">
+      <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
+        append-to-body @closed="corpTypeClosed">
         <span>
-          <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
-          </avue-form>
+          <corp-type></corp-type>
+          <!-- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
+        </avue-form> -->
         </span>
         <div class="avue-dialog__footer">
           <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
@@ -98,7 +99,8 @@
 
 <script>
 import { option2, option3 } from "./js/optionList";
-import { getDetails, addCorpType, getCorpType, submit, customerList } from "@/api/basicData/client";
+import { getDetails, addCorpType, getCorpType, submit, customerList, itemDel } from "@/api/basicData/client";
+import corpType from '@/components/corpType/index'
 export default {
   name: "index",
   data() {
@@ -117,7 +119,7 @@ export default {
       form2: {},
       form3: {},
       form4: {},
-      data:[],
+      data: [],
       data1: [],
       data2: [],
       option: {
@@ -206,9 +208,12 @@ export default {
           }
         ]
       },
-      corpsFiles:[]
+      corpsFiles: []
     };
   },
+  components: {
+    corpType
+  },
   props: {
     detailData: {
       type: Object
@@ -217,9 +222,9 @@ export default {
   async created() {
     this.option2 = await this.getColumnData(this.getColumnName(208), option2);
     // this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
-    // if (this.detailData.id) {
-    //   this.getDetail(this.detailData.id);
-    // }
+    if (this.detailData.id) {
+      this.getDetail(this.detailData.id);
+    }
     if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
@@ -231,10 +236,11 @@ export default {
       customerList({ corpType: "KH" }).then(res => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
       });
-      // this.getWorkDicts("abbreviation").then(res => {
-      //   this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
-      // });
-      // this.$refs.crud.init();
+      this.getWorkDicts("abbreviation").then(res => {
+        this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
+      });
+      this.findObject(this.option2.column, "addr").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
+      this.$refs.crud.init();
     },
     cellStyle() {
       return "padding:0;height:40px;";
@@ -251,8 +257,8 @@ export default {
       getDetails({ id: id })
         .then(res => {
           this.form = res.data.data;
-          this.data= res.data.data.corpsAddrList
-          this.corpsFiles=res.data.data.corpsFiles
+          this.data = res.data.data.corpsAddrList
+          this.corpsFiles = res.data.data.corpsFiles
         })
         .finally(() => {
           this.loadingBtn = false;
@@ -262,7 +268,7 @@ export default {
       this.form.corpName = row.cname
     },
     addRow() {
-      this.data.push({ $cellEdit: true})
+      this.data.push({ $cellEdit: true })
     },
     rowCell(row, index) {
       if (row.$cellEdit == true) {
@@ -278,13 +284,13 @@ export default {
         type: "warning"
       }).then(() => {
         if (row.id) {
-          // itemDel(row.id).then(res => {
-          //   this.$message({
-          //     type: "success",
-          //     message: "删除成功!"
-          //   });
-          //   this.data1.splice(index, 1);
-          // });
+          itemDel(row.id).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.data.splice(index, 1);
+          });
         } else {
           this.$message({
             type: "success",
@@ -328,8 +334,8 @@ export default {
       });
     },
     corpTypeClosed() {
-      this.reload = Math.random();
-      this.form4 = this.$options.data().form4
+      // this.reload = Math.random();
+      // this.form4 = this.$options.data().form4
     },
     getCorpType() {
       getCorpType({ corpType: 'KH' }).then(res => {
@@ -337,19 +343,21 @@ export default {
       })
     },
     addCorpType() {
-      this.$refs["corpType"].validate((valid, done) => {
-        done();
-        if (valid) {
-          addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
-            .then(res => {
-              this.$message.success("保存成功");
-              this.getCorpType()
-              this.corpTypeVisible = false
-            })
-        } else {
-          return false;
-        }
-      });
+      // this.$refs["corpType"].validate((valid, done) => {
+      //   done();
+      //   if (valid) {
+      //     addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
+      //       .then(res => {
+      //         this.$message.success("保存成功");
+      //         this.getCorpType()
+      //         this.corpTypeVisible = false
+      //       })
+      //   } else {
+      //     return false;
+      //   }
+      // });
+      this.getCorpType()
+      this.corpTypeVisible = false
     },
     //修改提交触发
     editCustomer() {
@@ -357,12 +365,12 @@ export default {
         done();
         if (valid) {
           this.loadingBtn = true;
-          submit({ ...this.form, code: this.form.cname, corpType: "KH", corpsAddrList: this.data})
+          submit({ ...this.form, code: this.form.cname, corpType: "KH", corpsAddrList: this.data })
             .then(res => {
               this.$message.success("保存成功");
               this.form = res.data.data;
               this.data = res.data.data.corpsAddrList
-              this.corpsFiles=res.data.data.corpsFiles
+              this.corpsFiles = res.data.data.corpsFiles
             })
             .finally(() => {
               this.loadingBtn = false;

+ 34 - 24
src/views/client/index.vue

@@ -59,9 +59,11 @@
       </table>
       <el-row>
         <el-col :span="4">
-          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;" @save="corpTypeVisible = true">
+          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
+            @save="corpTypeVisible = true">
             <template slot="addBtn">
-              <i class="el-icon-plus" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;" @click="corpTypeVisible = true"></i>
+              <i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
+                @click="corpTypeVisible = true"></i>
             </template>
           </avue-tree>
         </el-col>
@@ -116,12 +118,13 @@
 
     </basic-container>
     <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
-    <details-info v-if="!showInfo" @goBack="goBack()" :detailData="detailData" />
-    <el-dialog title="添加客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
-      width="30%" append-to-body @closed="corpTypeClosed">
+    <details-info v-if="!showInfo" @goBack="goBack()" @editOpen="editOpen" :detailData="detailData" />
+    <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog"
+      width="80%" append-to-body @closed="corpTypeClosed">
       <span>
-        <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
-        </avue-form>
+        <corp-type></corp-type>
+        <!-- <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
+        </avue-form> -->
       </span>
       <div class="avue-dialog__footer">
         <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
@@ -136,6 +139,7 @@ import detailsInfo from "./detailsInfo";
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
 import { getList, getCorpType, pageStatistics, remove, addCorpType, customerList } from "@/api/basicData/client";
+import corpType from '@/components/corpType/index'
 export default {
   name: "index",
   data() {
@@ -273,11 +277,13 @@ export default {
           }
         ]
       },
+      hostUrl: ''
     };
   },
   components: {
     detailsPage,
-    detailsInfo
+    detailsInfo,
+    corpType
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(207), option);
@@ -356,23 +362,25 @@ export default {
         });
     },
     addCorpType() {
-      this.$refs["corpType"].validate((valid, done) => {
-        done();
-        if (valid) {
-          addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
-            .then(res => {
-              this.$message.success("保存成功");
-              this.getAllWorkDicts()
-              this.corpTypeVisible = false
-            })
-        } else {
-          return false;
-        }
-      });
+      // this.$refs["corpType"].validate((valid, done) => {
+      //   done();
+      //   if (valid) {
+      //     addCorpType({ ...this.form4, corpType: 'KH', status: 0 })
+      //       .then(res => {
+      //         this.$message.success("保存成功");
+      //         this.getAllWorkDicts()
+      //         this.corpTypeVisible = false
+      //       })
+      //   } else {
+      //     return false;
+      //   }
+      // });
+      this.getAllWorkDicts()
+      this.corpTypeVisible = false
     },
     corpTypeClosed() {
-      this.reload = Math.random();
-      this.form4 = this.$options.data().form4
+      // this.reload = Math.random();
+      // this.form4 = this.$options.data().form4
     },
     viewInfo(row) {
       this.detailData = {
@@ -457,9 +465,11 @@ export default {
 ::v-deep .el-form-item__error {
   display: none !important;
 }
-::v-deep .el-input-group__append{
+
+::v-deep .el-input-group__append {
   padding: 0 0px !important;
 }
+
 .el-dialog ::v-deep .el-form-item__error {
   display: none !important;
 }

+ 1 - 1
src/views/client/js/optionList.js

@@ -160,7 +160,7 @@ export const option2 = {
     {
       label: "地址",
       prop: "addr",
-      dicData: JSON.parse(localStorage.getItem('areaTypeTree')),
+      dicData:[],
       dataType: "string",
       type: "cascader",
       props: {

+ 4 - 1
src/views/supplier/detailsInfo.vue

@@ -87,7 +87,7 @@
                             </el-button> -->
                             <el-button size="mini">付款
                             </el-button>
-                            <el-button size="mini">
+                            <el-button size="mini">
                             </el-button>
                         </template>
                         <template slot="corpIdSearch">
@@ -417,6 +417,9 @@ export default {
                     this.loading = false;
                 });
         },
+        editCustomer(){
+            this.$emit('editOpen',this.form,1)
+        },
         async saveColumn() {
             const inSave = await this.saveColumnData(
                 this.getColumnName(210.1),

+ 35 - 42
src/views/supplier/detailsPage.vue

@@ -17,10 +17,10 @@
         <avue-form ref="form" class="trading-form" v-model="form" :option="option">
           <template slot="corpsTypeId">
             <div style="display:flex;">
-              <avue-input-tree default-expand-all v-model="form.corpsTypeId" placeholder="请选择供应商分类" :dic="corpTypeList"
+              <avue-input-tree v-model="form.corpsTypeId" placeholder="请选择供应商分类" :dic="corpTypeList"
                 :props="props">
               </avue-input-tree>
-              <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
+              <i class="el-icon-setting" style="font-size:18px;line-height: 32px;margin-left:4px"
                 @click="corpTypeVisible = true"></i>
             </div>
           </template>
@@ -81,24 +81,24 @@
       <c-upload v-loading="loadingBtn" typeUpload="CD"
         deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="corpsFiles" display
         :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
-      <el-dialog title="添加供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
-        width="30%" append-to-body @closed="corpTypeClosed">
-        <span>
-          <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
-          </avue-form>
-        </span>
-        <div class="avue-dialog__footer">
-          <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
-          <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
-        </div>
-      </el-dialog>
+        <el-dialog title="设置供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog"
+      width="80%" append-to-body @closed="corpTypeClosed">
+      <span>
+        <supplier-type></supplier-type>
+      </span>
+      <div class="avue-dialog__footer">
+        <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
+        <el-button @click="addCorpType" type="primary" size="mini">确 定</el-button>
+      </div>
+    </el-dialog>
     </div>
   </div>
 </template>
 
 <script>
 import { option2, option3 } from "./js/optionList";
-import { getDetails, addCorpType, getCorpType, submit, customerList } from "@/api/basicData/client";
+import { getDetails, addCorpType, getCorpType, submit, customerList,itemDel } from "@/api/basicData/client";
+import supplierType from '@/components/supplierType/index'
 export default {
   name: "index",
   data() {
@@ -213,6 +213,9 @@ export default {
       type: Object
     }
   },
+  components: {
+    supplierType
+  },
   async created() {
     this.option2 = await this.getColumnData(this.getColumnName(210), option2);
     // this.option3 = await this.getColumnData(this.getColumnName(210.4), option3);
@@ -230,9 +233,10 @@ export default {
       customerList({ corpType: "GYS" }).then(res => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
       });
-      // this.getWorkDicts("abbreviation").then(res => {
-      //   this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
-      // });
+      this.getWorkDicts("abbreviation").then(res => {
+        this.findObject(this.option2.column, "abbreviation").dicData = res.data.data;
+      });
+      this.findObject(this.option2.column, "addr").dicData =JSON.parse(localStorage.getItem('areaTypeTree'))
       this.$refs.crud.init();
     },
     cellStyle() {
@@ -277,13 +281,13 @@ export default {
         type: "warning"
       }).then(() => {
         if (row.id) {
-          // itemDel(row.id).then(res => {
-          //   this.$message({
-          //     type: "success",
-          //     message: "删除成功!"
-          //   });
-          //   this.data.splice(index, 1);
-          // });
+          itemDel(row.id).then(res => {
+            this.$message({
+              type: "success",
+              message: "删除成功!"
+            });
+            this.data.splice(index, 1);
+          });
         } else {
           this.$message({
             type: "success",
@@ -327,8 +331,8 @@ export default {
       });
     },
     corpTypeClosed() {
-      this.reload = Math.random();
-      this.form4 = this.$options.data().form4
+      // this.reload = Math.random();
+      // this.form4 = this.$options.data().form4
     },
     getCorpType() {
       getCorpType({ corpType: 'GYS' }).then(res => {
@@ -336,19 +340,8 @@ export default {
       })
     },
     addCorpType() {
-      this.$refs["corpType"].validate((valid, done) => {
-        done();
-        if (valid) {
-          addCorpType({ ...this.form4, corpType: 'GYS', status: 0 })
-            .then(res => {
-              this.$message.success("保存成功");
-              this.getCorpType()
-              this.corpTypeVisible = false
-            })
-        } else {
-          return false;
-        }
-      });
+      this.getCorpType()
+      this.corpTypeVisible = false
     },
     //修改提交触发
     editCustomer() {
@@ -443,9 +436,9 @@ export default {
   margin-bottom: 8px !important;
 }
 
-::v-deep .el-dialog__body {
-  padding: 0px 20px 15px 20px;
-}
+// ::v-deep .el-dialog__body {
+//   padding: 0px 20px 15px 20px;
+// }
 
 ::v-deep .el-form-item__error {
   display: none !important;

+ 31 - 24
src/views/supplier/index.vue

@@ -59,9 +59,11 @@
       </table>
       <el-row>
         <el-col :span="4">
-          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;" @save="corpTypeVisible = true">
+          <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
+            @save="corpTypeVisible = true">
             <template slot="addBtn">
-              <i class="el-icon-plus" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;" @click="corpTypeVisible = true"></i>
+              <i class="el-icon-setting" style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
+                @click="corpTypeVisible = true"></i>
             </template>
           </avue-tree>
         </el-col>
@@ -116,12 +118,11 @@
 
     </basic-container>
     <details-page v-if="!show" @goBack="goBack()" :detailData="detailData" />
-    <details-info v-if="!showInfo" @goBack="goBack()" :detailData="detailData" />
-    <el-dialog title="添加供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog avue-dialog--top"
-      width="30%" append-to-body @closed="corpTypeClosed">
+    <details-info v-if="!showInfo" @goBack="goBack()" @editOpen="editOpen" :detailData="detailData" />
+    <el-dialog title="设置供应商分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog"
+      width="80%" append-to-body @closed="corpTypeClosed">
       <span>
-        <avue-form :key="reload" ref="corpType" v-model="form4" :option="option4" style="margin-top:20px">
-        </avue-form>
+        <supplier-type></supplier-type>
       </span>
       <div class="avue-dialog__footer">
         <el-button @click="corpTypeVisible = false" size="mini">取 消</el-button>
@@ -136,6 +137,7 @@ import detailsInfo from "./detailsInfo";
 import detailsPage from "./detailsPage";
 import { option } from "./js/optionList";
 import { getList, getCorpType, pageStatistics, remove, addCorpType, customerList } from "@/api/basicData/client";
+import supplierType from '@/components/supplierType/index'
 export default {
   name: "index",
   data() {
@@ -277,7 +279,8 @@ export default {
   },
   components: {
     detailsPage,
-    detailsInfo
+    detailsInfo,
+    supplierType
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(209), option);
@@ -356,23 +359,25 @@ export default {
         });
     },
     addCorpType() {
-      this.$refs["corpType"].validate((valid, done) => {
-        done();
-        if (valid) {
-          addCorpType({ ...this.form4, corpType: 'GYS', status: 0 })
-            .then(res => {
-              this.$message.success("保存成功");
-              this.getAllWorkDicts()
-              this.corpTypeVisible = false
-            })
-        } else {
-          return false;
-        }
-      });
+      // this.$refs["corpType"].validate((valid, done) => {
+      //   done();
+      //   if (valid) {
+      //     addCorpType({ ...this.form4, corpType: 'GYS', status: 0 })
+      //       .then(res => {
+      //         this.$message.success("保存成功");
+      //         this.getAllWorkDicts()
+      //         this.corpTypeVisible = false
+      //       })
+      //   } else {
+      //     return false;
+      //   }
+      // });
+      this.getAllWorkDicts()
+      this.corpTypeVisible = false
     },
     corpTypeClosed() {
-      this.reload = Math.random();
-      this.form4 = this.$options.data().form4
+      // this.reload = Math.random();
+      // this.form4 = this.$options.data().form4
     },
     viewInfo(row) {
       this.detailData = {
@@ -457,9 +462,11 @@ export default {
 ::v-deep .el-form-item__error {
   display: none !important;
 }
-::v-deep .el-input-group__append{
+
+::v-deep .el-input-group__append {
   padding: 0 0px !important;
 }
+
 .el-dialog ::v-deep .el-form-item__error {
   display: none !important;
 }

+ 1 - 1
src/views/supplier/js/optionList.js

@@ -160,7 +160,7 @@ export const option2 = {
     {
       label: "地址",
       prop: "addr",
-      dicData: JSON.parse(localStorage.getItem('areaTypeTree')),
+      dicData:[],
       dataType: "string",
       type: "cascader",
       props: {