|  | @@ -1,49 +1,37 @@
 | 
	
		
			
				|  |  |  <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"
 | 
	
		
			
				|  |  | +    :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>
 | 
	
		
			
				|  |  | +      <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/store/customerCategory";
 | 
	
		
			
				|  |  | -import {customerParameter} from "@/api/store/management-type";
 | 
	
		
			
				|  |  | +import { customerList, typeSave, detail, deleteDetails } from "@/api/store/customerCategory";
 | 
	
		
			
				|  |  | +import { customerParameter } from "@/api/store/management-type";
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    name: "customerInformation",
 | 
	
	
		
			
				|  | @@ -51,7 +39,118 @@ export default {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        form: {},
 | 
	
		
			
				|  |  |        search: {},
 | 
	
		
			
				|  |  | -      option: option,
 | 
	
		
			
				|  |  | +      option: {
 | 
	
		
			
				|  |  | +        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,
 | 
	
		
			
				|  |  | +            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,
 | 
	
		
			
				|  |  | +            showColumn: false,
 | 
	
		
			
				|  |  | +            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"
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +            ]
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        ]
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  |        loading: false,
 | 
	
		
			
				|  |  |        parentId: 0,
 | 
	
		
			
				|  |  |        dataList: [],
 | 
	
	
		
			
				|  | @@ -64,26 +163,27 @@ export default {
 | 
	
		
			
				|  |  |        query: {}
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | -  async created() {
 | 
	
		
			
				|  |  | -  },
 | 
	
		
			
				|  |  | +  async created() {},
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  |      //删除列表后面的删除按钮触发触发(row, index, done)
 | 
	
		
			
				|  |  |      rowDel(row, index, done) {
 | 
	
		
			
				|  |  | -      console.log('5555555555555555555555555555555555');
 | 
	
		
			
				|  |  | +      console.log("5555555555555555555555555555555555");
 | 
	
		
			
				|  |  |        this.$confirm("确定将选择数据删除?", {
 | 
	
		
			
				|  |  |          confirmButtonText: "确定",
 | 
	
		
			
				|  |  |          cancelButtonText: "取消",
 | 
	
		
			
				|  |  |          type: "warning"
 | 
	
		
			
				|  |  | -      }).then(() => {
 | 
	
		
			
				|  |  | -        return deleteDetails(row.id);
 | 
	
		
			
				|  |  | -      }).then(() => {
 | 
	
		
			
				|  |  | -        this.$message({
 | 
	
		
			
				|  |  | -          type: "success",
 | 
	
		
			
				|  |  | -          message: "操作成功!"
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  | +        .then(() => {
 | 
	
		
			
				|  |  | +          return deleteDetails(row.id);
 | 
	
		
			
				|  |  | +        })
 | 
	
		
			
				|  |  | +        .then(() => {
 | 
	
		
			
				|  |  | +          this.$message({
 | 
	
		
			
				|  |  | +            type: "success",
 | 
	
		
			
				|  |  | +            message: "操作成功!"
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +          // 数据回调进行刷新
 | 
	
		
			
				|  |  | +          done(row);
 | 
	
		
			
				|  |  |          });
 | 
	
		
			
				|  |  | -        // 数据回调进行刷新
 | 
	
		
			
				|  |  | -        done(row);
 | 
	
		
			
				|  |  | -      });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //修改时的修改按钮点击触发
 | 
	
		
			
				|  |  |      rowUpdate(row, index, done, loading) {
 | 
	
	
		
			
				|  | @@ -106,7 +206,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //新增修改时保存触发
 | 
	
		
			
				|  |  |      rowSave(row, done, loading) {
 | 
	
		
			
				|  |  | -      console.log('33333333333333');
 | 
	
		
			
				|  |  | +      console.log("33333333333333");
 | 
	
		
			
				|  |  |        row.corpType = customerParameter.code;
 | 
	
		
			
				|  |  |        typeSave(row).then(
 | 
	
		
			
				|  |  |          res => {
 | 
	
	
		
			
				|  | @@ -125,7 +225,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      //查询全部
 | 
	
		
			
				|  |  |      initData() {
 | 
	
		
			
				|  |  | -      customerList({corpType: customerParameter.code}).then(res => {
 | 
	
		
			
				|  |  | +      customerList({ corpType: customerParameter.code }).then(res => {
 | 
	
		
			
				|  |  |          const column = this.findObject(this.option.column, "parentId");
 | 
	
		
			
				|  |  |          column.dicData = res.data.data.records;
 | 
	
		
			
				|  |  |        });
 | 
	
	
		
			
				|  | @@ -184,7 +284,7 @@ export default {
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      onLoad(page, params = {}) {
 | 
	
		
			
				|  |  |        this.loading = true;
 | 
	
		
			
				|  |  | -      const {createTimeA} = this.query;
 | 
	
		
			
				|  |  | +      const { createTimeA } = this.query;
 | 
	
		
			
				|  |  |        let values = {
 | 
	
		
			
				|  |  |          ...params,
 | 
	
		
			
				|  |  |          corpType: customerParameter.code,
 | 
	
	
		
			
				|  | @@ -205,7 +305,7 @@ export default {
 | 
	
		
			
				|  |  |        values.parentId = 0;
 | 
	
		
			
				|  |  |        customerList(values)
 | 
	
		
			
				|  |  |          .then(res => {
 | 
	
		
			
				|  |  | -          console.log('24324');
 | 
	
		
			
				|  |  | +          console.log("24324");
 | 
	
		
			
				|  |  |            this.dataList = res.data.data.records;
 | 
	
		
			
				|  |  |            this.page.total = res.data.data.total;
 | 
	
		
			
				|  |  |          })
 | 
	
	
		
			
				|  | @@ -219,10 +319,7 @@ export default {
 | 
	
		
			
				|  |  |         * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
 | 
	
		
			
				|  |  |         * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
 | 
	
		
			
				|  |  |         */
 | 
	
		
			
				|  |  | -      const inSave = await this.saveColumnData(
 | 
	
		
			
				|  |  | -        this.getColumnName(141.2),
 | 
	
		
			
				|  |  | -        this.option
 | 
	
		
			
				|  |  | -      );
 | 
	
		
			
				|  |  | +      const inSave = await this.saveColumnData(this.getColumnName(141.2), this.option);
 | 
	
		
			
				|  |  |        if (inSave) {
 | 
	
		
			
				|  |  |          this.$nextTick(() => {
 | 
	
		
			
				|  |  |            this.$refs.crud.doLayout();
 | 
	
	
		
			
				|  | @@ -246,7 +343,7 @@ export default {
 | 
	
		
			
				|  |  |      //树桩列点击展开触发
 | 
	
		
			
				|  |  |      treeLoad(tree, treeNode, resolve) {
 | 
	
		
			
				|  |  |        const parentId = tree.id;
 | 
	
		
			
				|  |  | -      customerList({parentId: parentId}).then(res => {
 | 
	
		
			
				|  |  | +      customerList({ parentId: parentId }).then(res => {
 | 
	
		
			
				|  |  |          resolve(res.data.data.records);
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -256,6 +353,6 @@ export default {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <style scoped>
 | 
	
		
			
				|  |  |  .page-crad ::v-deep .basic-container__card {
 | 
	
		
			
				|  |  | -    height: 94.8vh;
 | 
	
		
			
				|  |  | +  height: 94.8vh;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  </style>
 |