ソースを参照

订单暂停、启动行按钮问题,设置班表问题修改,自动刷新问题修改

yejian016332 3 年 前
コミット
311ee2b487

+ 560 - 559
imcs-ui/src/views/zuihou/classScheduleMgr/settingClassSchedul/Index.vue

@@ -1,559 +1,560 @@
-<template>
-  <div class="app-container">
-		<!-- 搜索模块 -->
-    <div class="filter-container">
-    	<span>
-    		<span>{{$t("calssSchedule.searchForm.month")}}:</span>
-    		<span>{{objData.year}}年{{objData.month}}月</span>
-    	</span>
-    	<span style="margin-left: 15px;">
-    		<span>{{$t("calssSchedule.searchForm.deptName")}}:</span>
-        <el-cascader
-          v-model="queryParams.deptId"
-          placeholder="请选择"
-          :options="depts"
-          :props="props"
-          filterable
-          change-on-select
-          ref="cascader"
-          @change="handleChange"
-        ></el-cascader>
-    	</span>
-    	<span style="margin-left: 15px;">
-    		<span>{{$t("calssSchedule.searchForm.userName")}}:</span>
-    		<el-input v-model="queryParams.userName" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
-    	</span>
-      <span style="margin-left: 15px;">
-	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
-	        {{ $t("table.search") }}
-	      </el-button>
-	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
-	        {{ $t("table.reset") }}
-	      </el-button>
-      </span>
-    </div>
-
-    <!-- 功能按钮 -->
-    <el-row class="filter-container">
-    	<el-col>
-    		<el-button type="primary" icon="el-icon-setting" size="medium" @click="add">{{ $t("common.setting") }}</el-button>
-    		<el-button type="primary" icon="el-icon-view" size="medium" @click="viewOne(null)">
-	        {{ $t("common.view") }}
-	      </el-button>
-	      <!--<el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
-	        {{ $t("common.edit") }}
-	      </el-button>-->
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="clearBtn">
-	        {{ $t("common.clear") }}
-	      </el-button>
-	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="clearAllBtn">
-	        {{ $t("calssSchedule.buttons.allClear") }}
-	      </el-button>
-    	</el-col>
-    </el-row>
-
-		<!-- 列表数据 -->
-    <el-table
-      :key="tableKey"
-      ref="table"
-      v-loading="loading"
-      :data="tableData.data"
-      border
-      fit
-      row-key="id"
-      style="width: 100%;"
-      @selection-change="onSelectChange"
-      @cell-click="cellClick"
-    >
-    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
-	      <template slot-scope="scope">
-	        <div>
-	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
-	        </div>
-	      </template>
-      </el-table-column>
-      <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
-      <el-table-column prop="orgName" :label='$t("calssSchedule.table.setClass.deptName")' :show-overflow-tooltip="true" width="180px"></el-table-column>
-      <el-table-column prop="userName" :label='$t("calssSchedule.table.setClass.name")' :show-overflow-tooltip="true" width="100px">
-      	<template slot-scope="{ row }">
-      		<a style="color: #2db7f5;" @click="viewOne(row)">{{row.userName}}</a>
-      	</template>
-      </el-table-column>
-      <el-table-column prop="model" :label='$t("calssSchedule.table.setClass.no")' :show-overflow-tooltip="true" width="100px"></el-table-column>
-      <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.field" :label="item.text" width="140px">
-      	<template slot-scope="{ row }">
-      		<div>
-      			<span v-for="obj in row[item.field]" :key="obj.keys" :style="obj.color" class="clsName">{{obj.text}}</span>
-      		</div>
-      	</template>
-      </el-table-column>
-    </el-table>
-    <pagination
-      v-show="tableData.count > 0"
-      :limit.sync="queryParams.size"
-      :page.sync="queryParams.current"
-      :total="Number(tableData.count)"
-      @pagination="fetch"
-    />
-    <tenant-edit
-      ref="edit"
-      :dialog-visible="dialog.isVisible"
-      :title="dialog.title"
-      @close="editClose"
-      @success="editSuccess"
-    />
-    <tenant-view
-      ref="view"
-      :dialog-visible="tenantViewVisible"
-      @close="viewClose"
-    />
-    <el-dialog
-      v-el-drag-dialog
-      :close-on-click-modal="false"
-      :close-on-press-escape="true"
-      title="预览"
-      width="80%"
-      top="50px"
-      :visible.sync="preview.isVisible"
-    >
-      <el-scrollbar>
-        <div v-html="preview.context" />
-      </el-scrollbar>
-    </el-dialog>
-
-    <!-- 【日历-查看】组件 -->
-    <calendar-user
-      ref="calendar"
-      :dialog-visible="userDialog.isVisible"
-      :title="userDialog.title"
-      @close="editUserClose"
-      @success="editUserSuccess"
-    />
-  </div>
-</template>
-
-<script>
-	import Pagination from "@/components/Pagination"
-	import TenantEdit from "./components/Edit"
-	import TenantView from "./components/View"
-	// 【查看】组件
-	import CalendarUser from "./components/CalendarUser"
-	// 【设置班表】-API
-	import settingClassSchedulApi from "@/api/classScheduleMgr/settingClassSchedul"
-  // 【部门】-API
-  import orgApi from '@/api/Org'
-	import elDragDialog from '@/directive/el-drag-dialog'
-	import {initDicts, initQueryParams } from '@/utils/commons'
-	export default {
-	  name: "ShiftChangeMgr",
-	  directives: { elDragDialog },
-	  components: { Pagination, TenantEdit, TenantView, CalendarUser },
-	  props: {
-	  	objData: Object
-	  },
-	  data () {
-	    return {
-	    	tags: ['','warning','success','danger'],
-	    	depts: [],
-        deptId:null,
-	      dialog: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      userDialog: {
-	        isVisible: false,
-	        title: ""
-	      },
-	      preview: {
-	        isVisible: false,
-	        context: ''
-	      },
-	      tenantViewVisible: false,
-	      tableKey: 0,
-	      queryParams: initQueryParams({}),
-	      selection: [],
-	      loading: false,
-	      tableData: {
-	        count: 0
-	      },
-	      dicts: {
-          NATION: {}
-        },
-	      enums: {
-	        TenantTypeEnum: {},
-	        TenantStatusEnum: {}
-	      },
-	      pickerOptions: {
-          shortcuts: [{
-            text: '最近一周',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近一个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit('pick', [start, end]);
-            }
-          }, {
-            text: '最近三个月',
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit('pick', [start, end]);
-            }
-          }]
-        },
-        props: {  // 配置数据格式
-            checkStrictly: true, // 是否严格的遵守父子节点不互相关联(官网配置项)
-            value: 'id',
-            label: 'label',
-        }
-	    }
-	  },
-	  watch: {
-      // 监听,路由传参数变化
-	  	objData: {
-	      	deep: true,
-	      	immediate: false,
-	      	handler() {
-	      		// 重置页面数据
-	        	this.resetInit()
-	      	}
-	    }
-    },
-	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
-	  created() {
-	  	// 加载【字典】
-	  	initDicts(['NATION'], this.dicts);
-        this.getTreeData()
-	  	// 加载列表数据
-	  	this.fetch()
-		},
-	  computed: {
-	  	settingColunm(e){
-	  		return "1111"
-	  	},
-	    currentUser () {
-	      return this.$store.state.account.user
-	    },
-	    nationList() {
-        return convertEnum(this.dicts.NATION)
-      }
-	  },
-	  mounted () {
-	  },
-	  methods: {
-	  	// 动态列的渲染格式化-函数
-	  	formatRow(row, column, cellValue, index){
-	  		let str = ""
-	  		// 如果值存在
-	  		if(!!cellValue){
-	  			let arr = cellValue.split(",")
-	  			arr.map(item => {
-	  				let list = item.split(";")
-	  				str += '<span style="'+ list[1] +'">'+ list[0] +'</span>'
-	  			})
-	  		}
-	  		return str
-	  	},
-	  	resetInit(){
-        // 加载Tree数据
-        this.getTreeData()
-	  		// 加载列表数据
-	  		this.fetch()
-	  	},
-	    viewClose () {
-	      this.tenantViewVisible = false
-	    },
-	    // 【日历-查看】关闭-事件
-	    editUserClose(){
-	    	this.userDialog.isVisible = false
-	    },
-	    // 【日历-查看】确认-事件
-	    editUserSuccess(){
-
-	    },
-	    editClose () {
-	      this.dialog.isVisible = false
-	    },
-	    editSuccess () {
-	      this.search()
-	    },
-	    onSelectChange (selection) {
-	      this.selection = selection
-	    },
-	    search () {
-	      this.fetch({
-	        ...this.queryParams
-	      })
-	    },
-	    reset () {
-	  	  this.objData.deptId = null
-        this.queryParams = initQueryParams({})
-	      this.$refs.table.clearSort()
-	      this.$refs.table.clearFilter()
-	      this.search()
-	    },
-	    add () {
-	      this.$refs.edit.type = "add"
-	      this.$refs.edit.setTenant(false, this.dicts)
-	      this.dialog.title = this.$t("common.setting") + this.objData.year + this.$t("common.date.year") + this.objData.month + this.$t("common.date.month") + this.$t("calssSchedule.common.classSchul")
-	      this.dialog.isVisible = true
-	    },
-	    singleDelete (row) {
-	      this.$refs.table.clearSelection()
-	      this.$refs.table.toggleRowSelection(row, true)
-	      this.batchDelete()
-	    },
-	    batchDelete () {
-	      if (!this.selection.length) {
-	        this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	      }
-
-	      this.$confirm(this.$t("calssSchedule.tips.settingTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-	      	const ids = []
-		      this.selection.forEach(item => {
-		        ids.push(item.id)
-		      })
-		      this.delete(ids)
-	      }).catch(() => {})
-	    },
-	    // 【清除】按钮-事件
-	    clearBtn(){
-	    	if (!this.selection.length) {
-	        this.$message({
-	          message: this.$t("tips.noDataSelected"),
-	          type: "warning"
-	        })
-	        return
-	      }
-	      this.$confirm(this.$t("calssSchedule.tips.settingTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-	      	let obj = {
-	      		date: this.objData.year+"-"+this.objData.month,
-	      		strUserList: new Array()
-	      	}
-		      this.selection.forEach(item => {
-		        obj.strUserList.push(item.userId)
-		      })
-		      this.clearSchedule(obj)
-	      }).catch(() => {})
-	    },
-	    // 【全部清除】按钮-事件
-	    clearAllBtn(){
-	    	this.$confirm(this.$t("calssSchedule.tips.settingAllTips"), this.$t("common.tips"), {
-	      	distinguishCancelAndClose: true,
-	        confirmButtonText: this.$t("common.confirm"),
-	        cancelButtonText: this.$t("common.cancel"),
-	        type: "warning"
-	      }).then(() => {
-		      let obj = {
-	      		date: this.objData.year+"-"+this.objData.month,
-	      	}
-		    	this.clearSchedule(obj)
-	      }).catch(() => {})
-	    },
-	    // 【清除、全部清除】-函数
-	    clearSchedule(obj){
-	    	settingClassSchedulApi.clearSchedule(obj).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.$message({
-	            message: this.$t("tips.deleteSuccess"),
-	            type: "success"
-	          })
-	          this.search()
-	          // 清理已经删除的数据
-	          this.$refs.table.clearSelection()
-	        }
-	      })
-	    },
-	    clearSelections () {
-	      this.$refs.table.clearSelection()
-	    },
-	    delete (ids) {
-	      settingClassSchedulApi.remove({ ids: ids }).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	          this.$message({
-	            message: this.$t("tips.deleteSuccess"),
-	            type: "success"
-	          })
-	          this.search()
-	          // 清理已经删除的数据
-	          this.$refs.table.clearSelection()
-	        }
-	      })
-	    },
-	    view (row) {
-	      this.$refs.view.setTenant(row)
-	      this.tenantViewVisible = true
-	    },
-	    // 【查看】表头上Btn-事件
-	    viewOne(row) {
-	    	if(null === row){
-            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.viewCalendar(this.selection[0]);
-
-	    	}else{
-            this.viewCalendar(row);
-	    	}
-	    },
-	    // 打开【日历-查看】组件
-	    viewCalendar(row){
-	  	  console.log(row)
-	    	this.$refs.calendar.setTenant(row, this.objData)
-	      this.userDialog.title = this.$t("calssSchedule.common.userSchul")
-	      this.userDialog.isVisible = true
-	    },
-	    edit (row) {
-	      this.$refs.edit.setTenant(row, this.dicts)
-	      this.$refs.edit.type = "edit"
-	      this.dialog.title = this.$t("common.edit")
-	      this.dialog.isVisible = true
-	    },
-	    fetch (params = {}) {
-	      this.loading = true
-	      if (this.queryParams.timeRange) {
-	        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
-
-        const selectDeptId = []
-        if(null != this.queryParams.deptId || this.queryParams.deptId === "undefined"){
-            this.queryParams.deptId.forEach(item => {
-                selectDeptId.push(item)
-            });
-            if(selectDeptId.length > 0){
-                this.objData.deptId = selectDeptId[selectDeptId.length-1]
-            }
-        }
-        this.objData.userName = this.queryParams.userName
-
-	      this.queryParams.model = this.objData
-	      settingClassSchedulApi.pageList(this.queryParams).then(response => {
-	        const res = response.data
-	        if (res.isSuccess) {
-	        	// this.tableData = res.data
-	          this.formatData(res.data)
-	        }
-	        // eslint-disable-next-line no-return-assign
-	      }).finally(() => this.loading = false)
-
-	    },
-	    // 格式化,自己需要的渲染数据
-	    formatData(data){
-	    	//this.tableData = res.data
-	    	if(data.data && data.data.length > 0){
-	    		// 数据内容
-	    		let list = []
-	    		data.data.map((item, index) => {
-	    			let keys = Object.keys(item)  // 对象的所有Key的数组
-	    			keys.map(val => {
-	    				// 如果字段是日期,格式化后,yyyy-MM-dd
-	    				if(val.indexOf("-") > -1){
-	    					// 如果值,存在--- "早班;#E20867,午班;#E30628"
-	    					if(!!item[val]){
-		    					let children = new Array()
-		    					let arr = item[val].split(",") // ["早班;#E20867","午班;#E30628"]
-		    					arr.map((res, keys) => {
-					  				let result = res.split(";")  // ["早班","#E20867"]/["午班","#E30628"]/
-					  				children.push({
-					  					keys: 'W'+ keys,
-		    							text: result[0],
-		    							color: 'background:'+ result[1]
-		    						})
-					  			})
-		    					// 赋值
-		    					item[val] = children
-	    					}
-	    				}
-	    			})
-	    			// 给数据赋值
-	    			list.push(item)
-	    		})
-	    		data.data = list
-	    	}
-	    	this.tableData = data
-	    },
-	    cellClick (row, column) {
-	      if (column['columnKey'] === "operation") {
-	        return
-	      }
-	      let flag = false
-	      this.selection.forEach((item) => {
-	        if (item.id === row.id) {
-	          flag = true
-	          this.$refs.table.toggleRowSelection(row)
-	        }
-	      })
-
-	      if (!flag) {
-	        this.$refs.table.toggleRowSelection(row, true)
-	      }
-	    },
-      // 加载Tree数据
-      getTreeData(){
-          orgApi.allTree({}).then((response) => {
-              const res = response.data
-              this.depts = res.data
-          })
-      },
-      handleChange() {
-          const el = this.$refs.cascader;
-          // 官方文档中有提供获取子节点的方法 getCheckedNodes;
-          // 通过监听当前的点击事件,判断是否还有子节点,如果没有,则关闭选项卡;
-          const mark = el.getCheckedNodes()[0].children.length;
-          if(!mark) {
-              el.dropDownVisible = false;
-          }
-      }
-	  }
-	}
-</script>
-<style lang="scss" scoped>
-	.clsName{
-		color: white;
-		padding: 2px 6px;
-		margin: 5px;
-		-moz-border-radius: 3px;
-		-webkit-border-radius: 3px;
-		border-radius: 3px;
-	}
-</style>
+<template>
+  <div class="app-container">
+		<!-- 搜索模块 -->
+    <div class="filter-container">
+    	<span>
+    		<span>{{$t("calssSchedule.searchForm.month")}}:</span>
+    		<span>{{objData.year}}年{{objData.month}}月</span>
+    	</span>
+    	<span style="margin-left: 15px;">
+    		<span>{{$t("calssSchedule.searchForm.deptName")}}:</span>
+        <el-cascader
+          v-model="queryParams.deptId"
+          placeholder="请选择"
+          :options="depts"
+          :props="props"
+          filterable
+          change-on-select
+          ref="cascader"
+          @change="handleChange"
+        ></el-cascader>
+    	</span>
+    	<span style="margin-left: 15px;">
+    		<span>{{$t("calssSchedule.searchForm.userName")}}:</span>
+    		<el-input v-model="queryParams.userName" :placeholder='$t("common.pleaseEnter")' style="width: 150px;" size="medium"/>
+    	</span>
+      <span style="margin-left: 15px;">
+	      <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
+	        {{ $t("table.search") }}
+	      </el-button>
+	      <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
+	        {{ $t("table.reset") }}
+	      </el-button>
+      </span>
+    </div>
+
+    <!-- 功能按钮 -->
+    <el-row class="filter-container">
+    	<el-col>
+    		<el-button type="primary" icon="el-icon-setting" size="medium" @click="add">{{ $t("common.setting") }}</el-button>
+    		<el-button type="primary" icon="el-icon-view" size="medium" @click="viewOne(null)">
+	        {{ $t("common.view") }}
+	      </el-button>
+	      <!--<el-button type="success" icon="el-icon-edit" size="medium" @click="editOne">
+	        {{ $t("common.edit") }}
+	      </el-button>-->
+	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="clearBtn">
+	        {{ $t("common.clear") }}
+	      </el-button>
+	      <el-button type="danger" icon="el-icon-delete" size="medium" @click="clearAllBtn">
+	        {{ $t("calssSchedule.buttons.allClear") }}
+	      </el-button>
+    	</el-col>
+    </el-row>
+
+		<!-- 列表数据 -->
+    <el-table
+      :key="tableKey"
+      ref="table"
+      v-loading="loading"
+      :data="tableData.data"
+      border
+      fit
+      row-key="id"
+      style="width: 100%;"
+      @selection-change="onSelectChange"
+      @cell-click="cellClick"
+    >
+    	<el-table-column :label='$t("common.serialNo")' width="55px" align="center">
+	      <template slot-scope="scope">
+	        <div>
+	          {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
+	        </div>
+	      </template>
+      </el-table-column>
+      <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
+      <el-table-column prop="orgName" :label='$t("calssSchedule.table.setClass.deptName")' :show-overflow-tooltip="true" width="180px"></el-table-column>
+      <el-table-column prop="userName" :label='$t("calssSchedule.table.setClass.name")' :show-overflow-tooltip="true" width="100px">
+      	<template slot-scope="{ row }">
+      		<a style="color: #2db7f5;" @click="viewOne(row)">{{row.userName}}</a>
+      	</template>
+      </el-table-column>
+      <el-table-column prop="model" :label='$t("calssSchedule.table.setClass.no")' :show-overflow-tooltip="true" width="100px"></el-table-column>
+      <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.field" :label="item.text" width="140px">
+      	<template slot-scope="{ row }">
+      		<div>
+      			<span v-for="obj in row[item.field]" :key="obj.keys" :style="obj.color" class="clsName">{{obj.text}}</span>
+      		</div>
+      	</template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="tableData.count > 0"
+      :limit.sync="queryParams.size"
+      :page.sync="queryParams.current"
+      :total="Number(tableData.count)"
+      @pagination="fetch"
+    />
+    <tenant-edit
+      ref="edit"
+      :dialog-visible="dialog.isVisible"
+      :title="dialog.title"
+      @close="editClose"
+      @success="editSuccess"
+    />
+    <tenant-view
+      ref="view"
+      :dialog-visible="tenantViewVisible"
+      @close="viewClose"
+    />
+    <el-dialog
+      v-el-drag-dialog
+      :close-on-click-modal="false"
+      :close-on-press-escape="true"
+      title="预览"
+      width="80%"
+      top="50px"
+      :visible.sync="preview.isVisible"
+    >
+      <el-scrollbar>
+        <div v-html="preview.context" />
+      </el-scrollbar>
+    </el-dialog>
+
+    <!-- 【日历-查看】组件 -->
+    <calendar-user
+      ref="calendar"
+      :dialog-visible="userDialog.isVisible"
+      :title="userDialog.title"
+      @close="editUserClose"
+      @success="editUserSuccess"
+    />
+  </div>
+</template>
+
+<script>
+	import Pagination from "@/components/Pagination"
+	import TenantEdit from "./components/Edit"
+	import TenantView from "./components/View"
+	// 【查看】组件
+	import CalendarUser from "./components/CalendarUser"
+	// 【设置班表】-API
+	import settingClassSchedulApi from "@/api/classScheduleMgr/settingClassSchedul"
+  // 【部门】-API
+  import orgApi from '@/api/Org'
+	import elDragDialog from '@/directive/el-drag-dialog'
+	import {initDicts, initQueryParams } from '@/utils/commons'
+	export default {
+	  name: "ShiftChangeMgr",
+	  directives: { elDragDialog },
+	  components: { Pagination, TenantEdit, TenantView, CalendarUser },
+	  props: {
+	  	objData: Object
+	  },
+	  data () {
+	    return {
+	    	tags: ['','warning','success','danger'],
+	    	depts: [],
+        deptId:null,
+	      dialog: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      userDialog: {
+	        isVisible: false,
+	        title: ""
+	      },
+	      preview: {
+	        isVisible: false,
+	        context: ''
+	      },
+	      tenantViewVisible: false,
+	      tableKey: 0,
+	      queryParams: initQueryParams({}),
+	      selection: [],
+	      loading: false,
+	      tableData: {
+	        count: 0
+	      },
+	      dicts: {
+          NATION: {}
+        },
+	      enums: {
+	        TenantTypeEnum: {},
+	        TenantStatusEnum: {}
+	      },
+	      pickerOptions: {
+          shortcuts: [{
+            text: '最近一周',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近一个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
+              picker.$emit('pick', [start, end]);
+            }
+          }, {
+            text: '最近三个月',
+            onClick(picker) {
+              const end = new Date();
+              const start = new Date();
+              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
+              picker.$emit('pick', [start, end]);
+            }
+          }]
+        },
+        props: {  // 配置数据格式
+            checkStrictly: true, // 是否严格的遵守父子节点不互相关联(官网配置项)
+            value: 'id',
+            label: 'label',
+        }
+	    }
+	  },
+	  watch: {
+      // 监听,路由传参数变化
+	  	objData: {
+	      	deep: true,
+	      	immediate: false,
+	      	handler() {
+	      		// 重置页面数据
+	        	this.resetInit()
+	      	}
+	    }
+    },
+	  // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+	  created() {
+	  	// 加载【字典】
+	  	initDicts(['NATION'], this.dicts);
+        this.getTreeData()
+	  	// 加载列表数据
+	  	this.fetch()
+		},
+	  computed: {
+	  	settingColunm(e){
+	  		return "1111"
+	  	},
+	    currentUser () {
+	      return this.$store.state.account.user
+	    },
+	    nationList() {
+        return convertEnum(this.dicts.NATION)
+      }
+	  },
+	  mounted () {
+	  },
+	  methods: {
+	  	// 动态列的渲染格式化-函数
+	  	formatRow(row, column, cellValue, index){
+	  		let str = ""
+	  		// 如果值存在
+	  		if(!!cellValue){
+	  			let arr = cellValue.split(",")
+	  			arr.map(item => {
+	  				let list = item.split(";")
+	  				str += '<span style="'+ list[1] +'">'+ list[0] +'</span>'
+	  			})
+	  		}
+	  		return str
+	  	},
+	  	resetInit(){
+        // 加载Tree数据
+        this.getTreeData()
+	  		// 加载列表数据
+	  		this.fetch()
+	  	},
+	    viewClose () {
+	      this.tenantViewVisible = false
+	    },
+	    // 【日历-查看】关闭-事件
+	    editUserClose(){
+	    	this.userDialog.isVisible = false
+          this.search()
+	    },
+	    // 【日历-查看】确认-事件
+	    editUserSuccess(){
+        this.search()
+	    },
+	    editClose () {
+	      this.dialog.isVisible = false
+	    },
+	    editSuccess () {
+	      this.search()
+	    },
+	    onSelectChange (selection) {
+	      this.selection = selection
+	    },
+	    search () {
+	      this.fetch({
+	        ...this.queryParams
+	      })
+	    },
+	    reset () {
+	  	  this.objData.deptId = null
+        this.queryParams = initQueryParams({})
+	      this.$refs.table.clearSort()
+	      this.$refs.table.clearFilter()
+	      this.search()
+	    },
+	    add () {
+	      this.$refs.edit.type = "add"
+	      this.$refs.edit.setTenant(false, this.dicts)
+	      this.dialog.title = this.$t("common.setting") + this.objData.year + this.$t("common.date.year") + this.objData.month + this.$t("common.date.month") + this.$t("calssSchedule.common.classSchul")
+	      this.dialog.isVisible = true
+	    },
+	    singleDelete (row) {
+	      this.$refs.table.clearSelection()
+	      this.$refs.table.toggleRowSelection(row, true)
+	      this.batchDelete()
+	    },
+	    batchDelete () {
+	      if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+
+	      this.$confirm(this.$t("calssSchedule.tips.settingTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+	      }).then(() => {
+	      	const ids = []
+		      this.selection.forEach(item => {
+		        ids.push(item.id)
+		      })
+		      this.delete(ids)
+	      }).catch(() => {})
+	    },
+	    // 【清除】按钮-事件
+	    clearBtn(){
+	    	if (!this.selection.length) {
+	        this.$message({
+	          message: this.$t("tips.noDataSelected"),
+	          type: "warning"
+	        })
+	        return
+	      }
+	      this.$confirm(this.$t("calssSchedule.tips.settingTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+	      }).then(() => {
+	      	let obj = {
+	      		date: this.objData.year+"-"+this.objData.month,
+	      		strUserList: new Array()
+	      	}
+		      this.selection.forEach(item => {
+		        obj.strUserList.push(item.userId)
+		      })
+		      this.clearSchedule(obj)
+	      }).catch(() => {})
+	    },
+	    // 【全部清除】按钮-事件
+	    clearAllBtn(){
+	    	this.$confirm(this.$t("calssSchedule.tips.settingAllTips"), this.$t("common.tips"), {
+	      	distinguishCancelAndClose: true,
+	        confirmButtonText: this.$t("common.confirm"),
+	        cancelButtonText: this.$t("common.cancel"),
+	        type: "warning"
+	      }).then(() => {
+		      let obj = {
+	      		date: this.objData.year+"-"+this.objData.month,
+	      	}
+		    	this.clearSchedule(obj)
+	      }).catch(() => {})
+	    },
+	    // 【清除、全部清除】-函数
+	    clearSchedule(obj){
+	    	settingClassSchedulApi.clearSchedule(obj).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.$message({
+	            message: this.$t("tips.deleteSuccess"),
+	            type: "success"
+	          })
+	          this.search()
+	          // 清理已经删除的数据
+	          this.$refs.table.clearSelection()
+	        }
+	      })
+	    },
+	    clearSelections () {
+	      this.$refs.table.clearSelection()
+	    },
+	    delete (ids) {
+	      settingClassSchedulApi.remove({ ids: ids }).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	          this.$message({
+	            message: this.$t("tips.deleteSuccess"),
+	            type: "success"
+	          })
+	          this.search()
+	          // 清理已经删除的数据
+	          this.$refs.table.clearSelection()
+	        }
+	      })
+	    },
+	    view (row) {
+	      this.$refs.view.setTenant(row)
+	      this.tenantViewVisible = true
+	    },
+	    // 【查看】表头上Btn-事件
+	    viewOne(row) {
+	    	if(null === row){
+            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.viewCalendar(this.selection[0]);
+
+	    	}else{
+            this.viewCalendar(row);
+	    	}
+	    },
+	    // 打开【日历-查看】组件
+	    viewCalendar(row){
+	  	  console.log(row)
+	    	this.$refs.calendar.setTenant(row, this.objData)
+	      this.userDialog.title = this.$t("calssSchedule.common.userSchul")
+	      this.userDialog.isVisible = true
+	    },
+	    edit (row) {
+	      this.$refs.edit.setTenant(row, this.dicts)
+	      this.$refs.edit.type = "edit"
+	      this.dialog.title = this.$t("common.edit")
+	      this.dialog.isVisible = true
+	    },
+	    fetch (params = {}) {
+	      this.loading = true
+	      if (this.queryParams.timeRange) {
+	        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
+
+        const selectDeptId = []
+        if(null != this.queryParams.deptId || this.queryParams.deptId === "undefined"){
+            this.queryParams.deptId.forEach(item => {
+                selectDeptId.push(item)
+            });
+            if(selectDeptId.length > 0){
+                this.objData.deptId = selectDeptId[selectDeptId.length-1]
+            }
+        }
+        this.objData.userName = this.queryParams.userName
+
+	      this.queryParams.model = this.objData
+	      settingClassSchedulApi.pageList(this.queryParams).then(response => {
+	        const res = response.data
+	        if (res.isSuccess) {
+	        	// this.tableData = res.data
+	          this.formatData(res.data)
+	        }
+	        // eslint-disable-next-line no-return-assign
+	      }).finally(() => this.loading = false)
+
+	    },
+	    // 格式化,自己需要的渲染数据
+	    formatData(data){
+	    	//this.tableData = res.data
+	    	if(data.data && data.data.length > 0){
+	    		// 数据内容
+	    		let list = []
+	    		data.data.map((item, index) => {
+	    			let keys = Object.keys(item)  // 对象的所有Key的数组
+	    			keys.map(val => {
+	    				// 如果字段是日期,格式化后,yyyy-MM-dd
+	    				if(val.indexOf("-") > -1){
+	    					// 如果值,存在--- "早班;#E20867,午班;#E30628"
+	    					if(!!item[val]){
+		    					let children = new Array()
+		    					let arr = item[val].split(",") // ["早班;#E20867","午班;#E30628"]
+		    					arr.map((res, keys) => {
+					  				let result = res.split(";")  // ["早班","#E20867"]/["午班","#E30628"]/
+					  				children.push({
+					  					keys: 'W'+ keys,
+		    							text: result[0],
+		    							color: 'background:'+ result[1]
+		    						})
+					  			})
+		    					// 赋值
+		    					item[val] = children
+	    					}
+	    				}
+	    			})
+	    			// 给数据赋值
+	    			list.push(item)
+	    		})
+	    		data.data = list
+	    	}
+	    	this.tableData = data
+	    },
+	    cellClick (row, column) {
+	      if (column['columnKey'] === "operation") {
+	        return
+	      }
+	      let flag = false
+	      this.selection.forEach((item) => {
+	        if (item.id === row.id) {
+	          flag = true
+	          this.$refs.table.toggleRowSelection(row)
+	        }
+	      })
+
+	      if (!flag) {
+	        this.$refs.table.toggleRowSelection(row, true)
+	      }
+	    },
+      // 加载Tree数据
+      getTreeData(){
+          orgApi.allTree({}).then((response) => {
+              const res = response.data
+              this.depts = res.data
+          })
+      },
+      handleChange() {
+          const el = this.$refs.cascader;
+          // 官方文档中有提供获取子节点的方法 getCheckedNodes;
+          // 通过监听当前的点击事件,判断是否还有子节点,如果没有,则关闭选项卡;
+          const mark = el.getCheckedNodes()[0].children.length;
+          if(!mark) {
+              el.dropDownVisible = false;
+          }
+      }
+	  }
+	}
+</script>
+<style lang="scss" scoped>
+	.clsName{
+		color: white;
+		padding: 2px 6px;
+		margin: 5px;
+		-moz-border-radius: 3px;
+		-webkit-border-radius: 3px;
+		border-radius: 3px;
+	}
+</style>

