From 324eed59a668758755219d5cd4e68463a9cc427d Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期三, 14 九月 2022 15:22:36 +0800
Subject: [PATCH] Default Changelist
---
src/views/specialWorkSystem/workTicket/myJobApply/index.vue | 86 ++++++++++++++++++++++++++++++++++++++----
1 files changed, 77 insertions(+), 9 deletions(-)
diff --git a/src/views/specialWorkSystem/workTicket/myJobApply/index.vue b/src/views/specialWorkSystem/workTicket/myJobApply/index.vue
index 0a00e50..bd1a108 100644
--- a/src/views/specialWorkSystem/workTicket/myJobApply/index.vue
+++ b/src/views/specialWorkSystem/workTicket/myJobApply/index.vue
@@ -4,7 +4,8 @@
<!-- <el-tab-pane label="申请中" name="1">-->
<div style="height: 100%">
<el-row class="homeCard">
- <el-col :span="8">
+ <span>作业类型:</span>
+ <el-col :span="10">
<div class="grid-content topInfo">
<el-select v-model="searchWord">
<el-option
@@ -37,9 +38,9 @@
<el-table-column property="workTypeDesc" label="作业类型" />
<el-table-column property="workLevelDesc" label="作业等级" />
<el-table-column property="applyTime" label="申请时间" width="180" />
- <el-table-column label="申请状态" width="180">
+ <el-table-column label="申请状态" align="center" width="180">
<template #default="scope">
- <el-tag type="success">{{ scope.row.statusDesc }}</el-tag>
+ <el-tag :type="scope.row.status==2?'success':(scope.row.status==8||scope.row.status==9)?'warning':'danger'">{{ scope.row.statusDesc }}</el-tag>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" align="center" width="250">
@@ -47,6 +48,7 @@
<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>
</el-table>
@@ -138,13 +140,22 @@
</div>
</div>
</el-dialog>
- <el-dialog v-model="deleteDialog" title="提示" width="30%" center @close="indexClear">
+ <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>
+ <span class="dialog-footer">
+ <el-button @click="downLoadDialog = false" size="default">取消</el-button>
+ <el-button type="primary" @click="conFirmDownLoad" size="default">确认</el-button>
+ </span>
</template>
</el-dialog>
<!-- </el-tab-pane>-->
@@ -192,12 +203,14 @@
import { useUserInfo } from '/@/stores/userInfo';
import { Session } from '/@/utils/storage';
import { useRouter } from 'vue-router';
-import { Edit, View, Plus, Delete, Refresh, Search, Finished } from '@element-plus/icons-vue';
+import { Edit, View, Plus, Delete, Refresh, Search, Finished, Download } from '@element-plus/icons-vue';
import { ElTable } from 'element-plus';
import { FormInstance, FormRules, ElMessage } from 'element-plus';
import { workApplyApi } from '/@/api/specialWorkSystem/workApply';
import type { TabsPaneContext } from 'element-plus';
import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage";
+import Cookies from 'js-cookie';
+import axios from 'axios';
// 定义接口来定义对象的类型
interface stateType {
@@ -209,10 +222,13 @@
dialogDetails: boolean;
dialogStatus: boolean;
deleteDialog: boolean;
+ downLoadDialog: boolean;
pageIndex1: number;
pageSize1: number;
chosenIndex: null | number;
deleteId: null | number;
+ downLoadId: null | number;
+ downLoadName: string;
searchWord: string;
totalSize1: number;
activeName: string;
@@ -268,10 +284,13 @@
dialogDetails: false,
dialogStatus: false,
deleteDialog: false,
+ downLoadDialog: false,
addRecord: {},
details: {},
statusInfo: {},
deleteId: null,
+ downLoadId: null,
+ downLoadName: '',
deleteArr: [],
workType: [
{ id: 1, name: '动火作业' },
@@ -303,7 +322,6 @@
};
const handleClick = (tab: TabsPaneContext, event: Event) => {
- console.log(tab, event);
};
// 获取部门列表
@@ -400,7 +418,6 @@
if (res.data.code === '200') {
state.approveInfo = JSON.parse(JSON.stringify(res.data.data));
state.approveInfo.operators = Array.from(state.approveInfo.operators, ({ operatorUname }) => operatorUname);
- console.log(state.approveInfo, 'steps');
} else {
ElMessage({
type: 'warning',
@@ -436,6 +453,41 @@
state.deleteDialog = false;
};
+ // 导出
+ const downLoadBtn = (row:any) =>{
+ state.downLoadId = row.workApplyId;
+ state.downLoadName = row.workTypeDesc + row.workPermitNo
+ state.downLoadDialog = true;
+ }
+
+ // 导出方法
+ const downLoadRecord = async (data: any) => {
+ // let res = await workApplyApi().postPrinting(data);
+ axios.post(import.meta.env.VITE_API_URL + `/work/apply/printing`,data,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{
+ if (res) {
+ const link = document.createElement('a')
+ let blob = new Blob([res.data],{type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'})
+ link.style.display = "none";
+ link.href = URL.createObjectURL(blob); // 创建URL
+ link.setAttribute("download", state.downLoadName + "作业证.docx");
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ } else {
+ ElMessage({
+ type: 'warning',
+ message: res.data.msg
+ });
+ }
+ })
+
+ };
+
+ const conFirmDownLoad = () => {
+ downLoadRecord({ applyWorkId: state.downLoadId });
+ state.downLoadDialog = false;
+ };
+
const handleSizeChange1 = (val: number) => {
state.pageSize1 = val;
getListByPage();
@@ -453,7 +505,6 @@
state.details.workDetail.otherSpecialWork=[]
}
else {
- console.log(state.details.workDetail.otherSpecialWork,'split')
const a = state.details.workDetail.otherSpecialWork
state.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
return state.workType.find((i: { id: number }) => i.id === Number(item))?.name;
@@ -468,7 +519,21 @@
return state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(item))?.depName;
});
}
- console.log(state.details,'details')
+ if(state.details.workDetail.csDepId){
+ state.details.workDetail.csDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.csDepId))?.depName;
+ }
+ if(state.details.workDetail.operationDepId){
+ state.details.workDetail.operationDepId = state.departmentRecursionList.find((i: { depId: number }) => i.depId === Number(state.details.workDetail.operationDepId))?.depName;
+ }
+ if(state.details.workDetail.gbPath){
+ state.details.workDetail.gbPath = state.details.workDetail.gbPath.split(',')
+ }
+ if(state.details.workDetail.bcPath){
+ state.details.workDetail.bcPath = state.details.workDetail.bcPath.split(',')
+ }
+ if(state.details.workDetail.bpLocationMapPath){
+ state.details.workDetail.bpLocationMapPath = state.details.workDetail.bpLocationMapPath.split(',')
+ }
state.dialogDetails = true;
};
@@ -492,6 +557,7 @@
Refresh,
Plus,
Finished,
+ Download,
reLoadData,
toApply,
handleClick,
@@ -501,7 +567,9 @@
viewRecord,
viewStatus,
deleteRecordBtn,
+ downLoadBtn,
conFirmDelete,
+ conFirmDownLoad,
getListByPage,
handleSizeChange1,
handleCurrentChange1,
--
Gitblit v1.9.2