马宇豪
2025-03-04 1b9fea7d4af68d8f933b2dc42bf6084b9646f64c
src/views/newSpecialWorkSystem/workTicket/sqjl/index.vue
@@ -6,22 +6,25 @@
                    <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="结束时间" />
          <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.trim="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>
          <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>-->
          <el-cascader :teleported="false" v-model="searPara.secondDepId" :options="departmentList" :props="casProps"
                       :show-all-levels="false"/>
                      </div>
                      <div class="basic-line">
                        <span>作业类型:</span>
@@ -56,7 +59,8 @@
                                </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="作业编号" align="center">
                                <template #default="scope">
                                  {{scope.row.workPermitNo?scope.row.workPermitNo:'—'}}
@@ -68,23 +72,36 @@
                                <el-table-column property="workTypeDesc" label="作业类型" align="center"/>
                                <el-table-column label="作业单位" align="center">
                                  <template #default="scope">
                                    <span v-if="scope.row.workDepList && scope.row.workDepList.length>0">{{scope.row.workDepList.map(i=>i.workDepName).join(',')}}</span>
                <span
                    v-if="scope.row.workDepList && scope.row.workDepList.length>0">{{ scope.row.workDepList.map(i => i.workDepName).join(',') }}</span>
                                    <span v-else>{{scope.row.workDepName }}</span>
                                  </template>
                                </el-table-column>
                                <el-table-column property="headList" label="负责人及电话" align="center">
                                  <template #default="scope">
                                    {{scope.row.headList.map(i=>{return i.userName + '(' + i.phone+ ')' }).join(',')}}
                {{
                  scope.row.headList.map(i => {
                    return i.userName + '(' + i.phone + ')'
                  }).join(',')
                }}
                                  </template>
                                </el-table-column>
                                <el-table-column property="operatorList" label="作业人及电话" align="center">
                                  <template #default="scope">
                                    {{scope.row.operatorList.map(i=>{return i.userName + '(' + i.phone+ ')' }).join(',')}}
                {{
                  scope.row.operatorList.map(i => {
                    return i.userName + '(' + i.phone + ')'
                  }).join(',')
                }}
                                  </template>
                                </el-table-column>
                                <el-table-column property="guardianList" label="监护人及电话" align="center">
                                  <template #default="scope">
                                    {{scope.row.guardianList.map(i=>{return i.userName + '(' + i.phone+ ')' }).join(',')}}
                {{
                  scope.row.guardianList.map(i => {
                    return i.userName + '(' + i.phone + ')'
                  }).join(',')
                }}
                                  </template>
                                </el-table-column>
                                <el-table-column property="expStartTime" label="作业开始时间" align="center"/>
@@ -113,15 +130,22 @@
                                    <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 v-if="(scope.row.working?.workAllStatus == 3 || scope.row.working?.workAllStatus == 4 || scope.row.working?.workAllStatus == 5)&&!scope.row.renewalWorkApplyId" link type="primary" size="small" :icon="Edit" @click="continueRecord(scope.row)">一键续票</el-button>
                <el-button
                    v-if="(scope.row.working?.workAllStatus == 3 || scope.row.working?.workAllStatus == 4 || scope.row.working?.workAllStatus == 5)&&!scope.row.renewalWorkApplyId"
                    link type="primary" size="small" :icon="Edit" @click="continueRecord(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>
                <el-button link type="primary" size="small" :icon="Download" @click="downLoadRecord(scope.row)">
                  作业票预览
                </el-button>
                                    </template>
                                </el-table-column>
                            </el-table>
                            <div class="pageBtn">
                                <el-pagination v-model:currentPage="pageIndex1" v-model:page-size="pageSize1" :page-sizes="[10, 15]" small="false" background layout="total, sizes, prev, pager, next, jumper" :total="totalSize1" @size-change="handleSizeChange1" @current-change="handleCurrentChange1" />
            <el-pagination v-model:currentPage="pageIndex1" v-model:page-size="pageSize1" :page-sizes="[10, 15]"
                           small="false" background layout="total, sizes, prev, pager, next, jumper" :total="totalSize1"
                           @size-change="handleSizeChange1" @current-change="handleCurrentChange1"/>
                            </div>
                        </div>
                    </div>
