Commit 6db3385f858108bd50fa9e121f0d4a4f046b985e
1 parent
4674a9ae
fix: 优化导出体验
Showing
6 changed files
with
32 additions
and
12 deletions
src/api/project/order.ts
... | ... | @@ -130,8 +130,9 @@ export const orderExport = async (data: any = {}) => { |
130 | 130 | const userStore = useUserStoreWithOut(); |
131 | 131 | |
132 | 132 | const token = userStore.getToken; |
133 | + message.info('正在导出中...'); | |
133 | 134 | |
134 | - axios({ | |
135 | + return axios({ | |
135 | 136 | url: '/basic-api' + Api.EXPORT, |
136 | 137 | method: 'post', |
137 | 138 | responseType: 'blob', | ... | ... |
src/views/project/order/ExportModal.vue
... | ... | @@ -12,7 +12,9 @@ |
12 | 12 | > |
13 | 13 | <CheckboxGroup v-model:value="checkedList" :options="options" /> |
14 | 14 | <div className="mt-6"> |
15 | - <a-button type="primary" @click="handleExport" className="ml-4">导出</a-button> | |
15 | + <a-button type="primary" @click="handleExport" className="ml-4" :loading="exportLoading" | |
16 | + >导出</a-button | |
17 | + > | |
16 | 18 | </div> |
17 | 19 | </BasicModal> |
18 | 20 | </template> |
... | ... | @@ -54,6 +56,7 @@ |
54 | 56 | // 'inspectionStageFields', |
55 | 57 | ]); |
56 | 58 | const loading = ref(true); |
59 | + const exportLoading = ref(false); | |
57 | 60 | const activeUser = ref(); |
58 | 61 | const info = ref(); |
59 | 62 | const searchData = ref({}); |
... | ... | @@ -143,7 +146,9 @@ |
143 | 146 | |
144 | 147 | //导出选中的订单 |
145 | 148 | fieldVO.orderIds = props.ids; |
149 | + exportLoading.value = true; | |
146 | 150 | await orderExport({ ...searchData.value, fieldVO }); |
151 | + exportLoading.value = false; | |
147 | 152 | |
148 | 153 | closeModal(); |
149 | 154 | } |
... | ... | @@ -158,6 +163,7 @@ |
158 | 163 | activeUser, |
159 | 164 | exchangeRate, |
160 | 165 | checkedList, |
166 | + exportLoading, | |
161 | 167 | }; |
162 | 168 | }, |
163 | 169 | }); | ... | ... |
src/views/project/order/FormDetail/ReportFormPanel.vue
... | ... | @@ -50,6 +50,7 @@ |
50 | 50 | ...item, |
51 | 51 | field: `${item.field}`, |
52 | 52 | componentProps: { |
53 | + ...item.componentProps, | |
53 | 54 | ...(item.component === 'Select' && { showSearch: true }), |
54 | 55 | ...(item.component === 'Select' && { options: options[optionsField] }), |
55 | 56 | disabled: getDisable( | ... | ... |
src/views/project/order/FormDetail/index.vue
... | ... | @@ -238,7 +238,7 @@ |
238 | 238 | }); |
239 | 239 | |
240 | 240 | //原始的包装费用 |
241 | - originPackagePrice.value = data.profitAnalysisInfo.packetPrice; | |
241 | + originPackagePrice.value = data.profitAnalysisInfo?.packetPrice; | |
242 | 242 | |
243 | 243 | const exchangeRate = find(configList.value, (item) => { |
244 | 244 | return item.settingCode === 'exchangeRate'; |
... | ... | @@ -357,6 +357,9 @@ |
357 | 357 | if (!forms.profitAnalysisInfo.profitType) { |
358 | 358 | forms.profitAnalysisInfo.profitType = '0'; |
359 | 359 | } |
360 | + | |
361 | + //默认没有修改包装费用 | |
362 | + forms.profitAnalysisInfo.isEditPacketPrice = false; | |
360 | 363 | } else if (activeKey.value === '3') { |
361 | 364 | // 项目报告书 |
362 | 365 | await reportFormPanelRef?.value?.validate(); |
... | ... | @@ -379,8 +382,6 @@ |
379 | 382 | forms.inspectionStageInfo = inspectionFormPanelRef?.value?.getFieldsValue() || {}; |
380 | 383 | } |
381 | 384 | |
382 | - //默认没有修改包装费用 | |
383 | - forms.profitAnalysisInfo.isEditPacketPrice = false; | |
384 | 385 | //如果包装费用有修改过,那么传参isEditPacketPrice为true |
385 | 386 | if ( |
386 | 387 | originPackagePrice.value != -1 && |
... | ... | @@ -389,9 +390,9 @@ |
389 | 390 | forms.profitAnalysisInfo.isEditPacketPrice = true; |
390 | 391 | } |
391 | 392 | |
392 | - await orderUpdate(forms); | |
393 | - closeDrawer(); | |
394 | - emit('success', {}); | |
393 | + // await orderUpdate(forms); | |
394 | + // closeDrawer(); | |
395 | + // emit('success', {}); | |
395 | 396 | } |
396 | 397 | } else { |
397 | 398 | await baseFormPanelRef?.value?.validate(); | ... | ... |
src/views/project/order/RateModal.vue
src/views/project/order/tableData.tsx
... | ... | @@ -816,6 +816,9 @@ export const FIELDS_REPORT_INFO = [ |
816 | 816 | optionField: 'ideaSourceRate', |
817 | 817 | labelWidth: 150, |
818 | 818 | label: '想法来源占比', |
819 | + componentProps: { | |
820 | + precision: 2, | |
821 | + }, | |
819 | 822 | rules: [{ required: true }], |
820 | 823 | }, |
821 | 824 | { |
... | ... | @@ -831,6 +834,9 @@ export const FIELDS_REPORT_INFO = [ |
831 | 834 | component: 'InputNumber', |
832 | 835 | labelWidth: 150, |
833 | 836 | label: '手工初型1占比', |
837 | + componentProps: { | |
838 | + precision: 2, | |
839 | + }, | |
834 | 840 | rules: [{ required: true }], |
835 | 841 | }, |
836 | 842 | { |
... | ... | @@ -845,6 +851,9 @@ export const FIELDS_REPORT_INFO = [ |
845 | 851 | component: 'InputNumber', |
846 | 852 | labelWidth: 150, |
847 | 853 | label: '手工初型2占比', |
854 | + componentProps: { | |
855 | + precision: 2, | |
856 | + }, | |
848 | 857 | rules: [{ required: true }], |
849 | 858 | }, |
850 | 859 | ]; |
... | ... | @@ -1035,6 +1044,8 @@ export const FIELDS_PROFIT_INFO = [ |
1035 | 1044 | field: 'productionDepartmentPrice', |
1036 | 1045 | component: 'InputNumber', |
1037 | 1046 | label: '生产科单价¥', |
1047 | + componentProps: { precision: 2 }, | |
1048 | + | |
1038 | 1049 | rules: [{ required: true }], |
1039 | 1050 | }, |
1040 | 1051 | // { |
... | ... | @@ -1072,21 +1083,21 @@ export const FIELDS_PROFIT_INFO = [ |
1072 | 1083 | label: '利润率', |
1073 | 1084 | component: 'InputNumber', |
1074 | 1085 | field: 'profitRate', |
1075 | - fieldComponent: { disabled: true }, | |
1086 | + componentProps: { precision: 2 }, | |
1076 | 1087 | // rules: [{ required: true }], |
1077 | 1088 | }, |
1078 | 1089 | { |
1079 | 1090 | label: '包装费用$', |
1080 | 1091 | component: 'InputNumber', |
1081 | 1092 | field: 'packetPrice', |
1082 | - fieldComponent: { disabled: true }, | |
1093 | + componentProps: { precision: 2 }, | |
1083 | 1094 | // rules: [{ required: true }], |
1084 | 1095 | }, |
1085 | 1096 | { |
1086 | 1097 | label: '汇率', |
1087 | 1098 | component: 'InputNumber', |
1088 | 1099 | field: 'exchangeRate', |
1089 | - fieldComponent: { disabled: true }, | |
1100 | + componentProps: { precision: 2 }, | |
1090 | 1101 | // rules: [{ required: true }], |
1091 | 1102 | }, |
1092 | 1103 | // { | ... | ... |