From 03a05815d7ea5612206b6cfe5d6537b4d4cedc0a Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 15 九月 2026 11:41:32 +0800
Subject: [PATCH] 天津潜宇塑胶app 1.添加采购需求、库存盘点、计件单价配置、产量统计、材料消耗核算、成本核算分析页面
---
src/pages/productionManagement/productionReport/index.vue | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/src/pages/productionManagement/productionReport/index.vue b/src/pages/productionManagement/productionReport/index.vue
index ac92038..1d20f0a 100644
--- a/src/pages/productionManagement/productionReport/index.vue
+++ b/src/pages/productionManagement/productionReport/index.vue
@@ -40,6 +40,15 @@
@click="openProducerPicker"
suffix-icon="arrow-down" />
</u-form-item>
+ <!-- 浣跨敤璁惧 -->
+ <u-form-item label="浣跨敤璁惧"
+ prop="deviceId">
+ <u-input v-model="form.deviceName"
+ placeholder="璇烽�夋嫨浣跨敤璁惧锛堥�夊~锛�"
+ readonly
+ @click="openDevicePicker"
+ suffix-icon="arrow-down" />
+ </u-form-item>
<!-- 宸ユ椂 -->
<u-form-item label="宸ユ椂"
v-if="form.type == 0"
@@ -115,6 +124,12 @@
title="閫夋嫨鐢熶骇浜�"
@select="onProducerConfirm"
@close="showProducerPicker = false" />
+ <!-- 浣跨敤璁惧閫夋嫨鍣� -->
+ <up-action-sheet :show="showDevicePicker"
+ :actions="deviceList"
+ title="閫夋嫨浣跨敤璁惧"
+ @select="onDeviceConfirm"
+ @close="showDevicePicker = false" />
<!-- 鍙傛暟閫夋嫨鍣� -->
<up-action-sheet :show="showParamSelect"
:actions="paramOptions"
@@ -142,6 +157,7 @@
});
};
import { addProductMain } from "@/api/productionManagement/productionReporting";
+ import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { getInfo } from "@/api/login";
import { userListNoPageByTenantId } from "@/api/system/user";
import {
@@ -167,10 +183,39 @@
workHour: 0,
type: null,
paramGroups: {},
+ deviceId: "",
+ deviceName: "",
});
const showProducerPicker = ref(false);
const producerList = ref([]);
+
+ // 浣跨敤璁惧閫夋嫨
+ const showDevicePicker = ref(false);
+ const deviceList = ref([]);
+
+ const openDevicePicker = async () => {
+ if (deviceList.value.length === 0) {
+ try {
+ const { data } = await getDeviceLedger();
+ const rows = Array.isArray(data) ? data : data?.records || [];
+ deviceList.value = rows.map(item => ({
+ name: item.deviceName || item.name || "-",
+ value: item.id,
+ }));
+ } catch (error) {
+ console.error("鍔犺浇璁惧鍒楄〃澶辫触:", error);
+ return;
+ }
+ }
+ showDevicePicker.value = true;
+ };
+
+ const onDeviceConfirm = e => {
+ form.value.deviceId = e.value;
+ form.value.deviceName = e.name;
+ showDevicePicker.value = false;
+ };
const params = ref([]);
const dictOptions = ref({});
@@ -361,6 +406,7 @@
form.value.productionOrderRoutingOperationId,
productionOrderId: form.value.productionOrderId,
workHour: form.value.workHour,
+ deviceId: form.value.deviceId || undefined,
productionOperationParamList: productionOperationParamList,
};
--
Gitblit v1.9.3