From 5613d5a442e9a298c6e34ca1f57023d9fa6c671e Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 26 九月 2023 17:03:31 +0800 Subject: [PATCH] # --- pages/basics/matQuery.vue | 101 +++++++++++++++++++++++++++++++++----------------- 1 files changed, 67 insertions(+), 34 deletions(-) diff --git a/pages/basics/matQuery.vue b/pages/basics/matQuery.vue index bdfe3bd..c54b193 100644 --- a/pages/basics/matQuery.vue +++ b/pages/basics/matQuery.vue @@ -3,26 +3,40 @@ <view> <view class="container"> <view class="text-box"> - <view class="text-title"><text>鍟嗗搧缂栫爜</text></view> + <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>鍟嗗搧鍚嶇О</text></view> + <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>瑙勬牸</text></view> + <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>鎵瑰彿</text></view> + <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>鏁伴噺</text></view> + <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 v-model="matData.anfme" :max="9999" color="#747474" @change="changeValue"/> + <uni-number-box :value="matData.anfme" :max="9999999" color="#747474" @change="changeValue"/> </view> </view> </view> @@ -43,44 +57,55 @@ matData: { matnr: null, maktx: null, - specs: null, batch: null, anfme: null, + owner: null }, + owners: [], + owner: '', baseIP:'', basePORT:'', + commonUrl: '' } }, onLoad(option) { - this.baseIP = option.baseIP - this.basePORT = option.basePORT - this.matData.matnr = option.matnr + 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 + }) + this.locOwner() }, - onShow() { - this.getMat() - }, methods: { - getMat() { - let that = this - + locOwner() { + let _this = 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: _this.commonUrl + '/locOwner/list/auth', + data:{curr:1,limit:15}, + header: { 'token':uni.getStorageSync('token') }, success(res) { - var res = res.data; + res = res.data if (res.code === 200) { - that.matData = {} - that.matData = res.data; + _this.owner = res.data.records + for (let k of res.data.records) { + _this.owners.push(k.owner) + } } } - }); + }) }, blur() { @@ -88,12 +113,17 @@ focus() { }, - changeValue() { - + changeValue(value) { + this.matData.anfme = value }, back() { - uni.$emit('matData', this.matData); - // console.log(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({ }) @@ -109,8 +139,9 @@ background-color: #ffffff; } .text-box { + display: flex; height: 100rpx; - line-height: 100rpx; + /* line-height: 100rpx; */ margin-top: 20rpx; margin-left: 10%; width: 80%; @@ -142,7 +173,9 @@ border-bottom: 1rpx solid #e8e8e8 ; width: 100%; } - + .text-desc { + line-height: 100rpx; + } .foot { width: 100%; -- Gitblit v1.9.1