12 changed files with 957 additions and 285 deletions
-
21demin.json
-
2src/components/TableModule/index.jsx
-
193src/pages/InRoadMgm/BusinessMgm/ChargeRules/EditModal.jsx
-
199src/pages/InRoadMgm/BusinessMgm/ChargeRules/FormModal.jsx
-
61src/pages/NewEnergy/ChargeDeviceMgm/ElectricModal/index.scss
-
203src/pages/NewEnergy/ChargeDeviceMgm/ElectricModal/loadable.jsx
-
6src/pages/NewEnergy/ChargeDeviceMgm/EquipmentSupplier/index.jsx
-
246src/pages/NewEnergy/ChargeDeviceMgm/EquipmentSupplier/index.scss
-
236src/pages/NewEnergy/ChargeDeviceMgm/EquipmentSupplier/loadable.jsx
-
13src/services/NewEnergy/ChargeDeviceMgm.js
-
32src/services/NewEnergy/EquipmentSupplier.js
-
2src/services/NewEnergy/index.js
@ -0,0 +1,21 @@ |
|||
{ |
|||
"status": 20000, |
|||
"messgae": "", |
|||
"data": { |
|||
"list": [ |
|||
{ |
|||
"producer_name": "供应商名称", |
|||
"code": "供应商组织结构代码", |
|||
"contacts": "联系人", |
|||
"phone": "联系电话" |
|||
}, |
|||
{ |
|||
"producer_name": "供应商名称", |
|||
"code": "供应商组织结构代码", |
|||
"contacts": "联系人", |
|||
"phone": "联系电话" |
|||
} |
|||
], |
|||
"total": 1000 |
|||
} |
|||
} |
@ -0,0 +1,6 @@ |
|||
import React from "react" |
|||
import loadable from "@loadable/component" |
|||
import { LoadingImg } from "@/components" |
|||
|
|||
const EquipmentSupplier = loadable(() => import("./loadable")) |
|||
export default (pros) => <EquipmentSupplier {...pros} fallback={<LoadingImg />} /> |
@ -0,0 +1,246 @@ |
|||
@import "@/assets/css/mixin.scss"; |
|||
$color-container-bg: var(--color-container-bg); |
|||
$color-user-list-bg: var(--color-user-list-bg); |
|||
$color-text: var(--color-text); |
|||
$color-primary: var(--color-primary); |
|||
|
|||
.ant-tabs { |
|||
margin-bottom: 16px; |
|||
|
|||
.ant-tabs-nav { |
|||
margin-bottom: 0 !important; |
|||
|
|||
&::before { |
|||
border-bottom: 1px solid var(--color-card-line) !important; |
|||
} |
|||
} |
|||
|
|||
.ant-tabs-nav-wrap { |
|||
width: 100%; |
|||
box-sizing: content-box; |
|||
|
|||
.ant-tabs-nav-list { |
|||
width: 340px; |
|||
|
|||
.ant-tabs-ink-bar { |
|||
height: 3px; |
|||
background-color: #00ccff; |
|||
} |
|||
|
|||
.ant-tabs-tab { |
|||
flex: 1; |
|||
width: 100%; |
|||
display: flex; |
|||
justify-content: center; |
|||
padding-bottom: 10px; |
|||
text-align: center; |
|||
cursor: pointer; |
|||
font-size: 14px !important; |
|||
font-family: MicrosoftYaHei; |
|||
text-align: center; |
|||
letter-spacing: 0.7px; |
|||
} |
|||
|
|||
.ant-tabs-tab-active { |
|||
div { |
|||
color: #00ccff; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.ant-input::-webkit-input-placeholder { |
|||
color: var(--color-placeholder); |
|||
} |
|||
|
|||
.ant-input::-moz-placeholder { |
|||
color: var(--color-placeholder); |
|||
} |
|||
.right-list .ant-btn-primary { |
|||
width: 68px; |
|||
height: 30px; |
|||
background: linear-gradient(180deg, #3aa9ff, #59b7ff); |
|||
border-radius: 4px; |
|||
} |
|||
.ant-input:-ms-input-placeholder { |
|||
color: var(--color-placeholder); |
|||
} |
|||
.right-list .cc-result-flow .table-wrap .yisa-table .ant-table-thead th { |
|||
background-color: #616b83 !important; |
|||
} |
|||
.right-list .cc-result-flow .table-wrap .yisa-table .ant-table-tbody td { |
|||
background-color: #3e4557 !important; |
|||
} |
|||
.right-list .cc-result-flow .table-wrap .yisa-table .ant-table-tbody tr:nth-child(even) td { |
|||
background-color: #3e4557 !important; |
|||
} |
|||
.ant-input::placeholder { |
|||
color: var(--color-placeholder); |
|||
} |
|||
|
|||
.ant-select-selection-placeholder { |
|||
color: var(--color-placeholder); |
|||
} |
|||
|
|||
.ant-select-disabled.ant-select-single:not(.ant-select-customize-input) .ant-select-selector { |
|||
background: var(--color-input-disabled-bg); |
|||
color: var(--color-placeholder); |
|||
} |
|||
|
|||
.ant-select-disabled .ant-select-arrow { |
|||
color: var(--color-placeholder); |
|||
} |
|||
|
|||
.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector { |
|||
background-color: var(--color-input-disabled-bg); |
|||
color: var(--color-input-disabled-color); |
|||
cursor: not-allowed; |
|||
} |
|||
|
|||
.ant-select-multiple { |
|||
.ant-select-selector { |
|||
.ant-select-selection-item { |
|||
background-color: var(--color-bg-body); |
|||
border-color: var(--color-border); |
|||
|
|||
.ant-select-selection-item-remove { |
|||
color: var(--color-text); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.ant-select-arrow { |
|||
color: var(--color-text); |
|||
} |
|||
|
|||
.ant-select-clear { |
|||
border-radius: 50%; |
|||
} |
|||
|
|||
.ant-select-dropdown-menu { |
|||
background-color: var(--color-input-bg); |
|||
|
|||
.ant-select-dropdown-menu-item { |
|||
color: var(--color-text); |
|||
|
|||
&.ant-select-dropdown-menu-item-active { |
|||
color: #fff; |
|||
// background-color: var(--radio-button-bg-checked); |
|||
} |
|||
|
|||
&.ant-select-dropdown-menu-item-selected { |
|||
color: #fff; |
|||
// background-color: var(--radio-button-bg-checked); |
|||
} |
|||
|
|||
&:hover { |
|||
color: #fff; |
|||
// background-color: var(--radio-button-bg-checked); |
|||
} |
|||
} |
|||
} |
|||
|
|||
.ant-select-selector { |
|||
background-color: var(--color-search-list-item-bg) !important; |
|||
box-shadow: none !important; |
|||
border-radius: 4px; |
|||
color: var(--color-search-list-item-value); |
|||
border-color: var(--color-search-list-item-bd) !important; |
|||
} |
|||
|
|||
.ant-select-selection { |
|||
background-color: var(--color-input-bg); |
|||
box-shadow: none; |
|||
color: var(--color-text); |
|||
// border-color:var(--checkable-tag-border); |
|||
} |
|||
|
|||
.ant-form-horizontal .ant-form-item-label { |
|||
label { |
|||
display: inline-block; |
|||
word-wrap: break-word; |
|||
white-space: normal; |
|||
} |
|||
} |
|||
|
|||
.ant-picker { |
|||
width: 100%; |
|||
background-color: var(--color-search-list-item-bg); |
|||
border-color: var(--color-border); |
|||
} |
|||
|
|||
.totalModal { |
|||
.ant-modal-footer { |
|||
display: none; |
|||
} |
|||
position: absolute; |
|||
top: 40px; |
|||
right: 174px; |
|||
} |
|||
.ltc-item-img { |
|||
width: 390px; |
|||
height: 300px; |
|||
border: 1px solid; |
|||
background: #6565656b; |
|||
margin-right: 20px !important; |
|||
img { |
|||
height: 295px; |
|||
width: 387px; |
|||
// object-fit: contain; |
|||
} |
|||
} |
|||
.hanleHistoyModal { |
|||
max-height: 700px; |
|||
overflow: auto; |
|||
} |
|||
.hanleHistoyModal::-webkit-scrollbar { |
|||
width: 5px; |
|||
} |
|||
.hanleHistoyModal::-webkit-scrollbar-thumb { |
|||
background-color: #9da2ab; |
|||
border-radius: 10px; |
|||
} |
|||
.modal-img { |
|||
img { |
|||
width: 200px; |
|||
height: 200px; |
|||
} |
|||
} |
|||
.electric-station-modal { |
|||
.add-station-body { |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
align-items: center; |
|||
.row { |
|||
width: 100%; |
|||
margin: 10px 0; |
|||
position: relative; |
|||
.redLogo{ |
|||
position: absolute; |
|||
left: 15px; |
|||
top: 7px; |
|||
} |
|||
} |
|||
.ele-style { |
|||
display: flex; |
|||
label { |
|||
line-height: 32px; |
|||
margin-left: 10px; |
|||
} |
|||
} |
|||
.cc-form-tree { |
|||
margin-bottom: 0; |
|||
} |
|||
.cc-form-content, |
|||
.form-select-single-content { |
|||
flex: auto; |
|||
} |
|||
.cc-form-name, |
|||
.form-select-single-name { |
|||
width: 100px; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,236 @@ |
|||
import React, { useState, useRef, useEffect } from "react"; |
|||
import { |
|||
message, |
|||
Modal, |
|||
Button, |
|||
} from "antd"; |
|||
import { utils } from "@/config/common"; |
|||
import ajax from "@/services"; |
|||
import { useSetState } from "ahooks" |
|||
import { TableModule, FormInput, FormSelect } from "@/components"; |
|||
import "./index.scss"; |
|||
|
|||
|
|||
function EquipmentSupplier() { |
|||
// 详情弹窗 |
|||
const [detailVisible, setDetailVisible] = useState(false); |
|||
// 列表数据 |
|||
const [tableData, setTableData] = useState([]); |
|||
// 数据总数 |
|||
const [total, setTotal] = useState(0); |
|||
const initAdd = { |
|||
supplier_id: "", |
|||
code: "", |
|||
contacts: "", |
|||
phone: "", |
|||
} |
|||
const [addFormData, setAddFormData] = useSetState(initAdd); |
|||
const [formData, setFormData] = useSetState({}); |
|||
const [getProducerList, setGetProducerList] = useState([]) |
|||
// 初始搜索条件 |
|||
const initFormData = { |
|||
supplier_id: "0", |
|||
contacts: "", |
|||
phone: "", |
|||
}; |
|||
|
|||
const columns = [ |
|||
{ |
|||
title: "供应商名称", |
|||
dataIndex: "producer_name", |
|||
key: "producer_name", |
|||
align: "center", |
|||
}, |
|||
{ |
|||
title: "供应商组织结构代码", |
|||
dataIndex: "code", |
|||
key: "code", |
|||
align: "center", |
|||
}, |
|||
{ |
|||
title: "联系人", |
|||
dataIndex: "contacts", |
|||
key: "contacts", |
|||
align: "center", |
|||
}, |
|||
{ |
|||
title: "联系电话", |
|||
dataIndex: "phone", |
|||
key: "phone", |
|||
align: "center", |
|||
} |
|||
]; |
|||
|
|||
const formSearch = [ |
|||
{ |
|||
name: "supplier_id", |
|||
type: "Select", |
|||
label: "设备供应商", |
|||
defaultValue: "0", |
|||
placeholder: "请选择设备生产商", |
|||
options: [ |
|||
{ value: "0", label: "全部" }, |
|||
...getProducerList |
|||
], |
|||
}, |
|||
{ |
|||
name: "contacts", |
|||
type: "Input", |
|||
label: "联系人", |
|||
placeholder: "请输入联系人", |
|||
}, |
|||
{ |
|||
name: "phone", |
|||
type: "Input", |
|||
label: "联系电话", |
|||
placeholder: "请输入联系电话", |
|||
}, |
|||
]; |
|||
|
|||
|
|||
// 检索 |
|||
const search = (params) => { |
|||
console.log(params); |
|||
utils.tableScrollTop("parent-table-scroll"); |
|||
ajax.getEquipList(params).then((res) => { |
|||
if (res.status === 20000) { |
|||
setFormData(params) |
|||
setTableData(res.data.list); |
|||
setTotal(res.data.total); |
|||
} else { |
|||
message.error(res.message) |
|||
} |
|||
}); |
|||
} |
|||
|
|||
const getHandleList = () => { |
|||
ajax.getSupplier().then((res) => { |
|||
if (res.status === 20000) { |
|||
setGetProducerList(res.data) |
|||
} else { |
|||
message.error(res.message) |
|||
} |
|||
}); |
|||
} |
|||
useEffect(() => { |
|||
getHandleList() |
|||
}, []) |
|||
const handelAdd = () => { |
|||
setDetailVisible(true) |
|||
setAddFormData(initAdd) |
|||
} |
|||
const handelOk = () => { |
|||
var numberRegex = /^[1][3,4,5,7,8][0-9]{9}$/; |
|||
var letterNumber = /^[0-9a-zA-Z]+$/; |
|||
var reg = /^[^\u4E00-\u9FFF]+$/; |
|||
if (addFormData.supplier_id === '') { |
|||
message.error('请选择设备供应商') |
|||
} else if (addFormData.code === '') { |
|||
message.error('请输入供应商组织结构代码') |
|||
} else if (!letterNumber.test(addFormData.code)) { |
|||
message.error('供应商组织结构代码只能输入英文和数字') |
|||
} else if (addFormData.contacts === '') { |
|||
message.error('请输入联系人') |
|||
} else if (reg.test(addFormData.contacts)) { |
|||
message.error('联系人只能输入汉字') |
|||
} else if (addFormData.phone === '') { |
|||
message.error('请输入联系电话') |
|||
} else if (!numberRegex.test(addFormData.phone)) { |
|||
message.error('请输入正确的联系电话') |
|||
}else { |
|||
ajax.addSupplier(addFormData).then((res) => { |
|||
if (res.status === 20000) { |
|||
message.success("新增成功") |
|||
setDetailVisible(false); |
|||
setAddFormData(initAdd) |
|||
search(formData) |
|||
} else { |
|||
message.error(res.message) |
|||
} |
|||
}); |
|||
} |
|||
|
|||
} |
|||
return ( |
|||
<> |
|||
<TableModule |
|||
showSerial={true} |
|||
isExport={false} |
|||
diyButton={ |
|||
<Button |
|||
type="primary" |
|||
onClick={handelAdd} |
|||
> |
|||
新增 |
|||
</Button> |
|||
} |
|||
columns={columns} |
|||
tableData={tableData} |
|||
formSearch={formSearch} |
|||
pagename="电桩型号" |
|||
pageName={'EquipmentSupplier'} |
|||
initFormData={initFormData} |
|||
total={total} |
|||
search={search} |
|||
exportUrl="/api/bpm/record/get_record_export" |
|||
/> |
|||
<Modal |
|||
title="新增电桩型号" |
|||
open={detailVisible} |
|||
width={500} |
|||
className="electric-station-modal" |
|||
onCancel={() => { |
|||
setDetailVisible(false); |
|||
}} |
|||
onOk={handelOk} |
|||
destroyOnClose |
|||
> |
|||
<div className="add-station-body"> |
|||
<div className="row "> |
|||
<div className="redLogo">*</div> |
|||
<FormSelect |
|||
yisaLabel="设备生产号" |
|||
placeholder="请选择设备生产号" |
|||
yisaData={getProducerList} |
|||
defaultValue={addFormData.supplier_id || null} |
|||
hasUnlimited={false} |
|||
onChange={e => { setAddFormData({ supplier_id: e }) }} |
|||
/> |
|||
</div> |
|||
<div className="row"> |
|||
<div className="redLogo" style={{left:-9}}>*</div> |
|||
<FormInput |
|||
yisaLabel="供应商组织结构代码" |
|||
placeholder="请输入供应商组织结构代码" |
|||
isShowAfterIcon={false} |
|||
value={addFormData.code} |
|||
onChange={e => { setAddFormData({ code: e.target.value }) }} |
|||
/> |
|||
</div> |
|||
<div className="row"> |
|||
<div className="redLogo" style={{left:40}}>*</div> |
|||
<FormInput |
|||
yisaLabel="联系人" |
|||
placeholder="请输入联系人" |
|||
isShowAfterIcon={false} |
|||
value={addFormData.contacts} |
|||
onChange={e => { setAddFormData({ contacts: e.target.value }) }} |
|||
/> |
|||
</div> |
|||
<div className="row"> |
|||
<div className="redLogo" style={{left:28}}>*</div> |
|||
<FormInput |
|||
yisaLabel="联系电话" |
|||
placeholder="请输入联系电话" |
|||
isShowAfterIcon={false} |
|||
value={addFormData.phone} |
|||
onChange={e => { setAddFormData({ phone: e.target.value }) }} |
|||
/> |
|||
</div> |
|||
</div> |
|||
</Modal> |
|||
</> |
|||
); |
|||
} |
|||
|
|||
export default EquipmentSupplier; |
@ -0,0 +1,32 @@ |
|||
import ajax from "@/config/ajax" |
|||
// 充电站管理
|
|||
// 获取列表数据
|
|||
const getEquipList = (params) => { |
|||
return ajax({ |
|||
url: "/api/nes/device/supplier_list", |
|||
type: "post", |
|||
data: params, |
|||
}); |
|||
}; |
|||
// 获取站点状态
|
|||
const getSupplier = (params) => { |
|||
return ajax({ |
|||
url: "/api/nes/device/supplier_down", |
|||
type: "get", |
|||
data: params, |
|||
}); |
|||
}; |
|||
// 新增充电站
|
|||
const addSupplier = (params) => { |
|||
return ajax({ |
|||
url: "/api/nes/device/supplier_add", |
|||
type: "post", |
|||
data: params, |
|||
}); |
|||
}; |
|||
|
|||
export default{ |
|||
getSupplier, |
|||
getEquipList, |
|||
addSupplier |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue