|
@@ -1,13 +1,22 @@
|
|
|
<template>
|
|
|
<div class="tels-restApply-container layout-padding">
|
|
|
<div class="layout-padding-auto layout-padding-view pd20">
|
|
|
- <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent >
|
|
|
- <el-form-item label="关键词" prop="KeyWords">
|
|
|
- <el-input v-model="state.queryParams.KeyWords" placeholder="坐席名称/工号" clearable @keyup.enter="queryList" />
|
|
|
+ <el-tabs v-model="state.queryParams.Type" @tab-change="handleQuery">
|
|
|
+ <el-tab-pane :name="0" label="待审批" :disabled="state.loading"></el-tab-pane>
|
|
|
+ <el-tab-pane :name="1" label="已审批" :disabled="state.loading"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ <el-form :model="state.queryParams" ref="ruleFormRef" inline @submit.native.prevent>
|
|
|
+ <el-form-item label="申请人" prop="ApplyUserName">
|
|
|
+ <el-input v-model="state.queryParams.ApplyUserName" placeholder="申请人" clearable @keyup.enter="handleQuery" class="keyword-input" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="申请时间" prop="time">
|
|
|
+ <el-form-item label="小休原因" prop="ReasonId">
|
|
|
+ <el-select v-model="state.queryParams.ReasonId" placeholder="请选择小休原因" @change="handleQuery" clearable>
|
|
|
+ <el-option v-for="item in state.restReason" :key="item.dicDataValue" :label="item.dicDataName" :value="item.dicDataValue" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="申请时间" prop="crTime">
|
|
|
<el-date-picker
|
|
|
- v-model="state.queryParams.time"
|
|
|
+ v-model="state.queryParams.crTime"
|
|
|
type="datetimerange"
|
|
|
range-separator="至"
|
|
|
start-placeholder="开始时间"
|
|
@@ -15,29 +24,14 @@
|
|
|
value-format="YYYY-MM-DD[T]HH:mm:ss"
|
|
|
:shortcuts="shortcuts"
|
|
|
:default-time="defaultTimeStartEnd"
|
|
|
- @change="
|
|
|
- (val: any[]) => {
|
|
|
- state.queryParams.BeginTime = val[0];
|
|
|
- state.queryParams.EndTime = val[1];
|
|
|
- }
|
|
|
- "
|
|
|
+ @change="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="小休原因" prop="Reason">
|
|
|
- <el-select v-model="state.queryParams.Reason" placeholder="请选择小休原因" class="w100">
|
|
|
- <el-option v-for="item in state.restReason" :key="item.id" :label="item.content" :value="item.content" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="审批状态" prop="Status">
|
|
|
- <el-select v-model="state.queryParams.Status" placeholder="请选择审批状态" class="w100">
|
|
|
- <el-option v-for="item in state.restApplyStatus" :key="item.key" :label="item.value" :value="item.key" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="handleQuery" :loading="state.loading" v-waves> <SvgIcon name="ele-Search" class="mr5" />查询 </el-button>
|
|
|
- <el-button @click="resetQuery(ruleFormRef)" v-waves class="default-button" :loading="state.loading">
|
|
|
- <SvgIcon name="ele-Refresh" class="mr5" />重置
|
|
|
- </el-button>
|
|
|
+ <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" :loading="state.loading">
|
|
|
+ <SvgIcon name="ele-Search" class="mr5" />更多查询</el-button
|
|
|
+ >
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<vxe-toolbar
|
|
@@ -47,7 +41,19 @@
|
|
|
:refresh="{
|
|
|
queryMethod: handleQuery,
|
|
|
}"
|
|
|
+ :tools="[{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }]"
|
|
|
>
|
|
|
+ <template #buttons>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="onAuditBatch"
|
|
|
+ :disabled="isChecked"
|
|
|
+ :loading="state.loading"
|
|
|
+ v-auth="'tels:restApply:audit:batch'"
|
|
|
+ v-if="state.queryParams.Type === 0"
|
|
|
+ >批量审批</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</vxe-toolbar>
|
|
|
<div style="overflow: hidden; width: 100%; height: 100%; flex: 1">
|
|
|
<vxe-table
|
|
@@ -62,43 +68,32 @@
|
|
|
auto-resize
|
|
|
show-overflow
|
|
|
:scrollY="{ enabled: true, gt: 100 }"
|
|
|
- id="restApply"
|
|
|
+ id="telsRestApply"
|
|
|
:custom-config="{ storage: true }"
|
|
|
+ :params="{ exportMethod: restApplyExport, exportParams: requestParams }"
|
|
|
+ @sort-change="sortChange"
|
|
|
+ @checkbox-all="selectAllChangeEvent"
|
|
|
+ @checkbox-change="selectChangeEvent"
|
|
|
>
|
|
|
-
|
|
|
- <vxe-column field="userName" title="坐席" width="140"></vxe-column>
|
|
|
- <vxe-column field="creationTime" title="申请时间" sortable width="160">
|
|
|
+ <vxe-column type="checkbox" width="50" align="center"></vxe-column>
|
|
|
+ <vxe-column field="reason" title="小休原因"></vxe-column>
|
|
|
+ <vxe-column field="applyUserName" title="申请人"></vxe-column>
|
|
|
+ <vxe-column field="applyTime" title="申请时间" sortable width="160">
|
|
|
<template #default="{ row }">
|
|
|
- {{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
+ {{ formatDate(row.applyTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column field="creationTime" title="开始时间" sortable width="160">
|
|
|
+ <vxe-column field="auditStatusText" title="审核结果"> </vxe-column>
|
|
|
+ <vxe-column field="auditOpinion" title="审核意见" min-width="140"></vxe-column>
|
|
|
+ <vxe-column field="auditUserName" title="审核人" min-width="140"></vxe-column>
|
|
|
+ <vxe-column field="auditTime" title="审核时间" sortable width="160">
|
|
|
<template #default="{ row }">
|
|
|
- {{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
+ {{ formatDate(row.auditTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column field="creationTime" title="结束时间" sortable width="160">
|
|
|
+ <vxe-column title="操作" fixed="right" width="90" align="center">
|
|
|
<template #default="{ row }">
|
|
|
- {{ formatDate(row.creationTime, 'YYYY-mm-dd HH:MM:SS') }}
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- <vxe-column field="restDuration" title="时长(分钟)" width="140">
|
|
|
- <template #default="{ row }">
|
|
|
- {{ (row.restDuration / 60).toFixed(2) }}
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- <vxe-column field="applyStatus" title="审批状态" width="140">
|
|
|
- <template #default="{ row }">
|
|
|
- {{ state.restApplyStatus[row.applyStatus].value }}
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- <vxe-column field="restReason" title="小休原因" min-width="140"></vxe-column>
|
|
|
- <vxe-column title="操作" fixed="right" width="140" align="center">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-button link type="primary" @click="onRecord(row)" v-auth="'system:workflow:record'" title="审批记录" v-if="row.workflowId">
|
|
|
- 审批记录
|
|
|
- </el-button>
|
|
|
- <el-button link type="primary" @click="onSubmit(row)" v-auth="'system:workflow:handle'" title="审批" v-if="[0].includes(row.applyStatus)">
|
|
|
+ <el-button link type="primary" @click="onAudit(row)" v-auth="'tels:restApply:audit'" title="审批" v-if="[0].includes(row.auditStatus)">
|
|
|
审批
|
|
|
</el-button>
|
|
|
</template>
|
|
@@ -113,24 +108,53 @@
|
|
|
:disabled="state.loading"
|
|
|
/>
|
|
|
</div>
|
|
|
- <!-- 流程审配 -->
|
|
|
- <process-audit ref="processAuditRef" @orderProcessSuccess="orderProcessSuccess" />
|
|
|
- <!-- 流转记录 -->
|
|
|
- <audit-record ref="AuditRecordRef" />
|
|
|
+ <!-- 更多查询 -->
|
|
|
+ <el-drawer v-model="drawer" title="更多查询" size="500px">
|
|
|
+ <el-form :model="state.queryParams" ref="drawerRuleFormRef" @submit.native.prevent label-width="100px" :disabled="state.loading">
|
|
|
+ <template v-if="state.queryParams.Type === 1">
|
|
|
+ <el-form-item label="审批状态" prop="AuditStatus">
|
|
|
+ <el-select v-model="state.queryParams.AuditStatus" placeholder="请选择审批状态" class="w100" @change="handleQuery" clearable>
|
|
|
+ <el-option v-for="item in state.restApplyStatus" :key="item.key" :label="item.value" :value="item.key" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审批人" prop="AuditUserName">
|
|
|
+ <el-input v-model="state.queryParams.AuditUserName" placeholder="审批人" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="审批时间" prop="spTime">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="state.queryParams.spTime"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始时间"
|
|
|
+ end-placeholder="结束时间"
|
|
|
+ value-format="YYYY-MM-DD[T]HH:mm:ss"
|
|
|
+ :shortcuts="shortcuts"
|
|
|
+ :default-time="defaultTimeStartEnd"
|
|
|
+ @change="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ </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>
|
|
|
+ <!-- 审核 -->
|
|
|
+ <rest-audit ref="restAuditRef" @updateList="queryList" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang="tsx" setup name="restApply">
|
|
|
-import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
|
|
+<script lang="tsx" setup name="telsRestApply">
|
|
|
+import { computed, defineAsyncComponent, onMounted, reactive, ref } from 'vue';
|
|
|
import type { FormInstance } from 'element-plus';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
-import { baseData, restApplyPaged } from '@/api/tels/restApply';
|
|
|
+import { restBaseData, restApplyExport, restApplyPaged } from '@/api/tels/restApply';
|
|
|
import { debounce } from '@/utils/tools';
|
|
|
-import { commonEnum, defaultTimeStartEnd, shortcuts } from "@/utils/constants";
|
|
|
-import other from '@/utils/other';
|
|
|
+import { defaultTimeStartEnd, shortcuts } from '@/utils/constants';
|
|
|
+import Other from '@/utils/other';
|
|
|
// 引入组件
|
|
|
-const AuditRecord = defineAsyncComponent(() => import('@/components/AuditRecord/index.vue')); // 流转记录
|
|
|
-const ProcessAudit = defineAsyncComponent(() => import('@/components/ProcessAudit/index.vue')); // 审批流程
|
|
|
+const RestAudit = defineAsyncComponent(() => import('@/views/tels/restApply/components/Audit.vue')); // 审批
|
|
|
const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
|
|
|
|
|
|
// 定义变量内容
|
|
@@ -138,12 +162,19 @@ const state = reactive<any>({
|
|
|
queryParams: {
|
|
|
PageIndex: 1, // 当前页码
|
|
|
PageSize: 10, // 每页条数
|
|
|
- KeyWords: null, // 关键字
|
|
|
- Reason: null, // 小休原因
|
|
|
- Status: null, // 审批状态
|
|
|
- time: [], // 申请时间
|
|
|
- BeginTime: null, // 开始时间
|
|
|
- EndTime: null, // 结束时间
|
|
|
+ Type: 0, // 默认待审批
|
|
|
+ ApplyUserName: null, // 申请人
|
|
|
+ ReasonId: null, // 小休原因
|
|
|
+ crTime: [], // 申请时间
|
|
|
+ ApplyStartTime: null, // 开始时间
|
|
|
+ ApplyEndTime: null, // 结束时间
|
|
|
+ AuditStatus: null, // 审批状态
|
|
|
+ AuditUserName: null, // 审批人
|
|
|
+ spTime: [], // 审批时间
|
|
|
+ AuditStartTime: null, // 审批开始时间
|
|
|
+ AuditEndTime: null, // 审批结束时间
|
|
|
+ SortRule: null, // 排序规则
|
|
|
+ SortField: null, // 排序字段
|
|
|
},
|
|
|
loading: false, // 加载状态
|
|
|
total: 0, // 总条数
|
|
@@ -153,71 +184,95 @@ const state = reactive<any>({
|
|
|
});
|
|
|
const ruleFormRef = ref<FormInstance>(); // 表单实例
|
|
|
/** 搜索按钮操作 节流操作 */
|
|
|
-const handleQuery = debounce(() => {
|
|
|
+const handleQuery = () => {
|
|
|
state.queryParams.PageIndex = 1;
|
|
|
queryList();
|
|
|
-}, 300);
|
|
|
-const orderProcessSuccess = () => {
|
|
|
- console.log('审批成功');
|
|
|
- handleQuery();
|
|
|
};
|
|
|
/** 获取用户列表 */
|
|
|
+const requestParams = ref<EmptyObjectType>({});
|
|
|
const queryList = () => {
|
|
|
state.loading = true;
|
|
|
- let request = other.deepClone(state.queryParams);
|
|
|
- Reflect.deleteProperty(request, 'time'); // 删除无用的参数
|
|
|
- restApplyPaged(request)
|
|
|
+ requestParams.value = Other.deepClone(state.queryParams);
|
|
|
+ requestParams.value.ApplyStartTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[0];
|
|
|
+ requestParams.value.ApplyEndTime = state.queryParams.crTime === null ? null : state.queryParams.crTime[1];
|
|
|
+ Reflect.deleteProperty(requestParams.value, 'crTime'); // 申请时间
|
|
|
+ requestParams.value.AuditStartTime = state.queryParams.spTime === null ? null : state.queryParams.spTime[0];
|
|
|
+ requestParams.value.AuditEndTime = state.queryParams.spTime === null ? null : state.queryParams.spTime[1];
|
|
|
+ Reflect.deleteProperty(requestParams.value, 'spTime'); // 审批时间
|
|
|
+ restApplyPaged(requestParams.value)
|
|
|
.then((response: any) => {
|
|
|
state.tableData = response?.result.items;
|
|
|
state.total = response?.result.total;
|
|
|
+ tableRef.value?.clearCheckboxRow();
|
|
|
+ checkTable.value = [];
|
|
|
state.loading = false;
|
|
|
})
|
|
|
.catch(() => {
|
|
|
state.loading = false;
|
|
|
});
|
|
|
};
|
|
|
+// 排序
|
|
|
+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();
|
|
|
+};
|
|
|
/** 重置按钮操作 */
|
|
|
+const drawer = ref(false);
|
|
|
+const drawerRuleFormRef = ref();
|
|
|
const resetQuery = debounce((formEl: FormInstance | undefined) => {
|
|
|
if (!formEl) return;
|
|
|
- state.queryParams.BeginTime = null;
|
|
|
- state.queryParams.EndTime = null;
|
|
|
formEl.resetFields();
|
|
|
+ ruleFormRef.value?.resetFields();
|
|
|
handleQuery();
|
|
|
}, 300);
|
|
|
-// 办理 下一步
|
|
|
-const processAuditRef = ref<RefType>();
|
|
|
-const onSubmit = debounce((row: any) => {
|
|
|
- const params = {
|
|
|
- id: row.workflowId,
|
|
|
- commonEnum: commonEnum.OrderCirculation,
|
|
|
- processType: '小休办理',
|
|
|
- extra: {
|
|
|
- dialogTitle: '小休办理',
|
|
|
- inputPlaceholder: '办理意见',
|
|
|
- annexName: '办理附件',
|
|
|
- },
|
|
|
- };
|
|
|
- processAuditRef.value.openDialog(params);
|
|
|
-}, 1000);
|
|
|
-// 审核记录
|
|
|
-const AuditRecordRef = ref<RefType>();
|
|
|
-const onRecord = (row: any) => {
|
|
|
- const params = {
|
|
|
- dialogTitle: '审核记录 (小休申请)',
|
|
|
- ...row,
|
|
|
- };
|
|
|
- console.log(params);
|
|
|
- AuditRecordRef.value.openDialog(params);
|
|
|
+// 审核
|
|
|
+const restAuditRef = ref<RefType>();
|
|
|
+const onAudit = (row: any) => {
|
|
|
+ restAuditRef.value.openDialog([row.id]);
|
|
|
+};
|
|
|
+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 !checkTable.value.length;
|
|
|
+});
|
|
|
+// 批量审批
|
|
|
+const onAuditBatch = () => {
|
|
|
+ const ids = checkTable.value.map((row: any) => row.id);
|
|
|
+ restAuditRef.value.openDialog(ids);
|
|
|
};
|
|
|
// 获取基础数据
|
|
|
const baseDataFn = () => {
|
|
|
- baseData().then((res: any) => {
|
|
|
- state.restApplyStatus = res.result?.restApplyStatus;
|
|
|
+ restBaseData().then((res: any) => {
|
|
|
+ state.restApplyStatus = res.result?.auditStatus;
|
|
|
+ state.restApplyStatus = state.restApplyStatus.filter((item: any) => {
|
|
|
+ return [1, 2].includes(item.key);
|
|
|
+ });
|
|
|
state.restReason = res.result?.restReason;
|
|
|
- queryList();
|
|
|
});
|
|
|
};
|
|
|
+const toolbarRef = ref<RefType>();
|
|
|
+const tableRef = ref<RefType>();
|
|
|
onMounted(() => {
|
|
|
+ queryList();
|
|
|
baseDataFn();
|
|
|
+ if (tableRef.value && toolbarRef.value) {
|
|
|
+ tableRef.value.connect(toolbarRef.value);
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|