From 3c820f4b8e162796d1a3f016794521ab9dd8382b Mon Sep 17 00:00:00 2001
From: caill <815519168@qq.com>
Date: Fri, 13 Oct 2023 13:09:28 +0800
Subject: [PATCH] =?UTF-8?q?=E7=82=B9=E4=BD=8D=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/home/home.vue | 2 -
pages/modules/pointmanage.vue | 80 +++++++++++++++++++++++------------
utils/getData2.js | 4 +-
3 files changed, 57 insertions(+), 29 deletions(-)
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 5958ad5..43b2d91 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -3,7 +3,6 @@
- {{$store.getters.userInfo !== '' ? JSON.parse($store.getters.userInfo).user_name : ''}}
欢迎进入诺力四期手持系统!
@@ -63,7 +62,6 @@
})
},
Quit () {
- this.$store.dispatch('delUserInfo')
uni.redirectTo({
url: '/pages/login/login'
})
diff --git a/pages/modules/pointmanage.vue b/pages/modules/pointmanage.vue
index 29803ef..50216f9 100644
--- a/pages/modules/pointmanage.vue
+++ b/pages/modules/pointmanage.vue
@@ -15,7 +15,7 @@
-
+
站点
@@ -97,23 +97,37 @@
// },
async initArea () {
let res = await queryArea()
- this.areaArr = [...res.result]
- this.areaArr.map(el => {
- this.$set(el, 'checked', false)
- this.$set(el, 'pointArr', [])
- })
- if (this.areaArr.length > 0) {
- this.getPonit(this.areaArr[0])
+ if (res.code === '1') {
+ this.areaArr = [...res.result]
+ this.areaArr.map(el => {
+ this.$set(el, 'checked', false)
+ this.$set(el, 'pointArr', [])
+ })
+ if (this.areaArr.length > 0) {
+ this.getPonit(this.areaArr[0])
+ }
+ } else {
+ uni.showToast({
+ title: res.desc,
+ icon: 'none'
+ })
}
},
async initPonit (e) {
let res = await queryPointByArea(e.value)
- this.regobj = e
- this.areaArr.map(el => {
- if (el.value === e.value) {
- this.$set(el, 'pointArr', [...res.result])
- }
- })
+ if (res.code === '1') {
+ this.regobj = e
+ this.areaArr.map(el => {
+ if (el.value === e.value) {
+ this.$set(el, 'pointArr', [...res.result])
+ }
+ })
+ } else {
+ uni.showToast({
+ title: res.desc,
+ icon: 'none'
+ })
+ }
},
getPonit (e) {
// clearInterval(this.timer)
@@ -132,10 +146,17 @@
},
async _handMaterial () {
let res = await handMaterial()
- res.result.map(el => {
- this.$set(el, 'text', el.label)
- })
- this.options = res.result
+ if (res.code === '1') {
+ res.result.map(el => {
+ this.$set(el, 'text', el.label)
+ })
+ this.options = res.result
+ } else {
+ uni.showToast({
+ title: res.desc,
+ icon: 'none'
+ })
+ }
},
change(e) {
// console.log('e:', e);
@@ -174,15 +195,23 @@
try {
let res = await handPointOpt(code, type, mtype, qty)
uni.showToast({
- title: '操作成功',
+ title: res.desc,
icon: 'none'
})
- that.initPonit(this.regobj)
- this.index = ''
- this.qty = ''
- this.obj = {}
- this.disabled1 = false
- this.disabled2 = false
+ if (res.code === '1') {
+ this.index = ''
+ this.qty = ''
+ this.obj = {}
+ this.disabled1 = false
+ this.disabled2 = false
+ this.initPonit(this.regobj)
+ } else {
+ this.index = ''
+ this.qty = ''
+ this.obj = {}
+ this.disabled1 = false
+ this.disabled2 = false
+ }
} catch (err) {
this.index = ''
this.qty = ''
@@ -309,7 +338,6 @@
height 70rpx
line-height 70rpx
width 100%
- max-width 300px
margin 40rpx auto 0
_fj()
.msg_btn
diff --git a/utils/getData2.js b/utils/getData2.js
index a851da6..c47c283 100644
--- a/utils/getData2.js
+++ b/utils/getData2.js
@@ -31,6 +31,7 @@ export const queryArea = () => request({
})
// export const queryArea = () => {
// let res = {
+// code: '1',
// result: [{value: '1', label: 'A1'}, {value: '2', label: 'A2'}]
// }
// return res
@@ -44,7 +45,8 @@ export const queryPointByArea = (code) => request({
})
// export const queryPointByArea = () => {
// let res = {
-// result: [{device_code: '1', device_name: 'JLDFJLLJ', status: '0', material_type: '1', qty: '10'}, {device_code: '2', device_name: 'JLDFJLLJ2'}]
+// code: '1',
+// result: [{device_code: '1', device_name: 'JLDFJLLJ', status: '2', material_type: '1', qty: '10'}, {device_code: '2', device_name: 'JLDFJLLJ2', status: '0', material_type: '1', qty: '10'}]
// }
// return res
// }