|
@@ -15,7 +15,7 @@
|
|
|
<el-form-item label="客户名称:" label-width="7em" prop="customName">
|
|
|
<el-input v-model="searchForm.customName" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="联系人:" label-width="7em" prop="contactsName">
|
|
|
+ <el-form-item label="联系人号码:" label-width="7em" prop="contactsName">
|
|
|
<el-input v-model="searchForm.contactsName" placeholder="请输入" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执行人:" label-width="7em" prop="executorName">
|
|
@@ -52,13 +52,14 @@
|
|
|
<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="ml-auto p-3">
|
|
|
- <el-button type="primary" @click="createTasks()">创建任务</el-Button>
|
|
|
+ <el-button type="primary" v-permission="['tasksAdd']" @click="createTasks()">创建任务</el-Button>
|
|
|
<el-button type="primary" :disabled="len == 0" :loading="btnLoading" @click="deleteTasks()">批量删除</el-Button>
|
|
|
- <el-button type="primary" @click="openImportModal()">导入</el-Button>
|
|
|
- <el-button type="primary" :loading="btnLoading" @click="exportTasks()">导出</el-Button>
|
|
|
+ <el-button type="primary" v-permission="['tasksImport']" @click="openImportModal()">导入</el-Button>
|
|
|
+ <!-- <el-button type="primary" :loading="btnLoading" @click="exportTasks()">导出</el-Button> -->
|
|
|
+ <el-button type="primary" v-permission="['tasksExport']" :loading="btnLoading" @click="newExportTasks()">导出</el-Button>
|
|
|
</div>
|
|
|
<div class="flex-1 overflow-y-auto">
|
|
|
- <el-table :data="tableData" style="width: 100%;height: 100%;" ref="tableRef" v-loading="loading">
|
|
|
+ <el-table :data="tableData" :show-overflow-tooltip="tableShowOverflowTooltip" style="width: 100%;height: 100%;" ref="tableRef" v-loading="loading">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="taskName" label="任务名称" header-align="center" align="center" show-overflow-tooltip
|
|
|
width="200" />
|
|
@@ -75,19 +76,11 @@
|
|
|
</el-text>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="customName" label="执行人" width="120" header-align="center" align="center" />
|
|
|
+ <el-table-column prop="executorNames" label="执行人" width="120" header-align="center" align="center" />
|
|
|
<el-table-column prop="startDate" label="开始时间" width="200" :sortable="true" header-align="center"
|
|
|
align="center" value-format="YYYY-MM-DD" />
|
|
|
<el-table-column prop="endDate" label="截止时间" width="200" :sortable="true" header-align="center"
|
|
|
align="center" value-format="YYYY-MM-DD" />
|
|
|
- <el-table-column prop="contactsName" label="联系人" header-align="center" align="center" width="120">
|
|
|
- <template #default="scope">
|
|
|
- <el-link :underline="false" type="primary" @click="goDetail(scope.row, 'contacts', 'contactsId')">
|
|
|
- {{ scope.row.contactsName }}
|
|
|
- </el-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="contactsTel" label="联系人号码" header-align="center" align="center" width="140" />
|
|
|
<el-table-column prop="customName" label="客户名称" header-align="center" align="center" width="120">
|
|
|
<template #default="scope">
|
|
|
<el-link :underline="false" type="primary" @click="goDetail(scope.row, 'customer', 'customId')">
|
|
@@ -117,8 +110,16 @@
|
|
|
</el-link>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="contactsName" label="联系人名称" header-align="center" align="center" width="120">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link :underline="false" type="primary" @click="goDetail(scope.row, 'contacts', 'contactsId')">
|
|
|
+ {{ scope.row.contactsName }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="contactsTel" label="联系人号码" header-align="center" align="center" width="140" />
|
|
|
|
|
|
- <el-table-column fixed="right" label="操作" header-align="center" align="center" width="150">
|
|
|
+ <el-table-column fixed="right" label="操作" header-align="center" align="center" width="160" v-permission="['tasksEdit']">
|
|
|
|
|
|
<template #default="scope">
|
|
|
<el-button link type="primary" @click.prevent="editRow(scope.row)">
|
|
@@ -165,6 +166,7 @@ import ImportModal from './ImportModal.vue';
|
|
|
import ExportModal from './ExportModal.vue';
|
|
|
import { post, uploadFile } from '@/utils/request';
|
|
|
import { getFromValue, confirmAction, downloadFile } from '@/utils/tools';
|
|
|
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
|
|
|
import { pushMap } from './type';
|
|
|
const router = useRouter()
|
|
|
const { getFunctionList } = useStore()
|
|
@@ -216,6 +218,23 @@ const tableRef = ref<InstanceType<typeof ElTable>>();
|
|
|
const loading = ref<boolean>(false);
|
|
|
const totalCount = ref<number>(0);
|
|
|
const tableData = ref<any[]>([])
|
|
|
+
|
|
|
+function newExportTasks() {
|
|
|
+ btnLoading.value = true
|
|
|
+ const { startDate, endDate } = searchForm.value;
|
|
|
+ let params = {
|
|
|
+ ...searchForm.value,
|
|
|
+ startDate: startDate && dayjs(startDate).format('YYYY-MM-DD 00:00:00'),
|
|
|
+ endDate: endDate && dayjs(endDate).format('YYYY-MM-DD 23:59:59')
|
|
|
+ }
|
|
|
+ post(EXPORT_DATA_BY_TASK_ID, {...getFromValue(params)}).then((res) => {
|
|
|
+ globalPopup?.showSuccess("导出成功")
|
|
|
+ downloadFile(res.data, "任务列表.xlsx");
|
|
|
+ }).finally(() => {
|
|
|
+ btnLoading.value = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
function search() {
|
|
|
loading.value = true;
|
|
|
const { startDate, endDate } = searchForm.value;
|
|
@@ -228,7 +247,10 @@ function search() {
|
|
|
loading.value = false;
|
|
|
const { total, record } = data;
|
|
|
totalCount.value = total;
|
|
|
- tableData.value = record;
|
|
|
+ tableData.value = record.map((item: any) => ({
|
|
|
+ ...item,
|
|
|
+ executorNames: item.taskExecutors?.join(',') ?? ''
|
|
|
+ }));
|
|
|
}).catch(err => {
|
|
|
globalPopup?.showError(err);
|
|
|
loading.value = false;
|