From 7ed291f7f663d530284b35a6ae28c77ccb87d812 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期一, 08 四月 2024 19:13:20 +0800
Subject: [PATCH] #
---
pages/stock/stockCheck.vue | 170 ++++++++++++++++++++++++++++++++------------------------
1 files changed, 96 insertions(+), 74 deletions(-)
diff --git a/pages/stock/stockCheck.vue b/pages/stock/stockCheck.vue
index cd83df3..8c52a6b 100644
--- a/pages/stock/stockCheck.vue
+++ b/pages/stock/stockCheck.vue
@@ -4,7 +4,7 @@
<view class="item">
<view class="code-decs">鎵樼洏鐮�:</view>
<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
- @confirm="barcodeInput()">
+ @input="search()">
</view>
<view class="item">
<view class="code-decs">鐗╂枡鐮�:</view>
@@ -53,14 +53,14 @@
</view>
<view class="list-right">
<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
- <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
+ <!-- <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons> -->
</view>
</view>
</scroll-view>
<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
<view class="buttom">
<button size="mini" @click="reset('warn')">閲嶇疆</button>
- <button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button>
+ <button size="mini" type="primary" @click="combConfirm('warn')">纭</button>
</view>
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
@@ -77,7 +77,7 @@
</view>
</view>
<view class="popup-item">
- <view class="popup-item-left">鍚堝悓鍙�:</view>
+ <view class="popup-item-left">鎵瑰彿:</view>
<view class="popup-item-right"><input type="text" v-model="batch"></view>
</view>
<view class="popup-item">
@@ -111,7 +111,7 @@
<view>
<uni-popup ref="combConfirm" type="dialog">
<uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
- @confirm="comb" @close="combClose"></uni-popup-dialog>
+ @confirm="adjust" @close="combClose"></uni-popup-dialog>
</uni-popup>
</view>
<!-- 纭閲嶇疆 -->
@@ -120,6 +120,10 @@
<uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
@confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
</uni-popup>
+ </view>
+
+ <view class="keyboard" :class="hidebg" mode="aspectFit" @click="hideKeyboard">
+ <image src="@/static/img/keyboard1.png" style="height: 70%;width: 70%;"></image>
</view>
</view>
</template>
@@ -143,39 +147,75 @@
content: '',
barcodeFocus: true,
matFocus: false,
- matData: ''
+ matData: '',
+ hide: true,
+ hidebg: 'kb-bgtr'
}
},
onLoad() {
-
+ // #ifdef APP
+ setInterval(()=>{
+ if (this.hide) {
+ uni.hideKeyboard()
+ } else {
+
+ }
+ },20)
+ // #endif
+ },
+ onBackPress() {
+ this.hide = false
},
onShow() {
this.baseUrl = uni.getStorageSync('baseUrl');
this.token = uni.getStorageSync('token');
},
methods: {
+ hideKeyboard() {
+ this.hide = this.hide ? false : true
+ if (this.hide) {
+ this.hidebg = 'kb-bgtr'
+ } else {
+ this.hidebg = 'kb-bgfa'
+ }
+ },
messageToggle(type) {
this.msgType1 = type
this.$refs.message.open()
},
- // barcode input 浜嬩欢
- barcodeInput() {
- // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
- setTimeout(() => {
- var len = this.barcode.length
- if (len != 8) {
- uni.showToast({
- title: '鎵樼洏鐮佹湁璇閲嶈瘯',
- icon: "none",
- position: 'top'
- });
- this.barcodeFocuss()
- return;
+ // 鏍规嵁鎵樼洏鐮佹悳绱�
+ search() {
+ let that = this
+ uni.request({
+ url: that.baseUrl + '/mobile/checkDetl/auth2',
+ header: {
+ 'token':uni.getStorageSync('token')
+ },
+ data: {barcode: that.barcode},
+ method:'GET',
+ success(res) {
+ console.log(res);
+ res = res.data
+ if(res.code === 200){
+ for(var i = 0; i < res.data.length;i++){
+ that.dataList.push(res.data[i])
+ }
+ } else if (res.code == 403) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({title: res.msg, icon: "none",position: 'top'})
+ }
}
- this.focuss()
- }, 200)
+
+ })
},
+
// 鎵樼洏鐮佹湁璇噸缃�
barcodeFocuss() {
let that = this;
@@ -350,62 +390,11 @@
combConfirm(type) {
this.msgType = type
this.title = '璀﹀憡'
- this.content = '鏄惁鐜板湪缁勬墭!'
+ this.content = '鏄惁纭鐩樼偣!'
this.$refs.combConfirm.open()
},
combClose() {
this.$refs.combConfirm.close()
- },
- comb() {
- uni.vibrateShort();
- let that = this;
- if (that.barcode === '') {
- this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
- this.messageToggle('error')
- return;
- }
- if (that.dataList.length === 0) {
- this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
- this.messageToggle('error')
- return;
- }
- for (var i = 0; i < that.dataList.length; i++) {
- if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
- this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
- this.messageToggle('error')
- return;
- }
- }
- uni.request({
- url: that.baseUrl + '/mobile/comb/auth',
- data: JSON.stringify({
- barcode: that.barcode,
- combMats: that.dataList
- }),
- method: 'POST',
- header: {
- 'token': uni.getStorageSync('token')
- },
- success(result) {
- var res = result.data
- if (res.code === 200) {
- that.resst();
- that.messageText = "缁勬墭鎴愬姛"
- that.messageToggle('success')
- } else if (res.code == 403) {
- that.messageText = res.msg
- that.messageToggle('error')
- setTimeout(() => {
- uni.reLaunch({
- url: '../login/login'
- });
- }, 1000);
- } else {
- that.messageText = res.msg
- that.messageToggle('error')
- }
- }
- });
},
reset(type) {
this.msgType = type
@@ -416,6 +405,7 @@
// 纭閲嶇疆
resetConfirm() {
this.dataList = []
+ this.barcode = ''
this.messageText = "閲嶇疆瀹屾垚"
this.messageToggle('success')
},
@@ -429,6 +419,38 @@
this.barcode = ''
this.barcodeFocuss()
},
+ adjust() {
+ let that = this
+ var combMats = []
+ var combParam = {}
+ combParam['barcode'] = that.barcode
+ combParam['wrkDetls'] = that.dataList
+ uni.request({
+ url: that.baseUrl + '/mobile/adjustNew/auth',
+ method: 'POST',
+ data: JSON.stringify(combParam),
+ header: {
+ 'token':uni.getStorageSync('token')
+ },
+ success(result) {
+ var res = result.data
+ if (res.code === 200) {
+ that.dataList = []
+ that.barcode = ''
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ } else if (res.code == 403) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({title: res.msg, icon: "none",position: 'top'})
+ }
+ },
+ });
+ },
}
}
</script>
--
Gitblit v1.9.1