Commit ecb5361a08a4e17f0bb6bb921f6dff137ddd3fd1

Authored by wuxw
1 parent 7d596bb5

优化考勤

src/components/oa/staffAttendanceReplenishCheckIn.vue
... ... @@ -54,6 +54,13 @@ export default {
54 54 },
55 55 methods: {
56 56 open(details) {
  57 + details.forEach(item => {
  58 + if(item.specCd === '1001'){
  59 + item.specName = this.$t('staffAttendance.work')
  60 + }else{
  61 + item.specName = this.$t('staffAttendance.offWork')
  62 + }
  63 + })
57 64 this.details = details || []
58 65 this.form = {
59 66 detailId: '',
... ...
src/components/org/addScheduleClassesStaff.vue
... ... @@ -45,10 +45,13 @@ export default {
45 45 scheduleId: this.scheduleId,
46 46 staffs: this.staffs
47 47 }
48   - await saveScheduleClassesStaff(params)
49   - this.$message.success(this.$t('common.operationSuccess'))
  48 + const {code,msg} = await saveScheduleClassesStaff(params)
  49 + if(code === 0){
50 50 this.$emit('success')
51 51 this.visible = false
  52 + }else{
  53 + this.$message.error(msg)
  54 + }
52 55 } catch (error) {
53 56 this.$message.error(this.$t('common.saveError'))
54 57 }
... ...
src/views/contract/addContractList.vue
... ... @@ -214,7 +214,7 @@
214 214  
215 215 <!-- Approvers -->
216 216 <div v-show="addContractInfo.audit == '1001'">
217   - <purchase-approvers ref="purchaseApprovers" :flow-type="50005" @notify3="handleNotify"></purchase-approvers>
  217 + <purchase-approvers ref="purchaseApprovers" flow-type="50005" @notify3="handleNotify"></purchase-approvers>
218 218 </div>
219 219  
220 220 <!-- Buttons -->
... ...
src/views/oa/monthAttendanceManageList.vue
... ... @@ -228,11 +228,9 @@ export default {
228 228 pagePath: 'monthAttendance'
229 229 }
230 230 await exportMonthAttendance(params)
231   - this.$message.success(this.$t('common.operationSuccess'))
  231 + this.$router.push('/pages/property/downloadTempFile?tab=下载中心')
232 232 } catch (error) {
233 233 this.$message.error(this.$t('monthAttendance.exportError'))
234   - } finally {
235   - this.loading = false
236 234 }
237 235 },
238 236  
... ...
src/views/oa/staffAttendanceManageList.vue
... ... @@ -38,32 +38,34 @@
38 38 <el-card class="box-card">
39 39 <div class="attendance-grid">
40 40 <el-row :gutter="20">
41   - <el-col v-for="index in staffAttendanceManageInfo.maxDay" :key="index" :span="4" class="attendance-day"
  41 + <el-col v-for="index in staffAttendanceManageInfo.maxDay" :key="index" :span="4" class="attendance-day "
42 42 :style="{ backgroundColor: getBgColor(index) }">
43   - <div class="day-header">
44   - {{ staffAttendanceManageInfo.curYear }}-{{ staffAttendanceManageInfo.curMonth }}-{{ index }}
45   - </div>
  43 + <div class="labeling-strip">
  44 + <div class="day-header">
  45 + {{ staffAttendanceManageInfo.curYear }}-{{ staffAttendanceManageInfo.curMonth }}-{{ index }}
  46 + </div>
46 47  
47   - <div v-if="getDayAttendance(index) && getDayAttendance(index).state !== '30000'" class="replenish-btn"
48   - @click="replenishCheckIn(index)">
49   - {{ $t('staffAttendance.replenish') }}
50   - </div>
  48 + <div v-if="getDayAttendance(index) && getDayAttendance(index).state !== '30000'" class="strip"
  49 + @click="replenishCheckIn(index)">
  50 + <span> {{ $t('staffAttendance.replenish') }}</span>
  51 + </div>
