|
@@ -53,21 +53,19 @@
|
|
|
<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="editClue(false)">新建线索</el-button>
|
|
|
- <el-button type="primary" @click="batchTransfer()">批量转移</el-button>
|
|
|
- <el-button type="primary" @click="batchDeletes()">批量删除</el-button>
|
|
|
+ <el-button type="primary" :disabled="batchTableData.length <= 0" @click="batchTransfer()">批量转移</el-button>
|
|
|
+ <el-button type="primary" :disabled="batchTableData.length <= 0" @click="batchDeletes()">批量删除</el-button>
|
|
|
<el-button type="primary" @click="showDeteleClue(true)">回收站</el-button>
|
|
|
<el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
|
|
|
<el-button type="primary" @click="exportTheadTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
|
|
|
</div>
|
|
|
<div class="flex-1 w-full overflow-hidden">
|
|
|
- <el-table ref="clueTableRef" :data="clueTable" border v-loading="allLoading.clueTableLading"
|
|
|
- style="width: 100%;height: 100%;">
|
|
|
+ <el-table :show-overflow-tooltip="tableShowOverflowTooltip" ref="clueTableRef" :data="clueTable" border v-loading="allLoading.clueTableLading"
|
|
|
+ style="width: 100%;height: 100%;" @selection-change="changeBatch">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="clueName" label="线索名称" width="180">
|
|
|
<template #default="scope">
|
|
|
- <el-button link type="primary" size="large" @click.prevent="toClueTableDetail(scope.row)">{{
|
|
|
- scope.row.clueName
|
|
|
- }}</el-button>
|
|
|
+ <div class="table-text-textnowrap" @click.prevent="toClueTableDetail(scope.row)">{{ scope.row.clueName }}</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="clueSourceValue" label="线索来源" width="180"></el-table-column>
|
|
@@ -103,8 +101,8 @@
|
|
|
<div class="flex justify-between items-center border-b pb-3 dialog-header">
|
|
|
<h4 :id="titleId">{{ allText.editClueText }}</h4>
|
|
|
<div>
|
|
|
- <el-button type="primary" @click="saveEditClue(true)">保存并新建</el-button>
|
|
|
- <el-button type="primary" @click="saveEditClue(false)">保存</el-button>
|
|
|
+ <el-button type="primary" :loading="allLoading.clueSaveLoading" @click="saveEditClue(true)">保存并新建</el-button>
|
|
|
+ <el-button type="primary" :loading="allLoading.clueSaveLoading" @click="saveEditClue(false)">保存</el-button>
|
|
|
<el-button @click="dialogVisible.editClueDialogVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -178,6 +176,7 @@ import { GenerateForm } from '@zmjs/form-design';
|
|
|
import TaskModal from '@/components/TaskModal/index.vue'
|
|
|
import DeteleTables from "./deteleTables.vue";
|
|
|
import { createTask } from "@/components/TaskModal/taskFunction";
|
|
|
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
|
|
|
|
|
|
// 定义类型
|
|
|
interface fixedDataInterface {
|
|
@@ -220,6 +219,7 @@ const allLoading = reactive({
|
|
|
clueLoading: false,
|
|
|
importLoading: false,
|
|
|
exoprtLoading: false,
|
|
|
+ clueSaveLoading: false
|
|
|
})
|
|
|
const dialogVisible = reactive({
|
|
|
editClueDialogVisible: false,
|
|
@@ -248,6 +248,7 @@ const clueTemplate = ref({
|
|
|
}) // 线索模板
|
|
|
const editForm = ref({}) // 编辑表单
|
|
|
const taskModalForm = ref({}) // 任务弹窗表单
|
|
|
+const batchTableData = ref([])
|
|
|
|
|
|
// 批量变量
|
|
|
const transferForm = reactive({
|
|
@@ -289,6 +290,7 @@ function transferClues() {
|
|
|
if (res.code == 'ok') {
|
|
|
globalPopup?.showSuccess('批量转移成功')
|
|
|
dialogVisible.clueDialogVisible = false
|
|
|
+ changeBatch(false)
|
|
|
getClueTable()
|
|
|
}
|
|
|
})
|
|
@@ -344,13 +346,14 @@ async function saveEditClue(flag: boolean) {
|
|
|
const data = await generateForm.value.getData()
|
|
|
let newData = { ...editForm.value, ...data }
|
|
|
delete newData.createTime
|
|
|
+ allLoading.clueSaveLoading = true
|
|
|
post(UNDATEFORM, { ...newData }).then((res) => {
|
|
|
if (res.code != 'ok') {
|
|
|
globalPopup?.showError(res.msg)
|
|
|
return
|
|
|
}
|
|
|
globalPopup?.showSuccess('保存成功')
|
|
|
- if (!flag) {
|
|
|
+ if (flag) {
|
|
|
editForm.value = {}
|
|
|
generateForm.value && generateForm.value.reset()
|
|
|
generateFormKey.value++
|
|
@@ -359,6 +362,8 @@ async function saveEditClue(flag: boolean) {
|
|
|
getClueTable()
|
|
|
}).catch((_err) => {
|
|
|
console.log(_err)
|
|
|
+ }).finally(() => {
|
|
|
+ allLoading.clueSaveLoading = false
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -391,6 +396,15 @@ async function importProducts(param: UploadRequestOptions) {
|
|
|
globalPopup?.showError(res.msg || '')
|
|
|
}
|
|
|
|
|
|
+function changeBatch(flag: boolean = true) {
|
|
|
+ if (flag) {
|
|
|
+ batchTableData.value = clueTableRef.value && clueTableRef.value.getSelectionRows()
|
|
|
+ } else {
|
|
|
+ batchTableData.value = []
|
|
|
+ clueTableRef.value && clueTableRef.value.clearSelection()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
function batchTransfer() {
|
|
|
const data = clueTableRef.value && clueTableRef.value.getSelectionRows()
|
|
|
if (!data.length) {
|
|
@@ -417,6 +431,7 @@ function batchDeletes() {
|
|
|
return
|
|
|
}
|
|
|
globalPopup?.showSuccess('删除成功')
|
|
|
+ changeBatch(false)
|
|
|
getClueTable()
|
|
|
})
|
|
|
})
|