<template>
|
<j-modal
|
:title="title"
|
fullscreen
|
:visible="visible"
|
centered
|
:confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
@ok="handleOk"
|
@cancel="handleCancel"
|
cancelText="关闭">
|
<a-tabs tab-position="left">
|
<a-tab-pane tab="基础信息" :key="1">
|
<a-spin :spinning="confirmLoading">
|
<j-form-container :disabled="disableSubmit">
|
<a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol"
|
:wrapperCol="wrapperCol" slot="detail">
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="关键设备标识">
|
<j-dict-select-tag dict-code="equipment_importance" placeholder="请输入关键设备标识"
|
v-model="model.equipmentImportance"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item prop="equipmentCode" label="统一编码">
|
<a-input placeholder="请输入统一编码" v-model="model.equipmentCode" :disabled="!editable"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item prop="equipmentName" label="设备名称">
|
<a-input placeholder="请输入设备名称" v-model="model.equipmentName"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="型号">
|
<a-input placeholder="请输入型号" v-model="model.equipmentModel"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item prop="factoryOrgCode" label="使用部门">
|
<a-tree-select v-model="model.factoryOrgCode" style="width: 100%" show-search
|
:tree-data="productionTreeData" :disabled="!editable"
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
|
placeholder="请选择使用部门" allow-clear treeNodeFilterProp="title"
|
:replaceFields="{key:'orgCode',value:'orgCode'}"
|
searchPlaceholder="请输入关键字搜索" tree-default-expand-all/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item prop="equipmentCategory" label="所属分类">
|
<j-dict-select-tag dict-code="equipment_category" placeholder="请选择所属分类" :disabled="!editable"
|
v-model="model.equipmentCategory"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="ABC标识">
|
<j-dict-select-tag dict-code="abc_flag" placeholder="请选择ABC标识" v-model="model.abcFlag"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item prop="repairDepartOrgCode" label="维修班组">
|
<a-tree-select v-model="model.repairDepartOrgCode" style="width: 100%"
|
show-search :tree-data="repairDepartTreeData" treeNodeFilterProp="title"
|
:replaceFields="{key:'orgCode',value:'orgCode'}" searchPlaceholder="请输入关键字搜索"
|
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="请选择维修班组"
|
allow-clear tree-default-expand-all/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="安全配置">
|
<a-input placeholder="请输入安全配置" v-model="model.securityConfiguration"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="冷却系统">
|
<j-dict-select-tag dict-code="cooling_system" placeholder="请选择冷却系统" v-model="model.coolSystem"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="灭火器">
|
<j-dict-select-tag dict-code="yn" type="radio" v-model="model.fireExtinguisher"
|
@change="handleRadioChange($event,'fireExtinguisherExpirationDate')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="灭火器有效期">
|
<a-input :disabled="!Boolean(+model.fireExtinguisher)"
|
v-model="model.fireExtinguisherExpirationDate" placeholder="请输入灭火器有效期"/>
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="操作系统">
|
<j-dict-select-tag dict-code="yn " type="radio" v-model="model.operationSystem"
|
@change="handleRadioChange($event,'system')"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="系统">
|
<a-input placeholder="请输入系统" :disabled="!Boolean(+model.operationSystem)" v-model="model.system"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="真空热处理炉">
|
<j-dict-select-tag dict-code="yn " type="radio" v-model="model.trueHeatTreatment"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="设备端口">
|
<a-input placeholder="请输入设备端口" v-model="model.equipmentPort"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="坐标数量">
|
<a-input-number placeholder="请输入坐标数量" v-model="model.coordinateNum" :min="0" :max="12"
|
style="width: 100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="重量">
|
<a-input-number placeholder="请输入重量" v-model="model.equipmentWeight" :min="0" style="width: 100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="重量计量单位">
|
<a-input placeholder="请输入重量计量单位" v-model="model.weightUnit"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="功能位置">
|
<a-input placeholder="请输入功能位置" v-model="model.functionalLocation"/>
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="安装位置">
|
<a-input placeholder="请输入安装位置" v-model="model.installationPosition"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="出厂日期">
|
<a-date-picker v-model="model.leaveFactoryDate" value-format="YYYY-MM-DD" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="立项卡号">
|
<a-input placeholder="请输入立项卡号" v-model="model.cardNumber"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="资金来源">
|
<a-input placeholder="请输入资金来源" v-model="model.fundingSource"/>
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="验收日期">
|
<a-date-picker v-model="model.acceptanceCheckDate" value-format="YYYY-MM-DD" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="出厂编号">
|
<a-input placeholder="请输入出厂编号" v-model="model.factoryNumber"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="资产制造商">
|
<a-input placeholder="请输入资产制造商" v-model="model.manufacturingEnterprise"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="资产来源国家">
|
<a-input placeholder="请输入资产来源国家" v-model="model.originCountry"/>
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="设备规格">
|
<a-input placeholder="请输入设备规格" v-model="model.equipmentSpecification"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="总功率(KW)">
|
<a-input-number placeholder="请输入总功率(KW)" v-model="model.equipmentPower" :min="0"
|
style="width: 100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="质保开始日期">
|
<a-date-picker v-model="model.warrantyStartDate" value-format="YYYY-MM-DD" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="质保结束日期">
|
<a-date-picker v-model="model.warrantyEndDate" value-format="YYYY-MM-DD" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="资产状态">
|
<j-dict-select-tag dict-code="asset_status" placeholder="请选择资产状态" v-model="model.assetStatus"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="本次三保日期">
|
<a-date-picker v-model="model.latestThirdMaintenance" value-format="YYYY-MM-DD"
|
:disabled="!editable" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="下次三保日期">
|
<a-date-picker v-model="model.nextThirdMaintenance" value-format="YYYY-MM-DD" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="三保周期(年)">
|
<a-input-number placeholder="请输入三保周期(年)" v-model="model.thirdMaintenancePeriod" :min="1"
|
style="width: 100%"/>
|
</a-form-model-item>
|
</a-col>
|
|
</a-row>
|
|
<a-row>
|
<a-col :span="customSpan">
|
<a-form-model-item label="技术状态">
|
<j-dict-select-tag placeholder="请选择技术状态" dict-code="equipment_technology_status"
|
v-model="model.technologyStatus"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="本次技术鉴定日期">
|
<a-date-picker v-model="model.latestTechnologyCheck" value-format="YYYY-MM-DD"
|
:disabled="!editable" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="下次技术鉴定日期">
|
<a-date-picker v-model="model.nextTechnologyCheck" value-format="YYYY-MM-DD" style="width:100%"/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="customSpan">
|
<a-form-model-item label="技术鉴定周期(年)">
|
<a-input-number placeholder="请输入技术鉴定周期(年)" v-model="model.technologyCheckPeriod" :min="1"
|
style="width: 100%"/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</a-form-model>
|
</j-form-container>
|
</a-spin>
|
</a-tab-pane>
|
|
<template v-if="disableSubmit">
|
<a-tab-pane tab="设备文档" :key="2">
|
</a-tab-pane>
|
|
<a-tab-pane tab="点检工单" :key="3">
|
</a-tab-pane>
|
|
<a-tab-pane tab="二保工单" :key="4">
|
</a-tab-pane>
|
|
<a-tab-pane tab="三保工单" :key="5">
|
</a-tab-pane>
|
|
<a-tab-pane tab="维修工单" :key="6">
|
</a-tab-pane>
|
|
<a-tab-pane tab="保养标准" :key="7">
|
</a-tab-pane>
|
</template>
|
</a-tabs>
|
</j-modal>
|
</template>
|
|
<script>
|
import { getAction, httpAction } from '@/api/manage'
|
import { validateDuplicateValueInDelFlag } from '@/utils/util'
|
|
export default {
|
name: 'EamEquipmentModal',
|
props: {
|
productionTreeData: {
|
type: Array
|
},
|
repairDepartTreeData: {
|
type: Array
|
}
|
},
|
data() {
|
return {
|
title: '操作',
|
visible: false,
|
//控制编辑
|
editable: false,
|
//详情控制
|
disableSubmit: false,
|
model: {},
|
customSpan: 6,
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 10 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 14 }
|
},
|
labelColLong: {
|
xs: { span: 24 },
|
sm: { span: 2 }
|
},
|
wrapperColLong: {
|
xs: { span: 24 },
|
sm: { span: 22 }
|
},
|
confirmLoading: false,
|
validatorRules: {
|
equipmentCode: [
|
{ required: true, message: '请输入统一编码', trigger: 'change' },
|
{ validator: (rule, value, callback) => validateDuplicateValueInDelFlag('eam_equipment', 'equipment_code', value, this.model.id, true, callback) }
|
],
|
equipmentName: [
|
{ required: true, message: '请输入设备名称', trigger: 'change' }
|
],
|
factoryOrgCode: [
|
{ required: true, message: '请选择使用部门', trigger: 'change' }
|
],
|
equipmentCategory: [
|
{ required: true, message: '请选择设备所属分类', trigger: 'change' }
|
],
|
repairDepartOrgCode: [
|
{ required: true, message: '请选择维修班组', trigger: 'change' }
|
]
|
},
|
url: {
|
add: '/eam/equipment/add',
|
edit: '/eam/equipment/edit'
|
}
|
}
|
},
|
methods: {
|
add() {
|
this.editable = true
|
//初始化默认值
|
this.model = {
|
operationSystem: 1,
|
fireExtinguisher: 0,
|
trueHeatTreatment: 0
|
}
|
this.visible = true
|
},
|
|
edit(record) {
|
this.editable = false
|
this.model = Object.assign({}, record)
|
this.visible = true
|
},
|
|
/**\
|
* 单选框值发生改变时触发
|
* @param value 单选框值
|
* @param key 单选框关联字段
|
*/
|
handleRadioChange(value, key) {
|
if (value == '0') delete this.model[key]
|
},
|
|
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'
|
}
|
httpAction(httpUrl, this.model, method)
|
.then((res) => {
|
if (res.success) {
|
that.$notification.success({
|
message: '消息',
|
description: res.message
|
})
|
that.$emit('ok')
|
that.close()
|
} else {
|
that.$notification.warning({
|
message: '消息',
|
description: res.message
|
})
|
}
|
})
|
.finally(() => {
|
that.confirmLoading = false
|
})
|
} else {
|
return false
|
}
|
})
|
},
|
|
handleCancel() {
|
this.close()
|
},
|
|
close() {
|
this.$emit('close')
|
this.visible = false
|
this.$refs.form.clearValidate()
|
}
|
}
|
}
|
</script>
|