Commit 56e705851a81bf125af4e4441be131ba69dcfcb4

Authored by 张志伟
2 parents 7458fc7c 0eec092c

Merge branch 'contract' into 'master'

Contract add:派遣人员打卡二维码

add:派遣人员打卡二维码

See merge request !247
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
... ...