Browse Source

Merge branch 'ecp' of http://git.echepei.com/gubersail/gubersail-platform-ui into ecp

Qukatie 1 month ago
parent
commit
1edf29bc4e

+ 41 - 0
src/api/dealer/brand/brand.js

@@ -0,0 +1,41 @@
+import request from '@/router/axios';
+//查询列表
+export const getList = (params) => {
+    return request({
+        url: '/api/gubersail-admin/brandDesc/list',
+        method: 'get',
+        params: params
+    })
+}
+//删除
+export const remove = (id) => {
+    return request({
+        url: '/api/gubersail-admin/brandDesc/update',
+        method: 'post',
+        data: {
+            id
+        }
+    })
+}
+
+export const submit = (data) => {
+    return request({
+        url: '/api/gubersail-admin/brandDesc/submit',
+        method: 'POST',
+        data: data
+    })
+}
+export const getDetails = (data) => {
+    return request({
+        url: '/api/gubersail-admin/brandDesc/detail',
+        method: 'get',
+        params: data
+    })
+}
+export const updateEnableOrNot = (data) => {
+    return request({
+        url: '/api/gubersail-admin/brandDesc/updateEnableOrNot',
+        method: 'get',
+        params: data
+    })
+}

+ 36 - 0
src/api/fc/customerCategory.js

@@ -0,0 +1,36 @@
+import request from '@/router/axios';
+
+//客户类别列表查询
+export function customerList(data) {
+    return request({
+        url: '/api/gubersail-admin/corpstype/page',
+        method: 'get',
+        params: data
+    })
+}
+
+//客户类别列表修改和新增
+export function typeSave(data) {
+    return request({
+        url: '/api/gubersail-admin/corpstype/submit',
+        method: 'post',
+        data: data
+    })
+}
+//客户类别列表查看明细
+export function detail(data) {
+    return request({
+        url: '/api/gubersail-admin/corpstype/detail?id='+data,
+        method: 'get'
+    })
+}
+//客户类别列表修改和新增
+export function deleteDetails(data) {
+    return request({
+        url: '/api/gubersail-admin/corpstype/update',
+        method: 'post',
+        data: {
+            id:data
+        }
+    })
+}

+ 118 - 0
src/api/fc/customerInformation.js

@@ -0,0 +1,118 @@
+import request from '@/router/axios';
+
+
+//查询区域下拉
+export function areaTypeTree() {
+    return request({
+        url: '/api/blade-system/region/lazy-list',
+        method: 'get'
+    })
+}
+
+
+// 创建用户2
+export function creatingUsersTwo(data) {
+    return request({
+        url: '/api/gubersail-admin/corpsAttn/user',
+        method: 'post',
+        data: data
+    })
+}
+
+
+export const getList = (params) => {
+    return request({
+        url: '/api/gubersail-admin/fc/customer/list',
+        method: 'get',
+        params: {
+            ...params
+        }
+    })
+}
+
+
+export const getDetails = (data) => {
+    return request({
+        url: '/api/gubersail-admin/corpsDesc/detail',
+        method: 'get',
+        params: data
+    })
+}
+export const getCorpType = (data) => {
+    return request({
+        url: '/api/gubersail-admin/corpstype/tree',
+        method: 'get',
+        params: data
+    })
+}
+export const submit = (data) => {
+    return request({
+        url: '/api/gubersail-admin/corpsDesc/submit',
+        method: 'POST',
+        data: data
+    })
+}
+export const remove = (data) => {
+    return request({
+        url: '/api/gubersail-admin/corpsDesc/update',
+        method: 'POST',
+        data: data
+    })
+}
+
+export function customerList(data) {
+    return request({
+        url: '/api/gubersail-admin/corpstype/page',
+        method: 'get',
+        params: data
+    })
+}
+
+export const itemDel = (data) => {
+    return request({
+        url: '/api/gubersail-admin/corpsAddr/update',
+        method: 'POST',
+        data: {
+            id: data
+        }
+    })
+}
+
+//客户联系人列表删除
+export function corpsattn(data) {
+    return request({
+        url: '/api/gubersail-admin/corpsAttn/update',
+        method: 'post',
+        data: {
+            id: data
+        }
+    })
+}
+
+//禁用启用
+export function editenable(data) {
+    return request({
+        url: '/api/gubersail-admin/corpsDesc/updateEnableOrNot',
+        method: 'get',
+        params: data
+    })
+}
+
+// 查询业务员
+export function getUserByRole(data) {
+    return request({
+        url: '/api/blade-user/salerList',
+        method: 'get',
+        params: data
+    })
+}
+
+
+// 查询品牌
+export function getBrandDesc(data) {
+    return request({
+        url: 'api/gubersail-admin/brandDesc/listAllV1?type=PP',
+        method: 'get',
+        params: data
+    })
+}

+ 92 - 0
src/api/fc/management-type.js

@@ -0,0 +1,92 @@
+//客户管理
+export const customerParameter = {
+  code: "KH",
+  name: "客户"
+}
+//客户管理
+export const supplierParameter = {
+  code: "GYS",
+  name: "供应商"
+}
+//客户管理
+export const companyParameter = {
+  code: "GS",
+  name: "公司主体"
+}
+export const KCParameter = {
+  code: "KH,CD",
+  name: "客户、车队"
+}
+
+export const CSParameter = {
+  code: "KG",
+  name: "客户、供应商"
+}
+//车队
+export const CDParameter = {
+  code: "CD",
+  name: "车队"
+}
+//工厂
+export const GCParameter = {
+  code: "GC",
+  name: "工厂"
+}
+export const getCustomerCode = (row) => {
+  let code = null;
+  switch (row) {
+    case 'KH':
+      code = customerParameter.code
+      break;
+    case 'GYS':
+      code = supplierParameter.code
+      break;
+    case 'GS':
+      code = companyParameter.code
+      break;
+    case 'KC':
+      code = KCParameter.code
+      break;
+    case 'KG':
+      code = CSParameter.code
+      break;
+    case 'CD':
+      code = CDParameter.code
+      break;
+    case 'GC':
+      code = GCParameter.code
+      break;
+    default:
+      code = customerParameter.code
+  }
+  return code
+}
+export const getCustomerName = (row) => {
+  let name = null;
+  switch (row) {
+    case 'KH':
+      name = customerParameter.name
+      break;
+    case 'GYS':
+      name = supplierParameter.name
+      break;
+    case 'GS':
+      name = companyParameter.name
+      break;
+    case 'KG':
+      name = CSParameter.name
+      break;
+    case 'KC':
+      name = KCParameter.name
+      break;
+    case 'CD':
+      name = CDParameter.name
+      break;
+    case 'GC':
+      name = GCParameter.name
+      break;
+    default:
+      name = customerParameter.name
+  }
+  return name
+}

+ 43 - 0
src/components/titleComponent/main.vue

