Commit 301976f1d79b63e6a918d76837478d34c95d573f

Authored by 舒述军
2 parents 84c35dd8 c8e9f248

Merge branch 'master' into order_lzh

Showing 110 changed files with 10026 additions and 192 deletions

Too many changes to show.

To preserve performance only 48 of 110 files are displayed.

config/routers/contract.ts
... ... @@ -59,4 +59,12 @@ export default [
59 59 path: "/contract/kt/itemamount/config", //事项款设置
60 60 component: "./contract/ItemAmountSetting",
61 61 },
  62 + {
  63 + path: "/contract/kt/authorization/setting", //合同授权
  64 + component: "./contract/AuthorizationSetting",
  65 + },
  66 + {
  67 + path: "/contract/kt/expressChargingStandard/setting", //快递收费标准
  68 + component: "./contract/ExpressChargingStandardSetting",
  69 + },
62 70 ];
... ...
config/routers/performance.ts
... ... @@ -70,6 +70,31 @@ export default [
70 70 component: "./performance/SalarySystemSetting",
71 71 },
72 72  
  73 + /** 考评指标 */
  74 + {
  75 + path: "/morax/evaSetting", //考评指标库设置
  76 + component: "./performance/EvaSetting",
  77 + },
  78 + {
  79 + path: "/morax/evaGroupSetting", //考评组设置
  80 + component: "./performance/EvaGroupSetting",
  81 + },
  82 + /** 考评组设置==》编辑新增 */
  83 + {
  84 + path: "/morax/evaGroupSetting/edit/:id?/:read?/:type?",
  85 + component: "./performance/EvaGroupSetting/EditComfirm/index",
  86 + },
  87 + /** 考评数据导入 */
  88 + {
  89 + path: "/morax/evaDataImport",
  90 + component: "./performance/EvaDataImport",
  91 + },
  92 + /** 考评数据导入==> 查看数据清单 */
  93 + {
  94 + path: "/morax/evaDataImport/edit/:id?/:num?",
  95 + component: "./performance/EvaDataImport/EditComfirm/index",
  96 + },
  97 +
