|
@@ -1,4 +1,5 @@
|
|
|
<template>
|
|
|
+ <view>
|
|
|
<view class="p-content">
|
|
|
<view class="p-head" v-if="baseData">
|
|
|
<view>
|
|
@@ -7,7 +8,7 @@
|
|
|
<text style="color: crimson;">{{baseData.purchaseBillNo}}</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <button :disabled="loading" size="mini" type="primary" @click="toOut"> 入库 <text class="iconfont icon-icon-test43"></text></button>
|
|
|
+ <button :disabled="loading" size="mini" style="padding:0 10px;height: 28px;line-height: 28px;" type="primary" @click="toOut"> 入库 <text class="iconfont icon-icon-test43"></text></button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view>
|
|
@@ -28,6 +29,9 @@
|
|
|
border="surround"
|
|
|
v-model="code">
|
|
|
</view>
|
|
|
+ <view>
|
|
|
+ <button size="mini" style="padding:0 10px;height: 30px;line-height: 30px;margin-left: 10px;margin-top: 3px;" :style="{color:'#aa0000'}" @click="resetInput">重置</button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view style="justify-content: flex-start;flex-wrap: wrap;" v-if="baseData">
|
|
@@ -39,69 +43,75 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="p-body">
|
|
|
- <uni-table style="width: 100%;" border emptyText="暂无数据" :loading="loading" >
|
|
|
- <!-- 表头行 -->
|
|
|
- <uni-tr>
|
|
|
- <uni-td align="center">产品编码</uni-td>
|
|
|
- <uni-td align="center">仓库仓位</uni-td>
|
|
|
- <uni-td align="center">入库/发货数量</uni-td>
|
|
|
- </uni-tr>
|
|
|
- <!-- 表格数据行 -->
|
|
|
- <uni-tr
|
|
|
- v-for="item in detailList"
|
|
|
- :key="item.id"
|
|
|
- :checkedRow="hasCheck(item)"
|
|
|
- @click="editRow(item)"
|
|
|
- >
|
|
|
- <uni-td width="30%" align="center">
|
|
|
- <view>{{item.dealerProductEntity&&item.dealerProductEntity.code||'--'}}</view>
|
|
|
- </uni-td>
|
|
|
- <uni-td width="30%" align="center">
|
|
|
- <view>
|
|
|
- <view>{{item.warehouseEntity&&item.warehouseEntity.name||defWarehouseName[0]}}/</view>
|
|
|
- <view>{{item.warehouseLocationEntity&&item.warehouseLocationEntity.name||defWarehouseName[1]}}</view>
|
|
|
- </view>
|
|
|
- </uni-td>
|
|
|
- <uni-td width="40%" align="center"><text style="color: red;">{{item.realPutQty||'0'}}</text>/{{item.putQty}}</uni-td>
|
|
|
- </uni-tr>
|
|
|
- </uni-table>
|
|
|
+ <scroll-view :scroll-top="scrollTop" :scroll-y="true" class="scrollView">
|
|
|
+ <uni-table style="width: 100%;" border emptyText="暂无数据" :loading="loading" >
|
|
|
+ <!-- 表头行 -->
|
|
|
+ <uni-tr>
|
|
|
+ <uni-td align="center">产品编码</uni-td>
|
|
|
+ <uni-td align="center">仓库仓位</uni-td>
|
|
|
+ <uni-td align="center">入库/发货数量</uni-td>
|
|
|
+ </uni-tr>
|
|
|
+ <!-- 表格数据行 -->
|
|
|
+ <uni-tr
|
|
|
+ v-for="item in detailList"
|
|
|
+ :key="item.id"
|
|
|
+ :id="item.id"
|
|
|
+ :checkedRow="hasCheck(item)"
|
|
|
+ @click="selRow(item)"
|
|
|
+ >
|
|
|
+ <uni-td width="30%" align="center">
|
|
|
+ <view>{{item.dealerProductEntity&&item.dealerProductEntity.code||'--'}}</view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td width="35%" align="center">
|
|
|
+ <view>
|
|
|
+ {{item.warehouseEntity&&item.warehouseEntity.name||defWarehouseName[0]}}/{{item.warehouseLocationEntity&&item.warehouseLocationEntity.name||defWarehouseName[1]}}
|
|
|
+ </view>
|
|
|
+ </uni-td>
|
|
|
+ <uni-td width="35%" align="center">
|
|
|
+ <view @click="editRow(item)">
|
|
|
+ <text style="color: red;">{{item.realPutQty||'0'}}</text>/{{item.putQty}}
|
|
|
+ </view>
|
|
|
+ </uni-td>
|
|
|
+ </uni-tr>
|
|
|
+ </uni-table>
|
|
|
+ </scroll-view>
|
|
|
</view>
|
|
|
<view class="p-footer">
|
|
|
<button size="mini" type="warn" @click="pickFun(false)"> <text class="iconfont icon-reduce-btn"> 减 </text></button>
|
|
|
<button size="mini" type="primary" @click="pickFun(true)"> <text class="iconfont icon-add-btn"> 加 </text></button>
|
|
|
</view>
|
|
|
- <scanCode @onKeyDown="keyDown"></scanCode>
|
|
|
- <!-- 选择仓库 -->
|
|
|
- <chooseWarehouse ref="chooseWarehouse" :openPick="showPick" :value="warehouseVal" @close="showPick=false" @change="confirmWarehouse"></chooseWarehouse>
|
|
|
- <!-- 左键扫描,修改包装数 -->
|
|
|
- <uni-popup ref="popup" :mask-click="false" type="dialog">
|
|
|
- <view style="background-color: #fff;padding: 30rpx 50rpx;border-radius: 30rpx;width: 75%;margin: 0 auto;">
|
|
|
- <view v-if="tempProduct">
|
|
|
- <view style="padding: 30rpx 0;">
|
|
|
- 产品编码:{{tempProduct.dealerProductEntity.code}}
|
|
|
- </view>
|
|
|
- <view style="display: flex;align-items: center;">
|
|
|
- 数量:
|
|
|
- <u--input
|
|
|
- placeholder="请输入数量"
|
|
|
- border="surround"
|
|
|
- v-model="tempProduct.packQty"
|
|
|
- :min="0"
|
|
|
- type="digit"
|
|
|
- ></u--input>
|
|
|
- {{tempProduct.dealerProductEntity.unit}}
|
|
|
- {{tempProduct.dealerProductEntity.packQtyUnit?("/"+tempProduct.dealerProductEntity.packQtyUnit):''}}
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
+ <scanCode @onKeyDown="keyDown"></scanCode>
|
|
|
+ <!-- 选择仓库 -->
|
|
|
+ <chooseWarehouse ref="chooseWarehouse" :openPick="showPick" :value="warehouseVal" @close="showPick=false" @change="confirmWarehouse"></chooseWarehouse>
|
|
|
+ <!-- 左键扫描,修改包装数 -->
|
|
|
+ <uni-popup ref="popup" :mask-click="false" type="dialog">
|
|
|
+ <view style="background-color: #fff;padding: 30rpx 50rpx;border-radius: 30rpx;width: 75%;margin: 0 auto;">
|
|
|
+ <view v-if="tempProduct">
|
|
|
+ <view style="padding: 30rpx 0;">
|
|
|
+ 产品编码:{{tempProduct.dealerProductEntity.code}}
|
|
|
</view>
|
|
|
- <view style="display: flex;padding: 60rpx 15rpx 10rpx;justify-content: space-between;">
|
|
|
- <button size="mini" @click="closePop">取消</button>
|
|
|
- <button size="mini" type="primary" @click="okPop">确定</button>
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ 数量:
|
|
|
+ <u--input
|
|
|
+ placeholder="请输入数量"
|
|
|
+ border="surround"
|
|
|
+ v-model="tempProduct.packQty"
|
|
|
+ :min="0"
|
|
|
+ type="digit"
|
|
|
+ ></u--input>
|
|
|
+ {{tempProduct.dealerProductEntity.unit}}
|
|
|
+ {{tempProduct.dealerProductEntity.packQtyUnit?("/"+tempProduct.dealerProductEntity.packQtyUnit):''}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- </uni-popup>
|
|
|
-
|
|
|
- <u-modal :show="showModal" :title="msg.title" :confirmText="msg.confirmText" showCancelButton :content='msg.content' @cancel="showModal=false" @confirm="confirmModal"></u-modal>
|
|
|
- </view>
|
|
|
+ <view style="display: flex;padding: 60rpx 15rpx 10rpx;justify-content: space-between;">
|
|
|
+ <button size="mini" @click="closePop">取消</button>
|
|
|
+ <button size="mini" type="primary" @click="okPop">确定</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+ <u-modal :show="showModal" :title="msg.title" :confirmText="msg.confirmText" showCancelButton :content='msg.content' @cancel="showModal=false" @confirm="confirmModal"></u-modal>
|
|
|
+</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -130,7 +140,8 @@
|
|
|
defWarehouse: [],
|
|
|
defWarehouseName:[],
|
|
|
keyName: '',
|
|
|
- warehouseVal: []
|
|
|
+ warehouseVal: [],
|
|
|
+ scrollTop: 0,
|
|
|
};
|
|
|
},
|
|
|
onLoad(opts) {
|
|
@@ -184,9 +195,22 @@
|
|
|
return curProduct&&curProduct.id == item.id
|
|
|
},
|
|
|
// 获取所有可操作商品
|
|
|
- getCurProduct(){
|
|
|
+ getCurProduct(flag){
|
|
|
const curProduct = this.detailList.filter(item => item.dealerProductEntity&&item.dealerProductEntity.qrCode == this.code)
|
|
|
this.curProductArr = curProduct || []
|
|
|
+
|
|
|
+ // 滚动到指定位置
|
|
|
+ if(this.curProductArr.length&&!flag){
|
|
|
+ const cur = this.curProductArr[0]
|
|
|
+ this.scrollToRow(cur)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 选择行
|
|
|
+ selRow(item){
|
|
|
+ this.code = item.dealerProductEntity&&item.dealerProductEntity.qrCode||''
|
|
|
+ this.getCurProduct(true)
|
|
|
+ const idx = this.curProductArr.findIndex(k => k.id == item.id)
|
|
|
+ this.curProductIndex = idx || 0
|
|
|
},
|
|
|
// 获取当前操作行
|
|
|
getCurRow(){
|
|
@@ -197,6 +221,18 @@
|
|
|
}
|
|
|
return curProduct
|
|
|
},
|
|
|
+ // 滚动到指定行
|
|
|
+ scrollToRow(cur){
|
|
|
+ const idx = this.detailList.findIndex(item => item.id == cur.id)
|
|
|
+ this.scrollTop = idx * 60
|
|
|
+ },
|
|
|
+ // 清空输入框
|
|
|
+ resetInput(){
|
|
|
+ this.code = ''
|
|
|
+ this.curProductIndex = 0
|
|
|
+ this.getCurProduct()
|
|
|
+ this.scrollTop = 0
|
|
|
+ },
|
|
|
pickFun(flag){
|
|
|
playAudio('info')
|
|
|
this.getCurProduct()
|
|
@@ -204,8 +240,8 @@
|
|
|
},
|
|
|
addQty(flag){
|
|
|
const curProduct = this.getCurRow()
|
|
|
- // console.log(curProduct)
|
|
|
if(curProduct){
|
|
|
+ curProduct.realPutQty = curProduct.realPutQty || 0
|
|
|
this.loading = true
|
|
|
// 加
|
|
|
if(flag){
|
|
@@ -278,6 +314,7 @@
|
|
|
this.loading = false
|
|
|
})
|
|
|
}else{
|
|
|
+ this.loading = false
|
|
|
uni.$u.toast("入库数量不能小于0")
|
|
|
playAudio('warn')
|
|
|
}
|
|
@@ -313,7 +350,6 @@
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
// 详情
|
|
|
getDetail(){
|
|
|
receivingQuery({receivingBillSn: this.receivingBillSn, source : "PDA"}).then(res => {
|
|
@@ -406,15 +442,19 @@
|
|
|
}
|
|
|
}
|
|
|
.p-body{
|
|
|
- overflow: auto;
|
|
|
flex-grow: 1;
|
|
|
- height: 50%;
|
|
|
+ height: calc(100vh - 240px);
|
|
|
+ .scrollView{
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
.p-footer{
|
|
|
- padding:30upx;
|
|
|
+ padding: 20upx;
|
|
|
display: flex;
|
|
|
> button{
|
|
|
width: 40%;
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
}
|
|
|
}
|
|
|
}
|