index.tsx
3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// App.js
function Header() {
return (
<div className="flex items-start justify-between mb-6">
<div className="text-sm">
<p className="font-medium">网址: www.canrd.com</p>
</div>
<h1 className="text-3xl font-bold text-center">发票</h1>
<div className="text-sm text-right">
<p className="font-medium">QQ: 2902385824</p>
</div>
</div>
);
}
function InvoiceDetails() {
return (
<div className="grid grid-cols-2 gap-4 mb-6 text-sm">
<div>
<p>单位名称: 某某科技有限公司</p>
<p>联系人: 张三</p>
<p>联系电话: 18583817221</p>
<p>送货地址: 广东省东莞市</p>
</div>
<div className="text-right">
<p>编号: Canrd-DZ-2023-1101-004</p>
<p>开票日期: 2023年11月1日</p>
</div>
</div>
);
}
function ProductsTable() {
return (
<div className="mb-6">
<table className="w-full text-sm border border-gray-300 table-fixed">
<thead>
<tr className="">
<th className="w-1/4 p-2 border border-gray-300 border-solid">
序号
</th>
<th className="w-1/6 p-2 border border-gray-300 border-solid">
订单号
</th>
<th className="w-1/6 p-2 border border-gray-300 border-solid">
货品名称
</th>
<th className="w-1/12 p-2 border border-gray-300 border-solid">
规格
</th>
<th className="w-1/6 p-2 border border-gray-300 border-solid">
单位
</th>
<th className="w-1/6 p-2 border border-gray-300 border-solid">
数量
</th>
<th className="w-1/4 p-2 border border-gray-300 border-solid">
备注
</th>
</tr>
</thead>
<tbody>
<tr>
<td className="p-2 whitespace-normal border border-gray-300 border-solid">
产品名称可能非常长,所以这里会自动换行
</td>
<td className="p-2 border border-gray-300 border-solid">
规格型号
</td>
<td className="p-2 border border-gray-300 border-solid">单位</td>
<td className="p-2 border border-gray-300 border-solid">1</td>
<td className="p-2 border border-gray-300 border-solid">400</td>
<td className="p-2 border border-gray-300 border-solid">400</td>
<td className="p-2 whitespace-normal border border-gray-300 border-solid">
备注信息可能也会很长,需要自动换行来适应内容
</td>
</tr>
{/* 其他行 */}
</tbody>
</table>
</div>
);
}
function Footer() {
return (
<div className="text-sm">
<p>备注: 一些备注文本...</p>
<div className="flex items-center justify-between mt-4">
<div>
<p>销售人员: 签字</p>
</div>
<div>
<p>业务员: 签字</p>
</div>
<div>
<p>开票人: 签字</p>
<p className="font-medium">总计: ¥400</p>
</div>
</div>
</div>
);
}
function App() {
return (
<div className="flex items-center justify-center min-h-screen bg-gray-100">
<div className="w-full max-w-4xl p-10 bg-white border border-gray-300">
<Header />
<InvoiceDetails />
<ProductsTable />
<Footer />
</div>
</div>
);
}
export default App;