From 4e66ae97b0af03b3596ebd776fbeee0f7393625f Mon Sep 17 00:00:00 2001 From: whycq <123456> Date: 星期三, 11 五月 2022 20:39:02 +0800 Subject: [PATCH] # --- pages/basics/checkout.vue | 56 ++++++++++++++++++++++---------------------------------- 1 files changed, 22 insertions(+), 34 deletions(-) diff --git a/pages/basics/checkout.vue b/pages/basics/checkout.vue index c16729a..7512b4c 100644 --- a/pages/basics/checkout.vue +++ b/pages/basics/checkout.vue @@ -28,16 +28,20 @@ </view> </view> --> - <view class="square-2"> + <view class="square-3"> <view class="square-title"> <view class="title-sign"><view class="sign"></view></view> <view class="title-text"><text>璐у搧鏉$爜</text></view> </view> <view class="square-content"> + <text>绔欏彴锛�</text> <view class="content-combox"> - <uni-combox emptyTips="鏆傛棤鏁版嵁" :candidates="siteList" v-model="desc" placeholder="绔欏彴鍙�" + <uni-combox emptyTips="鏆傛棤鏁版嵁" :candidates="siteList" v-model="desc" placeholder="绔欏彴鍙�" @input="choseStaNo"></uni-combox> </view> + </view> + <view class="square-content"> + <text>璐у搧鏉$爜锛�</text> <view class="content-input-combox"> <input type="text" v-model="matnr" placeholder="鎵爜 / 杈撳叆" @input="findMat()" :focus="focus" > @@ -77,7 +81,7 @@ <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="matnr">{{item.matnr}}</view> + <view class="matnr">{{item.matnr}}-{{item.batch}}</view> </view> <view class="data-list-right"> <uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons> @@ -189,6 +193,10 @@ position: 'bottom', duration: 1000 }); + that.matList = [] + that.barcode = '' + that.matnr = '' + that.desc = '' } else if (res.code == 403) { uni.showToast({title: res.msg, icon: "none", position: 'top'}) setTimeout(() => { @@ -234,27 +242,19 @@ 'token':uni.getStorageSync('token') }, success(result) { + var res = result.data; if(res.data) { - let add = true; for(let i = 0;i<that.matList.length;i++) { - for (let j = 0;j < that.res.data.length; j++) { + for (let j = 0;j < res.data.length; j++) { if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { - res.data.splice(i,1) - // break; + res.data.splice(j,1) } } - // add = false; } - that.matList = that.matList.concat(res.data) - // if (add) { - // that.matList = that.matList.concat(res.data) - // } + that.matList = res.data.concat(that.matList) + // that.matList = that.matList.concat(res.data) } - - // that.addMatList(res.data) - // that.matList = res.data - } }); }, @@ -295,24 +295,17 @@ }, success(result) { var res = result.data; + console.log(res) if(res.data) { - let add = true; for(let i = 0;i<that.matList.length;i++) { - for (let j = 0;j < that.res.data.length; j++) { + for (let j = 0;j < res.data.length; j++) { if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) { - res.data.splice(i,1) - // break; + res.data.splice(j,1) } } - // if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[0])) { - // add = false; - // break; - // } } - that.matList = that.matList.concat(res.data) - // if (add) { - // that.matList = that.matList.concat(res.data) - // } + that.matList = res.data.concat(that.matList) + // that.matList = that.matList.concat(res.data) } } @@ -438,12 +431,7 @@ margin-top: 5rpx; margin-right: 10rpx; } - .combox { - position: fixed; - display: inline-block; - width: 28%; - float: right; - } + /* .pak-seach-box input { background-color: #ededed; border: 1rpx solid #d8d8d8; -- Gitblit v1.9.1