|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <!-- 库位码输入框 --> | 
|---|
|  |  |  | <!-- 库位号输入框 --> | 
|---|
|  |  |  | <view class="square-2"> | 
|---|
|  |  |  | <view class="square-title"> | 
|---|
|  |  |  | <view class="title-sign"><view class="sign"></view></view> | 
|---|
|  |  |  | <view class="title-text"><text>库位码</text></view> | 
|---|
|  |  |  | <view class="title-text"><text>库位号</text></view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="square-content"> | 
|---|
|  |  |  | <view class="content-input"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- <view class="square-2"> | 
|---|
|  |  |  | <view class="square-title"> | 
|---|
|  |  |  | <view class="title-sign"><view class="sign"></view></view> | 
|---|
|  |  |  | <view class="title-text"><text>商品码</text></view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="square-content"> | 
|---|
|  |  |  | <view class="content-input"> | 
|---|
|  |  |  | <input type="text" v-model="matnr" placeholder="扫码 / 输入" @input="findMat" :focus="matnrFocus"> | 
|---|
|  |  |  | <uni-icons v-show="matnr" type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | <!-- 商品列表表头 --> | 
|---|
|  |  |  | <view class="square-1"> | 
|---|
|  |  |  | <view class="square-title"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <view class="square-none"> | 
|---|
|  |  |  | <view class="v-show" v-show="matList.length == 0">暂无更多数据...</view> | 
|---|
|  |  |  | <view class="square-none" v-show="matList.length == 0"> | 
|---|
|  |  |  | <view class="v-show">暂无更多数据...</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 商品列表 --> | 
|---|
|  |  |  | <!-- <checkbox-group > | 
|---|
|  |  |  | <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > | 
|---|
|  |  |  | <view class="list-left"> | 
|---|
|  |  |  | <view class="lists-item">No:{{listNum}}</view> | 
|---|
|  |  |  | <view class="lists-item">商品编码:{{item.matnr}}</view> | 
|---|
|  |  |  | <view class="lists-item">商品批号:{{item.batch}}</view> | 
|---|
|  |  |  | <view class="lists-item">上架数量:{{item.anfme}}</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="list-right"> | 
|---|
|  |  |  | <uni-icons type="trash" size="20" color="#a5a5a5" @click="removeItem(item,index)"></uni-icons> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </checkbox-group> --> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <checkbox-group> | 
|---|
|  |  |  | <view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" > | 
|---|
|  |  |  | <view class="data-list-left"> | 
|---|
|  |  |  | <!-- <view> | 
|---|
|  |  |  | <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" /> | 
|---|
|  |  |  | </view> --> | 
|---|
|  |  |  | <view class="matnr"><text style="width: 400rpx;">编码:{{item.matnr}}</text></view> | 
|---|
|  |  |  | <view><text style="width: 400rpx;">品名:{{item.maktx}}</text></view> | 
|---|
|  |  |  | <view><text style="width: 400rpx;">批号:{{item.batch}}</text></view> | 
|---|
|  |  |  | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="data-list-right"> | 
|---|
|  |  |  | <label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label> | 
|---|
|  |  |  | <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label> | 
|---|
|  |  |  | <label><uni-icons type="trash" size="25" color="#a5a5a5" @click="removeItem(item,index)"></uni-icons></label> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </checkbox-group> | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <!-- 弹窗 --> | 
|---|
|  |  |  | <!-- 修改数量 --> | 
|---|
|  |  |  | <uni-popup ref="revise" background-color="#fff" > | 
|---|
|  |  |  | <uni-popup ref="revise" background-color="#fff"> | 
|---|
|  |  |  | <view class="revise-box"> | 
|---|
|  |  |  | <view class="revise-box-top"> | 
|---|
|  |  |  | <view class="color-block-blue"></view> | 
|---|
|  |  |  | <text class="title">修改数量</text> | 
|---|
|  |  |  | <text class="title">修改批号/数量</text> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="" style="position: relative;left: 50px;margin-bottom: 20px;"> | 
|---|
|  |  |  | <text style="display: inline-block;float: left;width: 50px;">批号:</text> | 
|---|
|  |  |  | <input type="text" style="width: 100px;border-bottom: 1px solid #9e9e9e;" v-model="batch"> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | <view class="changeBox"> | 
|---|
|  |  |  | <view class="num-box"> | 
|---|
|  |  |  | 
|---|
|  |  |  | messageText: '这是一条成功提示', | 
|---|
|  |  |  | count:'', | 
|---|
|  |  |  | rowNum:'', | 
|---|
|  |  |  | batch:'' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | mounted(){ | 
|---|
|  |  |  | 
|---|
|  |  |  | uni.showToast({title: '请添加商品', icon: "none", position: 'top'}); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var combList = {} | 
|---|
|  |  |  | var matList = [] | 
|---|
|  |  |  | combList['locno'] = that.locno | 
|---|
|  |  |  | combList['combMats'] = that.matList | 
|---|
|  |  |  | matList['matnr'] = that.matList | 
|---|
|  |  |  | console.log(JSON.stringify(combList)) | 
|---|
|  |  |  | var combMats = [] | 
|---|
|  |  |  | var combParam = {} | 
|---|
|  |  |  | combParam['locno'] = that.locno | 
|---|
|  |  |  | combParam['combMats'] = that.matList | 
|---|
|  |  |  | uni.request({ | 
|---|
|  |  |  | url: that.commonUrl + '/mobile/mat/onSale/auth', | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | combParam:JSON.stringify(combList) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | header: { 'token':uni.getStorageSync('token') }, | 
|---|
|  |  |  | method:'GET', | 
|---|
|  |  |  | data: JSON.stringify(combParam), | 
|---|
|  |  |  | header: { 'token':uni.getStorageSync('token'),}, | 
|---|
|  |  |  | method:'POST', | 
|---|
|  |  |  | success(result) { | 
|---|
|  |  |  | console.log(result) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | var res = result.data | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | uni.showToast({title: res.msg, icon: "none", position: 'top'}); | 
|---|
|  |  |  | that.resst() | 
|---|
|  |  |  | } 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'}) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | confirm() { | 
|---|
|  |  |  | this.matList[this.rowNum].anfme = this.count | 
|---|
|  |  |  | this.matList[this.rowNum].batch = this.batch | 
|---|
|  |  |  | this.$refs.revise.close() | 
|---|
|  |  |  | this.$forceUpdate() // 强制刷新 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | @import url(@/static/css/putOnSale.css); | 
|---|
|  |  |  | .footer { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 100rpx; | 
|---|
|  |  |  | line-height: 100rpx; | 
|---|
|  |  |  | background-color: #FFF; | 
|---|
|  |  |  | position: fixed; | 
|---|
|  |  |  | bottom: 0; | 
|---|
|  |  |  | border-top: 1px solid #d8d8d8; | 
|---|
|  |  |  | border-radius: 20rpx 20rpx 0 0 ; | 
|---|
|  |  |  | z-index: 1; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .revise-box { | 
|---|
|  |  |  | position: relative; | 
|---|
|  |  |  | width: 500rpx; | 
|---|
|  |  |  | height: 400rpx; | 
|---|
|  |  |  | border-radius: 25px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .revise-box-top { | 
|---|
|  |  |  | width: 400rpx; | 
|---|
|  |  |  | height: 120rpx; | 
|---|
|  |  |  | border-radius: 25px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .color-block-blue { | 
|---|
|  |  |  | background-color: #1E9FFF; | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | float: left; | 
|---|
|  |  |  | margin: 15rpx 15rpx 0 15rpx; | 
|---|
|  |  |  | width: 12rpx; | 
|---|
|  |  |  | height: 40rpx; | 
|---|
|  |  |  | border: 5rpx solid #1E9FFF; | 
|---|
|  |  |  | border-radius: 20rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .title { | 
|---|
|  |  |  | display: inline-block; | 
|---|
|  |  |  | float: left; | 
|---|
|  |  |  | font-size: 34rpx; | 
|---|
|  |  |  | font-weight: 700; | 
|---|
|  |  |  | height: 50rpx; | 
|---|
|  |  |  | line-height: 50rpx; | 
|---|
|  |  |  | margin-top: 10rpx; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|