| | |
| | | <template> |
| | | <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" |
| | | <a-modal :title="title" :width="500" :visible="visible" :confirmLoading="confirmLoading" |
| | | @ok="handleOk" @cancel="handleCancel" cancelText="关闭"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-col :span="24"> |
| | | <a-form-item label="班制名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input allow-clear placeholder="请输入班制名称" v-decorator="['shiftName',validatorRules.shiftName]"/> |
| | | </a-form-item> |
| | | |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="是否默认班制" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-switch v-model="defaultShift" checked-children="是" un-checked-children="否"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <!--<a-col :span="12">--> |
| | | <!--<a-form-item label="是否默认班制" :labelCol="labelCol" :wrapperCol="wrapperCol">--> |
| | | <!--<a-switch v-model="defaultShift" checked-children="是" un-checked-children="否"/>--> |
| | | <!--</a-form-item>--> |
| | | <!--</a-col>--> |
| | | |
| | | </a-row> |
| | | </a-form> |
| | |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 6 |
| | | span: 4 |
| | | } |
| | | }, |
| | | wrapperCol: { |
| | |
| | | span: 24 |
| | | }, |
| | | sm: { |
| | | span: 18 |
| | | span: 20 |
| | | } |
| | | }, |
| | | confirmLoading: false, |
| | |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'shiftName')) |
| | | if (record.defaultShift == 'true') { |
| | | this.defaultShift = true |
| | | } else { |
| | | this.defaultShift = false |
| | | } |
| | | // if (record.defaultShift == 'true') { |
| | | // this.defaultShift = true |
| | | // } else { |
| | | // this.defaultShift = false |
| | | // } |
| | | }) |
| | | }, |
| | | close() { |
| | |
| | | if (!err) { |
| | | that.confirmLoading = true |
| | | let formData = Object.assign(this.model, values) |
| | | formData.shiftStatus = 1 |
| | | formData.defaultShift = that.defaultShift |
| | | // formData.shiftStatus = 1 |
| | | // formData.defaultShift = that.defaultShift |
| | | let obj |
| | | if (!this.model.id) { |
| | | obj = postAction(this.url.add, formData) |
| | |
| | | } |
| | | obj.then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | // that.$message.success(res.message) |
| | | that.$notification.success({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | that.$emit('ok', res.result) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | // that.$message.warning(res.message) |
| | | that.$notification.warning({ |
| | | message:'消息', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |