From 6c9cbdf482ce1330704dc635c510ec51a1115a9f Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期一, 18 三月 2024 16:52:29 +0800 Subject: [PATCH] # --- pages/basics/order.vue | 97 ++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 88 insertions(+), 9 deletions(-) diff --git a/pages/basics/order.vue b/pages/basics/order.vue index 952c5fb..4dfe3c0 100644 --- a/pages/basics/order.vue +++ b/pages/basics/order.vue @@ -15,7 +15,7 @@ </view> </view> - <view class="square-2"> + <!-- <view class="square-2"> <view class="square-title"> <view class="title-sign"><view class="sign"></view></view> <view class="title-text"><text>鍗曟嵁缂栧彿</text></view> @@ -25,6 +25,23 @@ <input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()" :focus="focus" placeholder-style="line-height: 85rpx;"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons> + </view> + </view> + </view> --> + + <view class="square-2"> + <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"> + <view class="content-input-btn"> + <input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()" + :focus="focus" placeholder-style="line-height: 85rpx;"> + <uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons> + </view> + <view class="content-btn"> + <button class="cu-btn bg-blue pda-btn" @click="selectOrder()">+鎻愬彇</button> </view> </view> </view> @@ -59,6 +76,8 @@ <view class="data-list-left"> <view class="matnr"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view> <view><text style="width: 700rpx;">鍝佸悕锛歿{item.maktx}}</text></view> + <view><text style="width: 700rpx;">鍚堝悓鍙凤細{{item.model}}</text></view> + <view><text style="width: 700rpx;">绠卞彿锛歿{item.xh}}</text></view> <view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view> <view> <text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text> @@ -106,7 +125,7 @@ <view class="num-box"> <uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474" @change="changeValue"/> </view> - <button class="cu-btn" @click="changeMax">max</button> + <!-- <button class="cu-btn" @click="changeMax">max</button> --> </view> <view class="revise-box-buttom"> <view> @@ -144,6 +163,7 @@ check:false, checkText:'鍏ㄩ��', checkedData:[], + matData: '' } }, mounted(){ @@ -159,6 +179,62 @@ // 鑾峰彇url getUrl() { this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl + }, + selectOrder() { + let that = this + uni.vibrateShort(); + uni.navigateTo({ + url: "orderSelect", + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� + acceptDataFromOpenedPage: function(data) { + console.log(data.data); + that.matData = data.data.item + that.orderNo = data.data.orderNo + setTimeout(()=> { + that.findMat1() + },100) + }, + }, + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl }) + }, + + }); + that.matnr = '' + }, + findMat1() { + let that = this + uni.navigateTo({ + url: "orderQuery", + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + matList1: function(data) { + that.checkMat(data.data) + // that.matList.push(data.data) + }, + }, + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� + res.eventChannel.emit('matData', { data: that.matData }) + }, + }); + + }, + checkMat(mat) { + var len = this.matList.length + var add = true + for (var i = 0; i < len; i++) { + if (mat.matnr == this.matList[i].matnr) { + this.matList[i].anfme += mat.anfme + this.$forceUpdate() // 寮哄埗鍒锋柊 + add = false + } + } + if (add) { + this.matList.unshift(mat) + } }, // barcode input 浜嬩欢 barcodeInput() { @@ -339,11 +415,14 @@ let res = result.data if (res.code === 200) { if(res.data) { - uni.showLoading(); - that.matList = res.data; + uni.showLoading(); + // res.data[0].combMats + for (let k in res.data[0].combMats) { + res.data[0].combMats[k]['id'] = k + 1 + } + that.matList = res.data[0].combMats; that.orderNo = that.order that.initAnfme() - console.log(that.matList) } } else if (res.code == 403) { uni.showToast({title: res.msg, icon: "none", position: 'top'}) @@ -542,7 +621,7 @@ } .data-list { border-bottom: 1px solid #d8d8d8; - height: 180rpx; + height: 250rpx; margin: 15rpx; border-radius: 20rpx; } @@ -567,13 +646,13 @@ height: 100%; width: 100rpx; text-align: center; - line-height: 170rpx; + line-height: 250rpx; } .data-list-left { /* background-color: #ffff7f; */ display: inline-block; float: left; - height: 180rpx; + height: 250rpx; width: 500rpx; color: #676767; } @@ -586,7 +665,7 @@ float: right; width: 100rpx; height: 180rpx; - line-height: 180rpx; + line-height: 250rpx; } .data-list-right label { display: inline-block; -- Gitblit v1.9.1