Commit 813b6793c8142c6083c78eb955bde6d8c2f902ea

Authored by 曾国涛
2 parents 60aa1cb0 5d7e77f4

Merge branch 'zgt'

.idea/inspectionProfiles/Project_Default.xml
1 1 <component name="InspectionProjectProfileManager">
2 2 <profile version="1.0">
3 3 <option name="myName" value="Project Default" />
4   - <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5 4 <inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
6 5 </profile>
7 6 </component>
8 7 \ No newline at end of file
... ...
package-lock.json
... ... @@ -12,7 +12,6 @@
12 12 "@ant-design/pro-components": "^2.6.32",
13 13 "@inspir/assembly-css": "1.0.0-alpha",
14 14 "@react-buddy/ide-toolbox": "^2.4.0",
15   - "@react-buddy/palette-antd": "^5.3.0",
16 15 "@umijs/max": "^4.0.87",
17 16 "antd": "^5.10.2",
18 17 "axios": "^1.6.1",
... ... @@ -3988,19 +3987,6 @@
3988 3987 "react": "^17.0.0 || ^18.0.0"
3989 3988 }
3990 3989 },
3991   - "node_modules/@react-buddy/palette-antd": {
3992   - "version": "5.3.1",
3993   - "resolved": "https://registry.npmjs.org/@react-buddy/palette-antd/-/palette-antd-5.3.1.tgz",
3994   - "integrity": "sha512-G75Pik29FnmyvANiGLSpMFpru4Uzv5woq/IFrkmfYmJb+5vW3lhc+Y/PftLqatSH9fjXs/UOszuSbPzlykT9cw==",
3995   - "dependencies": {
3996   - "@react-buddy/ide-toolbox": "^2.4.0"
3997   - },
3998   - "peerDependencies": {
3999   - "@ant-design/icons": "^5.1.4",
4000   - "antd": "^5.3.0",
4001   - "react": "^17.0.0 || ^18.0.0"
4002   - }
4003   - },
4004 3990 "node_modules/@sinclair/typebox": {
4005 3991 "version": "0.27.8",
4006 3992 "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
... ... @@ -28469,14 +28455,6 @@
28469 28455 "integrity": "sha512-TWHX6gwa0Gop7215uHhjFMbYLLdjM/b9rr0wYE3E0m7GNJ56gbPpbZiq86w9uI8zksl827acqGeT437MkuO64w==",
28470 28456 "requires": {}
28471 28457 },
28472   - "@react-buddy/palette-antd": {
28473   - "version": "5.3.1",
28474   - "resolved": "https://registry.npmjs.org/@react-buddy/palette-antd/-/palette-antd-5.3.1.tgz",
28475   - "integrity": "sha512-G75Pik29FnmyvANiGLSpMFpru4Uzv5woq/IFrkmfYmJb+5vW3lhc+Y/PftLqatSH9fjXs/UOszuSbPzlykT9cw==",
28476   - "requires": {
28477   - "@react-buddy/ide-toolbox": "^2.4.0"
28478   - }
28479   - },
28480 28458 "@sinclair/typebox": {
28481 28459 "version": "0.27.8",
28482 28460 "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
... ...
src/pages/Invoice/components/AddInvoiceDrawerForm.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import { postServiceInvoiceAddInvoice } from '@/services';
  3 +import { PlusOutlined } from '@ant-design/icons';
  4 +import {
  5 + DrawerForm,
  6 + ProFormDateTimePicker,
  7 + ProFormGroup,
  8 + ProFormList,
  9 + ProFormMoney,
  10 + ProFormSelect,
  11 + ProFormText,
  12 + ProFormTextArea,
  13 +} from '@ant-design/pro-components';
  14 +import { Button, Form, message } from 'antd';
  15 +
  16 +export default ({ onClose }) => {
  17 + const [form] = Form.useForm<{
  18 + invoiceNumber: '';
  19 + invoiceStatus: '';
  20 + purchaser: '';
  21 + payee: '';
  22 + contacts: '';
  23 + sale: '';
  24 + invoicingTime: '';
  25 + notes: '';
  26 + mainOrderIdObjs: [
  27 + {
  28 + mainOrderId: '';
  29 + },
  30 + ];
  31 + money: '';
  32 + }>();
  33 +
  34 + return (
  35 + <DrawerForm<{
  36 + invoiceNumber: string;
  37 + invoiceStatus: string;
  38 + purchaser: string;
  39 + payee: string;
  40 + contacts: string;
  41 + sale: string;
  42 + invoicingTime: Date;
  43 + notes: string;
  44 + mainOrderIdObjs: [
  45 + {
  46 + mainOrderId: string;
  47 + },
  48 + ];
  49 + money: string;
  50 + }>
  51 + title="新增开票"
  52 + resize={{
  53 + onResize() {
  54 + console.log('resize!');
  55 + },
  56 + maxWidth: window.innerWidth * 0.8,
  57 + minWidth: 400,
  58 + }}
  59 + form={form}
  60 + trigger={
  61 + <Button type="primary">
  62 + <PlusOutlined />
  63 + 新增
  64 + </Button>
  65 + }
  66 + autoFocusFirstInput
  67 + drawerProps={{
  68 + destroyOnClose: true,
  69 + }}
  70 + submitTimeout={2000}
  71 + onFinish={async (values) => {
  72 + console.log(values);
  73 + const mainOrderIds = values.mainOrderIdObjs.flatMap(
  74 + (item) => item.mainOrderId,
  75 + );
  76 + let attrs = { ...values, mainOrderIds };
  77 + let res = await postServiceInvoiceAddInvoice({
  78 + data: { ...attrs },
  79 + });
  80 + if (res.result === RESPONSE_CODE.SUCCESS) {
  81 + message.success(res.message);
  82 + return true;
  83 + } else {
  84 + message.error(res.message);
  85 + }
  86 + onClose();
  87 + // 不返回不会关闭弹框
  88 + return true;
  89 + }}
  90 + >
  91 + <ProFormText
  92 + name="invoiceNumber"
  93 + width="md"
  94 + label="发票号码"
  95 + placeholder="请输入名称"
  96 + rules={[{ required: true, message: '请输入名称!' }]}
  97 + />
  98 + <ProFormSelect
  99 + name="invoiceStatus"
  100 + label="发票类型"
  101 + valueEnum={{
  102 + SPECIALLY_INVOICED: '专票',
  103 + COMMON_INVOICED: '普票',
  104 + }}
  105 + rules={[{ required: true, message: '请选择发票类型!' }]}
  106 + />
  107 + <ProFormText
  108 + name="purchaser"
  109 + width="md"
  110 + label="购买方"
  111 + placeholder="请输入购买方"
  112 + rules={[{ required: true, message: '请输入购买方!' }]}
  113 + />
  114 + <ProFormText
  115 + name="payee"
  116 + width="md"
  117 + label="收款单位"
  118 + placeholder="请输入收款单位"
  119 + rules={[{ required: true, message: '请输入收款单位!' }]}
  120 + />
  121 + <ProFormText
  122 + name="contacts"
  123 + width="md"
  124 + label="联系人"
  125 + placeholder="请输入联系人"
  126 + rules={[{ required: true, message: '请输入联系人!' }]}
  127 + />
  128 + <ProFormText
  129 + name="sale"
  130 + width="md"
  131 + label="销售"
  132 + placeholder="请输入销售"
  133 + rules={[{ required: true, message: '请输入销售!' }]}
  134 + />
  135 + <ProFormDateTimePicker
  136 + name="invoicingTime"
  137 + label="开票时间"
  138 + fieldProps={{
  139 + format: (value) => value.format('YYYY-MM-DD'),
  140 + }}
  141 + rules={[{ required: true, message: '请输入开票时间!' }]}
  142 + />
  143 + <ProFormTextArea name="notes" label="备注" placeholder="请输入名称" />
  144 + <ProFormList
  145 + name="mainOrderIdObjs"
  146 + label="订单号"
  147 + min={1}
  148 + deleteIconProps={{
  149 + tooltipText: '删除',
  150 + }}
  151 + initialValue={[
  152 + {
  153 + mainOrderId: '',
  154 + },
  155 + ]}
  156 + >
  157 + <ProFormGroup key="group">
  158 + <ProFormText
  159 + rules={[{ required: true, message: '请输入关联订单!' }]}
  160 + name="mainOrderId"
  161 + />
  162 + </ProFormGroup>
  163 + </ProFormList>
  164 + <ProFormMoney
  165 + label="金额"
  166 + name="money"
  167 + customSymbol="¥"
  168 + min={0}
  169 + rules={[{ required: true, message: '请输入金额!' }]}
  170 + />
  171 + </DrawerForm>
  172 + );
  173 +};
... ...
src/pages/Invoice/index.tsx
1 1 import ButtonConfirm from '@/components/ButtomConfirm';
2 2 import EllipsisDiv from '@/components/Div/EllipsisDiv';
3 3 import { RESPONSE_CODE } from '@/constants/enum';
  4 +import AddInvoiceDrawerForm from '@/pages/Invoice/components/AddInvoiceDrawerForm';
4 5 import {
5 6 BANK_STATEMENT_COLUMNS,
6 7 INVOICE_COLUMNS,
... ... @@ -338,6 +339,15 @@ const InvoicePage = () =&gt; {
338 339 dateFormatter="string"
339 340 headerTitle="发票列表"
340 341 scroll={{ x: 1400, y: 360 }}
  342 + toolBarRender={() => [
  343 + <AddInvoiceDrawerForm
  344 + key="addInvoiceDrawerForm"
  345 + onClose={() => {
  346 + invoiceActionRef.current?.reload();
  347 + bankActionRef.current?.reload();
  348 + }}
  349 + ></AddInvoiceDrawerForm>,
  350 + ]}
341 351 />
342 352 ),
343 353 },
... ...
src/pages/Order/index.tsx
... ... @@ -2047,6 +2047,41 @@ const OrderPage = () =&gt; {
2047 2047 ) : (
2048 2048 ''
2049 2049 )}
  2050 +
  2051 + {isAdmin() || isSales() || isFinance() ? (
  2052 + <Flex title={optRecord.notes} className="pt-2">
  2053 + <div className="flex items-center">
  2054 + <div className="flex items-center max-w-[500px]">
  2055 + <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
  2056 + <Tooltip title={optRecord.reissueNotes} placement="topLeft">
  2057 + <span className="text-[#8C8C8C]">
  2058 + 重新开票备注:
  2059 + {optRecord.reissueNotes === undefined ||
  2060 + optRecord.reissueNotes === null
  2061 + ? '暂无备注'
  2062 + : optRecord.reissueNotes}
  2063 + </span>
  2064 + </Tooltip>
  2065 + </div>
  2066 +
  2067 + <Tooltip title="编辑">
  2068 + <EditTwoTone
  2069 + className="pl-1 hover:curcor-pointer"
  2070 + onClick={() => {
  2071 + setNotesEditVisible(true);
  2072 + setSelectedRows([optRecord.id]);
  2073 + setNotes(optRecord.reissueNotes);
  2074 + setNotesType(5);
  2075 + }}
  2076 + />
  2077 + </Tooltip>
  2078 + </div>
  2079 + <Divider type="vertical" className="mx-5" />
  2080 + </div>
  2081 + </Flex>
  2082 + ) : (
  2083 + ''
  2084 + )}
