| | |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | :mask-closable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="关闭"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules"> |
| | | <a-spin :spinning="spinning"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="orderNum" label="工单号"> |
| | | <a-form-model-item prop="orderNum" label="工单号"> |
| | | <a-input placeholder="工单号系统自动生成" v-model="model.orderNum" disabled /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编码"> |
| | | <a-form-model-item prop="equipmentId" label="设备编码"> |
| | | <maintenance-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId" |
| | | :maintenanceCategory="maintenanceCategory" |
| | | @autocompleteForm="autocompleteForm" :disabled="editable"></maintenance-equipment-select> |
| | | @autocompleteForm="autocompleteForm" |
| | | :disabled="editable"></maintenance-equipment-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="standardName" label="标准名称"> |
| | | <a-form-model-item prop="standardName" label="标准名称"> |
| | | <a-input placeholder="选择设备后自动带出" v-model="model.standardName" disabled /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenanceDate" label="保养日期"> |
| | | <a-form-model-item prop="maintenanceDate" label="保养日期"> |
| | | <a-date-picker placeholder="请选择计划保养日期" v-model="model.maintenanceDate" format="YYYY-MM-DD" |
| | | style="width: 100%" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="保养人"> |
| | | <j-search-select-tag v-model="model.operator" placeholder="请选择保养人" |
| | | <a-form-model-item prop="operator" label="保养人"> |
| | | <j-search-select-tag v-model="model.operator" placeholder="请选择保养人" :disabled="!model.equipmentId" |
| | | :dictOptions="maintenanceOperatorOptions" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="maintenancePeriod" label="保养周期"> |
| | | <a-form-model-item prop="maintenancePeriod" label="保养周期"> |
| | | <a-input placeholder="选择设备后自动带出" v-model="model.maintenancePeriod" disabled /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | |
| | | </a-form-model-item> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <a-spin :spinning="detail.loading"> |
| | | <j-vxe-table |
| | | ref="editableDetailTable" |
| | | :rowNumber="true" |
| | |
| | | :toolbarConfig="detail.toolbarConfig" |
| | | keep-source |
| | | :height="300" |
| | | :loading="detail.loading" |
| | | :dataSource="detail.dataSource" |
| | | :columns="detail.columns" |
| | | style="margin-top: 8px;" /> |
| | | </a-spin> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | |
| | | sm: { span: 21 } |
| | | }, |
| | | confirmLoading: false, |
| | | spinning: false, |
| | | validatorRules: { |
| | | equipmentId: [ |
| | | { required: true, message: '请选择设备!' } |
| | |
| | | edit: '/eam/weekMaintenanceOrder/edit', |
| | | standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', |
| | | detail: '/eam/weekMaintenanceOrderDetail/queryList', |
| | | userSelect: '/eam/user_select/list', |
| | | userSelect: '/eam/user_select/list' |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | |
| | | this.visible = true |
| | | this.editable = false |
| | | this.detail.dataSource = [] |
| | | this.loadMaintenanceOperatorList(); |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | |
| | | this.$set(this.model, 'standardId', selectObj.id) |
| | | this.$set(this.model, 'equipmentId', selectObj.equipmentId) |
| | | // console.log('model', this.model) |
| | | if (!this.model.equipmentId) delete this.model.operator |
| | | if (!this.model.id) { |
| | | this.loadStandardDetail(selectObj.id) |
| | | } |
| | | this.loadMaintenanceOperatorList(this.model.equipmentId); |
| | | this.loadMaintenanceOperatorList(this.model.equipmentId) |
| | | }, |
| | | //加载详情数据 |
| | | loadStandardDetail(standardId) { |
| | | this.detail.dataSource = [] |
| | | if (standardId) { |
| | | getAction(this.url.standardDetail, { standardId: standardId }).then(res => { |
| | | this.spinning = true |
| | | getAction(this.url.standardDetail, { standardId: standardId }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.detail.dataSource = res.result.map(item => ({ |
| | | itemCode: item.itemCode, |
| | |
| | | itemDemand: item.itemDemand |
| | | })) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | this.spinning = false |
| | | }) |
| | | } |
| | | }, |
| | |
| | | if (equipmentId) { |
| | | params.equipmentId = equipmentId |
| | | } |
| | | getAction(this.url.userSelect, params).then(res => { |
| | | else return |
| | | const that = this |
| | | getAction(this.url.userSelect, params) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.maintenanceOperatorOptions = res.result.map(item => ({ |
| | | that.maintenanceOperatorOptions = res.result.map(item => ({ |
| | | key: item.id, |
| | | value: item.username, |
| | | text: item.realname |
| | | })) |
| | | if (!that.maintenanceOperatorOptions.find(item => item.value === that.model.operator)) delete that.model.operator |
| | | } else { |
| | | if (that.model.operator) delete that.model.operator |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | if (that.model.operator) delete that.model.operator |
| | | }) |
| | | } |
| | | |
| | | } |