|
|
@ -8,7 +8,12 @@ |
|
|
|
<view class="cc-name">{{e.name || '-'}}</view> |
|
|
|
<view class="cc-num"> |
|
|
|
<view hover-class="hover-active" @click="reduceStock(i)">-</view> |
|
|
|
<input :class="[e.stock<=e.limit?'active':'']" :value="e.stock" disabled /> |
|
|
|
<input |
|
|
|
@change="stockInputChange($event,i)" |
|
|
|
:class="[e.stock<=e.limit?'active':'']" |
|
|
|
:value="e.stock" |
|
|
|
type="number" |
|
|
|
/> |
|
|
|
<view hover-class="hover-active" class="active" @click="addStock(i)">+</view> |
|
|
|
</view> |
|
|
|
<view class="cc-price"><text>¥</text>{{e.price || 0}}</view> |
|
|
@ -17,11 +22,12 @@ |
|
|
|
</view> |
|
|
|
<view class="cm-tip">Tips:一包标准粉如若大概能冲40杯左右,建议一包填38杯库存。</view> |
|
|
|
<view class="cm-fixed-bar"> |
|
|
|
<view class="cfb-select-all" @click="isFillAll = !isFillAll"> |
|
|
|
<!-- PM: 删掉, 没有上限--> |
|
|
|
<!-- <view class="cfb-select-all" @click="isFillAll = !isFillAll"> |
|
|
|
<image v-if="isFillAll" class="active" mode="aspectFit" src="/subpackage/device/static/images/selected_987.png"></image> |
|
|
|
<image v-else></image> |
|
|
|
<text>全部饮品补满</text> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
<view class="cfb-confirm" hover-class="hover-active" @click="confirmSave">确认补粉</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -50,8 +56,14 @@ export default { |
|
|
|
this.coffeeList(_query.id); |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
stockInputChange(e,i){ |
|
|
|
let _typeList = this.typeList.slice(); |
|
|
|
_typeList[i].stock = e.detail.value; |
|
|
|
this.typeList = _typeList; |
|
|
|
}, |
|
|
|
confirmSave: util.debounce(function(){ |
|
|
|
let { typeList, isFillAll } = this; |
|
|
|
if(!typeList.length)return; |
|
|
|
util.showModal({ |
|
|
|
title: '是否确认补粉?', |
|
|
|
content: isFillAll?'请确认全部补满':'', |
|
|
@ -59,7 +71,7 @@ export default { |
|
|
|
success: res=>{ |
|
|
|
if(res.confirm){ |
|
|
|
this.confirmReq( |
|
|
|
typeList.map(e=>({id: e.id, stock: isFillAll? e.depth || 38 : e.stock})) |
|
|
|
typeList.map(e=>({id: e.id, stock: isFillAll? e.depth : e.stock})) |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
@ -92,7 +104,7 @@ export default { |
|
|
|
}, |
|
|
|
addStock(index){ |
|
|
|
let _typeList = this.typeList.slice(); |
|
|
|
_typeList[index].stock++; |
|
|
|
_typeList[index].stock++ |
|
|
|
this.typeList = _typeList; |
|
|
|
}, |
|
|
|
coffeeList(hardware_id){ |
|
|
@ -205,7 +217,7 @@ export default { |
|
|
|
padding-bottom: calc( 10upx + env(safe-area-inset-bottom)); /* 兼容 iOS >= 11.2 */ |
|
|
|
padding-top: 10upx; |
|
|
|
background-color: #fff; |
|
|
|
@include centerFlex(space-between); |
|
|
|
@include centerFlex(flex-end); |
|
|
|
.cfb-select-all{ |
|
|
|
font-size: 28upx; |
|
|
|
line-height: 40upx; |
|
|
|