From b46d3fcc37e5eb76e77e5b7f1c0e7383af237d30 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 30 一月 2026 14:09:01 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New

---
 src/views/productionManagement/productionCosting/index.vue |  190 +++++++++++++++++++++++++++++++----------------
 1 files changed, 124 insertions(+), 66 deletions(-)

diff --git a/src/views/productionManagement/productionCosting/index.vue b/src/views/productionManagement/productionCosting/index.vue
index fd3a11b..b4faa17 100644
--- a/src/views/productionManagement/productionCosting/index.vue
+++ b/src/views/productionManagement/productionCosting/index.vue
@@ -4,20 +4,39 @@
 			<!-- 宸︿晶鍙拌处 + 椤堕儴绛涢�� -->
 			<div class="left-panel">
 				<div class="left-header">
-					<!-- <div class="left-title">鐢熶骇鍙拌处</div> -->
-					<el-radio-group v-model="dateType" size="small" @change="handleDateTypeChange">
-						<el-radio-button label="day">鏃�</el-radio-button>
-						<el-radio-button label="month">鏈�</el-radio-button>
-					</el-radio-group>
-					
+          <el-form :model="searchForm" inline>
+            <el-form-item prop="dateType">
+              <el-radio-group v-model="searchForm.dateType" size="small" @change="handleDateTypeChange">
+                <el-radio-button label="day">鏃�</el-radio-button>
+                <el-radio-button label="month">鏈�</el-radio-button>
+              </el-radio-group>
+            </el-form-item>
+
+            <el-form-item label="鏃ユ湡锛�" prop="dateRange">
+              <el-date-picker
+                  v-model="searchForm.dateRange"
+                  :type="searchForm.dateType === 'day' ? 'date' : 'daterange'"
+                  range-separator="鑷�"
+                  start-placeholder="寮�濮嬫棩鏈�"
+                  end-placeholder="缁撴潫鏃ユ湡"
+                  format="YYYY-MM-DD"
+                  value-format="YYYY-MM-DD"
+                  style="width: 300px"
+                  @change="handleDateRangeChange"
+              />
+            </el-form-item>
+          </el-form>
 				</div>
 				<PIMTable
 					rowKey="id"
 					:column="leftTableColumn"
 					:tableData="leftTableData"
 					:tableLoading="tableLoading"
-					@rowClick="handleLeftRowClick"
-				></PIMTable>
+          :page="page"
+          :height="200"
+          @row-click="handleLeftRowClick"
+          @pagination="pagination"
+        ></PIMTable>
 			</div>
 
 			<!-- 鍙充晶鏄庣粏锛堝師鏈夊唴瀹癸級 -->
@@ -29,10 +48,10 @@
 						rowKey="id"
 						:column="tableColumn"
 						:tableData="tableData"
-						:page="page"
-						:tableLoading="tableLoading"
+						:page="page1"
+						:tableLoading="tableLoading1"
 						style="margin-right: 20px;"
-						@pagination="pagination"
+						@pagination="pagination1"
 					></PIMTable>
 			</div>
 		</div>
@@ -41,77 +60,66 @@
 
 <script setup>
 import {onMounted, ref} from "vue";
-import {
-	listCustomer,
-} from "@/api/basicData/customerFile.js";
 import { ElMessageBox } from "element-plus";
 import dayjs from "dayjs";
-import {productionAccountingListPage} from "@/api/productionManagement/productionCosting.js";
+import {salesLedgerProductionAccountingListProductionDetails, salesLedgerProductionAccountingList} from "@/api/productionManagement/productionCosting.js";
 const { proxy } = getCurrentInstance();
 
 const tableColumn = ref([
 	{
 		label: "鐢熶骇鏃ユ湡",
-		prop: "schedulingDate",
-		width: 120,
+		prop: "scheduleDate",
+    minWidth: 100,
 	},
 	{
 		label: "鐢熶骇浜�",
 		prop: "schedulingUserName",
-		width: 90,
+    minWidth: 100,
 	},
 	{
 		label: "鍚堝悓鍙�",
 		prop: "salesContractNo",
-		width: 220,
+    minWidth: 100,
 	},
-	// {
-	// 	label: "瀹㈡埛鍚堝悓鍙�",
-	// 	prop: "customerContractNo",
-	// 	width: 250,
-	// },
 	{
 		label: "瀹㈡埛鍚嶇О",
 		prop: "customerName",
-		width: 250,
+    minWidth: 100,
 	},
-	// {
-	// 	label: "椤圭洰鍚嶇О",
-	// 	prop: "projectName",
-	// 	width:300
-	// },
 	{
 		label: "浜у搧澶х被",
-		prop: "productCategory",
-		width: 160,
+		prop: "productName",
+    minWidth: 100,
 	},
 	{
 		label: "瑙勬牸鍨嬪彿",
-		prop: "specificationModel",
-		width: 160,
+		prop: "productModelName",
+    minWidth: 100,
 	},
 	{
 		label: "鍗曚綅",
 		prop: "unit",
+    minWidth: 100,
 	},
 	{
 		label: "宸ュ簭",
 		prop: "process",
+    minWidth: 100,
 	},
 	{
 		label: "鐢熶骇鏁伴噺",
-		prop: "finishedNum",
-		width: 100,
+		prop: "quantity",
+    minWidth: 100,
 	},
 	{
 		label: "宸ユ椂瀹氶",
 		prop: "workHours",
-		width: 100,
+    minWidth: 100,
 	},
 	{
 		label: "宸ヨ祫",
 		prop: "wages",
-		width: 100,
+    minWidth: 100,
 	},
 ]);
 
