飘泊客 11 months ago
commit 800f944b84

@ -140,7 +140,7 @@ export type SysUserDTOTag = {
} }
export type SysUserDTO = { export type SysUserDTO = {
//标签组名 //标签组名
name: string | undefined name?: string | undefined
// 主键id // 主键id
// userId?: number // userId?: number
// // 前端传入密码 // // 前端传入密码
@ -164,8 +164,13 @@ export type SysUserDTO = {
// organizationId?: number // organizationId?: number
// // 角色标识列表 // // 角色标识列表
// roleCodes: string[] // roleCodes: string[]
desc: objectState desc?: objectState
// stage?: objectState // stage?: objectState
//计费开关
chargingStatus?: number
nickname?: string | undefined
//剩余线索数量
residueClueNum?: number | undefined
} }
//编辑线索阶段表单 //编辑线索阶段表单

@ -11,10 +11,8 @@
:width="850" :width="850"
@cancel="handleClose" @cancel="handleClose"
> >
<a-tabs <a-tabs
v-if=" v-if="title === '新建预约'"
title === '新建预约'
"
v-model:activeKey="activeKey" v-model:activeKey="activeKey"
centered centered
@change="tabsChange" @change="tabsChange"
@ -22,14 +20,8 @@
<a-tab-pane key="1" tab="A类型客户"> </a-tab-pane> <a-tab-pane key="1" tab="A类型客户"> </a-tab-pane>
<a-tab-pane key="2" tab="B类型客户" force-render> </a-tab-pane> <a-tab-pane key="2" tab="B类型客户" force-render> </a-tab-pane>
</a-tabs> </a-tabs>
<a-tabs
v-else-if=" <a-tabs v-else v-model:activeKey="activeKey" centered>
title !== '新建预约'
"
v-model:activeKey="activeKey"
centered
@change="tabsChange"
>
<a-tab-pane v-if="formModel.customType === 0" key="1" tab="A类型客户"> </a-tab-pane> <a-tab-pane v-if="formModel.customType === 0" key="1" tab="A类型客户"> </a-tab-pane>
<a-tab-pane v-if="formModel.customType === 1" key="2" tab="B类型客户" force-render> <a-tab-pane v-if="formModel.customType === 1" key="2" tab="B类型客户" force-render>
</a-tab-pane> </a-tab-pane>
@ -430,8 +422,12 @@
</p> </p>
</div> </div>
</a-modal> </a-modal>
<!-- 匹配信息确认弹窗 --> <!-- 匹配信息确认弹窗 -->
<a-modal v-model:visible="matchregisterVisible" title="确认信息" @ok="matchhandleOk"> <a-modal
v-model:visible="matchregisterVisible"
title="确认信息"
@ok="matchhandleOk(formModel.detailAddress)"
>
<p>重新匹配将清空预约门店信息,是否重新匹配?</p> <p>重新匹配将清空预约门店信息,是否重新匹配?</p>
</a-modal> </a-modal>
</a-modal> </a-modal>
@ -473,7 +469,13 @@ const userInfoCurrent = ref<string | undefined>('')
// required: true, // required: true,
// trigger: 'change' // trigger: 'change'
// } // }
// watch(
// () => activeKey.value,
// (newVal, oldVal) => {
// console.log('newVal, oldVal', newVal, oldVal)
// },
// { immediate: true, deep: true }
// )
onMounted(() => { onMounted(() => {
// //
provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions
@ -496,7 +498,7 @@ onMounted(() => {
}) })
// tab key // tab key
const activeKey = ref('1') const activeKey = ref('')
//tabs change //tabs change
const tabsChange = (val: string) => { const tabsChange = (val: string) => {
handleMapInit() handleMapInit()
@ -530,7 +532,6 @@ const reservationTimeClass = computed(() => ({
/// ///
const isDetailAddressDisabled = ref(false) const isDetailAddressDisabled = ref(false)
const isDetailAddressReadOnly = ref(false) const isDetailAddressReadOnly = ref(false)
const detailAddressReadOnlyDynamicClass = computed(() => ({ const detailAddressReadOnlyDynamicClass = computed(() => ({
'custom-disabled-style': isDetailAddressDisabled.value, 'custom-disabled-style': isDetailAddressDisabled.value,
'custom-readonly-style': 'custom-readonly-style':
@ -555,7 +556,6 @@ const addressChange = async (value: any) => {
formModel.economize = value[0] formModel.economize = value[0]
formModel.market = value[1] formModel.market = value[1]
formModel.distinguish = value[2] formModel.distinguish = value[2]
// console.log(value.length, 'value.length')
// if (value.length === 2) { // if (value.length === 2) {
// formModel.detailAddress = value[0] + value[1] // formModel.detailAddress = value[0] + value[1]
// } else if (value.length === 3) { // } else if (value.length === 3) {
@ -733,7 +733,6 @@ const accordingAddressGetCenter = () => {
// //
const getLocation = (type: string) => { const getLocation = (type: string) => {
// console.log(address, 'address')
const addressValue = const addressValue =
// //
formModel.address?.toString().split(',').join('') + formModel.detailAddress formModel.address?.toString().split(',').join('') + formModel.detailAddress
@ -744,7 +743,6 @@ const getLocation = (type: string) => {
lng.value = result.geocodes[0].location.lng lng.value = result.geocodes[0].location.lng
lat.value = result.geocodes[0].location.lat lat.value = result.geocodes[0].location.lat
formModel.otherAddressesInfo = `${lng.value},${lat.value}` formModel.otherAddressesInfo = `${lng.value},${lat.value}`
console.log(lng.value, lat.value, 'lng.value')
// //
map.value.setCenter([lng.value, lat.value]) // map.value.setCenter([lng.value, lat.value]) //
if (type === 'match') { if (type === 'match') {
@ -779,7 +777,6 @@ const getLocation = (type: string) => {
// //
const getCenterMarker = (type: string, lng: number, lat: number) => { const getCenterMarker = (type: string, lng: number, lat: number) => {
formModel.otherAddressesInfo = `${lng},${lat}` formModel.otherAddressesInfo = `${lng},${lat}`
console.log(lng, lat, 'lng')
// //
map.value.setCenter([lng, lat]) // map.value.setCenter([lng, lat]) //
if (type === 'match' || type === 'select') { if (type === 'match' || type === 'select') {
@ -822,7 +819,6 @@ const getCenterMarkerAddress = () => {
// //
const pois = result.poiList.pois const pois = result.poiList.pois
console.log(pois, 'pois') console.log(pois, 'pois')
console.log(formModel.detailAddress, 'formModel.detailAddress匹配')
// //
if (pois[0].name.includes('小区')) { if (pois[0].name.includes('小区')) {
const result = pois[0].name.replace('小区', '') const result = pois[0].name.replace('小区', '')
@ -999,11 +995,6 @@ const pagingQuery = (lng: number | undefined, lat: number | undefined) => {
const accordingStorenameMatch = (pois: any) => { const accordingStorenameMatch = (pois: any) => {
isName.value = false isName.value = false
getCenterMarker('match', pois[0].location.lng, pois[0].location.lat) getCenterMarker('match', pois[0].location.lng, pois[0].location.lat)
console.log(
pois[0].location.lng,
pois[0].location.lat,
'pois[0].location.lng, pois[0].location.lat'
)
} }
// //
const accordingAddressMatch = () => { const accordingAddressMatch = () => {
@ -1016,7 +1007,9 @@ const idThen = (detailAddress: string) => {
listData.value = [] listData.value = []
lng.value = undefined lng.value = undefined
lat.value = undefined lat.value = undefined
// if (map.value && typeof map.value.clearMap === 'function') {
map.value.clearMap() map.value.clearMap()
// }
// city.value = formModel.market?.slice(0, -1) // city.value = formModel.market?.slice(0, -1)
// //
@ -1111,39 +1104,45 @@ const idThen = (detailAddress: string) => {
// //
const match = async (detailAddress: string) => { const match = async (detailAddress: string) => {
// console.log(listData.length,'listData.length') // console.log(listData.length,'listData.length')
console.log(title.value,'title.value') console.log(title.value, 'title.value')
if (activeKey.value === '1') { if (activeKey.value === '1') {
if(title.value==='新建预约'&&formModel.customStoreEntities.length!==0){ if (title.value === '新建预约' && formModel.customStoreEntities.length !== 0) {
matchregisterVisible.value=true matchregisterVisible.value = true
}else{ } else {
const fields = ['address', 'detailAddress', 'radius'] // const fields = ['address', 'detailAddress', 'radius'] //
formRef.value formRef.value
?.validateFields(fields) ?.validateFields(fields)
.then(() => { .then(() => {
idThen(detailAddress) idThen(detailAddress)
}) })
.catch(() => { .catch(() => {
// //
console.log('校验失败') console.log('校验失败')
}) })
} }
} else { } else {
if(title.value==='新建预约'&&formModel.customStoreEntities.length!==0){ if (title.value === '新建预约' && formModel.customStoreEntities.length !== 0) {
matchregisterVisible.value=true matchregisterVisible.value = true
}else{ } else {
if (formModel.address && formModel.address.length === 0) { if (formModel.address && formModel.address.length === 0) {
message.info('请输入您的地址信息') return message.info('请输入您的地址信息')
} if (!formModel.detailAddress) { }
message.info('请输入您的详细地址信息') if (!formModel.detailAddress) {
} if(!formModel.radius){ return message.info('请输入您的详细地址信息')
message.info('请选择区域半径') }
} if (!formModel.radius) {
if(formModel.address && formModel.address.length>0&&formModel.detailAddress&&formModel.radius){ return message.info('请选择区域半径')
idThen(detailAddress) }
if (
formModel.address &&
formModel.address.length > 0 &&
formModel.detailAddress &&
formModel.radius
) {
idThen(detailAddress)
}
} }
} }
}
} }
// //
const resetForm = () => { const resetForm = () => {
@ -1282,26 +1281,26 @@ const handleOk = async () => {
await submitOperate() await submitOperate()
} }
// //
const matchhandleOk = async () => { const matchhandleOk = async (detailAddress: string) => {
matchregisterVisible.value=false matchregisterVisible.value = false
listData.value.forEach((item:any)=>{ listData.value.forEach((item: any) => {
item.disabled=false item.disabled = false
}) })
if (infoWindows.value) { if (infoWindows.value) {
infoWindows.value.close(); // infoWindows.value.close() //
} }
formModel.customStoreEntities=[] formModel.customStoreEntities = []
// listData.value=[] // listData.value=[]
const fields = ['address', 'detailAddress', 'radius'] // const fields = ['address', 'detailAddress', 'radius'] //
formRef.value formRef.value
?.validateFields(fields) ?.validateFields(fields)
.then(() => { .then(() => {
idThen(detailAddress) idThen(detailAddress)
}) })
.catch(() => { .catch(() => {
// //
console.log('校验失败') console.log('校验失败')
}) })
// await submitOperate() // await submitOperate()
} }
// //
@ -1413,9 +1412,9 @@ const handleSubmit = () => {
// //
const handleClose = () => { const handleClose = () => {
activeKey.value = '1' // activeKey.value = '1'
/// ///
isAddressDisabled.value = isAddressDisabled.value =
isAddressReadOnly.value = isAddressReadOnly.value =
isDetailAddressDisabled.value = isDetailAddressDisabled.value =
isDetailAddressReadOnly.value = isDetailAddressReadOnly.value =
@ -1445,22 +1444,28 @@ interface openObj {
type?: string type?: string
record?: GeopoliticalCustomersRecord record?: GeopoliticalCustomersRecord
} }
const handleMapInit = () => { const handleMapInit = async () => {
nextTick(() => { await nextTick(async () => {
initMap() await initMap()
}) })
} }
defineExpose({ defineExpose({
open(opendata: openObj) { open(opendata: openObj) {
console.log(activeKey.value, 'activeKey.value')
isSubmit.value = false isSubmit.value = false
openModal() openModal()
resetFields.value() console.log('formModel.customType resssssssss', formModel.customType)
if (userInfoCurrent.value === 'ROLE_REVIEWER') { //resetFields.value(),resetFields.value()formModel.customType0
formModel.customType = 1 // resetFields.value()
} else if (userInfoCurrent.value === 'ROLE_PRELIMINARY_EXAMINER') { // formModel.customType = undefined
formModel.customType = 0 formModel.customStoreEntities = []
} console.log('formModel.customType ddddddddddd', formModel.customType)
// if (userInfoCurrent.value === 'ROLE_REVIEWER') {
// formModel.customType = 1
// } else if (userInfoCurrent.value === 'ROLE_PRELIMINARY_EXAMINER') {
// formModel.customType = 0
// }
const handleSuccess = (res: any) => { const handleSuccess = (res: any) => {
const data = res.data || {} const data = res.data || {}
@ -1494,6 +1499,7 @@ defineExpose({
formModel.distinguish = distinguish formModel.distinguish = distinguish
formModel.detailAddress = detailAddress formModel.detailAddress = detailAddress
formModel.customType = customType formModel.customType = customType
console.log(formModel.customType, '111')
formModel.otherAddressesInfo = otherAddressesInfo formModel.otherAddressesInfo = otherAddressesInfo
formModel.radius = radius formModel.radius = radius
@ -1502,8 +1508,16 @@ defineExpose({
formModel.customStoreEntities.forEach((i: any) => { formModel.customStoreEntities.forEach((i: any) => {
i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime) i.option = generateTimeSlots(i.tradeStartTime, i.tradeEndTime)
}) })
const getActiveKey = () => {
if (formModel.customType === 0) {
activeKey.value = '1'
} else {
activeKey.value = '2'
}
}
if (opendata.type === 'audit') { if (opendata.type === 'audit') {
handleMapInit() getActiveKey()
// handleMapInit()
title.value = '编辑' title.value = '编辑'
// activeKey.value=formModel.customType // activeKey.value=formModel.customType
if (formModel.address.length !== 0) { if (formModel.address.length !== 0) {
@ -1517,22 +1531,15 @@ defineExpose({
isDetailAddressDisabled.value = true isDetailAddressDisabled.value = true
} }
if (formModel.address.length !== 0 && formModel.detailAddress && formModel.radius) { if (formModel.address.length !== 0 && formModel.detailAddress && formModel.radius) {
match(formModel.detailAddress) handleMapInit().then(() => {
match(formModel.detailAddress)
})
} }
} else if (opendata.type === 'edit') { } else if (opendata.type === 'edit') {
handleMapInit() getActiveKey()
title.value = '编辑预约' title.value = '编辑预约'
// if(formModel.customType===0){
// activeKey.value='1'
// }else if(formModel.customType===1){
// activeKey.value='2'
// }
if (formModel.address.length !== 0) { if (formModel.address.length !== 0) {
isAddressDisabled.value = true isAddressDisabled.value = true
// isRadiusDisabled.value = true
// isRadiusReadOnly.value = true
// match(formModel.detailAddress)
} }
if (formModel.radius) { if (formModel.radius) {
isRadiusDisabled.value = true isRadiusDisabled.value = true
@ -1541,28 +1548,25 @@ defineExpose({
isDetailAddressDisabled.value = true isDetailAddressDisabled.value = true
} }
if (formModel.address.length !== 0 && formModel.detailAddress && formModel.radius) { if (formModel.address.length !== 0 && formModel.detailAddress && formModel.radius) {
match(formModel.detailAddress) handleMapInit().then(() => {
match(formModel.detailAddress)
})
}
} else if (opendata.type === 'view') {
if (formModel.customType === 0) {
activeKey.value = '1'
} else {
activeKey.value = '2'
} }
}
}
if (opendata.newFormAction === FormAction.CREATE) {
handleMapInit()
title.value = '新建预约'
formModel.customStoreEntities.length = 0
} else if (opendata.newFormAction === FormAction.UPDATE) {
doRequest(getDetail({ id: opendata.record?.customId }), {
onSuccess: handleSuccess
})
if (opendata.type === 'view') {
title.value = '详情' title.value = '详情'
console.log(formModel.customType, 'formModel.customTypeA')
isAddressReadOnly.value = true isAddressReadOnly.value = true
isRadiusReadOnly.value = true isRadiusReadOnly.value = true
isDetailAddressReadOnly.value = true isDetailAddressReadOnly.value = true
isReservationTimeisReadOnly.value = true isReservationTimeisReadOnly.value = true
} else if (opendata.type === 'distribute') { } else if (opendata.type === 'distribute') {
getActiveKey()
title.value = '分发' title.value = '分发'
isAddressReadOnly.value = true isAddressReadOnly.value = true
isRadiusReadOnly.value = true isRadiusReadOnly.value = true
@ -1573,6 +1577,17 @@ defineExpose({
formModel.description = 1 formModel.description = 1
} }
} }
if (opendata.newFormAction === FormAction.CREATE) {
activeKey.value = '1'
handleMapInit()
title.value = '新建预约'
formModel.customStoreEntities.length = 0
} else if (opendata.newFormAction === FormAction.UPDATE) {
doRequest(getDetail({ id: opendata.record?.customId }), {
onSuccess: handleSuccess
})
}
formAction.value = opendata.newFormAction formAction.value = opendata.newFormAction
} }
}) })
@ -1775,7 +1790,7 @@ const initMap = async () => {
// center: [120.1551, 30.2741], // // center: [120.1551, 30.2741], //
zoom: 18 // zoom: 18 //
}) })
console.log(map.value, 'map.value') console.log(map.value, 'initMap map.value')
// await auto('') // await auto('')
if ( if (
(title.value === '编辑预约' && formModel.otherAddressesInfo) || (title.value === '编辑预约' && formModel.otherAddressesInfo) ||

@ -147,6 +147,12 @@ const columns: ProColumns[] = [
return h(DictBadge, { dictCode: 'user_status', value: value }) return h(DictBadge, { dictCode: 'user_status', value: value })
} }
}, },
{
key: 'residueClueNum',
title: '剩余线索数量',
dataIndex: 'residueClueNum',
width: '100px'
},
{ {
title: '创建日期', title: '创建日期',
dataIndex: 'createTime', dataIndex: 'createTime',

@ -34,9 +34,8 @@
placeholder="请选择" placeholder="请选择"
/> />
</a-form-item> </a-form-item>
<a-form-item label="线索数量">
<a-form-item label="状态"> <a-input v-model:value="formModel.residueClueNum" placeholder="请输入" />
<dict-radio-group v-model:value="formModel.status" dict-code="user_status" />
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -62,6 +61,9 @@
@changes="updateRole" @changes="updateRole"
/> />
</a-form-item> </a-form-item>
<a-form-item label="状态">
<dict-radio-group v-model:value="formModel.status" dict-code="user_status" />
</a-form-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -98,7 +100,8 @@ const formModel = reactive<SysUserDTO>({
gender: 1, gender: 1,
phoneNumber: '', phoneNumber: '',
email: '', email: '',
roleCodes: [] roleCodes: [],
residueClueNum: undefined
}) })
// //

@ -58,6 +58,19 @@
<template #icon><UserOutlined /></template> <template #icon><UserOutlined /></template>
</a-avatar> </a-avatar>
</template> </template>
<template v-else-if="column.key === 'chargingStatus'">
<a-switch
v-if="record.whichUserId === 1"
:checked="record.chargingStatus === 1 ? true : false"
@change="switchChange(record)"
/>
<span v-else></span>
</template>
<template v-else-if="column.key === 'residueClueNum'">
<span v-if="record.whichUserId !== 1">{{ record.residueClueNum }}</span>
<span v-else></span>
</template>
<template v-else-if="column.key === 'operate'"> <template v-else-if="column.key === 'operate'">
<a-dropdown :trigger="['click']"> <a-dropdown :trigger="['click']">
<a class="ant-dropdown-link" @click.prevent> 操作 </a> <a class="ant-dropdown-link" @click.prevent> 操作 </a>
@ -127,6 +140,9 @@ import { doRequest } from '@/utils/axios/request'
import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface' import type { MenuInfo } from 'ant-design-vue/es/menu/src/interface'
import { DictBadge, DictText } from '@/components/Dict' import { DictBadge, DictText } from '@/components/Dict'
import { NewButton, DeleteTextButton } from '@/components/Button' import { NewButton, DeleteTextButton } from '@/components/Button'
//
import { updateUser } from '@/api/system/user'
import { message } from 'ant-design-vue'
defineOptions({ name: 'SysUserPage' }) defineOptions({ name: 'SysUserPage' })
@ -243,6 +259,26 @@ const uploadAvatarProcessor = (fileObj: FileObject, record: SysUserPageVO) => {
return res return res
}) })
} }
const switchChange = (record: any) => {
if (record.chargingStatus === 1) {
record.chargingStatus = 0
} else {
record.chargingStatus = 1
}
doRequest(
updateUser(
toRaw({
chargingStatus: record.chargingStatus,
username: record.username,
userId: record.userId,
nickname: record.nickname
})
),
{
onSuccess: (res: any) => {}
}
)
}
// //
const columns: ProColumns[] = [ const columns: ProColumns[] = [
@ -281,6 +317,19 @@ const columns: ProColumns[] = [
return h(DictBadge, { dictCode: 'user_status', value: value }) return h(DictBadge, { dictCode: 'user_status', value: value })
} }
}, },
{
key: 'chargingStatus',
title: '计费开关',
dataIndex: 'chargingStatus',
width: '80px'
},
{
key: 'residueClueNum',
title: '剩余线索数量',
dataIndex: 'residueClueNum',
width: '100px',
align: 'center'
},
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',

Loading…
Cancel
Save