Commit 3b164e709c2c44cd8ca5b4bdcd5a1ee85daf1a00

Authored by 舒述军
2 parents 4cbecaac 67f47de1

Merge branch 'master' into crm_fix

src/pages/attendance/Attend/subpages/AttendanceGroup/api.ts
1   -import { http,PromisePageResp } from "@/typing/http";
  1 +import { http, PromisePageResp } from "@/typing/http";
2 2 import request from "@/utils/request";
3 3 import { ATTENDANCE_HOST } from "@/utils/host";
4 4  
... ... @@ -70,10 +70,15 @@ export function saveApi(params?: Item): P<void> {
70 70 }
71 71  
72 72 interface BaseSettingItem {
73   - id?: number;
74   - noticeTime?: number; //待办提前通知时间(分钟)
75   - defectTime?: number; //严重迟到时间判定(分钟)
76   - lackTime?: number; //缺卡判定时间
  73 + id?: number; // 主键
  74 + groupId?: number; // 集团id
  75 + defectTime?: number; // 严重迟到时间判定(分钟)
  76 + onDutyNoticeTime?: number; // 上班待办提前通知时间(分钟)
  77 + offDutyNoticeTime?: number; // 下班待办延后通知时间(分钟)
  78 + onDutyLackTime?: number; // 上班缺卡时间判定(分钟)
  79 + offDutyLackTime?: number; // 下班缺卡时间判定(分钟)
  80 + outsideRemainingHour?: number; // 外勤结束时间离门店下班时间≤?小时不用打考勤卡
  81 + travelRemainingHour?: number; // 出差结束时间离门店下班时间≤?小时不用打考勤卡
77 82 }
78 83 /**获取考勤组基础设置
79 84 * /attendance/base/setting/get
... ...
src/pages/attendance/Attend/subpages/AttendanceGroup/components/TimeConfig.tsx
1   -import { Button, Form, InputNumber, message, Popconfirm, Radio, Row, Select } from "antd";
  1 +import { Button, Form, InputNumber, message, Popconfirm, Row } from "antd";
2 2 import React, { useEffect, useState } from "react";
3 3 import useInitial from "@/hooks/useInitail";
4   -import { fetchBaseSettingApi, saveOrUpdateApi } from "@/pages/attendance/Attend/subpages/AttendanceGroup/api";
  4 +import {
  5 + fetchBaseSettingApi,
  6 + saveOrUpdateApi,
  7 +} from "@/pages/attendance/Attend/subpages/AttendanceGroup/api";
5 8  
6 9 const FormItem = Form.Item;
7 10  
... ... @@ -49,7 +52,12 @@ export default function TimeConfig() {
49 52  
50 53 return (
51 54 <div>
52   - <Form form={form} onFinish={submit} labelCol={{ span: 6 }} wrapperCol={{ span: 15 }}>
  55 + <Form
  56 + form={form}
  57 + onFinish={submit}
  58 + labelCol={{ span: 6 }}
  59 + wrapperCol={{ span: 15 }}
  60 + >
53 61 <div
54 62 style={{
55 63 display: "flex",
... ... @@ -77,7 +85,8 @@ export default function TimeConfig() {
77 85 />
78 86 </FormItem>
79 87 <span style={{ marginLeft: 5 }}>
80   - 到应打卡时间 <span style={{ color: "#999999" }}>(除最后一次应打卡)</span>
  88 + 到应打卡时间{" "}
  89 + <span style={{ color: "#999999" }}>(除最后一次应打卡)</span>
81 90 </span>
82 91 </div>
83 92 </div>
... ... @@ -93,7 +102,10 @@ export default function TimeConfig() {
93 102 >
94 103 <span style={{ color: "#ff4d4f" }}>*</span> 最后一次应打卡时间要求:
95 104 <div>
96   - <span style={{ marginRight: 5, marginLeft: 5 }}> 应打卡时间延后</span>
  105 + <span style={{ marginRight: 5, marginLeft: 5 }}>
  106 + {" "}
  107 + 应打卡时间延后
  108 + </span>
97 109 <FormItem
98 110 name="offDutyNoticeTime"
99 111 label="打卡时间要求"
... ... @@ -108,7 +120,9 @@ export default function TimeConfig() {
108 120 disabled={!edit}
109 121 />
110 122 </FormItem>
111   - <span style={{ color: "#999999", marginLeft: 5 }}>(当天仅一次打卡不计此情况)</span>
  123 + <span style={{ color: "#999999", marginLeft: 5 }}>
  124 + (当天仅一次打卡不计此情况)
  125 + </span>
112 126 </div>
113 127 </div>
114 128  
... ... @@ -123,9 +137,17 @@ export default function TimeConfig() {
123 137 >
124 138 <span style={{ color: "#ff4d4f" }}>*</span> 严重迟到判定:
125 139 <div>
126   - <span style={{ marginLeft: 5, marginRight: 5 }}>在应打卡时间延后</span>
  140 + <span style={{ marginLeft: 5, marginRight: 5 }}>
  141 + 在应打卡时间延后
  142 + </span>
127 143  
128   - <FormItem name="defectTime" noStyle rules={[{ required: true, message: "请填写严重迟到时间判定(分钟)" }]}>
  144 + <FormItem
  145 + name="defectTime"
  146 + noStyle
  147 + rules={[
  148 + { required: true, message: "请填写严重迟到时间判定(分钟)" },
  149 + ]}
  150 + >
129 151 <InputNumber
130 152 min={0}
131 153 style={{ width: 200 }}
... ... @@ -147,7 +169,10 @@ export default function TimeConfig() {
147 169 >
148 170 <span style={{ color: "#ff4d4f" }}>*</span> 上班缺卡时间判定:
149 171 <div>
150   - <span style={{ marginRight: 5, marginLeft: 5 }}> 应打卡时间延后</span>
  172 + <span style={{ marginRight: 5, marginLeft: 5 }}>
  173 + {" "}
  174 + 应打卡时间延后
  175 + </span>
151 176 <FormItem
152 177 name="onDutyLackTime"
153 178 label="打卡时间要求"
... ... @@ -175,8 +200,14 @@ export default function TimeConfig() {
175 200 >
176 201 <span style={{ color: "#ff4d4f" }}>*</span> 下班缺卡时间判定:
177 202 <div>
178   - <span style={{ marginRight: 5, marginLeft: 5 }}>在应打卡时间延后</span>
179   - <FormItem name="offDutyLackTime" noStyle rules={[{ required: true, message: "请填写缺卡时间判定(分钟)" }]}>
  203 + <span style={{ marginRight: 5, marginLeft: 5 }}>
  204 + 在应打卡时间延后
  205 + </span>
  206 + <FormItem
  207 + name="offDutyLackTime"
  208 + noStyle
  209 + rules={[{ required: true, message: "请填写缺卡时间判定(分钟)" }]}
  210 + >
180 211 <InputNumber
181 212 min={0}
182 213 style={{ width: 200 }}
... ... @@ -188,6 +219,66 @@ export default function TimeConfig() {
188 219 <span style={{ marginLeft: 5 }}>后不允许打卡</span>
189 220 </div>
190 221 </div>
  222 + <div
  223 + style={{
  224 + display: "flex",
  225 + justifyContent: "flex-start",
  226 + alignItems: "center",
  227 + marginTop: 20,
  228 + paddingLeft: "20%",
  229 + }}
  230 + >
  231 + <span style={{ color: "#ff4d4f" }}>*</span> 外勤结束时间:
  232 + <div>
  233 + <span style={{ marginLeft: 5, marginRight: 5 }}>
  234 + 离门店下班时间提前
  235 + </span>
  236 + <FormItem
  237 + name="outsideRemainingHour"
  238 + noStyle
  239 + rules={[{ required: true, message: "请填写打卡时间要求" }]}
  240 + >
  241 + <InputNumber
  242 + min={0}
  243 + style={{ width: 200 }}
  244 + formatter={(value) => `${value}小时`}
  245 + parser={(value: any) => value.replace("小时", "")}
  246 + disabled={!edit}
  247 + />
  248 + </FormItem>
  249 + <span style={{ marginLeft: 5, marginRight: 5 }}>不用考勤打卡</span>
  250 + </div>
  251 + </div>
  252 + <div
  253 + style={{
  254 + display: "flex",
  255 + justifyContent: "flex-start",
  256 + alignItems: "center",
  257 + marginTop: 20,
  258 + paddingLeft: "20%",
  259 + }}
  260 + >
  261 + <span style={{ color: "#ff4d4f" }}>*</span> 出差结束时间:
  262 + <div>
  263 + <span style={{ marginLeft: 5, marginRight: 5 }}>
  264 + 离门店下班时间提前
  265 + </span>
  266 + <FormItem
  267 + name="travelRemainingHour"
  268 + noStyle
  269 + rules={[{ required: true, message: "请填写打卡时间要求" }]}
  270 + >
  271 + <InputNumber
  272 + min={0}
  273 + style={{ width: 200 }}
  274 + formatter={(value) => `${value}小时`}
  275 + parser={(value: any) => value.replace("小时", "")}
  276 + disabled={!edit}
  277 + />
  278 + </FormItem>
  279 + <span style={{ marginLeft: 5, marginRight: 5 }}>不用考勤打卡</span>
  280 + </div>
  281 + </div>
191 282 </Form>
192 283 <Row style={{ width: "80%", marginTop: 20 }} justify="center">
193 284 {!edit ? (
... ... @@ -196,7 +287,11 @@ export default function TimeConfig() {
196 287 </Button>
197 288 ) : (
198 289 <div>
199   - <Button type="primary" onClick={form.submit} loading={confirmLoading}>
  290 + <Button
  291 + type="primary"
  292 + onClick={form.submit}
  293 + loading={confirmLoading}
  294 + >
200 295 确定
201 296 </Button>
202 297 <Popconfirm
... ...
src/pages/attendance/Leave/components/Modal.tsx
... ... @@ -22,8 +22,9 @@ const CreateModal = (props: Props) =&gt; {
22 22 useEffect(() => {
23 23 if (visiable && type === 1) {
24 24 API.fetchDetail(1).then((res: any) => {
25   - setYear(res.data);
26   - setYearData(res.data.conditions);
  25 + const data = res.data || {};
  26 + setYear(data);
  27 + setYearData(data.conditions);
27 28 });
28 29 }
29 30 }, [visiable]);
... ... @@ -91,7 +92,7 @@ const CreateModal = (props: Props) =&gt; {
91 92 rules={[{ required: !(type === 1 || type === 8 || type === 6) }]}
92 93 hidden={type === 1 || type === 8 || type === 6 || type === 10}
93 94 >
94   - <InputNumber min={1} style={{ width: 200 }} />
  95 + <InputNumber min={1} style={{ width: 200 }} addonAfter="天" />
95 96 </FormItem>
96 97 <FormItem
97 98 name="annualWay"
... ... @@ -110,7 +111,7 @@ const CreateModal = (props: Props) =&gt; {
110 111 rules={[{ required: type === 1 }]}
111 112 hidden={!(type === 1)}
112 113 >
113   - <InputNumber min={1} style={{ width: 200 }} />
  114 + <InputNumber min={1} style={{ width: 200 }} addonAfter="天" />
114 115 </FormItem>
115 116 <FormItem
116 117 name="advanceDays"
... ... @@ -127,7 +128,7 @@ const CreateModal = (props: Props) =&gt; {
127 128 ]}
128 129 hidden={type === 3 || type === 8 || type === 5 || type === 10}
129 130 >
130   - <InputNumber min={1} style={{ width: 200 }} />
  131 + <InputNumber min={1} style={{ width: 200 }} addonAfter="天" />
131 132 </FormItem>
132 133 <FormItem
133 134 name="times"
... ... @@ -135,7 +136,7 @@ const CreateModal = (props: Props) =&gt; {
135 136 rules={[{ required: type === 6 || type === 8 }]}
136 137 hidden={!(type === 6 || type === 8)}
137 138 >
138   - <InputNumber min={1} style={{ width: 200 }} />
  139 + <InputNumber min={1} style={{ width: 200 }} addonAfter="次" />
139 140 </FormItem>
140 141 <FormItem
141 142 name="conditions"
... ...
src/pages/attendance/Leave/index.tsx
1   -import React, { useState } from 'react';
  1 +import React, { useState } from "react";
2 2 import { PageHeaderWrapper } from "@ant-design/pro-layout";
3   -import { Button, Card, Table } from 'antd';
4   -import * as TYPE from './entity';
5   -import Modal from './components/Modal';
6   -import useInitial from '@/hooks/useInitail';
7   -import * as API from './api';
  3 +import { Button, Card, Table } from "antd";
  4 +import * as TYPE from "./entity";
  5 +import Modal from "./components/Modal";
  6 +import useInitial from "@/hooks/useInitail";
  7 +import * as API from "./api";
8 8  
9 9 const Column = Table.Column;
10 10  
... ... @@ -13,7 +13,7 @@ const Leave = () =&gt; {
13 13 const [type, setType] = useState<number>(0);
14 14 const { data, setParams } = useInitial(API.fetchDetail, {}, type);
15 15  
16   - const onEdit = (record:any) => {
  16 + const onEdit = (record: any) => {
17 17 setParams(record.type, true);
18 18 setType(record.type);
19 19 setVisiable(true);
... ... @@ -40,10 +40,10 @@ const Leave = () =&gt; {
40 40 visiable={visiable}
41 41 setVisiable={setVisiable}
42 42 type={type}
43   - data={data}
  43 + data={data || {}}
44 44 />
45 45 </PageHeaderWrapper>
46 46 );
47 47 };
48 48  
49   -export default Leave;
50 49 \ No newline at end of file
  50 +export default Leave;
... ...
src/pages/finance/SpecialAccount/FinancingCompany/components/CreateModal.tsx
... ... @@ -10,7 +10,8 @@ const FormItem = Form.Item;
10 10 const { Option } = Select;
11 11  
12 12 export default function CreateModal() {
13   - const { visible, current, setCurrent, setVisible, fcList, accountList, setLoading, dealerId, brandList } = useStore();
  13 + const { visible, current, setCurrent, setVisible, fcList, accountList, setLoading, dealerId, brandList, type } =
  14 + useStore();
14 15 const [form] = Form.useForm();
15 16  
16 17 const [saveLoading, setSaveLoading] = useState<boolean>(false);
... ... @@ -76,6 +77,10 @@ export default function CreateModal() {
76 77 }
77 78  
78 79 function submit(fieldValue: any) {
  80 + if (fieldValue.depositAccount.value === fieldValue.account.value) {
  81 + message.error("还款保证金账户、一般账户请勿配置为同一账户", 1.5);
  82 + return;
  83 + }
79 84 const param = {
80 85 dealerId,
81 86 ...fieldValue,
... ... @@ -155,7 +160,7 @@ export default function CreateModal() {
155 160 {({ getFieldValue }): any => {
156 161 const category = getFieldValue("compCategory");
157 162 return category ? (
158   - <FormItem label="融资公司" name="fcComp" rules={[{ required: true, message: "请选择融资公司" }]}>
  163 + <FormItem label="往来银行" name="fcComp" rules={[{ required: true, message: "请选择往来银行" }]}>
159 164 <Select
160 165 showSearch
161 166 labelInValue
... ... @@ -185,7 +190,7 @@ export default function CreateModal() {
185 190 <Radio value={2}>每张票支付</Radio>
186 191 </Radio.Group>
187 192 </FormItem>
188   - <FormItem name="depositAccount" label="保证金账户">
  193 + <FormItem name="depositAccount" label="还款保证金账户">
189 194 <Select labelInValue placeholder="请选择账户" showSearch optionFilterProp="children" allowClear>
190 195 {accountList.map((item) => (
191 196 <Option key={item.id} value={item.id}>
... ...
src/pages/finance/SpecialAccount/FinancingCompany/components/Filter.tsx
... ... @@ -26,7 +26,6 @@ export default function AccountList() {
26 26 }}
27 27 >
28 28 <Row style={{ display: "flex", flex: 1, alignItems: 'center' }}>
29   - <div>商家:</div>
30 29 <Col span={6}>
31 30 <Select
32 31 placeholder="请选择商家"
... ... @@ -44,7 +43,6 @@ export default function AccountList() {
44 43 ))}
45 44 </Select>
46 45 </Col>
47   - <div style={{ marginLeft: 20 }}>品牌:</div>
48 46 <Col span={6}>
49 47 <Select
50 48 placeholder="请选择品牌"
... ...
src/pages/finance/SpecialAccount/FinancingCompany/components/List.tsx
... ... @@ -39,7 +39,7 @@ export default function SalesFinanceList() {
39 39 }
40 40 >
41 41 <span>
42   - 保证金&nbsp;&nbsp;
  42 + 还款保证金账户&nbsp;&nbsp;
43 43 <ExclamationCircleFilled style={{ color: "#40a9ff" }} />
44 44 </span>
45 45 </Popover>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/CondLaddersTable.tsx
... ... @@ -205,10 +205,11 @@ const LadderTable = ({ value, onChange, readOnly, visible, type, setladderVisibl
205 205 render: (value: number) => (value && value !== 65536 ? value + "%" : ""),
206 206 },
207 207 {
208   - title: "标准分",
  208 + title: "绩效分折算比例",
209 209 dataIndex: "scorePercent",
210 210 width: "15%",
211 211 editable: true,
  212 + render: (value: number) => value + "%",
212 213 },
213 214 {
214 215 title: "操作",
... ...
src/pages/performance/KpiGroupSetting/EditComfirm/components/CondLaddersTable.tsx
... ... @@ -202,13 +202,14 @@ const LadderTable = ({ value, onChange, readOnly, visible, type, setladderVisibl
202 202 dataIndex: "upper",
203 203 width: "20%",
204 204 editable: true,
205   - render: (value: number) => ((value && value !== 65536) ? (value + "%") : ""),
  205 + render: (value: number) => (value && value !== 65536 ? value + "%" : ""),
206 206 },
207 207 {
208   - title: "标准分",
  208 + title: "绩效分折算比例",
209 209 dataIndex: "scorePercent",
210 210 width: "15%",
211 211 editable: true,
  212 + render: (value: number) => value + "%",
212 213 },
213 214 {
214 215 title: "操作",
... ...
src/pages/pms/storage/partShop/components/PartShopModal.tsx
... ... @@ -29,7 +29,7 @@ export default function PartShopModal() {
29 29 });
30 30 }
31 31 }, [visible]);
32   -
  32 +
33 33 useEffect(() => {
34 34 if (isadd) {
35 35 setItem({});
... ... @@ -119,7 +119,7 @@ export default function PartShopModal() {
119 119 <InputNumber style={{ width: "100%" }} min={0} step={1} placeholder="总库存数量" disabled={isprice || isadd} />
120 120 </Item>
121 121 <Item label="锁定库存" name="lockStock" rules={[{ required: true, message: "请输入锁定库存" }, { validator: validatorLockStock }]}>
122   - <InputNumber style={{ width: "100%" }} min={0} step={1} placeholder="锁定库存" disabled={isprice || isadd} />
  122 + <InputNumber style={{ width: "100%" }} min={0} step={1} placeholder="锁定库存" disabled />
123 123 </Item>
124 124 {!!fw && !isprice && !isadd && (
125 125 <Item label="修改人" name="user" rules={[{ required: true, message: "请输入修改人" }]}>
... ...