From 321a8a61f3cbc8c0c507d7339e1d46f59ec535c2 Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期一, 09 九月 2024 15:21:24 +0800 Subject: [PATCH] # --- pages/WCS/wcsButton.vue | 206 +++++++++++++++++++++++++++++++++++++++++++++++++++ pages/home/home.vue | 6 static/img/zy_logo.png | 0 pages/login/login.vue | 17 ++++ pages.json | 7 + static/css/wms.css/wms.css | 2 6 files changed, 233 insertions(+), 5 deletions(-) diff --git a/pages.json b/pages.json index bd43719..edf5ace 100644 --- a/pages.json +++ b/pages.json @@ -189,6 +189,13 @@ "navigationBarTitleText" : "璁㈠崟缁勬墭", "enablePullDownRefresh" : false } + }, + { + "path" : "pages/WCS/wcsButton", + "style" : + { + "navigationBarTitleText" : "WCS鎸夐挳" + } } ], "globalStyle": { diff --git a/pages/WCS/wcsButton.vue b/pages/WCS/wcsButton.vue new file mode 100644 index 0000000..1ac189c --- /dev/null +++ b/pages/WCS/wcsButton.vue @@ -0,0 +1,206 @@ +<template> + <view> + <scroll-view scroll-y class="page"> + <view class="tag-list"> + <picker mode="selector" :range="list" @change="onChange($event)"> + <view class="picker"> + {{sta}} 鍙犵洏鏈� + </view> + </picker> + + </view> + <view class="tag-list"> + <button type="primary" @click="stackBack">绌烘澘鍥為��</button> + </view> + <view class="tag-list"> + <button type="primary" @click="stackOut">鍙犵洏鍑哄簱</button> + </view> + <view class="tag-list"> + <button type="primary" @click="stackOut2">鍙犳弧鍏ュ簱</button> + </view> + + </scroll-view> + </view> + +</template> + +<script> + export default { + data() { + return { + wcsbaseUrl:'', + list:["114","103"], + sta:'103', + msgType: 'success', + messageText: '', + title: '', + content: '', + } + }, + onShow() { + this.wcsbaseUrl = uni.getStorageSync('wcsBaseUrl'); + }, + methods: { + onChange(e) { + this.sta = this.list[e.detail.value]; + }, + stackBack(){ + var that = this + uni.showModal({ + title:'鎻愮ず', + content: that.sta+'绔欑‘璁ゆ墽琛岀┖鏉垮洖閫�鍚楋紵', + success: (res) => { + if (res.confirm) { + uni.request({ + url: that.wcsbaseUrl + '/console/stackBack', + data: JSON.stringify({ + devpNo: that.sta + }), + method: 'POST', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { + uni.showToast({ + title:'鎿嶄綔鎴愬姛', + icon:'success', + duration:2000 + }) + } else if (res.code == 403) { + that.messageText = res.msg + that.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({ + title:'鎿嶄綔澶辫触', + icon:'error', + duration:2000 + }) + } + } + }); + } else if (res.cancel) { + } + } + }) + }, + stackOut(){ + var that = this + var devpNo = that.sta == '103'?'123':'122' + uni.showModal({ + title:'鎻愮ず', + content: that.sta+'绔欑‘璁ゆ墽琛屽彔鐩樺嚭搴撳悧锛�', + success: (res) => { + if (res.confirm) { + uni.request({ + url: that.wcsbaseUrl + '/console/stackOut', + data: JSON.stringify({ + devpNo: devpNo + }), + method: 'POST', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { + uni.showToast({ + title:'鎿嶄綔鎴愬姛', + icon:'success', + duration:2000 + }) + } else if (res.code == 403) { + that.messageText = res.msg + that.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({ + title:'鎿嶄綔澶辫触', + icon:'error', + duration:2000 + }) + } + } + }); + } else if (res.cancel) { + } + } + }) + }, + stackOut2(){ + var that = this + var devpNo = that.sta == '103'?'104':'115' + uni.showModal({ + title:'鎻愮ず', + content: that.sta+'绔欑‘璁ゆ墽琛屽彔婊″叆搴撳悧锛�', + success: (res) => { + if (res.confirm) { + uni.request({ + url: that.wcsbaseUrl + '/console/stackOut', + data: JSON.stringify({ + devpNo: devpNo + }), + method: 'POST', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { + uni.showToast({ + title:'鎿嶄綔鎴愬姛', + icon:'success', + duration:2000 + }) + } else if (res.code == 403) { + that.messageText = res.msg + that.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({ + title:'鎿嶄綔澶辫触', + icon:'error', + duration:2000 + }) + } + } + }); + } else if (res.cancel) { + } + } + }) + }, + } + } +</script> + +<style> +.tag-list { + width: 94%; + min-height: 30px; + margin: 10px auto; + background-color: #FFF; + border-radius: 5px; + box-shadow: 0 5upx 20upx rgba(0, 0, 0, 0.2); + } + .picker { + border-radius: 5px; + padding: 10px; + background-color: #fff; + text-align: center; + } +</style> diff --git a/pages/home/home.vue b/pages/home/home.vue index 5a75c3f..da32b0d 100644 --- a/pages/home/home.vue +++ b/pages/home/home.vue @@ -32,11 +32,11 @@ url: '/pakin/pakin' }, { - title: '鎷f枡绔欏埌绔�', - name: 'leftover', + title: 'WCS鎸夐挳', + name: 'wcsButton', color: 'orange', cuIcon: 'pullup', - url: '/pakin/leftovers' + url: '/WCS/wcsButton' }, // { // title: '鍐嶆鎷f枡', diff --git a/pages/login/login.vue b/pages/login/login.vue index f4c7aca..bfa5bf0 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -9,7 +9,7 @@ <!-- logo --> <view class="logo"> <view class="logo-box"> - <image src="../../static/img/logo.png" mode="aspectFit"></image> + <image src="../../static/img/zy_logo.png" mode="aspectFit"></image> </view> </view> <view class="content"> @@ -76,6 +76,18 @@ <view class="popup-item-left">椤圭洰:</view> <view class="popup-item-right"><input type="text" v-model="url.project"></view> </view> + <view class="popup-item"> + <view class="popup-item-left">WCSIP:</view> + <view class="popup-item-right"><input type="text" v-model="url.wcsIp"></view> + </view> + <view class="popup-item"> + <view class="popup-item-left">WCS绔彛:</view> + <view class="popup-item-right"><input type="text" v-model="url.wcsPort"></view> + </view> + <view class="popup-item"> + <view class="popup-item-left">WCS椤圭洰:</view> + <view class="popup-item-right"><input type="text" v-model="url.wcsProject"></view> + </view> <view class="btn"> <view class="btn-left" @click="close">鍙栨秷</view> <view class="btn-right" @click="settingConfirm">纭</view> @@ -116,6 +128,7 @@ project: '' }, baseUrl: '', + wcsBaseUrl: '', user: { userName: '', password: '', @@ -166,7 +179,9 @@ // 淇濆瓨ip settingConfirm() { this.baseUrl = "http://" + this.url.ip + ':' + this.url.port + '/' + this.url.project + this.wcsBaseUrl = "http://" + this.url.wcsIp + ':' + this.url.wcsPort + '/' + this.url.wcsProject uni.setStorageSync('baseUrl', this.baseUrl); + uni.setStorageSync('wcsBaseUrl',this.wcsBaseUrl) uni.setStorageSync('url', this.url); this.$refs.inputDialog.close() }, diff --git a/static/css/wms.css/wms.css b/static/css/wms.css/wms.css index 34210d6..1622e8a 100644 --- a/static/css/wms.css/wms.css +++ b/static/css/wms.css/wms.css @@ -77,7 +77,7 @@ font-size: 14px; } .popup-item-left { - width: 16vw; + width: 18vw; padding-right: 20rpx; text-align: right; color: #606266; diff --git a/static/img/zy_logo.png b/static/img/zy_logo.png new file mode 100644 index 0000000..a5cb3ca --- /dev/null +++ b/static/img/zy_logo.png Binary files differ -- Gitblit v1.9.1