Commit 8866330358bbb77d2c94cea9a00c07d29c53074a

Authored by jiangwei
2 parents b460f170 a3a2c879

Merge remote-tracking branch 'origin/master' into cas

Showing 220 changed files with 12620 additions and 891 deletions

Too many changes to show.

To preserve performance only 78 of 220 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/fvm.ts
... ... @@ -330,4 +330,9 @@ export default [
330 330 path: "/fvm/plan/ticket/execution",
331 331 component: "./stock/Plan/TicketExecution",
332 332 },
  333 + // 加装车配置
  334 + {
  335 + path: "/fvm/vehicle/additional",
  336 + component: "./stock/VehicleAdditional",
  337 + },
333 338 ];
... ...
config/routers/order3.ts
... ... @@ -206,8 +206,12 @@ export default [
206 206 path: "/order3/retailTaskConfiguration",
207 207 component: "./order3/RetailTaskConfiguration",
208 208 },
209   - { // 附加值任务配置
  209 + { // 附加值任务配置
210 210 path: "/order3/addValueTaskConfig",
211 211 component: "./order3/AddValueTaskConfig",
212 212 },
  213 + {//分期优惠券抵扣设置
  214 + path: "/order3/orderSetting/loanDiscountSetting",
  215 + component: "./order3/OrderSetting/LoanDiscountSetting",
  216 + },
213 217 ];
214 218 \ No newline at end of file
... ...
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/components/FeeweeUploadAttachment/index.tsx
... ... @@ -89,7 +89,7 @@ export default function FeeweeUploadAttachment({
89 89 }))
90 90 );
91 91 })
92   - .catch((error: any) => {})
  92 + .catch((error: any) => { })