2050 2085 </>
2051 2086 );
2052 2087 };
... ...
src/services/definition.ts
... ... @@ -889,6 +889,78 @@ export interface InventoryMaterialStockReq {
889 889 materialId?: string;
890 890 }
891 891  
  892 +export interface InvoiceDto {
  893 + /**
  894 + * @description
  895 + * 收款时间
  896 + * @format date-time
  897 + */
  898 + collectionTime?: string;
  899 + /**
  900 + * @description
  901 + * 联系人
  902 + */
  903 + contacts?: string;
  904 + /**
  905 + * @description
  906 + * id
  907 + * @format int64
  908 + */
  909 + id?: number;
  910 + /**
  911 + * @description
  912 + * 发票号码
  913 + */
  914 + invoiceNumber?: string;
  915 + /**
  916 + * @description
  917 + * 发票类型
  918 + */
  919 + invoiceStatus?: string;
  920 + /**
  921 + * @description
  922 + * 开票日期
  923 + * @format date-time
  924 + */
  925 + invoicingTime?: string;
  926 + /**
  927 + * @description
  928 + * 关联主订单id
  929 + */
  930 + mainOrderIds?: Array<number>;
  931 + /**
  932 + * @description
  933 + * 金额
  934 + * @format int64
  935 + */
  936 + money?: number;
  937 + /**
  938 + * @description
  939 + * 备注
  940 + */
  941 + notes?: string;
  942 + /**
  943 + * @description
  944 + * 收款单位
  945 + */
  946 + payee?: string;
  947 + /**
  948 + * @description
  949 + * 购买方
  950 + */
  951 + purchaser?: string;
  952 + /**
  953 + * @description
  954 + * 销售
  955 + */
  956 + sale?: string;
  957 + /**
  958 + * @description
  959 + * 状态
  960 + */
  961 + status?: string;
  962 +}
  963 +
