cyy il y a 1 an
Parent
commit
3a9777fc05

+ 3 - 3
src/views/platform/bpmn/my-reissue/index.vue

@@ -40,9 +40,9 @@
                       </div>
                       <div style=" width: 100%; text-align: right; padding-top: 5rpx;padding-bottom: 0rpx;">
                           <!-- <van-button v-if="item.lei_xing_ == '1' && item.shi_fou_guo_shen_ == '已编制'" type="warning" size="small" class="u-m-r-15 btn-sty" @click="getGo(item.id_,'2')">确定</van-button> -->
-                          <van-button v-if="item.zhuangTai == '未通过'||item.zhuangTai == '已撤销'" type="success" size="small" class="u-m-r-15 btn-sty" @click="getGo(item.id,'4')">重新申请</van-button>
-                          <van-button v-if="item.zhuangTai == '未通过'||item.zhuangTai == '待审核'" type="success" size="small" class="u-m-r-15 btn-sty btn-yellow-color" @click="revocation(item.id)">撤销</van-button>
-                          <van-button type="warning" size="small" class="btn-back-color btn-sty" @click="getGo(item.id,'1')">查阅</van-button>
+                          <van-button v-if="item.zhuangTai == '未通过'||item.zhuangTai == '已撤销'" type="success" size="mini" class="u-m-r-15 btn-sty" @click="getGo(item.id,'4')">重新申请</van-button>
+                          <van-button v-if="item.zhuangTai == '未通过'||item.zhuangTai == '待审核'" type="success" size="mini" class="u-m-r-15 btn-sty btn-yellow-color" @click="revocation(item.id)">撤销</van-button>
+                          <van-button type="warning" size="mini" class="btn-back-color btn-sty" @click="getGo(item.id,'1')">查阅</van-button>
                       </div>
                   </van-cell>
               </van-checkbox-group>

+ 461 - 93
src/views/platform/bpmn/shiftTransferApplication/staForm.vue

@@ -5,7 +5,7 @@
                 <van-nav-bar
                     :title="'调班 ' + (typeValue == '5'? '审核':typeValue == '4'? '修改':typeValue == '3'? '申请': typeValue == '2'? '审批': typeValue == '1'? '详情': '')"
                     :right-text="typeValue == '4' ? '退回原因' : ''"
-                    @click-left="closePop()"
+                    @click-left="closePop('default')"
                     @click-right="getBack()"
                 >
                     <template #left>
@@ -61,121 +61,172 @@
                     :readonly="typeValue != 3 && typeValue != 4 && typeValue != 6? true : false"
                 />
             </van-form>
-            <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">
+            <!-- {{ showDateArr[userInfo.user.id].dateKeyArr }} -->
+            <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+''" >
+                    <van-collapse-item v-for="(item, index) in tabChildActiveArr" :key="'tab'+index" :name="index+''" >
                       <template #title>
-                        <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>
+                        <div style="display: flex;align-items: center;">{{'序号'+ (index+1)}} <van-icon  v-if="typeValue==4||typeValue==3||typeValue==6" name="close" style="margin-left:5px" color="#ee0a24" @click.stop.prevent="delCollapse(index)" /></div>
                       </template>
                         <van-field
+                            v-if="typeValue == 3 || typeValue == 4 || typeValue == 6"
+                            required
+                            label="调班日期:"
+                            :placeholder="form.paiBan===''?'请先选择排班记录':showDateArr[userInfo.user.id]&&showDateArr[userInfo.user.id].dateKeyArr.length>0?'请选择调班日期':'暂无可选日期'"
+                            label-width="6em"
+                            :value="tabChildActiveArr[index].tiaobanBenRenRiQi"
+                            readonly
+                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6)&&showDateArr[userInfo.user.id].dateKeyArr.length>0 ? changeShow('tbbrrqShow', true, 'tbrqInd', index,'tbrq'+index,tabChildActiveArr[index].tiaobanBenRenRiQi):''"
+                        />
+                        <van-field
+                            v-else
                             required
                             label="调班日期:"
-                            :placeholder="form.paiBan===''?'请先选择排班记录':showDateArr[userInfo.user.id].dateKeyArr.length>0?'请选择调班日期':'暂无可选日期'"
                             label-width="6em"
                             :value="tabChildActiveArr[index].tiaobanBenRenRiQi"
                             readonly
-                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6)&&showDateArr[userInfo.user.id].dateKeyArr.length>0 ? tbbrrqShow = true:''"
                         />
                         <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
+                          <van-picker
                                 :ref="'tbrq'+index"
                                 show-toolbar
                                 :columns="showDateArr[userInfo.user.id].dateKeyArr"
-                                @confirm="actionTbbrrqCallback(index)"
+                                @confirm="actionTbbrrqCallback"
                                 @cancel="tbbrrqShow = false"
                             />
                         </van-popup>
                         <van-field
+                            v-if="typeValue == 3 || typeValue == 4 || typeValue == 6"
                             required
                             label="调班班次:"
                             :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 || typeValue == 6) && tabChildActiveArr[index].tiaobanBenRenRiQi!=='' &&showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi]!=''? tbbrbcShow = true:''"
+                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanBenRenRiQi!=='' &&showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi]!=''?  changeShow('tbbrbcShow', true, 'tbbcInd', index,'tbbc'+index,tabChildActiveArr[index].tiaobanBenRenBanCi):''"
                         />
-                        <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
+                        <van-field
+                            v-else
+                            required
+                            label="调班班次:"
+                            label-width="6em"
+                            :value="tabChildActiveArr[index].tiaobanBenRenBanCi"
+                            readonly
+                        />
+                        <van-popup v-if="tabChildActiveArr[index].tiaobanBenRenRiQi!==''&& (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbbrbcShow" position="bottom" :style="{ height: '30%'}" @open="actionTbbrbcOpen()">
+                            <!-- <van-picker
                                 :ref="'tbbc'+index"
                                 show-toolbar
                                 :columns="getBanCi(showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi])"
                                 @confirm="actionTbbrbcCallback(index)"
                                 @cancel="tbbrbcShow = false"
