|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<uni-popup ref="popup"> |
|
|
<u-popup v-model="show" mode="bottom"> |
|
|
<view class="uni-flex uni-column pop_customer"> |
|
|
<view class="uni-flex uni-column pop_customer"> |
|
|
<view class="" style="padding:10rpx"> |
|
|
<view class="" style="padding:10rpx"> |
|
|
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx"> |
|
|
<view class="uni-flex u-col-center uni-row space-between" style="padding: 10rpx 10rpx 20rpx 10rpx"> |
|
@ -31,56 +31,27 @@ |
|
|
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|
|
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</u-popup> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script setup> |
|
|
import uom from '@/mycomponents/qty/uom.vue' |
|
|
import uom from '@/mycomponents/qty/uom.vue' |
|
|
import StdUom from '@/mycomponents/qty/StdUom.vue' |
|
|
import StdUom from '@/mycomponents/qty/StdUom.vue' |
|
|
import balanceStatus from '@/mycomponents/status/balanceStatus.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: "" |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
import { ref,onBeforeMount } from 'vue'; |
|
|
}, |
|
|
import { onLoad } from '@dcloudio/uni-app'; // 引入 uni-app 的 onLoad 钩子 |
|
|
watch: { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
const props = defineProps({ |
|
|
created() { |
|
|
|
|
|
// this.reasonList = getInspectReasonList(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
title: { |
|
|
title: { |
|
|
type: String, |
|
|
type: String, |
|
|
default: "编辑数量" |
|
|
default: "编辑数量" |
|
|
}, |
|
|
}, |
|
|
settingParam: { |
|
|
settingParam: { |
|
|
type: Object, |
|
|
type: Object, |
|
|
default: {} |
|
|
default: () => ({}) |
|
|
}, |
|
|
}, |
|
|
isShowStatus: { |
|
|
isShowStatus: { |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
@ -90,53 +61,71 @@ |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
default: false |
|
|
default: false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}); |
|
|
methods: { |
|
|
const emit = defineEmits(['confirm']); |
|
|
openEditPopup(item, handleQty) { |
|
|
|
|
|
this.dataContent = item |
|
|
|
|
|
this.allQty = Number(handleQty) |
|
|
|
|
|
setTimeout(res => { |
|
|
const popup = ref(null); |
|
|
this.$refs.popup.open('bottom') |
|
|
const comMessage = ref(null); |
|
|
}, 100) |
|
|
|
|
|
}, |
|
|
const allQty = ref(0); |
|
|
closeEditPopup() { |
|
|
const balanceQty = ref(0); |
|
|
this.$refs.popup.close() |
|
|
const inventoryStatus = ref(""); |
|
|
}, |
|
|
const originalInventoryStatus = ref(""); |
|
|
confirm() { |
|
|
const dataContent = ref({}); |
|
|
this.setValue(); |
|
|
const handleQty = ref(0); |
|
|
}, |
|
|
const reason = ref(""); |
|
|
cancel() { |
|
|
const show = ref(false); |
|
|
this.dataContent.inventoryStatus = this.originalInventoryStatus; |
|
|
|
|
|
this.closeEditPopup(); |
|
|
|
|
|
}, |
|
|
const openEditPopup = (item, handleQty) => { |
|
|
calcQty(val) { |
|
|
dataContent.value = item; |
|
|
this.allQty = val * Number(this.dataContent.packQty); |
|
|
allQty.value = Number(handleQty); |
|
|
}, |
|
|
setTimeout(() => { |
|
|
setValue() { |
|
|
show.value = true |
|
|
var balanceQty = Number(this.dataContent.qty); |
|
|
}, 100); |
|
|
if (this.allQty == 0) { |
|
|
}; |
|
|
this.$refs.comMessage.showConfirmWarningModal('数量必须大于0', |
|
|
|
|
|
res => { |
|
|
const closeEditPopup = () => { |
|
|
this.allQty = balanceQty; |
|
|
show.value = false |
|
|
}) |
|
|
}; |
|
|
} else if (this.allQty > balanceQty) { |
|
|
|
|
|
this.$refs.comMessage.showConfirmWarningModal('数量[' + this.allQty + ']不允许大于库存数量[' + balanceQty + ']', |
|
|
const confirm = () => { |
|
|
res => { |
|
|
setValue(); |
|
|
this.allQty = balanceQty; |
|
|
}; |
|
|
}) |
|
|
|
|
|
|
|
|
const cancel = () => { |
|
|
|
|
|
dataContent.value.inventoryStatus = originalInventoryStatus.value; |
|
|
|
|
|
closeEditPopup(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const calcQty = (val) => { |
|
|
|
|
|
allQty.value = val * Number(dataContent.value.packQty); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const setValue = () => { |
|
|
|
|
|
const balanceQtyValue = Number(dataContent.value.qty); |
|
|
|
|
|
if (allQty.value === 0) { |
|
|
|
|
|
comMessage.value.showConfirmWarningModal('数量必须大于0', () => { |
|
|
|
|
|
allQty.value = balanceQtyValue; |
|
|
|
|
|
}); |
|
|
|
|
|
} else if (allQty.value > balanceQtyValue) { |
|
|
|
|
|
comMessage.value.showConfirmWarningModal(`数量[${allQty.value}]不允许大于库存数量[${balanceQtyValue}]`, () => { |
|
|
|
|
|
allQty.value = balanceQtyValue; |
|
|
|
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
console.log(33,this.allQty) |
|
|
console.log(33, allQty.value); |
|
|
this.$emit("confirm", Number(this.allQty)); |
|
|
emit('confirm', Number(allQty.value)); |
|
|
this.closeEditPopup(); |
|
|
closeEditPopup(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const updateStatus = (value) => { |
|
|
|
|
|
inventoryStatus.value = value; |
|
|
|
|
|
console.log(inventoryStatus.value); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
updateStatus(value) { |
|
|
|
|
|
this.inventoryStatus = value |
|
|
|
|
|
console.log(this.inventoryStatus) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|