Commit 31183be40797484f1ce3946c7a9b7502ca4ec912

Authored by 曾国涛
2 parents cd284914 86129810

Merge remote-tracking branch 'origin/dev' into dev

Too many changes to show.

To preserve performance only 5 of 23 files are displayed.

.umirc.ts
... ... @@ -139,9 +139,20 @@ export default defineConfig({
139 139 {
140 140 name: '课题组管理',
141 141 path: '/researchGroup',
142   - component: './ResearchGroup',
143 142 icon: 'AccountBookOutlined',
144 143 access: 'canReadAdminAndSales',
  144 + routes: [
  145 + {
  146 + name: '课题组列表',
  147 + path: 'researchGroup',
  148 + component: './ResearchGroup/ResearchGroup',
  149 + },
  150 + {
  151 + name: '课题组风险名单',
  152 + path: 'researchGroupAccess',
  153 + component: './ResearchGroup/ResearchGroupAccess',
  154 + },
  155 + ],
145 156 },
146 157 {
147 158 name: '分期账单',
... ...
src/pages/Order/FeedBack/OrderList.tsx
... ... @@ -2585,9 +2585,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => {
2585 2585 </span>
2586 2586 </div>
2587 2587 <span>
2588   - <span className="text-[#8C8C8C]">联系人:</span>
  2588 + <span className="text-[#8C8C8C]">课题组:</span>
2589 2589 <span className="text-slate-700">
2590   - {record.institutionContactName + ' '}
  2590 + {record.institutionContactName
  2591 + ? record.institutionContactName + ' '
  2592 + : '空'}
2591 2593 </span>
2592 2594 </span>
2593 2595 </>
... ...
src/pages/Order/OrderList/OrderDrawer.tsx
... ... @@ -768,73 +768,69 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
768 768 }>
769 769 open
770 770 width={1000}
771   - title={drawerTitle}
772   - resize={{
773   - onResize() {
774   - console.log('resize!');
775   - },
776   - maxWidth: window.innerWidth * 0.8,
777   - minWidth: 400,
  771 + modalProps={{
  772 + destroyOnClose: true,
  773 + maskClosable: true,
  774 + title: (
  775 + <div
  776 + style={{ display: 'flex', alignItems: 'center', width: '100%' }}
  777 + >
  778 + <span>{drawerTitle}</span>
  779 + {hasLocalData && (
  780 + <Button
  781 + key="useLocalData"
  782 + type="link"
  783 + onClick={() => {
  784 + useLocalFormData();
  785 + }}
  786 + >
  787 + 使用草稿
  788 + </Button>
  789 + )}
  790 + </div>
  791 + ),
778 792 }}
779 793 onFinishFailed={() => {
780 794 message.error('表单项存在错误,请检查');
781 795 setSubmitBtnLoading(false);
782 796 }}
783 797 submitter={{
784   - render: (props) => {
785   - return [
786   - <Button
787   - key="cancel"
788   - onClick={() => {
789   - onClose();
790   - }}
791   - >
792   - 取消
793   - </Button>,
794   - <Button
795   - key="localSave"
796   - loading={localSaveLoading}
797   - hidden={!optType('add') && !optType('copy')}
798   - onClick={() => {
799   - setLocalSaveLoading(true);
800   - saveFormDataToLocal();
801   - }}
802   - >
803   - 本地保存
804   - </Button>,
805   - <Button
806   - key="ok"
807   - type="primary"
808   - loading={submitBtnLoading}
809   - disabled={optType('after-sales-check')}
810   - onClick={() => {
811   - setSubmitBtnLoading(true);
812   - props.submit();
813   - }}
814   - >
815   - 提交
816   - </Button>,
817   - ];
818   - },
819   - }}
820   - form={form}
821   - autoFocusFirstInput
822   - drawerProps={{
823   - destroyOnClose: true,
824   - maskClosable: false,
825   - extra: [
  798 + render: (props) => [
  799 + <Button
  800 + key="cancel"
  801 + onClick={() => {
  802 + onClose();
  803 + }}
  804 + >
  805 + 取消
  806 + </Button>,
826 807 <Button
827   - key="useLocalData"
828   - hidden={!hasLocalData}
829   - type="link"
  808 + key="localSave"
  809 + loading={localSaveLoading}
  810 + hidden={!optType('add') && !optType('copy')}
830 811 onClick={() => {
831   - useLocalFormData();
  812 + setLocalSaveLoading(true);
  813 + saveFormDataToLocal();
832 814 }}
833 815 >
834   - 使用草稿
  816 + 本地保存
  817 + </Button>,
  818 + <Button
  819 + key="ok"
  820 + type="primary"
  821 + loading={submitBtnLoading}
  822 + disabled={optType('after-sales-check')}
  823 + onClick={() => {
  824 + setSubmitBtnLoading(true);
  825 + props.submit();
  826 + }}
  827 + >
  828 + 提交
835 829 </Button>,
836 830 ],
837 831 }}
  832 + form={form}
  833 + autoFocusFirstInput
838 834 submitTimeout={2000}
839 835 onFinish={async (values) => {
840 836 let res = {};
... ...
src/pages/Order/OrderList/OrderList.tsx
... ... @@ -2627,9 +2627,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
2627 2627 </span>
2628 2628 </div>
2629 2629 <span>
2630   - <span className="text-[#8C8C8C]">联系人:</span>
  2630 + <span className="text-[#8C8C8C]">课题组:</span>
2631 2631 <span className="text-slate-700">
2632   - {record.institutionContactName + ' '}
  2632 + {record.institutionContactName
  2633 + ? record.institutionContactName + ' '
  2634 + : '空'}
2633 2635 </span>
2634 2636 </span>
2635 2637 </>
... ...
src/pages/Order/OrderWarning/components/OrderDrawer.tsx
... ... @@ -11,6 +11,10 @@ import {
11 11 postKingdeeRepMaterialUnit,
12 12 postKingdeeRepMeasureUnit,
13 13 postPrepaidPhoneAvailableList,
  14 + postResearchGroupsNameSet,
  15 + postServiceConstCompanyType,
  16 + postServiceConstOrderSource,
  17 + postServiceConstPlatformType,
14 18 postServiceOrderAddOrder,
15 19 postServiceOrderAfterSalesQuerySnapshotOrder,
16 20 postServiceOrderApplyAfterSales,
... ... @@ -28,17 +32,21 @@ import { getTeacherCustomFieldNumber } from &#39;@/utils/kingdee&#39;;
28 32 import { getSalesCodeOptions } from '@/utils/order';
29 33 import { getDefaultString } from '@/utils/StringUtil';
30 34 import {
31   - DrawerForm,
32 35 FormListActionType,
  36 + ModalForm,
33 37 ProCard,
  38 + ProFormDatePicker,
34 39 ProFormDateTimePicker,
  40 + ProFormDependency,
35 41 ProFormDigit,
36 42 ProFormList,
  43 + ProFormRadio,
37 44 ProFormSelect,
38 45 ProFormText,
39 46 ProFormTextArea,
40 47 ProFormUploadDragger,
41 48 } from '@ant-design/pro-components';
  49 +import { Group } from '@ant-design/pro-form';
42 50 import { Button, Form, message, Modal } from 'antd';
43 51 import { cloneDeep } from 'lodash';
44 52 import { useEffect, useRef, useState } from 'react';
... ... @@ -48,15 +56,15 @@ import {
48 56 INVOCING_STATUS_OPTIONS_OLD,
49 57 PAYEE_OPTIONS,
50 58 PAYMENT_CHANNEL_OPTIONS,
51   - PAYMENT_METHOD_OPTIONS,
  59 + PAYMENT_METHOD_OPTIONS_4_ADD,
52 60 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
53 61 SHIPPING_WAREHOUSE_OPTIONS,
54   -} from '../../constant';
  62 +} from '../constant';
55 63 import KingdeeCustomerModal from './KingdeeCustomerModal';
56 64  
57 65 export default ({ onClose, data, subOrders, orderOptType }) => {
58 66 const [invoicingStatus, setInvoicingStatus] = useState('');
59   - const [salesCodeOptions] = useState([]);
  67 + const [salesCodeOptions, setSalesCodeOptions] = useState([]);
60 68 const [submitBtnLoading, setSubmitBtnLoading] = useState(false);
61 69 const [drawerTitle, setDrawerTitle] = useState('');
62 70 const [hasLocalData, setHasLocalData] = useState(false);
... ... @@ -80,41 +88,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
80 88 const [district, setDistrict] = useState('');
81 89 // const [productCustomerContactOptions, setProductCustomerContactOptions] =
82 90 // useState([]); //客户的收货人选项
83   - const [form] = Form.useForm<{
84   - isLocalData: boolean;
85   - salesCode: '';
86   - customerName: '';
87   - customerContactNumber: '';
88   - institution: '';
89   - institutionContactName: '';
90   - customerShippingAddress: '';
91   - totalPayment: '';
92   - paymentChannel: '';
93   - paymentMethod: '';
94   - productBelongBusiness: '';
95   - invoicingStatus: '';
96   - invoiceIdentificationNumber: '';
97   - invoicingTime: '';
98   - bank: '';
99   - bankAccountNumber: '';
100   - deleteSubOrderLists: [];
101   - filePaths: [];
102   - notes: '';
103   - invoiceFirst: boolean;
104   - list: [
105   - {
106   - productCode: '';
107   - productName: '';
108   - quantity: '';
109   - productPrice: '';
110   - parameters: '';
111   - subOrderPayment: '';
112   - unit: '';
113   - serialNumber: '';
114   - notes: '';
115   - },
116   - ];
117   - }>();
  91 + const [form] = Form.useForm();
118 92 const [accountOptions, setAccountOptions] = useState<any>([]);
119 93  
120 94 let copyData = cloneDeep(data);
... ... @@ -134,7 +108,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
134 108 */
135 109 const loadSalesCodeOptions = async () => {
136 110 let options = await getSalesCodeOptions();
137   - console.log('options ', JSON.stringify(options));
  111 + setSalesCodeOptions(options);
  112 +
138 113 if (optType('copy') || optType('edit')) {
139 114 let includeFlag = false;
140 115 //销售代码校验,如果是旧的销售代码,则提示并清空
... ... @@ -623,6 +598,21 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
623 598 form.setFieldValue('totalPayment', totalPayment);
624 599 }
625 600  
  601 + /*function computeTotalPayment() {
  602 + let list = form.getFieldValue('list');
  603 + let totalPaymentInMicro = 0; // 以"1 万分"为单位计算
  604 +
  605 + list?.forEach((subOrder: any) => {
  606 + let subOrderPayment = subOrder?.subOrderPayment;
  607 + if (subOrderPayment !== '' && subOrderPayment !== undefined) {
  608 + totalPaymentInMicro += Math.round(subOrderPayment * 10000); // 转换成整数(1 万分)
  609 + }
  610 + });
  611 +
  612 + let totalPayment = totalPaymentInMicro / 10000; // 计算完后转换回元
  613 + form.setFieldValue('totalPayment', totalPayment.toFixed(2)); // 保留 4 位小数
  614 + }*/
  615 +
626 616 /**
627 617 * 检查用户额度
628 618 * @param option
... ... @@ -751,18 +741,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
751 741 }
752 742 }
753 743  
754   - const validateContactNumber = (_: any, value: any) => {
755   - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
756   - const phoneRegex = /^\d{1,11}(-\d{1,11})?$/;
757   -
758   - if (emailRegex.test(value) || phoneRegex.test(value)) {
759   - return Promise.resolve();
760   - }
761   - return Promise.reject(
762   - new Error('联系方式必须是邮箱或手机号格式(不能包含空格等特殊符号)'),
763   - );
764   - };
765   -
766 744 /**
767 745 * 刪除草稿数据
768 746 */
... ... @@ -782,22 +760,14 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
782 760  
783 761 return (
784 762 <>
785   - <DrawerForm<{
  763 + <ModalForm<{
786 764 isLocalData: any;
787 765 deleteSubOrderLists: any;
788 766 name: string;
789 767 company: string;
790 768 }>
791 769 open
792   - width="35%"
793   - title={drawerTitle}
794   - resize={{
795   - onResize() {
796   - console.log('resize!');
797   - },
798   - maxWidth: window.innerWidth * 0.8,
799   - minWidth: 400,
800   - }}
  770 + width={1000}
801 771 onFinishFailed={() => {
802 772 message.error('表单项存在错误,请检查');
803 773 setSubmitBtnLoading(false);
... ... @@ -841,21 +811,27 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
841 811 }}
842 812 form={form}
843 813 autoFocusFirstInput
844   - drawerProps={{
  814 + modalProps={{
845 815 destroyOnClose: true,
846   - maskClosable: false,
847   - extra: [
848   - <Button
849   - key="useLocalData"
850   - hidden={!hasLocalData}
851   - type="link"
852   - onClick={() => {
853   - useLocalFormData();
854   - }}
  816 + maskClosable: true,
  817 + title: (
  818 + <div
  819 + style={{ display: 'flex', alignItems: 'center', width: '100%' }}
855 820 >
856   - 使用草稿
857   - </Button>,
858   - ],
  821 + <span>{drawerTitle}</span>
  822 + {hasLocalData && (
  823 + <Button
  824 + key="useLocalData"
  825 + type="link"
  826 + onClick={() => {
  827 + useLocalFormData();
  828 + }}
  829 + >
  830 + 使用草稿
  831 + </Button>
  832 + )}
  833 + </div>
  834 + ),
859 835 }}
860 836 submitTimeout={2000}
861 837 onFinish={async (values) => {
... ... @@ -869,11 +845,46 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
869 845 });
870 846 return item;
871 847 });
872   -
  848 + list = list.map((item, index) => {
  849 + // //记录部门修改时间
  850 + if (
  851 + optType('edit') &&
  852 + copyData?.subOrderInformationLists[index]
  853 + ?.productBelongBusiness &&
  854 + item.productBelongBusiness !==
  855 + copyData?.subOrderInformationLists[index]?.productBelongBusiness
  856 + ) {
  857 + const date = new Date();
  858 + const year = date.getFullYear();
  859 + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
  860 + const day = String(date.getDate()).padStart(2, '0');
  861 + const hours = String(date.getHours()).padStart(2, '0');
  862 + const minutes = String(date.getMinutes()).padStart(2, '0');
  863 + const seconds = String(date.getSeconds()).padStart(2, '0');
  864 +
  865 + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  866 + values.productBelongBusinessUpdateTime = formattedDate;
  867 + } else if (optType('add') || optType('copy')) {
  868 + const date = new Date();
  869 + const year = date.getFullYear();
  870 + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
  871 + const day = String(date.getDate()).padStart(2, '0');
  872 + const hours = String(date.getHours()).padStart(2, '0');
  873 + const minutes = String(date.getMinutes()).padStart(2, '0');
  874 + const seconds = String(date.getSeconds()).padStart(2, '0');
  875 + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  876 + values.productBelongBusinessUpdateTime = formattedDate;
  877 + } else {
  878 + values.productBelongBusinessUpdateTime =
  879 + data.productBelongBusinessUpdateTime;
  880 + }
  881 + return item;
  882 + });
873 883 values.list = list;
874 884 values.institution = values.institution?.trim();
875 885 values.institutionContactName = values.institutionContactName?.trim();
876 886 values.customerName = values.customerNameString.trim();
  887 +
877 888 // values.customerShippingAddress =
878 889 // province + city + district + values.customerShippingAddress;
879 890  
... ... @@ -907,7 +918,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
907 918 });
908 919 let diff = originIds.filter((item) => !curIds.includes(item));
909 920 values.deleteSubOrderLists = diff;
910   -
911 921 if (optType('edit')) {
912 922 values.province = province;
913 923 values.city = city;
... ... @@ -1129,7 +1139,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1129 1139 console.log(form.getFieldValue('id'));
1130 1140 if (form.getFieldValue('id') !== undefined) {
1131 1141 const resp = await postDistrictSelOrderProvince({
1132   - data: form.getFieldValue('id'),
  1142 + data: {
  1143 + oId: form.getFieldValue('id'),
  1144 + orderType: orderOptType,
  1145 + },
1133 1146 });
1134 1147 if (resp && resp.data) {
1135 1148 if (resp.data.province) {
... ... @@ -1193,10 +1206,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1193 1206 loadAccountOptions(v.target.value);
1194 1207 },
1195 1208 }}
1196   - rules={[
1197   - { required: true, message: '联系方式必填' },
1198   - { validator: validateContactNumber },
1199   - ]}
  1209 + rules={[{ required: true, message: '联系方式必填' }]}
1200 1210 />
1201 1211 <ProFormText
1202 1212 width="lg"
... ... @@ -1206,45 +1216,163 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1206 1216 placeholder="请输入单位"
1207 1217 rules={[{ required: true, message: '单位必填' }]}
1208 1218 />
1209   - <ProFormText
  1219 + {/*<ProFormText
1210 1220 width="lg"
1211 1221 key="institutionContactName"
1212 1222 name="institutionContactName"
1213 1223 label="课题组"
1214 1224 placeholder="请输入课题组"
1215 1225 rules={[{ required: true, message: '课题组必填' }]}
1216   - />
1217   - {/*<ProFormSelect
1218   - key={'institutionContactName'}
  1226 + />*/}
  1227 + <Group>
  1228 + <ProFormSelect
  1229 + request={async () => {
  1230 + const res = await postServiceConstCompanyType();
  1231 + return Object.entries(res?.data).map(([value, label]) => ({
  1232 + label,
  1233 + value,
  1234 + }));
  1235 + }}
1219 1236 width="md"
1220   - showSearch
1221   - name="institutionContactName"
1222   - rules={[{ required: true, message: '请输入课题组名称!' }]}
1223   - request={async (value) => {
1224   - const keywords = value.keyWords;
1225   - const res = await postResearchGroupsNameSet({
1226   - data: {
1227   - groupName: keywords,
1228   - },
1229   - });
1230   - let options = res?.data?.map((c: any) => {
1231   - return {
1232   - label: c,
1233   - value: c,
1234   - key: c,
1235   - };
1236   - });
1237   - return options;
  1237 + onChange={() => {
  1238 + form.setFieldValue('platformType', '');
1238 1239 }}
1239   - fieldProps={{
1240   - filterOption() {
1241   - return true;
1242   - },
  1240 + rules={[{ required: true, message: '单位类型必填' }]}
  1241 + name="companyType"
  1242 + label="单位类型"
  1243 + />
  1244 + <ProFormDependency name={['companyType']}>
  1245 + {({ companyType }) => {
  1246 + const renderInstitutionContactName = () => (
  1247 + <>
  1248 + <ProFormSelect
  1249 + key="institutionContactName"
  1250 + width="md"
  1251 + showSearch
  1252 + name="institutionContactName"
  1253 + rules={[{ required: true, message: '请输入课题组名称!' }]}
  1254 + request={async (value) => {
  1255 + const keywords = value?.keyWords || '';
  1256 + const res = await postResearchGroupsNameSet({
  1257 + data: { status: 'ADD_AUDIT_PASS', groupName: keywords },
  1258 + });
  1259 + return Object.entries(res?.data || {}).map(
  1260 + ([researchGroupsId, researchGroupsName]) => ({
  1261 + label: researchGroupsName,
  1262 + value: researchGroupsName, // 使用 researchGroupsId 作为 value
  1263 + key: researchGroupsId,
  1264 + id: researchGroupsId,
  1265 + }),
  1266 + );
  1267 + }}
  1268 + fieldProps={{
  1269 + filterOption: () => true,
  1270 + onChange: (_, option) => {
  1271 + form.setFieldsValue({
  1272 + researchGroupId: option?.id || '',
  1273 + });
  1274 + },
  1275 + }}
  1276 + debounceTime={1000}
  1277 + label="课题组名称"
  1278 + placeholder="请输入名称"
  1279 + />
  1280 + <ProFormText
  1281 + hidden={true}
  1282 + key="researchGroupId"
  1283 + name="researchGroupId"
  1284 + ></ProFormText>
  1285 + </>
  1286 + );
  1287 + const renderPlatformType = (fieldKey) => (
  1288 + <ProFormSelect
  1289 + key={fieldKey}
  1290 + width="md"
  1291 + showSearch
  1292 + name="platformType"
  1293 + rules={[{ required: true, message: '请选择平台类型!' }]}
  1294 + request={async () => {
  1295 + const res = await postServiceConstPlatformType({
  1296 + query: { companyType },
  1297 + });
  1298 + return Object.entries(res?.data).map(([value, label]) => ({
  1299 + label,
  1300 + value,
  1301 + }));
  1302 + }}
  1303 + fieldProps={{
  1304 + filterOption: (input, option) =>
  1305 + option?.label.toLowerCase().includes(input.toLowerCase()), // 自定义搜索过滤逻辑
  1306 + }}
  1307 + debounceTime={1000}
  1308 + label="平台类型"
  1309 + placeholder="请输入平台类型"
  1310 + />
  1311 + );
  1312 +
  1313 + if (companyType === 'school') {
  1314 + return renderInstitutionContactName();
  1315 + } else if (
  1316 + ['firm', 'ECommercePlatform', 'otherPlatform'].includes(
  1317 + companyType,
  1318 + )
  1319 + ) {
  1320 + return (
  1321 + <Group>
  1322 + {['ECommercePlatform', 'otherPlatform'].includes(
  1323 + companyType,
  1324 + ) && renderPlatformType(`platformType_${companyType}`)}
  1325 + <ProFormText
  1326 + width="md"
  1327 + name="institutionContactName"
  1328 + label="课题组名称"
  1329 + placeholder="请输入名称"
  1330 + />
  1331 + </Group>
  1332 + );
  1333 + } else if (companyType === 'officialWebsite') {
  1334 + return (
  1335 + <Group>
  1336 + <ProFormSelect
  1337 + request={async () => {
  1338 + const res = await postServiceConstOrderSource();
  1339 + return Object.entries(res?.data).map(
  1340 + ([value, label]) => ({
  1341 + label,
  1342 + value,
  1343 + }),
  1344 + );
  1345 + }}
  1346 + width="md"
  1347 + name="orderSource"
  1348 + label="订单来源"
  1349 + />
  1350 + <ProFormDependency name={['orderSource']}>
  1351 + {({ orderSource }) => {
  1352 + if (orderSource === 'school') {
  1353 + return renderInstitutionContactName();
  1354 + } else if (orderSource === 'company') {
  1355 + return (
  1356 + <ProFormText
  1357 + width="md"
  1358 + name="institutionContactName"
  1359 + label="课题组名称"
  1360 + placeholder="请输入名称"
  1361 + />
  1362 + );
  1363 + }
  1364 + return null;
  1365 + }}
  1366 + </ProFormDependency>
  1367 + </Group>
  1368 + );
  1369 + } else {
  1370 + return renderInstitutionContactName();
  1371 + }
1243 1372 }}
1244   - debounceTime={1000}
1245   - label="课题组名称"
1246   - placeholder="请输入名称"
1247   - />*/}
  1373 + </ProFormDependency>
  1374 + </Group>
  1375 +
1248 1376 <div
1249 1377 style={{
1250 1378 display: 'flex',
... ... @@ -1315,7 +1443,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1315 1443 console.log(form.getFieldValue('id'));
1316 1444 if (form.getFieldValue('id')) {
1317 1445 const resp = await postDistrictSelOrderProvince({
1318   - data: form.getFieldValue('id'),
  1446 + data: {
  1447 + oId: form.getFieldValue('id'),
  1448 + orderType: orderOptType,
  1449 + },
1319 1450 });
1320 1451 if (
1321 1452 resp.data.province !== null &&
... ... @@ -1375,7 +1506,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1375 1506 let districtOptions = [];
1376 1507 if (form.getFieldValue('id')) {
1377 1508 const resp = await postDistrictSelOrderProvince({
1378   - data: form.getFieldValue('id'),
  1509 + data: {
  1510 + oId: form.getFieldValue('id'),
  1511 + orderType: orderOptType,
  1512 + },
1379 1513 });
1380 1514 if (resp.data.city !== null && resp.data.city !== undefined) {
1381 1515 let res = await postDistrictSelectByNameAndLevel({
... ... @@ -1477,7 +1611,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1477 1611 onChange={(val: any) => {
1478 1612 setPaymentMethod(val);
1479 1613 }}
1480   - options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
  1614 + options={enumToSelect(PAYMENT_METHOD_OPTIONS_4_ADD)}
1481 1615 rules={[{ required: true, message: '支付方式必填' }]}
1482 1616 disabled={optType('after-sales-check')}
1483 1617 />
... ... @@ -1561,7 +1695,34 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1561 1695 form.setFieldValue('invoiceFirst', false);
1562 1696 }
1563 1697 }}
1564   - rules={[{ required: true, message: '是否需要开票必填' }]}
  1698 + rules={[
  1699 + { required: true, message: '是否需要开票必填' },
  1700 + {
  1701 + validator: (_, value) => {
  1702 + // 自定义校验逻辑
  1703 + if (
  1704 + form.getFieldValue('paymentMethod') ===
  1705 + 'WITHHOLDING_ADVANCE_DEPOSIT' &&
  1706 + value !== 'UN_INVOICE'
  1707 + ) {
  1708 + return Promise.reject('扣预存订单不能开票');
  1709 + }
  1710 + return Promise.resolve();
  1711 + },
  1712 + },
  1713 + {
  1714 + validator: (_, value) => {
  1715 + // 自定义校验逻辑
  1716 + if (
  1717 + form.getFieldValue('totalPayment') === 0 &&
  1718 + value !== 'UN_INVOICE'
  1719 + ) {
  1720 + return Promise.reject('金额为0订单不能开票');
  1721 + }
  1722 + return Promise.resolve();
  1723 + },
  1724 + },
  1725 + ]}
1565 1726 />
1566 1727 <ProFormSelect
1567 1728 placeholder="是否开票后发货"
... ... @@ -1750,6 +1911,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1750 1911 value: listMeta?.record?.materialId,
1751 1912 }}
1752 1913 fieldProps={{
  1914 + popupMatchSelectWidth: false,
  1915 + listHeight: 400,
  1916 + dropdownStyle: { width: '55%' },
1753 1917 filterOption() {
1754 1918 return true;
1755 1919 },
... ... @@ -1946,6 +2110,76 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1946 2110 rules={[{ required: true, message: '所属事业部必填' }]}
1947 2111 disabled={optType('after-sales-check')}
1948 2112 />,
  2113 +
  2114 + <Group key="selfDevelop">
  2115 + <ProFormRadio.Group
  2116 + key="selfDevelop"
  2117 + name="selfDevelop"
  2118 + label="是否自研产品"
  2119 + initialValue={false}
  2120 + options={[
  2121 + {
  2122 + label: '是',
  2123 + value: true,
  2124 + },
  2125 + {
  2126 + label: '否',
  2127 + value: false,
  2128 + },
  2129 + ]}
  2130 + rules={[{ required: true, message: '是否自研产品必填' }]}
  2131 + />
  2132 + <ProFormDependency name={['selfDevelop']}>
  2133 + {({ selfDevelop }) => {
  2134 + if (selfDevelop) {
  2135 + return (
  2136 + <ProFormDatePicker
  2137 + name="deliveryDatetime"
  2138 + label="产品交期(填写前请先与工程师沟通)"
  2139 + rules={[
  2140 + { required: true, message: '产品交期必填' },
  2141 + ]}
  2142 + />
  2143 + );
  2144 + }
  2145 + }}
  2146 + </ProFormDependency>
  2147 + </Group>,
  2148 + <ProFormRadio.Group
  2149 + key="proxy"
  2150 + name="proxy"
  2151 + label="是否代买代购"
  2152 + //hidden={true}
  2153 + initialValue={true}
  2154 + options={[
  2155 + {
  2156 + label: '是',
  2157 + value: true,
  2158 + },
  2159 + {
  2160 + label: '否',
  2161 + value: false,
  2162 + },
  2163 + ]}
  2164 + />,
  2165 + <ProFormRadio.Group
  2166 + key="discount"
  2167 + name="discount"
  2168 + label="是否竞标/打折"
  2169 + //hidden={true}
  2170 + initialValue={true}
  2171 + options={[
  2172 + {
  2173 + label: '是',
  2174 + value: true,
  2175 + },
  2176 + {
  2177 + label: '否',
  2178 + value: false,
  2179 + },
  2180 + ]}
  2181 + />,
  2182 +
1949 2183 <ProFormSelect
1950 2184 key={'shippingWarehouse' + listMeta.index}
1951 2185 placeholder="请选择发货仓库"
... ... @@ -1997,7 +2231,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1997 2231 }}
1998 2232 actionRef={actionRef}
1999 2233 ></ProFormList>
2000   - </DrawerForm>
  2234 + </ModalForm>
2001 2235 {kingdeeCstomerModalVisible && (
2002 2236 <KingdeeCustomerModal
2003 2237 setVisible={setKingdeeCstomerModalVisible}
... ...