|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<view class=""> |
|
|
|
<uni-popup ref="popup"> |
|
|
|
<u-popup v-model="show" mode="bottom"> |
|
|
|
<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"> |
|
|
@ -31,112 +31,101 @@ |
|
|
|
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
</u-popup> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
<script setup> |
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
import { ref,onBeforeMount } from 'vue'; |
|
|
|
import { onLoad } from '@dcloudio/uni-app'; // 引入 uni-app 的 onLoad 钩子 |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
title: { |
|
|
|
type: String, |
|
|
|
default: "编辑数量" |
|
|
|
}, |
|
|
|
settingParam: { |
|
|
|
type: Object, |
|
|
|
default: () => ({}) |
|
|
|
}, |
|
|
|
isShowStatus: { |
|
|
|
type: Boolean, |
|
|
|
default: true |
|
|
|
}, |
|
|
|
allowEditStatus: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
} |
|
|
|
}); |
|
|
|
const emit = defineEmits(['confirm']); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const popup = ref(null); |
|
|
|
const comMessage = ref(null); |
|
|
|
|
|
|
|
const allQty = ref(0); |
|
|
|
const balanceQty = ref(0); |
|
|
|
const inventoryStatus = ref(""); |
|
|
|
const originalInventoryStatus = ref(""); |
|
|
|
const dataContent = ref({}); |
|
|
|
const handleQty = ref(0); |
|
|
|
const reason = ref(""); |
|
|
|
const show = ref(false); |
|
|
|
|
|
|
|
|
|
|
|
const openEditPopup = (item, handleQty) => { |
|
|
|
dataContent.value = item; |
|
|
|
allQty.value = Number(handleQty); |
|
|
|
setTimeout(() => { |
|
|
|
show.value = true |
|
|
|
}, 100); |
|
|
|
}; |
|
|
|
|
|
|
|
const closeEditPopup = () => { |
|
|
|
show.value = false |
|
|
|
}; |
|
|
|
|
|
|
|
const confirm = () => { |
|
|
|
setValue(); |
|
|
|
}; |
|
|
|
|
|
|
|
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 { |
|
|
|
console.log(33, allQty.value); |
|
|
|
emit('confirm', Number(allQty.value)); |
|
|
|
closeEditPopup(); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const updateStatus = (value) => { |
|
|
|
inventoryStatus.value = value; |
|
|
|
console.log(inventoryStatus.value); |
|
|
|
}; |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|