¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div ref="device"> |
| | | <a-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" :getContainer="() => this.$refs.device" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="å
³é"> |
| | | |
| | | <a-row type="flex" :gutter="24"> |
| | | <a-col :md="5"> |
| | | <base-tree @getCurrSelected="changeSelectionNode"></base-tree> |
| | | </a-col> |
| | | <a-col :md="19"> |
| | | <device-calendar-add-tree></device-calendar-add-tree> |
| | | <!--<a-spin :spinning="confirmLoading">--> |
| | | <!--<a-form :form="form">--> |
| | | <!--<a-row :gutter="24">--> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="çææ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-date-picker v-decorator="['takeEffectDate',validatorRules.takeEffectDate]" :disabled="disableSubmit"--> |
| | | <!--:readOnly="disableSubmit" :disabledDate="disabledDate"/>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="å¤±ææ¶é´" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-date-picker v-decorator="['invalidDate',validatorRules.invalidDate]" :disabled="disableSubmit"--> |
| | | <!--:readOnly="disableSubmit" :disabledDate="disabledDate"/>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <!--</a-row>--> |
| | | <!--<a-row :gutter="24">--> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="çå¶åç§°" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-select v-decorator="['shiftId', validatorRules.shiftId]" placeholder="è¯·éæ©çå¶"--> |
| | | <!--@change="initShiftSubList">--> |
| | | <!--<a-select-option v-for="(em,index) in shiftList" :key="index" :value="em.id">--> |
| | | <!--{{ em.shiftName }}--> |
| | | <!--</a-select-option>--> |
| | | <!--</a-select>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="ææéæ©" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-select v-decorator="['weekId', validatorRules.weekId]" placeholder="è¯·éæ©ææ"--> |
| | | <!--@change="weekChange" mode="multiple">--> |
| | | <!--<a-select-option v-for="(em,index) in weekList" :key="index" :value="em.id">--> |
| | | <!--{{ em.name }}--> |
| | | <!--</a-select-option>--> |
| | | <!--</a-select>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | <!--</a-row>--> |
| | | |
| | | <!--</a-form>--> |
| | | <!--</a-spin>--> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTree from '../../../common/BaseTree' |
| | | import DeviceCalendarAddTree from './DeviceCalendarAddTree' |
| | | import moment from 'moment' |
| | | import pick from 'lodash.pick' |
| | | import { |
| | | getAction, |
| | | postAction, |
| | | requestPut |
| | | } from '@/api/manage' |
| | | import { |
| | | duplicateCheck |
| | | } from '@/api/api' |
| | | import AFormItem from 'ant-design-vue/es/form/FormItem' |
| | | import { |
| | | JeecgListMixin |
| | | } from '@/mixins/JeecgListMixin' |
| | | export default { |
| | | name: 'DeviceCalendarAddCon', |
| | | mixins: [JeecgListMixin], |
| | | components: { AFormItem,BaseTree,DeviceCalendarAddTree}, |
| | | props: {node:{}}, |
| | | data() { |
| | | return { |
| | | weekList:[ |
| | | { |
| | | id:0, |
| | | name:"ææå¤©" |
| | | }, |
| | | { |
| | | id:1, |
| | | name:"ææä¸" |
| | | }, |
| | | { |
| | | id:2, |
| | | name:"ææäº" |
| | | }, |
| | | { |
| | | id:3, |
| | | name:"ææä¸" |
| | | }, |
| | | { |
| | | id:4, |
| | | name:"ææå" |
| | | }, |
| | | { |
| | | id:5, |
| | | name:"ææäº" |
| | | }, |
| | | { |
| | | id:6, |
| | | name:"ææå
" |
| | | } |
| | | |
| | | ], |
| | | title: '', |
| | | isDaySpan: false, |
| | | visible: false, |
| | | show: false, |
| | | model: {}, |
| | | checked: false, |
| | | |
| | | |
| | | url: { |
| | | list: '/mdc/mdcequipment/findListEquipment', |
| | | add: '/mdc/mdcshiftsub/add', |
| | | edit: '/mdc/mdcshiftsub/edit', |
| | | initShiftList: '/mdc/mdcshift/initShiftList', |
| | | initShiftSubList: '/mdc/mdcshiftsub/initShiftSubList', |
| | | getShiftSubById: '/mdc/mdcshiftsub/getShiftSubById', |
| | | settingCalendar: '/mdc/mdcdevicecalendar/settingCalendar', |
| | | }, |
| | | shiftList: [], |
| | | shiftSubList: [], |
| | | disableSubmit: true, |
| | | selectEquementId:{} |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | // watch:{ |
| | | // node(val) { //çå¬currSelected ååï¼å°åååçæ°å¼ä¼ éç» getCurrSelected äºä»¶ |
| | | // if (JSON.stringify(val) != '{}') { |
| | | // // if (val.entity.equipmentId) { |
| | | // // this.queryParams.equipmentName = val.entity.equipmentName |
| | | // // this.queryParams.parentId = '' |
| | | // // this.queryParams.equipmentId = val.entity.equipmentId |
| | | // // } else { |
| | | // // this.queryParams.parentId = val.entity.id |
| | | // // this.queryParams.equipmentId = '' |
| | | // // this.queryParams.equipmentName = '' |
| | | // // } |
| | | // // this.searchQuery() |
| | | // } |
| | | // } |
| | | // }, |
| | | methods: { |
| | | changeSelection(val) { |
| | | this.selectEquementId = val |
| | | }, |
| | | // close() { |
| | | // this.$emit('close') |
| | | // this.visible = false |
| | | // }, |
| | | // handleCancel() { |
| | | // this.close() |
| | | // }, |
| | | // handleOk() { |
| | | // // this.selectionRows = this.SelectedList; |
| | | // // console.log(this.selectionRows); |
| | | // this.$emit('sendSelectionRows', this.selectionRows) |
| | | // this.close() |
| | | // }, |
| | | disabledDate(current){ |
| | | //Can not slect days before today and today |
| | | return current && current < moment().endOf("day"); |
| | | }, |
| | | initShiftList() { |
| | | getAction(this.url.initShiftList).then((res) => { |
| | | if (res.success) { |
| | | this.shiftList = res.result |
| | | } |
| | | }) |
| | | }, |
| | | weekChange(shiftId) { |
| | | // getAction(this.url.initShiftSubList, { shiftId, shiftId }).then((res) => { |
| | | // if (res.success) { |
| | | // this.shiftSubList = res.result |
| | | // } |
| | | // }) |
| | | }, |
| | | add(record) { |
| | | // let _this = this |
| | | // this.visible = true |
| | | // this.form.resetFields() |
| | | // this.model = Object.assign({}, record) |
| | | // this.initShiftList() |
| | | // this.$nextTick(() => { |
| | | // this.form.setFieldsValue(pick(this.model, 'equmentName')) |
| | | // this.form.setFieldsValue({ |
| | | // takeEffectDate: moment(), |
| | | // invalidDate: moment().endOf('month') |
| | | // }) |
| | | // }) |
| | | }, |
| | | 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) |
| | | 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() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | // shiftSubChange(val) { |
| | | // let _this = this |
| | | // getAction(this.url.getShiftSubById, { shiftSubId: val }).then((res) => { |
| | | // if (res.success) { |
| | | // if (res.result.isDaySpan == 'true') { |
| | | // _this.isDaySpan = true |
| | | // } else { |
| | | // _this.isDaySpan = false |
| | | // } |
| | | // _this.form.setFieldsValue({ |
| | | // startDate: res.result.startDate, |
| | | // endDate: res.result.endDate |
| | | // }) |
| | | // if (res.result.sleepStartDate) { |
| | | // _this.form.setFieldsValue({ |
| | | // sleepStartDate: res.result.sleepStartDate |
| | | // }) |
| | | // } |
| | | // if (res.result.sleepStartDate) { |
| | | // _this.form.setFieldsValue({ |
| | | // sleepEndDate: res.result.sleepEndDate |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | // } |
| | | } |
| | | } |
| | | </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> |