93 93 .finally(() => {
94 94 // hide();
95 95 setLoading(false);
... ... @@ -217,9 +217,9 @@ export default function FeeweeUploadAttachment({
217 217 return (
218 218 <Spin spinning={loading}>
219 219 <Upload
220   - {...props}
221 220 accept={FeeweeFileAccept}
222 221 beforeUpload={beforeUpload}
  222 + {...props}
223 223 onPreview={onPreview}
224 224 fileList={fileList}
225 225 onChange={onUploadChange}
... ... @@ -229,8 +229,8 @@ export default function FeeweeUploadAttachment({
229 229 props.listType === "picture-card"
230 230 ? ListTypeOfPictureCard
231 231 : props.listType === "picture"
232   - ? ListTypeOfPicture
233   - : ListTypeOfText;
  232 + ? ListTypeOfPicture
  233 + : ListTypeOfText;
234 234 return (
235 235 <DOM
236 236 file={file}
... ... @@ -288,9 +288,8 @@ const ListTypeOfText = ({
288 288 }
289 289 >
290 290 <div
291   - className={`ant-upload-list-item ant-upload-list-item-done ${
292   - file?.status === "error" ? "ant-upload-list-item-error" : ""
293   - } ant-upload-list-item-list-type-text`}
  291 + className={`ant-upload-list-item ant-upload-list-item-done ${file?.status === "error" ? "ant-upload-list-item-error" : ""
  292 + } ant-upload-list-item-list-type-text`}
294 293 >
295 294 <div className="ant-upload-list-item-info">
296 295 {file?.status === "uploading" ? (
... ... @@ -300,9 +299,8 @@ const ListTypeOfText = ({
300 299 </div>
301 300 <span
302 301 className="ant-upload-list-item-name"
303   - title={`${file?.name}(${
304   - file?.size ? getFileSize(file?.size) : ""
305   - })`}
  302 + title={`${file?.name}(${file?.size ? getFileSize(file?.size) : ""
  303 + })`}
306 304 >
307 305 {file?.name}({file?.size ? getFileSize(file?.size) : ""})
308 306 </span>
... ... @@ -405,9 +403,8 @@ const ListTypeOfPictureCard = ({
405 403 }
406 404 >
407 405 <div
408   - className={`ant-upload-list-item ant-upload-list-item-done ${
409   - file?.status === "error" ? "ant-upload-list-item-error" : ""
410   - } ant-upload-list-item-list-type-picture-card`}
  406 + className={`ant-upload-list-item ant-upload-list-item-done ${file?.status === "error" ? "ant-upload-list-item-error" : ""
  407 + } ant-upload-list-item-list-type-picture-card`}
411 408 >
412 409 <div className="ant-upload-list-item-info">
413 410 {file?.status === "uploading" ? (
... ... @@ -434,9 +431,8 @@ const ListTypeOfPictureCard = ({
434 431 src={IMGURL.showImage(
435 432 file?.thumbUrl || file?.response?.data
436 433 )}
437   - alt={`${file?.name}(${
438   - file?.size ? getFileSize(file?.size) : ""
439   - })`}
  434 + alt={`${file?.name}(${file?.size ? getFileSize(file?.size) : ""
  435 + })`}
440 436 className="ant-upload-list-item-image"
441 437 />
442 438 ) : (
... ... @@ -448,9 +444,8 @@ const ListTypeOfPictureCard = ({
448 444 style={{
449 445 display: file?.type?.includes("image") ? "none" : undefined,
450 446 }}
451   - title={`${file?.name}(${
452   - file?.size ? getFileSize(file?.size) : ""
453   - })`}
  447 + title={`${file?.name}(${file?.size ? getFileSize(file?.size) : ""
  448 + })`}
454 449 >
455 450 {file?.name}({file?.size ? getFileSize(file?.size) : ""})
456 451 </span>
... ... @@ -517,11 +512,9 @@ const ListTypeOfPicture = ({
517 512 }
518 513 >
519 514 <div
520   - className={`ant-upload-list-item ant-upload-list-item-done ${
521   - file?.status === "error" ? "ant-upload-list-item-error" : ""
522   - } ${
523   - file?.status === "uploading" ? "ant-upload-list-item-uploading" : ""
524   - } ant-upload-list-item-list-type-picture`}
  515 + className={`ant-upload-list-item ant-upload-list-item-done ${file?.status === "error" ? "ant-upload-list-item-error" : ""
  516 + } ${file?.status === "uploading" ? "ant-upload-list-item-uploading" : ""
  517 + } ant-upload-list-item-list-type-picture`}
525 518 >
526 519 <div className="ant-upload-list-item-info">
527 520 {file?.status === "uploading" ? (
... ... @@ -531,9 +524,8 @@ const ListTypeOfPicture = ({
531 524 </div>
532 525 <span
533 526 className="ant-upload-list-item-name"
534   - title={`${file?.name}(${
535   - file?.size ? getFileSize(file?.size) : ""
536   - })`}
  527 + title={`${file?.name}(${file?.size ? getFileSize(file?.size) : ""
  528 + })`}
537 529 >
538 530 {file?.name}({file?.size ? getFileSize(file?.size) : ""})
539 531 </span>
... ... @@ -563,9 +555,8 @@ const ListTypeOfPicture = ({
563 555 {file?.type?.includes("image") ? (
564 556 <img
565 557 src={IMGURL.showImage(file?.thumbUrl || file?.response?.data)}
566   - alt={`${file?.name}(${
567   - file?.size ? getFileSize(file?.size) : ""
568   - })`}
  558 + alt={`${file?.name}(${file?.size ? getFileSize(file?.size) : ""
  559 + })`}
569 560 className="ant-upload-list-item-image"
570 561 />
571 562 ) : (
... ... @@ -576,9 +567,8 @@ const ListTypeOfPicture = ({
576 567 target="_blank"
577 568 rel="noopener noreferrer"
578 569 className="ant-upload-list-item-name"
579   - title={`${file?.name}(${
580   - file?.size ? getFileSize(file?.size) : ""
581   - })`}
  570 + title={`${file?.name}(${file?.size ? getFileSize(file?.size) : ""
  571 + })`}
582 572 href={
583 573 file?.status === "error"
584 574 ? undefined
... ...
src/pages/admin/Role/entity.ts
1 1 /*
2 2 * @Date: 2021-07-14 10:54:47
3 3 * @LastEditors: wangqiang@feewee.cn
4   - * @LastEditTime: 2021-07-29 14:50:55
  4 + * @LastEditTime: 2023-02-27 17:18:17
5 5 */
6 6 export enum RoleTypeEnum {
7   - '系统角色' = 1,
8   - '流程角色',
9   - '功能角色'
  7 + "系统角色" = 1,
  8 + "流程角色",
  9 + "功能角色",
10 10 }
11 11  
12 12 export const roleTypeTag = {
13   - 1: 'geekblue',
14   - 2: 'purple',
15   - 3: 'orange'
  13 + 1: "geekblue",
  14 + 2: "purple",
  15 + 3: "orange",
16 16 };
17 17  
18 18 export const roleRange = [1, 2, 3, 4];
19 19 export const roleRangeType = {
20   - 1: '展厅',
21   - 2: '服务站',
22   - 3: '二手车店',
23   - 4: '租赁店',
  20 + 1: "展厅",
  21 + 2: "服务站",
  22 + 3: "二手车店",
  23 + 4: "租赁店",
24 24 };
25 25  
  26 +export enum EnumRoleRangeType {
  27 + "展厅" = 1,
  28 + "服务站",
  29 + "二手车店",
  30 + "租赁店",
  31 +}
  32 +
26 33 /** 角色输入类型 */
27 34 export enum RoleRangeTypeEnum {
28   - '允许' = 1,
29   - '不允许'
  35 + "允许" = 1,
  36 + "不允许",
30 37 }
31 38  
32 39 /** 角色用途枚举 */
33 40 export enum UseTypeEnum {
34   - '默认' = 1,
35   - '业务',
36   - '审批',
37   - '管理'
  41 + "默认" = 1,
  42 + "业务",
  43 + "审批",
  44 + "管理",
38 45 }
39 46  
40 47 /** 角色用途颜色枚举 */
41 48 export enum UseTypeColorEnum {
42   - '#4189FD' = 1,
43   - '#20C688',
44   - '#FF921C',
45   - '#F93939'
46   -}
47 49 \ No newline at end of file
  50 + "#4189FD" = 1,
  51 + "#20C688",
  52 + "#FF921C",
  53 + "#F93939",
  54 +}
... ...
src/pages/admin/Stand/StandGroup/components/EditModal.tsx
... ... @@ -20,20 +20,19 @@ export default function DetailModal() {
20 20 const [loading, setLoading] = useState<boolean>(false);
21 21 const [staffList, setStaffList] = useState<any>([]);
22 22 const [roleShop, setRoleShop] = useState<RoleShop>({});
23   - const [staffSelect, setStaffSelect] = useState<any>([]);
24 23 const [form] = Form.useForm();
25 24 const resetRef = useRef<any>(true);
26   - const [shopValue, setShopValue] = useState<any>();
  25 + // const [shopValue, setShopValue] = useState<any>();
27 26  
28 27 useEffect(() => {
29 28 if (visible && currentItem.id) {
30   - const _staff = currentItem?.staffList?.map((i:any) => i.staffId);
31   - setShopValue([currentItem.shopId]);
  29 + const _staff = currentItem?.staffList?.map((i:any) => ({value: i.staffId, label: i.staffName}));
  30 + // setShopValue([{value: currentItem.shopId, label: currentItem.shopName}]);
32 31 form.setFieldsValue({
33 32 name: currentItem.name,
34 33 roleCode: currentItem.roleCode,
35 34 roleName: currentItem.roleName,
36   - shop: [currentItem.shopId],
  35 + shop: [{value: currentItem.shopId, label: currentItem.shopName}],
37 36 staff: _staff,
38 37 });
39 38 setRoleShop({roleCode: currentItem.roleCode, roleName: currentItem.roleName, shopId: currentItem.shopId, shopName: currentItem.shopName});
... ... @@ -51,7 +50,6 @@ export default function DetailModal() {
51 50 } else {
52 51 setStaffList([]);
53 52 form.setFieldsValue({staff: []});
54   - setStaffSelect([]);
55 53 }
56 54 }, [roleShop.roleCode, roleShop.shopId]);
57 55  
... ... @@ -75,24 +73,22 @@ export default function DetailModal() {
75 73 setStaffList([]);
76 74 setRoleShop({});
77 75 setCurrentItem({});
78   - setStaffSelect([]);
79 76 resetRef.current = true;
80 77 }
81 78  
82 79 async function onFinish() {
83 80 const params = await form.validateFields();
84   - console.log('params', params);
85 81 setLoading(true);
86   - const _staff = staffSelect.map((v:any) => {
  82 + const _staff = params.staff.map((v:any) => {
87 83 const k = {
88 84 staffId: v.value,
89   - staffName: v.children
  85 + staffName: v.label
90 86 };
91 87 return k;
92 88 });
93 89 const _params: List = {
94   - shopId: params.shop.value,
95   - shopName: params.shop.label,
  90 + shopId: Array.isArray(params.shop)? params.shop[0].value: params.shop.value,
  91 + shopName: Array.isArray(params.shop)? params.shop[0].label: params.shop.label,
96 92 roleCode: params.roleCode,
97 93 roleName: roleShop.roleName,
98 94 staffList: _staff,
... ... @@ -167,7 +163,7 @@ export default function DetailModal() {
167 163 shopId: item.value || undefined,
168 164 shopName: item.label || undefined,
169 165 })}
170   - value={shopValue}
  166 + // value={shopValue}
171 167 />
172 168 </Form.Item>
173 169 <Form.Item
... ... @@ -216,7 +212,7 @@ export default function DetailModal() {
216 212 mode="multiple"
217 213 showArrow={false}
218 214 optionFilterProp="children"
219   - onChange={(key, value) => setStaffSelect(value)}
  215 + labelInValue
220 216 >
221 217 {staffList.length &&
222 218 staffList.map((item: any) => (
... ...
src/pages/capital/ReceiveRules/component/SelectGoodsTable.tsx
... ... @@ -74,6 +74,8 @@ const SelectGoodsTable = (props: Props) =&gt; {
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) =&gt; {
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 &#39;@/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/BearCostSetting/components/BearModal/index.tsx
... ... @@ -34,7 +34,7 @@ const BearModal = ({visible, onCancel, item = {} as BearCostSetting.Item}:Props)
34 34 dataSource={item.shareRateItemList || []}
35 35 rowKey={(item) => `${item.id}`}
36 36 >
37   - <Column title="门店/往来单位名称" dataIndex="name" render={(t) => t || "-"} />
  37 + <Column title="门店/往来单位" dataIndex="name" render={(t) => t || "-"} />
38 38 <Column title="分摊比例" dataIndex="shareRate" render={(t) => (t && `${(t*100).toFixed(2)}%`) || "-"} />
39 39  
40 40 </Table>
... ...
src/pages/contract/BearCostSetting/components/ShareRateItemlist/index.tsx
... ... @@ -128,7 +128,7 @@ const ShareRateItemlist = ({onChange, value=[]}:Props) =&gt; {
128 128 size="small"
129 129 >
130 130 <Column
131   - title="门店/往来单位名称"
  131 + title="门店/往来单位"
132 132 dataIndex="name"
133 133 width={200}
134 134 render={(t) => t || "-"}
... ... @@ -176,7 +176,7 @@ const ShareRateItemlist = ({onChange, value=[]}:Props) =&gt; {
176 176 onCancel={closeModal}
177 177 onOk={form.submit}
178 178 >
179   - <Form form={form} onFinish={handleItemSave}>
  179 + <Form form={form} labelCol={{span: '4'}} onFinish={handleItemSave}>
180 180 <Form.Item
181 181 label="对象类型:"
182 182 name="type"
... ... @@ -203,7 +203,7 @@ const ShareRateItemlist = ({onChange, value=[]}:Props) =&gt; {
203 203 </Select>
204 204 </Form.Item>
205 205 <Form.Item
206   - label={data?.type === 1 ? '门店名称': "往来单位"}
  206 + label={data?.type === 1 ? '门店': "往来单位"}
207 207 name="id"
208 208 rules={[{ required: true, message: '请选择缴费方式' }]}
209 209 >
... ... @@ -241,7 +241,7 @@ const ShareRateItemlist = ({onChange, value=[]}:Props) =&gt; {
241 241 name="shareRate"
242 242 rules={[{ required: true, message: '请输入缴费标识' }]}
243 243 >
244   - <InputNumber addonAfter="%" max={100} min={0} precision={2} />
  244 + <InputNumber placeholder="请填写" addonAfter="%" max={100} min={0} precision={2} />
245 245 </Form.Item>
246 246 <Form.Item
247 247 name="key"
... ...
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