From 376bcaa483e26c36c90bebcce1d0b9be8e854d5e Mon Sep 17 00:00:00 2001
From: CD配唱片 <CD配唱片>
Date: 星期一, 28 四月 2025 12:59:45 +0800
Subject: [PATCH] 提交产能规划全table编辑
---
src/views/basicData/standardProcess/index.vue | 395 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 263 insertions(+), 132 deletions(-)
diff --git a/src/views/basicData/standardProcess/index.vue b/src/views/basicData/standardProcess/index.vue
index 68566fd..6f58e01 100644
--- a/src/views/basicData/standardProcess/index.vue
+++ b/src/views/basicData/standardProcess/index.vue
@@ -1,6 +1,12 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
+ <el-form
+ :model="queryParams"
+ ref="queryRef"
+ :inline="true"
+ v-show="showSearch"
+ label-width="68px"
+ >
<el-form-item label="宸ュ簭缂栫爜" prop="processNumber">
<el-input
v-model="queryParams.processNumber"
@@ -42,12 +48,20 @@
/>
</el-form-item>
<el-form-item label="宸ュ巶" prop="plant">
- <el-input
- v-model="queryParams.plant"
- placeholder="璇疯緭鍏ュ伐鍘�"
+ <el-select
clearable
- @keyup.enter="handleQuery"
- />
+ v-model="queryParams.plant"
+ style="width: 200px;"
+ placeholder="璇疯緭鍏ラ�傜敤宸ュ巶"
+ >
+ <el-option
+ v-for="plant in plantList"
+ :key="plant.id"
+ :label="plant.plantName"
+ :value="plant.plantCode"
+ >
+ </el-option>
+ </el-select>
</el-form-item>
<el-form-item label="杞﹂棿" prop="workShop">
<el-input
@@ -66,7 +80,9 @@
/>
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="Search" @click="handleQuery">鎼滅储</el-button>
+ <el-button type="primary" icon="Search" @click="handleQuery"
+ >鎼滅储</el-button
+ >
<el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
@@ -79,7 +95,8 @@
icon="Plus"
@click="handleAdd"
v-hasPermi="['core:standardProcess:add']"
- >鏂板</el-button>
+ >鏂板</el-button
+ >
</el-col>
<el-col :span="1.5">
<el-button
@@ -89,7 +106,8 @@
:disabled="single"
@click="handleUpdate"
v-hasPermi="['core:standardProcess:edit']"
- >淇敼</el-button>
+ >淇敼</el-button
+ >
</el-col>
<el-col :span="1.5">
<el-button
@@ -99,16 +117,18 @@
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['core:standardProcess:remove']"
- >鍒犻櫎</el-button>
+ >鍒犻櫎</el-button
+ >
</el-col>
<el-col :span="1.5">
<el-button
- type="info"
- plain
- icon="Upload"
- @click="handleImport"
- v-hasPermi="['aps:standardProcess:importData']"
- >瀵煎叆</el-button>
+ type="info"
+ plain
+ icon="Upload"
+ @click="handleImport"
+ v-hasPermi="['aps:standardProcess:importData']"
+ >瀵煎叆</el-button
+ >
</el-col>
<el-col :span="1.5">
<el-button
@@ -117,41 +137,66 @@
icon="Download"
@click="handleExport"
v-hasPermi="['core:standardProcess:export']"
- >瀵煎嚭</el-button>
+ >瀵煎嚭</el-button
+ >
</el-col>
- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
+ <right-toolbar
+ v-model:showSearch="showSearch"
+ @queryTable="getList"
+ ></right-toolbar>
</el-row>
<HxlhTable
- style="width: 100%"
- :columns="columns"
- :data="standardProcessList"
- :loading="loading"
- :height="height"
- @on-checkbox="handleCheckboxChange"
+ style="width: 100%"
+ :columns="columns"
+ :data="standardProcessList"
+ :loading="loading"
+ :height="height"
+ :page="page"
+ @changePageNo="changePageNo"
+ @changePageSize="changePageSize"
+ @on-checkbox="handleCheckboxChange"
>
</HxlhTable>
-<!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
- <el-dialog :title="upload.title" v-model="upload.open" width="90%" append-to-body @close="dialogCancel">
+ <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
+ <el-dialog
+ :title="upload.title"
+ v-model="upload.open"
+ width="90%"
+ append-to-body
+ @close="dialogCancel"
+ >
<el-row :gutter="10">
<el-col>
- <div style="border-bottom: 1px solid #ccc;" >
+ <div style="border-bottom: 1px solid #ccc">
<p>涓婁紶Excel鏂囦欢銆�</p>
</div>
</el-col>
- <el-col >
+ <el-col>
<div></div>
</el-col>
</el-row>
- <el-row :gutter="10" style="margin-top: 20px;">
- </el-row>
+ <el-row :gutter="10" style="margin-top: 20px"> </el-row>
<el-row>
<el-col>
- <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="true" drag>
+ <el-upload
+ ref="uploadRef"
+ :limit="1"
+ accept=".xlsx, .xls"
+ :headers="upload.headers"
+ :action="upload.url + '?updateSupport=' + upload.updateSupport"
+ :disabled="upload.isUploading"
+ :on-progress="handleFileUploadProgress"
+ :on-success="handleFileSuccess"
+ :auto-upload="true"
+ drag
+ >
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
- <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+ <div class="el-upload__text">
+ 灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em>
+ </div>
<template #tip>
<div class="el-upload__tip">
<span>浠呭厑璁稿鍏ls銆亁lsx鏍煎紡鏂囦欢銆�</span>
@@ -160,36 +205,37 @@
</el-upload>
</el-col>
</el-row>
-<!-- <el-row v-show="isVisible">-->
-<!-- <el-col>-->
-<!-- <div>-->
-<!-- <h2>鏁版嵁棰勮</h2>-->
-<!-- </div>-->
-<!-- <HxlhTable-->
-<!-- style="width: 100%"-->
-<!-- :columns="exampleColumns"-->
-<!-- :data="exampleList"-->
-<!-- :loading="loading"-->
-<!-- :maxHeight="exampleHeight"-->
-<!-- @on-checkbox="handleCheckboxChange"-->
-<!-- >-->
-<!-- </HxlhTable>-->
-<!-- </el-col>-->
-<!-- <el-col>-->
-<!-- <div style="text-align: right;">-->
-<!-- <h4>鍏变笂浼�<span style="color: blue;">{{ total }}</span>鏉℃暟鎹�</h4>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
+ <!-- <el-row v-show="isVisible">-->
+ <!-- <el-col>-->
+ <!-- <div>-->
+ <!-- <h2>鏁版嵁棰勮</h2>-->
+ <!-- </div>-->
+ <!-- <HxlhTable-->
+ <!-- style="width: 100%"-->
+ <!-- :columns="exampleColumns"-->
+ <!-- :data="exampleList"-->
+ <!-- :loading="loading"-->
+ <!-- :maxHeight="exampleHeight"-->
+ <!-- @on-checkbox="handleCheckboxChange"-->
+ <!-- >-->
+ <!-- </HxlhTable>-->
+ <!-- </el-col>-->
+ <!-- <el-col>-->
+ <!-- <div style="text-align: right;">-->
+ <!-- <h4>鍏变笂浼�<span style="color: blue;">{{ total }}</span>鏉℃暟鎹�</h4>-->
+ <!-- </div>-->
+ <!-- </el-col>-->
+ <!-- </el-row>-->
<template #footer>
<div class="dialog-footer">
<el-button
- type="success"
- plain
- icon="Check"
- :disabled="planned"
- @click="uploadParse"
- >纭涓婁紶</el-button>
+ type="success"
+ plain
+ icon="Check"
+ :disabled="planned"
+ @click="uploadParse"
+ >纭涓婁紶</el-button
+ >
<el-button @click="dialogCancel">鍙� 娑�</el-button>
</div>
</template>
@@ -197,7 +243,12 @@
<!-- 娣诲姞鎴栦慨鏀规爣鍑嗗伐搴忓璇濇 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
- <el-form ref="standardProcessRef" :model="form" :rules="rules" label-width="80px">
+ <el-form
+ ref="standardProcessRef"
+ :model="form"
+ :rules="rules"
+ label-width="80px"
+ >
<el-form-item label="宸ュ簭缂栫爜" prop="processNumber">
<el-input v-model="form.processNumber" placeholder="璇疯緭鍏ュ伐搴忕紪鐮�" />
</el-form-item>
@@ -205,26 +256,48 @@
<el-input v-model="form.processName" placeholder="璇疯緭鍏ュ伐搴忓悕绉�" />
</el-form-item>
<el-form-item label="璧勬簮缁�" prop="resourceGroupName">
- <el-input v-model="form.resourceGroupName" placeholder="璇疯緭鍏ヨ祫婧愮粍" />
+ <el-input
+ v-model="form.resourceGroupName"
+ placeholder="璇疯緭鍏ヨ祫婧愮粍"
+ />
</el-form-item>
<el-form-item label="浜ц兘妯″瀷" prop="model">
- <el-input v-model="form.model" placeholder="璇疯緭鍏ヤ骇鑳芥ā鍨�: 鐙崰/鍚堟壒" />
+ <el-input
+ v-model="form.model"
+ placeholder="璇疯緭鍏ヤ骇鑳芥ā鍨�: 鐙崰/鍚堟壒"
+ />
</el-form-item>
<el-form-item label="璁捐浜ц兘" prop="designCapacity">
- <el-input v-model="form.designCapacity" placeholder="璇疯緭鍏ヨ璁′骇鑳�" />
+ <el-input
+ v-model="form.designCapacity"
+ placeholder="璇疯緭鍏ヨ璁′骇鑳�"
+ />
</el-form-item>
<el-form-item label="宸ュ巶" prop="plant">
- <el-input v-model="form.plant" placeholder="璇疯緭鍏ュ伐鍘�" />
+ <el-select
+ clearable
+ v-model="form.plant"
+ style="width: 100%"
+ placeholder="璇疯緭鍏ラ�傜敤宸ュ巶"
+ >
+ <el-option
+ v-for="plant in plantList"
+ :key="plant.id"
+ :label="plant.plantName"
+ :value="plant.plantCode"
+ >
+ </el-option>
+ </el-select>
</el-form-item>
<el-form-item label="杞﹂棿" prop="workShop">
<el-input v-model="form.workShop" placeholder="璇疯緭鍏ヨ溅闂�" />
</el-form-item>
-<!-- <el-form-item label="鏃ュ巻Id" prop="workCalenderId">-->
-<!-- <el-input v-model="form.workCalenderId" placeholder="璇疯緭鍏ユ棩鍘咺d" />-->
-<!-- </el-form-item>-->
-<!-- <el-form-item label="浜ц兘妯″瀷Id" prop="modelId">-->
-<!-- <el-input v-model="form.modelId" placeholder="璇疯緭鍏ヤ骇鑳芥ā鍨婭d" />-->
-<!-- </el-form-item>-->
+ <!-- <el-form-item label="鏃ュ巻Id" prop="workCalenderId">-->
+ <!-- <el-input v-model="form.workCalenderId" placeholder="璇疯緭鍏ユ棩鍘咺d" />-->
+ <!-- </el-form-item>-->
+ <!-- <el-form-item label="浜ц兘妯″瀷Id" prop="modelId">-->
+ <!-- <el-input v-model="form.modelId" placeholder="璇疯緭鍏ヤ骇鑳芥ā鍨婭d" />-->
+ <!-- </el-form-item>-->
<el-form-item label="鏃ュ巻鎻忚堪" prop="workCalender">
<el-input v-model="form.workCalender" placeholder="璇疯緭鍏ユ棩鍘嗘弿杩�" />
</el-form-item>
@@ -240,14 +313,27 @@
</template>
<script setup name="StandardProcess">
-import { listStandardProcess, getStandardProcess, delStandardProcess, addStandardProcess, updateStandardProcess } from "@/api/basicData/standardProcess";
+import {
+ listStandardProcess,
+ getStandardProcess,
+ delStandardProcess,
+ addStandardProcess,
+ updateStandardProcess,
+} from "@/api/basicData/standardProcess";
+import { listAll_plant } from "@/api/basicData/plant";
import HxlhTable from "@/components/HxlhTable/index.vue";
import { getToken } from "@/utils/auth.js";
-import {ref} from "vue";
-import { ElMessage } from 'element-plus'
+import { ref } from "vue";
+import { ElMessage } from "element-plus";
const { proxy } = getCurrentInstance();
-
+// 鍒嗛〉灞炴��
+const page = ref({
+ total: 0,
+ current: 1,
+ size: 10,
+});
+const plantList = ref([]);
const standardProcessList = ref([]);
const open = ref(false);
const loading = ref(true);
@@ -258,7 +344,7 @@
const total = ref(0);
const title = ref("");
//寮圭獥鐩稿叧
-const height = ref(document.documentElement.clientHeight - 260 + "px;")
+const height = ref(document.documentElement.clientHeight - 330 + "px;");
const isVisible = ref(false);
const isError = ref(false);
const planned = ref(true);
@@ -281,60 +367,75 @@
// 璁剧疆涓婁紶鐨勮姹傚ご閮�
headers: { Authorization: "Bearer " + getToken() },
// 涓婁紶鐨勫湴鍧�
- url: import.meta.env.VITE_APP_BASE_API + "/aps/standardProcess/importData"
+ url: import.meta.env.VITE_APP_BASE_API + "/aps/standardProcess/importData",
});
// 琛ㄦ牸閰嶇疆-鍒楄〃
const columns = ref([
- { type: 'checkbox', width: 60, align:"center"},
- { type: 'seq', title: '搴忓彿', width: 60, align: 'center' },
+ { type: "checkbox", width: 60, align: "center" },
+ { type: "seq", title: "搴忓彿", width: 60, align: "center" },
{
- title: '宸ュ簭缂栫爜',
- field: 'processNumber',
+ title: "宸ュ簭缂栫爜",
+ field: "processNumber",
width: 150,
- align:"center",
+ align: "center",
},
{
- title: '宸ュ簭鍚嶇О',
- field: 'processName',
+ title: "宸ュ簭鍚嶇О",
+ field: "processName",
width: 200,
- align:"center",
+ align: "center",
},
{
- title: '璧勬簮缁�',
- field: 'resourceGroupName',
+ title: "璧勬簮缁�",
+ field: "resourceGroupName",
width: 150,
- align:"center",
+ align: "center",
},
{
- title: '浜ц兘妯″瀷',
- field: 'model',
+ title: "浜ц兘妯″瀷",
+ field: "model",
width: 150,
- align:"center",
+ align: "center",
},
{
- title: '璁捐浜ц兘',
- field: 'designCapacity',
+ title: "璁捐浜ц兘",
+ field: "designCapacity",
width: 150,
- align:"center",
+ align: "center",
},
{
- title: '宸ュ巶',
- field: 'plant',
+ title: "宸ュ巶",
+ field: "plant",
width: 150,
- align:"center",
+ align: "center",
+ formatter: ({ cellValue, row, column }) => {
+ if (cellValue) {
+ for (let i = 0; i < plantList.value.length; i++) {
+ if (cellValue === plantList.value[i].plantCode) {
+ return plantList.value[i].plantName;
+ }
+ }
+ }
+ },
},
{
- title: '杞﹂棿',
- field: 'workShop',
+ title: "杞﹂棿",
+ field: "workShop",
width: 150,
- align:"center",
+ align: "center",
},
{
- title: '鏃ュ巻',
- field: 'workCalender',
+ title: "鏃ュ巻",
+ field: "workCalender",
width: 150,
- align:"center",
- }
+ align: "center",
+ },
+ {
+ title: "涓撲笟",
+ field: "major",
+ width: 150,
+ align: "center",
+ },
]);
const data = reactive({
@@ -353,10 +454,9 @@
workShop: null,
workCalenderId: null,
modelId: null,
- workCalender: null
+ workCalender: null,
},
- rules: {
- }
+ rules: {},
});
const { queryParams, form, rules } = toRefs(data);
@@ -364,13 +464,25 @@
/** 鏌ヨ鏍囧噯宸ュ簭鍒楄〃 */
function getList() {
loading.value = true;
- listStandardProcess(queryParams.value).then(response => {
+ listStandardProcess(queryParams.value).then((response) => {
standardProcessList.value = response.rows;
total.value = response.total;
loading.value = false;
+ page.value.total = response.total;
});
}
+function changePageNo(currentPage) {
+ queryParams.value.pageNum = currentPage;
+ page.value.current = currentPage;
+ getList();
+}
+function changePageSize(pageSize) {
+ page.value.current = 1;
+ queryParams.value.pageNum = 1;
+ queryParams.value.pageSize = pageSize;
+ getList();
+}
// 鍙栨秷鎸夐挳
function cancel() {
open.value = false;
@@ -397,7 +509,7 @@
updateBy: null,
updateTime: null,
modelId: null,
- workCalender: null
+ workCalender: null,
};
proxy.resetForm("standardProcessRef");
}
@@ -416,7 +528,7 @@
// 澶氶�夋閫変腑鏁版嵁
function handleSelectionChange(selection) {
- ids.value = selection.map(item => item.id);
+ ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
@@ -431,8 +543,8 @@
/** 淇敼鎸夐挳鎿嶄綔 */
function handleUpdate(row) {
reset();
- const _id = row.id || ids.value
- getStandardProcess(_id).then(response => {
+ const _id = row.id || ids.value;
+ getStandardProcess(_id).then((response) => {
form.value = response.data;
open.value = true;
title.value = "淇敼鏍囧噯宸ュ簭";
@@ -441,16 +553,16 @@
/** 鎻愪氦鎸夐挳 */
function submitForm() {
- proxy.$refs["standardProcessRef"].validate(valid => {
+ proxy.$refs["standardProcessRef"].validate((valid) => {
if (valid) {
if (form.value.id != null) {
- updateStandardProcess(form.value).then(response => {
+ updateStandardProcess(form.value).then((response) => {
proxy.$modal.msgSuccess("淇敼鎴愬姛");
open.value = false;
getList();
});
} else {
- addStandardProcess(form.value).then(response => {
+ addStandardProcess(form.value).then((response) => {
proxy.$modal.msgSuccess("鏂板鎴愬姛");
open.value = false;
getList();
@@ -463,19 +575,27 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
function handleDelete(row) {
const _ids = row.id || ids.value;
- proxy.$modal.confirm('鏄惁纭鍒犻櫎鏍囧噯宸ュ簭缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�').then(function() {
- return delStandardProcess(_ids);
- }).then(() => {
- getList();
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- }).catch(() => {});
+ proxy.$modal
+ .confirm('鏄惁纭鍒犻櫎鏍囧噯宸ュ簭缂栧彿涓�"' + _ids + '"鐨勬暟鎹」锛�')
+ .then(function () {
+ return delStandardProcess(_ids);
+ })
+ .then(() => {
+ getList();
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ })
+ .catch(() => {});
}
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
function handleExport() {
- proxy.download('aps/standardProcess/export', {
- ...queryParams.value
- }, `standardProcess_${new Date().getTime()}.xlsx`)
+ proxy.download(
+ "aps/standardProcess/export",
+ {
+ ...queryParams.value,
+ },
+ `standardProcess_${new Date().getTime()}.xlsx`
+ );
}
/** 瀵煎叆鎸夐挳鎿嶄綔 */
@@ -484,10 +604,10 @@
upload.open = true;
}
-function handleCheckboxChange(){}
+function handleCheckboxChange() {}
/** dialog鍙栨秷 */
-function dialogCancel(){
+function dialogCancel() {
if (uploadRef.value) {
uploadRef.value.clearFiles();
}
@@ -508,22 +628,28 @@
upload.open = false;
requestDate.value = null;
ElMessage({
- message: '璧勬簮姹犳暟鎹凡鎴愬姛涓婁紶鍜岃В鏋�',
- type: 'success',
- })
+ message: "璧勬簮姹犳暟鎹凡鎴愬姛涓婁紶鍜岃В鏋�",
+ type: "success",
+ });
getList();
}
/** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */
const handleFileSuccess = (response, file, fileList) => {
- if(response.code == '200'){
+ if (response.code == "200") {
batchNumber.value = response.data;
isVisible.value = true;
planned.value = false;
isError.value = false;
- }else{
+ } else {
isError.value = true;
- proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true });
+ proxy.$alert(
+ "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
+ response.msg +
+ "</div>",
+ "瀵煎叆缁撴灉",
+ { dangerouslyUseHTMLString: true }
+ );
}
proxy.$refs["uploadRef"].handleRemove(file);
upload.isUploading = false;
@@ -533,6 +659,11 @@
const handleFileUploadProgress = (event, file, fileList) => {
upload.isUploading = true;
};
-
+onMounted(async () => {
+ /** 鏌ヨ宸ュ巶鍒楄〃 */
+ const response = await listAll_plant({});
+ plantList.value = response.data;
+ loading.value = false;
+});
getList();
</script>
--
Gitblit v1.9.3