| | |
| | | this.configTimeVisibleLoading = true |
| | | this.$axios.post(this.$api.performanceShift.getList).then(res => { |
| | | if (res.code === 200) { |
| | | this.timeQuery = res.data |
| | | this.timeQuery.forEach(item => { |
| | | res.data.forEach(item => { |
| | | item.isEdit = false |
| | | item.time.push(item.startTime) |
| | | item.time.push(item.endTime) |
| | | const index = this.timeTypeList.findIndex(val => val.value === item.shift) |
| | | if (index > -1) { |
| | | item.type = this.timeTypeList[index].label |
| | | } |
| | | }) |
| | | this.timeQuery = res.data |
| | | } |
| | | this.configTimeVisibleLoading = false |
| | | }).catch(e => { |
| | |
| | | }, |
| | | isObjectEmpty(obj) { |
| | | return Object.keys(obj).some(key => !obj[key]); |
| | | }, |
| | | saveTimeQuery () { |
| | | this.timeQuery.forEach(item => { |
| | | if (this.isObjectEmpty(item)) { |
| | | return this.$message.error('请填写完整') |
| | | } |
| | | }) |
| | | console.log('???') |
| | | }, |
| | | closeConfigTimeVisible () { |
| | | this.configTimeVisible = false |
| | | this.timeQuery = [{ |
| | | type: '', |
| | | time: null, |
| | | isEdit: false |
| | | }] |
| | | }, |
| | | handleDown(){ |
| | | let year = this.query.year.getFullYear() |