Commit de64c07ce292073ea70e9cc2f73cc5953235b045
Merge branch 'znh' of http://39.108.227.113:8001/zhusen/canrd-erp-front into znh
# Conflicts: # src/pages/Order/index.tsx
Showing
4 changed files
with
212 additions
and
166 deletions
src/pages/Order/components/DeliverModal.tsx
@@ -208,7 +208,6 @@ const DeliverModal = ({ | @@ -208,7 +208,6 @@ const DeliverModal = ({ | ||
208 | footer={[ | 208 | footer={[ |
209 | <Button | 209 | <Button |
210 | key="back" | 210 | key="back" |
211 | - size="large" | ||
212 | onClick={() => { | 211 | onClick={() => { |
213 | setVisible(false); | 212 | setVisible(false); |
214 | }} | 213 | }} |
@@ -218,7 +217,6 @@ const DeliverModal = ({ | @@ -218,7 +217,6 @@ const DeliverModal = ({ | ||
218 | <Button | 217 | <Button |
219 | key="selfDeliver" | 218 | key="selfDeliver" |
220 | type="primary" | 219 | type="primary" |
221 | - size="large" | ||
222 | onClick={async () => { | 220 | onClick={async () => { |
223 | //请求体封装 | 221 | //请求体封装 |
224 | let list = data.map((item) => { | 222 | let list = data.map((item) => { |
@@ -253,7 +251,6 @@ const DeliverModal = ({ | @@ -253,7 +251,6 @@ const DeliverModal = ({ | ||
253 | <Button | 251 | <Button |
254 | key="submit" | 252 | key="submit" |
255 | type="primary" | 253 | type="primary" |
256 | - size="large" | ||
257 | onClick={async () => { | 254 | onClick={async () => { |
258 | //请求体封装 | 255 | //请求体封装 |
259 | let list = data.map((item) => { | 256 | let list = data.map((item) => { |
src/pages/Order/constant.ts
@@ -51,20 +51,20 @@ export const INVOCING_STATUS_OPTIONS_OLD = { | @@ -51,20 +51,20 @@ export const INVOCING_STATUS_OPTIONS_OLD = { | ||
51 | }; | 51 | }; |
52 | 52 | ||
53 | export const PAYEE_OPTIONS = { | 53 | export const PAYEE_OPTIONS = { |
54 | - ZHUGUANG_PUBLIC_ACCOUNT: '烛光公账', | ||
55 | - EXPERIMENT_PUBLIC_ACCOUNT: '实验公账', | ||
56 | - NEW_ENERGY_PUBLIC_ACCOUNT: '新能源公账', | ||
57 | - INNOVATION_PUBLIC_ACCOUNT: '创新公账', | ||
58 | - JIANTU_PUBLIC_ACCOUNT: '坚途公账', | ||
59 | - KNOWLEDGE_PUBLIC_ACCOUNT: '知识公账', | ||
60 | - ZHUGUANG_ACCEPTANCE_DRAFT: '烛光承兑汇票', | 54 | + ZHUGUANG_PUBLIC_ACCOUNT: '广东烛光新能源科技有限公司', |
55 | + EXPERIMENT_PUBLIC_ACCOUNT: '东莞市科路得实验器材科技有限公司', | ||
56 | + NEW_ENERGY_PUBLIC_ACCOUNT: '东莞市科路得新能源科技有限公司', | ||
57 | + INNOVATION_PUBLIC_ACCOUNT: '东莞科路得创新科技有限公司', | ||
58 | + JIANTU_PUBLIC_ACCOUNT: '东莞市坚途新材料科技有限公司', | ||
59 | + KNOWLEDGE_PUBLIC_ACCOUNT: '东莞市科路得知识产权代理有限公司', | ||
60 | + // ZHUGUANG_ACCEPTANCE_DRAFT: '烛光承兑汇票', | ||
61 | LIUPING_ACCOUNT: '刘平账户', | 61 | LIUPING_ACCOUNT: '刘平账户', |
62 | INNOVATION_ALIPAY: '创新支付宝', | 62 | INNOVATION_ALIPAY: '创新支付宝', |
63 | ZHUGUANG_ALIPAY: '烛光支付宝', | 63 | ZHUGUANG_ALIPAY: '烛光支付宝', |
64 | - ZHUGUANG_WISE_COLLECTION: '烛光慧收款', | ||
65 | - EXPERIMENT_QR_CODE: '实验二维码', | ||
66 | - INNOVATION_QR_CODE: '创新二维码', | ||
67 | - NEW_ENERGY_QR_CODE: '新能源二维码', | 64 | + // ZHUGUANG_WISE_COLLECTION: '烛光慧收款', |
65 | + // EXPERIMENT_QR_CODE: '实验二维码', | ||
66 | + // INNOVATION_QR_CODE: '创新二维码', | ||
67 | + // NEW_ENERGY_QR_CODE: '新能源二维码', | ||
68 | }; | 68 | }; |
69 | 69 | ||
70 | export const PROCURE_ORDER_STATUS = { | 70 | export const PROCURE_ORDER_STATUS = { |
src/pages/Order/index.tsx
@@ -26,8 +26,13 @@ import { | @@ -26,8 +26,13 @@ import { | ||
26 | } from '@/utils'; | 26 | } from '@/utils'; |
27 | import { | 27 | import { |
28 | getReceivingCompanyOptions, | 28 | getReceivingCompanyOptions, |
29 | + isAdmin, | ||
29 | isExaminer, | 30 | isExaminer, |
31 | + isFinance, | ||
32 | + isProcure, | ||
33 | + isSales, | ||
30 | isSupplier, | 34 | isSupplier, |
35 | + isWarehousekeeper, | ||
31 | } from '@/utils/order'; | 36 | } from '@/utils/order'; |
32 | import { getUserInfo } from '@/utils/user'; | 37 | import { getUserInfo } from '@/utils/user'; |
33 | import { | 38 | import { |
@@ -882,110 +887,6 @@ const OrderPage = () => { | @@ -882,110 +887,6 @@ const OrderPage = () => { | ||
882 | 参数:{optRecord.parameters} | 887 | 参数:{optRecord.parameters} |
883 | </span> | 888 | </span> |
884 | </div> | 889 | </div> |
885 | - | ||
886 | - <Flex title={optRecord.notes}> | ||
887 | - <div | ||
888 | - className="max-w-[375px] whitespace-no-wrap overflow-hidden overflow-ellipsis hover:cursor-pointer" | ||
889 | - onClick={() => { | ||
890 | - copyToClipboard(optRecord.notes); | ||
891 | - message.info('备注复制成功:' + optRecord.notes); | ||
892 | - }} | ||
893 | - > | ||
894 | - <span className="text-[#8C8C8C]"> | ||
895 | - 备注: | ||
896 | - {optRecord.notes === null ? '暂无备注' : optRecord.notes} | ||
897 | - </span> | ||
898 | - </div> | ||
899 | - {!isSupplier() ? ( | ||
900 | - <EditTwoTone | ||
901 | - className="pl-1 hover:curcor-pointer" | ||
902 | - onClick={() => { | ||
903 | - setNotesEditVisible(true); | ||
904 | - setSelectedRows([optRecord.id]); | ||
905 | - setNotes(optRecord.notes); | ||
906 | - setNotesType(1); | ||
907 | - }} | ||
908 | - /> | ||
909 | - ) : ( | ||
910 | - '' | ||
911 | - )} | ||
912 | - </Flex> | ||
913 | - | ||
914 | - {(roleCode === 'procure' || | ||
915 | - roleCode === 'warehouseKeeper' || | ||
916 | - roleCode === 'admin') && | ||
917 | - !isSupplier() ? ( | ||
918 | - <> | ||
919 | - <Flex title={optRecord.supplierName}> | ||
920 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
921 | - <span className="text-[#8C8C8C]"> | ||
922 | - 所属采购: | ||
923 | - {optRecord.supplierName === null | ||
924 | - ? '暂无' | ||
925 | - : optRecord.supplierName} | ||
926 | - </span> | ||
927 | - </div> | ||
928 | - | ||
929 | - <Divider type="vertical" /> | ||
930 | - | ||
931 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
932 | - <span className="text-[#8C8C8C]"> | ||
933 | - 采购备注: | ||
934 | - {optRecord.procureNotes === null | ||
935 | - ? '暂无备注' | ||
936 | - : optRecord.procureNotes} | ||
937 | - </span> | ||
938 | - </div> | ||
939 | - {/* 编辑备注按钮 */} | ||
940 | - <EditTwoTone | ||
941 | - className="pl-1 hover:curcor-pointer" | ||
942 | - onClick={() => { | ||
943 | - setSelectedRows([optRecord.id]); | ||
944 | - setNotes(optRecord.procureNotes); | ||
945 | - setNotesEditVisible(true); | ||
946 | - setNotesType(2); | ||
947 | - }} | ||
948 | - /> | ||
949 | - </Flex> | ||
950 | - | ||
951 | - <Flex title={optRecord.supplierNotes}> | ||
952 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
953 | - <span className="text-[#8C8C8C]"> | ||
954 | - 供应商备注: | ||
955 | - {optRecord.supplierNotes === null | ||
956 | - ? '暂无备注' | ||
957 | - : optRecord.supplierNotes} | ||
958 | - </span> | ||
959 | - </div> | ||
960 | - {/* 编辑备注按钮 */} | ||
961 | - <EditTwoTone | ||
962 | - className="pl-1 hover:curcor-pointer" | ||
963 | - onClick={() => { | ||
964 | - setSelectedRows([optRecord.id]); | ||
965 | - setNotes(optRecord.supplierNotes); | ||
966 | - setNotesEditVisible(true); | ||
967 | - setNotesType(3); | ||
968 | - }} | ||
969 | - /> | ||
970 | - </Flex> | ||
971 | - </> | ||
972 | - ) : ( | ||
973 | - '' | ||
974 | - )} | ||
975 | - | ||
976 | - {/* {optRecord.applyInvoicingNotes !== undefined && | ||
977 | - optRecord.applyInvoicingNotes !== null ? ( | ||
978 | - <Flex title={optRecord.notes}> | ||
979 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
980 | - <span className="text-[#8C8C8C]"> | ||
981 | - 开票备注: | ||
982 | - {optRecord.applyInvoicingNotes} | ||
983 | - </span> | ||
984 | - </div> | ||
985 | - </Flex> | ||
986 | - ) : ( | ||
987 | - '' | ||
988 | - )} */} | ||
989 | </Flex> | 890 | </Flex> |
990 | <Flex className="w-[13%]" vertical gap="small"> | 891 | <Flex className="w-[13%]" vertical gap="small"> |
991 | {!isSupplier() ? ( | 892 | {!isSupplier() ? ( |
@@ -2002,11 +1903,98 @@ const OrderPage = () => { | @@ -2002,11 +1903,98 @@ const OrderPage = () => { | ||
2002 | </Flex> | 1903 | </Flex> |
2003 | </Flex> | 1904 | </Flex> |
2004 | 1905 | ||
2005 | - {roleCode === 'admin' || | ||
2006 | - roleCode === 'salesManager' || | ||
2007 | - roleCode === 'salesRepresentative' || | ||
2008 | - roleCode === 'finance' ? ( | ||
2009 | - <Flex title={optRecord.notes}> | 1906 | + <Flex title={optRecord.notes}> |
1907 | + <div | ||
1908 | + className="overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer" | ||
1909 | + onClick={() => { | ||
1910 | + copyToClipboard(optRecord.notes); | ||
1911 | + message.info('备注复制成功:' + optRecord.notes); | ||
1912 | + }} | ||
1913 | + > | ||
1914 | + <span className="text-[#8C8C8C]"> | ||
1915 | + 备注: | ||
1916 | + {optRecord.notes === null ? '暂无备注' : optRecord.notes} | ||
1917 | + </span> | ||
1918 | + </div> | ||
1919 | + {!isSupplier() && (isSales() || isWarehousekeeper() || isAdmin()) && ( | ||
1920 | + <EditTwoTone | ||
1921 | + className="pl-1 pr-1 hover:curcor-pointer" | ||
1922 | + onClick={() => { | ||
1923 | + setNotesEditVisible(true); | ||
1924 | + setSelectedRows([optRecord.id]); | ||
1925 | + setNotes(optRecord.notes); | ||
1926 | + setNotesType(1); | ||
1927 | + }} | ||
1928 | + /> | ||
1929 | + )} | ||
1930 | + </Flex> | ||
1931 | + | ||
1932 | + {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) && | ||
1933 | + !isSupplier() ? ( | ||
1934 | + <div className="pt-2"> | ||
1935 | + <Flex title={optRecord.supplierName}> | ||
1936 | + <div> | ||
1937 | + <span className="text-[#8C8C8C]"> | ||
1938 | + 所属采购: | ||
1939 | + {optRecord.supplierName === null | ||
1940 | + ? '暂无' | ||
1941 | + : optRecord.supplierName} | ||
1942 | + </span> | ||
1943 | + </div> | ||
1944 | + | ||
1945 | + <Divider type="vertical" /> | ||
1946 | + | ||
1947 | + <div className="overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer"> | ||
1948 | + <span className="text-[#8C8C8C]"> | ||
1949 | + 采购备注: | ||
1950 | + {optRecord.procureNotes === null | ||
1951 | + ? '暂无备注' | ||
1952 | + : optRecord.procureNotes} | ||
1953 | + </span> | ||
1954 | + </div> | ||
1955 | + {/* 编辑备注按钮 */} | ||
1956 | + {(isProcure() || isAdmin()) && ( | ||
1957 | + <EditTwoTone | ||
1958 | + className="pl-1 pr-1 hover:curcor-pointer" | ||
1959 | + onClick={() => { | ||
1960 | + setSelectedRows([optRecord.id]); | ||
1961 | + setNotes(optRecord.procureNotes); | ||
1962 | + setNotesEditVisible(true); | ||
1963 | + setNotesType(2); | ||
1964 | + }} | ||
1965 | + /> | ||
1966 | + )} | ||
1967 | + </Flex> | ||
1968 | + | ||
1969 | + {(isAdmin() || isProcure()) && ( | ||
1970 | + <Flex title={optRecord.supplierNotes}> | ||
1971 | + <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | ||
1972 | + <span className="text-[#8C8C8C]"> | ||
1973 | + 供应商备注: | ||
1974 | + {optRecord.supplierNotes === null | ||
1975 | + ? '暂无备注' | ||
1976 | + : optRecord.supplierNotes} | ||
1977 | + </span> | ||
1978 | + </div> | ||
1979 | + {/* 编辑备注按钮 */} | ||
1980 | + <EditTwoTone | ||
1981 | + className="pl-1 hover:curcor-pointer" | ||
1982 | + onClick={() => { | ||
1983 | + setSelectedRows([optRecord.id]); | ||
1984 | + setNotes(optRecord.supplierNotes); | ||
1985 | + setNotesEditVisible(true); | ||
1986 | + setNotesType(3); | ||
1987 | + }} | ||
1988 | + /> | ||
1989 | + </Flex> | ||
1990 | + )} | ||
1991 | + </div> | ||
1992 | + ) : ( | ||
1993 | + '' | ||
1994 | + )} | ||
1995 | + | ||
1996 | + {isAdmin() || isSales() || isFinance() ? ( | ||
1997 | + <Flex title={optRecord.notes} className="pt-2"> | ||
2010 | <div className="flex items-center"> | 1998 | <div className="flex items-center"> |
2011 | <div className="flex items-center max-w-[500px]"> | 1999 | <div className="flex items-center max-w-[500px]"> |
2012 | <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis"> | 2000 | <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
@@ -2267,22 +2255,19 @@ const OrderPage = () => { | @@ -2267,22 +2255,19 @@ const OrderPage = () => { | ||
2267 | }} | 2255 | }} |
2268 | > | 2256 | > |
2269 | <span className="text-[#8C8C8C]">收货人:</span> | 2257 | <span className="text-[#8C8C8C]">收货人:</span> |
2258 | + {!isSupplier() && ( | ||
2259 | + <Tooltip className="order-tooltip" title="详情"> | ||
2260 | + <ContainerTwoTone | ||
2261 | + className="px-1 hover:curcor-pointer" | ||
2262 | + onClick={() => { | ||
2263 | + createOptObject(null, record.id); | ||
2264 | + setDeliverInfoDrawerVisible(true); | ||
2265 | + }} | ||
2266 | + /> | ||
2267 | + </Tooltip> | ||
2268 | + )} | ||
2270 | <span className="text-slate-700"> | 2269 | <span className="text-slate-700"> |
2271 | {record.customerName + ' '} | 2270 | {record.customerName + ' '} |
2272 | - | ||
2273 | - {!isSupplier() ? ( | ||
2274 | - <Tooltip className="order-tooltip" title="详情"> | ||
2275 | - <ContainerTwoTone | ||
2276 | - className="hover:curcor-pointer" | ||
2277 | - onClick={() => { | ||
2278 | - createOptObject(null, record.id); | ||
2279 | - setDeliverInfoDrawerVisible(true); | ||
2280 | - }} | ||
2281 | - /> | ||
2282 | - </Tooltip> | ||
2283 | - ) : ( | ||
2284 | - '' | ||
2285 | - )} | ||
2286 | </span> | 2271 | </span> |
2287 | </span> | 2272 | </span> |
2288 | </div> | 2273 | </div> |
@@ -2356,34 +2341,33 @@ const OrderPage = () => { | @@ -2356,34 +2341,33 @@ const OrderPage = () => { | ||
2356 | 2341 | ||
2357 | {roleCode === 'finance' ? <Divider type="vertical" /> : ''} | 2342 | {roleCode === 'finance' ? <Divider type="vertical" /> : ''} |
2358 | 2343 | ||
2344 | + <div title={record.notes}> | ||
2345 | + <div | ||
2346 | + className="max-w-[850px] whitespace-normal overflow-hidden overflow-ellipsis hover:cursor-pointer" | ||
2347 | + onClick={() => { | ||
2348 | + copyToClipboard(record.notes); | ||
2349 | + message.info('备注复制成功:' + record.notes); | ||
2350 | + }} | ||
2351 | + > | ||
2352 | + <span className="text-[#8C8C8C]">备注:</span> | ||
2353 | + <span className="ml-2"> | ||
2354 | + {record.notes === null ? '暂无备注' : record.notes} | ||
2355 | + </span> | ||
2356 | + </div> | ||
2357 | + </div> | ||
2358 | + | ||
2359 | {!isSupplier() ? ( | 2359 | {!isSupplier() ? ( |
2360 | - <> | ||
2361 | - <div title={record.notes}> | ||
2362 | - <div | ||
2363 | - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer" | ||
2364 | - onClick={() => { | ||
2365 | - copyToClipboard(record.notes); | ||
2366 | - message.info('备注复制成功:' + record.notes); | ||
2367 | - }} | ||
2368 | - > | ||
2369 | - <span className="text-[#8C8C8C]">备注:</span> | ||
2370 | - <span className="ml-2"> | ||
2371 | - {record.notes === null ? '暂无备注' : record.notes} | ||
2372 | - </span> | ||
2373 | - </div> | ||
2374 | - </div> | ||
2375 | - <Tooltip title="编辑"> | ||
2376 | - <EditTwoTone | ||
2377 | - className="pl-1 hover:curcor-pointer" | ||
2378 | - onClick={() => { | ||
2379 | - setNotesEditVisible(true); | ||
2380 | - setSelectedRows([record.id]); | ||
2381 | - setNotes(record.notes); | ||
2382 | - setNotesType(0); | ||
2383 | - }} | ||
2384 | - /> | ||
2385 | - </Tooltip> | ||
2386 | - </> | 2360 | + <Tooltip title="编辑"> |
2361 | + <EditTwoTone | ||
2362 | + className="pl-1 hover:curcor-pointer" | ||
2363 | + onClick={() => { | ||
2364 | + setNotesEditVisible(true); | ||
2365 | + setSelectedRows([record.id]); | ||
2366 | + setNotes(record.notes); | ||
2367 | + setNotesType(0); | ||
2368 | + }} | ||
2369 | + /> | ||
2370 | + </Tooltip> | ||
2387 | ) : ( | 2371 | ) : ( |
2388 | '' | 2372 | '' |
2389 | )} | 2373 | )} |
@@ -3666,6 +3650,29 @@ const OrderPage = () => { | @@ -3666,6 +3650,29 @@ const OrderPage = () => { | ||
3666 | } | 3650 | } |
3667 | 3651 | ||
3668 | /** | 3652 | /** |
3653 | + * 排除采购 | ||
3654 | + */ | ||
3655 | + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) { | ||
3656 | + mainOrdersColumns.push({ | ||
3657 | + title: '采购排除', | ||
3658 | + width: 120, | ||
3659 | + dataIndex: 'excludeProcureNames', | ||
3660 | + fieldProps: { | ||
3661 | + mode: 'multiple', | ||
3662 | + }, | ||
3663 | + valueType: 'select', | ||
3664 | + request: async () => { | ||
3665 | + const res = await postServiceOrderProvideProcurementRoles(); | ||
3666 | + let options = res.data?.map((item) => { | ||
3667 | + return { label: item, value: item }; | ||
3668 | + }); | ||
3669 | + return options; | ||
3670 | + }, | ||
3671 | + hideInTable: true, | ||
3672 | + }); | ||
3673 | + } | ||
3674 | + | ||
3675 | + /** | ||
3669 | * 仓库可以筛选发货仓库 | 3676 | * 仓库可以筛选发货仓库 |
3670 | */ | 3677 | */ |
3671 | if (roleCode === 'warehouseKeeper' || roleCode === 'admin') { | 3678 | if (roleCode === 'warehouseKeeper' || roleCode === 'admin') { |
src/utils/order.ts
@@ -9,7 +9,7 @@ export function getReceivingCompanyOptions(PAYEE_OPTIONS: any) { | @@ -9,7 +9,7 @@ export function getReceivingCompanyOptions(PAYEE_OPTIONS: any) { | ||
9 | export function isSupplier() { | 9 | export function isSupplier() { |
10 | let userInfo = getUserInfo(); | 10 | let userInfo = getUserInfo(); |
11 | if (userInfo) { | 11 | if (userInfo) { |
12 | - return ['首能', '枭源'].includes(userInfo.username); | 12 | + return ['首能', '枭源'].includes(userInfo?.username); |
13 | } | 13 | } |
14 | return false; | 14 | return false; |
15 | } | 15 | } |
@@ -17,7 +17,49 @@ export function isSupplier() { | @@ -17,7 +17,49 @@ export function isSupplier() { | ||
17 | export function isExaminer() { | 17 | export function isExaminer() { |
18 | let userInfo = getUserInfo(); | 18 | let userInfo = getUserInfo(); |
19 | if (userInfo) { | 19 | if (userInfo) { |
20 | - return userInfo.roleSmallVO?.code === 'examiner'; | 20 | + return ['examiner'].includes(userInfo?.roleSmallVO?.code); |
21 | + } | ||
22 | + return false; | ||
23 | +} | ||
24 | + | ||
25 | +export function isSales() { | ||
26 | + let userInfo = getUserInfo(); | ||
27 | + if (userInfo) { | ||
28 | + return ['salesRepresentative', 'salesManager'].includes( | ||
29 | + userInfo?.roleSmallVO?.code, | ||
30 | + ); | ||
31 | + } | ||
32 | + return false; | ||
33 | +} | ||
34 | + | ||
35 | +export function isProcure() { | ||
36 | + let userInfo = getUserInfo(); | ||
37 | + if (userInfo) { | ||
38 | + return ['procure'].includes(userInfo?.roleSmallVO?.code); | ||
39 | + } | ||
40 | + return false; | ||
41 | +} | ||
42 | + | ||
43 | +export function isWarehousekeeper() { | ||
44 | + let userInfo = getUserInfo(); | ||
45 | + if (userInfo) { | ||
46 | + return ['warehouseKeeper'].includes(userInfo?.roleSmallVO?.code); | ||
47 | + } | ||
48 | + return false; | ||
49 | +} | ||
50 | + | ||
51 | +export function isAdmin() { | ||
52 | + let userInfo = getUserInfo(); | ||
53 | + if (userInfo) { | ||
54 | + return ['admin'].includes(userInfo?.roleSmallVO?.code); | ||
55 | + } | ||
56 | + return false; | ||
57 | +} | ||
58 | + | ||
59 | +export function isFinance() { | ||
60 | + let userInfo = getUserInfo(); | ||
61 | + if (userInfo) { | ||
62 | + return ['finance'].includes(userInfo?.roleSmallVO?.code); | ||
21 | } | 63 | } |
22 | return false; | 64 | return false; |
23 | } | 65 | } |