batman
2023-03-15 f7bd94cf4a3d6ce6b06c2f90413f6798c488481d
src/views/specialWorkSystem/specialIndex/index.vue
@@ -69,12 +69,12 @@
                active-text="作业人"
                inactive-text="监护人"
            />
            <el-radio-group v-model="chartSearch4.days" size="small" @change="(value)=>changeTime2(value)">
              <el-radio :label='7' border>近7天</el-radio>
              <el-radio :label='30' border>近30天</el-radio>
              <el-radio :label='90' border>近90天</el-radio>
              <el-radio :label='365' border>近一年</el-radio>
            </el-radio-group>
            <el-select :teleported="false" v-model="chartSearch4.period" size="small">
              <el-option label="近7天" value="week"/>
              <el-option label="近30天" value="month"/>
              <el-option label="近90天" value="season"/>
              <el-option label="近1年" value="year"/>
            </el-select>
            <el-select :teleported="false" v-model="chartSearch4.workType" size="small">
              <el-option
                  v-for="item in workType1"
@@ -550,7 +550,7 @@
    });
    // 页面载入时执行方法
    onMounted(() => {
      getListByPage();
      // getListByPage();
      getAllDepartment();
      initZyfb()
      initSlfx()
@@ -777,7 +777,7 @@
    }
    // 刷新
    const reLoadData = async () => {
      getListByPage();
      // getListByPage();
    };
    // 填写表单
@@ -802,29 +802,29 @@
    };
    // 分页获取列表
    const getListByPage = async () => {
      const dateRange = JSON.parse(JSON.stringify(state.searchDate))
      if(dateRange[1]){dateRange[1] = dateRange[1].replace('00:00:00','23:59:59')}
      const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord, applyDepId: state.searchDep,applyStartTime: dateRange[0],applyEndTime: dateRange[1]} };
      let res = await workApplyApi().getApplyList(data);
      if (res.data.code === '200') {
        state.workData = JSON.parse(JSON.stringify(res.data.data));
        state.workData = state.workData.map((item) => {
          if (item.operators == null || item.operators == []) {
            item.operators = [];
          } else {
            item.operators = Array.from(item.operators, ({ operatorUname }) => operatorUname);
          }
          return item;
        });
        state.totalSize1 = res.data.total;
      } else {
        ElMessage({
          type: 'warning',
          message: res.data.msg
        });
      }
    };
    // const getListByPage = async () => {
    //   const dateRange = JSON.parse(JSON.stringify(state.searchDate))
    //   if(dateRange[1]){dateRange[1] = dateRange[1].replace('00:00:00','23:59:59')}
    //   const data = { pageSize: state.pageSize1, pageIndex: state.pageIndex1, searchParams: { workType: state.searchWord, applyDepId: state.searchDep,applyStartTime: dateRange[0],applyEndTime: dateRange[1]} };
    //   let res = await workApplyApi().getApplyList(data);
    //   if (res.data.code === '200') {
    //     state.workData = JSON.parse(JSON.stringify(res.data.data));
    //     state.workData = state.workData.map((item) => {
    //       if (item.operators == null || item.operators == []) {
    //         item.operators = [];
    //       } else {
    //         item.operators = Array.from(item.operators, ({ operatorUname }) => operatorUname);
    //       }
    //       return item;
    //     });
    //     state.totalSize1 = res.data.total;
    //   } else {
    //     ElMessage({
    //       type: 'warning',
    //       message: res.data.msg
    //     });
    //   }
    // };
    // 表格数据格式化
    const toNames = (row, column, cellValue, index) => {
@@ -851,7 +851,7 @@
          message: '请输入查询关键词'
        });
      } else {
        getListByPage();
        // getListByPage();
      }
    };
    // 重置搜索
@@ -859,16 +859,16 @@
      state.searchWord = null;
      state.searchDep = null;
      state.searchDate = []
      getListByPage();
      // getListByPage();
    };
    const handleSizeChange1 = (val: number) => {
      state.pageSize1 = val;
      getListByPage();
      // getListByPage();
    };
    const handleCurrentChange1 = (val: number) => {
      state.pageIndex1 = val;
      getListByPage();
      // getListByPage();
    };
    // 查看记录
@@ -962,7 +962,7 @@
      searchRecord,
      clearSearch,
      viewRecord,
      getListByPage,
      // getListByPage,
      handleSizeChange1,
      handleCurrentChange1,
      ...toRefs(state)