shuishen
2021-09-03 2d50c51214f0ced8c992a415c72ea33b519fff59
src/views/workreport/workreport.vue
@@ -27,6 +27,7 @@
          size="small"
          icon="el-icon-delete"
          plain
          v-if="permission.workreport_delete"
          @click="handleDelete"
          >删 除
        </el-button>
@@ -41,7 +42,6 @@
</template>
<script>
import { workreportColumn } from "./data";
import {
  getListPage,
  remove,
@@ -51,6 +51,8 @@
} from "@/api/workreport/workreport";
import { getDept } from "@/api/system/dept";
import { mapGetters } from "vuex";
import { mapState } from "vuex";
import { workreportColumn } from "./data";
export default {
  data() {
@@ -89,7 +91,7 @@
        excelBtn: false,
        menuWidth: 320,
        dialogClickModal: false,
        column: workreportColumn,
        column:workreportColumn,
      },
      data: [],
    };
@@ -98,10 +100,10 @@
    ...mapGetters(["permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.notice_add, false),
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.notice_edit, false),
        addBtn: this.vaildData(this.permission.workreport_add, false),
        viewBtn: this.vaildData(this.permission.workreport_view, false),
        delBtn: this.vaildData(this.permission.workreport_delete, false),
        editBtn: this.vaildData(this.permission.workreport_edit, false),
      };
    },
    ids() {
@@ -111,6 +113,9 @@
      });
      return ids.join(",");
    },
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
  },
  mounted() {},
  methods: {
@@ -139,6 +144,7 @@
    rowUpdate(row, index, done, loading) {
      row.deptId = this.deptId;
      row.userId = this.userId;
      row.category = 3;
      // row.receivedIds = row.receivedIds.join(",");
      update(row).then(
        () => {
@@ -238,36 +244,22 @@
      ).content.user_id;
      var that = this;
      getDept(this.deptId).then((res) => {
        var deptCategory = res.data.data.deptCategory;
        deptCategory == 1
          ? (that.deptCategory = true)
          : (that.deptCategory = false);
      getDept(this.deptId).then(() => {
        const columnReceivedIds = that.findObject(that.option.column, "receivedIds");
        columnReceivedIds.dicUrl = "/api/blade-system/dept/lazy-tree-users?type=3&deptId="+that.deptId;
        params["deptId"] = that.deptId;
        params["userId"] = that.userId;
        // const { releaseTimeRange } = this.query;
        // if (that.deptCategory) {
        params["deptId"] = this.deptId;
        params["userId"] = this.userId;
        // }
        let values = {
          ...params,
        };
        // if (releaseTimeRange) {
        //   values = {
        //     ...params,
        //     startTime: releaseTimeRange[0],
        //     endTime: releaseTimeRange[1],
        //     ...this.query,
        //   };
        //   values.releaseTimeRange = null;
        // }
        this.loading = true;
        that.loading = true;
        getListPage(page.currentPage, page.pageSize, values).then((res) => {
          const data = res.data.data;
          this.page.total = data.total;
          this.data = data.records;
          this.loading = false;
          this.selectionClear();
          that.page.total = data.total;
          that.data = data.records;
          that.loading = false;
          that.selectionClear();
        });
      });
    },