소스 검색

1.新增企业客户联系人管理页面
2.新增企业客户联系人编辑与新增
3.优化个人客户管理页面
4.优化企业客户管理页面

GouGengquan 19 시간 전
부모
커밋
afae61e9d1

+ 4 - 0
src/api/modules/customerCompany.js

@@ -33,4 +33,8 @@ export default {
   getCustomerCompanyIncomePage(params) {
     return request.get(`customerCompany/getCustomerCompanyIncomePage`, { params: params })
   },
+  // 下拉列表
+  pullDownList(params) {
+    return request.get(`customerCompany/pullDownList`, { params: params })
+  },
 }

+ 4 - 0
src/api/modules/customerLinkman.js

@@ -33,4 +33,8 @@ export default {
   getCustomerPersonalIncomePage(params) {
     return request.get(`customerLinkman/getCustomerPersonalIncomePage`, { params: params })
   },
+  // 分页查询企业客户联系人列表
+  getCustomerLinkmanPage(params) {
+    return request.get(`customerLinkman/getCustomerLinkmanPage`, { params: params })
+  },
 }

+ 3 - 1
src/router/urlMap.js

@@ -163,6 +163,7 @@ import _views_statistical_major_scene_images from '@/views/statistical/major/sce
 import _views_administration_assets_complaint_check_list from '@/views/administration/assets/complainantCheckList'
 import _views_hr_payslip_email_list from '@/views/hr/payslipEmail'
 import _views_customer_company_list from '@/views/customer/customerCompany'
