From 091d9e9b11fa41531d2827a16c8c85613b7dbf82 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 29 一月 2026 16:19:07 +0800
Subject: [PATCH] 进销存升级 1.指标统计发货率取值修改
---
src/views/productionManagement/productionCosting/index.vue | 251 +++++++++++++++++++++++++++++++++++++------------
1 files changed, 187 insertions(+), 64 deletions(-)
diff --git a/src/views/productionManagement/productionCosting/index.vue b/src/views/productionManagement/productionCosting/index.vue
index ed72bd5..fd3a11b 100644
--- a/src/views/productionManagement/productionCosting/index.vue
+++ b/src/views/productionManagement/productionCosting/index.vue
@@ -1,36 +1,40 @@
<template>
<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" />
- <span class="search_title ml10">鐢熶骇浜猴細</span>
- <el-input
- v-model="searchForm.customerName"
- style="width: 240px"
- placeholder="璇疯緭鍏�"
- @change="handleQuery"
- clearable
- prefix-icon="Search"
- />
- <el-button type="primary" @click="handleQuery" style="margin-left: 10px"
- >鎼滅储</el-button
- >
+ <div class="content-layout">
+ <!-- 宸︿晶鍙拌处 + 椤堕儴绛涢�� -->
+ <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>
+
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="leftTableColumn"
+ :tableData="leftTableData"
+ :tableLoading="tableLoading"
+ @rowClick="handleLeftRowClick"
+ ></PIMTable>
</div>
- <div>
- <el-button @click="handleOut">瀵煎嚭</el-button>
+
+ <!-- 鍙充晶鏄庣粏锛堝師鏈夊唴瀹癸級 -->
+ <div class="right-panel">
+ <div class="header-filters">
+ <el-button @click="handleOut" class="ml10">瀵煎嚭</el-button>
+ </div>
+ <PIMTable
+ rowKey="id"
+ :column="tableColumn"
+ :tableData="tableData"
+ :page="page"
+ :tableLoading="tableLoading"
+ style="margin-right: 20px;"
+ @pagination="pagination"
+ ></PIMTable>
</div>
- </div>
- <div class="table_list">
- <PIMTable
- rowKey="id"
- :column="tableColumn"
- :tableData="tableData"
- :page="page"
- :tableLoading="tableLoading"
- @pagination="pagination"
- ></PIMTable>
</div>
</div>
</template>
@@ -42,75 +46,104 @@
} from "@/api/basicData/customerFile.js";
import { ElMessageBox } from "element-plus";
import dayjs from "dayjs";
+import {productionAccountingListPage} from "@/api/productionManagement/productionCosting.js";
const { proxy } = getCurrentInstance();
const tableColumn = ref([
{
label: "鐢熶骇鏃ユ湡",
- prop: "customerName",
+ prop: "schedulingDate",
width: 120,
},
{
label: "鐢熶骇浜�",
- prop: "customerName",
- width: 120,
+ prop: "schedulingUserName",
+ width: 90,
},
{
label: "鍚堝悓鍙�",
- prop: "taxpayerIdentificationNumber",
+ prop: "salesContractNo",
width: 220,
},
- {
- label: "瀹㈡埛鍚堝悓鍙�",
- prop: "addressPhone",
- width: 250,
- },
+ // {
+ // label: "瀹㈡埛鍚堝悓鍙�",
+ // prop: "customerContractNo",
+ // width: 250,
+ // },
{
label: "瀹㈡埛鍚嶇О",
- prop: "contactPerson",
+ prop: "customerName",
+ width: 250,
},
- {
- label: "椤圭洰鍚嶇О",
- prop: "contactPhone",
- width:150
- },
+ // {
+ // label: "椤圭洰鍚嶇О",
+ // prop: "projectName",
+ // width:300
+ // },
{
label: "浜у搧澶х被",
- prop: "basicBankAccount",
- width: 220,
+ prop: "productCategory",
+ width: 160,
},
{
label: "瑙勬牸鍨嬪彿",
- prop: "bankAccount",
- width: 220,
+ prop: "specificationModel",
+ width: 160,
},
{
label: "鍗曚綅",
- prop: "bankCode",
- width:220
+ prop: "unit",
},
{
label: "宸ュ簭",
- prop: "maintainer",
+ prop: "process",
},
{
label: "鐢熶骇鏁伴噺",
- prop: "maintenanceTime",
+ prop: "finishedNum",
width: 100,
},
{
label: "宸ユ椂瀹氶",
- prop: "maintenanceTime",
+ prop: "workHours",
width: 100,
},
{
label: "宸ヨ祫",
- prop: "maintenanceTime",
+ prop: "wages",
width: 100,
},
]);
+
+// 宸︿晶姹囨�诲彴璐﹀垪锛堢敓浜т汉銆佷骇閲忋�佸伐璧勩�佸悎鏍肩巼锛�
+const leftTableColumn = ref([
+ {
+ label: "鐢熶骇浜�",
+ prop: "schedulingUserName",
+ width: 120,
+ },
+ {
+ label: "浜ч噺",
+ prop: "finishedNum",
+ width: 100,
+ },
+ {
+ label: "宸ヨ祫",
+ prop: "wages",
+ width: 100,
+ },
+ {
+ label: "鍚堟牸鐜�",
+ prop: "qualifiedRate",
+ width: 100,
+ },
+]);
+
const tableData = ref([]);
const tableLoading = ref(false);
+const leftTableData = ref([]);
+// 鏃� / 鏈� 鍒囨崲锛堥粯璁ゆ寜鏃ワ級
+const dateType = ref("day");
const page = reactive({
current: 1,
size: 100,
@@ -119,7 +152,8 @@
const data = reactive({
searchForm: {
- customerName: "",
+ schedulingUserName: "",
+ salesContractNo: "",
entryDate: [
dayjs().format("YYYY-MM-DD"),
dayjs().add(1, "day").format("YYYY-MM-DD"),
@@ -143,21 +177,61 @@
};
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 = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
} else {
- searchForm.entryDateStart = undefined;
- searchForm.entryDateEnd = undefined;
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
}
handleQuery();
};
const getList = () => {
tableLoading.value = true;
- listCustomer({ ...searchForm.value, ...page }).then((res) => {
+ const params = { ...searchForm.value, ...page };
+ params.dateType = dateType.value;
+ params.entryDate = undefined
+ productionAccountingListPage(params).then((res) => {
tableLoading.value = false;
- tableData.value = res.records;
- page.total = res.total;
+ const records = res.data.records || [];
+ tableData.value = records;
+ page.total = res.data.total || 0;
+ buildLeftTableData(records);
});
+};
+
+// 鏋勫缓宸︿晶姹囨�诲彴璐︼紙鎸夌敓浜т汉姹囨�讳骇閲忋�佸伐璧勭瓑锛�
+const buildLeftTableData = (records) => {
+ const map = {};
+ records.forEach((item) => {
+ const key = item.schedulingUserName || "鏈煡";
+ if (!map[key]) {
+ map[key] = {
+ id: key,
+ schedulingUserName: key,
+ finishedNum: 0,
+ wages: 0,
+ qualifiedRate: item.qualifiedRate ?? null,
+ };
+ }
+ map[key].finishedNum += Number(item.finishedNum || 0);
+ map[key].wages += Number(item.wages || 0);
+ if (item.qualifiedRate != null) {
+ map[key].qualifiedRate = item.qualifiedRate;
+ }
+ });
+ leftTableData.value = Object.values(map);
+};
+
+// 宸︿晶鏃�/鏈堝垏鎹�
+const handleDateTypeChange = () => {
+ // 杩欓噷鍙綔涓虹瓫閫夋潯浠剁殑涓�閮ㄥ垎锛岀洿鎺ラ噸鏂版煡璇㈠垪琛�
+ handleQuery();
+};
+
+// 鐐瑰嚮宸︿晶琛岋紝鍒峰彸渚ф槑缁嗭紙鎸夌敓浜т汉杩囨护锛�
+const handleLeftRowClick = (row) => {
+ searchForm.value.schedulingUserName = row.schedulingUserName || "";
+ handleQuery();
};
// 瀵煎嚭
@@ -168,7 +242,7 @@
type: "warning",
})
.then(() => {
- proxy.download("/basic/customer/export", {}, "鐢熶骇鏍哥畻.xlsx");
+ proxy.download("/salesLedger/productionAccounting/export", {}, "鐢熶骇鏍哥畻.xlsx");
})
.catch(() => {
proxy.$modal.msg("宸插彇娑�");
@@ -180,4 +254,53 @@
});
</script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.content-layout {
+ display: flex;
+ gap: 16px;
+}
+
+.left-panel {
+ flex: 0 0 50%;
+ max-width: 50%;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.right-panel {
+ flex: 0 0 50%;
+ max-width: 49%;
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.left-header {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ margin-bottom: 8px;
+}
+
+.left-title {
+ font-size: 16px;
+ color: #ffffff;
+}
+
+.header-filters {
+ display: flex;
+ align-items: center;
+ flex: 1;
+ justify-content: flex-end;
+ gap: 8px;
+}
+
+.search_title {
+ color: #ffffff;
+}
+
+.ml10 {
+ margin-left: 10px;
+}
+</style>
--
Gitblit v1.9.3