From edeae69c3120490918dd175c1d502c23f58bb48f Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期二, 19 十一月 2024 16:42:02 +0800
Subject: [PATCH] #
---
pages/order/orderPutOn.vue | 96 +++++++++++++++++++++++++-----------------------
1 files changed, 50 insertions(+), 46 deletions(-)
diff --git a/pages/order/orderPutOn.vue b/pages/order/orderPutOn.vue
index f6204f3..5d537d6 100644
--- a/pages/order/orderPutOn.vue
+++ b/pages/order/orderPutOn.vue
@@ -2,16 +2,16 @@
<view>
<view class="code">
<view class="item">
- <view class="code-decs">搴撲綅鍙�:</view>
- <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
- @input="barcodeInput()">
- </view>
- <view class="item">
<view class="code-decs">鐗╂枡鍙�:</view>
<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()">
<view class="item-right">
<button></button>
</view>
+ </view>
+ <view class="item">
+ <view class="code-decs">搴撲綅鍙�:</view>
+ <input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus">
+ <button v-show="recommendLocs.length" size="mini" type="primary" @click="toggle('right')">鎺ㄨ崘</button>
</view>
</view>
<view class="mat-list-title">
@@ -141,6 +141,14 @@
<uni-popup-message :type="msgType1" :message="messageText" :duration="2000"></uni-popup-message>
</uni-popup>
</view>
+ <view>
+ <!-- 鏅�氬脊绐� -->
+ <uni-popup ref="popup" background-color="#fff">
+ <scroll-view scroll-y="true" class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
+ <view class="recommend" v-for="item in recommendLocs" @click="chose(item)"> {{ item }}</view>
+ </scroll-view>
+ </uni-popup>
+ </view>
</view>
</template>
@@ -165,10 +173,12 @@
messageText: '',
title: '',
content: '',
- barcodeFocus: true,
- matFocus: false,
+ barcodeFocus: false,
+ matFocus: true,
matData: '',
- removeNum: 0
+ removeNum: 0,
+ type: 'center',
+ recommendLocs: []
}
},
onShow() {
@@ -212,12 +222,8 @@
that.matnr = matnr[1]
uni.request({
url: that.baseUrl + '/mat/auth',
- data: {
- matnr: that.matnr
- },
- header: {
- 'token': uni.getStorageSync('token')
- },
+ data: { matnr: that.matnr },
+ header: { 'token': uni.getStorageSync('token') },
success(result) {
result = result.data
if (result.code === 200 && result.data) {
@@ -236,33 +242,41 @@
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
events: {
matList: function(data) {
+ that.recommendLoc()
that.checkMat(data.data)
that.focuss()
},
},
});
} else if (result.code == 403) {
- uni.showToast({
- title: result.msg,
- icon: "none",
- position: 'top'
- })
+ uni.showToast({ title: result.msg, icon: "none", position: 'top' })
setTimeout(() => {
- uni.reLaunch({
- url: '../login/login'
- });
+ uni.reLaunch({ url: '../login/login' });
}, 1000);
} else {
- uni.showToast({
- title: result.msg,
- icon: "none",
- position: 'top'
- })
+ uni.showToast({ title: result.msg, icon: "none", position: 'top' })
}
}
});
+ },
+ // 鎺ㄨ崘搴撲綅
+ recommendLoc() {
+ let that = this
+ that.recommendLocs = []
+ uni.request({
+ url: that.baseUrl + '/node/recommendLoc',
+ data: {matnr: that.matnr},
+ header: {'token': uni.getStorageSync('token')},
+ success(res) {
+ res = res.data
+ if (res.code == 200 && res.data) {
+ that.recommendLocs = res.data
+ }
+ }
+
+ })
},
checkMat(mat) {
mat['orderNo'] = this.order
@@ -312,19 +326,16 @@
uni.vibrateShort();
let that = this;
if (that.barcode === '') {
- this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
- this.messageToggle('error')
+ uni.showToast({ title:"璇锋壂鎻忔墭鐩樻潯鐮�", icon: "error", position: 'center' })
return;
}
if (that.dataList.length === 0) {
- this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
- this.messageToggle('error')
+ uni.showToast({ title:"璇锋坊鍔犲晢鍝佸垪琛�", icon: "error", position: 'center' })
return;
}
for (var i = 0; i < that.dataList.length; i++) {
if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
- this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
- this.messageToggle('error')
+ uni.showToast({ title: that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0', icon: "error", position: 'center' })
return;
}
}
@@ -335,26 +346,21 @@
combMats: that.dataList
}),
method: 'POST',
- header: {
- 'token': uni.getStorageSync('token')
- },
+ header: { 'token': uni.getStorageSync('token') },
success(result) {
var res = result.data
if (res.code === 200) {
that.resst();
- that.messageText = "缁勬墭鎴愬姛"
- that.messageToggle('success')
+ uni.showToast({ title:"缁勬墭鎴愬姛", icon: "success", position: 'center' })
} else if (res.code == 403) {
- that.messageText = res.msg
- that.messageToggle('error')
+ uni.showToast({ title: res.msg, icon: "none", position: 'top' })
setTimeout(() => {
uni.reLaunch({
url: '../login/login'
});
}, 1000);
} else {
- that.messageText = res.msg
- that.messageToggle('error')
+ uni.showToast({ title: res.msg, icon: "none", position: 'top' })
}
}
});
@@ -400,16 +406,14 @@
},
// 纭绉婚櫎
removeConfirm(i) {
- this.messageText = "绉婚櫎鎴愬姛"
- this.messageToggle('success')
+ uni.showToast({ title: "绉婚櫎鎴愬姛", icon: "success", position: 'top' })
this.dataList.splice(this.removeNum, 1)
},
reviseConfirm() {
this.dataList[this.rowNum].anfme = this.count
this.dataList[this.rowNum].batch = this.batch
this.dataList[this.rowNum].weight = this.weight
- this.messageText = "淇敼鎴愬姛"
- this.messageToggle('success')
+ uni.showToast({ title: "淇敼鎴愬姛", icon: "success", position: 'top' })
this.$refs.revise.close()
this.$forceUpdate() // 寮哄埗鍒锋柊
},
--
Gitblit v1.9.1