Commit e8b0b5d97dfc44ef1b8b873f5f6b6c4bb9d8b0d6
Merge branch 'master' of gitlab.feewee.cn:FEV2/fw-cms into bug_fix
Showing
10 changed files
with
281 additions
and
14 deletions
config/routers/contract.ts
... | ... | @@ -75,4 +75,8 @@ export default [ |
75 | 75 | path: "/contract/kt/expressLogisticsArticle/setting", //快递物流物品配置 |
76 | 76 | component: "./contract/ExpressLogisticsArticleSetting", |
77 | 77 | }, |
78 | + { | |
79 | + path: "/contract/kt/laborDispatching", //劳务派遣配置 | |
80 | + component: "./contract/LaborDispatching", | |
81 | + } | |
78 | 82 | ]; | ... | ... |
src/pages/contract/LaborDispatching/api.ts
0 → 100644
1 | +import { http } from "@/typing/http"; | |
2 | +import request from "@/utils/request"; | |
3 | +import { CONTRACT_HOST } from "@/utils/host"; | |
4 | + | |
5 | +export interface PageParams{ | |
6 | + current?: number; | |
7 | + pageSize?: number; | |
8 | + placeName?:string;//服务地点名称 | |
9 | +} | |
10 | + | |
11 | +export interface Item { | |
12 | + id?:number;//id | |
13 | + placeType?:number;//服务地点类型,1门店、2食堂、3车辆库房、4配件库房 | |
14 | + placeId?:number;//服务地点id | |
15 | + placeName?:number;//服务地点名称 | |
16 | + address?:number;//派遣地点位置 | |
17 | + addressLng?:number;//劳务派遣地点位置经度 | |
18 | + addressLat?:number;//劳务派遣地点位置纬度 | |
19 | + wxQrCodeFid?:string;//小程序二维码文件id | |
20 | +} | |
21 | + | |
22 | +/** | |
23 | + * 分页查询快递收费标准 | |
24 | + */ | |
25 | + export function getLabourQrcodePage(params?: PageParams): http.PromisePageResp<Item> { | |
26 | + return request.get(`${CONTRACT_HOST}/erp/labour/qrcode/page`, { params }); | |
27 | +} | ... | ... |
src/pages/contract/LaborDispatching/components/Filter/index.tsx
0 → 100644
1 | +import React, { useState, memo } from "react"; | |
2 | +import { Row, Col, Input } from "antd"; | |
3 | +import _ from "lodash"; | |
4 | + | |
5 | +interface Props { | |
6 | + setParams:any; | |
7 | + innerParams:any; | |
8 | +} | |
9 | + | |
10 | +function Filter({ setParams, innerParams }:Props) { | |
11 | + const _onChange = _.debounce((val: string) => { | |
12 | + setParams({ placeName: val, current: 1 }, true); | |
13 | + }, 500); | |
14 | + return ( | |
15 | + <Row style={{flex: 1}}> | |
16 | + <Col span={8} style={{marginRight: 10}}> | |
17 | + <Input.Search | |
18 | + allowClear | |
19 | + placeholder="服务地点" | |
20 | + onChange={(e) => _onChange(e.target.value)} | |
21 | + style={{ maxWidth: 180, marginRight: 15 }} | |
22 | + /> | |
23 | + </Col> | |
24 | + </Row> | |
25 | + ); | |
26 | +} | |
27 | + | |
28 | +export default Filter; | |
0 | 29 | \ No newline at end of file | ... | ... |
src/pages/contract/LaborDispatching/index.tsx
0 → 100644
1 | +import React, { useState } from "react"; | |
2 | +import { Card, ConfigProvider, Table, Input } 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 Filter from './components/Filter'; | |
7 | +import * as API from './api'; | |
8 | +import _ from "lodash"; | |
9 | +import st from "./style.less"; | |
10 | + | |
11 | +interface Props { | |
12 | +} | |
13 | +enum PlaceType{ | |
14 | + '--' = 0, | |
15 | + '门店' = 1, | |
16 | + '食堂', | |
17 | + '车辆库房', | |
18 | + '配件库房' | |
19 | +} | |
20 | + | |
21 | +const { Column } = Table; | |
22 | + | |
23 | +function expressChargingStandard(props:Props) { | |
24 | + const { | |
25 | + list: LabourList, | |
26 | + loading, | |
27 | + paginationConfig, | |
28 | + innerParams, | |
29 | + setParams | |
30 | + } = usePagination<API.Item>(API.getLabourQrcodePage, {current: 1, pageSize: 10}); | |
31 | + const _onChange = _.debounce((val: string) => { | |
32 | + setParams({ placeName: val, current: 1 }, true); | |
33 | +}, 500); | |
34 | + return ( | |
35 | + <PageHeaderWrapper | |
36 | + title="派遣人员打卡二维码" | |
37 | + > | |
38 | + <ConfigProvider locale={zhCN}> | |
39 | + <Card className={st.page}> | |
40 | + <div className={st.header}> | |
41 | + <Input.Search | |
42 | + allowClear | |
43 | + placeholder="服务地点" | |
44 | + onChange={(e) => _onChange(e.target.value)} | |
45 | + style={{ maxWidth: 180, marginRight: 15 }} | |
46 | + /> | |
47 | + </div> | |
48 | + <Table | |
49 | + size="middle" | |
50 | + loading={loading} | |
51 | + dataSource={LabourList} | |
52 | + scroll={{ y: 800 }} | |
53 | + pagination={{ ...paginationConfig }} | |
54 | + rowKey={(item: API.Item) => `${item.id}`} | |
55 | + onChange={(_pagination) => setParams({ ..._pagination }, true)} | |
56 | + > | |
57 | + <Column title="服务地点" width={200} dataIndex="placeName" render={(t:any, item:API.Item) => `${t || '--'}(${PlaceType[item.placeType || 0]})`} /> | |
58 | + <Column title="位置" width={200} dataIndex="address" render={(t:any) => t || '-'} /> | |
59 | + <Column | |
60 | + title="打卡二维码" | |
61 | + width={200} | |
62 | + dataIndex="wxQrCodeFid" | |
63 | + render={(t:any, item:API.Item) => ( | |
64 | + <span> | |
65 | + <a title="点击下载二维码" href={`/api/file/download?fid=${item.wxQrCodeFid}`}> | |
66 | + 查看 | |
67 | + </a> | |
68 | + </span> | |
69 | + )} | |
70 | + /> | |
71 | + {/* <Column | |
72 | + title="操作" | |
73 | + width={100} | |
74 | + dataIndex="unit" | |
75 | + render={(text, row:API.Item) => ( | |
76 | + <span> | |
77 | + <Popconfirm title="是否编辑?" onConfirm={() => edit(row)} okText="确定" cancelText="取消"> | |
78 | + <a | |
79 | + onClick={(e) => { | |
80 | + e.preventDefault(); | |
81 | + }} | |
82 | + style={{ color: "#FAAD14" }} | |
83 | + > | |
84 | + 编辑 | |
85 | + </a> | |
86 | + </Popconfirm> | |
87 | + <Divider type="vertical" /> | |
88 | + <Popconfirm title="是否删除?" onConfirm={() => _delete(row)} okText="确定" cancelText="取消"> | |
89 | + <a | |
90 | + onClick={(e) => { | |
91 | + e.preventDefault(); | |
92 | + }} | |
93 | + style={{ color: "red" }} | |
94 | + > | |
95 | + 删除 | |
96 | + </a> | |
97 | + </Popconfirm> | |
98 | + </span> | |
99 | + | |
100 | + )} | |
101 | + /> */} | |
102 | + </Table> | |
103 | + </Card> | |
104 | + </ConfigProvider> | |
105 | + </PageHeaderWrapper> | |
106 | + ); | |
107 | +} | |
108 | + | |
109 | +export default expressChargingStandard; | |
0 | 110 | \ No newline at end of file | ... | ... |
src/pages/contract/LaborDispatching/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/LaborDispatching/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/order3/FinancialCreditMail/api.ts
1 | 1 | import { http } from '@/typing/http'; |
2 | 2 | import request from '@/utils/request'; |
3 | 3 | import { ORDER3, FINANCE2_HOST } from '@/utils/host'; |
4 | -import { common } from '@/typing/common'; | |
4 | +import { PageParams } from '@/typing/common'; | |
5 | 5 | |
6 | -interface Params extends common.PageParams { | |
6 | +interface Params extends PageParams { | |
7 | 7 | } |
8 | 8 | |
9 | 9 | interface FinParmas { |
... | ... | @@ -29,21 +29,21 @@ export interface Shop { |
29 | 29 | export interface SaveParam { |
30 | 30 | financeCompanyId?: number, // 金融公司id |
31 | 31 | financeCompanyName?: string, // 金融公司名称 |
32 | - shopInfo?: Shop[] | |
32 | + shopList?: Shop[] | |
33 | 33 | } |
34 | 34 | /** 信贷资料金融公司不邮寄列表 */ |
35 | 35 | export function getFinancialListApi(): http.PromiseResp<SaveParam[]> { |
36 | - return request.get(`${ORDER3}/erp/system/order/loan/material/post/config`); | |
36 | + return request.get(`${ORDER3}/erp/system/loan/material/post/config`); | |
37 | 37 | } |
38 | 38 | |
39 | 39 | /**保存信贷资料金融公司不邮寄 */ |
40 | 40 | export function saveFinancialApi(params: SaveParam): http.PromiseResp<any> { |
41 | - return request.post(`${ORDER3}/erp/system/order/loan/material/post/config/save`, params); | |
41 | + return request.post(`${ORDER3}/erp/system/loan/material/post/config/save`, params); | |
42 | 42 | } |
43 | 43 | |
44 | 44 | /**删除信贷资料金融公司不邮寄 */ |
45 | 45 | export function deleteFinancialApi(params : any): http.PromiseResp<any> { |
46 | - return request.post(`${ORDER3}/erp/system/order/loan/material/post/config/delete`, params, { contentType: 'form-urlencoded' }); | |
46 | + return request.post(`${ORDER3}/erp/system/loan/material/post/config/delete`, params, { contentType: 'form-urlencoded' }); | |
47 | 47 | } |
48 | 48 | /** 查询金融公司 */ |
49 | 49 | export function getCompanyList(params: FinParmas) : http.PromiseResp<CompanyList[]> { | ... | ... |
src/pages/order3/FinancialCreditMail/components/EditModal.tsx
... | ... | @@ -3,6 +3,7 @@ import { Modal, Button, message, Form, Select } from 'antd'; |
3 | 3 | import {useStore} from '../index'; |
4 | 4 | import {SaveParam, saveFinancialApi, Shop} from '../api'; |
5 | 5 | import _ from 'lodash'; |
6 | +import ShopSelectNew from '@/components/ShopSelectNew'; | |
6 | 7 | |
7 | 8 | export default function DetailModal() { |
8 | 9 | const {visible, setVisible, data, setLoading: setPageLoading, companyList, shopData, currentData, setIsEdit, isEdit} = useStore(); |
... | ... | @@ -15,8 +16,8 @@ export default function DetailModal() { |
15 | 16 | useEffect(() => { |
16 | 17 | if (visible && currentData.current) { |
17 | 18 | setFiancial({financeCompanyId: currentData.current.financeCompanyId, financeCompanyName: currentData.current.financeCompanyName}); |
18 | - setShop(currentData.current.shopInfo); | |
19 | - const _shop = currentData.current?.shopInfo.map((item: any) => item.shopId); | |
19 | + setShop(currentData.current.shopList); | |
20 | + const _shop = currentData.current?.shopList.map((item: any) => ({label: item.shopName, value: item.shopId})); | |
20 | 21 | form.setFieldsValue({ |
21 | 22 | shop: _shop || [], |
22 | 23 | company: currentData.current?.financeCompanyId || undefined |
... | ... | @@ -32,8 +33,9 @@ export default function DetailModal() { |
32 | 33 | |
33 | 34 | async function onFinish() { |
34 | 35 | const param = await form.validateFields(); |
36 | + const _shop = param.shop.map((v: any) => ({shopId: v.value, shopName: v.label})); | |
35 | 37 | setConfirmLoading(true); |
36 | - const params = {financeCompanyId: financial.financeCompanyId, financeCompanyName: financial.financeCompanyName, shopInfo: shop}; | |
38 | + const params = {financeCompanyId: financial.financeCompanyId, financeCompanyName: financial.financeCompanyName, shopList: _shop}; | |
37 | 39 | saveFinancialApi(params) |
38 | 40 | .then(res => { |
39 | 41 | message.success(res.result); |
... | ... | @@ -68,6 +70,7 @@ export default function DetailModal() { |
68 | 70 | maskClosable={false} |
69 | 71 | onCancel={handleCancel} |
70 | 72 | afterClose={form.resetFields} |
73 | + width="50%" | |
71 | 74 | footer={[ |
72 | 75 | <Button key="cancel" loading={confirmLoading} onClick={handleCancel} style={{marginLeft: 10}}>取消</Button>, |
73 | 76 | <Button key="submit" onClick={_.debounce(onFinish, 380)} type="primary" htmlType="submit" loading={confirmLoading}>确认</Button> |
... | ... | @@ -88,13 +91,14 @@ export default function DetailModal() { |
88 | 91 | </Select> |
89 | 92 | </Form.Item> |
90 | 93 | <Form.Item label="门店" rules={[{required: true, message: '请选择门店'}]} name="shop"> |
91 | - <Select allowClear mode="multiple" placeholder="请选择门店" showSearch optionFilterProp="label" onChange={(key, value) => _onChangeShop(key, value)}> | |
94 | + <ShopSelectNew defaultOptions={{bizTypes: "1"}} placeholder="请选择门店" multiple /> | |
95 | + {/* <Select allowClear mode="multiple" placeholder="请选择门店" showSearch optionFilterProp="label" onChange={(key, value) => _onChangeShop(key, value)}> | |
92 | 96 | {shopData.length > 0 && shopData.map(role => ( |
93 | 97 | <Select.Option key={role.id} value={role.id} label={role.name}> |
94 | 98 | {role.name} |
95 | 99 | </Select.Option> |
96 | 100 | ))} |
97 | - </Select> | |
101 | + </Select> */} | |
98 | 102 | </Form.Item> |
99 | 103 | </Form> |
100 | 104 | </Modal> | ... | ... |
src/pages/order3/FinancialCreditMail/components/List.tsx
1 | 1 | import React from 'react'; |
2 | 2 | import { Table, Popconfirm, message, Space } from 'antd'; |
3 | 3 | import { useStore } from '../index'; |
4 | -import {SaveParam, deleteFinancialApi} from '../api'; | |
4 | +import {SaveParam, deleteFinancialApi, Shop} from '../api'; | |
5 | 5 | |
6 | 6 | const Column = Table.Column; |
7 | 7 | |
... | ... | @@ -28,6 +28,13 @@ export default function LargeList() { |
28 | 28 | setVisible(true); |
29 | 29 | setIsEdit(true); |
30 | 30 | } |
31 | + | |
32 | + function renderShop(shopList: Shop[] = []) { | |
33 | + if (!shopList.length) { | |
34 | + return '--'; | |
35 | + } | |
36 | + return `${shopList[0].shopName}等${shopList.length}个门店`; | |
37 | + } | |
31 | 38 | return ( |
32 | 39 | <Table |
33 | 40 | dataSource={data || []} |
... | ... | @@ -36,7 +43,7 @@ export default function LargeList() { |
36 | 43 | pagination={false} |
37 | 44 | > |
38 | 45 | <Column title="金融公司" dataIndex="financeCompanyName" align="left" /> |
39 | - <Column title="适用门店" dataIndex="shopInfo" align="left" render={(_text, record) => <span style={{color: "#4189FD"}} onClick={() => lookShop(record)}>查看</span>} /> | |
46 | + <Column title="适用门店" dataIndex="shopList" align="left" render={(_text, record: any) => <span style={{color: "#4189FD", cursor: 'pointer'}} onClick={() => lookShop(record)}>{renderShop(record?.shopList)}</span>} /> | |
40 | 47 | <Column |
41 | 48 | title="操作" |
42 | 49 | align="center" | ... | ... |
src/pages/order3/FinancialCreditMail/components/ShopModal.tsx