Ver código fonte

换班更新查询

yejian016332 3 anos atrás
pai
commit
7efc708eae

+ 20 - 0
imcs-ui/src/api/classScheduleMgr/shiftChangeMgr.js

@@ -44,6 +44,14 @@ const apiList = {
   import: {
     method: 'POST',
     url: `/authority/scheduleUserChange/import`
+  },
+  queryUserApplyData: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/queryUserApplyData`
+  },
+  queryUserChangeData: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/queryUserChangeData`
   }
 }
 
@@ -127,5 +135,17 @@ export default {
       ...apiList.import,
       data
     })
+  },
+  queryUserApplyData (data) {
+    return axiosApi({
+      ...apiList.queryUserApplyData,
+      data
+    })
+  },
+  queryUserChangeData (data) {
+    return axiosApi({
+      ...apiList.queryUserChangeData,
+      data
+    })
   }
 }

+ 25 - 2
imcs-ui/src/views/zuihou/classScheduleMgr/shiftChangeMgr/Index.vue

@@ -253,7 +253,9 @@
               picker.$emit('pick', [start, end]);
             }
           }]
-        }
+        },
+        applyList: [],
+        changeList: []
 	    }
 	  },
 	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
@@ -402,7 +404,10 @@
 	        })
 	        return
 	      }
-	      this.$refs.edit.setTenant(row, this.dicts)
+	      // 根据换班id查询用户之前的换班的
+        this.queryUserApplyData(row)
+        this.queryUserChangeData(row)
+	      this.$refs.edit.setTenant(row,this.applyList,this.changeList, this.dicts)
 	      this.$refs.edit.type = "edit"
 	      this.dialog.title = this.$t("common.edit")
 	      this.dialog.isVisible = true
@@ -526,6 +531,24 @@
                   this.search()
               }
           })
+      },
+      queryUserApplyData(row){
+        shiftChangeMgrApi.queryUserApplyData(row).then(response => {
+          response = response.data
+          if (response.isSuccess) {
+            // 返回修改的用户换班信息
+            this.applyList = response.data
+          }
+        })
+      },
+      queryUserChangeData(row){
+        shiftChangeMgrApi.queryUserChangeData(row).then(response => {
+          response = response.data
+          if (response.isSuccess) {
+            // 返回修改的用户换班信息
+            this.changeList = response.data
+          }
+        })
       },
 	  }
 	}

+ 36 - 16
imcs-ui/src/views/zuihou/classScheduleMgr/shiftChangeMgr/components/Edit.vue

@@ -29,7 +29,7 @@
       </el-form-item>
       <el-form-item :label='$t("calssSchedule.table.staffChange.model")+":"' prop="" style="border-bottom: 1px solid #EEEEEE;">
       	<template>
-				  <el-checkbox-group v-model="tenant.applyUserId">
+				  <el-checkbox-group v-model="tenant.applyList">
 				    <el-checkbox v-for="item in this.applyCheckbox" :key="item.id" :label="item.id">{{item.name.data}}</el-checkbox>
 				  </el-checkbox-group>
 				</template>
@@ -55,7 +55,7 @@
       </el-form-item>
       <el-form-item :label='$t("calssSchedule.table.staffChange.remark")+":"' prop="changeList">
       	<template>
-				  <el-checkbox-group v-model="tenant.changeUserId">
+				  <el-checkbox-group v-model="tenant.changeList">
 				    <el-checkbox v-for="item in this.updateCheckbox" :key="item.id" :label="item.id">{{item.name.data}}</el-checkbox>
 				  </el-checkbox-group>
 				</template>
@@ -99,8 +99,10 @@ export default {
       confirmDisabled: false,
       loginUserId: null,
       deptUserList: [],
-      applyCheckbox: [],  // 【更换班表-申请人】
-      updateCheckbox: [],  // 【更换班表-更换人】
+        applyList: [],
+        changeList: [],
+      applyCheckbox: [1471036400953458688],  // 【更换班表-申请人】
+      updateCheckbox: [1471036672111017984],  // 【更换班表-更换人】
       dicts:{
         NATION: {}
       },
@@ -141,6 +143,11 @@ export default {
 	    return this.$store.state.account.user
 	  },
   },
+  created() {
+      // 调用常量-审核状态
+      // this.queryUserApplyData()
+      // this.queryUserChangeData()
+  },
   mounted () {
   	// this.applyList = this.$constWKS.CASCADERLIST,
     // 获取当前用户
@@ -167,9 +174,6 @@ export default {
   	// 【申请日期】值变化事件
   	dateChange(val){
   		let userId = this.$store.state.account.user.id
-        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'))
@@ -180,7 +184,6 @@ export default {
   		// 【更换日期】的值
   		let date = this.tenant.changeTime
   			// 查询【更换人】的班次列表
-        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'))
       }
@@ -199,9 +202,9 @@ export default {
         name: '',
         status: '1',
         applyTime: null,
-        changeTime: null,  
+        changeTime: null,
         changeUserId: null,
-        applyUserId: null,      
+        applyUserId: null,
         applyList: [],
         changeList: []
       }
@@ -221,11 +224,10 @@ export default {
     		this.tenant = { ...val }
         this.type = "edit"
     	}
-    	if(this.type ==="edit"){        
+    	if(this.type ==="edit"){
     	  this.applyClassList(true, val.applyUserId, val.applyTime)
         this.applyClassList(false, val.changeUserId, val.changeTime)
       }
-      console.log(this.tenant)
       // 字典表
       this.dicts = dicts
     },
@@ -295,7 +297,7 @@ export default {
         })
     },
     // 【更换班表】-列表数据
-    applyClassList(flag, val, date){  	    
+    applyClassList(flag, val, date){
     	classesMgrApi.getListById({userId: val, date}).then(res => {
     		res = res.data
     		if (res.isSuccess) {
@@ -307,8 +309,6 @@ export default {
 		    	}
 	      }
     	})
-        console.log(this.applyCheckbox)
-        console.log(this.updateCheckbox)
     },
     // 【部门人员】-级联数据
     getDeptUser(){
@@ -318,7 +318,27 @@ export default {
     			this.deptUserList = res.data
     		}
     	})
-    }
+    },
+    queryUserApplyData(row){
+      shiftChangeMgrApi.queryUserApplyData(row).then(response => {
+        response = response.data
+        if (response.isSuccess) {
+            // 返回修改的用户换班信息
+            this.applyList = response.data
+            console.log(this.applyList)
+        }
+      })
+    },
+    queryUserChangeData(row){
+      shiftChangeMgrApi.queryUserChangeData(row).then(response => {
+        response = response.data
+        if (response.isSuccess) {
+            // 返回修改的用户换班信息
+            this.changeList = response.data
+            console.log(this.changeList)
+        }
+      })
+    },
   }
 }
 </script>