From f515939aa42d86acd2bd7d8374213f4c9b0a618c Mon Sep 17 00:00:00 2001 From: jiangxucong Date: Thu, 25 Dec 2025 10:11:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86-=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E8=AE=A1=E5=88=92=E7=AE=A1=E7=90=86-=E5=8F=91?= =?UTF-8?q?=E6=B2=B9=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../HairOilProductionPlan.js | 281 ++++++++++++++++++ .../HairOilProductionPlan.less | 233 +++++++++++++++ 2 files changed, 514 insertions(+) create mode 100644 src/pages/business_planmanage/components/second_oil_components/HairOilProductionPlan.js create mode 100644 src/pages/business_planmanage/components/second_oil_components/HairOilProductionPlan.less diff --git a/src/pages/business_planmanage/components/second_oil_components/HairOilProductionPlan.js b/src/pages/business_planmanage/components/second_oil_components/HairOilProductionPlan.js new file mode 100644 index 0000000..e0028c4 --- /dev/null +++ b/src/pages/business_planmanage/components/second_oil_components/HairOilProductionPlan.js @@ -0,0 +1,281 @@ +import React, { useMemo, useState } from 'react'; +import { Select, Space, Button, Switch, message, Input, Modal, InputNumber } from 'antd'; +import { PlusOutlined, SearchOutlined, ReloadOutlined, ExportOutlined } from '@ant-design/icons'; +import StandardTable from '@/components/StandardTable'; +import styles from './HairOilProductionPlan.less'; + +const HairOilProductionPlan = () => { + const [searchKeyword, setSearchKeyword] = useState(''); + // 列表筛选与数据(演示数据,可替换为接口) + const [filters, setFilters] = useState({ + listCategory: undefined, + listStatus: undefined, + }); + + const columns = useMemo(() => { + return [ + { title: '计划编号', dataIndex: 'planNo', key: 'planNo', width: 100 }, + { title: '油品名称', dataIndex: 'planName', key: 'planName', width: 220 }, + { title: '计划类型', dataIndex: 'planType', key: 'planType', width: 100 }, + { title: '计划时间', dataIndex: 'planTime', key: 'planTime', width: 160 }, + { title: '数量(吨)', dataIndex: 'qty', key: 'qty', width: 100 }, + { title: '来源/目的地', dataIndex: 'sourceTarget', key: 'sourceTarget', width: 230 }, + { title: '状态', dataIndex: 'status', key: 'status', width: 100 }, + { title: '进度', dataIndex: 'progress', key: 'progress', width: 100 }, + { title: '创建人', dataIndex: 'creator', key: 'creator', width: 100 }, + { + title: '操作', + key: 'action', + fixed: 'right', + width: 140, + render: (_, record) => ( + + + + ), + }, + ]; + }, []); + + const [tableData, setTableData] = useState([ + { + key: 'RV20230710001', + planNo: 'RV20230710001', + planName: '92#汽油', + planType: '管道收油', + planTime: '2024-05-01 14:00', + qty: 600, + sourceTarget: '来源: 炼油厂 目的地: 1号储罐', + status: '已审批', + progress: '45%', + creator: '郑双', + actionText: '更新进度', + }, + { + key: 'RV20230710002', + planNo: 'RV20230710002', + planName: '95#汽油', + planType: '管道收油', + planTime: '2024-05-01 14:00', + qty: 500, + sourceTarget: '来源: 炼油厂 目的地: 2号储罐', + status: '已驳回', + progress: '40%', + creator: '钱亮丽', + actionText: '跟踪进度', + }, + { + key: 'RV20230710003', + planNo: 'RV20230710003', + planName: '92#汽油', + planType: '铁路收油', + planTime: '2024-05-01 15:00', + qty: 300, + sourceTarget: '来源: 炼油厂 目的地: 3号储罐', + status: '已审批', + progress: '0%', + creator: '郑璞', + actionText: '开始执行', + }, + { + key: 'RV20230710004', + planNo: 'RV20230710004', + planName: '95#汽油', + planType: '公路收油', + planTime: '2024-05-01 12:00', + qty: 200, + sourceTarget: '来源: 炼油厂 目的地: 4号储罐', + status: '已审批', + progress: '50%', + creator: '孙莲艳', + actionText: '开始执行', + }, + { + key: 'RV20230710005', + planNo: 'RV20230710005', + planName: '92#汽油', + planType: '管道收油', + planTime: '2024-05-01 11:00', + qty: 100, + sourceTarget: '来源: 炼油厂 目的地: 5号储罐', + status: '已驳回', + progress: '90%', + creator: '李莉娜', + actionText: '更新进度', + }, + { + key: 'RV20230710006', + planNo: 'RV20230710006', + planName: '95#汽油', + planType: '管道收油', + planTime: '2024-05-01 10:00', + qty: 150, + sourceTarget: '来源: 炼油厂 目的地: 6号储罐', + status: '已驳回', + progress: '30%', + creator: '李钰', + actionText: '查看详情', + }, + ]); + + const [progressState, setProgressState] = useState({ open: false, value: 0, recordKey: null }); + + const handlePrimaryAction = (record) => { + const action = record.actionText; + if (action === '更新进度') { + const current = parseInt(String(record.progress).replace('%', ''), 10) || 0; + setProgressState({ open: true, value: current, recordKey: record.key }); + } else if (action === '跟踪进度') { + message.info(`当前进度:${record.progress}`); + } else if (action === '开始执行') { + Modal.confirm({ + title: '确认开始执行?', + onOk: () => { + setTableData((prev) => prev.map((item) => + item.key === record.key + ? { ...item, status: '执行中', progress: item.progress || '0%', actionText: '更新进度' } + : item + )); + message.success('已开始执行'); + }, + }); + } else if (action === '查看详情') { + Modal.info({ + title: '计划详情', + content: ( +
+
计划编号:{record.planNo}
+
计划名称:{record.planName}
+
计划类型:{record.planType}
+
计划时间:{record.planTime}
+
数量(吨):{record.qty}
+
来源/目的地:{record.sourceTarget}
+
状态:{record.status}
+
进度:{record.progress}
+
创建人:{record.creator}
+
+ ), + }); + } + }; + + + return ( +
+
+
+ + 查询条件 +
+
+
+ setSearchKeyword(e.target.value)} + onSearch={(val) => setSearchKeyword(val)} + style={{ minWidth: 150 }} + /> +
+
+ 状态: +