From e8d946a82907aa530ff086987d3ec7d2c04a90d2 Mon Sep 17 00:00:00 2001
From: Admin <978517621@qq.com>
Date: 星期二, 15 十一月 2022 13:09:55 +0800
Subject: [PATCH] 默认更改列表

---
 src/views/specialWorkManage/workTicket/myJobApply/index.vue |  119 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 80 insertions(+), 39 deletions(-)

diff --git a/src/views/specialWorkManage/workTicket/myJobApply/index.vue b/src/views/specialWorkManage/workTicket/myJobApply/index.vue
index a736bf3..244da37 100644
--- a/src/views/specialWorkManage/workTicket/myJobApply/index.vue
+++ b/src/views/specialWorkManage/workTicket/myJobApply/index.vue
@@ -24,7 +24,7 @@
                         <div class="main-card">
                             <el-row class="cardTop">
                                 <el-col :span="24" class="mainCardBtn">
-                                    <el-button type="primary" size="default" @click="toApply()">申请</el-button>
+<!--                                    <el-button type="primary" 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>
@@ -32,8 +32,8 @@
                             <el-table ref="multipleTableRef" :data="applyData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }">
                                 <el-table-column property="workPermitNo" label="作业申请单号" width="180" />
                                 <el-table-column property="applyUname" label="申请人" />
-                                <el-table-column property="depName" label="部门名称" />
-                                <el-table-column property="operators" label="作业人" />
+                                <el-table-column property="operatorCompanys" label="施工单位" />
+                                <el-table-column property="operatorUnames" label="作业人" />
                                 <el-table-column property="workTypeDesc" label="作业类型" />
                                 <el-table-column property="workLevelDesc" label="作业等级" />
                                 <el-table-column property="applyTime" label="申请时间" width="180" />
@@ -47,6 +47,7 @@
                                         <el-button link type="text"   @click="viewRecord(scope.row)">查看</el-button>
                                         <el-button link type="text"   @click="viewStatus(scope.row)">进度</el-button>
                                         <el-button link type="text"  @click="deleteRecordBtn(scope.row)">取消</el-button>
+                                        <el-button :disabled="scope.row.status == 7 ? false : true" link type="text" @click="downLoadRecord(scope.row)">导出作业票</el-button>
                                     </template>
                                 </el-table-column>
                             </el-table>
@@ -56,27 +57,30 @@
                         </div>
                     </div>
                 </div>
-                <el-dialog v-model="dialogDetails" title="作业申请详情" center>
+                <el-dialog :visible.sync="dialogDetails" title="作业申请详情" center>
                     <fire v-if="dialogType == 1" :details = details></fire>
-                    <space v-else-if="dialogType == 2" :details = details></space>
-                    <hoist v-else-if="dialogType == 3" :details = details></hoist>
-                    <ground v-else-if="dialogType == 4" :details = details></ground>
-                    <broken v-else-if="dialogType == 5" :details = details></broken>
-                    <height v-else-if="dialogType == 6" :details = details></height>
-                    <power v-else-if="dialogType == 7" :details = details></power>
-                    <plate v-else :details = details></plate>
+                    <space v-if="dialogType == 2" :details = details></space>
+                    <hoist v-if="dialogType == 3" :details = details></hoist>
+                    <ground v-if="dialogType == 4" :details = details></ground>
+                    <broken v-if="dialogType == 5" :details = details></broken>
+                    <height v-if="dialogType == 6" :details = details></height>
+                    <power v-if="dialogType == 7" :details = details></power>
+                    <plate v-if="dialogType == 8" :details = details></plate>
                     <template #footer>
-                      <span class="dialog-footer">
+                      <div class="dialog-footer" align="right">
                         <el-button type="primary" @click="dialogDetails = false"
                         >确认</el-button
                         >
-                      </span>
+                      </div>
                     </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-dialog :visible.sync="dialogStatus" title="作业申请进度" width="60%">
+                    <el-form style="margin-bottom: 40px">
+                        <el-form-item label="作业人" v-if="approveInfo.operatorUnames">
+                            <el-input v-model="approveInfo.operatorUnames" readonly type="textarea" />
+                        </el-form-item>
+                        <el-form-item label="作业人" v-else>
+                            <el-input placeholder="无" readonly type="textarea" />
                         </el-form-item>
                     </el-form>
                     <div style="display: flex; flex-direction: column-reverse">
@@ -88,7 +92,10 @@
                                         审批结果:<span>{{ item.approvalResultDesc }}</span>
                                     </div>
                                     <div class="text">
-                                        审批类型:<span>{{ item.typeDesc }}</span>
+                                        审批层级:<span>{{ item.typeDesc }}</span>
+                                    </div>
+                                    <div class="text" v-if="item.auditTypeDesc">
+                                        审批类型:<span>{{ item.auditTypeDesc }}</span>
                                     </div>
                                     <div class="text" v-show="item.startApprovalTime != null">
                                         开始时间:<span>{{ item.startApprovalTime }}</span>
@@ -100,7 +107,7 @@
                                             ><span>{{ i.resultDesc }}</span>
                                         </div>
                                     </div>
