马宇豪
2025-03-04 1b9fea7d4af68d8f933b2dc42bf6084b9646f64c
src/views/newSpecialWorkSystem/workTicket/wdsq/index.vue
@@ -6,22 +6,16 @@
                    <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="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-cascader :teleported="false" v-model="searPara.secondDepId" :options="departmentList" :props="casProps" :show-all-levels="false"/>
                      </div>
                      <div class="basic-line">
                        <span>作业类型:</span>
@@ -55,35 +49,49 @@
                                </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:'—'}}
                                  </template>
                                </el-table-column>
                                <el-table-column property="seDepName" label="事业部" align="center"/>
            <el-table-column property="seDepName" label="部门" align="center"/>
                                <el-table-column property="applyDepName" label="作业所在车间" align="center"/>
                                <el-table-column property="workContent" label="作业内容" align="center"/>
                                <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"/>
@@ -105,26 +113,37 @@
                                </el-table-column>
                                <el-table-column label="风险研判" align="center">
                                    <template #default="scope">
                                        <el-button v-if="scope.row.status == 0" link type="primary" size="small" @click="openReport('上传', scope.row)">上传研判报告</el-button>
                <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 == 15">已取消</el-tag>
                                        <el-tag type="danger" v-else-if="scope.row.status == 16">已废止</el-tag>
                                        <el-button v-else link type="primary" size="small" @click="openReport('查看', scope.row)">查看研判报告</el-button>
                <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="150">
                                    <template #default="scope">
                                        <span v-if="scope.row.status == 16">已废止</span>
                                        <span v-if="scope.row.status == 15">已取消</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 == 0 || scope.row.status == 1" link type="danger" size="small"
                           :icon="Delete" @click="abortRecordBtn(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.status == 0 || scope.row.status == 1" link type="primary" size="small" v-throttle :icon="Edit" @click="openEdit(scope.row)">修改</el-button>
                                        <el-button link type="success" v-throttle v-if="scope.row.status == 0 || scope.row.status == 1" size="small" :icon="Download" @click="checkTicket(scope.row)">正式办票</el-button>
                <el-button v-if="scope.row.status == 0 || scope.row.status == 1" link type="primary" size="small"
                           v-throttle :icon="Edit" @click="openEdit(scope.row)">修改
                </el-button>
                <el-button link type="success" v-throttle v-if="scope.row.status == 0 || scope.row.status == 1"
                           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>
                            </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>
@@ -202,15 +221,19 @@
    timeRange: Array<string>;
    dep4List: Array<type>;
    lists: {}
  casProps: {}
}
interface type {
    id: number;
    name: string;
}
interface DepartmentState {
    depId: number;
    depName: string;
}
export default defineComponent({
    name: 'myApply',
    components: {
@@ -257,6 +280,12 @@
              headUserName: '',
              secondDepId: null
            },
      casProps: {
        emitPath: false,
        value: 'depId',
        label: 'depName',
        checkStrictly: true
      },
            timeRange: [],
            applyData: [],
            workTimeList: [],
@@ -293,12 +322,7 @@
            spList: [],
            riskList: []
          },
          dep4List: [
            {id:49,name:'电石事业部'},
            {id:50,name:'电力事业部'},
            {id:48,name:'有机化工事业部'},
            {id:32,name:'甲醇事业部'}
          ],
      dep4List: [],
          statusList: [
            {
              value: 0,
@@ -534,7 +558,7 @@
                state.departmentList = JSON.parse(JSON.stringify(res.data.data))
                recursion(state.departmentList);
                state.lists.departList = JSON.parse(JSON.stringify(res.data.data))
                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)
        // 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',
@@ -543,7 +567,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 {
@@ -713,7 +741,17 @@
        // 导出方法
        const exportSheet = async () => {
            // let res = await workApplyApi().postPrinting(data);
            axios.post(import.meta.env.VITE_API_URL + `/specialwork9step/work/export/excel`,{startTime: state.searPara.startTime,endTime: state.searPara.endTime,secondDepId: state.searPara.secondDepId},{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/export/excel`, {
        startTime: state.searPara.startTime,
        endTime: state.searPara.endTime,
        secondDepId: state.searPara.secondDepId
      }, {
        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/excel'})
@@ -813,6 +851,7 @@
    height: calc(100vh - 144px);
    box-sizing: border-box;
    overflow: hidden;
    .demo-tabs {
        width: 100%;
        height: 100%;
@@ -825,6 +864,7 @@
            height: 100%;
        }
    }
    .homeCard {
        width: 100%;
        padding: 20px;
@@ -835,15 +875,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;
@@ -853,22 +896,27 @@
                .demo-pagination-block + .demo-pagination-block {
                    margin-top: 10px;
                }
                .demo-pagination-block .demonstration {
                    margin-bottom: 16px;
                }
            }
        }
        &:last-of-type {
            height: calc(100% - 130px);
        }
    }
    .el-row {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        &:last-child {
            margin-bottom: 0;
        }
        .grid-content {
            align-items: center;
            min-height: 36px;
@@ -886,6 +934,7 @@
            }
        }
    }
    .el-card {
        border: 0;
    }