Commit 0eb3d08e299ab09830808d84a1a7ef604fbb6652

Authored by zhongnanhuang
1 parent 55a39af0

feat: update

src/pages/Order/components/ApplyForInvoicingModal.tsx
... ... @@ -3,8 +3,7 @@ import {
3 3 postServiceOrderApplyInvoicing,
4 4 postServiceOrderMergeApplyInvoicing,
5 5 } from '@/services';
6   -import { getAliYunOSSFileNameFromUrl } from '@/utils';
7   -import { getReceivingCompany } from '@/utils/order';
  6 +import { enumToSelect, getAliYunOSSFileNameFromUrl } from '@/utils';
8 7 import {
9 8 ModalForm,
10 9 ProFormSelect,
... ... @@ -13,6 +12,7 @@ import {
13 12 } from '@ant-design/pro-components';
14 13 import { Form, message } from 'antd';
15 14 import { cloneDeep } from 'lodash';
  15 +import { PAYEE_OPTIONS } from '../constant';
16 16 export default ({
17 17 setCheckVisible,
18 18 isEdit,
... ... @@ -168,20 +168,20 @@ export default ({
168 168 placeholder="请输入备注"
169 169 />
170 170 <ProFormSelect
171   - placeholder="选择付款公司"
  171 + placeholder="选择收款单位"
172 172 name="receivingCompany"
173 173 width="lg"
174 174 key="receivingCompany"
175 175 label={
176 176 <div>
177   - <span>开票付款公司</span>
  177 + <span>开票收款单位</span>
178 178 <span className="pl-2 text-xs text-gray-400">
179   - 财务开票将依据这个字段,选择对应的公司开票(若对[付款公司]没有要求,请选择[任意]
  179 + 财务开票将依据这个字段,选择对应的公司开票(若对[收款单位]没有要求,请任意选择一个
180 180 </span>
181 181 </div>
182 182 }
183   - options={getReceivingCompany()}
184   - rules={[{ required: true, message: '开票付款公司必填' }]}
  183 + options={enumToSelect(PAYEE_OPTIONS)}
  184 + rules={[{ required: true, message: '开票收款单位必填' }]}
185 185 />
186 186 <ProFormUploadDragger
187 187 key="2"
... ...
src/pages/Order/components/DeliverInfoDrawer.tsx
  1 +import { enumValueToLabel } from '@/utils';
  2 +import { getReceivingCompanyOptions } from '@/utils/order';
1 3 import { Col, Drawer, Row } from 'antd';
2 4  
3 5 export default ({ data, onClose }) => {
... ... @@ -40,9 +42,14 @@ export default ({ data, onClose }) =&gt; {
40 42 <Col span={18}>{data.bank}</Col>
41 43  
42 44 <Col span={6}>
43   - <span className="className='text-[#333333]'">开票付款公司</span>
  45 + <span className="className='text-[#333333]'">开票收款单位</span>
  46 + </Col>
  47 + <Col span={18}>
  48 + {enumValueToLabel(
  49 + data.receivingCompany,
  50 + getReceivingCompanyOptions(),
  51 + )}
44 52 </Col>
45   - <Col span={18}>{data.receivingCompany}</Col>
46 53  
47 54 <Col span={6}>
48 55 <span className="className='text-[#333333]'">银行账号</span>
... ...
src/pages/Order/components/FinancialDrawer.tsx
... ... @@ -4,7 +4,8 @@ import {
4 4 postServiceOrderEditOrder,
5 5 postServiceOrderInvoicing,
6 6 } from '@/services';
7   -import { enumToSelect } from '@/utils';
  7 +import { enumToSelect, enumValueToLabel } from '@/utils';
  8 +import { getReceivingCompanyOptions } from '@/utils/order';
8 9 import {
9 10 DrawerForm,
10 11 ProFormDatePicker,
... ... @@ -35,6 +36,15 @@ export default ({
35 36 }, [mainOrder]);
36 37  
37 38 const [form] = Form.useForm<{ name: string; company: string }>();
  39 +
  40 + /**
  41 + * 自动选择收款公司
  42 + * @param receivingCompany
  43 + */
  44 + function chooseReceivingCompany(receivingCompany: any) {
  45 + form.setFieldValue('payee', receivingCompany);
  46 + }
  47 +
38 48 return (
39 49 <DrawerForm<{
40 50 name: string;
... ... @@ -150,11 +160,35 @@ export default ({
150 160 initialValue={subOrders[0]?.invoiceNumber}
151 161 rules={[{ required: true, message: '发票号码必填' }]}
152 162 />,
  163 + <div
  164 + key="salesChooseReceivingCompany"
  165 + hidden={subOrders[0].receivingCompany === null}
  166 + >
  167 + <span className={'pl-2 text-xs text-gray-400'}>
  168 + 销售申请开票时选择了:
  169 + {enumValueToLabel(
  170 + subOrders[0].receivingCompany,
  171 + getReceivingCompanyOptions(),
  172 + )}
  173 + </span>
  174 + <span
  175 + hidden={subOrders[0].receivingCompany === 'ANY'}
  176 + className={
  177 + 'pl-2 text-xs text-[#1677ff] cursor-pointer hover:text-[#64abf7]'
  178 + }
  179 + onClick={() => {
  180 + chooseReceivingCompany(subOrders[0].receivingCompany);
  181 + }}
  182 + >
  183 + 选择
  184 + </span>
  185 + </div>,
153 186 <ProFormSelect
154 187 key="payee"
155 188 placeholder="选择收款单位"
156 189 name="payee"
157 190 width="lg"
  191 + showSearch
158 192 label="收款单位"
159 193 options={enumToSelect(PAYEE_OPTIONS)}
160 194 initialValue={subOrders[0]?.payee}
... ...
src/pages/Order/components/FinancialMergeDrawer.tsx
... ... @@ -141,7 +141,6 @@ export default ({ dataList, setVisible, onClose }) =&gt; {
141 141 { label: '部分开票', value: 'PARTIAL_INVOICING' },
142 142 ]}
143 143 initialValue={'COMPLETE_INVOICING'}
144   - disabled
145 144 />
146 145 <ProFormTextArea width="lg" name="invoicingNotes" label="备注" />
147 146 </DrawerForm>
... ...
src/pages/Order/components/OrderDrawer.tsx
... ... @@ -19,7 +19,6 @@ import {
19 19 getUserInfo,
20 20 } from '@/utils';
21 21 import { getTeacherCustomFieldNumber } from '@/utils/kingdee';
22   -import { getReceivingCompany } from '@/utils/order';
23 22 import {
24 23 DrawerForm,
25 24 FormListActionType,
... ... @@ -39,6 +38,7 @@ import {
39 38 AFTE_SALES_PLAN_OPTIONS,
40 39 INVOCING_STATUS_OPTIONS,
41 40 INVOCING_STATUS_OPTIONS_OLD,
  41 + PAYEE_OPTIONS,
42 42 PAYMENT_CHANNEL_OPTIONS,
43 43 PAYMENT_METHOD_OPTIONS,
44 44 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
... ... @@ -740,6 +740,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
740 740 width="lg"
741 741 showSearch
742 742 disabled={optType('after-sales-check')}
  743 + tooltip="空格将作为或条件。例如输入[北京 广东],那么查找出来的将是包含[北京]或者包含[广东]的搜索结果"
743 744 label={
744 745 <>
745 746 <span>客户</span>
... ... @@ -782,6 +783,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
782 783 id: copyData?.customerId,
783 784 }}
784 785 fieldProps={{
  786 + filterOption() {
  787 + return true;
  788 + },
785 789 optionItemRender(item) {
786 790 if (item.type === 'add') {
787 791 return (
... ... @@ -838,6 +842,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
838 842 key: keywords,
839 843 });
840 844 }
  845 +
  846 + console.log(options);
841 847 return options;
842 848 }}
843 849 />
... ... @@ -957,18 +963,19 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
957 963 />
958 964  
959 965 <ProFormSelect
960   - placeholder="付款公司"
  966 + placeholder="收款单位"
961 967 name="receivingCompany"
962 968 width="lg"
963 969 key="receivingCompany"
964   - label="开票付款公司"
  970 + showSearch
  971 + label="开票收款单位"
965 972 tooltip="财务开票将依据这个字段,选择对应的公司开票"
966   - options={getReceivingCompany()}
  973 + options={enumToSelect(PAYEE_OPTIONS)}
967 974 disabled={optType('after-sales-check')}
968 975 hidden={invoicingStatus === 'UN_INVOICE'}
969 976 />
970 977  
971   - <ProFormText
  978 + <ProFormTextArea
972 979 width="lg"
973 980 name="invoiceIdentificationNumber"
974 981 label="开票信息"
... ... @@ -1098,6 +1105,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1098 1105 name="productName"
1099 1106 disabled={optType('after-sales-check')}
1100 1107 placeholder="请搜索商品"
  1108 + tooltip="空格将作为或条件。例如输入[极片 电池],那么查找出来的将是包含[极片]或者包含[电池]的搜索结果"
1101 1109 rules={[{ required: true, message: '商品名称必填' }]}
1102 1110 onChange={(_, option) => {
1103 1111 autoFillProductInfo(option, listMeta, listMeta.index);
... ... @@ -1107,6 +1115,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1107 1115 value: listMeta?.record?.materialId,
1108 1116 }}
1109 1117 fieldProps={{
  1118 + filterOption() {
  1119 + return true;
  1120 + },
1110 1121 optionItemRender(item) {
1111 1122 if (item.type === 'add') {
1112 1123 return (
... ...
src/pages/Order/components/ProcureCheckModal.tsx
... ... @@ -113,12 +113,12 @@ export default ({ setCheckVisible, data, subOrders, onClose }) =&gt; {
113 113 >
114 114 <ProFormSelect
115 115 key="key"
116   - label="供应商名称"
  116 + label="采购名称"
117 117 width="lg"
118 118 name="name"
119 119 // options={options}
120   - placeholder="请选择供应商"
121   - rules={[{ required: true, message: '供应商必填' }]}
  120 + placeholder="请选择采购"
  121 + rules={[{ required: true, message: '采购名称必填' }]}
122 122 request={async () => {
123 123 const res = await postServiceOrderQuerySupplier();
124 124 let options = res.data?.map((item) => {
... ...
src/pages/Order/components/ProcureConvertModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2 2 import {
3 3 postServiceOrderProcureConvertProcure,
  4 + postServiceOrderProcureConvertWarehouseKeeper,
4 5 postServiceOrderProvideProcurementRoles,
5 6 } from '@/services';
6 7 import {
... ... @@ -50,13 +51,25 @@ export default ({ setVisible, subOrders, onClose }) =&gt; {
50 51 }}
51 52 submitTimeout={2000}
52 53 onFinish={async (values) => {
53   - const data = await postServiceOrderProcureConvertProcure({
54   - data: {
55   - procureName: values.procureName,
56   - procureConvertNotes: values.procureConvertNotes,
57   - subIds: subOrderIds,
58   - },
59   - });
  54 + let data;
  55 + if (values.procureName === 'warehouseKeeper') {
  56 + //转给仓库
  57 + data = await postServiceOrderProcureConvertWarehouseKeeper({
  58 + data: {
  59 + subIds: subOrderIds,
  60 + checkNotes: values.procureConvertNotes,
  61 + },
  62 + });
  63 + } else {
  64 + data = await postServiceOrderProcureConvertProcure({
  65 + data: {
  66 + procureName: values.procureName,
  67 + procureConvertNotes: values.procureConvertNotes,
  68 + subIds: subOrderIds,
  69 + },
  70 + });
  71 + }
  72 +
60 73 if (data.result === RESPONSE_CODE.SUCCESS) {
61 74 message.success(data.message);
62 75 onClose();
... ... @@ -74,9 +87,11 @@ export default ({ setVisible, subOrders, onClose }) =&gt; {
74 87 rules={[{ required: true, message: '采购必填' }]}
75 88 request={async () => {
76 89 const res = await postServiceOrderProvideProcurementRoles();
77   - return res.data?.map((item) => {
  90 + let options = res.data?.map((item) => {
78 91 return { label: item, value: item };
79 92 });
  93 + options.push({ label: '仓库', value: 'warehouseKeeper' });
  94 + return options;
80 95 }}
81 96 />
82 97  
... ...
src/pages/Order/constant.ts
... ... @@ -151,6 +151,14 @@ export const ORDER_STATUS_OPTIONS = {
151 151 PROCURE_CONVERT_WAREHOUSE_KEEPER: '采购转仓库',
152 152 };
153 153  
  154 +/**
  155 + * 采购筛选订单的主要订单状态
  156 + */
  157 +export const PROCURE_PRIMARY_ORDER_STATUS_OPTIONS = {
  158 + PROCURE_UN_PROCESS: '采购未审核',
  159 + PROCURE_WAIT_SHIP: '采购待发货',
  160 +};
  161 +
154 162 export const AFTE_SALES_PLAN_OPTIONS = {
155 163 RETURNS_OR_REFUNDS: '退货/退款',
156 164 EXCHANGE_GOODS: '换货',
... ...
src/pages/Order/index.tsx
... ... @@ -17,6 +17,7 @@ import {
17 17 enumValueToLabel,
18 18 formatDateTime,
19 19 } from '@/utils';
  20 +import { getReceivingCompanyOptions } from '@/utils/order';
20 21 import { getUserInfo } from '@/utils/user';
21 22 import {
22 23 ClockCircleTwoTone,
... ... @@ -79,6 +80,7 @@ import {
79 80 PAYMENT_CHANNEL_OPTIONS,
80 81 PAYMENT_METHOD_OPTIONS,
81 82 PROCURE_ORDER_STATUS,
  83 + PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
82 84 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
83 85 TAGS_COLOR,
84 86 getInvoicingType,
... ... @@ -1363,11 +1365,39 @@ const OrderPage = () =&gt; {
1363 1365 </Flex>
1364 1366 </Flex>
1365 1367 <Flex className="pl-6" align="center">
  1368 + {userInfo.roleSmallVO.code === 'finance' ? (
  1369 + <div
  1370 + title={enumValueToLabel(
  1371 + record.receivingCompany,
  1372 + getReceivingCompanyOptions(),
  1373 + )}
  1374 + className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px]"
  1375 + >
  1376 + <span className="text-[#8C8C8C]">开票付款单位:</span>
  1377 + <span className="text-slate-700">
  1378 + {record.receivingCompany !== null
  1379 + ? enumValueToLabel(
  1380 + record.receivingCompany,
  1381 + getReceivingCompanyOptions(),
  1382 + )
  1383 + : '暂无'}
  1384 + </span>
  1385 + </div>
  1386 + ) : (
  1387 + ''
  1388 + )}
  1389 +
  1390 + {userInfo.roleSmallVO.code === 'finance' ? (
  1391 + <Divider type="vertical" />
  1392 + ) : (
  1393 + ''
  1394 + )}
  1395 +
1366 1396 <div title={record.notes}>
1367 1397 <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
1368 1398 <span className="text-[#8C8C8C]">备注:</span>
1369 1399 <span className="ml-2">
1370   - {record.notes === undefined ? '暂无备注' : record.notes}
  1400 + {record.notes === null ? '暂无备注' : record.notes}
1371 1401 </span>
1372 1402 </div>
1373 1403 </div>
... ... @@ -1455,6 +1485,22 @@ const OrderPage = () =&gt; {
1455 1485 ''
1456 1486 )}
1457 1487  
  1488 + {record.mainPath?.includes('orderChangeRequest') && false ? (
  1489 + <Button
  1490 + className="p-0"
  1491 + type="link"
  1492 + onClick={() => {
  1493 + setOrderDrawerVisible(true);
  1494 + setOrderRow(record);
  1495 + setOrderOptType('order-change-normal');
  1496 + }}
  1497 + >
  1498 + 申请修改
  1499 + </Button>
  1500 + ) : (
  1501 + ''
  1502 + )}
  1503 +
1458 1504 {record.mainPath?.includes('leaderAudit') ? (
1459 1505 <Button
1460 1506 className="p-0"
... ... @@ -1797,7 +1843,7 @@ const OrderPage = () =&gt; {
1797 1843  
1798 1844 {record?.subOrderInformationLists[0].subPath?.includes(
1799 1845 'noNeedInvoicingEdit',
1800   - ) ? (
  1846 + ) && false ? (
1801 1847 <Button
1802 1848 className="p-0"
1803 1849 type="link"
... ... @@ -1984,9 +2030,13 @@ const OrderPage = () =&gt; {
1984 2030 if (
1985 2031 selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
1986 2032 selectedSubOrders[i].orderStatus !==
1987   - 'FINANCE_PROCESS'
  2033 + 'FINANCE_PROCESS' &&
  2034 + selectedSubOrders[i].orderStatus !==
  2035 + 'LEADER_AUDITED'
1988 2036 ) {
1989   - message.error('请选择未审核的子订单进行审核');
  2037 + message.error(
  2038 + '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
  2039 + );
1990 2040 return;
1991 2041 }
1992 2042 }
... ... @@ -2257,6 +2307,18 @@ const OrderPage = () =&gt; {
2257 2307 },
2258 2308 };
2259 2309 }
  2310 +
  2311 + /**
  2312 + * 采购的订单状态筛选内容
  2313 + */
  2314 + if (
  2315 + userInfo.roleSmallVO.code === 'procure' &&
  2316 + item.dataIndex === 'orderStatus'
  2317 + ) {
  2318 + item.valueEnum = enumToProTableEnumValue(
  2319 + PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
  2320 + );
  2321 + }
2260 2322 return item;
2261 2323 },
2262 2324 );
... ...