51 52  
52   - <div v-for="(item, detailIndex) in getAttendanceDetail(index)" :key="detailIndex"
53   - class="attendance-detail">
54   - <div v-if="item.rest">{{ item.rest }}</div>
55   - <div v-else>
56   - {{ item.specCd === '1001' ? $t('staffAttendance.work') : $t('staffAttendance.offWork') }}:
57   - <span v-if="item.state !== '10000'">{{ formatTime(item.checkTime) }}</span>
58   - <span v-else> - </span>
59   - <span>({{ item.stateName }})</span>
  53 + <div v-for="(item, detailIndex) in getAttendanceDetail(index)" :key="detailIndex"
  54 + class="attendance-detail">
  55 + <div v-if="item.rest">{{ item.rest }}</div>
  56 + <div v-else>
  57 + {{ item.specCd === '1001' ? $t('staffAttendance.work') : $t('staffAttendance.offWork') }}:
  58 + <span v-if="item.state !== '10000'">{{ formatTime(item.checkTime) }}</span>
  59 + <span v-else> - </span>
  60 + <span>({{ item.stateName }})</span>
  61 + </div>
60 62 </div>
61   - </div>
62 63  
63   - <div class="log-link">
64   - <el-link type="primary" @click="checkInLog(index)">
65   - {{ $t('staffAttendance.log') }}
66   - </el-link>
  64 + <div class="log-link">
  65 + <el-link type="primary" @click="checkInLog(index)">
  66 + {{ $t('staffAttendance.log') }}
  67 + </el-link>
  68 + </div>
67 69 </div>
68 70 </el-col>
69 71 </el-row>
... ... @@ -76,7 +78,7 @@
76 78  
77 79 <choose-org-tree ref="chooseOrgTree" @switchOrg="handleSwitchOrg"></choose-org-tree>
78 80 <staff-attendance-detail ref="staffAttendanceDetail"></staff-attendance-detail>
79   - <staff-attendance-replenish-check-in ref="staffAttendanceReplenishCheckIn"></staff-attendance-replenish-check-in>
  81 + <staff-attendance-replenish-check-in ref="staffAttendanceReplenishCheckIn" @success="loadStaffAttendances"></staff-attendance-replenish-check-in>
80 82 </div>
81 83 </template>
82 84  
... ... @@ -177,6 +179,7 @@ export default {
177 179  
178 180 const { data } = await queryAttendanceClassesTask(params)
179 181 this.staffAttendanceManageInfo.attendances = data || []
  182 + console.log(this.staffAttendanceManageInfo.attendances)
180 183 } catch (error) {
181 184 console.error('Failed to load staff attendances:', error)
182 185 }
... ... @@ -199,8 +202,12 @@ export default {
199 202  
200 203 getDayAttendance(day) {
201 204 if (!this.staffAttendanceManageInfo.attendances) return null
  205 + const attendance = this.staffAttendanceManageInfo.attendances.find(item => item.taskDay == day)
202 206  
203   - return this.staffAttendanceManageInfo.attendances.find(item => item.taskDay === day) || null
  207 + if (!attendance) {
  208 + return null
  209 + }
  210 + return attendance
204 211 },
205 212  
206 213 getAttendanceDetail(day) {
... ... @@ -306,11 +313,39 @@ export default {
306 313 }
307 314  
308 315 .attendance-grid {
  316 +
  317 +
309 318 .attendance-day {
310 319 padding: 10px;
311 320 margin-bottom: 20px;
312 321 border-radius: 4px;
313 322 box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  323 + height: 120px;
  324 +
  325 + .labeling-strip {
  326 + position: relative;
  327 +
  328 + .strip {
  329 + position: absolute;
  330 + top: 0;
  331 + right: 0;
  332 + background-color: #409eff;
  333 + color: #fff;
  334 + padding: 4px 8px;
  335 + font-size: 12px;
  336 + border-radius: 0 4px 0 4px;
  337 + cursor: pointer;
  338 + z-index: 1;
  339 +
  340 + &:hover {
  341 + background-color: #66b1ff;
  342 + }
  343 +
  344 + span {
  345 + white-space: nowrap;
  346 + }
  347 + }
  348 + }
314 349  
315 350 .day-header {
316 351 font-weight: bold;
... ... @@ -318,6 +353,10 @@ export default {
318 353 text-align: center;
319 354 }
320 355  
  356 +
  357 +
  358 +
  359 +
321 360 .replenish-btn {
322 361 color: #409eff;
323 362 cursor: pointer;
... ...