From 083c7d3d49b72913bde962c4b91feb881f068649 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 18 三月 2024 14:38:55 +0800
Subject: [PATCH] #
---
pages/basics/order.vue | 113 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 99 insertions(+), 14 deletions(-)
diff --git a/pages/basics/order.vue b/pages/basics/order.vue
index 5c0b039..80f81af 100644
--- a/pages/basics/order.vue
+++ b/pages/basics/order.vue
@@ -9,13 +9,13 @@
<view class="square-content">
<view class="content-input">
<input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="10"
- :focus="barcodeFocus" @input="barcodeInput">
+ :focus="barcodeFocus" @input="barcodeInput" placeholder-style="line-height: 85rpx;">
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
</view>
</view>
</view>
- <view class="square-2">
+ <!-- <view class="square-2">
<view class="square-title">
<view class="title-sign"><view class="sign"></view></view>
<view class="title-text"><text>鍗曟嵁缂栧彿</text></view>
@@ -23,8 +23,25 @@
<view class="square-content">
<view class="content-input">
<input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()"
- :focus="focus">
+ :focus="focus" placeholder-style="line-height: 85rpx;">
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></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="square-content">
+ <view class="content-input-btn">
+ <input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()"
+ :focus="focus" placeholder-style="line-height: 85rpx;">
+ <uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons>
+ </view>
+ <view class="content-btn">
+ <button class="cu-btn bg-blue pda-btn" @click="selectOrder()">+鎻愬彇</button>
</view>
</view>
</view>
@@ -59,6 +76,8 @@
<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.model}}</text></view>
+ <view><text style="width: 700rpx;">绠卞彿锛歿{item.xh}}</text></view>
<view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
<view>
<text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text>
@@ -106,7 +125,7 @@
<view class="num-box">
<uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474" @change="changeValue"/>
</view>
- <button class="cu-btn" @click="changeMax">max</button>
+ <!-- <button class="cu-btn" @click="changeMax">max</button> -->
</view>
<view class="revise-box-buttom">
<view>
@@ -125,6 +144,7 @@
export default {
data() {
return {
+ commonUrl:null,
barcode: '',
barcodeFocus:true,
focus:false,
@@ -143,6 +163,7 @@
check:false,
checkText:'鍏ㄩ��',
checkedData:[],
+ matData: ''
}
},
mounted(){
@@ -150,8 +171,69 @@
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
+ },
+ selectOrder() {
+ let that = this
+ uni.vibrateShort();
+ uni.navigateTo({
+ url: "orderSelect",
+ events: {
+ // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨�
+ acceptDataFromOpenedPage: function(data) {
+ that.matData = data.data
+ setTimeout(()=> {
+ that.findMat1()
+ },100)
+ },
+ },
+ success: function(res) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+ res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
+ },
+
+ });
+ that.matnr = ''
+ },
+ findMat1() {
+ let that = this
+ uni.navigateTo({
+ url: "orderQuery",
+ events: {
+ // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+ matList1: function(data) {
+ that.checkMat(data.data)
+ // that.matList.push(data.data)
+ },
+ },
+ success: function(res) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('matData', { data: that.matData })
+ },
+ });
+
+ },
+ checkMat(mat) {
+ var len = this.matList.length
+ var add = true
+ for (var i = 0; i < len; i++) {
+ if (mat.matnr == this.matList[i].matnr) {
+ this.matList[i].anfme += mat.anfme
+ this.$forceUpdate() // 寮哄埗鍒锋柊
+ add = false
+ }
+ }
+ if (add) {
+ this.matList.unshift(mat)
+ }
+ },
// barcode input 浜嬩欢
barcodeInput() {
var len = this.barcode.length
@@ -283,7 +365,7 @@
}
uni.showLoading();
uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/comb/auth',
+ url: that.commonUrl + '/mobile/comb/auth',
data: JSON.stringify({
orderNo: that.orderNo,
barcode: that.barcode,
@@ -299,7 +381,7 @@
if (res.code === 200) {
uni.showToast({
title: res.msg,
- position: 'bottom',
+ position: 'top',
duration: 1000
});
that.resst()
@@ -319,7 +401,7 @@
findOrder() {
let that = this
uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/order/search/orderNo/auth',
+ url: that.commonUrl + '/mobile/order/search/orderNo/auth',
data: {
orderNo: that.order
},
@@ -331,11 +413,14 @@
let res = result.data
if (res.code === 200) {
if(res.data) {
- uni.showLoading();
- that.matList = res.data;
+ uni.showLoading();
+ // res.data[0].combMats
+ for (let k in res.data[0].combMats) {
+ res.data[0].combMats[k]['id'] = k + 1
+ }
+ that.matList = res.data[0].combMats;
that.orderNo = that.order
that.initAnfme()
- console.log(that.matList)
}
} else if (res.code == 403) {
uni.showToast({title: res.msg, icon: "none", position: 'top'})
@@ -534,7 +619,7 @@
}
.data-list {
border-bottom: 1px solid #d8d8d8;
- height: 180rpx;
+ height: 250rpx;
margin: 15rpx;
border-radius: 20rpx;
}
@@ -559,13 +644,13 @@
height: 100%;
width: 100rpx;
text-align: center;
- line-height: 170rpx;
+ line-height: 250rpx;
}
.data-list-left {
/* background-color: #ffff7f; */
display: inline-block;
float: left;
- height: 180rpx;
+ height: 250rpx;
width: 500rpx;
color: #676767;
}
@@ -578,7 +663,7 @@
float: right;
width: 100rpx;
height: 180rpx;
- line-height: 180rpx;
+ line-height: 250rpx;
}
.data-list-right label {
display: inline-block;
--
Gitblit v1.9.1