From 01f3e49f3763a25ef67a4c3e5786491703a1aece Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期四, 13 七月 2023 14:39:58 +0800 Subject: [PATCH] 特殊作业对接修改 --- src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue | 554 ++++++++++++++---------------------------------------- 1 files changed, 145 insertions(+), 409 deletions(-) diff --git a/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue b/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue index 9863772..7798f8d 100644 --- a/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue +++ b/src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue @@ -4,30 +4,46 @@ <!-- <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 HH:mm:ss" type="datetimerange" @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="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> @@ -71,15 +87,18 @@ </el-table-column> <el-table-column label="风险研判" align="center"> <template #default="scope"> - <el-tag>{{ statusList.find(i=>i.value === scope.row.status)?.label }}</el-tag> + <el-button v-if="scope.row.status == 0" link type="primary" size="small" @click="openReport('上传', scope.row)">上传研判报告</el-button> + <el-tag type="danger" v-else-if="scope.row.status == -1">已废止</el-tag> + <el-button v-else link type="primary" size="small" @click="openReport('查看', scope.row)">查看研判报告</el-button> </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="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> + <span v-if="scope.row.status == -1">已废止</span> + <el-button v-if="scope.row.status == 0 || scope.row.status == 1" link type="danger" size="small" :icon="Delete" @click="abortRecordBtn(scope.row)">作废</el-button> + <el-button v-if="scope.row.status !== -1" 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 v-if="scope.row.status == 1" link type="success" size="small" :icon="Download" @click="checkTicket(scope.row)">正式办票</el-button> <!-- <el-button :disabled="scope.row.status == 7 ? false : true" link type="primary" size="small" :icon="Download" @click="downLoadBtn(scope.row)">导出作业票</el-button>--> </template> </el-table-column> @@ -108,127 +127,7 @@ </span> </template> </el-dialog> - <el-dialog v-model="dialogStatus" title="作业申请进度" width="60%"> - <el-form v-if="approveInfo.operators.length > 0" style="margin-bottom: 40px"> - <el-form-item label="申请作业人"> - <el-input v-model="approveInfo.operators" readonly type="textarea" /> - </el-form-item> - </el-form> - <div style="display: flex; flex-direction: column-reverse"> - <div v-for="(item, index) in approveInfo.approvalSteps" class="stepItem"> - <div class="stepNum">{{ item.stepSerial }}</div> - <div class="stepCard"> - <el-card class="box-card" shadow="always"> - <div class="text"> - 审批结果:<span class="bold-text">{{ item.approvalResultDesc }}</span> - </div> - <div class="text"> - 审批类型:<span class="bold-text">{{ item.typeDesc }}</span> - </div> - <div class="text" v-if="item.auditTypeDesc"> - 审批类型:<span class="bold-text">{{ item.auditTypeDesc }}</span> - </div> - <div class="text" v-show="item.startApprovalTime != null"> - 开始时间:<span>{{ item.startApprovalTime }}</span> - </div> - <div class="approveUnit"> - <div class="item-tit"><span>审批人</span><span>审批状态</span></div> - <div class="item-cont" v-for="i in item.stepUnits"> - <span>{{ i.approvalUname }}</span - ><span>{{ i.resultDesc }}</span> - </div> - </div> - <div class="approveItem"> - <div class="item-tit"> - <span>审批项目</span> -<!-- <span>类型</span>--> - <div>措施标准</div> - </div> - <div class="item-cont" v-for="i in item.stepItems"> - <span>{{ i.itemName }}</span> -<!-- <span>{{ i.typeDesc }}</span>--> - <div v-if="i.measure !== null"> - <div> - <span>作业类型:</span><span>{{ i.measure.workTypeDesc }}</span> - </div> - <div> - <span>措施内容:</span><span>{{ i.measure.context }}</span> - </div> - </div> - <div v-if="i.stand !== null"> - <div> - <span>标题名称:</span><span>{{ i.stand.title }}</span> - </div> - <div> - <span>标准内容:</span><span>{{ i.stand.typeDesc }}</span> - </div> - </div> - </div> - </div> - <div class="text" v-show="item.expFinishApprovalTime && item.expFinishApprovalTime != null"> - 期望结束时间:<span>{{ item.expFinishApprovalTime }}</span> - </div> - <div class="text" v-show="item.finishApprovalTime != null"> - 结束时间:<span>{{ item.finishApprovalTime }}</span> - </div> - </el-card> - </div> - </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> - <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%">--> -<!-- <el-row class="homeCard">--> -<!-- <el-col :span="8">--> -<!-- <div class="grid-content topInfo">--> -<!-- <el-input v-model="searchWord" placeholder="作业证名称"></el-input>--> -<!-- <el-button type="primary">查询</el-button>--> -<!-- <el-button plain>重置</el-button>--> -<!-- </div>--> -<!-- </el-col>--> -<!-- </el-row>--> -<!-- <div class="homeCard">--> -<!-- <div class="main-card">--> -<!-- <el-table ref="multipleTableRef" :data="passedData" style="width: 100%" height="calc(100% - 48px)" :header-cell-style="{ background: '#fafafa' }" @selection-change="handleSelectionChange">--> -<!-- <el-table-column type="selection" width="55" />--> -<!-- <el-table-column type="index" label="编号" width="200" />--> -<!-- <el-table-column property="level" label="作业证等级" width="180" sortable />--> -<!-- <el-table-column property="applyDate" label="申请日期" sortable />--> -<!-- <el-table-column property="name" label="申请人" width="180" />--> -<!-- <el-table-column property="department" label="申请部门" width="180" />--> -<!-- <el-table-column label="申请状态" width="180">--> -<!-- <template #default="scope">--> -<!-- <el-tag type="success">{{ scope.row.status }}</el-tag>--> -<!-- </template>--> -<!-- </el-table-column>--> -<!-- </el-table>--> -<!-- <div class="pageBtn">--> -<!-- <el-pagination v-model:currentPage="pageIndex2" v-model:page-size="pageSize2" :page-sizes="[10, 15]" small="false" background layout="total, sizes, prev, pager, next, jumper" :total="totalSize2" @size-change="handleSizeChange2" @current-change="handleCurrentChange2" />--> -<!-- </div>--> -<!-- </div>--> -<!-- </div>--> -<!-- </div>--> -<!-- </el-tab-pane>--> -<!-- </el-tabs>--> + <report-log ref="reportDialogRef" @refresh="getListByPage"></report-log> </div> </template> @@ -241,7 +140,7 @@ import { useRouter } from 'vue-router'; 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 { FormInstance, FormRules, ElMessage, ElMessageBox } from 'element-plus'; import { workApplyApi } from '/@/api/specialWorkSystem/workApply'; import type { TabsPaneContext } from 'element-plus'; import {teamManageApi} from "/@/api/systemManage/basicDateManage/personShiftManage/teamManage"; @@ -257,15 +156,11 @@ approveInfo: Object; 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 +171,9 @@ departmentList: Array<any>; departmentRecursionList: Array<DepartmentState>; statusList: Array<any>; + searPara: {} + timeRange: Array<string>; + dep4List: Array<type>; } interface type { id: number; @@ -288,20 +186,14 @@ export default defineComponent({ name: 'myApply', components: { - // fire: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/fireLog.vue')), - // space: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/spaceLog.vue')), - // hoist: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/hoistLog.vue')), - // ground: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/groundLog.vue')), - // broken: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/brokenLog.vue')), - // height: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/heightLog.vue')), - // power: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/powerLog.vue')), - // plate: defineAsyncComponent(() => import('/@/views/specialWorkSystem/workTicket/wdsq/components/plateLog.vue')) - detailLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/detailLog.vue')) + detailLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/detailLog.vue')), + reportLog: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/wdsq/components/jsaReportDialog.vue')) }, setup() { const userInfo = useUserInfo(); const { userInfos } = storeToRefs(userInfo); const router = useRouter(); + const reportDialogRef = ref(); const state = reactive<stateType>({ pageIndex1: 1, pageSize1: 10, @@ -311,7 +203,14 @@ departmentList: [], departmentRecursionList: [], chosenIndex: null, - searchWord: '', + searPara:{ + startTime: '', + endTime: '', + workType: null, + headUserName: '', + secondDepId: null + }, + timeRange: [], applyData: [], workTimeList: [], multipleSelection: [], @@ -321,12 +220,9 @@ }, dialogDetails: false, dialogStatus: false, - deleteDialog: false, - downLoadDialog: false, addRecord: {}, details: {}, statusInfo: {}, - deleteId: null, downLoadId: null, downLoadName: '', deleteArr: [], @@ -340,6 +236,12 @@ { id: 7, name: '临时用电作业' }, { id: 8, name: '盲板抽堵作业' } ], + dep4List: [ + {id:49,name:'电石事业部'}, + {id:50,name:'电力事业部'}, + {id:48,name:'有机化工事业部'}, + {id:32,name:'甲醇事业部'} + ], statusList: [ { value: -1, @@ -387,11 +289,15 @@ } ] }); - 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 () => { @@ -435,7 +341,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().getNewApplyListPage(data); if (res.data.code === '200') { state.applyData = JSON.parse(JSON.stringify(res.data.data)); @@ -475,19 +381,19 @@ // 关键词查询记录 const searchRecord = async () => { - if (state.searchWord == '') { - ElMessage({ - type: 'warning', - message: '请输入查询关键词' - }); - } else { - getListByPage(); - } + getListByPage(); }; // 重置搜索 const clearSearch = async () => { - state.searchWord = ''; - getListByPage(); + state.timeRange = [] + state.searPara = { + startTime: '', + endTime: '', + workType: null, + headUserName: '', + secondDepId: null + }; + getListByPage(); }; // 查看进度 @@ -510,38 +416,69 @@ } }; - 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({ + const abortRecordBtn = (row:object) => { + ElMessageBox.confirm( + '是否作废该项申报?', + '申报作废', + { + confirmButtonText: '确认', + cancelButtonText: '取消' + } + ) + .then(async () => { + let res = await workApplyApi().abolishTicket({id: row.id}); + if (res.data.code === '200') { + ElMessage({ type: 'success', - message: '删除成功!' - }); - getListByPage(); - } else { - ElMessage({ + message: '作废成功!' + }); + getListByPage(); + } else { + ElMessage({ type: 'warning', message: res.data.msg - }); - } + }); + } + }) + .catch(() => { + console.log('取消废票') + }) }; - const conFirmDelete = () => { - deleteRecord({ workApplyId: state.deleteId }); - state.deleteDialog = false; - }; + // 正式办票 + const checkTicket = (row:object) =>{ + ElMessageBox.confirm( + '是否进行正式办票操作?', + '正式办票', + { + confirmButtonText: '确认', + cancelButtonText: '取消' + } + ) + .then(async () => { + let res = await workApplyApi().checkTicket({id: row.id}); + if (res.data.code === '200') { + ElMessage({ + type: 'success', + message: '办票成功!' + }); + getListByPage(); + } else { + ElMessage({ + type: 'warning', + message: res.data.msg + }); + } + }) + .catch(() => { + console.log('取消办票') + }) + } // 导出图表 const downLoadBtn = (row:any) =>{ state.downLoadId = row.workApplyId; state.downLoadName = row.workTypeDesc + row.workPermitNo - state.downLoadDialog = true; } // 导出方法 @@ -567,11 +504,6 @@ }; - const conFirmDownLoad = () => { - downLoadRecord({ applyWorkId: state.downLoadId }); - state.downLoadDialog = false; - }; - const handleSizeChange1 = (val: number) => { state.pageSize1 = val; getListByPage(); @@ -579,6 +511,10 @@ const handleCurrentChange1 = (val: number) => { state.pageIndex1 = val; getListByPage(); + }; + + const openReport = (type: string, value: {}) => { + reportDialogRef.value.showReportDialog(type, value); }; // 查看记录 @@ -609,18 +545,20 @@ Plus, Finished, Download, + reportDialogRef, + checkTicket, + giveTime, reLoadData, toApply, handleClick, toNames, searchRecord, clearSearch, + openReport, viewRecord, viewStatus, - deleteRecordBtn, + abortRecordBtn, downLoadBtn, - conFirmDelete, - conFirmDownLoad, getListByPage, handleSizeChange1, handleCurrentChange1, @@ -683,208 +621,6 @@ } &:last-of-type { height: calc(100% - 100px); - } - } - .stepItem { - display: flex; - align-items: flex-start; - margin-top: 30px; - margin-left: 30px; - padding-bottom: 30px; - padding-left: 40px; - border-left: 1px solid #a0cfff; - position: relative; - &:first-of-type { - margin-top: 30px; - } - &:first-of-type { - margin-bottom: 0; - border-left: none; - } - .stepNum { - position: absolute; - width: 40px; - height: 40px; - border-radius: 20px; - box-sizing: border-box; - font-size: 18px; - color: #333; - border: 1px solid #a0cfff; - line-height: 38px; - text-align: center; - left: -20px; - top: -30px; - background: #d9ecff; - } - .stepCard { - width: 100%; - margin-top: -30px; - - .box-card { - width: 100%; - - .card-header { - display: flex; - justify-content: space-between; - align-items: center; - - span { - font-weight: bold; - margin-left: 10px; - } - } - - .text { - width: 100%; - font-size: 14px; - margin-bottom: 10px; - padding-left: 10px; - - span { - color: #409eff; - } - - .bold-text{ - font-weight: bolder; - } - - &:last-of-type { - margin-bottom: 0; - } - } - .approveUnit { - width: 100%; - font-size: 14px; - margin-bottom: 20px; - padding: 10px 15px; - border: 1px solid #fff; - background: #ecf8ff; - border-radius: 6px; - .item-tit { - width: 100%; - display: flex; - color: #409eff; - align-items: flex-start; - justify-content: space-between; - padding-bottom: 10px; - border-bottom: 1px solid #a0cfff; - - & > span { - flex: 1; - &:last-of-type{ - text-align: center; - } - } - & > div { - flex: 1; - text-align: center; - } - } - .item-cont { - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 0; - border-bottom: 1px solid #c6e2ff; - - & > span { - flex: 1; - &:last-of-type{ - text-align: center; - } - } - & > div { - flex: 1; - text-align: center; - - & > div { - text-align: left; - width: 100%; - display: flex; - justify-content: center; - align-items: center; - span { - width: 45%; - &:first-of-type { - width: 30%; - } - } - } - } - &:last-of-type { - border-bottom: 0; - } - } - } - .approveItem { - width: 100%; - font-size: 14px; - margin-bottom: 20px; - padding: 10px 15px; - background: #ecf8ff; - border: 1px solid #fff; - border-radius: 6px; - .item-tit { - width: 100%; - display: flex; - color: #409eff; - align-items: flex-start; - justify-content: space-between; - padding-bottom: 10px; - border-bottom: 1px solid #a0cfff; - - & > span { - flex: 1; - } - & > div { - flex: 2; - text-align: center; - } - } - .item-cont { - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 0; - border-bottom: 1px solid #c6e2ff; - - & > span { - flex: 1; - } - & > div { - flex: 2; - text-align: center; - - & > div { - text-align: left; - width: 100%; - display: flex; - justify-content: center; - align-items: flex-start; - margin-bottom: 10px; - span { - width: 50%; - &:first-of-type { - width: 25%; - } - } - } - } - &:last-of-type { - border-bottom: 0; - } - } - } - } - } - &:hover .card-header { - color: #0098f5; - } - &:hover .stepNum { - border: 2px solid #0098f5; - color: #0098f5; } } .el-row { -- Gitblit v1.9.2