From d91fd1557ebed3e9bcb8c051c71b9d41c0e36eef Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期二, 02 四月 2024 16:50:07 +0800 Subject: [PATCH] Default Changelist --- src/views/newSpecialWorkSystem/workTicket/sqjl/index.vue | 171 +++++++++++++++++++++++++++++++++------------------------ 1 files changed, 99 insertions(+), 72 deletions(-) diff --git a/src/views/newSpecialWorkSystem/workTicket/sqjl/index.vue b/src/views/newSpecialWorkSystem/workTicket/sqjl/index.vue index dcd2db8..20a5ac3 100644 --- a/src/views/newSpecialWorkSystem/workTicket/sqjl/index.vue +++ b/src/views/newSpecialWorkSystem/workTicket/sqjl/index.vue @@ -4,34 +4,57 @@ <!-- <el-tab-pane label="申请中" name="1">--> <div style="height: 100%"> <el-row class="homeCard"> + <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> + <span>时间筛选:</span> + <el-date-picker v-model="timeRange" value-format="YYYY-MM-DD" type="daterange" @change="giveTime()" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" /> + </div> + <div class="basic-line" style="display:flex;white-space:nowrap;line-height: 40px"> + <span>负责人:</span> + <el-input v-model="searPara.headUserName" placeholder="负责人"/> + </div> + <div class="basic-line"> + <span>事业部:</span> + <el-select v-model="searPara.secondDepId"> + <el-option + v-for="item in dep4List" + :key="item.id" + :label="item.name" + :value="item.id" + /> + </el-select> + </div> + <div class="basic-line"> <span>作业类型:</span> - <el-col :span="10"> - <div class="grid-content topInfo"> - <el-select v-model="searchWord"> - <el-option - v-for="item in workType" - :key="item.id" - :label="item.name" - :value="item.id" - /> - </el-select> - - <el-button type="primary" @click="searchRecord">查询</el-button> - <el-button plain @click="clearSearch">重置</el-button> - </div> - </el-col> + <el-select v-model="searPara.workType"> + <el-option + v-for="item in workType" + :key="item.id" + :label="item.name" + :value="item.id" + /> + </el-select> + </div> + <div style="margin-left: 20px"> + <el-button type="primary" @click="searchRecord">查询</el-button> + <el-button plain @click="clearSearch">重置</el-button> + </div> </el-row> <div class="homeCard"> <div class="main-card"> <el-row class="cardTop"> <el-col :span="12" class="mainCardBtn"> - <el-button type="primary" :icon="Plus" size="default" @click="toApply()">申请</el-button> + <el-button type="primary" :icon="Plus" size="default" @click="toApply()">新增申报</el-button> <!-- <el-button type="danger" :icon="Delete" size="default">删除</el-button>--> <!-- <el-button type="success" size="default">设置分类</el-button>--> </el-col> <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData()" /> </el-row> <el-table ref="multipleTableRef" :data="applyData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }"> + <el-table-column property="workPermitNo" label="作业编号" align="center"> + <template #default="scope"> + {{scope.row.workPermitNo?scope.row.workPermitNo:'—'}} + </template> + </el-table-column> <el-table-column property="seDepName" label="事业部" align="center"/> <el-table-column property="applyDepName" label="作业所在车间" align="center"/> <el-table-column property="workContent" label="作业内容" align="center"/> @@ -69,18 +92,18 @@ {{scope.row.guardianList.length}} </template> </el-table-column> - <el-table-column label="风险研判" align="center"> + <el-table-column label="作业状态" align="center"> <template #default="scope"> <el-tag>{{ statusList.find(i=>i.value === scope.row.status)?.label }}</el-tag> </template> </el-table-column> <el-table-column fixed="right" label="操作" align="center" width="300"> <template #default="scope"> - <el-button link type="danger" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">作废</el-button> +<!-- <el-button link type="danger" size="small" :icon="Delete" @click="deleteRecordBtn(scope.row)">作废</el-button>--> <el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button> - <el-button link type="success" size="small" :icon="Finished">修改</el-button> - <el-button link type="success" size="small" :icon="Download">正式办票</el-button> -<!-- <el-button :disabled="scope.row.status == 7 ? false : true" link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出作业票</el-button>--> +<!-- <el-button link type="success" size="small" :icon="Finished">修改</el-button>--> +<!-- <el-button link type="success" size="small" :icon="Download">正式办票</el-button>--> + <el-button link type="primary" size="small" :icon="Download" @click="downLoadRecord(scope.row)">作业票预览</el-button> </template> </el-table-column> </el-table> @@ -185,15 +208,15 @@ </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-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>--> <!-- <el-tab-pane label="已通过" name="2">--> <!-- <div style="height: 100%">--> @@ -258,14 +281,10 @@ 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; addRecord: {}; @@ -276,6 +295,9 @@ departmentList: Array<any>; departmentRecursionList: Array<DepartmentState>; statusList: Array<any>; + dep4List: Array<type>; + searPara: {} + timeRange: Array<string>; } interface type { id: number; @@ -303,7 +325,13 @@ departmentList: [], departmentRecursionList: [], chosenIndex: null, - searchWord: '', + searPara:{ + startTime: '', + endTime: '', + workType: null, + headUserName: '', + secondDepId: null + }, applyData: [], workTimeList: [], multipleSelection: [], @@ -314,14 +342,17 @@ dialogDetails: false, dialogStatus: false, deleteDialog: false, - downLoadDialog: false, addRecord: {}, details: {}, statusInfo: {}, deleteId: null, - downLoadId: null, - downLoadName: '', deleteArr: [], + dep4List: [ + {id:49,name:'电石事业部'}, + {id:50,name:'电力事业部'}, + {id:48,name:'有机化工事业部'}, + {id:32,name:'甲醇事业部'} + ], workType: [ { id: 1, name: '动火作业' }, { id: 2, name: '受限空间作业' }, @@ -377,13 +408,19 @@ value: 9, label: '安全措施确认,培训交底中' } - ] + ], + timeRange: [] }); - interface User { - name: string; - list: []; - info: string; + + const giveTime = () => { + if (state.timeRange && state.timeRange !== null) { + state.searPara.startTime = state.timeRange[0]; + state.searPara.endTime = state.timeRange[1]; + } else { + state.searPara.startTime = ''; + state.searPara.endTime = ''; } + }; // 刷新 const reLoadData = async () => { @@ -427,7 +464,7 @@ // 分页获取 const getListByPage = async () => { - const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord } }; + const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: state.searPara }; let res = await workApplyApi().getAllNewApplyListPage(data); if (res.data.code === '200') { state.applyData = JSON.parse(JSON.stringify(res.data.data)); @@ -467,18 +504,18 @@ // 关键词查询记录 const searchRecord = async () => { - if (state.searchWord == '') { - ElMessage({ - type: 'warning', - message: '请输入查询关键词' - }); - } else { - getListByPage(); - } + getListByPage(); }; // 重置搜索 const clearSearch = async () => { - state.searchWord = ''; + state.timeRange = [] + state.searPara = { + startTime: '', + endTime: '', + workType: null, + headUserName: '', + secondDepId: null + }; getListByPage(); }; @@ -529,26 +566,21 @@ 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) => { + const downLoadRecord = (row: any) => { // let res = await workApplyApi().postPrinting(data); - axios.post(import.meta.env.VITE_API_URL + `/work/apply/printingPdf`,data,{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`,'uid':`${Cookies.get('uid')}`},responseType: 'blob'}).then(res=>{ + console.log(row,555) + axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/down/load/pdf`,{ id: row.id},{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/pdf'}) link.style.display = "none"; link.href = URL.createObjectURL(blob); // 创建URL - link.setAttribute("download", state.downLoadName + "作业证.pdf"); - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); + link.setAttribute("download", row.workTypeDesc + row.workPermitNo + "作业证.pdf"); + document.body.appendChild(link) + window.open(link.href) + document.body.removeChild(link) } else { ElMessage({ type: 'warning', @@ -557,11 +589,6 @@ } }) - }; - - const conFirmDownLoad = () => { - downLoadRecord({ applyWorkId: state.downLoadId }); - state.downLoadDialog = false; }; const handleSizeChange1 = (val: number) => { @@ -601,6 +628,7 @@ Plus, Finished, Download, + giveTime, reLoadData, toApply, handleClick, @@ -610,9 +638,8 @@ viewRecord, viewStatus, deleteRecordBtn, - downLoadBtn, + downLoadRecord, conFirmDelete, - conFirmDownLoad, getListByPage, handleSizeChange1, handleCurrentChange1, -- Gitblit v1.9.2