Commit ff7dbaab06fa63de6b033c30fae44cb0544a6e94
Merge remote-tracking branch 'origin/master' into bug_fix
Showing
8 changed files
with
81 additions
and
46 deletions
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, ABILITY_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 | /** |
... | ... | @@ -113,6 +114,14 @@ export function getStoragePage(params?: PartStorageSpace.QueryPageParam): http.P |
113 | 114 | * |
114 | 115 | * /ability/erp/exam/config/standard/all/list |
115 | 116 | */ |
116 | - export function getAbilityPage(): http.PromiseResp <PartStorageSpace.AbilityPageVO> { | |
117 | +export function getAbilityPage(): http.PromiseResp<PartStorageSpace.AbilityPageVO[]> { | |
117 | 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`); | |
118 | 127 | } |
119 | 128 | \ No newline at end of file | ... | ... |
src/pages/approval/FLowSetting/components/ConditionSetting.tsx
... | ... | @@ -10,6 +10,7 @@ import { |
10 | 10 | getPostTypeList, |
11 | 11 | getAbilityPage, |
12 | 12 | processDeleteApi, //删除流程 |
13 | + getFoundPage, | |
13 | 14 | } from "../api"; |
14 | 15 | import useInitial from "@/hooks/useInitail"; |
15 | 16 | import { getShopApi, getAllRoleCodeApi } from "@/common/api"; |
... | ... | @@ -78,6 +79,8 @@ export default function ConditionSetting({ match }: Props) { |
78 | 79 | * 能力提升业务类型列表 |
79 | 80 | */ |
80 | 81 | const { data: abilityList } = useInitial(getAbilityPage, [], {}); |
82 | + // 款项列表 | |
83 | + const { data: foundList } = useInitial(getFoundPage, [], {}); | |
81 | 84 | |
82 | 85 | useEffect(() => { |
83 | 86 | if (preConditonList.length) { |
... | ... | @@ -292,6 +295,7 @@ export default function ConditionSetting({ match }: Props) { |
292 | 295 | preCondition={preCondition} |
293 | 296 | accountList={accountList} |
294 | 297 | fittingsList={fittingsList} |
298 | + foundList={foundList} | |
295 | 299 | /> |
296 | 300 | <DetailItem detailItem={detailItem} setDetailItem={setDetailItem} /> |
297 | 301 | </PageHeaderWrapper> | ... | ... |
src/pages/approval/FLowSetting/components/Modal.tsx
... | ... | @@ -42,6 +42,7 @@ interface Props { |
42 | 42 | readOnly?: boolean; |
43 | 43 | // preConditonList: any[]; |
44 | 44 | abilityList: PartStorageSpace.AbilityPageVO[]; // 能力提升列表; |
45 | + foundList: PartStorageSpace.FoundPageVO[]; //款项列表 | |
45 | 46 | preCondition: any[]; |
46 | 47 | fittingsList: PartStorageSpace.PageVO[]; |
47 | 48 | accountList: SpecialAccount.AccountInfo[]; |
... | ... | @@ -66,6 +67,7 @@ export default function setModal(props: Props) { |
66 | 67 | accountList, |
67 | 68 | fittingsList, |
68 | 69 | abilityList, |
70 | + foundList, | |
69 | 71 | } = props; |
70 | 72 | const [newData, setNewData] = useState<ApprovalProcess.InstanceInfo[]>([]); |
71 | 73 | const [deepData, setDeepData] = useState<ApprovalProcess.InstanceInfo[]>([]); |
... | ... | @@ -262,7 +264,10 @@ export default function setModal(props: Props) { |
262 | 264 | : -Infinity; |
263 | 265 | |
264 | 266 | return ( |
265 | - <div style={{ marginBottom: judgeRule===1?75:20 }}> | |
267 | + <div | |
268 | + style={{ marginBottom: judgeRule === 1 ? 75 : 20 }} | |
269 | + key={`id_${index}`} | |
270 | + > | |
266 | 271 | <React.Fragment key={`id_${index}`}> |
267 | 272 | <FormItem |
268 | 273 | label={`${index + 1}、${name || ""}(${ |
... | ... | @@ -343,9 +348,6 @@ export default function setModal(props: Props) { |
343 | 348 | labelInValue |
344 | 349 | multiple |
345 | 350 | initType={1} |
346 | - // onChange={(value) => { | |
347 | - // console.log("value:", value); | |
348 | - // }} | |
349 | 351 | value={ |
350 | 352 | originalData.length > 0 |
351 | 353 | ? originalData.map((i: any) => ({ |
... | ... | @@ -551,7 +553,6 @@ export default function setModal(props: Props) { |
551 | 553 | </Select> |
552 | 554 | </div> |
553 | 555 | )} |
554 | - | |
555 | 556 | {/* 能力提升 */} |
556 | 557 | {type === TriggerType["能力提升业务类型"] && ( |
557 | 558 | <div> |
... | ... | @@ -581,6 +582,36 @@ export default function setModal(props: Props) { |
581 | 582 | </Select> |
582 | 583 | </div> |
583 | 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 | + )} | |
584 | 615 | </FormItem> |
585 | 616 | </React.Fragment> |
586 | 617 | </div> | ... | ... |
src/pages/approval/FLowSetting/entity.ts
... | ... | @@ -16,13 +16,8 @@ export enum TriggerType { |
16 | 16 | "车辆区域库" = 8, |
17 | 17 | "资金账户" = 9, |
18 | 18 | "能力提升业务类型" = 10, |
19 | - // "数量" = 1, | |
20 | - // "金额" = 2, | |
21 | - // "门店" = 3, | |
22 | - // "岗位" = 4, | |
23 | - // "角色" = 5, | |
24 | - // "自定义" = 6, | |
25 | - // "区域库" = 7, | |
19 | + "款项" = 11, | |
20 | + | |
26 | 21 | } |
27 | 22 | |
28 | 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
... | ... | @@ -12,9 +12,10 @@ export const Condition_Type = [ |
12 | 12 | { label: "车辆区域库", value: 8 }, |
13 | 13 | { label: "资金账户", value: 9 }, |
14 | 14 | { label: "能力提升业务类型", value: 10 }, |
15 | + { label: "款项", value: 11 }, | |
15 | 16 | ]; |
16 | -export enum Condition_Type_Enum{ | |
17 | - "数量"=1, | |
17 | +export enum Condition_Type_Enum { | |
18 | + "数量" = 1, | |
18 | 19 | "金额", |
19 | 20 | "门店", |
20 | 21 | "岗位", |
... | ... | @@ -24,7 +25,8 @@ export enum Condition_Type_Enum{ |
24 | 25 | "车辆区域库", |
25 | 26 | "资金账户", |
26 | 27 | "能力提升业务类型", |
27 | -} | |
28 | + "款项" | |
29 | +} | |
28 | 30 | |
29 | 31 | // 判断规则,1区间、2大于等于、3小于等于、4大于、5小于、6等于、7属于、8不属于 |
30 | 32 | export const Judge_Rule1 = [ |
... | ... | @@ -40,8 +42,8 @@ export const Judge_Rule2 = [ |
40 | 42 | { label: "不属于", value: 8 }, |
41 | 43 | ]; |
42 | 44 | |
43 | -export enum Judge_Rule_Enum{ | |
44 | - "区间"=1, | |
45 | +export enum Judge_Rule_Enum { | |
46 | + "区间" = 1, | |
45 | 47 | "大于等于", |
46 | 48 | "小于等于", |
47 | 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/pms/storage/StorageManage/interface.d.ts