From 2a4151ddaf5cbd3834362dc077e65cc7e020fb4f Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期四, 03 四月 2025 09:21:03 +0800
Subject: [PATCH] #
---
pages/pakin/leftovers.vue | 116 ++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 84 insertions(+), 32 deletions(-)
diff --git a/pages/pakin/leftovers.vue b/pages/pakin/leftovers.vue
index cc572fd..5d51539 100644
--- a/pages/pakin/leftovers.vue
+++ b/pages/pakin/leftovers.vue
@@ -7,9 +7,10 @@
@input="barcodeInput()">
</view>
<view class="item">
- <view class="code-decs">妤煎眰:</view>
- <uni-combox :candidates="floorList" placeholder="璇烽�夋嫨鍑哄簱绔欑偣" v-model="floor"></uni-combox>
- </view>
+ <view class="code-decs">鎷f枡绠�:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode2" :focus="barcodeFocus2"
+ @input="barcodeInput2()">
+ </view>
<!-- <view class="item">
<view class="code-decs">婊℃墭:</view>
<radio-group @change="isFrozen">
@@ -23,7 +24,7 @@
</view> -->
</view>
- <!-- <scroll-view>
+ <scroll-view>
<view class="list" v-for="(item,i) in dataList" :key="i">
<view class="list-left">
<view class="list-left-item">
@@ -56,7 +57,7 @@
<uni-tag :text="item.weight" type="warning"></uni-tag>
</view>
</view> -->
- <!-- <view class="list-left-item">
+ <view class="list-left-item">
<view class="desc">鏁伴噺锛�</view>
<view class="left-item">{{item.anfme}}</view>
</view>
@@ -66,13 +67,13 @@
<uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
</view>
</view>
- </scroll-view> -->
+ </scroll-view>
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
<view class="buttom">
<button size="mini" @click="reset('warn')">閲嶇疆</button>
<button size="mini" type="primary" @click="combConfirm('warn')">纭畾</button>
</view>
- <!-- 寮圭獥 -->
+ <!-- 寮圭獥
<!-- 淇敼鏁伴噺 -->
<view>
<uni-popup ref="revise" type="dialog">
@@ -145,6 +146,7 @@
baseUrl: '',
token: '',
barcode: '',
+ barcode2:'',
dataList: [],
count: 0,
rowNum: '',
@@ -157,6 +159,7 @@
title: '',
content: '',
barcodeFocus: true,
+ barcodeFocus2: true,
matFocus: false,
matData: '',
removeNum: 0,
@@ -188,7 +191,7 @@
// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
setTimeout(() => {
var len = this.barcode.length
- if (len != 8) {
+ if (len >= 9 && len <=8) {
uni.showToast({
title: '鎵樼洏鐮佹湁璇閲嶈瘯',
icon: "none",
@@ -197,8 +200,59 @@
this.barcodeFocuss()
return;
}
- this.focuss()
+ this.selectPakinDetlList()
+ // this.focuss()
}, 200)
+ },
+ barcodeInput2() {
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ setTimeout(() => {
+ var len = this.barcode2.length
+
+ // this.selectPakinDetlList()
+ // this.focuss()
+ }, 200)
+ },
+ selectPakinDetlList(){
+ let that = this;
+ uni.request({
+ url: that.baseUrl + '/mobile/select/workDetl/barcode',
+ data: JSON.stringify({
+ barcode: that.barcode
+ }),
+ method: 'POST',
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ success(result) {
+ result = result.data
+ if (result.code === 200 && result.data) {
+ for(var i =0;i<result.data.length;i++){
+ console.log(result.data[i])
+ that.dataList.push(result.data[i])
+ }
+
+ } else if (result.code == 403) {
+ uni.showToast({
+ title: result.msg,
+ icon: "none",
+ position: 'top'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: result.msg,
+ icon: "none",
+ position: 'top'
+ })
+ }
+
+ }
+ });
},
// 鎵樼洏鐮佹湁璇噸缃�
barcodeFocuss() {
@@ -207,6 +261,14 @@
setTimeout(() => {
that.barcode = '';
that.barcodeFocus = true;
+ }, 100);
+ },
+ barcodeFocuss2() {
+ let that = this;
+ that.barcodeFocus2 = false;
+ setTimeout(() => {
+ that.barcode2 = '';
+ that.barcodeFocus2 = true;
}, 100);
},
// 鍟嗗搧鍏夋爣娓呯┖閲嶇疆
@@ -231,25 +293,10 @@
success(result) {
result = result.data
if (result.code === 200 && result.data) {
- that.matData = result.data
- that.matnr = ''
- that.matData['batch'] = ''
- uni.navigateTo({
- url: "../mat/matSelected",
- // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- success: function(res) {
- res.eventChannel.emit('mat', {
- data: result.data
- })
- },
- // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
- events: {
- matList: function(data) {
- that.checkMat(data.data)
- that.focuss()
- },
- },
- });
+ for(var i =0;i<result.data.length;i++){
+ that.dataList.unshift(result.data[i])
+ }
+
} else if (result.code == 403) {
uni.showToast({
title: result.msg,
@@ -389,16 +436,21 @@
this.messageToggle('error')
return;
}
- if (that.floor === 0 || that.floor === '') {
- this.messageText = "璇烽�夋嫨妤煎眰"
+ if (that.barcode2 === '') {
+ this.messageText = "璇锋壂鎻忔嫞鏂欑鏉$爜"
this.messageToggle('error')
return;
- }
+ }
+ if (that.dataList.length === 0) {
+ this.messageText = "鎷f枡鍒楄〃涓虹┖"
+ this.messageToggle('error')
+ return;
+ }
uni.request({
url: that.baseUrl + '/mobile/leftovers/out',
data: JSON.stringify({
barcode: that.barcode,
- floor: that.floor
+ barcode2: that.barcode2
}),
method: 'POST',
header: {
--
Gitblit v1.9.1