From 42befdd31d6c897381bb7c80fd41d0d9619c085c Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期六, 07 十月 2023 16:21:48 +0800 Subject: [PATCH] # --- pages/basics/matQuery.vue | 169 ++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 104 insertions(+), 65 deletions(-) diff --git a/pages/basics/matQuery.vue b/pages/basics/matQuery.vue index a73e3c2..e721812 100644 --- a/pages/basics/matQuery.vue +++ b/pages/basics/matQuery.vue @@ -1,39 +1,51 @@ <template> - <scroll-view scroll-y> - <view> - <view class="container"> - <view class="text-box"> - <view class="text-title"><text>鍟嗗搧缂栫爜</text></view> - <view class="text-title"><text>{{matData.matnr}}</text></view> - </view> - <view class="text-box"> - <view class="text-title"><text>鍟嗗搧鍚嶇О</text></view> - <view class="text-title">{{matData.maktx}}</view> - </view> - <view class="text-box"> - <view class="text-title"><text>瑙勬牸</text></view> - <view class="text-title">{{matData.specs}}</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> - <view class="text-box"> - <view class="text-title"><text>鏁伴噺</text></view> - <view class="text-title"> - <view> - <uni-number-box color="#747474" @change="changeValue"/> - </view> + <view> + <view class="container"> + <view class="text-box"> + <view class="text-title text-desc"><text>鍟嗗搧缂栫爜</text></view> + <view class="text-title"><text>{{matData.matnr}}</text></view> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>鍟嗗搧鍚嶇О</text></view> + <view class="text-title">{{matData.maktx}}</view> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>瑙勬牸</text></view> + <view class="text-title">{{matData.specs}}</view> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>鍏ュ簱鍖哄煙</text></view> + <view class="text-title">{{matData.matType$}}</view> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>鎵瑰彿</text></view> + <view class="text-title"><input type="text" v-model="matData.batch"></view> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>澶囨敞</text></view> + <view class="text-title"><input type="text" v-model="matData.memo"></view> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>瀹㈡埛淇℃伅</text></view> + <uni-combox :candidates="owners" placeholder="璇烽�夋嫨瀹㈡埛绫诲埆" + v-model="matData.owner"></uni-combox> + <!-- <view class="text-title"><input type="text" v-model="matData.cstmr"></view> --> + </view> + <view class="text-box"> + <view class="text-title text-desc"><text>鏁伴噺</text></view> + <view class="text-title"> + <view> + <uni-number-box :value="matData.anfme" :max="9999999" color="#747474" @change="changeValue"/> </view> </view> </view> </view> <view class="foot flex justify-center"> - <label for=""> + <label> <button class="cu-btn bg-blue" @click="back()">鎻愬彇</button> </label> </view> - </scroll-view> + </view> </template> <script> @@ -43,40 +55,59 @@ matData: { matnr: null, maktx: null, - specs: null, batch: null, - anfme: 0 + anfme: null, + owner: null }, + owners: [], + owner: '', baseIP:'', basePORT:'', + commonUrl: '' } }, onLoad(option) { - this.baseIP = option.baseIP - this.basePORT = option.basePORT - this.matData.matnr = option.matnr - this.getMat() + let that = this + // #ifdef APP-NVUE + const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE + // #endif + // #ifndef APP-NVUE + const eventChannel = this.getOpenerEventChannel(); + // #endif + + // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + eventChannel.on('matData', function(data) { + that.matData = data.data + that.matData.anfme = 0 + }) + + eventChannel.on('url', function(data) { + that.commonUrl = data.data + }) + setTimeout(()=> { + this.locOwner() + },100) }, methods: { - getMat() { + locOwner() { let that = this uni.request({ - url: 'http://localhost:8081/jkwms/mat/auth', - // url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth', - data: { - matnr: that.matData.matnr - }, - header: { - 'token':uni.getStorageSync('token') - }, + url: 'http://10.10.10.100:8080/bfwms' + '/locOwner/list/auth', + data:{curr:1,limit:15}, + header: { 'token':uni.getStorageSync('token') }, + method:'GET', success(res) { - var res = res.data; - console.log(res); + res = res.data if (res.code === 200) { - that.matData = res.data; + that.owner = res.data.records + for (let k of res.data.records) { + that.owners.push(k.owner) + } } + }, + fail(res) { } - }); + }) }, blur() { @@ -84,14 +115,19 @@ focus() { }, - changeValue() { - + changeValue(value) { + this.matData.anfme = value }, back() { - this.matData.anfme = 5.9 - uni.$emit('matData', this.matData); + if (this.matData.anfme === 0) { + uni.showToast({title: '璇疯緭鍏ユ暟閲�', icon: "none", position: 'top'}); + return; + } + this.getOpenerEventChannel().emit('matList', {data: this.matData}); + this.getOpenerEventChannel().emit('owner', {data: this.owner}); + uni.vibrateShort(); uni.navigateBack({ - delta: 1 + }) } } @@ -105,40 +141,42 @@ background-color: #ffffff; } .text-box { + display: flex; height: 100rpx; - line-height: 100rpx; + /* line-height: 100rpx; */ margin-top: 20rpx; margin-left: 10%; width: 80%; - font-size: 36rpx; - font-weight: 700; + font-size: 32rpx; + font-weight: 400; color: #434343; border-bottom: 1rpx solid #e8e8e8; } .text-box:last-child { border-bottom: none; } - .text-box:last-child .text-title:last-child { - display: flex; - height: 100%; - align-items: center; - } .text-box .text-title { width: 30%; + height: 100rpx; float: left; display: inline-block; } - .text-box .text-value { - width: 70%; - padding: 0 20upx; - } .text-box .text-title:last-child { display: inline-block; - margin-left: 10%; - width: 60%; + margin-left: 5%; + width: 65%; font-size: 30rpx; font-weight: 400; color: #747474; + display: flex; + align-items: center; + } + .text-box .text-title:last-child input { + border-bottom: 1rpx solid #e8e8e8 ; + width: 100%; + } + .text-desc { + line-height: 100rpx; } .foot { @@ -146,6 +184,7 @@ height: 100rpx; line-height: 100rpx; background-color: rgba(255,255,255,1); + /* background-color: #434343; */ position: fixed; bottom: 0%; border-top: 1px solid #d8d8d8; -- Gitblit v1.9.1