|
@@ -12,7 +12,7 @@
|
|
|
<el-option v-for="item in fixedData.ClueSources" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="电话号码">
|
|
|
+ <el-form-item label="公司号码">
|
|
|
<el-input v-model="customerCriteriaForm.telPhone" clearable placeholder="请输入"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="邮箱">
|
|
@@ -20,7 +20,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客户行业">
|
|
|
<el-select v-model="customerCriteriaForm.customerIndustryId" placeholder="请选择" clearable>
|
|
|
- <el-option v-for="item in fixedData.CustomIndustry" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ <el-option v-for="item in fixedData.CustomIndustry" :key="item.id" :label="item.name"
|
|
|
+ :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客户级别">
|
|
@@ -52,46 +53,48 @@
|
|
|
<div class="flex-1 p-5 overflow-auto">
|
|
|
<div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
|
|
|
<div class="flex justify-end pb-3">
|
|
|
- <el-button type="primary" @click="editCustomer(false)">新建客户</el-button>
|
|
|
+ <el-button type="primary" v-permission="['customerAdd']" @click="editCustomer(false)">新建客户</el-button>
|
|
|
<el-button type="primary" @click="showVisible('batchTransferVisible')"
|
|
|
:disabled="batchTableData.length <= 0">批量转移</el-button>
|
|
|
<el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
|
|
|
<el-button type="primary" @click="showVisible('deteleCustomerVisible')">回收站</el-button>
|
|
|
- <el-button type="primary" @click="showVisible('importVisible')">导入</el-button>
|
|
|
- <el-button type="primary" @click="exportCustomerTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
|
|
|
+ <el-button type="primary" v-permission="['customerImport']" @click="showVisible('importVisible')">导入</el-button>
|
|
|
+ <el-button type="primary" v-permission="['customerExport']" @click="exportCustomerTableList()"
|
|
|
+ :loading="allLoading.exoprtLoading">导出</el-button>
|
|
|
</div>
|
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
|
- <el-table ref="customerTableRef" :data="customerTable" border v-loading="allLoading.customerTableLading"
|
|
|
- style="width: 100%;height: 100%;" @selection-change="changeBatch">
|
|
|
+ <el-table ref="customerTableRef" :show-overflow-tooltip="tableShowOverflowTooltip" :data="customerTable" border v-loading="allLoading.customerTableLading"
|
|
|
+ style="width: 100%;height: 100%;" @selection-change="changeBatch" @sort-change="sortChange">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="customName" label="客户名称" width="180">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" size="large" @click.prevent="toCustomerTableDetail(scope.row)">{{
|
|
|
+ <!-- <el-button link type="primary" size="large" @click.prevent="toCustomerTableDetail(scope.row)">{{
|
|
|
scope.row.customName
|
|
|
- }}</el-button>
|
|
|
+ }}</el-button> -->
|
|
|
+ <div class="table-text-textnowrap" @click.prevent="toCustomerTableDetail(scope.row)">{{ scope.row.customName }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="customSourceValue" label="客户来源" width="180"></el-table-column>
|
|
|
<el-table-column prop="companyPhone" label="公司电话" width="180"></el-table-column>
|
|
|
<el-table-column prop="email" label="邮箱" width="200"></el-table-column>
|
|
|
<el-table-column prop="customerIndustryValue" label="客户行业" width="180"></el-table-column>
|
|
|
- <el-table-column prop="customerLevelValue" label="客户级别" width="180"></el-table-column>
|
|
|
+ <el-table-column prop="customerLevelValue" label="客户级别" width="180" sortable></el-table-column>
|
|
|
<el-table-column prop="inchargerName" label="负责人" width="190"></el-table-column>
|
|
|
<el-table-column prop="creatorName" label="创建人" width="180"></el-table-column>
|
|
|
<el-table-column prop="newCreateTime" label="创建时间" width="180"></el-table-column>
|
|
|
- <el-table-column label="操作" fixed="right" width="200">
|
|
|
+ <el-table-column label="操作" fixed="right" width="200" v-permission="['customerEdit', 'tasksAdd', 'customerEdit']">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" size="large" @click="editCustomer(scope.row)">编辑</el-button>
|
|
|
- <el-button link type="primary" size="large" @click="newTask(scope.row)">新建任务</el-button>
|
|
|
- <el-button link type="danger" size="large"
|
|
|
+ <el-button link type="primary" size="large" v-permission="['customerEdit']" @click="editCustomer(scope.row)">编辑</el-button>
|
|
|
+ <el-button link type="primary" size="large" v-permission="['tasksAdd']" @click="newTask(scope.row)">新建任务</el-button>
|
|
|
+ <el-button link type="danger" size="large" v-permission="['customerEdit']"
|
|
|
@click="customerDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="flex justify-end pt-3">
|
|
|
- <el-pagination layout="total, prev, pager, next, sizes" :total="customerTotalTable" :hide-on-single-page="true"
|
|
|
- @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
+ <el-pagination layout="total, prev, pager, next, sizes" :total="customerTotalTable"
|
|
|
+ :hide-on-single-page="true" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -181,6 +184,7 @@ import { useRouter, useRoute } from "vue-router";
|
|
|
import { GenerateForm } from '@zmjs/form-design';
|
|
|
import { createTask } from "@/components/TaskModal/taskFunction";
|
|
|
import { ElTable, UploadRequestOptions } from "element-plus";
|
|
|
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
|
|
|
|
|
|
import TaskModal from '@/components/TaskModal/index.vue'
|
|
|
import DeteleBusiness from './component/deteleTables.vue'
|
|
@@ -209,6 +213,7 @@ interface customerCriteriaFormType { // 线索筛选条件类型
|
|
|
customerIndustryId: string | number,
|
|
|
customerLevelId: string | number,
|
|
|
inchargerId: string | number,
|
|
|
+ isDesc?: string | number,
|
|
|
startTime: string | number,
|
|
|
endTime: string | number,
|
|
|
pageIndex: string | number,
|
|
@@ -226,6 +231,7 @@ const customerCriteriaForm = reactive<customerCriteriaFormType>({ // 筛选条
|
|
|
customerIndustryId: '',
|
|
|
customerLevelId: '',
|
|
|
inchargerId: '',
|
|
|
+ isDesc: '',
|
|
|
startTime: getFirstDayOfMonth(new Date()),
|
|
|
endTime: formatDate(new Date()),
|
|
|
pageIndex: 1,
|
|
@@ -276,6 +282,21 @@ const transferPersonnel = ref('')
|
|
|
|
|
|
|
|
|
// 定义方法
|
|
|
+function sortChange(data: any) {
|
|
|
+ customerCriteriaForm.pageIndex = 1
|
|
|
+ switch (data.order) {
|
|
|
+ case 'ascending':
|
|
|
+ customerCriteriaForm.isDesc = 1
|
|
|
+ break
|
|
|
+ case 'descending':
|
|
|
+ customerCriteriaForm.isDesc = 0
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ customerCriteriaForm.isDesc = ''
|
|
|
+ }
|
|
|
+ getCustomerTable()
|
|
|
+}
|
|
|
+
|
|
|
async function importBusiness(param: UploadRequestOptions) {
|
|
|
allLoading.importLoading = true
|
|
|
const formData = new FormData();
|
|
@@ -364,6 +385,7 @@ function editCustomerSave(flag: boolean) {
|
|
|
...customerTemplateValue.value,
|
|
|
...res
|
|
|
}
|
|
|
+ delete formVal.createTime
|
|
|
post(URL_EDITSAVE, { ...formVal }).then((_res) => {
|
|
|
allVisible.editCustomerVisible = flag
|
|
|
globalPopup?.showSuccess('保存成功')
|