From 4aa1546dda1adf637a8d612c6dc0a535532294b4 Mon Sep 17 00:00:00 2001 From: whycq <913841844@qq.com> Date: 星期一, 17 四月 2023 12:28:56 +0800 Subject: [PATCH] # --- pages/basics/notificationFile.vue | 126 +++++++++++++++++++++++++++++++---------- 1 files changed, 94 insertions(+), 32 deletions(-) diff --git a/pages/basics/notificationFile.vue b/pages/basics/notificationFile.vue index a8faae5..c0848a8 100644 --- a/pages/basics/notificationFile.vue +++ b/pages/basics/notificationFile.vue @@ -5,19 +5,20 @@ <view class="search-area"> <view class="search-icon"><uni-icons type="search" size="25" color="#a5a5a5"></uni-icons></view> <input type="text" v-model="zpallet" placeholder=" 鎵樼洏鏉$爜"/> - <view class="close-icon" @click="reset()"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view> + <view class="close-icon" v-show="zpallet" @click="remove('zpallet')"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view> </view> - <view class="search-btn"><button @click="search(zpallet)" class="cu-btn bg-blue">鎼滅储</button></view> + <view class="search-btn"><button @click="getList(zpallet)" class="cu-btn bg-blue">鎼滅储</button></view> </view> <!-- list鍒楄〃 --> <checkbox-group > <view v-for="(item,index) in listData" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > - <view class="data-list-left"> - <view>鎵樼洏鏉$爜锛歿{item.zpallet}}</view> - <view>鎵樼洏鍚嶇О锛歿{item.maktx}}</view> - <view>鍟嗗搧缂栫爜锛歿{item.matnr}}-{{item.batch}}</view> - <view>浠撳簱鍙凤細{{item.origin}}</view> + <view class="data-list-left">{{index + 1 }}</view> + <view class="data-list-right"> + <view>鎵樼洏鏉$爜锛�<text class="context zpallet">{{item.zpallet}}</text></view> + <view>鎵樼洏鍚嶇О锛�<text class="context">{{item.maktx}}</text></view> + <view>鍟嗗搧缂栫爜锛�<text class="context">{{item.matnr}}-{{item.batch}}</text></view> + <view>浠撳簱鍙凤細<text class="context">{{item.origin}}</text></view> </view> </view> </checkbox-group> @@ -30,7 +31,7 @@ <button class="cu-btn lg" @click="resst()">閲嶇疆</button> </view> <view> - <button class="cu-btn lg pakin-btn bg-red" @click="comb()">鍒犻櫎</button> + <button class="cu-btn lg pakin-btn bg-red" @click="deleteData()">鍒犻櫎</button> </view> </view> </view> @@ -70,32 +71,83 @@ getUrl() { this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl }, - getList() { + remove(e) { + this[e] = '' + }, + getList(barcode) { let that = this + if (barcode == '') { + that.listData = [] + uni.showToast({title: '璇疯緭鍏ユ墭鐩樼爜', icon: "none",position: 'center'}) + return + } uni.request({ url: that.commonUrl + '/waitPakin/list/auth', data:{ curr:1, - limit:20, + limit:16, + zpallet:barcode }, - header: { - 'token':uni.getStorageSync('token') - }, + header: {'token':uni.getStorageSync('token')}, method:'GET', success: result =>{ - console.log(result); let res = result.data if (res.code === 200) { - if (res.data) { - let list = res.data.records - that.listData = this.reload ? list : this.listData.concat(list); - this.reload = false; - + if (res.data.records.length>0) { + that.listData = res.data.records + } else { + that.listData = [] + uni.showToast({title: '鎵樼洏鐮侊細' + barcode + ' 鏃犳暟鎹紒', icon: "none",position: 'center'}) } + } else if(res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'center'}) + that.returnIndex(); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'center'}) } } }) - } + }, + // 閲嶇疆 + resst() { + this.listData = [] + this.zpallet = '' + // 80049089 + }, + // 鍒犻櫎 + deleteData() { + let that = this + console.log((JSON.stringify(that.listData))); + uni.request({ + url: that.commonUrl + "/waitPakin/delete/auth", + data: {param:JSON.stringify(that.listData)}, + header: { + 'token':uni.getStorageSync('token'), + 'content-type' : 'application/x-www-form-urlencoded' + }, + method:'POST', + success(result) { + let res = result.data + if (res.code === 200) { + uni.showToast({title: res.msg, icon: "none",position: 'center'}) + that.resst(); + } else if(res.code === 403) { + uni.showToast({title: res.msg, icon: "none", position: 'center'}) + that.returnIndex(); + } else { + uni.showToast({title: res.msg, icon: "none",position: 'center'}) + } + } + }) + }, + // 403璺宠浆鐧诲綍椤� + returnIndex() { + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + }, } } @@ -176,33 +228,43 @@ background-color: #ebebeb; } - .demo-list { + .data-list { border-bottom: 1px solid #d8d8d8; height: 180rpx; margin: 15rpx; border-radius: 20rpx; } - .demo-list:first-child { + .data-list:first-child { margin-top: 120rpx; } - .demo-list:last-child { - margin-bottom: 120rpx; + .data-list:last-child { + margin-bottom: 160rpx; } - label { - display: block; - } - .demo-list-left { + .data-list-left { display: inline-block; float: left; + width: 10%; + height: 180rpx; text-align: center; - width: 100rpx; - height: 180rpx; line-height: 180rpx; + font-size: 40rpx; + color: #666; } - .demo-list-right { + + .data-list-right { display: inline-block; float: left; + width: 90%; height: 180rpx; - color: #828282; + font-size: 32rpx; + color: #666; + } + .context { + color: #999; + font-size: 30rpx; + } + .zpallet { + color: #666; + font-size: 36rpx; } </style> \ No newline at end of file -- Gitblit v1.9.1