73 98 /** 旧 */
74 99 {
75 100 path: "/performance/salaryManage/salaryGroupSetting", //薪酬组设置
... ...
package.json
... ... @@ -54,6 +54,7 @@
54 54 "copy-to-clipboard": "^3.3.1",
55 55 "cos-js-sdk-v5": "0.5.26",
56 56 "currency.js": "^2.0.3",
  57 + "dayjs": "^1.11.7",
57 58 "global": "^4.4.0",
58 59 "image-conversion": "^2.1.1",
59 60 "immer": "^7.0.5",
... ...
src/pages/capital/ReceiveRules/component/SelectGoodsTable.tsx
... ... @@ -74,6 +74,8 @@ const SelectGoodsTable = (props: Props) => {
74 74 };
75 75  
76 76 function saveDate() {
  77 + console.log("🚀 ~ file: SelectGoodsTable.tsx:80 ~ saveDate ~ selectedRow:", selectedRow);
  78 +
77 79 onChange && onChange(selectedRow);
78 80 onCancel();
79 81 }
... ... @@ -87,8 +89,12 @@ const SelectGoodsTable = (props: Props) => {
87 89 selectedRowKeys: selectedRow.map(row => row.code),
88 90 onSelect: (row: any, _selected: boolean) => {
89 91 const index = selectedRow.findIndex((_row) => _row.code == row.code);
  92 + if (!multiple) {
  93 + setSelectedRow([row]);
  94 + return;
  95 + }
90 96 if (_selected) {
91   - selectedRow.unshift(row);
  97 + selectedRow.unshift(row);
92 98 } else if (index > -1) {
93 99 selectedRow.splice(index, 1);
94 100 }
... ...
src/pages/capital/ReceiveRules/subPages/GoodsDimension/components/RenderSelectGoos.tsx
... ... @@ -2,14 +2,17 @@ import SelectGoodsTable from '@/pages/capital/ReceiveRules/component/SelectGoods
2 2 import { Button, Card, Popconfirm, Row, Table } from 'antd';
3 3 import React, { useState } from 'react';
4 4 import { PlusOutlined } from '@ant-design/icons';
  5 +import RenderGoodsSpec from '@/pages/capital/components/RenderGoodsSpec';
5 6  
6 7 const Column = Table.Column;
7 8  
8 9 interface GoodsProps {
9 10 onChange?: Function;
10 11 value?: any;
  12 + multiple?: boolean;
  13 + disabled?: boolean;
11 14 }
12   -function RenderSelectGoos({ onChange, value = [] }: GoodsProps) {
  15 +function RenderSelectGoos({ onChange, value = [], multiple, disabled }: GoodsProps) {
13 16 const [goodsModal, setGoodsModal] = useState({ visible: false });
14 17 function deleteItem(code: string) {
15 18 const newData = value.filter((i: any) => i.code !== code);
... ... @@ -18,11 +21,14 @@ function RenderSelectGoos({ onChange, value = [] }: GoodsProps) {
18 21  
19 22 return (
20 23 <Card>
21   - <Row justify="end" style={{ marginBottom: 10 }}>
22   - <Button type="primary" icon={<PlusOutlined />} onClick={() => setGoodsModal({ visible: true })}>新增</Button>
23   - </Row>
  24 + {!disabled ? (
  25 + <Row justify="end" style={{ marginBottom: 10 }}>
  26 + <Button type="primary" icon={<PlusOutlined />} onClick={() => setGoodsModal({ visible: true })}>新增</Button>
  27 + </Row>
  28 + ) : null}
24 29 <Table
25 30 dataSource={value}
  31 + pagination={multiple ? undefined : false}
26 32 // loading={loading}
27 33 bordered={false}
28 34 size="small"
... ... @@ -31,6 +37,13 @@ function RenderSelectGoos({ onChange, value = [] }: GoodsProps) {
31 37 <Column title="物品名称" dataIndex="name" />
32 38 <Column title="物品编码" dataIndex="code" />
33 39 <Column
  40 + title="型号规格"
  41 + dataIndex="spec"
  42 + width="16%"
  43 + ellipsis
  44 + render={(text, record) => text && <RenderGoodsSpec specList={JSON.parse(text)} />}
  45 + />
  46 + <Column
34 47 align="center"
35 48 title="操作"
36 49 // width={400}
... ... @@ -38,9 +51,11 @@ function RenderSelectGoos({ onChange, value = [] }: GoodsProps) {
38 51 return (
39 52 <>
40 53 <Popconfirm title="确认删除?" onConfirm={() => deleteItem(value.code)}>
41   - <Button type="link">
42   - 删除
43   - </Button>
  54 + {!disabled && (
  55 + <Button type="link">
  56 + 删除
  57 + </Button>
  58 + )}
44 59 </Popconfirm>
45 60 </>
46 61 );
... ... @@ -48,6 +63,7 @@ function RenderSelectGoos({ onChange, value = [] }: GoodsProps) {
48 63 />
49 64 </Table>
50 65 <SelectGoodsTable
  66 + multiple={multiple}
51 67 visible={goodsModal.visible}
52 68 onCancel={() => setGoodsModal({ visible: false })}
53 69 onChange={(v) => onChange && onChange(v)}
... ...
src/pages/contract/AuthorizationSetting/api.ts 0 → 100644
  1 +import { http } from "@/typing/http";
  2 +import request from "@/utils/request";
  3 +import qs from 'qs';
  4 +import { CONTRACT_HOST, HOST } from "@/utils/host";
  5 +import { Any } from "currency.js";
  6 +
  7 +type PrResArr<T> = http.PromiseResp<T[]>;
  8 +
  9 +export interface Item {
  10 + id?:number, //授权ID
  11 + typeName?:string, //合同类型名称
  12 + createTime?:number, //创建时间
  13 + updateTime?:number, //更新时间
  14 + enabled?:boolean, //是否启用
  15 + roles?:Roles[],//授权角色
  16 +}
  17 +export interface Roles {
  18 + roleCode?:string, //角色编码
  19 + roleName?:string, //角色名称
  20 +}
  21 +export interface TypesItem {
  22 + id?: number; // id
  23 + name?: string;
  24 + fixedAmount?: boolean;
  25 + contractableTradeCompCategories?: number[];
  26 + feeType?: string;
  27 + feeTypeValue?: string;
  28 + bizType?: string;
  29 + bizTypeValue?: number;
  30 + subjectType?: string;
  31 + subjectTypeValue?: string;
  32 + servicePlaceTypes?: number[];
  33 +}
  34 +
  35 +export interface PageParams {
  36 + current?: number;
  37 + pageSize?: number;
  38 + contractTypeName?:string //合同类型名称
  39 +}
  40 +export interface SaveParams {
  41 + contractAuthId?: number;
  42 + typeId: number;//合同类型id
  43 + typeName:string //合同类型名称
  44 + roles?:Roles[],//授权角色
  45 +}
  46 +interface DelParams {
  47 + contractAuthId?: number; //合同授权id
  48 +}
  49 +
  50 +export interface DisableParams {
  51 + contractAuthId?: number;//合同授权id
  52 + enabled?: boolean;//是否启用
  53 +}
  54 +
  55 +/**
  56 + * 查询所有角色列表
  57 + */
  58 +export function getAllRoleCodeApi(params: CommonApi.RoleParams): PrResArr<CommonApi.RoleCodeVO> {
  59 + return request.get(`${HOST}/role/listAll`, { params });
  60 +}
  61 +/**
  62 + * 查询合同类型列表
  63 + */
  64 +export function getContractTypes(params: PageParams): http.PromisePageResp<TypesItem> {
  65 + return request.get(`${CONTRACT_HOST}/erp/contract/type/page`, { params });
  66 +}
  67 +
  68 +/**
  69 + * 分页查询合同授权
  70 + */
  71 +export function getContractAuthPage(params?: PageParams): http.PromisePageResp<Item> {
  72 + return request.get(`${CONTRACT_HOST}/erp/contractAuth/page`, {params});
  73 +}
  74 +
  75 +/**
  76 + * 新增合同授权/编辑合同授权
  77 + */
  78 +export function addContractAuth(params?: SaveParams): http.PromisePageResp<Any> {
  79 + return request.post(`${CONTRACT_HOST}/erp/contractAuth/save`, {...params});
  80 +}
  81 +
  82 +/**
  83 + * 删除合同授权
  84 + */
  85 + export function delContractAuth(params?: DelParams): http.PromisePageResp<Any> {
  86 + return request.post(`${CONTRACT_HOST}/erp/contractAuth/delete`, {...params});
  87 +}
  88 +
  89 +/**
  90 + * 启用或禁用
  91 + */
  92 + export function disableContractAuth(params?: DisableParams): http.PromisePageResp<Any> {
  93 + return request.post(`${CONTRACT_HOST}/erp/contractAuth/enableOrDisable`, {...params});
  94 +}
0 95 \ No newline at end of file
... ...
src/pages/contract/AuthorizationSetting/components/AddModel/index.tsx 0 → 100644
  1 +import React, { useCallback, useEffect, useState } from "react";
  2 +import { Modal, Skeleton, Select, Form, message } from "antd";
  3 +import * as API from '../../api';
  4 +
  5 +interface Props{
  6 + visible:boolean;
  7 + row?:API.Item;
  8 + contractTypesList:any[],
  9 + roleList:any[],
  10 + onRefresh: () => void;
  11 + onCancel?: () => void;
  12 +}
  13 +
  14 +function AddModel({visible, row, contractTypesList, roleList, onCancel, onRefresh}:Props) {
  15 + const [form] = Form.useForm();
  16 + const [loading, setLoading] = useState<boolean>(false);
  17 + const {id, roles, typeName } = row || {};
  18 + useEffect(() => {
  19 + if (id) {
  20 + form.setFieldsValue({
  21 + contractType: contractTypesList.filter((item:API.TypesItem) => item.name === typeName).map((i:any) => ({label: i.name, value: i.id}))[0],
  22 + roleCode: roles?.length && roles.map((i:any) => ({label: i.roleName, value: i.roleCode})),
  23 + });
  24 + }
  25 + }, [row]);
  26 +
  27 + /**
  28 + * @description: 表单提交
  29 + * @param {any} feildValue
  30 + * @return {*}
  31 + */
  32 + const handleSave = (feildValue: any) => {
  33 + setLoading(true);
  34 + const { roleCode, contractType } = feildValue;
  35 + const _roleCode = roleCode.length && roleCode.map((item:any) => ({roleCode: item.value, roleName: item.label }));
  36 + const params = {roles: _roleCode, typeId: contractType.value, typeName: contractType.label };
  37 + API.addContractAuth({ ...params, contractAuthId: id })
  38 + .then(res => {
  39 + message.success("操作成功");
  40 + _onCancel();
  41 + setLoading(false);
  42 + onRefresh();
  43 + })
  44 + .catch(err => {
  45 + message.error(err?.message);
  46 + setLoading(false);
  47 + });
  48 + };
  49 + /**
  50 + * @description: 关闭弹框
  51 + * @param {*}
  52 + * @return {*}
  53 + */
  54 + const _onCancel = () => {
  55 + onCancel && onCancel();
  56 + form.resetFields();
  57 + };
  58 +
  59 + return (
  60 + <Modal
  61 + title={`${id ? '编辑':'新增'}合同授权`}
  62 + visible={visible}
  63 + confirmLoading={loading}
  64 + onCancel={_onCancel}
  65 + onOk={form.submit}
  66 + cancelButtonProps={{ hidden: true }}
  67 + width="50%"
  68 + bodyStyle={{minHeight: 300}}
  69 + >
  70 + <Skeleton
  71 + loading={false}
  72 + >
  73 + <Form form={form} onFinish={handleSave} wrapperCol={{ span: 18 }} labelCol={{ span: 4 }}>
  74 + <Form.Item
  75 + label="合同类型"
  76 + name="contractType"
  77 + rules={[{ required: true, message: '请选择合同类型' }]}
  78 + >
  79 + <Select
  80 + placeholder="请选择合同类型"
  81 + showSearch
  82 + allowClear
  83 + optionFilterProp="children"
  84 + labelInValue
  85 + onSelect={(it:any) => {
  86 + const item = contractTypesList.filter((i:any) => it.value === i.id);
  87 + }}
  88 + filterOption={(input, option: any) => option?.children.indexOf(input) >= 0}
  89 + >
  90 + {
  91 + contractTypesList && contractTypesList.map((item:any) => (
  92 + <Select.Option value={item.id} key={item.id}>
  93 + {item.name}
  94 + </Select.Option>
  95 + ))
  96 + }
  97 + </Select>
  98 + </Form.Item>
  99 + <Form.Item
  100 + label="授权角色"
  101 + name="roleCode"
  102 + rules={[{ required: true, message: '请选择授权角色' }]}
  103 + >
  104 + <Select
  105 + placeholder="请选择授权角色(支持多选)"
  106 + mode="multiple"
  107 + showSearch
  108 + allowClear
  109 + showArrow
  110 + optionFilterProp="children"
  111 + labelInValue
  112 + onSelect={(it:any) => {
  113 + const item = roleList.filter((i:any) => it.value === i.roleCode);
  114 + }}
  115 + filterOption={(input, option: any) => option?.children.indexOf(input) >= 0}
  116 + >
  117 + {
  118 + roleList && roleList.map((item:any) => (
  119 + <Select.Option value={item.roleCode} key={item.id}>
  120 + {item.roleName}
  121 + </Select.Option>
  122 + ))
  123 + }
  124 + </Select>
  125 + </Form.Item>
  126 + </Form>
  127 + </Skeleton>
  128 + </Modal>
  129 + );
  130 +}
  131 +
  132 +export default AddModel;
0 133 \ No newline at end of file
... ...
src/pages/contract/AuthorizationSetting/components/Filter/index.tsx 0 → 100644
  1 +import React, { useCallback, useState } from "react";
  2 +import { Row, Col, Select } from "antd";
  3 +import * as common from "@/typing/common";
  4 +import _ from "lodash";
  5 +import * as API from '../../api';
  6 +
  7 +interface Props{
  8 + contractTypesList?:any[],
  9 + setParams:any,
  10 + innerParams?:any,
  11 +}
  12 +
  13 +function Filter({ contractTypesList, innerParams, setParams }:Props) {
  14 + const onChange = _.debounce((contractTypeName: string) => {
  15 + setParams({...innerParams, contractTypeName}, true);
  16 + }, 350);
  17 + return (
  18 + <Row
  19 + style={{ display: 'flex', flex: 1 }}
  20 + >
  21 + <Col span={12}>
  22 + <Select
  23 + placeholder="请选择合同类型"
  24 + showSearch
  25 + optionFilterProp="children"
  26 + allowClear
  27 + style={{ width: 200 }}
  28 + onChange={(contractTypeName) => onChange(contractTypeName)}
  29 + >
  30 + {
  31 + contractTypesList && contractTypesList.map((item:any) => (
  32 + <Select.Option value={item.name} key={item.id}>
  33 + {item.name}
  34 + </Select.Option>
  35 + ))
  36 + }
  37 + </Select>
  38 + </Col>
  39 + </Row>
  40 + );
  41 +}
  42 +
  43 +export default Filter;
0 44 \ No newline at end of file
... ...
src/pages/contract/AuthorizationSetting/components/RolesModel/index.tsx 0 → 100644
  1 +import React, { useCallback, useEffect, useState } from "react";
  2 +import { Modal, Form, message, Table } from "antd";
  3 +import * as API from '../../api';
  4 +
  5 +interface Props{
  6 + visible:boolean;
  7 + roles?:API.Roles[];
  8 + onRefresh: () => void;
  9 + onCancel?: () => void;
  10 +}
  11 +const { Column } = Table;
  12 +
  13 +function RolesModel({visible, roles, onRefresh, onCancel}:Props) {
  14 + return (
  15 + <Modal
  16 + title="授权角色"
  17 + visible={visible}
  18 + onCancel={onCancel}
  19 + >
  20 + <Table
  21 + dataSource={roles}
  22 + rowKey={(item: API.Roles) => `${item.roleCode}`}
  23 +
  24 + >
  25 + <Column title="角色名称" width={200} dataIndex="roleName" render={(t) => t || "-"} />
  26 + <Column title="角色编码" width={200} dataIndex="roleCode" render={(t) => t || "-"} />
  27 + </Table>
  28 + </Modal>
  29 + );
  30 +}
  31 +
  32 +export default RolesModel;
0 33 \ No newline at end of file
... ...
src/pages/contract/AuthorizationSetting/index.tsx 0 → 100644
  1 +import React, { useCallback, useState } from "react";
  2 +import { Button, Card, ConfigProvider, Divider, Input, message, Popconfirm, Select, Table } from "antd";
  3 +import { PageHeaderWrapper } from "@ant-design/pro-layout";
  4 +import zhCN from "antd/lib/locale-provider/zh_CN";
  5 +import usePagination from "@/hooks/usePagination";
  6 +import useInitial from "@/hooks/useInitail";
  7 +import { PlusOutlined } from "@ant-design/icons";
  8 +import AddModel from './components/AddModel';
  9 +import RolesModel from './components/RolesModel';
  10 +import Filter from './components/Filter';
  11 +import * as API from './api';
  12 +import _ from "lodash";
  13 +import moment from 'moment';
  14 +import st from "./style.less";
  15 +
  16 +const { Column } = Table;
  17 +function AuthorizationSetting() {
  18 + const [visible, setVisible] = useState<boolean>(false);
  19 + const [searchValue, setSearchValue] = useState<API.Item>({});
  20 + const [rolesVisible, setRolesVisible] = useState<boolean>(false);
  21 + const [row, setRow] = useState<API.Item>();
  22 + const [roles, setRoles] = useState<API.Roles[]>();
  23 + const {data: roleList} = useInitial<CommonApi.RoleCodeVO[], any>(API.getAllRoleCodeApi, [], {});
  24 + const {
  25 + list: authList,
  26 + paginationConfig,
  27 + loading,
  28 + innerParams,
  29 + setParams,
  30 + } = usePagination<API.Item>(API.getContractAuthPage, {current: 1, pageSize: 10});
  31 + const {
  32 + list: contractTypesList,
  33 + } = usePagination<API.TypesItem>(API.getContractTypes, {current: 1, pageSize: 999});
  34 + /**
  35 + * @description: 删除
  36 + * @param {*}
  37 + * @return {*}
  38 + *
  39 + */
  40 + const _delete = (row:API.Item) => {
  41 + const {id} =row;
  42 + API.delContractAuth({contractAuthId: id})
  43 + .then((res) => {
  44 + message.success("操作成功");
  45 + setParams({ ...innerParams }, true);
  46 + })
  47 + .catch((e) => {
  48 + message.error(e.message);
  49 + });
  50 + };
  51 +
  52 + /**
  53 + * @description: 编辑
  54 + * @param {API} row
  55 + * @return {*}
  56 + */
  57 + const edit = async (row:API.Item) => {
  58 + await setRow(row);
  59 + setVisible(true);
  60 + };
  61 +
  62 + /**
  63 + * @description: 禁用启用
  64 + * @param {API} row
  65 + * @return {*}
  66 + */
  67 + const handleDisable = (row:API.Item) => {
  68 + const { id, enabled } = row;
  69 + API.disableContractAuth({contractAuthId: id, enabled: !enabled})
  70 + .then((res) => {
  71 + message.success("操作成功");
  72 + setParams({ ...innerParams }, true);
  73 + })
  74 + .catch((err) => {
  75 + message.error(err.message);
  76 + });
  77 + };
  78 +
  79 + const showRoles = async (row:API.Item) => {
  80 + const {roles} = row;
  81 + try {
  82 + await setRoles(roles);
  83 + } finally {
  84 + setRolesVisible(true);
  85 + }
  86 + };
  87 +
  88 + return (
  89 + <PageHeaderWrapper title="合同授权">
  90 + <ConfigProvider locale={zhCN}>
  91 + <Card className={st.page}>
  92 + <div className={st.header}>
  93 + <Filter
  94 + contractTypesList={contractTypesList}
  95 + setParams={setParams}
  96 + innerParams={innerParams}
  97 + />
  98 + <Button
  99 + type="primary"
  100 + icon={<PlusOutlined />}
  101 + onClick={() => {
  102 + setVisible(true);
  103 + }}
  104 + >
  105 + 新增
  106 + </Button>
  107 + </div>
  108 + <Table
  109 + size="middle"
  110 + loading={loading}
  111 + dataSource={authList}
  112 + pagination={{ ...paginationConfig }}
  113 + scroll={{ y: 800 }}
  114 + rowKey={(item: API.Item) => `${item.id}`}
  115 + onChange={(_pagination) => setParams({ ..._pagination }, true)}
  116 + >
  117 + <Column title="合同类型" width={200} dataIndex="typeName" render={(t) => t || "-"} />
  118 + <Column
  119 + title="授权角色"
  120 + width={200}
  121 + dataIndex="id"
  122 + render={(text, row:API.Item) => (
  123 + <Button
  124 + type="link"
  125 + onClick={() => showRoles(row)}
  126 + >
  127 + 查看
  128 + </Button>
  129 + )}
  130 + />
  131 + <Column title="状态" width={200} dataIndex="enabled" render={(t) => (t?'启用':'禁用')} />
  132 + {/* <Column title="创建时间" width={200} dataIndex="createTime" render={(t) => (t ? moment(t).format('YYYY-MM-DD HH:mm') : "-")} />
  133 + <Column title="更新时间" width={200} dataIndex="updateTime" render={(t) => (t ? moment(t).format('YYYY-MM-DD HH:mm') : "-")} /> */}
  134 + <Column
  135 + title="操作"
  136 + width={100}
  137 + dataIndex="unit"
  138 + render={(text, row:API.Item) => (
  139 + <span>
  140 + <Popconfirm title={`是否${row.enabled ? "禁用?":"启用?"}`} onConfirm={() => handleDisable(row)} okText="确定" cancelText="取消">
  141 + <a
  142 + onClick={(e) => {
  143 + e.preventDefault();
  144 + }}
  145 + style={{ color: "#FAAD14" }}
  146 + >
  147 + {`${row.enabled ? '禁用' :'启用'}`}
  148 + </a>
  149 + </Popconfirm>
  150 + <Divider type="vertical" />
  151 + <Popconfirm title="是否编辑?" onConfirm={() => edit(row)} okText="确定" cancelText="取消">
  152 + <a
  153 + onClick={(e) => {
  154 + e.preventDefault();
  155 + }}
  156 + style={{ color: "#FAAD14" }}
  157 + >
  158 + 编辑
  159 + </a>
  160 + </Popconfirm>
  161 + <Divider type="vertical" />
  162 + <Popconfirm title="是否删除?" onConfirm={() => _delete(row)} okText="确定" cancelText="取消">
  163 + <a
  164 + onClick={(e) => {
  165 + e.preventDefault();
  166 + }}
  167 + style={{ color: "red" }}
  168 + >
  169 + 删除
  170 + </a>
  171 + </Popconfirm>
  172 + </span>
  173 +
  174 + )}
  175 + />
  176 + </Table>
  177 + <AddModel
  178 + visible={visible}
  179 + contractTypesList={contractTypesList}
  180 + roleList={roleList}
  181 + row={row}
  182 + onCancel={() => {
  183 + setVisible(false);
  184 + setRow(undefined);
  185 + }}
  186 + onRefresh={() => setParams({ ...innerParams }, true)}
  187 + />
  188 + <RolesModel
  189 + visible={rolesVisible}
  190 + roles={roles}
  191 + onCancel={() => {
  192 + setRolesVisible(false);
  193 + setRoles(undefined);
  194 + }}
  195 + onRefresh={() => setParams({ ...innerParams }, true)}
  196 + />
  197 + </Card>
  198 + </ConfigProvider>
  199 + </PageHeaderWrapper>
  200 + );
  201 +}
  202 +export default AuthorizationSetting;
... ...
src/pages/contract/AuthorizationSetting/style.css 0 → 100644
  1 +.page {
  2 + position: relative;
  3 +}
  4 +.page .header {
  5 + margin-bottom: 10px;
  6 + height: 32px;
  7 + display: flex;
  8 + flex-direction: row;
  9 + justify-content: space-between;
  10 +}
  11 +.page .header .add {
  12 + position: absolute;
  13 + right: 28px;
  14 + top: 24px;
  15 + z-index: 10;
  16 +}
  17 +.table :global .ant-table table {
  18 + width: 100%;
  19 + border-collapse: collapse;
  20 + text-align: center;
  21 + border-radius: 4px 4px 0 0;
  22 +}
  23 +.table :global .ant-table-thead > tr > th,
  24 +.table :global .ant-table-tbody > tr > td {
  25 + padding: 16px 16px;
  26 + word-break: break-word;
  27 + text-align: center;
  28 + -ms-word-break: break-all;
  29 +}
  30 +.table .cover {
  31 + align-items: center;
  32 + height: 68px;
  33 +}
  34 +.table .cover img {
  35 + border-radius: 4%;
  36 + height: 100%;
  37 + width: auto;
  38 + min-width: 100px;
  39 + max-width: 100px;
  40 +}
... ...
src/pages/contract/AuthorizationSetting/style.less 0 → 100644
  1 +//@import '~antd/lib/style/themes/default.less';
  2 +
  3 +.page {
  4 + position: relative;
  5 +
  6 + .header {
  7 + margin-bottom: 10px;
  8 + height: 32px;
  9 + display: flex;
  10 + flex-direction: row;
  11 + justify-content: space-between;
  12 + .add {
  13 + position: absolute;
  14 + right: 28px;
  15 + top: 24px;
  16 + z-index: 10;
  17 + }
  18 + }
  19 +
  20 + }
  21 + .table {
  22 + :global {
  23 + .ant-table table {
  24 + width: 100%;
  25 + border-collapse: collapse;
  26 + text-align: center;
  27 + border-radius: 4px 4px 0 0;
  28 + }
  29 + .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
  30 + padding: 16px 16px;
  31 + word-break: break-word;
  32 + text-align: center;
  33 + -ms-word-break: break-all;
  34 + }
  35 + }
  36 + .cover {
  37 + align-items: center;
  38 + height: 68px;
  39 + img {
  40 + border-radius: 4%;
  41 + height: 100%;
  42 + width: auto;
  43 + min-width: 100px;
  44 + max-width: 100px;
  45 + }
  46 + }
  47 + }
  48 +
0 49 \ No newline at end of file
... ...
src/pages/contract/ExpressChargingStandardSetting/api.ts 0 → 100644
  1 +import { http } from "@/typing/http";
  2 +import request from "@/utils/request";
  3 +import qs from 'qs';
  4 +import { CONTRACT_HOST, HOST, FINANCE2_HOST } from "@/utils/host";
  5 +import { Any } from "currency.js";
  6 +
  7 +type PrResArr<T> = http.PromiseResp<T[]>;
  8 +
  9 +export interface PageParams {
  10 + current?: number;
  11 + pageSize?: number;
  12 + tradeCompId?:number; //合同类型名称
  13 + sendAreaNo?:string; //寄件地区编号
  14 + arriveAreaNo?:string; //到达地区编号
  15 +}
  16 +
  17 +export interface SaveParams {
  18 + expressChargeStandardId?:number; //id,提供该参数将执行编辑操作
  19 + tradeCompId:number; //往来单位id
  20 + tradeCompName:string; //往来单位名称
  21 + sendAreaNo:string; //寄件地区编号
  22 + sendAreaName:string; //寄件地区名称
  23 + firstWeight:number; //首重
  24 + continuedWeight:number; //续重
  25 + arriveAreas:ArriveAreas[]; //到达地区
  26 +}
  27 +
  28 +export interface DelParams {
  29 + expressChargeStandardId:number; //快递收费标准id
  30 +}
  31 +
  32 +export interface ArriveAreas {
  33 + arriveAreaNo:string; //到达地区编号
  34 + arriveAreaName:string; //到达地区名称
  35 +}
  36 +
  37 +export interface Item {
  38 + id?:number;
  39 + tradeCompName?:string; //往来单位名称
  40 + tradeCompShortName?:string; //往来单位简称
  41 + sendAreaName?:string; //寄件地区名称
  42 + arriveAreaName?:string; //到达地区名称
  43 + firstWeight?:number; //首重
  44 + continuedWeight?:number; //续重
  45 +}
  46 +
  47 +/**
  48 + * 分页查询快递收费标准
  49 + */
  50 + export function getStandardPage(params?: PageParams): http.PromisePageResp<Item> {
  51 + return request.get(`${CONTRACT_HOST}/erp/express/charge/standard/page`, { params });
  52 +}
  53 +
  54 +/**
  55 + * 新增/编辑快递收费标准
  56 + */
  57 + export function addStandardSave(params: SaveParams): http.PromiseResp<any> {
  58 + return request.post(`${CONTRACT_HOST}/erp/express/charge/standard/save`, { ...params });
  59 +}
  60 +
  61 +/**
  62 + * 删除快递收费标准
  63 + */
  64 + export function delStandard(params: DelParams): http.PromiseResp<void> {
  65 + return request.post(`${CONTRACT_HOST}/erp/express/charge/standard/delete`, { ...params });
  66 +}
  67 +
  68 +/**获取往来单位列表*/
  69 +export function fetchComps(params?: any): http.PromiseResp<BearCostSetting.Comp[]> {
  70 + return request.get(`${FINANCE2_HOST}/common/trade/company/list`, {params });
  71 +}
  72 +
  73 +/**
  74 + * 城市列表
  75 + */
  76 + export function getCityLsit(): http.PromiseResp<any> {
  77 + const params = { pbh: 0 };
  78 + return request.get(`/oop/select/region`, { params });
  79 +}
0 80 \ No newline at end of file
... ...
src/pages/contract/ExpressChargingStandardSetting/components/AddModel/index.tsx 0 → 100644
  1 +import React, { useCallback, useEffect, useState } from "react";
  2 +import { Modal, Skeleton, Select, Form, message, InputNumber } from "antd";
  3 +import * as API from '../../api';
  4 +import _ from "lodash";
  5 +
  6 +interface Props {
  7 + visible:boolean;
  8 + row?:API.Item;
  9 + compList:any[];
  10 + cityList:any[];
  11 + onCancel:()=>void;
  12 + onRefresh:() => void;
  13 +
  14 +}
  15 +
  16 +function AddModel({visible, row, compList, cityList, onCancel, onRefresh}:Props) {
  17 + const [form] = Form.useForm();
  18 + const [loading, setLoading] = useState<boolean>(false);
  19 + const { id } = row || {};
  20 + useEffect(() => {
  21 + if (id) {
  22 + const { tradeCompName, sendAreaName, firstWeight, continuedWeight, arriveAreaName } = row || {};
  23 + form.setFieldsValue({
  24 + tradeComp: compList.filter(it => tradeCompName === it.name).map(item => ({value: item.id, label: item.name}))[0],
  25 + sendArea: cityList.filter(it => sendAreaName === it.fullName).map(item => ({value: item.bh, label: item.fullName}))[0],
  26 + firstWeight,
  27 + continuedWeight,
  28 + arriveAreas: cityList.filter(it => arriveAreaName === it.fullName).map(item => ({value: item.bh, label: item.fullName}))[0]
  29 +
  30 + });
  31 + }
  32 + }, [row]);
  33 +
  34 + /**
  35 + * @description: 确定
  36 + * @param {*}
  37 + * @return {*}
  38 + */
  39 + const handleSave = (feildValue:any) => {
  40 + setLoading(true);
  41 + const {tradeComp, sendArea, arriveAreas, firstWeight, continuedWeight} = feildValue;
  42 + const _arriveAreas = id ? [{ ...arriveAreas }].map(item => ({arriveAreaNo: item.value, arriveAreaName: item.label}))
  43 + : arriveAreas.length && arriveAreas.map((item:any) => ({arriveAreaNo: item.value, arriveAreaName: item.label}));
  44 +
  45 + const params = {
  46 + expressChargeStandardId: id,
  47 + tradeCompId: tradeComp.value,
  48 + tradeCompName: tradeComp.label,
  49 + tradeCompShortName: compList && compList.filter(item => item.id == tradeComp.value)[0].shortName,
  50 + sendAreaNo: sendArea.value,
  51 + sendAreaName: sendArea.label,
  52 + firstWeight,
  53 + continuedWeight,
  54 + arriveAreas: _arriveAreas
  55 + };
  56 + API.addStandardSave({ ...params })
  57 + .then(res => {
  58 + message.success("操作成功");
  59 + _onCancel();
  60 + setLoading(false);
  61 + onRefresh();
  62 + }).catch(err => {
  63 + message.error(err?.message);
  64 + setLoading(false);
  65 + });
  66 + };
  67 + /**
  68 + * @description: 关闭弹框
  69 + * @param {*}
  70 + * @return {*}
  71 + */
  72 + const _onCancel = () => {
  73 + onCancel && onCancel();
  74 + form.resetFields();
  75 + };
  76 +
  77 + return (
  78 + <Modal
  79 + title={`${id ? '编辑':'新增'}快递收费标准`}
  80 + visible={visible}
  81 + confirmLoading={loading}
  82 + onCancel={_onCancel}
  83 + onOk={form.submit}
  84 + cancelButtonProps={{ hidden: true }}
  85 + width="50%"
  86 + bodyStyle={{minHeight: 300}}
  87 + >
  88 + <Skeleton loading={false}>
  89 + <Form form={form} onFinish={handleSave} wrapperCol={{ span: 18 }} labelCol={{ span: 4 }}>
  90 + <Form.Item
  91 + label="快递公司"
  92 + name="tradeComp"
  93 + rules={[{required: true, message: '请选择快递公司'}]}
  94 + >
  95 + <Select
  96 + placeholder="请选择快递公司"
  97 + showSearch
  98 + allowClear
  99 + optionFilterProp="children"
  100 + labelInValue
  101 + onSelect={(it:any) => {
  102 + const item = compList.filter((i:any) => it.value === i.id);
  103 + }}
  104 + filterOption={(input, option: any) => option?.children.indexOf(input) >= 0}
  105 + >
  106 + {
  107 + compList.map(item => (
  108 + <Select.Option value={item.id} key={item.id}>
  109 + {item.name}
  110 + </Select.Option>
  111 + ))
  112 + }
  113 + </Select>
  114 + </Form.Item>
  115 + <Form.Item
  116 + label="寄件地区"
  117 + name="sendArea"
  118 + rules={[{required: true, message: '请选择寄件地区'}]}
  119 + >
  120 + <Select
  121 + placeholder="请选择寄件地区"
  122 + showSearch
  123 + allowClear
  124 + optionFilterProp="children"
  125 + labelInValue
  126 + onSelect={(it:any) => {
  127 + const item = cityList.filter((i:any) => it.value === i.id);
  128 + }}
  129 + filterOption={(input, option: any) => option?.children.indexOf(input) >= 0}
  130 + >
  131 + {
  132 + cityList.map(item => (
  133 + <Select.Option value={item.bh} key={item.bh}>
  134 + {item.fullName}
  135 + </Select.Option>
  136 + ))
  137 + }
  138 + </Select>
  139 + </Form.Item>
  140 + <Form.Item
  141 + label="到达地区"
  142 + name="arriveAreas"
  143 + rules={[{required: true, message: '请选择到达地区'}]}
  144 + >
  145 + <Select
  146 + placeholder={`请选择到达地区${id ? '' : '(支持多选)'}`}
  147 + mode={id ? undefined : 'multiple'}
  148 + showSearch
  149 + allowClear
  150 + showArrow
  151 + optionFilterProp="children"
  152 + labelInValue
  153 + onSelect={(it:any) => {
  154 + const item = cityList.filter((i:any) => it.value === i.id);
  155 + }}
  156 + filterOption={(input, option: any) => option?.children.indexOf(input) >= 0}
  157 + >
  158 + {
  159 + cityList.map(item => (
  160 + <Select.Option value={item.bh} key={item.bh}>
  161 + {item.fullName}
  162 + </Select.Option>
  163 + ))
  164 + }
  165 + </Select>
  166 + </Form.Item>
  167 + <Form.Item
  168 + label="首重"
  169 + name="firstWeight"
  170 + rules={[{required: true, message: '请填写首重'}]}
  171 + >
  172 + <InputNumber placeholder="请填写" addonAfter="元" max={100000000} min={0} precision={2} />
  173 + </Form.Item>
  174 + <Form.Item
  175 + label="续重"
  176 + name="continuedWeight"
  177 + rules={[{required: true, message: '请填写续重'}]}
  178 + >
  179 + <InputNumber placeholder="请填写" addonAfter="元/kg" max={100000000} min={0} precision={2} />
  180 + </Form.Item>
  181 + </Form>
  182 + </Skeleton>
  183 + </Modal>
  184 + );
  185 +}
  186 +
  187 +export default AddModel;
0 188 \ No newline at end of file
... ...
src/pages/contract/ExpressChargingStandardSetting/components/Filter/index.tsx 0 → 100644
  1 +import React, { useCallback, useState } from "react";
  2 +import { Row, Col, Select } from "antd";
  3 +import _ from "lodash";
  4 +
  5 +interface Props {
  6 + setParams:any;
  7 + innerParams:any;
  8 + cityList:any[];
  9 + compList:BearCostSetting.Comp[];
  10 +}
  11 +
  12 +interface SearchData {
  13 + tradeCompId?:number;//往来单位id
  14 + sendAreaNo?:string;//寄件地区编号
  15 + arriveAreaNo?:string;//到达地区编号
  16 +}
  17 +
  18 +function Filter({ compList, cityList, setParams, innerParams }:Props) {
  19 + const [searchData, setSearchData] = useState<SearchData>({});
  20 + return (
  21 + <Row style={{flex: 1}}>
  22 + <Col span={8} style={{marginRight: 10}}>
  23 + <Select
  24 + placeholder="请选择快递公司"
  25 + showSearch
  26 + optionFilterProp="children"
  27 + allowClear
  28 + style={{ minWidth: 260, maxWidth: 280 }}
  29 + onChange={(tradeCompId) => {
  30 + setSearchData({...searchData, tradeCompId});
  31 + setParams({...innerParams, ...searchData, tradeCompId}, true);
  32 + }}
  33 + >
  34 + {
  35 + compList.map(item => (
  36 + <Select.Option value={item.id} key={item.id}>
  37 + {item.name}
  38 + </Select.Option>
  39 + ))
  40 + }
  41 + </Select>
  42 + </Col>
  43 + <Col span={6} style={{marginRight: 10}}>
  44 + <Select
  45 + placeholder="请选择寄件地区"
  46 + showSearch
  47 + optionFilterProp="children"
  48 + allowClear
  49 + style={{ width: 200 }}
  50 + onChange={(sendAreaNo) => {
  51 + setSearchData({...searchData, sendAreaNo});
  52 + setParams({...innerParams, ...searchData, sendAreaNo}, true);
  53 + }}
  54 + >
  55 + {
  56 + cityList.map(item => (
  57 + <Select.Option value={item.bh} key={item.bh}>
  58 + {item.fullName}
  59 + </Select.Option>
  60 + ))
  61 + }
  62 + </Select>
  63 + </Col>
  64 + <Col span={6} style={{marginRight: 10}}>
  65 + <Select
  66 + placeholder="请选择到达地区"
  67 + showSearch
  68 + optionFilterProp="children"
  69 + allowClear
  70 + style={{ width: 200 }}
  71 + onChange={(arriveAreaNo) => {
  72 + setSearchData({...searchData, arriveAreaNo});
  73 + setParams({...innerParams, ...searchData, arriveAreaNo}, true);
  74 + }}
  75 + >
  76 + {
  77 + cityList.map(item => (
  78 + <Select.Option value={item.bh} key={item.bh}>
  79 + {item.fullName}
  80 + </Select.Option>
  81 + ))
  82 + }
  83 + </Select>
  84 + </Col>
  85 + </Row>
  86 + );
  87 +}
  88 +
  89 +export default Filter;
0 90 \ No newline at end of file
... ...
src/pages/contract/ExpressChargingStandardSetting/index.tsx 0 → 100644
  1 +import React, { useState } from "react";
  2 +import { Button, Card, ConfigProvider, Divider, message, Popconfirm, Table } from "antd";
  3 +import { PageHeaderWrapper } from "@ant-design/pro-layout";
  4 +import zhCN from "antd/lib/locale-provider/zh_CN";
  5 +import usePagination from "@/hooks/usePagination";
  6 +import useInitial from "@/hooks/useInitail";
  7 +import { PlusOutlined } from "@ant-design/icons";
  8 +import AddModel from './components/AddModel';
  9 +import Filter from './components/Filter';
  10 +import * as API from './api';
  11 +import _ from "lodash";
  12 +import st from "./style.less";
  13 +
  14 +interface Props {
  15 +}
  16 +
  17 +const { Column } = Table;
  18 +
  19 +function expressChargingStandard(props:Props) {
  20 + const [visible, setVisible] = useState<boolean>(false);
  21 + const {
  22 + list: standardList,
  23 + loading,
  24 + paginationConfig,
  25 + innerParams,
  26 + setParams,
  27 + setLoading
  28 + } = usePagination<API.Item>(API.getStandardPage, {current: 1, pageSize: 10});
  29 + const { data: cityList, loading: cityLoading } = useInitial(API.getCityLsit, [], {});
  30 + const { data: compList, loading: compLoading } = useInitial(API.fetchComps, [], {types: '88'});
  31 + const [row, setRow] = useState<API.Item>();
  32 + /**
  33 + * @description: 编辑
  34 + * @param {*} _
  35 + * @return {*}
  36 + */
  37 + const edit = _.debounce(async (row:API.Item) => {
  38 + await setRow({...row});
  39 + setVisible(true);
  40 + }, 800);
  41 +
  42 + /**
  43 + * @description: 删除
  44 + * @param {*} _
  45 + * @return {*}
  46 + */
  47 + const _delete = _.debounce((row:API.Item) => {
  48 + const {id} = row;
  49 + if (!id) return;
  50 + setLoading(true);
  51 + API.delStandard({expressChargeStandardId: id})
  52 + .then(res => {
  53 + message.success("操作成功");
  54 + setParams({...innerParams}, true);
  55 + setLoading(false);
  56 + }).catch(err => {
  57 + message.error(err?.message);
  58 + setLoading(false);
  59 + });
  60 + }, 800);
  61 +
  62 + return (
  63 + <PageHeaderWrapper
  64 + loading={cityLoading || compLoading}
  65 + title="快递收费标准配置"
  66 + >
  67 + <ConfigProvider locale={zhCN}>
  68 + <Card className={st.page}>
  69 + <div className={st.header}>
  70 + <Filter
  71 + cityList={cityList || []}
  72 + compList={compList || []}
  73 + setParams={setParams}
  74 + innerParams={innerParams}
  75 + />
  76 + <Button
  77 + type="primary"
  78 + icon={<PlusOutlined />}
  79 + onClick={() => {
  80 + setVisible(true);
  81 + }}
  82 + >
  83 + 新增
  84 + </Button>
  85 + </div>
  86 + <Table
  87 + size="middle"
  88 + loading={loading}
  89 + dataSource={standardList}
  90 + pagination={{ ...paginationConfig }}
  91 + scroll={{ y: 800 }}
  92 + rowKey={(item: API.Item) => `${item.id}`}
  93 + onChange={(_pagination) => setParams({ ..._pagination }, true)}
  94 + >
  95 + <Column title="快递公司" width={200} dataIndex="tradeCompName" render={(t:any) => t || "-"} />
  96 + <Column title="寄件地区" width={200} dataIndex="sendAreaName" render={(t:any) => t || '-'} />
  97 + <Column title="到达地区" width={200} dataIndex="arriveAreaName" render={(t:any) => t || '-'} />
  98 + <Column title="首重(元)" width={200} dataIndex="firstWeight" render={(t:any) => t || '-'} />
  99 + <Column title="续重(元/kg)" width={200} dataIndex="continuedWeight" render={(t:any) => t || '-'} />
  100 + <Column
  101 + title="操作"
  102 + width={100}
  103 + dataIndex="unit"
  104 + render={(text, row:API.Item) => (
  105 + <span>
  106 + <Popconfirm title="是否编辑?" onConfirm={() => edit(row)} okText="确定" cancelText="取消">
  107 + <a
  108 + onClick={(e) => {
  109 + e.preventDefault();
  110 + }}
  111 + style={{ color: "#FAAD14" }}
  112 + >
  113 + 编辑
  114 + </a>
  115 + </Popconfirm>
  116 + <Divider type="vertical" />
  117 + <Popconfirm title="是否删除?" onConfirm={() => _delete(row)} okText="确定" cancelText="取消">
  118 + <a
  119 + onClick={(e) => {
  120 + e.preventDefault();
  121 + }}
  122 + style={{ color: "red" }}
  123 + >
  124 + 删除
  125 + </a>
  126 + </Popconfirm>
  127 + </span>
  128 +
  129 + )}
  130 + />
  131 + </Table>
  132 + <AddModel
  133 + visible={visible}
  134 + row={row}
  135 + compList={compList || []}
  136 + cityList={cityList || []}
  137 + onCancel={() => {
  138 + setVisible(false);
  139 + setRow(undefined);
  140 + }}
  141 + onRefresh={() => setParams({ ...innerParams }, true)}
  142 + />
  143 + </Card>
  144 + </ConfigProvider>
  145 + </PageHeaderWrapper>
  146 + );
  147 +}
  148 +
  149 +export default expressChargingStandard;
0 150 \ No newline at end of file
... ...
src/pages/contract/ExpressChargingStandardSetting/style.less 0 → 100644
  1 +//@import '~antd/lib/style/themes/default.less';
  2 +
  3 +.page {
  4 + position: relative;
  5 +
  6 + .header {
  7 + margin-bottom: 10px;
  8 + height: 32px;
  9 + display: flex;
  10 + flex-direction: row;
  11 + justify-content: space-between;
  12 + .add {
  13 + position: absolute;
  14 + right: 28px;
  15 + top: 24px;
  16 + z-index: 10;
  17 + }
  18 + }
  19 +
  20 + }
  21 + .table {
  22 + :global {
  23 + .ant-table table {
  24 + width: 100%;
  25 + border-collapse: collapse;
  26 + text-align: center;
  27 + border-radius: 4px 4px 0 0;
  28 + }
  29 + .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
  30 + padding: 16px 16px;
  31 + word-break: break-word;
  32 + text-align: center;
  33 + -ms-word-break: break-all;
  34 + }
  35 + }
  36 + .cover {
  37 + align-items: center;
  38 + height: 68px;
  39 + img {
  40 + border-radius: 4%;
  41 + height: 100%;
  42 + width: auto;
  43 + min-width: 100px;
  44 + max-width: 100px;
  45 + }
  46 + }
  47 + }
  48 +
0 49 \ No newline at end of file
... ...
src/pages/coupon/CouponConfig/components/FullReduce.tsx
... ... @@ -8,6 +8,7 @@ import ShopLimit from &quot;./ShopLimit&quot;;
8 8 import useInitail from "@/hooks/useInitail";
9 9 import { PaymentTypeEnum } from '@/pages/coupon/CashChange/api';
10 10 import { RightOutlined } from '@ant-design/icons';
  11 +import RenderSelectGoos from '@/pages/capital/ReceiveRules/subPages/GoodsDimension/components/RenderSelectGoos';
11 12  
12 13 const Option = Select.Option;
13 14 interface Props {
... ... @@ -170,6 +171,12 @@ export default function FullReduce({
170 171 />
171 172 </Form.Item>
172 173 )}
  174 + {/* 实物兑换券选择兑换物品 */}
  175 + {classifyInfo.code === "dhyhq" && (
  176 + <Form.Item label="兑换物品" name="amsCode" extra={<span style={{ fontSize: 12 }}>*兑换物品仅限一个</span>} rules={[{ required: true, message: '请选择' }]}>
  177 + <RenderSelectGoos multiple={false} disabled={readonly} />
  178 + </Form.Item>
  179 + )}
173 180 <Form.Item
174 181 label="优惠券券面金额"
175 182 name="amount"
... ...
src/pages/coupon/CouponConfig/index.tsx
... ... @@ -32,6 +32,7 @@ export default function UpsertCoupon({ visible, onCancel, onSave, remark, disabl
32 32 classifyCode: data.classifyCode ? { value: data.classifyCode, label: data.classifyName } : undefined,
33 33 exchangeTypeId: data.exchangeTypeId ? { value: data.exchangeTypeId, label: data.exchangeTypeName } : undefined,
34 34 orgList: data.orgList ? data.orgList.map((i) => ({ value: i.orgId, label: i.orgName })) : undefined,
  35 + amsCode: data.amsCode ? [{ code: data.amsCode, name: data.amsName, spec: data.amsSpec }] : undefined,
35 36 });
36 37 setLoading(false);
37 38 }).catch((e) => {
... ... @@ -72,6 +73,7 @@ export default function UpsertCoupon({ visible, onCancel, onSave, remark, disabl
72 73 exchangeTypeId: fields.exchangeTypeId && fields.exchangeTypeId.value,
73 74 exchangeTypeName: fields.exchangeTypeId && fields.exchangeTypeId.label,
74 75 schemeList: fields.schemeList ? fields.schemeList.map((i: MktConponSpace.LimitList) => ({ ...i, externalRely: i.externalRely || false })) : [],
  76 + amsCode: fields.amsCode && fields.amsCode.map((i: { code: string; }) => i.code).join(','),
75 77 remark,
76 78 };
77 79 setSaveLoading(true);
... ...
src/pages/coupon/CouponOperation/components/CouponLog.tsx
... ... @@ -109,7 +109,7 @@ function CouponLog({ couponLog, setCouponLog, onChange }: Props) {
109 109 <Table
110 110 dataSource={data}
111 111 loading={loading}
112   - rowKey={(record) => `id${record.type}`}
  112 + rowKey="id"
113 113 >
114 114 <Column
115 115 title="日志类型"
... ...
src/pages/finance/FinanceInvestor/components/Filter.tsx
... ... @@ -8,26 +8,11 @@ const { Option } = Select;
8 8 const Search = Input.Search;
9 9  
10 10 export default function AccountList() {
11   - // const { setVisible, setParams, innerParams, dealerLoading, dealerList } = useStore();
12 11 const { triggerModal, brands, financeList, setInvestList, companys, dealers } = useStore();
13   - // investList,
14   - // setInvestList,
15 12 // 存储删选条件
16 13 const [filterParams, setFilterParams] = useState({});
17 14  
18   - console.log("投资主体11列表", financeList);
19   -
20   - // function searchType(accountType: number) {
21   - // setParams({ accountType }, true);
22   - // }
23   -
24   - // _onSelectSubject;
25   - // const fetchListByName = debounce(value => {
26   - // setParams({ keywords: value }, true);
27   - // }, 500);
28   -
29 15 useEffect(() => {
30   - console.log("筛选参数filterParams", filterParams);
31 16 let originList = financeList;
32 17 let res = [];
33 18 if (filterParams.brandId) {
... ... @@ -41,7 +26,6 @@ export default function AccountList() {
41 26 if (filterParams.includeId) {
42 27 //删选包含商家 includeId
43 28 originList = originList.filter((item) => item.includeDealers?.find((y) => y.id === filterParams.includeId));
44   - console.log("筛选输入:", originList);
45 29 }
46 30 if (filterParams.creditDealerId) {
47 31 //删选授信商家 creditDealerId
... ...
src/pages/finance/SpecialAccount/FactoryBill/components/Filter.tsx
1 1 import React, { useCallback } from "react";
2   -import { Button, Col, Row, Select } from "antd";
  2 +import { Button, Row, Select } from "antd";
3 3 import { useStore } from "../index";
4 4  
5 5 const { Option } = Select;
... ... @@ -10,61 +10,47 @@ export default function Filter() {
10 10 const searchDealer = useCallback((dealerId) => {
11 11 setDealerId(dealerId);
12 12 }, []);
13   -
  13 +
14 14 const searchBrand = useCallback((brandId) => {
15 15 setBrandId(brandId);
16 16 }, []);
17 17  
18 18 return (
19   - <div
20   - style={{
21   - display: "flex",
22   - flexDirection: "row",
23   - justifyContent: "space-between",
24   - alignItems: "center",
25   - marginBottom: 20,
26   - }}
27   - >
28   - <Row style={{ display: "flex", flex: 1, alignItems: "center" }}>
29   - <div>商家:</div>
30   - <Col span={6}>
31   - <Select
32   - placeholder="请选择商家"
33   - showSearch
34   - optionFilterProp="children"
35   - onChange={searchDealer}
36   - // value={dealerId && dealerId > 0 ? dealerId : undefined}
37   - style={{ width: 300 }}
38   - >
39   - {dealerList.map((dealer) => (
40   - <Option value={dealer.id} key={dealer.id}>
41   - {dealer.name}
42   - </Option>
43   - ))}
44   - </Select>
45   - </Col>
46   - <div style={{ marginLeft: 20 }}>品牌:</div>
47   - <Col span={6}>
48   - <Select
49   - placeholder="请选择品牌"
50   - loading={brandLoading}
51   - allowClear
52   - optionFilterProp="children"
53   - onChange={searchBrand}
54   - value={brandId && brandId > 0 ? brandId : undefined}
55   - style={{ width: 160 }}
56   - >
57   - {brandList.map((brand) => (
58   - <Option value={brand.id} key={brand.id}>
59   - {brand.name}
60   - </Option>
61   - ))}
62   - </Select>
63   - </Col>
  19 + <Row justify="space-between" style={{ marginBottom: 10 }}>
  20 + <Row justify="start">
  21 + <Select
  22 + placeholder="请选择商家"
  23 + showSearch
  24 + optionFilterProp="children"
  25 + onChange={searchDealer}
  26 + style={{ width: 200 }}
  27 + >
  28 + {dealerList.map((dealer) => (
  29 + <Option value={dealer.id} key={dealer.id}>
  30 + {dealer.name}
  31 + </Option>
  32 + ))}
  33 + </Select>
  34 + <Select
  35 + placeholder="请选择品牌"
  36 + loading={brandLoading}
  37 + allowClear
  38 + optionFilterProp="children"
  39 + onChange={searchBrand}
  40 + value={brandId && brandId > 0 ? brandId : undefined}
  41 + style={{ width: 200,marginLeft:100 }}
  42 + >
  43 + {brandList.map((brand) => (
  44 + <Option value={brand.id} key={brand.id}>
  45 + {brand.name}
  46 + </Option>
  47 + ))}
  48 + </Select>
64 49 </Row>
  50 +
65 51 <Button type="primary" hidden={!dealerId} onClick={() => setVisible(true)}>
66 52 新增
67 53 </Button>
68   - </div>
  54 + </Row>
69 55 );
70 56 }
... ...
src/pages/identify/IdentifyAudit/components/List.tsx
... ... @@ -27,11 +27,21 @@ export default function IdentifyAuditList() {
27 27 >
28 28 <Table.Column title="资料编码" dataIndex="identifyCode" align="left" />
29 29 <Table.Column title="资料名称" dataIndex="identifyName" align="left" />
30   - {pagination.innerParams.type === Type.会员认证 ? (
31   - <Table.Column title="会员号" dataIndex="memberId" align="left" />
  30 + {pagination.innerParams.type !== Type.员工认证 ? (
  31 + <Table.Column
  32 + title="会员号"
  33 + dataIndex="memberId"
  34 + align="left"
  35 + render={(memberId) => memberId ?? "-"}
  36 + />
32 37 ) : null}
33   - {pagination.innerParams.type === Type.员工认证 ? (
34   - <Table.Column title="员工ID" dataIndex="staffId" align="left" />
  38 + {pagination.innerParams.type !== Type.会员认证 ? (
  39 + <Table.Column
  40 + title="员工ID"
  41 + dataIndex="staffId"
  42 + align="left"
  43 + render={(staffId) => staffId ?? "-"}
  44 + />
35 45 ) : null}
36 46 {pagination.innerParams.type === Type.车辆认证 ? (
37 47 <Table.Column title="VIN" dataIndex="vin" align="left" />
... ...
src/pages/identify/IdentifyAudit/components/Modal.tsx
... ... @@ -2,7 +2,7 @@
2 2 * @Author: wangqiang@feewee.cn
3 3 * @Date: 2023-02-10 17:52:44
4 4 * @LastEditors: wangqiang@feewee.cn
5   - * @LastEditTime: 2023-02-11 16:46:04
  5 + * @LastEditTime: 2023-03-01 14:04:28
6 6 */
7 7 import {
8 8 Button,
... ... @@ -139,12 +139,12 @@ export default function IdentifyAuditModal() {
139 139 <ProDescriptions.Item label="资料名称">
140 140 {current?.identifyName || "-"}
141 141 </ProDescriptions.Item>
142   - {pagination.innerParams?.type === Type.会员认证 ? (
  142 + {pagination.innerParams?.type !== Type.员工认证 ? (
143 143 <ProDescriptions.Item label="会员ID">
144 144 {current?.memberId || "-"}
145 145 </ProDescriptions.Item>
146 146 ) : null}
147   - {pagination.innerParams?.type === Type.员工认证 ? (
  147 + {pagination.innerParams?.type !== Type.会员认证 ? (
148 148 <ProDescriptions.Item label="员工ID">
149 149 {current?.staffId || "-"}
150 150 </ProDescriptions.Item>
... ...
src/pages/mkt/ActivityCreate/BasicInformation/components/ImageUploader/index.tsx
... ... @@ -161,7 +161,7 @@ export default function Detail({ form, readOnly, bizType }: Props) {
161 161 return e && e.fileList;
162 162 }}
163 163 >
164   - <Upload maxCount={10} multiple {...videoProps}>
  164 + <Upload maxCount={1} multiple {...videoProps}>
165 165 {uploadButton}
166 166 </Upload>
167 167 </FormItem>
... ...
src/pages/mkt/ActivityCreate/BasicInformation/index.tsx
... ... @@ -86,7 +86,6 @@ function Index({ onNext }: Props) {
86 86 // }
87 87 // }
88 88 params.bizType = undefined;
89   - params.activityName = undefined;
90 89 params.activityType = undefined;
91 90 params.address = undefined;
92 91 params.addressType = undefined;
... ... @@ -170,7 +169,7 @@ function Index({ onNext }: Props) {
170 169 </Select>
171 170 </FormItem>
172 171 <FormItem name="activityName" label="活动名称" {...formRules.activityName}>
173   - <Input placeholder="输入活动名称" disabled={readOnly} />
  172 + <Input placeholder="输入活动名称" disabled={readOnly && !changeEnable} />
174 173 </FormItem>
175 174 <FormItem label="活动描述">
176 175 <BraftEditor
... ...
src/pages/mkt/ActivityCreate/ExternalPromotion/components/ActivityScope/index.tsx
... ... @@ -710,7 +710,7 @@ function Index() {
710 710 {({ getFieldValue }) => (getFieldValue("goalType") === 2 ? (
711 711 <Form.Item name="goalJoinLimit" rules={[{ required: true, message: "请选择活动报名条件" }]}>
712 712 <Radio.Group
713   - disabled={readOnly}
  713 + disabled={readOnly && !changeEnable}
714 714 onChange={(v) => {
715 715 setGoalJoinLimit(v.target.value);
716 716 if (v.target.value === 1) {
... ... @@ -739,7 +739,7 @@ function Index() {
739 739 {bizType !== 2 && (
740 740 <Form.Item name="nonGoalJoin" valuePropName="checked">
741 741 <Checkbox
742   - disabled={readOnly || disable || JoinLimit === 1}
  742 + disabled={(readOnly && !changeEnable) || disable || JoinLimit === 1}
743 743 onChange={(v) => {
744 744 if (v.target.checked) {
745 745 form.setFieldsValue({ nonGoalBrowse: true });
... ... @@ -754,7 +754,7 @@ function Index() {
754 754 <div style={{ marginTop: 35, color: '#666' }}>*活动页面展示(C端---{'>'}霏车车小程序)</div>
755 755 <Form.Item name="publicity" valuePropName="checked">
756 756 <Checkbox
757   - disabled={readOnly || [5, 6, 9].includes(activityType || 0)}
  757 + disabled={(readOnly && !changeEnable) || [5, 6, 9].includes(activityType || 0)}
758 758 onChange={(v) => {
759 759 if (v.target.checked) {
760 760 form.setFieldsValue({ nonGoalBrowse: true });
... ... @@ -767,7 +767,7 @@ function Index() {
767 767 </Form.Item>
768 768 <div style={{ marginTop: 30, color: '#666' }}>*车系详情中"查看优惠"页面展示活动信息</div>
769 769 <Form.Item name="nonGoalBrowse" valuePropName="checked">
770   - <Checkbox disabled={readOnly || (disable && JoinLimit !== 1) || (!!nonGoalLimit.nonGoalJoin || !!nonGoalLimit.publicity)}> 非目标客户可查看</Checkbox>
  770 + <Checkbox disabled={(readOnly && !changeEnable) || (disable && JoinLimit !== 1) || (!!nonGoalLimit.nonGoalJoin || !!nonGoalLimit.publicity)}> 非目标客户可查看</Checkbox>
771 771 </Form.Item>
772 772  
773 773 <Form.Item style={{ marginTop: 30, textAlign: "center" }}>
... ...
src/pages/performance/CompensateGroupConfig/components/DraftList.tsx
... ... @@ -89,7 +89,7 @@ export default ({ type }: Props) =&gt; {
89 89 新增
90 90 </Button>
91 91 </Row>
92   - <Table loading={loading} rowKey={(row) => `id${row.id}`} dataSource={list} pagination={paginationConfig}>
  92 + <Table loading={loading} rowKey={(row) => `id${row.draftId}`} dataSource={list} pagination={paginationConfig}>
93 93 <Column title="薪酬组名称" dataIndex="name" align="center" render={(name) => name || ""} />
94 94 <Column title="岗位" dataIndex="postName" align="center" />
95 95 <Column
... ...
src/pages/performance/CompensateGroupConfig/interface.d.ts
... ... @@ -125,9 +125,9 @@ declare namespace CompensateConfig {
125 125 settings: Settings[];
126 126 id?: number;
127 127 name: string;
128   - ladderParams?: CommissionParams[];
  128 + ladderParams: CommissionParams[];
129 129 commissionParams: CommissionParams[];
130   - conds?: Conds[];
  130 + conds: Conds[];
131 131 }
132 132 interface Conds {
133 133 indicatorCode: string;
... ...
src/pages/performance/EvaDataImport/EditComfirm/index.tsx 0 → 100644
  1 +import React, { useState, useEffect } from "react";
  2 +import { PageHeaderWrapper } from "@ant-design/pro-layout";
  3 +import { Button, Card, Table, Row, message, Space, Typography, Divider, Switch, Upload } from "antd";
  4 +import usePagination from "@/hooks/usePagination";
  5 +import { evaDataDetailApi } from "../api";
  6 +import { UploadOutlined } from "@ant-design/icons";
  7 +import type { UploadProps } from "antd";
  8 +import useInitail from "@/hooks/useInitail";
  9 +import { createStore } from "@/hooks/moz";
  10 +import { common } from "@/typing/common";
  11 +import store from "./store";
  12 +import { isArray } from "lodash";
  13 +import moment from "moment";
  14 +import { ReasonsEnum } from "../entity";
  15 +import { history } from "umi";
  16 +import st from "./style.less";
  17 +
  18 +const Column = Table.Column;
  19 +export const { Provider, useStore } = createStore(store);
  20 +
  21 +interface Props extends common.ConnectProps {}
  22 +
  23 +function Index(props: Props) {
  24 + const { setId, configId } = useStore();
  25 + const [delay, setDelay] = useState(true);
  26 + const [newData, setNewData] = useState<any>([]);
  27 + const { match } = props;
  28 + const { id, num } = match.params;
  29 + useEffect(() => {
  30 + setId(id);
  31 + }, [id]);
  32 + useEffect(() => {
  33 + if (configId) {
  34 + setParams({ id: configId }, true);
  35 + setDelay(false);
  36 + }
  37 + }, [configId]);
  38 + console.log('num', num);
  39 + const { data, errMsg, setParams, loading } = useInitail(evaDataDetailApi, {}, {}, delay);
  40 + console.log(isArray(data));
  41 + useEffect(() => {
  42 + if (isArray(data)) {
  43 + setNewData(data);
  44 + }
  45 + }, [data]);
  46 +
  47 + return (
  48 + <PageHeaderWrapper title="考评数据导入">
  49 + <Card>
  50 + <Table loading={loading} rowKey={(row) => `id${id}`} dataSource={newData} pagination={{ total: num }}>
  51 + <Column title="归属人员" dataIndex="userName" align="center" render={(name) => <span>{name || "--"}</span>} />
  52 + <Column title="归属门店" dataIndex="shopName" align="center" render={(name) => <span>{name || "--"}</span>} />
  53 + <Column
  54 + title="指标名称"
  55 + dataIndex="indicatorName"
  56 + align="center"
  57 + render={(name) => <span>{name || "--"}</span>}
  58 + />
  59 + <Column
  60 + title="指标值"
  61 + dataIndex="indicatorValue"
  62 + align="center"
  63 + render={(num, record: any) => (
  64 + <span>
  65 + {num !== undefined
  66 + ? `${num}${
  67 + record.dataType == 1 ? "台" : record.dataType == 2 ? "%" : record.dataType == 3 ? "元" : ""
  68 + }`
  69 + : "--"}
  70 + </span>
  71 + )}
  72 + />
  73 + <Column