bug
Your Name
2022-08-19 61aa46c5c464eb3c2b6674173cd854e1c9afd7ae
src/views/specialWorkSystem/workApplyManage/myJobApply/index.vue
@@ -22,13 +22,7 @@
                        </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 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="部门名称"/>
@@ -58,93 +52,46 @@
            <el-dialog v-model="dialogDetails" title="作业申请详情">
               <el-form :model="details" label-width="120px">
                  <el-form-item label="作业申请单号">
                     <el-input
                           v-model="details.workPermitNo"
                           readonly
                     />
                            <el-input v-model="details.workPermitNo" readonly />
                  </el-form-item>
                  <el-form-item label="申请人">
                     <el-input
                           v-model="details.applyUname"
                           readonly
                     />
                            <el-input v-model="details.applyUname" readonly />
                  </el-form-item>
                  <el-form-item label="部门名称">
                     <el-input
                           v-model="details.depName"
                           readonly
                     />
                            <el-input v-model="details.depName" readonly />
                  </el-form-item>
                  <el-form-item label="作业人">
                     <el-input
                           v-model="details.operators"
                           readonly
                           type="textarea"
                     />
                            <el-input v-model="details.operators" readonly type="textarea" />
                  </el-form-item>
                  <el-form-item label="作业类型">
                     <el-input
                           v-model="details.workTypeDesc"
                           readonly
                     />
                            <el-input v-model="details.workTypeDesc" readonly />
                  </el-form-item>
                  <el-form-item label="作业等级">
                     <el-input
                           v-model="details.workLevelDesc"
                           readonly
                     />
                            <el-input v-model="details.workLevelDesc" readonly />
                  </el-form-item>
                  <el-form-item label="作业内容">
                     <el-input
                           v-model="details.workContent"
                           readonly
                           type="textarea"
                     />
                            <el-input v-model="details.workContent" readonly type="textarea" />
                  </el-form-item>
                  <el-form-item label="作业地址">
                     <el-input
                           v-model="details.workLocation"
                           readonly
                           type="textarea"
                     />
                            <el-input v-model="details.workLocation" readonly type="textarea" />
                  </el-form-item>
                  <el-form-item label="作业方式">
                     <el-input
                           v-model="details.workDetail.hotMethod"
                           readonly
                           type="textarea"
                     />
                            <el-input v-model="details.workDetail.hotMethod" readonly type="textarea" />
                  </el-form-item>
                  <el-form-item label="关联其他作业">
                     <el-input
                           v-model="details.workDetail.otherSpecialWork"
                           readonly
                           type="textarea"
                     />
                            <el-input v-model="details.workDetail.otherSpecialWork" readonly type="textarea" />
                  </el-form-item>
                  <el-form-item label="期望开始时间">
                     <el-input
                           v-model="details.expStartTime"
                           readonly
                     />
                            <el-input v-model="details.expStartTime" readonly />
                  </el-form-item>
                  <el-form-item label="期望结束时间">
                     <el-input
                           v-model="details.expEndTime"
                           readonly
                     />
                            <el-input v-model="details.expEndTime" readonly />
                  </el-form-item>
                  <el-form-item label="申请时间">
                     <el-input
                           v-model="details.applyTime"
                           readonly
                     />
                            <el-input v-model="details.applyTime" readonly />
                  </el-form-item>
                  <el-form-item label="当前状态">
                     <el-input
                           v-model="details.statusDesc"
                           readonly
                     />
                            <el-input v-model="details.statusDesc" readonly />
                  </el-form-item>
                  <el-form-item>
                     <el-button type="primary" @click="dialogDetails = false" size="default">确认</el-button>
@@ -154,11 +101,7 @@
            <el-dialog v-model="dialogStatus" title="作业申请进度">
               <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-input v-model="approveInfo.operators" readonly type="textarea" />
                  </el-form-item>
               </el-form>
               <div style="display: flex;flex-direction: column-reverse">
