|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch">
|
|
|
<el-form-item label="姓名" prop="name">
|
|
|
<el-input
|
|
|
v-model="queryParams.name"
|
|
@@ -34,12 +34,17 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
plain
|
|
|
- icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
>新增</el-button>
|
|
|
+ <BatchImport
|
|
|
+ ref="batchImport"
|
|
|
+ @import="importDataBtn"
|
|
|
+ @temDownload="importTemplateBtn"
|
|
|
+ :fileSize="2"
|
|
|
+ ></BatchImport>
|
|
|
</div>
|
|
|
- <el-table v-loading="loading" :data="contactList" height="700px">
|
|
|
+ <el-table size="mini" v-loading="loading" :data="contactList" height="700px">
|
|
|
<el-table-column width="200" label="编号" align="center" prop="code" />
|
|
|
<el-table-column show-overflow-tooltip label="姓名" align="center" prop="name" />
|
|
|
<el-table-column label="性别" align="center" prop="gander" >
|
|
@@ -47,9 +52,9 @@
|
|
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.gander"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="联系电话" align="center" prop="telephone" />
|
|
|
+ <el-table-column width="100" label="联系电话" align="center" prop="telephone" />
|
|
|
<el-table-column width="200" show-overflow-tooltip label="所属客户" align="center" prop="customerName" />
|
|
|
- <el-table-column show-overflow-tooltip label="部门名称" align="center" prop="departmentName" />
|
|
|
+ <el-table-column show-overflow-tooltip label="所属科室" align="center" prop="sectionName" />
|
|
|
<el-table-column label="职务" align="center" prop="position" >
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.mk_bo_position" :value="scope.row.position"/>
|
|
@@ -140,7 +145,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="联系人分类" prop="contactClassification">
|
|
|
+ <el-form-item label="分类" prop="contactClassification">
|
|
|
<el-select v-model="form.contactClassification" placeholder="">
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.mk_bo_contact_type"
|
|
@@ -190,7 +195,7 @@
|
|
|
</el-divider>
|
|
|
<el-row>
|
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="上级联系人" prop="superiorContactName">
|
|
|
+ <el-form-item label="联系人" prop="superiorContactName">
|
|
|
<dr-popover-select v-model="form.superiorContactName" title="上级联系人" type="LINKMAN_PARAM" :dataMapping="{
|
|
|
superiorContact: 'id',
|
|
|
superiorContactName: 'name',
|
|
@@ -364,7 +369,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listContact, getContact, delContact, addContact, updateContact } from "@/api/business/spd/bo/contact";
|
|
|
+import { listContact, getContact, delContact, addContact, updateContact,importData} from "@/api/business/spd/bo/contact";
|
|
|
import EducationList from '../education/educationList.vue';
|
|
|
import RelationshipList from '../relationship/relationshipList.vue';
|
|
|
|
|
@@ -374,7 +379,8 @@ export default {
|
|
|
components: {
|
|
|
EducationList,
|
|
|
RelationshipList,
|
|
|
- ElPopoverSelectV2: () =>import("@/components/popover-select-v2")
|
|
|
+ ElPopoverSelectV2: () =>import("@/components/popover-select-v2"),
|
|
|
+ BatchImport: () => import("@/components/BatchImport/index.vue"),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -599,6 +605,30 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ //导入模板
|
|
|
+ importTemplateBtn(){
|
|
|
+ this.download('/mk/bo/contact/importTemplate', {
|
|
|
+ }, `客户联系人导入模板_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ // 上传文件
|
|
|
+ async importDataBtn(file) {
|
|
|
+ try {
|
|
|
+ this.$modal.loading("加载中......");
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append("file", file[0].raw);
|
|
|
+ let { code, msg } = await importData(formData);
|
|
|
+ if (code == 200) {
|
|
|
+ this.$notify.success({ message: msg });
|
|
|
+ let { setVisible } = this.$refs.batchImport;
|
|
|
+ setVisible(false);
|
|
|
+ this.resetList();
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ } finally {
|
|
|
+ this.$modal.closeLoading();
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|