Administrator
2021-08-30 d692738bc337f86307939a728c21720de268be9b
工作汇报修改
2 files modified
79 ■■■■ changed files
src/api/system/dict.js 8 ●●●●● patch | view | raw | blame | history
src/views/workreport/workreport.vue 71 ●●●● patch | view | raw | blame | history
src/api/system/dict.js
@@ -87,3 +87,11 @@
    params,
  })
}
export const getDictionaryBiz = (params) => {
    return request({
        url: '/api/blade-system/dict-biz/dictionary',
        method: 'get',
        params,
    })
}
src/views/workreport/workreport.vue
@@ -52,7 +52,7 @@
} from "@/api/workreport/workreport";
import { getDept } from "@/api/system/dept";
import { mapGetters } from "vuex";
import { getDictionaryBiz } from "@/api/system/dict";
export default {
  data() {
    return {
@@ -245,27 +245,31 @@
      //     ? (that.deptCategory = true)
      //     : (that.deptCategory = false);
        //1:保安公司  2:公安  3:培训公司
        if(this.userInfo.role_name=="保安公司管理员"
        || this.userInfo.role_name=="保安"
        || this.userInfo.role_name=="未持证保安"
      if (
        this.userInfo.role_name == "保安公司管理员" ||
        this.userInfo.role_name == "保安"
        ){
             const column = that.findObject(that.option.column, "category");
             column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=securityWorkReportCategory";
             const columnReceivedIds = that.findObject(that.option.column, "receivedIds");
             columnReceivedIds.dicUrl = "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId="+that.userInfo.dept_id;
        }
        if(this.userInfo.role_name=="公安管理员"){
             const column = that.findObject(that.option.column, "category");
             column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=workReportCategory";
             const columnReceivedIds = that.findObject(that.option.column, "receivedIds");
             columnReceivedIds.dicUrl = "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId="+that.userInfo.dept_id;
        }
        var code = {
          code: "securityWorkReportCategory",
        };
        getDictionaryBiz(code).then((res) => {
          // column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=securityWorkReportCategory";
          column.dicData = res.data.data;
          const columnReceivedIds = that.findObject(
            that.option.column,
            "receivedIds"
          );
          columnReceivedIds.dicUrl =
            "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId=" +
            that.userInfo.dept_id;
        params["deptId"] = this.deptId;
        params["userId"] = this.userId;
        // }
        let values = {
          ...params,
        };
@@ -277,7 +281,40 @@
          this.loading = false;
          this.selectionClear();
        });
      // });
        });
      }
      if (this.userInfo.role_name == "公安管理员") {
        const column = that.findObject(that.option.column, "category");
        var code1 = { code: "workReportCategory" };
        getDictionaryBiz(code1).then((res) => {
          // column.dicUrl = "/api/blade-system/dict-biz/dictionary?code=workReportCategory";
          column.dicData = res.data.data;
          const columnReceivedIds = that.findObject(
            that.option.column,
            "receivedIds"
          );
          columnReceivedIds.dicUrl =
            "/api/blade-system/dept/lazy-tree-users?type={{key}}&deptId=" +
            that.userInfo.dept_id;
          params["deptId"] = this.deptId;
          params["userId"] = this.userId;
          // }
          let values = {
            ...params,
          };
          this.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();
          });
        });
      }
    },
  },
};