Bläddra i källkod

换班管理页面优化,审核功能增加

yejian016332 3 år sedan
förälder
incheckning
3094cd06e2

+ 131 - 131
imcs-ui/src/api/classScheduleMgr/shiftChangeMgr.js

@@ -1,131 +1,131 @@
-import axiosApi from '../AxiosApi.js'
-
-const apiList = {
-	getList: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/all`
-  },
-  page: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/page`
-  },
-  update: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/update`
-  },
-  save: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange`
-  },
-  updateStatus: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/status`
-  },
-  remove: {
-    method: 'DELETE',
-    url: `/authority/scheduleUserChange`
-  },
-  delete: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/delete`
-  },
-  list: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/query`
-  },
-  preview: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/preview`
-  },
-  export: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/export`
-  },
-  import: {
-    method: 'POST',
-    url: `/authority/scheduleUserChange/import`
-  }
-}
-
-export default {
-	getList (data) {
-    return axiosApi({
-      ...apiList.getList,
-      data
-    })
-  },
-  page (data) {
-    return axiosApi({
-      ...apiList.page,
-      data
-    })
-  },
-  save (data) {
-    return axiosApi({
-      ...apiList.save,
-      data
-    })
-  },
-  update (data) {
-    return axiosApi({
-      ...apiList.update,
-      data
-    })
-  },
-  updateStatus (data) {
-    return axiosApi({
-      ...apiList.updateStatus,
-      data
-    })
-  },
-  remove (data) {
-    return axiosApi({
-      ...apiList.remove,
-      data
-    })
-  },
-  delete (data) {
-    return axiosApi({
-      ...apiList.remove,
-      data
-    })
-  },
-  list (data) {
-    return axiosApi({
-      ...apiList.list,
-      data
-    })
-  },
-  check (code) {
-    return axiosApi({
-      method: 'GET',
-      url: `/authority/scheduleUserChange/check/${code}`
-    })
-  },
-  checkField (data) {
-    return axiosApi({
-      method: 'POST',
-      url: `/authority/scheduleUserChange/check`,
-      data
-    })
-  },
-  preview (data) {
-    return axiosApi({
-      ...apiList.preview,
-      data
-    })
-  },
-  export (data) {
-    return axiosApi({
-      ...apiList.export,
-      responseType: "blob",
-      data
-    })
-  },
-  import (data) {
-    return axiosApi({
-      ...apiList.import,
-      data
-    })
-  }
-}
+import axiosApi from '../AxiosApi.js'
+
+const apiList = {
+	getList: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/all`
+  },
+  page: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/page`
+  },
+  update: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/update`
+  },
+  save: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange`
+  },
+  updateStatus: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/updateStatus`
+  },
+  remove: {
+    method: 'DELETE',
+    url: `/authority/scheduleUserChange`
+  },
+  delete: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/delete`
+  },
+  list: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/query`
+  },
+  preview: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/preview`
+  },
+  export: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/export`
+  },
+  import: {
+    method: 'POST',
+    url: `/authority/scheduleUserChange/import`
+  }
+}
+
+export default {
+	getList (data) {
+    return axiosApi({
+      ...apiList.getList,
+      data
+    })
+  },
+  page (data) {
+    return axiosApi({
+      ...apiList.page,
+      data
+    })
+  },
+  save (data) {
+    return axiosApi({
+      ...apiList.save,
+      data
+    })
+  },
+  update (data) {
+    return axiosApi({
+      ...apiList.update,
+      data
+    })
+  },
+  updateStatus (data) {
+    return axiosApi({
+      ...apiList.updateStatus,
+      data
+    })
+  },
+  remove (data) {
+    return axiosApi({
+      ...apiList.remove,
+      data
+    })
+  },
+  delete (data) {
+    return axiosApi({
+      ...apiList.remove,
+      data
+    })
+  },
+  list (data) {
+    return axiosApi({
+      ...apiList.list,
+      data
+    })
+  },
+  check (code) {
+    return axiosApi({
+      method: 'GET',
+      url: `/authority/scheduleUserChange/check/${code}`
+    })
+  },
+  checkField (data) {
+    return axiosApi({
+      method: 'POST',
+      url: `/authority/scheduleUserChange/check`,
+      data
+    })
+  },
+  preview (data) {
+    return axiosApi({
+      ...apiList.preview,
+      data
+    })
+  },
+  export (data) {
+    return axiosApi({
+      ...apiList.export,
+      responseType: "blob",
+      data
+    })
+  },
+  import (data) {
+    return axiosApi({
+      ...apiList.import,
+      data
+    })
+  }
+}

+ 2 - 1
imcs-ui/src/lang/zh/calssSchedule.js

