完成:黄家明项目的开发并存档
This commit is contained in:
@@ -19,6 +19,9 @@ import {Scan} from '@nutui/icons-react-taro'
|
||||
import {pageDictData} from "@/api/system/dict-data";
|
||||
import {DictData} from "@/api/system/dict-data/model";
|
||||
import {myUserVerify} from "@/api/system/userVerify";
|
||||
import {listUserRole, updateUserRole} from "@/api/system/userRole";
|
||||
import {UserRole} from "@/api/system/userRole/model";
|
||||
import {updateUser} from "@/api/system/user";
|
||||
|
||||
// 图片数据接口
|
||||
interface UploadedImageData {
|
||||
@@ -40,6 +43,7 @@ const Query = () => {
|
||||
const [dict, setDict] = useState<DictData[]>([])
|
||||
const [adminId, setAdminId] = useState<number>()
|
||||
const [showPreview, setShowPreview] = useState(false)
|
||||
const [userRole, setUserRole] = useState<UserRole>()
|
||||
const [fileList, setFileList] = useState<UploadedImageData[]>([]) // 图片文件列表
|
||||
const [FormData, setFormData] = useState<HjmCar>(
|
||||
{
|
||||
@@ -117,18 +121,33 @@ const Query = () => {
|
||||
});
|
||||
return false
|
||||
}
|
||||
updateHjmCar({...FormData, status: 1, driverId: adminId}).then(() => {
|
||||
Taro.showToast({title: `绑定成功`, icon: 'success'})
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
return Taro.navigateBack()
|
||||
}, 1000)
|
||||
}).catch(() => {
|
||||
Taro.showToast({
|
||||
title: '绑定失败',
|
||||
icon: 'error'
|
||||
});
|
||||
})
|
||||
// 升级为快递员
|
||||
if(userRole){
|
||||
updateHjmCar({
|
||||
...FormData,
|
||||
status: 1,
|
||||
driverId: adminId,
|
||||
driverName: Taro.getStorageSync('RealName')
|
||||
}).then(() => {
|
||||
userRole.roleId = 1738;
|
||||
updateUserRole(userRole).then(() => {
|
||||
Taro.showToast({title: `绑定成功`, icon: 'success'})
|
||||
})
|
||||
updateUser({
|
||||
userId: Taro.getStorageSync('UserId'),
|
||||
organizationId: FormData.organizationId
|
||||
}).then(() => {})
|
||||
setTimeout(() => {
|
||||
reload();
|
||||
return Taro.navigateBack()
|
||||
}, 1000)
|
||||
}).catch(() => {
|
||||
Taro.showToast({
|
||||
title: '绑定失败',
|
||||
icon: 'error'
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const submitFailed = (error: any) => {
|
||||
@@ -308,6 +327,12 @@ const Query = () => {
|
||||
pageDictData({dictCode: 'InsuranceStatus'}).then(res => {
|
||||
setDict(res?.list || [])
|
||||
})
|
||||
// 查询角色
|
||||
listUserRole({userId: Taro.getStorageSync('UserId')}).then(res => {
|
||||
if(res.length > 0){
|
||||
setUserRole(res[0])
|
||||
}
|
||||
})
|
||||
// 检查是否已实名
|
||||
myUserVerify({status: 1}).then(data => {
|
||||
if (!data) {
|
||||
@@ -623,6 +648,9 @@ const Query = () => {
|
||||
<Cell className={'car-info-item-title'}>
|
||||
快递公司品牌:{FormData?.parentOrganization}
|
||||
</Cell>
|
||||
<Cell className={'car-info-item-title'}>
|
||||
所属站点:{FormData?.organization}
|
||||
</Cell>
|
||||
<Cell className={'car-info-item-title'}>
|
||||
管理责任人:{FormData?.parentOrganizationAdmin}
|
||||
</Cell>
|
||||
|
||||
Reference in New Issue
Block a user