@@ -0,0 +1,43 @@
+<template>
+  <div class="container">
+    <div class="redcolumn"></div>
+    <div class="container-title">{{ title }}</div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "containerTitle",
+  props: {
+    title: ""
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.container {
+  display: flex;
+  justify-content: left;
+  margin-left: 10px;
+  background-color: inherit;
+  height: 18px;
+  // padding-bottom: 12px;
+  vertical-align: middle;
+  .redcolumn {
+    width: 4px;
+    height: 13px;
+    background-color: #d6000f;
+    margin: 3px 4px 0 0;
+  }
+  .container-title {
+    font-size: 12px;
+    line-height: 18px;
+    font-family: PingFangSC-Semibold, PingFang SC;
+    font-weight: 600;
+    color: #323233;
+  }
+}
+// .container:first-child {
+//   padding-top: 16px;
+// }
+</style>

+ 4 - 0
src/main.js

@@ -43,6 +43,10 @@ Vue.use(avueUeditor)
 import cUpload from './components/upload'
 Vue.component('cUpload', cUpload)
 
+//自定义标题
+import containerTitle from './components/titleComponent/main.vue';
+Vue.component('containerTitle', containerTitle);
+
 //获取浏览器指纹并生成ID
 import Fingerprint2 from 'fingerprintjs2'
 // 注册全局crud驱动

+ 219 - 0
src/views/dealer/brand/detailsPage.vue

@@ -0,0 +1,219 @@
+<template>
+    <div>
+        <div class="customer-head">
+            <div class="customer-back">
+                <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                           @click="backToList(0)">返回列表
+                </el-button>
+            </div>
+            <div class="add-customer-btn">
+                <el-button class="el-button--small-yh" type="primary" size="small" @click="editCustomer">保存数据
+                </el-button>
+                <el-button class="el-button--small-yh" :type="form.enableOrNot == 0 ? 'primary' : ''" size="small"
+                           @click="enableNot" v-if="form.id">
+                    {{ form.enableOrNot == 0 ? '启用' : '禁用' }}
+                </el-button>
+            </div>
+        </div>
+        <div style="margin-top: 50px">
+            <trade-card title="基础信息">
+                <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
+            </trade-card>
+            <trade-card :title="titleType==1?'规格型号1附件信息':'花纹附件信息'">
+                <c-upload basic :data="form.brandFigureList" :disabled="disabled"
+                          deleteUrl="/api/blade-sales-part/brandfigure/remove" :enumerationValue="338" display/>
+                <!-- <span style="font-size: 12px;">(图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)</span> -->
+            </trade-card>
+            <trade-card title="附件信息">
+                <c-upload basic :data="form.brandFilesList" :disabled="disabled"
+                          deleteUrl="/api/blade-sales-part/brandfiles/remove" :enumerationValue="272.1" display/>
+                <!-- <span style="font-size: 12px;">(图片文件像素推荐700X750,有且只允许有一张主图,其余均为副图)</span> -->
+            </trade-card>
+        </div>
+    </div>
+</template>
+
+<script>
+import {submit, getDetails, updateEnableOrNot} from "@/api/dealer/brand/brand";
+
+export default {
+    name: "detailsPage",
+    data() {
+        return {
+            disabled: false,
+            form: {
+                brandFilesList: [],
+                brandFigureList: []
+            },
+            optionForm: {
+                menuBtn: false,
+                span: 8,
+                column: [{
+                    label: '名称',
+                    prop: "cname",
+                    rules: [{
+                        required: true,
+                        message: " ",
+                        trigger: "blur"
+                    }]
+                }, {
+                    label: '制单人',
+                    prop: "createUserName",
+                    disabled: true
+                }, {
+                    label: '制单日期',
+                    prop: "createTime",
+                    disabled: true
+                }, {
+                    label: '排序',
+                    prop: "sort",
+                    type: 'number'
+                }, {
+                    label: '备注',
+                    prop: "remarks",
+                    type: 'textarea',
+                    span: 24,
+                    minRows: 2
+                }]
+            },
+            formContacts: {},
+            titleType: null,
+        }
+    },
+    props: {
+        onLoad: Object,
+        detailData: Object
+    },
+    async created() {
+        if (this.onLoad.id && this.detailData.id) {
+            this.refresh(this.onLoad.id, true)
+        } else if (this.onLoad.id) {
+            this.refresh(this.onLoad.id, true)
+        }
+    },
+    methods: {
+        refresh(id, type) {
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            })
+            getDetails({id: id}).then(res => {
+                this.form = res.data.data
+                if (this.form.enableOrNot == 1) {
+                    this.$set(this.optionForm, 'disabled', true)
+                } else {
+                    this.$set(this.optionForm, 'disabled', false)
+                }
+                loading.close();
+            }).catch(() => {
+                loading.close();
+            })
+        },
+        //是否启用
+        enableNot() {
+            // const { brandFilesList, ...formWithoutBrandFilesList } = this.form;
+            // const { brandFigureList, ...formWithoutbrandFigureListList } = this.form;
+            const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+            })
+            this.form.enableOrNot = this.form.enableOrNot == 0 ? 1 : 0
+            delete this.form.brandFigureList
+            delete this.form.brandFilesList
+            updateEnableOrNot({
+                ...this.form
+            }).then(res => {
+                loading.close()
+                this.$message.success("操作成功")
+                this.refresh(this.form.id)
+            }).catch(() => {
+                loading.close()
+            })
+        },
+        //修改提交触发
+        editCustomer() {
+            if (this.form.createDept && JSON.parse(localStorage.getItem('saber-userInfo')).content.dept_id.indexOf(this.form.createDept) == -1) {
+                this.$message.warning('暂无权限')
+                return
+            }
+            if (this.form.brandFigureList.length === 0 && this.form.brandFilesList.length === 0) {
+                return this.$message.error('请上传图片')
+            }
+            if (this.form.brandFilesList.length != 0) {
+                this.form.brandFilesList[0].version = '0'
+            }
+            let num = 0
+            for (let item of this.form.brandFilesList) {
+                if (item.version == 0) {
+                    num++
+                }
+            }
+            for (let item of this.form.brandFigureList) {
+                if (this.form.brandFigureList.filter(e => e.figure == item.figure).length > 1) {
+                    return this.$message.error('花纹名称' + item.figure + '不能重复!')
+                }
+            }
+            if (num > 1) {
+                return this.$message.error("主图类型重复")
+            }
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    this.loadingBtn = true;
+                    this.form.type = 'PP'
+                    // 把花纹数组里的全部默认0
+                    for (let item of this.form.brandFigureList) {
+                        item.version = '0'
+                    }
+                    submit({
+                        ...this.form
+                    }).then(res => {
+                        this.$message.success("保存成功");
+                        this.refresh(res.data.data.id)
+                    }).finally(() => {
+                        this.loadingBtn = false;
+                    });
+                } else {
+                    return false;
+                }
+            });
+        },
+        //自定义列保存
+        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;
+            }
+        },
+        backToList(type) {
+            this.$emit("backToList", type);
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-form-item {
+    margin-bottom: 8px !important;
+}
+</style>

+ 267 - 0
src/views/dealer/brand/index.vue

@@ -0,0 +1,267 @@
+<template>
+    <div>
+        <basic-container v-show="!detailsOpen">
+            <avue-crud
+                :option="option"
+                :search.sync="search"
+                v-model="form"
+                :table-loading="loading"
+                :data="dataList"
+                ref="crud"
+                :key="key"
+                @on-load="onLoad"
+                @search-change="searchChange"
+                @row-del="rowDel"
+                @refresh-change="refreshChange"
+                @resetColumn="resetColumnTwo('crud','option','optionList',272)"
+                @saveColumn="saveColumnTwo('crud','option','optionList',272)"
+                :page.sync="page">
+                <template slot="enableOrNot" slot-scope="{row,index,disabled}">
+                    <div v-if="row.enableOrNot === 1">是</div>
+                    <div v-else style="color: red">否</div>
+                </template>
+                <template slot-scope="{type,size,row,index}" slot="menu">
+                    <!-- <el-button :size="size" :type="type" @click="check(row)">查看</el-button> -->
+                    <el-button :size="size" :type="type" :disabled="row.enableOrNot"
+                               @click="$refs.crud.rowDel(row,index)">删除
+                    </el-button>
+                </template>
+                <template slot-scope="{ row, index }" slot="cname">
+                    <span style="color: #409EFF;cursor: pointer" @click.stop="check(row)">{{ row.cname }}</span>
+                </template>
+                <template slot="corpNameSearch">
+                    <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>
+                </template>
+                <template slot-scope="{type,size,row,$index}" slot="menuLeft">
+                    <el-button icon="el-icon-plus" type="primary" :size="size" @click="detailsOpen = true">新增
+                    </el-button>
+                </template>
+            </avue-crud>
+        </basic-container>
+        <detailsPage v-if="detailsOpen" :onLoad="form" :detailData="detailData" @backToList="backToList"></detailsPage>
+    </div>
+</template>
+
+<script>
+import {getList, remove} from "@/api/dealer/brand/brand";
+import detailsPage from "./detailsPage.vue"
+
+export default {
+    name: "index",
+    components: {
+        detailsPage
+    },
+    data() {
+        return {
+            detailsOpen: false,
+            loading: false,
+            search: {},
+            form: {},
+            dataList: [],
+            detailData: {},
+            page: {
+                pageSize: 20,
+                currentPage: 1,
+                total: 0,
+                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+            },
+            key: 0,
+            option: {},
+            optionList: {
+                viewBtn: false,
+                editBtn: false,
+                delBtn: false,
+                addBtn: false,
+                index: true,
+                span: 8,
+                border: true,
+                height: "auto",
+                searchMenuPosition: "right",
+                align: "center",
+                size: "small",
+                menuWidth: 50,
+                searchSpan: 8,
+                searchIcon: true,
+                searchIndex: 2,
+                highlightCurrentRow: true,
+                dialogWidth: "70%",
+                column: [{
+                    label: '品牌名称',
+                    prop: "cname",
+                    search: true,
+                    overHidden: true,
+                }, {
+                    label: '所属公司',
+                    prop: "salesCompanyName",
+                    overHidden: true,
+                }, {
+                    label: "制单人",
+                    search: true,
+                    prop: "createUserName",
+                    searchProp: "createUser",
+                    overHidden: true,
+                    width: 100,
+                    filterable: true,
+                    remote: true,
+                    type: "select",
+                    dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+                    props: {
+                        label: "account",
+                        value: "id",
+                        res: 'data.records'
+                    }
+                }, {
+                    label: "制单日期",
+                    search: true,
+                    prop: "createTime",
+                    searchProp: "createTimeList",
+                    type: "date",
+                    overHidden: true,
+                    width: 100,
+                    searchRange: true,
+                    unlinkPanels: true,
+                    searchDefaultTime: ["00:00:00", "23:59:59"],
+                    format: "yyyy-MM-dd",
+                    valueFormat: "yyyy-MM-dd HH:mm:ss"
+                }, {
+                    label: "更新人",
+                    prop: "updateUserName",
+                    searchProp: "updateUser",
+                    overHidden: true,
+                    width: 100,
+                    filterable: true,
+                    remote: true,
+                    type: "select",
+                    dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+                    props: {
+                        label: "account",
+                        value: "id",
+                        res: 'data.records'
+                    }
+                }, {
+                    label: "更新日期",
+                    prop: "updateTime",
+                    searchProp: "updateTimeList",
+                    type: "date",
+                    overHidden: true,
+                    width: 100,
+                    searchRange: true,
+                    searchDefaultTime: ["00:00:00", "23:59:59"],
+                    format: "yyyy-MM-dd",
+                    valueFormat: "yyyy-MM-dd HH:mm:ss"
+                }, {
+                    label: '是否启用',
+                    prop: "enableOrNot",
+                    search: false,
+                    overHidden: true,
+                    type: 'select',
+                    dicData: [{
+                        label: '否',
+                        value: 0
+                    }, {
+                        label: '是',
+                        value: 1
+                    }]
+                }]
+            }
+        }
+    },
+    async created() {
+        this.option = this.optionList;
+        this.key++
+        let i = 0;
+        this.option.column.forEach(item => {
+            if (item.search) i++
+        })
+        if (i % 3 !== 0) {
+            const num = 3 - Number(i % 3)
+            this.option.searchMenuSpan = num * 8;
+            this.option.searchMenuPosition = "right";
+        }
+    },
+    methods: {
+        check(row) {
+            this.form = row
+            this.detailsOpen = true
+        },
+        backToList(type) {
+            this.form = {}
+            this.detailsOpen = false
+            if (type === 0) {
+                this.detailData = {}
+            }
+            this.onLoad(this.page, this.search)
+        },
+        //刷新
+        refreshChange() {
+            this.onLoad(this.page, this.search)
+        },
+        rowDel(form, index) {
+            this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                remove(form.id).then(res => {
+                    this.$message({
+                        type: 'success',
+                        message: '删除成功!'
+                    });
+                    this.dataList.splice(index, 1);
+                    this.onLoad(this.page)
+                })
+            }).catch(() => {
+            });
+        },
+        searchChange(params, done) {
+            this.page.currentPage = 1
+            done();
+            this.onLoad(this.page, params)
+        },
+        onLoad(page, params = {}) {
+            params = {
+                type: 'PP',
+                ...params,
+                current: page.currentPage,
+                size: page.pageSize,
+                ...Object.assign(params, this.search)
+            }
+            this.loading = true
+            getList(params).then(res => {
+                this.dataList = res.data.data.records
+                this.page.total = res.data.data.total
+                this.loading = false
+            }).finally(() => {
+                this.loading = false
+            })
+        },
+        //自定义列保存
+        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;
+            }
+        }
+    }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 0 - 3
src/views/dealer/store/detailsPage.vue

