From 30dc46174a37613366081bd1abab8eb71c171f7f Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 16 一月 2026 16:17:46 +0800
Subject: [PATCH] 浪潮对接单点登录:MES制造执行系统功能迁移
---
src/views/productionManagement/operationScheduling/components/formDia.vue | 151 +++++++++++++++++++++++++------------------------
1 files changed, 77 insertions(+), 74 deletions(-)
diff --git a/src/views/productionManagement/operationScheduling/components/formDia.vue b/src/views/productionManagement/operationScheduling/components/formDia.vue
index a4f36bf..8906312 100644
--- a/src/views/productionManagement/operationScheduling/components/formDia.vue
+++ b/src/views/productionManagement/operationScheduling/components/formDia.vue
@@ -7,8 +7,8 @@
@close="closeDia"
>
<el-button type="primary" @click="addRow" style="margin-bottom: 10px;">鏂板</el-button>
- <span style="font-size: 18px;margin-left: 10px">寰呮帓浜ф暟閲忥細{{pendingNum}}</span>
- <el-table :data="tableData" border style="width: 100%" :summary-method="summarizeMainTable" show-summary :row-key="row => row.id">
+ <span style="font-size: 18px;margin-left: 10px">寰呮帓浜ф暟閲忥細{{pendingNum}}</span>
+ <el-table :data="tableData" border style="width: 100%" :summary-method="summarizeMainTable" show-summary :row-key="row => row.id" stripe>
<el-table-column label="搴忓彿" width="60">
<template #default="scope">
{{ scope.$index + 1 }}
@@ -16,7 +16,11 @@
</el-table-column>
<el-table-column label="宸ュ簭" prop="process">
<template #default="scope">
- <el-input v-model="scope.row.process" placeholder="璇疯緭鍏ュ伐搴�" />
+ <el-input
+ v-model="scope.row.process"
+ placeholder="璇疯緭鍏ュ伐搴�"
+ clearable
+ />
</template>
</el-table-column>
<el-table-column label="鍗曚綅" prop="unit">
@@ -26,28 +30,28 @@
</el-table-column>
<el-table-column label="鎺掍骇鏁伴噺" width="200" prop="schedulingNum">
<template #default="scope">
- <el-input-number
- v-model="scope.row.schedulingNum"
- placeholder="璇疯緭鍏�"
- :min="0"
- :step="0.1"
- :precision="2"
- clearable
- style="width: 100%"
- />
+ <el-input-number
+ v-model="scope.row.schedulingNum"
+ placeholder="璇疯緭鍏�"
+ :min="0"
+ :step="0.1"
+ :precision="2"
+ clearable
+ style="width: 100%"
+ />
</template>
</el-table-column>
<el-table-column label="宸ユ椂瀹氶" width="200" prop="workHours">
<template #default="scope">
- <el-input-number
- v-model="scope.row.workHours"
- placeholder="璇疯緭鍏�"
- :min="0"
- :step="0.1"
- :precision="2"
- clearable
- style="width: 100%"
- />
+ <el-input-number
+ v-model="scope.row.workHours"
+ placeholder="璇疯緭鍏�"
+ :min="0"
+ :step="0.1"
+ :precision="2"
+ clearable
+ style="width: 100%"
+ />
</template>
</el-table-column>
<el-table-column label="鎺掍骇鏃ユ湡" prop="schedulingDate">
@@ -57,18 +61,18 @@
</el-table-column>
<el-table-column label="鎺掍骇浜�" prop="schedulingUserId">
<template #default="scope">
- <el-select
- v-model="scope.row.schedulingUserId"
- placeholder="閫夋嫨浜哄憳"
- style="width: 100%;"
- >
- <el-option
- v-for="user in userList"
- :key="user.userId"
- :label="user.nickName"
- :value="user.userId"
- />
- </el-select>
+ <el-select
+ v-model="scope.row.schedulingUserId"
+ placeholder="閫夋嫨浜哄憳"
+ style="width: 100%;"
+ >
+ <el-option
+ v-for="user in userList"
+ :key="user.userId"
+ :label="user.nickName"
+ :value="user.userId"
+ />
+ </el-select>
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" width="80">
@@ -77,12 +81,12 @@
</template>
</el-table-column>
</el-table>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭</el-button>
- <el-button @click="closeDia">鍙栨秷</el-button>
- </div>
- </template>
+ <template #footer>
+ <div class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭</el-button>
+ <el-button @click="closeDia">鍙栨秷</el-button>
+ </div>
+ </template>
</el-dialog>
</div>
</template>
@@ -92,13 +96,12 @@
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {processScheduling} from "@/api/productionManagement/operationScheduling.js";
const { proxy } = getCurrentInstance()
-const { work_step } = proxy.useDict("work_step")
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
const operationType = ref('')
const tableData = ref([
- { process: '', schedulingDate: '', schedulingNum: '', schedulingUserId: '', workHours: '', unit: '' }
+ { process: '', schedulingDate: '', schedulingNum: '', schedulingUserId: '', workHours: '', unit: '' }
]);
const unitFromRow = ref('');
const idFromRow = ref('');
@@ -109,10 +112,10 @@
const openDialog = (type, row) => {
operationType.value = type;
dialogFormVisible.value = true;
- userListNoPageByTenantId().then((res) => {
- userList.value = res.data;
- });
- pendingNum.value = row.pendingNum
+ userListNoPageByTenantId().then((res) => {
+ userList.value = res.data;
+ });
+ pendingNum.value = row.pendingNum
if (row && row.unit !== undefined) {
unitFromRow.value = row.unit;
idFromRow.value = row.id;
@@ -125,36 +128,36 @@
}
}
const submitForm = () => {
- // 1. 妫�鏌ユ瘡涓�琛屾槸鍚﹀~鍐欏畬鏁�
- for (let i = 0; i < tableData.value.length; i++) {
- const row = tableData.value[i];
- if (
- !row.process ||
- !row.schedulingDate ||
- row.schedulingNum === '' || row.schedulingNum === null ||
- !row.schedulingUserId ||
- row.workHours === '' || row.workHours === null ||
- !row.unit
- ) {
- proxy.$modal.msgError(`绗�${i + 1}琛屾暟鎹湭濉啓瀹屾暣`);
- return;
- }
- }
- // 2. 鍚堣鎺掍骇鏁伴噺
- const totalSchedulingNum = tableData.value.reduce((sum, row) => {
- return sum + Number(row.schedulingNum || 0);
- }, 0);
- if (totalSchedulingNum > Number(pendingNum.value)) {
- proxy.$modal.msgError('鎺掍骇鏁伴噺鍚堣涓嶈兘瓒呰繃寰呮帓浜ф暟閲�');
- return;
- }
- processScheduling(tableData.value).then((res) => {
- proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
- closeDia();
- })
+ // 1. 妫�鏌ユ瘡涓�琛屾槸鍚﹀~鍐欏畬鏁�
+ for (let i = 0; i < tableData.value.length; i++) {
+ const row = tableData.value[i];
+ if (
+ !row.process ||
+ !row.schedulingDate ||
+ row.schedulingNum === '' || row.schedulingNum === null ||
+ !row.schedulingUserId ||
+ row.workHours === '' || row.workHours === null ||
+ !row.unit
+ ) {
+ proxy.$modal.msgError(`绗�${i + 1}琛屾暟鎹湭濉啓瀹屾暣`);
+ return;
+ }
+ }
+ // 2. 鍚堣鎺掍骇鏁伴噺
+ const totalSchedulingNum = tableData.value.reduce((sum, row) => {
+ return sum + Number(row.schedulingNum || 0);
+ }, 0);
+ if (totalSchedulingNum > Number(pendingNum.value)) {
+ proxy.$modal.msgError('鎺掍骇鏁伴噺鍚堣涓嶈兘瓒呰繃寰呮帓浜ф暟閲�');
+ return;
+ }
+ processScheduling(tableData.value).then((res) => {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ closeDia();
+ })
}
const summarizeMainTable = (param) => {
- return proxy.summarizeTable(param, ['schedulingNum']);
+ return proxy.summarizeTable(param, ['schedulingNum']);
};
// 鍏抽棴寮规
const closeDia = () => {
@@ -175,4 +178,4 @@
<style scoped>
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3