Commit 99f55856d5f8460b0c6a2b7b0202751b2f03ac5f

Authored by boyang
2 parents bb230f20 d90ecca7

Merge branch 'master' into feature-installment2

# Conflicts:
#	src/pages/Order/OrderList/OrderDrawer.tsx
src/pages/Invoice/Invoice/index.tsx
@@ -52,6 +52,11 @@ const InvoiceRecord = () => { @@ -52,6 +52,11 @@ const InvoiceRecord = () => {
52 let dataIndex = item.dataIndex; 52 let dataIndex = item.dataIndex;
53 let dataType = item.valueType; 53 let dataType = item.valueType;
54 54
  55 + // 如果是mainOrderIds列并且已经有自己的render函数,不要覆盖
  56 + if (dataIndex === 'mainOrderIds' && item.render) {
  57 + return newItem;
  58 + }
  59 +
55 newItem.render = (text, record) => { 60 newItem.render = (text, record) => {
56 let textValue = record[dataIndex]; 61 let textValue = record[dataIndex];
57 62
@@ -108,16 +113,17 @@ const InvoiceRecord = () => { @@ -108,16 +113,17 @@ const InvoiceRecord = () => {
108 if (record.paths?.includes('edit')) { 113 if (record.paths?.includes('edit')) {
109 btns.push( 114 btns.push(
110 <a 115 <a
  116 + className="p-0"
111 key="editable" 117 key="editable"
112 onClick={() => { 118 onClick={() => {
113 action?.startEditable?.(record.id); 119 action?.startEditable?.(record.id);
114 }} 120 }}
  121 + style={{ marginRight: 8, whiteSpace: 'nowrap' }}
115 > 122 >
116 编辑 123 编辑
117 </a>, 124 </a>,
118 ); 125 );
119 } 126 }
120 -  
121 if (record.paths?.includes('writeOff') && !record.writeOffId) { 127 if (record.paths?.includes('writeOff') && !record.writeOffId) {
122 btns.push( 128 btns.push(
123 <InvoiceWriteOffModal 129 <InvoiceWriteOffModal
src/pages/Invoice/constant.tsx
  1 +import EllipsisDiv from '@/components/Div/EllipsisDiv';
1 import { enumToProTableEnumValue } from '@/utils'; 2 import { enumToProTableEnumValue } from '@/utils';
2 import { PAYEE_OPTIONS } from '../Order/constant'; 3 import { PAYEE_OPTIONS } from '../Order/constant';
3 4
@@ -45,6 +46,53 @@ export const INVOICE_COLUMNS = [ @@ -45,6 +46,53 @@ export const INVOICE_COLUMNS = [
45 width: 100, 46 width: 100,
46 }, 47 },
47 { 48 {
  49 + dataIndex: 'mainOrderIds',
  50 + title: '主订单id',
  51 + valueType: 'text',
  52 + width: 160,
  53 + hideInTable: false,
  54 + hideInSearch: true,
  55 + readonly: true,
  56 + render: (text: any, record: any) => {
  57 + if (!record.mainOrderIds || record.mainOrderIds.length === 0) {
  58 + return '-';
  59 + }
  60 +
  61 + let content = '';
  62 +
  63 + // 直接从text参数中处理,可能是已处理过的数组
  64 + if (text && Array.isArray(text)) {
  65 + content = text.join(', ');
  66 + }
  67 + // 如果record.mainOrderIds是数组,直接join
  68 + else if (Array.isArray(record.mainOrderIds)) {
  69 + content = record.mainOrderIds.join(', ');
  70 + }
  71 + // 如果是字符串,检查是否为JSON格式的数组
  72 + else if (typeof record.mainOrderIds === 'string') {
  73 + try {
  74 + // 尝试解析JSON
  75 + const parsedData = JSON.parse(record.mainOrderIds);
  76 + if (Array.isArray(parsedData)) {
  77 + content = parsedData.join(', ');
  78 + } else {
  79 + content = record.mainOrderIds;
  80 + }
  81 + } catch (e) {
  82 + // 不是JSON格式,使用原始字符串
  83 + content = record.mainOrderIds;
  84 + }
  85 + }
  86 + // 其他情况直接返回原值
  87 + else {
  88 + content = String(record.mainOrderIds);
  89 + }
  90 +
  91 + // 使用EllipsisDiv组件显示带省略号的内容
  92 + return <EllipsisDiv text={content} />;
  93 + },
  94 + },
  95 + {
48 dataIndex: 'mainOrderId', 96 dataIndex: 'mainOrderId',
49 title: '主订单id', 97 title: '主订单id',
50 valueType: 'text', 98 valueType: 'text',
@@ -65,7 +113,7 @@ export const INVOICE_COLUMNS = [ @@ -65,7 +113,7 @@ export const INVOICE_COLUMNS = [
65 title: '状态', 113 title: '状态',
66 dataIndex: 'statusText', 114 dataIndex: 'statusText',
67 valueType: 'text', 115 valueType: 'text',
68 - width: 180, 116 + width: 100,
69 readonly: true, 117 readonly: true,
70 hideInSearch: true, 118 hideInSearch: true,
71 }, 119 },
@@ -73,7 +121,7 @@ export const INVOICE_COLUMNS = [ @@ -73,7 +121,7 @@ export const INVOICE_COLUMNS = [
73 title: '状态', 121 title: '状态',
74 dataIndex: 'writeOffIdIsNull', 122 dataIndex: 'writeOffIdIsNull',
75 valueType: 'select', 123 valueType: 'select',
76 - width: 100, 124 + width: 80,
77 valueEnum: { 125 valueEnum: {
78 true: { 126 true: {
79 text: '未核销', 127 text: '未核销',
src/pages/Order/OrderList/OrderList.tsx
@@ -4379,6 +4379,13 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; { @@ -4379,6 +4379,13 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
4379 refreshTable(); 4379 refreshTable();
4380 }} 4380 }}
4381 defaultValue={0} 4381 defaultValue={0}
  4382 + style={{
  4383 + display: 'flex',
  4384 + flexDirection: 'row',
  4385 + alignItems: 'center',
  4386 + gap: 8,
  4387 + whiteSpace: 'nowrap',
  4388 + }}
4382 > 4389 >
4383 {radios} 4390 {radios}
4384 </Radio.Group> 4391 </Radio.Group>
src/pages/OrderReport/index.tsx
@@ -181,7 +181,6 @@ const OrderReportPage = () =&gt; { @@ -181,7 +181,6 @@ const OrderReportPage = () =&gt; {
181 }, [selectedMonth, selectedYear]); 181 }, [selectedMonth, selectedYear]);
182 182
183 useEffect(() => { 183 useEffect(() => {
184 - loadData();  
185 getSalesCodeOptions(); 184 getSalesCodeOptions();
186 }, []); 185 }, []);
187 186
src/pages/ResearchGroup/ResearchGroup/constant.tsx
@@ -20,7 +20,6 @@ export const RESEARCH_GROUP_COLUMNS = [ @@ -20,7 +20,6 @@ export const RESEARCH_GROUP_COLUMNS = [
20 key: 'id', 20 key: 'id',
21 valueType: 'index', 21 valueType: 'index',
22 hideInSearch: true, 22 hideInSearch: true,
23 - hideInTable: true,  
24 }, 23 },
25 { 24 {
26 title: '课题组名称', 25 title: '课题组名称',