+ 32 - 2
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/index.vue

@@ -193,7 +193,7 @@
 	          <i
 	            class="el-icon-video-pause table-operation"
 	            style="color: #2db7f5;"
-	            @click="panseBtn('0')"
+	            @click="orderOperateBtn(row,'stop')"
 	          />
           </el-tooltip>
           <!-- 继续生产-->
@@ -201,7 +201,7 @@
 	          <i
 	            class="el-icon-video-play table-operation"
 	            style="color: #2db7f5;"
-	            @click="panseBtn('1')"
+	            @click="orderOperateBtn(row,'start')"
 	          />
           </el-tooltip>
         	<!-- 排产预览 -->
@@ -559,6 +559,36 @@
         	this.orderDelete()
         }
       },
+
+      orderOperateBtn(row,command){
+        // 如果是:【暂停】
+        if(command == "stop"){
+            const produceStatus = row.produceStatus
+            console.log("produceStatus="+produceStatus)
+            if (produceStatus === '1' || produceStatus === '4') {
+                this.$message({
+                    message: this.$t("订单未开始生产或已经生产完成,无需暂停"),
+                    type: "warning"
+                })
+                return false
+            }
+            this.panseBtn('0')
+        }
+
+        // 如果是:【启用】
+        if(command == "start"){
+            const produceStatus = row.produceStatus
+            if (produceStatus != '3') {
+                this.$message({
+                    message: this.$t("订单未暂停,无需启用"),
+                    type: "warning"
+                })
+                return false
+            }
+            this.panseBtn('1')
+        }
+      },
+
       // 【优先级】按钮-事件
       priorityBtn(){
       	if(this.checkData()){