|
|
|
@ -160,6 +160,7 @@ export default { |
|
|
|
return { |
|
|
|
operation: 'add', // add:新增, edit:编辑 |
|
|
|
deviceId: null, |
|
|
|
factoryId: null, |
|
|
|
form: { |
|
|
|
id: null, |
|
|
|
imgItemList: [], |
|
|
|
@ -178,6 +179,7 @@ export default { |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
if (options.operation) { |
|
|
|
this.factoryId = options.factoryId |
|
|
|
this.operation = options.operation |
|
|
|
if (options.operation == 'edit') { |
|
|
|
this.init(options.id) |
|
|
|
@ -276,7 +278,7 @@ export default { |
|
|
|
let list = this.technicsTypeList.filter((item) => this.form.technicsTypeList.includes(item.value)) |
|
|
|
let technicsTypeList = list.map((item) => ({ id: item.value, name: item.label })) |
|
|
|
this.form.typeName = this.deviceTypeList.find((item) => item.value == this.form.type).label |
|
|
|
changeDevice({ ...this.form, technicsTypeList }).then((res) => { |
|
|
|
changeDevice({ ...this.form, technicsTypeList, factoryId: this.factoryId }).then((res) => { |
|
|
|
if (res) { |
|
|
|
uni.showToast({ |
|
|
|
title: '保存成功', |
|
|
|
|