@@ -90,7 +90,8 @@ export default {
 			areaTips: '删除班次管理数据后,会将班次管理数据全部删除,确认删除?',
 			schedulTips: '删除班表管理数据后,会将班表管理数据全部删除,确认删除?',
 			settingTips: '清除设置班表数据后,会将设置班表人员数据全部清除,确认清除?',
-			settingAllTips: '全部清除设置班表数据后,会将设置班表人员数据全部清除,确认全部清除?'
+			settingAllTips: '全部清除设置班表数据后,会将设置班表人员数据全部清除,确认全部清除?',
+      shiftChangeTips: '删除人员换班数据后,会将该人员当前换班数据全部删除,确认删除?',
 		}
 	}
 }

+ 126 - 12
imcs-ui/src/views/zuihou/classScheduleMgr/shiftChangeMgr/Index.vue

@@ -40,7 +40,7 @@
 	      </el-button>
       </span>
     </div>
-    
+
     <!-- 功能按钮 -->
     <el-row class="filter-container">
     	<el-col>
@@ -51,6 +51,8 @@
 	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="batchDelete">
 	        {{ $t("table.delete") }}
 	      </el-button>
+        <el-button type="primary" icon="el-icon-thumb" size="medium" @click="updateStatus('1')">{{$t("common.audio.addAudio")}}</el-button>
+        <el-button type="primary" icon="el-icon-suitcase" size="medium" @click="audioBtn()">{{$t("common.audio.audio")}}</el-button>
     	</el-col>
     </el-row>
 
@@ -154,6 +156,31 @@
         <div v-html="preview.context" />
       </el-scrollbar>
     </el-dialog>
+
+    <el-dialog
+      v-el-drag-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      :title='$t("common.audio.audio")'
+      width="400px"
+      top="150px"
+      :visible.sync="audioIsVisible"
+    >
+      <template>
+        <el-row>
+          <el-radio v-model="audioVal" label="2">{{$t("common.audio.audioOk")}}</el-radio>
+          <el-radio v-model="audioVal" label="3">{{$t("common.audio.aduioFail")}}</el-radio>
+        </el-row>
+        <el-row style="margin-top: 30px;text-align: center;">
+          <el-button plain type="primary" size="medium" @click="audioOk">
+            {{ $t("common.confirm") }}
+          </el-button>
+          <el-button plain type="danger" size="medium" @click="colseAudio">
+            {{ $t("common.cancel") }}
+          </el-button>
+        </el-row>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -164,8 +191,7 @@
 	// 【换班管理】-API
 	import shiftChangeMgrApi from "@/api/classScheduleMgr/shiftChangeMgr"
 	import elDragDialog from '@/directive/el-drag-dialog'
-	import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
-	import axios from 'axios'
+	import {initDicts, initQueryParams } from '@/utils/commons'
 	export default {
 	  name: "ShiftChangeMgr",
 	  directives: { elDragDialog },
@@ -176,6 +202,8 @@
 	    return {
 	    	tags: ['','warning','success','danger'],
 	    	audioStatus: [],
+        audioIsVisible: false,
+        audioVal: '2', //默认【审核通过】
 	      dialog: {
 	        isVisible: false,
 	        title: ""
@@ -246,7 +274,7 @@
       }
 	  },
 	  mounted () {
-	    
+
 	  },
 	  methods: {
 	    viewClose () {
@@ -291,9 +319,9 @@
 	        })
 	        return
 	      }
-	
+
 	      const readonlyIndex = this.selection.findIndex(item => item.readonly)
-	
+
 	      if (readonlyIndex > -1) {
 	        this.$message({
 	          message: this.$t("tips.systemData"),
@@ -301,8 +329,8 @@
 	        })
 	        return
 	      }
-	
-	      this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
+
+	      this.$confirm(this.$t("calssSchedule.tips.shiftChangeTips"), this.$t("common.tips"), {
 	      	distinguishCancelAndClose: true,
 	        confirmButtonText: this.$t("common.confirm"),
 	        cancelButtonText: this.$t("common.cancel"),
@@ -385,7 +413,7 @@
 	        this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
 	        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
 	      }
-	
+
 	      this.queryParams.current = params.current ? params.current : this.queryParams.current
 	      this.queryParams.size = params.size ? params.size : this.queryParams.size
 	      shiftChangeMgrApi.page(this.queryParams).then(response => {
@@ -395,7 +423,7 @@
 	        }
 	        // eslint-disable-next-line no-return-assign
 	      }).finally(() => this.loading = false)
-	     
+
 	    },
 	    cellClick (row, column) {
 	      if (column['columnKey'] === "operation") {
@@ -408,11 +436,97 @@
 	          this.$refs.table.toggleRowSelection(row)
 	        }
 	      })
-	
+
 	      if (!flag) {
 	        this.$refs.table.toggleRowSelection(row, true)
 	      }
-	    }
+	    },
+      // 【提交审核】按钮-事件
+      updateStatus(status){
+          if (!this.selection.length) {
+              this.$message({
+                  message: this.$t("tips.noDataSelected"),
+                  type: "warning"
+              })
+              return
+          }
+          if (this.selection.length > 1) {
+              this.$message({
+                  message: this.$t("tips.mustOne"),
+                  type: "warning"
+              })
+              return
+          }
+          // 调用API
+          this.audio(status)
+      },
+      // 【取消】审核按钮-事件
+      colseAudio(){
+          this.audioIsVisible = false
+      },
+      // 【确定】审核按钮-事件
+      audioOk(){
+          // 调用审核
+          this.audio(false)
+      },
+      // 【审核产品】-按钮事件
+      audioBtn(){
+          if (!this.selection.length) {
+              this.$message({
+                  message: this.$t("tips.noDataSelected"),
+                  type: "warning"
+              })
+              return
+          }
+          if (this.selection.length > 1) {
+              this.$message({
+                  message: this.$t("tips.mustOne"),
+                  type: "warning"
+              })
+              return
+          }
+          this.audioIsVisible = true
+      },
+      // 【审核产品】-Table的Row操作事件
+      audioBtnRow(row) {
+          // 清除所有的选择数据
+          this.$refs.table.clearSelection()
+          // 设置当前行为选中的数据
+          this.$refs.table.toggleRowSelection(row, true)
+          // 弹出审核页面
+          this.audioIsVisible = true
+      },
+      // 【审核通过/审核不通过】接口-事件
+      audio(status){
+          if(!status){
+              status =  this.audioVal
+          }
+          // 赋值
+          this.selection[0].status = status
+          let msg = "提交审核成功!"
+          if(status == "2"){
+              msg = "审核通过!"
+          }
+          if(status == "3"){
+              msg = "审核不通过!"
+          }
+          shiftChangeMgrApi.updateStatus({ id: this.selection[0].id, auditStatus: status}).then(response => {
+              if (response.status == 200) {
+                  // 如果是审核,成功后,关闭弹出框
+                  if(status == '2' || status == '3'){
+                      this.audioIsVisible = false
+                      // 审核成功后,改成默认值
+                      this.audioVal = '2'
+                  }
+                  this.$message({
+                      message: msg,
+                      type: "success"
+                  })
+                  // 重新查询列表数据
+                  this.search()
+              }
+          })
+      },
 	  }
 	}
 </script>

+ 30 - 18
imcs-ui/src/views/zuihou/classScheduleMgr/shiftChangeMgr/components/Edit.vue

@@ -1,23 +1,23 @@
 <template>
-  <el-dialog 
-  	:close-on-click-modal="false" 
-  	:close-on-press-escape="false" 
-  	:title="title" 
+  <el-dialog
+  	:close-on-click-modal="false"
+  	:close-on-press-escape="false"
+  	:title="title"
   	:append-to-body="true"
-  	:visible.sync="isVisible" 
-  	width="500px" 
+  	:visible.sync="isVisible"
+  	width="500px"
   	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" 
+          <el-cascader
+          	v-model="tenant.applyUserId"
           	key="1"
-          	:options="applyList" 
-          	:props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}" 
+          	:options="applyList"
+          	:props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}"
           	:show-all-levels="false"
           	filterable
-          	clearable 
+          	clearable
           	:placeholder='$t("common.pleaseSelect")'
           	style="width: 100%;"
           	@change="cascaderChange"
@@ -34,16 +34,16 @@
 				  </el-checkbox-group>
 				</template>
       </el-form-item>
-      
+
       <el-form-item :label='$t("calssSchedule.table.staffChange.hours")+":"' prop="changeUserId">
-          <el-cascader 
-          	v-model="tenant.changeUserId" 
+          <el-cascader
+          	v-model="tenant.changeUserId"
           	key="2"
-          	:options="applyList" 
-          	:props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}" 
+          	:options="applyList"
+          	:props="{ checkStrictly: true , emitPath: false, expandTrigger: 'click'}"
           	:show-all-levels="false"
           	filterable
-          	clearable 
+          	clearable
           	:placeholder='$t("common.pleaseSelect")'
           	style="width: 100%;"
           	@change="cascaderChange2"
@@ -109,7 +109,19 @@ export default {
         ],
         changeUserId: [
         	{ required: true, message: this.$t("rules.require"), trigger: 'change' }
-        ]
+        ],
+        applyTime: [
+          { required: true, message: this.$t("rules.require"), trigger: 'change' }
+        ],
+        changeTime: [
+          { required: true, message: this.$t("rules.require"), trigger: 'change' }
+        ],
+        applyList: [
+            { required: true, message: this.$t("rules.require"), trigger: 'change' }
+        ],
+        changeList: [
+            { required: true, message: this.$t("rules.require"), trigger: 'change' }
+        ],
       }
     }
   },