From d648788841a802a2f56db5bd657a408b9b229d65 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 25 三月 2026 13:30:47 +0800
Subject: [PATCH] 销售看板
---
src/views/productionManagement/productionReporting/index.vue | 353 +++++++++++++++++++++++-----------------------------------
1 files changed, 139 insertions(+), 214 deletions(-)
diff --git a/src/views/productionManagement/productionReporting/index.vue b/src/views/productionManagement/productionReporting/index.vue
index 4bf8452..2f30d64 100644
--- a/src/views/productionManagement/productionReporting/index.vue
+++ b/src/views/productionManagement/productionReporting/index.vue
@@ -4,18 +4,26 @@
<el-form :model="searchForm"
:inline="true">
<el-form-item label="鐢熶骇璁㈠崟鍙�:">
- <el-input v-model="searchForm.orderNo"
+ <el-input v-model="searchForm.npsNo"
placeholder="璇疯緭鍏�"
clearable
style="width: 160px;"
@keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="鐝粍:">
- <el-input v-model="searchForm.teamName"
- placeholder="璇疯緭鍏�"
- clearable
- style="width: 160px;"
- @keyup.enter="handleQuery" />
+ <el-select v-model="searchForm.schedule"
+ placeholder="璇烽�夋嫨"
+ clearable
+ style="width: 160px;"
+ @keyup.enter="handleQuery">
+ <el-option label="鐧界彮"
+ value="鐧界彮" />
+ <el-option label="澶滅彮"
+ value="澶滅彮" />
+ </el-select>
+ <!-- <el-input v-model="searchForm.schedule"
+ placeholder="璇疯緭鍏�""
+ @keyup.enter="handleQuery" /> -->
</el-form-item>
<el-form-item label="浜у搧鍚嶇О:">
<el-input v-model="searchForm.productName"
@@ -46,93 +54,105 @@
:isSelection="false"
@selection-change="handleSelectionChange"
@pagination="pagination">
- <template #outputVolume="{ row }">
- <span style="font-weight: bold;color: #409eff;">{{ row.outputVolume }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
+ <template #totalQuantity="{ row }">
+ <span style="font-weight: bold;color: #409eff;">{{ row.totalQuantity }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
</template>
- <template #unqualifiedVolume="{ row }">
- <span style="font-weight: bold;color: #b43434;">{{ row.unqualifiedVolume }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
+ <template #scrapQty="{ row }">
+ <span style="font-weight: bold;color: #b43434;">{{ row.scrapQty }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
</template>
- <template #completedVolume="{ row }">
- <span style="font-weight: bold;color: #28e431;">{{ row.completedVolume }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
+ <template #quantity="{ row }">
+ <span style="font-weight: bold;color: #28e431;">{{ row.quantity }}</span><span style="margin-left: 5px;color: #909399;">鏂�</span>
</template>
</PIMTable>
</div>
- <ReportingDialog v-model:visible="dialogVisible"
- :data="form"
- @completed="handleQuery" />
+ <!-- 璇︽儏寮圭獥 -->
+ <detail-dialog v-model:visible="detailDialogVisible"
+ :data="detailData" />
</div>
</template>
<script setup>
import { onMounted, ref, reactive, getCurrentInstance } from "vue";
+ import { useRouter } from "vue-router";
import { ElMessage, ElMessageBox } from "element-plus";
import dayjs from "dayjs";
import {
- workListPage,
- productionReport,
- productionReportUpdate,
productionReportDelete,
+ productionReportDetail,
+ productionReportListPage,
} from "@/api/productionManagement/productionReporting.js";
import PIMTable from "@/components/PIMTable/PIMTable.vue";
- import ReportingDialog from "./components/ReportingDialog.vue";
+ import DetailDialog from "./detailDialog.vue";
+ const router = useRouter();
const { proxy } = getCurrentInstance();
const tableColumn = ref([
{
+ label: "鎶ュ伐缂栧彿",
+ prop: "productNo",
+ },
+ {
label: "鐢熶骇璁㈠崟鍙�",
- prop: "orderNo",
- width: "150px",
+ prop: "npsNo",
},
{
label: "鐝粍",
- prop: "teamName",
+ prop: "schedule",
width: "120px",
dataType: "tag",
+ formatType: params => {
+ return params === "鐧界彮" ? "primary" : "warning";
+ },
},
{
label: "浜у搧缂栫爜",
prop: "materialCode",
- width: "150px",
},
{
label: "浜у搧鍚嶇О",
prop: "productName",
- width: "150px",
},
{
label: "瑙勬牸",
- prop: "specification",
- width: "120px",
- className: "specification-cell",
+ prop: "productModelName",
+ className: "productModelName-cell",
+ },
+ {
+ label: "寮哄害",
+ prop: "strength",
+ dataType: "tag",
+ formatType: params => {
+ return params == "A3.5" ? "primary" : "warning";
+ },
},
{
label: "浜у嚭鏂归噺",
- prop: "outputVolume",
- width: "120px",
+ prop: "totalQuantity",
+ width: "100px",
align: "right",
dataType: "slot",
- slot: "outputVolume",
+ slot: "totalQuantity",
},
{
label: "涓嶅悎鏍兼柟閲�",
- prop: "unqualifiedVolume",
- width: "120px",
+ prop: "scrapQty",
+ width: "100px",
align: "right",
dataType: "slot",
- slot: "unqualifiedVolume",
+ slot: "scrapQty",
},
{
label: "瀹屾垚鏂归噺",
- prop: "completedVolume",
- width: "120px",
+ prop: "quantity",
+ width: "100px",
align: "right",
dataType: "slot",
- slot: "completedVolume",
+ slot: "quantity",
},
{
label: "鍒涘缓浜�",
- prop: "createBy",
+ prop: "postName",
width: "120px",
dataType: "tag",
},
@@ -182,171 +202,41 @@
});
const searchForm = reactive({
- orderNo: "",
- teamName: "",
+ npsNo: "",
+ schedule: "",
productName: "",
});
- const mockData = [
- {
- id: 1,
- orderNo: "PO202401001",
- teamName: "鐢熶骇涓�缁�",
- materialCode: "PC001",
- productName: "鏍囧噯鐮屽潡",
- specification: "600脳240脳200",
- outputVolume: 120.5,
- unqualifiedVolume: 2.3,
- completedVolume: 118.2,
- createBy: "寮犱笁",
- createTime: "2024-01-15 08:30:00",
- },
- {
- id: 2,
- orderNo: "PO202401002",
- teamName: "鐢熶骇浜岀粍",
- materialCode: "PC002",
- productName: "鏍囧噯鐮屽潡",
- specification: "600脳240脳200",
- outputVolume: 150.8,
- unqualifiedVolume: 1.5,
- completedVolume: 149.3,
- createBy: "鏉庡洓",
- createTime: "2024-01-15 09:15:00",
- },
- {
- id: 3,
- orderNo: "PO202401003",
- teamName: "鐢熶骇涓夌粍",
- materialCode: "PC003",
- productName: "鍔犳皵鐮屽潡",
- specification: "600脳240脳250",
- outputVolume: 95.2,
- unqualifiedVolume: 0.8,
- completedVolume: 94.4,
- createBy: "鐜嬩簲",
- createTime: "2024-01-15 10:00:00",
- },
- {
- id: 4,
- orderNo: "PO202401004",
- teamName: "鐢熶骇涓�缁�",
- materialCode: "PC004",
- productName: "鏍囧噯鐮屽潡",
- specification: "600脳240脳200",
- outputVolume: 180.6,
- unqualifiedVolume: 3.2,
- completedVolume: 177.4,
- createBy: "璧靛叚",
- createTime: "2024-01-15 14:20:00",
- },
- {
- id: 5,
- orderNo: "PO202401005",
- teamName: "鐢熶骇浜岀粍",
- materialCode: "PC005",
- productName: "鍔犳皵鐮屽潡",
- specification: "600脳240脳250",
- outputVolume: 110.3,
- unqualifiedVolume: 1.1,
- completedVolume: 109.2,
- createBy: "瀛欎竷",
- createTime: "2024-01-15 15:45:00",
- },
- {
- id: 6,
- orderNo: "PO202401006",
- teamName: "鐢熶骇涓夌粍",
- materialCode: "PC006",
- productName: "鏍囧噯鐮屽潡",
- specification: "600脳240脳200",
- outputVolume: 135.7,
- unqualifiedVolume: 2.5,
- completedVolume: 133.2,
- createBy: "鍛ㄥ叓",
- createTime: "2024-01-16 08:00:00",
- },
- {
- id: 7,
- orderNo: "PO202401007",
- teamName: "鐢熶骇涓�缁�",
- materialCode: "PC007",
- productName: "鍔犳皵鐮屽潡",
- specification: "600脳240脳250",
- outputVolume: 88.4,
- unqualifiedVolume: 0.6,
- completedVolume: 87.8,
- createBy: "鍚翠節",
- createTime: "2024-01-16 09:30:00",
- },
- {
- id: 8,
- orderNo: "PO202401008",
- teamName: "鐢熶骇浜岀粍",
- materialCode: "PC008",
- productName: "鏍囧噯鐮屽潡",
- specification: "600脳240脳200",
- outputVolume: 165.2,
- unqualifiedVolume: 2.8,
- completedVolume: 162.4,
- createBy: "閮戝崄",
- createTime: "2024-01-16 11:00:00",
- },
- {
- id: 9,
- orderNo: "PO202401009",
- teamName: "鐢熶骇涓夌粍",
- materialCode: "PC009",
- productName: "鍔犳皵鐮屽潡",
- specification: "600脳240脳250",
- outputVolume: 102.5,
- unqualifiedVolume: 1.3,
- completedVolume: 101.2,
- createBy: "閽卞崄涓�",
- createTime: "2024-01-16 13:15:00",
- },
- {
- id: 10,
- orderNo: "PO202401010",
- teamName: "鐢熶骇涓�缁�",
- materialCode: "PC010",
- productName: "鏍囧噯鐮屽潡",
- specification: "600脳240脳200",
- outputVolume: 142.8,
- unqualifiedVolume: 2.1,
- completedVolume: 140.7,
- createBy: "鍒樺崄浜�",
- createTime: "2024-01-16 15:00:00",
- },
- ];
-
- const dialogVisible = ref(false);
const form = reactive({
id: undefined,
orderId: "",
- orderNo: "",
- teamName: "",
+ npsNo: "",
+ schedule: "",
materialCode: "",
productName: "",
- specification: "",
- outputVolume: 0,
- unqualifiedVolume: 0,
- completedVolume: 0,
+ productModelName: "",
+ totalQuantity: 0,
+ scrapQty: 0,
+ quantity: 0,
processId: "",
params: {},
});
const selectedRows = ref([]);
+ const detailDialogVisible = ref(false);
+ const detailData = ref({});
const getList = () => {
tableLoading.value = true;
- setTimeout(() => {
+ productionReportListPage({
+ current: page.current,
+ size: page.size,
+ ...searchForm,
+ }).then(res => {
+ tableData.value = res.data.records;
+ page.total = res.data.total;
tableLoading.value = false;
- const start = (page.current - 1) * page.size;
- const end = start + page.size;
- tableData.value = mockData.slice(start, end);
- page.total = mockData.length;
- }, 500);
+ });
};
const handleQuery = () => {
@@ -355,8 +245,8 @@
};
const handleReset = () => {
- searchForm.orderNo = "";
- searchForm.teamName = "";
+ searchForm.npsNo = "";
+ searchForm.schedule = "";
searchForm.productName = "";
page.current = 1;
getList();
@@ -374,44 +264,79 @@
const handleAdd = () => {
Object.assign(form, {
+ type: "add",
id: undefined,
orderId: "",
- orderNo: "",
- teamName: "",
+ npsNo: "",
+ schedule: "",
materialCode: "",
productName: "",
- specification: "",
- outputVolume: 0,
- unqualifiedVolume: 0,
- completedVolume: 0,
+ productModelName: "",
+ totalQuantity: 0,
+ scrapQty: 0,
+ quantity: 0,
processId: "",
params: {},
});
- dialogVisible.value = true;
+ router.push({
+ path: "/productionManagement/ReportingDialog",
+ // query: { data: JSON.stringify(form) },
+ });
};
const handleEdit = row => {
- Object.assign(form, {
- id: row.id,
- orderId: row.orderId || "",
- orderNo: row.orderNo,
- teamName: row.teamName,
- materialCode: row.materialCode,
- productName: row.productName,
- specification: row.specification,
- outputVolume: row.outputVolume,
- unqualifiedVolume: row.unqualifiedVolume,
- completedVolume: row.completedVolume,
- createBy: row.createBy || "",
- createTime: row.createTime || new Date(),
- processId: row.processId || "",
- params: row.params || {},
- });
- dialogVisible.value = true;
+ // 璋冪敤璇︽儏鎺ュ彛鑾峰彇瀹屾暣鏁版嵁
+ productionReportDetail(row.id)
+ .then(res => {
+ if (res.code === 200) {
+ const detailData = res.data;
+ // 鏋勫缓缂栬緫琛ㄥ崟鏁版嵁
+ const editForm = {
+ id: row.id,
+ type: "edit",
+ orderId: detailData.productOrderId || "",
+ npsNo: detailData.npsNo || "",
+ schedule: detailData.schedule || "",
+ materialCode: detailData.materialCode || "",
+ productName: detailData.productName || "",
+ productModelName: detailData.model || "",
+ totalQuantity: detailData.quantity || 0,
+ scrapQty: detailData.unqualifiedQuantity || 0,
+ quantity: detailData.qualifiedQuantity || 0,
+ createBy: detailData.postName || "",
+ createTime: detailData.createTime || new Date(),
+ processId: "",
+ params: {},
+ // 浼犻�掑伐搴忎俊鎭�
+ productionProductRouteItemDtoList:
+ detailData.productionProductRouteItemDtoList || [],
+ };
+ router.push({
+ path: "/productionManagement/ReportingDialog",
+ query: { data: JSON.stringify(editForm) },
+ });
+ } else {
+ ElMessage.error("鑾峰彇璇︽儏澶辫触");
+ }
+ })
+ .catch(() => {
+ ElMessage.error("鑾峰彇璇︽儏澶辫触");
+ });
};
const handleDetail = row => {
- ElMessage.info("璇︽儏鍔熻兘寰呭疄鐜�");
+ productionReportDetail(row.id)
+ .then(res => {
+ if (res.code === 200) {
+ detailData.value = res.data;
+ detailDialogVisible.value = true;
+ } else {
+ ElMessage.error("鑾峰彇璇︽儏澶辫触");
+ }
+ })
+ .catch(() => {
+ ElMessage.error("鑾峰彇璇︽儏澶辫触");
+ });
};
const handleDelete = row => {
@@ -421,7 +346,7 @@
type: "warning",
})
.then(() => {
- productionReportDelete({ id: row.id })
+ productionReportDelete(row.id)
.then(() => {
ElMessage.success("鍒犻櫎鎴愬姛");
getList();
@@ -539,7 +464,7 @@
}
</style>
<style lang="scss">
- .specification-cell {
+ .productModelName-cell {
color: #7a7d81;
font-style: italic;
}
--
Gitblit v1.9.3