@@ -186,10 +186,7 @@ import {
     typeSave,
     customerListAll
 } from "@/api/tirePartsMall/basicData/warehouse";
-import limitrecord from "@/views/tirePartsMall/basicData/customerInformation/components/limitrecord.vue";
 import {limitrecordSubmit} from "@/api/tirePartsMall/basicData/customerInformation/limitrecord";
-import check_green_recycling_record
-    from "@/views/tirePartsMall/basicData/customerInformation/check_green_recycling_record.vue";
 
 export default {
     name: "index",

+ 263 - 0
src/views/fc/customer/components/index.vue

@@ -0,0 +1,263 @@
+<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/fc/customerCategory";
+import {customerParameter} from "@/api/fc/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.2), option);
+    this.option.height = window.innerHeight - 500;
+  },
+  methods: {
+    //删除列表后面的删除按钮触发触发(row, index, done)
+    rowDel(row, index, done) {
+      console.log('5555555555555555555555555555555555');
+      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) {
+      console.log('33333333333333');
+      row.corpType = customerParameter.code;
+      typeSave(row).then(
+        res => {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.onLoad(this.page);
+          done(row);
+        },
+        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) {
+      console.log(1);
+      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 => {
+          console.log('24324');
+          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.2),
+        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.2), 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/views/fc/customer/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,
+      "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"
+        }
+      ]
+    }
+  ]
+}

+ 887 - 0
src/views/fc/customer/detailsPage.vue

