|
@@ -22,6 +22,29 @@
|
|
|
class="adjust-form"
|
|
class="adjust-form"
|
|
|
@submit.native.prevent
|
|
@submit.native.prevent
|
|
|
>
|
|
>
|
|
|
|
|
+ <el-form-item label="调班方式">
|
|
|
|
|
+ <template slot="label">
|
|
|
|
|
+ <span>调班方式</span>
|
|
|
|
|
+ <el-tooltip content="调班方式为调班时目标人员、目标日期、目标班次必填。调班方式为排班变更时,目标人员、日期不可填写。" placement="top">
|
|
|
|
|
+ <i class="el-icon-question"></i>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="reScheduleValue"
|
|
|
|
|
+ :disabled="readonly"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ :placeholder=" readonly ? '' : '请选择调班方式'"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in reScheduleOptions"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="选择排班" prop="scheduleId">
|
|
<el-form-item label="选择排班" prop="scheduleId">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="formData.scheduleId"
|
|
v-model="formData.scheduleId"
|
|
@@ -150,7 +173,7 @@
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="scope.row.party"
|
|
v-model="scope.row.party"
|
|
|
- :disabled="readonly"
|
|
|
|
|
|
|
+ :disabled="readonly || reScheduleValue==='paiban'"
|
|
|
filterable
|
|
filterable
|
|
|
:placeholder=" readonly ? '' : '请选择目标人员'"
|
|
:placeholder=" readonly ? '' : '请选择目标人员'"
|
|
|
@change="handlePartyChange($event, scope.row, scope.$index, 'change')"
|
|
@change="handlePartyChange($event, scope.row, scope.$index, 'change')"
|
|
@@ -172,7 +195,7 @@
|
|
|
align="center"
|
|
align="center"
|
|
|
>
|
|
>
|
|
|
<template slot="header">
|
|
<template slot="header">
|
|
|
- <span>调班日期</span>
|
|
|
|
|
|
|
+ <span>目标日期</span>
|
|
|
<el-tooltip content="仅可选择当前排班范围内且目标人员有可选班次的日期" placement="top">
|
|
<el-tooltip content="仅可选择当前排班范围内且目标人员有可选班次的日期" placement="top">
|
|
|
<i class="el-icon-question"></i>
|
|
<i class="el-icon-question"></i>
|
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -180,7 +203,7 @@
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="scope.row.afterDate"
|
|
v-model="scope.row.afterDate"
|
|
|
- :disabled="readonly"
|
|
|
|
|
|
|
+ :disabled="readonly || reScheduleValue==='paiban'"
|
|
|
:placeholder=" readonly ? '' : '请选择目标日期'"
|
|
:placeholder=" readonly ? '' : '请选择目标日期'"
|
|
|
@change="handleDateChange($event, scope.$index, 'afterShiftList')"
|
|
@change="handleDateChange($event, scope.$index, 'afterShiftList')"
|
|
|
>
|
|
>
|
|
@@ -214,6 +237,7 @@
|
|
|
multiple
|
|
multiple
|
|
|
filterable
|
|
filterable
|
|
|
:placeholder=" readonly ? '' : '请选择目标班次'"
|
|
:placeholder=" readonly ? '' : '请选择目标班次'"
|
|
|
|
|
+ @visible-change="(visible) => {getPaiBanBanci(visible,scope.$index)}"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in scope.row.afterShiftList"
|
|
v-for="item in scope.row.afterShiftList"
|
|
@@ -280,6 +304,8 @@ export default {
|
|
|
afterDateList: [], // 目标日期下拉数据
|
|
afterDateList: [], // 目标日期下拉数据
|
|
|
blockList: [], // 被锁定数据
|
|
blockList: [], // 被锁定数据
|
|
|
scheduleOptions: [],
|
|
scheduleOptions: [],
|
|
|
|
|
+ reScheduleOptions: [{ key: 'diaoban', value: 'diaoban', label: '调班' }, { key: 'paiban', value: 'paiban', label: '排班变更' }],
|
|
|
|
|
+ reScheduleValue: '',
|
|
|
selectionIndex: [],
|
|
selectionIndex: [],
|
|
|
toolbars: [
|
|
toolbars: [
|
|
|
{ key: 'save', icon: 'ibps-icon-save', label: '提交', type: 'success', visible: !this.readonly },
|
|
{ key: 'save', icon: 'ibps-icon-save', label: '提交', type: 'success', visible: !this.readonly },
|
|
@@ -446,6 +472,30 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
},
|
|
},
|
|
|
|
|
+ rowValidate (row, index) {
|
|
|
|
|
+ if (!row.beforeDate) {
|
|
|
|
|
+ this.$message.warning(`第${index}行` + '调班日期未选择!')
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ if (row.beforeAdjust.length < 1) {
|
|
|
|
|
+ this.$message.warning(`第${index}行` + '调班班次未选择!')
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.reScheduleValue === 'diaoban') { // 排班变更目标日期目标人员不用填
|
|
|
|
|
+ if (!row.afterDate) {
|
|
|
|
|
+ this.$message.warning(`第${index}行` + '目标人员未选择!')
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!row.party) {
|
|
|
|
|
+ this.$message.warning(`第${index}行` + '目标日期未选择!')
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (row.afterAdjust.length < 1) {
|
|
|
|
|
+ this.$message.warning(`第${index}行` + '目标班次未选择!')
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
initDateOptions (startDateStr, obj) { // 初始化日期下拉数据
|
|
initDateOptions (startDateStr, obj) { // 初始化日期下拉数据
|
|
|
const result = []
|
|
const result = []
|
|
|
const startDate = new Date(startDateStr)
|
|
const startDate = new Date(startDateStr)
|
|
@@ -640,6 +690,13 @@ export default {
|
|
|
this.handleDateChange(row.afterDate, index, 'afterShiftList')
|
|
this.handleDateChange(row.afterDate, index, 'afterShiftList')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getPaiBanBanci (visible, index) { // 排班变更方式,班次全部可选,目标人员和日期不可选
|
|
|
|
|
+ if (this.reScheduleValue === 'paiban' && visible === true) {
|
|
|
|
|
+ this.formData.adjustList[index]['afterShiftList'] = this.scheduleInfo.scheduleShift
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
handleFormAction ({ key }) {
|
|
handleFormAction ({ key }) {
|
|
|
switch (key) {
|
|
switch (key) {
|
|
|
case 'save':
|
|
case 'save':
|
|
@@ -699,6 +756,15 @@ export default {
|
|
|
let statusVal = '已暂存'
|
|
let statusVal = '已暂存'
|
|
|
if (key === 'tempSave') { // 暂存
|
|
if (key === 'tempSave') { // 暂存
|
|
|
} else { // 提交
|
|
} else { // 提交
|
|
|
|
|
+ // 对最后一行进行行校验
|
|
|
|
|
+ if (this.formData.adjustList.length < 1) { // 校验不通过则返回true
|
|
|
|
|
+ this.$message.warning('调班表未填写数据!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.rowValidate(this.formData.adjustList[this.formData.adjustList.length - 1], this.formData.adjustList.length)) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
statusVal = adjustList.some(i => this.$utils.isNotEmpty(i.party)) ? '待审核' : '待审批'
|
|
statusVal = adjustList.some(i => this.$utils.isNotEmpty(i.party)) ? '待审核' : '待审批'
|
|
|
}
|
|
}
|
|
|
// return
|
|
// return
|
|
@@ -746,6 +812,10 @@ export default {
|
|
|
if (this.formData.adjustList.length > 0) {
|
|
if (this.formData.adjustList.length > 0) {
|
|
|
this.addFilterList(this.formData.adjustList)
|
|
this.addFilterList(this.formData.adjustList)
|
|
|
}
|
|
}
|
|
|
|
|
+ // 对上一行进行行校验
|
|
|
|
|
+ if (this.formData.adjustList.length > 0 && this.rowValidate(this.formData.adjustList[this.formData.adjustList.length - 1], this.formData.adjustList.length)) { // 校验不通过则返回true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.formData.adjustList.push({
|
|
this.formData.adjustList.push({
|
|
|
recordId: '',
|
|
recordId: '',
|
|
|
beforeDate: '',
|
|
beforeDate: '',
|