From d36530e3550cfa30e9a91d73f202943782545eeb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 16:12:51 +0800
Subject: [PATCH] 生产排产-工序下拉取消,改为手动填入

---
 src/views/productionManagement/productionDispatching/index.vue |  116 +++++++++++++++++++++++++---------------------------------
 1 files changed, 50 insertions(+), 66 deletions(-)

diff --git a/src/views/productionManagement/productionDispatching/index.vue b/src/views/productionManagement/productionDispatching/index.vue
index 70a3de9..527880f 100644
--- a/src/views/productionManagement/productionDispatching/index.vue
+++ b/src/views/productionManagement/productionDispatching/index.vue
@@ -13,7 +13,7 @@
 				/>
 				<span class="search_title ml10">椤圭洰鍚嶇О锛�</span>
 				<el-input
-					v-model="searchForm.customerName"
+					v-model="searchForm.projectName"
 					style="width: 240px"
 					placeholder="璇疯緭鍏�"
 					@change="handleQuery"
@@ -23,12 +23,11 @@
 				<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
-				>
+				<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">
@@ -51,72 +50,73 @@
 <script setup>
 import {onMounted, ref} from "vue";
 import FormDia from "@/views/productionManagement/productionDispatching/components/formDia.vue";
-import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js";
-import {ElMessageBox} from "element-plus";
 import dayjs from "dayjs";
+import {schedulingListPage} from "@/api/productionManagement/productionOrder.js";
+import { ElMessageBox } from "element-plus";
 
 const data = reactive({
 	searchForm: {
-		staffName: "",
-		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"),
+		customerName: "",
+		projectName: "",
+		entryDate: null, // 褰曞叆鏃ユ湡
+		entryDateStart: undefined,
+		entryDateEnd: undefined,
 	},
 });
 const { searchForm } = toRefs(data);
 const tableColumn = ref([
 	{
-		label: "褰曞叆鏃ユ湡",
-		prop: "staffNo",
-	},
-	{
 		label: "鍚堝悓鍙�",
-		prop: "staffName",
+		prop: "salesContractNo",
+		width: 220,
 	},
 	{
 		label: "瀹㈡埛鍚堝悓鍙�",
-		prop: "addressPhone",
+		prop: "customerContractNo",
 		width: 250,
 	},
 	{
 		label: "瀹㈡埛鍚嶇О",
-		prop: "contactPerson",
+		prop: "customerName",
+		width: 250,
 	},
 	{
 		label: "椤圭洰鍚嶇О",
-		prop: "contactPhone",
-		width:150
+		prop: "projectName",
+		width:300
 	},
 	{
 		label: "浜у搧澶х被",
-		prop: "basicBankAccount",
-		width: 220,
+		prop: "productCategory",
+		width: 160,
 	},
 	{
 		label: "瑙勬牸鍨嬪彿",
-		prop: "bankAccount",
+		prop: "specificationModel",
 		width: 220,
 	},
 	{
 		label: "鍗曚綅",
-		prop: "bankCode",
-		width:220
+		prop: "unit",
+		width:90
+	},
+	{
+		label: "褰曞叆鏃ユ湡",
+		prop: "entryDate",
+		width: 120,
 	},
 	{
 		label: "鏁伴噺",
-		prop: "maintainer",
+		prop: "quantity",
 	},
 	{
 		label: "鎺掍骇鏁伴噺",
-		prop: "maintenanceTime",
+		prop: "schedulingNum",
 		width: 100,
 	},
 	{
 		label: "寰呮帓鏁伴噺",
-		prop: "maintenanceTime",
+		prop: "pendingQuantity",
 		width: 100,
 	},
 ]);
@@ -139,11 +139,11 @@
 };
 const changeDaterange = (value) => {
 	if (value) {
-		searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
-		searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+		searchForm.value.entryDateStart = value[0];
+		searchForm.value.entryDateEnd = value[1];
 	} else {
-		searchForm.entryDateStart = undefined;
-		searchForm.entryDateEnd = undefined;
+		searchForm.value.entryDateStart = undefined;
+		searchForm.value.entryDateEnd = undefined;
 	}
 	handleQuery();
 };
@@ -154,11 +154,18 @@
 };
 const getList = () => {
 	tableLoading.value = true;
-	staffJoinListPage({...page, ...searchForm.value}).then(res => {
+	// 鏋勯�犱竴涓柊鐨勫璞★紝涓嶅寘鍚玡ntryDate瀛楁
+	const params = { ...searchForm.value, ...page };
+	params.entryDate = undefined
+	schedulingListPage(params).then((res) => {
 		tableLoading.value = false;
-		tableData.value = res.data.records
+		// 澶勭悊姣忔潯鏁版嵁锛屽鍔爌endingQuantity瀛楁
+		tableData.value = res.data.records.map(item => ({
+			...item,
+			pendingQuantity: (Number(item.quantity) || 0) - (Number(item.schedulingNum) || 0)
+		}));
 		page.total = res.data.total;
-	}).catch(err => {
+	}).catch(() => {
 		tableLoading.value = false;
 	})
 };
@@ -168,44 +175,20 @@
 };
 
 // 鎵撳紑寮规
-const openForm = (type, row) => {
+const openForm = (type) => {
 	if (selectedRows.value.length !== 1) {
 		proxy.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�");
 		return;
 	}
-	if (selectedRows.value[0].unPaymentAmountTotal == 0) {
-		proxy.$message.warning("鏃犻渶鍐嶄粯娆�");
+	if (selectedRows.value[0].pendingQuantity == 0) {
+		proxy.$message.warning("鏃犻渶鍐嶆淳宸�");
 		return;
 	}
 	nextTick(() => {
-		formDia.value?.openDialog(type, row)
+		formDia.value?.openDialog(type, selectedRows.value[0])
 	})
 };
 
-// 鍒犻櫎
-const handleDelete = () => {
-	let ids = [];
-	if (selectedRows.value.length > 0) {
-		ids = selectedRows.value.map((item) => item.id);
-	} else {
-		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
-		return;
-	}
-	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			staffJoinDel(ids).then((res) => {
-				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-				getList();
-			});
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
-};
 // 瀵煎嚭
 const handleOut = () => {
 	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
@@ -214,12 +197,13 @@
 		type: "warning",
 	})
 		.then(() => {
-			proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 1}, "浜哄憳鍏ヨ亴.xlsx");
+			proxy.download("/salesLedger/scheduling/exportOne", {}, "鐢熶骇娲惧伐.xlsx");
 		})
 		.catch(() => {
 			proxy.$modal.msg("宸插彇娑�");
 		});
 };
+
 onMounted(() => {
 	getList();
 });

--
Gitblit v1.9.3