Commit b14da0a60acee1720e5bcdf3faddbb38c7aee461

Authored by sanmu
1 parent 2c532616

feat: 增加利润分析搜索

src/views/project/order/ProfitAnalysis.vue
... ... @@ -68,8 +68,10 @@
68 68 const activeRate = ref();
69 69 const profitType = ref('0');
70 70 const info = ref({});
  71 + const searchData = ref();
71 72 const [register, { setModalProps, redoModalHeight }] = useModalInner(async (data) => {
72 73 orderIds.value = toRaw(data.data);
  74 + searchData.value = data.searchData;
73 75 info.value = {};
74 76 });
75 77  
... ... @@ -92,15 +94,23 @@
92 94 {
93 95 field: 'packetTotalPrice',
94 96 label: '包装费用',
95   - show: isTracker,
96 97 render: (val) => '$' + (val || 0).toFixed(2),
97 98 },
98 99 {
99 100 field: 'profitRate',
100 101 label: '总利润率',
101   - show: isTracker,
102 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 116 watch(
... ... @@ -142,6 +152,7 @@
142 152 orderIds: orderIds.value,
143 153 profitType: profitType.value,
144 154 exchangeRate: activeRate.value,
  155 + queryVO: searchData.value,
145 156 });
146 157 info.value = {
147 158 ...(res || {}),
... ...
src/views/project/order/index.vue
... ... @@ -84,10 +84,7 @@
84 84 <template #toolbar>
85 85 <a-button type="primary" @click="handleRateModal">比重计算</a-button>
86 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 88 >分析利润</a-button
92 89 >
93 90 <a-button
... ... @@ -246,8 +243,11 @@
246 243 }
247 244  
248 245 function handleProfitModal() {
  246 + const form = getForm();
  247 + const values = form.getFieldsValue();
249 248 openProfitModal(true, {
250 249 data: checkedKeys.value,
  250 + searchData: values,
251 251 });
252 252 }
253 253  
... ...