master
飘泊客 1 year ago
parent 79c55346e5
commit f735ec4559

@ -132,3 +132,12 @@ export function updateCustomerAudit(customId: number, status: number, salesmanTy
salesmanType salesmanType
}) })
} }
/**
* ID
*
*/
export function getCustomDetails(id: number) {
return httpClient.get<ApiResult>('/custom/details', {
params: { id }
})
}

@ -252,6 +252,9 @@ export interface GeopoliticalCustomersSearch {
startTime?: string startTime?: string
// 访问时间区间的结束值 // 访问时间区间的结束值
endTime?: string endTime?: string
// 分发时间
distributeStartTime?: string
distributeEndTime?: string
} }
/** /**
* *

@ -1,8 +1,6 @@
/* 使用源对象,覆盖目标对象的已有属性 */ /* 使用源对象,覆盖目标对象的已有属性 */
export function overrideProperties<T>(target: T, source: any, excludes?: string[]): T { export function overrideProperties<T>(target: T, source: any, excludes?: string[]): T {
if (!source) return target if (!source) return target
console.log('target==', target)
console.log('source==', source)
// @ts-ignore // @ts-ignore
Object.keys(target).forEach(key => { Object.keys(target).forEach(key => {
const result = target as any const result = target as any
@ -10,6 +8,5 @@ export function overrideProperties<T>(target: T, source: any, excludes?: string[
result[key] = source[key] result[key] = source[key]
} }
}) })
console.log('return---', target)
return target return target
} }

@ -412,6 +412,7 @@ onMounted(() => {
// //
// provincesAndCitiesAndAutonomousOptions.value = provincesAndCitiesAndAutonomousRegions // provincesAndCitiesAndAutonomousOptions.value = provincesAndCitiesAndAutonomousRegions
provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions provincesAndCitiesAndAutonomousOptions.value = window.globalProvincesAndCitiesAndAutonomousRegions
console.log('provincesAndCitiesAndAutonomousOptions==', provincesAndCitiesAndAutonomousOptions.value)
}) })
/// ///
@ -433,9 +434,11 @@ const formRef = ref<FormInstance>()
const provincesAndCitiesAndAutonomousOptions: any = ref([]) const provincesAndCitiesAndAutonomousOptions: any = ref([])
//change //change
const addressChange = (value: any) => { const addressChange = (value: any) => {
formModel.economize = value[0] if (value) {
formModel.market = value[1] formModel.economize = value[0]
formModel.distinguish = value[2] formModel.market = value[1]
formModel.distinguish = value[2]
}
} }
//(ref) //(ref)

