|
|
@@ -7,11 +7,14 @@
|
|
|
:right-style="{ overflow: 'hidden' }"
|
|
|
>
|
|
|
<div>
|
|
|
- <div class="ele-border-lighter sys-organization-list" style="margin-left: 10px">
|
|
|
+ <div
|
|
|
+ class="ele-border-lighter sys-organization-list"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ >
|
|
|
<AssetTree
|
|
|
@handleNodeClick="handleNodeClick"
|
|
|
:defaultExpandedKeys="defaultExpandedKeys"
|
|
|
- :defaultExpandAll = false
|
|
|
+ :defaultExpandAll="false"
|
|
|
id="17"
|
|
|
:isFirstRefreshTable="false"
|
|
|
ref="treeList"
|
|
|
@@ -20,7 +23,11 @@
|
|
|
</div>
|
|
|
|
|
|
<template v-slot:content>
|
|
|
- <div class="ele-border-lighter form-content" v-loading="loading" style="margin-right: 10px">
|
|
|
+ <div
|
|
|
+ class="ele-border-lighter form-content"
|
|
|
+ v-loading="loading"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ >
|
|
|
<contact-search @search="reload"> </contact-search>
|
|
|
|
|
|
<!-- 数据表格 -->
|
|
|
@@ -90,12 +97,15 @@
|
|
|
:underline="false"
|
|
|
icon="el-icon-edit"
|
|
|
@click="openEdit('编辑客户', row)"
|
|
|
+ v-if="row.assignStatus !== 1"
|
|
|
>
|
|
|
修改
|
|
|
</el-link>
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
- v-if="row.assignStatus === 0&&$hasPermission('eom:contact:assign')"
|
|
|
+ v-if="
|
|
|
+ row.assignStatus === 0 && $hasPermission('eom:contact:assign')
|
|
|
+ "
|
|
|
:underline="false"
|
|
|
@click="assign('', row)"
|
|
|
>
|
|
|
@@ -110,7 +120,7 @@
|
|
|
释放
|
|
|
</el-link>
|
|
|
<el-link
|
|
|
- v-if="row.status === 2"
|
|
|
+ v-if="row.status === 2 && row.assignStatus !== 1"
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
icon="el-icon-check"
|
|
|
@@ -119,7 +129,7 @@
|
|
|
启用
|
|
|
</el-link>
|
|
|
<el-link
|
|
|
- v-if="row.status === 1"
|
|
|
+ v-if="row.status === 1 && row.assignStatus !== 1"
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
icon="el-icon-close"
|
|
|
@@ -131,6 +141,7 @@
|
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
|
title="确定要删除此客户信息吗?"
|
|
|
+ v-if="row.assignStatus !== 1"
|
|
|
@confirm="remove(row)"
|
|
|
>
|
|
|
<template v-slot:reference>
|
|
|
@@ -158,7 +169,6 @@
|
|
|
@done="commitBtn"
|
|
|
/>
|
|
|
<drawer ref="drawerRef"></drawer>
|
|
|
-
|
|
|
</ele-split-layout>
|
|
|
<!-- </el-card> -->
|
|
|
|
|
|
@@ -166,345 +176,351 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import ContactSearch from './components/contactSearch.vue';
|
|
|
- import AddContactDialog from './components/addContactDialog.vue';
|
|
|
- import assignDialog from './components/assignDialog.vue';
|
|
|
- import ContactDetailDialog from './components/contactDetailDialog.vue';
|
|
|
- import popModal from '@/components/pop-modal';
|
|
|
- import AssetTree from '@/components/AssetTree';
|
|
|
- import {
|
|
|
- contactDelete,
|
|
|
- contactPage,
|
|
|
- contactTypeTree,
|
|
|
- updateStatus,
|
|
|
- free
|
|
|
- } from '@/api/saleManage/contact';
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
- import drawer from './components/drawer.vue';
|
|
|
+import ContactSearch from './components/contactSearch.vue';
|
|
|
+import AddContactDialog from './components/addContactDialog.vue';
|
|
|
+import assignDialog from './components/assignDialog.vue';
|
|
|
+import ContactDetailDialog from './components/contactDetailDialog.vue';
|
|
|
+import popModal from '@/components/pop-modal';
|
|
|
+import AssetTree from '@/components/AssetTree';
|
|
|
+import {
|
|
|
+ contactDelete,
|
|
|
+ contactPage,
|
|
|
+ contactTypeTree,
|
|
|
+ updateStatus,
|
|
|
+ free
|
|
|
+} from '@/api/saleManage/contact';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import drawer from './components/drawer.vue';
|
|
|
+import { mapGetters } from 'vuex';
|
|
|
|
|
|
- export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- components: {
|
|
|
- AssetTree,
|
|
|
- ContactSearch,
|
|
|
- popModal,
|
|
|
- AddContactDialog,
|
|
|
- ContactDetailDialog,
|
|
|
- assignDialog,drawer
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- selection: [],
|
|
|
- defaultExpandedKeys:[],
|
|
|
- delVisible: false,
|
|
|
- // 加载状态
|
|
|
- loading: false,
|
|
|
- columns: [
|
|
|
- {
|
|
|
- width: 45,
|
|
|
- type: 'selection',
|
|
|
- columnKey: 'selection',
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '客户编码',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 140
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '客户名称',
|
|
|
- align: 'center',
|
|
|
- slot: 'name',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 200
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'serialNo',
|
|
|
- label: '客户代号',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 140
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'phone',
|
|
|
- label: '客户电话',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'addressName',
|
|
|
- label: '单位地址',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- let addr =
|
|
|
- '' + _row.addressName
|
|
|
- ? _row.addressName.replaceAll(',', '')
|
|
|
- : '';
|
|
|
- addr += _row.address ? _row.address : '';
|
|
|
- return addr;
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'linkName',
|
|
|
- label: '联系人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'linkPhone',
|
|
|
- label: '联系人电话',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
+export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: {
|
|
|
+ AssetTree,
|
|
|
+ ContactSearch,
|
|
|
+ popModal,
|
|
|
+ AddContactDialog,
|
|
|
+ ContactDetailDialog,
|
|
|
+ assignDialog,
|
|
|
+ drawer
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ selection: [],
|
|
|
+ defaultExpandedKeys: [],
|
|
|
+ delVisible: false,
|
|
|
+ // 加载状态
|
|
|
+ loading: false,
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: 45,
|
|
|
+ type: 'selection',
|
|
|
+ columnKey: 'selection',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '客户编码',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '客户名称',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'name',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 200
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'serialNo',
|
|
|
+ label: '客户代号',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'phone',
|
|
|
+ label: '客户电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'addressName',
|
|
|
+ label: '单位地址',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ let addr =
|
|
|
+ '' + _row.addressName ? _row.addressName.replaceAll(',', '') : '';
|
|
|
+ addr += _row.address ? _row.address : '';
|
|
|
+ return addr;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'linkName',
|
|
|
+ label: '联系人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'linkPhone',
|
|
|
+ label: '联系人电话',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'parentName',
|
|
|
- label: '上级单位',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'salesmanName',
|
|
|
- label: '销售员',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 120
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'assignStatus',
|
|
|
- label: '是否指派',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.assignStatus === 1 ? '是' : '否';
|
|
|
- }
|
|
|
- },
|
|
|
+ {
|
|
|
+ prop: 'parentName',
|
|
|
+ label: '上级单位',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'salesmanName',
|
|
|
+ label: '销售员',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'assignStatus',
|
|
|
+ label: '是否指派',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.assignStatus === 1 ? '是' : '否';
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return _row.status === 1 ? '启用' : '禁用';
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createUsername',
|
|
|
- label: '创建人',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 160,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return this.$util.toDateString(cellValue);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 280,
|
|
|
- align: 'center',
|
|
|
- resizable: false,
|
|
|
- slot: 'action',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'right'
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return _row.status === 1 ? '启用' : '禁用';
|
|
|
}
|
|
|
- ],
|
|
|
- current: {},
|
|
|
- curNodeData: {},
|
|
|
- treeList: [],
|
|
|
- treeLoading: false,
|
|
|
- formData: {},
|
|
|
- rootTreeId: null,
|
|
|
- defaultProps: {
|
|
|
- children: 'children',
|
|
|
- label: 'name'
|
|
|
},
|
|
|
- showEdit: true
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {},
|
|
|
- created() {
|
|
|
- this.requestDict('客户状态');
|
|
|
- this.getTreeData();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where, order }) {
|
|
|
- return contactPage({
|
|
|
- pageNum: page,
|
|
|
- size: limit,
|
|
|
- type: 1,
|
|
|
- ...where
|
|
|
- });
|
|
|
- },
|
|
|
- async getTreeData() {
|
|
|
- try {
|
|
|
- this.treeLoading = true;
|
|
|
- const res = await contactTypeTree({ type: 17 });
|
|
|
- this.treeLoading = false;
|
|
|
- if (res?.code === '0') {
|
|
|
- this.treeList = res.data;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.defaultExpandedKeys = this.treeList?.map(item=>item.id) ||[17]
|
|
|
- // 默认高亮第一级树节点
|
|
|
- // if (this.treeList[0]) {
|
|
|
- // this.rootTreeId = this.treeList[0].id;
|
|
|
- // this.getDetail(this.treeList[0].id);
|
|
|
- // }
|
|
|
- });
|
|
|
- return this.treeList;
|
|
|
+ {
|
|
|
+ prop: 'createUsername',
|
|
|
+ label: '创建人',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 160,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return this.$util.toDateString(cellValue);
|
|
|
}
|
|
|
- } catch (error) {}
|
|
|
- this.treeLoading = false;
|
|
|
- },
|
|
|
- handleNodeClick(data, node) {
|
|
|
- this.curNodeData = data;
|
|
|
- this.reload({ categoryId: data.id });
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({ page: 1, where });
|
|
|
- },
|
|
|
- openEdit(row, type) {
|
|
|
- this.current = row;
|
|
|
- this.showEdit = true;
|
|
|
- this.$refs.addContactDialogRef.open(row, type, this.curNodeData.id);
|
|
|
- this.$refs.addContactDialogRef.$refs.form &&
|
|
|
- this.$refs.addContactDialogRef.$refs.form.clearValidate();
|
|
|
- },
|
|
|
- //批量删除
|
|
|
- allDelBtn() {
|
|
|
- if (this.selection.length === 0) return;
|
|
|
- this.delVisible = true;
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 280,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'right'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ current: {},
|
|
|
+ curNodeData: {},
|
|
|
+ treeList: [],
|
|
|
+ treeLoading: false,
|
|
|
+ formData: {},
|
|
|
+ rootTreeId: null,
|
|
|
+ defaultProps: {
|
|
|
+ children: 'children',
|
|
|
+ label: 'name'
|
|
|
},
|
|
|
- commitBtn() {
|
|
|
- const dataId = this.selection.map((v) => v.id);
|
|
|
- contactDelete(dataId).then((res) => {
|
|
|
- this.$message.success('删除成功!');
|
|
|
+ showEdit: true
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['user'])
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.requestDict('客户状态');
|
|
|
+ this.getTreeData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where, order }) {
|
|
|
+ return contactPage({
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ type: 1,
|
|
|
+ ...where
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async getTreeData() {
|
|
|
+ try {
|
|
|
+ this.treeLoading = true;
|
|
|
+ const res = await contactTypeTree({ type: 17 });
|
|
|
+ this.treeLoading = false;
|
|
|
+ if (res?.code === '0') {
|
|
|
+ this.treeList = res.data;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.defaultExpandedKeys = this.treeList?.map(
|
|
|
+ (item) => item.id
|
|
|
+ ) || [17];
|
|
|
+ // 默认高亮第一级树节点
|
|
|
+ // if (this.treeList[0]) {
|
|
|
+ // this.rootTreeId = this.treeList[0].id;
|
|
|
+ // this.getDetail(this.treeList[0].id);
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ return this.treeList;
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ this.treeLoading = false;
|
|
|
+ },
|
|
|
+ handleNodeClick(data, node) {
|
|
|
+ this.curNodeData = data;
|
|
|
+ this.reload({ categoryId: data.id });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where });
|
|
|
+ },
|
|
|
+ openEdit(type,row) {
|
|
|
+ // console.log(row,'user')
|
|
|
+ // this.user.info.id
|
|
|
+ this.current = row;
|
|
|
+ this.showEdit = true;
|
|
|
+ this.$refs.addContactDialogRef.open( type,row, this.curNodeData.id);
|
|
|
+ this.$refs.addContactDialogRef.$refs.form &&
|
|
|
+ this.$refs.addContactDialogRef.$refs.form.clearValidate();
|
|
|
+ },
|
|
|
+ //批量删除
|
|
|
+ allDelBtn() {
|
|
|
+ if (this.selection.length === 0) return;
|
|
|
+ this.delVisible = true;
|
|
|
+ },
|
|
|
+ commitBtn() {
|
|
|
+ const dataId = this.selection.map((v) => v.id);
|
|
|
+ contactDelete(dataId).then((res) => {
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ remove(row) {
|
|
|
+ contactDelete([row.id]).then((res) => {
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 启用客户 */
|
|
|
+ enableOption(row) {
|
|
|
+ updateStatus(row.id, 1)
|
|
|
+ .then((msg) => {
|
|
|
+ this.$message.success('客户启用成功');
|
|
|
this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.$message.error(e.message);
|
|
|
});
|
|
|
- },
|
|
|
- remove(row) {
|
|
|
- contactDelete([row.id]).then((res) => {
|
|
|
- this.$message.success('删除成功!');
|
|
|
+ },
|
|
|
+ /** 禁用客户 */
|
|
|
+ disableOption(row) {
|
|
|
+ updateStatus(row.id, 2)
|
|
|
+ .then((msg) => {
|
|
|
+ this.$message.success('客户禁用成功');
|
|
|
this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.$message.error(e.message);
|
|
|
});
|
|
|
- },
|
|
|
- /** 启用客户 */
|
|
|
- enableOption(row) {
|
|
|
- updateStatus(row.id, 1)
|
|
|
- .then((msg) => {
|
|
|
- this.$message.success('客户启用成功');
|
|
|
- this.reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- this.$message.error(e.message);
|
|
|
- });
|
|
|
- },
|
|
|
- /** 禁用客户 */
|
|
|
- disableOption(row) {
|
|
|
- updateStatus(row.id, 2)
|
|
|
- .then((msg) => {
|
|
|
- this.$message.success('客户禁用成功');
|
|
|
- this.reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- this.$message.error(e.message);
|
|
|
- });
|
|
|
- },
|
|
|
- //指派
|
|
|
- assign(type, row) {
|
|
|
- let contactIds = [];
|
|
|
- let contactNames = [];
|
|
|
- let isAssign = false;
|
|
|
- if (type == 'all') {
|
|
|
- contactIds = this.selection.map((item) => item.id);
|
|
|
- contactNames = this.selection.map((item) => item.name);
|
|
|
- this.selection.forEach((item) => {
|
|
|
- if (item.assignStatus === 1) {
|
|
|
- isAssign = true;
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- contactIds = [row.id];
|
|
|
- contactNames = [row.name];
|
|
|
- }
|
|
|
- if (isAssign) {
|
|
|
- this.$message.warning('请先释放已指派的客户!');
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$refs.assignDialogRef.open(contactIds, contactNames);
|
|
|
- },
|
|
|
- //释放
|
|
|
- setFree(type, row) {
|
|
|
- let contactIds = [];
|
|
|
- let contactNames = [];
|
|
|
- if (type == 'all') {
|
|
|
- contactIds = this.selection.map((item) => item.id).toString();
|
|
|
- contactNames = this.selection.map((item) => item.name).toString();
|
|
|
- } else {
|
|
|
- contactIds = row.id;
|
|
|
- contactNames = row.name;
|
|
|
- }
|
|
|
- free({ contactIds, contactNames }).then((res) => {
|
|
|
- this.$message.success('释放成功');
|
|
|
- this.reload();
|
|
|
+ },
|
|
|
+ //指派
|
|
|
+ assign(type, row) {
|
|
|
+ let contactIds = [];
|
|
|
+ let contactNames = [];
|
|
|
+ let isAssign = false;
|
|
|
+ if (type == 'all') {
|
|
|
+ contactIds = this.selection.map((item) => item.id);
|
|
|
+ contactNames = this.selection.map((item) => item.name);
|
|
|
+ this.selection.forEach((item) => {
|
|
|
+ if (item.assignStatus === 1) {
|
|
|
+ isAssign = true;
|
|
|
+ }
|
|
|
});
|
|
|
- },
|
|
|
-
|
|
|
- openDetail(row) {
|
|
|
- // this.$refs.contactDetailDialogRef.open(row);
|
|
|
- this.$refs.drawerRef.open(row);
|
|
|
-
|
|
|
+ } else {
|
|
|
+ contactIds = [row.id];
|
|
|
+ contactNames = [row.name];
|
|
|
+ }
|
|
|
+ if (isAssign) {
|
|
|
+ this.$message.warning('请先释放已指派的客户!');
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.$refs.assignDialogRef.open(contactIds, contactNames);
|
|
|
+ },
|
|
|
+ //释放
|
|
|
+ setFree(type, row) {
|
|
|
+ let contactIds = [];
|
|
|
+ let contactNames = [];
|
|
|
+ if (type == 'all') {
|
|
|
+ contactIds = this.selection.map((item) => item.id).toString();
|
|
|
+ contactNames = this.selection.map((item) => item.name).toString();
|
|
|
+ } else {
|
|
|
+ contactIds = row.id;
|
|
|
+ contactNames = row.name;
|
|
|
+ }
|
|
|
+ free({ contactIds, contactNames }).then((res) => {
|
|
|
+ this.$message.success('释放成功');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ openDetail(row) {
|
|
|
+ // this.$refs.contactDetailDialogRef.open(row);
|
|
|
+ this.$refs.drawerRef.open(row,'allList');
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- :deep(.el-link--inner) {
|
|
|
- margin-left: 0px !important;
|
|
|
- }
|
|
|
+:deep(.el-link--inner) {
|
|
|
+ margin-left: 0px !important;
|
|
|
+}
|
|
|
|
|
|
- .sys-organization-list {
|
|
|
- height: calc(100vh - 264px);
|
|
|
- box-sizing: border-box;
|
|
|
- border-width: 1px;
|
|
|
- border-style: solid;
|
|
|
- overflow: auto;
|
|
|
- }
|
|
|
- .sys-organization-list :deep(.el-tree-node__content) {
|
|
|
- height: 40px;
|
|
|
- & > .el-tree-node__expand-icon {
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
+.sys-organization-list {
|
|
|
+ height: calc(100vh - 264px);
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-width: 1px;
|
|
|
+ border-style: solid;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+.sys-organization-list :deep(.el-tree-node__content) {
|
|
|
+ height: 40px;
|
|
|
+ & > .el-tree-node__expand-icon {
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
|
+}
|
|
|
</style>
|