From 17de5258a24ba6f42a07f9cc57b3bfc552e7bbff Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期二, 16 八月 2022 13:08:35 +0800
Subject: [PATCH] #
---
pages/basics/pakin.vue | 178 +++++++++++++++++++++++++++-----------------
pages/basics/matQuery.vue | 21 ++--
2 files changed, 119 insertions(+), 80 deletions(-)
diff --git a/pages/basics/matQuery.vue b/pages/basics/matQuery.vue
index 991cd95..0e48142 100644
--- a/pages/basics/matQuery.vue
+++ b/pages/basics/matQuery.vue
@@ -4,25 +4,25 @@
<view class="container">
<view class="text-box">
<view class="text-title"><text>鍟嗗搧缂栫爜</text></view>
- <view class="text-title"><text>{{matData.matnr}}</text></view>
+ <view class="text-title"><text>{{matData.matNo}}</text></view>
</view>
<view class="text-box">
<view class="text-title"><text>鍟嗗搧鍚嶇О</text></view>
- <view class="text-title">{{matData.maktx}}</view>
+ <view class="text-title">{{matData.matName}}</view>
</view>
<view class="text-box">
<view class="text-title"><text>瑙勬牸</text></view>
- <view class="text-title">{{matData.specs}}</view>
+ <view class="text-title">{{matData.str2}}</view>
</view>
<view class="text-box">
- <view class="text-title"><text>搴忓垪鍙�</text></view>
- <view class="text-title"><input type="text" v-model="matData.batch"></view>
+ <view class="text-title"><text>鍗曚綅</text></view>
+ <view class="text-title"><input type="text" v-model="matData.str1"></view>
</view>
<view class="text-box">
<view class="text-title"><text>鏁伴噺</text></view>
<view class="text-title">
<view>
- <uni-number-box v-model="matData.anfme" :max="9999" color="#747474" @change="changeValue"/>
+ <uni-number-box v-model="matData.count" :max="99999" color="#747474" @change="changeValue"/>
</view>
</view>
</view>
@@ -41,9 +41,9 @@
data() {
return {
matData: {
- matnr: null,
- maktx: null,
- batch: null,
+ matNo: null,
+ matName: null,
+ str2: null,
anfme: null,
},
baseIP:'',
@@ -62,11 +62,12 @@
// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
eventChannel.on('matData', function(data) {
that.matData = data.data
+ console.log(that.matData)
})
},
onShow() {
- this.matData.anfme = 0
+ this.matData.count = 0
},
methods: {
blur() {
diff --git a/pages/basics/pakin.vue b/pages/basics/pakin.vue
index 33d2310..92d886e 100644
--- a/pages/basics/pakin.vue
+++ b/pages/basics/pakin.vue
@@ -8,8 +8,8 @@
</view>
<view class="square-content">
<view class="content-input">
- <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="10"
- :focus="barcodeFocus" @input="barcodeInput" placeholder-style="line-height: 85rpx;">
+ <input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" placeholder-style="margin-top:10px" maxlength="10"
+ :focus="barcodeFocus" @confirm="barcodeInput()">
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
</view>
</view>
@@ -22,14 +22,14 @@
<view class="title-text"><text>妫�绱㈠晢鍝�</text></view>
</view>
<view class="square-content">
- <view class="content-input-btn">
+ <view class="content-input">
<input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
- :focus="focus" placeholder-style="line-height: 85rpx;">
+ :focus="focus" placeholder-style="margin-top:9px">
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
</view>
- <view class="content-btn">
+ <!-- <view class="content-btn">
<button class="cu-btn bg-blue pda-btn" @click="selectMat()">+鎻愬彇</button>
- </view>
+ </view> -->
</view>
</view>
@@ -52,15 +52,15 @@
<!-- <view>
<checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
</view> -->
- <view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view>
- <view><text style="width: 400rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
- <view><text style="width: 400rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
+ <view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matNo}}</text></view>
+ <view><text style="width: 400rpx;">鍝佸悕锛歿{item.matName}}</text></view>
+ <view><text style="width: 400rpx;">瑙勬牸锛歿{item.str2}}</text></view>
<view>
- <text style="width: 400rpx;">鏁伴噺锛歿{item.anfme}}</text>
+ <text style="width: 400rpx;">鏁伴噺锛歿{item.count}}</text>
</view>
</view>
<view class="data-list-right">
- <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
+ <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(index)"></uni-icons></label>
<label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label>
</view>
</view>
@@ -87,18 +87,19 @@
<!-- 寮圭獥 -->
<!-- 淇敼鏁伴噺 -->
- <uni-popup ref="revise" background-color="#fff" @change="change">
+
+ <uni-popup ref="revise" background-color="#fff">
<view class="revise-box">
<view class="revise-box-top">
<view class="color-block-blue"></view>
<text class="title">缁勬墭鏁伴噺</text>
</view>
<view class="text-box">
- <text>鍙粍鏁伴噺锛歿{enableQty}}</text>
+ <text>纭缁勬墭鏁伴噺</text>
</view>
<view class="changeBox">
<view class="num-box">
- <uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474" @change="changeValue"/>
+ <uni-number-box v-model="counts" :min="0" :max="99999" color="#747474" />
</view>
</view>
<view class="revise-box-buttom">
@@ -127,6 +128,7 @@
result: '',
enableQty:'',
count:'',
+ counts:'',
minCount:0,
maxCount:'',
rowNum:'',
@@ -150,15 +152,19 @@
methods: {
// barcode input 浜嬩欢
barcodeInput() {
- var len = this.barcode.length
- if (len != 8) {
- uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'});
- this.barcodeFocuss()
- return;
- }
- if (len == 8) {
- this.focuss()
- }
+ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
+ setTimeout(()=>{
+ var len = this.barcode.length
+ if (len != 8) {
+ uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'});
+ this.barcodeFocuss()
+ return;
+ }
+ if (len == 8) {
+ this.focuss()
+ }
+ },100)
+
},
// 鎵樼洏鐮佹湁璇噸缃�
barcodeFocuss() {
@@ -204,13 +210,8 @@
this.focus = true;
});
},
- remove() {
- // this.matList.splice(index,1)
- for (var i = 0; i < this.matList.length; i++) {
- if (this.matList[i].checked == true) {
- this.matList.splice(i,1)
- }
- }
+ remove(item,index) {
+ this.matList.splice(index,1)
this.checkList();
uni.vibrateShort();
},
@@ -282,9 +283,9 @@
findMat() {
let that = this
uni.request({
- url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth',
+ url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/matCode/auth',
data: {
- matnr:that.matnr
+ id:that.matnr
},
header: {
'token':uni.getStorageSync('token')
@@ -301,7 +302,6 @@
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
matList: function(data) {
that.matList.push(data.data)
- console.log(that.matList)
},
},
success: function(res) {
@@ -325,47 +325,38 @@
this.$refs.goodsSearch.open(type)
},
checkbox: function (e) {
- var items = this.matList,
- 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();
+ // var items = this.matList,
+ // 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();
},
- revise(item,index) {
- var maxCount = this.matList[index].maxCount
- if (maxCount == undefined ) {
- this.matList[index]["maxCount"] = item.enableQty
- }
- this.enableQty = item.enableQty
- this.count = this.minCount
- this.maxCount = item.maxCount
+ revise(index) {
this.rowNum = index
- this.eject()
- },
- eject(type) {
- this.type = type
- // open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦� uni-popup 缁勪欢涓婄粦瀹� type灞炴��
- this.$refs.revise.open(type)
- },
- changeValue() {
+ this.$refs.revise.open()
},
+ changeCount(e) {
+
+ },
+ // 纭缁勬墭鏁伴噺
confirm() {
- this.matList[this.rowNum].anfme = this.count
+ this.matList[this.rowNum].count = this.counts
+ this.$forceUpdate() // 寮哄埗鍒锋柊
this.$refs.revise.close()
},
// 鍒楄〃鍙嶉��
@@ -526,12 +517,13 @@
height: 180rpx;
margin: 15rpx;
border-radius: 20rpx;
+ font-size: 12px;
}
.data-list:first-child {
margin-top: 20rpx;
}
.data-list:last-child {
- margin-bottom: 120rpx;
+ margin-bottom: 170rpx;
}
/* .data-list-left {
display: inline-block;
@@ -568,4 +560,50 @@
width: 80rpx;
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
--
Gitblit v1.9.1