@@ -166,28 +109,54 @@
                     <div class="stepNum">{{item.stepSerial}}</div>
                     <div class="stepCard">
                        <el-card class="box-card" shadow="always">
                           <div class="text">审批结果:<span>{{item.approvalResultDesc}}</span></div>
                           <div class="text">审批类型:<span>{{item.typeDesc}}</span></div>
                           <div class="text" v-show="item.startApprovalTime !=null">开始时间:<span>{{item.startApprovalTime}}</span></div>
                                    <div class="text">
                                        审批结果:<span>{{ item.approvalResultDesc }}</span>
                                    </div>
                                    <div class="text">
                                        审批类型:<span>{{ item.typeDesc }}</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 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 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>
                                                    <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>
                                                    <span>标题名称:</span><span>{{ i.stand.title }}</span>
                                                </div>
                                                <div>
                                                    <span>标准内容:</span><span>{{ i.stand.typeDesc }}</span>
                                 </div>
                              </div>
                           </div>
                           <div class="text" v-show="item.expFinishApprovalTime !=null">期望结束时间:<span>{{item.expFinishApprovalTime}}</span></div>
                           <div class="text" v-show="item.finishApprovalTime !=null">结束时间:<span>{{item.finishApprovalTime}}</span></div>
                                    </div>
                                    <div class="text" v-show="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>
@@ -216,14 +185,7 @@
               </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 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 />