@@ -120,40 +128,51 @@
 	{
 		label: "鐢熶骇浜�",
 		prop: "schedulingUserName",
-		width: 120,
+    minWidth: 100,
 	},
 	{
 		label: "浜ч噺",
-		prop: "finishedNum",
-		width: 100,
-	},
+		prop: "outputNum",
+    minWidth: 100,
+
+  },
 	{
 		label: "宸ヨ祫",
 		prop: "wages",
-		width: 100,
+    minWidth: 100,
+
 	},
 	{
 		label: "鍚堟牸鐜�",
-		prop: "qualifiedRate",
-		width: 100,
+		prop: "outputRate",
+    minWidth: 100,
+
 	},
 ]);
 
 const tableData = ref([]);
 const tableLoading = ref(false);
+const tableLoading1 = ref(false);
 const leftTableData = ref([]);
 // 鏃� / 鏈� 鍒囨崲锛堥粯璁ゆ寜鏃ワ級
-const dateType = ref("day");
 const page = reactive({
 	current: 1,
 	size: 100,
 	total: 0,
 });
 
+const page1 = reactive({
+  current: 1,
+  size: 100,
+  total: 0,
+});
+
 const data = reactive({
 	searchForm: {
 		schedulingUserName: "",
 		salesContractNo: "",
+    dateType: "day",
+    dateRange: undefined,
 		entryDate: [
 			dayjs().format("YYYY-MM-DD"),
 			dayjs().add(1, "day").format("YYYY-MM-DD"),
@@ -164,39 +183,60 @@
 });
 const { searchForm } = toRefs(data);
 
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
-	page.current = 1;
-	getList();
-};
 const pagination = (obj) => {
 	page.current = obj.page;
 	page.size = obj.limit;
 	getList();
 };
-const changeDaterange = (value) => {
+
+const pagination1 = (obj) => {
+  page1.current = obj.page;
+  page1.size = obj.limit;
+	getList1();
+};
+
+const handleDateRangeChange = (value) => {
 	if (value) {
-		searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
-		searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+    if (searchForm.value.dateType === "day") {
+      searchForm.value.entryDate = value;
+    } else {
+      searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
+      searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+    }
+
 	} else {
+		searchForm.value.entryDate = undefined;
 		searchForm.value.entryDateStart = undefined;
 		searchForm.value.entryDateEnd = undefined;
 	}
-	handleQuery();
+  reloadData()
 };
+
 const getList = () => {
 	tableLoading.value = true;
 	const params = { ...searchForm.value, ...page };
-	params.dateType = dateType.value;
-	params.entryDate = undefined
-	productionAccountingListPage(params).then((res) => {
-		tableLoading.value = false;
+
+  salesLedgerProductionAccountingList(params).then((res) => {
 		const records = res.data.records || [];
-		tableData.value = records;
+    leftTableData.value = records;
 		page.total = res.data.total || 0;
-		buildLeftTableData(records);
-	});
+	}).finally(() => {
+    tableLoading.value = false;
+  })
+
+
+
+};
+
+const getList1 = () => {
+  tableLoading1.value = true;
+  const params = { ...page1, ...searchForm.value };
+  salesLedgerProductionAccountingListProductionDetails(params).then((res) => {
+    tableData.value = res.data.records || [];;
+    page1.total = res.data.total || 0;
+  }).finally(() => {
+    tableLoading1.value = false;
+  })
 };
 
 // 鏋勫缓宸︿晶姹囨�诲彴璐︼紙鎸夌敓浜т汉姹囨�讳骇閲忋�佸伐璧勭瓑锛�
@@ -225,14 +265,33 @@
 // 宸︿晶鏃�/鏈堝垏鎹�
 const handleDateTypeChange = () => {
 	// 杩欓噷鍙綔涓虹瓫閫夋潯浠剁殑涓�閮ㄥ垎锛岀洿鎺ラ噸鏂版煡璇㈠垪琛�
-	handleQuery();
+  searchForm.value.dateRange = undefined;
+  searchForm.value.entryDate = undefined;
+  searchForm.value.entryDateStart = undefined;
+  searchForm.value.entryDateEnd = undefined;
+  reloadData()
 };
+
+const reloadData = () => {
+  page.current = 1;
+  page1.current = 1;
+  getList();
+  tableData.value = []
+}
 
 // 鐐瑰嚮宸︿晶琛岋紝鍒峰彸渚ф槑缁嗭紙鎸夌敓浜т汉杩囨护锛�
 const handleLeftRowClick = (row) => {
 	searchForm.value.schedulingUserName = row.schedulingUserName || "";
 	handleQuery();
 };
+
+// 鏌ヨ鍒楄〃
+/** 鎼滅储鎸夐挳鎿嶄綔 */
+const handleQuery = () => {
+  page1.current = 1;
+  getList1();
+};
+
 
 // 瀵煎嚭
 const handleOut = () => {
@@ -257,12 +316,12 @@
 <style scoped lang="scss">
 .content-layout {
   display: flex;
+  flex-direction: column;
   gap: 16px;
 }
 
 .left-panel {
   flex: 0 0 50%;
-  max-width: 50%;
   display: flex;
   flex-direction: column;
   gap: 10px;
@@ -270,7 +329,6 @@
 
 .right-panel {
   flex: 0 0 50%;
-  max-width: 49%;
   display: flex;
   flex-direction: column;
   gap: 10px;

--
Gitblit v1.9.3