From 13c612ffe222940cae61c66a0b496ca271cbd635 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期三, 17 七月 2024 09:10:36 +0800 Subject: [PATCH] # --- pages/out/checkOut.vue | 38 +++++++++++++++++++++++++++++--------- 1 files changed, 29 insertions(+), 9 deletions(-) diff --git a/pages/out/checkOut.vue b/pages/out/checkOut.vue index 2685cd6..677ee69 100644 --- a/pages/out/checkOut.vue +++ b/pages/out/checkOut.vue @@ -36,7 +36,7 @@ <view class="list-left-item"> <view class="desc">鐘舵�侊細</view> <view class="left-item"> - <uni-tag :text="item.deadTime" type="error"></uni-tag> + <uni-tag :text="item.deadTime" :type="deadTimeType"></uni-tag> </view> </view> </view> @@ -135,6 +135,8 @@ matFocus: false, matData: '', removeNum: 0, + targetBatch: '', + deadTimeType: 'error' } }, onLoad() { @@ -152,19 +154,35 @@ // barcode input 浜嬩欢 barcodeInput() { let _this = this - let barcode = this.barcode.split(",") - _this.barcode = barcode[0] - // let batch = barcode[0] + let newBarcode = this.barcode + let barcode = this.barcode.split(" ") + this.targetBatch = barcode[1].slice(3) + this.barcode = barcode[1].slice(3) uni.request({ url: _this.baseUrl + '/mobile/wrkDetl/search/batch/auth', header: {'token': uni.getStorageSync('token')}, - data: _this.barcode, + data: newBarcode, method:'POST', success(res) { res = res.data - console.log(res); if (res.code === 200) { + if (res.data.source === 1) { + _this.deadTimeType = "primary" + } else { + _this.deadTimeType = "error" + } _this.dataList.push(res.data) + } else if (res.code == 403) { + _this.messageText = res.msg + _this.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + _this.messageText = res.data + _this.messageToggle('error') } } @@ -354,8 +372,8 @@ comb() { let that = this; uni.request({ - url: that.baseUrl + '/mobile/order/search/orderNo/auth', - data: that.barcode, + url: that.baseUrl + '/mobile/order/search/batch/auth', + data: that.targetBatch, method: 'POST', header: {'token': uni.getStorageSync('token')}, method:'POST', @@ -363,7 +381,7 @@ let res = result.data if (res.code === 200) { that.dataList = [] - this.barcode = '' + that.barcode = '' that.messageText = "纭鎴愬姛" that.messageToggle('success') } else if (res.code == 403) { @@ -391,6 +409,7 @@ resetConfirm() { this.dataList = [] this.barcode = '' + this.targetBatch = '' this.messageText = "閲嶇疆瀹屾垚" this.messageToggle('success') }, @@ -402,6 +421,7 @@ resst() { this.dataList = [] this.barcode = '' + this.targetBatch = '' this.barcodeFocuss() }, } -- Gitblit v1.9.1