-                            />
+                            /> -->
+                            <!-- {{ showDateArr[userInfo.user.id]['dateKeyValArr'] }} -->
+                            <div class="van-picker__toolbar"><button type="button" class="van-picker__cancel" @click="actionTbbrbcOpen('1',index)">取消</button><button type="button" class="van-picker__confirm" @click="actionTbbrbcCallback(tbbcInd)">确认</button></div>
+                            <van-checkbox-group v-if="showDateArr[userInfo.user.id]['dateKeyValArr'].hasOwnProperty(tabChildActiveArr[tbbcInd].tiaobanBenRenRiQi)" v-model="tbbrbcArr[tbbcInd]" :style="{width:'100%',height:'100%'}">
+                              <!-- <van-cell-group :ref="'tbbc'+index"> -->
+                                <!-- <van-cell
+                                  v-for="(bca, i) in getBanCi(showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[index].tiaobanBenRenRiQi])"
+                                  :key="bca"
+                                  clickable
+                                  :title="`${bca}`"
+                                  @click="toggleCheckboxestbbc(i,'checkboxestbbc'+i )"
+                                > -->
+                                  <!-- <template #right-icon> -->
+                                    <van-checkbox v-for="(bca, i) in getBanCi(showDateArr[userInfo.user.id]['dateKeyValArr'][tabChildActiveArr[tbbcInd].tiaobanBenRenRiQi]||'')" :ref="'checkboxestbbc'+i" :key="bca" class="checkBoxSty" :name="bca" >{{ bca }}</van-checkbox>
+                                  <!-- </template> -->
+                                <!-- </van-cell> -->
+                              <!-- </van-cell-group> -->
+                          </van-checkbox-group>
+                          <div v-else style="display: flex;align-items: center;height: 80%;justify-content: center;"><div>该日期已过或无可选班次!</div></div>
+
                         </van-popup>
                         <van-field
-                            v-if="form.type!=='排班变更'"
+                            v-if="form.type!=='排班变更'&&(typeValue == 3 || typeValue == 4 || typeValue == 6)"
                             required
                             label="目标人员:"
                             :placeholder="form.paiBan===''?'请先选择排班记录':getAllPer(showDateArr).length>0?'请选择目标人员':'暂无可选人员'"
                             label-width="6em"
                             :value="tabChildActiveArr[index].tiaobanMuBiaoRenYuan"
                             readonly
-                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6 )&&getAllPer(showDateArr).length>0? tbmbryShow = true:''"
+                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6 )&&getAllPer(showDateArr).length>0? changeShow('tbmbryShow', true, 'mbryInd', index,'mbry'+index,tabChildActiveArr[index].tiaobanMuBiaoRenYuan):''"
+                        />
+                        <van-field
+                            v-else-if = "form.type!=='排班变更'"
+                            required
+                            label="目标人员:"
+                            label-width="6em"
+                            :value="tabChildActiveArr[index].tiaobanMuBiaoRenYuan"
+                            readonly
                         />
                         <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
                                 :columns="getAllPer(showDateArr)"
-                                @confirm="actionTbmbryCallback(index)"
+                                @confirm="actionTbmbryCallback"
                                 @cancel="tbmbryShow = false"
                             />
                         </van-popup>
                         <van-field
+                            v-if="typeValue == 3 || typeValue == 4 || typeValue == 6"
                             required
                             label="目标日期:"
                             :placeholder="tabChildActiveArr[index].tiaobanMuBiaoRenYuan===''?'请先选择目标人员':showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr.length>0?'请选择目标日期':'暂无可选日期'"
                             label-width="6em"
                             :value="tabChildActiveArr[index].tiaobanMuBiaoRiQi"
                             readonly
-                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanMuBiaoRenYuan!=='' && showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr.length>0? tbmbrqShow = true:''"
+                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanMuBiaoRenYuan!=='' && showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr.length>0? changeShow('tbmbrqShow', true, 'mbrqInd', index,'mbrq'+index,tabChildActiveArr[index].tiaobanMuBiaoRiQi):''"
+                        />
+                        <van-field
+                            v-else
+                            required
+                            label="目标日期:"
+                            label-width="6em"
+                            :value="tabChildActiveArr[index].tiaobanMuBiaoRiQi"
+                            readonly
                         />
                         <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
                                 :columns="showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId].dateKeyArr"
-                                @confirm="actionTbmbrqCallback(index)"
+                                @confirm="actionTbmbrqCallback"
                                 @cancel="tbmbrqShow = false"
                             />
                         </van-popup>
                         <van-field
+                            v-if="typeValue == 3 || typeValue == 4 || typeValue == 6"
                             :required="form.type==='调班'"
                             label="目标班次:"
                             :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 || typeValue == 6) && tabChildActiveArr[index].tiaobanMuBiaoRiQi!=='' && showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[index].tiaobanMuBiaoRiQi]!=''? tbmbbcShow = true:''"
+                            @click="(typeValue == 3 || typeValue == 4 || typeValue == 6) && tabChildActiveArr[index].tiaobanMuBiaoRiQi!=='' && showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[index].tiaobanMuBiaoRiQi]!=''? changeShow('tbmbbcShow', true, 'mbbcInd', index,'mbbc'+index,tabChildActiveArr[index].tiaobanBenRenBanCi):''"
                         />