@@ -0,0 +1,887 @@
+<template>
+    <div>
+        <div class="borderless">
+            <div class="customer-head">
+                <div class="customer-back">
+                    <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+                               @click="backToList">返回列表
+                    </el-button>
+                </div>
+                <div class="add-customer-btn">
+                    <el-button type="primary" size="small" @click="editCustomer">
+                        保存数据
+                    </el-button>
+                    <el-button class="el-button--small-yh" :type="form.enableOrNot == 0 ? 'primary' : ''" size="small"
+                               v-if="form.id"
+                               @click="editEnable">
+                        {{ form.enableOrNot == 0 ? '启用' : '禁用' }}
+                    </el-button>
+                </div>
+            </div>
+            <trade-card title="基础资料" style="margin-top: 60px" v-loading="loadingBtn">
+                <avue-form ref="form" class="trading-form" v-model="form" :option="option">
+                    <template slot="corpsTypeId">
+                        <div style="display:flex;">
+                            <avue-input-tree v-model="form.corpsTypeId" :disabled="option.disabled"
+                                             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"
+                               @click="corpTypeVisible = true"></i>
+                        </div>
+                    </template>
+                </avue-form>
+            </trade-card>
+            <trade-card title="客户联系人" v-loading="loadingBtn">
+                <avue-crud ref="crudTwo" :option="customerContactBack" v-model="contactsForm" :data="contactsData"
+                           @saveColumn="saveColumnTwo" @resetColumn="resetColumnTwo" @row-save="rowSave"
+                           @row-update="rowUpdate"
+                           @row-del="rowDelTwo">
+                    <template slot-scope="{ type, size, row, disabled,index}" slot="menu">
+                        <el-button :size="size" :disabled="disabled" :type="type"
+                                   :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
+                                   @click="$refs.crudTwo.rowEdit(row, index)">{{
+                                row.$cellEdit ? '确认' : '修改'
+                            }}
+                        </el-button>
+                        <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
+                                   @click="rowDelTwo(row, index)">删除
+                        </el-button>
+                        <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户
+                        </el-button>
+                    </template>
+                </avue-crud>
+            </trade-card>
+            <trade-card title="地址信息" v-loading="loadingBtn">
+                <avue-crud :option="option2" ref="crud" :data="data" @row-save="rowSave" @row-update="rowUpdate"
+                           @saveColumn="saveColumn" @resetColumn="resetColumn">
+                    <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="menuLeft">
+                        <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="addRow">录入明细
+                        </el-button>
+                    </template>
+                    <template v-if="!row.$cellEdit" slot-scope="{type,size,row,index,disabled}" slot="menu">
+                        <el-button :size="size" :disabled="disabled" :type="type"
+                                   :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
+                                   @click="$refs.crud.rowCell(row, index)">{{
+                                row.$cellEdit ? '确认' : '修改'
+                            }}
+                        </el-button>
+                        <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
+                                   @click="rowDel(row, index)">删除
+                        </el-button>
+                    </template>
+                    <template slot="defaultAddres" slot-scope="{row,index,disabled}">
+                        <el-switch active-value="1" inactive-value="0" :disabled="disabled" v-model="row.defaultAddres"
+                                   @change="addressUnique(row, index)">
+                        </el-switch>
+                    </template>
+                </avue-crud>
+            </trade-card>
+            <containerTitle title="上传附件"></containerTitle>
+            <c-upload v-loading="loadingBtn" typeUpload="CD" deleteUrl="/api/blade-sales-part/corpsfiles/remove"
+                      :data="corpsFiles" display :enumerationValue="35.1" :disabled="detailData.status == 1"></c-upload>
+            <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
+                       append-to-body @closed="corpTypeClosed">
+                <span>
+                        <corp-type></corp-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>
+
+        <el-dialog title="创建用户" :visible.sync="dialogVisibleBt" append-to-body width="60%">
+            <avue-form v-if="dialogVisibleBt" ref="formDataTwo" v-model="formDataTwo" :option="optionData">
+            </avue-form>
+            <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleBt = false">取 消</el-button>
+        <el-button type="primary" @click="confirmSynchronizationTwo">确 定</el-button>
+      </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import {option2, option3} from "./js/optionList";
+import {getDetails, getCorpType, submit, customerList,areaTypeTree,
+    itemDel, corpsattn, editenable, getUserByRole, getBrandDesc, creatingUsersTwo} from "@/api/fc/customerInformation"
+import corpType from './components/index'
+import {getRoleTree} from "@/api/system/role";
+import {getDeptTree} from "@/api/system/dept";
+import {getPostList} from "@/api/system/post";
+import website from "@/config/website";
+
+export default {
+    name: "index",
+    data() {
+        return {
+            propsCk: {
+                label: 'cname',
+                value: 'id'
+            },
+            props: {
+                label: 'title',
+                value: 'value'
+            },
+            optionData: {
+                span: 8,
+                menuBtn: false,
+                column: [
+                    {
+                        label: "所属角色",
+                        prop: "roleId",
+                        multiple: true,
+                        type: "tree",
+                        dicData: [],
+                        props: {
+                            label: "title"
+                        },
+                        checkStrictly: true,
+                        slot: true,
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属角色",
+                                trigger: "click"
+                            }
+                        ]
+                    },
+                    {
+                        label: "所属部门",
+                        prop: "deptId",
+                        type: "tree",
+                        multiple: true,
+                        dicData: [],
+                        props: {
+                            label: "title"
+                        },
+                        checkStrictly: true,
+                        slot: true,
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属部门",
+                                trigger: "click"
+                            }
+                        ]
+                    },
+                    {
+                        label: "所属岗位",
+                        prop: "postId",
+                        type: "tree",
+                        multiple: true,
+                        dicData: [],
+                        props: {
+                            label: "postName",
+                            value: "id"
+                        },
+                        rules: [
+                            {
+                                required: true,
+                                message: "请选择所属岗位",
+                                trigger: "click"
+                            }
+                        ]
+                    }
+                ]
+            },
+            dialogVisibleBt: false,
+            formDataTwo: false,
+            customerContact: {},
+            contactsForm: {},
+            contactsData: [],
+            corpTypeList: [],
+            corpTypeVisible: false,
+            loadingBtn: false,
+            form: {
+                ifLimitAmount: '0'
+            },
+            form4: {},
+            data: [],
+            data2: [],
+            option: {
+                menuBtn: false,
+                labelWidth: 130,
+                column: [
+                    {
+                        label: "客户名称",
+                        prop: "cname",
+                        rules: [
+                            {
+                                required: true,
+                                message: "",
+                                trigger: "blur"
+                            }
+                        ],
+                        span: 8,
+                    },
+                    {
+                        label: "客户分类",
+                        prop: "corpsTypeId",
+                        span: 8,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }]
+                    },
+                    {
+                        label: "电话",
+                        prop: "tel",
+                        span: 8,
+                    },
+                    {
+                        label: "业务员",
+                        span: 12,
+                        prop: "salesmanId",
+                        type: "select",
+                        props: {
+                            label: "name",
+                            value: "id"
+                        },
+                        dicData: [],
+                        dicUrl: "/api/blade-user/factoryUserList",
+                        filterable: true,
+                        rules: [{
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }],
+                        change: (value) => {
+                            if (value.value) {
+                                for (let item of value.column.dicData.data) {
+                                    if (item.id == value.value) {
+                                        this.$set(this.form, 'salesmanName', item.name)
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    {
+                        label: "品牌",
+                        prop: "brandId",
+                        props: {
+                            label: 'cname',
+                            value: 'id'
+                        },
+                        span: 12,
+                        search: true,
+                        dicDate: [],
+                        multiple: true,
+                        dicUrl: '/api/gubersail-admin/brandDesc/listAllV1?type=PP',
+                        type: "select",
+                        dataType: "string",
+                        rules: [{
+                            message: "请选择品牌",
+                            trigger: "click"
+                        }]
+                    },
+                    {
+                        label: "备注",
+                        prop: "remarks",
+                        type: "textarea",
+                        minRows: 2,
+                        span: 24,
+                    }
+                ]
+            },
+            option2:{
+                align: 'center',
+                index: true,
+                addBtnText: "录入明细",
+                refreshBtn: false,
+                dialogDrag: true,
+                addBtn: false,
+                span: 8,
+                height: 600,
+                editBtn: false,
+                delBtn: false,
+                menuWidth: 140,
+                dialogTop: 25,
+                dialogWidth: "80%",
+                addRowBtn:false,
+                cellBtn:true,
+                rowKey: "index",
+                cancelBtn:false,
+                // saveBtn:false,
+                column: [{
+                    label: '联系人',
+                    prop: 'contacts',
+                    cell: true,
+                    rules: [
+                        {
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }
+                    ],
+                }, {
+                    label: '电话',
+                    prop: 'tel',
+                    cell: true,
+                    rules: [
+                        {
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }
+                    ]
+                },
+                    {
+                        label: "地址",
+                        prop: "belongtoarea",
+                        dicData: [],
+                        dataType: "string",
+                        type: "cascader",
+                        props: {
+                            label: 'name',
+                            value: 'name'
+                        },
+                        rules: [
+                            {
+                                required: true,
+                                message: " ",
+                                trigger: "blur"
+                            }
+                        ],
+                        filterable: true,
+                        cell: true,
+                    },
+                    {
+                        label: '详细地址',
+                        prop: 'detailedAddress',
+                        cell: true,
+                        rules: [
+                            {
+                                required: true,
+                                message: " ",
+                                trigger: "blur"
+                            }
+                        ]
+                    }, {
+                        label: '备注',
+                        prop: 'remarks',
+                        cell: true
+                    }, {
+                        label: '默认地址',
+                        prop: 'defaultAddres',
+                        display: false,
+                        width: 100,
+                    }]
+            },
+            option3: {},
+            option4: {
+                menuBtn: false,
+                labelWidth: 80,
+                column: [{
+                    label: "分类名称",
+                    prop: "cname",
+                    rules: [
+                        {
+                            required: true,
+                            message: "",
+                            trigger: "blur"
+                        }
+                    ],
+                    span: 24,
+                },
+                    {
+                        label: "上级类型",
+                        prop: "parentId",
+                        dicData: [],
+                        type: "tree",
+                        props: {
+                            label: "cname",
+                            value: "id"
+                        },
+                        span: 24,
+                    }
+                ]
+            },
+            corpsFiles: [],
+            customerContactBack: {
+                align: 'center',
+                index: true,
+                addBtnText: "录入明细",
+                refreshBtn: false,
+                dialogDrag: true,
+                addBtn: true,
+                span: 8,
+                height: 600,
+                addRowBtn: false,
+                editBtn: false,
+                delBtn: false,
+                menuWidth: 200,
+                dialogTop: 25,
+                dialogWidth: "80%",
+                column: [{
+                    label: '联系人',
+                    prop: 'cname',
+                    cell: true,
+                    rules: [
+                        {
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }
+                    ]
+                }, {
+                    label: '电话',
+                    prop: 'tel',
+                    cell: true,
+                    rules: [
+                        {
+                            required: true,
+                            message: " ",
+                            trigger: "blur"
+                        }
+                    ]
+                }, {
+                    label: '登录用户id',
+                    prop: 'userId',
+                    cell: true
+                }, {
+                    label: '备注',
+                    prop: 'remarks',
+                    cell: true
+                }]
+            },
+            userObj: {}
+        }
+    },
+    components: {
+        corpType
+    },
+    props: {
+        detailData: {
+            type: Object
+        }
+    },
+    async created() {
+        this.customerContact = await this.getColumnData(
+            this.getColumnName(263.1),
+            this.customerContactBack
+        );
+        if (this.detailData.id) {
+            this.getDetail(this.detailData.id);
+        }
+        if (this.detailData.status == 1) {
+            this.option.disabled = true;
+        }
+        if (!website.tenantMode) {
+            this.initData(website.tenantId);
+        } else {
+            this.initData();
+        }
+        this.getUserByRolefun()
+        this.getCorpType()
+        this.getAllWorkDicts()
+        this.userObj = JSON.parse(localStorage.getItem("saber-userInfo")).content;
+
+    },
+    activated() {
+
+        setTimeout(() => {
+            this.$nextTick(() => {
+                this.$refs.crud.doLayout()
+            })
+        }, 100)
+    },
+    methods: {
+        // 获取业务员数据
+        getUserByRolefun() {
+            getUserByRole().then(res => {
+                this.findObject(this.option.column, "salesmanId").dicData = res.data;
+            })
+        },
+        // 启用或禁用
+        editEnable() {
+            let data = this.form
+            editenable({id: data.id, enableOrNot: data.enableOrNot ? 0 : 1}).then(res => {
+                this.$message({
+                    type: "success",
+                    message: data.enableOrNot ? "禁用成功!" : "启用成功!"
+                });
+                this.getDetail(this.detailData.id)
+                // this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
+            })
+        },
+        addressUnique(row, index) {
+            for (let item in this.data) {
+                if (index != item) {
+                    if (this.data[item].defaultAddres == 1) {
+                        this.$message.warning("默认地址只能唯一")
+                        return row.defaultAddres = 0
+                    }
+                }
+            }
+        },
+        initData(tenantId) {
+            getBrandDesc().then(res => {
+                const column = this.findObject(this.option.column, 'brandId')
+                column.dicData = res.data.data
+                this.form.brandId = '';
+            })
+            getRoleTree(tenantId).then(res => {
+                const column = this.findObject(this.optionData.column, "roleId");
+                column.dicData = res.data.data;
+            });
+            getDeptTree(tenantId).then(res => {
+                const column = this.findObject(this.optionData.column, "deptId");
+                column.dicData = res.data.data;
+            });
+            getPostList(tenantId).then(res => {
+                const column = this.findObject(this.optionData.column, "postId");
+                column.dicData = res.data.data;
+            });
+        },
+        //确认创建用户
+        confirmSynchronizationTwo() {
+            this.$refs["formDataTwo"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    let data = JSON.parse(JSON.stringify(this.formDataTwo));
+                    data.deptId = data.deptId.join(",");
+                    data.roleId = data.roleId.join(",");
+                    data.postId = data.postId.join(",");
+                    creatingUsersTwo({
+                        ...data,
+                        id: this.formRow.id
+                    }).then(res => {
+                        this.dialogVisibleBt = false;
+                        this.formDataTwo = {}
+                        this.$message.success(
+                            "创建用户成功,默认帐号:手机号。默认密码:123456"
+                        );
+                        this.getDetail(this.form.id)
+                    });
+                } else {
+                    return false;
+                }
+            });
+        }
+        ,
+        getAllWorkDicts() {
+            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.getAreaData()
+            // this.findObject(this.option2.column, "belongtoarea").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
+            this.$refs.crud.init();
+        },
+        getAreaData(){
+            areaTypeTree().then(res => {
+
+            })
+        },
+        getDetail(id) {
+            this.loadingBtn = true
+            getDetails({id: id})
+                .then(res => {
+                    this.form = res.data.data;
+                    if (this.form.enableOrNot == 1) {
+                        this.$set(this.option, 'disabled', true)
+                    } else {
+                        this.$set(this.option, 'disabled', false)
+                    }
+                    if (this.form.brandId == null || this.form.brandId === "") {
+                        this.form.brandId = "";
+                    }
+                    this.data = res.data.data.corpsAddrList
+                    this.corpsFiles = res.data.data.corpsFilesList
+                    this.contactsData = res.data.data.corpsAttnList
+                })
+                .finally(() => {
+                    this.loadingBtn = false;
+                });
+        },
+        addRow() {
+            this.data.push({$cellEdit: true})
+        },
+        rowDel(row, index) {
+            this.$confirm("确定删除数据?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+                    itemDel(row.id).then(res => {
+                        this.$message({
+                            type: "success",
+                            message: "删除成功!"
+                        });
+                        this.data.splice(index, 1);
+                    });
+                } else {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                    this.data.splice(index, 1);
+                }
+            });
+        }
+        ,
+        addRow2() {
+            this.data2.push({$cellEdit: true, type: 1})
+        }
+        ,
+        rowCell2(row, index) {
+            if (row.$cellEdit == true) {
+                this.$set(row, "$cellEdit", false);
+            } else {
+                this.$set(row, "$cellEdit", true);
+            }
+        }
+        ,
+        rowDe2(row, index) {
+            this.$confirm("确定删除数据?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                if (row.id) {
+                    // itemDel(row.id).then(res => {
+                    //   this.$message({
+                    //     type: "success",
+                    //     message: "删除成功!"
+                    //   });
+                    //   this.data2.splice(index, 1);
+                    // });
+                } else {
+                    this.$message({
+                        type: "success",
+                        message: "删除成功!"
+                    });
+                    this.data2.splice(index, 1);
+                }
+            });
+        }
+        ,
+        corpTypeClosed() {
+            // this.reload = Math.random();
+            // this.form4 = this.$options.data().form4
+        }
+        ,
+        getCorpType() {
+            getCorpType({corpType: 'KH'}).then(res => {
+                this.corpTypeList = res.data.data
+            })
+        },
+        addCorpType() {
+            this.getCorpType()
+            this.corpTypeVisible = false
+        }
+        ,
+        //修改提交触发
+        editCustomer() {
+            this.$refs["form"].validate((valid, done) => {
+                done();
+                if (valid) {
+                    if (this.contactsData.length == 0) return this.$message.error("请添加客户联系人");
+                    if (this.data.length == 0) return this.$message.error("请添加地址信息");
+                    this.loadingBtn = true;
+                    if (!this.form.id) {
+                        this.form.checkStatus = '通过'
+
+                        // typeof(this.form.brandId) == 'Array' ? this.form.prandId.join(',') : this.form.brandId = ''
+                    }
+                    console.log(this.form.$brandId)
+                    if (this.form.$brandId) {
+                        this.form.brandName = this.form.$brandId.split('|').join(',')
+                    } else {
+                        this.form.brandName = null
+                    }
+                    submit({
+                        ...this.form,
+                        code: this.form.cname,
+                        corpType: "KH",
+                        corpsAddrList: this.data,
+                        corpsFilesList: this.corpsFiles,
+                        corpsAttnList: this.contactsData,
+                        billType: 1,
+                    }).then(res => {
+                        this.$message.success("保存成功");
+                        this.form = res.data.data;
+                        this.data = res.data.data.corpsAddrList
+                        this.corpsFiles = res.data.data.corpsFilesList
+                        this.getDetail(res.data.data.id);
+                        if (!this.form.id) {
+                            //添加成功后默认启用
+                            let data = this.form
+                            editenable({id: res.data.data.id, enableOrNot: data.enableOrNot ? 0 : 1}).then(res => {
+                                this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
+                            })
+                        }
+                    }).finally(() => {
+                        this.loadingBtn = false;
+                    });
+                } else {
+                    return false;
+                }
+            });
+        }
+        ,
+        async saveColumn() {
+            const inSave = await this.saveColumnData(
+                this.getColumnName(263.2),
+                this.option2
+            );
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        }
+        ,
+        async resetColumn() {
+            this.option2 = option2;
+            const inSave = await this.delColumnData(
+                this.getColumnName(263.2),
+                option2
+            );
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.getAllWorkDicts()
+                this.$message.success("重置成功");
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        }
+        ,
+
+
+        creatingUsers(row) {
+            console.log("row", row)
+            if (row.id) {
+                if (row.tel) {
+                    if (!row.userId) {
+                        this.dialogVisibleBt = true;
+                        this.formDataTwo = {
+                            roleId: ["1658417787548205058"],
+                            postId: ["1742709504333688834"],
+                            deptId: [this.userObj.dept_id]
+                        };
+                        this.formRow = row;
+                    } else {
+                        this.$message.error("已经存在用户,请勿重复创建");
+                    }
+                } else {
+                    this.$message.error("请输入手机号");
+                }
+            } else {
+                this.$message.error("请保存数据后再点击");
+            }
+        }
+        ,
+        //新增客户联系人保存触发
+        rowSave(row, done, loading) {
+            if (this.data.length == 1) {
+                this.$set(row, 'defaultAddres', '1')
+            }
+            done(row);
+        }
+        ,
+        //修改客户联系人触发
+        rowUpdate(row, index, done, loading) {
+            done(row);
+        }
+        ,
+        //删除客户联系人触发
+        rowDelTwo(row, index, donerowDel) {
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                // 数据回调进行刷新
+                if (row.id) {
+                    corpsattn(row.id).then(res => {
+                        this.$message({
+                            type: "success",
+                            message: "操作成功!"
+                        });
+                        this.contactsData.splice(index, 1);
+                    });
+                } else {
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                    this.contactsData.splice(index, 1);
+                }
+            });
+        },
+        //返回列表
+        backToList() {
+            this.$emit("goBack");
+        }
+    }
+}
+;
+</script>
+
+<style lang="scss" scoped>
+.trading-form ::v-deep .el-form-item {
+    margin-bottom: 8px !important;
+}
+
+::v-deep .el-dialog__body {
+    padding: 0px 20px 15px 20px;
+}
+
+::v-deep .el-form-item__error {
+    display: none !important;
+}
+
+.el-dialog ::v-deep .el-form-item__error {
+    display: none !important;
+}
+
+.img-form ::v-deep .el-form-item {
+    height: 150px;
+    line-height: 150px;
+    margin-bottom: 8px !important;
+}
+
+.img-form ::v-deep .avue-upload__icon {
+    font-size: 20px;
+    width: 150px;
+    height: 150px;
+    line-height: 150px;
+}
+
+::v-deep .el-table .cell {
+    padding: 0 2px !important;
+}
+
+::v-deep .avue-crud .el-table .el-form-item__label {
+    left: -1px;
+}
+
+.addressTabs {
+    display: flex;
+    justify-content: center;
+
+    span {
+        width: 100px;
+        font-size: 18px;
+        font-weight: 600;
+        text-align: center;
+    }
+}
+</style>

