23 changed files with 5202 additions and 491 deletions
-
2scripts/webpack.dev.js
-
BINsrc/assets/images/status_err.png
-
BINsrc/assets/images/status_normal.png
-
BINsrc/assets/images/warningIcon.png
-
2src/components/form/FormInput/index.jsx
-
21src/components/form/FormSelect/index.jsx
-
2src/components/form/FormSelectionBox/index.jsx
-
216src/pages/MerchantMgm/FunctionMgm/index.scss
-
1407src/pages/MerchantMgm/FunctionMgm/loadable.jsx
-
337src/pages/MerchantMgm/InvoiceConf/index.scss
-
1029src/pages/MerchantMgm/InvoiceConf/loadable.jsx
-
317src/pages/MerchantMgm/MerchantAdmin/index.scss
-
871src/pages/MerchantMgm/MerchantAdmin/loadable.jsx
-
255src/pages/MerchantMgm/MerchantInfo/index.scss
-
434src/pages/MerchantMgm/MerchantInfo/loadable.jsx
-
8src/router/menu-bk.js
-
6src/router/menu.js
-
90src/services/MerchantMgm/InvoiceConf/index.js
-
65src/services/MerchantMgm/MerchantAdmin/index.js
-
55src/services/MerchantMgm/MerchantInfo/index.js
-
31src/services/MerchantMgm/functionMgm/index.js
-
39src/services/MerchantMgm/index.js
After Width: 32 | Height: 32 | Size: 664 B |
After Width: 32 | Height: 32 | Size: 943 B |
After Width: 32 | Height: 32 | Size: 702 B |
1407
src/pages/MerchantMgm/FunctionMgm/loadable.jsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1029
src/pages/MerchantMgm/InvoiceConf/loadable.jsx
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,15 +1,866 @@ |
|||||
import React, { useState, useRef, useEffect } from "react"; |
import React, { useState, useRef, useEffect } from "react"; |
||||
// import { message, Pagination, Table, Space, Modal, } from "antd"; |
|
||||
// import { dictionary, utils } from "@/config/common"; |
|
||||
// import moment from 'moment' |
|
||||
// import { useSessionStorageState, useUpdateEffect, useSize, useUpdate } from 'ahooks'; |
|
||||
// import ajax from "@/services" |
|
||||
// import { FormInput, FormSelect, OptionPanel, ResultPanel, FormSliderPicker, AreaCascader, ImgResize, ImgZoom, } from "@/components" |
|
||||
// import "./index.scss"; |
|
||||
// import errorImg from "@/assets/images/layout/error.png" |
|
||||
// import { useLocation } from "react-router-dom"; |
|
||||
|
import { Input, Select, message, Popover, Pagination, Table, Form, Radio, Modal, Button } from "antd"; |
||||
|
import { pageSizeOptions } from '@/config/character.config.js' |
||||
|
import moment from 'moment' |
||||
|
import { useSetState } from 'ahooks'; |
||||
|
import ajax from "@/services" |
||||
|
import "./index.scss"; |
||||
|
import status_normal from '@/assets/images/status_normal.png' |
||||
|
import status_err from '@/assets/images/status_err.png' |
||||
|
import warningIcon from "@/assets/images/warningIcon.png"; |
||||
|
import { SearchOutlined} from '@ant-design/icons'; |
||||
|
|
||||
function MerchantAdmin() { |
function MerchantAdmin() { |
||||
return <div>MerchantAdmin</div> |
|
||||
|
//默认 |
||||
|
const parameter = { |
||||
|
id: 1, |
||||
|
operatorid: '',//商户ID |
||||
|
shop_name: '',//商户名称 |
||||
|
manage_type: '',//经营业务类型 |
||||
|
manage_type_name: "",//经营业务类型 |
||||
|
account: "",//管理员账号 |
||||
|
username: "",//姓名 |
||||
|
phone: "",//电话 |
||||
|
email: "",//邮箱 |
||||
|
sex: "",//性别 |
||||
|
status: 0,//状态 |
||||
|
create_time: "",//创建时间 |
||||
|
start: moment().subtract(90, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'), |
||||
|
end: moment().format('YYYY-MM-DD HH:mm:ss'), |
||||
|
pn: 1, |
||||
|
page_size: Number(pageSizeOptions[0]), // 每页条数 |
||||
|
} |
||||
|
//商户名称下拉 |
||||
|
const [tenantPull, setTenantPull] = useState([]) |
||||
|
//等待状态 |
||||
|
const [loading, setLoading] = useState(false) // 等待状态 |
||||
|
//表格数据 |
||||
|
const [tableData, setTableData] = useState([]) |
||||
|
//检索表单 |
||||
|
const [formData, setFormData] = useSetState(parameter) |
||||
|
const [lastFormData, setLastFormData] = useState(formData) |
||||
|
const lastFormDataRef = useRef(formData) |
||||
|
|
||||
|
const [searchForm] = Form.useForm() |
||||
|
//是否第一次检索表单 |
||||
|
const [isFirst,setIsFirst]=useState(false) |
||||
|
//查看表单记录 |
||||
|
const [records, setRecords] = useState({}) |
||||
|
//总条数 |
||||
|
const [total, setTotal] = useState() |
||||
|
//创建管理员开关 |
||||
|
const [createVisible, setCreateVisible] = useState(false) |
||||
|
//编辑开关 |
||||
|
const [updateVisible, setUpdateVisible] = useState(false) |
||||
|
//查看开关 |
||||
|
const [checkVisible, setCheckVisible] = useState(false) |
||||
|
//编辑表单 |
||||
|
const [updateForm] = Form.useForm() |
||||
|
//性别单选 |
||||
|
const [sexValue, setSexValue] = useState(1); |
||||
|
//重置密码确认框 |
||||
|
const [confirm, setConfirm] = useState(false) |
||||
|
//禁用确认框 |
||||
|
const [banBtn, setBanBtn] = useState(false) |
||||
|
//启用确认框 |
||||
|
const [startBtn, setStartBtn] = useState(false) |
||||
|
//id |
||||
|
const [ID, setID] = useState() |
||||
|
//表头 |
||||
|
const columns = [ |
||||
|
{ |
||||
|
title: '序号', |
||||
|
dataIndex: 'id', |
||||
|
key: 'id', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '商户名称', |
||||
|
key: 'shop_name', |
||||
|
dataIndex: 'shop_name', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '经营业务类型', |
||||
|
key: 'manage_type_name', |
||||
|
dataIndex: 'manage_type_name', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '管理员账号', |
||||
|
key: 'account', |
||||
|
dataIndex: 'account', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '管理员姓名', |
||||
|
key: 'username', |
||||
|
dataIndex: 'username', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '手机号', |
||||
|
key: 'phone', |
||||
|
dataIndex: 'phone', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '邮箱', |
||||
|
key: 'email', |
||||
|
dataIndex: 'email', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '性别', |
||||
|
key: 'sex_status_name', |
||||
|
dataIndex: 'sex_status_name', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '添加时间', |
||||
|
key: 'create_time', |
||||
|
dataIndex: 'create_time', |
||||
|
align: "center", |
||||
|
}, |
||||
|
{ |
||||
|
title: '状态', |
||||
|
key: 'user_status_name', |
||||
|
dataIndex: 'user_status_name', |
||||
|
align: "center", |
||||
|
render: (value, row, index) => { |
||||
|
return ( |
||||
|
<> |
||||
|
{ |
||||
|
row.user_status == 1 ? |
||||
|
<img src={status_normal}></img> : |
||||
|
<img src={status_err}></img> |
||||
|
} |
||||
|
</> |
||||
|
) |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
key: 'operation', |
||||
|
dataIndex: 'operation', |
||||
|
align: "center", |
||||
|
render: (text, record, index) => { |
||||
|
return <> |
||||
|
<Popover content={ |
||||
|
<div className="operateBtn" style={{ cursor: "pointer" }} trigger="hover"> |
||||
|
<div onClick={() => { checkBtn(index) }}>详情</div> |
||||
|
<div onClick={() => { resetPassWordBtn(index) }}>重置密码</div> |
||||
|
{ |
||||
|
record.user_status == 2 ? |
||||
|
<> |
||||
|
<div onClick={() => { updateBtn(record) }}>编辑</div> |
||||
|
<div onClick={() => { stopBtn(record) }}>启用</div> |
||||
|
</> : <div onClick={() => { stopBtn(record) }}>停用</div> |
||||
|
} |
||||
|
</div>}> |
||||
|
<button className="scheduleBtn">操作</button> |
||||
|
</Popover> |
||||
|
</> |
||||
|
}, |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
//状态类型下拉框 |
||||
|
const statusType = [ |
||||
|
{ |
||||
|
label: "全部", |
||||
|
value: 0 |
||||
|
}, |
||||
|
{ |
||||
|
label: "启用", |
||||
|
value: 1 |
||||
|
}, |
||||
|
{ |
||||
|
label: "禁用", |
||||
|
value: 2 |
||||
|
}, |
||||
|
] |
||||
|
|
||||
|
//获取商户名称的下拉 |
||||
|
const getTenantNamePull = () => { |
||||
|
ajax.getTenantPull().then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
setTenantPull(res.data) |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
} |
||||
|
).catch( |
||||
|
err => { console.log(err); } |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
//获取表格数据 |
||||
|
const getTable = () => { |
||||
|
const value =searchForm.getFieldsValue(["shop_name","phone","username","account","status"]) |
||||
|
console.log(value); |
||||
|
setLoading(true) |
||||
|
ajax.getMerchantAdminTable(value).then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
setTableData(res.data.list) |
||||
|
setTotal(res.data.total_records) |
||||
|
setIsFirst(true) |
||||
|
if (banBtn) { |
||||
|
setTimeout( |
||||
|
() => { |
||||
|
message.success("禁用成功", 2.5) |
||||
|
}, 1000 |
||||
|
) |
||||
|
setBanBtn(false) |
||||
|
} |
||||
|
if (startBtn) { |
||||
|
setTimeout( |
||||
|
() => { |
||||
|
message.success("启用成功", 2.5) |
||||
|
}, 1000 |
||||
|
) |
||||
|
setStartBtn(false) |
||||
|
} |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
setLoading(false) |
||||
|
} |
||||
|
).catch( |
||||
|
(err) => { |
||||
|
console.log(err) |
||||
|
} |
||||
|
) |
||||
|
} |
||||
|
|
||||
|
//搜索数据 |
||||
|
const getSearchData = () => { |
||||
|
getTable() |
||||
|
} |
||||
|
|
||||
|
//重置数据 |
||||
|
const getResetData = () => { |
||||
|
searchForm.setFieldsValue( |
||||
|
{ |
||||
|
shop_name: '', |
||||
|
phone: '', |
||||
|
account: '', |
||||
|
username: '', |
||||
|
status: 0 |
||||
|
} |
||||
|
) |
||||
|
if(isFirst){ |
||||
|
getTable() |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//切换分页 |
||||
|
const changePn = (pn, length) => { |
||||
|
if (lastFormData.page_size === length) { |
||||
|
setLastFormData(Object.assign({}, lastFormData, { pn: pn })) |
||||
|
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: pn }) |
||||
|
getTable(Object.assign({}, lastFormData, { pn: pn })) |
||||
|
} |
||||
|
} |
||||
|
//切换每页条数 |
||||
|
const changeLength = (pn, length) => { |
||||
|
setFormData(Object.assign({}, formData, { pn: 1, page_size: length })) |
||||
|
setLastFormData(Object.assign({}, lastFormData, { pn: 1, page_size: length })) |
||||
|
lastFormDataRef.current = Object.assign({}, lastFormData, { pn: 1, page_size: length }) |
||||
|
getTable(Object.assign({}, lastFormData, { pn: 1, page_size: length })) |
||||
|
} |
||||
|
|
||||
|
//创建管理员 |
||||
|
const createData = () => { |
||||
|
setCreateVisible(true) |
||||
|
updateForm.setFieldsValue( |
||||
|
{ |
||||
|
shop_name: '', |
||||
|
phone: '', |
||||
|
account: '', |
||||
|
_name: '', |
||||
|
email: '', |
||||
|
sex_status: '' |
||||
|
} |
||||
|
) |
||||
|
} |
||||
|
//点击取消-返回上一层 |
||||
|
const createOncancel = () => { |
||||
|
setCreateVisible(false) |
||||
|
setUpdateVisible(false) |
||||
|
setCheckVisible(false) |
||||
|
} |
||||
|
|
||||
|
//编辑管理员-提交按钮 |
||||
|
const submitUpdate = () => { |
||||
|
const value = updateForm.getFieldsValue(['shop_name', 'phone', 'name', 'account', 'email', 'sex_status']) |
||||
|
ajax.updateMerchantAdmin(value).then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
setCreateVisible(false) |
||||
|
setUpdateVisible(false) |
||||
|
message.success("已提交", 2.5) |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
} |
||||
|
).catch( |
||||
|
err => { |
||||
|
console.log(err); |
||||
|
} |
||||
|
) |
||||
|
|
||||
|
} |
||||
|
//创建新管理员-提交按钮 |
||||
|
const submitAdd = () => { |
||||
|
const value = updateForm.getFieldsValue(['shop_name', 'phone', '_name', 'account', 'email', 'sex_status']) |
||||
|
ajax.addMerchantAdmin(value).then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
setCreateVisible(false) |
||||
|
setUpdateVisible(false) |
||||
|
message.success("已提交", 2.5) |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
} |
||||
|
).catch( |
||||
|
err => { |
||||
|
console.log(err); |
||||
|
} |
||||
|
) |
||||
|
|
||||
|
} |
||||
|
//编辑 |
||||
|
function updateBtn(record) { |
||||
|
setUpdateVisible(true) |
||||
|
setFormData(record) |
||||
|
//数据回显 |
||||
|
updateForm.setFieldsValue( |
||||
|
{ |
||||
|
shop_name: record.shop_name, |
||||
|
phone: record.phone, |
||||
|
account: record.account, |
||||
|
_name: record.username, |
||||
|
email: record.email, |
||||
|
sex_status: parseInt(record.sex_status) |
||||
|
} |
||||
|
) |
||||
|
|
||||
|
} |
||||
|
//查看 |
||||
|
function checkBtn(index) { |
||||
|
setCheckVisible(true) |
||||
|
ajax.checkMerchantAdmin(index).then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
setRecords(res.data) |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
} |
||||
|
).catch( |
||||
|
err => { console.log(err); } |
||||
|
) |
||||
|
} |
||||
|
//启用/停用 |
||||
|
function stopBtn(record) { |
||||
|
if (record.user_status == 1) { |
||||
|
//禁用 |
||||
|
setBanBtn(true) |
||||
|
} else { |
||||
|
//启用 |
||||
|
setStartBtn(true) |
||||
|
} |
||||
|
setID(record.id) |
||||
|
} |
||||
|
|
||||
|
const handleAdminStatus = () => { |
||||
|
ajax.updateAdminStatus(ID).then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
getTable() |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
} |
||||
|
).catch( |
||||
|
err => { |
||||
|
console.log(err); |
||||
|
} |
||||
|
) |
||||
|
} |
||||
|
//重置密码 |
||||
|
const resetPassWordBtn = (index) => { |
||||
|
setConfirm(true) |
||||
|
setID(index) |
||||
|
} |
||||
|
|
||||
|
const handleReset = () => { |
||||
|
ajax.resetPassWord(ID).then( |
||||
|
res => { |
||||
|
if (res.status == 20000) { |
||||
|
getTable() |
||||
|
setConfirm(false) |
||||
|
message.success("重置成功", 2.5) |
||||
|
} else { |
||||
|
message.error(res.message) |
||||
|
} |
||||
|
} |
||||
|
).catch( |
||||
|
err => { console.log(err); } |
||||
|
) |
||||
|
} |
||||
|
//关闭重置密码确认框,关闭禁用确认框 |
||||
|
const handleCancel = () => { |
||||
|
setConfirm(false) |
||||
|
setBanBtn(false) |
||||
|
setStartBtn(false) |
||||
|
message.warning("已取消操作", 2.5) |
||||
|
} |
||||
|
|
||||
|
//性别单选框改变 |
||||
|
const onChange = (e) => { |
||||
|
setSexValue(e.target.value); |
||||
|
}; |
||||
|
//新增--商户名选择搜索框 |
||||
|
const filterOption = (input, option) => |
||||
|
(option?.label ?? '').toLowerCase().includes(input.toLowerCase()); |
||||
|
|
||||
|
useEffect( |
||||
|
() => { |
||||
|
getTenantNamePull() |
||||
|
}, [] |
||||
|
) |
||||
|
return ( |
||||
|
<div id="MerchantAdmin" > |
||||
|
{ |
||||
|
!createVisible && !updateVisible && !checkVisible ? |
||||
|
<> |
||||
|
<div className="panel"> |
||||
|
<div className="panel-1"> |
||||
|
<Form |
||||
|
form={searchForm} |
||||
|
layout="inline" |
||||
|
> |
||||
|
<Form.Item |
||||
|
label="商户名称:" |
||||
|
name="shop_name" |
||||
|
className="search-form" |
||||
|
> |
||||
|
<Select |
||||
|
className="yisa-select" |
||||
|
options={tenantPull} |
||||
|
placeholder="请选择" |
||||
|
/> |
||||
|
</Form.Item> |
||||
|
<Form.Item |
||||
|
label="手机号:" |
||||
|
name="phone" |
||||
|
className="search-form" |
||||
|
rules={[ |
||||
|
{ |
||||
|
validator: (rule, value) => { |
||||
|
let reg = new RegExp(/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/); |
||||
|
if (!reg.test(value)) { |
||||
|
return Promise.reject('手机号码不合法'); |
||||
|
} else { |
||||
|
return Promise.resolve(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
]} |
||||
|
> |
||||
|
<Input |
||||
|
placeholder="请输入手机号" |
||||
|
/> |
||||
|
</Form.Item> |
||||
|
<Form.Item |
||||
|
label="姓名:" |
||||
|
name="username" |
||||
|
className="search-form" |
||||
|
> |
||||
|
<Input |
||||
|
placeholder="请输入姓名" |
||||
|
/> |
||||
|
</Form.Item> |
||||
|
</Form> |
||||
|
</div> |
||||
|
<div className="panel-2"> |
||||
|
<Form |
||||
|
form={searchForm} |
||||
|
layout="inline" |
||||
|
initialValues={{ |
||||
|
status: statusType[0].value, |
||||
|
}} |
||||
|
> |
||||
|
<Form.Item |
||||
|
label="管理员账号:" |
||||
|
name="account" |
||||
|
className="search-form" |
||||
|
rules={[ |
||||
|
{ |
||||
|
validator: (rule, value) => { |
||||
|
let reg = new RegExp(/^[0-9]+$/); |
||||
|
if (!reg.test(value)) { |
||||
|
return Promise.reject('管理员账号不合法'); |
||||
|
} else { |
||||
|
return Promise.resolve(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
]} |
||||
|
> |
||||
|
<Input |
||||
|
className="form-input" |
||||
|
placeholder="请输入管理员账号" |
||||
|
// onBlur={handleBlurNumber} |
||||
|
/> |
||||
|
</Form.Item> |
||||
|
<Form.Item |
||||
|
label="状态:" |
||||
|
name="status" |
||||
|
className="search-form" |
||||
|
> |
||||
|
<Select |
||||
|
className="yisa-select" |
||||
|
options={statusType} |
||||
|
placeholder="请选择" |
||||
|
/> |
||||
|
</Form.Item> |
||||
|
<Form.Item |
||||
|
className="btnBox" |
||||
|
> |
||||
|
<Button type="primary" className="search-btn btn" icon={<SearchOutlined />} onClick={() => { getSearchData() }}> |
||||
|
搜索 |
||||
|
</Button> |
||||
|
<Button type="primary" className="reset-btn btn" onClick={() => { getResetData() }}> |
||||
|
条件重置 |
||||
|
</Button> |
||||
|
<Button type="primary" className="create-btn btn" onClick={() => { createData() }}> |
||||
|
创建用户 |
||||
|
</Button> |
||||
|
</Form.Item> |
||||
|
</Form> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<Table |
||||
|
columns={columns} |
||||
|
className="table" |
||||
|
pagination={false} |
||||
|
dataSource={tableData} |
||||
|
loading={loading} |
||||
|
></Table> |
||||
|
<Pagination |
||||
|
className="pagination-common" |
||||
|
showSizeChanger |
||||
|
showQuickJumper |
||||
|
showTotal={() => { |
||||
|
if (total) { |
||||
|
return `共 ${total} 条` |
||||
|
} |
||||
|
else return `共 0 条` |
||||
|
} |
||||
|
} |
||||
|
total={total} |
||||
|
current={formData.pn} |
||||
|
pageSize={formData.page_size} |
||||
|
pageSizeOptions={pageSizeOptions} |
||||
|
onChange={changePn} |
||||
|
onShowSizeChange={changeLength} |
||||
|
/> |
||||
|
{ |
||||
|
confirm ? |
||||
|
<Modal |
||||
|
title="提示" |
||||
|
open={confirm} |
||||
|
onCancel={handleCancel} |
||||
|
width={400} |
||||
|
getContainer={document.getElementById('MerchantAdmin')} |
||||
|
footer={ |
||||
|
[ |
||||
|
<Button key="back" onClick={handleCancel} style={{ color: "#3f3d3d" }}> |
||||
|
取消 |
||||
|
</Button>, |
||||
|
<Button key="submit" type="primary" onClick={handleReset} style={{ background: "#409EFF", color: "#fff" }}> |
||||
|
确定 |
||||
|
</Button>, |
||||
|
] |
||||
|
} |
||||
|
> |
||||
|
<div className="warning"> |
||||
|
<img src={warningIcon}></img> |
||||
|
<span>此操作将重置该用户密码, 是否继续?</span> |
||||
|
</div> |
||||
|
</Modal> |
||||
|
: '' |
||||
|
} |
||||
|
{ |
||||
|
banBtn ? |
||||
|
<Modal |
||||
|
title="提示" |
||||
|
open={banBtn} |
||||
|
onCancel={handleCancel} |
||||
|
width={400} |
||||
|
getContainer={document.getElementById('MerchantAdmin')} |
||||
|
footer={ |
||||
|
[ |
||||
|
<Button key="back" onClick={handleCancel} style={{ color: "#3f3d3d" }}> |
||||
|
取消 |
||||
|
</Button>, |
||||
|
<Button key="submit" type="primary" onClick={handleAdminStatus} style={{ background: "#409EFF", color: "#fff" }}> |
||||
|
确定 |
||||
|
</Button>, |
||||
|
] |
||||
|
} |
||||
|
> |
||||
|
<div className="warning"> |
||||
|
<img src={warningIcon}></img> |
||||
|
<span>此操作将禁用该用户, 是否继续?</span> |
||||
|
</div> |
||||
|
</Modal> : '' |
||||
|
} |
||||
|
{ |
||||
|
startBtn ? |
||||
|
<Modal |
||||
|
title="提示" |
||||
|
open={startBtn} |
||||
|
onCancel={handleCancel} |
||||
|
width={400} |
||||
|
getContainer={document.getElementById('MerchantAdmin')} |
||||
|
footer={ |
||||
|
[ |
||||
|
<Button key="back" onClick={handleCancel} style={{ color: "#3f3d3d" }}> |
||||
|
取消 |
||||
|
</Button>, |
||||
|
<Button key="submit" type="primary" onClick={handleAdminStatus} style={{ background: "#409EFF", color: "#fff" }}> |
||||
|
确定 |
||||
|
</Button>, |
||||
|
] |
||||
|
} |
||||
|
> |
||||
|
<div className="warning"> |
||||
|
<img src={warningIcon}></img> |
||||
|
<span>此操作将启用该用户, 是否继续?</span> |
||||
|
</div> |
||||
|
</Modal> : '' |
||||
|
} |
||||
|
</> : '' |
||||
|
} |
||||
|
|
||||
|
{ |
||||
|
createVisible || updateVisible ? |
||||
|
<div id="create"> |
||||
|
<div className="create-form"> |
||||
|
<div className="container"> |
||||
|
{ |
||||
|
createVisible ? |
||||
|
<Form |
||||
|
form={updateForm} |
||||
|
labelAlign='left' |
||||
|
labelCol={{ span: 8 }} |
||||
|
wrapperCol={{ span: 16 }} |
||||
|
style={{ width: 400 }} |
||||
|
initialValues={{ sex_status: '1' }} |
||||
|
className="form-wrap" |
||||
|
> |
||||
|
<Form.Item |
||||
|
label="商户:" |
||||
|
name="shop_name" |
||||
|
required={true} |
||||
|
rules={[{ required: true }]} |
||||
|
> |
||||
|
<Select |
||||
|
filterOption={filterOption} |
||||
|
optionFilterProp="label" |
||||
|
showSearch |
||||
|
options={tenantPull} |
||||
|
> |
||||
|
</Select> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="手机号码" |
||||
|
name="phone" |
||||
|
required={true} |
||||
|
validateFirst={true} // 出错时两个校验分别生效 |
||||
|
rules={[ |
||||
|
{ |
||||
|
validator: (rule, value) => { |
||||
|
let reg = new RegExp(/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/); |
||||
|
if (!reg.test(value)) { |
||||
|
return Promise.reject('手机号码不合法'); |
||||
|
} else if (value = '') { |
||||
|
return Promise.reject('手机号码不能为空'); |
||||
|
} else { |
||||
|
return Promise.resolve(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
]} |
||||
|
|
||||
|
> |
||||
|
<Input placeholder="请输入手机号码" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="登录名" |
||||
|
name="account" |
||||
|
required={true} |
||||
|
rules={[{ required: true }]} |
||||
|
> |
||||
|
<Input placeholder="请输入登录名" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="姓名" |
||||
|
name="_name" |
||||
|
required={true} |
||||
|
rules={[{ required: true }]} |
||||
|
> |
||||
|
<Input placeholder="请输入姓名" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="邮箱" |
||||
|
name="email" |
||||
|
> |
||||
|
<Input placeholder="请输入邮箱" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="性别" |
||||
|
name="sex_status" |
||||
|
> |
||||
|
<Radio.Group onChange={onChange} value={sexValue}> |
||||
|
<Radio value={1}>男</Radio> |
||||
|
<Radio value={2}>女</Radio> |
||||
|
</Radio.Group> |
||||
|
</Form.Item> |
||||
|
|
||||
|
</Form> : |
||||
|
<Form |
||||
|
form={updateForm} |
||||
|
labelAlign='left' |
||||
|
labelCol={{ span: 8 }} |
||||
|
wrapperCol={{ span: 16 }} |
||||
|
style={{ width: 400 }} |
||||
|
initialValues={{ sex_status: '1' }} |
||||
|
className="form-wrap" |
||||
|
> |
||||
|
<Form.Item |
||||
|
label="商户:" |
||||
|
name="shop_name" |
||||
|
> |
||||
|
{formData.shop_name} |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="手机号码" |
||||
|
name="phone" |
||||
|
required={true} |
||||
|
validateFirst={true} // 出错时两个校验分别生效 |
||||
|
rules={[ |
||||
|
{ |
||||
|
validator: (rule, value) => { |
||||
|
let reg = new RegExp(/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/); |
||||
|
if (!reg.test(value)) { |
||||
|
return Promise.reject('手机号码不合法'); |
||||
|
} else if (value = '') { |
||||
|
return Promise.reject('手机号码不能为空'); |
||||
|
} else { |
||||
|
return Promise.resolve(); |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
]} |
||||
|
|
||||
|
> |
||||
|
<Input placeholder="请输入手机号码" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="登录名" |
||||
|
name="account" |
||||
|
required={true} |
||||
|
rules={[{ required: true }]} |
||||
|
> |
||||
|
{formData.account} |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="姓名" |
||||
|
name="_name" |
||||
|
required={true} |
||||
|
rules={[{ required: true }]} |
||||
|
> |
||||
|
<Input placeholder="请输入姓名" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="邮箱" |
||||
|
name="email" |
||||
|
> |
||||
|
<Input placeholder="请输入邮箱" /> |
||||
|
</Form.Item> |
||||
|
|
||||
|
<Form.Item |
||||
|
label="性别" |
||||
|
name="sex_status" |
||||
|
> |
||||
|
<Radio.Group onChange={onChange} value={sexValue}> |
||||
|
<Radio value={1}>男</Radio> |
||||
|
<Radio value={2}>女</Radio> |
||||
|
</Radio.Group> |
||||
|
</Form.Item> |
||||
|
|
||||
|
</Form> |
||||
|
} |
||||
|
</div> |
||||
|
{ |
||||
|
createVisible && !updateVisible ? |
||||
|
<div className="btns"> |
||||
|
<Button className="btn-1 btn" onClick={submitAdd} type="primary" htmlType="submit">提交</Button> |
||||
|
<Button className="btn-2 btn" onClick={createOncancel}>取消</Button> |
||||
|
</div> : |
||||
|
<div className="btns"> |
||||
|
<Button className="btn-1 btn" onClick={submitUpdate} type="primary" htmlType="submit">提交</Button> |
||||
|
<Button className="btn-2 btn" onClick={createOncancel}>取消</Button> |
||||
|
</div> |
||||
|
} |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
: '' |
||||
|
} |
||||
|
|
||||
|
{ |
||||
|
checkVisible ? |
||||
|
<div id="check"> |
||||
|
<div className="check-form"> |
||||
|
<div className="btns"> |
||||
|
<button className="btn" onClick={createOncancel}>返回</button> |
||||
|
</div> |
||||
|
<div className="container"> |
||||
|
<div className="title">系统管理员详情</div> |
||||
|
<div className="item"><div className="item-title">商户:</div><span>{records.shop_name}</span></div> |
||||
|
<div className="item"><div className="item-title">手机号:</div><span>{records.phone}</span></div> |
||||
|
<div className="item"><div className="item-title">登录名:</div><span>{records.account}</span></div> |
||||
|
<div className="item"><div className="item-title">姓名:</div><span>{records.username}</span></div> |
||||
|
<div className="item"><div className="item-title">邮箱:</div><span>{records.email}</span></div> |
||||
|
<div className="item"><div className="item-title">性别:</div><span>{records.sex_status}</span></div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
: '' |
||||
|
} |
||||
|
|
||||
|
</div> |
||||
|
) |
||||
} |
} |
||||
|
|
||||
export default MerchantAdmin; |
export default MerchantAdmin; |
@ -0,0 +1,90 @@ |
|||||
|
import ajax from "@/config/ajax" |
||||
|
|
||||
|
//获取表格数据
|
||||
|
const getInvoiceTable=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/get_all_receipt", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//获取商户名称的下拉
|
||||
|
const getTenantPull=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/operator/get_all_operator", |
||||
|
type:"get", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//获取计税方式的下拉
|
||||
|
const getTaxWayPull=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/get_tax_type", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//获取税率的下拉
|
||||
|
const getTaxRatePull=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/get_percent_type", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
//获取开票项目的下拉
|
||||
|
const getInvoiceItemPull=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/get_item_list", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//获取含税标志的下拉
|
||||
|
const getTaxTypePull=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/get_include_tax_list", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//新建保存
|
||||
|
const createForm=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/add_receipt", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
//查看详情
|
||||
|
const checkForm=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/show_receipt", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
//启用、停用
|
||||
|
const updateInvoiceStatus=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt//update_status", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
export default { |
||||
|
getInvoiceTable, |
||||
|
getTenantPull, |
||||
|
getTaxWayPull, |
||||
|
getTaxRatePull, |
||||
|
getInvoiceItemPull, |
||||
|
getTaxTypePull, |
||||
|
createForm, |
||||
|
checkForm, |
||||
|
updateInvoiceStatus |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
import ajax from "@/config/ajax" |
||||
|
|
||||
|
|
||||
|
//获取表格数据
|
||||
|
const getMerchantAdminTable=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchant/get_all_merchant", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//增加
|
||||
|
const addMerchantAdmin=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchant/add_merchant", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//查看详情
|
||||
|
const checkMerchantAdmin=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchant/show_merchant", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
//编辑
|
||||
|
const updateMerchantAdmin=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchant/edit_merchant", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//启用/停用
|
||||
|
const updateAdminStatus=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchant/update_status", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//重置密码
|
||||
|
const resetPassWord=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchant/update_pwd", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
getMerchantAdminTable, |
||||
|
addMerchantAdmin, |
||||
|
checkMerchantAdmin, |
||||
|
updateAdminStatus, |
||||
|
updateMerchantAdmin, |
||||
|
resetPassWord |
||||
|
} |
||||
|
|
@ -0,0 +1,55 @@ |
|||||
|
import ajax from "@/config/ajax" |
||||
|
|
||||
|
//下拉框
|
||||
|
const getSelectOption = (p)=>{ |
||||
|
return ajax({ |
||||
|
url: "/api/com/common/get_sys_config", |
||||
|
type: 'get', |
||||
|
data: p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//获取表格数据
|
||||
|
const getMerchantInfoTable=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/merchant/get_table", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//增加商户
|
||||
|
const addTenant=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantinfo/add_merchant", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//查看详情
|
||||
|
const checkTenant=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantinfo/show_merchant", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//启用/停用
|
||||
|
const updateStatus=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantinfo/update_status", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
export default { |
||||
|
getSelectOption, |
||||
|
getMerchantInfoTable, |
||||
|
addTenant, |
||||
|
checkTenant, |
||||
|
updateStatus |
||||
|
} |
||||
|
|
@ -0,0 +1,31 @@ |
|||||
|
import ajax from "@/config/ajax" |
||||
|
|
||||
|
|
||||
|
//获取表格数据
|
||||
|
const getFunctionMgmTable=(p)=>{ |
||||
|
return ajax({ |
||||
|
url:"/api/bpm/merchantreceipt/get_all_func", |
||||
|
type:"post", |
||||
|
data:p |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
//增加
|
||||
|
|
||||
|
|
||||
|
//查看详情
|
||||
|
|
||||
|
//编辑
|
||||
|
|
||||
|
|
||||
|
//启用/停用
|
||||
|
|
||||
|
|
||||
|
//重置密码
|
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
getFunctionMgmTable, |
||||
|
|
||||
|
} |
||||
|
|
@ -1,34 +1,11 @@ |
|||||
import ajax from "@/config/ajax" |
|
||||
|
|
||||
//下拉框
|
|
||||
const getSelectOption = (p)=>{ |
|
||||
return ajax({ |
|
||||
url: "/api/com/common/get_sys_config", |
|
||||
type: 'get', |
|
||||
data: p |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//获取表格数据
|
|
||||
const getTable=(p)=>{ |
|
||||
return ajax({ |
|
||||
url:"/api/merchant/get_table", |
|
||||
type:"post", |
|
||||
data:p |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//增加商户
|
|
||||
const addTenant=(p)=>{ |
|
||||
return ajax({ |
|
||||
url:"/api/bpm/merchantinfo/add_merchan", |
|
||||
type:"post", |
|
||||
data:p |
|
||||
}) |
|
||||
} |
|
||||
|
import MerchantInfo from "./MerchantInfo"; |
||||
|
import invoiceConf from "./invoiceConf"; |
||||
|
import MerchantAdmin from "./MerchantAdmin"; |
||||
|
import functionMgm from "./functionMgm"; |
||||
|
|
||||
export default { |
export default { |
||||
getSelectOption, |
|
||||
getTable, |
|
||||
addTenant |
|
||||
|
...MerchantInfo, |
||||
|
...invoiceConf, |
||||
|
...MerchantAdmin, |
||||
|
...functionMgm |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue