| | |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId" label="设备编码"> |
| | | <maintenance-equipment-select placeholder="请输入设备编号或名称搜索" v-model="model.equipmentId" |
| | | :maintenanceCategory="maintenanceCategory" |
| | | @autocompleteForm="autocompleteForm"></maintenance-equipment-select> |
| | | @autocompleteForm="autocompleteForm" :disabled="editable"></maintenance-equipment-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | |
| | | </a-col> |
| | | <a-col :span="8"> |
| | | <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="operator" label="保养人"> |
| | | <j-dict-select-tag v-model="model.operator" placeholder="请选择保养人" |
| | | dictCode="sys_user,realname,username,username!='admin' order by create_time" /> |
| | | <j-search-select-tag v-model="model.operator" placeholder="请选择保养人" |
| | | :dictOptions="maintenanceOperatorOptions" /> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="8"> |
| | |
| | | editable: false, |
| | | model: {}, |
| | | maintenanceCategory: 'WEEK_MAINTENANCE', |
| | | maintenanceOperatorOptions: [], |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | |
| | | add: '/eam/weekMaintenanceOrder/add', |
| | | edit: '/eam/weekMaintenanceOrder/edit', |
| | | standardDetail: '/eam/eamMaintenanceStandardDetail/queryList', |
| | | detail: '/eam/weekMaintenanceOrderDetail/queryList' |
| | | detail: '/eam/weekMaintenanceOrderDetail/queryList', |
| | | userSelect: '/eam/user_select/list', |
| | | }, |
| | | detail: { |
| | | loading: false, |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | this.loadMaintenanceOperatorList(); |
| | | }, |
| | | methods: { |
| | | add() { |
| | |
| | | }, |
| | | autocompleteForm(selectObj) { |
| | | //标准名称,保养周期不刷新解决办法 |
| | | //办法一 |
| | | const newObj = { |
| | | standardName: selectObj.standardName, |
| | | maintenancePeriod: selectObj.maintenancePeriod, |
| | | standardId : selectObj.id, |
| | | }; |
| | | this.model = Object.assign({}, newObj, this.model) |
| | | //办法一 validatorRules equipmentId 还是有问题 |
| | | // const newObj = { |
| | | // standardName: selectObj.standardName, |
| | | // maintenancePeriod: selectObj.maintenancePeriod, |
| | | // standardId : selectObj.id, |
| | | // equipmentId: selectObj.equipmentId, |
| | | // }; |
| | | // this.model = Object.assign({}, newObj, this.model) |
| | | //办法二 |
| | | // this.$set(this.model, 'standardName', selectObj.standardName) |
| | | // this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) |
| | | // this.$set(this.model, 'standardId', selectObj.id) |
| | | this.$set(this.model, 'standardName', selectObj.standardName) |
| | | this.$set(this.model, 'maintenancePeriod', selectObj.maintenancePeriod) |
| | | this.$set(this.model, 'standardId', selectObj.id) |
| | | this.$set(this.model, 'equipmentId', selectObj.equipmentId) |
| | | // console.log('model', this.model) |
| | | if (!this.model.id) { |
| | | this.loadStandardDetail(selectObj.id) |
| | | } |
| | | this.loadMaintenanceOperatorList(this.model.equipmentId); |
| | | }, |
| | | //加载详情数据 |
| | | loadStandardDetail(standardId) { |
| | |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | loadMaintenanceOperatorList(equipmentId) { |
| | | this.maintenanceOperatorOptions = [] |
| | | let params = { positionCode: 'PCR0001' } |
| | | if (equipmentId) { |
| | | params.equipmentId = equipmentId |
| | | } |
| | | getAction(this.url.userSelect, params).then(res => { |
| | | if (res.success) { |
| | | this.maintenanceOperatorOptions = res.result.map(item => ({ |
| | | key: item.id, |
| | | value: item.username, |
| | | text: item.realname |
| | | })) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | } |