From d6b5426ec33378fbe991beb7cec089fe7e8b2659 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期四, 22 九月 2022 09:33:35 +0800 Subject: [PATCH] #可回退版本 --- pages/basics/stoOut.vue | 157 +++++++++++++++++++++++++++------------------------- 1 files changed, 82 insertions(+), 75 deletions(-) diff --git a/pages/basics/stoOut.vue b/pages/basics/stoOut.vue index 743467f..ecf37fc 100644 --- a/pages/basics/stoOut.vue +++ b/pages/basics/stoOut.vue @@ -39,9 +39,6 @@ <checkbox-group @change="checkbox"> <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > - <!-- <label class="left-check-box"> - <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> - </label> --> <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> @@ -50,40 +47,11 @@ <text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text> </view> </view> - <view class="data-list-right"> - <!-- <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> --> - <!-- list涓垹闄ら敭 --> - <!-- <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> --> - </view> </view> </checkbox-group> - <!-- <view style="margin-top: 10px;"> - <uni-table ref="table" border stripe emptyText="鏆傛棤鏇村鏁版嵁"> - <uni-tr> - <uni-th align="center" width="50">鍑哄簱鏁伴噺</uni-th> - <uni-th align="center" width="70">浜у搧ID</uni-th> - <uni-th align="center" width="80">浜у搧浠e彿</uni-th> - <uni-th align="center" width="70">浜у搧鍚嶇О</uni-th> - </uni-tr> - <uni-tr v-for="(item, index) in matList" :key="index"> - <uni-td align="center">{{item.qty}}</uni-td> - <uni-td align="center">{{item.matNo}}</uni-td> - <uni-td align="center">{{item.size}}</uni-td> - <uni-td align="center">{{item.matName}}</uni-td> - </uni-tr> - </uni-table> - </view> --> <!-- 搴曢儴鎸夐挳 --> <view class="footer flex justify-around"> - <!-- 搴曢儴鍏ㄩ�� 鍙嶉�夋寜閽� --> - <!-- <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 class="label-btn" style="width: 150rpx;"> <button class="cu-btn" @click="resst()">閲嶇疆</button> </label> @@ -105,14 +73,21 @@ siteId: '' } }, - mounted(){ - const UIP = uni.getStorageSync('UIP'); - this.baseIP = UIP; - const UPORT = uni.getStorageSync('UPORT'); - this.basePORT = UPORT; - this.staNoSelect(); - }, + mounted(){ + const UIP = uni.getStorageSync('UIP'); + this.baseIP = UIP; + const UPORT = uni.getStorageSync('UPORT'); + this.basePORT = UPORT + const PROJ = uni.getStorageSync('UPROJ'); + this.baseUrl = PROJ + this.getUrl() + this.staNoSelect(); + }, methods: { + // 鑾峰彇url + getUrl() { + this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl + }, // 娓呯┖鍗曞彿鎼滅储妗� removeLocNo() { this.locNo = null @@ -120,7 +95,7 @@ searchLocNo() { let that = this; uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/locDetl/list/auth", + url: that.commonUrl + "/locDetl/list/auth", header: { 'content-type':"application/x-www-form-urlencoded", 'token':uni.getStorageSync('token') @@ -154,7 +129,7 @@ staNoSelect() { let that = this; uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/available/take/site", + url: that.commonUrl + "/available/take/site", header: {'token':uni.getStorageSync('token')}, success(result) { let res = result.data @@ -178,45 +153,77 @@ }, outbound() { let that = this - if (that.matList.length === 0) { - uni.showToast({title: "璇烽�夋嫨鍑哄簱鍙�", icon: "none",position: 'top'}) - } else { - if (that.siteId == '') { - uni.showToast({title: "璇烽�夋嫨鍑哄簱鍙�", icon: "none",position: 'top'}) - return; - } - }; - var staNo = that.siteId.substring(0,3) - var locDetls = []; - that.matList.forEach(function(elem) { - console.log(elem) - locDetls.push({locNo:elem.locNo,matnr:elem.matnr, batch: elem.batch, count: elem.anfme,}); - }); - let param = { - outSite: staNo, - locDetls: locDetls - } - uni.request({ - url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + "/plate/out/start", - header: { - 'token':uni.getStorageSync('token')}, - data: JSON.stringify(param), - method:"POST", - success(result) { - console.log(result) - if (result.data.code === 200) { - uni.showToast({title: result.data.msg, icon: "none",position: 'top'}) - that.resst() - } else { - uni.showToast({title: result.data.msg, icon: "none",position: 'top'}) - } - } - }) + console.log(that.locNo) + if(that.locNo === ''||that.locNo===null){ + uni.showToast({title: "杈撳叆鏉$爜", icon: "none",position: 'top'}) + return; + } + if (that.siteId === '') { + uni.showToast({title: "璇烽�夋嫨鍑哄簱鍙�", icon: "none",position: 'top'}) + return; + } + + if (that.matList.length === 0) { + var staNo = that.siteId.substring(0,3) + var getlocNo = []; + getlocNo.push(that.locNo); + uni.request({ + url: that.commonUrl + "/empty/pda/plate/out/start", + header: { + 'token':uni.getStorageSync('token')}, + data: { + outSite: staNo, + locNos: getlocNo + }, + method:"POST", + traditional:true, + success(result) { + console.log(result) + if (result.data.code === 200) { + uni.showToast({title: result.data.msg, icon: "none",position: 'top'}) + that.resst() + } else { + uni.showToast({title: result.data.msg, icon: "none",position: 'top'}) + } + } + }) + + }else{ + var staNo = that.siteId.substring(0,3) + var locDetls = []; + that.matList.forEach(function(elem) { + console.log(elem) + locDetls.push({locNo:elem.locNo,matnr:elem.matnr, batch: elem.batch, count: elem.anfme,}); + }); + let param = { + outSite: staNo, + locDetls: locDetls + } + console.log("param") + console.log(param) + uni.request({ + url: that.commonUrl + "/plate/out/start", + header: { + 'token':uni.getStorageSync('token')}, + data: JSON.stringify(param), + method:"POST", + success(result) { + console.log(result) + if (result.data.code === 200) { + uni.showToast({title: result.data.msg, icon: "none",position: 'top'}) + that.resst() + } else { + uni.showToast({title: result.data.msg, icon: "none",position: 'top'}) + } + } + }) + } }, resst() { this.billNo = ''; this.matList = []; this.siteId = ''; + this.locNo = null } } } -- Gitblit v1.9.1