zhonghuizhen 8 месяцев назад
Родитель
Сommit
2864749b1d

+ 4 - 2
src/views/business/​scheduleManage/edit.vue

@@ -180,6 +180,7 @@
           <el-form-item
             label="调班/补卡审批人"
             prop="approver"
+            required
             :show-message="false"
           >
             <el-select
@@ -737,7 +738,7 @@ export default {
             }
             this.pickerOptions.disabledDate = (time) => {
               // 保持今天之前的日期不可选
-              if (time < today) {
+              if (time <= today) {
                 return true
               }
               // 计算与开始日期的绝对差值
@@ -1053,6 +1054,7 @@ export default {
           () => []
         )
       })
+      debugger
       // 再次遍历用户列表,填充每个排班班次对应的用户信息
       userList.forEach(({ userId, userName }) => {
         data[userId].forEach((day, dayIndex) => {
@@ -1423,7 +1425,7 @@ export default {
       })
     },
     validateForm() {
-      const { scheduleRule, approver, status, ...rest } = this.formData
+      const { scheduleRule, status, ...rest } = this.formData
       const result = Object.keys(rest).some(
         (k) =>
           this.$utils.isEmpty(rest[k]) && k !== 'id' && k !== 'oldScheduleId'

+ 15 - 12
src/views/system/dashboard/components/util.js

@@ -666,25 +666,28 @@ export function buildComponent(name, column, preview, vm) {
           const { first, second } = this.$store.getters.level || {}
           const today = this.$common.getDateNow()
           // const sql = `select a.*, b.title_,b.type_, b.start_date_, b.end_date_, b.config_, b.overview_, b.id_ as pai_ban_id_ from t_schedule_detail a, t_schedule b where a.parent_id_ = b.id_ and b.di_dian_ = '${second || first}' and a.user_id_ = '${this.userId}' and b.status_ = '已发布'`
+         // 新查询语句 SELECT ad.* FROM t_attendance_detail ad INNER JOIN t_schedule s ON ad.pai_ban_id_ = s.id_ WHERE ad.ri_qi_ = #{p0} AND ad.yong_hu_id_ = #{p1} AND ad.di_dian_ = #{p2} AND s.status_ = #{p3}
           return new Promise((resolve, reject) => {
             this.$common
               .request('query', {
-                key: 'getScheduleDataByUid',
-                params: [second || first, this.userId]
+                key: 'getTodayScheduleDataByUid',
+                params: [today, this.userId, second || first, '已发布']
               })
               .then((res) => {
                 const { data = [] } = res.variables || {}
                 let todaySchedule = []
+
                 data.forEach((item) => {
-                  const days = this.getDays(item.start_date_, today)
-                  const shift = item[`d${days}_`]
-                  const config = item.config_ ? JSON.parse(item.config_) : {}
-                  const { scheduleShift } = config
-                  this.scheduleShift = scheduleShift
-                  if (shift) {
-                    const shiftList = shift.split(',')
-                    todaySchedule = todaySchedule.concat(shiftList) // 返回今日班次
+                  let obj = {}
+                  obj.label = item.ban_ci_ming_+'/'+item.ban_ci_bie_ming_
+                  obj.type = 'info'  //班次默认显示灰色
+                  if(item.da_ka_shi_jian_1_ && item.da_ka_shi_jian_2_ ){ //上下班时间都打卡了,班次显示绿色
+                    obj.type = 'success'
+                  }else if(item.da_ka_shi_jian_1_ || item.da_ka_shi_jian_2_){//上下班时间打卡了其中一个,班次显示橙色
+                    obj.type = 'warning'
                   }
+                  todaySchedule.push(obj) // 加入今日班次
+                  
                 })
                 console.log(todaySchedule)
                 resolve(todaySchedule)
@@ -869,10 +872,10 @@ export function buildComponent(name, column, preview, vm) {
           const today = this.$common.getDateNow()
           // 当天仅有一个班次
           if (todaySchedule.length === 1) {
-            this.$emit('dakaSingle', todaySchedule[0])
+            this.$emit('dakaSingle', todaySchedule[0].label.split('/')[1])
             return
           } else {
-            this.$emit('action-event', 'daka', todaySchedule)
+            this.$emit('action-event', 'daka', todaySchedule.map(item => item.label.split('/')[1]) )
           }
         },
         async showMySchedule() {

+ 6 - 8
src/views/system/dashboard/templates/userInfoTab.vue

@@ -48,12 +48,12 @@
               <template v-if="todaySchedule.length">
                 <span style="flex-shrink: 0">今日班次:</span>
                 <el-tag
-                  v-for="(item, index) in todaySchedule"
-                  :key="index"
-                  class="dept-tag"
-                  type="info"
-                  size="mini"
-                  >{{ item }}</el-tag
+                      v-for="(item, index) in todaySchedule"
+                      :key="index"
+                      class="dept-tag"
+                      :type= item.type
+                      size="mini"
+                  >{{ item.label }}</el-tag>
                 >
               </template>
               <span v-else style="text-overflow: ellipsis; width: 190px"
@@ -63,7 +63,6 @@
               <el-button
                 type="primary"
                 size="mini"
-                plain
                 @click="showMySchedule"
                 style="
                   display: flex;
@@ -79,7 +78,6 @@
               <el-button
                 type="primary"
                 size="mini"
-                plain
                 v-if="todaySchedule.length > 0"
                 @click="handleClockFromTab(todaySchedule)"
                 style="

+ 7 - 0
src/views/system/homepage/components/mySchedule.vue

@@ -13,6 +13,7 @@
     @close="closeDialog"
   >
     <v-full-calendar
+      class="my-calendar"
       ref="calendar"
       :options="scheduleConfig"
       :hide-other-month-days="true"
@@ -57,6 +58,12 @@ export default {
       padding: 20px 0 !important;
       height: calc(100vh - 100px);
     }
+    .my-calendar .fc-button {
+      background-color: #409eff;
+      color: white;
+      border: none;
+    }
+
     // 事件容器样式
     .fc-event {
       padding: 8px;

+ 2 - 0
src/views/system/homepage/index.vue

@@ -740,6 +740,7 @@ export default {
         default:
           break
       }
+      
     },
     // 打开指定弹框
     handleOpen(state, dateArr, events, clickId) {
@@ -846,6 +847,7 @@ export default {
               // this.$message.warning('打卡失败')
             })
         })
+        
     },
     handleDakaConfirm(selectedValue) {
       this.dakaSingle(selectedValue)