From b25e11bb1e76255b4c05e10022e1ca9be5c7cc99 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 19 三月 2026 16:53:56 +0800
Subject: [PATCH] 库存报表加日期选择
---
src/pages/inventoryManagement/stockManagement/subtract.vue | 27 ++++++---------------------
1 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/src/pages/inventoryManagement/stockManagement/subtract.vue b/src/pages/inventoryManagement/stockManagement/subtract.vue
index 1a7ebf7..d052011 100644
--- a/src/pages/inventoryManagement/stockManagement/subtract.vue
+++ b/src/pages/inventoryManagement/stockManagement/subtract.vue
@@ -28,7 +28,7 @@
<text class="form-label">姣涢噸(鍚�)</text>
<up-input
v-model="form.grossWeight"
- type="number"
+ type="digit"
placeholder="璇疯緭鍏ユ瘺閲�"
/>
</view>
@@ -36,7 +36,7 @@
<text class="form-label">鐨噸(鍚�)</text>
<up-input
v-model="form.tareWeight"
- type="number"
+ type="digit"
placeholder="璇疯緭鍏ョ毊閲�"
/>
</view>
@@ -44,7 +44,7 @@
<text class="form-label">鍑�閲�(鍚�)</text>
<up-input
v-model="form.netWeight"
- type="number"
+ type="digit"
disabled
placeholder="鑷姩璁$畻"
/>
@@ -92,7 +92,6 @@
import dayjs from 'dayjs'
import PageHeader from '@/components/PageHeader.vue'
import { subtractStockInventory } from '@/api/inventoryManagement/stockInventory.js'
-import { subtractStockUnInventory } from '@/api/inventoryManagement/stockUninventory.js'
const form = reactive({
id: undefined,
@@ -124,20 +123,12 @@
remark: ''
})
-const type = ref('0') // 0 鍚堟牸搴撳瓨锛�1 涓嶅悎鏍煎簱瀛�
+const type = ref('0') // 鍥哄畾鍚堟牸搴撳瓨
const showWeighingDatePicker = ref(false)
const weighingDateValue = ref(Date.now())
-const maxAllowedNetWeight = computed(() => {
- const v = form.unLockedQuantity ?? form.qualitity
- const n = Number(v)
- return !isNaN(n) ? n : 0
-})
-
onLoad((options) => {
- if (options && options.type != null) {
- type.value = options.type
- }
+ type.value = '0'
const cached = uni.getStorageSync('stockSubtractRecord')
if (cached) {
try {
@@ -189,14 +180,8 @@
uni.showToast({ title: '璁板綍淇℃伅缂哄け锛屾棤娉曞嚭搴�', icon: 'none' })
return
}
- const net = Number(form.netWeight)
- if (!isNaN(net) && net > 0 && maxAllowedNetWeight.value > 0 && net > maxAllowedNetWeight.value) {
- uni.showToast({ title: `鍑�閲嶄笉鑳藉ぇ浜庡彲鐢ㄥ簱瀛� ${maxAllowedNetWeight.value}`, icon: 'none' })
- return
- }
const payload = { ...form }
- const api = type.value === '0' ? subtractStockInventory : subtractStockUnInventory
- api(payload)
+ subtractStockInventory(payload)
.then(() => {
uni.showToast({ title: '鍑哄簱鎴愬姛', icon: 'success' })
setTimeout(() => {
--
Gitblit v1.9.3