| | |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编号"> |
| | | <MaintenanceEquipmentSelect placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId" :disabled="editable"></MaintenanceEquipmentSelect> |
| | | <MaintenanceEquipmentSelect placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId" |
| | | :maintenanceCategory="maintenanceCategory" :disabled="editable" |
| | | @autocompleteForm="autocompleteForm"></MaintenanceEquipmentSelect> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="点检日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="inspectionDate"> |
| | | <j-date placeholder="请选择点检日期" v-model="model.inspectionDate" style="width: 100%" /> |
| | | <j-date placeholder="请选择点检日期" v-model="model.inspectionDate" style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期"> |
| | | <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%"/> |
| | | <a-input-number v-model="model.maintenancePeriod" :min="1" :precision="0" disabled style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item label="点检过期时间" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> |
| | | <j-date placeholder="请选择点检过期时间" v-model="model.expirationTime" disabled style="width: 100%" /> |
| | | <a-form-model-item label="点检过期时间" :labelCol="{span:6}" :wrapperCol="{span:15}" prop="expirationTime"> |
| | | <j-date placeholder="请选择点检过期时间" v-model="model.expirationTime" disabled style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="备注" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> |
| | | <a-form-model-item label="备注" :labelCol="{span:1}" :wrapperCol="{span:22}" prop="remark"> |
| | | <a-textarea v-model="model.remark" rows="3" placeholder="请输入备注" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;"/> |
| | | style="margin-top: 8px;" /> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | |
| | | import MaintenanceEquipmentSelect from '@views/eam/equipment/modules/MaintenanceEquipmentSelect' |
| | | |
| | | export default { |
| | | name: "EamMaintenanceStandardModal", |
| | | name: 'EamMaintenanceStandardModal', |
| | | mixins: [JVxeTableModelMixin], |
| | | components: { |
| | | MaintenanceEquipmentSelect, |
| | | MaintenanceEquipmentSelect |
| | | }, |
| | | data () { |
| | | data() { |
| | | return { |
| | | title:"操作", |
| | | title: '操作', |
| | | visible: false, |
| | | model: {}, |
| | | editable: false, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | sm: { span: 5 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | sm: { span: 16 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | |
| | | ] |
| | | }, |
| | | url: { |
| | | add: "/eam/maintenanceStandard/add", |
| | | edit: "/eam/maintenanceStandard/edit", |
| | | detail: "/eam/eamMaintenanceStandardDetail/queryList", |
| | | add: '/eam/maintenanceStandard/add', |
| | | edit: '/eam/maintenanceStandard/edit', |
| | | detail: '/eam/eamMaintenanceStandardDetail/queryList' |
| | | }, |
| | | maintenanceCategory: 'POINT_INSPECTION', |
| | | detail: { |
| | | loading: false, |
| | | dataSource: [], |
| | |
| | | title: '序号', |
| | | key: 'itemCode', |
| | | width: '10%', |
| | | align:"center", |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '保养项', |
| | | key: 'itemName', |
| | | width: '20%', |
| | | align:"center", |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '保养要求', |
| | | key: 'itemDemand', |
| | | width: '30%', |
| | | align:"center", |
| | | }, |
| | | ], |
| | | align: 'center' |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | created() { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.model = {}; |
| | | this.visible = true; |
| | | this.editable = false; |
| | | add() { |
| | | this.model = {} |
| | | this.visible = true |
| | | this.editable = false |
| | | }, |
| | | edit (record) { |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.editable = true; |
| | | if(record && record.referenceFile) { |
| | | let obj = JSON.parse(record.referenceFile); |
| | | this.model.fileList = [obj]; |
| | | }else { |
| | | this.model.fieldList = []; |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | this.visible = true |
| | | this.editable = true |
| | | if (record && record.referenceFile) { |
| | | let obj = JSON.parse(record.referenceFile) |
| | | this.model.fileList = [obj] |
| | | } else { |
| | | this.model.fieldList = [] |
| | | } |
| | | this.loadDetail(record.id); |
| | | this.loadDetail(record.id) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | this.$refs.form.clearValidate(); |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | async handleOk () { |
| | | const that = this; |
| | | let errMap = await that.$refs.editableDetailTable.validateTable(); |
| | | if(errMap){ |
| | | this.$message.warning("数据校验失败!"); |
| | | return; |
| | | async handleOk() { |
| | | const that = this |
| | | let errMap = await that.$refs.editableDetailTable.validateTable() |
| | | if (errMap) { |
| | | this.$message.warning('数据校验失败!') |
| | | return |
| | | } |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | let tableData = that.$refs.editableDetailTable.getTableData(); |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData(); |
| | | that.model.tableDetailList = [...tableData]; |
| | | that.model.removeDetailList = [...removeData]; |
| | | let tableData = that.$refs.editableDetailTable.getTableData() |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData() |
| | | that.model.tableDetailList = [...tableData] |
| | | that.model.removeDetailList = [...removeData] |
| | | |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | 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.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | that.close(); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | httpAction(httpurl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$message.success(res.message) |
| | | that.$emit('ok') |
| | | that.close() |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.confirmLoading = false |
| | | }) |
| | | }else{ |
| | | return false; |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | handleCancel() { |
| | | this.close() |
| | | }, |
| | | autocompleteForm(selectObj) { |
| | | this.model.standardName = selectObj.standardName |
| | | this.model.maintenancePeriod=selectObj.maintenancePeriod |
| | | }, |
| | | //加载详情数据 |
| | | loadDetail(standardId) { |
| | | this.detail.dataSource = []; |
| | | this.detail.dataSource = [] |
| | | if (standardId) { |
| | | getAction(this.url.detail, { standardId: standardId }).then(res => { |
| | | if (res.success) { |
| | | this.detail.dataSource = [...res.result]; |
| | | this.detail.dataSource = [...res.result] |
| | | } |
| | | }) |
| | | } |