| | |
| | | <a-col :span="24"> |
| | | <a-form-item label="设备组" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-input-search :readOnly="true" v-decorator="['equipmentId', validatorRules.equipmentId]" |
| | | @search="deviceSearch" enter-button/> |
| | | @search="deviceSearch" enter-button placeholder="请选择设备"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | </a-form> |
| | | </a-spin> |
| | | <device-calend-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-calend-list-model> |
| | | <select-device-modal ref="selectDeviceModal" @selectFinished="selectOK" :title="'选择设备'"/> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | |
| | | } from '@/api/api' |
| | | |
| | | import Calendar from 'vue-calendar-component'; |
| | | import SelectDeviceModal from '../../../../system/modules/SelectDeviceModal' |
| | | |
| | | export default { |
| | | name: 'ShiftInfoModel', |
| | | components: {DeviceCalendListModel,Calendar}, |
| | | components: { SelectDeviceModal, DeviceCalendListModel,Calendar}, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | 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', |
| | |
| | | this.value = value; |
| | | }, |
| | | deviceSearch() { |
| | | this.$refs.deviceRepairListModel.openPage() |
| | | this.$refs.deviceRepairListModel.title = '选择设备' |
| | | this.$refs.deviceRepairListModel.disableSubmit = false |
| | | this.$refs.selectDeviceModal.visible = true |
| | | this.$refs.selectDeviceModal.selectedRowKeys = [] |
| | | this.$refs.selectDeviceModal.selectedRows = [] |
| | | this.$refs.selectDeviceModal.checkedKeys = this.form.getFieldValue('equipmentId') ? this.form.getFieldValue('equipmentId').split(',') : [] |
| | | }, |
| | | getDeviceRows(val) { |
| | | console.log("========",val); |
| | |
| | | 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:'请选择生效时间!' |
| | | }); |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.close() |
| | | }, |
| | | |
| | | /** |
| | | * 选择已有设备后点击确定时触发 |
| | | * @param data 已选择的设备 |
| | | */ |
| | | selectOK(data) { |
| | | // let params = {} |
| | | // params.equipmentIdList = [] |
| | | // for (var a = 0; a < data.length; a++) { |
| | | // params.equipmentIdList.push(data[a]) |
| | | // } |
| | | console.log('data=', data) |
| | | this.form.setFieldsValue({ |
| | | equipmentId: data.join(',') |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |