From 6ff974ca03d6a8b75c2193eae0e267eef1f22b12 Mon Sep 17 00:00:00 2001 From: Your Name <you@example.com> Date: 星期三, 20 七月 2022 21:48:50 +0800 Subject: [PATCH] # --- pages/basics/pakin.vue | 125 ++++++++++++++++++++++++++++++----------- 1 files changed, 90 insertions(+), 35 deletions(-) diff --git a/pages/basics/pakin.vue b/pages/basics/pakin.vue index 30ccf64..47f3054 100644 --- a/pages/basics/pakin.vue +++ b/pages/basics/pakin.vue @@ -8,8 +8,8 @@ </view> <view class="square-content"> <view class="content-input"> - <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="10" - :focus="barcodeFocus" @input="barcodeInput"> + <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" placeholder-style="margin-top:10px" maxlength="10" + :focus="barcodeFocus" @confirm="barcodeInput()"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> </view> </view> @@ -24,7 +24,7 @@ <view class="square-content"> <view class="content-input-btn"> <input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()" - :focus="focus"> + :focus="focus" placeholder-style="margin-top:9px"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons> </view> <view class="content-btn"> @@ -38,7 +38,7 @@ <view class="square-title"> <view class="title-sign"><view class="sign"></view></view> <view class="title-text"><text>鍟嗗搧鍒楄〃</text></view> - <label v-show="matList.length != 0" style="float: right;margin-right: 20px;margin-top: 13px;"><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove()"></uni-icons></label> + <!-- <label v-show="matList.length != 0" style="float: right;margin-right: 20px;margin-top: 13px;"><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove()"></uni-icons></label> --> </view> </view> @@ -49,19 +49,19 @@ <checkbox-group @change="checkbox"> <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > <view class="data-list-left"> - <view class=""> + <!-- <view> <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> - </view> - <view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view> - <view><text style="width: 400rpx;">鍝佸悕锛歿{item.maktx}}</text></view> - <view><text style="width: 400rpx;">鎵瑰彿锛歿{item.batch}}</text></view> + </view> --> + <view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matNo}}</text></view> + <view><text style="width: 400rpx;">鍝佸悕锛歿{item.matName}}</text></view> + <view><text style="width: 400rpx;">瑙勬牸锛歿{item.str2}}</text></view> <view> - <text style="width: 400rpx;">鏁伴噺锛歿{item.anfme}}</text> + <text style="width: 400rpx;">鏁伴噺锛歿{item.count}}</text> </view> </view> <view class="data-list-right"> <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> - + <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> </view> </view> </checkbox-group> @@ -70,12 +70,12 @@ <!-- 搴曢儴鎸夐挳 --> <view class="footer flex justify-around"> - <label class="label-btn" style="width: 170rpx;"> + <!-- <label class="label-btn" style="width: 170rpx;"> <checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox> </label> <label class="label-btn" style="width: 100rpx;"> <text @click="reChecked()">鍙嶉��</text> - </label> + </label> --> <label class="label-btn" style="width: 150rpx;"> <button class="cu-btn" @click="resst()">閲嶇疆</button> @@ -94,7 +94,7 @@ <text class="title">缁勬墭鏁伴噺</text> </view> <view class="text-box"> - <text>鍙粍鏁伴噺锛歿{enableQty}}</text> + <text>纭缁勬墭鏁伴噺</text> </view> <view class="changeBox"> <view class="num-box"> @@ -123,7 +123,7 @@ searchBox: 'hide', pick:'hide', matnr:'', - matList:[{matnr:"1100758-10004",maktx:"JK-T9270D-12-2PL-Q-(3/16)",batch:"12",anfme:"1"}], + matList:[], result: '', enableQty:'', count:'', @@ -137,7 +137,7 @@ }, onShow() { setTimeout(()=>{ - this.focuss() + // this.focuss() }, 100); }, @@ -150,15 +150,19 @@ methods: { // barcode input 浜嬩欢 barcodeInput() { - var len = this.barcode.length - if (len != 8) { - uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'}); - this.barcodeFocuss() - return; - } - if (len == 8) { - this.focuss() - } + // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� + setTimeout(()=>{ + var len = this.barcode.length + if (len != 8) { + uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'}); + this.barcodeFocuss() + return; + } + if (len == 8) { + this.focuss() + } + },100) + }, // 鎵樼洏鐮佹湁璇噸缃� barcodeFocuss() { @@ -185,7 +189,7 @@ resst() { this.matList = [] this.barcode = '' - this.focuss() + this.barcodeFocuss() uni.vibrateShort(); }, removeBarcode() { @@ -204,13 +208,14 @@ this.focus = true; }); }, - remove() { - // this.matList.splice(index,1) - for (var i = 0; i < this.matList.length; i++) { - if (this.matList[i].checked == true) { - this.matList.splice(i,1) - } - } + remove(item,index) { + this.matList.splice(index,1) + + // for (var i = 0; i < this.matList.length; i++) { + // if (this.matList[i].checked == true) { + // this.matList.splice(i,1) + // } + // } this.checkList(); uni.vibrateShort(); }, @@ -237,6 +242,7 @@ 'token':uni.getStorageSync('token') }, success(result) { + console.log(result) uni.hideLoading(); var res = result.data if (res.code === 200) { @@ -282,14 +288,15 @@ findMat() { let that = this uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth', + url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/matCode/auth', data: { - matnr:that.matnr + id:that.matnr }, header: { 'token':uni.getStorageSync('token') }, success(result) { + console.log(result) uni.vibrateShort(); let res = result.data if (res.code === 200 && res.data) { @@ -395,6 +402,7 @@ }, // 鍒楄〃鍏ㄩ�� allChecked(e){ + if (this.check == true) { for (var i = 0; i < this.matList.length;i++) { this.$set(this.matList[i],'checked',false) @@ -525,6 +533,7 @@ height: 180rpx; margin: 15rpx; border-radius: 20rpx; + font-size: 12px; } .data-list:first-child { margin-top: 20rpx; @@ -567,4 +576,50 @@ width: 80rpx; height: 180rpx; } + .revise-box { + width: 500rpx; + height: 500rpx; + } + .revise-box-top { + width: 100%; + height: 100rpx; + background-color: #fff; + padding: 10rpx; + } + .changeBox { + width: 100%; + height: 100rpx; + line-height: 120rpx; + text-align: center; + background-color: #FFF; + margin-top: 20rpx; + border-bottom: 1px solid #e3e3e3; + } + .text-box { + width: 100%; + height: 100rpx; + line-height: 120rpx; + text-align: center; + /* padding-left: 120rpx; */ + background-color: #FFF; + margin-top: 20rpx; + border-bottom: 1px solid #e3e3e3; + } + .changeBox .num-box { + display: inline-block; + /* float: left; */ + } + .changeBox button { + float: left; + } + .revise-box-buttom { + position: absolute; + width: 100%; + height: 100rpx; + line-height: 100rpx; + background-color: #FFFFFF; + bottom: 0; + text-align: center; + } + </style> \ No newline at end of file -- Gitblit v1.9.1