王志国
4 weeks ago
4 changed files with 186 additions and 7 deletions
@ -0,0 +1,161 @@ |
|||
<template> |
|||
<view class=""> |
|||
<uni-popup ref="popup"> |
|||
<view class="uni-flex uni-column pop_customer"> |
|||
<view class="" style="padding:10rpx"> |
|||
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx"> |
|||
<view class="" style="font-size: 35rpx;"> |
|||
{{title}} |
|||
</view> |
|||
<image style="width: 35rpx;height: 35rpx;" src="/static/icons/icons_close.svg" |
|||
@click="closeEditPopup"></image> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
<view class="uni-flex uni-column" style="background-color: white; height:60%;"> |
|||
<view class="uni-flex uni-column "> |
|||
|
|||
<view class="uni-flex uni-row space-between padding title u-col-center"> |
|||
<text>数量 : </text> |
|||
<view class="uni-flex uni-row uni-center" style="align-items: center;"> |
|||
<input class="qty_input" v-model="allQty" :focus="true" type="number" |
|||
@confirm="confirm()" /> |
|||
<uom :uom="dataContent.uom"></uom> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="uni-flex uni-row hide_border"> |
|||
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="cancel()">取消</button> |
|||
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import uom from '@/mycomponents/qty/uom.vue' |
|||
import StdUom from '@/mycomponents/qty/StdUom.vue' |
|||
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' |
|||
// import { |
|||
// getInspectReasonList |
|||
// } from '@/common/directory.js'; |
|||
|
|||
export default { |
|||
components: { |
|||
uom, |
|||
StdUom, |
|||
balanceStatus, |
|||
}, |
|||
data() { |
|||
return { |
|||
allQty: 0, |
|||
stdCount: 1, |
|||
stateData: 0, |
|||
balanceQty: 0, |
|||
inventoryStatus: "", |
|||
originalInventoryStatus: "", |
|||
dataContent: {}, |
|||
handleQty: 0, |
|||
FailedQty: 0, |
|||
reasonList: [], |
|||
reason: "" |
|||
|
|||
} |
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
created() { |
|||
// this.reasonList = getInspectReasonList(); |
|||
}, |
|||
|
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: "编辑数量" |
|||
}, |
|||
settingParam: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
isShowStatus: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
allowEditStatus: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}, |
|||
methods: { |
|||
openEditPopup(item, handleQty) { |
|||
this.dataContent = item |
|||
this.allQty = Number(handleQty) |
|||
setTimeout(res => { |
|||
this.$refs.popup.open('bottom') |
|||
}, 100) |
|||
}, |
|||
closeEditPopup() { |
|||
this.$refs.popup.close() |
|||
}, |
|||
confirm() { |
|||
this.setValue(); |
|||
}, |
|||
cancel() { |
|||
this.dataContent.inventoryStatus = this.originalInventoryStatus; |
|||
this.closeEditPopup(); |
|||
}, |
|||
calcQty(val) { |
|||
this.allQty = val * Number(this.dataContent.packQty); |
|||
}, |
|||
setValue() { |
|||
var balanceQty = Number(this.dataContent.qty); |
|||
if (this.allQty == 0) { |
|||
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0', |
|||
res => { |
|||
this.allQty = balanceQty; |
|||
}) |
|||
} else if (this.allQty > balanceQty) { |
|||
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']', |
|||
res => { |
|||
this.allQty = balanceQty; |
|||
}) |
|||
} else { |
|||
console.log(33,this.allQty) |
|||
this.$emit("confirm", Number(this.allQty)); |
|||
this.closeEditPopup(); |
|||
} |
|||
}, |
|||
|
|||
updateStatus(value) { |
|||
this.inventoryStatus = value |
|||
console.log(this.inventoryStatus) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.uni-popup .uni-popup__wrapper { |
|||
width: 100% !important; |
|||
padding: 30rpx; |
|||
} |
|||
|
|||
.hide_border { |
|||
button { |
|||
border: none; |
|||
} |
|||
|
|||
button::after { |
|||
border: none; |
|||
} |
|||
} |
|||
|
|||
.title { |
|||
font-size: 30rpx; |
|||
} |
|||
</style> |
Loading…
Reference in new issue