From 248ef3ba3de9994dc83d2b36690542893f9fb6e6 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期四, 28 十一月 2024 16:26:06 +0800 Subject: [PATCH] # --- pages/home/orderManage.vue | 94 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 76 insertions(+), 18 deletions(-) diff --git a/pages/home/orderManage.vue b/pages/home/orderManage.vue index faf4c17..7b7957c 100644 --- a/pages/home/orderManage.vue +++ b/pages/home/orderManage.vue @@ -12,6 +12,7 @@ </view> <view class="cu-tabbar-height"></view> </scroll-view> + <view style="height: 50rpx;"></view> </view> </template> @@ -26,8 +27,20 @@ project: 'tzsk', elements2: [ { + title: '寰呭寘瑁呭叆搴撳崟', + name: 'pakinOrder', + color: 'blue', + url: `/phyz/waitOrder/waitOrderIn` + }, + { + title: '寰呭寘瑁呭嚭搴撳崟', + name: 'pakinOrder', + color: 'blue', + url: `/phyz/waitOrder/waitOrderOut` + }, + { title: '閲囪喘鍏ュ簱鍗�', - name: 'outPakin', + name: 'pakinOrder', color: 'blue', // cuIcon: 'pullup', url: `/phyz/order/pakinOrderSelect` @@ -47,7 +60,7 @@ // url: `/phyz/order/purchaseOrder` // }, { - title: '璁㈠崟鍑哄簱', + title: '閲囪喘鍑哄簱', name: 'outOrder', color: 'blue', // cuIcon: 'pullup', @@ -79,18 +92,48 @@ name: 'processOrder', color: 'blue', // cuIcon: 'pullup', - url: `/phyz/orderOut/bcpOrderOutSelect` + url: `/phyz/processOrder/processOrder` + }, + { + title: '鍗婃垚鍝佸洖娴佸崟', + name: 'backStock', + color: 'blue', + // cuIcon: 'pullup', + url: `/phyz/backStock/backStocksOrder` + }, + { + title: '鍏ュ簱鍗�', + name: 'orderIn', + color: 'blue', + // cuIcon: 'pullup', + url: `/phyz/comOrder/orderIn` + }, + { + title: '鍑哄簱鍗�', + name: 'orderOut', + color: 'blue', + // cuIcon: 'pullup', + url: `/phyz/comOrder/orderOut` }, ], + menu: [], colorList: ['cyan','blue','purple','mauve','pink','brown','red','orange','yellow','olive','olive','grey' ] }; }, - onShow() { + // onShow() { + // this.baseUrl = uni.getStorageSync('baseUrl'); + // this.token = uni.getStorageSync('token'); + // this.project = uni.getStorageSync('project') + // // this.getAuth() + // this.backGroundRepeat() + // }, + onLoad(option) { this.baseUrl = uni.getStorageSync('baseUrl'); this.token = uni.getStorageSync('token'); - this.project = uni.getStorageSync('project') - this.getAuth() + this.project = uni.getStorageSync('project'); + this.menu = uni.getStorageSync('menu'); + this.getAuth2(option.id) this.backGroundRepeat() }, methods: { @@ -105,11 +148,30 @@ i++ } }, - getAuth() { + getAuth2(id) { + let secMenu = [] + for (let k of this.menu) { + if (id == k.id) { + secMenu = k.children + } + } + for (let i in secMenu) { + this.getIcon(secMenu[i].title) + this.elements.unshift({ + title: secMenu[i].name, + name: secMenu[i].title, + color: this.colorList[i], + cuIcon: this.icon, + id: secMenu[i].id, + url: `${secMenu[i].code}` + }) + } + }, + getAuth(id) { let that = this uni.request({ url: that.baseUrl + '/menu/pda/auth', - data: {}, + data: {level:2 ,id: id}, header: { 'token': uni.getStorageSync('token') }, method: 'POST', success(res) { @@ -122,8 +184,11 @@ that.elements = [] if (res.code === 200) { if (res.data == undefined || res.data == null || res.data == "") { - that.elements = that.elements2 - return + if (res.data.length == 0) { + return + } else { + that.elements = that.elements2 + } } for (var i = 0; i < res.data.length; i++) { if (res.data.length < 0) { @@ -135,16 +200,9 @@ name: res.data[i].title, color: that.colorList[i], cuIcon: that.icon, - url: `/${that.project}${res.data[i].action}` + url: `${res.data[i].code}` }) } - that.elements.push({ - title: '閫�鍑虹櫥褰�', - name: 'logOut', - color: 'grey', - cuIcon: 'exit', - url: '/login/logOut' - }) } else if (res.code === 403) { uni.showToast({ title: res.msg, -- Gitblit v1.9.1