|
@@ -86,7 +86,7 @@
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title">库存预警值</view>
|
|
<view class="tui-title">库存预警值</view>
|
|
|
<input v-model="form.stockWarning" style="width:300upx;" @focus="form.stockWarning=''" placeholder-class="phcolor" class="tui-input" name="stockWarning" placeholder="请填写" maxlength="50" type="number" />
|
|
<input v-model="form.stockWarning" style="width:300upx;" @focus="form.stockWarning=''" placeholder-class="phcolor" class="tui-input" name="stockWarning" placeholder="请填写" maxlength="50" type="number" />
|
|
|
- <button v-if="productData.id > 0" class="admin-button-com blue middle" @click="printLabel(productData)">打标签</button>
|
|
|
|
|
|
|
+ <button v-if="productData.id > 0" class="admin-button-com blue middle" @click="doPrintLabel(productData.id)">打标签</button>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
@@ -133,6 +133,11 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
</form>
|
|
</form>
|
|
|
|
|
+
|
|
|
|
|
+ <uni-popup ref="inputDialog" type="dialog">
|
|
|
|
|
+ <uni-popup-dialog ref="inputClose" mode="input" title="标签数量" value=""
|
|
|
|
|
+ placeholder="请输入标签数量" @confirm="dialogPrintLabelConfirm"></uni-popup-dialog>
|
|
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -186,7 +191,8 @@ export default {
|
|
|
hasRequest:0,
|
|
hasRequest:0,
|
|
|
productData:{id:0},
|
|
productData:{id:0},
|
|
|
headers:{token:''},
|
|
headers:{token:''},
|
|
|
- cost:0
|
|
|
|
|
|
|
+ cost:0,
|
|
|
|
|
+ printItemId:0
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
@@ -211,23 +217,32 @@ export default {
|
|
|
watch:{
|
|
watch:{
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- printLabel(item){
|
|
|
|
|
|
|
+ doPrintLabel(id){
|
|
|
|
|
+ this.printItemId = id
|
|
|
|
|
+ this.$refs.inputDialog.open()
|
|
|
|
|
+ },
|
|
|
|
|
+ dialogPrintLabelConfirm(count) {
|
|
|
let that=this;
|
|
let that=this;
|
|
|
- let doList = ['打1个标签', '打2个标签','打5个标签', '打10个标签','打100个标签','打500个标签']
|
|
|
|
|
- let doNum = [1,2,5,10,100,500]
|
|
|
|
|
- uni.showActionSheet({
|
|
|
|
|
- itemList: doList,
|
|
|
|
|
- success: function (respond) {
|
|
|
|
|
- let index = respond.tapIndex
|
|
|
|
|
- let currentNum = Number(doNum[index])
|
|
|
|
|
- print({id:item.id,num:currentNum}).then(res=>{
|
|
|
|
|
- if(res.code == 1){
|
|
|
|
|
- that.$msg(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.$refs.inputDialog.close()
|
|
|
|
|
+
|
|
|
|
|
+ let currentNum = Number(count)
|
|
|
|
|
+ let itemId = this.printItemId
|
|
|
|
|
+ if (currentNum <= 0) {
|
|
|
|
|
+ that.$msg('打印数量不能小于等于0')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (itemId == 0) {
|
|
|
|
|
+ that.$msg('打印的花材id出错')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ print({id:itemId,num:currentNum}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ that.$msg(res.msg)
|
|
|
|
|
+ } else if(res.code == 0){
|
|
|
|
|
+ that.$msg(res.msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
notModify(){
|
|
notModify(){
|
|
|
this.$msg('不可修改')
|
|
this.$msg('不可修改')
|
|
|
},
|
|
},
|