yxy / y-word
word导出
1.0.0
2025-03-12 06:53 UTC
Requires
- php: ^8.2
- phpoffice/phpword: 1.3
This package is not auto-updated.
Last update: 2025-04-10 05:24:29 UTC
README
示例
$year = '2023';
$PartyA = '宝山钢铁股份有限公司';
$PartyB = '四川美姑河水电开发有限公司';
$PartyB_address = "四川";
$PartyB_electric_field = "柳洪水电站";
$dosage = "14400";
$data = [
['type' => 'title', 'data' => '标题标题'],
["type" => 'text', 'data' => [
["content" => "为落实国家能源政策、促进节能减排,经协商,双方就{$year}年_{$PartyB}替代{$PartyA}自备电厂控煤电量的省间替代交易达成一致意见如下:", "tab" => true],
["content" => "一、甲方(被替代方):{$PartyA}<w:br/>二、乙方(替代方):{$PartyB}<w:br/>", "tab" => false],
["content" => "乙方系 {$PartyB_address}一家具有法人资格的电力生产企业。本协议所指乙方具体电厂或场站为:{$PartyB_electric_field},在北京电力交易平台中的交易单元名称为:{$PartyB_electric_field}。", "tab" => true],
]],
["type" => 'table', 'data' => [
['cellSpan' => true, 'cell' => [["span" => 12, 'content' => "电厂或场站公司名称:{$PartyB}"]]],
['cellSpan' => true, 'cell' => [["span" => 12, 'content' => "交易单元名称:{$PartyB_electric_field}"]]],
['cellSpan' => true, 'cell' => [["span" => 12, 'content' => "月度合计电量:{$dosage}兆瓦时"]]],
['cell' => ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时']],
['cell' => ['20', '120', '220', '320', '420', '520', '620', '720', '820', '920', '1020', '1120']],
['cell' => ['12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时']],
['cell' => ['20', '120', '220', '320', '420', '520', '620', '720', '820', '920', '1020', '1120']],
]],
["type" => 'table', 'data' => [
['cell' => ['发电企业公司名称', '交易单元名称', '执行时段', '交易电量(兆瓦时)']],
['rowSpan' => true, 'cell' => ['托克逊县申源新能源投资有限公司', '申源红岭分散式风电一场', '5月', '2480']],
['rowSpan' => true, 'cell' => ['', '', '6月', '2480']],
['rowSpan' => true, 'cell' => ['', '', '7月', '2980']],
['rowSpan' => true, 'cell' => ['', '', '8月', '2740']],
['rowSpan' => true, 'cell' => ['', '', '9月', '2120']],
['rowSpan' => true, 'cell' => ['', '', '10月', '2650']],
['rowSpan' => true, 'cell' => ['', '', '11月', '2910']],
['rowSpan' => true, 'cell' => ['', '', '12月', '2640']],
]],
[
"type" => 'table',
'data' => [
['cell' => [
['width' => 2200, 'content' => '公司名称'],
['width' => 2200, 'content' => '交易单元'],
['width' => 700, 'content' => '月份'],
['width' => 700, 'content' => '0时'],
['width' => 700, 'content' => '1时'],
['width' => 700, 'content' => '2时'],
['width' => 700, 'content' => '3时'],
['width' => 700, 'content' => '4时'],
['width' => 700, 'content' => '5时'],
['width' => 700, 'content' => '6时'],
['width' => 700, 'content' => '7时'],
['width' => 700, 'content' => '合计']
]],
['rowSpan' => true, 'cell' => ['托克逊县申源新能源投资有限公司', '申源克尔碱分散式风电一场', '5月', '152', '874', '465', '987', '641', '654', '852', '187', '3182']],
['rowSpan' => true, 'cell' => ['', '', '6月', '152', '874', '465', '987', '641', '654', '852', '187', '3182']],
['rowSpan' => true, 'cell' => ['', '', '7月', '152', '874', '465', '987', '641', '654', '852', '187', '3182']],
['rowSpan' => true, 'cell' => ['', '', '8月', '152', '874', '465', '987', '641', '654', '852', '187', '3182']],
['rowSpan' => true, 'cell' => ['', '', '9月', '152', '874', '465', '987', '641', '654', '852', '187', '3182']],
['rowSpan' => true, 'cell' => ['', '', '10月', '152', '874', '465', '987', '641', '654', '852', '187', '3182']],
[
'cellSpan' => true,
'cell' => [
["span" => 2, 'content' => "合计"],
'',
'',
'',
'',
'',
'',
'',
'',
'',
'19092'
],
]
]
]
];
Word::export($data,'测试测试');