修改营业时间

master
doublekou 1 year ago
commit 96adab6ce1

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

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

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

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

@ -17,15 +17,9 @@
:pagination="{ showQuickJumper: true }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'companyId'">
<a>
<!-- {{ record.companyId }} -->
蘑菇
</a>
</template>
<template v-else-if="column.key === 'operate'">
<template v-if="column.key === 'operate'">
<operation-group>
<a @click="handleView(record)"></a>
<a @click="handleView(record.customId)"></a>
</operation-group>
</template>
</template>
@ -86,8 +80,8 @@ const searchTable = (params: GeopoliticalCustomersPageParam) => {
reloadTable(true) // tableRequest
}
//
const handleView = (record: GeopoliticalCustomersRecord) => {
inspectionModalRef.value?.open(FormAction.OTHER, record)
const handleView = (id: number) => {
inspectionModalRef.value?.open(FormAction.OTHER, id)
}
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: '录入日期',
dataIndex: 'createTime',
@ -138,7 +145,7 @@ const columns: ProColumns[] = [
},
{
title: '录入员',
dataIndex: 'companyId'
dataIndex: 'enterName'
},
{
key: 'operate',

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

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

@ -65,7 +65,12 @@
:rules="[{ required: true, message: '请选择营业时间', trigger: ['blur'] }]"
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-col>
</a-row>
@ -108,7 +113,7 @@
<a-textarea
id="tipinput"
v-model:value="formModel.address"
:disabled="title == '编辑门店'"
:readonly="title == '编辑门店'"
allow-clear
auto-size
placeholder="请输入详细地址"
@ -306,7 +311,12 @@ defineExpose({
} else if (newFormAction === FormAction.UPDATE) {
title.value = '编辑门店'
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)
}
formAction.value = newFormAction

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

Loading…
Cancel
Save