From b665f6f67837fb608e0055dd2ea9ad05c5c5fb34 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期二, 06 一月 2026 11:28:45 +0800
Subject: [PATCH] 增加生产报工-投入产出接口

---
 src/api/productionManagement/productionProductInput.js        |   11 +++++
 src/views/productionManagement/productionReporting/index.vue  |    7 +++
 src/views/productionManagement/productionReporting/Output.vue |   19 ++++++++-
 src/api/productionManagement/productionProductMain.js         |    0 
 src/views/productionManagement/productionReporting/Input.vue  |   17 ++++++++
 src/api/productionManagement/productionProductOutput.js       |   11 +++++
 6 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/src/api/productionManagement/productionProductInput.js b/src/api/productionManagement/productionProductInput.js
new file mode 100644
index 0000000..f72cd9b
--- /dev/null
+++ b/src/api/productionManagement/productionProductInput.js
@@ -0,0 +1,11 @@
+// 鐢熶骇鎶曞叆椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function productionProductInputListPage(query) {
+    return request({
+        url: "/productionProductInput/listPage",
+        method: "get",
+        params: query,
+    });
+}
diff --git a/src/api/productionManagement/production_product_main.js b/src/api/productionManagement/productionProductMain.js
similarity index 100%
rename from src/api/productionManagement/production_product_main.js
rename to src/api/productionManagement/productionProductMain.js
diff --git a/src/api/productionManagement/productionProductOutput.js b/src/api/productionManagement/productionProductOutput.js
new file mode 100644
index 0000000..10095e9
--- /dev/null
+++ b/src/api/productionManagement/productionProductOutput.js
@@ -0,0 +1,11 @@
+// 鐢熶骇浜у嚭椤甸潰鎺ュ彛
+import request from "@/utils/request";
+
+// 鍒嗛〉鏌ヨ
+export function productionProductOutputListPage(query) {
+    return request({
+        url: "/productionProductOutput/listPage",
+        method: "get",
+        params: query,
+    });
+}
diff --git a/src/views/productionManagement/productionReporting/Input.vue b/src/views/productionManagement/productionReporting/Input.vue
index 144e5bd..7959848 100644
--- a/src/views/productionManagement/productionReporting/Input.vue
+++ b/src/views/productionManagement/productionReporting/Input.vue
@@ -24,10 +24,15 @@
 
 <script setup>
 import {ref, computed, onMounted} from "vue";
+import { productionProductInputListPage } from "@/api/productionManagement/productionProductInput";
 
 const props = defineProps({
   visible: {
     type: Boolean,
+    required: true,
+  },
+  productionProductMainId: {
+    type: Number,
     required: true,
   },
 });
@@ -55,7 +60,7 @@
   },
   {
     label: '浜у搧鍨嬪彿',
-    prop: 'productModelName',
+    prop: 'model',
   },
   {
     label: '鎶曞叆鏁伴噺',
@@ -79,6 +84,16 @@
 };
 
 const fetchData = () => {
+  tableLoading.value = true;
+  const params = { productMainId: props.productionProductMainId, ...page };
+
+  productionProductInputListPage(params).then(res => {
+    tableLoading.value = false;
+    data.value = res.data.records;
+    page.total = res.data.total;
+  }).catch(err => {
+    tableLoading.value = false;
+  })
 };
 
 defineExpose({
diff --git a/src/views/productionManagement/productionReporting/Output.vue b/src/views/productionManagement/productionReporting/Output.vue
index b033dc0..0f49a55 100644
--- a/src/views/productionManagement/productionReporting/Output.vue
+++ b/src/views/productionManagement/productionReporting/Output.vue
@@ -24,10 +24,15 @@
 
 <script setup>
 import {ref, computed, onMounted} from "vue";
+import { productionProductOutputListPage } from "@/api/productionManagement/productionProductOutput.js";
 
 const props = defineProps({
   visible: {
     type: Boolean,
+    required: true,
+  },
+  productionProductMainId: {
+    type: Number,
     required: true,
   },
 });
@@ -55,10 +60,10 @@
   },
   {
     label: '浜у搧鍨嬪彿',
-    prop: 'productModelName',
+    prop: 'model',
   },
   {
-    label: '浜у嚭鏁伴噺',
+    label: '鎶曞叆鏁伴噺',
     prop: 'quantity',
   },
 ]
@@ -79,6 +84,16 @@
 };
 
 const fetchData = () => {
+  tableLoading.value = true;
+  const params = { productMainId: props.productionProductMainId, ...page };
+
+  productionProductOutputListPage(params).then(res => {
+    tableLoading.value = false;
+    data.value = res.data.records;
+    page.total = res.data.total;
+  }).catch(err => {
+    tableLoading.value = false;
+  })
 };
 
 defineExpose({
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index 7d55dd6..96aa91e 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -130,10 +130,12 @@
     <input-modal
         v-if="isShowInput"
         v-model:visible="isShowInput"
+        :production-product-main-id="isShowingId"
     />
     <output-modal
         v-if="isShowOutput"
         v-model:visible="isShowOutput"
+        :production-product-main-id="isShowingId"
     />
 	</div>
 </template>
@@ -148,7 +150,7 @@
 } from "@/api/productionManagement/productionReporting.js";
 import {
   productionProductMainListPage,
-} from "@/api/productionManagement/production_product_main.js";
+} from "@/api/productionManagement/productionProductMain.js";
 import {userListNoPageByTenantId} from "@/api/system/user.js";
 import InputModal from "@/views/productionManagement/productionReporting/Input.vue";
 import OutputModal from "@/views/productionManagement/productionReporting/Output.vue";
@@ -394,14 +396,17 @@
 
 // 鎵撳紑鎶曞叆妯℃�佹
 const isShowInput = ref(false);
+const isShowingId = ref(0)
 const showInput = (row) => {
 	isShowInput.value = true;
+  isShowingId.value = row.id
 }
 
 // 鎵撳紑浜у嚭妯℃�佹
 const isShowOutput = ref(false);
 const showOutput = (row) => {
 	isShowOutput.value = true;
+  isShowingId.value = row.id
 }
 
 // 瀵煎嚭

--
Gitblit v1.9.3