From a1131357b9e38c86e734816bae42d2fafcd48222 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 23 三月 2026 11:01:41 +0800
Subject: [PATCH] fix: 客户3.22提出的修改需求
---
src/pages/consumablesLogistics/receiptManagement/index.vue | 1
src/pages/inventoryManagement/dispatchLog/view.vue | 44 -----
src/pages/inventoryManagement/stockManagement/add.vue | 2
src/pages/inventoryManagement/receiptManagement/components/formDiaManual.vue | 6
src/pages/consumablesLogistics/dispatchLog/view.vue | 39 ----
src/pages/consumablesLogistics/stockManagement/subtract.vue | 86 ----------
src/pages/consumablesLogistics/dispatchLog/index.vue | 6
src/pages/inventoryManagement/stockManagement/subtract.vue | 113 ++------------
src/pages/consumablesLogistics/stockManagement/add.vue | 113 +------------
src/pages/inventoryManagement/receiptManagement/detail.vue | 9
src/pages/consumablesLogistics/receiptManagement/view.vue | 31 ---
src/pages/qualityManagement/rawMaterial/form.vue | 2
src/pages/inventoryManagement/dispatchLog/index.vue | 7
13 files changed, 55 insertions(+), 404 deletions(-)
diff --git a/src/pages/consumablesLogistics/dispatchLog/index.vue b/src/pages/consumablesLogistics/dispatchLog/index.vue
index 11d524e..98f75b5 100644
--- a/src/pages/consumablesLogistics/dispatchLog/index.vue
+++ b/src/pages/consumablesLogistics/dispatchLog/index.vue
@@ -29,13 +29,9 @@
<view class="row"><text class="l">瑙勬牸鍨嬪彿</text><text class="r">{{ item.model }}</text></view>
<view class="row"><text class="l">鍗曚綅</text><text class="r">{{ item.unit }}</text></view>
<view class="row"><text class="l">鍑哄簱鏁伴噺</text><text class="r highlight">{{ item.stockOutNum }}</text></view>
+ <!-- <view class="row"><text class="l">閲囪喘鍛�</text><text class="r">{{ item.purchaser || '-' }}</text></view> -->
<view class="row"><text class="l">鍑哄簱浜�</text><text class="r">{{ item.createBy }}</text></view>
<view class="row" v-if="item.recordType !== undefined"><text class="l">鏉ユ簮</text><text class="r">{{ getRecordType(item.recordType) || item.recordType }}</text></view>
- <view class="row"><text class="l">姣涢噸(鍚�)</text><text class="r">{{ item.grossWeight ?? '-' }}</text></view>
- <view class="row"><text class="l">鐨噸(鍚�)</text><text class="r">{{ item.tareWeight ?? '-' }}</text></view>
- <view class="row"><text class="l">鍑�閲�(鍚�)</text><text class="r">{{ item.netWeight ?? '-' }}</text></view>
- <view class="row"><text class="l">杩囩鏃ユ湡</text><text class="r">{{ item.weighingDate || '-' }}</text></view>
- <view class="row"><text class="l">杩囩鍛�</text><text class="r">{{ item.weighingOperator || '-' }}</text></view>
</view>
</view>
<view class="card-actions">
diff --git a/src/pages/consumablesLogistics/dispatchLog/view.vue b/src/pages/consumablesLogistics/dispatchLog/view.vue
index 546c134..6ec0462 100644
--- a/src/pages/consumablesLogistics/dispatchLog/view.vue
+++ b/src/pages/consumablesLogistics/dispatchLog/view.vue
@@ -49,38 +49,6 @@
</view>
</view>
</view>
- <view class="section-card">
- <view class="section-head">
- <view class="section-dot"></view>
- <text class="section-title">鍑哄簱淇℃伅</text>
- </view>
- <view class="section-body">
- <view class="detail-row">
- <text class="label">杞︾墝鍙�</text>
- <text class="value">{{ detail.licensePlateNo || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">姣涢噸(鍚�)</text>
- <text class="value">{{ detail.grossWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">鐨噸(鍚�)</text>
- <text class="value">{{ detail.tareWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">鍑�閲�(鍚�)</text>
- <text class="value">{{ detail.netWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">杩囩鏃ユ湡</text>
- <text class="value">{{ detail.weighingDate || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">杩囩鍛�</text>
- <text class="value">{{ detail.weighingOperator || '-' }}</text>
- </view>
- </view>
- </view>
</view>
<view v-else class="empty">
<text class="empty-text">鏆傛棤璇︽儏鏁版嵁</text>
@@ -111,12 +79,7 @@
stockOutNum: d.stockOutNum,
createBy: d.createBy,
recordType: d.recordType,
- licensePlateNo: d.licensePlateNo,
- grossWeight: d.grossWeight,
- tareWeight: d.tareWeight,
- netWeight: d.netWeight,
- weighingDate: d.weighingDate,
- weighingOperator: d.weighingOperator,
+ purchaser: d.purchaser,
};
}
diff --git a/src/pages/consumablesLogistics/receiptManagement/index.vue b/src/pages/consumablesLogistics/receiptManagement/index.vue
index 9a515e0..b88f30b 100644
--- a/src/pages/consumablesLogistics/receiptManagement/index.vue
+++ b/src/pages/consumablesLogistics/receiptManagement/index.vue
@@ -29,6 +29,7 @@
<view class="row"><text class="l">瑙勬牸鍨嬪彿</text><text class="r">{{ item.model }}</text></view>
<view class="row"><text class="l">鍗曚綅</text><text class="r">{{ item.unit }}</text></view>
<view class="row"><text class="l">鍏ュ簱鏁伴噺</text><text class="r highlight">{{ item.stockInNum }}</text></view>
+ <view class="row"><text class="l">閲囪喘鍛�</text><text class="r">{{ item.purchaser || '-' }}</text></view>
<view class="row"><text class="l">鍏ュ簱浜�</text><text class="r">{{ item.createBy }}</text></view>
<view class="row" v-if="item.recordType !== undefined"><text class="l">鏉ユ簮</text><text class="r">{{ getRecordType(item.recordType) || item.recordType }}</text></view>
</view>
diff --git a/src/pages/consumablesLogistics/receiptManagement/view.vue b/src/pages/consumablesLogistics/receiptManagement/view.vue
index d603419..221bead 100644
--- a/src/pages/consumablesLogistics/receiptManagement/view.vue
+++ b/src/pages/consumablesLogistics/receiptManagement/view.vue
@@ -56,28 +56,8 @@
</view>
<view class="section-body">
<view class="detail-row">
- <text class="label">杞︾墝鍙�</text>
- <text class="value">{{ detail.licensePlateNo || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">姣涢噸(鍚�)</text>
- <text class="value">{{ detail.grossWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">鐨噸(鍚�)</text>
- <text class="value">{{ detail.tareWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">鍑�閲�(鍚�)</text>
- <text class="value">{{ detail.netWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">杩囩鏃ユ湡</text>
- <text class="value">{{ detail.weighingDate || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">杩囩鍛�</text>
- <text class="value">{{ detail.weighingOperator || '-' }}</text>
+ <text class="label">閲囪喘鍛�</text>
+ <text class="value">{{ detail.purchaser || '-' }}</text>
</view>
</view>
</view>
@@ -111,12 +91,7 @@
stockInNum: d.stockInNum,
createBy: d.createBy,
recordType: d.recordType,
- licensePlateNo: d.licensePlateNo,
- grossWeight: d.grossWeight,
- tareWeight: d.tareWeight,
- netWeight: d.netWeight,
- weighingDate: d.weighingDate,
- weighingOperator: d.weighingOperator,
+ purchaser: d.purchaser,
};
}
diff --git a/src/pages/consumablesLogistics/stockManagement/add.vue b/src/pages/consumablesLogistics/stockManagement/add.vue
index 9df1db0..3c1f199 100644
--- a/src/pages/consumablesLogistics/stockManagement/add.vue
+++ b/src/pages/consumablesLogistics/stockManagement/add.vue
@@ -24,35 +24,14 @@
</view>
<view class="form-section">
- <view class="section-title">杩囩淇℃伅</view>
+ <view class="section-title">鍏ュ簱淇℃伅</view>
<view class="form-row">
- <text class="form-label required">杞︾墝鍙�</text>
- <up-input v-model="form.licensePlateNo" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
+ <text class="form-label required">鏁伴噺</text>
+ <up-input v-model="form.qualitity" type="number" placeholder="璇疯緭鍏ユ暟閲�" />
</view>
<view class="form-row">
- <text class="form-label required">姣涢噸(鍚�)</text>
- <up-input v-model="form.grossWeight" type="digit" placeholder="璇疯緭鍏ユ瘺閲�" />
- </view>
- <view class="form-row">
- <text class="form-label required">鐨噸(鍚�)</text>
- <up-input v-model="form.tareWeight" type="digit" placeholder="璇疯緭鍏ョ毊閲�" />
- </view>
- <view class="form-row">
- <text class="form-label">鍑�閲�(鍚�)</text>
- <up-input v-model="form.netWeight" type="digit" disabled placeholder="鑷姩璁$畻" />
- </view>
- <view class="form-row">
- <text class="form-label required">杩囩鏃ユ湡</text>
- <view class="selector-trigger" @click="openWeighingDatePicker">
- <text class="selector-text" :class="{ placeholder: !form.weighingDate }">
- {{ form.weighingDate || "璇烽�夋嫨杩囩鏃ユ湡" }}
- </text>
- <up-icon name="calendar" size="16" color="#999"></up-icon>
- </view>
- </view>
- <view class="form-row">
- <text class="form-label required">杩囩鍛�</text>
- <up-input v-model="form.weighingOperator" placeholder="璇疯緭鍏ヨ繃纾呭憳" />
+ <text class="form-label required">閲囪喘鍛�</text>
+ <up-input v-model="form.purchaser" placeholder="璇疯緭鍏ラ噰璐憳" />
</view>
</view>
@@ -96,22 +75,12 @@
</view>
</up-popup>
- <up-popup :show="showWeighingDatePicker" mode="bottom" @close="showWeighingDatePicker = false">
- <up-datetime-picker
- :show="true"
- v-model="weighingDateValue"
- mode="datetime"
- @confirm="onWeighingDateConfirm"
- @cancel="showWeighingDatePicker = false"
- />
- </up-popup>
</view>
</template>
<script setup>
-import { computed, reactive, ref, watch } from "vue";
+import { computed, reactive, ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
-import dayjs from "dayjs";
import PageHeader from "@/components/PageHeader.vue";
import { createConsumablesIn } from "@/api/consumablesLogistics/consumablesIn.js";
import { productModelList } from "@/api/basicData/productModel.js";
@@ -123,12 +92,8 @@
productModelName: "",
unit: "",
productType: undefined,
- licensePlateNo: "",
- grossWeight: "",
- tareWeight: "",
- netWeight: "",
- weighingDate: "",
- weighingOperator: "",
+ qualitity: "",
+ purchaser: "",
remark: "",
});
@@ -142,9 +107,6 @@
});
const productList = ref([]);
const productLoading = ref(false);
-
-const showWeighingDatePicker = ref(false);
-const weighingDateValue = ref(Date.now());
onLoad((options) => {
type.value = "0";
@@ -184,60 +146,17 @@
showProductPopup.value = false;
};
-const computeNetWeight = () => {
- const gross = Number(form.grossWeight);
- const tare = Number(form.tareWeight);
- if (!isNaN(gross) && !isNaN(tare)) {
- const net = Number((gross - tare).toFixed(2));
- form.netWeight = net > 0 ? net : 0;
- } else {
- form.netWeight = "";
- }
-};
-
-watch(
- () => [form.grossWeight, form.tareWeight],
- () => {
- computeNetWeight();
- }
-);
-
-const openWeighingDatePicker = () => {
- weighingDateValue.value = form.weighingDate
- ? dayjs(form.weighingDate, "YYYY-MM-DD HH:mm:ss").valueOf()
- : Date.now();
- showWeighingDatePicker.value = true;
-};
-
-const onWeighingDateConfirm = (e) => {
- const ts = e?.value ?? weighingDateValue.value;
- form.weighingDate = dayjs(ts).format("YYYY-MM-DD HH:mm:ss");
- showWeighingDatePicker.value = false;
-};
-
const handleSubmit = () => {
if (!form.productName || !form.productModelId) {
uni.showToast({ title: "璇烽�夋嫨浜у搧", icon: "none" });
return;
}
- if (!form.licensePlateNo) {
- uni.showToast({ title: "璇疯緭鍏ヨ溅鐗屽彿", icon: "none" });
+ if (!form.qualitity || Number(form.qualitity) <= 0) {
+ uni.showToast({ title: "璇疯緭鍏ユ暟閲�", icon: "none" });
return;
}
- if (!form.grossWeight || Number(form.grossWeight) <= 0) {
- uni.showToast({ title: "璇疯緭鍏ユ瘺閲�", icon: "none" });
- return;
- }
- if (!form.tareWeight || Number(form.tareWeight) <= 0) {
- uni.showToast({ title: "璇疯緭鍏ョ毊閲�", icon: "none" });
- return;
- }
- if (!form.weighingDate) {
- uni.showToast({ title: "璇烽�夋嫨杩囩鏃ユ湡", icon: "none" });
- return;
- }
- if (!form.weighingOperator) {
- uni.showToast({ title: "璇疯緭鍏ヨ繃纾呭憳", icon: "none" });
+ if (!form.purchaser) {
+ uni.showToast({ title: "璇疯緭鍏ラ噰璐憳", icon: "none" });
return;
}
const payload = {
@@ -247,12 +166,8 @@
productModelName: form.productModelName,
unit: form.unit,
productType: form.productType,
- licensePlateNo: form.licensePlateNo,
- grossWeight: form.grossWeight,
- tareWeight: form.tareWeight,
- netWeight: form.netWeight,
- weighingDate: form.weighingDate,
- weighingOperator: form.weighingOperator,
+ qualitity: Number(form.qualitity),
+ purchaser: form.purchaser,
remark: form.remark,
};
createConsumablesIn(payload)
diff --git a/src/pages/consumablesLogistics/stockManagement/subtract.vue b/src/pages/consumablesLogistics/stockManagement/subtract.vue
index bc649a7..e127d95 100644
--- a/src/pages/consumablesLogistics/stockManagement/subtract.vue
+++ b/src/pages/consumablesLogistics/stockManagement/subtract.vue
@@ -26,35 +26,6 @@
<up-input v-model="form.stockOutNum" type="number" :placeholder="'鏈�澶�' + stockRecord.unLockedQuantity" />
</view>
<view class="form-row">
- <text class="form-label">杞︾墝鍙�</text>
- <up-input v-model="form.licensePlateNo" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
- </view>
- <view class="form-row">
- <text class="form-label">姣涢噸(鍚�)</text>
- <up-input v-model="form.grossWeight" type="digit" placeholder="璇疯緭鍏ユ瘺閲�" />
- </view>
- <view class="form-row">
- <text class="form-label">鐨噸(鍚�)</text>
- <up-input v-model="form.tareWeight" type="digit" placeholder="璇疯緭鍏ョ毊閲�" />
- </view>
- <view class="form-row">
- <text class="form-label">鍑�閲�(鍚�)</text>
- <up-input v-model="form.netWeight" type="digit" disabled placeholder="鑷姩璁$畻" />
- </view>
- <view class="form-row">
- <text class="form-label">杩囩鏃ユ湡</text>
- <view class="selector-trigger" @click="openWeighingDatePicker">
- <text class="selector-text" :class="{ placeholder: !form.weighingDate }">
- {{ form.weighingDate || "璇烽�夋嫨杩囩鏃ユ湡" }}
- </text>
- <up-icon name="calendar" size="16" color="#999"></up-icon>
- </view>
- </view>
- <view class="form-row">
- <text class="form-label">杩囩鍛�</text>
- <up-input v-model="form.weighingOperator" placeholder="璇疯緭鍏ヨ繃纾呭憳" />
- </view>
- <view class="form-row">
<text class="form-label">澶囨敞</text>
<up-input v-model="form.remark" type="textarea" placeholder="閫夊~" />
</view>
@@ -64,23 +35,12 @@
<view class="bottom-bar">
<view class="btn-submit" @click="handleSubmit">鎻愪氦</view>
</view>
-
- <up-popup :show="showWeighingDatePicker" mode="bottom" @close="showWeighingDatePicker = false">
- <up-datetime-picker
- :show="true"
- v-model="weighingDateValue"
- mode="datetime"
- @confirm="onWeighingDateConfirm"
- @cancel="showWeighingDatePicker = false"
- />
- </up-popup>
</view>
</template>
<script setup>
-import { computed, reactive, ref, watch } from "vue";
+import { computed, reactive, ref } from "vue";
import { onLoad } from "@dcloudio/uni-app";
-import dayjs from "dayjs";
import PageHeader from "@/components/PageHeader.vue";
import { subtractConsumablesIn } from "@/api/consumablesLogistics/consumablesIn.js";
@@ -96,17 +56,8 @@
const form = reactive({
stockOutNum: "",
- licensePlateNo: "",
- grossWeight: "",
- tareWeight: "",
- netWeight: "",
- weighingDate: "",
- weighingOperator: "",
remark: "",
});
-
-const showWeighingDatePicker = ref(false);
-const weighingDateValue = ref(Date.now());
onLoad((options) => {
type.value = "0";
@@ -126,35 +77,6 @@
}
});
-const computeNetWeight = () => {
- const gross = Number(form.grossWeight);
- const tare = Number(form.tareWeight);
- if (!isNaN(gross) && !isNaN(tare)) {
- const net = Number((gross - tare).toFixed(2));
- form.netWeight = net > 0 ? net : 0;
- } else {
- form.netWeight = "";
- }
-};
-
-watch(
- () => [form.grossWeight, form.tareWeight],
- () => computeNetWeight()
-);
-
-const openWeighingDatePicker = () => {
- weighingDateValue.value = form.weighingDate
- ? dayjs(form.weighingDate, "YYYY-MM-DD HH:mm:ss").valueOf()
- : Date.now();
- showWeighingDatePicker.value = true;
-};
-
-const onWeighingDateConfirm = (e) => {
- const ts = e?.value ?? weighingDateValue.value;
- form.weighingDate = dayjs(ts).format("YYYY-MM-DD HH:mm:ss");
- showWeighingDatePicker.value = false;
-};
-
const handleSubmit = () => {
const outNum = Number(form.stockOutNum);
if (!outNum || outNum <= 0 || outNum > Number(stockRecord.unLockedQuantity)) {
@@ -164,12 +86,6 @@
subtractConsumablesIn({
id: stockRecord.id,
stockOutNum: outNum,
- licensePlateNo: form.licensePlateNo,
- grossWeight: form.grossWeight,
- tareWeight: form.tareWeight,
- netWeight: form.netWeight,
- weighingDate: form.weighingDate,
- weighingOperator: form.weighingOperator,
remark: form.remark,
})
.then(() => {
diff --git a/src/pages/inventoryManagement/dispatchLog/index.vue b/src/pages/inventoryManagement/dispatchLog/index.vue
index 702ccf5..5c37172 100644
--- a/src/pages/inventoryManagement/dispatchLog/index.vue
+++ b/src/pages/inventoryManagement/dispatchLog/index.vue
@@ -41,13 +41,8 @@
<view class="row"><text class="l">瑙勬牸鍨嬪彿</text><text class="r">{{ item.model }}</text></view>
<view class="row"><text class="l">鍗曚綅</text><text class="r">{{ item.unit }}</text></view>
<view class="row"><text class="l">鍑哄簱鏁伴噺</text><text class="r highlight">{{ item.stockOutNum }}</text></view>
- <view class="row"><text class="l">鍑哄簱浜�</text><text class="r">{{ item.createBy }}</text></view>
+ <view class="row"><text class="l">閲囪喘鍛�</text><text class="r">{{ item.purchaser || item.createBy }}</text></view>
<view class="row" v-if="item.recordType !== undefined"><text class="l">鏉ユ簮</text><text class="r">{{ getRecordType(item.recordType) || item.recordType }}</text></view>
- <view class="row"><text class="l">姣涢噸(鍚�)</text><text class="r">{{ item.grossWeight ?? '-' }}</text></view>
- <view class="row"><text class="l">鐨噸(鍚�)</text><text class="r">{{ item.tareWeight ?? '-' }}</text></view>
- <view class="row"><text class="l">鍑�閲�(鍚�)</text><text class="r">{{ item.netWeight ?? '-' }}</text></view>
- <view class="row"><text class="l">杩囩鏃ユ湡</text><text class="r">{{ item.weighingDate || '-' }}</text></view>
- <view class="row"><text class="l">杩囩鍛�</text><text class="r">{{ item.weighingOperator || '-' }}</text></view>
</view>
</view>
<view class="card-actions">
diff --git a/src/pages/inventoryManagement/dispatchLog/view.vue b/src/pages/inventoryManagement/dispatchLog/view.vue
index e764082..8a2a977 100644
--- a/src/pages/inventoryManagement/dispatchLog/view.vue
+++ b/src/pages/inventoryManagement/dispatchLog/view.vue
@@ -41,45 +41,12 @@
<text class="value value-num">{{ detail.stockOutNum ?? '-' }}</text>
</view>
<view class="detail-row">
- <text class="label">鍑哄簱浜�</text>
- <text class="value">{{ detail.createBy || '-' }}</text>
+ <text class="label">閲囪喘鍛�</text>
+ <text class="value">{{ detail.purchaser || detail.createBy || '-' }}</text>
</view>
<view class="detail-row">
<text class="label">鏉ユ簮</text>
<text class="value">{{ getRecordType(detail.recordType) || '-' }}</text>
- </view>
- </view>
- </view>
- <!-- 鍑哄簱淇℃伅 -->
- <view class="section-card">
- <view class="section-head">
- <view class="section-dot"></view>
- <text class="section-title">鍑哄簱淇℃伅</text>
- </view>
- <view class="section-body">
- <view class="detail-row">
- <text class="label">杞︾墝鍙�</text>
- <text class="value">{{ detail.licensePlateNo || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">姣涢噸(鍚�)</text>
- <text class="value">{{ detail.grossWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">鐨噸(鍚�)</text>
- <text class="value">{{ detail.tareWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">鍑�閲�(鍚�)</text>
- <text class="value">{{ detail.netWeight ?? '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">杩囩鏃ユ湡</text>
- <text class="value">{{ detail.weighingDate || '-' }}</text>
- </view>
- <view class="detail-row">
- <text class="label">杩囩鍛�</text>
- <text class="value">{{ detail.weighingOperator || '-' }}</text>
</view>
</view>
</view>
@@ -115,12 +82,7 @@
stockOutNum: d.stockOutNum,
createBy: d.createBy,
recordType: d.recordType,
- licensePlateNo: d.licensePlateNo,
- grossWeight: d.grossWeight,
- tareWeight: d.tareWeight,
- netWeight: d.netWeight,
- weighingDate: d.weighingDate,
- weighingOperator: d.weighingOperator
+ purchaser: d.purchaser
}
}
diff --git a/src/pages/inventoryManagement/receiptManagement/components/formDiaManual.vue b/src/pages/inventoryManagement/receiptManagement/components/formDiaManual.vue
index f973f6b..9d93eee 100644
--- a/src/pages/inventoryManagement/receiptManagement/components/formDiaManual.vue
+++ b/src/pages/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -1,4 +1,4 @@
-锘�<template>
+<template>
<up-popup :show="dialogFormVisible" mode="bottom" :round="10" closeable @close="closeDia">
<view class="form-popup">
<view class="popup-header">
@@ -160,7 +160,7 @@
supplierName: form.value.supplierName || '',
itemType: '',
inboundNum: 0,
- inboundDate: '',
+ inboundDate: getCurrentDate(),
taxRate: null,
taxInclusiveUnitPrice: 0,
taxInclusiveTotalPrice: 0,
@@ -195,6 +195,8 @@
const openDatePicker = (index) => {
currentEditIndex.value = index
+ const currentDate = productList.value[index]?.inboundDate
+ dateValue.value = currentDate ? new Date(currentDate).getTime() : Date.now()
showDatePicker.value = true
}
diff --git a/src/pages/inventoryManagement/receiptManagement/detail.vue b/src/pages/inventoryManagement/receiptManagement/detail.vue
index 241a0ff..0977f37 100644
--- a/src/pages/inventoryManagement/receiptManagement/detail.vue
+++ b/src/pages/inventoryManagement/receiptManagement/detail.vue
@@ -56,10 +56,10 @@
v-model="form.inboundDate"
readonly
placeholder="璇烽�夋嫨鍏ュ簱鏃ユ湡"
- @click="showDatePicker = true"
+ @click="openInboundDatePicker"
/>
<template #right>
- <up-icon name="calendar" @click="showDatePicker = true"></up-icon>
+ <up-icon name="calendar" @click="openInboundDatePicker"></up-icon>
</template>
</u-form-item>
</view>
@@ -245,6 +245,11 @@
showDatePicker.value = false
}
+const openInboundDatePicker = () => {
+ dateValue.value = form.value.inboundDate ? new Date(form.value.inboundDate).getTime() : Date.now()
+ showDatePicker.value = true
+}
+
// 璁$畻鍚◣鎬讳环
const calculateTotalPrice = () => {
const num = parseFloat(form.value.inboundNum) || 0
diff --git a/src/pages/inventoryManagement/stockManagement/add.vue b/src/pages/inventoryManagement/stockManagement/add.vue
index cbfdbd1..8c29d09 100644
--- a/src/pages/inventoryManagement/stockManagement/add.vue
+++ b/src/pages/inventoryManagement/stockManagement/add.vue
@@ -163,7 +163,7 @@
grossWeight: '',
tareWeight: '',
netWeight: '',
- weighingDate: '',
+ weighingDate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
weighingOperator: '',
qualitity: '',
remark: ''
diff --git a/src/pages/inventoryManagement/stockManagement/subtract.vue b/src/pages/inventoryManagement/stockManagement/subtract.vue
index d052011..7fb85e1 100644
--- a/src/pages/inventoryManagement/stockManagement/subtract.vue
+++ b/src/pages/inventoryManagement/stockManagement/subtract.vue
@@ -19,48 +19,10 @@
</view>
<view class="form-section">
- <view class="section-title">鍑哄簱/杩囩淇℃伅</view>
+ <view class="section-title">鍑哄簱淇℃伅</view>
<view class="form-row">
- <text class="form-label">杞︾墝鍙�</text>
- <up-input v-model="form.licensePlateNo" placeholder="璇疯緭鍏ヨ溅鐗屽彿" />
- </view>
- <view class="form-row">
- <text class="form-label">姣涢噸(鍚�)</text>
- <up-input
- v-model="form.grossWeight"
- type="digit"
- placeholder="璇疯緭鍏ユ瘺閲�"
- />
- </view>
- <view class="form-row">
- <text class="form-label">鐨噸(鍚�)</text>
- <up-input
- v-model="form.tareWeight"
- type="digit"
- placeholder="璇疯緭鍏ョ毊閲�"
- />
- </view>
- <view class="form-row">
- <text class="form-label">鍑�閲�(鍚�)</text>
- <up-input
- v-model="form.netWeight"
- type="digit"
- disabled
- placeholder="鑷姩璁$畻"
- />
- </view>
- <view class="form-row">
- <text class="form-label">杩囩鏃ユ湡</text>
- <view class="selector-trigger" @click="openWeighingDatePicker">
- <text class="selector-text" :class="{ placeholder: !form.weighingDate }">
- {{ form.weighingDate || '璇烽�夋嫨杩囩鏃ユ湡' }}
- </text>
- <up-icon name="calendar" size="16" color="#999"></up-icon>
- </view>
- </view>
- <view class="form-row">
- <text class="form-label">杩囩鍛�</text>
- <up-input v-model="form.weighingOperator" placeholder="璇疯緭鍏ヨ繃纾呭憳" />
+ <text class="form-label">鍑哄簱鏁伴噺</text>
+ <up-input v-model="form.stockOutNum" type="number" :placeholder="'鏈�澶�' + (form.unLockedQuantity ?? 0)" />
</view>
<view class="form-row">
<text class="form-label">澶囨敞</text>
@@ -72,24 +34,12 @@
<view class="bottom-bar">
<view class="btn-submit" @click="handleSubmit">鍑哄簱</view>
</view>
-
- <!-- 杩囩鏃ユ湡閫夋嫨鍣� -->
- <up-popup :show="showWeighingDatePicker" mode="bottom" @close="showWeighingDatePicker = false">
- <up-datetime-picker
- :show="true"
- v-model="weighingDateValue"
- mode="datetime"
- @confirm="onWeighingDateConfirm"
- @cancel="showWeighingDatePicker = false"
- />
- </up-popup>
</view>
</template>
<script setup>
-import { ref, reactive, watch, computed } from 'vue'
+import { ref, reactive, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
-import dayjs from 'dayjs'
import PageHeader from '@/components/PageHeader.vue'
import { subtractStockInventory } from '@/api/inventoryManagement/stockInventory.js'
@@ -113,19 +63,12 @@
createTime: '',
updateTime: '',
version: undefined,
- // 鍑哄簱/杩囩淇℃伅
- licensePlateNo: '',
- grossWeight: '',
- tareWeight: '',
- netWeight: '',
- weighingDate: '',
- weighingOperator: '',
+ // 鍑哄簱淇℃伅
+ stockOutNum: '',
remark: ''
})
const type = ref('0') // 鍥哄畾鍚堟牸搴撳瓨
-const showWeighingDatePicker = ref(false)
-const weighingDateValue = ref(Date.now())
onLoad((options) => {
type.value = '0'
@@ -143,44 +86,22 @@
}
})
-// 鍑�閲� = 姣涢噸 - 鐨噸
-const computeNetWeight = () => {
- const gross = Number(form.grossWeight)
- const tare = Number(form.tareWeight)
- if (!isNaN(gross) && !isNaN(tare)) {
- const net = Number((gross - tare).toFixed(2))
- form.netWeight = net > 0 ? net : 0
- } else {
- form.netWeight = ''
- }
-}
-
-watch(
- () => [form.grossWeight, form.tareWeight],
- () => {
- computeNetWeight()
- }
-)
-
-const openWeighingDatePicker = () => {
- weighingDateValue.value = form.weighingDate
- ? dayjs(form.weighingDate, 'YYYY-MM-DD HH:mm:ss').valueOf()
- : Date.now()
- showWeighingDatePicker.value = true
-}
-
-const onWeighingDateConfirm = (e) => {
- const ts = e?.value ?? weighingDateValue.value
- form.weighingDate = dayjs(ts).format('YYYY-MM-DD HH:mm:ss')
- showWeighingDatePicker.value = false
-}
-
const handleSubmit = () => {
if (!form.id) {
uni.showToast({ title: '璁板綍淇℃伅缂哄け锛屾棤娉曞嚭搴�', icon: 'none' })
return
}
- const payload = { ...form }
+ const outNum = Number(form.stockOutNum)
+ const max = Number(form.unLockedQuantity ?? 0)
+ if (!outNum || outNum <= 0 || outNum > max) {
+ uni.showToast({ title: `璇疯緭鍏� 1~${max} 涔嬮棿鐨勬暟閲廯, icon: 'none' })
+ return
+ }
+ const payload = {
+ id: form.id,
+ stockOutNum: outNum,
+ remark: form.remark
+ }
subtractStockInventory(payload)
.then(() => {
uni.showToast({ title: '鍑哄簱鎴愬姛', icon: 'success' })
diff --git a/src/pages/qualityManagement/rawMaterial/form.vue b/src/pages/qualityManagement/rawMaterial/form.vue
index 148dcd6..3f84f70 100644
--- a/src/pages/qualityManagement/rawMaterial/form.vue
+++ b/src/pages/qualityManagement/rawMaterial/form.vue
@@ -200,7 +200,7 @@
checkType: '',
checkResult: '',
checkUserName: userStore?.nickName || '',
- checkTime: ''
+ checkTime: dayjs().format('YYYY-MM-DD')
})
const inspectItems = ref([]) // qualityInspectItem
--
Gitblit v1.9.3