+ 652 - 0
src/views/fc/customer/index.vue

@@ -0,0 +1,652 @@
+<template>
+    <div>
+        <basic-container v-show="show" class="page-crad">
+            <el-row>
+                <el-col :span="4">
+                    <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" style="height:73vh;"
+                               @save="corpTypeVisible = true">
+                        <template slot="addBtn">
+                            <el-tooltip class="item" effect="dark" content="新建分类" placement="top">
+                                <i class="el-icon-setting"
+                                   style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
+                                   @click="corpTypeVisible = true"></i>
+                            </el-tooltip>
+                        </template>
+                    </avue-tree>
+                </el-col>
+                <el-col :span="20">
+                    <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+                               @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+                               @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading"
+                               @saveColumn="saveColumn"
+                               @resetColumn="resetColumn" :cell-style="cellStyle"
+                               @search-criteria-switch="searchCriteriaSwitch">
+                        <template slot="menuLeft">
+                            <el-button type="primary" size="mini" @click.stop="newAdd()">新建客户
+                            </el-button>
+                            <el-button type="primary" size="mini" icon="el-icon-bottom" @click="excelBox = true">导入
+                            </el-button>
+                            <el-button type="primary" size="mini" icon="el-icon-top" @click="outExport">导出
+                            </el-button>
+                            <el-button type="primary" size="mini" icon="el-icon-download" @click="brandBox = true">
+                                Excel更新品牌
+                            </el-button>
+                        </template>
+                        <template slot="enableOrNot" slot-scope="{row,index,disabled}">
+                            <div v-if="row.enableOrNot === 1">启用</div>
+                            <div v-else style="color: red">禁用</div>
+                        </template>
+                        <template slot-scope="{ row, index }" slot="cname">
+                            <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(row, 2)">{{
+                                    row.cname
+                                }}</span>
+                        </template>
+                        <template slot="dateSearch">
+                            <el-date-picker v-model="search.date" type="daterange" start-placeholder="开始日期"
+                                            end-placeholder="结束日期"
+                                            format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
+                                            :default-time="['00:00:00', '23:59:59']"
+                                            :picker-options="pickerOptions">
+                            </el-date-picker>
+                        </template>
+                        <template slot-scope="{type,size, row, index }" slot="menu">
+                            <el-button v-if="row.checkStatus == '提交' || row.checkStatus == '驳回'" :size="size"
+                                       :type="type" @click.stop="passThrough(row,'通过')">通过
+                            </el-button>
+                            <el-button v-if="row.checkStatus == '提交' || row.checkStatus == '通过'" :size="size"
+                                       :type="type" @click.stop="passThrough(row,'驳回')">驳回
+                            </el-button>
+                            <el-button :size="size" :type="type"
+                                       :disabled="row.enableOrNot||!roleName.includes('基础资料')"
+                                       @click.stop="rowDel(row)">删除
+                            </el-button>
+                        </template>
+                    </avue-crud>
+                </el-col>
+            </el-row>
+
+        </basic-container>
+        <details-page v-if="!show" @goBack="goBack()" :detailData="detailData"/>
+        <el-dialog title="设置客户分类" v-dialogDrag :visible.sync="corpTypeVisible" class="avue-dialog" width="80%"
+                   append-to-body
+                   @closed="corpTypeClosed">
+            <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="导入客户" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
+                   v-dialog-drag>
+            <avue-form :option="excelOption" v-model="excelForm" table-loading="excelLoading"
+                       :upload-before="uploadBefore"
+                       :upload-after="uploadAfter">
+                <template slot="excelTemplate">
+                    <el-button type="primary" @click="derivation">
+                        点击下载<i class="el-icon-download el-icon--right"></i>
+                    </el-button>
+                </template>
+            </avue-form>
+            <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+            </p>
+        </el-dialog>
+        <!--更新品牌按钮-->
+        <el-dialog title="更新品牌" append-to-body :visible.sync="brandBox" width="555px" :close-on-click-modal="false"
+                   v-dialog-drag>
+            <avue-form :option="brandExcel" v-model="brandExcelForm" table-loading="excelLoading"
+                       :upload-before="uploadBefore"
+                       :upload-after="brandAfter">
+                <template slot="brandTemplate">
+                    <el-button type="primary" @click="brandDerive">
+                        点击下载<i class="el-icon-download el-icon--right"></i>
+                    </el-button>
+                </template>
+            </avue-form>
+            <p style="text-align: center;color: #DC0505">
+                温馨提示 第一次导入时请先下载模板
+            </p>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import detailsPage from "./detailsPage";
+import {option} from "./js/optionList";
+import {
+    getList,
+    getCorpType,
+    remove,
+    customerList,
+    submit
+} from "@/api/fc/customerInformation";
+import corpType from './components/index.vue'
+import {getToken} from "@/util/auth";
+
+export default {
+    name: "index",
+    data() {
+        return {
+            corpTypeVisible: false,
+            excelForm: {},
+            brandExcelForm: {},
+            WarehouseNameList: [],
+            excelOption: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                    {
+                        label: "模板下载",
+                        prop: "excelTemplate",
+                        formslot: true,
+                        span: 24
+                    },
+                    {
+                        label: "导入客户",
+                        prop: "excelFile",
+                        type: "upload",
+                        drag: true,
+                        loadText: "客户上传中,请稍等",
+                        accept: '.xls,.xlsx',
+                        span: 24,
+                        propsHttp: {
+                            res: "data"
+                        },
+                        tip: "请上传 .xls,.xlsx 标准格式文件",
+                        action: "/api/gubersail-admin/corpsDesc/corpsImport"
+                    }
+                ]
+            },
+            brandExcel: {
+                submitBtn: false,
+                emptyBtn: false,
+                column: [
+                    {
+                        label: "模版下载",
+                        prop: "brandTemplate",
+                        formslot: true,
+                        span: 24
+                    },
+                    {
+                        label: "导入品牌",
+                        prop: "brandFile",
+                        type: "upload",
+                        drag: true,
+                        loadText: "品牌上传中,请稍等",
+                        accept: '.xls,.xlsx',
+                        span: 24,
+                        propsHttp: {
+                            res: "data"
+                        },
+                        tip: "请上传 .xls,.xlsx 标准格式文件",
+                        action: "/api/gubersail-admin/corpsDesc/importBrand"
+                    }
+                ]
+            },
+            src: '',
+            show: true,
+            excelBox: false,
+            brandBox: false,
+            loading: false,
+            search: {},
+            detailData: {},
+            dataList: [],
+            selectionList: [],
+            page: {
+                pageSize: 20,
+                currentPage: 1,
+                total: 0,
+                pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+            },
+            form: {
+                debitAmount: 0,
+                deliveringAmount: 0,
+                advancePayment: 0,
+                balanceAmount: 0,
+                settlmentAmount: 0
+            },
+            formSerach: {},
+            pickerOptions: {
+                shortcuts: [
+                    {
+                        text: '当天',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
+                            const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    },
+                    {
+                        text: '昨天',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 0, 0, 0);
+                            const end = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '当月',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
+                            const end = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '当季',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3, 1, 0, 0, 0);
+                            const end = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3 + 3, 0, 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '当年',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
+                            const end = new Date(date.getFullYear() + 1, 0, 0, 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '最近一周',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7, 0, 0, 0);
+                            const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '最近二周',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 2, 0, 0, 0);
+                            const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }, {
+                        text: '最近三周',
+                        onClick(picker) {
+                            const date = new Date();
+                            const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 3, 0, 0, 0);
+                            const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
+                            picker.$emit('pick', [start, end]);
+                        }
+                    }]
+            },
+            treeOption: {
+                addBtn: false,
+                menu: false,
+                size: "small",
+                props: {
+                    labelText: "标题",
+                    label: "title",
+                    value: "value",
+                }
+            },
+            treeData: [],
+            form4: {},
+            option4: {
+                menuBtn: false,
+                labelWidth: 80,
+                column: [
+                    {
+                        label: "分类名称",
+                        prop: "cname",
+                        rules: [
+                            {
+                                required: true,
+                                message: "",
+                                trigger: "blur"
+                            }
+                        ],
+                        span: 24,
+                    },
+                    {
+                        label: "上级类型",
+                        prop: "parentId",
+                        dicData: [],
+                        type: "tree",
+                        props: {
+                            label: "cname",
+                            value: "id"
+                        },
+                        span: 24,
+                    }
+                ]
+            },
+            hostUrl: '',
+            option: {},
+            roleName: null,
+        };
+    },
+    components: {
+        detailsPage,
+        corpType
+    },
+    activated() {
+        setTimeout(() => {
+            this.$nextTick(() => {
+                this.$refs.crud.doLayout()
+                this.$refs.crud.refreshTable();
+            })
+        }, 100)
+    },
+    async created() {
+        this.roleName = localStorage.getItem('roleName')
+        this.option = await this.getColumnData(this.getColumnName(207), option);
+        this.getAllWorkDicts()
+
+        this.option = option;
+        const inSave = await this.delColumnData(this.getColumnName(207), option);
+        if (inSave) {
+            this.$nextTick(() => {
+                this.$refs.crud.doLayout();
+            });
+            this.getAllWorkDicts()
+            this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        }
+    },
+    mounted() {
+        // 页面尺寸改变,重新渲染avue表格,避免表格错位
+        window.addEventListener(
+            'resize',
+            () => {
+                if (Math.abs(this.screenWidth - document.body.clientWidth) > 20) {
+                    this.$nextTick(() => {
+                        this.$refs.crud.refreshTable();
+                    })
+                }
+                this.screenWidth = document.body.clientWidth;
+            }
+        )
+    },
+    methods: {
+        // 导入客户
+        derivation() {
+            window.open(
+                `/api/gubersail-admin/corpsDesc/corpsExport?${this.website.tokenHeader
+                }=${getToken()}`
+            );
+        },
+        // 导入品牌
+        brandDerive() {
+            window.open(
+                `/api/gubersail-admin/corpsDesc/corpsExportBrand?${this.website.tokenHeader
+                }=${getToken()}`
+            );
+        },
+        //导出
+        outExport() {
+            let config = {params: {...this.search}}
+            if (config.params) {
+                for (const [propName, value] of Object.entries(config.params)) {
+                    if (value instanceof Array) {
+                        value.forEach((item, index) => {
+                            config.params[`${propName}[${index}]`] = item;
+                        });
+                        delete config.params[propName];
+                    }
+                }
+            }
+            const routeData = this.$router.resolve({
+                path: '/api/gubersail-admin/corpsDesc/pjCorpsExport',      //跳转目标窗口的地址
+                query: {
+                    ...config.params,    //括号内是要传递给新窗口的参数
+                    identification: this.url
+                }
+            })
+            window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
+        },
+        uploadBefore(file, done, loading) {
+            done();
+            loading = true;
+        },
+        //   客户导入后回显
+        uploadAfter(res, done, loading, column) {
+            this.excelBox = false;
+            let myError = res.toString();//转字符串
+            myError = myError.replace("Error: ", "") // 去掉前面的" Error: "
+            this.$message.success(myError);
+            this.refreshChange();
+            loading = false;
+            done();
+        },
+        //   品牌更新后回显
+        brandAfter(res, done, loading, column) {
+            this.brandBox = false;
+            console.log(res, 'res')
+            let myError = res.toString();//转字符串
+            myError = myError.replace("Error: ", "") // 去掉前面的" Error: "
+            this.$message.success(myError);
+            this.refreshChange();
+            loading = false;
+            done();
+        },
+        filterNode(value, data) {
+            console.log(value, data)
+            if (!value) return true;
+            return data.label.indexOf(value) !== -1;
+        },
+        nodeClick(data) {
+            this.search.corpsTypeId = data.value
+            this.page.currentPage = 1;
+            this.onLoad(this.page, this.search);
+        },
+        getAllWorkDicts() {
+            this.getWorkDicts("client_status").then(res => {
+                this.findObject(this.option.column, "status").dicData = res.data.data;
+            });
+            getCorpType({corpType: 'KH'}).then(res => {
+                this.treeData = res.data.data
+            });
+            customerList({corpType: "KH"}).then(res => {
+                this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
+            });
+            this.$refs.crud.init();
+        },
+        searchCriteriaSwitch(type) {
+            this.$refs.crud.getTableHeight();
+        },
+        cellStyle() {
+            return "padding:0;height:40px;";
+        },
+        //点击搜索按钮触发
+        searchChange(params, done) {
+            this.page.currentPage = 1;
+            this.onLoad(this.page, params);
+            done();
+        },
+        refreshChange() {
+            this.onLoad(this.page, this.search);
+        },
+        newAdd() {
+            this.show = false;
+        },
+        onLoad(page, params = {}) {
+            console.log('page', page);
+            // this.$refs.crud.refreshTable()
+            console.log('params', params);
+            console.log('this.search', this.search);
+            let data = this.deepClone(Object.assign(params, this.search));
+            if (data.date && data.date.length > 0) {
+                data.startTime = data.date[0]
+                data.endTime = data.date[1]
+            }
+            delete data.date
+            data.corpType = "KH"
+            this.loading = true;
+            getList({
+                current: page.currentPage,
+                size: page.pageSize,
+                // ...page.pageSize,
+                ...data
+            }).then(res => {
+                this.dataList = res.data.data.records ? res.data.data.records : [];
+                this.page.total = res.data.data.total;
+            }).finally(() => {
+                // pageStatistics(data).then(res => {
+                //   this.form = res.data.data
+                // })
+                this.loading = false;
+            });
+        },
+        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.getAllWorkDicts()
+            this.corpTypeVisible = false
+        },
+        corpTypeClosed() {
+            // this.reload = Math.random();
+            // this.form4 = this.$options.data().form4
+        },
+        editOpen(row, status) {
+            this.showInfo = true;
+            this.detailData = {
+                id: row.id,
+                status: status
+            };
+            this.show = false;
+        },
+        currentChange(val) {
+            this.page.currentPage = val;
+        },
+        sizeChange(val) {
+            this.page.currentPage = 1;
+            this.page.pageSize = val;
+        },
+        // 通过驳回方法
+        passThrough(row, type) {
+            this.$confirm(`确定${type}数据?`, {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                row.checkStatus = type
+                submit(row).then(res => {
+                    this.$message({
+                        type: "success",
+                        message: `${type}成功!`
+                    });
+                    this.onLoad(this.page, this.search);
+                })
+            })
+        },
+        rowDel(row, index, done) {
+            this.$confirm("确定删除数据?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                remove({id: row.id, corpType: "KH"}).then(res => {
+                    if (res.data.code == 200) {
+                        this.$message({
+                            type: "success",
+                            message: "删除成功!"
+                        });
+                        this.onLoad(this.page, this.search);
+                    }
+                });
+            });
+        },
+        async saveColumn() {
+            const inSave = await this.saveColumnData(
+                this.getColumnName(207),
+                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(207), option);
+            if (inSave) {
+                this.$nextTick(() => {
+                    this.$refs.crud.doLayout();
+                });
+                this.getAllWorkDicts()
+                this.$message.success("重置成功");
+                this.$refs.crud.$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //返回列表
+        goBack() {
+            this.detailData = this.$options.data().detailData;
+            this.show = true;
+            this.showInfo = true;
+            this.onLoad(this.page, this.search);
+            this.$nextTick(() => {
+                this.$refs.crud.doLayout()
+                this.$refs.crud.refreshTable();
+            })
+        },
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+// .page-crad ::v-deep .basic-container__card {
+//   height: 94.2vh;
+// }
+
+::v-deep .el-form-item__error {
+    display: none !important;
+}
+
+::v-deep .el-input-group__append {
+    padding: 0 0px !important;
+}
+
+.el-dialog ::v-deep .el-form-item__error {
+    display: none !important;
+}
+
+.stat-td {
+    text-align: center;
+    position: relative;
+}
+
+.stat-img {
+    width: 95%;
+    height: 100px;
+}
+
+.stat-tip {
+    position: absolute;
+    left: 15px;
+    top: 5px;
+
+    .money {
+        color: #fff;
+        font-size: 28px;
+        text-align: left;
+        font-weight: 600;
+    }
+
+    .title {
+        color: #fff;
+        font-size: 14px;
+        text-align: left;
+        margin-top: 5px;
+        margin-bottom: 0px;
+    }
+}
+</style>

+ 373 - 0
src/views/fc/customer/js/optionList.js

@@ -0,0 +1,373 @@
+
+export const option = {
+  searchShow: true,
+  searchMenuSpan: 8,
+  align: "center",
+  height: "auto",
+  searchSpan: 8,
+  tip: false,
+  border: true,
+  index: true,
+  indexFixed:false,
+  selectionFixed:false,
+  expandFixed:false,
+  addBtn: false,
+  viewBtn: false,
+  editBtn: false,
+  delBtn: false,
+  menuWidth: 150,
+  searchIcon: true,
+  searchIndex: 2,
+  column: [
+    {
+      label: "客户名称",
+      prop: "cname",
+      overHidden: true,
+      width:140,
+      search: true,
+    },
+    {
+      label: "电话",
+      prop: "tel",
+      overHidden: true,
+      search: true,
+    },
+    {
+      label: "商城价格",
+      prop: "priceSystem",
+      overHidden: true,
+    },
+    {
+      label: "客户分类",
+      prop: "corpsTypeName",
+      overHidden: true,
+    },
+    {
+      label: "业务员",
+      prop: "salesmanId",
+      overHidden: true,
+      type: 'select',
+      props: {
+        label: "name",
+        value: "id"
+      },
+      dicUrl: "/api/blade-user/salerList",
+      search: true,
+    },
+
+    {
+      label: "是否启用",
+      prop: "enableOrNot",
+      overHidden: true,
+      search:true,
+      showColumn: false,
+      type: 'select',
+      dicData: [{
+        label: '启用',
+        value: 1
+      }, {
+        label: '禁用',
+        value: 0
+      }]
+    },
+    {
+      label: "审核状态",
+      prop: "checkStatus",
+      overHidden: true,
+      // hide: true,
+      search:true,
+      // showColumn: false,
+      type: 'select',
+      dicData: [{
+        label: '提交',
+        value: '提交'
+      }, {
+        label: '通过',
+        value: '通过'
+      }, {
+        label: '驳回',
+        value: '驳回'
+      }]
+    },
+    {
+      label: "品牌",
+      prop: "brandName",
+      overHidden: true,
+      // hide: true,
+      search:true,
+    },
+    {
+      label: "创建人",
+      prop: "createUser",
+      overHidden: true,
+      type: 'select',
+      props: {
+        label: "name",
+        value: "id"
+      },
+      dicUrl: "/api/blade-user/userListAll",
+      width:100,
+    },
+    {
+      label: "创建时间",
+      prop: "createTime",
+      overHidden: true,
+      search: true,
+      searchProp: "createTimeList",
+      type: "date",
+      unlinkPanels: true,
+      searchRange: true,
+      format: "yyyy-MM-dd",
+      valueFormat: "yyyy-MM-dd HH:mm:ss",
+      width:100,
+      searchDefaultTime: ["00:00:00", "23:59:59"]
+    },
+    {
+      label: "合同金额",
+      prop: "debitAmount",
+      overHidden: true,
+      hide: true,
+      showColumn: false,
+    },
+    {
+      label: "已送货",
+      prop: "deliveringAmount",
+      overHidden: true,
+      hide: true,
+      showColumn: false,
+    },
+    {
+      label: "预收款",
+      prop: "advancePayment",
+      overHidden: true,
+      hide: true,
+      showColumn: false,
+    },
+    {
+      label: "未收款",
+      prop: "balanceAmount",
+      overHidden: true,
+      hide: true,
+      showColumn: false,
+    },
+    {
+      label: "已收款",
+      prop: "settlmentAmount",
+      overHidden: true,
+      hide: true,
+      showColumn: false,
+    },
+    {
+      label: "状态",
+      prop: "status",
+      type: 'select',
+      props: {
+        label: "dictValue",
+        value: "dictKey"
+      },
+      dicData: [],
+      hide: true,
+      showColumn: false,
+      overHidden: true,
+    },
+    {
+      label: "日期",
+      prop: "date",
+      hide: true,
+      showColumn: false,
+      overHidden: true,
+    },
+
+
+  ]
+}
+export const optionList = {
+  align: "center",
+  addBtn: false,
+  refreshBtn: false,
+  editBtn: false,
+  delBtn: false,
+  border: true,
+  menuWidth: 120,
+  stripe: true,
+  index: true,
+  indexSlot: true,
+  column: [
+    {
+      label: "地址类型",
+      prop: "type",
+      dicData: [
+        {
+          type: 0,
+          name: '客户地址'
+        },
+        {
+          type: 1,
+          name: '物流地址'
+        }
+      ],
+      dataType: "string",
+      type: "cascader",
+      props: {
+        label: 'name',
+        value: 'type'
+      },
+      overHidden: true
+    },
+    {
+      label: "详细地址",
+      prop: "detailedAddress",
+      overHidden: true
+    }
+  ]
+}
+export const option2 = {
+  align: 'center',
+  index: true,
+  addBtnText: "录入明细",
+  refreshBtn: false,
+  dialogDrag: true,
+  addBtn: false,
+  span: 8,
+  height: 600,
+  editBtn: false,
+  delBtn: false,
+  menuWidth: 140,
+  dialogTop: 25,
+  dialogWidth: "80%",
+  addRowBtn:false,
+  cellBtn:true,
+  rowKey: "index",
+  cancelBtn:false,
+  // saveBtn:false,
+  column: [{
+    label: '联系人',
+    prop: 'contacts',
+    cell: true,
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ],
+  }, {
+    label: '电话',
+    prop: 'tel',
+    cell: true,
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ]
+  },
+  {
+    label: "地址",
+    prop: "belongtoarea",
+    dicData: [],
+    dataType: "string",
+    type: "cascader",
+    // type: "async-cascader", // 修改为 "async-cascader"
+    props: {
+      label: 'name',
+      value: 'name'
+    },
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ],
+    filterable: true,
+    cell: true,
+  },
+  {
+    label: '详细地址',
+    prop: 'detailedAddress',
+    cell: true,
+    rules: [
+      {
+        required: true,
+        message: " ",
+        trigger: "blur"
+      }
+    ]
+  }, {
+    label: '备注',
+    prop: 'remarks',
+    cell: true
+  }, {
+    label: '默认地址',
+    prop: 'defaultAddres',
+    display: false,
+    width: 100,
+  }]
+}
+export const option3 = {
+  align: "center",
+  addBtn: false,
+  refreshBtn: false,
+  editBtn: false,
+  delBtn: false,
+  border: true,
+  menuWidth: 120,
+  stripe: true,
+  index: true,
+  indexSlot: true,
+  column: [
+    {
+      label: "目的地",
+      prop: "destination",
+      minWidth: 150,
+      cell: true,
+    },
+    {
+      label: "物流公司",
+      prop: "logisticsCompany",
+      minWidth: 200,
+      cell: true,
+    },
+    {
+      label: "电话",
+      prop: "tel",
+      minWidth: 150,
+      cell: true,
+    },
+    {
+      label: "地址",
+      prop: "addr",
+      dicData: JSON.parse(localStorage.getItem('areaTypeTree')),
+      dataType: "string",
+      type: "cascader",
+      props: {
+        label: 'name',
+        value: 'name'
+      },
+      minWidth: 250,
+      filterable: true,
+      cell: true
+    },
+    {
+      label: "详细地址",
+      prop: "detailedAddress",
+      minWidth: 350,
+      cell: true,
+    },
+    {
+      label: "邮编",
+      prop: "postalCode",
+      minWidth: 150,
+      cell: true,
+    },
+    {
+      label: "备注",
+      prop: "remarks",
+      minWidth: 300,
+      cell: true,
+    }
+  ]
+}
+