| | |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceCategory" label="保养分类"> |
| | | <j-dict-select-tag dict-code="maintenance_category" placeholder="请选择保养分类" v-model="model.maintenanceCategory" /> |
| | | <j-dict-select-tag dict-code="maintenance_category" placeholder="请选择保养分类" v-model="model.maintenanceCategory" :disabled="editable" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="initialDate" label="初始日期"> |
| | | <a-date-picker placeholder="请选择初始日期" v-model="model.initialDate" format="yyyy-MM-dd" style="width: 100%"/> |
| | | <a-date-picker placeholder="请选择初始日期" v-model="model.initialDate" format="YYYY-MM-DD" style="width: 100%" :disabled="editable"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编号"> |
| | | <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId"></lx-search-equipment-select> |
| | | <lx-search-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId" :disabled="editable"></lx-search-equipment-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | |
| | | :wrapperCol="wrapperCol" |
| | | prop="fileList"> |
| | | <lx-upload :returnUrl="false" |
| | | :isMultiple="false" |
| | | :multiple="false" |
| | | v-model="model.fileList" |
| | | biz="EamMaintenanceStandard"> |
| | | </lx-upload> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import { getAction, httpAction } from '@/api/manage' |
| | | import { JVxeTableModelMixin } from '@/mixins/JVxeTableModelMixin.js' |
| | | import { JVXETypes } from '@/components/jeecg/JVxeTable' |
| | | import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect' |
| | |
| | | title:"操作", |
| | | visible: false, |
| | | model: {}, |
| | | editable: false, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | standardName: [ |
| | |
| | | url: { |
| | | add: "/eam/maintenanceStandard/add", |
| | | edit: "/eam/maintenanceStandard/edit", |
| | | detail: "/eam/eamMaintenanceStandardDetail/queryList", |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | |
| | | width: '20%', |
| | | align:"center", |
| | | validateRules: [ |
| | | {required : true} |
| | | {required : true, message: '保养项不能为空!'} |
| | | ] |
| | | }, |
| | | { |
| | |
| | | width: '30%', |
| | | align:"center", |
| | | validateRules: [ |
| | | {required : true} |
| | | {required : true, message: "保养要求不能为空!"} |
| | | ] |
| | | }, |
| | | ], |
| | |
| | | }, |
| | | methods: { |
| | | add () { |
| | | //初始化默认值 |
| | | this.edit({}); |
| | | 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 = []; |
| | | } |
| | | this.loadDetail(record.id); |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | |
| | | // 触发表单验证 |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | debugger; |
| | | let tableData = that.$refs.editableDetailTable.getTableData(); |
| | | let newData = that.$refs.editableDetailTable.getNewData(); |
| | | let removeData = that.$refs.editableDetailTable.getDeleteData(); |
| | | that.model.tableDetailList = [...tableData]; |
| | | that.model.removeDetailList = [...removeData]; |
| | | |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | |
| | | //加载详情数据 |
| | | loadDetail(standardId) { |
| | | this.detail.dataSource = []; |
| | | if (standardId) { |
| | | getAction(this.url.detail, { standardId: standardId }).then(res => { |
| | | if (res.success) { |
| | | this.detail.dataSource = [...res.result]; |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |