完成:黄家明项目的开发并存档
This commit is contained in:
10
.idea/AugmentWebviewStateStore.xml
generated
Normal file
10
.idea/AugmentWebviewStateStore.xml
generated
Normal file
File diff suppressed because one or more lines are too long
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/template-10519.iml" filepath="$PROJECT_DIR$/.idea/template-10519.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
12
.idea/template-10519.iml
generated
Normal file
12
.idea/template-10519.iml
generated
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="WEB_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -24,6 +24,8 @@ export interface HjmCar {
|
|||||||
parentOrganizationAdmin?: string;
|
parentOrganizationAdmin?: string;
|
||||||
// 车辆编号
|
// 车辆编号
|
||||||
code?: string;
|
code?: string;
|
||||||
|
// 安装人员ID
|
||||||
|
installerId?: number;
|
||||||
// 操作员ID
|
// 操作员ID
|
||||||
driverId?: number;
|
driverId?: number;
|
||||||
// 操作员
|
// 操作员
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { PageParam } from '@/api';
|
import type { PageParam } from '@/api/index';
|
||||||
import type {CompanyParameter} from "~/api/system/companyParameter/model";
|
import type {CompanyParameter} from "@/api/system/companyParameter/model";
|
||||||
import type {CompanyUrl} from "~/api/system/companyUrl/model";
|
import type {CompanyUrl} from "@/api/system/companyUrl/model";
|
||||||
import type {CompanyGit} from "~/api/system/companyGit/model";
|
import type {CompanyGit} from "@/api/system/companyGit/model";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业信息
|
* 企业信息
|
||||||
@@ -101,7 +101,7 @@ export interface Company {
|
|||||||
*/
|
*/
|
||||||
export interface CompanyParam extends PageParam {
|
export interface CompanyParam extends PageParam {
|
||||||
companyId?: number;
|
companyId?: number;
|
||||||
type?: number;
|
type?: any;
|
||||||
official?: boolean;
|
official?: boolean;
|
||||||
shortName?: string;
|
shortName?: string;
|
||||||
companyName?: string;
|
companyName?: string;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api/index';
|
import type { ApiResult, PageResult } from '@/api/index';
|
||||||
import type { CompanyGit, CompanyGitParam } from './model';
|
import type { CompanyGit, CompanyGitParam } from './model';
|
||||||
import { SERVER_API_URL } from '@/config/index';
|
import {SERVER_API_URL} from "@/utils/server";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询代码仓库
|
* 分页查询代码仓库
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api/index';
|
import type { ApiResult, PageResult } from '@/api/index';
|
||||||
import type { CompanyParameter, CompanyParameterParam } from './model';
|
import type { CompanyParameter, CompanyParameterParam } from './model';
|
||||||
import {SERVER_API_URL} from '@/config/index';
|
import {SERVER_API_URL} from "@/utils/server";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询应用参数
|
* 分页查询应用参数
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { PageParam } from '@/api';
|
import type { PageParam } from '@/api/index';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应用参数
|
* 应用参数
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {SERVER_API_URL} from "@/utils/server";
|
|||||||
export async function pageOrganizations(params: OrganizationParam) {
|
export async function pageOrganizations(params: OrganizationParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<Organization>>>(
|
const res = await request.get<ApiResult<PageResult<Organization>>>(
|
||||||
SERVER_API_URL + '/system/organization/page',
|
SERVER_API_URL + '/system/organization/page',
|
||||||
{ params }
|
params
|
||||||
);
|
);
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
return res.data;
|
return res.data;
|
||||||
@@ -23,7 +23,7 @@ export async function pageOrganizations(params: OrganizationParam) {
|
|||||||
export async function listOrganizations(params?: OrganizationParam) {
|
export async function listOrganizations(params?: OrganizationParam) {
|
||||||
const res = await request.get<ApiResult<Organization[]>>(
|
const res = await request.get<ApiResult<Organization[]>>(
|
||||||
SERVER_API_URL + '/system/organization',
|
SERVER_API_URL + '/system/organization',
|
||||||
{ params }
|
params
|
||||||
);
|
);
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
return res.data;
|
return res.data;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PageParam } from '@/api';
|
import { PageParam } from '@/api/index';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机构
|
* 机构
|
||||||
@@ -38,5 +38,7 @@ export interface Organization {
|
|||||||
*/
|
*/
|
||||||
export interface OrganizationParam extends PageParam {
|
export interface OrganizationParam extends PageParam {
|
||||||
organizationName?: string;
|
organizationName?: string;
|
||||||
|
keywords?: string;
|
||||||
|
limit?: number;
|
||||||
parentId?: number;
|
parentId?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,3 +30,17 @@ export async function updateUserRole(data: UserRole) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.message));
|
return Promise.reject(new Error(res.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加用户角色
|
||||||
|
*/
|
||||||
|
export async function addUserRole(data: UserRole) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
SERVER_API_URL + '/system/user-role',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ export interface UserRole {
|
|||||||
*/
|
*/
|
||||||
export interface UserRoleParam extends PageParam {
|
export interface UserRoleParam extends PageParam {
|
||||||
keywords?: any;
|
keywords?: any;
|
||||||
|
roleId?: number;
|
||||||
userId?: number;
|
userId?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ export interface UserVerify {
|
|||||||
zzCode?: string;
|
zzCode?: string;
|
||||||
// 营业执照
|
// 营业执照
|
||||||
zzImg?: string;
|
zzImg?: string;
|
||||||
|
// 组织机构代码
|
||||||
|
organizationId?: number;
|
||||||
|
// 组织机构名称
|
||||||
|
organizationName?: string;
|
||||||
|
// 记录当前用户角色ID
|
||||||
|
userRoleId?: number;
|
||||||
// 备注
|
// 备注
|
||||||
comments?: string;
|
comments?: string;
|
||||||
// 状态, 0在线, 1离线
|
// 状态, 0在线, 1离线
|
||||||
@@ -54,5 +60,6 @@ export interface UserVerify {
|
|||||||
export interface UserVerifyParam extends PageParam {
|
export interface UserVerifyParam extends PageParam {
|
||||||
id?: number;
|
id?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
|
organizationId?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Taro, {useDidShow, useDidHide} from '@tarojs/taro'
|
|||||||
import './app.scss'
|
import './app.scss'
|
||||||
import {loginByOpenId} from "@/api/layout";
|
import {loginByOpenId} from "@/api/layout";
|
||||||
import {TenantId} from "@/utils/config";
|
import {TenantId} from "@/utils/config";
|
||||||
import {saveStorageByLoginUser} from "@/utils/server";
|
// import {saveStorageByLoginUser} from "@/utils/server";
|
||||||
import {mqttStart} from "@/api/hjm/hjmCar";
|
import {mqttStart} from "@/api/hjm/hjmCar";
|
||||||
|
|
||||||
function App(props) {
|
function App(props) {
|
||||||
@@ -20,7 +20,7 @@ function App(props) {
|
|||||||
tenantId: TenantId
|
tenantId: TenantId
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
if (data) {
|
if (data) {
|
||||||
saveStorageByLoginUser(data.access_token, data.user)
|
// saveStorageByLoginUser(data.access_token, data.user)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ const BestSellers = (props: any) => {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
{props.data.length === 0 && (
|
||||||
|
<div className={'flex justify-center items-center'}>
|
||||||
|
<div className={'text-gray-500 text-sm'}>暂无数据</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div style={{height: '170px'}}></div>
|
<div style={{height: '170px'}}></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,57 +1,127 @@
|
|||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import {useRouter} from '@tarojs/taro'
|
import {Map} from '@tarojs/components'
|
||||||
import {getHjmCar, pageHjmCar} from "@/api/hjm/hjmCar";
|
// import {Search} from '@nutui/icons-react-taro'
|
||||||
|
// import {Button, Input} from '@nutui/nutui-react-taro'
|
||||||
|
import {pageByQQMap} from "@/api/hjm/hjmCar";
|
||||||
import {HjmCar} from "@/api/hjm/hjmCar/model";
|
import {HjmCar} from "@/api/hjm/hjmCar/model";
|
||||||
import {Image,Cell} from '@nutui/nutui-react-taro'
|
|
||||||
import './location.scss'
|
import './location.scss'
|
||||||
|
import {HjmFence} from "@/api/hjm/hjmFence/model";
|
||||||
|
import {getHjmFence} from "@/api/hjm/hjmFence";
|
||||||
|
import {Market} from "../pages/index";
|
||||||
|
interface Where {
|
||||||
|
latitude?: number;
|
||||||
|
longitude?: number;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 电子围栏
|
* 文章终极列表
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
const Fence = () => {
|
const Location = () => {
|
||||||
const {params} = useRouter();
|
// const [keywords, setKeywords] = useState<string>()
|
||||||
const [keywords, setKeywords] = useState<string>()
|
// const [item, setItem] = useState<HjmCar>()
|
||||||
const [item, setItem] = useState<HjmCar>()
|
const [longitude, setLongitude] = useState<any>(108.374959)
|
||||||
|
const [latitude, setLatitude] = useState<any>(22.767024)
|
||||||
|
const [scale, setScale] = useState<any>(16)
|
||||||
|
const [showCircles, setShowCircles] = useState<boolean>(false)
|
||||||
|
const [points, setPoints] = useState<any[]>([])
|
||||||
|
const [fence, setFence] = useState<HjmFence>()
|
||||||
|
const [markers, setMarkers] = useState<Market[]>([])
|
||||||
|
|
||||||
// 打开地图选择位置
|
// const onKeywords = (keywords: string) => {
|
||||||
// const chooseLocation = async () => {
|
// setKeywords(keywords)
|
||||||
// try {
|
|
||||||
// const res = await Taro.chooseLocation({
|
|
||||||
// latitude, // 默认纬度
|
|
||||||
// longitude // 默认经度
|
|
||||||
// })
|
|
||||||
// console.log('选择的位置:', res);
|
|
||||||
// } catch (err) {
|
|
||||||
// console.error('选择位置失败:', err);
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
const reload = () => {
|
|
||||||
const id = Number(params.id);
|
// 通用的坐标字符串转数组函数
|
||||||
// 执行搜索
|
const parseCoordinateString = (coordStr: string) => {
|
||||||
if (keywords) {
|
if (!coordStr) return {points: []};
|
||||||
pageHjmCar({keywords}).then(res => {
|
|
||||||
if (res?.list && res?.list?.length > 0) {
|
try {
|
||||||
const data = res?.list[0];
|
// 分割坐标点
|
||||||
setItem(data)
|
const coordPairs = coordStr.split(';');
|
||||||
setKeywords(data.code)
|
|
||||||
|
// 转为多边形点数组
|
||||||
|
const points = coordPairs.map(coord => {
|
||||||
|
const [lat, lng] = coord.split(',');
|
||||||
|
return {
|
||||||
|
latitude: parseFloat(lat),
|
||||||
|
longitude: parseFloat(lng)
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
return false;
|
console.log(points,'pointspointspoints')
|
||||||
}
|
return {points};
|
||||||
// 获取车辆信息
|
} catch (error) {
|
||||||
if (id) {
|
console.error('解析坐标字符串失败:', error);
|
||||||
getHjmCar(id).then(data => {
|
return {points: []};
|
||||||
setItem(data)
|
|
||||||
setKeywords(data.code)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
setScale(11)
|
||||||
|
setLongitude(108.355702)
|
||||||
|
setLatitude(22.857968)
|
||||||
|
getHjmFence(4).then(data => {
|
||||||
|
setFence(data)
|
||||||
|
const coordStr = data.points || '';
|
||||||
|
|
||||||
|
// 使用通用函数解析坐标字符串
|
||||||
|
const {points} = parseCoordinateString(coordStr);
|
||||||
|
console.log('解析结果 - 多边形点:', points);
|
||||||
|
setPoints(points);
|
||||||
|
setShowCircles(true)
|
||||||
|
console.log(fence,'fencefencefence')
|
||||||
|
})
|
||||||
|
const where: Where = {}
|
||||||
|
where.latitude = latitude
|
||||||
|
where.longitude = longitude
|
||||||
|
pageByQQMap(where).then(res => {
|
||||||
|
if (res?.count == 0) {
|
||||||
|
const arr = []
|
||||||
|
// @ts-ignore
|
||||||
|
arr.push({
|
||||||
|
id: 10001,
|
||||||
|
latitude: 22.813371,
|
||||||
|
longitude: 108.323885,
|
||||||
|
title: '当前位置',
|
||||||
|
name: '当前位置'
|
||||||
|
})
|
||||||
|
setMarkers(arr)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (res?.list && res?.list.length > 0) {
|
||||||
|
const data = res?.list;
|
||||||
|
const arr = []
|
||||||
|
data?.map((item: HjmCar) => {
|
||||||
|
// @ts-ignore
|
||||||
|
arr.push({
|
||||||
|
id: item.id,
|
||||||
|
latitude: item.latitude,
|
||||||
|
longitude: item.longitude,
|
||||||
|
label: {
|
||||||
|
content: `${item?.code}`,
|
||||||
|
color: '#000000',
|
||||||
|
fontSize: 12,
|
||||||
|
borderRadius: 5,
|
||||||
|
bgColor: '#FFFFFF',
|
||||||
|
// @ts-ignore
|
||||||
|
padding: '5px 5px',
|
||||||
|
borderWidth: 1
|
||||||
|
},
|
||||||
|
title: `${item.organization}`,
|
||||||
|
name: item.organization
|
||||||
|
})
|
||||||
|
})
|
||||||
|
setMarkers(arr)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reload()
|
reload()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
// 监听圈圈数据变化
|
||||||
|
useEffect(() => {
|
||||||
|
}, [showCircles])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -82,35 +152,47 @@ const Fence = () => {
|
|||||||
{/* </div>*/}
|
{/* </div>*/}
|
||||||
{/* </div>*/}
|
{/* </div>*/}
|
||||||
{/*</div>*/}
|
{/*</div>*/}
|
||||||
{item ? (
|
{/*{item ? (*/}
|
||||||
<div className={'car-info w-full bg-white'}>
|
{/* <div className={'car-info fixed bottom-0 left-0 w-full z-20 bg-white p-4'}>*/}
|
||||||
<Image src={item?.image} mode={'widthFix'} width={'100%'} className={'bg-gray-50'}/>
|
{/* <div className={'car-info-item'}>*/}
|
||||||
<div className={'px-2'}>
|
{/* <div className={'car-info-item-content'}>*/}
|
||||||
<Cell className={'car-info-item-title'}>
|
{/* 操作人员:{item?.driver}*/}
|
||||||
车辆编号:{item?.code}
|
{/* </div>*/}
|
||||||
</Cell>
|
{/* <div className={'car-info-item-content pr-6'}>*/}
|
||||||
<Cell className={'car-info-item-title'}>
|
{/* 电子围栏:{item?.fenceName} ({item?.inFence ? '围栏内' : '围栏外'})*/}
|
||||||
快递公司:{item?.kuaidi}
|
{/* </div>*/}
|
||||||
</Cell>
|
{/* <div className={'car-info-item-content pr-6'}>*/}
|
||||||
<Cell className={'car-info-item-title'}>
|
{/* 当前车速:{item?.speed}*/}
|
||||||
管理负责人:{item?.kuaidiAdmin}
|
{/* </div>*/}
|
||||||
</Cell>
|
{/* <div className={'car-info-item-title'}>*/}
|
||||||
<Cell className={'car-info-item-content'}>
|
{/* 更新时间:{item?.updateTime}*/}
|
||||||
操作员:{item?.driver}
|
{/* </div>*/}
|
||||||
</Cell>
|
{/* </div>*/}
|
||||||
<Cell className={'car-info-item-content'}>
|
{/* </div>*/}
|
||||||
保险状态:{item?.insuranceStatus}
|
{/*) : ''}*/}
|
||||||
</Cell>
|
|
||||||
<Cell className={'car-info-item-content'}>
|
{markers.length > 0 && (
|
||||||
GPS编号:{item?.gpsNo}
|
<Map
|
||||||
</Cell>
|
id="map"
|
||||||
<Cell className={'car-info-item-content'}>
|
longitude={longitude}
|
||||||
电子围栏:{item?.fenceName}
|
latitude={latitude}
|
||||||
</Cell>
|
scale={scale}
|
||||||
</div>
|
// @ts-ignore
|
||||||
</div>
|
markers={markers}
|
||||||
) : ''}
|
polygons={points.length > 0 ? [
|
||||||
|
{
|
||||||
|
points: points,
|
||||||
|
color: '#ff0000',
|
||||||
|
strokeWidth: 3
|
||||||
|
}
|
||||||
|
] : []}
|
||||||
|
onTap={() => {
|
||||||
|
console.log('map tap')
|
||||||
|
}}
|
||||||
|
style={{width: '100%', height: '100vh'}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default Fence
|
export default Location
|
||||||
|
|||||||
@@ -41,6 +41,13 @@ const List = () => {
|
|||||||
where.organizationId = Taro.getStorageSync('OrganizationId');
|
where.organizationId = Taro.getStorageSync('OrganizationId');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(roleCode == 'Installer'){
|
||||||
|
// @ts-ignore
|
||||||
|
where.installerId = Taro.getStorageSync('UserId')
|
||||||
|
}
|
||||||
|
if(roleCode == 'user'){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// 获取车辆列表
|
// 获取车辆列表
|
||||||
pageHjmCar(where).then(res => {
|
pageHjmCar(where).then(res => {
|
||||||
|
|||||||
@@ -128,7 +128,8 @@ const Query = () => {
|
|||||||
// 安装车辆
|
// 安装车辆
|
||||||
updateHjmCar({
|
updateHjmCar({
|
||||||
...FormData,
|
...FormData,
|
||||||
status: 1
|
status: 1,
|
||||||
|
installerId: Taro.getStorageSync('UserId')
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
Taro.showToast({title: `安装成功`, icon: 'success'})
|
Taro.showToast({title: `安装成功`, icon: 'success'})
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -419,6 +420,11 @@ const Query = () => {
|
|||||||
if (carInfo.status == 1 && roleCode == 'kuaidiyuan') {
|
if (carInfo.status == 1 && roleCode == 'kuaidiyuan') {
|
||||||
// 2.1先查询名下有多少辆车
|
// 2.1先查询名下有多少辆车
|
||||||
const carCount = await pageHjmCar({driverId: Taro.getStorageSync('UserId')})
|
const carCount = await pageHjmCar({driverId: Taro.getStorageSync('UserId')})
|
||||||
|
carCount?.list.map(d => {
|
||||||
|
if(d.code == code){
|
||||||
|
// 只能绑定一辆车
|
||||||
|
}
|
||||||
|
})
|
||||||
if (carCount?.count == 0) {
|
if (carCount?.count == 0) {
|
||||||
// 2.2无车辆则认领
|
// 2.2无车辆则认领
|
||||||
setClaimVehicle(true)
|
setClaimVehicle(true)
|
||||||
@@ -504,7 +510,7 @@ const Query = () => {
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={'管理责任人'}
|
label={'管理责任人'}
|
||||||
name="parentOrganizationAdmin"
|
name="kuaidiAdmin"
|
||||||
rules={[{message: '管理责任人'}]}
|
rules={[{message: '管理责任人'}]}
|
||||||
>
|
>
|
||||||
<Input placeholder="管理责任人" disabled type="text"/>
|
<Input placeholder="管理责任人" disabled type="text"/>
|
||||||
@@ -705,7 +711,7 @@ const Query = () => {
|
|||||||
所属站点:{FormData?.organization}
|
所属站点:{FormData?.organization}
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell className={'car-info-item-title'}>
|
<Cell className={'car-info-item-title'}>
|
||||||
管理责任人:{FormData?.parentOrganizationAdmin}
|
管理责任人:{FormData?.kuaidiAdmin}
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell className={'car-info-item-content'}>
|
<Cell className={'car-info-item-content'}>
|
||||||
保险状态:{FormData?.insuranceStatus}
|
保险状态:{FormData?.insuranceStatus}
|
||||||
@@ -717,10 +723,10 @@ const Query = () => {
|
|||||||
电子围栏:{FormData.fenceName}
|
电子围栏:{FormData.fenceName}
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell className={'car-info-item-content'}>
|
<Cell className={'car-info-item-content'}>
|
||||||
安装状态:{FormData.status == 2 ? '已绑定' : '未绑定'}
|
安装状态:{FormData.status == 1 ? '已安装' : '未安装'}
|
||||||
</Cell>
|
</Cell>
|
||||||
<Cell className={'car-info-item-content'}>
|
<Cell className={'car-info-item-content'}>
|
||||||
操作员:{FormData.status == 2 ? FormData.driver : '-'}
|
操作员:{FormData.driver || '-'}
|
||||||
</Cell>
|
</Cell>
|
||||||
{
|
{
|
||||||
// 认领车辆
|
// 认领车辆
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {Button} from '@nutui/nutui-react-taro'
|
|||||||
import {Target, Scan, Truck} from '@nutui/icons-react-taro'
|
import {Target, Scan, Truck} from '@nutui/icons-react-taro'
|
||||||
import {getUserInfo} from "@/api/layout";
|
import {getUserInfo} from "@/api/layout";
|
||||||
import navTo from "@/utils/common";
|
import navTo from "@/utils/common";
|
||||||
|
import {pageHjmCar} from "@/api/hjm/hjmCar";
|
||||||
|
|
||||||
const ExpirationTime = () => {
|
const ExpirationTime = () => {
|
||||||
const [isAdmin, setIsAdmin] = useState<boolean>(false)
|
const [isAdmin, setIsAdmin] = useState<boolean>(false)
|
||||||
@@ -45,6 +46,9 @@ const ExpirationTime = () => {
|
|||||||
if(Taro.getStorageSync('certification') == 'yz'){
|
if(Taro.getStorageSync('certification') == 'yz'){
|
||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
}
|
}
|
||||||
|
if(Taro.getStorageSync('RoleCode') == 'Installer'){
|
||||||
|
setIsAdmin(true)
|
||||||
|
}
|
||||||
data.roles?.map((item, index) => {
|
data.roles?.map((item, index) => {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
setRoleName(item.roleCode)
|
setRoleName(item.roleCode)
|
||||||
@@ -53,6 +57,12 @@ const ExpirationTime = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
pageHjmCar({driverId: Taro.getStorageSync('UserId')}).then(res => {
|
||||||
|
if(res?.list && res.list.length > 0){
|
||||||
|
setIsAdmin(true)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const Header = (props: any) => {
|
|||||||
if (data) {
|
if (data) {
|
||||||
setIsLogin(true);
|
setIsLogin(true);
|
||||||
Taro.setStorageSync('UserId', data.userId)
|
Taro.setStorageSync('UserId', data.userId)
|
||||||
|
Taro.setStorageSync('Phone',data.phone)
|
||||||
// 机构ID
|
// 机构ID
|
||||||
Taro.setStorageSync('OrganizationId',data.organizationId)
|
Taro.setStorageSync('OrganizationId',data.organizationId)
|
||||||
// 父级机构ID
|
// 父级机构ID
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ function Home() {
|
|||||||
if (!Taro.getStorageSync('access_token')) {
|
if (!Taro.getStorageSync('access_token')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
pageHjmCarByMap(latitude, longitude)
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -315,6 +316,9 @@ function Home() {
|
|||||||
console.log('交警', '12312')
|
console.log('交警', '12312')
|
||||||
setIsAdmin(true)
|
setIsAdmin(true)
|
||||||
}
|
}
|
||||||
|
if (Taro.getStorageSync('RoleCode') == 'Installer') {
|
||||||
|
setIsAdmin(true)
|
||||||
|
}
|
||||||
setUserInfo(data)
|
setUserInfo(data)
|
||||||
setIsLogin(true);
|
setIsLogin(true);
|
||||||
Taro.setStorageSync('UserId', data.userId)
|
Taro.setStorageSync('UserId', data.userId)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Button} from '@nutui/nutui-react-taro'
|
import {Button} from '@nutui/nutui-react-taro'
|
||||||
import {Avatar, Tag} from '@nutui/nutui-react-taro'
|
import {Avatar, Tag, Space} from '@nutui/nutui-react-taro'
|
||||||
import {getUserInfo, getWxOpenId} from '@/api/layout';
|
import {getUserInfo, getWxOpenId} from '@/api/layout';
|
||||||
import Taro from '@tarojs/taro';
|
import Taro from '@tarojs/taro';
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
@@ -163,11 +163,18 @@ function UserCard() {
|
|||||||
<div className={'user-info flex flex-col px-2'}>
|
<div className={'user-info flex flex-col px-2'}>
|
||||||
<div className={'py-1 text-black font-bold'}>{IsLogin ? userInfo?.mobile : '请点击头像登录'}</div>
|
<div className={'py-1 text-black font-bold'}>{IsLogin ? userInfo?.mobile : '请点击头像登录'}</div>
|
||||||
{IsLogin ? (
|
{IsLogin ? (
|
||||||
<div className={'grade text-xs py-1'}>
|
<Space className={'grade text-xs py-1'}>
|
||||||
<Tag type="success" round>
|
<Tag type="success" round>
|
||||||
<div className={'p-1'}>{roleName || '注册用户'}</div>
|
<div className={'p-1'}>{roleName || '注册用户'}</div>
|
||||||
</Tag>
|
</Tag>
|
||||||
</div>
|
{/*{*/}
|
||||||
|
{/* userInfo?.organizationName && (*/}
|
||||||
|
{/* <Tag type="warning" round>*/}
|
||||||
|
{/* <div className={'p-1'}>{userInfo?.organizationName}</div>*/}
|
||||||
|
{/* </Tag>*/}
|
||||||
|
{/* )*/}
|
||||||
|
{/*}*/}
|
||||||
|
</Space>
|
||||||
) : ''}
|
) : ''}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ const UserCell = () => {
|
|||||||
content: '确定要退出登录吗?',
|
content: '确定要退出登录吗?',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
|
Taro.clearStorageSync()
|
||||||
Taro.removeStorageSync('access_token')
|
Taro.removeStorageSync('access_token')
|
||||||
Taro.removeStorageSync('TenantId')
|
Taro.removeStorageSync('TenantId')
|
||||||
Taro.removeStorageSync('UserId')
|
Taro.removeStorageSync('UserId')
|
||||||
@@ -56,7 +57,7 @@ const UserCell = () => {
|
|||||||
/>
|
/>
|
||||||
</Cell.Group>
|
</Cell.Group>
|
||||||
{
|
{
|
||||||
roleName === 'kuaidi' && (
|
(roleName === 'kuaidi' || roleName == 'zhandian') && (
|
||||||
<Cell.Group divider={true}>
|
<Cell.Group divider={true}>
|
||||||
<Cell
|
<Cell
|
||||||
className="nutui-cell-clickable"
|
className="nutui-cell-clickable"
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import {
|
|||||||
Tag,
|
Tag,
|
||||||
Space
|
Space
|
||||||
} from '@nutui/nutui-react-taro'
|
} from '@nutui/nutui-react-taro'
|
||||||
import {Search, Calendar, Truck, File, AddCircle} from '@nutui/icons-react-taro'
|
import {Search, Calendar, Truck, File} from '@nutui/icons-react-taro'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
import {pageHjmViolation} from "@/api/hjm/hjmViolation";
|
|
||||||
import {UserVerify} from "@/api/system/userVerify/model";
|
import {UserVerify} from "@/api/system/userVerify/model";
|
||||||
import {pageUserVerify} from "@/api/system/userVerify";
|
import {pageUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
||||||
|
import {listUserRole, updateUserRole} from "@/api/system/userRole";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -21,6 +21,7 @@ const List: React.FC = () => {
|
|||||||
const [list, setList] = useState<UserVerify[]>([])
|
const [list, setList] = useState<UserVerify[]>([])
|
||||||
const [loading, setLoading] = useState<boolean>(false)
|
const [loading, setLoading] = useState<boolean>(false)
|
||||||
const [keywords, setKeywords] = useState<string>('')
|
const [keywords, setKeywords] = useState<string>('')
|
||||||
|
// const [showTextArea, setShowTextArea] = useState<boolean>(false)
|
||||||
const [refreshing, setRefreshing] = useState<boolean>(false)
|
const [refreshing, setRefreshing] = useState<boolean>(false)
|
||||||
console.log(refreshing)
|
console.log(refreshing)
|
||||||
// 获取状态显示
|
// 获取状态显示
|
||||||
@@ -42,9 +43,20 @@ const List: React.FC = () => {
|
|||||||
if (showLoading) setLoading(true)
|
if (showLoading) setLoading(true)
|
||||||
setRefreshing(true)
|
setRefreshing(true)
|
||||||
|
|
||||||
const res = await pageUserVerify({
|
const where = {
|
||||||
keywords: keywords.trim(),
|
keywords: keywords.trim(),
|
||||||
})
|
}
|
||||||
|
|
||||||
|
if (Taro.getStorageSync('RoleCode') == 'zhandian') {
|
||||||
|
// @ts-ignore
|
||||||
|
where.organizationId = Taro.getStorageSync('OrganizationId')
|
||||||
|
}
|
||||||
|
if (Taro.getStorageSync('RoleCode') == 'kuaidi') {
|
||||||
|
// @ts-ignore
|
||||||
|
where.OrganizationParentId = Taro.getStorageSync('OrganizationParentId')
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await pageUserVerify(where)
|
||||||
|
|
||||||
setList(res?.list || [])
|
setList(res?.list || [])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -67,12 +79,44 @@ const List: React.FC = () => {
|
|||||||
setKeywords(value)
|
setKeywords(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onAddInsurance = () => {
|
const onPass = async (item: UserVerify) => {
|
||||||
Taro.navigateTo({
|
const role = await listUserRole({roleId: 1701,userId: item.userId})
|
||||||
url: '/hjm/violation/add'
|
const userRole = role[0];
|
||||||
|
userRole.roleId = 1738;
|
||||||
|
updateUserRole(userRole).then(() => {
|
||||||
|
updateUserVerify({
|
||||||
|
...item,
|
||||||
|
status: 1
|
||||||
|
}).then(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '操作成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
reload().then()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onReject = async (item: UserVerify) => {
|
||||||
|
const role = await listUserRole({roleId: 1738,userId: item.userId})
|
||||||
|
const userRole = role[0];
|
||||||
|
if(userRole){
|
||||||
|
userRole.roleId = 1701;
|
||||||
|
updateUserRole(userRole).then(() => {
|
||||||
|
updateUserVerify({
|
||||||
|
...item,
|
||||||
|
status: 2
|
||||||
|
}).then(() => {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '操作成功',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
reload().then()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reload().then()
|
reload().then()
|
||||||
}, [])
|
}, [])
|
||||||
@@ -137,10 +181,7 @@ const List: React.FC = () => {
|
|||||||
<Loading type="spinner">加载中...</Loading>
|
<Loading type="spinner">加载中...</Loading>
|
||||||
</div>
|
</div>
|
||||||
) : list.length === 0 ? (
|
) : list.length === 0 ? (
|
||||||
<Empty description="暂无报险记录">
|
<Empty description="暂无数据">
|
||||||
<Button type="primary" onClick={onAddInsurance}>
|
|
||||||
立即报险
|
|
||||||
</Button>
|
|
||||||
</Empty>
|
</Empty>
|
||||||
) : (
|
) : (
|
||||||
<div style={{padding: '0 16px'}}>
|
<div style={{padding: '0 16px'}}>
|
||||||
@@ -183,6 +224,18 @@ const List: React.FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Space direction="vertical">
|
<Space direction="vertical">
|
||||||
|
|
||||||
|
<div style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
gap: '8px'
|
||||||
|
}}>
|
||||||
|
<Truck size={14} color="#8c8c8c"/>
|
||||||
|
<span style={{fontSize: '13px', color: '#8c8c8c'}}>
|
||||||
|
所属站点:{item.organizationName}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div style={{
|
<div style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
@@ -235,6 +288,20 @@ const List: React.FC = () => {
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
<Space className={'pt-4 flex justify-end'}>
|
||||||
|
<Button type="success" onClick={() => onPass(item)}>通过</Button>
|
||||||
|
<Button type="warning" onClick={() => onReject(item)}>驳回</Button>
|
||||||
|
</Space>
|
||||||
|
|
||||||
|
|
||||||
|
{/*{showTextArea && (*/}
|
||||||
|
{/* <TextArea*/}
|
||||||
|
{/* placeholder={'个性签名'}*/}
|
||||||
|
{/* value={item?.comments}*/}
|
||||||
|
{/* onChange={(value) => changeComments(value)}*/}
|
||||||
|
{/* />*/}
|
||||||
|
{/*)}*/}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
import {Image} from '@nutui/nutui-react-taro'
|
|
||||||
import {ConfigProvider} from '@nutui/nutui-react-taro'
|
import {ConfigProvider} from '@nutui/nutui-react-taro'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
@@ -8,19 +7,22 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
Radio,
|
Radio,
|
||||||
|
Cell,
|
||||||
|
SearchBar
|
||||||
} from '@nutui/nutui-react-taro'
|
} from '@nutui/nutui-react-taro'
|
||||||
import {UserVerify} from "@/api/system/userVerify/model";
|
import {UserVerify} from "@/api/system/userVerify/model";
|
||||||
import {addUserVerify, myUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
import {addUserVerify, myUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
||||||
import {uploadFile} from "@/api/system/file";
|
import {pageOrganizations} from "@/api/system/organization";
|
||||||
|
|
||||||
function Index() {
|
function Index() {
|
||||||
const [isUpdate, setIsUpdate] = useState<boolean>(false)
|
const [isUpdate, setIsUpdate] = useState<boolean>(false)
|
||||||
const [submitText, setSubmitText] = useState<string>('提交')
|
const [submitText, setSubmitText] = useState<string>('提交')
|
||||||
|
const [siteList, setSiteList] = useState<any[]>([])
|
||||||
|
|
||||||
const [FormData, setFormData] = useState<UserVerify>({
|
const [FormData, setFormData] = useState<UserVerify>({
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
type: undefined,
|
type: 0,
|
||||||
phone: undefined,
|
phone: Taro.getStorageSync('Phone'),
|
||||||
avatar: undefined,
|
avatar: undefined,
|
||||||
realName: undefined,
|
realName: undefined,
|
||||||
idCard: undefined,
|
idCard: undefined,
|
||||||
@@ -29,6 +31,9 @@ function Index() {
|
|||||||
sfz2: undefined,
|
sfz2: undefined,
|
||||||
zzCode: undefined,
|
zzCode: undefined,
|
||||||
zzImg: undefined,
|
zzImg: undefined,
|
||||||
|
organizationId: undefined,
|
||||||
|
organizationName: undefined,
|
||||||
|
userRoleId: Taro.getStorageSync(''),
|
||||||
status: undefined,
|
status: undefined,
|
||||||
statusText: undefined,
|
statusText: undefined,
|
||||||
comments: undefined
|
comments: undefined
|
||||||
@@ -47,43 +52,41 @@ function Index() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
if(Taro.getStorageSync('Phone')){
|
||||||
|
setFormData({...FormData, phone: Taro.getStorageSync('Phone')})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitFailed = (error: any) => {
|
||||||
|
console.log(error, 'err...')
|
||||||
|
}
|
||||||
|
|
||||||
|
const searchSiteList = (keywords: string) => {
|
||||||
|
pageOrganizations({keywords,limit: 5}).then(res => {
|
||||||
|
setSiteList(res?.list || [])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onOrganizationChange = (item) => {
|
||||||
|
console.log(item);
|
||||||
|
|
||||||
|
setFormData({
|
||||||
|
...FormData,
|
||||||
|
organizationId: item.organizationId,
|
||||||
|
organizationName: item.organizationName
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交表单
|
// 提交表单
|
||||||
const submitSucceed = (values: any) => {
|
const submitSucceed = (values: any) => {
|
||||||
console.log('提交表单', values);
|
console.log('提交表单...',values)
|
||||||
if (FormData.status != 2 && FormData.status != undefined) return false;
|
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||||
if (FormData.type == 0) {
|
if(FormData.organizationId == 0 || !FormData.organizationId){
|
||||||
if (!FormData.sfz1 || !FormData.sfz2) {
|
Taro.showToast({
|
||||||
Taro.showToast({
|
title: '请选择站点',
|
||||||
title: '请上传身份证正反面',
|
icon: 'none'
|
||||||
icon: 'none'
|
});
|
||||||
});
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!FormData.realName || !FormData.idCard) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: '请填写真实姓名和身份证号码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (FormData.type == 1) {
|
|
||||||
if (!FormData.zzImg) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: '请上传营业执照',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!FormData.name || !FormData.zzCode) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: '请填写主体名称和营业执照号码',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!FormData.realName){
|
if(!FormData.realName){
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
@@ -92,6 +95,7 @@ function Index() {
|
|||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
console.log('提交表单', FormData);
|
||||||
const saveOrUpdate = isUpdate ? updateUserVerify : addUserVerify;
|
const saveOrUpdate = isUpdate ? updateUserVerify : addUserVerify;
|
||||||
saveOrUpdate({...FormData, status: 0}).then(() => {
|
saveOrUpdate({...FormData, status: 0}).then(() => {
|
||||||
Taro.showToast({title: `提交成功`, icon: 'success'})
|
Taro.showToast({title: `提交成功`, icon: 'success'})
|
||||||
@@ -107,40 +111,6 @@ function Index() {
|
|||||||
reload();
|
reload();
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const submitFailed = (error: any) => {
|
|
||||||
console.log(error, 'err...')
|
|
||||||
}
|
|
||||||
|
|
||||||
const uploadSfz1 = () => {
|
|
||||||
if (FormData.status != 2 && FormData.status != undefined) return false;
|
|
||||||
uploadFile().then(data => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
sfz1: data.url
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const uploadSfz2 = () => {
|
|
||||||
if (FormData.status != 2 && FormData.status != undefined) return false;
|
|
||||||
uploadFile().then(data => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
sfz2: data.url
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const uploadZzImg = () => {
|
|
||||||
if (FormData.status != 2 && FormData.status != undefined) return false;
|
|
||||||
uploadFile().then(data => {
|
|
||||||
setFormData({
|
|
||||||
...FormData,
|
|
||||||
zzImg: data.url
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reload()
|
reload()
|
||||||
@@ -173,27 +143,72 @@ function Index() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Form.Item
|
{/*<Form.Item*/}
|
||||||
label="类型"
|
{/* label="类型"*/}
|
||||||
name="type"
|
{/* name="type"*/}
|
||||||
initialValue={FormData.type}
|
{/* initialValue={FormData.type}*/}
|
||||||
required
|
{/* required*/}
|
||||||
>
|
{/*>*/}
|
||||||
<Radio.Group value={FormData?.type} direction="horizontal"
|
{/* <Radio.Group value={FormData?.type} direction="horizontal"*/}
|
||||||
disabled={FormData.status != 2 && FormData.status != undefined}
|
{/* disabled={FormData.status != 2 && FormData.status != undefined}*/}
|
||||||
onChange={(value) => setFormData({...FormData, type: value})}>
|
{/* onChange={(value) => setFormData({...FormData, type: value})}>*/}
|
||||||
<Radio key={0} value={0}>
|
{/* <Radio key={0} value={0}>*/}
|
||||||
个人
|
{/* 个人*/}
|
||||||
</Radio>
|
{/* </Radio>*/}
|
||||||
<Radio key={1} value={1}>
|
{/* <Radio key={1} value={1}>*/}
|
||||||
企业
|
{/* 企业*/}
|
||||||
</Radio>
|
{/* </Radio>*/}
|
||||||
</Radio.Group>
|
{/* </Radio.Group>*/}
|
||||||
</Form.Item>
|
{/*</Form.Item>*/}
|
||||||
|
|
||||||
|
{FormData.status != 1 && (
|
||||||
|
<>
|
||||||
|
<ConfigProvider
|
||||||
|
theme={{
|
||||||
|
nutuiSearchbarBackground: '#ffffff',
|
||||||
|
nutuiSearchbarContentBackground: '#eee',
|
||||||
|
nutuiSearchbarInputTextAlign: 'right',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<SearchBar className={'mt-3'} placeholder={'搜索站点'} onChange={(val: string) => searchSiteList(val)} maxLength={10} />
|
||||||
|
</ConfigProvider>
|
||||||
|
<div className={'p-3'}
|
||||||
|
>
|
||||||
|
<Radio.Group defaultValue={FormData.organizationId} direction="horizontal">
|
||||||
|
{siteList.map((item: any,index) => (
|
||||||
|
<Cell className={'px-2'} key={item.organizationId} onClick={() => onOrganizationChange(item)}>
|
||||||
|
<Radio key={index} value={item.organizationId}>{item.organizationName}</Radio>
|
||||||
|
</Cell>
|
||||||
|
))}
|
||||||
|
</Radio.Group>
|
||||||
|
{/*{siteList.length == 0 && (*/}
|
||||||
|
{/* <div className={'text-center'}>*/}
|
||||||
|
{/* <span className={'text-gray-400 text-sm'}>没有搜索结果</span>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*)}*/}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
|
||||||
|
)}
|
||||||
|
|
||||||
{
|
{
|
||||||
// 个人类型
|
// 个人类型
|
||||||
FormData.type == 0 && (
|
FormData.type == 0 && (
|
||||||
<>
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={'所属站点'}
|
||||||
|
name="organizationId"
|
||||||
|
required
|
||||||
|
initialValue={FormData.organizationName}
|
||||||
|
rules={[{message: '请输入所属站点'}]}
|
||||||
|
>
|
||||||
|
<Input
|
||||||
|
placeholder={'请输入所属站点'}
|
||||||
|
type="text"
|
||||||
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
|
value={FormData?.organizationName}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={'真实姓名'}
|
label={'真实姓名'}
|
||||||
name="realName"
|
name="realName"
|
||||||
@@ -210,103 +225,118 @@ function Index() {
|
|||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={'身份证号码'}
|
label={'手机号码'}
|
||||||
name="idCard"
|
name="phone"
|
||||||
required
|
required
|
||||||
initialValue={FormData.idCard}
|
initialValue={FormData.phone}
|
||||||
rules={[{message: '请输入身份证号码'}]}
|
rules={[{message: '请输入手机号码'}]}
|
||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
placeholder="请输入身份证号码"
|
placeholder={'请输入手机号'}
|
||||||
type="text"
|
type="text"
|
||||||
value={FormData?.idCard}
|
|
||||||
disabled={FormData.status != 2 && FormData.status != undefined}
|
disabled={FormData.status != 2 && FormData.status != undefined}
|
||||||
maxLength={18}
|
value={FormData?.phone}
|
||||||
onChange={(value) => setFormData({...FormData, idCard: value})}
|
onChange={(value) => setFormData({...FormData, phone: value})}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
{/*<Form.Item*/}
|
||||||
label={'上传证件'}
|
{/* label={'身份证号码'}*/}
|
||||||
name="image"
|
{/* name="idCard"*/}
|
||||||
required
|
{/* required*/}
|
||||||
rules={[{message: '请上传身份证正反面'}]}
|
{/* initialValue={FormData.idCard}*/}
|
||||||
>
|
{/* rules={[{message: '请输入身份证号码'}]}*/}
|
||||||
<div className={'flex gap-2'}>
|
{/*>*/}
|
||||||
<div onClick={uploadSfz1}>
|
{/* <Input*/}
|
||||||
<Image src={FormData.sfz1}
|
{/* placeholder="请输入身份证号码"*/}
|
||||||
radius="10%" width="80" height="80"/>
|
{/* type="text"*/}
|
||||||
</div>
|
{/* value={FormData?.idCard}*/}
|
||||||
<div onClick={uploadSfz2}>
|
{/* disabled={FormData.status != 2 && FormData.status != undefined}*/}
|
||||||
<Image src={FormData.sfz2} mode={'scaleToFill'}
|
{/* maxLength={18}*/}
|
||||||
radius="10%" width="80" height="80"/>
|
{/* onChange={(value) => setFormData({...FormData, idCard: value})}*/}
|
||||||
</div>
|
{/* />*/}
|
||||||
</div>
|
{/*</Form.Item>*/}
|
||||||
</Form.Item>
|
{/*<Form.Item*/}
|
||||||
|
{/* label={'上传证件'}*/}
|
||||||
|
{/* name="image"*/}
|
||||||
|
{/* required*/}
|
||||||
|
{/* rules={[{message: '请上传身份证正反面'}]}*/}
|
||||||
|
{/*>*/}
|
||||||
|
{/* <div className={'flex gap-2'}>*/}
|
||||||
|
{/* <div onClick={uploadSfz1}>*/}
|
||||||
|
{/* <Image src={FormData.sfz1}*/}
|
||||||
|
{/* radius="10%" width="80" height="80"/>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* <div onClick={uploadSfz2}>*/}
|
||||||
|
{/* <Image src={FormData.sfz2} mode={'scaleToFill'}*/}
|
||||||
|
{/* radius="10%" width="80" height="80"/>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/* </div>*/}
|
||||||
|
{/*</Form.Item>*/}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{/*{*/}
|
||||||
// 企业类型
|
{/* // 企业类型*/}
|
||||||
FormData.type == 1 && (
|
{/* FormData.type == 1 && (*/}
|
||||||
<>
|
{/* <>*/}
|
||||||
<Form.Item
|
{/* <Form.Item*/}
|
||||||
label={'主体名称'}
|
{/* label={'主体名称'}*/}
|
||||||
name="name"
|
{/* name="name"*/}
|
||||||
required
|
{/* required*/}
|
||||||
initialValue={FormData.name}
|
{/* initialValue={FormData.name}*/}
|
||||||
rules={[{message: '请输入公司名称或单位名称'}]}
|
{/* rules={[{message: '请输入公司名称或单位名称'}]}*/}
|
||||||
>
|
{/* >*/}
|
||||||
<Input
|
{/* <Input*/}
|
||||||
placeholder={'请输入主体名称'}
|
{/* placeholder={'请输入主体名称'}*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
value={FormData?.name}
|
{/* value={FormData?.name}*/}
|
||||||
onChange={(value) => setFormData({...FormData, name: value})}
|
{/* onChange={(value) => setFormData({...FormData, name: value})}*/}
|
||||||
/>
|
{/* />*/}
|
||||||
</Form.Item>
|
{/* </Form.Item>*/}
|
||||||
<Form.Item
|
{/* <Form.Item*/}
|
||||||
label={'营业执照号码'}
|
{/* label={'营业执照号码'}*/}
|
||||||
name="zzCode"
|
{/* name="zzCode"*/}
|
||||||
required
|
{/* required*/}
|
||||||
initialValue={FormData.zzCode}
|
{/* initialValue={FormData.zzCode}*/}
|
||||||
rules={[{message: '请输入营业执照号码'}]}
|
{/* rules={[{message: '请输入营业执照号码'}]}*/}
|
||||||
>
|
{/* >*/}
|
||||||
<Input
|
{/* <Input*/}
|
||||||
placeholder="请输入营业执照号码"
|
{/* placeholder="请输入营业执照号码"*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
value={FormData?.zzCode}
|
{/* value={FormData?.zzCode}*/}
|
||||||
maxLength={18}
|
{/* maxLength={18}*/}
|
||||||
onChange={(value) => setFormData({...FormData, zzCode: value})}
|
{/* onChange={(value) => setFormData({...FormData, zzCode: value})}*/}
|
||||||
/>
|
{/* />*/}
|
||||||
</Form.Item>
|
{/* </Form.Item>*/}
|
||||||
<Form.Item
|
{/* <Form.Item*/}
|
||||||
label={'上传营业执照'}
|
{/* label={'上传营业执照'}*/}
|
||||||
name="zzImg"
|
{/* name="zzImg"*/}
|
||||||
required
|
{/* required*/}
|
||||||
rules={[{message: '请上传营业执照'}
|
{/* rules={[{message: '请上传营业执照'}*/}
|
||||||
]}
|
{/* ]}*/}
|
||||||
>
|
{/* >*/}
|
||||||
<div onClick={uploadZzImg}>
|
{/* <div onClick={uploadZzImg}>*/}
|
||||||
<Image src={FormData.zzImg} mode={'scaleToFill'}
|
{/* <Image src={FormData.zzImg} mode={'scaleToFill'}*/}
|
||||||
radius="10%" width="80" height="80"/>
|
{/* radius="10%" width="80" height="80"/>*/}
|
||||||
</div>
|
{/* </div>*/}
|
||||||
</Form.Item>
|
{/* </Form.Item>*/}
|
||||||
</>
|
{/* </>*/}
|
||||||
)
|
{/* )*/}
|
||||||
}
|
{/*}*/}
|
||||||
<Form.Item
|
{/*<Form.Item*/}
|
||||||
label={'真实姓名'}
|
{/* label={'真实姓名'}*/}
|
||||||
name="realName"
|
{/* name="realName"*/}
|
||||||
required
|
{/* required*/}
|
||||||
initialValue={FormData.realName}
|
{/* initialValue={FormData.realName}*/}
|
||||||
rules={[{message: '请输入真实姓名'}]}
|
{/* rules={[{message: '请输入真实姓名'}]}*/}
|
||||||
>
|
{/*>*/}
|
||||||
<Input
|
{/* <Input*/}
|
||||||
placeholder={'请输入真实姓名'}
|
{/* placeholder={'请输入真实姓名'}*/}
|
||||||
type="text"
|
{/* type="text"*/}
|
||||||
value={FormData?.realName}
|
{/* value={FormData?.realName}*/}
|
||||||
onChange={(value) => setFormData({...FormData, realName: value})}
|
{/* onChange={(value) => setFormData({...FormData, realName: value})}*/}
|
||||||
/>
|
{/* />*/}
|
||||||
</Form.Item>
|
{/*</Form.Item>*/}
|
||||||
{
|
{
|
||||||
FormData.status != undefined && (
|
FormData.status != undefined && (
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
Reference in New Issue
Block a user