Commit b14da0a60acee1720e5bcdf3faddbb38c7aee461
1 parent
2c532616
feat: 增加利润分析搜索
Showing
2 changed files
with
17 additions
and
6 deletions
src/views/project/order/ProfitAnalysis.vue
@@ -68,8 +68,10 @@ | @@ -68,8 +68,10 @@ | ||
68 | const activeRate = ref(); | 68 | const activeRate = ref(); |
69 | const profitType = ref('0'); | 69 | const profitType = ref('0'); |
70 | const info = ref({}); | 70 | const info = ref({}); |
71 | + const searchData = ref(); | ||
71 | const [register, { setModalProps, redoModalHeight }] = useModalInner(async (data) => { | 72 | const [register, { setModalProps, redoModalHeight }] = useModalInner(async (data) => { |
72 | orderIds.value = toRaw(data.data); | 73 | orderIds.value = toRaw(data.data); |
74 | + searchData.value = data.searchData; | ||
73 | info.value = {}; | 75 | info.value = {}; |
74 | }); | 76 | }); |
75 | 77 | ||
@@ -92,15 +94,23 @@ | @@ -92,15 +94,23 @@ | ||
92 | { | 94 | { |
93 | field: 'packetTotalPrice', | 95 | field: 'packetTotalPrice', |
94 | label: '包装费用', | 96 | label: '包装费用', |
95 | - show: isTracker, | ||
96 | render: (val) => '$' + (val || 0).toFixed(2), | 97 | render: (val) => '$' + (val || 0).toFixed(2), |
97 | }, | 98 | }, |
98 | { | 99 | { |
99 | field: 'profitRate', | 100 | field: 'profitRate', |
100 | label: '总利润率', | 101 | label: '总利润率', |
101 | - show: isTracker, | ||
102 | render: (val) => (Number(val || 0) * 100).toFixed(2) + '%', | 102 | render: (val) => (Number(val || 0) * 100).toFixed(2) + '%', |
103 | }, | 103 | }, |
104 | + { | ||
105 | + field: 'orderTotalNum', | ||
106 | + label: '订单总数', | ||
107 | + render: (val) => val || 0, | ||
108 | + }, | ||
109 | + { | ||
110 | + field: 'recordNum', | ||
111 | + label: '记录数', | ||
112 | + render: (val) => val || 0, | ||
113 | + }, | ||
104 | ]; | 114 | ]; |
105 | 115 | ||
106 | watch( | 116 | watch( |
@@ -142,6 +152,7 @@ | @@ -142,6 +152,7 @@ | ||
142 | orderIds: orderIds.value, | 152 | orderIds: orderIds.value, |
143 | profitType: profitType.value, | 153 | profitType: profitType.value, |
144 | exchangeRate: activeRate.value, | 154 | exchangeRate: activeRate.value, |
155 | + queryVO: searchData.value, | ||
145 | }); | 156 | }); |
146 | info.value = { | 157 | info.value = { |
147 | ...(res || {}), | 158 | ...(res || {}), |
src/views/project/order/index.vue
@@ -84,10 +84,7 @@ | @@ -84,10 +84,7 @@ | ||
84 | <template #toolbar> | 84 | <template #toolbar> |
85 | <a-button type="primary" @click="handleRateModal">比重计算</a-button> | 85 | <a-button type="primary" @click="handleRateModal">比重计算</a-button> |
86 | <a-button type="primary" @click="handleExportModal">导出</a-button> | 86 | <a-button type="primary" @click="handleExportModal">导出</a-button> |
87 | - <a-button | ||
88 | - type="primary" | ||
89 | - @click="handleProfitModal" | ||
90 | - :disabled="!checkedKeys.length || role === ROLE.TRACKER" | 87 | + <a-button type="primary" @click="handleProfitModal" :disabled="role === ROLE.TRACKER" |
91 | >分析利润</a-button | 88 | >分析利润</a-button |
92 | > | 89 | > |
93 | <a-button | 90 | <a-button |
@@ -246,8 +243,11 @@ | @@ -246,8 +243,11 @@ | ||
246 | } | 243 | } |
247 | 244 | ||
248 | function handleProfitModal() { | 245 | function handleProfitModal() { |
246 | + const form = getForm(); | ||
247 | + const values = form.getFieldsValue(); | ||
249 | openProfitModal(true, { | 248 | openProfitModal(true, { |
250 | data: checkedKeys.value, | 249 | data: checkedKeys.value, |
250 | + searchData: values, | ||
251 | }); | 251 | }); |
252 | } | 252 | } |
253 | 253 |