From b95f96d36c98cc0249f7758ab78a309a9f08abfd Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期二, 11 十月 2022 13:45:30 +0800 Subject: [PATCH] # --- pages/basics/pakin.vue | 2 pages/basics/matSelect2.vue | 2 pages.json | 11 + pages/basics/matSelect3.vue | 391 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ pages/index/index.vue | 12 5 files changed, 409 insertions(+), 9 deletions(-) diff --git a/pages.json b/pages.json index 2cf6808..6c44e2d 100644 --- a/pages.json +++ b/pages.json @@ -42,7 +42,7 @@ "path" : "pages/basics/stockCheck", "style" : { - "navigationBarTitleText": "骞冲簱搴撲綅鐩樼偣", + "navigationBarTitleText": "搴撲綅鐩樼偣", "enablePullDownRefresh": false } },{ @@ -177,6 +177,15 @@ "enablePullDownRefresh": false } + }, + { + "path" : "pages/basics/matSelect3", + "style" : + { + "navigationBarTitleText": "閫夋嫨鍟嗗搧", + "enablePullDownRefresh": false + + } } diff --git a/pages/basics/matSelect2.vue b/pages/basics/matSelect2.vue index c7e4151..a8b48cd 100644 --- a/pages/basics/matSelect2.vue +++ b/pages/basics/matSelect2.vue @@ -30,7 +30,7 @@ <view class="cu-tag bg-cyan ">鍟嗗搧</view> </view> <view class="matnr"><text style="width: 400rpx;">{{item.matnr}}</text></view> - <view class="matnr"><text style="width: 400rpx;">{{item.maktx}}</text></view> + <view class="matnr"><text style="width: 400rpx;">{{item.specs}}</text></view> </view> </label> </checkbox-group> diff --git a/pages/basics/matSelect3.vue b/pages/basics/matSelect3.vue new file mode 100644 index 0000000..3f80eb6 --- /dev/null +++ b/pages/basics/matSelect3.vue @@ -0,0 +1,391 @@ +<template> + <view> + <scroll-view scroll-y > + <view class="search-box"> + <view class="search-area"> + <view class="search-icon"><uni-icons type="search" size="25" color="#a5a5a5"></uni-icons></view> + <input type="text" v-model="condition" placeholder="璇疯緭鍏ュ晢鍝佺紪鐮� / 鍚嶇О"/> + <view class="close-icon" @click="reset()"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view> + </view> + <view class="search-btn"><button @click="search(condition)" class="cu-btn bg-blue">鎼滅储</button></view> + </view> + <checkbox-group @change="checkbox"> + <label v-for="(item,index) in tag" :key="index" class="demo-list bg-false" + @click="showTag(item.id)"> + <view class="demo-list-right"> + <view class="tag"> + <view class="cu-tag bg-blue ">褰掔被</view> + </view> + + <view class="order-ditel"><text class="orderNo">{{item.name}}</text></view> + </view> + </label> + + </checkbox-group> + <checkbox-group> + <label v-for="(item,index) in data" :key="index" class="demo-list bg-false" + @click="findBySelect(item.matnr)"> + <view class="demo-list-right"> + <view class="tag"> + <view class="cu-tag bg-cyan ">鍟嗗搧</view> + </view> + <view class="matnr"><text style="width: 400rpx;">{{item.matnr}}</text></view> + <view class="matnr"><text style="width: 400rpx;">{{item.specs}}</text></view> + </view> + </label> + </checkbox-group> + </scroll-view> + <view class="footer flex" style="height: 100rpx;"> + <view class="bottom"> + <view style="display: inline-block;"> + <button size="mini">涓婁竴椤�</button> + </view> + <view style="display: flex;align-items: center;"> + <text>褰撳墠椤碉細</text> + <input v-model="limit" type="text" style="width: 50rpx;border: 1px solid #ccc;height: 30rpx;font-size: 14rpx;"> + </view> + <view style="display: flex;align-items: center;"> + <text style="font-size: 14rpx;">鍏眥{pages}}椤�</text> + </view> + <view style="display: inline-block;"> + <button size="mini">涓嬩竴椤�</button> + </view> + </view> + </view> + </view> +</template> + +<script> + export default { + data() { + return { + commonUrl:null, + condition:null, + tag: [], + data: [], + limit: 1, + pages: 10 + } + }, + onLoad() { + let that = this + // const eventChannel = this.$scope.eventChannel; // 鍏煎APP-NVUE + const eventChannel = this.getOpenerEventChannel(); + + // 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� + eventChannel.on('commonUrl', function(data) { + that.commonUrl = data.commonUrl + that.showTag(1) + }) + }, + methods: { + checkbox() { + + }, + reset() { + this.condition = null + uni.vibrateShort(); + }, + search(condition) { + let that = this + that.tag = null + that.data = null + uni.vibrateShort(); + uni.showLoading({ + title: '鎼滅储涓�...' + }); + uni.request({ + // url: "http://localhost:8081/jkwms/tag/list/pda/auth", + url: that.commonUrl + '/mat/search/pda/auth', + data: { + condition: condition + }, + method:"GET", + header: { + 'token':uni.getStorageSync('token'), + }, + success(result) { + uni.hideLoading(); + var res = result.data + if (res.code === 200 ) { + that.data = res.data + } else if (res.code == 403) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + } + }); + }, + showTag(parentId) { + let that = this + uni.showLoading(); + uni.request({ + url: that.commonUrl + '/tag/list/pda/auth', + header: { + 'token':uni.getStorageSync('token'), + }, + data: { + curr: 1, + limit: 16, + parentId: parentId + }, + header: { + 'token':uni.getStorageSync('token'), + }, + success(result) { + uni.hideLoading(); + that.tag = null + that.data = null + var res = result.data + if (res.code === 200) { + if (res.data != null && res.data.length > 0) { + that.tag = res.data + } else { + that.showMat(parentId) + } + } else if (res.code === 403 ) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + + } + }); + }, + showMat(tagId) { + uni.showLoading(); + let that = this + if (tagId == null || tagId == '' || tagId == undefined) { + return; + } + uni.request({ + url: that.commonUrl + '/mat/list/auth2', + data: { + param: { + curr: 1, + limit: 16, + tag_id:tagId} + }, + method:"GET", + header: { + 'token':uni.getStorageSync('token'), + }, + success(result) { + uni.hideLoading(); + that.tag = null + var res = result.data + if (res.code === 200) { + if (res.data != null && res.data.length > 0) { + that.data = res.data + + } else { + // that.tagId = parentId + } + } else if (res.code === 403 ) { + uni.showToast({title: res.msg, icon: "none", position: 'top'}) + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'top'}) + } + + } + }); + }, + findBySelect(matnr) { + this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: matnr}); + uni.vibrateShort(); + uni.navigateBack({ + + }) + + } + } + } +</script> + +<style> + .bottom { + height: 100%; + width: 100%; + /* background-color: #828282; */ + display: flex; + justify-content: space-around; + + } + .matnr { + margin-left: 60rpx; + margin-top: 20rpx; + } + .matnr:last-child { + margin-top: 0rpx; + } + .tag { + padding-left: 50rpx; + padding-top: 10rpx; + width: 100%; + border-bottom: 1px solid #ebebeb; + } + .search-box { + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100rpx; + background-color: #FFF; + border-bottom: 1px solid #d8d8d8; + border-radius: 0 0 20rpx 20rpx; + z-index: 1; + } + /*#ifdef H5 */ + .search-box { + position: fixed; + left: 0; + top: 89rpx; + width: 100%; + height: 100rpx; + background-color: #ffffff; + border-bottom: 1px solid #d8d8d8; + border-radius: 0 0 20rpx 20rpx; + z-index: 1; + } + /* #endif */ + .search-area { + display: inline-block; + background-color: #F1F1F1; + width: 75%; + height: 70%; + margin: 15rpx; + border-radius: 15rpx; + } + .search-area input { + display: inline-block; + height: 70rpx; + width: 70%; + line-height: 70rpx; + font-size: 25rpx; + font-weight: 400; + } + .search-btn { + display: inline-block; + float: right; + margin-right: 30rpx; + margin-top: 15rpx; + } + .search-icon { + display: inline-block; + float: left; + width: 70rpx; + height: 70rpx; + text-align: center; + line-height: 70rpx; + + } + .close-icon { + display: inline-block; + float: right; + width: 70rpx; + height: 70rpx; + text-align: center; + line-height: 70rpx; + } + .bg-false { + background-color: #FFFFFF; + } + .bg-true { + background-color: #ebebeb; + } + .demo-list { + border-bottom: 1px solid #d8d8d8; + height: 180rpx; + margin: 15rpx; + border-radius: 20rpx; + } + .demo-list:first-child { + margin-top: 120rpx; + } + .demo-list:last-child { + margin-bottom: 120rpx; + } + label { + display: block; + } + .demo-list-left { + display: inline-block; + float: left; + text-align: center; + width: 100rpx; + height: 180rpx; + line-height: 180rpx; + } + .demo-list-right { + display: inline-block; + float: left; + width: 100%; + height: 180rpx; + color: #828282; + } + .order-ditel { + margin-top: 30rpx; + height: 60rpx; + width: 600rpx; + line-height: 60rpx; + } + + .demo-list-right .index { + width: 120rpx; + height: 25rpx; + line-height: 25rpx; + font-size: 40rpx; + border-right: 4rpx solid #6f6f6f; + padding-left: 0px; + padding-right: 10rpx; + color: #3b3b3b; + /* background-color: #007AFF; */ + } + .demo-list-right .orderNo { + padding-left: 30rpx; + font-size: 35rpx; + width: 400rpx; + color: #3b3b3b; + /* background-color: #0A98D5; */ + } + .demo-list-right .vertical-bar { // 绔栨潬 + /* background-color: #6739B6; */ + width: 50rpx; + font-size: 30rpx; + text-align: center; + } + .demo-list-right text { + display: inline-block; + width: 250rpx; + font-size: 25rpx; + } + .color-red { + width: auto; + font-weight: 700; + color: #e74f4f; + } + + + .label-btn { + width: 150rpx; + } + checkbox { + /* transform:scale(0.7) */ + } +</style> diff --git a/pages/basics/pakin.vue b/pages/basics/pakin.vue index bc3c3bc..3039192 100644 --- a/pages/basics/pakin.vue +++ b/pages/basics/pakin.vue @@ -278,7 +278,7 @@ let that = this uni.vibrateShort(); uni.navigateTo({ - url: "matSelect", + url: "matSelect3", events: { // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨� acceptDataFromOpenedPage: function(data) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 6ed09c1..2b92a6a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -72,12 +72,12 @@ // color: 'blue', // cuIcon: 'video' // }, - // { - // title: '搴撳瓨鐩樼偣', - // name: 'stoCheck', - // color: 'blue', - // cuIcon: 'safe' - // }, + { + title: '搴撳瓨鐩樼偣', + name: 'stockCheck', + color: 'blue', + cuIcon: 'safe' + }, // { // title: '骞充粨搴撳瓨鐩樼偣', // name: 'manStoCheck', -- Gitblit v1.9.1