-                        <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRiQi!==''&& (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbmbbcShow" position="bottom">
-                            <van-picker
+                        <van-field
+                            v-else
+                            :required="form.type==='调班'"
+                            label="目标班次:"
+                            label-width="6em"
+                            :value="tabChildActiveArr[index].tiaobanMuBiaoBanCi"
+                            readonly
+                        />
+                        <van-popup v-if="tabChildActiveArr[index].tiaobanMuBiaoRiQi!==''&& (typeValue == 3 || typeValue == 4 || typeValue == 6 )" v-model="tbmbbcShow" :style="{ height: '30%'}" position="bottom" @open="actionTbmbbcOpen()">
+                            <!-- <van-picker
                                 :ref="'mbbc'+index"
                                 show-toolbar
                                 :columns="getBanCi(showDateArr[tabChildActiveArr[index].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[index].tiaobanMuBiaoRiQi])"
                                 @confirm="actionTbmbbcCallback(index)"
                                 @cancel="tbmbbcShow = false"
-                            />
+                            /> -->
+                            <div class="van-picker__toolbar"><button type="button" class="van-picker__cancel" @click="actionTbmbbcOpen('1',index)">取消</button><button type="button" class="van-picker__confirm" @click="actionTbmbbcCallback(mbbcInd)">确认</button></div>
+                            <van-checkbox-group v-if="showDateArr[tabChildActiveArr[mbbcInd].tiaobanMuBiaoRenYuanId]['dateKeyValArr'].hasOwnProperty(tabChildActiveArr[mbbcInd].tiaobanMuBiaoRiQi)" v-model="tbmbbcArr[mbbcInd]" :style="{width:'100%',height:'100%'}">
+                              <van-checkbox v-for="(bca, i) in getBanCi(showDateArr[tabChildActiveArr[mbbcInd].tiaobanMuBiaoRenYuanId]['dateKeyValArr'][tabChildActiveArr[mbbcInd].tiaobanMuBiaoRiQi]||'')" :key="bca" :ref="'checkboxes'+i" class="checkBoxSty" :name="bca" >{{ bca }}</van-checkbox>
+                            </van-checkbox-group>
+                            <div v-else style="display: flex;align-items: center;height: 80%;justify-content: center;"><div>该日期已过或无可选班次!</div></div>
                         </van-popup>
                     </van-collapse-item>
                 </van-collapse>
@@ -196,7 +247,14 @@
                     :readonly="typeValue != 2 && typeValue != 5"
                 />
             </van-cell-group>
-
+            <!-- <div v-if="typeValue == '3'" class="padding flex flex-direction">
+                <van-button
+                    type="success"
+                    class="btn btn-back-color"
+                    @click="onSubmit"
+                >暂存
+                </van-button>
+            </div> -->
             <div v-if="typeValue == '3'||typeValue == '6'" class="padding flex flex-direction">
                 <van-button
                     type="success"
@@ -205,6 +263,7 @@
                 >提交
                 </van-button>
             </div>
+
             <div v-if="typeValue == '2'||typeValue == '5'" class="padding flex flex-direction">
                 <van-button
                     type="success"
@@ -276,9 +335,9 @@ export default {
     }
   },
   data() {
-    const { useId, userInfo, userList } = this.$store.getters
+    const { userId, userInfo, userList } = this.$store.getters
     return {
-      useId,
+      userId,
       userInfo,
       userList,
       tabChildActive: ['0'],
@@ -292,6 +351,13 @@ export default {
       tbmbryShow: false,
       tbmbrqShow: false,
       tbmbbcShow: false,
+      tbmbbcArr: [],
+      tbbrbcArr: [],
+      tbrqInd: 0,
+      tbbcInd: 0,
+      mbbcInd: 0,
+      mbryInd: 0,
+      mbrqInd: 0,
       taskId: '',
       form: {
         type: '',
@@ -313,7 +379,8 @@ export default {
       tabChildShow: false,
       dateArr: [],
       modeType: ['调班', '排班变更'],
-      poor: 0
+      poor: 0,
+      rowTF: []
     }
   },
   computed: {
@@ -359,14 +426,25 @@ export default {
     },
     form: {
       handler: function(val, oldVal) {
+        // if (val.paiBan !== '' && val.paiBanId !== oldVal.paiBanId && oldVal.paiBanId != '' && val.type !== '') {
+        //   this.tabChildShow = true
+        //   this.tabChildActiveArr.length = 0
+        //   this.tabChildActiveArr.push({ tiaobanBenRenRiQi: '', tiaobanBenRenBanCi: '', tiaobanMuBiaoRenYuan: this.form.type === '排班变更' ? this.userInfo.user.name : '', tiaobanMuBiaoRenYuanId: this.form.type === '排班变更' ? this.userInfo.user.id : '', tiaobanMuBiaoRiQi: '', tiaobanMuBiaoBanCi: '' })
+        // } else
         if (val.paiBan !== '' && val.type !== '') {
           this.tabChildShow = true
           if (this.tabChildActiveArr.length === 0) {
             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.tabChildActiveArr.forEach((item, i) => {
+            //   this.vaildBanci(this.tabChildActiveArr[i])
+            // })
           }
         } else {
           this.tabChildShow = false
           this.tabChildActiveArr = []
+          this.tbmbbcArr = []
+          this.tbbrbcArr = []
         }
       },
       deep: true,
@@ -376,8 +454,8 @@ export default {
   mounted() {
   },
   methods: {
-    closePop() {
-      this.$emit('updataSet', false)
+    closePop(val = '') {
+      this.$emit('updataSet', false, val)
     },
     getList(val) {
       this.list = []
@@ -402,27 +480,47 @@ export default {
           data.forEach((item, i) => {
             if (showData.hasOwnProperty(item.user_id_)) {
               this.dateArr.forEach((e, n) => {
-                if (item['d' + (n + 1) + '_'] && n > 4) {
+                // if (item['d' + (n + 1) + '_'] && n > 4) {
+                const newE = new Date(e)
+                if (newE > this.nowDate && item['d' + (n + 1) + '_']) {
                   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) + '_'] && n > 4) {
+                // if (item['d' + (n + 1) + '_'] && n > 4) {
+                const newE = new Date(e)
+                if (newE > this.nowDate && item['d' + (n + 1) + '_']) {
                   showData[item.user_id_]['dateKeyValArr'][e] = item['d' + (n + 1) + '_']
                   showData[item.user_id_]['dateKeyArr'].push({ text: e })
                 }
               })
             }
           })
-          this.showDateArr = showData
+          console.log(this.$common.getDateNow(10), showData, 'showDatashowData')
+          // this.showDateArr = showData
+          if (this.typeValue == 4 && showData[this.userId].dateKeyArr.length === 0) {
+            this.$toast(`当前排班已没有可选日期!`)
+          }
+          this.$set(this, 'showDateArr', showData)
+          // this.$nextTick(() => {
+          this.$forceUpdate() // 确保属性更新后视图正确渲染
+          // })
+          // this.$set(this, 'showDateArr', showData)
         }
       })
     },
     actionSheetCallback(e, type = '') {
       if (this.form.paiBan !== e || type === '1') {
+        // this.dateArr = this.generationDate(this.$common.getDateNow(10), e.obj.end_date_)
         this.dateArr = this.generationDate(e.obj.start_date_, e.obj.end_date_)
+        if (type !== '1') {
+          this.tabChildActiveArr.length = 0
+          this.tbmbbcArr = []
+          this.tbbrbcArr = []
+        }
+
         this.getPlanList(e.id)
         this.form.paiBan = e.text
         this.form.paiBanId = e.id
@@ -435,57 +533,94 @@ export default {
       if (this.form.type !== e || type === '1') {
         this.form.type = e
         this.tabChildActiveArr = []
+        this.tbmbbcArr = []
+        this.tbbrbcArr = []
         this.tabChildActive = ['0']
       }
       this.modeShow = false
     },
-    actionTbbrrqCallback(index) {
-      const obj = this.$refs['tbrq' + index][0].getValues()
-      if (this.tabChildActiveArr[index].tiaobanBenRenRiQi !== obj[0].text) {
-        this.tabChildActiveArr[index].tiaobanBenRenRiQi = obj[0].text
-
-        this.tabChildActiveArr[index].tiaobanBenRenBanCi = ''
+    actionTbbrrqCallback(value, index) {
+      // const obj = this.$refs['tbrq' + this.tbrqInd][0].getValues()
+      if (this.tabChildActiveArr[this.tbrqInd].tiaobanBenRenRiQi !== value.text) {
+        this.tabChildActiveArr[this.tbrqInd].tiaobanBenRenRiQi = value.text
+        this.tabChildActiveArr[this.tbrqInd].tiaobanBenRenBanCi = ''
+        this.tbbrbcArr[this.tbrqInd] = []
       }
       this.tbbrrqShow = false
     },
+    actionTbbrbcOpen(ind, index) {
+      // this.tbbrbcArr[index].length = 0
+      if (ind === '1') {
+        this.tbbrbcShow = false
+      }
+    },
+    changeShow(name, val, aim, index, def, defVal) {
+      this[name] = val
+      this[aim] = index
+      console.log(this.tbbrbcArr, aim, index)
+    },
     actionTbbrbcCallback(index) {
-      const obj = this.$refs['tbbc' + index][0].getValues()
-      this.tabChildActiveArr[index].tiaobanBenRenBanCi = obj[0]
+      // const obj = this.$refs['tbbc' + index][0].getValues()
+      // this.tabChildActiveArr[index].tiaobanBenRenBanCi = obj[0]
+      this.tabChildActiveArr[index].tiaobanBenRenBanCi = this.tbbrbcArr[index].join(',')
+      // this.rowTF[index] =
+      this.vaildBanci(this.tabChildActiveArr[index])
       this.tbbrbcShow = false
     },
-    actionTbmbryCallback(index) {
-      const obj = this.$refs['mbry' + index][0].getValues()
-      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 = ''
+    actionTbmbryCallback(value, index) {
+      // const obj = this.$refs['mbry' + index][0].getValues()
+      if (this.tabChildActiveArr[this.mbryInd].tiaobanMuBiaoRenYuan !== value.text && this.tabChildActiveArr[this.mbryInd].tiaobanMuBiaoRenYuanId !== value.id) {
+        this.tabChildActiveArr[this.mbryInd].tiaobanMuBiaoRenYuan = value.text
+        this.tabChildActiveArr[this.mbryInd].tiaobanMuBiaoRenYuanId = value.id
+        this.tbmbbcArr[this.mbryInd] = []
+        this.tabChildActiveArr[this.mbryInd].tiaobanMuBiaoRiQi = ''
+        this.tabChildActiveArr[this.mbryInd].tiaobanMuBiaoBanCi = ''
       }
 
       this.tbmbryShow = false
     },
-    actionTbmbrqCallback(index) {
-      const obj = this.$refs['mbrq' + index][0].getValues()
-      if (this.tabChildActiveArr[index].tiaobanMuBiaoRiQi !== obj[0].text) {
-        this.tabChildActiveArr[index].tiaobanMuBiaoRiQi = obj[0].text
-
-        this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = ''
+    actionTbmbrqCallback(value, index) {
+      // const obj = this.$refs['mbrq' + index][0].getValues()
+      if (this.tabChildActiveArr[this.mbrqInd].tiaobanMuBiaoRiQi !== value.text) {
+        this.tabChildActiveArr[this.mbrqInd].tiaobanMuBiaoRiQi = value.text
+        this.tbmbbcArr[this.mbryInd] = []
+        this.tabChildActiveArr[this.mbrqInd].tiaobanMuBiaoBanCi = ''
       }
 
       this.tbmbrqShow = false
     },
+    actionTbmbbcOpen(ind, index) {
+      // this.tbmbbcArr[index].length = 0
+      if (ind === '1') {
+        this.tbmbbcShow = false
+      }
+    },
     actionTbmbbcCallback(index) {
-      const obj = this.$refs['mbbc' + index][0].getValues()
-      this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = obj[0]
+      // const obj = this.$refs['mbbc' + index][0].getValues()
+      // this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = obj[0]
+      this.tabChildActiveArr[index].tiaobanMuBiaoBanCi = this.tbmbbcArr[index].join(',')
+      // this.rowTF[index] =
+      this.vaildBanci(this.tabChildActiveArr[index], index)
       this.tbmbbcShow = false
     },
+    toggle(index, name) {
+      // console.log(this.$refs[name])
+      if (this.$refs[name]) {
+        this.$refs[name][index].toggle()
+      }
+    },
+    toggleCheckboxestbbc(index, name) {
+      console.log(this.$refs[name])
+      if (this.$refs[name]) {
+        this.$refs[name][index].toggle()
+      }
+    },
     // 获取排班人员
     getAllPer(val) {
       const data = Object.keys(val)
       const returnArr = []
       data.forEach((item, i) => {
-        const mid = this.userList.findIndex(t => t.userId === item)
+        const mid = this.userList.findIndex(t => t.userId === item && t.userId !== this.userId)
         if (mid !== -1) {
           returnArr.push({ text: this.userList[mid].userName, id: this.userList[mid].userId })
         }
@@ -524,21 +659,231 @@ export default {
     },
     addEvent() {
       this.tabChildActive.push(this.tabChildActiveArr.length + '')
+      this.tbbrbcArr.push([])
+      this.tbmbbcArr.push([])
       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
-    //   }
-    // },
+    async getBlockAdjustRequest(self) {
+      // 获取锁定班次
+      const scheduleId = self
+      // const sql = `select * from t_adjustment_detail where status_ in ( "待审核", "审核中", "待审批") and parent_id_ in (select id_ from t_adjustment where schedule_id_ = '${scheduleId}')`
+
+      return new Promise((resolve, reject) => {
+        this.$common
+          .request('query', {
+            key: 'getLockedAdjustmentData',
+            params: [scheduleId]
+          })
+          .then((res) => {
+            const { data = [] } = res.variables || {}
+            resolve(data)
+          })
+          .catch((error) => {
+            reject(error)
+          })
+      })
+    },
+    vaildBanci(row, index, switchBtn = 'on') {
+      // console.log(row,this.showDateArr[row.tiaobanMuBiaoRenYuanId].dateKeyValArr, row.tiaobanMuBiaoBanCi)
+      // 校验调班那天是否有重复班次
+      if (this.form.type === '调班' && row.tiaobanBenRenBanCi !== '' && row.tiaobanBenRenRiQi !== '' && row.tiaobanMuBiaoBanCi !== '' && row.tiaobanMuBiaoRenYuan !== '' && row.tiaobanMuBiaoRenYuanId !== '' && row.tiaobanMuBiaoRiQi !== '') {
+        const ubc = this.showDateArr[this.userInfo.user.id].dateKeyValArr[row.tiaobanBenRenRiQi]?.split(',') || []
+        const mbc = this.showDateArr[row.tiaobanMuBiaoRenYuanId].dateKeyValArr[row.tiaobanMuBiaoRiQi]?.split(',') || []
+        const ubcArr = row.tiaobanMuBiaoBanCi.split(',').filter(t => ubc.includes(t))
+        const mbcArr = row.tiaobanBenRenBanCi.split(',').filter(t => mbc.includes(t))
+        const ubcNum = ubc.length - row.tiaobanBenRenBanCi.split(',').length + row.tiaobanMuBiaoBanCi.split(',').length
+        const mbcNum = mbc.length - row.tiaobanMuBiaoBanCi.split(',').length + row.tiaobanBenRenBanCi.split(',').length
+        const ubcExist = []
+        this.tabChildActiveArr.forEach((t, i) => {
+          const mid = row.tiaobanBenRenBanCi.split(',').filter(m => t.tiaobanBenRenBanCi.split(',').includes(m) && t.tiaobanBenRenRiQi === row.tiaobanBenRenRiQi)
+          if (mid.length > 0 && i !== index) {
+            ubcExist.push(mid)
+          }
+        })
+        const mbcExist = []
+        this.tabChildActiveArr.forEach((t, i) => {
+          const mid = row.tiaobanMuBiaoBanCi.split(',').filter(m => t.tiaobanMuBiaoBanCi.split(',').includes(m) && t.tiaobanMuBiaoRiQi === row.tiaobanMuBiaoRiQi)
+          if (mid.length > 0 && i !== index) {
+            mbcExist.push(mid)
+          }
+        })
+
+        // const res = await this.getBlockAdjustRequest(this.form.paiBanId)
+        this.$common
+          .request('query', {
+            key: 'getLockedAdjustmentData',
+            params: [this.form.paiBanId]
+          })
+          .then((res) => {
+            const { data = [] } = res.variables || {}
+            const blockList = this.getBlockResult(data || [], 'default')
+            const createBy = this.userInfo.user.id
+            if (blockList[createBy]) {
+              const lockMid = []
+              const blockListForUser = blockList[createBy] // 锁定数据中用户数据
+              const beforeDate = row.tiaobanBenRenRiQi
+              blockListForUser.forEach((blockEntry) => {
+                if (blockEntry.value === beforeDate) {
+                  const banci = blockEntry.banci
+                  if (row.tiaobanBenRenBanCi.split(',').includes(banci)) {
+                    // const nameObj = this.scheduleInfo.scheduleShift.find(
+                    //   (obj) => obj.alias === banci
+                    // )
+                    lockMid.push(banci)
+                  }
+                }
+              })
+              if (switchBtn === 'on') {
+                this.$toast(`${row.tiaobanBenRenBanCi}调班班次【 ${lockMid.join(',')} 】已被申请,请重新选择`)
+              }
+
+              // return { status: false, info: `${row.tiaobanBenRenBanCi}调班班次【 ${lockMid.join(',')} 】已被申请,请重新选择` }
+              this.rowTF[index] = { status: false, info: `${row.tiaobanBenRenBanCi}调班班次【 ${lockMid.join(',')} 】已被申请,请重新选择` }
+            }
+            const party = row.tiaobanMuBiaoRenYuanId
+            if (blockList[party]) {
+              const lockMid = []
+              const blockListForUser = blockList[party] // 锁定数据中用户数据
+              const afterDate = row.tiaobanMuBiaoRiQi
+              blockListForUser.forEach((blockEntry) => {
+                if (blockEntry.value === afterDate) {
+                  const banci = blockEntry.banci
+                  if (row.tiaobanMuBiaoBanCi.split(',').includes(banci)) {
+                    // const nameObj = this.scheduleInfo.scheduleShift.find(
+                    //   (obj) => obj.alias === banci
+                    // )
+                    lockMid.push(banci)
+                  }
+                }
+              })
+              if (switchBtn === 'on') {
+                this.$toast(`${row.tiaobanMuBiaoRiQi}目标班次【 ${lockMid.join(',')} 】已被申请,请重新选择`)
+              }
+
+              this.rowTF[index] = { status: false, info: `${row.tiaobanMuBiaoRiQi}目标班次【 ${lockMid.join(',')} 】已被申请,请重新选择` }
+              // return { status: false, info: `${row.tiaobanMuBiaoRiQi}目标班次【 ${lockMid.join(',')} 】已被申请,请重新选择` }
+            }
+          })
+
+        if (ubcArr.length > 0) {
+          if (switchBtn === 'on') {
+            this.$toast(`${row.tiaobanMuBiaoRiQi}您已有【 ${ubcArr.join(',')} 】班次,不能作为调班班次!`)
+          }
+          this.rowTF[index] = { status: false, info: `${row.tiaobanMuBiaoRiQi}您已有【 ${ubcArr.join(',')} 】班次,不能作为调班班次!` }
+
+          // return { status: false, info: `${row.tiaobanMuBiaoRiQi}您已有【 ${ubcArr.join(',')} 】班次,不能作为调班班次!` }
+        }
+        if (mbcArr.length > 0) {
+          if (switchBtn === 'on') {
+            this.$toast(`${row.tiaobanBenRenRiQi}目标人员已有【 ${mbcArr.join(',')} 】班次,不能作为调班班次!`)
+          }
+          this.rowTF[index] = { status: false, info: `${row.tiaobanBenRenRiQi}目标人员已有【 ${mbcArr.join(',')} 】班次,不能作为调班班次!` }
+
+          // return { status: false, info: `${row.tiaobanBenRenRiQi}目标人员已有【 ${mbcArr.join(',')} 】班次,不能作为调班班次!` }
+        }
+        if (ubcNum > 3) {
+          if (switchBtn === 'on') {
+            this.$toast(`调班后您【${row.tiaobanBenRenRiQi}】的班次大于3个!`)
+          }
+          this.rowTF[index] = { status: false, info: `调班后您【${row.tiaobanBenRenRiQi}】的班次大于3个!` }
+
+          // return { status: false, info: `调班后您【${row.tiaobanBenRenRiQi}】的班次大于3个!` }
+        }
+        if (mbcNum > 3) {
+          if (switchBtn === 'on') {
+            this.$toast(`调班后【${row.tiaobanMuBiaoRenYuan}】【${row.tiaobanMuBiaoRiQi}的班次大于3个!`)
+          }
+          this.rowTF[index] = { status: false, info: `调班后【${row.tiaobanMuBiaoRenYuan}】【${row.tiaobanMuBiaoRiQi}】的班次大于3个!` }
+          // return { status: false, info: `调班后【${row.tiaobanMuBiaoRenYuan}】【${row.tiaobanMuBiaoRiQi}】的班次大于3个!` }
+        }
+        if (ubcExist.length > 0) {
+          if (switchBtn === 'on') {
+            this.$toast(`已有其他序号调班班次选择了${row.tiaobanBenRenRiQi}${ubcExist.join(',')}`)
+          }
+          this.rowTF[index] = { status: false, info: `已有其他序号调班班次选择了${row.tiaobanBenRenRiQi}${ubcExist.join(',')}` }
+
+          // return { status: false, info: `已有其他序号调班班次选择了${row.tiaobanBenRenRiQi}${ubcExist.join(',')}` }
+        }
+        if (mbcExist.length > 0) {
+          if (switchBtn === 'on') {
+            this.$toast(`已有其他序号目标班次选择了${row.tiaobanMuBiaoRiQi}${mbcExist.join(',')}`)
+          }
+          this.rowTF[index] = { status: false, info: `已有其他序号目标班次选择了${row.tiaobanMuBiaoRiQi}${mbcExist.join(',')}` }
+          // return { status: false, info: `已有其他序号目标班次选择了${row.tiaobanMuBiaoRiQi}${mbcExist.join(',')}` }
+        }
+      } else if (this.form.type === '调班' && (row.tiaobanBenRenBanCi === '' || row.tiaobanBenRenRiQi === '' || row.tiaobanMuBiaoBanCi === '' || row.tiaobanMuBiaoRenYuan === '' || row.tiaobanMuBiaoRenYuanId === '' || row.tiaobanMuBiaoRiQi === '')) {
+        this.rowTF[index] = { status: false, info: `序号${index + 1}数据不完整,请检查!` }
+
+        // return { status: false, info: `序号${index + 1}数据不完整,请检查!` }
+      } else {
+        this.rowTF[index] = { status: true }
+        // return { status: true }
+      }
+    },
+    /**
+     * @param data 被锁定的数据
+     * @param type 类型区分是初始化时还是编辑中,因为初始化数据的字段和编辑行的不一致
+     */
+    getBlockResult(data, type) {
+      if (data.length < 1) {
+        return {}
+      }
+      const blockResult = []
+      const tempMap = {}
+      data.forEach((item) => {
+        let { create_by_, before_date_, before_adjust_ } = item
+        let key = `${create_by_}-${before_date_}`
+        if (type === 'adjustList') {
+          // 如果是给编辑行分组
+          create_by_ = item.createBy || this.$store.getters.userId
+          before_date_ = item.beforeDate
+          before_adjust_ = item.beforeAdjust.join(',')
+          key = `${create_by_}-${before_date_}`
+        }
+        if (!tempMap[key]) {
+          tempMap[key] = {
+            userid: create_by_,
+            value: before_date_,
+            banci: before_adjust_
+          }
+          blockResult.push(tempMap[key])
+        } else {
+          tempMap[key].banci += `,${before_adjust_}`
+        }
+      })
+      data.forEach((item) => {
+        let { party_, after_date_, after_adjust_ } = item
+        let key2 = `${party_}-${after_date_}`
+        if (type === 'adjustList') {
+          // 如果是给编辑行分组
+          party_ = item.party
+          after_date_ = item.afterDate
+          after_adjust_ = item.afterAdjust.join(',')
+          key2 = `${party_}-${after_date_}`
+        }
+        if (!tempMap[key2]) {
+          tempMap[key2] = {
+            userid: party_,
+            value: after_date_,
+            banci: after_adjust_
+          }
+          blockResult.push(tempMap[key2])
+        } else {
+          tempMap[key2].banci += `,${after_adjust_}`
+        }
+      })
+
+      // 按userid分组
+      const blockGrouped = {}
+      blockResult.forEach((item) => {
+        const userid = item.userid
+        if (!blockGrouped[userid]) {
+          blockGrouped[userid] = []
+        }
+        blockGrouped[userid].push(item)
+      })
+      return blockGrouped
+    },
     getDe(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_`
 
@@ -551,7 +896,7 @@ export default {
             tiaoBanYuanYin: data[0].reason_,
             paiBan: data[0].title_,
             paiBanId: data[0].schedule_id_,
-            gouTongQueDingNei: data[0].frejectReason,
+            gouTongQueDingNei: this.typeValue === 1 && data[0].frejectReason === '' ? '/' : data[0].frejectReason,
             bianZhiShiJian: data[0].bian_zhi_shi_jian,
             // gouTongRiQi: data[0].gou_tong_ri_qi_,
             executor: data[0].executor_
@@ -574,6 +919,11 @@ export default {
                 tiaobanMuBiaoBanCi: item.after_adjust_
               }
             )
+            // this.$set(this.tbbrbcArr, this.tbbrbcArr.length, item.before_adjust_.split(','))
+            // this.$set(this.tbmbbcArr, this.tbbrbcArr.length, item.after_adjust_.split(','))
+            this.tbbrbcArr.push(item.before_adjust_.split(','))
+            this.tbmbbcArr.push(item.after_adjust_.split(','))
+            console.log(this.tbbrbcArr, this.tbmbbcArr)
           })
           this.actionSheetCallback({ text: data[0].title_, id: data[0].schedule_id_, obj: data[0] }, '1')
         }
@@ -587,12 +937,30 @@ export default {
         })
       } else {
         this.tabChildActiveArr = this.tabChildActiveArr.filter((item, i) => i !== val)
+        this.tbbrbcArr = this.tbbrbcArr.filter((item, i) => i !== val)
+        this.tbmbbcArr = this.tbmbbcArr.filter((item, i) => i !== val)
       }
     },
     onSubmit() {
       if (!this.getYanZheng()) {
         return
       }
+      // if (this.rowTF.length === 0) {
+      this.rowTF.length = 0
+      this.tabChildActiveArr.forEach((item, i) => {
+        // this.rowTF[i] =
+        this.vaildBanci(item, i, 'off')
+      })
+      // }
+      const statusF = this.rowTF.filter(t => t.status === false)
+      if (statusF.length > 0) {
+        let str = ``
+        statusF.forEach(item => {
+          str = str + item.info + `\n`
+        })
+        this.$toast(str)
+        return
+      }
       const { second = '' } = this.$store.getters.level || {}
       const midArr = []
       let midStr = ''
@@ -652,7 +1020,7 @@ export default {
         midParam = res.data
         midParam.rejectReason = this.form.gouTongQueDingNei
         if (res.state === 200) {
-          if (this.typeValue == 5 && midParam.adjustmentDetailPoList.length > 0) {
+          if (this.typeValue == 5 && shiFouGuoShen !== '已拒绝' && midParam.adjustmentDetailPoList.length > 0) {
             midParam.adjustmentDetailPoList.forEach(item => {
               if (item.party === this.userInfo.user.id) {
                 item.status = '待审批'
@@ -663,11 +1031,12 @@ export default {
             midParam.status = midParam.adjustmentDetailPoList.some(item => item.status === '待审核') ? '审核中' : '待审批'
           } else if (midParam.adjustmentDetailPoList.length > 0) {
             midParam.adjustmentDetailPoList.forEach(item => {
-              item.status === shiFouGuoShen
+              item.status = shiFouGuoShen
             })
             midParam.status = shiFouGuoShen
           } else {
             midParam.status = shiFouGuoShen
+            // midParam.adjustmentDetailPoList[0].status = shiFouGuoShen
           }
 
           saveAdjustment(midParam)
@@ -790,9 +1159,6 @@ export default {
         return 0
       }
       return Math.ceil((new Date(end) - new Date(start)) / (1000 * 60 * 60 * 24))
-    },
-    toggle(index) {
-      this.$refs.checkboxes[index].toggle()
     }
   }
 }
@@ -878,7 +1244,9 @@ export default {
   border-radius: 5px;
   border: none;
 }
-
+.checkBoxSty{
+  margin: 3%;
+}
 .fileBox {
   line-height: 50px;
   color: #888888;

+ 102 - 56
src/views/platform/bpmn/shiftTransferApplication/staList.vue

@@ -32,7 +32,7 @@
         <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
             <van-list v-model="loading" :finished="finished" @load="loadData">
                 <van-checkbox-group v-model="checkedIds">
-                    <van-cell v-for="(item,index) in listData" :key="item.id+index">
+                    <van-cell v-for="(item,index) in listData" v-if="active==='我发起的' || (active==='待我处理'&& (item.STATUS == '待审核'&&item.partys.some(obj => obj.value === useId && item.createBy !== useId && obj.status === '待审核')))||(active==='待我处理'&& item.STATUS == '待审批' && item.executor.includes(useId))" :key="item.id+index">
                         <div class="sectionBox verticalLine">
                             <div class="left ">申请时间:</div>
                             <div>{{ $common.getFormatDate('string', 16, item.createTime) }} </div>
@@ -53,8 +53,8 @@
                             <van-button v-if="active==='我发起的'&& (item.STATUS == '已取消' || item.STATUS == '已拒绝')" type="info" size="mini" class="btn-sty" @click="LiftUpPop(item.id,'4')">再次申请</van-button>
                             <van-button v-if="active==='我发起的'" type="success" size="mini" class="u-m-l-15 btn-sty" @click="LiftUpPop(item.id,'1')">详情</van-button>
                             <van-button v-if="active==='我发起的'&& item.STATUS == '待审核'" type="warning" size="mini" class="u-m-l-15 btn-sty" @click="LiftUpPop(item.id,'7')">取消</van-button>
-                            <van-button v-if="active==='待我处理'&& (item.STATUS == '待审核'||item.partys.some(obj => obj.value === useId && item.createBy !== useId && obj.status === '待审核'))" type="warning" size="mini" class="btn-back-color btn-sty" @click="LiftUpPop(item.id,'5')">审核</van-button>
-                            <van-button v-if="active==='待我处理'&& item.STATUS == '待审批'" type="warning" size="mini" class="btn-back-color btn-sty" @click="LiftUpPop(item.id,'2')">审批</van-button>
+                            <van-button v-if="active==='待我处理'&& (item.STATUS == '待审核' && item.partys.some(obj => obj.value === useId && item.createBy !== useId && obj.status === '待审核'))" type="warning" size="mini" class="btn-back-color btn-sty" @click="LiftUpPop(item.id,'5')">审核</van-button>
+                            <van-button v-if="active==='待我处理'&& item.STATUS == '待审批' && item.executor.includes(useId)" type="warning" size="mini" class="btn-back-color btn-sty" @click="LiftUpPop(item.id,'2')">审批</van-button>
                         </div>
                     </van-cell>
                 </van-checkbox-group>
@@ -100,7 +100,8 @@ import IbpsBpmnDefinition from '@/business/platform/bpmn/definition/field'
 
 import staForm from './staForm.vue'
 import { queryAdjustment } from '@/api/platform/feature/changeShift'
-import { adjustQueryData } from '@/api/platform/feature/sqlInject'
+import { values } from 'lodash'
+// import { adjustQueryData } from '@/api/platform/feature/sqlInject'
 
 export default {
   components: {
@@ -165,9 +166,12 @@ export default {
     }
   },
   methods: {
-    updataSet(v) {
+    updataSet(v, d) {
       this.showPop = v
       this.startScroll()
+      if (d !== 'default') {
+        this.onRefresh()
+      }
     },
     generateTitle(name, title) {
       return i18n.generateTitle(name, title)
@@ -182,71 +186,59 @@ export default {
        */
     loadData(j) {
       this.loading = true
-      const params = this.getSearcFormData()
       if (j === 'search') {
         this.page = 0
       }
-      const itemSql = ``
-      //   const gtlx = params.parameters.find(i => i.key === 'gou_tong_lei_xing') || ''
-      //   if (gtlx && gtlx.value !== '全部') {
-      //     itemSql = itemSql + `and gou_tong_lei_xing = '${gtlx.value}'`
-      //   }
-      //   const bdbh = params.parameters.find(i => i.key === 'biao_dan_bian_hao') || ''
-      //   if (bdbh && bdbh.value !== '') {
-      //     itemSql = itemSql + `and biao_dan_bian_hao like '%${bdbh.value}%'`
-      //   }
-      //   const khlxr = params.parameters.find(i => i.key === 'ke_hu_lian_xi_ren') || ''
-      //   if (khlxr && khlxr.value !== '') {
-      //     itemSql = itemSql + `and ke_hu_lian_xi_ren like '%${khlxr.value}%'`
-      //   }
-
-      // v1
-      // const two = params.parameters.find(i => i.key === 'two') || ''
-      // if (two) {
-      //   itemSql = itemSql + `and overview_ like '%${two.value}%'`
-      // }
-      // const typeActive = this.active === '我发起的' ? `create_by_ = '${this.useId}' ` : `FIND_IN_SET('${this.useId}', executor_) and `
-      // const sql =
-      // 		`select * from t_adjustment where ${typeActive} ${itemSql}  ORDER BY create_time_ desc LIMIT ${this.page * params.requestPage.limit},${params.requestPage.limit}`
       if (this.active === '我发起的') {
         // 临时注释
         // const sql =
         // 	`select a.id_ as id,a.tenant_id_ as tenantId,a.ip_ as ip,a.create_by_ as createBy,a.create_time_ as createTime,a.update_by_ as updateBy,a.update_time_ as updateTime,a.di_dian_ as diDian,a.reason_ as reason,a.status as status,a.executor_ as executor,a.execute_date_ as executeDate,a.overview_ as overview,a.schedule_id_ as scheduleId,a.type_ as type,a.reject_reason_ as rejectReason,a.partys from (select f.*,GROUP_CONCAT(z.party_) as partys from t_adjustment f left join t_adjustment_detail z on f.id_ = z.parent_id_  GROUP BY f.id_) a where create_by_ = '${this.useId}' ORDER BY a.create_time_ desc LIMIT ${this.page * params.requestPage.limit},${params.requestPage.limit}`
-        adjustQueryData(this.getSearcFormData()).then(res => {
+
+        queryAdjustment(this.getSearcFormData()).then(res => {
+          // 处理审核人数据
+          res.data.dataResult.forEach((el) => {
+            el.partys = this.getPartysList(el.adjustmentDetailPoList)
+            el.STATUS = el.status
+          })
           ActionUtils.handleListData(this, res.data)
         })
-        // this.$common.request('sql', sql).then(response => {
-        // // 处理数据
-        //   ActionUtils.handleListDataCommon(this, response.variables)
+        // adjustQueryData(this.getSearcFormData()).then(res => {
+        //   ActionUtils.handleListData(this, res.data)
         // }).catch((e) => {
         //   ActionUtils.handleErrorData(this, e)
         // })
       } else if (this.active === '待我处理') {
         queryAdjustment(this.getSearcFormData()).then(res => {
-          res.data.dataResult.forEach((el) => { // 遍历子表提取审核人字段
+          ActionUtils.handleListData(this, res.data)
+          res.data.dataResult.forEach((el) => {
+            // 遍历子表提取审核人字段
             el.partys = this.getPartysList(el.adjustmentDetailPoList)
+            el.STATUS = el.status
           })
-          // if (!this.isRoleFilter()) { // 如果不是高权限角色
-          // 审核人审批人过滤
-          res.data.dataResult = this.filteredData(this.isRoleFilter(), res.data.dataResult)
-          ActionUtils.handleListDataCommon(this, res.data, { dataResultKey: 'dataResult' })
-
-          // }
-
-          // this.loading = false
-        }).catch(() => {
-          // this.loading = false
+          if (!this.isRoleFilter()) {
+            // 如果不是高权限角色
+            // 审核人审批人过滤
+            this.listData = this.filteredData(res.data.dataResult)
+          }
         })
       }
     },
     getPartysList(poList) {
       const self = this
-      const result = poList.map(item => ({
-        value: item.party,
-        STATUS: item.STATUS,
-        label: self.userOption.filter(o => o.value === item.party).length > 0 ? (self.userOption.filter(o => o.value === item.party))[0].label : '',
-        type: 'success'
-      }))
+      const result = poList.reduce((acc, currentItem) => {
+        const existing = acc.find((item) => item.value === currentItem.party)
+        if (!existing) {
+          acc.push({
+            value: currentItem.party,
+            status: currentItem.status,
+            label: self.userOption.filter(
+              (o) => o.value === currentItem.party
+            )[0].label,
+            type: 'success'
+          })
+        }
+        return acc
+      }, [])
       return result
     },
     isRoleFilter() {
@@ -283,17 +275,71 @@ export default {
        * 获取格式化参数
        */
     getSearcFormData() {
-      const params = {}
-      let mid = {}
+      const parameters = [
+        {
+          relation: 'AND',
+          parameters: [
+            {
+              key: 'Q^reason_^NE',
+              value: '排班修改',
+              'param': 'reason1'
+            }
+          ]
+        }
+      ]
+      const parMid = [
+        {
+          key: 'Q^status^NE',
+          value: '已取消',
+          param: 'status'
+        },
+        {
+          key: 'Q^status^NE',
+          value: '已暂存',
+          param: 'status1'
+        },
+        {
+          key: 'Q^status^NE',
+          value: '已通过',
+          param: 'status2'
+        },
+        {
+          key: 'Q^status^NE',
+          value: '已拒绝',
+          param: 'status3'
+        }
+        // {
+        //   key: 'Q^executor_^SL',
+        //   value: this.useId
+        // }
+      ]
+      const { first, second } = this.$store.getters.level || {}
+      parameters[0].parameters.push({
+        key: 'Q^di_dian_^S',
+        value: second || first
+      })
       if (this.$utils.isNotEmpty(this.twoParam)) {
-        params['Q^overview_^S'] = this.twoParam
+        if (this.active === '待我处理') {
+          parameters[0].parameters.push({
+            key: 'Q^overview_^SL',
+            value: this.twoParam
+          })
+        }
       }
       if (this.active === '我发起的') {
-        params['userId'] = this.useId
-        mid = ActionUtils.formatParams(params, this.pagination, this.sorts)
+        const { userId } = this.$store.getters || ''
+        if (userId) {
+          parameters[0].parameters.push({
+            key: 'Q^create_By_^S',
+            value: userId
+          })
+        }
+      }
+      const param = {
+        parameters: this.active === '我发起的' ? parameters : [...parameters[0].parameters, ...parMid],
+        ...ActionUtils.formatParams(null, { page: this.page }, this.sorts)
       }
-      console.log(this.active, ActionUtils.formatParams(params, this.pagination, this.sorts), 'sadsa')
-      return this.active === '待我处理' ? ActionUtils.formatParams(params, { page: this.page }, this.sorts) : { pageNo: mid.requestPage.pageNo, limit: mid.requestPage.limit, param: params }
+      return param
     },
     LiftUpPop(id, typeValue) {
       this.scrollWhere = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop