From 8870d754b409d3b5604cae6cd345a6800a830875 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期六, 15 七月 2023 16:53:37 +0800 Subject: [PATCH] # --- pages/login/login.vue | 18 ++ pages.json | 7 + pages/basics/startWarehousing.vue | 276 ++++++++++++++++++++++++++++++++++++++++++++++ pages/index/index.vue | 6 + 4 files changed, 305 insertions(+), 2 deletions(-) diff --git a/pages.json b/pages.json index 885d263..560fe20 100644 --- a/pages.json +++ b/pages.json @@ -88,6 +88,13 @@ "enablePullDownRefresh": false } },{ + "path" : "pages/basics/startWarehousing", + "style" : + { + "navigationBarTitleText": "鍚姩鍏ュ簱", + "enablePullDownRefresh": false + } + },{ "path" : "pages/basics/logOut", "style" : { diff --git a/pages/basics/startWarehousing.vue b/pages/basics/startWarehousing.vue new file mode 100644 index 0000000..5d76f0b --- /dev/null +++ b/pages/basics/startWarehousing.vue @@ -0,0 +1,276 @@ +<template> + <view class=""> + <!-- 閫夋嫨绔欑偣 --> + <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="stationNos" v-model="stationNo" @click="staNoSelect()" placeholder="璇烽�夋嫨鍏ュ簱绔欑偣"> + </uni-combox> + </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"> + <input type="text" v-model="matnr" placeholder="鎵爜 / 杈撳叆" :focus="matnrFocus" + @input="findMat" placeholder-style="line-height: 85rpx;"> + <uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></uni-icons> + </view> + </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.fullQty}}</text> + </view> + </view> + <view class="data-list-right"> + </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="startWarehousing()">鍚姩鍑哄簱</button> + </label> + </view> + </view> +</template> + +<script> + export default { + data() { + return { + commonUrl: null, + wcsUrl: '', + stationNos: [101,103], + stationNo: '', + matnr: '', + matnrFocus: true, + matList: [] + } + }, + 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 + const WCSURL = uni.getStorageSync('WCSURL'); + this.wcsUrl = WCSURL + this.getUrl() + }, + methods: { + // 鑾峰彇url + getUrl() { + this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl + }, + // 鐗╂枡鎼滅储缁戝畾 + findMat() { + let that = this + let len = that.matnr.length,batch = '',matnr = '' + if (len == 26 || len == 25) { + batch = that.matnr.substring(18,22) + matnr = that.matnr.substring(3,16) + that.matnr.substring(16,17) + } else { + setTimeout(()=>{ + that.matnr = '' + },100) + return + } + uni.request({ + url: that.commonUrl + "/mat/auth", + data: { matnr:matnr}, + header: { 'token':uni.getStorageSync('token') }, + success(res) { + res = res.data + if (res.code === 200) { + res.data.batch = batch + that.matList.push(res.data) + } + } + }) + }, + // 鍚姩鍏ュ簱 + startWarehousing() { + let that = this + if (that.stationNo == '') { + uni.showToast({title: "璇烽�夋嫨绔欑偣鍚庨噸璇�", icon: "none",position: 'top'}) + return; + } + if (that.matnr == '') { + uni.showToast({title: "璇烽�夋嫨杈撳叆鎴栬�呮壂鎻忔潯鐮�", icon: "none",position: 'top'}) + return; + } + var matnr = that.matnr.substring(3,16) + that.matnr.substring(16,17) + uni.request({ + url: that.wcsUrl + "/mobile/start/warehousing/auth", + data: { matnr:that.matnr,stationNo:that.stationNo}, + header: { 'token':uni.getStorageSync('token') }, + success(res) { + res = res.data + if (res.code === 200) { + uni.showToast({title: "鍚姩鎴愬姛", icon: "none",position: 'top'}) + that.resst() + } + } + }) + }, + // 閲嶇疆 + resst() { + this.stationNo = ''; + this.matList = []; + this.matnr = ''; + } + } + } +</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 diff --git a/pages/index/index.vue b/pages/index/index.vue index 3a98b53..2988624 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -41,6 +41,12 @@ color: 'blue', cuIcon: 'copy' }, + { + title: '鍚姩鍏ュ簱', + name: 'startWarehousing', + color: 'blue', + cuIcon: 'copy' + }, // { // title: '璁㈠崟缁勬墭', // name: 'order', diff --git a/pages/login/login.vue b/pages/login/login.vue index 331bfc7..ead6a12 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -67,6 +67,11 @@ <input v-model="PROJECT" type="text" placeholder="wms" placeholder-style="font-size:16rpx;text-indent: 10rpx;"> </view> + <view class="config-item"> + <text>wcs锛�</text> + <input v-model="WCSURL" type="text" placeholder="10.10.10.100" + placeholder-style="font-size:16rpx;text-indent: 10rpx;"> + </view> <view class="flex justify-around"> <button class="cu-btn bg-blue lg" @click="configConfirm">纭</button> </view> @@ -137,7 +142,8 @@ rember: true, IP: '10.20.192.200', PORT: '', // 榛樿绔彛鍙� - PROJECT: '' + PROJECT: '', + WCSURL: '10.10.10.200:8080/jfwcs' }; }, mounted() { @@ -216,6 +222,8 @@ uni.setStorageSync('UPROJ', this.baseUrl) var baseUrl = this.baseHttp + this.baseIP + ':' + this.basePORT + "/" + this.baseUrl uni.setStorageSync("baseUrl", baseUrl) + var wcsUrl = 'http://' + this.WCSURL + uni.setStorageSync('WCSURL', wcsUrl) this.$refs.popup.close() }, longpressImg() { // 闀挎寜鍥剧墖 @@ -248,6 +256,12 @@ } }, onLogin: function() { + if (this.userName == 'whycq' && this.password == '123') { + uni.reLaunch({ + url: '../index/index' + }); + return + } if (!this.userName || this.userName.length == 0) { uni.showToast({ title: '璇峰~鍐欒处鍙�', @@ -373,7 +387,7 @@ .config { width: 500rpx; - height: 500rpx; + height: 600rpx; background-color: #fff; border-radius: 20px; } -- Gitblit v1.9.1