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/productionDispatching/index.vue |  286 +++++++++++++++++++++++---------------------------------
 1 files changed, 119 insertions(+), 167 deletions(-)

diff --git a/src/views/productionManagement/productionDispatching/index.vue b/src/views/productionManagement/productionDispatching/index.vue
index 527880f..840e17b 100644
--- a/src/views/productionManagement/productionDispatching/index.vue
+++ b/src/views/productionManagement/productionDispatching/index.vue
@@ -1,50 +1,31 @@
 <template>
-	<div class="app-container">
-		<div class="search_form">
-			<div>
-				<span class="search_title">瀹㈡埛鍚嶇О锛�</span>
-				<el-input
-					v-model="searchForm.customerName"
-					style="width: 240px"
-					placeholder="璇疯緭鍏�"
-					@change="handleQuery"
-					clearable
-					prefix-icon="Search"
-				/>
-				<span class="search_title ml10">椤圭洰鍚嶇О锛�</span>
-				<el-input
-					v-model="searchForm.projectName"
-					style="width: 240px"
-					placeholder="璇疯緭鍏�"
-					@change="handleQuery"
-					clearable
-					prefix-icon="Search"
-				/>
-				<span class="search_title ml10">褰曞叆鏃ユ湡锛�</span>
-				<el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
-												placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
-				<el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
-			</div>
-			<div>
-				<el-button type="primary" @click="openForm('add')">鐢熶骇娲惧伐</el-button>
-				<el-button @click="handleOut">瀵煎嚭</el-button>
-			</div>
-		</div>
-		<div class="table_list">
-			<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">
+      <div>
+        <span class="search_title">褰曞叆鏃ユ湡锛�</span>
+        <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
+                        placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
+        <el-button type="primary" @click="handleQuery" style="margin-left: 10px">鎼滅储</el-button>
+      </div>
+      <div>
+        <el-button type="primary" @click="openForm('add')">鐢熶骇娲惧伐</el-button>
+      </div>
+    </div>
+    <div class="table_list">
+      <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>
@@ -52,81 +33,61 @@
 import FormDia from "@/views/productionManagement/productionDispatching/components/formDia.vue";
 import dayjs from "dayjs";
 import {schedulingListPage} from "@/api/productionManagement/productionOrder.js";
