This commit is contained in:
qsh
2024-07-05 15:18:51 +08:00
parent e1ff8213bf
commit ab0c770167
6 changed files with 407 additions and 109 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div>
<div class="relative">
<el-tabs v-model="queryType" size="small" @tab-change="resetQuery">
<el-tabs v-model="queryType" size="small" @tab-change="quickChange">
<el-tab-pane label="全部" name="0" />
<el-tab-pane name="1">
<template #label>
@@ -31,6 +31,14 @@
</template>
</el-tab-pane>
<el-tab-pane label="公海" name="4" />
<el-tab-pane
v-if="appStore.getAppInfo?.instanceType == 1"
label="地图总览"
name="5"
style="height: calc(100vh - 160px)"
>
<ClueMap ref="mapClue" v-if="queryType == 5" />
</el-tab-pane>
</el-tabs>
<div class="absolute" style="right: 10px; top: 0">
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
@@ -39,110 +47,112 @@
</el-button>
</div>
</div>
<!-- 搜索工作栏 -->
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<template #actionMore>
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
</template>
</Search>
<!-- 列表 -->
<SSTable
v-if="!loading"
class="mt-20px"
v-model:tableObject="tableObject"
:tableColumns="allSchemas.tableColumns"
@get-list="getTableList"
@get-checked-columns="getCheckedColumns"
>
<el-table-column
v-for="item in showColumns"
:key="item.field"
:prop="item.field"
:label="item.label"
min-width="120px"
<template v-if="queryType != 5">
<!-- 搜索工作栏 -->
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
<template #actionMore>
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
</template>
</Search>
<!-- 列表 -->
<SSTable
v-if="!loading"
class="mt-20px"
v-model:tableObject="tableObject"
:tableColumns="allSchemas.tableColumns"
@get-list="getTableList"
@get-checked-columns="getCheckedColumns"
>
<template #default="{ row }">
<div v-if="item.field == 'followRecord'">
<el-button
type="primary"
text
style="padding: 0"
@click="handleFollow(row)"
v-if="queryType != 4"
v-hasPermi="['clue:pool:update']"
>
快速新增
</el-button>
</div>
<div v-else-if="item.field == 'contact'">
<span>{{ row[item.field] }}</span>
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
</div>
<div v-else-if="item.form?.component == 'DatePicker'">
<span>{{ formatDate(row[item.field]) }}</span>
</div>
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="row[item.field]"></div>
</el-popover>
</div>
<span v-else>{{ row[item.field] }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="200px" fixed="right">
<template #default="scope">
<el-button
type="primary"
link
@click="handleDetail(scope.row)"
v-hasPermi="['clue:pool:detail']"
>
详情
</el-button>
<template v-if="queryType != 4">
<el-button
type="primary"
link
@click="handleEdit(scope.row)"
v-hasPermi="['clue:pool:update']"
>
修改
</el-button>
<el-button
type="primary"
link
:disabled="scope.row.state == '成交'"
@click="handleSuccess(scope.row)"
v-hasPermi="['clue:pool:enroll']"
>
登记
</el-button>
<el-button
type="primary"
link
v-hasPermi="['clue:pool:release']"
@click="handleRelease(scope.row.clueId)"
>
释放
</el-button>
<el-table-column
v-for="item in showColumns"
:key="item.field"
:prop="item.field"
:label="item.label"
min-width="120px"
>
<template #default="{ row }">
<div v-if="item.field == 'followRecord'">
<el-button
type="primary"
text
style="padding: 0"
@click="handleFollow(row)"
v-if="queryType != 4"
v-hasPermi="['clue:pool:update']"
>
快速新增
</el-button>
</div>
<div v-else-if="item.field == 'contact'">
<span>{{ row[item.field] }}</span>
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
</div>
<div v-else-if="item.form?.component == 'DatePicker'">
<span>{{ formatDate(row[item.field]) }}</span>
</div>
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
<template #reference>
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
</template>
<div v-dompurify-html="row[item.field]"></div>
</el-popover>
</div>
<span v-else>{{ row[item.field] }}</span>
</template>
<template v-else>
</el-table-column>
<el-table-column label="操作" width="200px" fixed="right">
<template #default="scope">
<el-button
type="primary"
link
v-hasPermi="['clue:pool:gain']"
@click="handleGain(scope.row.clueId)"
@click="handleDetail(scope.row)"
v-hasPermi="['clue:pool:detail']"
>
获取
详情
</el-button>
<template v-if="queryType != 4">
<el-button
type="primary"
link
@click="handleEdit(scope.row)"
v-hasPermi="['clue:pool:update']"
>
修改
</el-button>
<el-button
type="primary"
link
:disabled="scope.row.state == '成交'"
@click="handleSuccess(scope.row)"
v-hasPermi="['clue:pool:enroll']"
>
登记
</el-button>
<el-button
type="primary"
link
v-hasPermi="['clue:pool:release']"
@click="handleRelease(scope.row.clueId)"
>
释放
</el-button>
</template>
<template v-else>
<el-button
type="primary"
link
v-hasPermi="['clue:pool:gain']"
@click="handleGain(scope.row.clueId)"
>
获取
</el-button>
</template>
</template>
</template>
</el-table-column>
</SSTable>
</el-table-column>
</SSTable>
</template>
<DialogClue
v-if="!loading"
@@ -164,11 +174,13 @@
</template>
<script setup name="CluePool">
import { useAppStore } from '@/store/modules/app'
import { getSimpleFieldList } from '@/api/clue/clueField'
import DialogClue from './Comp/DialogClue.vue'
import DrawerClue from './Comp/DrawerClue.vue'
import DialogSuccess from './Comp/DialogSuccess.vue'
import DialogFollow from './Comp/DialogFollow.vue'
import ClueMap from './Comp/ClueMap.vue'
import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { removeNullField } from '@/utils'
@@ -177,6 +189,7 @@ import { formatDate } from '@/utils/formatTime'
import * as ClueApi from '@/api/clue'
const message = useMessage() // 消息弹窗
const appStore = useAppStore()
const searchRef = ref()
const queryType = ref('2')
@@ -223,10 +236,24 @@ function getCheckedColumns(list) {
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
}
const mapClue = ref()
function quickChange(name) {
try {
if (name != '5') {
resetQuery()
mapClue.value && mapClue.value.destroyMap()
}
} catch (error) {
console.log(error)
}
}
function resetQuery() {
searchRef.value.reset()
tableObject.value.pageNo = 1
getTableList()
nextTick(() => {
searchRef.value && searchRef.value.reset()
tableObject.value.pageNo = 1
getTableList()
})
}
async function getTableList() {