spring
2025-02-18 0c296ab5e1e4ed1eaab1940f85959ed66f68fbe7
src/views/performance/manHour/workTimeManagement.vue
@@ -75,6 +75,7 @@
          placeholder="全部"
          size="small"
          @change="refreshTable()"
          clearable
        >
          <el-option
            v-for="item in stateList"
@@ -173,16 +174,18 @@
        :column="column"
        :page="page"
        :tableLoading="tableLoading"
        :height="'calc(100vh - 320px)'"
        :height="'calc(100vh - 350px)'"
        :isSelection="true"
        v-if="currentTable == 'ValueTable0'"
        @pagination="pagination"
        :handleSelectionChange="handleSelectionChange"
      ></lims-table>
      <lims-table
        :tableData="tableData0"
        :column="column0"
        :page="page0"
        :tableLoading="tableLoading"
        :height="'calc(100vh - 320px)'"
        :height="'calc(100vh - 350px)'"
        v-if="currentTable == 'ValueTable1'"
        @pagination="pagination0"
      ></lims-table>
@@ -466,7 +469,6 @@
  exportOutputHours,
} from "@/api/performance/manHour";
import limsTable from "@/components/Table/lims-table.vue";
import { checkPermi } from "@/utils/permission"; // 权限判断函数
export default {
  components: {
    ValueTable,
@@ -648,7 +650,7 @@
      page: {
        total: 0,
        size: 10,
        current: 0,
        current: 1,
      },
      tableLoading: false,
      tableData0: [],
@@ -670,7 +672,7 @@
      page0: {
        total: 0,
        size: 10,
        current: 0,
        current: 1,
      },
      shifList: [],
    };
@@ -743,7 +745,6 @@
    this.getList0();
  },
  methods: {
    checkPermi,
    getList(entity) {
      this.tableLoading = true;
      let param = {};
@@ -751,6 +752,7 @@
        param = { ...entity, ...this.page };
      } else {
        param = { ...this.entity, ...this.page };
        param.dateTime = JSON.stringify(param.dateTime);
      }
      delete param.total;
      selectAuxiliaryWorkingHoursDay({ ...param })
@@ -772,6 +774,7 @@
        param = { ...entity, ...this.page0 };
      } else {
        param = { ...this.entity, ...this.page0 };
        param.dateTime = JSON.stringify(param.dateTime);
      }
      delete param.total;
      selectAuxiliaryOutputWorkingHours({ ...param })
@@ -786,13 +789,15 @@
          this.tableLoading = false;
        });
    },
    pagination(current, size) {
      this.page.current = current;
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    pagination0(current, size) {
      this.page0.current = current;
      this.getList();
    pagination0({ page, limit }) {
      this.page0.current = page;
      this.page0.size = limit;
      this.getList0();
    },
    /** 将时间选择器默认选为当天的日期 */
    setDate() {
@@ -947,7 +952,23 @@
      }
    },
    batchCheck(e) {
      this.$refs.ValueTable0.batchCheck(e);
      const list = JSON.parse(JSON.stringify(this.ValueTable0Selected));
      const state = e === 0 ? "不批准" : "已批准";
      let auxiliaryWorkingHoursDays = [];
      list.forEach((item) => {
        delete item.orderBy;
        item.state = state;
        auxiliaryWorkingHoursDays.push(item);
      });
      approve({ auxiliaryWorkingHoursDays: auxiliaryWorkingHoursDays }).then(
        (res) => {
          if (res.code === 201) {
            return;
          }
          this.submitBatchCheckDialog();
          this.$message.success("操作成功");
        }
      );
    },
    closeBatchCheckDialog() {
      this.batchCheckDialog = false;
@@ -1036,7 +1057,7 @@
      }
      entity.weekDay = this.entity.weekDay;
      entity.name = this.entity.name;
      collectWorkingHours({ entity: entity }).then((res) => {
      collectWorkingHours(entity).then((res) => {
        this.totalInfo = res.data;
      });
    },
@@ -1047,22 +1068,22 @@
    },
    getInfoByCode() {
      if (this.formData.number) {
        selectAuxiliaryWorkingHoursByNumber(this.formData.number).then(
          (res) => {
            this.auxiliaryWorking = res.data;
            if (this.addVisible) {
              this.formData.approvedWorkingHour =
                this.auxiliaryWorking.approvedWorkingHour;
              this.formData.auxiliaryProject =
                this.auxiliaryWorking.auxiliaryProject;
            } else if (this.title == "审核" && this.checkVisible) {
              this.formData0.approvedWorkingHour =
                this.auxiliaryWorking.approvedWorkingHour;
              this.formData0.auxiliaryProject =
                this.auxiliaryWorking.auxiliaryProject;
            }
        selectAuxiliaryWorkingHoursByNumber({
          number: this.formData.number,
        }).then((res) => {
          this.auxiliaryWorking = res.data;
          if (this.addVisible) {
            this.formData.approvedWorkingHour =
              this.auxiliaryWorking.approvedWorkingHour;
            this.formData.auxiliaryProject =
              this.auxiliaryWorking.auxiliaryProject;
          } else if (this.title == "审核" && this.checkVisible) {
            this.formData0.approvedWorkingHour =
              this.auxiliaryWorking.approvedWorkingHour;
            this.formData0.auxiliaryProject =
              this.auxiliaryWorking.auxiliaryProject;
          }
        );
        });
      }
    },
    handleOut() {
@@ -1103,6 +1124,10 @@
          this.outLoading = false;
        });
    },
    handleSelectionChange(val) {
      // console.log(111, val);
      this.ValueTable0Selected = val;
    },
  },
};
</script>