From e4dc67055ea0c21e72815054c044b56a76ec625e Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期三, 17 四月 2024 13:08:36 +0800 Subject: [PATCH] # --- pages/pakin/goodsDown.vue | 117 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 97 insertions(+), 20 deletions(-) diff --git a/pages/pakin/goodsDown.vue b/pages/pakin/goodsDown.vue index 5d798d0..d5a376d 100644 --- a/pages/pakin/goodsDown.vue +++ b/pages/pakin/goodsDown.vue @@ -11,6 +11,8 @@ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="barcodeFocus" @input="findMat()"> <view class="item-right"> <button></button> + <text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text> + <uni-icons type="right" color="#c1c1c1"></uni-icons> </view> </view> </view> @@ -31,12 +33,12 @@ </view> </view> --> <view class="list-left-item"> - <view class="desc">鏂欏彿锛�</view> + <view class="desc">缂栫爜锛�</view> <view class="left-item"> - <uni-tag :text="item.matnr" type="primary" style="width: 350rpx; overflow: auto;"></uni-tag> + <view class="left-item">{{item.matnr}}</view> </view> </view> - <!-- <view class="list-left-item"> + <view class="list-left-item"> <view class="desc">鍚嶇О锛�</view> <view class="left-item">{{item.maktx}}</view> </view> @@ -50,14 +52,14 @@ <uni-tag :text="item.batch" type="warning"></uni-tag> </view> </view> - <view class="list-left-item"> + <!-- <view class="list-left-item"> <view class="desc">閲嶉噺锛�</view> <view class="left-item"> <uni-tag :text="item.weight" type="warning"></uni-tag> </view> </view> --> <view class="list-left-item"> - <view class="desc">鏁伴噺锛�</view> + <view class="desc">鍏枻锛�</view> <view class="left-item">{{item.anfme}}</view> </view> </view> @@ -86,16 +88,16 @@ style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;"> </view> </view> - <!-- <view class="popup-item"> + <view class="popup-item"> <view class="popup-item-left">鎵瑰彿:</view> <view class="popup-item-right"><input type="text" v-model="batch"></view> - </view> --> - <view class="popup-item"> + </view> + <!-- <view class="popup-item"> <view class="popup-item-left">閲嶉噺:</view> <view class="popup-item-right"><input type="text" v-model="weight"></view> - </view> + </view> --> <view class="popup-item"> - <view class="popup-item-left">鏁伴噺:</view> + <view class="popup-item-left">鍏枻:</view> <view class="popup-item-right" style="border: none;justify-content: center;"> <uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" /> </view> @@ -171,11 +173,34 @@ removeNum: 0 } }, + onShow() { this.baseUrl = uni.getStorageSync('baseUrl'); this.token = uni.getStorageSync('token'); }, methods: { + selectMat() { + let that = this + uni.navigateTo({ + url: "../mat/matQuery", + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('commonUrl', { + commonUrl: '' + }) + }, + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� + acceptDataFromOpenedPage: function(data) { + that.matnr = data.data + that.findMat(that.matnr) + }, + }, + + + }); + that.matnr = '' + }, messageToggle(type) { this.msgType1 = type this.$refs.message.open() @@ -205,15 +230,64 @@ // 鎼滅储鐗╂枡 findMat() { let that = this - if(that.matnr.length < 5){ - that.barcodeFocuss() - return; - } - if(that.orderNo ===''){ - return; - } - that.checkMat({"matnr":that.matnr,"anfme":0,"origin":that.orderNo}) - that.barcodeFocuss() + uni.request({ + url: that.baseUrl + '/mat/auth', + data: { + matnr: that.matnr + }, + header: { + 'token': uni.getStorageSync('token') + }, + 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) { + if(data.data.batch == "" || data.data.batch == null){ + const now = new Date(); + const year = now.getFullYear(); + const month = now.getMonth() + 1; // 鏈堜唤浠�0寮�濮嬶紝闇�瑕佸姞1 + const day = now.getDate(); + data.data.batch = (""+year+month+day) + } + that.checkMat(data.data) + }, + }, + }); + } 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' + }) + } + + } + }); + }, checkMat(mat) { var len = this.dataList.length @@ -377,7 +451,7 @@ box-shadow: 0px 0px 30px 0px rgba(0,0,0,0.2); } .list:first-child { - margin-top: 410rpx; + margin-top:320rpx; } .list:last-child { margin-bottom: 120rpx; @@ -430,4 +504,7 @@ text-align: center; box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5); } + .list-left-item{ + margin-bottom: 2px; + } </style> \ No newline at end of file -- Gitblit v1.9.1