From 5f53730decf4a8c04c17616d4418fbb1b8f3026e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E5=BF=97=E5=9B=BD?= <854933521@qq.com>
Date: Tue, 29 Oct 2024 14:32:16 +0800
Subject: [PATCH] =?UTF-8?q?mycomponents/qty=20=E6=96=87=E4=BB=B6=E8=BF=81?=
=?UTF-8?q?=E7=A7=BB=208/8-10/25?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mycomponents/qty/balanceQtyEdit.vue | 18 ++-
src/mycomponents/qty/countQtyEdit.vue | 2 +-
src/mycomponents/qty/qtyEdit.vue | 161 ++++++++++++++++++++++++
src/mycomponents/qty/recommendQty.vue | 12 +-
4 files changed, 186 insertions(+), 7 deletions(-)
create mode 100644 src/mycomponents/qty/qtyEdit.vue
diff --git a/src/mycomponents/qty/balanceQtyEdit.vue b/src/mycomponents/qty/balanceQtyEdit.vue
index 6b69f01a..2a350b22 100644
--- a/src/mycomponents/qty/balanceQtyEdit.vue
+++ b/src/mycomponents/qty/balanceQtyEdit.vue
@@ -23,7 +23,7 @@
标包量 :
- {{ Number(dataContent.packQty) }}
+ {{ Number(dataContent.packQty) || 0}}
@@ -32,7 +32,9 @@
数量 :
-
+
@@ -86,7 +88,15 @@ const props = defineProps({
allowEditStatus: {
type: Boolean,
default: false
- }
+ },
+ queryBalance: {
+ type: Boolean,
+ default: true
+ },
+ allowEditQty: {
+ type: Boolean,
+ default: true
+ },
})
const allQty = ref(0)
const stdCount = ref(0)
@@ -148,7 +158,7 @@ const calcQty = (e) => {
}
const setValue = () => {
const balanceQty = Number(dataContent.value.balanceQty)
- if (allQty.value < 0) {
+ if (allQty.value <= 0) {
comMessageRef.value.showErrorMessage('数量必须等于0', (res) => {
if (res) {
allQty.value = balanceQty
diff --git a/src/mycomponents/qty/countQtyEdit.vue b/src/mycomponents/qty/countQtyEdit.vue
index ff2f932d..9b6d3e62 100644
--- a/src/mycomponents/qty/countQtyEdit.vue
+++ b/src/mycomponents/qty/countQtyEdit.vue
@@ -27,7 +27,7 @@
标包量 :
- {{ Number(dataContent.packQty) }}
+ {{ Number(dataContent.packQty) || 0}}
diff --git a/src/mycomponents/qty/qtyEdit.vue b/src/mycomponents/qty/qtyEdit.vue
new file mode 100644
index 00000000..c787a4d2
--- /dev/null
+++ b/src/mycomponents/qty/qtyEdit.vue
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+
+ {{title}}
+
+
+
+
+
+
+
+
+ 数量 :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/mycomponents/qty/recommendQty.vue b/src/mycomponents/qty/recommendQty.vue
index b7e007a0..29b5b843 100644
--- a/src/mycomponents/qty/recommendQty.vue
+++ b/src/mycomponents/qty/recommendQty.vue
@@ -2,7 +2,7 @@
-
+
{{ Number(dataContent.qty) }}
@@ -58,10 +58,18 @@ const props = defineProps({
isShowPackCount: {
type: Boolean,
default: true
+ },
+ isShowCount: {
+ type: Boolean,
+ default: true
}
})
const calc = (qty, packQty) => {
- return Math.ceil(Number(qty) / Number(packQty))
+ if(qty&&packQty){
+ return Math.ceil(Number(qty) / Number(packQty));
+ }else{
+ return 0
+ }
}