@@ -258,7 +220,7 @@
   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 type { TabsPaneContext } from 'element-plus';
   // 定义接口来定义对象的类型
   interface stateType {
@@ -279,7 +241,12 @@
      activeName:string;
      addRecord: {};
      details: {};
      statusInfo:{}
    statusInfo: {};
    workType: Array<type>;
}
interface type {
    id: number;
    name: string;
   }
   export default defineComponent({
@@ -310,7 +277,17 @@
            details: {},
            statusInfo:{},
            deleteId: null,
            deleteArr: []
            deleteArr: [],
            workType: [
                { id: 1, name: '动火作业' },
                { id: 2, name: '受限空间作业' },
                { id: 3, name: '吊装作业' },
                { id: 4, name: '动土作业' },
                { id: 5, name: '断路作业' },
                { id: 6, name: '高处作业' },
                { id: 7, name: '临时用电作业' },
                { id: 8, name: '盲板抽堵作业' }
            ]
         });
         interface User {
            name: string;
@@ -326,20 +303,20 @@
         // 填写表单
         const toApply =()=>{
            router.push({
               path: 'workTicket',
                path: 'workTicket'
            });
         }
        };
         const handleClick = (tab: TabsPaneContext, event: Event) => {
            console.log(tab, event)
         }
            console.log(tab, event);
        };
         // 分页获取工作时间组列表
         const getListByPage = async () => {
            const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { name: state.searchWord } };
            let res = await workApplyApi().getApplyListtPage(data);
            if (res.data.code === '200') {
               state.applyData = JSON.parse(JSON.stringify(res.data.data))
                state.applyData = JSON.parse(JSON.stringify(res.data.data));
               state.applyData = state.applyData.map((item) => {
                  if (item.operators == null || item.operators == []){
                     item.operators = [];
@@ -348,8 +325,8 @@
                  }
                  return item;
               });
               state.totalSize1 = res.data.total
               console.log('0212121')
                state.totalSize1 = res.data.total;
                console.log('0212121');
            } else {
               ElMessage({
                  type: 'warning',
@@ -395,16 +372,16 @@
         // 查看进度
         const viewStatus = (row)=>{
            getStatus({ workApplyId: row.workApplyId });
            state.dialogStatus = true
            state.dialogStatus = true;
         };
         // 查询进度方法
         const getStatus = async (data: any) => {
            let res = await workApplyApi().getStatus(data);
            if (res.data.code === '200') {
               state.approveInfo = JSON.parse(JSON.stringify(res.data.data))
                state.approveInfo = JSON.parse(JSON.stringify(res.data.data));
               state.approveInfo.operators = Array.from(state.approveInfo.operators, ({ operatorUname }) => operatorUname);
               console.log(state.approveInfo,'steps')
                console.log(state.approveInfo, 'steps');
            } else {
               ElMessage({
                  type: 'warning',
@@ -450,44 +427,47 @@
         };
         // 查看记录
         const viewRecord = (row) => {
        const viewRecord = (row: any) => {
            row.workDetail.otherSpecialWork = JSON.parse(JSON.stringify(row.workDetail.otherSpecialWork.split(','))).map((item: Array<string>) => {
                return state.workType.find((i: { id: number }) => i.id === Number(item))?.name;
            });
            state.details = JSON.parse(JSON.stringify(row));
            state.details.workDetail.otherSpecialWork = state.details.workDetail.otherSpecialWork.split(',')
            if(state.details.workDetail.otherSpecialWork == null || state.details.workDetail.otherSpecialWork == []){state.details.workDetail.otherSpecialWork = []}
            else{
               state.details.workDetail.otherSpecialWork.map(item =>{
                  console.log(item,'item')
                  if(item == '1'){
                     item = '动火作业'
                     return item
                  } else if(item == '2'){
                     item = '受限空间作业'
                     return item
                  } else if(item == '3'){
                     item = '吊装作业'
                     return item
                  } else if(item == '4'){
                     item = '动土作业'
                     return item
                  } else if(item == '5'){
                     item = '断路作业'
                     return item
                  } else if(item == '6'){
                     item = '高处作业'
                     return item
                  } else if(item == '7'){
                     item = '临时用电作业'
                     return item
                  } else {
                     item = '盲板抽堵作业'
                     return item
                  }
               })
            }
            console.log(state.details.workDetail.otherSpecialWork,'666666')
            // state.details.workDetail.otherSpecialWork = state.details.workDetail.otherSpecialWork.split(',');
            // if (state.details.workDetail.otherSpecialWork == null || state.details.workDetail.otherSpecialWork == []) {
            //     state.details.workDetail.otherSpecialWork = [];
            // } else {
            //     state.details.workDetail.otherSpecialWork.map((item) => {
            //         console.log(item, 'item');
            //         if (item == '1') {
            //             item = '动火作业';
            //             return item;
            //         } else if (item == '2') {
            //             item = '受限空间作业';
            //             return item;
            //         } else if (item == '3') {
            //             item = '吊装作业';
            //             return item;
            //         } else if (item == '4') {
            //             item = '动土作业';
            //             return item;
            //         } else if (item == '5') {
            //             item = '断路作业';
            //             return item;
            //         } else if (item == '6') {
            //             item = '高处作业';
            //             return item;
            //         } else if (item == '7') {
            //             item = '临时用电作业';
            //             return item;
            //         } else {
            //             item = '盲板抽堵作业';
            //             return item;
            //         }
            //     });
            // }
            // console.log(state.details.workDetail.otherSpecialWork, '666666');
            state.dialogDetails = true;
         };
         // 折线图
         const renderMenu = async (value: string) => {
@@ -639,7 +619,7 @@
                  span{
                     font-weight: bolder;
                     color: #409EFF;
                        color: #409eff;
                  }
                  &:last-of-type{
@@ -652,12 +632,12 @@
                  margin-bottom: 20px;
                  padding: 10px 15px;
                  border: 1px solid #fff;
                  background: #ECF8FF;
                    background: #ecf8ff;
                  border-radius: 6px;
                  .item-tit{
                     width: 100%;
                     display: flex;
                     color: #409EFF;
                        color: #409eff;
                     align-items: flex-start;
                     justify-content: space-between;
                     padding-bottom: 10px;
@@ -710,13 +690,13 @@
                  font-size: 14px;
                  margin-bottom: 20px;
                  padding: 10px 15px;
                  background: #ECF8FF;
                    background: #ecf8ff;
                  border: 1px solid #fff;
                  border-radius: 6px;
                  .item-tit{
                     width: 100%;
                     display: flex;
                     color: #409EFF;
                        color: #409eff;
                     align-items: flex-start;
                     justify-content: space-between;
                     padding-bottom: 10px;
@@ -728,8 +708,6 @@
                     &>div{
                        flex: 2;
                        text-align: center;
                     }
                  }
                  .item-cont{
@@ -769,11 +747,11 @@
            }
         }
         &:hover .card-header{
            color: #0098F5;
            color: #0098f5;
         }
         &:hover .stepNum{
            border: 2px solid #0098F5;
            color: #0098F5;
            border: 2px solid #0098f5;
            color: #0098f5;
         }
      }
      .el-row{