diff --git a/config/routers/crm_new.ts b/config/routers/crm_new.ts index f0af286..bf6d361 100644 --- a/config/routers/crm_new.ts +++ b/config/routers/crm_new.ts @@ -77,4 +77,8 @@ export default [ path: '/crm/threePartyPlatformClue', // 三方平台线索配置 component: './crm_new/ThreePartyPlatformClue', }, + { + path: '/crm/closeClue', // 暂停区域线索站岗分配 + component: './crm_new/Settings/subpages/CloseClue', + }, ]; \ No newline at end of file diff --git a/config/routers/finance.ts b/config/routers/finance.ts index 271844c..b582672 100644 --- a/config/routers/finance.ts +++ b/config/routers/finance.ts @@ -24,6 +24,10 @@ export default [ component: "finance/CompanyRelationAuth", }, { + path: "/finance2/companyRelationAuth/create", //往来单位关系设置==》新增 + component: "finance/CompanyRelationCreate", + }, + { path: "/finance2/specialAccountSetting/deductAccount", //划扣专用账户 component: "./finance/SpecialAccount/DeductAccount", }, diff --git a/src/pages/admin/Role/components/RoleFilter.tsx b/src/pages/admin/Role/components/RoleFilter.tsx index 68f821f..518e33c 100644 --- a/src/pages/admin/Role/components/RoleFilter.tsx +++ b/src/pages/admin/Role/components/RoleFilter.tsx @@ -24,7 +24,14 @@ export default function RoleFilter() { 禁用 {/* 已删除 */} - setParams({ ...innerParams, sysId, current: 1 }, true)} + > {(systems || []).map((i: Privilege.SystemListVO) => ())} { if (item.id === record.id) { - item.status = record.status === 0 ? 1 : 0 - return item; + return { ...item, status: record.status === 0 ? 1 : 0 }; } return item; }); diff --git a/src/pages/admin/RoleManagementGroup/components/Modal.tsx b/src/pages/admin/RoleManagementGroup/components/Modal.tsx index 8335fad..8dec58f 100644 --- a/src/pages/admin/RoleManagementGroup/components/Modal.tsx +++ b/src/pages/admin/RoleManagementGroup/components/Modal.tsx @@ -2,7 +2,7 @@ * @Author: wangqiang@feewee.cn * @Date: 2022-06-29 10:44:56 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-07-01 16:13:26 + * @LastEditTime: 2022-11-30 14:34:02 */ import { Button, @@ -139,12 +139,7 @@ export default function RoleManagementGrooupModal() { /> 管理组 - + {(fields, { add, remove }, { errors }) => ( <> {fields.map((field, index) => { @@ -152,11 +147,17 @@ export default function RoleManagementGrooupModal() { 0 ? `${number2text(index)}级管理` : "基础角色组" + } rules={[ { required: true, - message: `请选择${number2text(index + 1)}级管理组`, + message: `请选择${ + index > 0 + ? `${number2text(index)}级管理` + : "基础角色组" + }`, }, ]} > @@ -221,7 +222,9 @@ function SelectRoleGroup({ optionFilterProp="label" mode={index === 0 ? "multiple" : undefined} style={{ flex: 1 }} - placeholder={`请选择${number2text(index + 1)}级管理组`} + placeholder={`请选择${ + index > 0 ? `${number2text(index)}级管理` : "基础角色组" + }`} onBlur={() => { formatRoleList(form.getFieldValue("roleList") || []); }} diff --git a/src/pages/contract/BearCostSetting/components/BearModal/index.tsx b/src/pages/contract/BearCostSetting/components/BearModal/index.tsx index 739cd36..2e29c96 100644 --- a/src/pages/contract/BearCostSetting/components/BearModal/index.tsx +++ b/src/pages/contract/BearCostSetting/components/BearModal/index.tsx @@ -35,7 +35,7 @@ const BearModal = ({visible, onCancel, item = {} as BearCostSetting.Item}:Props) rowKey={(item) => `${item.id}`} > t || "-"} /> - (t && `${t*100}%`) || "-"} /> + (t && `${(t*100).toFixed(2)}%`) || "-"} /> diff --git a/src/pages/crm_new/Settings/index.tsx b/src/pages/crm_new/Settings/index.tsx index 61e6d4a..db95b85 100644 --- a/src/pages/crm_new/Settings/index.tsx +++ b/src/pages/crm_new/Settings/index.tsx @@ -111,6 +111,9 @@ export default function Settings() { {/* 龚昆修改整合:集客跟进,潜客跟进到一个新的页面 */}
+ history.push('/crm/closeClue')}>查看]}> + + history.push('/crm/followUpSettings')}>查看]}> diff --git a/src/pages/crm_new/Settings/subpages/CloseClue/api.ts b/src/pages/crm_new/Settings/subpages/CloseClue/api.ts new file mode 100644 index 0000000..6d661f8 --- /dev/null +++ b/src/pages/crm_new/Settings/subpages/CloseClue/api.ts @@ -0,0 +1,19 @@ +import request from '@/utils/request'; +import { CRM_HOST } from '@/utils/host'; + +export interface Result { + onlineSaleShopAssignClue?: boolean // 网销门店是否参与区域站岗线索分配 + exclusiveClueConvertRate?: number // 专属线索转化率(示例:90.50%) + stageMinAssignCount?: number // 下阶段每日最低分配线索数量 + dailyMinAssignCount?: number // 每日最低分配线索数量 从20个线索起,当天区域站岗分配线索跟进数每增加10个,低于“判断标准”,暂停当天资格 + increaseCount?: number // 每增加多少个当天区域站岗分配线索跟进数每增加10个,低于“判断标准”,暂停当天资格; +} +/** 查询停止区域线索分配资格设置 */ +export function getInfoApi() { + return request.get(`${CRM_HOST}/erp/config/find/stop/area/clue/assign/setting`); +} + +/** 新增/修改停止区域线索分配资格设置 */ +export function saveInfoApi(params: Result) { + return request.post(`${CRM_HOST}/erp/config/edit/stop/area/clue/assign/setting`, params); +} \ No newline at end of file diff --git a/src/pages/crm_new/Settings/subpages/CloseClue/index.tsx b/src/pages/crm_new/Settings/subpages/CloseClue/index.tsx new file mode 100644 index 0000000..fa5b00f --- /dev/null +++ b/src/pages/crm_new/Settings/subpages/CloseClue/index.tsx @@ -0,0 +1,160 @@ +import React, { useEffect, useState } from 'react'; +import { Button, Card, ConfigProvider, Form, InputNumber, message, Row, Switch, Space } from 'antd'; +import zhCN from 'antd/lib/locale-provider/zh_CN'; +import { PageHeaderWrapper } from '@ant-design/pro-layout'; +import { getInfoApi, saveInfoApi, Result } from './api'; +import './style.less'; +import { history } from 'umi'; +import { debounce } from 'lodash'; + +export default function CollectionFollowSetting() { + const [edit, setEdit] = useState(false); + const [loading, setLoading] = useState(true); + const [confirmLoading, setConfirmLoading]= useState(false); + const [form] = Form.useForm(); + const [stageMinAssignCount, setStageMinAssignCount] = useState(0); + const [dailyMinAssignCount, setDailyMinAssignCount] = useState(0); + const [increaseCount, setIncreaseCount] = useState(0); + const [checked, setChecked] = useState(false); + + useEffect(() => { + getInfo(); + }, []); + + const getInfo = () => { + getInfoApi().then(res => { + if (res.data) { + form.setFieldsValue({...res.data}); + setDailyMinAssignCount(res.data?.dailyMinAssignCount || 0); + setStageMinAssignCount(res.data?.stageMinAssignCount || 0); + setIncreaseCount(res.data?.increaseCount || 0); + setChecked(res.data.onlineSaleShopAssignClue || false); + } + setLoading(false); + }).catch(error => { + message.error(error.message); + setLoading(false); + }); + }; + + const onCancle = () => { + getInfo(); + setEdit(false); + }; + + const onOk = async () => { + const params: any = await form.validateFields(); + const _params: Result = { + exclusiveClueConvertRate: params.exclusiveClueConvertRate, + stageMinAssignCount, + dailyMinAssignCount, + increaseCount, + onlineSaleShopAssignClue: checked, + }; + setConfirmLoading(true); + saveInfoApi(_params).then(res => { + message.success(res.result); + setEdit(false); + setConfirmLoading(false); + history.goBack(); + }).catch(error => { + message.error(error.message); + setConfirmLoading(false); + }); + }; + + return ( + + + + {/* */} +
+ + `${value}%`} + precision={2} + disabled={!edit} + parser={value => value?.replace('%', '')} + /> + + + + {`(1)每阶段滚动判定,低于"区域站岗分配线索转化率标准",下一阶段线索每日仅分配`} + setStageMinAssignCount(e || 0)} + formatter={value => `${value}个`} + precision={0} + parser={value => value?.replace('个', '')} + /> +
+ (最低要求);阶段:1~10号;11~20号;21~月末 +
+ + + + (2)从 + setDailyMinAssignCount(e || 0)} + min={0} + disabled={!edit} + formatter={value => `${value}个`} + precision={0} + parser={value => value?.replace('个', '')} + /> + 线索起,当天区域站岗分配线索跟进数每增加 + + + setIncreaseCount(e || 0)} + formatter={value => `${value}个`} + precision={0} + disabled={!edit} + parser={value => value?.replace('个', '')} + /> + ,低于{`"区域站岗分配线索转化率标准"`},暂停当天资格; + + + + setChecked(e)} + /> + + +
+ + + { + !edit ? : + } + + + + + {/*
*/} +
+
+
+ ); +} \ No newline at end of file diff --git a/src/pages/crm_new/Settings/subpages/CloseClue/style.less b/src/pages/crm_new/Settings/subpages/CloseClue/style.less new file mode 100644 index 0000000..71b5741 --- /dev/null +++ b/src/pages/crm_new/Settings/subpages/CloseClue/style.less @@ -0,0 +1,8 @@ +.feewee-settings-form-closeClue { + .ant-form-item-control-input-content { + display: flex; + justify-content: start; + align-items: center; + flex-wrap: wrap; + } +} \ No newline at end of file diff --git a/src/pages/finance/CompanyRelationAuth/api.ts b/src/pages/finance/CompanyRelationAuth/api.ts index 30a97f7..d6036c8 100644 --- a/src/pages/finance/CompanyRelationAuth/api.ts +++ b/src/pages/finance/CompanyRelationAuth/api.ts @@ -19,6 +19,10 @@ export interface CompanyRelationListVO { compShortName?: string; //简称 compType?: number[]; //类型 compTypeName?: number; //类型 + beforeReimburse?: boolean; //是否报销前提供发票 + billAmountRatio?: number; //发票要求金额比例(已扩大100倍,前端直接拼接百分号展示) + settleMethodNames?: string; // 支持结算方式 + accountCheckPeriod?: number; //对账周期,每月多少号 } /** diff --git a/src/pages/finance/CompanyRelationAuth/components/Filter.tsx b/src/pages/finance/CompanyRelationAuth/components/Filter.tsx index f459e0f..97f72ab 100644 --- a/src/pages/finance/CompanyRelationAuth/components/Filter.tsx +++ b/src/pages/finance/CompanyRelationAuth/components/Filter.tsx @@ -3,7 +3,8 @@ import { Button, Col, Popconfirm, Row, Select, Input, message } from "antd"; import { useStore } from "../index"; import { CompanyCategoryTypeEnum } from "@/pages/finance/entitys"; import { debounce } from "lodash"; -import { deleteCompanyRelationApi } from '@/pages/finance/CompanyRelationAuth/api'; +import { deleteCompanyRelationApi } from "@/pages/finance/CompanyRelationAuth/api"; +import { history } from "umi"; const Search = Input.Search; const { Option } = Select; @@ -50,8 +51,9 @@ export default function Filter() { setDisabled(false); } + // 新增 function onAdd() { - setVisible(true); + history.push({ pathname: "/finance2/companyRelationAuth/create", state: companyParams }); } /** * @param compId @@ -59,7 +61,7 @@ export default function Filter() { async function onDelete() { const compIdList = selectedRelation.map((item) => item.compId); try { - const pa = { ...companyParams, compIdList}; + const pa = { ...companyParams, compIdList }; setSubmitLoading(true); const { success, result } = await deleteCompanyRelationApi(pa); setSubmitLoading(false); @@ -140,25 +142,15 @@ export default function Filter() {
- {/* - - {/* - - - - */}
); diff --git a/src/pages/finance/CompanyRelationAuth/index.tsx b/src/pages/finance/CompanyRelationAuth/index.tsx index 4a71827..3fd3b93 100644 --- a/src/pages/finance/CompanyRelationAuth/index.tsx +++ b/src/pages/finance/CompanyRelationAuth/index.tsx @@ -3,7 +3,6 @@ import { Card, Table } from "antd"; import { PageHeaderWrapper } from "@ant-design/pro-layout"; import { createStore } from "@/hooks/moz"; import store from "./useStore"; -import SelectModal from "./components/SelectModal"; import Filter from "./components/Filter"; import { CompanyRelationListVO } from "@/pages/finance/CompanyRelationAuth/api"; @@ -15,7 +14,6 @@ function CompanyRelationAuth() { const { selected, loading, - setSelectedRelation, } = useStore(); @@ -25,10 +23,10 @@ function CompanyRelationAuth() { setSelectedRelation([...selectedRows]); }, getCheckboxProps: (record: CompanyRelationListVO) => ({ - // disabled: record.name === "Disabled User", // Column configuration not to be checked name: String(record.compId), }), }; + return ( @@ -46,20 +44,12 @@ function CompanyRelationAuth() { - {/* ( - onDelete(key)} okText="确定" cancelText="取消"> - - - )} - /> */} + `支付${before ? "前" : "后"}`} /> + `${ratio}%`} /> + way || "--"} /> + (date ? `${date}日` : "--")} /> - ); } diff --git a/src/pages/finance/CompanyRelationCreate/api.ts b/src/pages/finance/CompanyRelationCreate/api.ts new file mode 100644 index 0000000..d6036c8 --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/api.ts @@ -0,0 +1,54 @@ +import { http } from "@/typing/http"; +import request from "@/utils/request"; +import { FINANCE2_HOST } from "@/utils/host"; + +type PrRes = http.PromiseResp; + +export interface CompanyRelationParams { + dealerId: number; + compCategory: number; + keywords?: string; + current?: number; + pageSize?: number; + companyType?: number; +} + +export interface CompanyRelationListVO { + compId?: number; + compName?: string; + compShortName?: string; //简称 + compType?: number[]; //类型 + compTypeName?: number; //类型 + beforeReimburse?: boolean; //是否报销前提供发票 + billAmountRatio?: number; //发票要求金额比例(已扩大100倍,前端直接拼接百分号展示) + settleMethodNames?: string; // 支持结算方式 + accountCheckPeriod?: number; //对账周期,每月多少号 +} + +/** + * 查询往来单位关系列表 + */ +export function getCompanyByDealerApi(params: CompanyRelationParams): PrRes { + return request.get(`${FINANCE2_HOST}/trade/company/relation/list`, { params }); +} + +interface SaveParams { + compIdList: number[]; //单位id集合 + dealerId: number; //商家id,必填 + compCategory: number; //单位类别,必填 +} + +/** + * 新增往来单位关系 + */ +export function saveCompanyRelationApi(params: SaveParams): PrRes { + return request.post(`${FINANCE2_HOST}/trade/company/relation/save`, params); +} + +/** +* 删除往来单位关系 + /trade/company/relation/delete + */ +export function deleteCompanyRelationApi(params: SaveParams): PrRes { + return request.post(`${FINANCE2_HOST}/trade/company/relation/delete`, params); +} diff --git a/src/pages/finance/CompanyRelationCreate/components/EditTagList.tsx b/src/pages/finance/CompanyRelationCreate/components/EditTagList.tsx new file mode 100644 index 0000000..e6df07b --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/components/EditTagList.tsx @@ -0,0 +1,47 @@ +import * as React from "react"; +import { Tag, Input, Tooltip } from "antd"; +import { PlusOutlined } from "@ant-design/icons"; +import { isArray } from "lodash"; +// import "./EditTagList.less"; + +interface Props { + value?: string[]; + onChange?: (value: string[]) => any; +} + +const colorArr = ["magenta", "geekblue", "cyan", "orange", "green", "lime", "gold", "volcano", "purple", "red"]; + +export default ({ value = [], onChange }: Props) => { + function handleClose(tag: string) { + const tags = value.filter((item) => item !== tag); + onChange && onChange(tags); + } + return ( + <> +
+ {isArray(value) && + value.map((tag, index) => { + const isLongTag = tag.length > 20; + const tagElem = ( + 1} + color={colorArr[index % 10]} + onClose={() => handleClose(tag)} + > + {isLongTag ? `${tag.slice(0, 20)}...` : tag} + + ); + return isLongTag ? ( + + {tagElem} + + ) : ( + tagElem + ); + })} +
+ + ); +}; diff --git a/src/pages/finance/CompanyRelationCreate/components/Filter.tsx b/src/pages/finance/CompanyRelationCreate/components/Filter.tsx new file mode 100644 index 0000000..8e0ae2a --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/components/Filter.tsx @@ -0,0 +1,157 @@ +import React from "react"; +import { Button, Col, Popconfirm, Row, Select, Input, message } from "antd"; +import { useStore } from "../index"; +import { CompanyCategoryTypeEnum } from "@/pages/finance/entitys"; +import { debounce } from "lodash"; +import { deleteCompanyRelationApi } from '@/pages/finance/CompanyRelationAuth/api'; +import { history } from 'umi'; + +const Search = Input.Search; +const { Option } = Select; + +export default function Filter() { + const { + setVisible, + dealerList, + setCompanyParams, + dealerLoading, + disabled, + setDisabled, + setSelected, + companyList, + comBussinessList, + selectedRelation, + submitLoading, + setSubmitLoading, + companyParams, + setLoading, + } = useStore(); + const searchDealer = (dealerId: number) => { + setCompanyParams({ ...companyParams, dealerId }, true); + }; + + function searchType(compCategory: number) { + setCompanyParams({ ...companyParams, compCategory }, true); + } + + function searchCompanyType(companyType: number) { + setCompanyParams({ ...companyParams, companyType }, true); + } + + const fetchListByName = debounce((value) => { + setCompanyParams({ ...companyParams, keywords: value }, true); + }, 500); + + function onCancel() { + setDisabled(true); + setSelected([...companyList]); + } + + function onEdit() { + setDisabled(false); + } + + // 新增 + function onAdd() { + history.push("/finance2/companyRelationAuth/create"); + } + /** + * @param compId + */ + async function onDelete() { + const compIdList = selectedRelation.map((item) => item.compId); + try { + const pa = { ...companyParams, compIdList}; + setSubmitLoading(true); + const { success, result } = await deleteCompanyRelationApi(pa); + setSubmitLoading(false); + + if (!success) { + return message.error(result); + } else { + message.success(result); + setLoading(true); + } + } catch (e) { + setSubmitLoading(false); + message.error(e.message); + } + } + + return ( +
+ + + + + + fetchListByName(e.target.value || undefined)} + style={{ width: 200 }} + /> + + + + + + + + +
+ + + + + +
+
+ ); +} diff --git a/src/pages/finance/CompanyRelationCreate/components/RelationshipSettings.tsx b/src/pages/finance/CompanyRelationCreate/components/RelationshipSettings.tsx new file mode 100644 index 0000000..2daa4e1 --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/components/RelationshipSettings.tsx @@ -0,0 +1,171 @@ +import React, { useState, useEffect, memo } from "react"; +import { Select, message, Form, Divider, Button, InputNumber } from "antd"; +import { useStore } from "../index"; +import { saveCompanyRelationApi } from "@/pages/finance/CompanyRelationAuth/api"; +import EditTagList from "./EditTagList"; +import { invoiceRequirements, payWay, RequirementsTypeEnum } from "@/pages/finance/CompanyRelationCreate/entity"; + +const { Option } = Select; + +interface Props { + onPrevious?: () => void; +} + +function SelectModal({ onPrevious }: Props) { + const [form] = Form.useForm(); + const { + // visible, + // selected, + // setVisible, + companyParams, + // comBussinessList, + // comBussinessLoading, + setDisabled, + selectData, + setSelectData, + } = useStore(); + const [submitLoading, setSubmitLoading] = useState(false); + + useEffect(() => { + const formDate = transFormData(selectData); + form.setFieldsValue({ ...formDate }); + }, [selectData]); + + function transFormData(originData: TradeCompany.ComList[]) { + let res = {}; + const comp = originData.map((it) => it.compName); + res.comp = comp; + return res; + } + + function onCancel() { + setSelectData([]); + history.back(); + } + + // 保存 + function _onOk(formData: any) { + const pa = transformDTO(formData); + setSubmitLoading(true); + saveCompanyRelationApi(pa) + .then((res) => { + message.success("保存成功"); + setSubmitLoading(false); + setDisabled(true); + onCancel(); + }) + .catch((e) => { + setSubmitLoading(false); + message.error(e.message); + }); + } + + function transformDTO(formData: any) { + const { beforeReimburse, comp = [] } = formData; + const compList = selectData.filter((item) => comp.find((y) => y === item.compName)); + const relationCompanyList = compList.map((item) => ({ + ...formData, + comp: undefined, + compId: item.id, + beforeReimburse: beforeReimburse === RequirementsTypeEnum["支付前"], + })); + const pa = { + ...companyParams, + relationCompanyList, + }; + return pa; + } + + return ( + <> +
+ + + + + + + + `${value}%`} + parser={(value) => value!.replace("%", "")} + /> + + + + + + + +
+
+ + + + + +
+ + ); +} + +export default memo(SelectModal); diff --git a/src/pages/finance/CompanyRelationAuth/components/SelectModal.tsx b/src/pages/finance/CompanyRelationCreate/components/SelectCorrespondenceUnits.tsx index 1df0d3b..d73abe3 100644 --- a/src/pages/finance/CompanyRelationAuth/components/SelectModal.tsx +++ b/src/pages/finance/CompanyRelationCreate/components/SelectCorrespondenceUnits.tsx @@ -1,14 +1,17 @@ import React, { useState, useEffect, memo } from "react"; -import { Modal, Table, Select, Input, message, Spin } from "antd"; +import { Modal, Table, Select, Input, message, Spin, Button, Divider } from "antd"; import Column from "antd/lib/table/Column"; import { RecordStateEnum } from "@/pages/finance/entitys"; import usePagination from "@/hooks/usePagination"; import { getCompAccountApi } from "@/pages/finance/TradeCompany/api"; import { useStore } from "../index"; import { debounce } from "lodash"; -import { saveCompanyRelationApi } from '@/pages/finance/CompanyRelationAuth/api'; -function SelectModal() { +interface Props { + onNext?: () => void; +} + +function SelectModal({ onNext }: Props) { const { visible, selected, @@ -17,155 +20,126 @@ function SelectModal() { comBussinessList, comBussinessLoading, setDisabled, - setLoading, + selectData, + setSelectData, } = useStore(); - const [submitLoading, setSubmitLoading] = useState(false); const [delay, setDelay] = useState(true); - const [selectData, setSelectData] = useState([]); + const { list: compList, loading, paginationConfig, setParams, innerParams, - } = usePagination(getCompAccountApi, { recordState: RecordStateEnum["已备案"] }, { delay }); - - const fetchListByName = debounce((value) => { - setParams({ ...innerParams, keywords: value }, true); - }, 500); - - function searchType(compTypes: number) { - setParams({ compTypes }, true); - } + } = usePagination( + getCompAccountApi, + { + compCategory: companyParams.compCategory, + excludeDealerId: companyParams.dealerId, + recordState: RecordStateEnum["已备案"], + }, + { delay } + ); useEffect(() => { - if (visible) { + if (companyParams.dealerId !== -1) { setDelay(false); setParams({ compCategory: companyParams.compCategory, excludeDealerId: companyParams.dealerId }, true); - // setSelectData(selected.map((row) => ({ id: row.compId, compName: row.compName }))); } - }, [visible, companyParams, selected]); - - function handSave() { - console.log("已选:", selectData); + }, [companyParams]); - const res = onSubmit(selectData); - console.log("res", res); - - if (res) { - onCancel(); - } - - // setSelected( - // selectData.map((item) => ({ - // compId: item.id, - // compName: item.compName, - // compShortName: item.compShortName, - // compType: item.compType, - // })) - // ); - } + const fetchListByName = debounce((value) => { + setParams({ ...innerParams, keywords: value }, true); + }, 500); - function onSubmit(selectedData: any[]) { - if (!selectedData.length) { - return message.info("请先选择往来单位"); - } - setSubmitLoading(true); - saveCompanyRelationApi({ - dealerId: companyParams.dealerId, - compCategory: companyParams.compCategory, - compIdList: selectedData.map((item) => item.id!), - }) - .then((res) => { - message.success("保存成功"); - setLoading(true); - setSubmitLoading(false); - setDisabled(true); - onCancel(); - }) - .catch((e) => { - setSubmitLoading(false); - message.error(e.message); - }); - } - function onCancel() { - setVisible(false); - setSelectData([]); + function searchType(compTypes: number) { + setParams({ compTypes }, true); } return ( - - -
- fetchListByName(e.target.value || undefined)} - style={{ width: 250, marginRight: 10 }} - /> - -
- - row.id as number), - onSelect: (row: any, _selected: boolean) => { - const index = selectData.findIndex((_row) => _row.id == row.id); - if (_selected) { - selectData.unshift(row); - } else if (index > -1) { - selectData.splice(index, 1); - } - setSelectData([...selectData]); - }, - onSelectAll: (selected, selectedRows, changeRows) => { - const changedKeys = changeRows.map((row) => row.id); - let newData = []; - // 全选 - if (selected) { - // 过滤掉已选的 - newData = selectData.concat(changeRows.filter((row) => !selectData.some((item) => item == row.id))); - } else { - // 全不选 - 去掉已选的 - newData = selectData.filter((row) => !changedKeys.find((y) => y === row.id)); - } - setSelectData(newData); - }, - }} + <> +
+ fetchListByName(e.target.value || undefined)} + style={{ width: 250, marginRight: 10 }} + /> +
-
-
+ {comBussinessList.map((item) => ( + + {item.name} + + ))} + + + + row.id as number), + onSelect: (row: any, _selected: boolean) => { + const index = selectData.findIndex((_row) => _row.id == row.id); + if (_selected) { + selectData.unshift(row); + } else if (index > -1) { + selectData.splice(index, 1); + } + setSelectData([...selectData]); + }, + onSelectAll: (selected, selectedRows, changeRows) => { + const changedKeys = changeRows.map((row) => row.id); + let newData = []; + // 全选 + if (selected) { + // 过滤掉已选的 + newData = selectData.concat(changeRows.filter((row) => !selectData.some((item) => item == row.id))); + } else { + // 全不选 - 去掉已选的 + newData = selectData.filter((row) => !changedKeys.find((y) => y === row.id)); + } + setSelectData(newData); + }, + }} + > + + + +
+
+ + + {!!selectData.length && ( + <> + + + + )} +
+ ); } diff --git a/src/pages/finance/CompanyRelationCreate/entity.ts b/src/pages/finance/CompanyRelationCreate/entity.ts new file mode 100644 index 0000000..57843df --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/entity.ts @@ -0,0 +1,29 @@ +// 发票要求 1:支付前 2:支付后 +export const invoiceRequirements = [ + { + label: "支付前", + value: 1, + }, + { + label: "支付后", + value: 2, + }, +]; + +export enum RequirementsTypeEnum { + "支付前" = 1, + "支付后", +} + +// 往来单位支付方式 +export const payWay = [ + { label: "即时支付", value: 1 }, + { label: "周期支付", value: 2 }, + { label: "员工垫付", value: 3 }, +]; + + export enum PayWayEnum { + "即时支付" = 1, + "周期支付", + "员工垫付", + } diff --git a/src/pages/finance/CompanyRelationCreate/index.tsx b/src/pages/finance/CompanyRelationCreate/index.tsx new file mode 100644 index 0000000..1bd8581 --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/index.tsx @@ -0,0 +1,73 @@ +import React, { useEffect, useState } from "react"; +import { Card, Steps, Table, Tabs } from "antd"; +import { PageHeaderWrapper } from "@ant-design/pro-layout"; +import { createStore } from "@/hooks/moz"; +import store from "./useStore"; +import SelectCorrespondenceUnits from "./components/SelectCorrespondenceUnits"; +import RelationshipSettings from "./components/RelationshipSettings"; +import { CompanyRelationListVO } from "@/pages/finance/CompanyRelationAuth/api"; + +const { Column } = Table; +const { TabPane } = Tabs; + +export const { Provider, useStore } = createStore(store); + +function CompanyRelationCreate(props) { + const pathParams = props.location.state || {}; + const { Step } = Steps; + const [current, setCurrent] = useState(0); + const { + selected, + // loading, + selectedRelation, + setSelectedRelation, + submitLoading, + setSubmitLoading, + // setLoading, + companyParams, + setCompanyParams, + } = useStore(); + + useEffect(() => { + setCompanyParams({ ...pathParams }); + }, []); + + const rowSelection = { + onChange: (selectedRowKeys: React.Key[], selectedRows: CompanyRelationListVO[]) => { + setSelectedRelation([...selectedRows]); + }, + getCheckboxProps: (record: CompanyRelationListVO) => ({ + name: String(record.compId), + }), + }; + + return ( + + + + + + +
} + > + + setCurrent(current + 1)} /> + + + setCurrent(0)} /> + + + + + ); +} + +export default (props) => ( + + + +); diff --git a/src/pages/finance/CompanyRelationCreate/useStore.ts b/src/pages/finance/CompanyRelationCreate/useStore.ts new file mode 100644 index 0000000..43f154a --- /dev/null +++ b/src/pages/finance/CompanyRelationCreate/useStore.ts @@ -0,0 +1,40 @@ +import { useState} from "react"; +import useInitial from "@/hooks/useInitail"; +import { CompanyRelationListVO } from "./api"; +import { getCompanyBusinessTypesApi } from "@/pages/finance/TradeCompany/api"; + +export default function useStore() { + const [disabled, setDisabled] = useState(true); + const [visible, setVisible] = useState(false); + const [submitLoading, setSubmitLoading] = useState(false); + const [selectData, setSelectData] = useState([]); + // 存储已选关系,用于批量删除 + const [selectedRelation, setSelectedRelation] = useState([]); + // 存储新增时选择条件 + const [companyParams, setCompanyParams] = useState({ dealerId: -1 }); + + // 往来单位业务类型列表 + const { data: comBussinessList, loading: comBussinessLoading } = useInitial(getCompanyBusinessTypesApi, [], null); + + const [selected, setSelected] = useState([]); + + return { + selectData, + setSelectData, + visible, + setVisible, + + disabled, + setDisabled, + selected, + setSelected, + submitLoading, + setSubmitLoading, + comBussinessList, + comBussinessLoading, + selectedRelation, + setSelectedRelation, + companyParams, + setCompanyParams, + }; +} diff --git a/src/pages/finance/SpecialAccount/FinancingCompany/components/CreateModal.tsx b/src/pages/finance/SpecialAccount/FinancingCompany/components/CreateModal.tsx index 94528ac..e7d11f4 100644 --- a/src/pages/finance/SpecialAccount/FinancingCompany/components/CreateModal.tsx +++ b/src/pages/finance/SpecialAccount/FinancingCompany/components/CreateModal.tsx @@ -14,7 +14,6 @@ export default function CreateModal() { const [form] = Form.useForm(); const [saveLoading, setSaveLoading] = useState(false); - console.log("current", current); useEffect(() => { if (visible) { form.setFieldsValue({ @@ -77,8 +76,6 @@ export default function CreateModal() { } function submit(fieldValue: any) { - // console.log("表单参数:", fieldValue); - // return; const param = { dealerId, ...fieldValue, @@ -100,13 +97,11 @@ export default function CreateModal() { loan: !!fieldValue.loan, }; setSaveLoading(true); - savePlatformMobile(param) .then((res) => { message.success("保存成功"); setVisible(false); setLoading(true); - // setSaveLoading(false); }) .catch((err) => { message.error(err.message); @@ -199,7 +194,6 @@ export default function CreateModal() { ))} - + + + + +
+ + ); +} + +export default AdressSelect; diff --git a/src/pages/finance/TradeCompany/components/CreateModal.tsx b/src/pages/finance/TradeCompany/components/CreateModal.tsx index 2421112..834614a 100644 --- a/src/pages/finance/TradeCompany/components/CreateModal.tsx +++ b/src/pages/finance/TradeCompany/components/CreateModal.tsx @@ -6,6 +6,7 @@ import PositionSelector from "@/components/PositionSelector"; import Contact from "./ContactsInput"; import Account from "./AccountsInput"; import { createCompanyApi, updateCompanyApi, getDetailComAccountApi } from "../api"; +import AdressSelect from "@/pages/finance/TradeCompany/components/AdressSelect"; const FormItem = Form.Item; const { Option } = Select; @@ -31,6 +32,7 @@ export default function CreateModal() { item = data; } form.setFieldsValue({ + ...item, compName: item.compName, compShortName: item.compShortName, subjectType: item.subjectType, @@ -41,7 +43,9 @@ export default function CreateModal() { brandId: item.brandId, location: item.compAddress ? { - address: "", + // address: "", + //@ts-ignored; + address: item.lonLatAddress||"", point: { lng: item.longitude, lat: item.latitude, @@ -61,8 +65,9 @@ export default function CreateModal() { const param = { id: current.id, ...item, - longitude: (item.location?.point || {}).lng, - latitude: (item.location?.point || {}).lat, + longitude: Number(item.longitude), + latitude: Number(item.latitude), + lonLatAddress: item.location? item.location.address : "", }; setSavelLoading(true); const saveApi = current.id ? updateCompanyApi : createCompanyApi; @@ -104,7 +109,7 @@ export default function CreateModal() { }} width="60%" > -
+ @@ -151,16 +156,16 @@ export default function CreateModal() { const _compType = getFieldValue("compType"); return _compType?.includes(CompanyBusinessTypeEnum["新车采购(主机厂)"]) || _compType?.includes(CompanyBusinessTypeEnum["配件采购"]) ? ( - - - - ) : null; + + + + ) : null; }} - - - + {/* */} + {/* */} + + {/* */} - + diff --git a/src/pages/notice/PublicRelease/store.ts b/src/pages/notice/PublicRelease/store.ts index 7d1a6e2..f78b754 100644 --- a/src/pages/notice/PublicRelease/store.ts +++ b/src/pages/notice/PublicRelease/store.ts @@ -1,7 +1,7 @@ /* * @Date: 2021-08-10 10:05:18 * @LastEditors: wangqiang@feewee.cn - * @LastEditTime: 2022-11-02 16:18:14 + * @LastEditTime: 2022-12-09 14:21:58 */ import useInitial from "@/hooks/useInitail"; @@ -9,40 +9,6 @@ import usePagination from "@/hooks/usePagination"; import { useMemo, useState } from "react"; import * as api from "./api"; -export default function useStore() { - const [listType, setListType] = useState<"列表" | "草稿">("列表"); - const listPagination = usePagination(api.getPublicListApi); - const draftPagination = usePagination(api.getDraftListApi); - const { data: TypeList } = useInitial(api.getFileTypeListApi, [], null); - const { data: Way } = useInitial(api.getPublicWayListApi, [], null); - const [visible, setVisible] = useState(false); - const [current, setCurrent] = useState(); - const [isView, setIsView] = useState(false); // 是否查看 - const [isChangeDetail, setIsChangeDetial] = useState(false); // 是否查看变更记录 - const [fileChangeId, setFileChangeId] = useState(); // 变更记录ID,用于查询变更记录详情使用 - const [rangeDetailVisible, setRangeDetailVisible] = useState(false); // 是否打开执行范围详情 - const [isChange, setIsChange] = useState(false); // 是否变更执行文件 - const [approvalProgressModalInfo, setApprovalProgressModalInfo] = - useState({ visible: false }); - const [fidModal, setFidModal] = useState<{ - visible: boolean; - title?: string; - fidList?: string[]; - }>({ visible: false }); - - const [fileProgressModal, setFileProgressModal] = useState<{ - visible: boolean; - id?: number; // 执行文件ID - title?: string; // 执行文件名 - loading?: boolean; - data?: CommonProgress.Item[]; - }>({ visible: false }); - - const pagination = useMemo( - () => (listType === "列表" ? listPagination : draftPagination), - [listType, listPagination, draftPagination] - ); - enum RangeType { "全集团" = 1, "部分人员", @@ -114,6 +80,40 @@ export default function useStore() { "#F4333C", } +export default function useStore() { + const [listType, setListType] = useState<"列表" | "草稿">("列表"); + const listPagination = usePagination(api.getPublicListApi, { fileStatus: FileStatus.执行中 }); + const draftPagination = usePagination(api.getDraftListApi); + const { data: TypeList } = useInitial(api.getFileTypeListApi, [], null); + const { data: Way } = useInitial(api.getPublicWayListApi, [], null); + const [visible, setVisible] = useState(false); + const [current, setCurrent] = useState(); + const [isView, setIsView] = useState(false); // 是否查看 + const [isChangeDetail, setIsChangeDetial] = useState(false); // 是否查看变更记录 + const [fileChangeId, setFileChangeId] = useState(); // 变更记录ID,用于查询变更记录详情使用 + const [rangeDetailVisible, setRangeDetailVisible] = useState(false); // 是否打开执行范围详情 + const [isChange, setIsChange] = useState(false); // 是否变更执行文件 + const [approvalProgressModalInfo, setApprovalProgressModalInfo] = + useState({ visible: false }); + const [fidModal, setFidModal] = useState<{ + visible: boolean; + title?: string; + fidList?: string[]; + }>({ visible: false }); + + const [fileProgressModal, setFileProgressModal] = useState<{ + visible: boolean; + id?: number; // 执行文件ID + title?: string; // 执行文件名 + loading?: boolean; + data?: CommonProgress.Item[]; + }>({ visible: false }); + + const pagination = useMemo( + () => (listType === "列表" ? listPagination : draftPagination), + [listType, listPagination, draftPagination] + ); + const gotoDraftList = (item: PublicNotice.ListVO) => { draftPagination.setParams({ fileId: item.id, fileName: item.title }); setTimeout(() => { diff --git a/src/pages/pms/partPlan/MinRatioPlan/components/StepBnt.tsx b/src/pages/pms/partPlan/MinRatioPlan/components/StepBnt.tsx index 0824753..696f8ca 100644 --- a/src/pages/pms/partPlan/MinRatioPlan/components/StepBnt.tsx +++ b/src/pages/pms/partPlan/MinRatioPlan/components/StepBnt.tsx @@ -8,7 +8,7 @@ interface Props { } export default function Index({length}: Props) { const { bntLoading, getStep2, current, setCurrent, getSummary, submit, summarySupplier, brandId, parts } = useStore(); - const flag = _.flattenDeep(summarySupplier.map(it => it.parts || [])).length == parts.length; + // const flag = _.flattenDeep(summarySupplier.map(it => it.parts || [])).length == parts.length; const next = _.throttle(() => { if (current == 1) { getStep2(); @@ -40,7 +40,7 @@ export default function Index({length}: Props) { {current == length && ( + } > @@ -79,36 +90,14 @@ export default function UploadExcel(props: Props) { setOverride(checked)} /> {stock ? ( - +

将文件拖到此处上传

) : ( - +

diff --git a/src/pages/pms/storage/partShop/components/api.tsx b/src/pages/pms/storage/partShop/components/api.tsx index 9783f65..780c0a7 100644 --- a/src/pages/pms/storage/partShop/components/api.tsx +++ b/src/pages/pms/storage/partShop/components/api.tsx @@ -1,6 +1,17 @@ import request from '@/utils/request'; import { PMS_HOST } from '@/utils/host'; +import {http} from "@/typing/http"; export function getList(params?: number) { return request.get(`${PMS_HOST}/erp/part/shop/get/stock/cnt`, {params: {storageId: params}}); } + +// 导入 +export function importStockFix(params: {override: boolean, file: any}): http.PromiseResp { + return request.post(`${PMS_HOST}/erp/part/shop/import/stock/fix`, params, { contentType: "form-data" }); +} + +// 导入 +export function shopImport(params: {override: boolean, file: any}): http.PromiseResp { + return request.post(`${PMS_HOST}/erp/part/shop/import`, params, { contentType: "form-data" }); +} diff --git a/src/pages/stock/AllowanceConfirm/EditComfirm/Manufacturer/index.tsx b/src/pages/stock/AllowanceConfirm/EditComfirm/Manufacturer/index.tsx index e32fe82..4f5f73b 100644 --- a/src/pages/stock/AllowanceConfirm/EditComfirm/Manufacturer/index.tsx +++ b/src/pages/stock/AllowanceConfirm/EditComfirm/Manufacturer/index.tsx @@ -277,6 +277,7 @@ export default function CreateModal(props: Props) { rebateId: Number(rebateId), orderIds, subsidyType: currentItem.subsidyType, + promotionId: currentItem.promotionId }); message.success(result || "操作成功"); } catch (error: any) {