Просмотр исходного кода

Merge branch '深圳三院' of http://119.23.210.103:3000/wy/zdqy_firm_former into 深圳三院

luoaoxuan 1 год назад
Родитель
Сommit
18dabcc9fe
1 измененных файлов с 21 добавлено и 20 удалено
  1. 21 20
      src/views/business/​scheduleManage/edit.vue

+ 21 - 20
src/views/business/​scheduleManage/edit.vue

@@ -223,7 +223,7 @@
                             class="color-block" 
                             :style="{ backgroundColor: shift.color }"
                         ></div>
-                        <span class="shift-name">{{ shift.name }}</span>
+                        <span class="shift-name">{{ shift.name+'/'+shift.alias }}</span>
                     </div>
                 </div>
             </div>
@@ -351,8 +351,9 @@
                                     class="shift"
                                     :style="{ color: viewType === 'users' ? `${shift.color}` : `${ordinateList[rIndex].color}`}"
                                 >
-                                    <div v-if="viewType !== 'users'">{{ viewType === 'users'? shift.alias : shift.userName }}</div>
-                                    <div v-if="viewType === 'users'" :style="{ width: '20px', height: '20px', backgroundColor: `${shift.color}`, margin: '0 auto', borderRadius: '2px' }"></div>
+                                    {{ viewType === 'users'? shift.alias : shift.userName }}
+                                    <!--<div v-if="viewType !== 'users'">{{ viewType === 'users'? shift.alias : shift.userName }}</div>
+                                    <div v-if="viewType === 'users'" :style="{ width: '20px', height: '20px', backgroundColor: `${shift.color}`, margin: '0 auto', borderRadius: '2px' }"></div>-->
                                 </div>
                                 <div v-if="hoveredIndex === `${row.value}-${cIndex}` && !readonly" class="overlay">
                                     <i class="el-icon-edit" />
@@ -651,43 +652,44 @@ export default {
                     el.options = el.options.filter(obj => obj.diDian === (second || first))
                 })
                 // console.log(this.configOptions)
-                if (this.$utils.isEmpty(this.pageParams.id)) {
-                    this.loading = false
+                if (self.$utils.isEmpty(self.pageParams.id)) {
+                    self.loading = false
                     return
                 }
-                const response = await getStaffSchedule({ id: this.pageParams.id })
-                const { staffScheduleDetailPoList: records, title, endDate, startDate, type, overview, config, status, id } = response.data
+                const response = await getStaffSchedule({ id: self.pageParams.id })
+                const { staffScheduleDetailPoList: records, title, endDate, startDate, type, overview, config, status, id, oldScheduleId } = response.data
                 const temp = config ? JSON.parse(config) : {}
-                this.responseData = response.data
+                self.responseData = response.data
                 console.log('responseData:', response.data)
                 console.log('configData:', temp)
-                this.formData = {
+                self.formData = {
                     title,
                     status,
                     id,
                     config: temp.id,
                     dateRange: [startDate, endDate],
                     approver: temp.approver || [],
+                    oldScheduleId: oldScheduleId,
                     overview: overview,
                     scheduleType: type,
                     scheduleRule: temp.scheduleRule || [],
                     scheduleShift: temp.scheduleShift || [],
                     scheduleStaff: temp.scheduleStaff || []
                 }
-                this.shiftList = this.formData.scheduleShift.filter(s => s.isEnabled === 'Y').map(s => ({
+                self.shiftList = self.formData.scheduleShift.filter(s => s.isEnabled === 'Y').map(s => ({
                     ...s,
-                    positions: s.positions.join(','),
+                    positions: (s.positions || []).join(','),
                     dateRange: s.dateRange.map(d => {
-                        return d.type === 'allday' ? '全天' : (`当天 ${d.startTime}` + '  ' + `${d.isSecondDay === 'Y' ? '第二天' : '当天'} ${d.endTime}`)
+                        return d.type === 'allday' ? '全天' : `当天 ${d.startTime}至${d.isSecondDay === 'Y' ? '第二天' : '当天'} ${d.endTime}`
                     })
                 }))
-                console.log('formData', this.formData)
-                this.scheduleData = this.transformScheduleData(records, overview, temp)
-                this.responseData = { ...this.responseData, records, overview, temp }
-                console.log('scheduleData', this.scheduleData)
-                this.loading = false
+                console.log('formData', self.formData)
+                self.scheduleData = self.transformScheduleData(records, overview, temp)
+                self.responseData = { ...self.responseData, records, overview, temp }
+                console.log('scheduleData', self.scheduleData)
+                self.loading = false
             }).catch(() => {
-                this.loading = false
+                self.loading = false
             })
         },
         getDayOfWeek (date) {
@@ -995,7 +997,6 @@ export default {
             const self = this
             if (val) {
                 await getStaffSchedule({ id: val }).then((res) => {
-                    debugger
                     const { staffScheduleDetailPoList: records, title, endDate, startDate, overview, config,type } = res.data
                     const temp = config ? JSON.parse(config) : {}
                     self.responseData = res.data
@@ -1013,7 +1014,7 @@ export default {
                     }
                     self.shiftList = self.formData.scheduleShift.filter(s => s.isEnabled === 'Y').map(s => ({
                         ...s,
-                        positions: s.positions.join(','),
+                        positions: (s.positions || []).join(','),
                         dateRange: s.dateRange.map(d => {
                             return d.type === 'allday' ? '全天' : (`当天 ${d.startTime}` + ' 至 ' + `${d.isSecondDay === 'Y' ? '第二天' : '当天'} ${d.endTime}`)
                         })