-                                    <div class="approveItem">
+                                    <div class="approveItem" v-if="item.stepItems && item.stepItems.length>0">
                                         <div class="item-tit">
                                             <span>审批项目</span>
 <!--                                            <span>类型</span>-->
@@ -109,7 +116,7 @@
                                         <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 v-if="i.measure">
                                                 <div>
                                                     <span>作业类型:</span><span>{{ i.measure.workTypeDesc }}</span>
                                                 </div>
@@ -117,7 +124,7 @@
                                                     <span>措施内容:</span><span>{{ i.measure.context }}</span>
                                                 </div>
                                             </div>
-                                            <div v-if="i.stand !== null">
+                                            <div v-if="i.stand">
                                                 <div>
                                                     <span>标题名称:</span><span>{{ i.stand.title }}</span>
                                                 </div>
@@ -138,7 +145,7 @@
                         </div>
                     </div>
                 </el-dialog>
-                <el-dialog v-model="deleteDialog" title="提示" width="30%" center>
+                <el-dialog :visible.sync="deleteDialog" title="提示" width="30%" center>
                     <span>您确定要取消该条申请吗?</span>
                     <template #footer>
                         <span class="dialog-footer">
@@ -195,6 +202,8 @@
 import power from './components/powerLog'
 import plate from './components/plateLog'
 import {workApplyApi} from "../../../../api/workApply";
+import Cookies from 'js-cookie';
+import axios from 'axios';
 export default{
     name: 'myApply',
     components: {
@@ -245,6 +254,9 @@
             ]
         }
     },
+    created(){
+        this.getListByPage()
+    },
     methods:{
         async getListByPage() {
             const data = { pageSize: this.pageSize1, pageIndex: this.pageIndex1, searchParams: { workType: this.searchWord } };
@@ -286,6 +298,34 @@
 
         reLoadData() {
             this.getListByPage();
+        },
+
+        // 导出方法
+        downLoadRecord(row) {
+            if(row.status == 7){
+                axios.post(process.env.BASE_API + `/work/apply/printing`,{applyWorkId: row.workApplyId},{headers:{'Content-Type': 'application/json','Authorization': `${Cookies.get('token')}`},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", row.workTypeDesc + row.workPermitNo + "作业证.docx");
+                        document.body.appendChild(link);
+                        link.click();
+                        document.body.removeChild(link);
+                    } else {
+                        this.$message({
+                            type: 'warning',
+                            message: res.data.msg
+                        });
+                    }
+                })
+            }else{
+                this.$message({
+                    type: 'warning',
+                    message: '该作业申请未完成审批流程,不可导出'
+                });
+            }
         },
 
         // 填写表单
@@ -335,8 +375,9 @@
             let res = await workApplyApi().getStatus(data);
             if (res.data.code === '200') {
                 this.approveInfo = JSON.parse(JSON.stringify(res.data.data));
-                this.approveInfo.operators = Array.from(this.approveInfo.operators, ({ operatorUname }) => operatorUname);
-                console.log(this.approveInfo, 'steps');
+                // this.approveInfo.operators = this.approveInfo.operators.map(item => {
+                //     return item.operatorUname
+                // }).join('、')
             } else {
                 this.$message({
                     type: 'warning',
@@ -374,24 +415,24 @@
         viewRecord(row) {
             this.dialogType = row.workType
             this.details = JSON.parse(JSON.stringify(row));
-            if(this.details.workDetail.otherSpecialWork == '' || !this.details.workDetail.otherSpecialWork){
-                this.details.workDetail.otherSpecialWork=[]
-            }
-            else {
-                console.log(this.details.workDetail.otherSpecialWork,'split')
-                const a = this.details.workDetail.otherSpecialWork
-                this.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
-                    return this.workType.find((i) => i.id === Number(item)).name;
-                });
-            }
+            this.details.operators = this.details.operators.join('、')
+            // if(!this.details.workDetail.otherSpecialWork || this.details.workDetail.otherSpecialWork == ''){
+            //     this.details.workDetail.otherSpecialWork = ''
+            // }
+            // else {
+            //     const a = this.details.workDetail.otherSpecialWork
+            //     this.details.workDetail.otherSpecialWork = a.split(',').map((item) => {
+            //         return this.workType.find((i) => i.id === Number(item)).name;
+            //     }).join('、');
+            // }
             if(this.details.workDetail.involvedDepIds == '' || !this.details.workDetail.involvedDepIds){
-                this.details.workDetail.involvedDepIds=[]
+                this.details.workDetail.involvedDepIds = ''
             }
             else {
                 const a = this.details.workDetail.involvedDepIds
                 this.details.workDetail.involvedDepIds = a.split(',').map((item) => {
                     return this.departmentRecursionList.find((i) => i.depId === Number(item)).depName;
-                });
+                }).join('、');
             }
             if(this.details.workDetail.gbPath){
                 this.details.workDetail.gbPath = this.details.workDetail.gbPath.split(',')
@@ -429,9 +470,9 @@
         width: 100%;
         height: 100%;
 
-        &::v-deep(.el-tabs__content) {
-            height: calc(100% - 60px);
-        }
+        //&::v-deep(.el-tabs__content) {
+        //    height: calc(100% - 60px);
+        //}
 
         .el-tab-pane {
             height: 100%;

--
Gitblit v1.9.2