|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div id="Customers" class="app-container">
|
|
|
- <div v-if="!isAdd1 && !isAdd2">
|
|
|
+ <div v-if="!isAdd0 && !isAdd1 && !isAdd2">
|
|
|
<div v-if="isList">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
label-width="68px">
|
|
@@ -77,6 +77,7 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="customersList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column type="index" label="序号" min-width="50" align="center" />
|
|
|
<el-table-column label="销售组织" align="center" prop="orgName" min-width="300" />
|
|
|
<el-table-column label="客户编码" align="center" prop="code" min-width="100" />
|
|
|
<el-table-column label="客户名称" align="center" prop="name" min-width="200" />
|
|
@@ -366,11 +367,60 @@
|
|
|
</el-tab-pane>
|
|
|
|
|
|
<el-tab-pane label="联系人信息" name="third" v-if="openState == 'check'">
|
|
|
- <el-table :data="mkCmCustomersContactList" ref="mkCmCustomersContact">
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="6" :offset="21">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddMkCmCustomersContact">添加
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" icon="el-icon-delete" size="mini"
|
|
|
+ @click="handleDeleteTab('0')">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-table :data="mkCmCustomersContactList" :row-class-name="rowMkCmCustomersContactIndex"
|
|
|
+ @selection-change="handleMkCmCustomersContactSelectionChange" ref="mkCmCustomersContact">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column type="index" label="序号" min-width="50" align="center" />
|
|
|
+ <el-table-column width="300" label="编号" align="center" prop="code" />
|
|
|
<el-table-column label="姓名" align="center" prop="name" min-width="150" />
|
|
|
- <el-table-column label="客户" align="center" prop="customerName" min-width="150" />
|
|
|
- <el-table-column label="手机" align="center" prop="telephone" min-width="150" />
|
|
|
- <el-table-column label="邮箱" align="center" prop="mail" min-width="150" />
|
|
|
+ <el-table-column label="性别" align="center" prop="gander" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gander"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="联系电话" align="center" prop="telephone" min-width="150" />
|
|
|
+ <el-table-column label="所属客户" align="center" prop="customerName" min-width="150" />
|
|
|
+ <el-table-column width="200" show-overflow-tooltip label="部门名称" align="center" prop="departmentName" />
|
|
|
+ <el-table-column label="职务" align="center" prop="position" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.mk_bo_position" :value="scope.row.position"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="决策力" align="center" prop="power" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.mk_bo_power" :value="scope.row.power"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column width="200" show-overflow-tooltip label="兴趣爱好" align="center" prop="hobby" />
|
|
|
+ <el-table-column width="200" show-overflow-tooltip label="家庭地址" align="center" prop="address" />
|
|
|
+ <el-table-column label="状态" align="center" prop="state" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.mk_bo_contact_state" :value="scope.row.state"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180px"
|
|
|
+ fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-search" @click="handleCheckAdd(scope.row, '0')">
|
|
|
+ 查看
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdateAdd(scope.row, '0')">修改
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteAdd(scope.row, '0')">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</el-tab-pane>
|
|
|
|
|
@@ -381,7 +431,7 @@
|
|
|
@click="handleAddMkCmCustomersResponsiblePerson">添加
|
|
|
</el-button>
|
|
|
<el-button type="danger" icon="el-icon-delete" size="mini"
|
|
|
- @click="handleDeleteMkCmCustomersResponsiblePerson">
|
|
|
+ @click="handleDeleteTab('1')">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -391,6 +441,7 @@
|
|
|
@selection-change="handleMkCmCustomersResponsiblePersonSelectionChange"
|
|
|
ref="mkCmCustomersResponsiblePerson">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column type="index" label="序号" min-width="50" align="center" />
|
|
|
<el-table-column label="人员姓名" align="center" prop="personName" min-width="150" />
|
|
|
<el-table-column label="客户名称" align="center" prop="customersName" min-width="150" />
|
|
|
<el-table-column label="关系类型" align="center" prop="relationshipType" min-width="150"
|
|
@@ -431,7 +482,7 @@
|
|
|
添加
|
|
|
</el-button>
|
|
|
<el-button type="danger" icon="el-icon-delete" size="mini"
|
|
|
- @click="handleDeleteMkCmCustomersDepartment">
|
|
|
+ @click="handleDeleteTab('2')">
|
|
|
删除
|
|
|
</el-button>
|
|
|
</el-col>
|
|
@@ -439,7 +490,13 @@
|
|
|
<el-table :data="mkCmCustomersDepartmentList" :row-class-name="rowMkCmCustomersDepartmentIndex"
|
|
|
@selection-change="handleMkCmCustomersDepartmentSelectionChange" ref="mkCmCustomersDepartment">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="科室名称" align="center" prop="name" min-width="150" />
|
|
|
+ <el-table-column type="index" label="序号" min-width="50" align="center" />
|
|
|
+ <el-table-column label="科室名称" align="center" prop="name" min-width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.mk_bo_section" :value="scope.row.name"
|
|
|
+ show-overflow-tooltip />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="客户名称" align="center" prop="customersName" min-width="150" />
|
|
|
<el-table-column label="负责人姓名" align="center" prop="responsiblePersonName" min-width="150" />
|
|
|
<el-table-column label="联系人手机" align="center" prop="phone" min-width="150" />
|
|
@@ -471,6 +528,8 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <AddContact v-model="isAdd0" v-if="isAdd0" :operatingState="operatingSta" :state="state" :row="rowDetail" :customersId="form.id"
|
|
|
+ :customersName="form.name" />
|
|
|
|
|
|
<AddPerson v-model="isAdd1" v-if="isAdd1" :pageStu="page" :disable="disable" :row="rowDetail" :customersId="form.id"
|
|
|
:customersName="form.name" />
|
|
@@ -489,6 +548,7 @@
|
|
|
addCustomers,
|
|
|
updateCustomers,
|
|
|
getContactInfo,
|
|
|
+ delContact,
|
|
|
} from "@/api/business/spd/cm/customers";
|
|
|
// 客户负责人接口
|
|
|
import {
|
|
@@ -501,6 +561,8 @@
|
|
|
import CollapseTransition from '@/components/MyCollapse/collapse.vue';
|
|
|
// 参照弹出框
|
|
|
import ElPopoverSelectV2 from "@/components/popover-select-v2";
|
|
|
+ // 新建客户联系人信息页面
|
|
|
+ import AddContact from "@/views/business/spd/cm/customersContact/index.vue";
|
|
|
// 新建客户负责人信息页面
|
|
|
import AddPerson from "@/views/business/spd/cm/customersResponsiblePerson/index.vue";
|
|
|
// 新建客户科室信息页面
|
|
@@ -511,12 +573,13 @@
|
|
|
components: {
|
|
|
CollapseTransition,
|
|
|
ElPopoverSelectV2,
|
|
|
+ AddContact,
|
|
|
AddPerson,
|
|
|
AddDepartment,
|
|
|
},
|
|
|
dicts: ['mk_cm_yes_no', 'mk_cm_classification', 'mk_cm_type', 'mk_cm_category', 'mk_cm_channel',
|
|
|
'mk_cm_business_type', 'mk_cm_industry', 'mk_cm_tax_type', 'mk_cm_enterprise_type', 'mk_cm_relationship_type',
|
|
|
- 'mk_cm_production_line'
|
|
|
+ 'mk_cm_production_line', 'mk_bo_section', 'sys_user_sex', 'mk_bo_position', 'mk_bo_power', 'mk_bo_contact_state'
|
|
|
],
|
|
|
data() {
|
|
|
return {
|
|
@@ -527,9 +590,11 @@
|
|
|
// 选中数组中的客户编码
|
|
|
codes: [],
|
|
|
// 子表选中数据
|
|
|
+ checkedMkCmCustomersContact: [],
|
|
|
checkedMkCmCustomersResponsiblePerson: [],
|
|
|
checkedMkCmCustomersDepartment: [],
|
|
|
// 子表选中主键
|
|
|
+ checkedMkCmCustomersContactIds: [],
|
|
|
checkedMkCmCustomersResponsiblePersonIds: [],
|
|
|
checkedMkCmCustomersDepartmentIds: [],
|
|
|
// 非单个禁用
|
|
@@ -557,6 +622,9 @@
|
|
|
// 列表页面
|
|
|
isList: true,
|
|
|
// 添加页面
|
|
|
+ isAdd0: false,
|
|
|
+ operatingSta: null,
|
|
|
+ state: null,
|
|
|
isAdd1: false,
|
|
|
isAdd2: false,
|
|
|
rowDetail: {},
|
|
@@ -702,6 +770,7 @@
|
|
|
delFlag: null
|
|
|
};
|
|
|
this.activeName = 'first';
|
|
|
+ this.mkCmCustomersContactList = [];
|
|
|
this.mkCmCustomersResponsiblePersonList = [];
|
|
|
this.mkCmCustomersDepartmentList = [];
|
|
|
this.resetForm("form");
|
|
@@ -782,7 +851,12 @@
|
|
|
},
|
|
|
/** Add查看按钮操作 */
|
|
|
handleCheckAdd(row, type) {
|
|
|
- if (type == '1') {
|
|
|
+ if (type == '0') {
|
|
|
+ this.isAdd0 = true;
|
|
|
+ this.operatingSta = 'Browse';
|
|
|
+ this.rowDetail = row;
|
|
|
+ this.disable = true;
|
|
|
+ } else if (type == '1') {
|
|
|
this.isAdd1 = true;
|
|
|
this.page = 'check';
|
|
|
this.rowDetail = row;
|
|
@@ -809,7 +883,12 @@
|
|
|
},
|
|
|
/** Add修改按钮操作 */
|
|
|
handleUpdateAdd(row, type) {
|
|
|
- if (type == '1') {
|
|
|
+ if (type == '0') {
|
|
|
+ this.isAdd0 = true;
|
|
|
+ this.operatingSta = 'Update';
|
|
|
+ this.rowDetail = row;
|
|
|
+ this.disable = false;
|
|
|
+ } else if (type == '1') {
|
|
|
this.isAdd1 = true;
|
|
|
this.page = 'update';
|
|
|
this.rowDetail = row;
|
|
@@ -863,9 +942,20 @@
|
|
|
},
|
|
|
/** Add删除按钮操作 */
|
|
|
handleDeleteAdd(row, type) {
|
|
|
- const ids = row.id || this.ids;
|
|
|
- if (type == '1') {
|
|
|
- this.$modal.confirm('是否确认删除人员姓名为"' + row.personName + '"的数据项?').then(function () {
|
|
|
+ let ids = [];
|
|
|
+ ids[0] = row.id;
|
|
|
+ if (type == '0') {
|
|
|
+ console.log(row, 'row')
|
|
|
+ this.$modal.confirm('是否确认删除序号为"' + row.index + '"的数据项?').then(function () {
|
|
|
+ return delContact(ids);
|
|
|
+ }).then(() => {
|
|
|
+ getContactInfo(this.form.id).then(res => {
|
|
|
+ this.mkCmCustomersContactList = res.data;
|
|
|
+ })
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ } else if (type == '1') {
|
|
|
+ this.$modal.confirm('是否确认删除序号为"' + row.index + '"的数据项?').then(function () {
|
|
|
return delCustomersResponsiblePerson(ids);
|
|
|
}).then(() => {
|
|
|
getCustomers(row.customersId).then(res => {
|
|
@@ -874,7 +964,7 @@
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
}).catch(() => {});
|
|
|
} else if (type == '2') {
|
|
|
- this.$modal.confirm('是否确认删除科室名称为"' + row.name + '"的数据项?').then(function () {
|
|
|
+ this.$modal.confirm('是否确认删除序号为"' + row.index + '"的数据项?').then(function () {
|
|
|
return delCustomersDepartment(ids);
|
|
|
}).then(() => {
|
|
|
getCustomers(row.customersId).then(res => {
|
|
@@ -884,6 +974,13 @@
|
|
|
}).catch(() => {});
|
|
|
}
|
|
|
},
|
|
|
+ /** 客户联系人序号 */
|
|
|
+ rowMkCmCustomersContactIndex({
|
|
|
+ row,
|
|
|
+ rowIndex
|
|
|
+ }) {
|
|
|
+ row.index = rowIndex + 1;
|
|
|
+ },
|
|
|
/** 客户负责人序号 */
|
|
|
rowMkCmCustomersResponsiblePersonIndex({
|
|
|
row,
|
|
@@ -898,6 +995,14 @@
|
|
|
}) {
|
|
|
row.index = rowIndex + 1;
|
|
|
},
|
|
|
+ /** 客户联系人添加按钮操作 */
|
|
|
+ handleAddMkCmCustomersContact() {
|
|
|
+ this.isList = false;
|
|
|
+ this.isAdd0 = true;
|
|
|
+ this.operatingSta = 'Insert';
|
|
|
+ this.disable = false;
|
|
|
+ this.state = '1';
|
|
|
+ },
|
|
|
/** 客户负责人添加按钮操作 */
|
|
|
handleAddMkCmCustomersResponsiblePerson() {
|
|
|
this.isList = false;
|
|
@@ -912,35 +1017,56 @@
|
|
|
this.page = 'add';
|
|
|
this.disable = false;
|
|
|
},
|
|
|
- /** 客户负责人删除按钮操作 */
|
|
|
- handleDeleteMkCmCustomersResponsiblePerson() {
|
|
|
- if (this.checkedMkCmCustomersResponsiblePerson.length == 0) {
|
|
|
- this.$modal.msgError("请先选择要删除的客户负责人数据");
|
|
|
- } else {
|
|
|
- this.$modal.confirm('是否确认删除序号为"' + this.checkedMkCmCustomersResponsiblePerson + '"的数据项?').then(function () {
|
|
|
- return delCustomersResponsiblePerson(this.checkedMkCmCustomersResponsiblePersonIds);
|
|
|
- }).then(() => {
|
|
|
- getCustomers(this.form.id).then(res => {
|
|
|
- this.mkCmCustomersResponsiblePersonList = res.data.mkCmCustomersResponsiblePersonList;
|
|
|
- })
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ /** 客户页签删除按钮操作 */
|
|
|
+ handleDeleteTab(type) {
|
|
|
+ let that = this;
|
|
|
+ if (type == '0') {
|
|
|
+ if (that.checkedMkCmCustomersContact.length == 0) {
|
|
|
+ that.$modal.msgError("请先选择要删除的客户联系人数据");
|
|
|
+ } else {
|
|
|
+ that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersContact + '"的数据项?').then(function () {
|
|
|
+ return delContact(that.checkedMkCmCustomersContactIds);
|
|
|
+ }).then(() => {
|
|
|
+ getContactInfo(that.form.id).then(res => {
|
|
|
+ that.mkCmCustomersContactList = res.data;
|
|
|
+ })
|
|
|
+ that.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch((e) => {
|
|
|
+ console.log(e, 'e');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else if (type == '1') {
|
|
|
+ if (that.checkedMkCmCustomersResponsiblePerson.length == 0) {
|
|
|
+ that.$modal.msgError("请先选择要删除的客户负责人数据");
|
|
|
+ } else {
|
|
|
+ that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersResponsiblePerson + '"的数据项?').then(function () {
|
|
|
+ return delCustomersResponsiblePerson(that.checkedMkCmCustomersResponsiblePersonIds);
|
|
|
+ }).then(() => {
|
|
|
+ getCustomers(that.form.id).then(res => {
|
|
|
+ that.mkCmCustomersResponsiblePersonList = res.data.mkCmCustomersResponsiblePersonList;
|
|
|
+ })
|
|
|
+ that.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
+ } else if (type == '2') {
|
|
|
+ if (that.checkedMkCmCustomersDepartment.length == 0) {
|
|
|
+ that.$modal.msgError("请先选择要删除的客户科室数据");
|
|
|
+ } else {
|
|
|
+ that.$modal.confirm('是否确认删除序号为"' + that.checkedMkCmCustomersDepartment + '"的数据项?').then(function () {
|
|
|
+ return delCustomersDepartment(that.checkedMkCmCustomersDepartmentIds);
|
|
|
+ }).then(() => {
|
|
|
+ getCustomers(that.form.id).then(res => {
|
|
|
+ that.mkCmCustomersDepartmentList = res.data.mkCmCustomersDepartmentList;
|
|
|
+ })
|
|
|
+ that.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- /** 客户科室删除按钮操作 */
|
|
|
- handleDeleteMkCmCustomersDepartment() {
|
|
|
- if (this.checkedMkCmCustomersDepartment.length == 0) {
|
|
|
- this.$modal.msgError("请先选择要删除的客户科室数据");
|
|
|
- } else {
|
|
|
- this.$modal.confirm('是否确认删除序号为"' + this.checkedMkCmCustomersDepartment + '"的数据项?').then(function () {
|
|
|
- return delCustomersDepartment(this.checkedMkCmCustomersDepartmentIds);
|
|
|
- }).then(() => {
|
|
|
- getCustomers(this.form.id).then(res => {
|
|
|
- this.mkCmCustomersDepartmentList = res.data.mkCmCustomersDepartmentList;
|
|
|
- })
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- }
|
|
|
+ /** 复选框选中数据 */
|
|
|
+ handleMkCmCustomersContactSelectionChange(selection) {
|
|
|
+ this.checkedMkCmCustomersContact = selection.map(item => item.index)
|
|
|
+ this.checkedMkCmCustomersContactIds = selection.map(item => item.id)
|
|
|
},
|
|
|
/** 复选框选中数据 */
|
|
|
handleMkCmCustomersResponsiblePersonSelectionChange(selection) {
|