@@ -321,15 +345,19 @@
    searPara: {}
    timeRange: Array<string>;
    lists: {}
  casProps: {}
}
interface type {
    id: number;
    name: string;
}
interface DepartmentState {
    depId: number;
    depName: string;
}
export default defineComponent({
    name: 'applys',
    components: {
@@ -352,11 +380,16 @@
            lists: {
              workerList: [],
              departList: [],
              departList2: [],
              deviceList: [],
              otherWorks: [],
              spList: [],
              riskList: []
      },
      casProps: {
        emitPath: false,
        value: 'depId',
        label: 'depName',
        checkStrictly: true
            },
            pageIndex1: 1,
            pageSize1: 10,
@@ -563,7 +596,6 @@
                state.departmentList = JSON.parse(JSON.stringify(res.data.data))
                recursion(state.departmentList);
                state.lists.departList = state.departmentList
                state.lists.departList2 = JSON.parse(JSON.stringify(res.data.data))[0].children[0].children.filter(i=>i.depId == 32 || i.depId == 48 || i.depId == 49 || i.depId == 50 || i.depId == 10 || i.depId == 41 || i.depId == 46 || i.depId == 47)
            } else {
                ElMessage({
                    type: 'warning',
@@ -713,7 +745,11 @@
      }
      const getOtherWork = async () => {
        let res = await workApplyApi().getOtherWork({pageSize: 999, pageIndex: 1, searchParams: {workPermitNo: '', workType: null}})
      let res = await workApplyApi().getOtherWork({
        pageSize: 999,
        pageIndex: 1,
        searchParams: {workPermitNo: '', workType: null}
      })
        if (res.data.code === '200') {
          state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data))
        } else {
@@ -795,7 +831,13 @@
        // 导出方法
        const downLoadRecord = (row: any) => {
            // let res = await workApplyApi().postPrinting(data);
            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=>{
      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'})
@@ -883,6 +925,7 @@
    height: calc(100vh - 144px);
    box-sizing: border-box;
    overflow: hidden;
    .demo-tabs {
        width: 100%;
        height: 100%;
@@ -895,6 +938,7 @@
            height: 100%;
        }
    }
    .homeCard {
        width: 100%;
        padding: 20px;
@@ -905,15 +949,18 @@
        .main-card {
            width: 100%;
            height: 100%;
            .cardTop {
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 20px;
                .mainCardBtn {
                    margin: 0;
                }
            }
            .pageBtn {
                height: 60px;
                display: flex;
@@ -923,15 +970,18 @@
                .demo-pagination-block + .demo-pagination-block {
                    margin-top: 10px;
                }
                .demo-pagination-block .demonstration {
                    margin-bottom: 16px;
                }
            }
        }
        &:last-of-type {
            height: calc(100% - 130px);
        }
    }
    .stepItem {
        display: flex;
        align-items: flex-start;
@@ -941,13 +991,16 @@
        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;
@@ -963,6 +1016,7 @@
            top: -30px;
            background: #d9ecff;
        }
        .stepCard {
            width: 100%;
            margin-top: -30px;
@@ -999,6 +1053,7 @@
                        margin-bottom: 0;
                    }
                }
                .approveUnit {
                    width: 100%;
                    font-size: 14px;
@@ -1007,6 +1062,7 @@
                    border: 1px solid #fff;
                    background: #ecf8ff;
                    border-radius: 6px;
                    .item-tit {
                        width: 100%;
                        display: flex;
@@ -1018,15 +1074,18 @@
                        & > span {
                            flex: 1;
                            &:last-of-type{
                                text-align: center;
                            }
                        }
                        & > div {
                            flex: 1;
                            text-align: center;
                        }
                    }
                    .item-cont {
                        width: 100%;
                        display: flex;
@@ -1037,10 +1096,12 @@
                        & > span {
                            flex: 1;
                            &:last-of-type{
                                text-align: center;
                            }
                        }
                        & > div {
                            flex: 1;
                            text-align: center;
@@ -1051,19 +1112,23 @@
                                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;
@@ -1072,6 +1137,7 @@
                    background: #ecf8ff;
                    border: 1px solid #fff;
                    border-radius: 6px;
                    .item-tit {
                        width: 100%;
                        display: flex;
@@ -1084,11 +1150,13 @@
                        & > span {
                            flex: 1;
                        }
                        & > div {
                            flex: 2;
                            text-align: center;
                        }
                    }
                    .item-cont {
                        width: 100%;
                        display: flex;
@@ -1100,6 +1168,7 @@
                        & > span {
                            flex: 1;
                        }
                        & > div {
                            flex: 2;
                            text-align: center;
@@ -1111,14 +1180,17 @@
                                justify-content: center;
                                align-items: flex-start;
                                margin-bottom: 10px;
                                span {
                                    width: 50%;
                                    &:first-of-type {
                                        width: 25%;
                                    }
                                }
                            }
                        }
                        &:last-of-type {
                            border-bottom: 0;
                        }
@@ -1126,21 +1198,26 @@
                }
            }
        }
        &:hover .card-header {
            color: #0098f5;
        }
        &:hover .stepNum {
            border: 2px solid #0098f5;
            color: #0098f5;
        }
    }
    .el-row {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        &:last-child {
            margin-bottom: 0;
        }
        .grid-content {
            align-items: center;
            min-height: 36px;
@@ -1158,6 +1235,7 @@
            }
        }
    }
    .el-card {
        border: 0;
    }