|  | @@ -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>
 |