From 5ce498f738f71b15b1158c7cf512a2a963437a3c Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期四, 05 二月 2026 17:24:44 +0800
Subject: [PATCH] 生产统计
---
src/api/productionManagement/productionProductMain.js | 8 +
src/api/viewIndex.js | 17 ---
src/views/productionManagement/productStatistics/index.vue | 254 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 262 insertions(+), 17 deletions(-)
diff --git a/src/api/productionManagement/productionProductMain.js b/src/api/productionManagement/productionProductMain.js
index 0493f8b..1c80e6e 100644
--- a/src/api/productionManagement/productionProductMain.js
+++ b/src/api/productionManagement/productionProductMain.js
@@ -9,3 +9,11 @@
params: query,
});
}
+
+export function queryProductInputAndOutput(query) {
+ return request({
+ url: "/productionProductMain/queryProductInputAndOutput",
+ method: "get",
+ params: query,
+ });
+}
diff --git a/src/api/viewIndex.js b/src/api/viewIndex.js
index 3caced7..0fd1390 100644
--- a/src/api/viewIndex.js
+++ b/src/api/viewIndex.js
@@ -100,23 +100,6 @@
});
};
-// 宸ュ崟鎵ц鏁堢巼鍒嗘瀽锛坉ateType: 1鍛� 2鏈� 3瀛e害锛�
-export const workOrderEfficiencyAnalysis = (params) => {
- return request({
- url: "/home/workOrderEfficiencyAnalysis",
- method: "get",
- params,
- });
-};
-
-// 鐢熶骇鏍哥畻鍒嗘瀽锛坉ateType: 1鍛� 2鏈� 3瀛e害锛�
-export const productionAccountingAnalysis = (params) => {
- return request({
- url: "/home/productionAccountingAnalysis",
- method: "get",
- params,
- });
-};
// 鐢熶骇鏍哥畻鍒嗘瀽
export const productionAccountingAnalysis = (query) => {
return request({
diff --git a/src/views/productionManagement/productStatistics/index.vue b/src/views/productionManagement/productStatistics/index.vue
new file mode 100644
index 0000000..763f271
--- /dev/null
+++ b/src/views/productionManagement/productStatistics/index.vue
@@ -0,0 +1,254 @@
+<template>
+ <div class="app-container">
+ <div class="search_form">
+ <div class="search-row">
+ <div class="search-item">
+ <span class="search_title">澶╋細</span>
+ <el-date-picker
+ v-model="searchForm.searchTime"
+ type="date"
+ placeholder="閫夋嫨鏃ユ湡"
+ clearable
+ @change="handleSearchDate"
+ />
+ </div>
+ <div class="search-item">
+ <el-button type="primary"
+ @click="handleQuery">鎼滅储
+ </el-button>
+ </div>
+ </div>
+ </div>
+ <div class="table_list">
+ <PIMTable rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :tableLoading="tableLoading"
+ @pagination="pagination">
+ </PIMTable>
+ </div>
+ </div>
+</template>
+
+<script setup>
+import {onMounted, ref} from "vue";
+import dayjs from "dayjs";
+import {getCurrentInstance, reactive, toRefs} from "vue";
+import {queryProductInputAndOutput} from "../../../api/productionManagement/productionProductMain.js";
+
+const {proxy} = getCurrentInstance();
+
+const tableColumn = ref([
+ {
+ label: "浜у搧鍚嶇О",
+ prop: "productName",
+ width: "140",
+ },
+ {
+ label: "瑙勬牸",
+ prop: "model",
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ },
+ {
+ label: "鎶曞叆鏁伴噺",
+ prop: "inputQuantity",
+ width: "140",
+ },
+ {
+ label: "浜у嚭鏁伴噺",
+ prop: "outputQuantity",
+ width: "140",
+ }
+]);
+const tableData = ref([]);
+const tableLoading = ref(false);
+const page = reactive({
+ current: 1,
+ size: 100,
+ total: 0,
+});
+
+const data = reactive({
+ searchForm: {
+ searchTime: dayjs(),
+ startTime: dayjs().startOf('day').format("YYYY-MM-DD"),
+ endTime: dayjs().add(1, 'day').startOf('day').format("YYYY-MM-DD"),
+ },
+});
+const {searchForm} = toRefs(data);
+
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+ page.current = 1;
+ getList();
+};
+const pagination = obj => {
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
+};
+const getList = () => {
+ tableLoading.value = true;
+ const params = {...searchForm.value, ...page};
+ queryProductInputAndOutput(params)
+ .then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records;
+ page.total = res.data.total;
+ })
+ .catch(() => {
+ tableLoading.value = false;
+ });
+};
+
+const handleSearchDate = () => {
+ searchForm.value.startTime = dayjs(searchForm.value.searchTime).startOf('day').format("YYYY-MM-DD");
+ searchForm.value.endTime = dayjs(searchForm.value.searchTime).add(1, 'day').startOf('day').format("YYYY-MM-DD");
+};
+
+onMounted(() => {
+ getList();
+});
+</script>
+<style scoped lang="scss">
+.search_form {
+ margin-bottom: 20px;
+ .search-row {
+ display: flex;
+ gap: 20px;
+ align-items: center;
+ .search-item {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ }
+ }
+}
+
+.transfer-card-title {
+ font-size: 24px;
+ font-weight: bold;
+ text-align: center;
+ margin-bottom: 20px;
+}
+
+.transfer-card-container {
+ display: flex;
+ gap: 20px;
+ height: 350px;
+ .transfer-card-info {
+ flex: 1;
+ overflow: auto;
+ .info-group {
+ width: 50%;
+ float: left;
+ }
+ .info-item {
+ display: flex;
+ margin-bottom: 15px;
+ .info-label {
+ width: 120px;
+ font-weight: bold;
+ margin-right: 20px;
+ }
+ .info-value {
+ flex: 1;
+ }
+ }
+ }
+ .transfer-card-qr {
+ width: 240px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+ }
+}
+</style>
+
+<style lang="scss">
+@media print {
+ @page {
+ size: landscape;
+ }
+ body * {
+ visibility: hidden;
+ }
+ .el-dialog__wrapper,
+ .el-dialog,
+ .el-dialog__body,
+ .transfer-card-title,
+ .transfer-card-container,
+ .transfer-card-container *,
+ .info-item,
+ .info-label,
+ .info-value {
+ visibility: visible;
+ }
+ .print-button-container {
+ visibility: hidden;
+ }
+ .el-dialog__wrapper {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ margin: 0;
+ }
+ .el-dialog {
+ width: 100% !important;
+ max-width: 800px;
+ margin: 0 auto !important;
+ }
+ .el-dialog__header,
+ .el-dialog__footer {
+ display: none;
+ }
+ .el-dialog__body {
+ padding: 20px;
+ }
+ .transfer-card-container {
+ height: auto;
+ display: flex;
+ gap: 20px;
+ }
+ .transfer-card-info {
+ flex: 1;
+ .info-group {
+ width: 100%;
+ float: none;
+ margin-bottom: 20px;
+ }
+ .info-item {
+ display: flex;
+ margin-bottom: 10px;
+ .info-label {
+ width: 100px;
+ font-weight: bold;
+ margin-right: 15px;
+ white-space: nowrap;
+ }
+ .info-value {
+ flex: 1;
+ word-break: break-word;
+ }
+ }
+ }
+ .transfer-card-qr {
+ width: 160px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-start;
+ }
+ .qr-container img {
+ width: 140px !important;
+ height: 140px !important;
+ }
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3