From af2a1feb2ae9c67a3f3a944873c7cdafa2122c29 Mon Sep 17 00:00:00 2001 From: rosehan <151435705@qq.com> Date: Sun, 28 Apr 2024 14:03:34 +0800 Subject: [PATCH] =?UTF-8?q?4=E6=9C=8826=E6=97=A5=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.js | 4 +- pages/index.vue | 28 +++- pages/login.vue | 38 ++--- store/index.js | 1 - store/modules/user.js | 17 ++- sunPages/mine/base/index.vue | 134 +++++++++++++----- .../delivery/deliveryEdit.vue | 17 +-- .../traceability-product/machining/index.vue | 45 +++--- utils/constant.js | 2 + 9 files changed, 195 insertions(+), 91 deletions(-) diff --git a/config.js b/config.js index c35fa06..bd3a73d 100644 --- a/config.js +++ b/config.js @@ -1,8 +1,8 @@ // 应用全局配置 module.exports = { - baseUrl: 'https://sy.hbcjy.com/prod-api', + //baseUrl: 'https://sy.hbcjy.com/prod-api', // baseUrl: 'http://127.0.0.1:48080', - // baseUrl: 'http://192.168.130.193:48080', + baseUrl: 'http://192.168.130.193:48080', baseApi: '/admin-api', // 应用信息 appInfo: { diff --git a/pages/index.vue b/pages/index.vue index ec6d87a..9eb45a1 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -7,8 +7,8 @@ - {{ BaseInfo.baseName }} - 负责人:{{ BaseInfo.baseLeader }} + {{ baseName }} + 负责人:{{ baseLeader }} @@ -178,15 +178,27 @@ baseId: this.$store.state.user.baseId, BaseInfo: null, ProductData: null, - ProductCode: null + ProductCode: null, + baseName: null, + baseLeader: null, } }, watch: { "$store.state.user.baseId"(newValue, oldVal) { - console.log("AAAA",newValue) - this.baseId=newValue + this.baseId = newValue this.getBaseData() - } + }, + "$store.state.user.baseName": { + handler(newVal) { + this.baseName = newVal + }, + }, + "$store.state.user.baseLeader": { + handler(newVal) { + this.baseLeader = newVal + }, + + }, }, onLoad: function() { this.getBaseData() @@ -195,13 +207,15 @@ }, methods: { // 获取基地数据 - async getBaseData() { + async getBaseData() { try { let params = { id: this.baseId } const res = await indexApi.getAllBaseInfo(params) this.BaseInfo = res.data + this.baseName = this.BaseInfo.baseName + this.baseLeader = this.BaseInfo.baseLeader } finally {} }, diff --git a/pages/login.vue b/pages/login.vue index a7fd5d2..8cc3ee6 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -1,9 +1,13 @@