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/index.vue | 402 +++++++++++++++++++++++++-------------------------------
1 files changed, 179 insertions(+), 223 deletions(-)
diff --git a/src/views/productionManagement/operationScheduling/index.vue b/src/views/productionManagement/operationScheduling/index.vue
index 082b782..134050d 100644
--- a/src/views/productionManagement/operationScheduling/index.vue
+++ b/src/views/productionManagement/operationScheduling/index.vue
@@ -1,53 +1,42 @@
<template>
- <div class="app-container">
- <div class="search_form">
- <el-form :model="searchForm" :inline="true">
- <el-form-item label="瀹㈡埛鍚嶇О:">
- <el-input v-model="searchForm.customerName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- style="width: 200px;"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="椤圭洰鍚嶇О:">
- <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search"
- style="width: 200px;"
- @change="handleQuery" />
- </el-form-item>
- <el-form-item label="娲惧伐鏃ユ湡:">
- <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
- placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
- </el-form-item>
- <el-form-item label="鐘舵��:">
- <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="handleQuery" style="width: 140px" clearable>
- <el-option label="寰呮帓浜�" :value="1"></el-option>
- <el-option label="宸叉帓浜�" :value="3"></el-option>
- <el-option label="鎺掍骇涓�" :value="2"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="handleQuery">鎼滅储</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="table_list">
- <div style="text-align: right" class="mb10">
- <el-button type="primary" @click="openForm">宸ュ簭鎺掍骇</el-button>
- <el-button type="danger" @click="handleDelete" plain>鍙栨秷鎺掍骇</el-button>
- <el-button @click="handleOut">瀵煎嚭</el-button>
- </div>
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :isSelection="true"
- @selection-change="handleSelectionChange"
- :tableLoading="tableLoading"
- @pagination="pagination"
- :total="page.total"
- ></PIMTable>
- </div>
- <form-dia ref="formDia" @close="handleQuery"></form-dia>
- </div>
+ <div class="app-container">
+ <div class="search_form">
+ <el-form :model="searchForm" :inline="true">
+ <el-form-item label="娲惧伐鏃ユ湡:">
+ <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
+ placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
+ </el-form-item>
+ <el-form-item label="鐘舵��:">
+ <el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="handleQuery" style="width: 140px" clearable>
+ <el-option label="寰呮帓浜�" :value="1"></el-option>
+ <el-option label="宸叉帓浜�" :value="3"></el-option>
+ <el-option label="鎺掍骇涓�" :value="2"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="handleQuery">鎼滅储</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="table_list">
+ <div style="text-align: right" class="mb10">
+ <el-button type="primary" @click="openForm">宸ュ簭鎺掍骇</el-button>
+ <el-button type="danger" @click="handleDelete" plain>鍙栨秷鎺掍骇</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :isSelection="true"
+ @selection-change="handleSelectionChange"
+ :tableLoading="tableLoading"
+ @pagination="pagination"
+ :total="page.total"
+ ></PIMTable>
+ </div>
+ <form-dia ref="formDia" @close="handleQuery"></form-dia>
+ </div>
</template>
<script setup>
@@ -58,104 +47,87 @@
import {listPageProcess, productionDispatchDelete} from "@/api/productionManagement/operationScheduling.js";
const data = reactive({
- searchForm: {
- staffName: "",
- status: 1,
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
- },
+ searchForm: {
+ staffName: "",
+ status: 1,
+ entryDate: [
+ dayjs().format("YYYY-MM-DD"),
+ dayjs().add(1, "day").format("YYYY-MM-DD"),
+ ], // 褰曞叆鏃ユ湡
+ entryDateStart: dayjs().format("YYYY-MM-DD"),
+ entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
+ },
});
const { searchForm } = toRefs(data);
const tableColumn = ref([
- {
- label: "鐘舵��",
- prop: "status",
- dataType: "tag",
- formatData: (params) => {
- if (params == 3) {
- return "宸叉帓浜�";
- } else if (params == 1) {
- return "寰呮帓浜�";
- } else {
- return '鎺掍骇涓�';
- }
- },
- formatType: (params) => {
- if (params == 3) {
- return "success";
- } else if (params == 1) {
- return "primary";
- } else {
- return 'warning';
- }
- },
- },
- {
- label: "娲惧伐鏃ユ湡",
- prop: "schedulingDate",
- width: 120,
- },
- {
- label: "娲惧伐浜�",
- prop: "schedulingUserName",
- },
- {
- label: "鍚堝悓鍙�",
- prop: "salesContractNo",
- width: 200,
- },
- {
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "customerContractNo",
- width: 200,
- },
- {
- label: "瀹㈡埛鍚嶇О",
- prop: "customerName",
- width: 200,
- },
- {
- label: "椤圭洰鍚嶇О",
- prop: "projectName",
- width:300
- },
- {
- label: "浜у搧澶х被",
- prop: "productCategory",
- width: 150,
- },
- {
- label: "瑙勬牸鍨嬪彿",
- prop: "specificationModel",
- width: 150,
- },
- {
- label: "鍗曚綅",
- prop: "unit",
- },
- {
- label: "鎺掍骇鎬绘暟",
- prop: "schedulingNum",
- },
- {
- label: "宸叉帓浜ф暟閲�",
- prop: "successNum",
- width: 100,
- },
- {
- label: "寰呮帓浜ф暟閲�",
- prop: "pendingNum",
- width: 100,
- },
+ {
+ label: "鐘舵��",
+ prop: "status",
+ dataType: "tag",
+ formatData: (params) => {
+ if (params == 3) {
+ return "宸叉帓浜�";
+ } else if (params == 1) {
+ return "寰呮帓浜�";
+ } else {
+ return '鎺掍骇涓�';
+ }
+ },
+ formatType: (params) => {
+ if (params == 3) {
+ return "success";
+ } else if (params == 1) {
+ return "primary";
+ } else {
+ return 'warning';
+ }
+ },
+ },
+ {
+ label: "娲惧伐鏃ユ湡",
+ prop: "schedulingDate",
+ width: 120,
+ },
+ {
+ label: "娲惧伐浜�",
+ prop: "schedulingUserName",
+ },
+ {
+ label: "浜у搧澶х被",
+ prop: "productCategory",
+ width: 150,
+ },
+ {
+ label: "瑙勬牸鍨嬪彿",
+ prop: "specificationModel",
+ width: 150,
+ },
+ {
+ label: "鍗曚綅",
+ prop: "unit",
+ },
+ {
+ label: "鎺掍骇鎬绘暟",
+ prop: "schedulingNum",
+ },
+ {
+ label: "宸叉帓浜ф暟閲�",
+ prop: "successNum",
+ width: 100,
+ },
+ {
+ label: "寰呮帓浜ф暟閲�",
+ prop: "pendingNum",
+ width: 100,
+ },
]);
const tableData = ref([]);
const selectedRows = ref([]);
const tableLoading = ref(false);
const page = reactive({
- current: 1,
- size: 100,
- total: 0,
+ current: 1,
+ size: 100,
+ total: 0,
});
const formDia = ref()
const { proxy } = getCurrentInstance()
@@ -163,109 +135,93 @@
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
- page.current = 1;
- getList();
+ page.current = 1;
+ getList();
};
const changeDaterange = (value) => {
- if (value) {
- searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
- searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
- } else {
- searchForm.value.entryDateStart = undefined;
- searchForm.value.entryDateEnd = undefined;
- }
- handleQuery();
+ if (value) {
+ searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+ } else {
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ }
+ handleQuery();
};
const pagination = (obj) => {
- page.current = obj.page;
- page.size = obj.limit;
- getList();
+ page.current = obj.page;
+ page.size = obj.limit;
+ getList();
};
const getList = () => {
- tableLoading.value = true;
- const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
- listPageProcess(params).then(res => {
- tableLoading.value = false;
- tableData.value = res.data.records.map(item => ({
- ...item,
- pendingNum: (Number(item.schedulingNum) || 0) - (Number(item.successNum) || 0)
- }));
- page.total = res.data.total;
- }).catch(err => {
- tableLoading.value = false;
- })
+ tableLoading.value = true;
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined
+ listPageProcess(params).then(res => {
+ tableLoading.value = false;
+ tableData.value = res.data.records.map(item => ({
+ ...item,
+ pendingNum: (Number(item.schedulingNum) || 0) - (Number(item.successNum) || 0)
+ }));
+ page.total = res.data.total;
+ }).catch(err => {
+ tableLoading.value = false;
+ })
};
// 琛ㄦ牸閫夋嫨鏁版嵁
const handleSelectionChange = (selection) => {
- selectedRows.value = selection;
+ selectedRows.value = selection;
};
// 鎵撳紑寮规
const openForm = (type, row) => {
- if (selectedRows.value.length !== 1) {
- proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
- return;
- }
- if (selectedRows.value[0].pendingNum == 0) {
- proxy.$message.warning("鏃犻渶鍐嶆帓浜�");
- return;
- }
- nextTick(() => {
- formDia.value?.openDialog(type, selectedRows.value[0])
- })
+ if (selectedRows.value.length !== 1) {
+ proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
+ return;
+ }
+ if (selectedRows.value[0].pendingNum == 0) {
+ proxy.$message.warning("鏃犻渶鍐嶆帓浜�");
+ return;
+ }
+ nextTick(() => {
+ formDia.value?.openDialog(type, selectedRows.value[0])
+ })
};
// 鍒犻櫎
const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- // 鏂板锛氬垽鏂槸鍚︽湁宸叉帓浜х殑鏁版嵁
- const hasScheduled = selectedRows.value.some(item => item.status == 3);
- if (hasScheduled) {
- proxy.$modal.msgWarning("宸叉帓浜ф暟鎹笉鑳藉彇娑堟帓浜�");
- return;
- }
- ids = selectedRows.value.map((item) => item.id);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("鏄惁纭鍙栨秷鎺掍骇锛�", "鍒犻櫎鎻愮ず", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- tableLoading.value = true;
- productionDispatchDelete(ids)
- .then((res) => {
- proxy.$modal.msgSuccess("鍙栨秷鎺掍骇鎴愬姛");
- getList();
- })
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ // 鏂板锛氬垽鏂槸鍚︽湁宸叉帓浜х殑鏁版嵁
+ const hasScheduled = selectedRows.value.some(item => item.status == 3);
+ if (hasScheduled) {
+ proxy.$modal.msgWarning("宸叉帓浜ф暟鎹笉鑳藉彇娑堟帓浜�");
+ return;
+ }
+ ids = selectedRows.value.map((item) => item.id);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("鏄惁纭鍙栨秷鎺掍骇锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ tableLoading.value = true;
+ productionDispatchDelete(ids)
+ .then((res) => {
+ proxy.$modal.msgSuccess("鍙栨秷鎺掍骇鎴愬姛");
+ getList();
+ })
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
};
-
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/salesLedger/scheduling/exportTwo", {}, "宸ュ簭鎺掍骇.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-
onMounted(() => {
- getList();
+ getList();
});
</script>
--
Gitblit v1.9.3