<template>
|
<a-modal
|
:width="1250"
|
:visible="visible"
|
:maskClosable="false"
|
:confirmLoading="confirmLoading"
|
@ok="handleOk"
|
@cancel="handleCancel"
|
cancelText="关闭"
|
>
|
<!-- :title="title" -->
|
|
<a-spin :spinning="confirmLoading">
|
<a-form :form="form">
|
<a-divider
|
orientation="center"
|
style="font-size: large;font-style: normal;font-size: 30px;color: #66aeed;"
|
> 生产设备保养计划变更申请单 </a-divider>
|
|
<a-row :gutter="24">
|
<a-col :lg="12">
|
<a-form-item
|
label="设备名称:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
:disabled="true"
|
allow-clear
|
placeholder="请输入设备名称"
|
v-decorator="['equipmentName', validatorRules.equipmentName ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-item
|
label="型号:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
:disabled="true"
|
allow-clear
|
placeholder="请输入型号"
|
v-decorator="['equipmentModel', validatorRules.equipmentModel ]"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter="24">
|
<a-col :lg="12">
|
<a-form-item
|
label="统一编号:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
:disabled="true"
|
allow-clear
|
placeholder="请输入统一编号"
|
v-decorator="['equipmentNum', validatorRules.equipmentNum ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-item
|
label="原计划时间:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<j-date
|
:disabled="true"
|
v-decorator="['planStartTime', validatorRules.planStartTime ]"
|
placeholder="请选择日期"
|
style="width: 100%"
|
:showTime="true"
|
dateFormat="YYYY-MM-DD HH:mm:ss"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :lg="12">
|
<a-form-item
|
label="申请单位:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
allow-clear
|
placeholder="请输入申请单位"
|
v-decorator="['applyUnit', validatorRules.applyUnit ]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-item
|
label="日期:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<j-date
|
v-decorator="['applyTime', validatorRules.applyTime ]"
|
placeholder="请选择日期"
|
style="width: 100%"
|
:showTime="true"
|
dateFormat="YYYY-MM-DD"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :lg="12">
|
<a-form-item
|
label="计划员:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<a-input
|
allow-clear
|
placeholder="请输入计划员"
|
v-decorator="['planUser', validatorRules.planUser ]"
|
/>
|
</a-form-item>
|
</a-col>
|
|
<a-col :span="12">
|
<a-form-item
|
label="申请延保时间:"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<j-date
|
v-decorator="['planDelayTime', validatorRules.planDelayTime ]"
|
placeholder="请选择日期"
|
style="width: 100%"
|
:showTime="true"
|
dateFormat="YYYY-MM-DD HH:mm:ss"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-model-item
|
label="上传"
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
>
|
<!-- prop="file" -->
|
<j-upload
|
:returnUrl="false"
|
:isMultiple="false"
|
v-decorator="['annex', validatorRules.annex]"
|
></j-upload>
|
|
<!-- v-model="model.annex" -->
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="24">
|
<a-form-item
|
:labelCol="{span:3}"
|
:wrapperCol="{span:21}"
|
label="延保(或变更)原因:"
|
>
|
<a-textarea
|
placeholder="请输入延保(或变更)原因"
|
allow-clear
|
rows="4"
|
v-decorator="['delayReason', validatorRules.delayReason]"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
</a-form>
|
</a-spin>
|
|
<template slot="footer">
|
<a-button
|
:style="{marginRight: '8px'}"
|
@click="handleCancel"
|
>
|
关闭
|
</a-button>
|
<a-button
|
:disabled="confirmLoading"
|
:loading="confirmLoading"
|
@click="handleOk"
|
type="primary"
|
>确定</a-button>
|
</template>
|
|
</a-modal>
|
</template>
|
|
<script>
|
import pick from 'lodash.pick'
|
import { getAction, postAction, requestPut } from '@/api/manage'
|
import { duplicateCheck } from '@/api/api'
|
|
export default {
|
name: 'MaintenanceOrderChangeModal',
|
data() {
|
return {
|
title: "操作",
|
visible: false,
|
model: {},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 6 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 18 },
|
},
|
confirmLoading: false,
|
form: this.$form.createForm(this),
|
validatorRules: {
|
applyUnit: {
|
rules: [
|
{ required: true, message: '请输入申请单位!' },
|
]
|
},
|
applyTime: {
|
rules: [
|
{ required: true, message: '请输入申请日期!' },
|
]
|
},
|
annex: {
|
rules: [
|
{ required: true, message: '请上传附件!' },
|
]
|
},
|
planUser: {
|
rules: [
|
{ required: true, message: '请输入计划员!' },
|
]
|
},
|
planDelayTime: {
|
rules: [
|
{ required: true, message: '请选择申请延保时间!' },
|
]
|
},
|
delayReason: {
|
rules: [
|
{ required: true, message: '请输入延保原因!' },
|
]
|
},
|
},
|
url: {
|
add: "/eam/planChangeApply/add",
|
},
|
}
|
},
|
created() {
|
},
|
methods: {
|
|
edit(record) {
|
this.form.resetFields();
|
this.model = Object.assign({}, record);
|
this.visible = true;
|
this.$nextTick(() => {
|
this.form.setFieldsValue(pick(this.model, 'equipmentNum', 'equipmentName', 'equipmentModel', 'planStartTime'));
|
this.form.setFieldsValue({ applyTime: record.currentDateTime });
|
});
|
},
|
|
|
handleOk() {
|
|
const that = this;
|
// 触发表单验证
|
that.form.validateFields((err, values) => {
|
if (!err) {
|
this.$confirm({
|
title: '计划变更',
|
content: '提示:计划变更后将延长保养计划开始时间,请谨慎操作!',
|
okText: '确认',
|
cancelText: '取消',
|
onOk() {
|
let formData = Object.assign(that.model, values);
|
that.confirmLoading = true;
|
// formData.annexName = that.model.annex[0].fileName;
|
// formData.annexSize = that.model.annex[0].fileSize;
|
// formData.annexPath = that.model.annex[0].filePath;
|
formData.annexName = formData.annex[0].fileName;
|
formData.annexSize = formData.annex[0].fileSize;
|
formData.annexPath = formData.annex[0].filePath;
|
postAction(that.url.add, formData).then((res) => {
|
if (res.success) {
|
that.$message.success(res.message);
|
that.$emit('ok', new Date());
|
} else {
|
that.$message.warning(res.message);
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
that.close();
|
})
|
},
|
})
|
}
|
})
|
},
|
|
// handleOk() {
|
// const that = this;
|
// // 触发表单验证
|
// that.form.validateFields((err, values) => {
|
// if (!err) {
|
// let formData = Object.assign(this.model, values);
|
// that.confirmLoading = true;
|
// formData.id = "";
|
// postAction(that.url.add, formData).then((res) => {
|
// if (res.success) {
|
// that.$message.success(res.message);
|
// that.$emit('ok', new Date());
|
// } else {
|
// that.$message.warning(res.message);
|
// }
|
// }).finally(() => {
|
// that.confirmLoading = false;
|
// that.close();
|
// })
|
|
// }
|
// })
|
// },
|
|
handleCancel() {
|
this.close();
|
},
|
|
close() {
|
this.$emit('close');
|
this.visible = false;
|
},
|
}
|
|
}
|
</script>
|
|
<style scoped>
|
.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>
|