892 964 export interface InvoiceRecordQueryRequest {
893 965 /** @format date */
894 966 createTimeGe?: string;
... ...
src/services/request.ts
... ... @@ -41,6 +41,7 @@ import type {
41 41 DictionaryVO,
42 42 Dto,
43 43 InventoryMaterialStockReq,
  44 + InvoiceDto,
44 45 InvoiceRecordQueryRequest,
45 46 MainOrderqueryRequest,
46 47 MaterialListReply,
... ... @@ -49,7 +50,6 @@ import type {
49 50 MaterialUnitListRes,
50 51 MeasureUnitListRes,
51 52 MessageQueryDTO,
52   - ModelAndView,
53 53 OrderAddVO,
54 54 OrderAuditLogQueryVO,
55 55 OrderBaseInfoQueryVO,
... ... @@ -1123,7 +1123,9 @@ export interface GetErrorResponse {
1123 1123 * @description
1124 1124 * OK
1125 1125 */
1126   - 200: ModelAndView;
  1126 + 200: {
  1127 + [propertyName: string]: any;
  1128 + };
1127 1129 /**
1128 1130 * @description
1129 1131 * Unauthorized
... ... @@ -1144,9 +1146,9 @@ export interface GetErrorResponse {
1144 1146 export type GetErrorResponseSuccess = GetErrorResponse[200];
1145 1147 /**
1146 1148 * @description
1147   - * errorHtml
  1149 + * error
1148 1150 * @tags basic-error-controller
1149   - * @produces text/html
  1151 + * @produces *
1150 1152 */
1151 1153 export const getError = /* #__PURE__ */ (() => {
1152 1154 const method = 'get';
... ... @@ -1170,7 +1172,9 @@ export interface PutErrorResponse {
1170 1172 * @description
1171 1173 * OK
1172 1174 */
1173   - 200: ModelAndView;
  1175 + 200: {
  1176 + [propertyName: string]: any;
  1177 + };
1174 1178 /**
1175 1179 * @description
1176 1180 * Created
... ... @@ -1196,9 +1200,9 @@ export interface PutErrorResponse {
1196 1200 export type PutErrorResponseSuccess = PutErrorResponse[200];
1197 1201 /**
1198 1202 * @description
1199   - * errorHtml
  1203 + * error
1200 1204 * @tags basic-error-controller
1201   - * @produces text/html
  1205 + * @produces *
1202 1206 * @consumes application/json
1203 1207 */
1204 1208 export const putError = /* #__PURE__ */ (() => {
... ... @@ -1223,7 +1227,9 @@ export interface PostErrorResponse {
1223 1227 * @description
1224 1228 * OK
1225 1229 */
1226   - 200: ModelAndView;
  1230 + 200: {
  1231 + [propertyName: string]: any;
  1232 + };
1227 1233 /**
1228 1234 * @description
1229 1235 * Created
... ... @@ -1249,9 +1255,9 @@ export interface PostErrorResponse {
1249 1255 export type PostErrorResponseSuccess = PostErrorResponse[200];
1250 1256 /**
1251 1257 * @description
1252   - * errorHtml
  1258 + * error
1253 1259 * @tags basic-error-controller
1254   - * @produces text/html
  1260 + * @produces *
1255 1261 * @consumes application/json
1256 1262 */
1257 1263 export const postError = /* #__PURE__ */ (() => {
... ... @@ -1276,7 +1282,9 @@ export interface DeleteErrorResponse {
1276 1282 * @description
1277 1283 * OK
1278 1284 */
1279   - 200: ModelAndView;
  1285 + 200: {
  1286 + [propertyName: string]: any;
  1287 + };
1280 1288 /**
1281 1289 * @description
1282 1290 * No Content
... ... @@ -1297,9 +1305,9 @@ export interface DeleteErrorResponse {
1297 1305 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
1298 1306 /**
1299 1307 * @description
1300   - * errorHtml
  1308 + * error
1301 1309 * @tags basic-error-controller
1302   - * @produces text/html
  1310 + * @produces *
1303 1311 */
1304 1312 export const deleteError = /* #__PURE__ */ (() => {
1305 1313 const method = 'delete';
... ... @@ -1323,7 +1331,9 @@ export interface OptionsErrorResponse {
1323 1331 * @description
1324 1332 * OK
1325 1333 */
1326   - 200: ModelAndView;
  1334 + 200: {
  1335 + [propertyName: string]: any;
  1336 + };
1327 1337 /**
1328 1338 * @description
1329 1339 * No Content
... ... @@ -1344,9 +1354,9 @@ export interface OptionsErrorResponse {
1344 1354 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
1345 1355 /**
1346 1356 * @description
1347   - * errorHtml
  1357 + * error
1348 1358 * @tags basic-error-controller
1349   - * @produces text/html
  1359 + * @produces *
1350 1360 * @consumes application/json
1351 1361 */
1352 1362 export const optionsError = /* #__PURE__ */ (() => {
... ... @@ -1371,7 +1381,9 @@ export interface HeadErrorResponse {
1371 1381 * @description
1372 1382 * OK
1373 1383 */
1374   - 200: ModelAndView;
  1384 + 200: {
  1385 + [propertyName: string]: any;
  1386 + };
1375 1387 /**
1376 1388 * @description
1377 1389 * No Content
... ... @@ -1392,9 +1404,9 @@ export interface HeadErrorResponse {
1392 1404 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
1393 1405 /**
1394 1406 * @description
1395   - * errorHtml
  1407 + * error
1396 1408 * @tags basic-error-controller
1397   - * @produces text/html
  1409 + * @produces *
1398 1410 * @consumes application/json
1399 1411 */
1400 1412 export const headError = /* #__PURE__ */ (() => {
... ... @@ -1419,7 +1431,9 @@ export interface PatchErrorResponse {
1419 1431 * @description
1420 1432 * OK
1421 1433 */
1422   - 200: ModelAndView;
  1434 + 200: {
  1435 + [propertyName: string]: any;
  1436 + };
1423 1437 /**
1424 1438 * @description
1425 1439 * No Content
... ... @@ -1440,9 +1454,9 @@ export interface PatchErrorResponse {
1440 1454 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
1441 1455 /**
1442 1456 * @description
1443   - * errorHtml
  1457 + * error
1444 1458 * @tags basic-error-controller
1445   - * @produces text/html
  1459 + * @produces *
1446 1460 * @consumes application/json
1447 1461 */
1448 1462 export const patchError = /* #__PURE__ */ (() => {
... ... @@ -7465,6 +7479,77 @@ export const postServiceBankStatementQueryBankStatement =
7465 7479 return request;
7466 7480 })();
7467 7481  
  7482 +/** @description request parameter type for postServiceInvoiceAddInvoice */
  7483 +export interface PostServiceInvoiceAddInvoiceOption {
  7484 + /**
  7485 + * @description
  7486 + * dto
  7487 + */
  7488 + body: {
  7489 + /**
  7490 + @description
  7491 + dto */
  7492 + dto: InvoiceDto;
  7493 + };
  7494 +}
  7495 +
  7496 +/** @description response type for postServiceInvoiceAddInvoice */
  7497 +export interface PostServiceInvoiceAddInvoiceResponse {
  7498 + /**
  7499 + * @description
  7500 + * OK
  7501 + */
  7502 + 200: ServerResult;
  7503 + /**
  7504 + * @description
  7505 + * Created
  7506 + */
  7507 + 201: any;
  7508 + /**
  7509 + * @description
  7510 + * Unauthorized
  7511 + */
  7512 + 401: any;
  7513 + /**
  7514 + * @description
  7515 + * Forbidden
  7516 + */
  7517 + 403: any;
  7518 + /**
  7519 + * @description
  7520 + * Not Found
  7521 + */
  7522 + 404: any;
  7523 +}
  7524 +
  7525 +export type PostServiceInvoiceAddInvoiceResponseSuccess =
  7526 + PostServiceInvoiceAddInvoiceResponse[200];
  7527 +/**
  7528 + * @description
  7529 + * 添加发票
  7530 + * @tags 发票
  7531 + * @produces *
  7532 + * @consumes application/json
  7533 + */
  7534 +export const postServiceInvoiceAddInvoice = /* #__PURE__ */ (() => {
  7535 + const method = 'post';
  7536 + const url = '/service/invoice/addInvoice';
  7537 + function request(
  7538 + option: PostServiceInvoiceAddInvoiceOption,
  7539 + ): Promise<PostServiceInvoiceAddInvoiceResponseSuccess> {
  7540 + return requester(request.url, {
  7541 + method: request.method,
  7542 + ...option,
  7543 + }) as unknown as Promise<PostServiceInvoiceAddInvoiceResponseSuccess>;
  7544 + }
  7545 +
  7546 + /** http method */
  7547 + request.method = method;
  7548 + /** request url */
  7549 + request.url = url;
  7550 + return request;
  7551 +})();
  7552 +
7468 7553 /** @description request parameter type for postServiceInvoiceCancelInvoiceAndBankStatement */
7469 7554 export interface PostServiceInvoiceCancelInvoiceAndBankStatementOption {
7470 7555 /**
... ...