|
@@ -38,8 +38,7 @@
|
|
已选<text>{{totalCategory}}</text>款/<text>{{totalQty}}</text>件
|
|
已选<text>{{totalCategory}}</text>款/<text>{{totalQty}}</text>件
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
- 查看明细
|
|
|
|
- <u-icon name="arrow-up"></u-icon>
|
|
|
|
|
|
+ 查看明细 <u-icon name="arrow-up"></u-icon>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="f-btns">
|
|
<view class="f-btns">
|
|
@@ -60,13 +59,12 @@
|
|
</div>
|
|
</div>
|
|
<div class="cpb_cart-list">
|
|
<div class="cpb_cart-list">
|
|
<view
|
|
<view
|
|
- @click="delDetail"
|
|
|
|
v-for="(item, index) in chooseList"
|
|
v-for="(item, index) in chooseList"
|
|
- :key="item.id"
|
|
|
|
|
|
+ :key="'cpb_'+item.id"
|
|
>
|
|
>
|
|
<view class="nav-right-item flex align_center">
|
|
<view class="nav-right-item flex align_center">
|
|
<view class="uni-col-1">
|
|
<view class="uni-col-1">
|
|
- <u-icon name="close-circle" color="#999" size="35"></u-icon>
|
|
|
|
|
|
+ <u-icon name="close-circle" color="#999" size="35" @click="delDetail(item,index)"></u-icon>
|
|
</view>
|
|
</view>
|
|
<view class="uni-col-11 flex">
|
|
<view class="uni-col-11 flex">
|
|
<view class="uni-col-2">
|
|
<view class="uni-col-2">
|
|
@@ -106,11 +104,12 @@
|
|
<view class="item-detail-text">
|
|
<view class="item-detail-text">
|
|
补货数量:
|
|
补货数量:
|
|
<u-number-box
|
|
<u-number-box
|
|
- v-model="item.checkQty"
|
|
|
|
|
|
+ v-model="item.replenishQty"
|
|
@minus="cartChangeNums"
|
|
@minus="cartChangeNums"
|
|
@plus="cartChangeNums"
|
|
@plus="cartChangeNums"
|
|
@blur="cartChangeNums"
|
|
@blur="cartChangeNums"
|
|
:index="'cart_'+item.id"
|
|
:index="'cart_'+item.id"
|
|
|
|
+ :min="1"
|
|
:max="999999"></u-number-box>
|
|
:max="999999"></u-number-box>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -144,6 +143,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { queryProductListForReplenish } from '@/api/shelf'
|
|
import { queryProductListForReplenish } from '@/api/shelf'
|
|
|
|
+ import { saveMainAndDetail } from '@/api/shelfReplenish'
|
|
import productList from './productList.vue'
|
|
import productList from './productList.vue'
|
|
import { clzConfirm } from '@/libs/tools'
|
|
import { clzConfirm } from '@/libs/tools'
|
|
export default {
|
|
export default {
|
|
@@ -153,7 +153,6 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
queryWord: '',
|
|
queryWord: '',
|
|
- qrCode: '',
|
|
|
|
nowData:null,
|
|
nowData:null,
|
|
detail:null,
|
|
detail:null,
|
|
pageNo:1,
|
|
pageNo:1,
|
|
@@ -164,7 +163,6 @@
|
|
partList: [],
|
|
partList: [],
|
|
allChecked: false,
|
|
allChecked: false,
|
|
showTab: false,
|
|
showTab: false,
|
|
- curType: [],
|
|
|
|
customBtnStyle: { // 自定义按钮样式
|
|
customBtnStyle: { // 自定义按钮样式
|
|
borderColor: this.$config('primaryColor'),
|
|
borderColor: this.$config('primaryColor'),
|
|
backgroundColor: this.$config('primaryColor'),
|
|
backgroundColor: this.$config('primaryColor'),
|
|
@@ -227,7 +225,7 @@
|
|
methods: {
|
|
methods: {
|
|
checkboxGroupChange(e) {
|
|
checkboxGroupChange(e) {
|
|
console.log(e);
|
|
console.log(e);
|
|
- this.curType = e
|
|
|
|
|
|
+ this.stockStateList = e
|
|
},
|
|
},
|
|
// 全选
|
|
// 全选
|
|
allCheckeChange(e){
|
|
allCheckeChange(e){
|
|
@@ -260,6 +258,7 @@
|
|
// 打开购物车
|
|
// 打开购物车
|
|
openCart(){
|
|
openCart(){
|
|
if(this.totalCategory){
|
|
if(this.totalCategory){
|
|
|
|
+ this.chooseList = this.$refs.productList.getAllChecked()
|
|
this.showCart = !this.showCart
|
|
this.showCart = !this.showCart
|
|
}else{
|
|
}else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -268,7 +267,18 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 清空购物车
|
|
|
|
|
|
+ // 删除购物车产品
|
|
|
|
+ delDetail(item,i){
|
|
|
|
+ console.log(item.id,i)
|
|
|
|
+ this.$refs.productList.setChecked(item.id,false)
|
|
|
|
+ const index = this.chooseList.findIndex(k => k.id == item.id)
|
|
|
|
+ this.chooseList.splice(index,1)
|
|
|
|
+ // 全部清空
|
|
|
|
+ if(this.chooseList.length==0){
|
|
|
|
+ this.clearChoose()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 空列表
|
|
clearDetail(){
|
|
clearDetail(){
|
|
const _this = this
|
|
const _this = this
|
|
clzConfirm({
|
|
clzConfirm({
|
|
@@ -276,19 +286,24 @@
|
|
content: '确认要清空列表吗?',
|
|
content: '确认要清空列表吗?',
|
|
success (ret) {
|
|
success (ret) {
|
|
if (ret.confirm || ret.index == 0) {
|
|
if (ret.confirm || ret.index == 0) {
|
|
- _this.chooseList = []
|
|
|
|
- _this.showCart = false
|
|
|
|
|
|
+ _this.clearChoose()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 清空已选数据
|
|
|
|
+ clearChoose(){
|
|
|
|
+ this.chooseList = []
|
|
|
|
+ this.showCart = false
|
|
|
|
+ this.allChecked = false
|
|
|
|
+ this.$refs.productList.allSelect(false)
|
|
|
|
+ },
|
|
// 修改数量
|
|
// 修改数量
|
|
cartChangeNums(v){
|
|
cartChangeNums(v){
|
|
- console.log(v,this.showCart)
|
|
|
|
- const data = this.chooseList.find(item => item.id == v.index.split('_')[1])
|
|
|
|
|
|
+ this.$refs.productList.changeNums(v.index.split('_')[1],v.value)
|
|
},
|
|
},
|
|
handleClear(){
|
|
handleClear(){
|
|
- this.curType = []
|
|
|
|
|
|
+ this.stockStateList = []
|
|
this.queryKeys.map(item => item.checked = false)
|
|
this.queryKeys.map(item => item.checked = false)
|
|
this.clearSearch()
|
|
this.clearSearch()
|
|
},
|
|
},
|
|
@@ -310,6 +325,10 @@
|
|
stockStateList: this.stockStateList
|
|
stockStateList: this.stockStateList
|
|
}
|
|
}
|
|
_this.status = 'loading'
|
|
_this.status = 'loading'
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ mask:true,
|
|
|
|
+ title:"正在加载..."
|
|
|
|
+ })
|
|
queryProductListForReplenish(params).then(res => {
|
|
queryProductListForReplenish(params).then(res => {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
@@ -326,12 +345,10 @@
|
|
this.$refs.productList.setData(_this.partList)
|
|
this.$refs.productList.setData(_this.partList)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 提交盘点单
|
|
|
|
|
|
+ // 提交
|
|
submitOrder(){
|
|
submitOrder(){
|
|
- if(this.chooseList.length){
|
|
|
|
- uni.navigateTo({
|
|
|
|
- url: '/pages/stockCheck/submitStockCheck?stockCheckSn='+this.stockCheckSn+'&type=submit'
|
|
|
|
- })
|
|
|
|
|
|
+ if(this.totalCategory){
|
|
|
|
+ this.handleSave()
|
|
}else{
|
|
}else{
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -339,6 +356,32 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ handleSave () {
|
|
|
|
+ const data = this.chooseList
|
|
|
|
+ const dataList = []
|
|
|
|
+ data.map(item => {
|
|
|
|
+ dataList.push({
|
|
|
|
+ shelfPlaceSn: item.shelfPlaceSn,
|
|
|
|
+ shelfPlaceCode: item.shelfPlaceCode,
|
|
|
|
+ productSn: item.productSn,
|
|
|
|
+ productCode: item.productCode,
|
|
|
|
+ qty: item.replenishQty
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ this.showLoading("正在提交...")
|
|
|
|
+ // 开始提交
|
|
|
|
+ saveMainAndDetail({
|
|
|
|
+ shelfSn: this.nowData.shelfSn,
|
|
|
|
+ dealerSn: this.nowData.dealerSn,
|
|
|
|
+ detailList: dataList
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.toashMsg(res.message)
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ }
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
// 扫描
|
|
// 扫描
|
|
toScan(){
|
|
toScan(){
|
|
this.mpaasScanModule = uni.requireNativePlugin("wss-scan")
|
|
this.mpaasScanModule = uni.requireNativePlugin("wss-scan")
|
|
@@ -366,7 +409,7 @@
|
|
const ret = data.scanValue.split("&")
|
|
const ret = data.scanValue.split("&")
|
|
this.queryWord = ret[1] // 产品编码
|
|
this.queryWord = ret[1] // 产品编码
|
|
}else{
|
|
}else{
|
|
- this.qrCode = data.scanValue
|
|
|
|
|
|
+ this.queryWord = data.scanValue
|
|
}
|
|
}
|
|
this.stockStateList = []
|
|
this.stockStateList = []
|
|
this.getpartList()
|
|
this.getpartList()
|
|
@@ -449,7 +492,7 @@
|
|
font-size: 0.8rem;
|
|
font-size: 0.8rem;
|
|
color: #666;
|
|
color: #666;
|
|
> view{
|
|
> view{
|
|
- padding: 0 10upx;
|
|
|
|
|
|
+ padding: 0 5upx;
|
|
&:first-child{
|
|
&:first-child{
|
|
text{
|
|
text{
|
|
color: red;
|
|
color: red;
|