Commit 490847a32af143037ce58e830c359f240f369697
Merge branch 'dev' into 'master'
Dev See merge request !27
Showing
1 changed file
with
63 additions
and
61 deletions
src/pages/Order/OrderList/OrderDrawer.tsx
... | ... | @@ -768,73 +768,69 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
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) => [ | |
826 | 799 | <Button |
827 | - key="useLocalData" | |
828 | - hidden={!hasLocalData} | |
829 | - type="link" | |
800 | + key="cancel" | |
830 | 801 | onClick={() => { |
831 | - useLocalFormData(); | |
802 | + onClose(); | |
832 | 803 | }} |
833 | 804 | > |
834 | - 使用草稿 | |
805 | + 取消 | |
806 | + </Button>, | |
807 | + <Button | |
808 | + key="localSave" | |
809 | + loading={localSaveLoading} | |
810 | + hidden={!optType('add') && !optType('copy')} | |
811 | + onClick={() => { | |
812 | + setLocalSaveLoading(true); | |
813 | + saveFormDataToLocal(); | |
814 | + }} | |
815 | + > | |
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 = {}; |
... | ... | @@ -1235,7 +1231,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
1235 | 1231 | value, |
1236 | 1232 | })); |
1237 | 1233 | }} |
1238 | - width="md" | |
1234 | + width="xl" | |
1239 | 1235 | onChange={() => { |
1240 | 1236 | form.setFieldValue('platformType', ''); |
1241 | 1237 | }} |
... | ... | @@ -1246,10 +1242,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
1246 | 1242 | <ProFormDependency name={['companyType']}> |
1247 | 1243 | {({ companyType }) => { |
1248 | 1244 | const renderInstitutionContactName = () => ( |
1249 | - <> | |
1245 | + <Group> | |
1250 | 1246 | <ProFormSelect |
1251 | 1247 | key="institutionContactName" |
1252 | - width="md" | |
1248 | + width="xl" | |
1253 | 1249 | showSearch |
1254 | 1250 | name="institutionContactName" |
1255 | 1251 | rules={[{ required: true, message: '请输入课题组名称!' }]} |
... | ... | @@ -1279,12 +1275,16 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
1279 | 1275 | label="课题组名称" |
1280 | 1276 | placeholder="请输入名称" |
1281 | 1277 | /> |
1282 | - <ProFormText | |
1283 | - hidden={true} | |
1278 | + <ProFormDigit | |
1279 | + readonly | |
1284 | 1280 | key="researchGroupId" |
1281 | + width="md" | |
1285 | 1282 | name="researchGroupId" |
1286 | - ></ProFormText> | |
1287 | - </> | |
1283 | + label="课题组Id" | |
1284 | + fieldProps={{ precision: 0 }} // 只允许整数 | |
1285 | + rules={[{ required: true, message: '请重新选择课题组!' }]} | |
1286 | + /> | |
1287 | + </Group> | |
1288 | 1288 | ); |
1289 | 1289 | const renderPlatformType = (fieldKey) => ( |
1290 | 1290 | <ProFormSelect |
... | ... | @@ -2163,6 +2163,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
2163 | 2163 | value: false, |
2164 | 2164 | }, |
2165 | 2165 | ]} |
2166 | + rules={[{ required: true, message: '是否代买代购必填' }]} | |
2166 | 2167 | />, |
2167 | 2168 | <ProFormRadio.Group |
2168 | 2169 | key="discount" |
... | ... | @@ -2180,6 +2181,7 @@ export default ({ onClose, data, subOrders, orderOptType }) => { |
2180 | 2181 | value: false, |
2181 | 2182 | }, |
2182 | 2183 | ]} |
2184 | + rules={[{ required: true, message: '是否竞标/打折必填' }]} | |
2183 | 2185 | />, |
2184 | 2186 | |
2185 | 2187 | <ProFormSelect | ... | ... |