@ -17,15 +17,9 @@
:pagination="{ showQuickJumper: true }" :pagination="{ showQuickJumper: true }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyId'"> <template v-if="column.key === 'operate'">
<a>
<!-- {{ record.companyId }} -->
蘑菇
</a>
</template>
<template v-else-if="column.key === 'operate'">
<operation-group> <operation-group>
<a @click="handleView(record)"></a> <a @click="handleView(record.customId)"></a>
</operation-group> </operation-group>
</template> </template>
</template> </template>
@ -86,8 +80,8 @@ const searchTable = (params: GeopoliticalCustomersPageParam) => {
reloadTable(true) // tableRequest reloadTable(true) // tableRequest
} }
// //
const handleView = (record: GeopoliticalCustomersRecord) => { const handleView = (id: number) => {
inspectionModalRef.value?.open(FormAction.OTHER, record) inspectionModalRef.value?.open(FormAction.OTHER, id)
} }
const columns: ProColumns[] = [ const columns: ProColumns[] = [
@ -123,6 +117,19 @@ const columns: ProColumns[] = [
} }
} }
}, },
{
title: '分发日期',
dataIndex: 'distributeTime',
width: 230,
align: 'center',
customRender: function ({ record }: any) {
if (record.distributeTime) {
return record.distributeTime
} else if (record.distributeTime === null) {
return '--'
}
}
},
{ {
title: '录入日期', title: '录入日期',
dataIndex: 'createTime', dataIndex: 'createTime',
@ -138,7 +145,7 @@ const columns: ProColumns[] = [
}, },
{ {
title: '录入员', title: '录入员',
dataIndex: 'companyId' dataIndex: 'enterName'
}, },
{ {
key: 'operate', key: 'operate',

@ -57,10 +57,20 @@
<template #footer> <template #footer>
<div v-if="title !== '详情'"> <div v-if="title !== '详情'">
<a-button v-if="title !== '审核'" @click="visible = false"></a-button> <a-button v-if="title !== '审核'" @click="visible = false"></a-button>
<a-button type="primary" html-type="submit" style="margin-left: 10px" @click="toExamine(0)" <a-button
v-if="formModel.enrollStatus == 1"
type="primary"
html-type="submit"
style="margin-left: 10px"
@click="toExamine(0)"
>重审</a-button >重审</a-button
> >
<a-button type="primary" html-type="submit" style="margin-left: 10px" @click="toExamine(1)" <a-button
v-if="formModel.enrollStatus == 1"
type="primary"
html-type="submit"
style="margin-left: 10px"
@click="toExamine(1)"
>分发</a-button >分发</a-button
> >
</div> </div>
@ -74,10 +84,11 @@ import { useModal } from '@/hooks/modal'
import type { FormRequestMapping } from '@/hooks/form' import type { FormRequestMapping } from '@/hooks/form'
import { overrideProperties } from '@/utils/bean-utils' import { overrideProperties } from '@/utils/bean-utils'
import { message } from 'ant-design-vue' import { message } from 'ant-design-vue'
import type { CustomerDTO, GeopoliticalCustomersRecord } from '@/api/geopoliticalCustomers/types'
import { updateCustomerAudit } from '@/api/geopoliticalCustomers/index' import { updateCustomerAudit } from '@/api/geopoliticalCustomers/index'
import { useAdminForm, useFormAction, FormAction, labelCol, wrapperCol } from '@/hooks/form' import { useAdminForm, useFormAction, FormAction, labelCol, wrapperCol } from '@/hooks/form'
import { useUserStore } from '@/stores/user-store' import { useUserStore } from '@/stores/user-store'
import { doRequest } from '@/utils/axios/request'
import { getCustomDetails } from '@/api/geopoliticalCustomers'
// //
import 'dayjs/locale/zh-cn' import 'dayjs/locale/zh-cn'
// import dayjs from 'dayjs' // import dayjs from 'dayjs'
@ -101,6 +112,7 @@ interface SysUserPageVO {
customName: string customName: string
customNid: string customNid: string
comprehensiveAddress?: string comprehensiveAddress?: string
enrollStatus?: number
customStoreVOList: ReservationShop[] customStoreVOList: ReservationShop[]
} }
@ -109,7 +121,8 @@ const formModel = reactive<SysUserPageVO>({
customName: '', customName: '',
customNid: '', customNid: '',
comprehensiveAddress: '', comprehensiveAddress: '',
customStoreVOList: [] customStoreVOList: [],
enrollStatus: undefined
}) })
// //
@ -132,6 +145,7 @@ const { submitLoading, resetFields } = useAdminForm(
// onMounted(() => {}) // onMounted(() => {})
const handleClose = () => { const handleClose = () => {
closeModal()
submitLoading.value = false submitLoading.value = false
} }
const toExamine = (type: number) => { const toExamine = (type: number) => {
@ -144,22 +158,21 @@ const toExamine = (type: number) => {
}) })
} }
defineExpose({ defineExpose({
open(newFormAction: FormAction, record?: GeopoliticalCustomersRecord) { open(newFormAction: FormAction, id: number) {
console.log(record, 'record')
openModal() openModal()
resetFields() resetFields()
let record: any = null
if (newFormAction === FormAction.OTHER) { if (newFormAction === FormAction.OTHER) {
title.value = '预约详情' title.value = '预约详情'
record!.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}` doRequest(getCustomDetails(id), {
// record!.customStoreVOList = [ onSuccess: (res: any) => {
// { record = res.data
// storeName: '', record.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}`
// reservationTime: '2023-9-14 10:12:15' overrideProperties(formModel, record)
// } formAction.value = newFormAction
// ] }
overrideProperties(formModel, record) })
} }
formAction.value = newFormAction
} }
}) })
</script> </script>

