diff --git a/config/routers/backlog.ts b/config/routers/backlog.ts index 7cfd11d..3be2bac 100644 --- a/config/routers/backlog.ts +++ b/config/routers/backlog.ts @@ -7,4 +7,9 @@ export default [ path: "./backlog/taskTime", // 待办时效 component: "./backlog/TaskTime", }, + /**工作类型配置 */ + { + path: "./backlog/workConfig", + component: "./backlog/WorkTypeConfig", + }, ]; diff --git a/config/routers/fvm.ts b/config/routers/fvm.ts index cead8e7..c79d50a 100644 --- a/config/routers/fvm.ts +++ b/config/routers/fvm.ts @@ -304,6 +304,14 @@ export default [ path: "fvm/allowance/edit/:id?", // 折让确认管理编辑新增 component: "./stock/AllowanceConfirm/EditComfirm/index", }, + { + path: "fvm/directVehicles/allowance", // 直营车折让确认 + component: "./stock/DirectVehicles", + }, + { + path: "fvm/directVehicles/edit/:id?", // 直营车折让确认编辑啊 + component: "./stock/DirectVehicles/EditComfirm", + }, // OTD计划设置 { path: "/fvm/plan/ticket/execution", diff --git a/config/routers/mkt.ts b/config/routers/mkt.ts index 34f208c..8f653a5 100644 --- a/config/routers/mkt.ts +++ b/config/routers/mkt.ts @@ -5,7 +5,7 @@ export default [ component: './mkt/ActivityManage', }, { - path: '/mkt/manage/create/:activityNo?/:status?', + path: '/mkt/manage/create/:activityNo?/:status?/:change?', component: './mkt/ActivityCreate', }, /**活动中奖概况运维 */ @@ -18,6 +18,10 @@ export default [ component: './mkt/articleList', }, { + path: '/mkt/original/article', // 原创文章 + component: './mkt/articleList', + }, + { path: '/mkt/poster', //海报库列表 component: './mkt/posterList', }, diff --git a/src/components/FeeweeUpload/index.tsx b/src/components/FeeweeUpload/index.tsx index bc9e887..4ba77ec 100644 --- a/src/components/FeeweeUpload/index.tsx +++ b/src/components/FeeweeUpload/index.tsx @@ -3,17 +3,17 @@ * @LastEditors: wangqiang@feewee.cn * @LastEditTime: 2021-03-11 12:55:38 */ -import React from 'react'; -import { message, Upload } from 'antd'; -import { UploadProps } from 'antd/lib/upload'; -import { RcFile, UploadFile } from 'antd/lib/upload/interface'; -import getFidFile from '@/utils/getFidFile'; +import React from "react"; +import { message, Upload } from "antd"; +import { UploadProps } from "antd/lib/upload"; +import { RcFile, UploadFile } from "antd/lib/upload/interface"; +import getFidFile from "@/utils/getFidFile"; interface Props extends UploadProps { - isFid?: boolean // 预览文件 路径是否为 fid 形式 - limitSize?: number // 限制文件大小,单位MB - limitUnit?: 'kb' | 'mb' | 'KB' | 'MB' // 限制大小单位, 默认MB - children?: React.ReactNode + isFid?: boolean; // 预览文件 路径是否为 fid 形式 + limitSize?: number; // 限制文件大小,单位MB + limitUnit?: "kb" | "mb" | "KB" | "MB"; // 限制大小单位, 默认MB + children?: React.ReactNode; } /** @@ -29,17 +29,23 @@ interface Props extends UploadProps { } * @param {Props} props */ -export default function FeeweeUpload({ isFid = false, limitSize = undefined, limitUnit = 'MB', children, ...props }: Props) { +export default function FeeweeUpload({ + isFid = false, + limitSize = undefined, + limitUnit = "MB", + children, + ...props +}: Props) { const onPreview = (file: UploadFile) => { if (props.onPreview) { props.onPreview(file); return; } getFidFile(file.response.data, isFid); - } + }; const beforeUpload = (file: RcFile, filelist: RcFile[]) => { - if (limitSize !== undefined && typeof limitSize === 'number') { + if (limitSize !== undefined && typeof limitSize === "number") { const limit = isExceededSize(file, limitSize, limitUnit); if (limit.success) { return true; @@ -50,27 +56,23 @@ export default function FeeweeUpload({ isFid = false, limitSize = undefined, lim * 当表单中使用时,可以在getValueFromEvent回调函数中多添加2行判断函数: * if (e.file.status === 'size_limit') { * return e.fileList.filter((file: any) => file.uid !== e.file.uid); - * } - */ - // @ts-ignore - file.status = 'size_limit'; + * } + */ + // @ts-ignore + file.status = "size_limit"; return false; } } return props.beforeUpload ? props.beforeUpload(file, filelist) : true; - } + }; return ( <> - + {children} - ) + ); } /** @@ -79,11 +81,14 @@ export default function FeeweeUpload({ isFid = false, limitSize = undefined, lim * @param {'kb' | 'mb' | 'KB' | 'MB'} limitUnit * @return {number} */ -function getLimitSize(limitSize: number, limitUnit: 'kb' | 'mb' | 'KB' | 'MB'): number { - if (limitUnit === 'kb' || limitUnit === 'KB') { +function getLimitSize( + limitSize: number, + limitUnit: "kb" | "mb" | "KB" | "MB" +): number { + if (limitUnit === "kb" || limitUnit === "KB") { return limitSize; } - if (limitUnit === 'mb' || limitUnit === 'MB') { + if (limitUnit === "mb" || limitUnit === "MB") { return limitSize * 1024; } return 0; @@ -96,15 +101,20 @@ function getLimitSize(limitSize: number, limitUnit: 'kb' | 'mb' | 'KB' | 'MB'): * @param {*} limitUnit * @return {{ success: boolean, msg?: string }} */ -function isExceededSize(file: RcFile, limitSize: number, limitUnit: 'kb' | 'mb' | 'KB' | 'MB'): { success: boolean, msg?: string } { +function isExceededSize( + file: RcFile, + limitSize: number, + limitUnit: "kb" | "mb" | "KB" | "MB" +): { success: boolean; msg?: string } { const _limitSize = getLimitSize(limitSize, limitUnit); const fileSizeToKB = file.size / 1024; if (fileSizeToKB <= _limitSize) { - return { success: true }; } else { - - return { success: false, msg: `文件【${file.name}】大小不能超过${limitSize}${limitUnit}` }; + return { + success: false, + msg: `文件【${file.name}】大小不能超过${limitSize}${limitUnit}`, + }; } -} \ No newline at end of file +} diff --git a/src/pages/approval/ApprovalSetting/components/CreateItem.tsx b/src/pages/approval/ApprovalSetting/components/CreateItem.tsx index 0cd10ff..b1f6363 100644 --- a/src/pages/approval/ApprovalSetting/components/CreateItem.tsx +++ b/src/pages/approval/ApprovalSetting/components/CreateItem.tsx @@ -209,7 +209,7 @@ export default function CreateItem({ item, setItem, setParams }: Props) { diff --git a/src/pages/approval/FLowSetting/api.ts b/src/pages/approval/FLowSetting/api.ts index 7fd535f..b27015a 100644 --- a/src/pages/approval/FLowSetting/api.ts +++ b/src/pages/approval/FLowSetting/api.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { http } from '@/typing/http'; -import { Approval_HOST, FVM_HOST, EHR_HOST, FINANCE2_HOST, PMS_HOST } from '@/utils/host'; +import { Approval_HOST, FVM_HOST, EHR_HOST, FINANCE2_HOST, PMS_HOST, ABILITY_HOST, } from '@/utils/host'; type P = Promise>; @@ -24,7 +24,8 @@ export function fetchProcessList(approvalConfigId: number): http.PromiseResp { return request.get(`${PMS_HOST}/erp/storage/page`, { params }); } + +/** 能力提升业务类型分页列表 + * + * /ability/erp/exam/config/standard/all/list + */ +export function getAbilityPage(): http.PromiseResp { + return request.get(`${ABILITY_HOST}/erp/exam/config/standard/all/list`); +} + +/** + * 款项列表 + * /common/refundable/types + */ +export function getFoundPage(): http.PromiseResp { + return request.get(`${FINANCE2_HOST}/common/refundable/types`); +} \ No newline at end of file diff --git a/src/pages/approval/FLowSetting/components/ConditionSetting.tsx b/src/pages/approval/FLowSetting/components/ConditionSetting.tsx index 048ae8f..b0f670a 100644 --- a/src/pages/approval/FLowSetting/components/ConditionSetting.tsx +++ b/src/pages/approval/FLowSetting/components/ConditionSetting.tsx @@ -8,7 +8,9 @@ import { getStoragePage, getAccountApi, getPostTypeList, + getAbilityPage, processDeleteApi, //删除流程 + getFoundPage, } from "../api"; import useInitial from "@/hooks/useInitail"; import { getShopApi, getAllRoleCodeApi } from "@/common/api"; @@ -73,6 +75,13 @@ export default function ConditionSetting({ match }: Props) { approvalConfigId ); + /** + * 能力提升业务类型列表 + */ + const { data: abilityList } = useInitial(getAbilityPage, [], {}); + // 款项列表 + const { data: foundList } = useInitial(getFoundPage, [], {}); + useEffect(() => { if (preConditonList.length) { const _temp = preConditonList.map((item) => ({ @@ -232,7 +241,6 @@ export default function ConditionSetting({ match }: Props) { style={{ marginLeft: 20 }} size="small" ghost - // onClick={() => onDelete(item.id)} > 删除 @@ -282,11 +290,12 @@ export default function ConditionSetting({ match }: Props) { form={form} eidt={!!currentItem.length} readOnly={readOnly} - // preConditionList={preConditonList} postTypeList={postTypeList} + abilityList={abilityList} preCondition={preCondition} accountList={accountList} fittingsList={fittingsList} + foundList={foundList} /> diff --git a/src/pages/approval/FLowSetting/components/DetailItem.tsx b/src/pages/approval/FLowSetting/components/DetailItem.tsx index 569625b..95e24c8 100644 --- a/src/pages/approval/FLowSetting/components/DetailItem.tsx +++ b/src/pages/approval/FLowSetting/components/DetailItem.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState, useRef } from "react"; import PostSelect from "@/components/PostSelect"; -import { Modal, Descriptions } from "antd"; +import { Modal, Descriptions, Form } from "antd"; import { TriggerType, TriggerAll, TriggerSelect, TriggerMode } from "../entity"; import _, { identity } from "lodash"; @@ -20,7 +20,6 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) { visible={visible} onCancel={hide} title="流程详情" - width={600} maskClosable={false} footer={null} > @@ -29,36 +28,53 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) {

触发条件:

{ViewItem.processConditions?.map((item) => ( -
+
{/* 除金额和数量以外的类型 区间展示 */} - {item.approvalCondition?.type !== 1 && - item.approvalCondition?.type !== 2 && ( -
-
- - {item.approvalCondition?.name} ( - {TriggerAll[item.approvalCondition?.judgeRule]}): +
+ {item.approvalCondition?.type !== 1 && + item.approvalCondition?.type !== 2 && ( + + + [ + {JSON.parse(item.value) + .map((i) => i.name) + .join(",")} + ] -
+ + )} - {/*
*/} -
- [ - {JSON.parse(item.value) - .map((i) => i.name) - .join(",")} - ] -
-
- )} - {/* 选择金额或数量,判断规则为区间 */} - {(item.approvalCondition?.type === 1 || + {/* 选择金额或数量,判断规则为区间 */} + {(item.approvalCondition?.type === 1 || + item.approvalCondition?.type === 2) && + item.approvalCondition?.judgeRule === 1 && ( + + [{JSON.parse(item.value).min},{JSON.parse(item.value).max} + ]{item.approvalCondition.unit} + + )} + {(item.approvalCondition?.type === 1 || + item.approvalCondition?.type === 2) && + item.approvalCondition?.judgeRule !== 1 && ( + + + {JSON.parse(item.value)} + {item.approvalCondition.unit} + + + )} + + + {/* {(item.approvalCondition?.type === 1 || item.approvalCondition?.type === 2) && item.approvalCondition?.judgeRule === 1 && (
- {/* */} {item.approvalCondition?.name} ( {TriggerAll[item.approvalCondition?.judgeRule]}) : @@ -77,27 +92,28 @@ export default function DetailItem({ detailItem, setDetailItem }: Props) { ]{item.approvalCondition.unit}
- )} + )} */} {/* 选择金额或数量,判断规则不是区间 */} - {(item.approvalCondition?.type === 1 || + + {/* {(item.approvalCondition?.type === 1 || item.approvalCondition?.type === 2) && item.approvalCondition?.judgeRule !== 1 && (
-
- +
+ {item.approvalCondition?.name} ( {TriggerAll[item.approvalCondition?.judgeRule]} ):
- + {JSON.parse(item.value)} {item.approvalCondition.unit}
- )} + )} */}
))}
diff --git a/src/pages/approval/FLowSetting/components/Modal.tsx b/src/pages/approval/FLowSetting/components/Modal.tsx index ecd8fe0..635292c 100644 --- a/src/pages/approval/FLowSetting/components/Modal.tsx +++ b/src/pages/approval/FLowSetting/components/Modal.tsx @@ -41,6 +41,8 @@ interface Props { eidt?: boolean; readOnly?: boolean; // preConditonList: any[]; + abilityList: PartStorageSpace.AbilityPageVO[]; // 能力提升列表; + foundList: PartStorageSpace.FoundPageVO[]; //款项列表 preCondition: any[]; fittingsList: PartStorageSpace.PageVO[]; accountList: SpecialAccount.AccountInfo[]; @@ -64,6 +66,8 @@ export default function setModal(props: Props) { preCondition, accountList, fittingsList, + abilityList, + foundList, } = props; const [newData, setNewData] = useState([]); const [deepData, setDeepData] = useState([]); @@ -260,99 +264,104 @@ export default function setModal(props: Props) { : -Infinity; return ( - - - {judgeRule === 1 ? ( -
+
+ + + {judgeRule === 1 ? ( +
+
+ 下限值(不包含,值为0则包含): + + onChange( + data, + { min: value > _maxRule ? _maxRule : value }, + index + ) + } + /> +
+
+ 上限值(包含): + + onChange( + data, + { max: value < _minRule ? _maxRule : value }, + index + ) + } + /> +
+
+ ) : null} + {[2, 3, 4, 5, 6].includes(judgeRule) ? (
- 下限值(不包含): - onChange( - data, - { min: value > _maxRule ? _maxRule : value }, - index - ) + min={_minRule} + value={ + typeof originalData === "number" + ? originalData + : undefined } + onChange={(value) => onChange(data, value, index)} />
-
- 上限值(包含): - - onChange( - data, - { max: value < _minRule ? _maxRule : value }, - index - ) + ) : null} + {type === TriggerType["门店"] && ( +
+ 0 + ? originalData.map((i: any) => ({ + value: i.idOrCode, + label: i.name, + })) + : [] } + onChange={(value) => { + console.log("value:", value); + onChange(data, value, index); + }} /> -
-
- ) : null} - {[2, 3, 4, 5, 6].includes(judgeRule) ? ( -
- onChange(data, value, index)} - /> -
- ) : null} - {type === TriggerType["门店"] && ( -
- { - // console.log("value:", value); - // }} - value={ - originalData.length > 0 - ? originalData.map((i: any) => ({ - value: i.idOrCode, - label: i.name, - })) - : [] - } - onChange={(value) => { - console.log("value:", value); - onChange(data, value, index); - }} - /> - {/* */} -
- )} - {type === TriggerType["角色"] && ( -
- 0 + ? originalData.map((i: any) => ({ + // idOrCode + value: i.idOrCode, + label: i.name, + })) + : [] + } + mode="multiple" + // style={{ width: '80%', marginTop: 10 }} + placeholder="请选择角色" + onChange={(value) => onChange(data, value, index)} + showSearch + > + {allPost.length && + allPost.map((item) => ( + + ))} + +
+ )} + {type === TriggerType["岗位"] && ( +
+ -
- )} - {type === TriggerType["岗位"] && ( -
- -
- )} - {/* 岗位大类 */} - {type === TriggerType["岗位大类"] && ( -
- -
- )} - {type === TriggerType["车辆区域库"] && ( - - )} - {/* 配件库房 */} - {type === TriggerType["配件库房"] && ( - - )} - {/* 资金账户 */} - {type === TriggerType["资金账户"] && ( - - )} -
-
+ +
+ )} + {/* 岗位大类 */} + {type === TriggerType["岗位大类"] && ( +
+ +
+ )} + {type === TriggerType["车辆区域库"] && ( +
+ +
+ )} + {/* 配件库房 */} + {type === TriggerType["配件库房"] && ( +
+ +
+ )} + {/* 资金账户 */} + {type === TriggerType["资金账户"] && ( +
+ +
+ )} + {/* 能力提升 */} + {type === TriggerType["能力提升业务类型"] && ( +
+ +
+ )} + {/* 款项 */} + + {type === TriggerType["款项"] && ( +
+ +
+ )} + + +
); })} diff --git a/src/pages/approval/FLowSetting/entity.ts b/src/pages/approval/FLowSetting/entity.ts index 788668a..26c8423 100644 --- a/src/pages/approval/FLowSetting/entity.ts +++ b/src/pages/approval/FLowSetting/entity.ts @@ -15,13 +15,9 @@ export enum TriggerType { "配件库房" = 7, "车辆区域库" = 8, "资金账户" = 9, - // "数量" = 1, - // "金额" = 2, - // "门店" = 3, - // "岗位" = 4, - // "角色" = 5, - // "自定义" = 6, - // "区域库" = 7, + "能力提升业务类型" = 10, + "款项" = 11, + } export enum TriggerMode { diff --git a/src/pages/approval/PreSetting/components/CreateItem.tsx b/src/pages/approval/PreSetting/components/CreateItem.tsx index b12bd0c..114f719 100644 --- a/src/pages/approval/PreSetting/components/CreateItem.tsx +++ b/src/pages/approval/PreSetting/components/CreateItem.tsx @@ -14,8 +14,6 @@ const layout = { wrapperCol: { span: 20 }, }; interface Props { - // visible: boolean; - // setVisible?: any; item: PreSetting.Item; setItem: any; approvalConfigId: number; @@ -54,9 +52,7 @@ export default function CreateItem({ .then((res) => { message.success("保存成功"); setItem({visible: false}); - // setVisible(false); setListLoading(true); - // setParams({ current: 1 }, true); }) .catch((err) => message.error(err.message)) .finally(() => { @@ -69,7 +65,6 @@ export default function CreateItem({ setVisible(false)} onCancel={() => setItem({ visible: false })} onOk={() => form.submit()} confirmLoading={loading} @@ -115,17 +110,13 @@ export default function CreateItem({ - prevValues.type !== currentValues.type - } + shouldUpdate={(prevValues, currentValues) => prevValues.type !== currentValues.type} > - {({ getFieldValue }) => - [1, 2].includes(getFieldValue("type")) ? ( - - - - ) : null - } + {({ getFieldValue }) => ([1, 2].includes(getFieldValue("type")) ? ( + + + + ) : null)} {conditionType && ( {[1, 2].includes(conditionType) ? Judge_Rule1.map((item) => ( - + )) : Judge_Rule2.map((item) => ( - + ))} diff --git a/src/pages/approval/PreSetting/entity.ts b/src/pages/approval/PreSetting/entity.ts index d8100a9..282c0f3 100644 --- a/src/pages/approval/PreSetting/entity.ts +++ b/src/pages/approval/PreSetting/entity.ts @@ -11,9 +11,11 @@ export const Condition_Type = [ { label: "配件库房", value: 7 }, { label: "车辆区域库", value: 8 }, { label: "资金账户", value: 9 }, + { label: "能力提升业务类型", value: 10 }, + { label: "款项", value: 11 }, ]; -export enum Condition_Type_Enum{ - "数量"=1, +export enum Condition_Type_Enum { + "数量" = 1, "金额", "门店", "岗位", @@ -22,7 +24,9 @@ export enum Condition_Type_Enum{ "配件库房", "车辆区域库", "资金账户", -} + "能力提升业务类型", + "款项" +} // 判断规则,1区间、2大于等于、3小于等于、4大于、5小于、6等于、7属于、8不属于 export const Judge_Rule1 = [ @@ -38,8 +42,8 @@ export const Judge_Rule2 = [ { label: "不属于", value: 8 }, ]; -export enum Judge_Rule_Enum{ - "区间"=1, +export enum Judge_Rule_Enum { + "区间" = 1, "大于等于", "小于等于", "大于", diff --git a/src/pages/approval/PreSetting/index.tsx b/src/pages/approval/PreSetting/index.tsx index 2b20eb4..672bdd1 100644 --- a/src/pages/approval/PreSetting/index.tsx +++ b/src/pages/approval/PreSetting/index.tsx @@ -63,10 +63,7 @@ export default function PreSetting({ match }: Props) { {approvalNo || ""}
- - {/* {approvalName || ""} */} - {/* {approvalName || ""} */} - +
`id_${record.id}`} - // pagination={false} loading={loading} scroll={{ x: 500, y: 350 }} > diff --git a/src/pages/attendance/FieldService/subpages/Work/components/Modal.tsx b/src/pages/attendance/FieldService/subpages/Work/components/Modal.tsx index 2ed90e0..48033c8 100644 --- a/src/pages/attendance/FieldService/subpages/Work/components/Modal.tsx +++ b/src/pages/attendance/FieldService/subpages/Work/components/Modal.tsx @@ -85,7 +85,7 @@ function CreateModal(props: Props) { onOk={form.submit} onCancel={() => setVisiable(false)} maskClosable={false} - getContainer={false} + // getContainer={false} >
{ diff --git a/src/pages/backlog/TaskConfig/components/CreateModal.tsx b/src/pages/backlog/TaskConfig/components/CreateModal.tsx index 0a0d80a..7adf7e8 100644 --- a/src/pages/backlog/TaskConfig/components/CreateModal.tsx +++ b/src/pages/backlog/TaskConfig/components/CreateModal.tsx @@ -14,6 +14,10 @@ interface Props { onCancel: () => void; onRefreshing: () => void; item: ListVO; + /** 系统列表 */ + systemList: any[]; + /** 工作类型列表 */ + workTyoeList: any[]; /** 角色列表 */ // roleList: CommonApi.RoleCodeVO[], } @@ -22,13 +26,16 @@ export default function CreateModal({ onCancel, item, onRefreshing, + systemList, + workTyoeList, }: Props) { const [form] = Form.useForm(); const [saveLoading, setSaveLoading] = useState(false); - const { list } = usePagination(systemListApi, { current: 1, pageSize: 100 }); const [value, setValue] = useState([]); useEffect(() => { + /** 编辑时,表单数据回显 */ + // if (visible && item.id) { if (visible) { const prePageParam: { [key: string]: any } = JSON.parse( item.pageParam || "{}" @@ -53,6 +60,7 @@ export default function CreateModal({ notifyType: item.notifyType || 1, pageParam, applySysId: item.applySysId, + workType: item.workType, customTemp: item.customTemp, customTempPath: item.customTempPath, closeStand: checkNull(item.closeStand) ? true : item.closeStand, @@ -109,6 +117,7 @@ export default function CreateModal({ title={item.itemCode ? "编辑待办项" : "新增待办项"} confirmLoading={saveLoading} maskClosable={false} + // afterClose={() => form.resetFields()} > pre.dock !== cur.dock || pre.itemType !== cur.itemType} + shouldUpdate={(pre, cur) => + pre.dock !== cur.dock || pre.itemType !== cur.itemType + } > {({ getFieldValue }) => { const dock = getFieldValue("dock"); @@ -207,9 +218,11 @@ export default function CreateModal({ pre.customTemp !== cur.customTemp || + shouldUpdate={(pre, cur) => + pre.customTemp !== cur.customTemp || pre.dock !== cur.dock || - pre.itemType !== cur.itemType} + pre.itemType !== cur.itemType + } > {({ getFieldValue }) => { const dock = getFieldValue("dock"); @@ -242,9 +255,11 @@ export default function CreateModal({ pre.dock !== cur.dock || + shouldUpdate={(pre, cur) => + pre.dock !== cur.dock || pre.itemType !== cur.itemType || - pre.customTemp !== cur.customTemp} + pre.customTemp !== cur.customTemp + } > {({ getFieldValue }) => { const dock = getFieldValue("dock"); @@ -322,7 +337,9 @@ export default function CreateModal({ pre.itemType !== cur.itemType || pre.customTemp !== cur.customTemp} + shouldUpdate={(pre, cur) => + pre.itemType !== cur.itemType || pre.customTemp !== cur.customTemp + } > {({ getFieldValue }) => { const itemType = getFieldValue("itemType"); @@ -364,7 +381,7 @@ export default function CreateModal({ rules={[{ required: true, message: "适用系统不能为空" }]} > + {workTyoeList.map((item) => ( + + {item.name} + + ))} + + ); diff --git a/src/pages/backlog/TaskConfig/index.tsx b/src/pages/backlog/TaskConfig/index.tsx index 89fbef7..a9a09d3 100644 --- a/src/pages/backlog/TaskConfig/index.tsx +++ b/src/pages/backlog/TaskConfig/index.tsx @@ -1,34 +1,64 @@ import React, { useState, useEffect } from "react"; import { PageHeaderWrapper } from "@ant-design/pro-layout"; -import { Card, Table, Popconfirm, Switch, message, Button, Input, Select } from "antd"; +import { + Card, + Table, + Popconfirm, + Switch, + message, + Button, + Input, + Select, +} from "antd"; import { PlusOutlined } from "@ant-design/icons"; import usePagination from "@/hooks/usePagination"; -import { ListVO, getConfigListApi, taskEnableApi, taskDeleteApi, taskDisableApi } from "./api"; +import { + ListVO, + getConfigListApi, + taskEnableApi, + taskDeleteApi, + taskDisableApi, +} from "./api"; import { TodoTypeEnum } from "./entity"; import moment from "moment"; import { debounce } from "lodash"; import CreateModal from "./components/CreateModal"; import { getAllRoleCodeApi } from "@/common/api"; import { systemListApi } from "@/pages/admin/Privilege/api"; +import { + getWorkTypeListApi, + WorkTypeListVO, +} from "@/pages/backlog/WorkTypeConfig/api"; const Column = Table.Column; const Search = Input.Search; export default function TaskConfig() { - const { list, loading, paginationConfig, setList, setParams, setLoading } = usePagination( - getConfigListApi, - {}, - {} - ); + const { list, loading, paginationConfig, setList, setParams, setLoading } = + usePagination(getConfigListApi, {}, {}); const [switchLoading, setSwitchLoading] = useState(false); - const [modalData, setModalData] = useState<{ visible: boolean; row: ListVO }>({ visible: false, row: {} }); + const [modalData, setModalData] = useState<{ visible: boolean; row: ListVO }>( + { visible: false, row: {} } + ); + /** + * 查询系统列表 + */ + const { list: syslist } = usePagination(systemListApi, { + current: 1, + pageSize: 100, + }); - const { list: syslist } = usePagination(systemListApi, { current: 1, pageSize: 100 }); + /** + * 查询工作类型列表 + */ + const { list: workTyoeList } = usePagination( + getWorkTypeListApi, + { pageSize: 1000 } + ); useEffect(() => { getAllRoleCodeApi() - .then((res) => { - }) + .then((res) => {}) .catch((e) => { message.error(`获取角色列表失败:${e.message}`); }); @@ -78,9 +108,9 @@ export default function TaskConfig() { }; //根据系统名称搜索 - const _onChangeSys = debounce((e: any) => { - setParams({ sysId: e, current: 1 }, true); - }, 500); + const _onChangeSys = (value: any) => { + setParams({ ...value, current: 1 }, true); + }; return ( @@ -95,34 +125,113 @@ export default function TaskConfig() { }} >
- _onChange(e.target.value)} style={{ maxWidth: 260, marginRight: 15 }} /> - _onChangeSys({ sysId: value })} + showSearch + optionFilterProp="children" + > {syslist.map((item) => ( {item.sysName} ))} +
-
- +
- TodoTypeEnum[t]} /> + TodoTypeEnum[t]} + /> - (String(text) === "true" ? "是" : "否")} /> - (String(text) === "true" ? "是" : "否")} /> - moment(text).format("YYYY-MM-DD")} /> + (String(text) === "true" ? "是" : "否")} + /> + (String(text) === "true" ? "是" : "否")} + /> + {text || "--"}} + /> + {text || "--"}} + /> + moment(text).format("YYYY-MM-DD")} + /> ( - handleChangeStatus(row)} onCancel={() => setSwitchLoading(false)}> - setSwitchLoading(true)} /> + handleChangeStatus(row)} + onCancel={() => setSwitchLoading(false)} + > + setSwitchLoading(true)} + /> )} /> @@ -134,7 +243,11 @@ export default function TaskConfig() { - handleDelete(row)}> + handleDelete(row)} + > @@ -146,6 +259,8 @@ export default function TaskConfig() { onCancel={triggerModal} onRefreshing={() => setLoading(true)} item={modalData.row} + systemList={syslist || []} + workTyoeList={workTyoeList || []} /> diff --git a/src/pages/backlog/TaskTime/index.tsx b/src/pages/backlog/TaskTime/index.tsx index 56cdaa3..716b095 100644 --- a/src/pages/backlog/TaskTime/index.tsx +++ b/src/pages/backlog/TaskTime/index.tsx @@ -81,7 +81,6 @@ export default function TaskConfig() { }} /> - {" "} 待办延时时间   diff --git a/src/pages/backlog/WorkTypeConfig/api.ts b/src/pages/backlog/WorkTypeConfig/api.ts new file mode 100644 index 0000000..e8d9ae8 --- /dev/null +++ b/src/pages/backlog/WorkTypeConfig/api.ts @@ -0,0 +1,56 @@ +/* + * @Date: 2021-12-29 15:35:12 + * @LastEditors: wangqiang@feewee.cn + * @LastEditTime: 2022-01-05 17:53:12 + */ +import request from "@/utils/request"; +import { common } from "@/typing/common"; +import { BACKLOG } from "@/utils/host"; +import { http } from "@/typing/http"; + +interface ListParams extends common.PaginationParam { + keywords?: string; +} + +export interface Pramas { + name?: string; +} +/** + * 列表项 + */ +export interface WorkTypeListVO { + id?: number; //ID + name?: string; // 名称 + createTime?: string; //创建时间 +} + +/** + * 工作类型列表 + * @param name 类型名称 + * @returns + */ +export function getWorkTypeListApi(params: Pramas): http.PromisePageResp { + return request.get(`${BACKLOG}/work/type/list`, { params }); +} + +export interface SaveParams { + /** 名称 */ + name: string, +} + +/** + * 新增|编辑工作类 + * work/type/save + * @param id + * @returns + */ +export function saveWorkType(params: SaveParams) { + return request.post(`${BACKLOG}/work/type/save`, { ...params }); +} + +/** + * 删除工作类型 + */ +export function deleteWorkTypeApi(id: number): http.PromisePageResp { + return request.get(`${BACKLOG}/work/type/delete`, { params: { id } }); +} diff --git a/src/pages/backlog/WorkTypeConfig/components/CreateModal.tsx b/src/pages/backlog/WorkTypeConfig/components/CreateModal.tsx new file mode 100644 index 0000000..eb37284 --- /dev/null +++ b/src/pages/backlog/WorkTypeConfig/components/CreateModal.tsx @@ -0,0 +1,76 @@ +import React, { useEffect, useState } from "react"; +import { Modal, Form, Input, message } from "antd"; +import { WorkTypeListVO, saveWorkType } from "../api"; + +interface Props { + visible: boolean; + onCancel: () => void; + onRefreshing: () => void; + item: WorkTypeListVO; +} +export default function CreateModal({ + visible, + onCancel, + item, + onRefreshing, +}: Props) { + const [form] = Form.useForm(); + const [saveLoading, setSaveLoading] = useState(false); + + useEffect(() => { + if (visible) { + form.setFieldsValue({ + ...item, + }); + } + }, [visible]); + + function handleSave(feildValue: any) { + setSaveLoading(true); + const params = { + ...feildValue, + id: item.id, + name: (feildValue.name || "").trim(), + }; + + setSaveLoading(false); + saveWorkType(params) + .then((res) => { + message.success("保存成功!"); + onCancel && onCancel(); + }) + .catch((e) => { + message.error(e.message); + }) + .finally(() => setSaveLoading(false)); + } + + return ( + { + form.resetFields(); + }} + > +
+ + + + +
+ ); +} diff --git a/src/pages/backlog/WorkTypeConfig/entity.ts b/src/pages/backlog/WorkTypeConfig/entity.ts new file mode 100644 index 0000000..bbd2b39 --- /dev/null +++ b/src/pages/backlog/WorkTypeConfig/entity.ts @@ -0,0 +1,10 @@ +export enum NotifyTypeEnum { + "app消息" = 1, + "短信" = 2, + "不通知" = 9 +} + +export enum TodoTypeEnum { + "业务性" = 1, + "提示性" = 2, +} \ No newline at end of file diff --git a/src/pages/backlog/WorkTypeConfig/index.tsx b/src/pages/backlog/WorkTypeConfig/index.tsx new file mode 100644 index 0000000..512908c --- /dev/null +++ b/src/pages/backlog/WorkTypeConfig/index.tsx @@ -0,0 +1,139 @@ +import React, { useState, useEffect } from "react"; +import { PageHeaderWrapper } from "@ant-design/pro-layout"; +import { Card, Table, Popconfirm, message, Button, Input } from "antd"; +import { PlusOutlined } from "@ant-design/icons"; +import usePagination from "@/hooks/usePagination"; +import { WorkTypeListVO, getWorkTypeListApi, deleteWorkTypeApi } from "./api"; +import moment from "moment"; +import { debounce } from "lodash"; +import CreateModal from "./components/CreateModal"; +import { getAllRoleCodeApi } from "@/common/api"; + +const Column = Table.Column; +const Search = Input.Search; + +export default function WorkTypeConfig() { + const { list, loading, paginationConfig, setParams, setLoading } = + usePagination(getWorkTypeListApi, {}); + const [switchLoading, setSwitchLoading] = useState(false); + const [modalData, setModalData] = useState<{ + visible: boolean; + row: WorkTypeListVO; + }>({ visible: false, row: {} }); + + useEffect(() => { + getAllRoleCodeApi() + .then((res) => {}) + .catch((e) => { + message.error(`获取角色列表失败:${e.message}`); + }); + }, []); + + function triggerModal(row: WorkTypeListVO = {}) { + setModalData({ visible: !modalData.visible, row }); + } + + /** 刷新列表 */ + const refreshTableList = () => { + setLoading(true); + }; + /** + * 关闭弹窗 + */ + const _onCancelModal = () => { + setModalData({ visible: false, row: {} }); + refreshTableList(); + }; + + /** + * 根据工作类型名称搜索 + */ + const _searchByName = debounce((val: string) => { + setParams({ name: val.trim(), current: 1 }, true); + }, 500); + + // 删除工作类型 + const handleDelete = (record: any) => { + setSwitchLoading(true); + deleteWorkTypeApi(record.id) + .then((res) => { + message.success("删除成功!"); + refreshTableList(); + }) + .catch((e) => { + message.error(e.message); + }) + .finally(() => setSwitchLoading(false)); + }; + + return ( + + +
+
+ _searchByName(e.target.value)} + style={{ maxWidth: 260, marginRight: 15 }} + /> +
+ +
+
`id${record.id}`} + > + + moment(text).format("YYYY-MM-DD")} + /> + + ( + <> + + handleDelete(row)} + > + + + + )} + /> +
+ setLoading(true)} + item={modalData.row} + /> + + + ); +} diff --git a/src/pages/carinsur/insuranceRebate/interface.d.ts b/src/pages/carinsur/insuranceRebate/interface.d.ts index 7dc5409..0e314f2 100644 --- a/src/pages/carinsur/insuranceRebate/interface.d.ts +++ b/src/pages/carinsur/insuranceRebate/interface.d.ts @@ -3,9 +3,9 @@ declare namespace InsurCash { id?: number, insurerName?: string, insurerId?: number, - tciRewardRatio?: number, //交强险比例 (%) - vciRewardRatio?: number, //商业险比例 (%) - status?: number, //1启用 2禁用 + tciRewardRatio?: number, //交强险比例 (%) + vciRewardRatio?: number, //商业险比例 (%) + status?: number, //1启用 2禁用 } interface qParam { current?: number, @@ -31,6 +31,7 @@ declare namespace InsurCash { /**保险公司 */ interface comList { id: number, - name: string, //保险公司名称 是[string] + name: string, //保险公司名称 是[string] + shortName: string, //保险公司名称 是[string] } -} \ No newline at end of file +} diff --git a/src/pages/carinsur/returnCash/components/CreateModal.tsx b/src/pages/carinsur/returnCash/components/CreateModal.tsx index af7579f..33c096c 100644 --- a/src/pages/carinsur/returnCash/components/CreateModal.tsx +++ b/src/pages/carinsur/returnCash/components/CreateModal.tsx @@ -121,7 +121,7 @@ export default function CreateModal({ onCancel, item = {}, onRrfreshing, visible optionFilterProp="children" // onSearch={onSearch} > - {companyList.map((item: InsurCash.comList) => )} + {companyList.map((item: InsurCash.comList) => )} @@ -165,7 +165,7 @@ export default function CreateModal({ onCancel, item = {}, onRrfreshing, visible seriesShow /> - current && current < moment()} /> + current && current < moment().add(-1, 'day')} /> 商家结算给三方 - {classifyInfo.code !== "dhyhq" && ( + {!["dhyhq"].includes(classifyInfo.code) && ( 厂家结算给商家 @@ -148,9 +149,11 @@ export default function FullReduce({ 系数 - - 金额 - + {!["xjdhq"].includes(classifyInfo.code) && ( + + 金额 + + )} ))} diff --git a/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/Components/WorkItemLimit.tsx b/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/Components/WorkItemLimit.tsx index 20ebdcf..46b379d 100644 --- a/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/Components/WorkItemLimit.tsx +++ b/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/Components/WorkItemLimit.tsx @@ -26,7 +26,9 @@ interface Props { function PartItem(props: Props, ref?: Ref) { const { onChange, value, style, disabled, title, useScene } = props; - const { loading, setLoading, list, setParams, paginationConfig, innerParams } = usePagination(API.fetchListApi, { workType: useScene }); + /**机修作业项,类型1,2,5 */ + const params = useScene === 1 ? { workTypes: "1,2,5" } : { workType: useScene }; + const { loading, setLoading, list, setParams, paginationConfig, innerParams } = usePagination(API.fetchListApi, params); const { data: brandList } = useInitial(getBrandFilterApi, [], {}); const [visible, setVisible] = useState(false); const [listData, setListData] = useState([]); @@ -68,7 +70,7 @@ function PartItem(props: Props, ref?: Ref) { @@ -82,7 +84,7 @@ function PartItem(props: Props, ref?: Ref) { scroll={{ y: 400 }} bordered > - + {/* */} {!disabled && ( diff --git a/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts b/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts index ee53d08..4230867 100644 --- a/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts +++ b/src/pages/coupon/CouponConfig/components/UsesceneItems/PreDecoration/interface.d.ts @@ -1,6 +1,7 @@ export interface QueryList { brandId?: number, workType?: number, //作业项类型 1:机修 2:电器 3:钣喷 4:装潢 5:基础保养 6:贴膜 + workTypes?: string, //多个作业项组合参数 keywords?: string, //关键词 specGroupCode?: string, //车型分组代码 current?: number, diff --git a/src/pages/coupon/CouponConfig/entity.ts b/src/pages/coupon/CouponConfig/entity.ts index 397b12e..c781c0a 100644 --- a/src/pages/coupon/CouponConfig/entity.ts +++ b/src/pages/coupon/CouponConfig/entity.ts @@ -26,6 +26,7 @@ export const externalRadio = [ export const WorkTypeEnum = { "jxyhq": 1, //机修 "bpyhq": 3, //钣喷 + "xcyhq": 7, //洗车 }; export const UsetypeEnum = { diff --git a/src/pages/coupon/CouponOperation/index.tsx b/src/pages/coupon/CouponOperation/index.tsx index a6bac88..e574bfb 100644 --- a/src/pages/coupon/CouponOperation/index.tsx +++ b/src/pages/coupon/CouponOperation/index.tsx @@ -114,7 +114,7 @@ function CouponOperation() { > 优惠券记录 - + {/* + */} )} /> diff --git a/src/pages/coupon/CreateCoupon/index.tsx b/src/pages/coupon/CreateCoupon/index.tsx index c804c92..9a1accf 100644 --- a/src/pages/coupon/CreateCoupon/index.tsx +++ b/src/pages/coupon/CreateCoupon/index.tsx @@ -30,7 +30,7 @@ const bzType = { */ interface Props extends common.ConnectProps{ } - export default function UpsertCoupon (props: Props) { + export default function UpsertCoupon(props: Props) { const bizType = bzType[props.match.params.bizName]; const { groupId, applyId, brandId, useScene } = props.match.params; const [useScenes, setUseScenes] = useState(); @@ -75,5 +75,4 @@ interface Props extends common.ConnectProps{ } ); -}; - +} diff --git a/src/pages/coupon/Destruction/api.ts b/src/pages/coupon/Destruction/api.ts index 4444205..8220353 100644 --- a/src/pages/coupon/Destruction/api.ts +++ b/src/pages/coupon/Destruction/api.ts @@ -28,6 +28,10 @@ export function couponInfoApi(checkCode: string): http.PromiseResp { - // return request.get(`${COUPON_HOST} /coupon/checkShop`, { params: { checkCode } }); return request.get(`/coupon/coupon/checkShop`, { params: { checkCode } }); } + +/**现金兑换优惠券核销*/ +export function useCashCoupon(params: CouponVerity.VerifyUseParam): http.PromiseResp { + return request.get(`${COUPON_HOST}/coupon/check/cash/coupon`, { params }); +} \ No newline at end of file diff --git a/src/pages/coupon/Destruction/index.tsx b/src/pages/coupon/Destruction/index.tsx index 736c9c0..0181e4b 100644 --- a/src/pages/coupon/Destruction/index.tsx +++ b/src/pages/coupon/Destruction/index.tsx @@ -7,11 +7,12 @@ import { couponInfoApi, checkShopApi, verifyRecordsApi, + useCashCoupon, } from "./api"; import DescriptionList from '@/components/DescriptionList'; import VerifyTable from './components/VerifyTable'; import debounce from 'lodash/debounce'; -import {couponTypeEnum} from "@/pages/coupon/CouponOperation/entity"; +import { couponTypeEnum } from "@/pages/coupon/CouponOperation/entity"; import usePagination from "@/hooks/usePagination"; const { Description } = DescriptionList; @@ -48,17 +49,17 @@ export default function CouponsVerify() { /** * 根据核销码查询优惠券可核销门店 */ - function getShopList(param:string) { + function getShopList(param: string) { setPageLoading(true); checkShopApi(param).then(res => { - setShopList(res.data||[]); - setPageLoading(false); + setShopList(res.data || []); + setPageLoading(false); }).catch((e) => message.error(e.message)); setPageLoading(false); } const seachOnchange = debounce((data: any) => { - if (data.length&&data.length < 8) { + if (data.length && data.length < 8) { message.error("动态码格式不正确!"); return; } @@ -82,7 +83,8 @@ export default function CouponsVerify() { shopId: dealerId, }; setPageLoading(true); - checkCouponApi(param) + const api = coupon.classifyCode === "dhyhq" ? checkCouponApi : useCashCoupon; + api(param) .then((res) => { message.success("核销成功"); setCoupon({}); @@ -90,7 +92,7 @@ export default function CouponsVerify() { setLoading(true); //重新加载核销记录列表 }) .catch((e) => { - message.error(e.message); + message.error(e.message, 4); setPageLoading(false); }); } @@ -193,7 +195,7 @@ export default function CouponsVerify() { disabled={!filterPram || !dealerId} onClick={handleVerifyCoupon} > - 确认销券 + {coupon.classifyCode === "xjdhq" ? "现金兑换券销券" : "实物兑换券销券"}
@@ -202,12 +204,10 @@ export default function CouponsVerify() { - {/* loading, list, paginationConfig, setLoading */} diff --git a/src/pages/crm_new/ChannelImport/api.ts b/src/pages/crm_new/ChannelImport/api.ts index 647bf61..897cf10 100644 --- a/src/pages/crm_new/ChannelImport/api.ts +++ b/src/pages/crm_new/ChannelImport/api.ts @@ -27,9 +27,9 @@ export const ReasonData = [ {value: 13, label: "渠道时间超出当前时间"}, {value: 14, label: "数据异常请检查"}, {value: 15, label: "渠道来源未知"}, - {value: 16, label: "渠道来源不支持"}, - {value: 17, label: "该门店下未查找到品牌"}, - {value: 18, label: "品牌不能为空"}, + // {value: 16, label: "渠道来源不支持"}, + {value: 16, label: "该门店下未查找到品牌"}, + {value: 17, label: "品牌不能为空"}, ]; export const ChannelData = [ diff --git a/src/pages/crm_new/ChannelImport/components/ReacordDetail.tsx b/src/pages/crm_new/ChannelImport/components/ReacordDetail.tsx index 70bf70c..957d202 100644 --- a/src/pages/crm_new/ChannelImport/components/ReacordDetail.tsx +++ b/src/pages/crm_new/ChannelImport/components/ReacordDetail.tsx @@ -53,7 +53,7 @@ export default function RecordDetail(props: Props) { onOk={handleCancle} onCancel={handleCancle} destroyOnClose - width="80%" + width="85%" > @@ -141,7 +141,7 @@ export default function RecordDetail(props: Props) { onChange={(value) => onChange("failureType", value)} > {ReasonData.map((item: any, i: number) => ( - + ))} @@ -185,6 +185,11 @@ export default function RecordDetail(props: Props) { ); }} /> + text && moment(text).format('YYYY-MM-DD HH:mm:ss')} /> + + + + (_text && ({_text}) || '--')} /> handleLookeacord(text.recordId)}>查看} /> diff --git a/src/pages/crm_new/ChannelImport/interface.d.ts b/src/pages/crm_new/ChannelImport/interface.d.ts index cce5359..a1a73a1 100644 --- a/src/pages/crm_new/ChannelImport/interface.d.ts +++ b/src/pages/crm_new/ChannelImport/interface.d.ts @@ -5,6 +5,10 @@ declare namespace CrmChannelImport { importTime?: number, //导入时间 staffName?: string//导入员工姓名 channelTypeName?: string, //渠道类型名称 + process?: string // 是否处理标识 + totalCount?: number // 总数量 + successCount?: number // 成功条数 + failureCount?: number // 失败条数 } // 导入记录详情 @@ -17,6 +21,8 @@ declare namespace CrmChannelImport { success: boolean, // 是否导入 failureReason: string, // 未导入原因 channelType?: string // 渠道 + brandName?: string // 品牌名称 + brandId?: number // 品牌id } // 导入请求参数 diff --git a/src/pages/crm_new/ChannelImport/subpages/RecordDetail/index.tsx b/src/pages/crm_new/ChannelImport/subpages/RecordDetail/index.tsx index 43f929d..c2d2862 100644 --- a/src/pages/crm_new/ChannelImport/subpages/RecordDetail/index.tsx +++ b/src/pages/crm_new/ChannelImport/subpages/RecordDetail/index.tsx @@ -5,7 +5,7 @@ import zhCN from 'antd/lib/locale-provider/zh_CN'; import useInitail from '@/hooks/useInitail'; import {getRecordDetailListApi} from './api'; import moment from 'moment'; -import { common } from '@/typing/common'; +import common from '@/typing/common'; // import './style.less'; interface Props extends common.ConnectProps { diff --git a/src/pages/crm_new/Settings/api.ts b/src/pages/crm_new/Settings/api.ts index f9de3f5..96b97f3 100644 --- a/src/pages/crm_new/Settings/api.ts +++ b/src/pages/crm_new/Settings/api.ts @@ -81,4 +81,15 @@ interface GatherConsultantBonus { export function saveGatherConsultantBonusApi(params: GatherConsultantBonus) { return request.post(`${CRM_HOST}/erp/config/edit/gather/consultant/bonus`, params, { contentType: "form-urlencoded" } ); +} + +/** 查询销售线索转化有效时长 */ +export function getFollowChannel() { + return request.get(`${CRM_HOST}/erp/config/find/follow/Channel`); +} + +/** 销售线索转化时长 */ +export function saveFollowChannel(params: {followChannelValidTime: number}) { + return request.post(`${CRM_HOST}/erp/config/edit/follow/channel`, params, { contentType: "form-urlencoded" } +); } \ No newline at end of file diff --git a/src/pages/crm_new/Settings/index.tsx b/src/pages/crm_new/Settings/index.tsx index 967d221..5455d13 100644 --- a/src/pages/crm_new/Settings/index.tsx +++ b/src/pages/crm_new/Settings/index.tsx @@ -20,7 +20,9 @@ import { getStandGuardRotateApi, saveStandGuardRotateApi, getGatherConsultantBonusApi, - saveGatherConsultantBonusApi + saveGatherConsultantBonusApi, + getFollowChannel, + saveFollowChannel } from './api'; import Item from './components/Item'; @@ -100,6 +102,7 @@ export default function Settings() { + {/* 集客跟进 */} history.push('/crm/collectionFollowSetting')}>查看]}> diff --git a/src/pages/dalaran/Account/api.ts b/src/pages/dalaran/Account/api.ts index 7ce7eed..ed39adb 100644 --- a/src/pages/dalaran/Account/api.ts +++ b/src/pages/dalaran/Account/api.ts @@ -26,6 +26,10 @@ export interface AccountVO { */ type: number; /** + * 账号类型 + */ + accountType: number; + /** * 平台类型 */ typeDesc?: string; @@ -90,6 +94,10 @@ export interface AccountDTO { * 门店名称 */ shopName?: string; + /** + * 账户类型 + */ + accountType?:number; } /** diff --git a/src/pages/dalaran/Account/components/EditModal.tsx b/src/pages/dalaran/Account/components/EditModal.tsx index bd18a30..f41bb15 100644 --- a/src/pages/dalaran/Account/components/EditModal.tsx +++ b/src/pages/dalaran/Account/components/EditModal.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from "react"; import { Form, Modal, message, Input, Select } from "antd"; import { AccountDTO, AccountVO, saveAccount } from "../api"; -import { PlatformEnum } from "@/pages/dalaran/Account/entity"; +import { PlatformEnum, AccountTypeEnum } from "@/pages/dalaran/Account/entity"; import { getStaffApi } from "@/common/api"; import usePagination from "@/hooks/usePagination"; @@ -15,7 +15,13 @@ interface Props { onOk?: Function; } -export default function EditModal({ visible, record, shopList = [], onClose, onOk }: Props) { +export default function EditModal({ + visible, + record, + shopList = [], + onClose, + onOk, +}: Props) { const [form] = Form.useForm(); const { list: userList, @@ -31,10 +37,15 @@ export default function EditModal({ visible, record, shopList = [], onClose, onO useEffect(() => { if (visible) { form.setFieldsValue({ + ...record, type: record?.type, account: record?.account, - shop: record?.shopId ? { value: record.shopId, label: record.shopName } : undefined, - user: record?.userId ? { value: record.userId, label: record.userName } : undefined, + shop: record?.shopId + ? { value: record.shopId, label: record.shopName } + : undefined, + user: record?.userId + ? { value: record.userId, label: record.userName } + : undefined, }); } }, [visible]); @@ -49,6 +60,7 @@ export default function EditModal({ visible, record, shopList = [], onClose, onO shopName: values?.shop?.label, userId: values?.user?.value, userName: values?.user?.label, + accountType: values.accountType, }; saveAccount(_accountParams) .then(() => { @@ -78,11 +90,24 @@ export default function EditModal({ visible, record, shopList = [], onClose, onO getContainer={false} confirmLoading={saveLoading} > -
- + + - + + + + - {shopList.map((item) => ( {item.name} @@ -109,12 +153,21 @@ export default function EditModal({ visible, record, shopList = [], onClose, onO ))} - prevValues.shop !== curValues.shop}> + + prevValues.shop !== curValues.shop + } + > {({ getFieldValue }) => { const _shop = getFieldValue("shop"); if (_shop) { return ( - + setParams({ roleCode, current: 1 }, true)} + showSearch + optionFilterProp="children" + getPopupContainer={(triggerNode) => triggerNode.parentNode} + > + {roles.map((role) => ( + + {role.roleName} + + ))} + + + {currentItem ? (
  1. - 编辑时,只能修改或添加归属门店和适用岗位的信息 + 编辑时,只能修改或添加归属门店、适用岗位、当前保管门店和往来单位的信息
) : ( @@ -142,13 +191,15 @@ export default function GroupMobileRecordModal() { )} - {currentItem ? ( - {currentItem.custodyShopName} - ) : ( - triggerNode.parentNode} + > + {(tempShopList || []).length > 0 + ? (tempShopList || []).map((shop: any) => ( + + {shop.label} + + )) + : shops.map((shop) => ( {shop.name} - ))} - - )} + ))} + + + + +
diff --git a/src/pages/ehr/GroupMobileRecord/interface.d.ts b/src/pages/ehr/GroupMobileRecord/interface.d.ts index 8915c5d..86ca3fc 100644 --- a/src/pages/ehr/GroupMobileRecord/interface.d.ts +++ b/src/pages/ehr/GroupMobileRecord/interface.d.ts @@ -1,7 +1,7 @@ /* * @Date: 2021-01-05 14:24:23 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 10:41:17 + * @LastEditTime: 2022-03-17 16:03:16 */ declare namespace GroupMobileRecord { interface QueryParams { @@ -23,8 +23,7 @@ declare namespace GroupMobileRecord { staffId?: number; //员工Id staffName?: string; // 当前使用人姓名 createTime?: string; // 备案时间 - shopId?: number; //门店ID - shopName?: string; //门店名称 + shopList?: ShopListVO[]; // 归属门店集合 postId?: number; //岗位ID postName?: string; //岗位名称 zip?: string; // 邮编 @@ -36,6 +35,13 @@ declare namespace GroupMobileRecord { custodyShopId?: number; // 保管门店 custodyShopName?: string; // 保管门店名称 useSecretNo?: boolean; //是否可以使用隐私号 + subjectId?: number; //来往单位id + subjectName?: string; //来往单位简称 + } + + interface ShopListVO { + shopId?: number; + shopName?: string; } interface PostListVO { diff --git a/src/pages/ehr/GroupMobileRecord/store.ts b/src/pages/ehr/GroupMobileRecord/store.ts index 70d8113..cfb586b 100644 --- a/src/pages/ehr/GroupMobileRecord/store.ts +++ b/src/pages/ehr/GroupMobileRecord/store.ts @@ -1,14 +1,14 @@ /* * @Date: 2021-01-05 14:24:23 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-07-31 09:36:54 + * @LastEditTime: 2022-03-18 09:29:58 */ -import usePagination from '@/hooks/usePagination'; -import useInitail from '@/hooks/useInitail'; -import { useState } from 'react'; -import { getMobileListApi, getPostListApi } from './api'; -import { getShopListApi } from '@/pages/ehr/PostSetting/api'; -import { getStaffApi } from '@/common/api'; +import usePagination from "@/hooks/usePagination"; +import useInitail from "@/hooks/useInitail"; +import { useState } from "react"; +import { getMobileListApi, getPostListApi, getUnitCompanyListApi } from "./api"; +import { getShopListApi } from "@/pages/ehr/PostSetting/api"; +import { getStaffApi } from "@/common/api"; export default function useStore() { const [visible, setVisible] = useState(false); @@ -17,17 +17,19 @@ export default function useStore() { const { data: shops } = useInitail(getShopListApi, [], {}); const { list: posts } = usePagination(getPostListApi); const staffPagination = usePagination(getStaffApi, {}); + const unitCompanyInitail = useInitail(getUnitCompanyListApi, [], null); + const [editSubject, setEditSubject] = useState(false); enum StatusText { - '空闲' = 1, - '待领取', - '使用中' + "空闲" = 1, + "待领取", + "使用中", } enum Status { - 'default' = 1, - 'warning', - 'processing' + "default" = 1, + "warning", + "processing", } return { @@ -40,6 +42,9 @@ export default function useStore() { posts, staffPagination, StatusText, - Status - } -} \ No newline at end of file + Status, + unitCompanyInitail, + editSubject, + setEditSubject, + }; +} diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/api.ts b/src/pages/ehr/InterviewSetting/HrDataConfiguration/api.ts index c46360b..c3c3227 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/api.ts +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/api.ts @@ -1,10 +1,10 @@ /* * @Date: 2021-02-24 09:57:33 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 10:45:02 + * @LastEditTime: 2022-03-17 11:44:09 */ import request from "@/utils/request"; -import { EHR_HOST } from "@/utils/host"; +import { EHR_HOST, IDENTIFY_HOST } from "@/utils/host"; import { http } from "@/typing/http"; /** 获取岗位列表 */ @@ -36,8 +36,8 @@ export function deleteRequireDataApi(params: { id: number }) { } /** 人事资料配置列表 */ -export function getDataConfigListApi(params: { postId: number }) { - return request.get(`${EHR_HOST}/hr/erp/data/config/list`, { params }); +export function getDataConfigListApi(params: { postId?: number }): http.PromisePageResp { + return request.get(`${EHR_HOST}/hr/erp/data/config/list`, { params }); } /** 人事资料配置编辑 */ @@ -51,3 +51,14 @@ export function deleteDataConfigApi(params: { postId: number }) { params, }); } + +/** + * @description: 查询资料库标准配置分页 + * @param {HrDataConfiguration.QueryDataParams} + * @return {http.PromisePageResp} + */ +export function getDatabaseListApi( + params: HrDataConfiguration.QueryDataParams +): http.PromisePageResp { + return request.get(`${IDENTIFY_HOST}/identify/page/list`, { params }); +} diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/ConfigurationModal.tsx b/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/ConfigurationModal.tsx index 49f0aba..a52bf4f 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/ConfigurationModal.tsx +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/ConfigurationModal.tsx @@ -1,22 +1,19 @@ /* * @Date: 2021-01-13 18:07:34 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 11:01:56 - */ -/* - * @Date: 2021-01-13 18:07:34 - * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-01-27 10:13:31 + * @LastEditTime: 2022-03-17 15:35:00 */ import React, { useEffect, useState } from "react"; import { Modal, Form, Select, message } from "antd"; import { useStore } from "../index"; -import { Type, handleFormInit } from "../entity"; -import { LabeledValue } from "antd/lib/select"; +import { + Type, + InductionsDataCode, + MustNeedDataCode, + InductionsDataCodeEnum, +} from "../entity"; import { saveDataConfigApi } from "../api"; import { debounce } from "lodash"; -import { StoreValue } from "antd/lib/form/interface"; -import { RuleObject } from "antd/lib/form"; export default function ConfigurationModal() { const { @@ -26,13 +23,10 @@ export default function ConfigurationModal() { currentItem, setCurrentItem, pagination, - requireDataPagination, - idCardId, - laborContractId, - notificationId, + dataPagination, } = useStore(); const { setLoading } = pagination; - const { list, setParams: setTypeListParams } = requireDataPagination; + const { list, setParams: setTypeListParams } = dataPagination; const [confirmLoading, setConfirmLoading] = useState(false); const [form] = Form.useForm(); @@ -45,13 +39,23 @@ export default function ConfigurationModal() { }, [configVisible]); const editFormInit = () => { - const obj = {}; - Object.entries(Type) - .filter((type) => typeof type[1] === "number") - .forEach((type) => { - obj[type[1]] = handleFormInit(currentItem?.stageList, Type[type[0]]); - }); - form.setFieldsValue(obj); + form.setFieldsValue({ + resumeDeliverys: currentItem?.resumeDeliverys?.map((item) => ({ + value: item.identifyCode, + key: item.identifyCode, + label: item.name, + })), + interviews: currentItem?.interviews?.map((item) => ({ + value: item.identifyCode, + key: item.identifyCode, + label: item.name, + })), + inductions: currentItem?.inductions?.map((item) => ({ + value: item.identifyCode, + key: item.identifyCode, + label: item.name, + })), + }); }; const onOk = () => { @@ -59,25 +63,17 @@ export default function ConfigurationModal() { const postId = val.postId || undefined; if (val.postId) delete val.postId; const params: HrDataConfiguration.Item = { + id: currentItem?.id, postId: postId || currentItem?.postId, - stageList: [], }; // 判断是否选择身份证 - let hasIDCard: boolean = false; - Object.entries(val).forEach((v) => { - v[1] && - params.stageList?.push({ - // @ts-ignore - stageType: v[0], - // @ts-ignore - requireList: v[1] - .map((r: LabeledValue) => { - if (r.value === idCardId) hasIDCard = true; - return r.value; - }) - .sort((a: number, b: number) => a - b), - }); - }); + let hasIDCard: boolean = [] + .concat( + val.resumeDeliverys || [], + val.interviews || [], + val.inductions || [] + ) + .some((item: any) => item.value === MustNeedDataCode["身份证"]); if (!hasIDCard) { setConfirmLoading(false); @@ -85,6 +81,19 @@ export default function ConfigurationModal() { return; } + params.resumeDeliverys = (val.resumeDeliverys || []).map((item: any) => ({ + name: item.label, + identifyCode: item.value, + })); + params.interviews = (val.interviews || []).map((item: any) => ({ + name: item.label, + identifyCode: item.value, + })); + params.inductions = (val.inductions || []).map((item: any) => ({ + name: item.label, + identifyCode: item.value, + })); + setConfirmLoading(true); saveDataConfigApi(params) .then((res) => { @@ -101,7 +110,7 @@ export default function ConfigurationModal() { }; const fetchTypeList = debounce((value: string) => { - setTypeListParams({ keyWords: value, current: 1 }, true); + setTypeListParams({ keywords: value, current: 1 }, true); }, 500); const validatorEntryResourece = ( @@ -109,12 +118,18 @@ export default function ConfigurationModal() { value: any[], type: 1 | 2 | 3 ): Promise | void => { - if (type !== Type["入职"]) return Promise.resolve(); - else { + if (type !== Type["入职"]) { + if (!value?.length) return Promise.reject(Error("请选择")); + else return Promise.resolve(); + } else { let flag = 0; value.forEach((item) => { - if (item.value === laborContractId) flag++; - if (item.value === notificationId) flag++; + if ( + item.value === InductionsDataCodeEnum.劳动合同 || + item.value === InductionsDataCodeEnum.告知书 + ) { + flag++; + } }); if (flag !== 2) { return Promise.reject( @@ -161,7 +176,120 @@ export default function ConfigurationModal() { )} - {Object.entries(Type) + { + setTypeListParams({ keywords: undefined }, true); + return val; + }} + rules={[ + { + required: true, + validator: (rule: any, value: any) => validatorEntryResourece(rule, value, 1), + }, + ]} + > + + + { + setTypeListParams({ keywords: undefined }, true); + return val; + }} + rules={[ + { + required: true, + // @ts-ignore + validator: (rule: RuleObject, value: StoreValue) => validatorEntryResourece(rule, value, 2), + }, + ]} + > + + + ({ + label: InductionsDataCode[code], + value: code, + key: code, + }))} + getValueFromEvent={(val) => { + setTypeListParams({ keywords: undefined }, true); + return val; + }} + rules={[ + { + required: true, + // @ts-ignore + validator: (rule: RuleObject, value: StoreValue) => validatorEntryResourece(rule, value, 3), + }, + ]} + > + + + {/* {Object.entries(Type) .filter((type) => typeof type[1] === "number") .map((type) => { let defaultValue: any[] = []; @@ -219,7 +347,7 @@ export default function ConfigurationModal() { ); - })} + })} */} ); diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/List.tsx b/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/List.tsx index 25a3c57..71d6931 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/List.tsx +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/List.tsx @@ -1,24 +1,25 @@ /* * @Date: 2021-02-03 10:42:42 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-08-20 14:36:43 + * @LastEditTime: 2022-03-17 15:39:10 */ -import React from 'react'; -import { Divider, message,Table, Popconfirm, Popover } from 'antd'; -import { useStore } from '../index'; -import { Type, handleCol } from '../entity'; -import { deleteDataConfigApi } from '../api'; +import React from "react"; +import { Divider, message, Table, Popconfirm, Popover } from "antd"; +import { useStore } from "../index"; +import { deleteDataConfigApi } from "../api"; export default function HrDataConfigurationList() { const { pagination, setConfigVisible, setCurrentItem } = useStore(); const { list, loading, setLoading, paginationConfig } = pagination; const delItem = (postId: number) => { - deleteDataConfigApi({ postId }).then(res => { - message.success('删除成功'); - setLoading(true); - }).catch(error => message.error(error.message)); - } + deleteDataConfigApi({ postId }) + .then((res) => { + message.success("删除成功"); + setLoading(true); + }) + .catch((error) => message.error(error.message)); + }; return ( - - { - const list = handleCol(stageList, Type['简历']); - return list != '——' ? {list} : list; - }} /> - { - const list = handleCol(stageList, Type['面试']); - return list != '——' ? {list} : list; - }} /> - { - const list = handleCol(stageList, Type['入职']); - return list != '——' ? {list} : list; - }} /> - ( - <> - { setCurrentItem(record); setConfigVisible(true); }}>编辑 - - delItem(record.postId!)}> - 删除 - - - )} /> + + { + const list = (resumeDeliverys || []) + .map((item) => item.name || "") + .join(";"); + return list ? ( + + {list} + + ) : ( + list + ); + }} + /> + { + const list = (interviews || []) + .map((item) => item.name || "") + .join(";"); + return list ? ( + + {list} + + ) : ( + list + ); + }} + /> + { + const list = (inductions || []) + .map((item) => item.name || "") + .join(";"); + return list ? ( + + {list} + + ) : ( + list + ); + }} + /> + ( + <> + { + setCurrentItem(record); + setConfigVisible(true); + }} + > + 编辑 + + + delItem(record.postId!)} + > + 删除 + + + )} + />
); -} \ No newline at end of file +} diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/RequireDataModal.tsx b/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/RequireDataModal.tsx index 627a599..a392af8 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/RequireDataModal.tsx +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/components/RequireDataModal.tsx @@ -1,152 +1,252 @@ -import React, { useEffect, useState } from 'react'; -import { Modal, List, Button, Row, Input, Popconfirm, message, Upload, Popover, Drawer } from 'antd'; -import { PlusOutlined, CloseOutlined, DatabaseOutlined, PlusCircleOutlined, EditOutlined, CheckCircleOutlined, CloseCircleOutlined, DeleteOutlined } from '@ant-design/icons'; -import { saveRequireDataApi, deleteRequireDataApi } from '../api'; -import { useStore } from '../index'; -import { debounce } from 'lodash'; -import { UploadChangeParam, UploadFile } from 'antd/lib/upload/interface'; -import { getFidFile } from '@/utils'; -import { checkNull } from '@/utils/validate'; +import React, { useEffect, useState } from "react"; +import { + Modal, + List, + Button, + Row, + Input, + Popconfirm, + message, + Upload, + Popover, + Drawer, +} from "antd"; +import { + PlusOutlined, + CloseOutlined, + DatabaseOutlined, + PlusCircleOutlined, + EditOutlined, + CheckCircleOutlined, + CloseCircleOutlined, + DeleteOutlined, +} from "@ant-design/icons"; +import { saveRequireDataApi, deleteRequireDataApi } from "../api"; +import { useStore } from "../index"; +import { debounce } from "lodash"; +import { UploadChangeParam, UploadFile } from "antd/lib/upload/interface"; +import { getFidFile } from "@/utils"; +import { checkNull } from "@/utils/validate"; export default function RequireDataModal() { - const { dataVisible, setDataVisible, pagination, requireDataPagination } = useStore(); + const { dataVisible, setDataVisible, pagination, requireDataPagination } = + useStore(); const { setLoading: setPageLoading } = pagination; - const { list, loading, setLoading, paginationConfig, setParams: setRequireDataParams } = requireDataPagination; + const { + list, + loading, + setLoading, + paginationConfig, + setParams: setRequireDataParams, + } = requireDataPagination; const [isAdd, setIsAdd] = useState(false); const [addInputValue, setAddInputValue] = useState(); const [addFileList, setAddFileList] = useState([]); const [editFileList, setEditFileList] = useState([]); - const [edit, setEdit] = useState<{ id?: number, value?: string }>(); + const [edit, setEdit] = useState<{ id?: number; value?: string }>(); const [drawerVisible, setDrawerVisible] = useState(false); - const [currentItem, setCurrentItem] = useState(); + const [currentItem, setCurrentItem] = + useState(); useEffect(() => { if (dataVisible) { - setRequireDataParams({ keyWords: '', current: 1 }, true); + setRequireDataParams({ keyWords: "", current: 1 }, true); } }, [dataVisible]); const editItem = (): any => { - if (!edit?.value || (edit?.value && !edit?.value.trim())) return message.error('资料项不能为空!'); - saveRequireDataApi({ id: edit?.id, requireName: edit?.value, exampleFid: editFileList.map(file => file.response.data).join(',') }).then(res => { - message.success('操作成功'); - setLoading(true); - setPageLoading(true); // 编辑成功后,刷新列表页; - setEdit(undefined); - setEditFileList([]); - }).catch(error => { - message.error(error.message); - }); - } + if (!edit?.value || (edit?.value && !edit?.value.trim())) { return message.error("资料项不能为空!"); } + saveRequireDataApi({ + id: edit?.id, + requireName: edit?.value, + exampleFid: editFileList.map((file) => file.response.data).join(","), + }) + .then((res) => { + message.success("操作成功"); + setLoading(true); + setPageLoading(true); // 编辑成功后,刷新列表页; + setEdit(undefined); + setEditFileList([]); + }) + .catch((error) => { + message.error(error.message); + }); + }; const delItem = (id: number) => { - deleteRequireDataApi({ id }).then(res => { - message.success('删除成功'); - setLoading(true); - }).catch(error => message.error(error.message)); - } + deleteRequireDataApi({ id }) + .then((res) => { + message.success("删除成功"); + setLoading(true); + }) + .catch((error) => message.error(error.message)); + }; const addOption = (): any => { - if (!addInputValue || (addInputValue && !addInputValue.trim())) return message.error('资料项不能为空!'); - saveRequireDataApi({ requireName: addInputValue, exampleFid: addFileList.map(file => file.response.data).join(',') }).then(res => { - message.success('操作成功'); - setAddInputValue(undefined); - setAddFileList([]); - setLoading(true); - }).catch(error => { - message.error(error.message); - }); - } + if (!addInputValue || (addInputValue && !addInputValue.trim())) { return message.error("资料项不能为空!"); } + saveRequireDataApi({ + requireName: addInputValue, + exampleFid: addFileList.map((file) => file.response.data).join(","), + }) + .then((res) => { + message.success("操作成功"); + setAddInputValue(undefined); + setAddFileList([]); + setLoading(true); + }) + .catch((error) => { + message.error(error.message); + }); + }; - const _onChange = (info: UploadChangeParam>, type: 'add' | 'edit') => { - if (info.file.status === 'done') { - if (type === 'add') setAddFileList([...addFileList, info.file]); + const _onChange = ( + info: UploadChangeParam>, + type: "add" | "edit" + ) => { + if (info.file.status === "done") { + if (type === "add") setAddFileList([...addFileList, info.file]); else setEditFileList([...editFileList, info.file]); } - } + }; const _onEdit = (item: HrDataConfiguration.RequireDataItem) => { - setEdit({ id: item.id, value: item.requireName }) + setEdit({ id: item.id, value: item.requireName }); // @ts-ignore - setEditFileList(!checkNull(item.exampleFid) && item.exampleFid ? (item.exampleFid || '').split(',').map((fid, index) => ({ - uid: fid, - name: (item.requireName || '') + (index + 1), - url: '/api/file/show?fid=' + fid, - status: 'done', - response: { data: fid, status: 'success' } - })) : []) - } + setEditFileList( + !checkNull(item.exampleFid) && item.exampleFid + ? (item.exampleFid || "").split(",").map((fid, index) => ({ + uid: fid, + name: (item.requireName || "") + (index + 1), + url: "/api/file/show?fid=" + fid, + status: "done", + response: { data: fid, status: "success" }, + })) + : [] + ); + }; - const renderItem = (item: HrDataConfiguration.RequireDataItem) => -
+ + ); - const onSearch = debounce((keyWords: string) => setRequireDataParams({ keyWords, current: 1 }, true), 500); + const onSearch = debounce( + (keyWords: string) => setRequireDataParams({ keyWords, current: 1 }, true), + 500 + ); return ( <> setDrawerVisible(false)} onCancel={() => setDrawerVisible(false)} - footer={[]} + footer={[ + , + ]} afterClose={() => setCurrentItem(undefined)} > {/* {currentItem && currentItem.exampleFid && currentItem.exampleFid.split(',').map((fid, index) => getFidFile(fid)}>{currentItem.requireName}-{index + 1})} */} - {currentItem && currentItem.exampleFid && currentItem.exampleFid.split(',').map(fid => )} + {currentItem && + currentItem.exampleFid && + currentItem.exampleFid + .split(",") + .map((fid) => ( + + ))} setDataVisible(false)} onCancel={() => setDataVisible(false)} - footer={[]} - afterClose={() => { setIsAdd(false); setAddInputValue(undefined); setAddFileList([]); setEditFileList([]); setEdit(undefined); }} + footer={[ + , + ]} + afterClose={() => { + setIsAdd(false); + setAddInputValue(undefined); + setAddFileList([]); + setEditFileList([]); + setEdit(undefined); + }} > - onSearch(e.target.value)} /> - + onSearch(e.target.value)} + /> + - 点击每一项左边图标,可查看该资料项对应示例图 + + 点击每一项左边图标,可查看该资料项对应示例图 + renderItem(item)} + renderItem={(item) => renderItem(item)} /> -
- +
+
-
- {isAdd && setAddInputValue(e.target.value)} - suffix={ - addOption()}> -
- ) -} \ No newline at end of file + ); +} diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/entity.ts b/src/pages/ehr/InterviewSetting/HrDataConfiguration/entity.ts index 92b222b..7bc6109 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/entity.ts +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/entity.ts @@ -1,29 +1,82 @@ /* * @Date: 2021-03-26 14:12:53 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-04-20 16:05:29 + * @LastEditTime: 2022-03-17 15:02:45 */ export enum Type { - '简历' = 1, - '面试', - '入职' + "简历" = 1, + "面试", + "入职", } -export const handleCol = (stageList: HrDataConfiguration.Stage[] = [], type: 1 | 2 | 3) => { - let tempList: HrDataConfiguration.Stage[] = []; - if (type === Type['简历']) tempList = stageList.filter(stage => stage.stageType === 1); - if (type === Type['面试']) tempList = stageList.filter(stage => stage.stageType === 2); - if (type === Type['入职']) tempList = stageList.filter(stage => stage.stageType === 3); - if (!tempList.length) return '——'; - else if (tempList.length && tempList[0].requireList && !tempList[0].requireList.length) return '——'; - else return tempList[0].requireList?.map(require => require.requireName).join(';'); + +export enum MustNeedDataCode { + "身份证" = "WHyh", +} + +export enum InductionsDataCodeEnum { + "劳动合同" = "YlSH", + "告知书" = "GPaj", } -export const handleFormInit = (stageList: HrDataConfiguration.Stage[] = [], type: 1 | 2 | 3) => { +// 入职阶段必须资料码 +export const InductionsDataCode = { + YlSH: "劳动合同", + GPaj: "告知书", +}; + +export const handleCol = ( + stageList: HrDataConfiguration.Stage[] = [], + type: 1 | 2 | 3 +) => { + let tempList: HrDataConfiguration.Stage[] = []; + if (type === Type["简历"]) { + tempList = stageList.filter((stage) => stage.stageType === 1); + } + if (type === Type["面试"]) { + tempList = stageList.filter((stage) => stage.stageType === 2); + } + if (type === Type["入职"]) { + tempList = stageList.filter((stage) => stage.stageType === 3); + } + if (!tempList.length) return "——"; + else if ( + tempList.length && + tempList[0].requireList && + !tempList[0].requireList.length + ) { + return "——"; + } else { + return tempList[0].requireList + ?.map((require) => require.requireName) + .join(";"); + } +}; + +export const handleFormInit = ( + stageList: HrDataConfiguration.Stage[] = [], + type: 1 | 2 | 3 +) => { let tempList: HrDataConfiguration.Stage[] = []; - if (type === Type['简历']) tempList = stageList.filter(stage => stage.stageType === 1); - if (type === Type['面试']) tempList = stageList.filter(stage => stage.stageType === 2); - if (type === Type['入职']) tempList = stageList.filter(stage => stage.stageType === 3); + if (type === Type["简历"]) { + tempList = stageList.filter((stage) => stage.stageType === 1); + } + if (type === Type["面试"]) { + tempList = stageList.filter((stage) => stage.stageType === 2); + } + if (type === Type["入职"]) { + tempList = stageList.filter((stage) => stage.stageType === 3); + } if (!tempList.length) return undefined; - else if (tempList.length && tempList[0].requireList && !tempList[0].requireList.length) return undefined; - else return tempList[0].requireList?.map(require => ({ label: require.requireName, value: require.id })); -} \ No newline at end of file + else if ( + tempList.length && + tempList[0].requireList && + !tempList[0].requireList.length + ) { + return undefined; + } else { + return tempList[0].requireList?.map((require) => ({ + label: require.requireName, + value: require.id, + })); + } +}; diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/index.tsx b/src/pages/ehr/InterviewSetting/HrDataConfiguration/index.tsx index d60cb63..96a0d7f 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/index.tsx +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/index.tsx @@ -1,7 +1,7 @@ /* * @Date: 2021-01-13 18:07:34 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 10:44:03 + * @LastEditTime: 2022-03-17 15:39:56 */ import React from "react"; import { Button, Card, ConfigProvider, Row, Select } from "antd"; @@ -18,7 +18,7 @@ import "./style.less"; export const { Provider, useStore } = createStore(store); function HrDataConfiguration() { - const { setDataVisible, setConfigVisible, posts, pagination } = useStore(); + const { setConfigVisible, posts, pagination } = useStore(); const { setParams } = pagination; return ( @@ -42,13 +42,13 @@ function HrDataConfiguration() { ))}
- + */}
- + {/* */} diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/interface.d.ts b/src/pages/ehr/InterviewSetting/HrDataConfiguration/interface.d.ts index 29cb8b4..83882cd 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/interface.d.ts +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/interface.d.ts @@ -1,29 +1,44 @@ /* * @Date: 2021-03-06 16:59:54 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-03-23 10:25:08 + * @LastEditTime: 2022-03-17 15:38:15 */ declare namespace HrDataConfiguration { interface RequireDataParams { - keyWords?: string // 搜索关键字 + keyWords?: string; // 搜索关键字 } interface RequireDataItem { - id?: number - groupId?: number // 归属集团 - requireCode?: string // 资料要求码 - requireName?: string // 资料要求名称 - exampleFid?: string // 对应示例图fids,用英文逗号分开 + id?: number; + groupId?: number; // 归属集团 + requireCode?: string; // 资料要求码 + requireName?: string; // 资料要求名称 + exampleFid?: string; // 对应示例图fids,用英文逗号分开 } interface Stage { - stageType: 1 | 2 | 3 // 阶段类型 1简历投递 2面试 3入职 - requireList?: RequireDataItem[] + stageType: 1 | 2 | 3; // 阶段类型 1简历投递 2面试 3入职 + requireList?: RequireDataItem[]; + } + + interface DataItem { + identifyCode?: string; // 资料库编码 + name?: string; // 资料库名称 } interface Item { - id?: number - postId?: number - postName?: string - stageList?: Stage[] + id?: number; + postId?: number; + postName?: string; + // stageList?: Stage[]; + resumeDeliverys?: DataItem[]; //简历资料 + interviews?: DataItem[]; //面试资料 + inductions?: DataItem[]; //入职资料 + } + + interface QueryDataParams { + keywords?: string; + applySys?: string; // 适配系统 + fileType?: number; // 文件类型 + classifyType?: number; // 分类类型 } -} \ No newline at end of file +} diff --git a/src/pages/ehr/InterviewSetting/HrDataConfiguration/store.ts b/src/pages/ehr/InterviewSetting/HrDataConfiguration/store.ts index 52d9f49..61add0c 100644 --- a/src/pages/ehr/InterviewSetting/HrDataConfiguration/store.ts +++ b/src/pages/ehr/InterviewSetting/HrDataConfiguration/store.ts @@ -1,51 +1,64 @@ -import usePagination from '@/hooks/usePagination'; -import { useEffect, useRef, useState } from 'react'; -import { getPostListApi, getRequireListApi, getDataConfigListApi } from './api'; +/* + * @Author: wangqiang@feewee.cn + * @Date: 2021-11-02 15:28:46 + * @LastEditors: wangqiang@feewee.cn + * @LastEditTime: 2022-03-17 15:39:39 + */ +import usePagination from "@/hooks/usePagination"; +import { useEffect, useRef, useState } from "react"; +import { + getPostListApi, + getRequireListApi, + getDataConfigListApi, + getDatabaseListApi, +} from "./api"; export default function useStore() { - const [dataVisible, setDataVisible] = useState(false); + // const [dataVisible, setDataVisible] = useState(false); const [configVisible, setConfigVisible] = useState(false); const [currentItem, setCurrentItem] = useState(); const { list: posts } = usePagination(getPostListApi, {}); const pagination = usePagination(getDataConfigListApi); - const requireDataPagination = usePagination(getRequireListApi); - const [idCardId, setIdCardId] = useState(); // 身份证ID - const [laborContractId, setLaborContractId] = useState(); // 劳动合同ID - const [notificationId, setNotificationId] = useState(); // 告知书ID + // const requireDataPagination = usePagination(getRequireListApi); + const dataPagination = usePagination(getDatabaseListApi, { applySys: 'ehr', pageSize: 30 }); + // const [idCardId, setIdCardId] = useState(); // 身份证ID + // const [laborContractId, setLaborContractId] = useState(); // 劳动合同ID + // const [notificationId, setNotificationId] = useState(); // 告知书ID - useEffect(() => { - if (requireDataPagination.list.length) { - requireDataPagination.list.forEach(item => { - if (item.requireCode === 'id_card') { - setIdCardId(item.id); - } - if (item.requireCode === 'labor_contract') { - setLaborContractId(item.id); - } - if (item.requireCode === 'notification') { - setNotificationId(item.id); - } - return { - label: item.requireName, - key: item.requireCode || item.id, - value: item.id, - }; - }) - } - }, [requireDataPagination.list]); + // useEffect(() => { + // if (requireDataPagination.list.length) { + // requireDataPagination.list.forEach((item) => { + // if (item.requireCode === "id_card") { + // setIdCardId(item.id); + // } + // if (item.requireCode === "labor_contract") { + // setLaborContractId(item.id); + // } + // if (item.requireCode === "notification") { + // setNotificationId(item.id); + // } + // return { + // label: item.requireName, + // key: item.requireCode || item.id, + // value: item.id, + // }; + // }); + // } + // }, [requireDataPagination.list]); return { - dataVisible, - setDataVisible, + // dataVisible, + // setDataVisible, configVisible, setConfigVisible, currentItem, setCurrentItem, posts, pagination, - requireDataPagination, - idCardId, - laborContractId, - notificationId - } -} \ No newline at end of file + // requireDataPagination, + // idCardId, + // laborContractId, + // notificationId, + dataPagination, + }; +} diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/api.ts b/src/pages/ehr/InterviewSetting/InterviewSetting/api.ts index 6519eaf..c8d991e 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/api.ts +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/api.ts @@ -1,7 +1,7 @@ /* * @Date: 2021-03-06 16:59:54 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-17 10:40:36 + * @LastEditTime: 2022-04-20 15:07:37 */ import request, { host } from "@/utils/request"; import { EHR_HOST } from "@/utils/host"; @@ -10,16 +10,17 @@ import { http } from "@/typing/http"; // 请求列表 export function getListApi( params?: Interview.DetailInterview -): http.PromiseResp { - return request.get( - `/${EHR_HOST}/recruit/erp/interview/flow/page`, - { params } - ); +): http.PromisePageResp { + return request.get(`/${EHR_HOST}/recruit/erp/interview/flow/page`, { + params, + }); } // 审批角色请求数据 -export function employRoleList(params: Interview.DetailInterview) { - return request.get(`${host.admin}/role/listAll`); +export function employRoleList() { + return request.get( + `${EHR_HOST}/hr/common/manager/role/list` + ); } //获取岗位列表 @@ -47,16 +48,15 @@ export function deleteApi(id: number) { // 面试模板 export function getEvaluateList( params?: Interview.DetailInterview -): http.PromiseResp { - return request.get( - `/${EHR_HOST}/recruit/erp/interview/evaluate/page`, - { params } - ); +): http.PromisePageResp { + return request.get(`/${EHR_HOST}/recruit/erp/interview/evaluate/page`, { + params, + }); } // 获取页面详情 export function getDetail(id?: number) { - return request.get( + return request.get( `/${EHR_HOST}/recruit/erp/interview/flow/detail`, { params: { id } } ); diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/EditModal.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/components/EditModal.tsx index 5d155bc..0a72c08 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/EditModal.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/EditModal.tsx @@ -45,9 +45,9 @@ export default function EditModal({ item }: Props) { setTableLoading(true); api .getDetail(current.id) - .then((res: any) => { + .then((res) => { if (res.success) { - const cur = res.data; + const cur = res.data || {}; setPostId(cur.postId); // 初始化编辑的岗位ID form.setFieldsValue({ id: cur && cur.id, @@ -61,7 +61,10 @@ export default function EditModal({ item }: Props) { (cur.shopType == 2 && cur.interviewFlowShopList) || [], }, interviewFlowItemList: (cur && cur.interviewFlowItemList) || [], - // employRoleName: { key:cur.employRoleCode, label: cur.employRoleName }, + employRole: { + value: cur.employRoleCode, + label: cur.employRoleName, + }, }); setTableLoading(false); } else { @@ -116,10 +119,10 @@ export default function EditModal({ item }: Props) { postName: item.postName.label, // 门店类型 1全部门店 2部分门店 shopType: item.shop.shopType || 1, - // // 录用审批角色编码 - // employRoleCode: (item.employRoleName.key).toString(), - // // 录用审批角色名 - // employRoleName: item.employRoleName.label, + // 录用审批角色编码 + employRoleCode: item.employRole?.value, + // 录用审批角色名 + employRoleName: item.employRole?.label, interviewFlowShopList: item.shop.shopType == 2 ? item.shop.interviewFlowShopList : undefined, }; @@ -163,8 +166,8 @@ export default function EditModal({ item }: Props) {
@@ -191,9 +194,9 @@ export default function EditModal({ item }: Props) { @@ -214,13 +217,24 @@ export default function EditModal({ item }: Props) { return null; }} - {/* - + {roleLists.map((item: any) => ( + + ))} - */} +
diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/List.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/components/List.tsx index 01dc821..aa1b601 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/List.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/List.tsx @@ -1,19 +1,26 @@ /* * @Date: 2021-02-03 10:42:42 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-02-21 11:17:03 + * @LastEditTime: 2022-04-20 14:57:49 */ -import React from 'react'; -import { Table, Popconfirm, Divider, message, Popover } from 'antd' -import moment from 'moment'; -import { useStore } from '../index'; -import { deleteApi } from '../api' -import './style.less'; +import React from "react"; +import { Table, Popconfirm, Divider, message, Popover } from "antd"; +import moment from "moment"; +import { useStore } from "../index"; +import { deleteApi } from "../api"; +import "./style.less"; const { Column } = Table; export default function List() { - const { list: data, loading, setModalVisible, setCurrent, setLoading, paginationConfig } = useStore(); + const { + list: data, + loading, + setModalVisible, + setCurrent, + setLoading, + paginationConfig, + } = useStore(); function handleModalVisible(flag: boolean, itemDate?: any) { setModalVisible(flag); @@ -22,8 +29,8 @@ export default function List() { // 删除系统 const handleDelete = (record: any) => { - deleteApi(record.id).then(res => { - message.success('删除成功'); + deleteApi(record.id).then((res) => { + message.success("删除成功"); setLoading(true); }); }; @@ -35,25 +42,48 @@ export default function List() { rowKey="id" pagination={paginationConfig} > - + - i.shopName || "").join(",") : "全部门店"}`}> - - {`${record.shopType == 2 ? (record.interviewFlowShopList || []).map(i => i.shopName || "").join(",") : "全部门店"}`} + width="30%" + render={(test, record: Interview.DetailInterview) => ( + i.shopName || "") + .join(",") + : "全部门店" + }`} + > + + {`${ + record.shopType == 2 + ? (record.interviewFlowShopList || []) + .map((i) => i.shopName || "") + .join(",") + : "全部门店" + }`} - } - > - {moment(time).format('YYYY-MM-DD HH:mm:ss')}}> + + )} + /> + ( + {moment(time).format("YYYY-MM-DD HH:mm:ss")} + )} + /> ( - + <> handleModalVisible(true, record)}>编辑 handleDelete(record)} > - 删除 + + 删除 + - + )} /> - ) -} \ No newline at end of file + ); +} diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/RadioHandle.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/components/RadioHandle.tsx index c6b18c1..ad6820f 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/RadioHandle.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/RadioHandle.tsx @@ -2,7 +2,7 @@ * @Author: wangqiang@feewee.cn * @Date: 2021-07-14 10:54:47 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 10:46:20 + * @LastEditTime: 2022-04-26 09:17:55 */ import React from "react"; import { Radio, Select } from "antd"; @@ -29,12 +29,13 @@ export default function RadioHandle({ value, onChange }: Props) { const _new = { ...value, interviewFlowShopList: val.map((item: any) => ({ - shopId: item.key, + shopId: item.value, shopName: item.label, })), }; onChange && onChange(_new); } + return (
@@ -45,7 +46,7 @@ export default function RadioHandle({ value, onChange }: Props) { setVisible(true)} /> @@ -62,21 +73,22 @@ export default function EvaluateName({ value = {}, onChange }: Props) { setSelected({ - evaluateId: selectedRows[0].id, - evaluateName: selectedRows[0].name - }), + evaluateId: selectedRows[0].id, + evaluateName: selectedRows[0].name, + }), }} rowKey="id" loading={loading} pagination={paginationConfig} > - - + +
- ) -} \ No newline at end of file + ); +} diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/Item.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/Item.tsx index 6fac007..d41071c 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/Item.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/Item.tsx @@ -30,7 +30,12 @@ export default function RoleSetting({ useEffect(() => { if (value.edit) { form.setFieldsValue({ - // roleName: value.roleCode && { key: value.roleCode, label: value.roleName } || undefined, + roleName: + (value.roleCode && { + value: value.roleCode, + label: value.roleName, + }) || + undefined, evaluateName: value.evaluateId && { evaluateId: value.evaluateId, evaluateName: value.evaluateName, @@ -57,8 +62,8 @@ export default function RoleSetting({ const params = { ...value, ...feildValue, - // roleCode: feildValue.roleName.key, - // roleName: feildValue.roleName.label, + roleCode: feildValue.roleName.value, + roleName: feildValue.roleName.label, evaluateId: feildValue.evaluateName.evaluateId, evaluateName: feildValue.evaluateName.evaluateName, edit: false, @@ -96,24 +101,32 @@ export default function RoleSetting({ form={form} style={{ flex: 1 }} onFinish={handleSave} + labelCol={{ span: 6 }} + wrapperCol={{ span: 18 }} labelAlign="right" > {value.edit ? ( <> - {/* - - */} + + ) : ( <> - {/* + {value.roleName} - */} + {value.scorePercent} % diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/index.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/index.tsx index da76f8c..6699e51 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/index.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/RoleSetting/index.tsx @@ -1,12 +1,18 @@ -import React, { useState, useEffect } from 'react'; -import { Button, Card, List, message } from 'antd'; -import { PlusOutlined } from '@ant-design/icons'; -import Item from './Item'; -import { useStore } from '../../index' +/* + * @Author: wangqiang@feewee.cn + * @Date: 2022-04-13 09:39:04 + * @LastEditors: wangqiang@feewee.cn + * @LastEditTime: 2022-04-20 14:58:07 + */ +import React, { useState, useEffect } from "react"; +import { Button, Card, List, message } from "antd"; +import { PlusOutlined } from "@ant-design/icons"; +import Item from "./Item"; +import { useStore } from "../../index"; interface Props { - value?: Interview.DetailInterview[], - onChange?: (value: Interview.DetailInterview[]) => void, + value?: Interview.DetailInterview[]; + onChange?: (value: Interview.DetailInterview[]) => void; } export default function RoleSetting({ value = [], onChange }: Props) { @@ -14,8 +20,10 @@ export default function RoleSetting({ value = [], onChange }: Props) { const [saveRole, setSaveRole] = useState([]); useEffect(() => { - setSaveRole(value.map(val => ({ key: val.roleCode, label: val.roleName }))) - }, []) + setSaveRole( + value.map((val) => ({ key: val.roleCode, label: val.roleName })) + ); + }, []); function handleAdd() { if (addFlag) { @@ -44,8 +52,22 @@ export default function RoleSetting({ value = [], onChange }: Props) { return ( - +
+
} > @@ -53,8 +75,8 @@ export default function RoleSetting({ value = [], onChange }: Props) { itemLayout="horizontal" size="small" dataSource={value} - renderItem={(item, index) => - ( ( + deleteHandle(index)} saveRole={saveRole} setSaveRole={setSaveRole} - />)} + /> + )} />
- ) -} \ No newline at end of file + ); +} diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.css b/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.css index e8e006a..6ab5bd1 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.css +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.css @@ -1,8 +1,8 @@ .span_limit_1 { - text-align: left; + display: -webkit-box; overflow: hidden; + text-align: left; text-overflow: ellipsis; - display: -webkit-box; /*! autoprefixer: off */ -webkit-box-orient: vertical; -webkit-line-clamp: 1; diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.less b/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.less index 6d15daf..6ab5bd1 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.less +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/components/style.less @@ -1,9 +1,9 @@ .span_limit_1 { - text-align: left; + display: -webkit-box; overflow: hidden; + text-align: left; text-overflow: ellipsis; - display: -webkit-box; /*! autoprefixer: off */ -webkit-box-orient: vertical; -webkit-line-clamp: 1; -} \ No newline at end of file +} diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/index.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/index.tsx index 07cfa7b..6cd841b 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/index.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/index.tsx @@ -1,43 +1,58 @@ -import React from 'react' -import { PageHeaderWrapper } from '@ant-design/pro-layout'; -import { Card, Row, Button, Input } from 'antd'; -import { PlusOutlined } from '@ant-design/icons'; -import { createStore } from '@/hooks/moz'; -import store from './store'; -import List from './components/List'; -import { debounce } from 'lodash'; -import EditModal from './components/EditModal' +/* + * @Author: wangqiang@feewee.cn + * @Date: 2022-04-13 09:39:04 + * @LastEditors: wangqiang@feewee.cn + * @LastEditTime: 2022-04-20 14:57:23 + */ +import React from "react"; +import { PageHeaderWrapper } from "@ant-design/pro-layout"; +import { Card, Row, Button, Input } from "antd"; +import { PlusOutlined } from "@ant-design/icons"; +import { createStore } from "@/hooks/moz"; +import store from "./store"; +import List from "./components/List"; +import { debounce } from "lodash"; +import EditModal from "./components/EditModal"; export const { Provider, useStore } = createStore(store); function InterviewSetting() { const { setModalVisible, setParams, setAddFlag } = useStore(); - - const handleChange = debounce(value => { - setParams({postName: value}, true) - }, 500) + + const handleChange = debounce((value) => { + setParams({ postName: value }, true); + }, 500); return ( - handleChange(e.target.value)} - /> - + handleChange(e.target.value)} + /> + - ) + ); } -export default () => \ No newline at end of file +export default () => ( + + + +); diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/interface.d.ts b/src/pages/ehr/InterviewSetting/InterviewSetting/interface.d.ts index 463747a..6ddd70a 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/interface.d.ts +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/interface.d.ts @@ -1,46 +1,52 @@ +/* + * @Author: wangqiang@feewee.cn + * @Date: 2022-04-13 09:39:04 + * @LastEditors: wangqiang@feewee.cn + * @LastEditTime: 2022-04-20 15:06:12 + */ declare namespace Interview { interface ShopList { - shopId?: number, - shopName?: string, + shopId?: number; + shopName?: string; } - + interface List { - id?: number,//面试流程id - postName?: string,//岗位名 - createTime?: Date,//创建时间 - shopType?: number,//门店类型 1全部门店 2部分门店 - interviewFlowShopList?: ShopList[] + id?: number; //面试流程id + postName?: string; //岗位名 + createTime?: Date; //创建时间 + shopType?: number; //门店类型 1全部门店 2部分门店 + interviewFlowShopList?: ShopList[]; } - interface DetailInterview { - id?: number, - postId?: number, - postName?: string, - shopType?: number, - employRoleCode?: string, - employRoleName?: string, - interviewFlowShopList?: ShopList[], - interviewFlowItemList?: DetailList[], - disabled? : boolean, - roleName?: string, - roleCode?: string, - evaluateId?: number, - shopId?: number, - shopName?: string, - scorePercent?: number, - evaluateName?: string, - edit?: boolean + interface DetailInterview { + id?: number; + postId?: number; + postName?: string; + shopType?: number; + employRoleCode?: string; + employRoleName?: string; + interviewFlowShopList?: ShopList[]; + interviewFlowItemList?: DetailList[]; + disabled?: boolean; + roleName?: string; + roleCode?: string; + evaluateId?: number; + shopId?: number; + shopName?: string; + scorePercent?: number; + evaluateName?: string; + edit?: boolean; + } interface DetailList { - scorePercent: number, - evaluateId: number, - evaluateName: string, - roleCode: string, - roleName: string + scorePercent: number; + evaluateId: number; + evaluateName: string; + roleCode: string; + roleName: string; } interface RoleLists { - ids?: number, - roleName?: string, - roleCode?: string + ids?: number; + roleName?: string; + roleCode?: string; } - -} \ No newline at end of file +} diff --git a/src/pages/ehr/InterviewSetting/InterviewSetting/store.tsx b/src/pages/ehr/InterviewSetting/InterviewSetting/store.tsx index a698333..57f2759 100644 --- a/src/pages/ehr/InterviewSetting/InterviewSetting/store.tsx +++ b/src/pages/ehr/InterviewSetting/InterviewSetting/store.tsx @@ -1,26 +1,33 @@ -import * as api from './api'; -import { useState } from 'react' -import usePagination from '@/hooks/usePagination'; -import useInitail from '@/hooks/useInitail'; +/* + * @Author: wangqiang@feewee.cn + * @Date: 2022-04-13 09:39:04 + * @LastEditors: wangqiang@feewee.cn + * @LastEditTime: 2022-04-20 14:57:19 + */ +import * as api from "./api"; +import { useState } from "react"; +import usePagination from "@/hooks/usePagination"; +import useInitail from "@/hooks/useInitail"; export default function useStore() { - const { list, loading, setParams, setLoading, paginationConfig } = usePagination(api.getListApi, {}); + const { list, loading, setParams, setLoading, paginationConfig } = + usePagination(api.getListApi, {}); const [modalVisible, setModalVisible] = useState(false); const [current, setCurrent] = useState({}); // 审批列表 const { data: roleLists } = useInitail(api.employRoleList, [], {}); // 岗位名称 const { list: postLists } = usePagination(api.getPostList, [], {}); - const { data: postList } = useInitail(api.getPostApi, [], {}) + const { data: postList } = useInitail(api.getPostApi, [], {}); const [addFlag, setAddFlag] = useState(false); let [edit, setEdit] = useState(false); const [tableLoading, setTableLoading] = useState(false); // 面试审批角色 - const ApprovalRoles: { label: string, value: string }[] = [ - { label: '面试-1', value: 'INTERVIEW-1' }, - { label: '面试-2', value: 'INTERVIEW-2' }, - { label: '面试-3', value: 'INTERVIEW-3' } + const ApprovalRoles: { label: string; value: string }[] = [ + { label: "面试-1", value: "INTERVIEW-1" }, + { label: "面试-2", value: "INTERVIEW-2" }, + { label: "面试-3", value: "INTERVIEW-3" }, ]; /** @@ -49,6 +56,6 @@ export default function useStore() { setTableLoading, ApprovalRoles, postId, - setPostId - } -} \ No newline at end of file + setPostId, + }; +} diff --git a/src/pages/ehr/PostSetting/components/IndexList/PostSettingModal.tsx b/src/pages/ehr/PostSetting/components/IndexList/PostSettingModal.tsx index 3eb1dca..f522cab 100644 --- a/src/pages/ehr/PostSetting/components/IndexList/PostSettingModal.tsx +++ b/src/pages/ehr/PostSetting/components/IndexList/PostSettingModal.tsx @@ -1,14 +1,14 @@ /* * @Date: 2021-04-20 09:37:50 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 10:50:26 + * @LastEditTime: 2022-03-17 11:13:04 */ import React, { useEffect, useState } from "react"; import { Form, Input, Modal, message, Switch, Select, Radio } from "antd"; import { ExclamationCircleOutlined } from "@ant-design/icons"; import { useStore } from "../../index"; import { savePostApi } from "../../api"; -import { validatorNumber } from "@/utils/validate"; +import { validatorNumberCanWithDecimal } from "@/utils/validate"; const FormItem = Form.Item; const SelectOption = Select.Option; @@ -243,7 +243,7 @@ export default function PostSettingModal() { label="话费补贴" rules={[ { required: true, message: "请输入话费补贴" }, - { validator: validatorNumber }, + { validator: validatorNumberCanWithDecimal }, ]} > { - return request.get(`${ABILITY_HOST}/erp/exam/config/list`, { + return request.get(`${ABILITY_HOST}/erp/exam/config/ability/list`, { params, }); } diff --git a/src/pages/ehr/StandardSetting/ExamSetting/components/QuestionBank/components/AddQuestionBank.tsx b/src/pages/ehr/StandardSetting/ExamSetting/components/QuestionBank/components/AddQuestionBank.tsx index fc68519..b9e1cd5 100644 --- a/src/pages/ehr/StandardSetting/ExamSetting/components/QuestionBank/components/AddQuestionBank.tsx +++ b/src/pages/ehr/StandardSetting/ExamSetting/components/QuestionBank/components/AddQuestionBank.tsx @@ -1,15 +1,23 @@ /* * @Date: 2021-03-26 14:12:53 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-08-30 15:23:40 + * @LastEditTime: 2022-04-22 10:20:11 */ -import React, { useEffect, useState } from 'react'; -import { Modal, Input, Table } from 'antd'; -import { useStore } from '../../../index'; -import useDebounce from '@/hooks/useDebounce'; +import React, { useEffect, useState } from "react"; +import { Modal, Input, Table } from "antd"; +import { useStore } from "../../../index"; +import useDebounce from "@/hooks/useDebounce"; export default function AddQuestionBank() { - const { visible, setVisible, questionBankInitial, form, standardId, examRole, getQuestionBankAttachList } = useStore(); + const { + visible, + setVisible, + questionBankInitial, + form, + standardId, + examRole, + getQuestionBankAttachList, + } = useStore(); const { data, loading, setParams } = questionBankInitial; const [selected, setSelected] = useState([]); const [inputVal, setInputVal] = useState(); @@ -17,8 +25,15 @@ export default function AddQuestionBank() { useEffect(() => { if (visible) { - setSelected(form.getFieldValue('examItemList') || []); - setParams({ standardId, scopeType: examRole?.type, roleCode: (examRole?.list || []).map(role => role.value).join(',') }, true); + setSelected(form.getFieldValue("examItemList") || []); + setParams( + { + standardId, + scopeType: examRole?.type, + roleCode: (examRole?.list || []).map((role) => role.value).join(","), + }, + true + ); } }, [visible, standardId, examRole]); @@ -26,24 +41,43 @@ export default function AddQuestionBank() { setParams({ name: inputChange }, true); }, [inputChange]); - const _onChange = (selectedRowKeys: number[], selectedRows: QuestionBank.List[]) => { - const seled: number[] = (form.getFieldValue('examItemList') || []).map((item: ExamSetting.QuestionBank) => item.factoryId); + const _onChange = ( + selectedRowKeys: number[], + selectedRows: QuestionBank.List[] + ) => { + const seled: number[] = (form.getFieldValue("examItemList") || []).map( + (item: ExamSetting.QuestionBank) => item.factoryId + ); const selectedR = [...selectedRows]; - const hadSelectedIds = selectedR.filter(item => seled.includes(item.id!)).map(row => row.id); - setSelected(selectedRows.map(row => { - if (hadSelectedIds.includes(row.id!)) { - const index = seled.findIndex(id => id === row.id); - return selected[index]; - } else { - return { factoryId: row.id, factoryName: row.name, total: row.num, num: 0 }; - } - })); - } + const hadSelectedIds = selectedR + .filter((item) => seled.includes(item.id!)) + .map((row) => row.id); + setSelected( + selectedRows.map((row) => { + if (hadSelectedIds.includes(row.id!)) { + const index = seled.findIndex((id) => id === row.id); + return selected[index]; + } else { + return { + factoryId: row.id, + factoryName: row.name, + total: row.num, + num: 0, + }; + } + }) + ); + }; const _onOk = () => { - form.setFieldsValue({ examItemList: selected, questionNum: selected.map(i => i.num).reduce((prev, cur) => (prev || 0) + (cur || 0), 0) }); - const factoryIds = selected.map(s => s.factoryId!); - getQuestionBankAttachList(factoryIds.join(',')); + form.setFieldsValue({ + examItemList: selected, + questionNum: selected + .map((i) => i.num) + .reduce((prev, cur) => (prev || 0) + (cur || 0), 0), + }); + const factoryIds = selected.map((s) => s.factoryId!); + getQuestionBankAttachList(factoryIds.join(",")); setVisible(false); setSelected([]); setInputVal(undefined); @@ -51,28 +85,33 @@ export default function AddQuestionBank() { return ( setVisible(false)} onOk={_onOk} - > - setInputVal(e.target.value)} style={{ maxWidth: 260, marginBottom: 20 }} /> + setInputVal(e.target.value)} + style={{ maxWidth: 260, marginBottom: 20 }} + /> s.factoryId || 0) || [], - onChange: _onChange + type: "checkbox", + selectedRowKeys: selected.map((s) => s.factoryId || 0) || [], + onChange: _onChange, }} > - - + +
- ) -} \ No newline at end of file + ); +} diff --git a/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/QuestionBankModal.tsx b/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/QuestionBankModal.tsx index 71a29c0..d396fe6 100644 --- a/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/QuestionBankModal.tsx +++ b/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/QuestionBankModal.tsx @@ -1,7 +1,7 @@ /* * @Date: 2021-07-14 10:54:47 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-03-17 10:19:42 + * @LastEditTime: 2022-04-22 09:24:49 */ import React, { useEffect, useState } from "react"; import { Modal, Form, Input, message, Select } from "antd"; @@ -56,10 +56,10 @@ export default function QuestionBankModal() { : undefined, role: { type: currentItem.scopeType || 1, - list: - currentItem.roleCode && currentItem.roleName - ? { value: currentItem.roleCode, label: currentItem.roleName } - : undefined, + list: currentItem.roleList?.map((role) => ({ + label: role.roleName, + value: role.roleCode, + })), }, abilityAttachList: FeeweeFileInit( currentItem.abilityAttachList || [] @@ -118,8 +118,10 @@ export default function QuestionBankModal() { standardId: val.standard?.value, standardName: val.standard?.label, scopeType: val.role?.type, - roleCode: val.role?.list?.value, - roleName: val.role?.list?.label, + roleList: val.role?.list?.map((item: any) => ({ + roleCode: item.value, + roleName: item.label, + })), abilityAttachList: (val.abilityAttachList && (val.abilityAttachList || []).map( @@ -226,6 +228,7 @@ export default function QuestionBankModal() { authorizeType={1} standardId={standardId} disabled={TYPE === 1 && !isDraft} + mode="multiple" /> - {record.scopeType === 1 ? "全部" : record.roleName} + {record.scopeType === 1 ? ( + "全部" + ) : record.roleList?.length ? ( + { + setCurrentItem(record); + setRoleVisible(true); + }} + > + 部分 + + ) : '-'} )} /> @@ -258,6 +271,25 @@ export default function DraftList() { ))}
+ setRoleVisible(false)} + onCancel={() => setRoleVisible(false)} + footer={[ + , + ]} + afterClose={() => setCurrentItem(undefined)} + > +
+ {currentItem?.roleList?.map((role, index) => ( +

{role.roleName}

+ ))} +
+
); } diff --git a/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/components/UsingList/index.tsx b/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/components/UsingList/index.tsx index 2baef5a..541ac9a 100644 --- a/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/components/UsingList/index.tsx +++ b/src/pages/ehr/StandardSetting/QuestionBank/components/QuestionBankList/components/UsingList/index.tsx @@ -1,7 +1,7 @@ /* * @Date: 2021-07-26 17:19:45 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-02-22 10:56:30 + * @LastEditTime: 2022-04-22 11:31:27 */ import React, { useEffect, useState } from "react"; import { useStore } from "../../../../index"; @@ -35,6 +35,8 @@ export default function UsingList() { setCurrentBreadcrumb, abilityAttachVisible, setAbilityAttachVisible, + roleVisible, + setRoleVisible, standardTypeList, setIsDraft, setTYPE, @@ -199,7 +201,20 @@ export default function UsingList() { - {record.scopeType === 1 ? "全部" : record.roleName} + {record.scopeType === 1 ? ( + "全部" + ) : record.roleList?.length ? ( + { + setCurrentItem(record); + setRoleVisible(true); + }} + > + 部分 + + ) : ( + "-" + )} )} /> @@ -281,6 +296,25 @@ export default function UsingList() { ))}
+ setRoleVisible(false)} + onCancel={() => setRoleVisible(false)} + footer={[ + , + ]} + afterClose={() => setCurrentItem(undefined)} + > +
+ {currentItem?.roleList?.map((role, index) => ( +

{role.roleName}

+ ))} +
+
); } diff --git a/src/pages/ehr/StandardSetting/QuestionBank/interface.d.ts b/src/pages/ehr/StandardSetting/QuestionBank/interface.d.ts index a38d3c1..0ecc6a2 100644 --- a/src/pages/ehr/StandardSetting/QuestionBank/interface.d.ts +++ b/src/pages/ehr/StandardSetting/QuestionBank/interface.d.ts @@ -1,85 +1,91 @@ /* * @Date: 2021-02-24 09:57:33 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-07-29 10:38:59 + * @LastEditTime: 2022-04-22 09:23:00 */ declare namespace QuestionBank { interface QueryParams { - name?: string // 题库名 - factoryId?: number // 生效中题库ID - standardId?: number // 业务类型ID - scopeType?: number // 适配范围 1通用 2部分 - roleCode?: string // 角色码 + name?: string; // 题库名 + factoryId?: number; // 生效中题库ID + standardId?: number; // 业务类型ID + scopeType?: number; // 适配范围 1通用 2部分 + roleCode?: string; // 角色码 } interface List { - id?: number - factoryId?: number // 生效中题库ID - name?: string - num?: number // 题量 - roleCode?: string,//适用角色编码 - roleName?: string,//适用角色名臣 - scopeType?: 1 | 2,//适用范围 1通用 2:部分 - standardId?: number,//业务类型ID - standardName?: string //业务类型名称 - abilityAttachList?: AbilityAttachVO[] // 附件 - status?: 1 | 2, //状态 1草稿 2审批中 3审批拒绝 + id?: number; + factoryId?: number; // 生效中题库ID + name?: string; + num?: number; // 题量 + scopeType?: 1 | 2; //适用范围 1通用 2:部分 + roleList?: RoleVO[]; + standardId?: number; //业务类型ID + standardName?: string; //业务类型名称 + abilityAttachList?: AbilityAttachVO[]; // 附件 + status?: 1 | 2; //状态 1草稿 2审批中 3审批拒绝 + } + + interface RoleVO { + roleCode?: string; //适用角色编码 + roleName?: string; //适用角色名臣 } interface AbilityAttachVO { - id?: number - type?: number // 1文档 2音频 3视频 - fid?: string - fileName?: string + id?: number; + type?: number; // 1文档 2音频 3视频 + fid?: string; + fileName?: string; } interface Items { - id?: number - questions?: Question[] + id?: number; + questions?: Question[]; } interface Question { - id?: number - factoryId?: number // 题库ID - draftId?: number // 草稿ID - index?: number - title?: string // 题目 - type?: number // 1 单选;2 多选;3 填空 - rightAnswer?: string - answerItemList?: ChoiceItem[] // 选择题选项 或 填空题答案 - uniqueFlag?: string // 草稿题目唯一标识 - draft?: boolean // 是否草稿创建 + id?: number; + factoryId?: number; // 题库ID + draftId?: number; // 草稿ID + index?: number; + title?: string; // 题目 + type?: number; // 1 单选;2 多选;3 填空 + rightAnswer?: string; + answerItemList?: ChoiceItem[]; // 选择题选项 或 填空题答案 + uniqueFlag?: string; // 草稿题目唯一标识 + draft?: boolean; // 是否草稿创建 } - interface ChoiceItem { // 选择题 - questionId?: number // 题目id - itemNo?: string // 答案编号 - answerItem?: string // 答案内容 + interface ChoiceItem { + // 选择题 + questionId?: number; // 题目id + itemNo?: string; // 答案编号 + answerItem?: string; // 答案内容 } - interface CompletionItem { // 填空题 - key?: string + interface CompletionItem { + // 填空题 + key?: string; } interface ImportQuestionParams { - file: File - draftId: number // 草稿ID - cover: boolean // 是否覆盖 + file: File; + draftId: number; // 草稿ID + cover: boolean; // 是否覆盖 } interface DraftQuestionParams { - factoryId?: number // 生效题库ID - draftId?: number // 草稿题库ID + factoryId?: number; // 生效题库ID + draftId?: number; // 草稿题库ID } interface DeleteDraftQuestionParams { - draftId: number // 草稿题库ID - id: number // 题目ID - draft: boolean // 是否草稿创建 + draftId: number; // 草稿题库ID + id: number; // 题目ID + draft: boolean; // 是否草稿创建 } interface BatchDeleteDraftQuestionParams { - draftId: number // 草稿题库ID - draftQuestionDelList: DeleteDraftQuestionParams[] + draftId: number; // 草稿题库ID + draftQuestionDelList: DeleteDraftQuestionParams[]; } -} \ No newline at end of file +} diff --git a/src/pages/ehr/StandardSetting/QuestionBank/store.ts b/src/pages/ehr/StandardSetting/QuestionBank/store.ts index 8bc6baf..2c736c2 100644 --- a/src/pages/ehr/StandardSetting/QuestionBank/store.ts +++ b/src/pages/ehr/StandardSetting/QuestionBank/store.ts @@ -1,26 +1,64 @@ /* * @Date: 2021-02-24 09:57:33 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-07-29 17:34:55 + * @LastEditTime: 2022-04-22 10:07:13 */ -import useInitial from '@/hooks/useInitail'; -import usePagination from '@/hooks/usePagination'; -import { getStandardTypeListByAuthApi } from '@/pages/ehr/StandardSetting/api'; -import { useState, ReactNode, useEffect } from 'react'; -import { getQuestionBankListApi, getQuestionListApi, getDraftListApi, getQuestionListByDraftApi } from './api'; +import useInitial from "@/hooks/useInitail"; +import usePagination from "@/hooks/usePagination"; +import { getStandardTypeListByAuthApi } from "@/pages/ehr/StandardSetting/api"; +import { useState, ReactNode, useEffect } from "react"; +import { + getQuestionBankListApi, + getQuestionListApi, + getDraftListApi, + getQuestionListByDraftApi, +} from "./api"; export interface BreadcrumbItem { - key?: string - name?: string + key?: string; + name?: string; } -export const OrderBy = [, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; +export const OrderBy = [ + , + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", +]; export default function useStore() { // 面包屑列表 - const [breadcrumbs, setBreadcrumbs] = useState([{ name: '列表', key: 'list' }]); + const [breadcrumbs, setBreadcrumbs] = useState([ + { name: "列表", key: "list" }, + ]); // 当前面包屑 - const [currentBreadcrumb, setCurrentBreadcrumb] = useState({ name: '列表', key: 'list' }); + const [currentBreadcrumb, setCurrentBreadcrumb] = useState({ + name: "列表", + key: "list", + }); const [TYPE, setTYPE] = useState<1 | 2>(1); const [visible, setVisible] = useState(false); const [addVisible, setAddVisible] = useState(false); @@ -29,18 +67,38 @@ export default function useStore() { const [isAddFinish, setIsAddFinish] = useState(true); const [currentItem, setCurrentItem] = useState(); // 列表项 - const pagination = usePagination(getQuestionBankListApi, {}, {}); + const pagination = usePagination( + getQuestionBankListApi, + {}, + {} + ); const [delay, setQuestionDelay] = useState(true); const [factoryId, setFactoryId] = useState(0); const [draftId, setDraftId] = useState(0); - const questionPagination = usePagination(getQuestionListApi, { factoryId }, { delay }); + const questionPagination = usePagination( + getQuestionListApi, + { factoryId }, + { delay } + ); // 添加题目弹窗中的题目内容,关闭后重置为空数组; - const [addModalContents, setAddModalContents] = useState<{ node: ReactNode, index: number }[]>([]); - const { data: standardTypeList = [] } = useInitial(getStandardTypeListByAuthApi, [], 1); // 业务类型列表 + const [addModalContents, setAddModalContents] = useState< + { node: ReactNode; index: number }[] + >([]); + const { data: standardTypeList = [] } = useInitial( + getStandardTypeListByAuthApi, + [], + 1 + ); // 业务类型列表 const [abilityAttachVisible, setAbilityAttachVisible] = useState(false); + const [roleVisible, setRoleVisible] = useState(false); const draftPagination = usePagination(getDraftListApi); - const draftQuestionInitial = useInitial(getQuestionListByDraftApi, [], { draftId }, delay); + const draftQuestionInitial = useInitial( + getQuestionListByDraftApi, + [], + { draftId }, + delay + ); const [isBatchDelete, setIsBatchDelete] = useState(false); const [selected, setSelected] = useState([]); const [isDraft, setIsDraft] = useState(false); @@ -86,6 +144,8 @@ export default function useStore() { standardTypeList, abilityAttachVisible, setAbilityAttachVisible, + roleVisible, + setRoleVisible, draftPagination, draftQuestionInitial, isBatchDelete, @@ -94,5 +154,5 @@ export default function useStore() { setSelected, isDraft, setIsDraft, - } -} \ No newline at end of file + }; +} diff --git a/src/pages/ehr/SubsidyWhite/components/SubsidyWhiteModal.tsx b/src/pages/ehr/SubsidyWhite/components/SubsidyWhiteModal.tsx index a6330f6..69ad4d5 100644 --- a/src/pages/ehr/SubsidyWhite/components/SubsidyWhiteModal.tsx +++ b/src/pages/ehr/SubsidyWhite/components/SubsidyWhiteModal.tsx @@ -1,17 +1,18 @@ /* * @Date: 2021-07-13 14:26:59 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2021-07-13 15:34:27 + * @LastEditTime: 2022-04-26 11:03:08 */ -import React, { useEffect, useState } from 'react'; -import { Form, Modal, message, Input } from 'antd'; -import { useStore } from '../index'; -import { saveSubsidyWhiteApi } from '../api'; -import MemberSelect from '@/components/MemberSelect'; -import { validatorNumber } from '@/utils/validate'; +import React, { useEffect, useState } from "react"; +import { Form, Modal, message, Input } from "antd"; +import { useStore } from "../index"; +import { saveSubsidyWhiteApi } from "../api"; +import MemberSelect from "@/components/MemberSelect"; +import { validatorNumberCanWithDecimal } from "@/utils/validate"; export default function SubsidyWhiteModal() { - const { currentItem, setCurrentItem, visible, setVisible, pagination } = useStore(); + const { currentItem, setCurrentItem, visible, setVisible, pagination } = + useStore(); const { setLoading } = pagination; const [form] = Form.useForm(); const [confirmLoading, setConfirmLoading] = useState(false); @@ -36,49 +37,86 @@ export default function SubsidyWhiteModal() { } }, [visible]); - const onOk = () => { + const onOk = (val: any) => { setConfirmLoading(true); - form.validateFields().then(val => { - const params: SubsidyWhite.List = { - ...val, - staffId: val.staff.value, - staffName: val.staff.label, - id: currentItem ? currentItem.id || undefined : undefined, - } - saveSubsidyWhiteApi(params).then(res => { + console.log("x", val); + const params: SubsidyWhite.List = { + ...val, + staffId: val.staff?.value, + staffName: val.staff?.label, + id: currentItem ? currentItem.id || undefined : undefined, + }; + saveSubsidyWhiteApi(params) + .then((res) => { message.success(res.result); setVisible(false); setCurrentItem(undefined); setLoading(true); - }).catch(error => message.error(error.message)) - .finally(() => setConfirmLoading(false)); - }).catch(() => setConfirmLoading(false)); - } + setConfirmLoading(false); + }) + .catch((error) => { + message.error(error.message); + setConfirmLoading(false); + }); + }; return ( setVisible(false)} - afterClose={() => { form.resetFields(); setCurrentItem(undefined); }} + afterClose={() => { + form.resetFields(); + setCurrentItem(undefined); + }} > -
- + + - - + + - - + + - - + +
- ) -} \ No newline at end of file + ); +} diff --git a/src/pages/finance/CompanyRelationAuth/api.ts b/src/pages/finance/CompanyRelationAuth/api.ts index a7717b7..a8d7ab7 100644 --- a/src/pages/finance/CompanyRelationAuth/api.ts +++ b/src/pages/finance/CompanyRelationAuth/api.ts @@ -17,7 +17,7 @@ export interface CompanyRelationListVO { compId?: number compName?: string compShortName?: string//简称 - compType?: number //类型 + compType?: number[] //类型 compTypeName?: number //类型 } diff --git a/src/pages/finance/PoundageConfig/Customer/components/PoundageModal.tsx b/src/pages/finance/PoundageConfig/Customer/components/PoundageModal.tsx index 011916d..d99e493 100644 --- a/src/pages/finance/PoundageConfig/Customer/components/PoundageModal.tsx +++ b/src/pages/finance/PoundageConfig/Customer/components/PoundageModal.tsx @@ -82,7 +82,7 @@ export default function PoundageModal() {

手续费名称:{poundage.row.name}

setMethod(Number(m))}> - {[20, 40, 41, 42, 43].map((i) => ( + {[20, 40, 41, 42, 43, 44].map((i) => ( onDelete(val.itemId)} diff --git a/src/pages/finance/PoundageConfig/POS/components/PoundageCreateModal.tsx b/src/pages/finance/PoundageConfig/POS/components/PoundageCreateModal.tsx index 27b85c3..66928f2 100644 --- a/src/pages/finance/PoundageConfig/POS/components/PoundageCreateModal.tsx +++ b/src/pages/finance/PoundageConfig/POS/components/PoundageCreateModal.tsx @@ -102,7 +102,7 @@ export default function POSPoundageCreateModal() {

setMethod(Number(m))}> - {[40, 41, 42, 43].map(i => ( + {[40, 41, 42, 43, 44].map(i => ( (false); + const [value, setValue] = useState(); useEffect(() => { if (visible) { + setValue(current.wdServiceFee ? 1 : 2); form.setFieldsValue({ compCategory: current.compCategory, company: current.compId ? { value: current.compId, label: current.compName } : undefined, account: current.accountId ? { value: current.accountId, label: current.accountName } : undefined, + isSupport: current.wdServiceFee ? 1 : 2, wdServiceFee: current.wdServiceFee, brand: current.brandId ? { value: current.brandId, label: current.brandName } : undefined, }); } - }, [visible]) + }, [visible]); function submit(fieldValue: any) { setSaveLoading(true); @@ -34,19 +38,21 @@ export default function CreateModal() { compName: fieldValue.company.label, accountId: fieldValue.account.value, accountName: fieldValue.account.label, - wdServiceFee: fieldValue.wdServiceFee, + wdServiceFee: value == 1 ? fieldValue.wdServiceFee : undefined, brandId: fieldValue.brand.value, brandName: fieldValue.brand.label, }; - saveFcDiscountApi(param).then(res => { - message.success('保存成功'); - setVisible(false); - setLoading(true); - setSaveLoading(false); - }).catch(err => { - message.error(err.message); - setSaveLoading(false); - }) + saveFcDiscountApi(param) + .then((res) => { + message.success("保存成功"); + setVisible(false); + setLoading(true); + setSaveLoading(false); + }) + .catch((err) => { + message.error(err.message); + setSaveLoading(false); + }); } function onCancel() { @@ -106,16 +112,39 @@ export default function CreateModal() { ))} - - `${value} %`} - /> + + setValue(e.target.value)}> + 支持 + 不支持 + + {/* {({ getFieldValue }) => { + console.log(getFieldValue("isSupport")); + return getFieldValue("isSupport") == 1 ? ( + + `${value} %`} + /> + + ) : null; + }} */} + {value == 1 ? ( + + `${value} %`} + /> + + ) : null} + - {accountList.map((item) => ( - + 供应商 服务商 - {comBussinessList.map((item) => ( - + - {/* -