Commit 7458fc7c514e78e72d4219445be19aa3972083d9
Merge remote-tracking branch 'origin/bug_fix'
Showing
2 changed files
with
64 additions
and
5 deletions
src/pages/ehr/PhoneChargeAndSubsidy/subpages/SubsidyConfirm/components/ConfirmModal.tsx
... | ... | @@ -9,6 +9,7 @@ import { |
9 | 9 | import { message, Modal, Popover, Row, Select } from "antd"; |
10 | 10 | import { priceToThousands } from "@/utils/utils"; |
11 | 11 | import FeeweeFilterOption from "@/pages/notice/components/FeeweeFilterOption"; |
12 | +import moment from "moment"; | |
12 | 13 | |
13 | 14 | interface FilterItem { |
14 | 15 | value?: number; |
... | ... | @@ -22,11 +23,13 @@ export default function SubsidyConfirmModal() { |
22 | 23 | staffs?: FilterItem[]; |
23 | 24 | shops?: FilterItem[]; |
24 | 25 | posts?: FilterItem[]; |
26 | + standardAmounts?: FilterItem[]; | |
25 | 27 | }>({}); |
26 | 28 | const [filterValue, setFilterValue] = useState<{ |
27 | 29 | staffId?: number; |
28 | 30 | shopId?: number; |
29 | 31 | postId?: number; |
32 | + standardAmount?: number; | |
30 | 33 | }>({}); |
31 | 34 | |
32 | 35 | useEffect(() => { |
... | ... | @@ -53,7 +56,16 @@ export default function SubsidyConfirmModal() { |
53 | 56 | })) || [], |
54 | 57 | "value" |
55 | 58 | ); |
56 | - setFilters({ staffs, shops, posts }); | |
59 | + const standardAmounts = unique( | |
60 | + confirmModalInfo.value?.map((staff) => ({ | |
61 | + value: staff.standardAmount, | |
62 | + label: `${staff.standardAmount ?? "-"} 元`, | |
63 | + })) || [], | |
64 | + "value" | |
65 | + ); | |
66 | + setFilters({ staffs, shops, posts, standardAmounts }); | |
67 | + } else { | |
68 | + setFilterValue({}); | |
57 | 69 | } |
58 | 70 | }, [confirmModalInfo.open, confirmModalInfo.value]); |
59 | 71 | |
... | ... | @@ -112,7 +124,9 @@ export default function SubsidyConfirmModal() { |
112 | 124 | const onCancel = () => setConfirmModalInfo({ open: false }); |
113 | 125 | |
114 | 126 | const onOk = () => { |
115 | - const item = items.find((i) => checkNull(i.realAmount) && (i.selected ?? true)); | |
127 | + const item = items.find( | |
128 | + (i) => checkNull(i.realAmount) && (i.selected ?? true) | |
129 | + ); | |
116 | 130 | if (item) { |
117 | 131 | return message.warning(`${item.staffName} 的实际补贴不能为空`); |
118 | 132 | } |
... | ... | @@ -192,12 +206,35 @@ export default function SubsidyConfirmModal() { |
192 | 206 | ))} |
193 | 207 | </Select> |
194 | 208 | </FeeweeFilterOption> |
209 | + <FeeweeFilterOption title="补贴标准"> | |
210 | + <Select | |
211 | + allowClear | |
212 | + placeholder="选择补贴标准筛选" | |
213 | + style={{ minWidth: 260, marginRight: 10, marginBottom: 10 }} | |
214 | + value={filterValue.postId} | |
215 | + onChange={(standardAmount) => setFilterValue({ ...filterValue, standardAmount })} | |
216 | + showSearch | |
217 | + optionFilterProp="children" | |
218 | + > | |
219 | + {filters.standardAmounts?.map((standardAmount) => ( | |
220 | + <Select.Option | |
221 | + key={standardAmount.value} | |
222 | + value={standardAmount.value} | |
223 | + > | |
224 | + {standardAmount.label} | |
225 | + </Select.Option> | |
226 | + ))} | |
227 | + </Select> | |
228 | + </FeeweeFilterOption> | |
195 | 229 | </Row> |
196 | 230 | <EditTable |
197 | 231 | value={items.filter( |
198 | 232 | (i) => (filterValue.staffId ? i.staffId === filterValue.staffId : true) && |
199 | 233 | (filterValue.shopId ? i.shopId === filterValue.shopId : true) && |
200 | - (filterValue.postId ? i.postId === filterValue.postId : true) | |
234 | + (filterValue.postId ? i.postId === filterValue.postId : true) && | |
235 | + (!checkNull(filterValue.standardAmount) | |
236 | + ? i.standardAmount === filterValue.standardAmount | |
237 | + : true) | |
201 | 238 | )} |
202 | 239 | onChange={(items) => setItems(items || [])} |
203 | 240 | pagination={{ |
... | ... | @@ -244,6 +281,22 @@ export default function SubsidyConfirmModal() { |
244 | 281 | {record.postName || "-"} |
245 | 282 | </span> |
246 | 283 | </span> |
284 | + <span className="span_limit_1"> | |
285 | + <span style={{ color: "#999" }}>入职时间:</span> | |
286 | + <span style={{ color: "#333" }}> | |
287 | + {record.entryDate | |
288 | + ? moment(record.entryDate).format("YYYY-MM-DD") | |
289 | + : "-"} | |
290 | + </span> | |
291 | + </span> | |
292 | + <span className="span_limit_1"> | |
293 | + <span style={{ color: "#999" }}>转正时间:</span> | |
294 | + <span style={{ color: "#333" }}> | |
295 | + {record.regularDate | |
296 | + ? moment(record.regularDate).format("YYYY-MM-DD") | |
297 | + : "-"} | |
298 | + </span> | |
299 | + </span> | |
247 | 300 | </span> |
248 | 301 | ), |
249 | 302 | }, |
... | ... | @@ -283,7 +336,11 @@ export default function SubsidyConfirmModal() { |
283 | 336 | title: "补贴标准", |
284 | 337 | width: 150, |
285 | 338 | dataIndex: "standardAmount", |
286 | - render: (standardAmount: number) => priceToThousands(standardAmount), | |
339 | + sorter: ( | |
340 | + a: EHrSubsidyConfirm.TypeStaffVO, | |
341 | + b: EHrSubsidyConfirm.TypeStaffVO | |
342 | + ) => (a.standardAmount ?? -1) - (b.standardAmount ?? -1), | |
343 | + render: (standardAmount: number) => `${priceToThousands(standardAmount)} 元`, | |
287 | 344 | }, |
288 | 345 | { |
289 | 346 | title: "实际补贴", |
... | ... | @@ -292,7 +349,7 @@ export default function SubsidyConfirmModal() { |
292 | 349 | editable: true, |
293 | 350 | inputType: "number", |
294 | 351 | max: 999.99, |
295 | - render: (realAmount: number) => priceToThousands(realAmount), | |
352 | + render: (realAmount: number) => `${priceToThousands(realAmount)} 元`, | |
296 | 353 | }, |
297 | 354 | { |
298 | 355 | title: "备注", | ... | ... |
src/pages/ehr/PhoneChargeAndSubsidy/subpages/SubsidyConfirm/interface.d.ts
... | ... | @@ -90,6 +90,8 @@ declare namespace EHrSubsidyConfirm { |
90 | 90 | postName?: string; |
91 | 91 | shopId?: number; |
92 | 92 | shopName?: string; |
93 | + entryDate?: number; // 入职时间 | |
94 | + regularDate?: number; // 转正时间 | |
93 | 95 | workDays?: number; // 上班天数 |
94 | 96 | askForLeaveDays?: number; // 请假天数 |
95 | 97 | evectionDays?: number; // 出差天数 | ... | ... |