From 14f694d913698b5e04b09f6e6df789cbd1102937 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 14:17:42 +0800
Subject: [PATCH] 生产管控-添加导出功能

---
 src/views/productionManagement/operationScheduling/index.vue |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/views/productionManagement/operationScheduling/index.vue b/src/views/productionManagement/operationScheduling/index.vue
index 3b35180..082b782 100644
--- a/src/views/productionManagement/operationScheduling/index.vue
+++ b/src/views/productionManagement/operationScheduling/index.vue
@@ -4,10 +4,12 @@
 			<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="娲惧伐鏃ユ湡:">
@@ -15,9 +17,9 @@
 													placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
 				</el-form-item>
 				<el-form-item label="鐘舵��:">
-					<el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" style="width: 140px" clearable>
+					<el-select v-model="searchForm.status" placeholder="璇烽�夋嫨鐘舵��" @change="handleQuery" style="width: 140px" clearable>
 						<el-option label="寰呮帓浜�" :value="1"></el-option>
-						<el-option label="宸叉帓浜�" :value="0"></el-option>
+						<el-option label="宸叉帓浜�" :value="3"></el-option>
 						<el-option label="鎺掍骇涓�" :value="2"></el-option>
 					</el-select>
 				</el-form-item>
@@ -30,6 +32,7 @@
 			<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"
@@ -58,12 +61,9 @@
 	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"),
+		entryDate: null, // 褰曞叆鏃ユ湡
+		entryDateStart: undefined,
+		entryDateEnd: undefined,
 	},
 });
 const { searchForm } = toRefs(data);
@@ -73,7 +73,7 @@
 		prop: "status",
 		dataType: "tag",
 		formatData: (params) => {
-			if (params == 0) {
+			if (params == 3) {
 				return "宸叉帓浜�";
 			} else if (params == 1) {
 				return "寰呮帓浜�";
@@ -82,7 +82,7 @@
 			}
 		},
 		formatType: (params) => {
-			if (params == 0) {
+			if (params == 3) {
 				return "success";
 			} else if (params == 1) {
 				return "primary";
@@ -220,6 +220,12 @@
 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("璇烽�夋嫨鏁版嵁");
@@ -242,6 +248,22 @@
 			proxy.$modal.msg("宸插彇娑�");
 		});
 };
+
+// 瀵煎嚭
+const handleOut = () => {
+	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			proxy.download("/salesLedger/scheduling/exportTwo", {}, "宸ュ簭鎺掍骇.xlsx");
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑�");
+		});
+};
+
 onMounted(() => {
 	getList();
 });

--
Gitblit v1.9.3