| | |
| | | }, |
| | | confirmLoading: false, form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | // shiftId:{ |
| | | // rules: [{ |
| | | // required: true, message: '请选择班制!', |
| | | // }], |
| | | // }, |
| | | equipmentId:{ |
| | | rules:[ |
| | | { |
| | | required:true,message:'请选择设备组!' |
| | | } |
| | | ] |
| | | }, |
| | | shiftId:{ |
| | | rules: [{ |
| | | required: true, message: '请选择班制!', |
| | | }], |
| | | } |
| | | }, |
| | | url: { |
| | | add: '/mdc/mdcDeviceCalendar/add', |
| | |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | |
| | | formData.dateList = this.sendDte |
| | | postAction(this.url.settingCalendar, formData).then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success(res.message) |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | if(formData.dateList&&formData.dateList.length>0){ |
| | | postAction(this.url.settingCalendar, formData).then((res) => { |
| | | if (res.success) { |
| | | // that.$message.success(res.message) |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | }else{ |
| | | that.confirmLoading = false |
| | | that.close() |
| | | }) |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:'请选择生效时间!' |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | }, |