Commit ef80ce2bb7168d271185939304e8a944de4a4987
Merge remote-tracking branch 'origin/master' into dev
Showing
210 changed files
with
12756 additions
and
3228 deletions
Too many changes to show.
To preserve performance only 61 of 210 files are displayed.
config/routers/backlog.ts
config/routers/fvm.ts
... | ... | @@ -304,6 +304,14 @@ export default [ |
304 | 304 | path: "fvm/allowance/edit/:id?", // 折让确认管理编辑新增 |
305 | 305 | component: "./stock/AllowanceConfirm/EditComfirm/index", |
306 | 306 | }, |
307 | + { | |
308 | + path: "fvm/directVehicles/allowance", // 直营车折让确认 | |
309 | + component: "./stock/DirectVehicles", | |
310 | + }, | |
311 | + { | |
312 | + path: "fvm/directVehicles/edit/:id?", // 直营车折让确认编辑啊 | |
313 | + component: "./stock/DirectVehicles/EditComfirm", | |
314 | + }, | |
307 | 315 | // OTD计划设置 |
308 | 316 | { |
309 | 317 | path: "/fvm/plan/ticket/execution", | ... | ... |
config/routers/mkt.ts
... | ... | @@ -5,7 +5,7 @@ export default [ |
5 | 5 | component: './mkt/ActivityManage', |
6 | 6 | }, |
7 | 7 | { |
8 | - path: '/mkt/manage/create/:activityNo?/:status?', | |
8 | + path: '/mkt/manage/create/:activityNo?/:status?/:change?', | |
9 | 9 | component: './mkt/ActivityCreate', |
10 | 10 | }, |
11 | 11 | /**活动中奖概况运维 */ |
... | ... | @@ -18,6 +18,10 @@ export default [ |
18 | 18 | component: './mkt/articleList', |
19 | 19 | }, |
20 | 20 | { |
21 | + path: '/mkt/original/article', // 原创文章 | |
22 | + component: './mkt/articleList', | |
23 | + }, | |
24 | + { | |
21 | 25 | path: '/mkt/poster', //海报库列表 |
22 | 26 | component: './mkt/posterList', |
23 | 27 | }, | ... | ... |
src/components/FeeweeUpload/index.tsx
... | ... | @@ -3,17 +3,17 @@ |
3 | 3 | * @LastEditors: wangqiang@feewee.cn |
4 | 4 | * @LastEditTime: 2021-03-11 12:55:38 |
5 | 5 | */ |
6 | -import React from 'react'; | |
7 | -import { message, Upload } from 'antd'; | |
8 | -import { UploadProps } from 'antd/lib/upload'; | |
9 | -import { RcFile, UploadFile } from 'antd/lib/upload/interface'; | |
10 | -import getFidFile from '@/utils/getFidFile'; | |
6 | +import React from "react"; | |
7 | +import { message, Upload } from "antd"; | |
8 | +import { UploadProps } from "antd/lib/upload"; | |
9 | +import { RcFile, UploadFile } from "antd/lib/upload/interface"; | |
10 | +import getFidFile from "@/utils/getFidFile"; | |
11 | 11 | |
12 | 12 | interface Props extends UploadProps { |
13 | - isFid?: boolean // 预览文件 路径是否为 fid 形式 | |
14 | - limitSize?: number // 限制文件大小,单位MB | |
15 | - limitUnit?: 'kb' | 'mb' | 'KB' | 'MB' // 限制大小单位, 默认MB | |
16 | - children?: React.ReactNode | |
13 | + isFid?: boolean; // 预览文件 路径是否为 fid 形式 | |
14 | + limitSize?: number; // 限制文件大小,单位MB | |
15 | + limitUnit?: "kb" | "mb" | "KB" | "MB"; // 限制大小单位, 默认MB | |
16 | + children?: React.ReactNode; | |
17 | 17 | } |
18 | 18 | |
19 | 19 | /** |
... | ... | @@ -29,17 +29,23 @@ interface Props extends UploadProps { |
29 | 29 | } |
30 | 30 | * @param {Props} props |
31 | 31 | */ |
32 | -export default function FeeweeUpload({ isFid = false, limitSize = undefined, limitUnit = 'MB', children, ...props }: Props) { | |
32 | +export default function FeeweeUpload({ | |
33 | + isFid = false, | |
34 | + limitSize = undefined, | |
35 | + limitUnit = "MB", | |
36 | + children, | |
37 | + ...props | |
38 | +}: Props) { | |
33 | 39 | const onPreview = (file: UploadFile) => { |
34 | 40 | if (props.onPreview) { |
35 | 41 | props.onPreview(file); |
36 | 42 | return; |
37 | 43 | } |
38 | 44 | getFidFile(file.response.data, isFid); |
39 | - } | |
45 | + }; | |
40 | 46 | |
41 | 47 | const beforeUpload = (file: RcFile, filelist: RcFile[]) => { |
42 | - if (limitSize !== undefined && typeof limitSize === 'number') { | |
48 | + if (limitSize !== undefined && typeof limitSize === "number") { | |
43 | 49 | const limit = isExceededSize(file, limitSize, limitUnit); |
44 | 50 | if (limit.success) { |
45 | 51 | return true; |
... | ... | @@ -50,27 +56,23 @@ export default function FeeweeUpload({ isFid = false, limitSize = undefined, lim |
50 | 56 | * 当表单中使用时,可以在getValueFromEvent回调函数中多添加2行判断函数: |
51 | 57 | * if (e.file.status === 'size_limit') { |
52 | 58 | * return e.fileList.filter((file: any) => file.uid !== e.file.uid); |
53 | - * } | |
54 | - */ | |
55 | - // @ts-ignore | |
56 | - file.status = 'size_limit'; | |
59 | + * } | |
60 | + */ | |
61 | + // @ts-ignore | |
62 | + file.status = "size_limit"; | |
57 | 63 | return false; |
58 | 64 | } |
59 | 65 | } |
60 | 66 | return props.beforeUpload ? props.beforeUpload(file, filelist) : true; |
61 | - } | |
67 | + }; | |
62 | 68 | |
63 | 69 | return ( |
64 | 70 | <> |
65 | - <Upload | |
66 | - {...props} | |
67 | - beforeUpload={beforeUpload} | |
68 | - onPreview={onPreview} | |
69 | - > | |
71 | + <Upload {...props} beforeUpload={beforeUpload} onPreview={onPreview}> | |
70 | 72 | {children} |
71 | 73 | </Upload> |
72 | 74 | </> |
73 | - ) | |
75 | + ); | |
74 | 76 | } |
75 | 77 | |
76 | 78 | /** |
... | ... | @@ -79,11 +81,14 @@ export default function FeeweeUpload({ isFid = false, limitSize = undefined, lim |
79 | 81 | * @param {'kb' | 'mb' | 'KB' | 'MB'} limitUnit |
80 | 82 | * @return {number} |
81 | 83 | */ |
82 | -function getLimitSize(limitSize: number, limitUnit: 'kb' | 'mb' | 'KB' | 'MB'): number { | |
83 | - if (limitUnit === 'kb' || limitUnit === 'KB') { | |
84 | +function getLimitSize( | |
85 | + limitSize: number, | |
86 | + limitUnit: "kb" | "mb" | "KB" | "MB" | |
87 | +): number { | |
88 | + if (limitUnit === "kb" || limitUnit === "KB") { | |
84 | 89 | return limitSize; |
85 | 90 | } |
86 | - if (limitUnit === 'mb' || limitUnit === 'MB') { | |
91 | + if (limitUnit === "mb" || limitUnit === "MB") { | |
87 | 92 | return limitSize * 1024; |
88 | 93 | } |
89 | 94 | return 0; |
... | ... | @@ -96,15 +101,20 @@ function getLimitSize(limitSize: number, limitUnit: 'kb' | 'mb' | 'KB' | 'MB'): |
96 | 101 | * @param {*} limitUnit |
97 | 102 | * @return {{ success: boolean, msg?: string }} |
98 | 103 | */ |
99 | -function isExceededSize(file: RcFile, limitSize: number, limitUnit: 'kb' | 'mb' | 'KB' | 'MB'): { success: boolean, msg?: string } { | |
104 | +function isExceededSize( | |
105 | + file: RcFile, | |
106 | + limitSize: number, | |
107 | + limitUnit: "kb" | "mb" | "KB" | "MB" | |
108 | +): { success: boolean; msg?: string } { | |
100 | 109 | const _limitSize = getLimitSize(limitSize, limitUnit); |
101 | 110 | |
102 | 111 | const fileSizeToKB = file.size / 1024; |
103 | 112 | if (fileSizeToKB <= _limitSize) { |
104 | - | |
105 | 113 | return { success: true }; |
106 | 114 | } else { |
107 | - | |
108 | - return { success: false, msg: `文件【${file.name}】大小不能超过${limitSize}${limitUnit}` }; | |
115 | + return { | |
116 | + success: false, | |
117 | + msg: `文件【${file.name}】大小不能超过${limitSize}${limitUnit}`, | |
118 | + }; | |
109 | 119 | } |
110 | -} | |
111 | 120 | \ No newline at end of file |
121 | +} | ... | ... |
src/pages/approval/ApprovalSetting/components/CreateItem.tsx
... | ... | @@ -209,7 +209,7 @@ export default function CreateItem({ item, setItem, setParams }: Props) { |
209 | 209 | <Form.Item |
210 | 210 | name="path" |
211 | 211 | label="业务详情路径" |
212 | - rules={[{ required: true }]} | |
212 | + // rules={[{ required: true }]} | |
213 | 213 | > |
214 | 214 | <Input placeholder="请输入业务详情路径" /> |
215 | 215 | </Form.Item> | ... | ... |
src/pages/approval/FLowSetting/api.ts
1 | 1 | import request from '@/utils/request'; |
2 | 2 | import { http } from '@/typing/http'; |
3 | -import { Approval_HOST, FVM_HOST, EHR_HOST, FINANCE2_HOST, PMS_HOST } from '@/utils/host'; | |
3 | +import { Approval_HOST, FVM_HOST, EHR_HOST, FINANCE2_HOST, PMS_HOST, ABILITY_HOST, } from '@/utils/host'; | |
4 | 4 | |
5 | 5 | type P<T> = Promise<http.PageResponse<T>>; |
6 | 6 | |
... | ... | @@ -24,7 +24,8 @@ export function fetchProcessList(approvalConfigId: number): http.PromiseResp<Flo |
24 | 24 | * /erp/approval/config/save |
25 | 25 | */ |
26 | 26 | export function saveApproveConfig(params: ApprovalSetteing.ApprovalListItems) { |
27 | - return request.post(`${Approval_HOST}/erp/approval/config/save`, params); | |
27 | + return request.post(`${FINANCE2_HOST | |
28 | + }/erp/approval/config/save`, params); | |
28 | 29 | } |
29 | 30 | |
30 | 31 | /** |
... | ... | @@ -108,3 +109,19 @@ export function getAccountApi(params: SpecialAccount.AccountParams): P<SpecialAc |
108 | 109 | export function getStoragePage(params?: PartStorageSpace.QueryPageParam): http.PromisePageResp<PartStorageSpace.PageVO> { |
109 | 110 | return request.get(`${PMS_HOST}/erp/storage/page`, { params }); |
110 | 111 | } |
112 | + | |
113 | +/** 能力提升业务类型分页列表 | |
114 | + * | |
115 | + * /ability/erp/exam/config/standard/all/list | |
116 | + */ | |
117 | +export function getAbilityPage(): http.PromiseResp<PartStorageSpace.AbilityPageVO[]> { | |
118 | + return request.get(`${ABILITY_HOST}/erp/exam/config/standard/all/list`); | |
119 | +} | |
120 | + | |
121 | +/** | |
122 | + * 款项列表 | |
123 | + * /common/refundable/types | |
124 | + */ | |
125 | +export function getFoundPage(): http.PromiseResp<PartStorageSpace.FoundPageVO[]> { | |
126 | + return request.get(`${FINANCE2_HOST}/common/refundable/types`); | |
127 | +} | |
111 | 128 | \ No newline at end of file | ... | ... |
src/pages/approval/FLowSetting/components/ConditionSetting.tsx
... | ... | @@ -8,7 +8,9 @@ import { |
8 | 8 | getStoragePage, |
9 | 9 | getAccountApi, |
10 | 10 | getPostTypeList, |
11 | + getAbilityPage, | |
11 | 12 | processDeleteApi, //删除流程 |
13 | + getFoundPage, | |
12 | 14 | } from "../api"; |
13 | 15 | import useInitial from "@/hooks/useInitail"; |
14 | 16 | import { getShopApi, getAllRoleCodeApi } from "@/common/api"; |
... | ... | @@ -73,6 +75,13 @@ export default function ConditionSetting({ match }: Props) { |
73 | 75 | approvalConfigId |
74 | 76 | ); |
75 | 77 | |
78 | + /** | |
79 | + * 能力提升业务类型列表 | |
80 | + */ | |
81 | + const { data: abilityList } = useInitial(getAbilityPage, [], {}); | |
82 | + // 款项列表 | |
83 | + const { data: foundList } = useInitial(getFoundPage, [], {}); | |
84 | + | |
76 | 85 | useEffect(() => { |
77 | 86 | if (preConditonList.length) { |
78 | 87 | const _temp = preConditonList.map((item) => ({ |
... | ... | @@ -232,7 +241,6 @@ export default function ConditionSetting({ match }: Props) { |
232 | 241 | style={{ marginLeft: 20 }} |
233 | 242 | size="small" |
234 | 243 | ghost |
235 | - // onClick={() => onDelete(item.id)} | |
236 | 244 | > |
237 | 245 | 删除 |
238 | 246 | </Button> |
... | ... | @@ -282,11 +290,12 @@ export default function ConditionSetting({ match }: Props) { |
282 | 290 | form={form} |
283 | 291 | eidt={!!currentItem.length} |
284 | 292 | readOnly={readOnly} |
285 | - // preConditionList={preConditonList} | |
286 | 293 | postTypeList={postTypeList} |
294 | + abilityList={abilityList} | |
287 | 295 | preCondition={preCondition} |
288 | 296 | accountList={accountList} |
289 | 297 | fittingsList={fittingsList} |
298 | + foundList={foundList} | |
290 | 299 | /> |
291 | 300 | <DetailItem detailItem={detailItem} setDetailItem={setDetailItem} /> |
292 | 301 | </PageHeaderWrapper> | ... | ... |
src/pages/approval/FLowSetting/components/DetailItem.tsx
1 | 1 | import React, { useEffect, useState, useRef } from "react"; |
2 | 2 | import PostSelect from "@/components/PostSelect"; |
3 | -import { Modal, Descriptions } from "antd"; | |
3 | +import { Modal, Descriptions, Form } from "antd"; | |
4 | 4 | import { TriggerType, TriggerAll, TriggerSelect, TriggerMode } from "../entity"; |
5 | 5 | import _, { identity } from "lodash"; |
6 | 6 | |
... | ... | @@ -20,7 +20,6 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) { |
20 | 20 | visible={visible} |
21 | 21 | onCancel={hide} |
22 | 22 | title="流程详情" |
23 | - width={600} | |
24 | 23 | maskClosable={false} |
25 | 24 | footer={null} |
26 | 25 | > |
... | ... | @@ -29,36 +28,53 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) { |
29 | 28 | <p>触发条件:</p> |
30 | 29 | <div style={{ paddingLeft: 20 }}> |
31 | 30 | {ViewItem.processConditions?.map((item) => ( |
32 | - <div style={{ marginBottom: 10 }} key={item.approvalCondition?.id}> | |
31 | + <div key={item.approvalCondition?.id}> | |
33 | 32 | {/* 除金额和数量以外的类型 区间展示 */} |
34 | - {item.approvalCondition?.type !== 1 && | |
35 | - item.approvalCondition?.type !== 2 && ( | |
36 | - <div | |
37 | - style={{ | |
38 | - display: "flex", | |
39 | - justifyContent: "flex-start", | |
40 | - justifyItems: "center", | |
41 | - }} | |
42 | - > | |
43 | - <div style={{ marginRight: 10 }}> | |
44 | - <span style={{}}> | |
45 | - {item.approvalCondition?.name} ( | |
46 | - {TriggerAll[item.approvalCondition?.judgeRule]}): | |
33 | + <Form> | |
34 | + {item.approvalCondition?.type !== 1 && | |
35 | + item.approvalCondition?.type !== 2 && ( | |
36 | + <Form.Item | |
37 | + label={`${item.approvalCondition?.name} ( | |
38 | + ${TriggerAll[item.approvalCondition?.judgeRule]}):`} | |
39 | + > | |
40 | + <span style={{ width: 400 }}> | |
41 | + [ | |
42 | + {JSON.parse(item.value) | |
43 | + .map((i) => i.name) | |
44 | + .join(",")} | |
45 | + ] | |
47 | 46 | </span> |
48 | - </div> | |
47 | + </Form.Item> | |
48 | + )} | |
49 | 49 | |
50 | - {/* <div style={{ backgroundColor: "red" }}> */} | |
51 | - <div style={{width:400}}> | |
52 | - [ | |
53 | - {JSON.parse(item.value) | |
54 | - .map((i) => i.name) | |
55 | - .join(",")} | |
56 | - ] | |
57 | - </div> | |
58 | - </div> | |
59 | - )} | |
60 | - {/* 选择金额或数量,判断规则为区间 */} | |
61 | - {(item.approvalCondition?.type === 1 || | |
50 | + {/* 选择金额或数量,判断规则为区间 */} | |
51 | + {(item.approvalCondition?.type === 1 || | |
52 | + item.approvalCondition?.type === 2) && | |
53 | + item.approvalCondition?.judgeRule === 1 && ( | |
54 | + <Form.Item | |
55 | + label={`${item.approvalCondition?.name} ( | |
56 | + ${TriggerAll[item.approvalCondition?.judgeRule]}):`} | |
57 | + > | |
58 | + [{JSON.parse(item.value).min},{JSON.parse(item.value).max} | |
59 | + ]{item.approvalCondition.unit} | |
60 | + </Form.Item> | |
61 | + )} | |
62 | + {(item.approvalCondition?.type === 1 || | |
63 | + item.approvalCondition?.type === 2) && | |
64 | + item.approvalCondition?.judgeRule !== 1 && ( | |
65 | + <Form.Item | |
66 | + label={`${item.approvalCondition?.name} ( | |
67 | + ${TriggerAll[item.approvalCondition?.judgeRule]}):`} | |
68 | + > | |
69 | + <span> | |
70 | + {JSON.parse(item.value)} | |
71 | + {item.approvalCondition.unit} | |
72 | + </span> | |
73 | + </Form.Item> | |
74 | + )} | |
75 | + </Form> | |
76 | + | |
77 | + {/* {(item.approvalCondition?.type === 1 || | |
62 | 78 | item.approvalCondition?.type === 2) && |
63 | 79 | item.approvalCondition?.judgeRule === 1 && ( |
64 | 80 | <div |
... | ... | @@ -66,7 +82,6 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) { |
66 | 82 | > |
67 | 83 | <div style={{ marginRight: 10 }}> |
68 | 84 | <span> |
69 | - {/* <span style={{ marginRight: 10 }}> */} | |
70 | 85 | {item.approvalCondition?.name} ( |
71 | 86 | {TriggerAll[item.approvalCondition?.judgeRule]}) : |
72 | 87 | </span> |
... | ... | @@ -77,27 +92,28 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) { |
77 | 92 | ]{item.approvalCondition.unit} |
78 | 93 | </span> |
79 | 94 | </div> |
80 | - )} | |
95 | + )} */} | |
81 | 96 | {/* 选择金额或数量,判断规则不是区间 */} |
82 | - {(item.approvalCondition?.type === 1 || | |
97 | + | |
98 | + {/* {(item.approvalCondition?.type === 1 || | |
83 | 99 | item.approvalCondition?.type === 2) && |
84 | 100 | item.approvalCondition?.judgeRule !== 1 && ( |
85 | 101 | <div |
86 | 102 | style={{ display: "flex", justifyContent: "flex-start" }} |
87 | 103 | > |
88 | - <div style={{ marginRight: 10}}> | |
89 | - <span > | |
104 | + <div style={{ marginRight: 10 }}> | |
105 | + <span> | |
90 | 106 | {item.approvalCondition?.name} ( |
91 | 107 | {TriggerAll[item.approvalCondition?.judgeRule]} ): |
92 | 108 | </span> |
93 | 109 | </div> |
94 | 110 | |
95 | - <span > | |
111 | + <span> | |
96 | 112 | {JSON.parse(item.value)} |
97 | 113 | {item.approvalCondition.unit} |
98 | 114 | </span> |
99 | 115 | </div> |
100 | - )} | |
116 | + )} */} | |
101 | 117 | </div> |
102 | 118 | ))} |
103 | 119 | </div> | ... | ... |
src/pages/approval/FLowSetting/components/Modal.tsx
... | ... | @@ -41,6 +41,8 @@ interface Props { |
41 | 41 | eidt?: boolean; |
42 | 42 | readOnly?: boolean; |
43 | 43 | // preConditonList: any[]; |
44 | + abilityList: PartStorageSpace.AbilityPageVO[]; // 能力提升列表; | |
45 | + foundList: PartStorageSpace.FoundPageVO[]; //款项列表 | |
44 | 46 | preCondition: any[]; |
45 | 47 | fittingsList: PartStorageSpace.PageVO[]; |
46 | 48 | accountList: SpecialAccount.AccountInfo[]; |
... | ... | @@ -64,6 +66,8 @@ export default function setModal(props: Props) { |
64 | 66 | preCondition, |
65 | 67 | accountList, |
66 | 68 | fittingsList, |
69 | + abilityList, | |
70 | + foundList, | |
67 | 71 | } = props; |
68 | 72 | const [newData, setNewData] = useState<ApprovalProcess.InstanceInfo[]>([]); |
69 | 73 | const [deepData, setDeepData] = useState<ApprovalProcess.InstanceInfo[]>([]); |
... | ... | @@ -260,99 +264,104 @@ export default function setModal(props: Props) { |
260 | 264 | : -Infinity; |
261 | 265 | |
262 | 266 | return ( |
263 | - <React.Fragment key={`id_${index}`}> | |
264 | - <FormItem | |
265 | - label={`${index + 1}、${name || ""}(${ | |
266 | - TriggerAll[judgeRule] | |
267 | - })`} | |
268 | - // name="areaCode" | |
269 | - > | |
270 | - {judgeRule === 1 ? ( | |
271 | - <div | |
272 | - style={{ | |
273 | - height: 70, | |
274 | - width: "100%", | |
275 | - marginBottom: 20, | |
276 | - }} | |
277 | - > | |
267 | + <div | |
268 | + style={{ marginBottom: judgeRule === 1 ? 75 : 20 }} | |
269 | + key={`id_${index}`} | |
270 | + > | |
271 | + <React.Fragment key={`id_${index}`}> | |
272 | + <FormItem | |
273 | + label={`${index + 1}、${name || ""}(${ | |
274 | + TriggerAll[judgeRule] | |
275 | + })`} | |
276 | + style={{ marginBottom: 20 }} | |
277 | + > | |
278 | + {judgeRule === 1 ? ( | |
279 | + <div | |
280 | + style={{ | |
281 | + height: 70, | |
282 | + width: "100%", | |
283 | + }} | |
284 | + > | |
285 | + <div> | |
286 | + <span>下限值(不包含,值为0则包含):</span> | |
287 | + <InputNumber | |
288 | + disabled={readOnly} | |
289 | + style={{ width: "100%" }} | |
290 | + placeholder="请输入" | |
291 | + precision={type === TriggerType["数量"] ? 0 : 2} | |
292 | + max={_maxRule} | |
293 | + value={originalData.min} | |
294 | + onChange={(value) => | |
295 | + onChange( | |
296 | + data, | |
297 | + { min: value > _maxRule ? _maxRule : value }, | |
298 | + index | |
299 | + ) | |
300 | + } | |
301 | + /> | |
302 | + </div> | |
303 | + <div | |
304 | + style={{ | |
305 | + width: "100%", | |
306 | + marginTop: 20, | |
307 | + }} | |
308 | + > | |
309 | + <span>上限值(包含):</span> | |
310 | + <InputNumber | |
311 | + disabled={readOnly} | |
312 | + style={{ width: "100%" }} | |
313 | + placeholder="请输入" | |
314 | + precision={type === TriggerType["数量"] ? 0 : 2} | |
315 | + min={_minRule} | |
316 | + value={originalData.max} | |
317 | + onChange={(value) => | |
318 | + onChange( | |
319 | + data, | |
320 | + { max: value < _minRule ? _maxRule : value }, | |
321 | + index | |
322 | + ) | |
323 | + } | |
324 | + /> | |
325 | + </div> | |
326 | + </div> | |
327 | + ) : null} | |
328 | + {[2, 3, 4, 5, 6].includes(judgeRule) ? ( | |
278 | 329 | <div> |
279 | - <span>下限值(不包含):</span> | |
280 | 330 | <InputNumber |
281 | 331 | disabled={readOnly} |
282 | 332 | style={{ width: "100%" }} |
283 | 333 | placeholder="请输入" |
284 | 334 | precision={type === TriggerType["数量"] ? 0 : 2} |
285 | - max={_maxRule} | |
286 | - value={originalData.min} | |
287 | - onChange={(value) => | |
288 | - onChange( | |
289 | - data, | |
290 | - { min: value > _maxRule ? _maxRule : value }, | |
291 | - index | |
292 | - ) | |
335 | + min={_minRule} | |
336 | + value={ | |
337 | + typeof originalData === "number" | |
338 | + ? originalData | |
339 | + : undefined | |
293 | 340 | } |
341 | + onChange={(value) => onChange(data, value, index)} | |
294 | 342 | /> |
295 | 343 | </div> |
296 | - <div style={{ width: "100%" }}> | |
297 | - <span>上限值(包含):</span> | |
298 | - <InputNumber | |
299 | - disabled={readOnly} | |
300 | - style={{ width: "100%" }} | |
301 | - placeholder="请输入" | |
302 | - precision={type === TriggerType["数量"] ? 0 : 2} | |
303 | - min={_minRule} | |
304 | - value={originalData.max} | |
305 | - onChange={(value) => | |
306 | - onChange( | |
307 | - data, | |
308 | - { max: value < _minRule ? _maxRule : value }, | |
309 | - index | |
310 | - ) | |
344 | + ) : null} | |
345 | + {type === TriggerType["门店"] && ( | |
346 | + <div> | |
347 | + <ShopSelect | |
348 | + labelInValue | |
349 | + multiple | |
350 | + initType={1} | |
351 | + value={ | |
352 | + originalData.length > 0 | |
353 | + ? originalData.map((i: any) => ({ | |
354 | + value: i.idOrCode, | |
355 | + label: i.name, | |
356 | + })) | |
357 | + : [] | |
311 | 358 | } |
359 | + onChange={(value) => { | |
360 | + console.log("value:", value); | |
361 | + onChange(data, value, index); | |
362 | + }} | |
312 | 363 | /> |
313 | - </div> | |
314 | - </div> | |
315 | - ) : null} | |
316 | - {[2, 3, 4, 5, 6].includes(judgeRule) ? ( | |
317 | - <div> | |
318 | - <InputNumber | |
319 | - disabled={readOnly} | |
320 | - style={{ width: "100%" }} | |
321 | - placeholder="请输入" | |
322 | - precision={type === TriggerType["数量"] ? 0 : 2} | |
323 | - min={_minRule} | |
324 | - value={ | |
325 | - typeof originalData === "number" | |
326 | - ? originalData | |
327 | - : undefined | |
328 | - } | |
329 | - onChange={(value) => onChange(data, value, index)} | |
330 | - /> | |
331 | - </div> | |
332 | - ) : null} | |
333 | - {type === TriggerType["门店"] && ( | |
334 | - <div> | |
335 | - <ShopSelect | |
336 | - labelInValue | |
337 | - multiple | |
338 | - initType={1} | |
339 | - // onChange={(value) => { | |
340 | - // console.log("value:", value); | |
341 | - // }} | |
342 | - value={ | |
343 | - originalData.length > 0 | |
344 | - ? originalData.map((i: any) => ({ | |
345 | - value: i.idOrCode, | |
346 | - label: i.name, | |
347 | - })) | |
348 | - : [] | |
349 | - } | |
350 | - onChange={(value) => { | |
351 | - console.log("value:", value); | |
352 | - onChange(data, value, index); | |
353 | - }} | |
354 | - /> | |
355 | - {/* <Select | |
364 | + {/* <Select | |
356 | 365 | disabled={readOnly} |
357 | 366 | optionFilterProp="children" |
358 | 367 | labelInValue |
... | ... | @@ -374,169 +383,238 @@ export default function setModal(props: Props) { |
374 | 383 | </Option> |
375 | 384 | ))} |
376 | 385 | </Select> */} |
377 | - </div> | |
378 | - )} | |
379 | - {type === TriggerType["角色"] && ( | |
380 | - <div> | |
381 | - <Select | |
382 | - disabled={readOnly} | |
383 | - optionFilterProp="children" | |
384 | - labelInValue | |
385 | - value={ | |
386 | - originalData.length > 0 | |
387 | - ? originalData.map((i: any) => ({ | |
388 | - // idOrCode | |
389 | - value: i.idOrCode, | |
390 | - label: i.name, | |
391 | - })) | |
392 | - : [] | |
393 | - } | |
394 | - mode="multiple" | |
395 | - // style={{ width: '80%', marginTop: 10 }} | |
396 | - placeholder="请选择角色" | |
397 | - onChange={(value) => onChange(data, value, index)} | |
398 | - showSearch | |
399 | - > | |
400 | - {allPost.length && | |
401 | - allPost.map((item) => ( | |
402 | - <Option value={item.roleCode} key={item.roleCode}> | |
403 | - {item.roleName} | |
386 | + </div> | |
387 | + )} | |
388 | + {type === TriggerType["角色"] && ( | |
389 | + <div> | |
390 | + <Select | |
391 | + disabled={readOnly} | |
392 | + optionFilterProp="children" | |
393 | + labelInValue | |
394 | + value={ | |
395 | + originalData.length > 0 | |
396 | + ? originalData.map((i: any) => ({ | |
397 | + // idOrCode | |
398 | + value: i.idOrCode, | |
399 | + label: i.name, | |
400 | + })) | |
401 | + : [] | |
402 | + } | |
403 | + mode="multiple" | |
404 | + // style={{ width: '80%', marginTop: 10 }} | |
405 | + placeholder="请选择角色" | |
406 | + onChange={(value) => onChange(data, value, index)} | |
407 | + showSearch | |
408 | + > | |
409 | + {allPost.length && | |
410 | + allPost.map((item) => ( | |
411 | + <Option value={item.roleCode} key={item.roleCode}> | |
412 | + {item.roleName} | |
413 | + </Option> | |
414 | + ))} | |
415 | + </Select> | |
416 | + </div> | |
417 | + )} | |
418 | + {type === TriggerType["岗位"] && ( | |
419 | + <div> | |
420 | + <Select | |
421 | + disabled={readOnly} | |
422 | + optionFilterProp="children" | |
423 | + value={ | |
424 | + originalData.length > 0 | |
425 | + ? originalData.map((i: any) => ({ | |
426 | + value: i.idOrCode, | |
427 | + label: i.name, | |
428 | + })) | |
429 | + : [] | |
430 | + } | |
431 | + labelInValue | |
432 | + mode="multiple" | |
433 | + placeholder="请选择岗位" | |
434 | + onChange={(value) => { | |
435 | + onChange(data, value, index); | |
436 | + }} | |
437 | + > | |
438 | + {postList.map((item) => ( | |
439 | + <Option value={item.id} key={item.id}> | |
440 | + {item.postName} | |
404 | 441 | </Option> |
405 | 442 | ))} |
406 | - </Select> | |
407 | - </div> | |
408 | - )} | |
409 | - {type === TriggerType["岗位"] && ( | |
410 | - <div> | |
411 | - <Select | |
412 | - disabled={readOnly} | |
413 | - optionFilterProp="children" | |
414 | - value={ | |
415 | - originalData.length > 0 | |
416 | - ? originalData.map((i: any) => ({ | |
417 | - value: i.idOrCode, | |
418 | - label: i.name, | |
419 | - })) | |
420 | - : [] | |
421 | - } | |
422 | - labelInValue | |
423 | - mode="multiple" | |
424 | - placeholder="请选择岗位" | |
425 | - onChange={(value) => { | |
426 | - onChange(data, value, index); | |
427 | - }} | |
428 | - > | |
429 | - {postList.map((item) => ( | |
430 | - <Option value={item.id} key={item.id}> | |
431 | - {item.postName} | |
432 | - </Option> | |
433 | - ))} | |
434 | - </Select> | |
435 | - </div> | |
436 | - )} | |
437 | - {/* 岗位大类 */} | |
438 | - {type === TriggerType["岗位大类"] && ( | |
439 | - <div> | |
440 | - <Select | |
441 | - disabled={readOnly} | |
442 | - optionFilterProp="children" | |
443 | - value={ | |
444 | - originalData.length > 0 | |
445 | - ? originalData.map((i: any) => ({ | |
446 | - value: i.idOrCode, | |
447 | - label: i.name, | |
448 | - })) | |
449 | - : [] | |
450 | - } | |
451 | - labelInValue | |
452 | - mode="multiple" | |
453 | - placeholder="请选择岗位大类" | |
454 | - onChange={(value) => onChange(data, value, index)} | |
455 | - > | |
456 | - {postTypeList.map((item) => ( | |
457 | - <Option value={item.type} key={item.type}> | |
458 | - {item.typeName} | |
459 | - </Option> | |
460 | - ))} | |
461 | - </Select> | |
462 | - </div> | |
463 | - )} | |
464 | - {type === TriggerType["车辆区域库"] && ( | |
465 | - <Select | |
466 | - optionFilterProp="children" | |
467 | - disabled={readOnly} | |
468 | - labelInValue | |
469 | - value={ | |
470 | - originalData.length > 0 | |
471 | - ? originalData.map((i: any) => ({ | |
472 | - value: i.idOrCode, | |
473 | - label: i.name, | |
474 | - })) | |
475 | - : [] | |
476 | - } | |
477 | - mode="multiple" | |
478 | - placeholder="请选择车辆区域库" | |
479 | - onChange={(value) => onChange(data, value, index)} | |
480 | - > | |
481 | - {storageList.map((item) => ( | |
482 | - <Option value={item.id} key={item.id}> | |
483 | - {item.name} | |
484 | - </Option> | |
485 | - ))} | |
486 | - </Select> | |
487 | - )} | |
488 | - {/* 配件库房 */} | |
489 | - {type === TriggerType["配件库房"] && ( | |
490 | - <Select | |
491 | - optionFilterProp="children" | |
492 | - disabled={readOnly} | |
493 | - labelInValue | |
494 | - value={ | |
495 | - originalData.length > 0 | |
496 | - ? originalData.map((i: any) => ({ | |
497 | - value: i.idOrCode, | |
498 | - label: i.name, | |
499 | - })) | |
500 | - : [] | |
501 | - } | |
502 | - mode="multiple" | |
503 | - placeholder="请选择配件库房" | |
504 | - onChange={(value) => onChange(data, value, index)} | |
505 | - > | |
506 | - {fittingsList.map((item) => ( | |
507 | - <Option value={item.storageCode} key={item.storageCode}> | |
508 | - {item.storageName} | |
509 | - </Option> | |
510 | - ))} | |
511 | - </Select> | |
512 | - )} | |
513 | - {/* 资金账户 */} | |
514 | - {type === TriggerType["资金账户"] && ( | |
515 | - <Select | |
516 | - optionFilterProp="children" | |
517 | - disabled={readOnly} | |
518 | - labelInValue | |
519 | - value={ | |
520 | - originalData.length > 0 | |
521 | - ? originalData.map((i: any) => ({ | |
522 | - value: i.idOrCode, | |
523 | - label: i.name, | |
524 | - })) | |
525 | - : [] | |
526 | - } | |
527 | - mode="multiple" | |
528 | - placeholder="请选择资金账户" | |
529 | - onChange={(value) => onChange(data, value, index)} | |
530 | - > | |
531 | - {accountList.map((item) => ( | |
532 | - <Option value={item.id} key={item.id}> | |
533 | - {item.name} | |
534 | - </Option> | |
535 | - ))} | |
536 | - </Select> | |
537 | - )} | |
538 | - </FormItem> | |
539 | - </React.Fragment> | |
443 | + </Select> | |
444 | + </div> | |
445 | + )} | |
446 | + {/* 岗位大类 */} | |
447 | + {type === TriggerType["岗位大类"] && ( | |
448 | + <div> | |
449 | + <Select | |
450 | + disabled={readOnly} | |
451 | + optionFilterProp="children" | |
452 | + value={ | |
453 | + originalData.length > 0 | |
454 | + ? originalData.map((i: any) => ({ | |
455 | + value: i.idOrCode, | |
456 | + label: i.name, | |
457 | + })) | |
458 | + : [] | |
459 | + } | |
460 | + labelInValue | |
461 | + mode="multiple" | |
462 | + placeholder="请选择岗位大类" | |
463 | + onChange={(value) => onChange(data, value, index)} | |
464 | + > | |
465 | + {postTypeList.map((item) => ( | |
466 | + <Option value={item.type} key={item.type}> | |
467 | + {item.typeName} | |
468 | + </Option> | |
469 | + ))} | |
470 | + </Select> | |
471 | + </div> | |
472 | + )} | |
473 | + {type === TriggerType["车辆区域库"] && ( | |
474 | + <div> | |
475 | + <Select | |
476 | + optionFilterProp="children" | |
477 | + disabled={readOnly} | |
478 | + labelInValue | |
479 | + value={ | |
480 | + originalData.length > 0 | |
481 | + ? originalData.map((i: any) => ({ | |
482 | + value: i.idOrCode, | |
483 | + label: i.name, | |
484 | + })) | |
485 | + : [] | |
486 | + } | |
487 | + mode="multiple" | |
488 | + placeholder="请选择车辆区域库" | |
489 | + onChange={(value) => onChange(data, value, index)} | |
490 | + > | |
491 | + {storageList.map((item) => ( | |
492 | + <Option value={item.id} key={item.id}> | |
493 | + {item.name} | |
494 | + </Option> | |
495 | + ))} | |
496 | + </Select> | |
497 | + </div> | |
498 | + )} | |
499 | + {/* 配件库房 */} | |
500 | + {type === TriggerType["配件库房"] && ( | |
501 | + <div> | |
502 | + <Select | |
503 | + optionFilterProp="children" | |
504 | + disabled={readOnly} | |
505 | + labelInValue | |
506 | + value={ | |
507 | + originalData.length > 0 | |
508 | + ? originalData.map((i: any) => ({ | |
509 | + value: i.idOrCode, | |
510 | + label: i.name, | |
511 | + })) | |
512 | + : [] | |
513 | + } | |
514 | + mode="multiple" | |
515 | + placeholder="请选择配件库房" | |
516 | + onChange={(value) => onChange(data, value, index)} | |
517 | + > | |
518 | + {fittingsList.map((item) => ( | |
519 | + <Option | |
520 | + value={item.storageCode} | |
521 | + key={item.storageCode} | |
522 | + > | |
523 | + {item.storageName} | |
524 | + </Option> | |
525 | + ))} | |
526 | + </Select> | |
527 | + </div> | |
528 | + )} | |
529 | + {/* 资金账户 */} | |
530 | + {type === TriggerType["资金账户"] && ( | |
531 | + <div> | |
532 | + <Select | |
533 | + optionFilterProp="children" | |
534 | + disabled={readOnly} | |
535 | + labelInValue | |
536 | + value={ | |
537 | + originalData.length > 0 | |
538 | + ? originalData.map((i: any) => ({ | |
539 | + value: i.idOrCode, | |
540 | + label: i.name, | |
541 | + })) | |
542 | + : [] | |
543 | + } | |
544 | + mode="multiple" | |
545 | + placeholder="请选择资金账户" | |
546 | + onChange={(value) => onChange(data, value, index)} | |
547 | + > | |
548 | + {accountList.map((item) => ( | |
549 | + <Option value={item.id} key={item.id}> | |
550 | + {item.name} | |
551 | + </Option> | |
552 | + ))} | |
553 | + </Select> | |
554 | + </div> | |
555 | + )} | |
556 | + {/* 能力提升 */} | |
557 | + {type === TriggerType["能力提升业务类型"] && ( | |
558 | + <div> | |
559 | + <Select | |
560 | + disabled={readOnly} | |
561 | + optionFilterProp="children" | |
562 | + value={ | |
563 | + originalData.length > 0 | |
564 | + ? originalData.map((i: any) => ({ | |
565 | + value: i.idOrCode, | |
566 | + label: i.name, | |
567 | + })) | |
568 | + : [] | |
569 | + } | |
570 | + labelInValue | |
571 | + mode="multiple" | |
572 | + placeholder="请选择能力提升业务类型" | |
573 | + onChange={(value) => { | |
574 | + onChange(data, value, index); | |
575 | + }} | |
576 | + > | |
577 | + {abilityList.map((item) => ( | |
578 | + <Option value={item.id} key={item.id}> | |
579 | + {item.name} | |
580 | + </Option> | |
581 | + ))} | |
582 | + </Select> | |
583 | + </div> | |
584 | + )} | |
585 | + {/* 款项 */} | |
586 | + | |
587 | + {type === TriggerType["款项"] && ( | |
588 | + <div> | |
589 | + <Select | |
590 | + disabled={readOnly} | |
591 | + optionFilterProp="children" | |
592 | + value={ | |
593 | + originalData.length > 0 | |
594 | + ? originalData.map((i: any) => ({ | |
595 | + value: i.idOrCode, | |
596 | + label: i.name, | |
597 | + })) | |
598 | + : [] | |
599 | + } | |
600 | + labelInValue | |
601 | + mode="multiple" | |
602 | + placeholder="请选择款项类型" | |
603 | + onChange={(value) => { | |
604 | + onChange(data, value, index); | |
605 | + }} | |
606 | + > | |
607 | + {foundList.map((item) => ( | |
608 | + <Option value={item.value} key={item.value}> | |
609 | + {item.name} | |
610 | + </Option> | |
611 | + ))} | |
612 | + </Select> | |
613 | + </div> | |
614 | + )} | |
615 | + </FormItem> | |
616 | + </React.Fragment> | |
617 | + </div> | |
540 | 618 | ); |
541 | 619 | })} |
542 | 620 | </Form> | ... | ... |
src/pages/approval/FLowSetting/entity.ts
... | ... | @@ -15,13 +15,9 @@ export enum TriggerType { |
15 | 15 | "配件库房" = 7, |
16 | 16 | "车辆区域库" = 8, |
17 | 17 | "资金账户" = 9, |
18 | - // "数量" = 1, | |
19 | - // "金额" = 2, | |
20 | - // "门店" = 3, | |
21 | - // "岗位" = 4, | |
22 | - // "角色" = 5, | |
23 | - // "自定义" = 6, | |
24 | - // "区域库" = 7, | |
18 | + "能力提升业务类型" = 10, | |
19 | + "款项" = 11, | |
20 | + | |
25 | 21 | } |
26 | 22 | |
27 | 23 | export enum TriggerMode { | ... | ... |
src/pages/approval/PreSetting/components/CreateItem.tsx
... | ... | @@ -14,8 +14,6 @@ const layout = { |
14 | 14 | wrapperCol: { span: 20 }, |
15 | 15 | }; |
16 | 16 | interface Props { |
17 | - // visible: boolean; | |
18 | - // setVisible?: any; | |
19 | 17 | item: PreSetting.Item; |
20 | 18 | setItem: any; |
21 | 19 | approvalConfigId: number; |
... | ... | @@ -54,9 +52,7 @@ export default function CreateItem({ |
54 | 52 | .then((res) => { |
55 | 53 | message.success("保存成功"); |
56 | 54 | setItem({visible: false}); |
57 | - // setVisible(false); | |
58 | 55 | setListLoading(true); |
59 | - // setParams({ current: 1 }, true); | |
60 | 56 | }) |
61 | 57 | .catch((err) => message.error(err.message)) |
62 | 58 | .finally(() => { |
... | ... | @@ -69,7 +65,6 @@ export default function CreateItem({ |
69 | 65 | <Modal |
70 | 66 | title={`${id?'编辑':'新增'}预设条件`} |
71 | 67 | visible={visible} |
72 | - // onCancel={() => setVisible(false)} | |
73 | 68 | onCancel={() => setItem({ visible: false })} |
74 | 69 | onOk={() => form.submit()} |
75 | 70 | confirmLoading={loading} |
... | ... | @@ -115,17 +110,13 @@ export default function CreateItem({ |
115 | 110 | |
116 | 111 | <Form.Item |
117 | 112 | noStyle |
118 | - shouldUpdate={(prevValues, currentValues) => | |
119 | - prevValues.type !== currentValues.type | |
120 | - } | |
113 | + shouldUpdate={(prevValues, currentValues) => prevValues.type !== currentValues.type} | |
121 | 114 | > |
122 | - {({ getFieldValue }) => | |
123 | - [1, 2].includes(getFieldValue("type")) ? ( | |
124 | - <Form.Item name="unit" label="单位" rules={[{ required: true }]}> | |
125 | - <Input placeholder="请输入单位" maxLength={4} /> | |
126 | - </Form.Item> | |
127 | - ) : null | |
128 | - } | |
115 | + {({ getFieldValue }) => ([1, 2].includes(getFieldValue("type")) ? ( | |
116 | + <Form.Item name="unit" label="单位" rules={[{ required: true }]}> | |
117 | + <Input placeholder="请输入单位" maxLength={4} /> | |
118 | + </Form.Item> | |
119 | + ) : null)} | |
129 | 120 | </Form.Item> |
130 | 121 | {conditionType && ( |
131 | 122 | <Form.Item |
... | ... | @@ -136,14 +127,14 @@ export default function CreateItem({ |
136 | 127 | <Select placeholder="请选择"> |
137 | 128 | {[1, 2].includes(conditionType) |
138 | 129 | ? Judge_Rule1.map((item) => ( |
139 | - <Option value={item.value} key={item.value}> | |
140 | - {item.label} | |
141 | - </Option> | |
130 | + <Option value={item.value} key={item.value}> | |
131 | + {item.label} | |
132 | + </Option> | |
142 | 133 | )) |
143 | 134 | : Judge_Rule2.map((item) => ( |
144 | - <Option value={item.value} key={item.value}> | |
145 | - {item.label} | |
146 | - </Option> | |
135 | + <Option value={item.value} key={item.value}> | |
136 | + {item.label} | |
137 | + </Option> | |
147 | 138 | ))} |
148 | 139 | </Select> |
149 | 140 | </Form.Item> | ... | ... |
src/pages/approval/PreSetting/entity.ts
... | ... | @@ -11,9 +11,11 @@ export const Condition_Type = [ |
11 | 11 | { label: "配件库房", value: 7 }, |
12 | 12 | { label: "车辆区域库", value: 8 }, |
13 | 13 | { label: "资金账户", value: 9 }, |
14 | + { label: "能力提升业务类型", value: 10 }, | |
15 | + { label: "款项", value: 11 }, | |
14 | 16 | ]; |
15 | -export enum Condition_Type_Enum{ | |
16 | - "数量"=1, | |
17 | +export enum Condition_Type_Enum { | |
18 | + "数量" = 1, | |
17 | 19 | "金额", |
18 | 20 | "门店", |
19 | 21 | "岗位", |
... | ... | @@ -22,7 +24,9 @@ export enum Condition_Type_Enum{ |
22 | 24 | "配件库房", |
23 | 25 | "车辆区域库", |
24 | 26 | "资金账户", |
25 | -} | |
27 | + "能力提升业务类型", | |
28 | + "款项" | |
29 | +} | |
26 | 30 | |
27 | 31 | // 判断规则,1区间、2大于等于、3小于等于、4大于、5小于、6等于、7属于、8不属于 |
28 | 32 | export const Judge_Rule1 = [ |
... | ... | @@ -38,8 +42,8 @@ export const Judge_Rule2 = [ |
38 | 42 | { label: "不属于", value: 8 }, |
39 | 43 | ]; |
40 | 44 | |
41 | -export enum Judge_Rule_Enum{ | |
42 | - "区间"=1, | |
45 | +export enum Judge_Rule_Enum { | |
46 | + "区间" = 1, | |
43 | 47 | "大于等于", |
44 | 48 | "小于等于", |
45 | 49 | "大于", | ... | ... |
src/pages/approval/PreSetting/index.tsx
... | ... | @@ -63,10 +63,7 @@ export default function PreSetting({ match }: Props) { |
63 | 63 | <Description term="审批编号">{approvalNo || ""}</Description> |
64 | 64 | </DescriptionList> |
65 | 65 | <div style={{ height: 15 }} /> |
66 | - <DescriptionList size="large" title="" col={1}> | |
67 | - {/* <Description term="审批名称">{approvalName || ""}</Description> */} | |
68 | - {/* <Description term="审批名称">{approvalName || ""}</Description> */} | |
69 | - </DescriptionList> | |
66 | + | |
70 | 67 | <div |
71 | 68 | style={{ |
72 | 69 | marginBottom: 20, |
... | ... | @@ -82,7 +79,6 @@ export default function PreSetting({ match }: Props) { |
82 | 79 | <Table |
83 | 80 | dataSource={data} |
84 | 81 | rowKey={(record) => `id_${record.id}`} |
85 | - // pagination={false} | |
86 | 82 | loading={loading} |
87 | 83 | scroll={{ x: 500, y: 350 }} |
88 | 84 | > | ... | ... |
src/pages/attendance/FieldService/subpages/Work/components/Modal.tsx
src/pages/backlog/TaskConfig/api.ts
... | ... | @@ -50,6 +50,8 @@ export interface ListVO { |
50 | 50 | customTemp?: boolean; // 是否使用自定义模板 |
51 | 51 | customTempPath?: string; // 自定义模板路径 |
52 | 52 | closeStand?: boolean; // 是否关单站岗 |
53 | + /** 工作类型 */ | |
54 | + workType?:number; | |
53 | 55 | } |
54 | 56 | |
55 | 57 | export function getConfigListApi(params: ListParams): http.PromisePageResp<ListVO> { | ... | ... |
src/pages/backlog/TaskConfig/components/CreateModal.tsx
... | ... | @@ -14,6 +14,10 @@ interface Props { |
14 | 14 | onCancel: () => void; |
15 | 15 | onRefreshing: () => void; |
16 | 16 | item: ListVO; |
17 | + /** 系统列表 */ | |
18 | + systemList: any[]; | |
19 | + /** 工作类型列表 */ | |
20 | + workTyoeList: any[]; | |
17 | 21 | /** 角色列表 */ |
18 | 22 | // roleList: CommonApi.RoleCodeVO[], |
19 | 23 | } |
... | ... | @@ -22,13 +26,16 @@ export default function CreateModal({ |
22 | 26 | onCancel, |
23 | 27 | item, |
24 | 28 | onRefreshing, |
29 | + systemList, | |
30 | + workTyoeList, | |
25 | 31 | }: Props) { |
26 | 32 | const [form] = Form.useForm(); |
27 | 33 | const [saveLoading, setSaveLoading] = useState(false); |
28 | - const { list } = usePagination(systemListApi, { current: 1, pageSize: 100 }); | |
29 | 34 | const [value, setValue] = useState<ValueVO[]>([]); |
30 | 35 | |
31 | 36 | useEffect(() => { |
37 | + /** 编辑时,表单数据回显 */ | |
38 | + // if (visible && item.id) { | |
32 | 39 | if (visible) { |
33 | 40 | const prePageParam: { [key: string]: any } = JSON.parse( |
34 | 41 | item.pageParam || "{}" |
... | ... | @@ -53,6 +60,7 @@ export default function CreateModal({ |
53 | 60 | notifyType: item.notifyType || 1, |
54 | 61 | pageParam, |
55 | 62 | applySysId: item.applySysId, |
63 | + workType: item.workType, | |
56 | 64 | customTemp: item.customTemp, |
57 | 65 | customTempPath: item.customTempPath, |
58 | 66 | closeStand: checkNull(item.closeStand) ? true : item.closeStand, |
... | ... | @@ -109,6 +117,7 @@ export default function CreateModal({ |
109 | 117 | title={item.itemCode ? "编辑待办项" : "新增待办项"} |
110 | 118 | confirmLoading={saveLoading} |
111 | 119 | maskClosable={false} |
120 | + // afterClose={() => form.resetFields()} | |
112 | 121 | > |
113 | 122 | <Form |
114 | 123 | form={form} |
... | ... | @@ -180,7 +189,9 @@ export default function CreateModal({ |
180 | 189 | |
181 | 190 | <Form.Item |
182 | 191 | noStyle |
183 | - shouldUpdate={(pre, cur) => pre.dock !== cur.dock || pre.itemType !== cur.itemType} | |
192 | + shouldUpdate={(pre, cur) => | |
193 | + pre.dock !== cur.dock || pre.itemType !== cur.itemType | |
194 | + } | |
184 | 195 | > |
185 | 196 | {({ getFieldValue }) => { |
186 | 197 | const dock = getFieldValue("dock"); |
... | ... | @@ -207,9 +218,11 @@ export default function CreateModal({ |
207 | 218 | |
208 | 219 | <Form.Item |
209 | 220 | noStyle |
210 | - shouldUpdate={(pre, cur) => pre.customTemp !== cur.customTemp || | |
221 | + shouldUpdate={(pre, cur) => | |
222 | + pre.customTemp !== cur.customTemp || | |
211 | 223 | pre.dock !== cur.dock || |
212 | - pre.itemType !== cur.itemType} | |
224 | + pre.itemType !== cur.itemType | |
225 | + } | |
213 | 226 | > |
214 | 227 | {({ getFieldValue }) => { |
215 | 228 | const dock = getFieldValue("dock"); |
... | ... | @@ -242,9 +255,11 @@ export default function CreateModal({ |
242 | 255 | |
243 | 256 | <Form.Item |
244 | 257 | noStyle |
245 | - shouldUpdate={(pre, cur) => pre.dock !== cur.dock || | |
258 | + shouldUpdate={(pre, cur) => | |
259 | + pre.dock !== cur.dock || | |
246 | 260 | pre.itemType !== cur.itemType || |
247 | - pre.customTemp !== cur.customTemp} | |
261 | + pre.customTemp !== cur.customTemp | |
262 | + } | |
248 | 263 | > |
249 | 264 | {({ getFieldValue }) => { |
250 | 265 | const dock = getFieldValue("dock"); |
... | ... | @@ -322,7 +337,9 @@ export default function CreateModal({ |
322 | 337 | |
323 | 338 | <Form.Item |
324 | 339 | noStyle |
325 | - shouldUpdate={(pre, cur) => pre.itemType !== cur.itemType || pre.customTemp !== cur.customTemp} | |
340 | + shouldUpdate={(pre, cur) => | |
341 | + pre.itemType !== cur.itemType || pre.customTemp !== cur.customTemp | |
342 | + } | |
326 | 343 | > |
327 | 344 | {({ getFieldValue }) => { |
328 | 345 | const itemType = getFieldValue("itemType"); |
... | ... | @@ -364,7 +381,7 @@ export default function CreateModal({ |
364 | 381 | rules={[{ required: true, message: "适用系统不能为空" }]} |
365 | 382 | > |
366 | 383 | <Select placeholder="请选择"> |
367 | - {list.map((item) => ( | |
384 | + {systemList.map((item) => ( | |
368 | 385 | <Select.Option value={item.id} key={item.id}> |
369 | 386 | {item.sysName} |
370 | 387 | </Select.Option> |
... | ... | @@ -384,6 +401,19 @@ export default function CreateModal({ |
384 | 401 | ))} |
385 | 402 | </Radio.Group> |
386 | 403 | </Form.Item> |
404 | + <Form.Item | |
405 | + name="workType" | |
406 | + label="工作类型" | |
407 | + rules={[{ required: true, message: "工作类型不能为空" }]} | |
408 | + > | |
409 | + <Select placeholder="请选择"> | |
410 | + {workTyoeList.map((item) => ( | |
411 | + <Select.Option value={item.id} key={item.id}> | |
412 | + {item.name} | |
413 | + </Select.Option> | |
414 | + ))} | |
415 | + </Select> | |
416 | + </Form.Item> | |
387 | 417 | </Form> |
388 | 418 | </Modal> |
389 | 419 | ); | ... | ... |
src/pages/backlog/TaskConfig/index.tsx
1 | 1 | import React, { useState, useEffect } from "react"; |
2 | 2 | import { PageHeaderWrapper } from "@ant-design/pro-layout"; |
3 | -import { Card, Table, Popconfirm, Switch, message, Button, Input, Select } from "antd"; | |
3 | +import { | |
4 | + Card, | |
5 | + Table, | |
6 | + Popconfirm, | |
7 | + Switch, | |
8 | + message, | |
9 | + Button, | |
10 | + Input, | |
11 | + Select, | |
12 | +} from "antd"; | |
4 | 13 | import { PlusOutlined } from "@ant-design/icons"; |
5 | 14 | import usePagination from "@/hooks/usePagination"; |
6 | -import { ListVO, getConfigListApi, taskEnableApi, taskDeleteApi, taskDisableApi } from "./api"; | |
15 | +import { | |
16 | + ListVO, | |
17 | + getConfigListApi, | |
18 | + taskEnableApi, | |
19 | + taskDeleteApi, | |
20 | + taskDisableApi, | |
21 | +} from "./api"; | |
7 | 22 | import { TodoTypeEnum } from "./entity"; |
8 | 23 | import moment from "moment"; |
9 | 24 | import { debounce } from "lodash"; |
10 | 25 | import CreateModal from "./components/CreateModal"; |
11 | 26 | import { getAllRoleCodeApi } from "@/common/api"; |
12 | 27 | import { systemListApi } from "@/pages/admin/Privilege/api"; |
28 | +import { | |
29 | + getWorkTypeListApi, | |
30 | + WorkTypeListVO, | |
31 | +} from "@/pages/backlog/WorkTypeConfig/api"; | |
13 | 32 | |
14 | 33 | const Column = Table.Column; |
15 | 34 | const Search = Input.Search; |
16 | 35 | |
17 | 36 | export default function TaskConfig() { |
18 | - const { list, loading, paginationConfig, setList, setParams, setLoading } = usePagination<ListVO>( | |
19 | - getConfigListApi, | |
20 | - {}, | |
21 | - {} | |
22 | - ); | |
37 | + const { list, loading, paginationConfig, setList, setParams, setLoading } = | |
38 | + usePagination<ListVO>(getConfigListApi, {}, {}); | |
23 | 39 | const [switchLoading, setSwitchLoading] = useState(false); |
24 | - const [modalData, setModalData] = useState<{ visible: boolean; row: ListVO }>({ visible: false, row: {} }); | |
40 | + const [modalData, setModalData] = useState<{ visible: boolean; row: ListVO }>( | |
41 | + { visible: false, row: {} } | |
42 | + ); | |
43 | + /** | |
44 | + * 查询系统列表 | |
45 | + */ | |
46 | + const { list: syslist } = usePagination(systemListApi, { | |
47 | + current: 1, | |
48 | + pageSize: 100, | |
49 | + }); | |
25 | 50 | |
26 | - const { list: syslist } = usePagination(systemListApi, { current: 1, pageSize: 100 }); | |
51 | + /** | |
52 | + * 查询工作类型列表 | |
53 | + */ | |
54 | + const { list: workTyoeList } = usePagination<WorkTypeListVO>( | |
55 | + getWorkTypeListApi, | |
56 | + { pageSize: 1000 } | |
57 | + ); | |
27 | 58 | |
28 | 59 | useEffect(() => { |
29 | 60 | getAllRoleCodeApi() |
30 | - .then((res) => { | |
31 | - }) | |
61 | + .then((res) => {}) | |
32 | 62 | .catch((e) => { |
33 | 63 | message.error(`获取角色列表失败:${e.message}`); |
34 | 64 | }); |
... | ... | @@ -78,9 +108,9 @@ export default function TaskConfig() { |
78 | 108 | }; |
79 | 109 | |
80 | 110 | //根据系统名称搜索 |
81 | - const _onChangeSys = debounce((e: any) => { | |
82 | - setParams({ sysId: e, current: 1 }, true); | |
83 | - }, 500); | |
111 | + const _onChangeSys = (value: any) => { | |
112 | + setParams({ ...value, current: 1 }, true); | |
113 | + }; | |
84 | 114 | |
85 | 115 | return ( |
86 | 116 | <PageHeaderWrapper title="待办配置"> |
... | ... | @@ -95,34 +125,113 @@ export default function TaskConfig() { |
95 | 125 | }} |
96 | 126 | > |
97 | 127 | <div style={{ display: "flex" }}> |
98 | - <Search allowClear placeholder="搜索待办名" onChange={(e) => _onChange(e.target.value)} style={{ maxWidth: 260, marginRight: 15 }} /> | |
99 | - <Select allowClear placeholder="搜索系统名称" style={{ width: 260, marginRight: 5 }} onChange={(e: any) => _onChangeSys(e)}> | |
128 | + <Search | |
129 | + allowClear | |
130 | + placeholder="搜索待办名" | |
131 | + onChange={(e) => _onChange(e.target.value)} | |
132 | + style={{ maxWidth: 260, marginRight: 15 }} | |
133 | + /> | |
134 | + <Select | |
135 | + allowClear | |
136 | + placeholder="选择归属系统" | |
137 | + style={{ width: 260, marginRight: 5 }} | |
138 | + onChange={(value: any) => _onChangeSys({ sysId: value })} | |
139 | + showSearch | |
140 | + optionFilterProp="children" | |
141 | + > | |
100 | 142 | {syslist.map((item) => ( |
101 | 143 | <Select.Option value={item.id!} key={item.id}> |
102 | 144 | {item.sysName} |
103 | 145 | </Select.Option> |
104 | 146 | ))} |
105 | 147 | </Select> |
148 | + <Select | |
149 | + allowClear | |
150 | + placeholder="选择工作类型" | |
151 | + style={{ width: 260, marginRight: 5 }} | |
152 | + onChange={(value: number) => _onChangeSys({ workType: value })} | |
153 | + showSearch | |
154 | + optionFilterProp="children" | |
155 | + > | |
156 | + {workTyoeList.map((item) => ( | |
157 | + <Select.Option value={item.id!} key={item.id}> | |
158 | + {item.name} | |
159 | + </Select.Option> | |
160 | + ))} | |
161 | + </Select> | |
106 | 162 | </div> |
107 | - <Button type="primary" icon={<PlusOutlined />} onClick={() => triggerModal()}> | |
163 | + <Button | |
164 | + type="primary" | |
165 | + icon={<PlusOutlined />} | |
166 | + onClick={() => triggerModal()} | |
167 | + > | |
108 | 168 | 新增配置 |
109 | 169 | </Button> |
110 | 170 | </div> |
111 | - <Table loading={loading} dataSource={list} pagination={paginationConfig} rowKey="itemCode"> | |
171 | + <Table | |
172 | + loading={loading} | |
173 | + dataSource={list} | |
174 | + pagination={paginationConfig} | |
175 | + rowKey="itemCode" | |
176 | + > | |
112 | 177 | <Column title="待办项" dataIndex="itemName" align="center" /> |
113 | 178 | <Column title="待办编码" dataIndex="itemCode" align="center" /> |
114 | - <Column title="类型" dataIndex="itemType" align="center" render={(t) => TodoTypeEnum[t]} /> | |
179 | + <Column | |
180 | + title="类型" | |
181 | + dataIndex="itemType" | |
182 | + align="center" | |
183 | + render={(t) => TodoTypeEnum[t]} | |
184 | + /> | |
115 | 185 | |
116 | - <Column title="对接新待办" dataIndex="dock" align="center" render={(text) => (String(text) === "true" ? "是" : "否")} /> | |
117 | - <Column title="待办时效考核" dataIndex="assess" align="center" render={(text) => (String(text) === "true" ? "是" : "否")} /> | |
118 | - <Column title="创建时间" dataIndex="createTime" align="center" render={(text) => moment(text).format("YYYY-MM-DD")} /> | |
186 | + <Column | |
187 | + title="对接新待办" | |
188 | + dataIndex="dock" | |
189 | + align="center" | |
190 | + render={(text) => (String(text) === "true" ? "是" : "否")} | |
191 | + /> | |
192 | + <Column | |
193 | + title="待办时效考核" | |
194 | + dataIndex="assess" | |
195 | + align="center" | |
196 | + render={(text) => (String(text) === "true" ? "是" : "否")} | |
197 | + /> | |
198 | + <Column | |
199 | + title="归属系统" | |
200 | + dataIndex="applySysName" | |
201 | + align="center" | |
202 | + render={(text) => <span>{text || "--"}</span>} | |
203 | + /> | |
204 | + <Column | |
205 | + title="工作类型" | |
206 | + dataIndex="workTypeName" | |
207 | + align="center" | |
208 | + render={(text) => <span>{text || "--"}</span>} | |
209 | + /> | |
210 | + <Column | |
211 | + title="创建时间" | |
212 | + dataIndex="createTime" | |
213 | + align="center" | |
214 | + render={(text) => moment(text).format("YYYY-MM-DD")} | |
215 | + /> | |
119 | 216 | <Column |
120 | 217 | title="状态" |
121 | 218 | align="center" |
122 | 219 | dataIndex="status" |
123 | 220 | render={(val, row: ListVO) => ( |
124 | - <Popconfirm placement="top" title={`确认${val ? "禁用" : "启用"}?`} onConfirm={() => handleChangeStatus(row)} onCancel={() => setSwitchLoading(false)}> | |
125 | - <Switch checkedChildren="启用" unCheckedChildren="禁用" checked={!!val} size="small" loading={switchLoading} onClick={() => setSwitchLoading(true)} /> | |
221 | + <Popconfirm | |
222 | + placement="top" | |
223 | + title={`确认${val ? "禁用" : "启用"}?`} | |
224 | + onConfirm={() => handleChangeStatus(row)} | |
225 | + onCancel={() => setSwitchLoading(false)} | |
226 | + > | |
227 | + <Switch | |
228 | + checkedChildren="启用" | |
229 | + unCheckedChildren="禁用" | |
230 | + checked={!!val} | |
231 | + size="small" | |
232 | + loading={switchLoading} | |
233 | + onClick={() => setSwitchLoading(true)} | |
234 | + /> | |
126 | 235 | </Popconfirm> |
127 | 236 | )} |
128 | 237 | /> |
... | ... | @@ -134,7 +243,11 @@ export default function TaskConfig() { |
134 | 243 | <Button type="link" onClick={() => triggerModal(row)}> |
135 | 244 | 编辑 |
136 | 245 | </Button> |
137 | - <Popconfirm placement="top" title="确认删除?" onConfirm={() => handleDelete(row)}> | |
246 | + <Popconfirm | |
247 | + placement="top" | |
248 | + title="确认删除?" | |
249 | + onConfirm={() => handleDelete(row)} | |
250 | + > | |
138 | 251 | <Button type="link">删除</Button> |
139 | 252 | </Popconfirm> |
140 | 253 | </> |
... | ... | @@ -146,6 +259,8 @@ export default function TaskConfig() { |
146 | 259 | onCancel={triggerModal} |
147 | 260 | onRefreshing={() => setLoading(true)} |
148 | 261 | item={modalData.row} |
262 | + systemList={syslist || []} | |
263 | + workTyoeList={workTyoeList || []} | |
149 | 264 | /> |
150 | 265 | </Card> |
151 | 266 | </PageHeaderWrapper> | ... | ... |
src/pages/backlog/TaskTime/index.tsx
... | ... | @@ -81,7 +81,6 @@ export default function TaskConfig() { |
81 | 81 | }} |
82 | 82 | /> |
83 | 83 | <Column |
84 | - // title="待办延时时间" | |
85 | 84 | title={ |
86 | 85 | <Popover |
87 | 86 | placement="topLeft" |
... | ... | @@ -93,7 +92,6 @@ export default function TaskConfig() { |
93 | 92 | } |
94 | 93 | > |
95 | 94 | <span> |
96 | - {" "} | |
97 | 95 | 待办延时时间 |
98 | 96 | <ExclamationCircleFilled style={{ color: "#40a9ff" }} /> |
99 | 97 | </span> | ... | ... |
src/pages/backlog/WorkTypeConfig/api.ts
0 → 100644
1 | +/* | |
2 | + * @Date: 2021-12-29 15:35:12 | |
3 | + * @LastEditors: wangqiang@feewee.cn | |
4 | + * @LastEditTime: 2022-01-05 17:53:12 | |
5 | + */ | |
6 | +import request from "@/utils/request"; | |
7 | +import { common } from "@/typing/common"; | |
8 | +import { BACKLOG } from "@/utils/host"; | |
9 | +import { http } from "@/typing/http"; | |
10 | + | |
11 | +interface ListParams extends common.PaginationParam { | |
12 | + keywords?: string; | |
13 | +} | |
14 | + | |
15 | +export interface Pramas { | |
16 | + name?: string; | |
17 | +} | |
18 | +/** | |
19 | + * 列表项 | |
20 | + */ | |
21 | +export interface WorkTypeListVO { | |
22 | + id?: number; //ID | |
23 | + name?: string; // 名称 | |
24 | + createTime?: string; //创建时间 | |
25 | +} | |
26 | + | |
27 | +/** | |
28 | + * 工作类型列表 | |
29 | + * @param name 类型名称 | |
30 | + * @returns | |
31 | + */ | |
32 | +export function getWorkTypeListApi(params: Pramas): http.PromisePageResp<WorkTypeListVO> { | |
33 | + return request.get(`${BACKLOG}/work/type/list`, { params }); | |
34 | +} | |
35 | + | |
36 | +export interface SaveParams { | |
37 | + /** 名称 */ | |
38 | + name: string, | |
39 | +} | |
40 | + | |
41 | +/** | |
42 | + * 新增|编辑工作类 | |
43 | + * work/type/save | |
44 | + * @param id | |
45 | + * @returns | |
46 | + */ | |
47 | +export function saveWorkType(params: SaveParams) { | |
48 | + return request.post(`${BACKLOG}/work/type/save`, { ...params }); | |
49 | +} | |
50 | + | |
51 | +/** | |
52 | + * 删除工作类型 | |
53 | + */ | |
54 | +export function deleteWorkTypeApi(id: number): http.PromisePageResp<null> { | |
55 | + return request.get(`${BACKLOG}/work/type/delete`, { params: { id } }); | |
56 | +} | ... | ... |
src/pages/backlog/WorkTypeConfig/components/CreateModal.tsx
0 → 100644
1 | +import React, { useEffect, useState } from "react"; | |
2 | +import { Modal, Form, Input, message } from "antd"; | |
3 | +import { WorkTypeListVO, saveWorkType } from "../api"; | |
4 | + | |
5 | +interface Props { | |
6 | + visible: boolean; | |
7 | + onCancel: () => void; | |
8 | + onRefreshing: () => void; | |
9 | + item: WorkTypeListVO; | |
10 | +} | |
11 | +export default function CreateModal({ | |
12 | + visible, | |
13 | + onCancel, | |
14 | + item, | |
15 | + onRefreshing, | |
16 | +}: Props) { | |
17 | + const [form] = Form.useForm(); | |
18 | + const [saveLoading, setSaveLoading] = useState(false); | |
19 | + | |
20 | + useEffect(() => { | |
21 | + if (visible) { | |
22 | + form.setFieldsValue({ | |
23 | + ...item, | |
24 | + }); | |
25 | + } | |
26 | + }, [visible]); | |
27 | + | |
28 | + function handleSave(feildValue: any) { | |
29 | + setSaveLoading(true); | |
30 | + const params = { | |
31 | + ...feildValue, | |
32 | + id: item.id, | |
33 | + name: (feildValue.name || "").trim(), | |
34 | + }; | |
35 | + | |
36 | + setSaveLoading(false); | |
37 | + saveWorkType(params) | |
38 | + .then((res) => { | |
39 | + message.success("保存成功!"); | |
40 | + onCancel && onCancel(); | |
41 | + }) | |
42 | + .catch((e) => { | |
43 | + message.error(e.message); | |
44 | + }) | |
45 | + .finally(() => setSaveLoading(false)); | |
46 | + } | |
47 | + | |
48 | + return ( | |