123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324 |
- <template>
- <div class="business-overdue-container layout-padding">
- <div class="layout-padding-auto layout-padding-view pd20">
- <el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline>
- <el-form-item label="工单标题" prop="Title">
- <el-input v-model.trim="state.queryParams.Title" placeholder="工单标题" clearable @keyup.enter="handleQuery" class="keyword-input" />
- </el-form-item>
- <el-form-item label="工单编码" prop="No">
- <el-input v-model.trim="state.queryParams.No" placeholder="工单编码" clearable @keyup.enter="handleQuery" class="keyword-input" />
- </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="drawer = true" class="default-button"> <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button>
- </el-form-item>
- </el-form>
- <vxe-toolbar
- ref="toolbarRef"
- :loading="state.loading"
- custom
- :refresh="{
- queryMethod: handleQuery,
- }"
- :tools="[{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }]"
- >
- <template #buttons>
- <el-button type="primary" @click="onJbExport" :loading="state.loading" :disabled="isChecked"
- ><SvgIcon name="iconfont icon-daochu" class="mr5" />交办单导出<span v-if="checkTable.length">({{checkTable.length}})</span>
- </el-button>
- </template>
- </vxe-toolbar>
- <div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
- <vxe-table
- border
- :loading="state.loading"
- :data="state.tableData"
- :sort-config="{ remote: true }"
- :column-config="{ resizable: true }"
- :row-config="{ isCurrent: true, isHover: true, height: 30,useKey:true }"
- ref="tableRef"
- @sort-change="sortChange"
- @checkbox-all="selectAllChangeEvent"
- @checkbox-change="selectChangeEvent"
- height="auto"
- auto-resize
- show-overflow
- :scrollY="{ enabled: true, gt: 100 }"
- id="businessOverdue"
- :custom-config="{ storage: true }"
- :params="{ exportMethod: exportOverdueList, exportParams: requestParams }"
- showHeaderOverflow
- >
- <vxe-column type="checkbox" width="60" align="center"></vxe-column>
- <vxe-column field="no" title="工单编码" width="140"></vxe-column>
- <vxe-column field="isProvinceText" title="省/市工单" width="90"></vxe-column>
- <vxe-column field="currentStepName" title="当前节点" width="100"></vxe-column>
- <vxe-column field="delayText" title="是否延期" width="100"></vxe-column>
- <vxe-column field="statusText" title="工单状态" width="100">
- <template #default="{ row }">
- <el-text type="danger" tag="b" v-if="[1, 2, 3, 9, 101, 102, 103, 104, 105, 200].includes(row.status)">{{ row.statusText }}</el-text>
- <span v-else>{{ row.statusText }}</span>
- </template>
- </vxe-column>
- <vxe-column field="title" title="工单标题" width="200">
- <template #default="{ row }">
- <order-detail :order="row" @updateList="handleQuery">{{ row.title }}</order-detail>
- </template>
- </vxe-column>
- <vxe-column field="centerToOrgHandlerName" title="派单员" width="120"></vxe-column>
- <vxe-column field="startTime" title="受理时间" sortable width="160">
- <template #default="{ row }">
- {{ formatDate(row.startTime, 'YYYY-mm-dd HH:MM:SS') }}
- </template>
- </vxe-column>
- <vxe-column field="expiredTime" title="工单期满时间" sortable width="160">
- <template #default="{ row }">
- {{ formatDate(row.expiredTime, 'YYYY-mm-dd HH:MM:SS') }}
- </template>
- </vxe-column>
- <vxe-column field="filedTime" title="办结时间" sortable width="160">
- <template #default="{ row }">
- {{ formatDate(row.filedTime, 'YYYY-mm-dd HH:MM:SS') }}
- </template>
- </vxe-column>
- <vxe-column field="actualHandleOrgName" title="接办部门" width="140"></vxe-column>
- <vxe-column field="orgLevelOneName" title="一级部门" width="140"></vxe-column>
- <vxe-column field="acceptType" title="受理类型" width="100"></vxe-column>
- <vxe-column field="counterSignTypeText" title="是否会签" width="90"></vxe-column>
- <vxe-column field="sourceChannel" title="来源渠道" width="100"></vxe-column>
- <vxe-column field="hotspotName" title="热点分类" width="150"></vxe-column>
- <vxe-column field="acceptorName" title="受理人" width="120"></vxe-column>
- </vxe-table>
- </div>
- <pagination
- @pagination="queryList"
- :total="state.total"
- v-model:current-page="state.queryParams.PageIndex"
- v-model:page-size="state.queryParams.PageSize"
- :disabled="state.loading"
- />
- </div>
- <!-- 更多查询 -->
- <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="FromPhone">
- <el-input v-model.trim="state.queryParams.FromPhone" placeholder="来电号码" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="接办部门" prop="ActualHandleOrgName">
- <el-input v-model="state.queryParams.ActualHandleOrgName" placeholder="请填写接办部门名称" clearable @keyup.enter="handleQuery" />
- </el-form-item>
- <el-form-item label="受理类型" prop="AcceptType">
- <el-select v-model="state.queryParams.AcceptType" placeholder="请选择受理类型" clearable @change="handleQuery">
- <el-option v-for="item in state.acceptTypeOptions" :value="item.dicDataValue" :key="item.dicDataValue" :label="item.dicDataName" />
- </el-select>
- </el-form-item>
- <el-form-item label="热点分类" prop="HotspotName">
- <el-input v-model.trim="state.queryParams.HotspotName" 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"
- />
- </el-form-item>
- <el-form-item label="当前节点" prop="CurrentStepCode">
- <el-select v-model="state.queryParams.CurrentStepCode" placeholder="请选择当前节点" clearable @change="handleQuery">
- <el-option v-for="item in state.currentStepOptions" :value="item.key" :key="item.key" :label="item.value" />
- </el-select>
- </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="Status">
- <el-select v-model="state.queryParams.Status" placeholder="请选择工单状态" clearable @change="handleQuery">
- <el-option v-for="item in state.orderStatusOptions" :value="item.key" :key="item.key" :label="item.value" />
- </el-select>
- </el-form-item>
- <el-form-item label="是否省工单" prop="IsProvince">
- <el-select v-model="state.queryParams.IsProvince" placeholder="请选择是否省工单" @change="handleQuery" clearable>
- <el-option label="是" value="true" />
- <el-option label="否" value="false" />
- </el-select>
- </el-form-item>
- <el-form-item label="是否延期" prop="Delay">
- <el-select v-model="state.queryParams.Delay" placeholder="请选择是否延期" @change="handleQuery" clearable>
- <el-option label="是" :value="1" />
- <el-option label="否" :value="2" />
- </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="businessOverdue">
- import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
- import { FormInstance } from 'element-plus';
- import { formatDate } from '@/utils/formatTime';
- import { exportOverdueList, overdueList } from '@/api/query/overdue';
- import { exportAssignment } from '@/utils/tools';
- import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
- import Other from '@/utils/other';
- import { listBaseData } from '@/api/business/order';
- import { departmentSatisfactionDetailBase } from '@/api/statistics/department';
- // 引入组件
- const OrderDetail = defineAsyncComponent(() => import('@/components/OrderDetail/index.vue')); // 工单详情
- const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
- // 定义变量内容
- const state = reactive<any>({
- queryParams: {
- // 查询条件
- PageIndex: 1,
- PageSize: 20,
- Title: null, // 关键字
- No: null, // 工单编码
- IsProvince: null, // 是否省工单
- Delay: null, // 是否延期
- SortField: null,
- SortRule: null,
- FromPhone:null, // 来电号码
- ActualHandleOrgName:null, // 接办部门
- AcceptType:null, // 受理类型
- HotspotName:null, // 热点
- crTime:[], // 受理时间
- CreationTimeStart:null,
- CreationTimeEnd:null,
- CurrentStepCode:null,
- doneTime:[], // 办结时间
- FiledTimeStart:null,
- FiledTimeEnd:null,
- Status:null,// 工单状态
- },
- tableData: [], //表单
- loading: false, // 加载
- total: 0, // 总数
- acceptTypeOptions: [], //受理类型
- channelOptions: [], // 来源频道
- orderStatusOptions: [], // 工单状态
- currentStepOptions: [], // 办理节点
- });
- // 排序
- const sortChange = (val: any) => {
- state.queryParams.SortField = val.order ? val.field : null;
- // 0 升序 1 降序
- state.queryParams.SortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
- handleQuery();
- };
- // 手动查询,将页码设置为1
- const handleQuery = () => {
- state.queryParams.PageIndex = 1;
- queryList();
- };
- /** 获取列表 */
- const requestParams = ref<EmptyObjectType>({});
- 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.FiledTimeStart = state.queryParams.doneTime === null ? null : state.queryParams.doneTime[0]; // 办结时间
- requestParams.value.FiledTimeEnd = state.queryParams.doneTime === null ? null : state.queryParams.doneTime[1];
- Reflect.deleteProperty(requestParams.value, 'doneTime'); // 删除无用的参数
- overdueList(requestParams.value)
- .then((res) => {
- state.tableData = res.result?.items ?? [];
- state.total = res.result?.total ?? 0;
- state.loading = false;
- tableRef.value.clearCheckboxRow();
- checkTable.value = [];
- })
- .catch((err) => {
- tableRef.value.clearCheckboxRow();
- checkTable.value = [];
- console.log(err);
- })
- .finally(() => {
- state.loading = false;
- });
- };
- // 交办单导出
- const onJbExport = () => {
- const ids = checkTable.value.map((item: any) => item.id);
- exportAssignment(ids)
- };
- const tableRef = ref<RefType>();
- const checkTable = ref<EmptyArrayType>([]);
- const selectAllChangeEvent = ({ checked }) => {
- if (tableRef.value) {
- const records = tableRef.value.getCheckboxRecords();
- checkTable.value = records;
- console.log(checked ? '所有勾选事件' : '所有取消事件', records);
- }
- };
- const selectChangeEvent = ({ checked }) => {
- if (tableRef.value) {
- const records = tableRef.value.getCheckboxRecords();
- checkTable.value = records;
- console.log(checked ? '勾选事件' : '取消事件', records);
- }
- };
- const isChecked = computed(() => {
- return !Boolean(checkTable.value.length);
- });
- /** 重置按钮操作 */
- 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();
- handleQuery();
- };
- // 获取查询基础数据
- const getBaseData = async () => {
- try {
- const res: any = await departmentSatisfactionDetailBase();
- const mappings: any = {
- acceptTypeOptions: 'acceptTypeOptions',
- channelOptions: 'channelOptions',
- orderStatusOptions: 'orderStatusOptions',
- currentStepOptions: 'currentStepOptions',
- };
- for (const key in mappings) {
- state[key] = res.result?.[mappings[key]] ?? [];
- }
- }catch (e){
- console.log(e);
- }
- }
- const toolbarRef = ref<RefType>();
- onMounted(() => {
- queryList();
- if (tableRef.value && toolbarRef.value) {
- tableRef.value.connect(toolbarRef.value);
- }
- getBaseData();
- });
- </script>
|