马宇豪
2025-03-04 1b9fea7d4af68d8f933b2dc42bf6084b9646f64c
src/views/newSpecialWorkSystem/workTicket/zysq/index.vue
@@ -25,6 +25,9 @@
         <el-tab-pane :lazy="true" label="盲板抽堵作业" name="plate">
            <plate-form ref="plate" :lists="lists"></plate-form>
         </el-tab-pane>
      <el-tab-pane :lazy="true" label="打开作业" name="open">
        <open-form ref="open" :lists="lists"></open-form>
      </el-tab-pane>
      </el-tabs>
<!--    <material-dialog ref="material"></material-dialog>-->
<!--    <el-radio-group v-model="activeName" size="large" @change="(value)=>handleClick(value)">-->
@@ -81,6 +84,7 @@
         heightForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/height.vue')),
         powerForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/power.vue')),
         plateForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/plate.vue')),
      openForm: defineAsyncComponent(() => import('/@/views/newSpecialWorkSystem/workTicket/zysq/components/open.vue')),
      },
      setup() {
         const userInfo = useUserInfo()
@@ -90,10 +94,10 @@
        lists: {
          workerList: [],
          departList: [],
          departList2: [],
          deviceList: [],
          otherWorks: [],
          spList: []
          spList: [],
          riskList: []
        },
        activeName: 'fire',
            allWorkers: [],
@@ -110,6 +114,7 @@
      const height = ref()
      const power = ref()
      const plate = ref()
      const open = ref()
      const handleClick = (tab: TabsPaneContext, event: Event) => {
        state.loading = true
@@ -139,11 +144,13 @@
      // 页面载入时执行方法
      onMounted(() => {
        getAll();
        getAllDepartment();
        getAllDevice();
        getOtherWork();
        getAll()
        getAllDepartment()
        getAllDevice()
        getOtherWork()
        spWorker()
        getOpList()
        getAllRisks()
      });
         // 获取用户列表
@@ -161,18 +168,18 @@
         };
      const spWorker = async ()=>{
        for(let id of ['17','18','19']){
        for(let id of ['18','19']){
          const res = await workApplyApi().getSpList({roleId: id})
          if(id == '17'){
            if (res.data.code === '200') {
              state.lists.spList.opList = JSON.parse(JSON.stringify(res.data.data))
            } else {
              ElMessage({
                type: 'warning',
                message: res.data.msg
              });
            }
          }
          // if(id == '17'){
          //   if (res.data.code === '200') {
          //     state.lists.spList.opList = JSON.parse(JSON.stringify(res.data.data))
          //   } else {
          //     ElMessage({
          //       type: 'warning',
          //       message: res.data.msg
          //     });
          //   }
          // }
          if(id == '18'){
            if (res.data.code === '200') {
              state.lists.spList.jhList = JSON.parse(JSON.stringify(res.data.data))
@@ -196,6 +203,29 @@
        }
      }
      const getOpList = async()=>{
        const res = await workApplyApi().getOpList()
        if(res.data.code == '200'){
          if(res.data.data && res.data.data.length>0){
            state.lists.spList.opList = JSON.parse(JSON.stringify(res.data.data)).map(i=>{
              if(i.certList && i.certList.length>0){
                i.certList = i.certList.map(item=>{
                  item['realName'] = i.realName + '(' + item.certTypeName +':'+ item.certExpiredAt + ')'
                  item['uid'] = item.certNo + ',' + item.certExpiredAt
                  return item
                })
              }
              return i
            })
          }
        }else{
          ElMessage({
            type: 'warning',
            message: res.data.msg
          })
        }
      }
         // 获取部门列表
         const getAllDepartment = async () => {
            let res = await teamManageApi().getAllDepartment();
@@ -203,7 +233,6 @@
               // state.departmentList = JSON.parse(JSON.stringify(res.data.data))
          // state.departmentList2 = state.departmentList[0].children[0].children.filter(i=>i.depId == 32 || i.depId == 48 || i.depId == 49 || i.depId == 50)
          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)
            } else {
               ElMessage({
                  type: 'warning',
@@ -214,7 +243,7 @@
      // 获取相关作业列表
      const getOtherWork = async () => {
        let res = await workApplyApi().getOtherWork({workPermitNo: '',workType: null});
        let res = await workApplyApi().getOtherWork({pageSize: 999, pageIndex: 1, searchParams: {workPermitNo: '', workType: null}})
        if (res.data.code === '200') {
          state.otherWorks = JSON.parse(JSON.stringify(res.data.data))
          state.lists.otherWorks = JSON.parse(JSON.stringify(res.data.data))
@@ -240,6 +269,20 @@
        }
      };
      // 获取设备列表
      const getAllRisks = async ()=>{
        const res = await workApplyApi().getAllRiskIdentity()
        if (res.data.code === '200') {
          // state.allDevices = JSON.parse(JSON.stringify(res.data.data))
          state.lists.riskList = JSON.parse(JSON.stringify(res.data.data))
        } else {
          ElMessage({
            type: 'warning',
            message: res.data.msg
          });
        }
      };
         return {
            ...toRefs(state),
        fire,
@@ -250,6 +293,7 @@
        hoist,
        plate,
        power,
        open,
        handleClick,
        getOtherWork
         };