Commit 7755761528e7ba4794ae1b3c05a4afcb2971039c
Merge branch 'znh' into develop
Showing
3 changed files
with
176 additions
and
129 deletions
src/pages/Order/components/DeliverModal.tsx
... | ... | @@ -208,7 +208,6 @@ const DeliverModal = ({ |
208 | 208 | footer={[ |
209 | 209 | <Button |
210 | 210 | key="back" |
211 | - size="large" | |
212 | 211 | onClick={() => { |
213 | 212 | setVisible(false); |
214 | 213 | }} |
... | ... | @@ -218,7 +217,6 @@ const DeliverModal = ({ |
218 | 217 | <Button |
219 | 218 | key="selfDeliver" |
220 | 219 | type="primary" |
221 | - size="large" | |
222 | 220 | onClick={async () => { |
223 | 221 | //请求体封装 |
224 | 222 | let list = data.map((item) => { |
... | ... | @@ -253,7 +251,6 @@ const DeliverModal = ({ |
253 | 251 | <Button |
254 | 252 | key="submit" |
255 | 253 | type="primary" |
256 | - size="large" | |
257 | 254 | onClick={async () => { |
258 | 255 | //请求体封装 |
259 | 256 | let list = data.map((item) => { | ... | ... |
src/pages/Order/index.tsx
... | ... | @@ -25,8 +25,13 @@ import { |
25 | 25 | } from '@/utils'; |
26 | 26 | import { |
27 | 27 | getReceivingCompanyOptions, |
28 | + isAdmin, | |
28 | 29 | isExaminer, |
30 | + isFinance, | |
31 | + isProcure, | |
32 | + isSales, | |
29 | 33 | isSupplier, |
34 | + isWarehousekeeper, | |
30 | 35 | } from '@/utils/order'; |
31 | 36 | import { getUserInfo } from '@/utils/user'; |
32 | 37 | import { |
... | ... | @@ -871,110 +876,6 @@ const OrderPage = () => { |
871 | 876 | 参数:{optRecord.parameters} |
872 | 877 | </span> |
873 | 878 | </div> |
874 | - | |
875 | - <Flex title={optRecord.notes}> | |
876 | - <div | |
877 | - className="max-w-[375px] whitespace-no-wrap overflow-hidden overflow-ellipsis hover:cursor-pointer" | |
878 | - onClick={() => { | |
879 | - copyToClipboard(optRecord.notes); | |
880 | - message.info('备注复制成功:' + optRecord.notes); | |
881 | - }} | |
882 | - > | |
883 | - <span className="text-[#8C8C8C]"> | |
884 | - 备注: | |
885 | - {optRecord.notes === null ? '暂无备注' : optRecord.notes} | |
886 | - </span> | |
887 | - </div> | |
888 | - {!isSupplier() ? ( | |
889 | - <EditTwoTone | |
890 | - className="pl-1 hover:curcor-pointer" | |
891 | - onClick={() => { | |
892 | - setNotesEditVisible(true); | |
893 | - setSelectedRows([optRecord.id]); | |
894 | - setNotes(optRecord.notes); | |
895 | - setNotesType(1); | |
896 | - }} | |
897 | - /> | |
898 | - ) : ( | |
899 | - '' | |
900 | - )} | |
901 | - </Flex> | |
902 | - | |
903 | - {(roleCode === 'procure' || | |
904 | - roleCode === 'warehouseKeeper' || | |
905 | - roleCode === 'admin') && | |
906 | - !isSupplier() ? ( | |
907 | - <> | |
908 | - <Flex title={optRecord.supplierName}> | |
909 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
910 | - <span className="text-[#8C8C8C]"> | |
911 | - 所属采购: | |
912 | - {optRecord.supplierName === null | |
913 | - ? '暂无' | |
914 | - : optRecord.supplierName} | |
915 | - </span> | |
916 | - </div> | |
917 | - | |
918 | - <Divider type="vertical" /> | |
919 | - | |
920 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
921 | - <span className="text-[#8C8C8C]"> | |
922 | - 采购备注: | |
923 | - {optRecord.procureNotes === null | |
924 | - ? '暂无备注' | |
925 | - : optRecord.procureNotes} | |
926 | - </span> | |
927 | - </div> | |
928 | - {/* 编辑备注按钮 */} | |
929 | - <EditTwoTone | |
930 | - className="pl-1 hover:curcor-pointer" | |
931 | - onClick={() => { | |
932 | - setSelectedRows([optRecord.id]); | |
933 | - setNotes(optRecord.procureNotes); | |
934 | - setNotesEditVisible(true); | |
935 | - setNotesType(2); | |
936 | - }} | |
937 | - /> | |
938 | - </Flex> | |
939 | - | |
940 | - <Flex title={optRecord.supplierNotes}> | |
941 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
942 | - <span className="text-[#8C8C8C]"> | |
943 | - 供应商备注: | |
944 | - {optRecord.supplierNotes === null | |
945 | - ? '暂无备注' | |
946 | - : optRecord.supplierNotes} | |
947 | - </span> | |
948 | - </div> | |
949 | - {/* 编辑备注按钮 */} | |
950 | - <EditTwoTone | |
951 | - className="pl-1 hover:curcor-pointer" | |
952 | - onClick={() => { | |
953 | - setSelectedRows([optRecord.id]); | |
954 | - setNotes(optRecord.supplierNotes); | |
955 | - setNotesEditVisible(true); | |
956 | - setNotesType(3); | |
957 | - }} | |
958 | - /> | |
959 | - </Flex> | |
960 | - </> | |
961 | - ) : ( | |
962 | - '' | |
963 | - )} | |
964 | - | |
965 | - {/* {optRecord.applyInvoicingNotes !== undefined && | |
966 | - optRecord.applyInvoicingNotes !== null ? ( | |
967 | - <Flex title={optRecord.notes}> | |
968 | - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
969 | - <span className="text-[#8C8C8C]"> | |
970 | - 开票备注: | |
971 | - {optRecord.applyInvoicingNotes} | |
972 | - </span> | |
973 | - </div> | |
974 | - </Flex> | |
975 | - ) : ( | |
976 | - '' | |
977 | - )} */} | |
978 | 879 | </Flex> |
979 | 880 | <Flex className="w-[13%]" vertical gap="small"> |
980 | 881 | {!isSupplier() ? ( |
... | ... | @@ -1941,11 +1842,98 @@ const OrderPage = () => { |
1941 | 1842 | </Flex> |
1942 | 1843 | </Flex> |
1943 | 1844 | |
1944 | - {roleCode === 'admin' || | |
1945 | - roleCode === 'salesManager' || | |
1946 | - roleCode === 'salesRepresentative' || | |
1947 | - roleCode === 'finance' ? ( | |
1948 | - <Flex title={optRecord.notes}> | |
1845 | + <Flex title={optRecord.notes}> | |
1846 | + <div | |
1847 | + className="overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer" | |
1848 | + onClick={() => { | |
1849 | + copyToClipboard(optRecord.notes); | |
1850 | + message.info('备注复制成功:' + optRecord.notes); | |
1851 | + }} | |
1852 | + > | |
1853 | + <span className="text-[#8C8C8C]"> | |
1854 | + 备注: | |
1855 | + {optRecord.notes === null ? '暂无备注' : optRecord.notes} | |
1856 | + </span> | |
1857 | + </div> | |
1858 | + {!isSupplier() && (isSales() || isWarehousekeeper() || isAdmin()) && ( | |
1859 | + <EditTwoTone | |
1860 | + className="pl-1 pr-1 hover:curcor-pointer" | |
1861 | + onClick={() => { | |
1862 | + setNotesEditVisible(true); | |
1863 | + setSelectedRows([optRecord.id]); | |
1864 | + setNotes(optRecord.notes); | |
1865 | + setNotesType(1); | |
1866 | + }} | |
1867 | + /> | |
1868 | + )} | |
1869 | + </Flex> | |
1870 | + | |
1871 | + {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) && | |
1872 | + !isSupplier() ? ( | |
1873 | + <div className="pt-2"> | |
1874 | + <Flex title={optRecord.supplierName}> | |
1875 | + <div> | |
1876 | + <span className="text-[#8C8C8C]"> | |
1877 | + 所属采购: | |
1878 | + {optRecord.supplierName === null | |
1879 | + ? '暂无' | |
1880 | + : optRecord.supplierName} | |
1881 | + </span> | |
1882 | + </div> | |
1883 | + | |
1884 | + <Divider type="vertical" /> | |
1885 | + | |
1886 | + <div className="overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer"> | |
1887 | + <span className="text-[#8C8C8C]"> | |
1888 | + 采购备注: | |
1889 | + {optRecord.procureNotes === null | |
1890 | + ? '暂无备注' | |
1891 | + : optRecord.procureNotes} | |
1892 | + </span> | |
1893 | + </div> | |
1894 | + {/* 编辑备注按钮 */} | |
1895 | + {(isProcure() || isAdmin()) && ( | |
1896 | + <EditTwoTone | |
1897 | + className="pl-1 pr-1 hover:curcor-pointer" | |
1898 | + onClick={() => { | |
1899 | + setSelectedRows([optRecord.id]); | |
1900 | + setNotes(optRecord.procureNotes); | |
1901 | + setNotesEditVisible(true); | |
1902 | + setNotesType(2); | |
1903 | + }} | |
1904 | + /> | |
1905 | + )} | |
1906 | + </Flex> | |
1907 | + | |
1908 | + {(isAdmin() || isProcure()) && ( | |
1909 | + <Flex title={optRecord.supplierNotes}> | |
1910 | + <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis"> | |
1911 | + <span className="text-[#8C8C8C]"> | |
1912 | + 供应商备注: | |
1913 | + {optRecord.supplierNotes === null | |
1914 | + ? '暂无备注' | |
1915 | + : optRecord.supplierNotes} | |
1916 | + </span> | |
1917 | + </div> | |
1918 | + {/* 编辑备注按钮 */} | |
1919 | + <EditTwoTone | |
1920 | + className="pl-1 hover:curcor-pointer" | |
1921 | + onClick={() => { | |
1922 | + setSelectedRows([optRecord.id]); | |
1923 | + setNotes(optRecord.supplierNotes); | |
1924 | + setNotesEditVisible(true); | |
1925 | + setNotesType(3); | |
1926 | + }} | |
1927 | + /> | |
1928 | + </Flex> | |
1929 | + )} | |
1930 | + </div> | |
1931 | + ) : ( | |
1932 | + '' | |
1933 | + )} | |
1934 | + | |
1935 | + {isAdmin() || isSales() || isFinance() ? ( | |
1936 | + <Flex title={optRecord.notes} className="pt-2"> | |
1949 | 1937 | <div className="flex items-center"> |
1950 | 1938 | <div className="flex items-center max-w-[500px]"> |
1951 | 1939 | <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
... | ... | @@ -2206,22 +2194,19 @@ const OrderPage = () => { |
2206 | 2194 | }} |
2207 | 2195 | > |
2208 | 2196 | <span className="text-[#8C8C8C]">收货人:</span> |
2197 | + {!isSupplier() && ( | |
2198 | + <Tooltip className="order-tooltip" title="详情"> | |
2199 | + <ContainerTwoTone | |
2200 | + className="px-1 hover:curcor-pointer" | |
2201 | + onClick={() => { | |
2202 | + createOptObject(null, record.id); | |
2203 | + setDeliverInfoDrawerVisible(true); | |
2204 | + }} | |
2205 | + /> | |
2206 | + </Tooltip> | |
2207 | + )} | |
2209 | 2208 | <span className="text-slate-700"> |
2210 | 2209 | {record.customerName + ' '} |
2211 | - | |
2212 | - {!isSupplier() ? ( | |
2213 | - <Tooltip className="order-tooltip" title="详情"> | |
2214 | - <ContainerTwoTone | |
2215 | - className="hover:curcor-pointer" | |
2216 | - onClick={() => { | |
2217 | - createOptObject(null, record.id); | |
2218 | - setDeliverInfoDrawerVisible(true); | |
2219 | - }} | |
2220 | - /> | |
2221 | - </Tooltip> | |
2222 | - ) : ( | |
2223 | - '' | |
2224 | - )} | |
2225 | 2210 | </span> |
2226 | 2211 | </span> |
2227 | 2212 | </div> |
... | ... | @@ -2297,7 +2282,7 @@ const OrderPage = () => { |
2297 | 2282 | |
2298 | 2283 | <div title={record.notes}> |
2299 | 2284 | <div |
2300 | - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer" | |
2285 | + className="max-w-[850px] whitespace-normal overflow-hidden overflow-ellipsis hover:cursor-pointer" | |
2301 | 2286 | onClick={() => { |
2302 | 2287 | copyToClipboard(record.notes); |
2303 | 2288 | message.info('备注复制成功:' + record.notes); |
... | ... | @@ -3570,6 +3555,29 @@ const OrderPage = () => { |
3570 | 3555 | } |
3571 | 3556 | |
3572 | 3557 | /** |
3558 | + * 排除采购 | |
3559 | + */ | |
3560 | + if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) { | |
3561 | + mainOrdersColumns.push({ | |
3562 | + title: '采购排除', | |
3563 | + width: 120, | |
3564 | + dataIndex: 'excludeProcureNames', | |
3565 | + fieldProps: { | |
3566 | + mode: 'multiple', | |
3567 | + }, | |
3568 | + valueType: 'select', | |
3569 | + request: async () => { | |
3570 | + const res = await postServiceOrderProvideProcurementRoles(); | |
3571 | + let options = res.data?.map((item) => { | |
3572 | + return { label: item, value: item }; | |
3573 | + }); | |
3574 | + return options; | |
3575 | + }, | |
3576 | + hideInTable: true, | |
3577 | + }); | |
3578 | + } | |
3579 | + | |
3580 | + /** | |
3573 | 3581 | * 仓库可以筛选发货仓库 |
3574 | 3582 | */ |
3575 | 3583 | if (roleCode === 'warehouseKeeper' || roleCode === 'admin') { | ... | ... |
src/utils/order.ts
... | ... | @@ -9,7 +9,7 @@ export function getReceivingCompanyOptions(PAYEE_OPTIONS: any) { |
9 | 9 | export function isSupplier() { |
10 | 10 | let userInfo = getUserInfo(); |
11 | 11 | if (userInfo) { |
12 | - return ['首能', '枭源'].includes(userInfo.username); | |
12 | + return ['首能', '枭源'].includes(userInfo?.username); | |
13 | 13 | } |
14 | 14 | return false; |
15 | 15 | } |
... | ... | @@ -17,7 +17,49 @@ export function isSupplier() { |
17 | 17 | export function isExaminer() { |
18 | 18 | let userInfo = getUserInfo(); |
19 | 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 | 64 | return false; |
23 | 65 | } | ... | ... |