Commit ae0a4b0e83aaebdceedf07d71de14a8a91e90870

Authored by 赵凤
1 parent 0fb75a0d

add款项

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&lt;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/entity.ts
... ... @@ -14,8 +14,8 @@ export const Condition_Type = [
14 14 { label: "能力提升业务类型", value: 10 },
15 15 { label: "款项", value: 11 },
16 16 ];
17   -export enum Condition_Type_Enum{
18   - "数量"=1,
  17 +export enum Condition_Type_Enum {
  18 + "数量" = 1,
19 19 "金额",
20 20 "门店",
21 21 "岗位",
... ... @@ -25,7 +25,8 @@ export enum Condition_Type_Enum{
25 25 "车辆区域库",
26 26 "资金账户",
27 27 "能力提升业务类型",
28   -}
  28 + "款项"
  29 +}
29 30  
30 31 // 判断规则,1区间、2大于等于、3小于等于、4大于、5小于、6等于、7属于、8不属于
31 32 export const Judge_Rule1 = [
... ... @@ -41,8 +42,8 @@ export const Judge_Rule2 = [
41 42 { label: "不属于", value: 8 },
42 43 ];
43 44  
44   -export enum Judge_Rule_Enum{
45   - "区间"=1,
  45 +export enum Judge_Rule_Enum {
  46 + "区间" = 1,
46 47 "大于等于",
47 48 "小于等于",
48 49 "大于",
... ...
src/pages/pms/storage/StorageManage/interface.d.ts
... ... @@ -27,6 +27,13 @@ declare namespace PartStorageSpace {
27 27 name?: string, //业务类型名
28 28 }
29 29  
  30 + /**
  31 + * 款项列表项
  32 + */
  33 + interface FoundPageVO {
  34 + name?: string,
  35 + value?: string
  36 + }
30 37 interface StoreDetail {
31 38 id?: number,
32 39 //仓库名
... ...