¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="device"> |
| | | <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" :getContainer="() => this.$refs.device" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="设å¤ç»" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]" |
| | | @search="deviceSearch" enter-button/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-item label="æ¥è¦å·" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请è¾å
¥æ¥è¦å·" v-decorator="['alarmCode', validatorRules.alarmCode]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-item label="æ¥è¦æè¿°" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input placeholder="请è¾å
¥æ¥è¦æè¿°" v-decorator="['alarmDescription', validatorRules.alarmDescription]"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-item label="æ¯å¦å¯ç¨" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-switch :default-checked = 'showM' v-decorator="['isUse', validatorRules.isUse]"></a-switch> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span='24'> |
| | | <a-form-item |
| | | :labelCol="labelCol" |
| | | :wrapperCol="wrapperCol" |
| | | label="æ°å¢æ¹å¼" |
| | | hidden> |
| | | <a-input |
| | | v-decorator="[ |
| | | 'addWay', |
| | | { rules: |
| | | [ |
| | | { required: true, message: '' } |
| | | ], |
| | | initialValue: '1' |
| | | } |
| | | ]" |
| | | placeholder="请è¾å
¥æ°å¢æ¹å¼" |
| | | allowClear |
| | | > |
| | | </a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </a-spin> |
| | | <!--<device-calend-list-model ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></device-calend-list-model>--> |
| | | <alarm-manager-equpment ref="deviceRepairListModel" @sendSelectionRows="getDeviceRows"></alarm-manager-equpment> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | // import DeviceCalendListModel from './DeviceCalendarListModel' |
| | | import AlarmManagerEqupment from './alarmManangerEqupment' |
| | | import moment from 'moment' |
| | | import pick from 'lodash.pick' |
| | | import { |
| | | getAction, |
| | | postAction, |
| | | requestPut, |
| | | putAction |
| | | } from '@/api/manage' |
| | | import { |
| | | duplicateCheck |
| | | } from '@/api/api' |
| | | |
| | | export default { |
| | | name: 'alarmManagerModal', |
| | | components: {AlarmManagerEqupment}, |
| | | props: { |
| | | options:{ |
| | | type:Array, |
| | | required:false, |
| | | default:()=>['1','2'] |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | showM:true, |
| | | // isUse:true, |
| | | title: '', |
| | | isDaySpan: false, |
| | | visible: false, |
| | | show: false, |
| | | model: { |
| | | isUse: 'Y', |
| | | }, |
| | | checked: true, |
| | | labelColLong: { |
| | | xs: { |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 3 |
| | | } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 21 |
| | | } |
| | | }, |
| | | labelCol: { |
| | | xs: { |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 6 |
| | | } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 18 |
| | | } |
| | | }, |
| | | confirmLoading: false, form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | equipmentIds:{ |
| | | rules: [{ |
| | | required: true, message: 'è¯·éæ©è®¾å¤!', |
| | | }], |
| | | }, |
| | | alarmCode:{ |
| | | rules: [{ |
| | | required: true, message: '请è¾å
¥æ¥è¦å·!', |
| | | }], |
| | | }, |
| | | alarmDescription:{ |
| | | rules: [{ |
| | | required: true, message: '请è¾å
¥æ¥è¦æè¿°!', |
| | | }], |
| | | }, |
| | | }, |
| | | url: { |
| | | add: '/mdc/alarmInfo/add', |
| | | edit: '/mdc/mdcshiftsub/edit', |
| | | //驱å¨ç±»å |
| | | initShiftList: '/mdc/mdcequipment/driveTypeSelected', |
| | | initShiftSubList: '/mdc/mdcshiftsub/initShiftSubList', |
| | | getShiftSubById: '/mdc/mdcshiftsub/getShiftSubById', |
| | | settingCalendar: '/mdc/mdcdevicecalendar/saveUpdateBatchList', |
| | | //æ°å¢æ¹å¼ |
| | | }, |
| | | shiftList: [], |
| | | shiftSubList: [], |
| | | disableSubmit: true |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | |
| | | methods: { |
| | | deviceSearch() { |
| | | this.$refs.deviceRepairListModel.openPage() |
| | | this.$refs.deviceRepairListModel.title = 'éæ©è®¾å¤' |
| | | this.$refs.deviceRepairListModel.disableSubmit = false |
| | | }, |
| | | getDeviceRows(val) { |
| | | console.log("========",val); |
| | | var equipmentIds = ""; |
| | | for(var i = 0;i<val.length;i++){ |
| | | //equipmentIds = equipmentIds + "," + val[i].equipmentId; |
| | | if (i == 0) { |
| | | equipmentIds = val[i].equipmentId; |
| | | } else { |
| | | equipmentIds = equipmentIds + "," + val[i].equipmentId; |
| | | } |
| | | } |
| | | this.form.setFieldsValue({ |
| | | equipmentIds: equipmentIds, |
| | | }) |
| | | }, |
| | | |
| | | initShiftList() { |
| | | getAction(this.url.initShiftList).then((res) => { |
| | | if (res.success) { |
| | | this.shiftList = res.result |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | add(record) { |
| | | let _this = this |
| | | this.visible = true |
| | | this.form.resetFields() |
| | | this.model = Object.assign({}, record) |
| | | this.initShiftList() |
| | | this.$nextTick(() => { |
| | | |
| | | }) |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.show = false |
| | | }, |
| | | handleOk() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | // console.log(formData) |
| | | formData.isUse = formData.isUse == true || formData.isUse == undefined ? "1" : "2" |
| | | putAction(this.url.add, 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() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-modal-content{ |
| | | /*background: -moz-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.27) 100%);*/ |
| | | /*background: -webkit-gradient(linear, left left, right right, color-stop(0%, rgba(0, 0, 0, 0.66)), color-stop(100%, rgba(0, 0, 0, 0.4)));*/ |
| | | /*background: -webkit-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ |
| | | /*background: -o-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ |
| | | /*background: -ms-linear-gradient(left, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ |
| | | /*background: linear-gradient(to right, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.4) 100%);*/ |
| | | /*background-color: #000;*/ |
| | | } |
| | | /deep/ .ant-modal-close{ |
| | | color: #1191b0; |
| | | font-size: 24px; |
| | | } |
| | | /deep/ .ant-modal-close-x{ |
| | | font-size: 24px; |
| | | } |
| | | .ant-btn { |
| | | padding: 0 10px; |
| | | margin-left: 3px; |
| | | } |
| | | |
| | | .ant-form-item-control { |
| | | line-height: 0px; |
| | | } |
| | | |
| | | /** 主表åè¡é´è· */ |
| | | .ant-form .ant-form-item { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | /** Tab页é¢è¡é´è· */ |
| | | .ant-tabs-content .ant-form-item { |
| | | margin-bottom: 0px; |
| | | } |
| | | </style> |