From aa2e3f4435dc4d12da4cb4bd282ba0daa1b3cb6d Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期一, 26 九月 2022 11:13:27 +0800
Subject: [PATCH] Default Changelist

---
 src/views/specialWorkSystem/workTicket/allApplys/index.vue |   91 ++++++++++++++++-----------------------------
 1 files changed, 33 insertions(+), 58 deletions(-)

diff --git a/src/views/specialWorkSystem/workTicket/allApplys/index.vue b/src/views/specialWorkSystem/workTicket/allApplys/index.vue
index a720953..8da1a5c 100644
--- a/src/views/specialWorkSystem/workTicket/allApplys/index.vue
+++ b/src/views/specialWorkSystem/workTicket/allApplys/index.vue
@@ -23,13 +23,17 @@
                                 <el-cascader v-model="searchDep" :options="departmentList" :props="casProps" :show-all-levels="false"/>
                             </div>
                         </el-col>
-                        <el-col :span="5" style="display:flex;align-items: center;">
+                        <el-col :span="8" style="display:flex;align-items: center;">
                             <span style="white-space: nowrap;margin-left: 20px">申请时间:</span>
                             <div class="grid-content topInfo">
                                 <el-date-picker
                                         v-model="searchDate"
-                                        type="date"
-                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD"
+                                        type="daterange"
+                                        unlink-panels
+                                        range-separator="至"
+                                        start-placeholder="开始日期"
+                                        end-placeholder="结束日期"
+                                        format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss"
                                 />
                             </div>
                         </el-col>
@@ -63,7 +67,6 @@
                                     <template #default="scope">
                                         <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button>
                                         <el-button link type="success" size="small" :icon="Finished" @click="viewStatus(scope.row)">进度</el-button>
-                                        <el-button link type="warning" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">取消</el-button>
                                         <el-button link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出</el-button>
                                     </template>
                                 </el-table-column>
@@ -156,15 +159,6 @@
                         </div>
                     </div>
                 </el-dialog>
-                <el-dialog v-model="deleteDialog" title="提示" width="30%" center>
-                    <span>您确定要取消该条申请吗?</span>
-                    <template #footer>
-                        <span class="dialog-footer">
-                            <el-button @click="deleteDialog = false" size="default">取消</el-button>
-                            <el-button type="primary" @click="conFirmDelete" size="default">确认</el-button>
-                        </span>
-                    </template>
-                </el-dialog>
                 <el-dialog v-model="downLoadDialog" title="提示" width="30%" center>
                     <span>您确定要导出该条记录吗?</span>
                     <template #footer>
@@ -246,9 +240,9 @@
     deleteId: null | number;
     downLoadId: null | number;
     downLoadName: string;
-    searchWord: string;
+    searchWord: number | null;
     searchDep: number | null;
-    searchDate: string;
+    searchDate: Array<any>,
     totalSize1: number;
     activeName: string;
     addRecord: {};
@@ -292,9 +286,9 @@
             departmentList: [],
             departmentRecursionList: [],
             chosenIndex: null,
-            searchWord: '',
+            searchWord: null,
             searchDep: null,
-            searchDate: '',
+            searchDate: [],
             applyData: [],
             workTimeList: [],
             multipleSelection: [],
@@ -357,7 +351,7 @@
             let res = await teamManageApi().getAllDepartment();
             if (res.data.code === '200') {
                 state.departmentList = JSON.parse(JSON.stringify(res.data.data))
-                recursion(state.departmentList);
+                // recursion(state.departmentList);
             } else {
                 ElMessage({
                     type: 'warning',
@@ -366,21 +360,23 @@
             }
         };
 
-        const recursion = (value: any) => {
-            for (let i of value) {
-                if (i.children.length !== 0) {
-                    state.departmentRecursionList.push(i);
-                    recursion(i.children);
-                } else {
-                    state.departmentRecursionList.push(i);
-                }
-            }
-        };
+        // const recursion = (value: any) => {
+        //     for (let i of value) {
+        //         if (i.children.length !== 0) {
+        //             state.departmentRecursionList.push(i);
+        //             recursion(i.children);
+        //         } else {
+        //             state.departmentRecursionList.push(i);
+        //         }
+        //     }
+        // };
 
-        // 分页获取工作时间组列表
+        // 分页获取列表
         const getListByPage = async () => {
-            const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord } };
-            let res = await workApplyApi().getApplyListPage(data);
+            const dateRange = JSON.parse(JSON.stringify(state.searchDate))
+            if(dateRange[1]){dateRange[1] = dateRange[1].replace('00:00:00','23:59:59')}
+            const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord, applyDepId: state.searchDep,applyStartTime: dateRange[0],applyEndTime: dateRange[1]} };
+            let res = await workApplyApi().getApplyList(data);
             if (res.data.code === '200') {
                 state.applyData = JSON.parse(JSON.stringify(res.data.data));
                 state.applyData = state.applyData.map((item) => {
@@ -419,7 +415,7 @@
 
         // 关键词查询记录
         const searchRecord = async () => {
-            if (state.searchWord == ''&& state.searchDep == null && state.searchDate == '') {
+            if (state.searchWord == null && state.searchDep == null && state.searchDate == '') {
                 ElMessage({
                     type: 'warning',
                     message: '请输入查询关键词'
@@ -430,14 +426,15 @@
         };
         // 重置搜索
         const clearSearch = async () => {
-            state.searchWord = '';
+            state.searchWord = null;
+            state.searchDep = null;
+            state.searchDate = ''
             getListByPage();
         };
 
         // 查看进度
         const viewStatus = (row) => {
             getStatus({ workApplyId: row.workApplyId });
-            state.dialogStatus = true;
         };
 
         // 查询进度方法
@@ -446,6 +443,7 @@
             if (res.data.code === '200') {
                 state.approveInfo = JSON.parse(JSON.stringify(res.data.data));
                 state.approveInfo.operators = Array.from(state.approveInfo.operators, ({ operatorUname }) => operatorUname);
+                state.dialogStatus = true;
             } else {
                 ElMessage({
                     type: 'warning',
@@ -457,28 +455,6 @@
         const deleteRecordBtn = (row) => {
             state.deleteId = row.workApplyId;
             state.deleteDialog = true;
-        };
-
-        // 取消申请方法
-        const deleteRecord = async (data: any) => {
-            let res = await workApplyApi().cancelApply(data);
-            if (res.data.code === '200') {
-                ElMessage({
-                    type: 'success',
-                    message: '删除成功!'
-                });
-                getListByPage();
-            } else {
-                ElMessage({
-                    type: 'warning',
-                    message: res.data.msg
-                });
-            }
-        };
-
-        const conFirmDelete = () => {
-            deleteRecord({ workApplyId: state.deleteId });
-            state.deleteDialog = false;
         };
 
         // 导出图表
@@ -504,7 +480,7 @@
                 } else {
                     ElMessage({
                         type: 'warning',
-                        message: res.data.msg
+                        message: '导出失败'
                     });
                 }
             })
@@ -596,7 +572,6 @@
             viewStatus,
             deleteRecordBtn,
             downLoadBtn,
-            conFirmDelete,
             conFirmDownLoad,
             getListByPage,
             handleSizeChange1,

--
Gitblit v1.9.2