<template>
|
<j-modal
|
:title="title"
|
:width="width"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
switchFullscreen
|
@ok="handleOk"
|
@cancel="handleCancel"
|
cancelText="关闭">
|
<a-spin :spinning="confirmLoading">
|
<a-form-model ref="form" :model="model" :rules="validatorRules">
|
<a-row>
|
<a-col :span="24">
|
<a-form-model-item label="设备变动单id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentChangeId">
|
<a-input v-model="model.equipmentChangeId"placeholder="请输入设备变动单id" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
|
<a-input v-model="model.equipmentId"placeholder="请输入设备ID" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="统一编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentNum">
|
<a-input v-model="model.equipmentNum"placeholder="请输入统一编码" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="资产编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="assetNumber">
|
<a-input v-model="model.assetNumber"placeholder="请输入资产编码" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="特种设备(是、否)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specificEquipment">
|
<j-dict-select-tag type="list" v-model="model.specificEquipment" dictCode="specific_equipment" placeholder="请选择特种设备(是、否)" disabled/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentName">
|
<a-input v-model="model.equipmentName"placeholder="请输入设备名称" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="设备型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="model">
|
<a-input v-model="model.model"placeholder="请输入设备型号" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="设备规格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="specification">
|
<a-input v-model="model.specification"placeholder="请输入设备规格" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentStatus">
|
<j-dict-select-tag type="list" v-model="model.equipmentStatus" dictCode="equipment_status" placeholder="请选择设备状态" disabled/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="技术状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="technologyStatus">
|
<j-dict-select-tag type="list" v-model="model.technologyStatus" dictCode="technology_status" placeholder="请选择技术状态" disabled/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="设备位置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="location">
|
<a-input v-model="model.location"placeholder="请输入设备位置" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="重要度" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentImportanceId">
|
<j-dict-select-tag type="list" v-model="model.equipmentImportanceId" dictCode="mom_eam_equipment_importance,name,id" placeholder="请选择重要度" disabled/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="封存原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sealReason">
|
<a-input v-model="model.sealReason"placeholder="请输入封存原因" disabled></a-input>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="封存日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sealDate">
|
<j-date placeholder="请选择封存日期" v-model="model.sealDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" disabled/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="启封日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unsealDate">
|
<j-date placeholder="请选择启封日期" v-model="model.unsealDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="24">
|
<a-form-model-item label="启封原因" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="unsealReason">
|
<a-textarea v-model="model.unsealReason" rows="4" placeholder="请输入启封原因" />
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-form-model>
|
</a-spin>
|
</j-modal>
|
</template>
|
|
<script>
|
|
import { httpAction } from '@/api/manage'
|
import { validateDuplicateValue } from '@/utils/util'
|
|
export default {
|
name: "EquipmentUnsealDetailModal",
|
components: {
|
},
|
props:{
|
mainId:{
|
type:String,
|
required:false,
|
default:''
|
}
|
},
|
data () {
|
return {
|
title:"操作",
|
width:800,
|
visible: false,
|
model:{
|
},
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 5 },
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 16 },
|
},
|
|
confirmLoading: false,
|
validatorRules: {
|
equipmentChangeId: [
|
{ required: true, message: '请输入设备变动单id!'},
|
],
|
},
|
url: {
|
add: "/eam/equipmentUnseal/addEquipmentUnsealDetail",
|
edit: "/eam/equipmentUnseal/editEquipmentUnsealDetail",
|
}
|
|
}
|
},
|
created () {
|
//备份model原始值
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
},
|
methods: {
|
add () {
|
this.edit(this.modelDefault);
|
},
|
edit (record) {
|
this.model = Object.assign({}, record);
|
this.visible = true;
|
},
|
close () {
|
this.$emit('close');
|
this.visible = false;
|
this.$refs.form.clearValidate();
|
},
|
handleOk () {
|
const that = this;
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = true;
|
let httpurl = '';
|
let method = '';
|
if(!this.model.id){
|
httpurl+=this.url.add;
|
method = 'post';
|
}else{
|
httpurl+=this.url.edit;
|
method = 'put';
|
}
|
this.model['equipmentChangeId'] = this.mainId
|
httpAction(httpurl,this.model,method).then((res)=>{
|
if(res.success){
|
that.$message.success(res.message);
|
that.$emit('ok');
|
}else{
|
that.$message.warning(res.message);
|
}
|
}).finally(() => {
|
that.confirmLoading = false;
|
that.close();
|
})
|
}else{
|
return false
|
}
|
})
|
},
|
handleCancel () {
|
this.close()
|
},
|
|
|
}
|
}
|
</script>
|