|
@@ -9,28 +9,28 @@
|
|
|
top="50px"
|
|
|
>
|
|
|
<el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
|
|
|
- <el-form-item :label='$t("calssSchedule.table.staffChange.auditUser")+":"' prop="applyUserId">
|
|
|
- <el-cascader
|
|
|
- v-model="tenant.applyUserId"
|
|
|
- key="1"
|
|
|
- :options="applyList"
|
|
|
- :props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}"
|
|
|
- :show-all-levels="false"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :placeholder='$t("common.pleaseSelect")'
|
|
|
- style="width: 100%;"
|
|
|
- @change="cascaderChange"
|
|
|
- >
|
|
|
- </el-cascader>
|
|
|
- </el-form-item>
|
|
|
+<!-- <el-form-item :label='$t("calssSchedule.table.staffChange.auditUser")+":"' prop="applyUserId">-->
|
|
|
+<!-- <el-cascader-->
|
|
|
+<!-- v-model="tenant.applyUserId"-->
|
|
|
+<!-- key="1"-->
|
|
|
+<!-- :options="deptUserList"-->
|
|
|
+<!-- :props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}"-->
|
|
|
+<!-- :show-all-levels="false"-->
|
|
|
+<!-- filterable-->
|
|
|
+<!-- clearable-->
|
|
|
+<!-- :placeholder='$t("common.pleaseSelect")'-->
|
|
|
+<!-- style="width: 100%;"-->
|
|
|
+<!-- @change="cascaderChange"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- </el-cascader>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
<el-form-item :label='$t("calssSchedule.table.staffChange.applyTime")+":"' prop="applyTime">
|
|
|
<el-date-picker v-model="tenant.applyTime" type="date" value-format="yyyy-MM-dd" :placeholder='$t("common.pleaseSelect")' style="width: 100%;" @change="dateChange"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
- <el-form-item :label='$t("calssSchedule.table.staffChange.model")+":"' prop="applyList" style="border-bottom: 1px solid #EEEEEE;">
|
|
|
+ <el-form-item :label='$t("calssSchedule.table.staffChange.model")+":"' prop="" style="border-bottom: 1px solid #EEEEEE;">
|
|
|
<template>
|
|
|
<el-checkbox-group v-model="tenant.applyList">
|
|
|
- <el-checkbox v-for="item in applyCheckbox" :key="item.id" :label="item.id">{{item.name.data}}</el-checkbox>
|
|
|
+ <el-checkbox v-for="item in this.applyCheckbox" :key="item.id" :label="item.id">{{item.name.data}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
@@ -39,7 +39,7 @@
|
|
|
<el-cascader
|
|
|
v-model="tenant.changeUserId"
|
|
|
key="2"
|
|
|
- :options="applyList"
|
|
|
+ :options="deptUserList"
|
|
|
:props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}"
|
|
|
:show-all-levels="false"
|
|
|
filterable
|
|
@@ -56,7 +56,7 @@
|
|
|
<el-form-item :label='$t("calssSchedule.table.staffChange.remark")+":"' prop="changeList">
|
|
|
<template>
|
|
|
<el-checkbox-group v-model="tenant.changeList">
|
|
|
- <el-checkbox v-for="item in updateCheckbox" :key="item.id" :label="item.id">{{item.name.data}}</el-checkbox>
|
|
|
+ <el-checkbox v-for="item in this.updateCheckbox" :key="item.id" :label="item.id">{{item.name.data}}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
@@ -74,6 +74,7 @@
|
|
|
import classesMgrApi from "@/api/classScheduleMgr/classesMgr"
|
|
|
// 【部门组织】-API
|
|
|
import orgApi from "@/api/Org"
|
|
|
+ import userApi from "@/api/User"
|
|
|
// 【日期格式化】组件
|
|
|
import moment from "moment"
|
|
|
|
|
@@ -96,7 +97,8 @@ export default {
|
|
|
screenWidth: 0,
|
|
|
width: this.initWidth(),
|
|
|
confirmDisabled: false,
|
|
|
- applyList: [],
|
|
|
+ loginUserId: null,
|
|
|
+ deptUserList: [],
|
|
|
applyCheckbox: [], // 【更换班表-申请人】
|
|
|
updateCheckbox: [], // 【更换班表-更换人】
|
|
|
dicts:{
|
|
@@ -104,9 +106,9 @@ export default {
|
|
|
},
|
|
|
roles: [],
|
|
|
rules: {
|
|
|
- applyUserId: [
|
|
|
- { required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
- ],
|
|
|
+ // applyUserId: [
|
|
|
+ // { required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
+ // ],
|
|
|
changeUserId: [
|
|
|
{ required: true, message: this.$t("rules.require"), trigger: 'change' }
|
|
|
],
|
|
@@ -138,6 +140,8 @@ export default {
|
|
|
},
|
|
|
mounted () {
|
|
|
// this.applyList = this.$constWKS.CASCADERLIST,
|
|
|
+ // 获取当前用户
|
|
|
+ this.getCurrUser()
|
|
|
// 部门人员-级联数据
|
|
|
this.getDeptUser()
|
|
|
window.onresize = () => {
|
|
@@ -149,41 +153,42 @@ export default {
|
|
|
methods: {
|
|
|
// 【申请人】值变化事件
|
|
|
cascaderChange(userId){
|
|
|
- console.log("【申请人】值变化: ", userId)
|
|
|
// 【申请日期】的值
|
|
|
let date = this.tenant.applyTime
|
|
|
- if(!!date){
|
|
|
- // 查询【申请人】的班次列表
|
|
|
- this.applyClassList(true, userId, moment(date).format('YYYY-MM-DD'))
|
|
|
- }
|
|
|
+ // 查询【申请人】的班次列表
|
|
|
+
|
|
|
+ if(null != userId && userId != undefined && null != date && date != undefined){
|
|
|
+ this.applyClassList(true, userId, moment(date).format('YYYY-MM-DD'))
|
|
|
+ }
|
|
|
},
|
|
|
// 【申请日期】值变化事件
|
|
|
dateChange(val){
|
|
|
- let userId = this.tenant.applyUserId
|
|
|
- console.log("【申请日期】值变化: ", moment(val).format('YYYY-MM-DD'))
|
|
|
- if(!!userId){
|
|
|
- // 查询【申请人】的班次列表
|
|
|
- this.applyClassList(true, userId, moment(val).format('YYYY-MM-DD'))
|
|
|
- }
|
|
|
+ let userId = this.loginUserId
|
|
|
+ console.log(userId)
|
|
|
+ console.log(val)
|
|
|
+ console.log(null != userId && userId != undefined && null != val && val != undefined)
|
|
|
+ // 查询【申请人】的班次列表
|
|
|
+ if(null != userId && userId != undefined && null != val && val != undefined){
|
|
|
+ this.applyClassList(true, userId, moment(val).format('YYYY-MM-DD'))
|
|
|
+ }
|
|
|
},
|
|
|
// 【更换人】值变化事件
|
|
|
cascaderChange2(userId){
|
|
|
- console.log("【更换人】值变化: ", userId)
|
|
|
// 【更换日期】的值
|
|
|
let date = this.tenant.changeTime
|
|
|
- if(!!date){
|
|
|
// 查询【更换人】的班次列表
|
|
|
- this.applyClassList(false, userId, moment(date).format('YYYY-MM-DD'))
|
|
|
- }
|
|
|
+ console.log(null != userId && userId != undefined && null != date && date != undefined)
|
|
|
+ if(null != userId && userId != undefined && null != date && date != undefined){
|
|
|
+ this.applyClassList(false, userId, moment(date).format('YYYY-MM-DD'))
|
|
|
+ }
|
|
|
},
|
|
|
// 【更换日期】值变化事件
|
|
|
dateChange2(val){
|
|
|
let userId = this.tenant.changeUserId
|
|
|
- console.log("【更换日期】值变化: ", moment(val).format('YYYY-MM-DD'))
|
|
|
- if(!!userId){
|
|
|
- // 查询【更换人】的班次列表
|
|
|
- this.applyClassList(false, userId, moment(val).format('YYYY-MM-DD'))
|
|
|
- }
|
|
|
+ // 查询【更换人】的班次列表
|
|
|
+ if(null != userId && userId != undefined && null != val && val != undefined){
|
|
|
+ this.applyClassList(false, userId, moment(val).format('YYYY-MM-DD'))
|
|
|
+ }
|
|
|
},
|
|
|
initTenant () {
|
|
|
return {
|
|
@@ -209,7 +214,12 @@ export default {
|
|
|
setTenant (val, dicts) {
|
|
|
if(val){
|
|
|
this.tenant = { ...val }
|
|
|
+ this.type = "edit"
|
|
|
}
|
|
|
+ if(this.type ==="edit"){
|
|
|
+ this.applyClassList(true, val.applyUserId, val.applyTime)
|
|
|
+ this.applyClassList(false, val.changeUserId, val.changeTime)
|
|
|
+ }
|
|
|
// 字典表
|
|
|
this.dicts = dicts
|
|
|
},
|
|
@@ -223,8 +233,6 @@ export default {
|
|
|
this.tenant = this.initTenant()
|
|
|
},
|
|
|
submitForm () {
|
|
|
- //console.log("Form数据:", this.tenant)
|
|
|
- // return false
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.confirmDisabled = true
|
|
@@ -239,6 +247,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
save () {
|
|
|
+ this.tenant.applyUserId = this.loginUserId
|
|
|
shiftChangeMgrApi.save(this.tenant)
|
|
|
.then((response) => {
|
|
|
const res = response.data
|
|
@@ -259,6 +268,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
update () {
|
|
|
+ this.tenant.applyUserId = this.loginUserId
|
|
|
shiftChangeMgrApi.update(this.tenant)
|
|
|
.then((response) => {
|
|
|
const res = response.data
|
|
@@ -280,9 +290,10 @@ export default {
|
|
|
},
|
|
|
// 【更换班表】-列表数据
|
|
|
applyClassList(flag, val, date){
|
|
|
+ console.log(val)
|
|
|
+ console.log(date)
|
|
|
classesMgrApi.getListById({userId: val, date}).then(res => {
|
|
|
res = res.data
|
|
|
- console.log("【更换班表】-列表数据: ", res)
|
|
|
if (res.isSuccess) {
|
|
|
// 如果是【申请人-更换班表】
|
|
|
if(flag){
|
|
@@ -292,16 +303,26 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ console.log(this.applyCheckbox)
|
|
|
+ console.log(this.updateCheckbox)
|
|
|
},
|
|
|
// 【部门人员】-级联数据
|
|
|
getDeptUser(){
|
|
|
orgApi.getDeptUser({}).then(res => {
|
|
|
res = res.data
|
|
|
- // console.log("【部门人员】-级联数据: ", res)
|
|
|
if(res.isSuccess){
|
|
|
- this.applyList = res.data
|
|
|
+ this.deptUserList = res.data
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+
|
|
|
+ getCurrUser(){
|
|
|
+ userApi.getCurrUser({}).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ this.loginUserId = res.data.id
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
}
|