Bladeren bron

Merge branch 'master' of http://119.23.210.103:3000/szjyxt/medical_lab_ui_mobile

cfort 11 maanden geleden
bovenliggende
commit
0cba84c217

+ 68 - 68
src/views/platform/bpmn/my-reissue/components/reissueDialog.vue

@@ -13,7 +13,7 @@
                                       ? '详情'
                                       : '')
                   "
-                  :right-text="typeValue == '4' ? '退回原因' : ''"
+                  :right-text="typeValue == '10' ? '退回原因' : ''"
                   @click-left="closePop()"
                   @click-right="getBack()"
               >
@@ -147,7 +147,7 @@
               <van-button
                   type="success"
                   class="btn btn-back-color"
-                  @click="onAgree('待审核', '重新提交', '申请')"
+                  @click="onSubmit"
               >
                 重新申请
               </van-button>
@@ -232,7 +232,9 @@ export default {
       maxDate: new Date(),
       minTime: new Date(),
       maxTime: new Date(),
-      approver: []
+      approver: [],
+      defaultUpTime: '',
+      defaultDownTime: ''
     }
   },
   computed: {
@@ -355,7 +357,8 @@ export default {
       const midStr = this.$common.getFormatDate('string', 10, this.xuanzeDate)
       const midDate = new Date(midStr)
       const midMax = this.$common.getFormatDate('string', 10, midDate.setDate(midDate.getDate() + 1))
-
+      this.defaultUpTime = midStr + ' ' + e.config.dateRange[0].startTime
+      this.defaultDownTime = (e.config.dateRange[0].isSecondDay === 'Y' ? midMax : midStr) + ' ' + e.config.dateRange[0].endTime
       if (e.config.dateRange[0].isSecondDay === 'Y') {
         this.minTime = new Date(midStr + ' 00:00:00')
         this.maxTime = new Date(midMax + ' 23:59:59')
@@ -369,6 +372,7 @@ export default {
     actionTypeCallback(e) {
       this.form.buKaLeiXing = e.text
       this.typeShow = false
+      this.form.buKaShiJian = e.text === '上班' ? this.defaultUpTime : e.text === '下班' ? this.defaultDownTime : ''
     },
     async schedule(val) {
       const date = this.$common.getFormatDate('string', 10, val)
@@ -449,13 +453,16 @@ export default {
         this.form.buKaBanCi = this.reissueData.name
         this.form.buKaRiQi = this.selectDate
         this.form.buKaLeiXing = this.reissueType === '' ? '' : this.reissueType
-        // this.form.buKaShiJian = this.$methCommon.time(16)
         // this.xuanzeTime = new Date()
         this.xuanzeDate = new Date(this.selectDate)
         this.approver = this.reissueData.approver
         const midStr = this.$common.getFormatDate('string', 10, this.xuanzeDate)
         const midDate = new Date(midStr)
         const midMax = this.$common.getFormatDate('string', 10, midDate.setDate(midDate.getDate() + 1))
+        this.defaultUpTime = midStr + ' ' + this.reissueData.config.dateRange[0].startTime
+        this.defaultDownTime = (this.reissueData.config.dateRange[0].isSecondDay === 'Y' ? midMax : midStr) + ' ' + this.reissueData.config.dateRange[0].endTime
+        this.form.buKaShiJian = this.reissueType === '上班' ? this.defaultUpTime : this.reissueType === '下班' ? this.defaultDownTime : ''
+
         if (this.reissueData.config.dateRange[0].isSecondDay === 'Y') {
           this.minTime = new Date(midStr + ' 00:00:00')
           this.maxTime = new Date(midMax + ' 23:59:59')
@@ -525,83 +532,76 @@ export default {
       const info = this.$store.getters.userInfo
       const useId = info.user.id
       // const detpId = info.employee.positions
-      const transmitData = {
-        bianZhiRen: useId,
-        bianZhiShiJian: this.$methCommon.time(16),
-        // bianZhiBuMen: this.mainPosition === null ? detpId : this.mainPosition.id,
-        zhuangTai: '待审核',
-        diDian: this.level.second || this.level.first,
-        buKaBanCi: this.form.buKaBanCi + '-' + this.form.buKaLeiXing,
-        buKaShiYou: this.form.buKaShiYou,
-        buKaRiQi: this.form.buKaRiQi,
-        buKaShiJian: this.form.buKaShiJian,
-        fuJian: this.form.fuJian,
-        paiBanId: clockInData[0].pai_ban_id_,
-        paiBanJiLuId: clockInData[0].pai_ban_ji_lu_id_,
-        kaoQinId: clockInData[0].id_,
-        shenHeRen: this.approver.join(',')
-      }
       const that = this
-
-      saveReissue(transmitData)
-        .then(res => {
-          if (res.state === 200) {
-            that.$toast.success('提交成功!')
-            setTimeout(() => {
-              that.closePop('1')
-            }, 1000)
-          }
-        })
-        .catch(() => {})
+      if (this.typeValue === '4') {
+        const field = {
+          bian_zhi_ren_: useId,
+          bian_zhi_shi_jian: this.$methCommon.time(16),
+          // bianZhiBuMen: this.mainPosition === null ? detpId : this.mainPosition.id,
+          zhuang_tai_: '待审核',
+          di_dian_: this.level.second || this.level.first,
+          bu_ka_ban_ci_: this.form.buKaBanCi + '-' + this.form.buKaLeiXing,
+          bu_ka_shi_you_: this.form.buKaShiYou,
+          bu_ka_ri_qi_: this.form.buKaRiQi,
+          bu_ka_shi_jian_: this.form.buKaShiJian,
+          fu_jian_: this.form.fuJian,
+          pai_ban_id_: clockInData[0].pai_ban_id_,
+          pai_ban_ji_lu_id_: clockInData[0].pai_ban_ji_lu_id_,
+          kao_qin_id_: clockInData[0].id_,
+          shen_he_ren_: this.approver.join(',')
+        }
+        this.updateData(this.form.id, field)
+      } else {
+        const transmitData = {
+          bianZhiRen: useId,
+          bianZhiShiJian: this.$methCommon.time(16),
+          // bianZhiBuMen: this.mainPosition === null ? detpId : this.mainPosition.id,
+          zhuangTai: '待审核',
+          diDian: this.level.second || this.level.first,
+          buKaBanCi: this.form.buKaBanCi + '-' + this.form.buKaLeiXing,
+          buKaShiYou: this.form.buKaShiYou,
+          buKaRiQi: this.form.buKaRiQi,
+          buKaShiJian: this.form.buKaShiJian,
+          fuJian: this.form.fuJian,
+          paiBanId: clockInData[0].pai_ban_id_,
+          paiBanJiLuId: clockInData[0].pai_ban_ji_lu_id_,
+          kaoQinId: clockInData[0].id_,
+          shenHeRen: this.approver.join(',')
+        }
+        saveReissue(transmitData)
+          .then(res => {
+            if (res.state === 200) {
+              that.$toast.success('提交成功!')
+              setTimeout(() => {
+                that.closePop('1')
+              }, 1000)
+            }
+          })
+          .catch(() => {})
+      }
     },
     onAgree(shiFouGuoShen, opinion, type) {
-      if (this.typeValue !== '2' && !this.getYanZheng()) {
+      if ((this.typeValue !== '2' || this.typeValue !== '4') && !this.getYanZheng()) {
         return
       }
-
-      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 => {
-      //   if (res.state === 200) {
-      //     if (this.typeValue === '2') {
-      //     } else {
-      //       this.$toast.success(type + '成功!')
-      //       this.closePop()
-      //     }
-      //     this.$toast.success(type + '成功!')
-      //     setTimeout(() => {
-      //       this.closePop()
-      //     }, 1000)
-      //   } else {
-      //     this.$toast.fail(type + '异常!')
-      //   }
-      // })
+      // this.updateData(this.form.id)
     },
-    updateData(id, fileId) {
-      const pp = {
+    updateData(id, field) {
+      const updateParams = {
+        tableName: 't_attendance_reissue',
         updList: [
           {
             where: {
               id_: id
             },
-            param: {
-              shi_fou_guo_shen_: '待审核'
-            }
+            param: field
           }
-        ],
-        tableName: 't_attendance_reissue'
+        ]
       }
-      const data = this.$sig(pp)
-      this.$common.request('update', data).then(res => {
-        this.$methCommon.getPrompt('提交成功', 'success')
+      this.$common.request('update', updateParams).then(res => {
+        this.$toast.success('提交成功!')
         setTimeout(() => {
-          this.closePop()
+          this.closePop('1')
         }, 1000)
       })
     },

+ 10 - 4
src/views/platform/bpmn/my-schedule/index.vue

@@ -97,11 +97,11 @@
             <div class="textSty">
               <div>出勤时间:</div>
               <div class="timeLine">
-                  <p>上班({{ item.state && item.state.data&&item.state.data.da_ka_shi_jian_1_&&item.state.data.da_ka_shi_jian_1_.length===19 ? item.state.data.da_ka_shi_jian_1_.substr(-8,5) : !item.reissue.up?'未打卡':'已有补卡记录'}})
+                  <p>上班(<span :style="{color:!judgeReissueBtn(item.state.data,'am', unfoldInfo.date)?'red':'#000'}">{{ item.state && item.state.data&&item.state.data.da_ka_shi_jian_1_&&item.state.data.da_ka_shi_jian_1_.length===19 ? item.state.data.da_ka_shi_jian_1_.substr(-8,5) : !item.reissue.up?'未打卡':'已有补卡记录'}}</span>)
                     <span v-if="item.reissue&&item.state && item.state.data && !judgeReissueBtn(item.state.data,'am', unfoldInfo.date)&&!item.reissue.up" class="reissueBtn" @click="reissueShow(item,'上班')">补卡</span>
                   </p>
                   <div style="height: 5px;"></div>
-                  <p>下班({{item.state && item.state.data&&item.state.data.shi_fou_kua_ri_==='Y'?'第二天':''}}{{item.state && item.state.data&&item.state.data.da_ka_shi_jian_2_&&item.state.data.da_ka_shi_jian_2_.length===19 ? item.state.data.da_ka_shi_jian_2_.substr(-8,5) : !item.reissue.down?'未打卡':'已有补卡记录'}})
+                  <p>下班(<span :style="{color:!judgeReissueBtn(item.state.data,'pm', unfoldInfo.date)?'red':'#000'}">{{item.state && item.state.data&&item.state.data.shi_fou_kua_ri_==='Y'?'第二天':''}}{{item.state && item.state.data&&item.state.data.da_ka_shi_jian_2_&&item.state.data.da_ka_shi_jian_2_.length===19 ? item.state.data.da_ka_shi_jian_2_.substr(-8,5) : !item.reissue.down?'未打卡':'已有补卡记录'}}</span>)
                     <span v-if="item.reissue&&item.state && item.state.data && !judgeReissueBtn(item.state.data,'pm',unfoldInfo.date)&&!item.reissue.down" class="reissueBtn" @click="reissueShow(item,'下班')">补卡</span>
                   </p>
               </div>
@@ -571,7 +571,7 @@ export default {
       const normTime = new Date(this.entryTime).getTime()
       const bzTime = val.hasOwnProperty(mid[1]) ? new Date(val[mid[1]]).getTime() : ''
       const dkTime = val.hasOwnProperty(mid[0]) ? new Date(val[mid[0]]).getTime() : ''
-      // console.log(pickDate, normDate, 'sasdsadas')
+      console.log(pickDate, normDate, 'sasdsadas')
       const diff = Math.abs(normDate - pickDate)
       const days = Math.floor(diff / (1000 * 60 * 60 * 24))
       if (pickDate > normDate) {
@@ -586,8 +586,14 @@ export default {
         }
       } else if (pickDate < normDate && days === 1 && val['shi_fou_kua_ri_'] === 'Y' && type === 'pm') {
         return true
-      } else if (pickDate < normDate && !val.hasOwnProperty(mid[0]) || !val.hasOwnProperty(mid[2])) {
+      } else if (pickDate < normDate && (!val.hasOwnProperty(mid[0]) || !val.hasOwnProperty(mid[2]))) {
         return false
+      } else if (pickDate < normDate) {
+        if (type === 'am' && (!val.hasOwnProperty(mid[0]) || (val.hasOwnProperty(mid[0]) && dkTime > bzTime))) {
+          return false
+        } else if (type === 'pm' && (val.hasOwnProperty(mid[0]) && dkTime < bzTime)) {
+          return false
+        }
       }
       return true
     },