From c6787e7d434f8e14c87b70ea7fbab8689f515bb2 Mon Sep 17 00:00:00 2001 From: mo-bai <1873032855@qq.com> Date: Fri, 29 Apr 2022 14:54:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E3=80=81=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E5=8E=82id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/device-operation/index.vue | 4 +++- pages/digital-workshops/index.vue | 9 +++++++-- pages/factory-operation/index.vue | 8 ++++++-- pages/production-operation/index.vue | 4 +++- pages/promotion/index.vue | 4 ++-- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/pages/device-operation/index.vue b/pages/device-operation/index.vue index 1ce85e5..76293ad 100644 --- a/pages/device-operation/index.vue +++ b/pages/device-operation/index.vue @@ -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: '保存成功', diff --git a/pages/digital-workshops/index.vue b/pages/digital-workshops/index.vue index c7725e2..c23bce4 100644 --- a/pages/digital-workshops/index.vue +++ b/pages/digital-workshops/index.vue @@ -137,12 +137,13 @@ export default { uni.stopPullDownRefresh() }, watch: { - factoryId(val) { + factoryId(val, oldVal) { if (val === -1) { if (this.companyTip()) { return } go2('factory-manage') + this.factoryId = oldVal } else { this.getCameraList() this.getList() @@ -225,7 +226,7 @@ export default { return } // 先判断是否时演示工厂 - go2('device-operation', { id: this.factoryId, operation: 'add' }) + go2('device-operation', { factoryId: this.factoryId, operation: 'add' }) }, // 获取摄像头列表 getCameraList() { @@ -243,6 +244,10 @@ export default { isExample: item.name == '演示样板工厂' } }) + if (this.factoryId == this.factoryList[0].value) { + this.getCameraList() + this.getList() + } this.factoryId = this.factoryList[0].value this.factoryList.push({ label: '工厂管理', diff --git a/pages/factory-operation/index.vue b/pages/factory-operation/index.vue index cf0f388..70abb2c 100644 --- a/pages/factory-operation/index.vue +++ b/pages/factory-operation/index.vue @@ -1,6 +1,6 @@