|
|
@@ -16,6 +16,23 @@
|
|
|
</div>
|
|
|
<div class="scrollView">
|
|
|
<van-form>
|
|
|
+ <van-field
|
|
|
+ required
|
|
|
+ label="调班方式:"
|
|
|
+ placeholder="请选择调班方式"
|
|
|
+ label-width="6em"
|
|
|
+ :value="form.type"
|
|
|
+ readonly
|
|
|
+ @click="typeValue == 3 || typeValue == 4|| typeValue == 6 ? modeShow = true:''"
|
|
|
+ />
|
|
|
+ <van-popup v-if="typeValue == 3 || typeValue == 4|| typeValue == 6" v-model="modeShow" position="bottom">
|
|
|
+ <van-picker
|
|
|
+ show-toolbar
|
|
|
+ :columns="modeType"
|
|
|
+ @confirm="actionModeCallback"
|
|
|
+ @cancel="modeShow = false"
|
|
|
+ />
|
|
|
+ </van-popup>
|
|
|
<van-field
|
|
|
required
|
|
|
label="选择排班:"
|
|
|
@@ -23,9 +40,9 @@
|
|
|
label-width="6em"
|
|
|
:value="form.paiBan"
|
|
|
readonly
|
|
|
- @click="typeValue == 3 || typeValue == 4 ? sheetShow = true:''"
|
|
|
+ @click="typeValue == 3 || typeValue == 4 || typeValue == 6? sheetShow = true:''"
|
|
|
/>
|
|
|
- <van-popup v-if="list.length>0 && (typeValue == 3 || typeValue == 4 )" v-model="sheetShow" position="bottom">
|
|
|
+ <van-popup v-if="list.length>0 && (typeValue == 3 || typeValue == 4|| typeValue == 6 )" v-model="sheetShow" position="bottom">
|
|
|
<van-picker
|
|
|
show-toolbar
|
|
|
:columns="list"
|
|
|
@@ -35,33 +52,32 @@
|
|
|
</van-popup>
|
|
|
<van-field
|
|
|
v-model="form.tiaoBanYuanYin"
|
|
|
- required
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
label="调班原因:"
|
|
|
placeholder="请输入调班原因"
|
|
|
label-width="6em"
|
|
|
clearable
|
|
|
- :readonly="typeValue != 3 && typeValue != 4 ? true : false"
|
|
|
+ :readonly="typeValue != 3 && typeValue != 4 && typeValue != 6? true : false"
|
|
|
/>
|
|
|
</van-form>
|
|
|
- <div v-if="(typeValue==1||typeValue==2||typeValue == '5')||(typeof showDateArr == 'object'&&Object.keys(showDateArr).length>0&&showDateArr[userInfo.user.id].dateKeyArr.length>0&&tabChildShow)" class="tabChildClass">
|
|
|
- <div v-if="typeValue == 3 || typeValue == 4 " class="tabAdd"><van-button plain hairline round size="mini" icon="plus" type="primary" @click="addEvent">添加</van-button></div>
|
|
|
+ <div v-if="(typeValue==1||typeValue==2||typeValue == 5 || typeValue == 7)||(typeof showDateArr == 'object'&&Object.keys(showDateArr).length>0&&showDateArr[userInfo.user.id].dateKeyArr.length>0&&tabChildShow)" class="tabChildClass">
|
|
|
+ <div v-if="typeValue == 3 || typeValue == 4 || typeValue == 6 " class="tabAdd"><van-button plain hairline round size="mini" icon="plus" type="primary" @click="addEvent">添加</van-button></div>
|
|
|
<van-collapse v-if="tabChildActiveArr.length>0" v-model="tabChildActive">
|
|
|
<van-collapse-item v-for="(item, index) in tabChildActiveArr" :key="index" :name="index+''" >
|
|
|
<template #title>
|
|
|
- <div>{{'序号'+ (index+1)}} <van-icon name="question-o" /></div>
|
|
|
+ <div style="display: flex;align-items: center;">{{'序号'+ (index+1)}} <van-icon name="close" style="margin-left:5px" color="#ee0a24" @click.stop.prevent="delCollapse(index)" /></div>
|
|
|
</template>
|
|
|
<van-field
|
|
|
required
|
|
|
label="调班日期:"
|
|
|
- :placeholder="form.paiBan===''?'请先选择排班记录':'请选择调班日期'"
|
|
|
+ :placeholder="form.paiBan===''?'请先选择排班记录':showDateArr[userInfo.user.id].dateKeyArr.length>0?'请选择调班日期':'暂无可选日期'"
|
|
|
label-width="6em"
|
|
|
:value="tabChildActiveArr[index].tiaobanBenRenRiQi"
|
|
|
readonly
|
|
|
- @click="typeValue == 3 || typeValue == 4 ? tbbrrqShow = true:''"
|
|
|
+ @click="(typeValue == 3 || typeValue == 4 || typeValue == 6)&&showDateArr[userInfo.user.id].dateKeyArr.length>0 ? tbbrrqShow = true:''"
|
|
|
/>
|
|
|
- <van-popup v-if="(typeValue == 3 || typeValue == 4 )&&Object.keys(showDateArr[userInfo.user.id]).length>0" v-model="tbbrrqShow" position="bottom">
|
|
|
+ <van-popup v-if="(typeValue == 3 || typeValue == 4 || typeValue == 6 )&&Object.keys(showDateArr[userInfo.user.id]).length>0" v-model="tbbrrqShow" position="bottom">
|
|
|
<van-picker
|
|
|
:ref="'tbrq'+index"
|
|
|
show-toolbar
|
|
|
@@ -73,13 +89,31 @@
|
|
|
<van-field
|
|
|
required
|
|
|
label="调班班次:"
|
|
|
- :placeholder="tabChildActiveArr[index].tiaobanBenRenRiQi===''?'请先选择调班日期':'请选择调班班次'"
|
|
|
+ :placeholder="tabChildActiveArr[index].tiaobanBenRenRiQi===''?'请先选择调班日期':showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi]!=''?'请选择调班班次':'暂无可选班次'"
|
|
|
label-width="6em"
|
|
|
:value="tabChildActiveArr[index].tiaobanBenRenBanCi"
|
|
|
readonly
|
|
|
- @click="(typeValue == 3 || typeValue == 4) && tabChildActiveArr[index].tiaobanBenRenRiQi!=='' ? tbbrbcShow = true:''"
|
|
|
+ @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanBenRenRiQi!=='' &&showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi]!=''? tbbrbcShow = true:''"
|
|
|
/>
|
|
|
- <van-popup v-if="tabChildActiveArr[index].tiaobanBenRenRiQi!==''&& (typeValue == 3 || typeValue == 4 )" v-model="tbbrbcShow" position="bottom">
|
|
|
+ <van-popup v-if="tabChildActiveArr[index].tiaobanBenRenRiQi!==''&& (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbbrbcShow" position="bottom">
|
|
|
+ <!-- <van-checkbox-group v-model="tabChildActiveArr[index].tiaobanBenRenBanCi">
|
|
|
+
|
|
|
+ <van-cell-group>
|
|
|
+ <van-cell
|
|
|
+ v-for="(item, index) in getBanCi(showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi])"
|
|
|
+
|
|
|
+ :ref="'tbbc'+index"
|
|
|
+ :key="item"
|
|
|
+ clickable
|
|
|
+ :title="`${item}`"
|
|
|
+ @click="toggle(index)"
|
|
|
+ >
|
|
|
+ <template #right-icon>
|
|
|
+ <van-checkbox ref="checkboxes" :name="item" />
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
+ </van-checkbox-group> -->
|
|
|
<van-picker
|
|
|
:ref="'tbbc'+index"
|
|
|
show-toolbar
|
|
|
@@ -89,15 +123,16 @@
|
|
|
/>
|
|
|
</van-popup>
|
|
|
<van-field
|
|
|
+ v-if="form.type!=='排班变更'"
|
|
|
required
|
|
|
label="目标人员:"
|
|
|
- :placeholder="form.paiBan===''?'请先选择排班记录':'请选择目标人员'"
|
|
|
+ :placeholder="form.paiBan===''?'请先选择排班记录':getAllPer(showDateArr).length>0?'请选择目标人员':'暂无可选人员'"
|
|
|
label-width="6em"
|
|
|
:value="tabChildActiveArr[index].tiaobanMuBiaoRenYuan"
|
|
|
readonly
|
|
|
- @click="typeValue == 3 || typeValue == 4 ? tbmbryShow = true:''"
|
|
|
+ @click="(typeValue == 3 || typeValue == 4 || typeValue == 6 )&&getAllPer(showDateArr).length>0? tbmbryShow = true:''"
|
|
|
/>
|
|
|
- <van-popup v-if="Object.keys(showDateArr).length>1 && (typeValue == 3 || typeValue == 4 )" v-model="tbmbryShow" position="bottom">
|
|
|
+ <van-popup v-if="Object.keys(showDateArr).length>1 && (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbmbryShow" position="bottom">
|
|
|
<van-picker
|
|
|
:ref="'mbry'+index"
|
|
|
show-toolbar
|
|
|
@@ -109,13 +144,13 @@
|
|
|
<van-field
|
|
|
required
|
|
|
label="目标日期:"
|
|
|
- :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRenYuan===''?'请先选择目标人员':'请选择目标日期'"
|
|
|
+ :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRenYuan===''?'请先选择目标人员':showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr.length>0?'请选择目标日期':'暂无可选日期'"
|
|
|
label-width="6em"
|
|
|
:value="tabChildActiveArr[index].tiaobanMuBiaoRiQi"
|
|
|
readonly
|
|
|
- @click="(typeValue == 3 || typeValue == 4) && tabChildActiveArr[index].tiaobanMuBiaoRenYuan!=='' ? tbmbrqShow = true:''"
|
|
|
+ @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanMuBiaoRenYuan!=='' && showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr.length>0? tbmbrqShow = true:''"
|
|
|
/>
|
|
|
- <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRenYuan!==''&& (typeValue == 3 || typeValue == 4 )" v-model="tbmbrqShow" position="bottom">
|
|
|
+ <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRenYuan!==''&& (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbmbrqShow" position="bottom">
|
|
|
<van-picker
|
|
|
:ref="'mbrq'+index"
|
|
|
show-toolbar
|
|
|
@@ -125,15 +160,15 @@
|
|
|
/>
|
|
|
</van-popup>
|
|
|
<van-field
|
|
|
- required
|
|
|
+ :required="form.type==='调班'"
|
|
|
label="目标班次:"
|
|
|
- :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRiQi===''?'请先选择目标日期':'请选择目标班次'"
|
|
|
+ :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRiQi===''?'请先选择目标日期':form.type==='排班变更'?'不选择班次视为休息':showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[index].tiaobanMuBiaoRiQi]!=''?'请选择目标班次':'暂无可选班次'"
|
|
|
label-width="6em"
|
|
|
:value="tabChildActiveArr[index].tiaobanMuBiaoBanCi"
|
|
|
readonly
|
|
|
- @click="(typeValue == 3 || typeValue == 4) && tabChildActiveArr[index].tiaobanMuBiaoRiQi!=='' ? tbmbbcShow = true:''"
|
|
|
+ @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanMuBiaoRiQi!=='' && showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[index].tiaobanMuBiaoRiQi]!=''? tbmbbcShow = true:''"
|
|
|
/>
|
|
|
- <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRiQi!==''&& (typeValue == 3 || typeValue == 4 )" v-model="tbmbbcShow" position="bottom">
|
|
|
+ <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRiQi!==''&& (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbmbbcShow" position="bottom">
|
|
|
<van-picker
|
|
|
:ref="'mbbc'+index"
|
|
|
show-toolbar
|
|
|
@@ -146,23 +181,23 @@
|
|
|
</van-collapse>
|
|
|
</div>
|
|
|
|
|
|
- <van-cell-group v-if="typeValue != 3 && typeValue != 4">
|
|
|
- <div class="verticalLine" style="width:4em;padding: 1em 0;">
|
|
|
- 意见
|
|
|
+ <van-cell-group v-if="typeValue == 2 || typeValue == 5">
|
|
|
+ <div class="verticalLine" style="width:6em;padding: 1em 0;">
|
|
|
+ 拒绝原因
|
|
|
</div>
|
|
|
<van-field
|
|
|
v-model="form.gouTongQueDingNei"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
label=""
|
|
|
- placeholder="请输入意见和建议"
|
|
|
+ placeholder="若拒绝,请输入原因"
|
|
|
label-width="0"
|
|
|
clearable
|
|
|
- :readonly="typeValue != 2"
|
|
|
+ :readonly="typeValue != 2 && typeValue != 5"
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
|
|
|
- <div v-if="typeValue == '3'" class="padding flex flex-direction">
|
|
|
+ <div v-if="typeValue == '3'||typeValue == '6'" class="padding flex flex-direction">
|
|
|
<van-button
|
|
|
type="success"
|
|
|
class="btn btn-back-color"
|
|
|
@@ -170,20 +205,39 @@
|
|
|
>提交
|
|
|
</van-button>
|
|
|
</div>
|
|
|
- <div v-if="typeValue == '2'" class="padding flex flex-direction">
|
|
|
+ <div v-if="typeValue == '2'||typeValue == '5'" class="padding flex flex-direction">
|
|
|
<van-button
|
|
|
type="success"
|
|
|
- class="btn btn-back-color"
|
|
|
- @click="onAgree('已完成', '同意', '确定')"
|
|
|
+ class="btn"
|
|
|
+ style="margin: 0 3px 0 6px;"
|
|
|
+ @click="onAgree(typeValue == '2'?'已通过':'已完成', '同意', '同意')"
|
|
|
>同意
|
|
|
</van-button>
|
|
|
+ <van-button
|
|
|
+ type="danger"
|
|
|
+ class="btn"
|
|
|
+ style="margin: 0 6px 0 3px;"
|
|
|
+ @click="onAgree('已拒绝', '同意', '拒绝')"
|
|
|
+ >拒绝
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
+ <!-- <div v-if="typeValue == '2'||typeValue == '5'" class="padding flex flex-direction">
|
|
|
+
|
|
|
+ </div> -->
|
|
|
+ <div v-if="typeValue == '7'" class="padding flex flex-direction">
|
|
|
+ <van-button
|
|
|
+ type="success"
|
|
|
+ class="btn btn-back-color"
|
|
|
+ @click="onAgree('已取消', '同意', '确认取消')"
|
|
|
+ >确认取消
|
|
|
+ </van-button>
|
|
|
</div>
|
|
|
<div v-if="typeValue == '4'" class="padding flex flex-direction">
|
|
|
<van-button
|
|
|
type="success"
|
|
|
class="btn btn-back-color"
|
|
|
- @click="onAgree('已编制', '重新提交', '提交')"
|
|
|
- >修改
|
|
|
+ @click="onSubmit"
|
|
|
+ >再次申请
|
|
|
</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -192,19 +246,18 @@
|
|
|
<script>
|
|
|
import random from '@/mixins/random'
|
|
|
import bpmnStatus from '@/mixins/bpmnStatus'
|
|
|
-import IbpsUploader from '@/business/platform/file/uploader'
|
|
|
+// import IbpsUploader from '@/business/platform/file/uploader'
|
|
|
import { saveAdjustment } from '@/api/platform/bpmn/bpmCommonStatment'
|
|
|
+import { getAdjustment, getStaffSchedule, saveStaffSchedule } from '@/api/platform/feature/changeShift'
|
|
|
|
|
|
import {
|
|
|
- getNextIdByAlias,
|
|
|
- findFormJsonByBo,
|
|
|
snapshot
|
|
|
} from '@/api/platform/form/transfer'
|
|
|
-import { agree } from '@/api/platform/bpmn/bpmTask'
|
|
|
+// import { agree } from '@/api/platform/bpmn/bpmTask'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- IbpsUploader
|
|
|
+ // IbpsUploader
|
|
|
},
|
|
|
mixins: [random, bpmnStatus],
|
|
|
props: {
|
|
|
@@ -231,7 +284,7 @@ export default {
|
|
|
tabChildActiveArr: [],
|
|
|
show: this.showPop,
|
|
|
showDateArr: {},
|
|
|
- // typeValue: '3',
|
|
|
+ modeShow: false,
|
|
|
sheetShow: false,
|
|
|
tbbrrqShow: false,
|
|
|
tbbrbcShow: false,
|
|
|
@@ -240,54 +293,26 @@ export default {
|
|
|
tbmbbcShow: false,
|
|
|
taskId: '',
|
|
|
form: {
|
|
|
- // xuanZeKeHu: '',
|
|
|
- // biaoDanBianHao: '',
|
|
|
- // buMenName: '',
|
|
|
- // keHuDanWeiMin: '',
|
|
|
- // keHuLianXiRen: '',
|
|
|
+ type: '',
|
|
|
tiaoBanYuanYin: '',
|
|
|
- // lianXiDianHua: '',
|
|
|
- // yangPinMingCheng: '',
|
|
|
- // yangPinBianHao: '',
|
|
|
- // yangPinLeiXing: '',
|
|
|
- // baoGaoBianHao: '',
|
|
|
paiBan: '',
|
|
|
paiBanId: '',
|
|
|
- // gouTongNeiRong: '',
|
|
|
- // keHu: '',
|
|
|
+ executor: '',
|
|
|
gouTongQueDingNei: ''
|
|
|
- // leiXing: '2',
|
|
|
- // yongHuYouXiang: '',
|
|
|
- // qiTa: ''
|
|
|
},
|
|
|
- // fuJianShangChuanArray: [],
|
|
|
- // popupShow: false,
|
|
|
list: [],
|
|
|
- // kehuXinXinList: [],
|
|
|
-
|
|
|
- // weiTuoList: [],
|
|
|
- // bianZhiRenName: '',
|
|
|
- // queDingRenName: '',
|
|
|
backShow: false,
|
|
|
option: '',
|
|
|
content: '',
|
|
|
- // timeShow: false,
|
|
|
- // params: {
|
|
|
- // year: true,
|
|
|
- // month: true,
|
|
|
- // day: true,
|
|
|
- // hour: true,
|
|
|
- // minute: true,
|
|
|
- // second: false
|
|
|
- // },
|
|
|
level: null,
|
|
|
mainPosition: {
|
|
|
id: ''
|
|
|
},
|
|
|
- // xuanzeTime: null,
|
|
|
nowDate: new Date(),
|
|
|
tabChildShow: false,
|
|
|
- dateArr: []
|
|
|
+ dateArr: [],
|
|
|
+ modeType: ['调班', '排班变更'],
|
|
|
+ poor: 0
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -305,29 +330,16 @@ export default {
|
|
|
handler: function(val, oldVal) {
|
|
|
if (val === true) {
|
|
|
this.form = {
|
|
|
- // xuanZeKeHu: '',
|
|
|
- // biaoDanBianHao: '',
|
|
|
- // buMenName: '',
|
|
|
- // keHuDanWeiMin: '',
|
|
|
- // keHuLianXiRen: '',
|
|
|
tiaoBanYuanYin: '',
|
|
|
- // lianXiDianHua: '',
|
|
|
- // yangPinMingCheng: '',
|
|
|
- // yangPinBianHao: '',
|
|
|
- // yangPinLeiXing: '',
|
|
|
- // baoGaoBianHao: '',
|
|
|
paiBan: '',
|
|
|
paiBanId: '',
|
|
|
- // gouTongNeiRong: '',
|
|
|
- // keHu: '',
|
|
|
+ type: '',
|
|
|
+ executor: '',
|
|
|
gouTongQueDingNei: ''
|
|
|
- // leiXing: '2',
|
|
|
- // yongHuYouXiang: '',
|
|
|
- // qiTa: ''
|
|
|
}
|
|
|
this.tabChildActive = ['0']
|
|
|
this.tabChildActiveArr = []
|
|
|
- this.getKehu()
|
|
|
+ // this.getKehu()
|
|
|
this.level = this.$store.getters.level
|
|
|
const mid = JSON.parse(localStorage.getItem('mainPosition'))
|
|
|
const mainPosition =
|
|
|
@@ -346,10 +358,10 @@ export default {
|
|
|
},
|
|
|
form: {
|
|
|
handler: function(val, oldVal) {
|
|
|
- if (val.paiBan !== '') {
|
|
|
+ if (val.paiBan !== '' && val.type !== '') {
|
|
|
this.tabChildShow = true
|
|
|
if (this.tabChildActiveArr.length === 0) {
|
|
|
- this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: '', tiaobanMuBiaoRenYuanId: '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
|
|
|
+ this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: this.form.type === '排班变更' ? this.userInfo.user.name : '', tiaobanMuBiaoRenYuanId: this.form.type === '排班变更' ? this.userInfo.user.id : '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
|
|
|
}
|
|
|
} else {
|
|
|
this.tabChildShow = false
|
|
|
@@ -389,14 +401,14 @@ export default {
|
|
|
data.forEach((item, i) => {
|
|
|
if (showData.hasOwnProperty(item.user_id_)) {
|
|
|
this.dateArr.forEach((e, n) => {
|
|
|
- if (item['d' + (n + 1) + '_']) {
|
|
|
+ if (item['d' + (n + 1) + '_'] && n > 4) {
|
|
|
showData[item.user_id_]['dateKeyValArr'][e] = showData[item.user_id_]['dateKeyValArr'][e] + (item['d' + (n + 1) + '_'] !== '' && showData[item.user_id_]['dateKeyValArr'][e] !== '' ? ',' : '') + (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
showData[item.user_id_] = { dateKeyArr: [], dateKeyValArr: {}}
|
|
|
this.dateArr.forEach((e, n) => {
|
|
|
- if (item['d' + (n + 1) + '_']) {
|
|
|
+ if (item['d' + (n + 1) + '_'] && n > 4) {
|
|
|
showData[item.user_id_]['dateKeyValArr'][e] = item['d' + (n + 1) + '_']
|
|
|
showData[item.user_id_]['dateKeyArr'].push({ text: e })
|
|
|
}
|
|
|
@@ -407,16 +419,32 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- actionSheetCallback(e) {
|
|
|
- this.dateArr = this.generationDate(e.obj.start_date_, e.obj.end_date_)
|
|
|
- this.getPlanList(e.id)
|
|
|
- this.form.paiBan = e.text
|
|
|
- this.form.paiBanId = e.id
|
|
|
+ actionSheetCallback(e, type = '') {
|
|
|
+ if (this.form.paiBan !== e || type === '1') {
|
|
|
+ this.dateArr = this.generationDate(e.obj.start_date_, e.obj.end_date_)
|
|
|
+ this.getPlanList(e.id)
|
|
|
+ this.form.paiBan = e.text
|
|
|
+ this.form.paiBanId = e.id
|
|
|
+ this.form.executor = JSON.parse(e.obj.config_).approver.join(',')
|
|
|
+ }
|
|
|
+
|
|
|
this.sheetShow = false
|
|
|
},
|
|
|
+ actionModeCallback(e, type = '') {
|
|
|
+ if (this.form.type !== e || type === '1') {
|
|
|
+ this.form.type = e
|
|
|
+ this.tabChildActiveArr = []
|
|
|
+ this.tabChildActive = ['0']
|
|
|
+ }
|
|
|
+ this.modeShow = false
|
|
|
+ },
|
|
|
actionTbbrrqCallback(index) {
|
|
|
const obj = this.$refs['tbrq' + index][0].getValues()
|
|
|
- this.tabChildActiveArr[index].tiaobanBenRenRiQi = obj[0].text
|
|
|
+ if (this.tabChildActiveArr[index].tiaobanBenRenRiQi !== obj[0].text) {
|
|
|
+ this.tabChildActiveArr[index].tiaobanBenRenRiQi = obj[0].text
|
|
|
+
|
|
|
+ this.tabChildActiveArr[index].tiaobanBenRenBanCi = ''
|
|
|
+ }
|
|
|
this.tbbrrqShow = false
|
|
|
},
|
|
|
actionTbbrbcCallback(index) {
|
|
|
@@ -426,13 +454,24 @@ export default {
|
|
|
},
|
|
|
actionTbmbryCallback(index) {
|
|
|
const obj = this.$refs['mbry' + index][0].getValues()
|
|
|
- this.tabChildActiveArr[index].tiaobanMuBiaoRenYuan = obj[0].text
|
|
|
- this.tabChildActiveArr[index].tiaobanMuBiaoRenYuanId = obj[0].id
|
|
|
+ if (this.tabChildActiveArr[index].tiaobanMuBiaoRenYuan !== obj[0].text && this.tabChildActiveArr[index].tiaobanMuBiaoRenYuanId !== obj[0].id) {
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRenYuan = obj[0].text
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRenYuanId = obj[0].id
|
|
|
+
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRiQi = ''
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = ''
|
|
|
+ }
|
|
|
+
|
|
|
this.tbmbryShow = false
|
|
|
},
|
|
|
actionTbmbrqCallback(index) {
|
|
|
const obj = this.$refs['mbrq' + index][0].getValues()
|
|
|
- this.tabChildActiveArr[index].tiaobanMuBiaoRiQi = obj[0].text
|
|
|
+ if (this.tabChildActiveArr[index].tiaobanMuBiaoRiQi !== obj[0].text) {
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoRiQi = obj[0].text
|
|
|
+
|
|
|
+ this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = ''
|
|
|
+ }
|
|
|
+
|
|
|
this.tbmbrqShow = false
|
|
|
},
|
|
|
actionTbmbbcCallback(index) {
|
|
|
@@ -442,7 +481,6 @@ export default {
|
|
|
},
|
|
|
// 获取排班人员
|
|
|
getAllPer(val) {
|
|
|
- // console.log(val)
|
|
|
const data = Object.keys(val)
|
|
|
const returnArr = []
|
|
|
data.forEach((item, i) => {
|
|
|
@@ -469,6 +507,7 @@ export default {
|
|
|
de.setUTCFullYear(endArr[0], endArr[1] - 1, endArr[2])
|
|
|
const unixDb = db.getTime()
|
|
|
const unixDe = de.getTime()
|
|
|
+ this.daysBetween(db, this.nowDate)
|
|
|
let stamp
|
|
|
const oneDay = 24 * 60 * 60 * 1000
|
|
|
for (stamp = unixDb; stamp <= unixDe;) {
|
|
|
@@ -477,37 +516,44 @@ export default {
|
|
|
}
|
|
|
return dateArr
|
|
|
},
|
|
|
+ daysBetween(date1, date2) {
|
|
|
+ const oneDay = 24 * 60 * 60 * 1000 // 每天的毫秒数
|
|
|
+ const diff = date2.getTime() - date1.getTime() // 计算两个日期的时间差(绝对值)
|
|
|
+ this.poor = Math.floor(diff / oneDay) // 将时间差转换为天数
|
|
|
+ },
|
|
|
addEvent() {
|
|
|
this.tabChildActive.push(this.tabChildActiveArr.length + '')
|
|
|
- this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: '', tiaobanMuBiaoRenYuanId: '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
|
|
|
- },
|
|
|
- getKehu() {
|
|
|
- const info = this.$store.getters.userInfo
|
|
|
- if (info) {
|
|
|
- // this.form.keHuDanWeiMin = info.user.qq
|
|
|
- // this.form.lianXiDianHua = info.user.mobile
|
|
|
- // this.form.keHuDanWeiMingChe = info.user.id
|
|
|
- // this.form.keHuLianXiRen = info.user.fullname
|
|
|
- this.form.paiBan = ''
|
|
|
- this.form.gouTongRiQi = this.$methCommon.time(16)
|
|
|
- // this.xuanzeTime = new Date()
|
|
|
- // this.form.yongHuYouXiang = info.user.email
|
|
|
- }
|
|
|
+ this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: this.form.type === '排班变更' ? this.userInfo.user.name : '', tiaobanMuBiaoRenYuanId: this.form.type === '排班变更' ? this.userInfo.user.id : '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
|
|
|
},
|
|
|
+ // getKehu() {
|
|
|
+ // const info = this.$store.getters.userInfo
|
|
|
+ // if (info) {
|
|
|
+ // // this.form.keHuDanWeiMin = info.user.qq
|
|
|
+ // // this.form.lianXiDianHua = info.user.mobile
|
|
|
+ // // this.form.keHuDanWeiMingChe = info.user.id
|
|
|
+ // // this.form.keHuLianXiRen = info.user.fullname
|
|
|
+ // // this.form.paiBan = ''
|
|
|
+ // // this.form.gouTongRiQi = this.$methCommon.time(16)
|
|
|
+ // // this.xuanzeTime = new Date()
|
|
|
+ // // this.form.yongHuYouXiang = info.user.email
|
|
|
+ // }
|
|
|
+ // },
|
|
|
getDe(id) {
|
|
|
- const sql = `select c.*,d.title_ from (select a.id_ as fid, a.schedule_id_,a.reason_,a.status,b.* from t_adjustment_detail b join t_adjustment a on a.id_ = b.parent_id_ where a.id_ = '${id}') c join t_schedule d on c.schedule_id_ = d.id_`
|
|
|
+ const sql = `select c.*,d.title_,d.start_date_, d.end_date_,d.config_ from (select a.id_ as fid, a.schedule_id_,a.reason_,a.status,a.type_,a.executor_,a.reject_reason_ as frejectReason,b.* from t_adjustment_detail b join t_adjustment a on a.id_ = b.parent_id_ where a.id_ = '${id}') c join t_schedule d on c.schedule_id_ = d.id_`
|
|
|
|
|
|
this.$common.request('sql', sql).then(res => {
|
|
|
if (res.state === 200) {
|
|
|
const data = res.variables.data
|
|
|
this.form = {
|
|
|
id: data[0].id_,
|
|
|
+ type: data[0].type_ === 'diaoban' ? '调班' : data[0].type_ === 'paiban' ? '排班变更' : '',
|
|
|
tiaoBanYuanYin: data[0].reason_,
|
|
|
paiBan: data[0].title_,
|
|
|
paiBanId: data[0].schedule_id_,
|
|
|
- gouTongQueDingNei: data[0].gou_tong_que_ding,
|
|
|
+ gouTongQueDingNei: data[0].frejectReason,
|
|
|
bianZhiShiJian: data[0].bian_zhi_shi_jian,
|
|
|
- gouTongRiQi: data[0].gou_tong_ri_qi_
|
|
|
+ // gouTongRiQi: data[0].gou_tong_ri_qi_,
|
|
|
+ executor: data[0].executor_
|
|
|
}
|
|
|
this.tabChildActive = []
|
|
|
data.forEach((item, i) => {
|
|
|
@@ -528,53 +574,63 @@ export default {
|
|
|
}
|
|
|
)
|
|
|
})
|
|
|
- // if (this.typeValue === '2' || this.typeValue === '4') {
|
|
|
- // this.getTaskId(data.id_)
|
|
|
- // }
|
|
|
+ this.actionSheetCallback({ text: data[0].title_, id: data[0].schedule_id_, obj: data[0] }, '1')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ delCollapse(val) {
|
|
|
+ if (this.tabChildActiveArr.length === 1) {
|
|
|
+ this.$notify({
|
|
|
+ type: 'success',
|
|
|
+ message: '只剩一个,不能再删了哦~'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.tabChildActiveArr = this.tabChildActiveArr.filter((item, i) => i !== val)
|
|
|
+ }
|
|
|
+ },
|
|
|
onSubmit() {
|
|
|
if (!this.getYanZheng()) {
|
|
|
return
|
|
|
}
|
|
|
- // const tmpArray = []
|
|
|
- // this.fuJianShangChuanArray.forEach(item => {
|
|
|
- // tmpArray.push(item.id)
|
|
|
- // })
|
|
|
-
|
|
|
- // const info = this.$store.getters.userInfo
|
|
|
const { second = '' } = this.$store.getters.level || {}
|
|
|
- // const useId = info.user.id
|
|
|
- // const detpId = info.employee.positions
|
|
|
const midArr = []
|
|
|
let midStr = ''
|
|
|
+ let mark = 0
|
|
|
this.tabChildActiveArr.forEach((item, i) => {
|
|
|
const str = `${this.userInfo.user.name}${item.tiaobanBenRenRiQi}班次【${item.tiaobanBenRenBanCi}】与${item.tiaobanMuBiaoRenYuan}${item.tiaobanMuBiaoRiQi}班次【${item.tiaobanMuBiaoBanCi}】调换`
|
|
|
+ const str1 = `${this.userInfo.user.name}${item.tiaobanBenRenRiQi}班次【${item.tiaobanBenRenBanCi}】与${item.tiaobanMuBiaoRiQi}班次【${item.tiaobanMuBiaoBanCi}】调换`
|
|
|
+ const str2 = `${this.userInfo.user.name}${item.tiaobanBenRenRiQi}班次【${item.tiaobanBenRenBanCi}】休息`
|
|
|
if (i === 0) {
|
|
|
- midStr = str
|
|
|
+ midStr = this.form.type === '调班' ? str : item.tiaobanMuBiaoBanCi === '' ? str2 : str1
|
|
|
} else {
|
|
|
- midStr = midStr + ';' + str
|
|
|
+ const strAdd = this.form.type === '调班' ? str : item.tiaobanMuBiaoBanCi === '' ? str2 : str1
|
|
|
+ midStr = midStr + ';' + strAdd
|
|
|
+ }
|
|
|
+ if (item.tiaobanMuBiaoRenYuanId === this.userInfo.user.id) {
|
|
|
+ mark += 1
|
|
|
}
|
|
|
-
|
|
|
midArr.push({
|
|
|
afterAdjust: item.tiaobanMuBiaoBanCi,
|
|
|
afterDate: item.tiaobanMuBiaoRiQi,
|
|
|
beforeAdjust: item.tiaobanBenRenBanCi,
|
|
|
beforeDate: item.tiaobanBenRenRiQi,
|
|
|
party: item.tiaobanMuBiaoRenYuanId,
|
|
|
- status: '待审核'
|
|
|
+ status: item.tiaobanMuBiaoRenYuanId === this.userInfo.user.id ? '审核中' : '待审核'
|
|
|
})
|
|
|
})
|
|
|
- console.log(midArr)
|
|
|
const para = {
|
|
|
adjustmentDetailPoList: midArr,
|
|
|
diDian: second,
|
|
|
overview: midStr,
|
|
|
reason: this.form.tiaoBanYuanYin,
|
|
|
scheduleId: this.form.paiBanId,
|
|
|
- status: '待审核'
|
|
|
+ type: this.form.type === '排班变更' ? 'paiban' : 'diaoban',
|
|
|
+ executor: this.form.executor,
|
|
|
+ status: this.form.type === '排班变更' || this.form.type === '调班' && mark >= midArr.length ? '待审批' : this.form.type === '调班' && mark > 0 && mark < midArr.length ? '审核中' : '待审核',
|
|
|
+ rejectReason: '',
|
|
|
+ id: this.id
|
|
|
}
|
|
|
+
|
|
|
const that = this
|
|
|
|
|
|
saveAdjustment(para)
|
|
|
@@ -589,95 +645,56 @@ export default {
|
|
|
.catch(() => {})
|
|
|
},
|
|
|
onAgree(shiFouGuoShen, opinion, type) {
|
|
|
- if (this.typeValue !== '2' && !this.getYanZheng()) {
|
|
|
- return
|
|
|
- }
|
|
|
- // const info = this.$store.getters.userInfo
|
|
|
- // const useId = info.user.id
|
|
|
- // const detpId = info.employee.positions
|
|
|
- // const tmpArray = []
|
|
|
- // this.fuJianShangChuanArray.forEach(item => {
|
|
|
- // tmpArray.push(item.id)
|
|
|
- // })
|
|
|
- // this.form.fuJian = tmpArray.join(',')
|
|
|
- this.form.shiFouGuoShen = shiFouGuoShen
|
|
|
- this.form.diDian = this.level.second
|
|
|
- this.form.shiFouGuoShen = shiFouGuoShen
|
|
|
- const editData = {
|
|
|
- data: JSON.stringify(this.form),
|
|
|
- opinion: opinion,
|
|
|
- taskId: this.taskId
|
|
|
- }
|
|
|
- agree(editData).then(res => {
|
|
|
+ let midParam = {}
|
|
|
+ const that = this
|
|
|
+ getAdjustment({ id: this.id }).then((res) => {
|
|
|
+ midParam = res.data
|
|
|
+ midParam.rejectReason = this.form.gouTongQueDingNei
|
|
|
if (res.state === 200) {
|
|
|
- if (this.typeValue === '2') {
|
|
|
- setTimeout(() => {
|
|
|
- this.getPath(this.id)
|
|
|
- }, 1000)
|
|
|
+ if (this.typeValue == 5 && midParam.adjustmentDetailPoList.length > 0) {
|
|
|
+ midParam.adjustmentDetailPoList.forEach(item => {
|
|
|
+ if (item.party === this.userInfo.user.id) {
|
|
|
+ item.status = '待审批'
|
|
|
+ }
|
|
|
+ console.log(item.party === this.userInfo.user.id, item.status)
|
|
|
+ })
|
|
|
+ console.log()
|
|
|
+ midParam.status = midParam.adjustmentDetailPoList.some(item => item.status === '待审核') ? '审核中' : '待审批'
|
|
|
+ } else if (midParam.adjustmentDetailPoList.length > 0) {
|
|
|
+ midParam.adjustmentDetailPoList.forEach(item => {
|
|
|
+ item.status === shiFouGuoShen
|
|
|
+ })
|
|
|
+ midParam.status = shiFouGuoShen
|
|
|
} else {
|
|
|
- this.$toast.success(type + '成功!')
|
|
|
- this.closePop()
|
|
|
+ midParam.status = shiFouGuoShen
|
|
|
}
|
|
|
- this.$toast.success(type + '成功!')
|
|
|
- setTimeout(() => {
|
|
|
- this.closePop()
|
|
|
- }, 1000)
|
|
|
- } else {
|
|
|
- this.$toast.fail(type + '异常!')
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 生成快照
|
|
|
- getPath(id) {
|
|
|
- const org = this.level.first
|
|
|
|
|
|
- const url = this.$common.getRequest.downloadReport(
|
|
|
- '咨询活动/客户沟通记录表.rpx',
|
|
|
- `id_=${id}&org_=${org}`
|
|
|
- )
|
|
|
- const data = {
|
|
|
- url,
|
|
|
- name: '用户沟通记录表' + this.$methCommon.time(19),
|
|
|
- type: 'pdf'
|
|
|
- }
|
|
|
- snapshot(data).then(res => {
|
|
|
- const result = res.data
|
|
|
- if (result.state === 200) {
|
|
|
- this.updateData(id, result.data.id)
|
|
|
+ saveAdjustment(midParam)
|
|
|
+ .then(res => {
|
|
|
+ if (res.state === 200) {
|
|
|
+ that.$toast.success(type + '成功!')
|
|
|
+ if (midParam.status === '已通过') {
|
|
|
+ this.handleAccess(midParam)
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ that.closePop()
|
|
|
+ }, 1000)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- updateData(id, fileId) {
|
|
|
- const pp = {
|
|
|
- updList: [
|
|
|
- {
|
|
|
- where: {
|
|
|
- id_: id
|
|
|
- },
|
|
|
- param: {
|
|
|
- kuai_zhao_: fileId,
|
|
|
- shi_fou_guo_shen_: '已完成'
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- tableName: 't_khgtjlb'
|
|
|
- }
|
|
|
- const data = this.$sig(pp)
|
|
|
- this.$common.request('update', data).then(res => {
|
|
|
- this.$methCommon.getPrompt('提交成功', 'success')
|
|
|
- setTimeout(() => {
|
|
|
- this.closePop()
|
|
|
- }, 1000)
|
|
|
- })
|
|
|
- },
|
|
|
getYanZheng() {
|
|
|
const suList = [
|
|
|
- 'tiaoBanYuanYin'
|
|
|
- // 'paiBan'
|
|
|
+ // 'tiaoBanYuanYin',
|
|
|
+ 'type',
|
|
|
+ 'paiBan'
|
|
|
]
|
|
|
const suListName = [
|
|
|
- '调班原因'
|
|
|
- // '排班'
|
|
|
+ // '调班原因',
|
|
|
+ '调班方式',
|
|
|
+ '排班'
|
|
|
]
|
|
|
for (const item in suList) {
|
|
|
if (!this.form[suList[item]]) {
|
|
|
@@ -689,17 +706,17 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const selList = ['gouTongRiQi', 'paiBan']
|
|
|
- const selListName = ['沟通时间', '沟通类型']
|
|
|
- for (const item in selList) {
|
|
|
- if (!this.form[selList[item]]) {
|
|
|
- this.$toast({
|
|
|
- duration: 2000, // 持续展示 toast
|
|
|
- message: '请选择' + selListName[item]
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
- }
|
|
|
+ // const selList = ['gouTongRiQi', 'paiBan']
|
|
|
+ // const selListName = ['沟通时间', '排班']
|
|
|
+ // for (const item in selList) {
|
|
|
+ // if (!this.form[selList[item]]) {
|
|
|
+ // this.$toast({
|
|
|
+ // duration: 2000, // 持续展示 toast
|
|
|
+ // message: '请选择' + selListName[item]
|
|
|
+ // })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
if (this.form.paiBan === '') {
|
|
|
this.$toast({
|
|
|
@@ -711,7 +728,7 @@ export default {
|
|
|
if (this.tabChildActiveArr.length <= 0) {
|
|
|
return false
|
|
|
}
|
|
|
- if (this.tabChildActiveArr.some(i => i.tiaobanBenRenRiQ === '' || i.tiaobanBenRenBanCi === '' || i.tiaobanMuBiaoRenYuan === '' || i.tiaobanMuBiaoRenYuanId === '' || i.tiaobanMuBiaoRiQi === '' || i.tiaobanMuBiaoBanCi === '')) {
|
|
|
+ if (this.tabChildActiveArr.some(i => i.tiaobanBenRenRiQ === '' || i.tiaobanBenRenBanCi === '' || i.tiaobanMuBiaoRenYuan === '' || i.tiaobanMuBiaoRenYuanId === '' || i.tiaobanMuBiaoRiQi === '' || (i.tiaobanMuBiaoBanCi === '' && this.form.type === '调班'))) {
|
|
|
this.$toast({
|
|
|
duration: 2000, // 持续展示 toast
|
|
|
message: '请填写具体调班信息'
|
|
|
@@ -720,33 +737,6 @@ export default {
|
|
|
}
|
|
|
return true
|
|
|
},
|
|
|
- // 根据委托单id查询 taskId
|
|
|
- getTaskId(id) {
|
|
|
- let sql = ``
|
|
|
- if (this.typeValue === '2') {
|
|
|
- sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '确认' and NODE_ID_ = 'Activity_02lroj1' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_02lroj1' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
|
|
|
- } else if (this.typeValue === '4') {
|
|
|
- sql = `select TASK_ID_,PROC_INST_ID_ from ibps_bpm_tasks where NAME_ = '沟通' and NODE_ID_ = 'Activity_0qy1dd7' and PROC_DEF_KEY_ = 'Process_0pjp1fy' and EXEC_ID_ = (select PROC_INST_ID_ from act_ru_execution where ACT_ID_ = 'Activity_0qy1dd7' and BUSINESS_KEY_ = '${id}') ORDER BY CREATE_TIME_ desc`
|
|
|
- }
|
|
|
- this.$common.request('sql', sql).then(res => {
|
|
|
- if (res.state === 200) {
|
|
|
- const result = res.variables.data[0]
|
|
|
- this.taskId = result.TASK_ID_
|
|
|
-
|
|
|
- this.getProcInstId(result.PROC_INST_ID_)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 根据委托单id查询 taskId
|
|
|
- getProcInstId(id) {
|
|
|
- const sql = `select OPTION_ from ibps_bpm_oper_log where PROC_INST_ID_ = '${id}' order by create_time_ desc limit 1`
|
|
|
- this.$common.request('sql', sql).then(res => {
|
|
|
- if (res.state === 200) {
|
|
|
- const result = res.variables.data[0]
|
|
|
- this.option = result.OPTION_
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
// 退回原因
|
|
|
getBack() {
|
|
|
this.content = this.option
|
|
|
@@ -754,7 +744,7 @@ export default {
|
|
|
this.$dialog
|
|
|
.alert({
|
|
|
title: '退回原因',
|
|
|
- message: this.option,
|
|
|
+ message: this.form.gouTongQueDingNei,
|
|
|
theme: 'round-button',
|
|
|
confirmButtonColor: '#1989fa'
|
|
|
})
|
|
|
@@ -764,6 +754,44 @@ export default {
|
|
|
},
|
|
|
cancel() {
|
|
|
this.backShow = false
|
|
|
+ },
|
|
|
+ async handleAccess(data) {
|
|
|
+ if (data.adjustmentDetailPoList.length > 0) {
|
|
|
+ const scheduleId = data.scheduleId
|
|
|
+ const response = await getStaffSchedule({ id: scheduleId })
|
|
|
+ const submitData = response.data
|
|
|
+ const { staffScheduleDetailPoList, startDate } = response.data
|
|
|
+ data.adjustmentDetailPoList.forEach(async(el) => {
|
|
|
+ const userId = el.createBy
|
|
|
+ const partyId = el.party
|
|
|
+ const userResIndex = staffScheduleDetailPoList.findIndex(item => item.userId === userId) // 获取调班人的排班详情
|
|
|
+ const partyResIndex = staffScheduleDetailPoList.findIndex(item => item.userId === partyId) // 获取目标人的排班详情
|
|
|
+ // 修改调班人排班数据
|
|
|
+ const index = this.getDays(startDate, el.beforeDate) // 计算得出是d几天
|
|
|
+ staffScheduleDetailPoList[userResIndex][`d${index + 1}`] = staffScheduleDetailPoList[userResIndex][`d${index + 1}`].replace(el.beforeAdjust, el.afterAdjust)
|
|
|
+ if (data.type !== 'paiban') {
|
|
|
+ // 修改目标人排班数据
|
|
|
+ const partyIndex = this.getDays(startDate, el.afterDate) // 计算得出是d几天
|
|
|
+ staffScheduleDetailPoList[partyResIndex][`d${partyIndex + 1}`] = staffScheduleDetailPoList[partyResIndex][`d${partyIndex + 1}`].replace(el.afterAdjust, el.beforeAdjust)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 保存修改后的排班
|
|
|
+ submitData.staffScheduleDetailPoList = staffScheduleDetailPoList
|
|
|
+ saveStaffSchedule(submitData).then(() => {
|
|
|
+ console.log('排班已更新')
|
|
|
+ }).catch((err) => {
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getDays(start, end) { // 根据日期获取排序 d1、d2、d3...
|
|
|
+ if (!start || !end) {
|
|
|
+ return 0
|
|
|
+ }
|
|
|
+ return Math.ceil((new Date(end) - new Date(start)) / (1000 * 60 * 60 * 24))
|
|
|
+ },
|
|
|
+ toggle(index) {
|
|
|
+ this.$refs.checkboxes[index].toggle()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -796,7 +824,7 @@ export default {
|
|
|
}
|
|
|
.btn-back-color {
|
|
|
background-color: #1989fa !important;
|
|
|
- border: none;
|
|
|
+ // border: none;
|
|
|
}
|
|
|
.btn-sty {
|
|
|
padding: 0 13px;
|
|
|
@@ -847,6 +875,7 @@ export default {
|
|
|
width: 90%;
|
|
|
padding: 15px;
|
|
|
border-radius: 5px;
|
|
|
+ border: none;
|
|
|
}
|
|
|
|
|
|
.fileBox {
|