@ -31,10 +31,10 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<!-- <a-col :xl="8" :md="12" :sm="24"> <a-col :xl="8" :md="12" :sm="24">
<a-form-item label="分发时间"> <a-form-item label="分发时间">
<a-range-picker <a-range-picker
v-model:value="searchTimeValue" v-model:value="distributeTime"
show-time show-time
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
style="width: 100%" style="width: 100%"
@ -43,7 +43,7 @@
}" }"
/> />
</a-form-item> </a-form-item>
</a-col> --> </a-col>
<a-col :xl="24" :md="24" :sm="24"> <a-col :xl="24" :md="24" :sm="24">
<search-actions :loading="props.loading" @search="search" @reset="reset" /> <search-actions :loading="props.loading" @search="search" @reset="reset" />
</a-col> </a-col>
@ -88,6 +88,7 @@ const emits = defineEmits<{
}>() }>()
const shopList: any = ref([]) const shopList: any = ref([])
const searchTimeValue = ref<[Dayjs, Dayjs]>() const searchTimeValue = ref<[Dayjs, Dayjs]>()
const distributeTime = ref<[Dayjs, Dayjs]>()
const formModel = reactive<GeopoliticalCustomersSearch>({ const formModel = reactive<GeopoliticalCustomersSearch>({
customName: '', customName: '',
customNid: '', customNid: '',
@ -113,6 +114,13 @@ const search = () => {
param.startTime = '' param.startTime = ''
param.endTime = '' param.endTime = ''
} }
if (distributeTime.value && distributeTime.value.length == 2) {
param.distributeStartTime = distributeTime.value[0].format('YYYY-MM-DD HH:mm:ss')
param.distributeEndTime = distributeTime.value[1].format('YYYY-MM-DD HH:mm:ss')
} else {
param.startTime = ''
param.endTime = ''
}
emits('search', param) emits('search', param)
} }
@ -121,6 +129,7 @@ const reset = () => {
resetFields() resetFields()
// //
searchTimeValue.value = undefined searchTimeValue.value = undefined
distributeTime.value = undefined
search() search()
} }
</script> </script>

@ -65,7 +65,12 @@
:rules="[{ required: true, message: '请选择营业时间', trigger: ['blur'] }]" :rules="[{ required: true, message: '请选择营业时间', trigger: ['blur'] }]"
name="tradeTime" name="tradeTime"
> >
<a-time-range-picker v-model:value="formModel.tradeTime" value-format="HH:mm:ss" /> <a-time-range-picker
v-model:value="formModel.tradeTime"
:minute-step="30"
:second-step="60"
value-format="HH:mm:ss"
/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -108,7 +113,7 @@
<a-textarea <a-textarea
id="tipinput" id="tipinput"
v-model:value="formModel.address" v-model:value="formModel.address"
:disabled="title == '编辑门店'" :readonly="title == '编辑门店'"
allow-clear allow-clear
auto-size auto-size
placeholder="请输入详细地址" placeholder="请输入详细地址"
@ -306,7 +311,12 @@ defineExpose({
} else if (newFormAction === FormAction.UPDATE) { } else if (newFormAction === FormAction.UPDATE) {
title.value = '编辑门店' title.value = '编辑门店'
const tradeTime = record?.tradeTime.toString() const tradeTime = record?.tradeTime.toString()
record!.tradeTime = tradeTime!.split('-') const time: string[] = tradeTime!.split('-')
if (time) {
time[0] = time[0] + ':00'
time[1] = time[1] + ':00'
}
record!.tradeTime = time
overrideProperties(formModel, record) overrideProperties(formModel, record)
} }
formAction.value = newFormAction formAction.value = newFormAction

@ -57,8 +57,9 @@ const userInfoCurrent = ref<string | undefined>('')
onMounted(() => { onMounted(() => {
userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString() userInfoCurrent.value = userInfo?.roleCodes?.toLocaleString()
if (provincesAndCitiesAndAutonomousRegions) { if (provincesAndCitiesAndAutonomousRegions) {
const addressArray = JSON.parse(JSON.stringify(provincesAndCitiesAndAutonomousRegions))
const arr: any[] = [] const arr: any[] = []
provincesAndCitiesAndAutonomousRegions.forEach(item => { addressArray.forEach((item: any) => {
item.children.forEach((it: any) => { item.children.forEach((it: any) => {
if (it.children) { if (it.children) {
delete it.children delete it.children

Loading…
Cancel
Save