+import _views_customer_linkman_list from '@/views/customer/customerLinkman'
 import _views_customer_personal_list from '@/views/customer/customerPersonal'
 
 export default {
@@ -316,6 +317,7 @@ export default {
   _views_administration_assets_complaint_check_list,
   _views_hr_payslip_email_list,
   _views_customer_company_list,
-  _views_customer_personal_list
+  _views_customer_personal_list,
+  _views_customer_linkman_list
 
 }

+ 2 - 2
src/views/customer/customerCompany.vue

@@ -96,7 +96,7 @@
         <el-row>
           <el-col>
             <el-form-item label="终端客户:" prop="terminal" label-width="140px" class="postInfo-container-item">
-              <el-select v-model="companyForm.terminal" style="width: 100%;" clearable>
+              <el-select v-model="companyForm.terminal" style="width: 100%;" @change="companyForm.parentId = null" clearable>
                 <el-option label="是" :value="true"></el-option>
                 <el-option label="否" :value="false"></el-option>
               </el-select>
@@ -106,7 +106,7 @@
         <el-row>
           <el-col>
             <el-form-item label="上级企业:" prop="parentId" label-width="140px" class="postInfo-container-item">
-              <el-select v-model="companyForm.parentId" filterable style="width: 100%;" clearable>
+              <el-select v-model="companyForm.parentId" filterable style="width: 100%;" clearable :disabled="companyForm.terminal">
                 <el-option v-for="item in parentCompany" :label="item.name" :value="item.id"></el-option>
               </el-select>
             </el-form-item>

+ 750 - 0
src/views/customer/customerLinkman.vue

@@ -0,0 +1,750 @@
+<template>
+  <div class="app-container">
+    <div class="title-container">
+      <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
+    </div>
+    <y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="selectPage">
+      <template slot="left">
+        <el-input style="width: 200px;float: left;" class="filter-item" v-model="listQuery.linkman" placeholder="企业客户联系人" clearable></el-input>
+        <el-input style="width: 200px;float: left;margin-left: 10px;" class="filter-item" v-model="listQuery.subCompany" placeholder="企业名称" clearable></el-input>
+        <el-input style="width: 200px;float: left;margin-left: 10px;" class="filter-item" v-model="listQuery.parentCompany" placeholder="上级企业" clearable></el-input>
+        <el-input style="width: 200px;float: left;margin-left: 10px;" class="filter-item" v-model="listQuery.mobile" placeholder="手机号" clearable></el-input>
+        <el-select v-model="listQuery.clientManagerId" filterable placeholder="客户经理(可搜索)" style=" width: 180px;margin-left: 10px;float: left;">
+          <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
+        </el-select>
+        <el-select v-model="listQuery.terminal" placeholder="终端客户" style=" width: 180px;margin-left: 10px;float: left;">
+          <el-option label="是" value="true"></el-option>
+          <el-option label="否" value="false"></el-option>
+        </el-select>
+        <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索</el-button>
+        <el-button class="filter-item" style="float: left;" round type="success" @click="resetParams()">重置</el-button>
+        <el-button class="filter-item" style="float: left;" round type="warning" @click="exportPage()">导出</el-button>
+        <PermissionButton menu-code="_views_customer_linkman_add" class-name="filter-item" name round type="danger" @click="openPersonalFormDialog()" />
+      </template>
+      <parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
+        <el-table-column label="联系人姓名" align="center" prop="name">
+          <template slot-scope="{row}">
+            <span>{{ row.linkman }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="企业名称" align="center" prop="name">
+          <template slot-scope="{row}">
+            <span>{{ row.subCompany }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="上级企业名称" align="center" prop="name">
+          <template slot-scope="{row}">
+            <span>{{ row.parentCompany }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="手机号" align="center" prop="mobile">
+          <template slot-scope="{row}">
+            <span>{{ row.mobile }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="座机号" align="center" prop="phone">
+          <template slot-scope="{row}">
+            <span>{{ row.phone }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="性别" align="center" prop="sex">
+          <template slot-scope="{row}">
+            <span>{{ row.sex }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="部门" align="center" prop="department">
+          <template slot-scope="{row}">
+            <span>{{ row.department}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="职位" align="center" prop="duty">
+          <template slot-scope="{row}">
+            <span>{{ row.duty}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="维护人" align="center" prop="clientManager">
+          <template slot-scope="{row}">
+            <span>{{ row.clientManager}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="终端客户" align="center" prop="terminal">
+          <template slot-scope="{row}">
+            <span>{{ row.terminal ? '终端客户' : '非终端客户' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="来单量" align="center" prop="orderVolume">
+          <template slot-scope="{row}">
+            <el-link v-if="row.orderVolume > 0">{{ row.orderVolume }}</el-link>
+            <span v-else>{{ row.orderVolume }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="评估收入" align="center" prop="estimatedRevenue">
+          <template slot-scope="{row}">
+            <el-link v-if="row.estimatedRevenue > 0">{{ row.estimatedRevenue }}</el-link>
+            <span v-else>{{ row.estimatedRevenue }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="创建时间" align="center" prop="created">
+          <template slot-scope="{row}">
+            <span>{{ row.created }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="100" fixed="right">
+          <template slot-scope="{row}">
+            <el-button type="text" @click="getDetail(row.id)">修改</el-button>
+          </template>
+        </el-table-column>
+      </parentTable>
+    </y-page-list-layout>
+    <el-dialog :visible.sync="linkmanFormDialogVisible" width="50%" @close="clearLinkmanlForm">
+      <el-form :model="linkmanForm" :rules="linkmanFormRules" ref="linkmanForm">
+        <el-row>
+          <el-col>
+            <el-form-item label="终端客户:" prop="terminal" label-width="140px" class="postInfo-container-item">
+              <el-select v-model="linkmanForm.terminal" style="width: 100%;" clearable @change="terminalChange()">
+                <el-option label="是" :value="true"></el-option>
+                <el-option label="否" :value="false"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row v-if="!linkmanForm.terminal">
+          <el-col>
+            <el-form-item label="上级企业:" prop="parentId" label-width="140px" class="postInfo-container-item">
+              <el-select v-model="linkmanForm.parentId" filterable style="width: 100%;" clearable @change="getCompany(), linkmanForm.ccId = null">
+                <el-option v-for="item in parentCompany" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="企业名称:" prop="ccId" label-width="140px" class="postInfo-container-item">
+              <el-select v-model="linkmanForm.ccId" filterable style="width: 100%;" clearable>
+                <el-option v-for="item in company" :label="item.name" :value="item.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="姓名:" prop="name" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.name" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="手机号:" prop="mobile" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.mobile" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="座机号:" prop="phone" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.phone" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="性别:" prop="sex" label-width="140px" class="postInfo-container-item">
+              <el-select v-model="linkmanForm.sex" style="width: 100%;" clearable>
+                <el-option label="男" value="男"></el-option>
+                <el-option label="女" value="女"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="身份证号码:" prop="idNo" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.idNo" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="微信号:" prop="wechatNo" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.wechatNo" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="QQ号:" prop="qqNo" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.qqNo" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="部门:" prop="department" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.department" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="职位:" prop="duty" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.duty" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="毕业院校:" prop="school" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.school" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="毕业专业:" prop="industry" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.industry" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="备注:" prop="description" label-width="140px" class="postInfo-container-item">
+              <el-input v-model.trim="linkmanForm.description" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col>
+            <el-form-item label="维护人:" prop="clientManagerId" label-width="140px" class="postInfo-container-item">
+              <el-select v-model="linkmanForm.clientManagerId" filterable style="width: 100%;" clearable>
+                <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="clearLinkmanlForm()">取 消</el-button>
+        <el-button v-if="!linkmanForm.id" type="primary" @click="addCustomer()">新 增</el-button>
+        <el-button v-if="linkmanForm.id" type="primary" @click="editCustomer()">修 改</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="来单列表" :visible.sync="orderDialogVisible" width="70%">
+      <y-page-list-layout :get-page-list="getOrderPage" :page-list="orderData" :page-para="orderListQuery">
+        <template slot="left">
+          <el-input style="width: 200px;float: left;" class="filter-item" v-model="orderListQuery.projectName" placeholder="订单名称" clearable></el-input>
+          <el-input style="width: 200px;float: left;margin-left: 10px;" class="filter-item" v-model="orderListQuery.orderId" placeholder="订单号" clearable></el-input>
+          <el-select v-model="orderListQuery.businessType" placeholder="业务类型" style=" width: 180px;margin-left: 10px;float: left;" clearable>
+            <el-option label="资产业务" value="ASSET_BUSINESS"></el-option>
+            <el-option label="大中型业务" value="MAJOR_BUSINESS"></el-option>
+            <el-option label="个贷业务" value="PERSONAL_BUSINESS"></el-option>
+          </el-select>
+          <el-date-picker
+            style="margin-right: 20px;float: left;margin-left: 10px;"
+            v-model="selectDateOrder"
+            type="daterange"
+            :picker-options="pickerOptions"
+            format="yyyy 年 MM 月 dd 日"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            align="right"
+          ></el-date-picker>
+          <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchListOrder()" round>搜索</el-button>
+          <el-button class="filter-item" style="float: left;" round type="success" @click="resetParamsOrder()">重置</el-button>
+        </template>
+        <parentTable ref="table" :data="orderData.records" slot="table" style="width: 100%;" :isBoard="800" class="tableFull" v-loading="orderListLoading">
+          <el-table-column label="订单号" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.orderId }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="订单名称" align="center" show-overflow-tooltip>
+            <template slot-scope="{row}">
+              <span>{{ row.projectName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="业务类型" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.businessType === 'ASSET_BUSINESS' ? '资产业务' : row.businessType === 'PERSONAL_BUSINESS' ? '个贷业务' : row.businessType === 'MAJOR_BUSINESS' ? '大中型业务' : '-' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="个人客户名称" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.linkmanName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="客户经理" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.clientManager }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="下单时间" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.created }}</span>
+            </template>
+          </el-table-column>
+        </parentTable>
+      </y-page-list-layout>
+    </el-dialog>
+    <el-dialog title="收入列表" :visible.sync="incomeDialogVisible" width="70%">
+      <y-page-list-layout :get-page-list="getIncomePage" :page-list="incomeData" :page-para="incomeListQuery">
+        <template slot="left">
+          <el-input style="width: 200px;float: left;" class="filter-item" v-model="incomeListQuery.projectName" placeholder="订单名称" clearable></el-input>
+          <el-input style="width: 200px;float: left;margin-left: 10px;" class="filter-item" v-model="incomeListQuery.orderId" placeholder="订单号" clearable></el-input>
+          <el-select v-model="incomeListQuery.businessType" placeholder="业务类型" style=" width: 180px;margin-left: 10px;float: left;" clearable>
+            <el-option label="资产业务" value="ASSET_BUSINESS"></el-option>
+            <el-option label="大中型业务" value="MAJOR_BUSINESS"></el-option>
+            <el-option label="个贷业务" value="PERSONAL_BUSINESS"></el-option>
+          </el-select>
+          <el-date-picker
+            style="margin-right: 20px;float: left;margin-left: 10px;"
+            v-model="selectDateOrder"
+            type="daterange"
+            :picker-options="pickerOptions"
+            format="yyyy 年 MM 月 dd 日"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            start-placeholder="下单日期"
+            end-placeholder="下单日期"
+            align="right"
+          ></el-date-picker>
+          <el-date-picker
+            style="margin-right: 20px;float: left;margin-left: 10px;"
+            v-model="selectDateIncome"
+            type="daterange"
+            :picker-options="pickerOptions"
+            format="yyyy 年 MM 月 dd 日"
+            value-format="yyyy-MM-dd"
+            range-separator="至"
+            start-placeholder="收款日期"
+            end-placeholder="收款日期"
+            align="right"
+          ></el-date-picker>
+          <el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchListIncome()" round>搜索</el-button>
+          <el-button class="filter-item" style="float: left;" round type="success" @click="resetParamsIncome()">重置</el-button>
+        </template>
+        <parentTable ref="table" :data="incomeData.records" slot="table" style="width: 100%;" :isBoard="800" class="tableFull" v-loading="orderListLoading">
+          <el-table-column label="订单号" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.orderId }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="订单名称" align="center" show-overflow-tooltip>
+            <template slot-scope="{row}">
+              <span>{{ row.projectName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="业务类型" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.businessType === 'ASSET_BUSINESS' ? '资产业务' : row.businessType === 'PERSONAL_BUSINESS' ? '个贷业务' : row.businessType === 'MAJOR_BUSINESS' ? '大中型业务' : '-' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="客户名称" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.customerName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="业务来源" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.customerSubName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="客户经理" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.clientManager }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="客户联系人" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.linkmanName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="下单时间" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.created }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="订单实收款" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.orderRealAmount ? row.orderRealAmount : '-' }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="收款时间" align="center">
+            <template slot-scope="{row}">
+              <span>{{ row.collectionTime ? row.collectionTime : '-' }}</span>
+            </template>
+          </el-table-column>
+        </parentTable>
+      </y-page-list-layout>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import YPageListLayout from '@/components/YPageListLayout';
+import Breadcrumb from '@/components/Breadcrumb';
+import PermissionButton from '@/components/PermissionButton/PermissionButton';
+import { getCookie, setCookie, removeCookie } from '@/utils/auth';
+import { isNumber, phoneNumber, postiveInteger, isIdNumber } from '@/utils/validate';
+
+export default {
+  name: 'CustomerPersonalList',
+  components: {
+    Breadcrumb,
+    YPageListLayout,
+    PermissionButton,
+  },
+  data() {
+    return {
+      pageData: { records: [] },
+      listLoading: false,
+      orderListLoading: false,
+      listQuery: {
+        page: 1,
+        size: 20,
+        current: 1,
+      },
+      // 用户下拉列表
+      allUsers: [],
+      // 上级企业
+      parentCompany: [],
+      // 企业
+      company: [],
+      linkmanFormDialogVisible: false,
+      linkmanForm: {
+        id: null,
+        parentId: null,
+        ccId: null,
+        name: null,
+        mobile: null,
+        phone: null,
+        sex: null,
+        idNo: null,
+        wechatNo: null,
+        qqNo: null,
+        department: null,
+        duty: null,
+        terminal: null,
+        school: null,
+        industry: null,
+        description: null,
+        clientManagerId: null,
+      },
+      linkmanFormRules: {
+        name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
+        mobile: [
+          { required: true, message: '手机号不能为空', trigger: 'blur' },
+          { required: true, validator: phoneNumber, trigger: 'blur' },
+        ],
+        terminal: [{ required: true, message: '请选择是否终端客户', trigger: 'change' }],
+        parentId: [{ required: true, message: '请选择上级企业', trigger: 'change' }],
+        ccId: [{ required: true, message: '请选择企业', trigger: 'change' }],
+        clientManagerId: [{ required: true, message: '请选择维护人', trigger: 'change' }],
+      },
+      orderDialogVisible: false,
+      selectDateOrder: '',
+      // 查询订单
+      orderListQuery: {
+        page: 1,
+        size: 10,
+        current: 1,
+        projectName: null,
+        orderId: null,
+        businessType: null,
+        createdStartTime: null,
+        createdEndTime: null,
+      },
+      orderData: { records: [] },
+      incomeDialogVisible: false,
+      selectDateIncome: '',
+      // 查询订单
+      incomeListQuery: {
+        page: 1,
+        size: 10,
+        current: 1,
+        projectName: null,
+        orderId: null,
+        businessType: null,
+        createdStartTime: null,
+        createdEndTime: null,
+      },
+      incomeData: { records: [] },
+      pickerOptions: {
+        shortcuts: [
+          {
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            },
+          },
+          {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            },
+          },
+          {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            },
+          },
+        ],
+      },
+    };
+  },
+  created() {
+    // 获取用户下拉列表
+    this.getAllUser();
+    this.selectPage();
+  },
+  methods: {
+    // 是否终端客户值改变
+    terminalChange() {
+      if (this.linkmanForm.terminal) {
+        this.linkmanForm.parentId = null;
+        this.linkmanForm.ccId = null;
+        this.getCompany();
+      }
+    },
+    // 获取上级企业
+    getParentCompany() {
+      let simpleAll = new Object();
+      simpleAll.terminal = 0;
+      this.$api.customerCompany.simpleAll(simpleAll).then((res) => {
+        if (res.code === 200) {
+          this.parentCompany = res.data;
+        }
+      });
+    },
+    // 获取企业
+    getCompany() {
+      let simpleAll = new Object();
+      simpleAll.parentId = this.linkmanForm.parentId;
+      simpleAll.terminal = this.linkmanForm.terminal;
+      this.$api.customerCompany.pullDownList(simpleAll).then((res) => {
+        if (res.code === 200) {
+          this.company = res.data;
+        }
+      });
+    },
+    // 获取所有用户下拉列表
+    getAllUser() {
+      this.$api.user.simpleAll().then((res) => {
+        if (res.code === 200) {
+          this.allUsers = res.data;
+        }
+      });
+    },
+    // 条件查询
+    searchList() {
+      // 重置分页
+      this.listQuery.page = 1;
+      this.listQuery.size = 20;
+      this.listQuery.current = 1;
+      this.selectPage();
+    },
+    // 重置搜索条件
+    resetParams() {
+      this.$router.push({ query: {} });
+      this.listQuery = {
+        page: 1,
+        size: 20,
+        current: 1,
+      };
+      this.selectPage();
+    },
+    // 分页查询
+    selectPage() {
+      this.listLoading = true;
+      this.$api.customerLinkman.getCustomerLinkmanPage(this.listQuery).then((res) => {
+        if (res.code === 200) {
+          this.pageData = res.data;
+        }
+        this.listLoading = false;
+      });
+    },
+    // 客户列表导出
+    exportPage() {
+      this.$utils.exportUtil('/customerLinkman/getCustomerLinkmanPage/export', this.listQuery, '导出');
+    },
+    // 打开新增/修改客户弹窗
+    openPersonalFormDialog() {
+      this.linkmanFormDialogVisible = true;
+      this.getParentCompany();
+      this.getCompany();
+    },
+    // 关闭新增/修改客户弹窗
+    clearLinkmanlForm() {
+      this.linkmanForm = {
+        id: null,
+        ccId: null,
+        name: null,
+        mobile: null,
+        phone: null,
+        sex: null,
+        idNo: null,
+        wechatNo: null,
+        qqNo: null,
+        department: null,
+        duty: null,
+        terminal: null,
+        school: null,
+        industry: null,
+        description: null,
+        clientManagerId: null,
+      };
+      this.$refs.linkmanForm.resetFields();
+      this.linkmanFormDialogVisible = false;
+    },
+    // 新增客户联系人
+    addCustomer() {
+      this.$refs.linkmanForm.validate((valid) => {
+        if (valid) {
+          this.$api.customerLinkman.add(this.linkmanForm).then((res) => {
+            if (res.code === 200) {
+              this.clearLinkmanlForm();
+              this.resetParams();
+            }
+          });
+        }
+      });
+    },
+    // 获取客户详情
+    getDetail(id) {
+      this.$api.customerLinkman.detail(id).then((res) => {
+        if (res.code === 200 && res.data) {
+          this.linkmanForm = res.data;
+          // 判断不是终端用户的话
+          if (!this.linkmanForm.terminal) {
+            // 查询父级企业的id
+            this.$api.customerCompany.detail(this.linkmanForm.ccId).then((res) => {
+              if (res.code === 200 && res.data) {
+                this.linkmanForm.parentId = res.data.parentId;
+              }
+              this.openPersonalFormDialog();
+            });
+          } else {
+            this.openPersonalFormDialog();
+          }
+        }
+      });
+    },
+    // 修改客户联系人
+    editCustomer() {
+      this.$refs.linkmanForm.validate((valid) => {
+        if (valid) {
+          this.$api.customerLinkman.edit(this.linkmanForm).then((res) => {
+            if (res.code === 200) {
+              this.clearLinkmanlForm();
+              this.resetParams();
+            }
+          });
+        }
+      });
+    },
+    // 打开来单列表弹窗
+    openOrderDialog(id) {
+      this.orderDialogVisible = true;
+      this.orderListQuery.linkmanId = id;
+      this.getOrderPage();
+    },
+    // 条件搜索来单
+    searchListOrder() {
+      // 重置分页
+      this.orderListQuery.page = 1;
+      this.orderListQuery.size = 10;
+      this.orderListQuery.current = 1;
+      this.getOrderPage();
+    },
+    // 重置来单列表搜索条件
+    resetParamsOrder() {
+      this.orderListQuery.page = 1;
+      this.orderListQuery.size = 10;
+      this.orderListQuery.current = 1;
+      this.orderListQuery.projectName = null;
+      this.orderListQuery.orderId = null;
+      this.orderListQuery.businessType = null;
+      this.orderListQuery.createdStartTime = null;
+      this.orderListQuery.createdEndTime = null;
+      this.selectDateOrder = '';
+      this.getOrderPage();
+    },
+    // 获取客户来单列表
+    getOrderPage() {
+      this.orderListLoading = true;
+      if (this.selectDateOrder) {
+        this.orderListQuery.createdStartTime = this.selectDateOrder[0] + ' 00:00:00';
+        this.orderListQuery.createdEndTime = this.selectDateOrder[1] + ' 23:59:59';
+      }
+      this.$api.customerLinkman.getCustomerPersonalOrderPage(this.orderListQuery).then((res) => {
+        if (res.code === 200) {
+          this.orderData = res.data;
+        }
+        this.orderListLoading = false;
+      });
+    },
+    // 打开来单评估收入列表弹窗
+    openIncomeDialog(id) {
+      this.incomeDialogVisible = true;
+      this.incomeListQuery.linkmanId = id;
+      this.getIncomePage();
+    },
+    // 条件搜索来单评估收入
+    searchListIncome() {
+      // 重置分页
+      this.incomeListQuery.page = 1;
+      this.incomeListQuery.size = 10;
+      this.incomeListQuery.current = 1;
+      this.getIncomePage();
+    },
+    // 重置来单评估收入列表搜索条件
+    resetParamsIncome() {
+      this.incomeListQuery.page = 1;
+      this.incomeListQuery.size = 10;
+      this.incomeListQuery.current = 1;
+      this.incomeListQuery.projectName = null;
+      this.incomeListQuery.orderId = null;
+      this.incomeListQuery.businessType = null;
+      this.incomeListQuery.createdStartTime = null;
+      this.incomeListQuery.createdEndTime = null;
+      this.incomeListQuery.collectionStartTime = null;
+      this.incomeListQuery.collectionEndTime = null;
+      this.selectDateOrder = '';
+      this.selectDateIncome = '';
+      this.getIncomePage();
+    },
+    // 获取客户来单评估收入列表
+    getIncomePage() {
+      this.orderListLoading = true;
+      if (this.selectDateOrder) {
+        this.incomeListQuery.createdStartTime = this.selectDateOrder[0] + ' 00:00:00';
+        this.incomeListQuery.createdEndTime = this.selectDateOrder[1] + ' 23:59:59';
+      }
+      if (this.selectDateIncome) {
+        this.incomeListQuery.collectionStartTime = this.selectDateIncome[0] + ' 00:00:00';
+        this.incomeListQuery.collectionEndTime = this.selectDateIncome[1] + ' 23:59:59';
+      }
+      this.$api.customerLinkman.getCustomerPersonalIncomePage(this.incomeListQuery).then((res) => {
+        if (res.code === 200) {
+          this.incomeData = res.data;
+        }
+        this.orderListLoading = false;
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 32 - 32
src/views/customer/customerPersonal.vue

@@ -98,33 +98,33 @@
         </el-table-column>
       </parentTable>
     </y-page-list-layout>
-    <el-dialog :visible.sync="personalFromDialogVisible" width="50%" @close="clearPersonalForm">
-      <el-form :model="personalFrom" :rules="personalFromRules" ref="personalFrom">
+    <el-dialog :visible.sync="personalFormDialogVisible" width="50%" @close="clearPersonalForm">
+      <el-form :model="personalForm" :rules="personalFormRules" ref="personalForm">
         <el-row>
           <el-col>
             <el-form-item label="姓名:" prop="name" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.name" />
+              <el-input v-model.trim="personalForm.name" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="手机号:" prop="mobile" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.mobile" />
+              <el-input v-model.trim="personalForm.mobile" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="座机号:" prop="phone" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.phone" />
+              <el-input v-model.trim="personalForm.phone" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="性别:" prop="sex" label-width="140px" class="postInfo-container-item">
-              <el-select v-model="personalFrom.sex" style="width: 100%;" clearable>
+              <el-select v-model="personalForm.sex" style="width: 100%;" clearable>
                 <el-option label="男" value="男"></el-option>
                 <el-option label="女" value="女"></el-option>
               </el-select>
@@ -134,42 +134,42 @@
         <el-row>
           <el-col>
             <el-form-item label="身份证号码:" prop="idNo" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.idNo" />
+              <el-input v-model.trim="personalForm.idNo" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="微信号:" prop="wechatNo" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.wechatNo" />
+              <el-input v-model.trim="personalForm.wechatNo" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="QQ号:" prop="qqNo" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.qqNo" />
+              <el-input v-model.trim="personalForm.qqNo" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="部门:" prop="department" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.department" />
+              <el-input v-model.trim="personalForm.department" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="职位:" prop="duty" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.duty" />
+              <el-input v-model.trim="personalForm.duty" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="终端客户:" prop="terminal" label-width="140px" class="postInfo-container-item">
-              <el-select v-model="personalFrom.terminal" style="width: 100%;" clearable>
+              <el-select v-model="personalForm.terminal" style="width: 100%;" clearable>
                 <el-option label="是" :value="true"></el-option>
                 <el-option label="否" :value="false"></el-option>
               </el-select>
@@ -179,28 +179,28 @@
         <el-row>
           <el-col>
             <el-form-item label="毕业院校:" prop="school" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.school" />
+              <el-input v-model.trim="personalForm.school" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="毕业专业:" prop="industry" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.industry" />
+              <el-input v-model.trim="personalForm.industry" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="备注:" prop="description" label-width="140px" class="postInfo-container-item">
-              <el-input v-model.trim="personalFrom.description" />
+              <el-input v-model.trim="personalForm.description" />
             </el-form-item>
           </el-col>
         </el-row>
         <el-row>
           <el-col>
             <el-form-item label="维护人:" prop="clientManagerId" label-width="140px" class="postInfo-container-item">
-              <el-select v-model="personalFrom.clientManagerId" filterable style="width: 100%;" clearable>
+              <el-select v-model="personalForm.clientManagerId" filterable style="width: 100%;" clearable>
                 <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id"></el-option>
               </el-select>
             </el-form-item>
@@ -209,8 +209,8 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="clearPersonalForm()">取 消</el-button>
-        <el-button v-if="!personalFrom.id" type="primary" @click="addCustomer()">新 增</el-button>
-        <el-button v-if="personalFrom.id" type="primary" @click="editCustomer()">修 改</el-button>
+        <el-button v-if="!personalForm.id" type="primary" @click="addCustomer()">新 增</el-button>
+        <el-button v-if="personalForm.id" type="primary" @click="editCustomer()">修 改</el-button>
       </div>
     </el-dialog>
     <el-dialog title="来单列表" :visible.sync="orderDialogVisible" width="70%">
@@ -392,8 +392,8 @@ export default {
       },
       // 用户下拉列表
       allUsers: [],
-      personalFromDialogVisible: false,
-      personalFrom: {
+      personalFormDialogVisible: false,
+      personalForm: {
         id: null,
         ccId: null, // 个人客户都为1
         name: null,
@@ -411,7 +411,7 @@ export default {
         description: null,
         clientManagerId: null,
       },
-      personalFromRules: {
+      personalFormRules: {
         name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
         mobile: [
           { required: true, message: '手机号不能为空', trigger: 'blur' },
@@ -529,11 +529,11 @@ export default {
     },
     // 打开新增/修改客户弹窗
     openPersonalFormDialog() {
-      this.personalFromDialogVisible = true;
+      this.personalFormDialogVisible = true;
     },
     // 关闭新增/修改客户弹窗
     clearPersonalForm() {
-      this.personalFrom = {
+      this.personalForm = {
         id: null,
         ccId: null, // 个人客户都为1
         name: null,
@@ -551,15 +551,15 @@ export default {
         description: null,
         clientManagerId: null,
       };
-      this.$refs.personalFrom.resetFields();
-      this.personalFromDialogVisible = false;
+      this.$refs.personalForm.resetFields();
+      this.personalFormDialogVisible = false;
     },
     // 新增个人客户
     addCustomer() {
-      this.$refs.personalFrom.validate((valid) => {
+      this.$refs.personalForm.validate((valid) => {
         if (valid) {
-          this.personalFrom.ccId = 1;
-          this.$api.customerLinkman.add(this.personalFrom).then((res) => {
+          this.personalForm.ccId = 1;
+          this.$api.customerLinkman.add(this.personalForm).then((res) => {
             if (res.code === 200) {
               this.clearPersonalForm();
               this.resetParams();
@@ -572,17 +572,17 @@ export default {
     getDetail(id) {
       this.$api.customerLinkman.detail(id).then((res) => {
         if (res.code === 200 && res.data) {
-          this.personalFrom = res.data;
+          this.personalForm = res.data;
           this.openPersonalFormDialog();
         }
       });
     },
     // 修改个人客户
     editCustomer() {
-      this.$refs.personalFrom.validate((valid) => {
+      this.$refs.personalForm.validate((valid) => {
         if (valid) {
-          this.personalFrom.ccId = 1;
-          this.$api.customerLinkman.edit(this.personalFrom).then((res) => {
+          this.personalForm.ccId = 1;
+          this.$api.customerLinkman.edit(this.personalForm).then((res) => {
             if (res.code === 200) {
               this.clearPersonalForm();
               this.resetParams();