From 6c9cbdf482ce1330704dc635c510ec51a1115a9f Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期一, 18 三月 2024 16:52:29 +0800 Subject: [PATCH] # --- pages/basics/stockQuery.vue | 215 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 211 insertions(+), 4 deletions(-) diff --git a/pages/basics/stockQuery.vue b/pages/basics/stockQuery.vue index 19dbff0..e2b301d 100644 --- a/pages/basics/stockQuery.vue +++ b/pages/basics/stockQuery.vue @@ -5,8 +5,17 @@ <view class="searchBox"> <view class="searchIcon"><uni-icons type="search" size="20" color="#dadada"></uni-icons></view> <view class="searchArea"> - <input type="text" placeholder=" 搴撲綅鍙� / 鎵樼洏鐮� / 鍟嗗搧缂栫爜 "></view> - <view class="closeIcon"><uni-icons type="closeempty" size="20" color="#dadada"></uni-icons></view> + <input v-model="locNo" type="text" placeholder=" 搴撲綅鍙�" @input="searchByLoc" placeholder-style="line-height: 85rpx;"></view> + <view class="closeIcon"><uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></uni-icons></view> + </view> + </view> + <!-- 鎼滅储妗� --> + <view class="square-1"> + <view class="searchBox"> + <view class="searchIcon"><uni-icons type="search" size="20" color="#dadada"></uni-icons></view> + <view class="searchArea"> + <input v-model="matnr" type="text" placeholder=" 鍟嗗搧缂栫爜" @input="searchByMatnr" placeholder-style="line-height: 85rpx;"></view> + <view class="closeIcon"><uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr"></uni-icons></view> </view> </view> <!-- 鍒楄〃澶� --> @@ -17,7 +26,7 @@ </view> </view> <!-- 鍟嗗搧鍒楄〃 --> - <checkbox-group @change="checkbox"> + <!-- <checkbox-group @change="checkbox"> <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > <view class="data-list-left"> <view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view> @@ -32,6 +41,26 @@ <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> </view> </view> + </checkbox-group> --> + <checkbox-group @change="checkbox"> + <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > + <label class="left-check-box"> + <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> + </label> + <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.batch}}</text></view> + <view> + <text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text> + </view> + </view> + <view class="data-list-right"> + <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> + <!-- list涓垹闄ら敭 --> + <!-- <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> --> + </view> + </view> </checkbox-group> <!-- 鏃犳暟鎹樉绀� --> <view class="square-none" v-show="matList.length === 0"> @@ -44,16 +73,194 @@ export default { data () { return { - matList:[], + commonUrl:null, + matList: [], + locNo: null, + matnr: null + } }, + mounted() { + const UIP = uni.getStorageSync('UIP'); + 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 + }, checkbox: function () { }, + // 娓呯┖搴撲綅鍙锋悳绱㈡ + removeLocNo() { + this.locNo = null + }, + // 娓呯┖鍟嗗搧缂栫爜 + removeMatnr() { + this.matnr = null + }, + request() { + let that = this + uni.request({ + url:that.commonUrl + '/locDetl/list/auth', + header:{'token':uni.getStorageSync('token')}, + data: { + curr: 1, + limit: 100, + loc_no: that.locNo, + matnr: that.matnr + }, + method:"GET", + success(result) { + let res = result.data + let records = res.data.records + if (res.code == 200) { + if (records) { + that.matList = records + } else { + uni.showToast({ + title: "鏆傛棤鏇村鏁版嵁", + position: 'top', + duration: 1000 + }); + } + } 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'}) + } + } + }) + }, + // 鏍规嵁搴撲綅鍙锋悳绱� + searchByLoc() { + let that = this + that.request() + }, + // 鏍规嵁鍟嗗搧缂栫爜鎼滅储 + searchByMatnr() { + let that = this + that.request() + } }, } </script> <style> + .bg-false { + background-color: #FFFFFF; + } + .bg-true { + background-color: #ebebeb; + } + .data-list { + border-bottom: 1px solid #d8d8d8; + height: 180rpx; + margin: 15rpx; + border-radius: 20rpx; + } + .data-list:first-child { + margin-top: 20rpx; + } + .data-list:last-child { + margin-bottom: 160rpx; + } + /* .data-list-left { + display: inline-block; + float: left; + text-align: center; + width: 100rpx; + height: 180rpx; + line-height: 180rpx; + } */ + .left-check-box { + display: inline-block; + /* background-color: #1E9FFF; */ + float: left; + height: 100%; + width: 100rpx; + text-align: center; + line-height: 170rpx; + } + .data-list-left { + /* background-color: #ffff7f; */ + display: inline-block; + float: left; + height: 180rpx; + width: 500rpx; + color: #676767; + } + .matnr { + padding-top: 10rpx; + } + .data-list-right { + /* background-color: #55ffff; */ + display: inline-block; + float: right; + width: 100rpx; + height: 180rpx; + line-height: 180rpx; + } + .data-list-right label { + display: inline-block; + float: left; + width: 100rpx; + 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