From e86a968d1f00ed28d5e07d3b9ced55a77406bb37 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Sat, 28 Aug 2021 09:56:27 +0800
Subject: [PATCH] 考试列表,工作汇报,派遣记录修改
---
src/views/workreport/workreport.vue | 21 ++++--
src/views/exam/startexam.vue | 9 +-
src/views/dispatch/dispatchChildoperable.vue | 97 ++++++++++++++++++-------------
3 files changed, 74 insertions(+), 53 deletions(-)
diff --git a/src/views/dispatch/dispatchChildoperable.vue b/src/views/dispatch/dispatchChildoperable.vue
index 3de8361..d858ed2 100644
--- a/src/views/dispatch/dispatchChildoperable.vue
+++ b/src/views/dispatch/dispatchChildoperable.vue
@@ -23,7 +23,13 @@
</template>
<script>
-import { getdata1, adddata1, update1, remove1,getDispatcherUnitByDeptId} from "@/api/dispatch/dispatch";
+import {
+ getdata1,
+ adddata1,
+ update1,
+ remove1,
+ getDispatcherUnitByDeptId,
+} from "@/api/dispatch/dispatch";
import { getListByDeptId } from "@/api/system/user";
import { mapState } from "vuex";
@@ -269,15 +275,14 @@
},
};
},
- created () {
-
-
- if(this.userInfo.role_name=="保安公司管理员"){
- const deptColumn = this.findObject(this.option1.column, "deptId");
-
- deptColumn.search = false;
-
- }
+ created() {
+ if (this.userInfo.role_name == "保安公司管理员") {
+ const deptColumn = this.findObject(this.option1.column, "deptId");
+ deptColumn.search = false;
+ }else{
+ const deptColumn = this.findObject(this.option1.column, "dispatcherUnitId");
+ deptColumn.search = false;
+ }
},
computed: {
// },
@@ -291,11 +296,11 @@
...mapState({
userInfo: (state) => state.user.userInfo,
}),
- deps(){
+ deps() {
return this.form.deptId;
- }
+ },
},
-
+
methods: {
handleChangeTABS(column) {
this.typeTABS = column;
@@ -425,12 +430,12 @@
beforeOpen(done, type) {
var that = this;
- if (["add","edit", "view"].includes(type)) {
- if(this.userInfo.role_name=="保安公司管理员"){
- getListByDeptId(that.userInfo.dept_id).then((res)=>{
+ if (["add", "edit", "view"].includes(type)) {
+ if (this.userInfo.role_name == "保安公司管理员") {
+ getListByDeptId(that.userInfo.dept_id).then((res) => {
const userColumn = that.findObject(this.option1.column, "userIds");
userColumn.dicData = res.data.data;
- })
+ });
}
}
this.initFlag = true;
@@ -478,13 +483,13 @@
};
}
- if(this.userInfo.role_name=="保安公司管理员"){
+ if (this.userInfo.role_name == "保安公司管理员") {
const deptColumn = this.findObject(this.option1.column, "deptId");
deptColumn.disabled = true;
// deptColumn.search = false; //会报错
deptColumn.value = this.userInfo.dept_id;
this.initData(2);
- }else{
+ } else {
this.initData(1);
}
@@ -499,34 +504,44 @@
this.data1 = data.records;
this.loading1 = false;
// this.$nextTick(() => this.$refs.crudrec1.dicInit("cascader"));
- console.log(this.form,111111);
+ console.log(this.form, 111111);
});
},
- initData(type){
+ initData(type) {
var that = this;
- if(type==1){
- getDispatcherUnitByDeptId(null).then((res)=>{
- const dispatcherUnitIdColumn = that.findObject(this.option1.column, "dispatcherUnitId");
- dispatcherUnitIdColumn.dicData = res.data.data;
-
- })
+ if (type == 1) {
+ getDispatcherUnitByDeptId(null).then((res) => {
+ const dispatcherUnitIdColumn = that.findObject(
+ this.option1.column,
+ "dispatcherUnitId"
+ );
+ console.log(res.data.data,111);
+ dispatcherUnitIdColumn.dicData = res.data.data;
+ });
}
- if(type==2){
- getDispatcherUnitByDeptId(that.userInfo.dept_id).then((res)=>{
- const dispatcherUnitIdColumn = that.findObject(this.option1.column, "dispatcherUnitId");
- dispatcherUnitIdColumn.dicData = res.data.data;
- })
+ if (type == 2) {
+ getDispatcherUnitByDeptId(that.userInfo.dept_id).then((res) => {
+ const dispatcherUnitIdColumn = that.findObject(
+ this.option1.column,
+ "dispatcherUnitId"
+ );
+ dispatcherUnitIdColumn.dicData = res.data.data;
+ });
+ getListByDeptId(that.userInfo.dept_id).then((res) => {
+ const userIdsColumn = that.findObject(this.option1.column, "userIds");
+ userIdsColumn.dicData = res.data.data;
+ });
}
- }
+ },
},
- watch: {
- // "form.deptId"() {
- // this.initData();
- // }
- deps(){
- console.log(this.deps,5646646)
- }
- },
+ // watch: {
+ // // "form.deptId"() {
+ // // this.initData();
+ // // }
+ // deps(){
+ // console.log(this.deps,5646646)
+ // }
+ // },
mounted() {
this.onLoad1(this.page1, this.query1);
},
diff --git a/src/views/exam/startexam.vue b/src/views/exam/startexam.vue
index 5a429d7..fc874e2 100644
--- a/src/views/exam/startexam.vue
+++ b/src/views/exam/startexam.vue
@@ -54,6 +54,7 @@
<template slot="menuLeft">
<el-button
+ style="display:none"
type="danger"
size="small"
icon="el-icon-delete"
@@ -108,14 +109,14 @@
form: {},
questionBankOption: {
// 操作栏多余按钮去除
- delBtn: true,
- editBtn: true,
- addBtn: true,
+ delBtn: false,
+ editBtn: false,
+ addBtn: false,
selection: true,
menu: true,
// 导出按钮
excelBtn: false,
- viewBtn: true,
+ viewBtn: false,
// title: '题库',
diff --git a/src/views/workreport/workreport.vue b/src/views/workreport/workreport.vue
index 4a9c1dd..a955138 100644
--- a/src/views/workreport/workreport.vue
+++ b/src/views/workreport/workreport.vue
@@ -239,20 +239,25 @@
).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((res) => {
+ // var deptCategory = res.data.data.deptCategory;
+ // deptCategory == 1
+ // ? (that.deptCategory = true)
+ // : (that.deptCategory = false);
+
+
//1:保安公司 2:公安 3:培训公司
- if(deptCategory == 1 || deptCategory == 3){
+ if(this.userInfo.role_name=="保安公司管理员"
+ || 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(deptCategory == 2){
+ 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");
@@ -272,7 +277,7 @@
this.loading = false;
this.selectionClear();
});
- });
+ // });
},
},
};
--
Gitblit v1.9.3