From fc940d1939db4b832f2fad50aeea1cdeb4a638f3 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 26 三月 2026 12:00:25 +0800
Subject: [PATCH] 报工页面改为两列
---
src/views/productionManagement/workOrder/index.vue | 175 ++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 132 insertions(+), 43 deletions(-)
diff --git a/src/views/productionManagement/workOrder/index.vue b/src/views/productionManagement/workOrder/index.vue
index 2b3b203..b6c4300 100644
--- a/src/views/productionManagement/workOrder/index.vue
+++ b/src/views/productionManagement/workOrder/index.vue
@@ -12,6 +12,17 @@
clearable
prefix-icon="Search"/>
</div>
+
+ <div class="search-item">
+ <span class="search_title">鐢熶骇璁㈠崟鍙凤細</span>
+ <el-input v-model="searchForm.productOrderNpsNo"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ @change="handleQuery"
+ clearable
+ prefix-icon="Search"/>
+ </div>
+
<div class="search-item">
<el-button type="primary"
@click="handleQuery">鎼滅储
@@ -25,6 +36,7 @@
:tableData="tableData"
:page="page"
:tableLoading="tableLoading"
+ :rowClassName="rowClassName"
@pagination="pagination">
<template #completionStatus="{ row }">
<el-progress :percentage="toProgressPercentage(row?.completionStatus)"
@@ -170,47 +182,58 @@
</el-dialog>
<el-dialog v-model="reportDialogVisible"
title="鎶ュ伐"
- width="500px">
+ width="800px">
<el-form ref="reportFormRef"
:model="reportForm"
:rules="reportFormRules"
label-width="120px">
- <el-form-item label="寰呯敓浜ф暟閲�">
- <el-input v-model="reportForm.planQuantity"
- readonly
- style="width: 300px"/>
- </el-form-item>
- <el-form-item label="鏈鐢熶骇鏁伴噺" prop="quantity">
- <el-input v-model.number="reportForm.quantity"
- type="number"
- min="1"
- step="1"
- style="width: 300px"
- placeholder="璇疯緭鍏ユ湰娆$敓浜ф暟閲�"
- @input="handleQuantityInput"/>
- </el-form-item>
- <el-form-item label="鎶ュ簾鏁伴噺" prop="scrapQty">
- <el-input v-model.number="reportForm.scrapQty"
- type="number"
- min="0"
- step="1"
- style="width: 300px"
- placeholder="璇疯緭鍏ユ姤搴熸暟閲�"
- @input="handleScrapQtyInput"/>
- </el-form-item>
- <el-form-item label="鐝粍淇℃伅">
- <el-select v-model="reportForm.userId"
- style="width: 300px"
- placeholder="璇烽�夋嫨鐝粍淇℃伅"
- clearable
- filterable
- @change="handleUserChange">
- <el-option v-for="user in userOptions"
- :key="user.userId"
- :label="user.userName"
- :value="user.userId"/>
- </el-select>
- </el-form-item>
+ <el-row :gutter="20">
+ <el-col :span="12">
+ <el-form-item label="寰呯敓浜ф暟閲�">
+ <el-input v-model="reportForm.planQuantity"
+ readonly
+ style="width: 100%"/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鏈鐢熶骇鏁伴噺" prop="quantity">
+ <el-input v-model.number="reportForm.quantity"
+ type="number"
+ min="1"
+ step="1"
+ style="width: 100%"
+ placeholder="璇疯緭鍏ユ湰娆$敓浜ф暟閲�"
+ @input="handleQuantityInput"/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鎶ュ簾鏁伴噺" prop="scrapQty">
+ <el-input v-model.number="reportForm.scrapQty"
+ type="number"
+ min="0"
+ step="1"
+ style="width: 100%"
+ placeholder="璇疯緭鍏ユ姤搴熸暟閲�"
+ @input="handleScrapQtyInput"/>
+ </el-form-item>
+ </el-col>
+ <el-col :span="12">
+ <el-form-item label="鐝粍淇℃伅">
+ <el-select v-model="reportForm.userId"
+ style="width: 100%"
+ placeholder="璇烽�夋嫨鐝粍淇℃伅"
+ clearable
+ filterable
+ @change="handleUserChange">
+ <el-option v-for="user in userOptions"
+ :key="user.userId"
+ :label="user.userName"
+ :value="user.userId"/>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ </el-row>
+ <ProductionRecordForm ref="productionRecordFormRef" :list="processParamList"/>
</el-form>
<template #footer>
<span class="dialog-footer">
@@ -224,6 +247,18 @@
<CopperPrintingForm
v-if="copperPrintingFormVisible"
v-model:isShow="copperPrintingFormVisible"
+ :isEdit="true"
+ :row="currentReportRowData"
+ @refreshData="getList"/>
+ <VoltageSortingForm
+ v-if="voltageSortingFormVisible"
+ v-model:isShow="voltageSortingFormVisible"
+ :isEdit="true"
+ :row="currentReportRowData"
+ @refreshData="getList"/>
+ <GranulationForm
+ v-if="granulationFormVisible"
+ v-model:isShow="granulationFormVisible"
:isEdit="true"
:row="currentReportRowData"
@refreshData="getList"/>
@@ -244,11 +279,17 @@
import QRCode from "qrcode";
import {getCurrentInstance, reactive, toRefs} from "vue";
import FilesDia from "./components/filesDia.vue";
+import {
+ listPage as listProcessParamPage,
+} from "@/api/productionManagement/productProcessParameter.js";
const {proxy} = getCurrentInstance();
const {priority_type} = proxy.useDict("priority_type");
const CopperPrintingForm = defineAsyncComponent(() => import("./components/CopperPrintingForm.vue"));
+const VoltageSortingForm = defineAsyncComponent(() => import("./components/VoltageSortingForm.vue"));
+const ProductionRecordForm = defineAsyncComponent(() => import("./components/ProductionRecordForm.vue"));
+const GranulationForm = defineAsyncComponent(() => import("./components/GranulationForm.vue"));
const tableColumn = ref([
{
label: "浼樺厛绾�",
@@ -375,6 +416,8 @@
const qrRowData = ref(null);
const editDialogVisible = ref(false);
const copperPrintingFormVisible = ref(false);
+const voltageSortingFormVisible = ref(false);
+const granulationFormVisible = ref(false);
const transferCardVisible = ref(false);
const transferCardData = ref([]);
const transferCardQrUrl = ref("");
@@ -393,7 +436,11 @@
productProcessRouteItemId: "",
userId: "",
productMainId: null,
+ otherData: {
+ rows: [],
+ }
});
+const productionRecordFormRef = ref();
// 鏈鐢熶骇鏁伴噺楠岃瘉瑙勫垯
const validateQuantity = (rule, value, callback) => {
@@ -433,6 +480,13 @@
scrapQty: [
{validator: validateScrapQty, trigger: 'blur'}
]
+};
+
+const rowClassName = ({row}) => {
+ if (Number(row.completionStatus) > 0 && Number(row.actualQualifiedRate) < Number(row.processQualifiedRate)) {
+ return 'danger-row';
+ }
+ return '';
};
// 澶勭悊鏈鐢熶骇鏁伴噺杈撳叆锛岄檺鍒跺繀椤诲ぇ浜庣瓑浜�1
@@ -498,6 +552,7 @@
const data = reactive({
searchForm: {
workOrderNo: "",
+ productOrderNpsNo: "",
},
});
const {searchForm} = toRefs(data);
@@ -623,12 +678,36 @@
});
};
-const showReportDialog = row => {
+const processParamPage = reactive({
+ current: 1,
+ size: 9999,
+ total: 0,
+});
+const getProcessParamList = async (row) => {
+ const params = {
+ processId: row.processId,
+ ...processParamPage,
+ };
+ const res = await listProcessParamPage(params)
+ return res.data.records
+};
+
+const processParamList = ref([])
+const showReportDialog = async row => {
currentReportRowData.value = row;
- if (row.processName === '鍗伴摐') {
+ if (row.processName === '鍗伴摐' || row.processName === '鍗伴摱') {
copperPrintingFormVisible.value = true
return
}
+ if (row.processName === '鐢靛帇鍒嗛��') {
+ voltageSortingFormVisible.value = true
+ return;
+ }
+ if (row.processName === '閫犵矑') {
+ granulationFormVisible.value = true
+ return;
+ }
+ processParamList.value = await getProcessParamList(row)
reportForm.planQuantity = row.planQuantity;
reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
@@ -658,7 +737,12 @@
workOrderFilesRef.value?.openDialog(row);
};
-const handleReport = () => {
+const handleReport = async () => {
+ const data = await productionRecordFormRef.value.submitData()
+ if (!data) {
+ return;
+ }
+ reportForm.otherData.rows = data || [];
reportFormRef.value?.validate((valid) => {
if (!valid) {
return false;
@@ -710,7 +794,8 @@
const submitData = {
...reportForm,
quantity: quantity,
- scrapQty: scrapQty
+ scrapQty: scrapQty,
+ otherData: JSON.stringify(reportForm.otherData)
};
// console.log(submitData);
@@ -823,7 +908,11 @@
}
</style>
-<style lang="scss">
+<style lang="scss" scoped>
+:deep(.danger-row td) {
+ color: #e95a66 !important;
+}
+
@media print {
@page {
size: landscape;
@@ -907,4 +996,4 @@
height: 140px !important;
}
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3