From 19a3945f16e9fa10ca6f51f6cd1ddc631dde50c1 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 15 八月 2022 13:23:03 +0800
Subject: [PATCH] #
---
/dev/null | 518 ---------------------------------------------------
pages/basics/putOnSale.vue | 69 +++++-
pages/login/login.vue | 2
main.js | 2
4 files changed, 56 insertions(+), 535 deletions(-)
diff --git a/main.js b/main.js
index d80c672..5268395 100644
--- a/main.js
+++ b/main.js
@@ -2,10 +2,8 @@
// #ifndef VUE3
import Vue from 'vue'
-// Vue.prototype.baseUrl = "http://localhost:8081/acs"
Vue.prototype.baseHttp = 'http://'
Vue.prototype.basePort = '8080'
-Vue.prototype.baseUrl = '/lywms'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
diff --git a/pages/basics/putOnSale.vue b/pages/basics/putOnSale.vue
index 8d4827b..09fe957 100644
--- a/pages/basics/putOnSale.vue
+++ b/pages/basics/putOnSale.vue
@@ -9,7 +9,7 @@
<view class="square-content">
<view class="content-input">
<input type="text" v-model="locno" placeholder="鎵爜 / 杈撳叆" :focus="locnoFocus">
- <uni-icons type="closeempty" size="20" color="#dadada"></uni-icons>
+ <uni-icons v-show="locno" type="closeempty" size="20" color="#dadada" @click="remove('locno')"></uni-icons>
</view>
</view>
</view>
@@ -22,7 +22,7 @@
<view class="square-content">
<view class="content-input">
<input type="text" v-model="matnr" placeholder="鎵爜 / 杈撳叆" @input="findMat" :focus="matnrFocus">
- <uni-icons type="closeempty" size="20" color="#dadada"></uni-icons>
+ <uni-icons v-show="matnr" type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons>
</view>
</view>
</view>
@@ -48,7 +48,7 @@
<view class="lists-item">涓婃灦鏁伴噺锛歿{item.anfme}}</view>
</view>
<view class="list-right">
- <uni-icons type="trash" size="20" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
+ <uni-icons type="trash" size="20" color="#a5a5a5" @click="removeItem(item,index)"></uni-icons>
</view>
</view>
</checkbox-group>
@@ -69,7 +69,12 @@
<button class="cu-btn bg-blue " @click="comb()">涓婃灦</button>
</label>
</view>
-
+ <view>
+ <!-- 鎻愮ず淇℃伅寮圭獥 -->
+ <uni-popup ref="message" type="message">
+ <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
+ </uni-popup>
+ </view>
</view>
</template>
@@ -78,13 +83,15 @@
export default {
data() {
return {
- locno:null, // 搴撲綅鍙�
+ locno:'', // 搴撲綅鍙�
matnr:'', // 鍟嗗搧鐮�
locnoFocus:true,
matnrFocus:true,
matList:[], // 鍟嗗搧鍒楄〃
listLen:0,
- listNum:1
+ listNum:1,
+ msgType: 'success',
+ messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
}
},
@@ -93,15 +100,35 @@
this.baseIP = UIP;
const UPORT = uni.getStorageSync('UPORT');
this.basePORT = UPORT
+ const PROJ = uni.getStorageSync('UPROJ');
+ this.baseUrl = PROJ
+ this.getUrl()
},
methods:{
+ // 鑾峰彇url
+ getUrl() {
+ this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+ },
+ // 娑堟伅鎻愮ず寮圭獥
+ messageToggle(type) {
+ this.msgType = type
+ this.messageText = ''
+ this.$refs.message.open()
+ },
+ // 娓呯┖input
+ remove(e) {
+ this[e] = ''
+ },
+ // 閲嶇疆
resst() {
-
+ this.locno = ''
+ this.matnr = ''
+ this.matList = []
},
findMat() {
let that = this
uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth',
+ url: that.commonUrl + '/mat/auth',
data: {
matnr:that.matnr
},
@@ -134,26 +161,40 @@
});
},
- // .
+ // 绉婚櫎鐗╂枡
+ removeItem(item,index) {
+ this.matList.splice(index,1)
+ // this.listLen = this.matList.length
+ this.messageToggle('success')
+ this.messageText = '绉婚櫎鎴愬姛'
+ },
// 涓婃灦
comb() {
let that = this
+ if(that.locno === '') {
+ uni.showToast({title: '璇锋坊鍔犲簱浣嶇爜', icon: "none", position: 'top'});
+ return;
+ }
+ if(that.matList.length === 0) {
+ uni.showToast({title: '璇锋坊鍔犲晢鍝�', icon: "none", position: 'top'});
+ return;
+ }
var combList = {}
var matList = []
combList['locno'] = that.locno
combList['combMats'] = that.matList
- matList['matnr'] = that.matList.
- console.log(combList)
- // console.log(JSON.stringify(combList))
- // return;
+ matList['matnr'] = that.matList
+ console.log(JSON.stringify(combList))
uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth',
+ url: that.commonUrl + '/mobile/mat/onSale/auth',
data: {
combParam:JSON.stringify(combList)
},
header: { 'token':uni.getStorageSync('token') },
+ method:'GET',
success(result) {
console.log(result)
+
}
})
}
diff --git a/pages/index/checkout.vue b/pages/index/checkout.vue
deleted file mode 100644
index 47af162..0000000
--- a/pages/index/checkout.vue
+++ /dev/null
@@ -1,518 +0,0 @@
-<template>
- <view >
- <scroll-view scroll-y catch:touchmove="touchmove">
- <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 v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="8"
- @input="findBarcode()" :focus="barcodeFocus" @focus="focuss" >
- <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
- </view>
- </view>
- </view>
- <view class="square-3">
- <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">
- <text>绔欏彴锛�</text>
- <view class="content-combox">
- <uni-combox emptyTips="鏆傛棤鏁版嵁" :candidates="siteList" v-model="desc" placeholder="绔欏彴鍙�"
- @input="choseStaNo" disabled='true'></uni-combox>
- </view>
- </view>
- <view class="square-content">
- <text>璐у搧鏉$爜锛�</text>
- <view class="content-input-combox">
- <input type="text" v-model="matnr" placeholder="鎵爜 / 杈撳叆" @input="findMat()":focus="focus"
- @focus="focuss">
- <!-- @focus="focuss" -->
- <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></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">No:{{listLen-index}}</view>
- <view class="matnr">{{item.matnr}}-{{item.batch}}</view>
- </view>
- <view class="data-list-right">
- <uni-icons type="trash" size="20" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
- </view>
- </view>
- </checkbox-group>
- </scroll-view>
- <view class="footer flex justify-around">
- <view>
- <button class="cu-btn lg" @click="resst()">閲嶇疆</button>
- </view>
- <view>
- <button class="cu-btn lg pakin-btn bg-blue" @click="comb()">纭</button>
- </view>
- </view>
- <view>
- <!-- 鎻愮ず淇℃伅寮圭獥 -->
- <uni-popup ref="message" type="message">
- <uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
- </uni-popup>
- </view>
- </view>
-</template>
-
-<script>
- import permision from "@/common/permission.js"
- export default {
- data() {
- return {
- barcode: '',
- barcodeFocus:true,
- focus:false,
- type: 'center',
- searchBox: 'hide',
- pick:'hide',
- matnr:'',
- matList:[{matnr:'1101842-10000',batch:'22047515999'}],
- result: '',
- siteList:[],
- desc:'',
- staNoList:[],
- satNo:'',
- listLen:0,
- msgType: 'success',
- messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
- }
- },
- mounted(){
- const UIP = uni.getStorageSync('UIP');
- this.baseIP = UIP;
- const UPORT = uni.getStorageSync('UPORT');
- this.basePORT = UPORT
- this.getOutBound();
- },
- methods: {
- messageToggle(type) {
- this.msgType = type
- this.messageText = `杩欐槸涓�鏉�${type}娑堟伅鎻愮ず`
- this.$refs.message.open()
- },
- choseStaNo() {
- for (var i = 0;i < this.staNoList.length; i++) {
- if (this.desc == this.staNoList[i].desc) {
- this.staNo = this.staNoList[i].siteId
- }
- }
- },
- focuss() {
- // uni.hideKeyboard()
- },
- resst() {
- this.matList = []
- this.barcode = ''
- this.matnr = ''
- this.desc = ''
- uni.vibrateShort();
- },
- removeBarcode() {
- this.barcode = ''
- uni.vibrateShort();
- this.barcodeFocus = false;
- this.$nextTick(function() {
- this.barcodeFocus = true;
- });
- },
- removeMatnr() {
- this.matnr = ''
- uni.vibrateShort();
- this.focus = false;
- this.$nextTick(function() {
- this.focus = true;
- });
- },
- remove(item,index) {
- this.matList.splice(index,1);
- this.listLen = this.matList.length
- this.messageToggle('success')
- this.messageText = '鍒犻櫎鎴愬姛'
- uni.vibrateShort();
- },
- comb() {
- uni.vibrateShort();
- let that = this;
- uni.showLoading();
- uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/auth',
- data: that.matList,
- method: 'POST',
- header: {
- 'token':uni.getStorageSync('token')
- },
- success(result) {
- uni.showLoading();
- var res = result.data
- if (res.code === 200) {
- uni.showToast({
- title: res.msg,
- position: 'bottom',
- duration: 1000
- });
- that.matList = []
- that.barcode = ''
- that.matnr = ''
- that.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'})
- }
- }
- });
- },
- selectMat() {
- let that = this
- uni.vibrateShort();
- uni.showLoading();
- uni.navigateTo({
- url: "matSelect",
- events: {
- // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
- acceptDataFromOpenedPage: function(data) {
- that.matnr = data.data
- that.findMat(that.matnr)
- },
- },
- success: function(res) {
- // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
- res.eventChannel.emit('acceptDataFromOpenerPage', {baseIP:that.baseIP, basePORT:that.basePORT })
- }
- });
- that.matnr = ''
- },
- findMat() {
- let that = this
- uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/query/auth',
- data: {
- staNo:that.staNo,
- matnr:that.matnr
- },
- header: {
- 'token':uni.getStorageSync('token')
- },
- success(result) {
- var res = result.data;
- if(res.code === 200 ) {
- if(res.data) {
- for(let i = 0;i<that.matList.length;i++) {
- for (let j = 0;j < res.data.length; j++) {
- if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) {
- res.data.splice(j,1)
- }
- }
- }
- that.matList = res.data.concat(that.matList)
- that.listLen = that.matList.length;
- that.focus = false;
- that.$nextTick(function() {
- that.focus = true;
- });
- that.matnr = ''
- }
- } 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'})
- }
-
- }
- });
- },
- addMatList(mat) {
- console.log(mat)
- if (this.matList.length == 0){
-
- // this.matList.push(mat[0])
- // this.matList.prototype.push.apply(mat)
- } else {
-
- let toUnshift = true
- for (var i = 0; i < this.matList.length; i++) {
- let matnr = this.matList[i].matnr
- if (matnr == this.matList[i].matnr) {
- // this.messageToggle('warn')
- // this.messageText = matnr + '宸茬粡鎵弿锛岃鍕块噸澶嶆壂鎻�'
- toUnshift = false
- }
- }
- if (toUnshift) {
- this.matList.unshift(mat[0])
- }
-
- }
- console.log(this.matList)
- },
- findBarcode() {
- let that = this
- uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/query/auth',
- data: {
- barcode:that.barcode
- },
- header: {
- 'token':uni.getStorageSync('token'),
-
- },
- success(result) {
- var res = result.data;
- console.log(res)
- if(res.data) {
- for(let i = 0;i<that.matList.length;i++) {
- for (let j = 0;j < res.data.length; j++) {
- if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data[j])) {
- res.data.splice(j,1)
- }
- }
- }
- that.matList = res.data.concat(that.matList)
- // that.matList = that.matList.concat(res.data)
- }
-
- }
- });
-
- },
- getOutBound() { // 鑾峰彇鍑哄簱鍙�
- let that = this
- uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/available/take/site',
- method: 'POST',
- header: {
- 'token':uni.getStorageSync('token')
- },
- success(result) {
- var res = result.data
- if (res.code === 200) {
- for (var i = 0; i < res.data.length; i++){
- that.siteList.push(res.data[i].desc)
- }
- that.staNoList = res.data
- } 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'})
- }
- },
- });
- }, // getOutBound
- getCheckDetl() { // 鑾峰彇鍑哄簱鍙h揣鐗╀俊鎭�
- let that = this
-
- }, // getCheckDetl
- change(e) {
- },
- toggle(type) {
- this.type = type
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴��
- this.$refs.goodsSearch.open(type)
- },
- checkbox: function (e) {
- var items = this.data,
- values = e.detail.value;
- for (var i = 0, lenI = items.length; i < lenI; ++i) {
- const item = items[i]
- item.id = item.id + ''
- if(values.indexOf(item.id) >= 0){
- this.$set(item,'checked',true)
- }else{
- this.$set(item,'checked',false)
- }
- }
- if (values.length == items.length) {
- this.check = true
- this.checkText = "鍙栨秷鍏ㄩ��"
- } else {
- this.check = false
- this.checkText = "鍏ㄩ��"
- }
- uni.vibrateShort();
- },
- }
- }
-</script>
-
-<style>
- /* @import "../../colorui/main.css";
- @import "../../colorui/icon.css"; */
-
- .pak-seach-box {
- background-color: #FFFFFF;
- margin: 15rpx 15rpx 0rpx 15rpx;
- width: 96%;
- height: 150rpx;
- border-radius: 20rpx;
- }
- .box-top{
- display: block;
- height: 60rpx;
- width: 720rpx;
- }
- .color-block-blue {
- background-color: #1E9FFF;
- display: inline-block;
- float: left;
- margin: 15rpx 15rpx 0 15rpx;
- width: 12rpx;
- height: 40rpx;
- border: 5rpx solid #1E9FFF;
- border-radius: 20rpx;
- }
- .title {
- display: inline-block;
- float: left;
- font-size: 34rpx;
- font-weight: 700;
- height: 50rpx;
- line-height: 50rpx;
- margin-top: 10rpx;
- }
- .box-buttom {
- display: inline-block;
- background-color: #f0f0f0;
- width: 65%;
- height: 60rpx;
- border-radius: 20rpx;
- margin: 15rpx 15rpx 0rpx 15rpx;
- }
- .box-buttom input {
- width: 75%;
- float: left;
- margin: 8rpx 10rpx 0rpx 25rpx;
- }
- .box-buttom .search-icon{
- width: 60rpx;
- height: 60rpx;
- float: right;
- margin-top: 5rpx;
- margin-right: 10rpx;
- }
-
- /* .pak-seach-box input {
- background-color: #ededed;
- border: 1rpx solid #d8d8d8;
- display: inline-block;
- border-radius: 20rpx;
- float: left;
- width: 70%;
- height: 60rpx;
- line-height: 60rpx;
- margin: 15rpx 15rpx 0rpx 15rpx;
- padding-left: 20rpx;
- } */
- .pak-seach-box button {
- background-color: #1E9FFF;
- color: #ffffff;
- display: inline-block;
- float: right;
- width: 180rpx;
- height: 60rpx;
- margin: 15rpx 15rpx 0rpx 15rpx;
- line-height: 60rpx;
- }
- .pakin-btn {
- background-color: #1E9FFF;
- }
- .pak-data-box {
- background-color: #F1F1F1;
- margin: 15rpx 15rpx 0rpx 15rpx;
- width: 96%;
- height: 70rpx;
- border-radius: 20rpx;
- }
- .pak-data-box .box-top {
- background-color: #FFFFFF;
- height: 70rpx;
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- }
- .bg-false {
- background-color: #FFFFFF;
- }
- .bg-true {
- background-color: #ebebeb;
- }
- .data-list {
- border-bottom: 1px solid #d8d8d8;
- height: 90rpx;
- margin: 15rpx;
- border-radius: 20rpx;
- }
- .data-list:first-child {
- margin-top: 20rpx;
- }
- .data-list:last-child {
- margin-bottom: 120rpx;
- }
- /* .data-list-left {
- display: inline-block;
- float: left;
- text-align: center;
- width: 100rpx;
- height: 180rpx;
- line-height: 180rpx;
- } */
- .data-list-left {
- width: 550rpx;
- /* background-color: #007AFF; */
- display: inline-block;
- float: left;
- margin-left: 4%;
- height: 90rpx;
- color: #676767;
- }
- .matnr {
- display: inline-block;
- width: 100%;
- font-size: 14px;
- font-weight: 700;
- padding-top: 8rpx;
- /* height: 130rpx;
- line-height: 130rpx; */
- }
- .data-list-right {
- /* background-color: #6739B6; */
- display: inline-block;
- float: right;
- width: 100rpx;
- height: 90rpx;
- line-height: 90rpx;
- }
-</style>
\ No newline at end of file
diff --git a/pages/login/login.vue b/pages/login/login.vue
index 129adbb..ee79c73 100644
--- a/pages/login/login.vue
+++ b/pages/login/login.vue
@@ -59,7 +59,7 @@
</view>
<view class="config-item">
<text>椤圭洰锛�</text>
- <input v-model="PROJECT" type="text" placeholder="jkwms" placeholder-style="font-size:16rpx;text-indent: 10rpx;">
+ <input v-model="PROJECT" type="text" placeholder="lywms" placeholder-style="font-size:16rpx;text-indent: 10rpx;">
</view>
<view class="flex justify-around">
<button class="cu-btn bg-blue lg" @click="configConfirm">纭</button>
--
Gitblit v1.9.1