Commit 45673c129bb6a86ad431f5b31ff1a9d962438818

Authored by zhongnanhuang
1 parent 0eb3d08e

feat: update

src/pages/Order/components/DeliverInfoDrawer.tsx
1 1 import { enumValueToLabel } from '@/utils';
2 2 import { getReceivingCompanyOptions } from '@/utils/order';
3 3 import { Col, Drawer, Row } from 'antd';
  4 +import { PAYEE_OPTIONS } from '../constant';
4 5  
5 6 export default ({ data, onClose }) => {
6 7 console.log(data);
... ... @@ -47,7 +48,7 @@ export default ({ data, onClose }) => {
47 48 <Col span={18}>
48 49 {enumValueToLabel(
49 50 data.receivingCompany,
50   - getReceivingCompanyOptions(),
  51 + getReceivingCompanyOptions(PAYEE_OPTIONS),
51 52 )}
52 53 </Col>
53 54  
... ...
src/pages/Order/components/FinancialDrawer.tsx
... ... @@ -168,7 +168,7 @@ export default ({
168 168 销售申请开票时选择了:
169 169 {enumValueToLabel(
170 170 subOrders[0].receivingCompany,
171   - getReceivingCompanyOptions(),
  171 + getReceivingCompanyOptions(PAYEE_OPTIONS),
172 172 )}
173 173 </span>
174 174 <span
... ...
src/pages/Order/constant.ts
... ... @@ -520,7 +520,9 @@ export const MAIN_ORDER_COLUMNS = [
520 520 dataIndex: 'receivingCompany',
521 521 valueType: 'select',
522 522 hideInTable: true,
523   - valueEnum: enumToProTableEnumValue(getReceivingCompanyOptions()),
  523 + valueEnum: enumToProTableEnumValue(
  524 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  525 + ),
524 526 },
525 527 {
526 528 title: '开票日期',
... ...
src/pages/Order/index.tsx
... ... @@ -77,6 +77,7 @@ import {
77 77 LOGISTICS_STATUS_OPTIONS,
78 78 MAIN_ORDER_COLUMNS,
79 79 ORDER_STATUS_OPTIONS,
  80 + PAYEE_OPTIONS,
80 81 PAYMENT_CHANNEL_OPTIONS,
81 82 PAYMENT_METHOD_OPTIONS,
82 83 PROCURE_ORDER_STATUS,
... ... @@ -146,6 +147,10 @@ const OrderPage = () =&gt; {
146 147 const [onlyShowCancelOrder, setOnlyShowCancelOrder] = useState(false);
147 148 const [onlyShowProcureToBeProcessed, setOnlyShowProcureToBeProcessed] =
148 149 useState(false);
  150 + const [
  151 + showCurrentLeaderNeedAuditOrders,
  152 + setShowCurrentLeaderNeedAuditOrders,
  153 + ] = useState(false);
149 154 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map
150 155 const [mainOrderSelectedRows, setMainOrderSelectedRows] = useState([]); //选中的主订单集合
151 156 const [onlyShowFinancialToBeProcessed, setOnlyShowFinancialToBeProcessed] =
... ... @@ -199,6 +204,11 @@ const OrderPage = () =&gt; {
199 204 refreshTable();
200 205 }
201 206  
  207 + function changeShowCurrentLeaderNeedAuditOrders(e: any) {
  208 + setShowCurrentLeaderNeedAuditOrders(e.target.checked);
  209 + refreshTable();
  210 + }
  211 +
202 212 function changeFinancialToBeProcessed(e: any) {
203 213 setOnlyShowFinancialToBeProcessed(e.target.checked);
204 214 refreshTable();
... ... @@ -1365,11 +1375,11 @@ const OrderPage = () =&gt; {
1365 1375 </Flex>
1366 1376 </Flex>
1367 1377 <Flex className="pl-6" align="center">
1368   - {userInfo.roleSmallVO.code === 'finance' ? (
  1378 + {userInfo?.roleSmallVO?.code === 'finance' ? (
1369 1379 <div
1370 1380 title={enumValueToLabel(
1371 1381 record.receivingCompany,
1372   - getReceivingCompanyOptions(),
  1382 + getReceivingCompanyOptions(PAYEE_OPTIONS),
1373 1383 )}
1374 1384 className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px]"
1375 1385 >
... ... @@ -1378,7 +1388,7 @@ const OrderPage = () =&gt; {
1378 1388 {record.receivingCompany !== null
1379 1389 ? enumValueToLabel(
1380 1390 record.receivingCompany,
1381   - getReceivingCompanyOptions(),
  1391 + getReceivingCompanyOptions(PAYEE_OPTIONS),
1382 1392 )
1383 1393 : '暂无'}
1384 1394 </span>
... ... @@ -1387,7 +1397,7 @@ const OrderPage = () =&gt; {
1387 1397 ''
1388 1398 )}
1389 1399  
1390   - {userInfo.roleSmallVO.code === 'finance' ? (
  1400 + {userInfo?.roleSmallVO?.code === 'finance' ? (
1391 1401 <Divider type="vertical" />
1392 1402 ) : (
1393 1403 ''
... ... @@ -1803,8 +1813,8 @@ const OrderPage = () =&gt; {
1803 1813 selectedSubOrders[index].orderStatus;
1804 1814 //仓库管理员在审核之后的任何时候都可以编辑
1805 1815 if (
1806   - userInfo.roleSmallVO.code !== 'warehouseKeeper' &&
1807   - userInfo.roleSmallVO.code !== 'admin'
  1816 + userInfo?.roleSmallVO?.code !== 'warehouseKeeper' &&
  1817 + userInfo?.roleSmallVO?.code !== 'admin'
1808 1818 ) {
1809 1819 //是审核通过及之后的订单
1810 1820 if (
... ... @@ -1820,7 +1830,7 @@ const OrderPage = () =&gt; {
1820 1830 } else {
1821 1831 //仓库管理员只能编辑是还未审核的订单
1822 1832 if (
1823   - userInfo.roleSmallVO.code !== 'admin' &&
  1833 + userInfo?.roleSmallVO?.code !== 'admin' &&
1824 1834 (orderStatus === 'UNAUDITED' ||
1825 1835 orderStatus === 'AUDIT_FAILED')
1826 1836 ) {
... ... @@ -2312,7 +2322,7 @@ const OrderPage = () =&gt; {
2312 2322 * 采购的订单状态筛选内容
2313 2323 */
2314 2324 if (
2315   - userInfo.roleSmallVO.code === 'procure' &&
  2325 + userInfo?.roleSmallVO?.code === 'procure' &&
2316 2326 item.dataIndex === 'orderStatus'
2317 2327 ) {
2318 2328 item.valueEnum = enumToProTableEnumValue(
... ... @@ -2357,12 +2367,24 @@ const OrderPage = () =&gt; {
2357 2367 toolBtns.push(
2358 2368 <Checkbox onChange={changeFinancialToBeProcessed}>排序</Checkbox>,
2359 2369 );
  2370 +
  2371 + toolBtns.push(
  2372 + <Checkbox onChange={changeShowCurrentLeaderNeedAuditOrders}>
  2373 + 待审核
  2374 + </Checkbox>,
  2375 + );
2360 2376 }
2361 2377  
2362 2378 if (roleCode === 'salesRepresentative' || roleCode === 'salesManager') {
2363 2379 toolBtns.push(
2364 2380 <Checkbox onChange={changeSalesCreateProcessed}>只看我创建</Checkbox>,
2365 2381 );
  2382 +
  2383 + toolBtns.push(
  2384 + <Checkbox onChange={changeShowCurrentLeaderNeedAuditOrders}>
  2385 + 待审核
  2386 + </Checkbox>,
  2387 + );
2366 2388 }
2367 2389  
2368 2390 if (roleCode === 'admin') {
... ... @@ -2672,6 +2694,10 @@ const OrderPage = () =&gt; {
2672 2694 if (onlyShowSalesCreateProcessed) {
2673 2695 params.condition = 30;
2674 2696 }
  2697 + //只看自己需要审核的订单
  2698 + if (showCurrentLeaderNeedAuditOrders) {
  2699 + params.condition = 40;
  2700 + }
2675 2701  
2676 2702 //是否只查看已作废
2677 2703 params.isDeleteQueryOrder = onlyShowCancelOrder;
... ...
src/utils/order.ts
1   -import { PAYEE_OPTIONS } from '@/pages/Order/constant';
2 1 import { cloneDeep } from 'lodash';
3   -import { enumToSelect } from '.';
4   -
5   -export function getReceivingCompanyOptions() {
6   - let payeeOprions = cloneDeep(PAYEE_OPTIONS);
7   - payeeOprions.ANY = '任意';
8   - return payeeOprions;
9   -}
10   -
11   -/**
12   - *
13   - * @returns 获取付款公司选项
14   - */
15   -export function getReceivingCompany() {
16   - let options = enumToSelect(getReceivingCompanyOptions());
17   - return options;
  2 +export function getReceivingCompanyOptions(PAYEE_OPTIONS: any) {
  3 + let payeeOptions = cloneDeep(PAYEE_OPTIONS);
  4 + payeeOptions.ANY = '任意';
  5 + return payeeOptions;
18 6 }
... ...