Commit 7be3559862f2377bf32fe854b511cfbc9784ac36

Authored by 曾国涛
1 parent cafb718c

refactor(Invoice): 优化重票记录页面代码结构

-调整组件导入顺序,提高代码可读性
- 重构操作列的渲染逻辑,增加日志输出
- 优化删除确认按钮的样式和布局
src/pages/Invoice/ReissueRecord/index.tsx
@@ -164,34 +164,37 @@ export default () => { @@ -164,34 +164,37 @@ export default () => {
164 title: '操作', 164 title: '操作',
165 valueType: 'option', 165 valueType: 'option',
166 key: 'option', 166 key: 'option',
167 - render: (record) => [  
168 - record.paths?.includes('audit') && (  
169 - <Audit  
170 - key={'audit'}  
171 - recordIds={[record.id]}  
172 - onClose={() => {  
173 - actionRef.current?.reload();  
174 - }}  
175 - />  
176 - ),  
177 - record.paths?.includes('audit') && (  
178 - <ButtonConfirm  
179 - key="delete"  
180 - className="p-0"  
181 - title={'确认删除该记录?'}  
182 - text="删除"  
183 - onConfirm={async () => {  
184 - let res = await postServiceInvoiceReissueRecordDelete({  
185 - data: { id: record.id },  
186 - });  
187 - if (res) {  
188 - message.success(res.message); 167 + render: (text, record) => {
  168 + console.log(text);
  169 + return [
  170 + record.paths?.includes('audit') && (
  171 + <Audit
  172 + key={'audit'}
  173 + recordIds={[record.id]}
  174 + onClose={() => {
189 actionRef.current?.reload(); 175 actionRef.current?.reload();
190 - }  
191 - }}  
192 - />  
193 - ),  
194 - ], 176 + }}
  177 + />
  178 + ),
  179 + record.paths?.includes('audit') && (
  180 + <ButtonConfirm
  181 + key="delete"
  182 + className="p-0"
  183 + title={'确认删除该记录?'}
  184 + text="删除"
  185 + onConfirm={async () => {
  186 + let res = await postServiceInvoiceReissueRecordDelete({
  187 + data: { id: record.id },
  188 + });
  189 + if (res) {
  190 + message.success(res.message);
  191 + actionRef.current?.reload();
  192 + }
  193 + }}
  194 + />
  195 + ),
  196 + ];
  197 + },
195 }, 198 },
196 ]; 199 ];
197 return ( 200 return (