| | |
| | | <template> |
| | | <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" |
| | | @ok="handleOk" @cancel="handleCancel" cancelText="关闭"> |
| | | <a-modal |
| | | :title="title" |
| | | :width="800" |
| | | :visible="visible" |
| | | :maskClosable="false" |
| | | :confirmLoading="confirmLoading" |
| | | :okButtonProps="{ props: {disabled: disableSubmit} }" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="关闭"> |
| | | <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-input allow-clear placeholder="请输入班次编码" |
| | | <a-input allow-clear placeholder="请输入班次编码" :disabled="disableSubmit" |
| | | v-decorator="['shiftCode',validatorRules.shiftCode]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="班次名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input allow-clear placeholder="请输入班次名称" v-decorator="['shiftName',validatorRules.shiftName]"/> |
| | | <a-input allow-clear placeholder="请输入班次名称" :disabled="disableSubmit" v-decorator="['shiftName',validatorRules.shiftName]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-time-picker v-decorator="['startTime',validatorRules.startTime]"/> |
| | | <a-time-picker :disabled="disableSubmit" v-decorator="['startTime',validatorRules.startTime]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-time-picker v-decorator="['endTime',validatorRules.endTime]"/> |
| | | <a-time-picker :disabled="disableSubmit" v-decorator="['endTime',validatorRules.endTime]"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-item label="工作时长" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input-number v-decorator="['workHours',validatorRules.workHours]" placeholder="请输入工作时长(小时)" style="width: 100%" /> |
| | | <a-input-number :disabled="disableSubmit" v-decorator="['workHours',validatorRules.workHours]" placeholder="请输入工作时长(小时)" style="width: 100%" /> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-item label="是否跨天" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-switch v-model="crossDayFlag" checked-children="是" un-checked-children="否"/> |
| | | <a-switch :disabled="disableSubmit" v-model="crossDayFlag" checked-children="是" un-checked-children="否"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model, 'shiftCode', 'shiftName', 'startTime', 'endTime','workHours')) |
| | | this.form.setFieldsValue({ |
| | | startTime: moment(this.model.startTime, 'HH:mm:ss'), |
| | | endTime: moment(this.model.endTime, 'HH:mm:ss') |
| | | startTime: moment(this.model.startTime, 'HH:mm'), |
| | | endTime: moment(this.model.endTime, 'HH:mm') |
| | | }) |
| | | if (record.crossDayFlag == '1') { |
| | | this.crossDayFlag = true |
| | |
| | | }else if(that.crossDayFlag == false){ |
| | | formData.crossDayFlag = '0' |
| | | } |
| | | formData.startTime = moment(formData.startTime).format('HH:mm:ss') |
| | | formData.endTime = moment(formData.endTime).format('HH:mm:ss') |
| | | formData.startTime = moment(formData.startTime).format('HH:mm') |
| | | formData.endTime = moment(formData.endTime).format('HH:mm') |
| | | if (formData.crossDayFlag == '0') { |
| | | let startTimeOne = formData.startTime.replace(/:/g, '') |
| | | let endTimeOne = formData.endTime.replace(/:/g, '') |
| | |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 关闭弹窗时清除表单校验 |
| | | removeValidate() { |
| | | if (this.$refs.form) this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | } |
| | | </script> |