123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <div class="statistics-department-satisfaction-detail-list-container layout-padding">
- <div class="layout-padding-auto layout-padding-view pd20">
- <ProTable
- ref="proTableRef"
- :columns="columns"
- :data="state.tableData"
- @updateTable="queryList"
- :loading="state.loading"
- :total="state.total"
- v-model:page-index="state.queryParams.PageIndex"
- v-model:page-size="state.queryParams.PageSize"
- :toolButton="['refresh', 'setting', 'exportCurrent', 'exportAll']"
- :exportMethod="departmentSatisfactionListExport"
- :exportParams="requestParams"
- >
- <template #table-search>
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
- <el-form-item label="工单标题" prop="Keyword">
- <el-input v-model="state.queryParams.Keyword" placeholder="工单标题" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="工单编码" prop="No">
- <el-input v-model="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" />
- </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"
- :clearable="false"
- />
- </el-form-item>
- <el-form-item label="" label-width="0">
- <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
- <el-button @click="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
- </el-form-item>
- </el-form>
- </template>
- <template #tableHeader="scope">
- <el-button type="primary" @click="onJbExport" :disabled="!scope.isSelected" :loading="state.loading"
- ><SvgIcon name="iconfont icon-daochu" class="mr5" />交办单导出
- </el-button>
- </template>
- <template #description>
- <el-popover :width="500" trigger="click">
- <template #reference>
- <el-button circle title="口径说明"><SvgIcon name="ele-QuestionFilled" /></el-button>
- </template>
- <el-descriptions title="" :column="1" border>
- <el-descriptions-item label="工单编码">工单编号</el-descriptions-item>
- <el-descriptions-item label="重办次数">发布是重办的次数</el-descriptions-item>
- <el-descriptions-item label="甄别">甄别中、未甄别、甄别退回、不同意、</el-descriptions-item>
- <el-descriptions-item label="回访信息"> 工单回访内容 </el-descriptions-item>
- <el-descriptions-item label="受理时间"> 工单新建时间 </el-descriptions-item>
- <el-descriptions-item label="工单标题"> 工单的标题(点击可查看工单详情)</el-descriptions-item>
- <el-descriptions-item label="话务员"> 工单回访话务员 </el-descriptions-item>
- <el-descriptions-item label="部门名称"> 新建工单用户所在部门 </el-descriptions-item>
- <el-descriptions-item label="评价工具"> 电话、门户网站、 </el-descriptions-item>
- <el-descriptions-item label="回访时间"> 工单回访时间 </el-descriptions-item>
- <el-descriptions-item label="满意度"> 回访时的满意度 </el-descriptions-item>
- <el-descriptions-item label="办结时间"> 工单办理完成的时间 </el-descriptions-item>
- </el-descriptions>
- </el-popover>
- </template>
- <template #title="{ row }">
- <order-detail :order="row" @updateList="queryList">{{ row.title }}</order-detail>
- </template>
- <template #operation="{ row }">
- <el-button link type="primary" @click="visitDetail(row)" title="查看回访详情"> 回访详情 </el-button>
- </template>
- </ProTable>
- </div>
- <!-- 回访详情 -->
- <visit-detail-com ref="visitDetailRef" @updateList="queryList" />
- <!-- 更多查询 -->
- <el-drawer v-model="drawer" title="更多查询" size="500px">
- <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="100px">
- <el-form-item label="回访人姓名" prop="VisitUser">
- <el-input v-model="state.queryParams.VisitUser" placeholder="回访人姓名" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="办件结果" prop="OrgProcessingResults">
- <el-select
- v-model="state.queryParams.OrgProcessingResults"
- placeholder="请选择来办件结果"
- clearable
- class="w100"
- @change="handleQuery"
- >
- <el-option v-for="item in state.visitSatisfaction" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
- </el-select>
- </el-form-item>
- <el-form-item label="热点分类" prop="Hotspot">
- <el-input v-model="state.queryParams.Hotspot" placeholder="热点分类名称" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="回访部门" prop="OrgId">
- <el-cascader
- :options="state.orgsOptions"
- filterable
- :show-all-levels="false"
- :props="{ checkStrictly: true, value: 'id', label: 'name', emitPath: false }"
- placeholder="请选择回访部门"
- clearable
- class="w100"
- v-model="state.queryParams.OrgId"
- @change="handleQuery"
- >
- </el-cascader>
- </el-form-item>
- <el-form-item label="办结时间" prop="doneTime">
- <el-date-picker
- v-model="state.queryParams.doneTime"
- 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="TypeCode">
- <el-select v-model="state.queryParams.TypeCode" placeholder="请选择来电主体" @change="handleQuery">
- <el-option :value="0" label="全部" />
- <el-option :value="1" label="市民" />
- <el-option :value="2" label="企业" />
- </el-select>
- </el-form-item>
- </el-form>
- <template #footer>
- <el-button type="primary" @click="handleQuery" :loading="state.loading"> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
- <el-button @click="resetQuery(drawerRuleFormRef)" class="default-button"> <SvgIcon name="ele-Refresh" class="mr5" />重置 </el-button>
- </template>
- </el-drawer>
- </div>
- </template>
- <script setup lang="tsx" name="statisticsDepartmentSatisfiedDetailList">
- import { onMounted, reactive, ref, defineAsyncComponent } from 'vue';
- import { ElMessage, ElMessageBox, FormInstance } from 'element-plus';
- import { departmentSatisfactionDetailBase, departmentSatisfactionList, departmentSatisfactionListExport } from '@/api/statistics/department';
- import { formatDate } from '@/utils/formatTime';
- import { defaultDateOne, defaultTimeStartEnd, shortcuts } from '@/utils/constants';
- import { useRoute } from 'vue-router';
- import Other from '@/utils/other';
- import { exportJbOrder } from '@/api/business/order';
- import { downloadZip } from '@/utils/tools';
- // 引入组件
- const VisitDetailCom = defineAsyncComponent(() => import('@/views/business/visit/component/Visit-detail.vue')); // 回访
- const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
- // 表格配置项
- const columns = ref<any[]>([
- { type: 'selection', width: 40, align: 'center' },
- { prop: 'no', label: '工单编码', width: 140 },
- { prop: 'reTransactNum', label: '重办次数' },
- { prop: 'orderScreenStatusText', label: '甄别', minWidth: 100 },
- { prop: 'visitContent', label: '回访信息', minWidth: 150 },
- { prop: 'hotspotSpliceName', label: '热点全称', minWidth: 150 },
- { prop: 'orgLevelOneName', label: '一级部门', minWidth: 140 },
- { prop: 'currentHandleOrgName', label: '办结部门', minWidth: 140 },
- {
- prop: 'creationTime',
- label: '受理时间',
- minWidth: 160,
- render: (scope) => {
- return <span>{formatDate(scope.row.creationTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- { prop: 'title', label: '工单标题', width: 200 },
- { prop: 'visitUser', label: '回访人', minWidth: 120 },
- { prop: 'visitOrgName', label: '回访部门', minWidth: 140 },
- { prop: 'visitTypeText', label: '回访方式', minWidth: 100 },
- {
- prop: 'visitTime',
- label: '回访时间',
- minWidth: 160,
- render: (scope) => {
- return <span>{formatDate(scope.row.visitTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- { prop: 'orgProcessingResults', label: '满意度', minWidth: 120 },
- { prop: 'content', label: '受理内容', minWidth: 150 },
- { prop: 'fileOpinion', label: '承办意见', minWidth: 150 },
- {
- prop: 'filedTime',
- label: '办结时间',
- minWidth: 160,
- render: (scope) => {
- return <span>{formatDate(scope.row.filedTime, 'YYYY-mm-dd HH:MM:SS')}</span>;
- },
- },
- { prop: 'operation', label: '操作', fixed: 'right', width: 90, align: 'center' },
- ]);
- // 定义变量内容
- const state = reactive<any>({
- queryParams: {
- // 查询条件
- PageIndex: 1,
- PageSize: 20,
- HotspotIds: null,
- crTime: defaultDateOne,
- CreationTimeStart: null,
- CreationTimeEnd: null,
- doneTime: [], // 办结时间
- ActualHandleTimeStart: null,
- ActualHandleTimeEnd: null,
- VisitUser: null,
- OrgProcessingResults: null,
- OrgId:null,
- TypeId:'1',
- TypeCode:0
- },
- tableData: [], //表单
- loading: false, // 加载
- total: 0, // 总数
- });
- /** 搜索按钮操作 */
- const handleQuery = () => {
- state.queryParams.PageIndex = 1;
- queryList();
- };
- /** 获取列表 */
- const requestParams = ref({});
- const queryList = () => {
- state.loading = true;
- requestParams.value = Other.deepClone(state.queryParams);
- requestParams.value.CreationTimeStart = state.queryParams.crTime === null ? null : state.queryParams.crTime[0]; // 生成时间
- requestParams.value.CreationTimeEnd = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
- Reflect.deleteProperty(requestParams.value, 'crTime'); // 删除无用的参数
- requestParams.value.ActualHandleTimeStart = state.queryParams.doneTime === null ? null : state.queryParams.doneTime[0]; // 生成时间
- requestParams.value.ActualHandleTimeEnd = state.queryParams.doneTime === null ? null : state.queryParams.doneTime[1];
- Reflect.deleteProperty(requestParams.value, 'doneTime'); // 删除无用的参数
- departmentSatisfactionList(requestParams.value)
- .then((res: any) => {
- state.tableData = res.result?.items ?? [];
- state.total = res.result.total ?? 0;
- state.loading = false;
- })
- .catch(() => {
- state.loading = false;
- });
- };
- /** 重置按钮操作 */
- const drawerRuleFormRef = ref();
- const ruleFormRef = ref<RefType>(); // 表单ref
- const drawer = ref(false);
- const resetQuery = (formEl: FormInstance | undefined) => {
- if (!formEl) return;
- formEl.resetFields();
- ruleFormRef.value?.resetFields();
- queryList();
- };
- // 回访详情
- const visitDetailRef = ref<RefType>();
- const visitDetail = (row: any) => {
- visitDetailRef.value.openDialog({ ...row, id: row.visitId }, '回访详情');
- };
- // 获取查询条件基础信息
- const getBaseData = async () => {
- try {
- const res: any = await departmentSatisfactionDetailBase();
- const mappings: any = {
- visitSatisfaction: 'visitSatisfaction',
- orgsOptions: 'orgsOptions',
- };
- for (const key in mappings) {
- state[key] = res.result?.[mappings[key]] ?? [];
- }
- } catch (error) {
- console.log(error);
- }
- };
- // 交办单导出
- const proTableRef = ref<RefType>();
- const onJbExport = () => {
- const ids = proTableRef.value.selectedList.map((item: any) => item.id);
- ElMessageBox.confirm(`您确定导出选中的${proTableRef.value.selectedList.length}个工单的交办单,是否继续?`, '提示', {
- confirmButtonText: '确认',
- cancelButtonText: '取消',
- type: 'warning',
- draggable: true,
- cancelButtonClass: 'default-button',
- autofocus: false,
- })
- .then(() => {
- state.loading = true;
- exportJbOrder(ids)
- .then((res: any) => {
- downloadZip(res);
- state.loading = false;
- ElMessage.success('导出成功');
- })
- .catch(() => {
- state.loading = false;
- });
- })
- .catch(() => {});
- };
- onMounted(() => {
- getBaseData();
- queryList();
- });
- </script>
|