| | |
| | | <!-- |
| | | * @Date: 2024-05-04 16:37:48 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-09 23:30:14 |
| | | * @LastEditTime: 2024-11-07 21:45:28 |
| | | * @FilePath: /cps-web/src/views/console/base/Add.vue |
| | | --> |
| | | <template> |
| | |
| | | this.form.date[0] = moment().format('YYYY-MM-DD') |
| | | } |
| | | // console.log(this.months) |
| | | this.$HTTP.post('/api/blade-cps/shift-off-day/list', { |
| | | this.$HTTP.post('/api/smis/shift-off-day/list', { |
| | | year: currentYear, |
| | | startOffDay: `${currentYear}-01-01`, |
| | | endOffDay: `${currentYear}-12-31` |
| | |
| | | } |
| | | }, |
| | | planCancel() { |
| | | // 取消排班只能取消当前时间之后的排班 |
| | | let now = moment(moment().format('YYYY-MM-DD')).valueOf() |
| | | this.months.forEach((item, i) => { |
| | | item.attributes = item.attributes.slice(0, 2) |
| | | // item.attributes = item.attributes.slice(0, 2) |
| | | item.attributes = item.attributes.map((v, i) => { |
| | | if (i > 1) { |
| | | v.dates = v.dates.filter(c => { |
| | | if (moment(c).valueOf() <= now) { |
| | | return true |
| | | } |
| | | }) |
| | | } |
| | | return v |
| | | }) |
| | | }) |
| | | }, |
| | | save() { |
| | |
| | | status: 1, |
| | | dateDTOList: list |
| | | } |
| | | this.$HTTP.post('/api/blade-cps/calendar', data).then(res => { |
| | | this.$HTTP.post('/api/smis/calendar', data).then(res => { |
| | | if (res.code === 200) { |
| | | this.$emit('success') |
| | | } else { |
| | |
| | | id: this.drawerInfo.id, |
| | | dateDTOList: list |
| | | } |
| | | this.$HTTP.put('/api/blade-cps/calendar', data).then(res => { |
| | | this.$HTTP.put('/api/smis/calendar', data).then(res => { |
| | | if (res.code === 200) { |
| | | this.$emit('success') |
| | | } else { |