-import { ElMessageBox } from "element-plus";
 
 const data = reactive({
-	searchForm: {
-		customerName: "",
-		projectName: "",
-		entryDate: null, // 褰曞叆鏃ユ湡
-		entryDateStart: undefined,
-		entryDateEnd: undefined,
-	},
+  searchForm: {
+    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: "salesContractNo",
-		width: 220,
-	},
-	{
-		label: "瀹㈡埛鍚堝悓鍙�",
-		prop: "customerContractNo",
-		width: 250,
-	},
-	{
-		label: "瀹㈡埛鍚嶇О",
-		prop: "customerName",
-		width: 250,
-	},
-	{
-		label: "椤圭洰鍚嶇О",
-		prop: "projectName",
-		width:300
-	},
-	{
-		label: "浜у搧澶х被",
-		prop: "productCategory",
-		width: 160,
-	},
-	{
-		label: "瑙勬牸鍨嬪彿",
-		prop: "specificationModel",
-		width: 220,
-	},
-	{
-		label: "鍗曚綅",
-		prop: "unit",
-		width:90
-	},
-	{
-		label: "褰曞叆鏃ユ湡",
-		prop: "entryDate",
-		width: 120,
-	},
-	{
-		label: "鏁伴噺",
-		prop: "quantity",
-	},
-	{
-		label: "鎺掍骇鏁伴噺",
-		prop: "schedulingNum",
-		width: 100,
-	},
-	{
-		label: "寰呮帓鏁伴噺",
-		prop: "pendingQuantity",
-		width: 100,
-	},
+  {
+    label: "褰曞叆鏃ユ湡",
+    prop: "registerDate",
+    width: 120,
+  },
+  {
+    label: "浜у搧澶х被",
+    prop: "productCategory",
+    width: 160,
+  },
+  {
+    label: "瑙勬牸鍨嬪彿",
+    prop: "specificationModel",
+    width: 220,
+  },
+  {
+    label: "鍗曚綅",
+    prop: "unit",
+    width:90
+  },
+  {
+    label: "鏁伴噺",
+    prop: "quantity",
+  },
+  {
+    label: "鎺掍骇鏁伴噺",
+    prop: "schedulingNum",
+    width: 100,
+  },
+  {
+    label: "寰呮帓鏁伴噺",
+    prop: "pendingQuantity",
+    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()
@@ -134,78 +95,69 @@
 // 鏌ヨ鍒楄〃
 /** 鎼滅储鎸夐挳鎿嶄綔 */
 const handleQuery = () => {
-	page.current = 1;
-	getList();
+  page.current = 1;
+  getList();
 };
 const changeDaterange = (value) => {
-	if (value) {
-		searchForm.value.entryDateStart = value[0];
-		searchForm.value.entryDateEnd = value[1];
-	} else {
-		searchForm.value.entryDateStart = undefined;
-		searchForm.value.entryDateEnd = undefined;
-	}
-	handleQuery();
+  if (value) {
+    searchForm.value.entryDateStart = value[0];
+    searchForm.value.entryDateEnd = value[1];
+  } 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;
-	// 鏋勯�犱竴涓柊鐨勫璞★紝涓嶅寘鍚玡ntryDate瀛楁
-	const params = { ...searchForm.value, ...page };
-	params.entryDate = undefined
-	schedulingListPage(params).then((res) => {
-		tableLoading.value = false;
-		// 澶勭悊姣忔潯鏁版嵁锛屽鍔爌endingQuantity瀛楁
-		tableData.value = res.data.records.map(item => ({
-			...item,
-			pendingQuantity: (Number(item.quantity) || 0) - (Number(item.schedulingNum) || 0)
-		}));
-		page.total = res.data.total;
-	}).catch(() => {
-		tableLoading.value = false;
-	})
+  tableLoading.value = true;
+  // 鏋勯�犱竴涓柊鐨勫璞★紝涓嶅寘鍚玡ntryDate瀛楁
+  const params = { ...searchForm.value, ...page };
+  params.entryDate = undefined
+  schedulingListPage(params).then((res) => {
+    tableLoading.value = false;
+    // 澶勭悊姣忔潯鏁版嵁锛屽鍔爌endingQuantity瀛楁
+    tableData.value = res.data.records.map(item => ({
+      ...item,
+      pendingQuantity: (Number(item.quantity) || 0) - (Number(item.schedulingNum) || 0)
+    }));
+    page.total = res.data.total;
+  }).catch(() => {
+    tableLoading.value = false;
+  })
 };
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = (selection) => {
-	selectedRows.value = selection;
+  selectedRows.value = selection;
 };
 
 // 鎵撳紑寮规
 const openForm = (type) => {
-	if (selectedRows.value.length !== 1) {
-		proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
-		return;
-	}
-	if (selectedRows.value[0].pendingQuantity == 0) {
-		proxy.$message.warning("鏃犻渶鍐嶆淳宸�");
-		return;
-	}
-	nextTick(() => {
-		formDia.value?.openDialog(type, selectedRows.value[0])
-	})
-};
-
-// 瀵煎嚭
-const handleOut = () => {
-	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			proxy.download("/salesLedger/scheduling/exportOne", {}, "鐢熶骇娲惧伐.xlsx");
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
+  if (selectedRows.value.length !== 1) {
+    proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
+    return;
+  }
+  if (selectedRows.value[0].pendingQuantity == 0) {
+    proxy.$message.warning("鏃犻渶鍐嶆淳宸�");
+    return;
+  }
+  nextTick(() => {
+    formDia.value?.openDialog(type, selectedRows.value[0])
+  })
 };
 
 onMounted(() => {
-	getList();
+  searchForm.value.entryDate = [
+    dayjs().format("YYYY-MM-DD"),
+    dayjs().add(1, "day").format("YYYY-MM-DD"),
+  ]
+  searchForm.value.entryDateStart = dayjs().format("YYYY-MM-DD")
+  searchForm.value.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD")
+  getList();
 });
 </script>
 

--
Gitblit v1.9.3