|
@@ -5,25 +5,25 @@
|
|
|
<el-form-item label="任务名称" prop="Keyword">
|
|
|
<el-input v-model="state.queryParams.Keyword" placeholder="回访任务名称" clearable @keyup.enter="handleQuery" class="keyword-input" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="任务状态" prop="AiOrderVisitTaskState">
|
|
|
- <el-select v-model="state.queryParams.AiOrderVisitTaskState" placeholder="请选择任务状态" @change="handleQuery" clearable>
|
|
|
- <el-option v-for="item in aiOrderVisitTaskState" :value="item.key" :key="item.key" :label="item.value" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="创建时间" prop="crTime">
|
|
|
- <el-date-picker
|
|
|
- v-model="state.queryParams.crTime"
|
|
|
- type="datetimerange"
|
|
|
- unlink-panels
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始时间"
|
|
|
- end-placeholder="结束时间"
|
|
|
- :shortcuts="shortcuts"
|
|
|
- @change="handleQuery"
|
|
|
- value-format="YYYY-MM-DD[T]HH:mm:ss"
|
|
|
- :default-time="defaultTimeStartEnd"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
+ <el-form-item label="任务状态" prop="AiOrderVisitTaskState">
|
|
|
+ <el-select v-model="state.queryParams.AiOrderVisitTaskState" placeholder="请选择任务状态" @change="handleQuery" clearable>
|
|
|
+ <el-option v-for="item in aiOrderVisitTaskState" :value="item.key" :key="item.key" :label="item.value" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="创建时间" prop="crTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="state.queryParams.crTime"
|
|
|
+ type="datetimerange"
|
|
|
+ unlink-panels
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ :shortcuts="shortcuts"
|
|
|
+ @change="handleQuery"
|
|
|
+ value-format="YYYY-MM-DD[T]HH:mm:ss"
|
|
|
+ :default-time="defaultTimeStartEnd"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
<el-button @click="resetQuery(ruleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
|
|
@@ -31,9 +31,6 @@
|
|
|
</el-form>
|
|
|
</el-card>
|
|
|
<el-card shadow="never">
|
|
|
-<!-- :toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
|
|
|
- @export-current="exportTable($event)"
|
|
|
- @export-all="exportTable($event, true)"-->
|
|
|
<ProTable
|
|
|
ref="proTableRef"
|
|
|
:columns="columns"
|
|
@@ -43,7 +40,9 @@
|
|
|
:total="state.total"
|
|
|
v-model:page-index="state.queryParams.PageIndex"
|
|
|
v-model:page-size="state.queryParams.PageSize"
|
|
|
-
|
|
|
+ :toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
|
|
|
+ @export-current="exportTable($event)"
|
|
|
+ @export-all="exportTable($event, true)"
|
|
|
>
|
|
|
<template #tableHeader="scope">
|
|
|
<el-button type="primary" @click="onAddVisit" v-auth="'business:visit:smart:add'">
|
|
@@ -63,26 +62,26 @@
|
|
|
>
|
|
|
终止任务
|
|
|
</el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- v-if="[5].includes(row.taskState)"
|
|
|
- @click="onStart(row)"
|
|
|
- title="启动任务"
|
|
|
- v-auth="'business:visit:smart:start'"
|
|
|
- >
|
|
|
- 启动
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- v-if="[1, 2].includes(row.taskState)"
|
|
|
- @click="onPause(row)"
|
|
|
- title="暂停任务"
|
|
|
- v-auth="'business:visit:smart:pause'"
|
|
|
- >
|
|
|
- 暂停
|
|
|
- </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ v-if="[5].includes(row.taskState)"
|
|
|
+ @click="onStart(row)"
|
|
|
+ title="启动任务"
|
|
|
+ v-auth="'business:visit:smart:start'"
|
|
|
+ >
|
|
|
+ 启动
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ v-if="[1, 2].includes(row.taskState)"
|
|
|
+ @click="onPause(row)"
|
|
|
+ title="暂停任务"
|
|
|
+ v-auth="'business:visit:smart:pause'"
|
|
|
+ >
|
|
|
+ 暂停
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</ProTable>
|
|
|
</el-card>
|
|
@@ -97,12 +96,12 @@
|
|
|
import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
|
|
import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
-import { getSmartVisitBaseData, getSmartVisitList } from "@/api/smartVisit";
|
|
|
-import { smartCallOutTaskPause, smartCallOutTaskStart, smartCallOutTaskStop } from "@/api/auxiliary/smartCallOut";
|
|
|
-import { defaultTimeStartEnd, shortcuts } from "@/utils/constants";
|
|
|
-import Other from "@/utils/other";
|
|
|
-import { downloadFileByStream } from "@/utils/tools";
|
|
|
-import { exportOrder } from "@/api/business/order";
|
|
|
+import { getSmartVisitBaseData, getSmartVisitExport, getSmartVisitList } from "@/api/smartVisit";
|
|
|
+import { smartCallOutTaskExport, smartCallOutTaskPause, smartCallOutTaskStart, smartCallOutTaskStop } from "@/api/auxiliary/smartCallOut";
|
|
|
+import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
|
|
|
+import Other from '@/utils/other';
|
|
|
+import { downloadFileByStream } from '@/utils/tools';
|
|
|
+import { exportOrder } from '@/api/business/order';
|
|
|
|
|
|
// 引入组件
|
|
|
const SmartVisitAdd = defineAsyncComponent(() => import('@/views/business/visit/component/Smart-visit-add.vue')); // 选择需要智能回访的工单
|
|
@@ -134,11 +133,11 @@ const state = reactive<any>({
|
|
|
// 查询参数
|
|
|
PageIndex: 1,
|
|
|
PageSize: 10,
|
|
|
- Keyword: null,
|
|
|
- AiOrderVisitTaskState:null,
|
|
|
- crTime:[],
|
|
|
- StartTime:null,
|
|
|
- EndTime:null
|
|
|
+ Keyword: null,
|
|
|
+ AiOrderVisitTaskState: null,
|
|
|
+ crTime: [],
|
|
|
+ StartTime: null,
|
|
|
+ EndTime: null,
|
|
|
},
|
|
|
total: 0, // 总条数
|
|
|
tableData: [], // 表格数据
|
|
@@ -152,10 +151,10 @@ const handleQuery = () => {
|
|
|
// 获取参数列表
|
|
|
const queryList = () => {
|
|
|
state.loading = true;
|
|
|
- let request = Other.deepClone(state.queryParams);
|
|
|
- request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
- request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
- Reflect.deleteProperty(request, 'crTime');
|
|
|
+ let request = Other.deepClone(state.queryParams);
|
|
|
+ request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
+ request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
+ Reflect.deleteProperty(request, 'crTime');
|
|
|
getSmartVisitList(request)
|
|
|
.then((res) => {
|
|
|
state.loading = false;
|
|
@@ -169,12 +168,12 @@ const queryList = () => {
|
|
|
// 页面基础数据
|
|
|
const aiOrderVisitTaskState = ref([]);
|
|
|
const getBaseData = async () => {
|
|
|
- try {
|
|
|
- const {result} = await getSmartVisitBaseData();
|
|
|
- aiOrderVisitTaskState.value = result.aiOrderVisitTaskState;
|
|
|
- }catch (e){
|
|
|
- console.log(e);
|
|
|
- }
|
|
|
+ try {
|
|
|
+ const { result } = await getSmartVisitBaseData();
|
|
|
+ aiOrderVisitTaskState.value = result.aiOrderVisitTaskState;
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
};
|
|
|
// 重置表单
|
|
|
const resetQuery = (formEl: FormInstance | undefined) => {
|
|
@@ -224,88 +223,90 @@ const onTermination = (row: any) => {
|
|
|
};
|
|
|
// 启动任务
|
|
|
const onStart = (row: any) => {
|
|
|
- ElMessageBox.confirm(`您确定要启动回访任务【${row.name}】吗?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- smartCallOutTaskStart({ id: row.id, typeId: 1 }).then(() => {
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '启动任务成功',
|
|
|
- });
|
|
|
- queryList();
|
|
|
- state.loading = false;
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- state.loading = false;
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- // 取消
|
|
|
- });
|
|
|
+ ElMessageBox.confirm(`您确定要启动回访任务【${row.name}】吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ autofocus: false,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ smartCallOutTaskStart({ id: row.id, typeId: 1 })
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '启动任务成功',
|
|
|
+ });
|
|
|
+ queryList();
|
|
|
+ state.loading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ state.loading = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // 取消
|
|
|
+ });
|
|
|
};
|
|
|
// 暂停任务
|
|
|
const onPause = (row: any) => {
|
|
|
- ElMessageBox.confirm(`您确定要暂停回访任务【${row.name}】吗?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- draggable: true,
|
|
|
- cancelButtonClass: 'default-button',
|
|
|
- autofocus: false,
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- smartCallOutTaskPause({ id: row.id, typeId: 1 }).then(() => {
|
|
|
- ElMessage({
|
|
|
- type: 'success',
|
|
|
- message: '暂停任务成功',
|
|
|
- });
|
|
|
- queryList();
|
|
|
- state.loading = false;
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- state.loading = false;
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- // 取消
|
|
|
- });
|
|
|
+ ElMessageBox.confirm(`您确定要暂停回访任务【${row.name}】吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ draggable: true,
|
|
|
+ cancelButtonClass: 'default-button',
|
|
|
+ autofocus: false,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ smartCallOutTaskPause({ id: row.id, typeId: 1 })
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '暂停任务成功',
|
|
|
+ });
|
|
|
+ queryList();
|
|
|
+ state.loading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ state.loading = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // 取消
|
|
|
+ });
|
|
|
};
|
|
|
// 表格导出
|
|
|
const exportTable = (val: any, isExportAll = false) => {
|
|
|
- let request = Other.deepClone(state.queryParams);
|
|
|
- request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
- request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
- Reflect.deleteProperty(request, 'crTime');
|
|
|
- const columnInfos = val.map((item: any) => {
|
|
|
- return {
|
|
|
- prop: item.prop,
|
|
|
- name: item.label,
|
|
|
- };
|
|
|
- });
|
|
|
- const req = {
|
|
|
- queryDto: request,
|
|
|
- columnInfos,
|
|
|
- isExportAll,
|
|
|
- };
|
|
|
- state.loading = true;
|
|
|
- exportOrder(req)
|
|
|
- .then((res: any) => {
|
|
|
- state.loading = false;
|
|
|
- downloadFileByStream(res);
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- state.loading = false;
|
|
|
- });
|
|
|
+ let request = Other.deepClone(state.queryParams);
|
|
|
+ request.StartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
+ request.EndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
+ Reflect.deleteProperty(request, 'crTime');
|
|
|
+ const columnInfos = val.map((item: any) => {
|
|
|
+ return {
|
|
|
+ prop: item.prop,
|
|
|
+ name: item.label,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ const req = {
|
|
|
+ queryDto: request,
|
|
|
+ columnInfos,
|
|
|
+ isExportAll,
|
|
|
+ };
|
|
|
+ state.loading = true;
|
|
|
+ getSmartVisitExport(req)
|
|
|
+ .then((res: any) => {
|
|
|
+ state.loading = false;
|
|
|
+ downloadFileByStream(res);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ state.loading = false;
|
|
|
+ });
|
|
|
};
|
|
|
// 页面加载时
|
|
|
onMounted(() => {
|
|
|
- getBaseData();
|
|
|
+ getBaseData();
|
|
|
queryList();
|
|
|
});
|
|
|
-</script>
|
|
|
+</script>
|