Commit 45673c129bb6a86ad431f5b31ff1a9d962438818

Authored by zhongnanhuang
1 parent 0eb3d08e

feat: update

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