From 5085370bbbce02c5111fa73e75c136f7fcdcbb51 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期三, 01 二月 2023 08:12:51 +0800 Subject: [PATCH] # --- pages/basics/pickOffLines.vue | 118 ++++++++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 88 insertions(+), 30 deletions(-) diff --git a/pages/basics/pickOffLines.vue b/pages/basics/pickOffLines.vue index 273f47f..63cceff 100644 --- a/pages/basics/pickOffLines.vue +++ b/pages/basics/pickOffLines.vue @@ -1,16 +1,32 @@ <template> <view> <scroll-view scroll-y class="scroll-Y"> - <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>鎷h揣鍗曟潯鐮�</text></view> </view> <view class="square-content"> <view class="content-input"> - <input readonly="value" v-model="doc_num" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="8" + <input readonly="value" v-model="doc_num" type="text" placeholder="鎵爜 / 杈撳叆" :focus="barcodeFocus" @input="nextInput"> <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></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>鎷h揣鍗曟潯鐮�</text></view> + </view> + <view class="square-content"> + <view class="content-input-btn"> + <input v-model="doc_num" type="text" placeholder="鎵爜 / 杈撳叆" + :focus="barcodeFocus" @input="nextInput" placeholder-style="line-height: 85rpx;"> + <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons> + </view> + <view class="content-btn"> + <button class="cu-btn bg-blue pda-btn" @click="selectPakin()">+鎻愬彇</button> </view> </view> </view> @@ -55,9 +71,9 @@ <view> <button class="cu-btn lg" @click="resst()">閲嶇疆</button> </view> - <view> + <!-- <view> <button class="cu-btn lg pakin-btn bg-blue" @click="comb()">纭</button> - </view> + </view> --> </view> <!-- 寮瑰嚭灞� --> <view class="popup-mask" v-if="popShow"> @@ -67,13 +83,13 @@ <view class="popup-text-key">鎷h揣鍗曞彿锛�</view> <view>{{doc_num}}</view> </view> - <view class="column"> + <!-- <view class="column"> <view class="popup-text-key">璐ф灦鍙凤細</view> <input type="text"> - </view> + </view> --> <view class="column"> <view class="popup-text-key">搴撲綅鍙凤細</view> - <input type="text"> + <input type="text" v-model="locNo"> </view> <view class="column event"> <view class="close" @click="close">鍙栨秷</view> @@ -91,26 +107,12 @@ commonUrl:null, doc_num: '', barcodeFocus:true, - matList:[ - { - locNo:"010022", - maktx:"灞炴�х敤浜庤缃瓧浣�", - anfme:"9999", - btnType:"default", // default - btnText: '鏈‘璁�', // 鏈‘璁� - }, - { - locNo:"01001", - maktx:"灞炴�х敤浜庤缃瓧浣�", - anfme:"9999", - btnType:"primary", // default - btnText: '宸插嚭搴�', // 鏈‘璁� - } - ], + matList:[], btnType:"primary", // default btnText: '宸插嚭搴�', // 鏈‘璁� popShow:false, index:0, + locNo: '' @@ -137,20 +139,47 @@ getUrl() { this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl }, + // 閫夋嫨璁㈠崟 + selectPakin() { + let that = this + uni.vibrateShort(); + uni.navigateTo({ + url: "pickOffLinesList", + events: { + // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� + acceptDataFromOpenedPage: function(data) { + that.doc_num = data.data + that.nextInput(that.doc_num) + }, + }, + success: function(res) { + // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑 + res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl }) + }, + + }); + }, nextInput() { let that = this uni.request({ - url: 'http://192.168.4.188:8081/sxjzwms/ManPakOut/list/auth', - data:{doc_num:"202209211053"}, + url: that.commonUrl + '/ManPakOut/list/auth', + data:{doc_num:that.doc_num}, header: { 'token':uni.getStorageSync('token'),}, method:'GET', success(result) { + console.log(result); let res = result.data if (res.code === 200) { let records = res.data.records for(var i = 0; i < records.length; i++) { - records[i]['btnType'] = 'default' - records[i]['btnText'] = '鏈‘璁�' + if (records[i].status == 0) { + records[i]['btnType'] = 'default' + records[i]['btnText'] = '鏈‘璁�' + } else if (records[i].status == 1) { + records[i]['btnType'] = 'primary' + records[i]['btnText'] = '宸插嚭搴�' + } + } that.matList = res.data.records } else if (res.code === 403) { @@ -173,10 +202,39 @@ close() { this.popShow = false }, + removeBarcode() { + this.doc_num = '' + }, confirm() { - this.popShow = false - this.matList[this.index].btnText= '宸插嚭搴�' - this.matList[this.index].btnType = 'primary' + let that = this + if(!that.matList[that.index].locNo == that.locNo) { + uni.showToast({title: '璇风‘璁ゅ簱浣嶅彿鏄惁姝g‘', icon: "none", position: 'top'}); + return + } + this.matList[this.index].status= 1 + uni.request({ + url: that.commonUrl + '/manPakOut/finish', + data:JSON.stringify(that.matList[that.index]), + method:'POST', + success(result) { + var res = result.data + if(res.code === 200) { + that.popShow = false + that.matList[that.index].btnText= '宸插嚭搴�' + that.matList[that.index].btnType = 'primary' + } 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'}) + } + } + }) + }, resst() { this.matList = [] -- Gitblit v1.9.1