From d6b5426ec33378fbe991beb7cec089fe7e8b2659 Mon Sep 17 00:00:00 2001 From: LSH Date: 星期四, 22 九月 2022 09:33:35 +0800 Subject: [PATCH] #可回退版本 --- pages/basics/stoOut.vue | 349 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 347 insertions(+), 2 deletions(-) diff --git a/pages/basics/stoOut.vue b/pages/basics/stoOut.vue index 02409e3..ecf37fc 100644 --- a/pages/basics/stoOut.vue +++ b/pages/basics/stoOut.vue @@ -1,8 +1,353 @@ <template> + <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"> + <input type="text" v-model="locNo" placeholder="鎵爜 / 杈撳叆" @input="searchLocNo" placeholder-style="line-height: 85rpx;"> + <uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></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="content-combox"> + <uni-combox emptyTips="鏆傛棤鏁版嵁" + :candidates="sites" v-model="siteId" @click="staNoSelect()" placeholder="璇烽�夋嫨鍑哄簱绔欑偣"> + </uni-combox> + </view> + </view> + + <view class="square-1"> + <view class="square-title"> + <view class="title-sign"><view class="sign"></view></view> + <view class="title-text"><text>鍟嗗搧鍒楄〃</text></view> + </view> + + </view> + + <view class="square-none" v-show="matList.length === 0"> + <view class="v-show">鏆傛棤鏇村鏁版嵁...</view> + </view> + + <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"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view> + <view><text style="width: 700rpx;">鍝佸悕锛歿{item.maktx}}</text></view> + <view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view> + <view> + <text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text> + </view> + </view> + </view> + </checkbox-group> + + <!-- 搴曢儴鎸夐挳 --> + <view class="footer flex justify-around"> + <label class="label-btn" style="width: 150rpx;"> + <button class="cu-btn" @click="resst()">閲嶇疆</button> + </label> + <label class="label-btn"> + <button class="cu-btn bg-blue " @click="outbound()">鍚姩鍑哄簱</button> + </label> + </view> + + </view> </template> - + <script> -</script> + export default { + data() { + return { + locNo: null, + matList: [], + sites: [], + siteId: '' + } + }, + 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 + }, + searchLocNo() { + let that = this; + uni.request({ + url: that.commonUrl + "/locDetl/list/auth", + header: { + 'content-type':"application/x-www-form-urlencoded", + 'token':uni.getStorageSync('token') + }, + data: { + curr:1, + limit:10, + // typeCode:1, + loc_no: that.locNo + }, + method:"POST", + success(result) { + console.log(result) + let res = result.data + if (res.code === 200 ) { + that.matList = res.data.records + that.staNoSelect() + } 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'}) + } + }, + }) + }, + staNoSelect() { + let that = this; + uni.request({ + url: that.commonUrl + "/available/take/site", + header: {'token':uni.getStorageSync('token')}, + success(result) { + let res = result.data + if (res.code === 200 ) { + that.sites = []; + for (var i = 0; i < res.data.length; i++) { + that.sites.push(res.data[i].desc) + } + } 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'}) + } + } + }) + }, + outbound() { + let that = this + 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 + } + } + } +</script> + <style> + .pda-btn1 { + margin-left:260rpx; + margin-right: auto; + margin-top: 150rpx; + width: 200rpx; + height: 80rpx; + font-size: 30upx; + font-weight: bold; + } + .combox { + width: 200px; + padding: 12px; + } + .bg-false { + background-color: #FFFFFF; + } + .bg-true { + background-color: #ebebeb; + } + .data-list { + border-bottom: 1px solid #d8d8d8; + height: 180rpx; + width: 94%; + margin: 15rpx auto 15rpx auto; + border-radius: 20rpx; + } + .data-list:first-child { + margin-top: 20rpx; + } + .data-list:last-child { + margin-bottom: 160rpx; + } + /* .data-list-left { + display: inline-block; + float: left; + text-align: center; + width: 100rpx; + height: 180rpx; + line-height: 180rpx; + } */ + .left-check-box { + display: inline-block; + /* background-color: #1E9FFF; */ + float: left; + height: 100%; + width: 100rpx; + text-align: center; + line-height: 170rpx; + } + .data-list-left { + /* background-color: #ffff7f; */ + display: inline-block; + float: left; + height: 180rpx; + width: 500rpx; + color: #676767; + text-indent: 20rpx; + } + .matnr { + padding-top: 10rpx; + } + .data-list-right { + /* background-color: #55ffff; */ + display: inline-block; + float: right; + width: 100rpx; + height: 180rpx; + line-height: 180rpx; + } + .data-list-right label { + display: inline-block; + float: left; + width: 100rpx; + height: 180rpx; + } + .revise-box { + width: 500rpx; + height: 500rpx; + } + .revise-box-top { + width: 100%; + height: 100rpx; + background-color: #fff; + padding: 10rpx; + } + .changeBox { + width: 100%; + height: 100rpx; + line-height: 120rpx; + text-align: center; + background-color: #FFF; + margin-top: 20rpx; + border-bottom: 1px solid #e3e3e3; + } + .text-box { + width: 100%; + height: 100rpx; + line-height: 120rpx; + text-align: center; + /* padding-left: 120rpx; */ + background-color: #FFF; + margin-top: 20rpx; + border-bottom: 1px solid #e3e3e3; + } + .changeBox .num-box { + display: inline-block; + float: left; + } + .changeBox button { + float: left; + } + .revise-box-buttom { + position: absolute; + width: 100%; + height: 100rpx; + line-height: 100rpx; + background-color: #FFFFFF; + bottom: 0; + text-align: center; + } </style> \ No newline at end of file -- Gitblit v1.9.1