123
parent
01dd268a2e
commit
beceb5b1d5
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,412 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="refModel">
|
||||||
|
<a-modal
|
||||||
|
:title="title"
|
||||||
|
:visible="visible"
|
||||||
|
:mask-closable="false"
|
||||||
|
:centered="true"
|
||||||
|
:body-style="{ paddingBottom: '8px', paddingTop: '0px' }"
|
||||||
|
:confirm-loading="submitLoading"
|
||||||
|
:width="650"
|
||||||
|
:get-container="() => $refs.refModel"
|
||||||
|
@cancel="handleClose"
|
||||||
|
>
|
||||||
|
<a-tabs centered>
|
||||||
|
<a-tab-pane v-if="formModel.customType === 0" key="1" tab="A类型客户" />
|
||||||
|
<a-tab-pane v-if="formModel.customType === 1" key="2" tab="B类型客户" force-render />
|
||||||
|
</a-tabs>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formModel"
|
||||||
|
:label-col="{ sm: { span: 24 }, md: { span: 8 } }"
|
||||||
|
:wrapper-col="wrapperCol"
|
||||||
|
>
|
||||||
|
<a-row justify="start">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="客户称呼">
|
||||||
|
<a-input v-model:value="formModel.customName" placeholder="请输入" readonly />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row justify="start">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="客户联系方式">
|
||||||
|
<a-input v-model:value="formModel.customNid" placeholder="请输入" readonly />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row justify="start">
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item
|
||||||
|
label="客户地址信息"
|
||||||
|
:label-col="{ sm: { span: 24 }, md: { span: 4 } }"
|
||||||
|
:wrapper-col="{ sm: { span: 24 }, md: { span: 20 } }"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
v-model:value="formModel.comprehensiveAddress"
|
||||||
|
placeholder="请输入"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row justify="start">
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item
|
||||||
|
label="备注"
|
||||||
|
:label-col="{ sm: { span: 24 }, md: { span: 4 } }"
|
||||||
|
:wrapper-col="{ sm: { span: 24 }, md: { span: 20 } }"
|
||||||
|
>
|
||||||
|
<a-input v-model:value="formModel.remark" readonly />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<template v-for="item in formModel.customStoreVOList" :key="item.storeId">
|
||||||
|
<a-row justify="start">
|
||||||
|
<a-col xs="24" :sm="24" :md="12">
|
||||||
|
<a-form-item label="预约门店">
|
||||||
|
<a-input v-model:value="item.storeName" placeholder="请输入" readonly />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col xs="24" :sm="24" :md="12">
|
||||||
|
<a-form-item label="预约时间">
|
||||||
|
<a-input v-model:value="item.reservationTime" placeholder="未选择" readonly />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</template>
|
||||||
|
<a-row v-if="formModel.enrollStatus == 1 && formModel.customType == 1" justify="start">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item
|
||||||
|
label="复审员选择"
|
||||||
|
:rules="[{ required: true, message: '请选择人员' }]"
|
||||||
|
name="reviewUserId"
|
||||||
|
>
|
||||||
|
<a-select ref="select" v-model:value="formModel.reviewUserId">
|
||||||
|
<a-select-option
|
||||||
|
v-for="(item, index) in selectedReviewerOptions"
|
||||||
|
:key="index"
|
||||||
|
:value="item.value"
|
||||||
|
>{{ item.label }}</a-select-option
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
<template #footer>
|
||||||
|
<div v-if="title !== '详情'">
|
||||||
|
<a-button v-if="title !== '审核'" @click="visible = false">取消</a-button>
|
||||||
|
<a-button
|
||||||
|
v-if="formModel.enrollStatus == 1 && formModel.customType == 1"
|
||||||
|
type="primary"
|
||||||
|
html-type="submit"
|
||||||
|
style="margin-left: 10px"
|
||||||
|
@click="toExamine(0)"
|
||||||
|
>重审</a-button
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
v-if="formModel.enrollStatus == 1 && formModel.customType == 0"
|
||||||
|
type="primary"
|
||||||
|
html-type="submit"
|
||||||
|
style="margin-left: 10px"
|
||||||
|
@click="toExamine(1)"
|
||||||
|
>分发</a-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-modal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { reactive, ref, onMounted, toRefs } from 'vue'
|
||||||
|
import { useModal } from '@/hooks/modal'
|
||||||
|
import type { FormRequestMapping } from '@/hooks/form'
|
||||||
|
import { overrideProperties } from '@/utils/bean-utils'
|
||||||
|
import { message } from 'ant-design-vue'
|
||||||
|
import { updateCustomerAudit, selectedReviewerList } from '@/api/geopoliticalCustomers/index'
|
||||||
|
import { useAdminForm, useFormAction, FormAction, wrapperCol } from '@/hooks/form'
|
||||||
|
import { useUserStore } from '@/stores/user-store'
|
||||||
|
import { doRequest } from '@/utils/axios/request'
|
||||||
|
import { getCustomDetails } from '@/api/geopoliticalCustomers'
|
||||||
|
import type { SelectProps } from 'ant-design-vue'
|
||||||
|
//预约时间
|
||||||
|
import 'dayjs/locale/zh-cn'
|
||||||
|
import { $ref } from 'vue/macros'
|
||||||
|
// import dayjs from 'dayjs'
|
||||||
|
const emits = defineEmits<{
|
||||||
|
(e: 'submit-success'): void
|
||||||
|
}>()
|
||||||
|
//dom中可以写成:rules = 'rulesData'
|
||||||
|
// const rulesData = {
|
||||||
|
// required: true,
|
||||||
|
// trigger: 'change'
|
||||||
|
// }
|
||||||
|
const { userInfo } = useUserStore()
|
||||||
|
|
||||||
|
interface ReservationShop {
|
||||||
|
customStoreId?: number
|
||||||
|
storeName: string
|
||||||
|
reservationTime: string
|
||||||
|
}
|
||||||
|
interface SysUserPageVO {
|
||||||
|
customId: number | undefined
|
||||||
|
customName: string
|
||||||
|
customNid: string
|
||||||
|
comprehensiveAddress?: string
|
||||||
|
enrollStatus?: number
|
||||||
|
remark?: string
|
||||||
|
customType: number
|
||||||
|
customStoreVOList: ReservationShop[]
|
||||||
|
reviewUserId: number | undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
const formModel = reactive<SysUserPageVO>({
|
||||||
|
customId: undefined,
|
||||||
|
customName: '',
|
||||||
|
customNid: '',
|
||||||
|
customType: 0,
|
||||||
|
comprehensiveAddress: '',
|
||||||
|
remark: '',
|
||||||
|
customStoreVOList: [],
|
||||||
|
enrollStatus: undefined,
|
||||||
|
reviewUserId: undefined
|
||||||
|
})
|
||||||
|
|
||||||
|
// 表单校验规则
|
||||||
|
const formRule = ref({
|
||||||
|
reviewUserId: [{ required: true, message: '请选择人员' }]
|
||||||
|
})
|
||||||
|
|
||||||
|
// 表单的提交请求
|
||||||
|
const formRequestMapping: FormRequestMapping<SysUserPageVO> = {}
|
||||||
|
|
||||||
|
const { title, visible, openModal, closeModal } = useModal()
|
||||||
|
|
||||||
|
const { formAction } = useFormAction()
|
||||||
|
|
||||||
|
const { submitLoading, resetFields, validateInfos } = useAdminForm(
|
||||||
|
formAction,
|
||||||
|
formRequestMapping,
|
||||||
|
formModel,
|
||||||
|
formRule
|
||||||
|
)
|
||||||
|
|
||||||
|
// onMounted(() => {})
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
closeModal()
|
||||||
|
submitLoading.value = false
|
||||||
|
}
|
||||||
|
const formRef = ref()
|
||||||
|
|
||||||
|
const toExamine = (type: number) => {
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
updateCustomerAudit(
|
||||||
|
formModel.customId as number,
|
||||||
|
type,
|
||||||
|
userInfo!.salesmanType,
|
||||||
|
formModel.reviewUserId
|
||||||
|
).then(res => {
|
||||||
|
message.info({
|
||||||
|
content: h('span', { style: 'white-space: pre-wrap;' }, res.message)
|
||||||
|
})
|
||||||
|
if (res.code == 200) {
|
||||||
|
closeModal()
|
||||||
|
emits('submit-success')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch((error: any) => {
|
||||||
|
console.log('error', error)
|
||||||
|
})
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
//已选择的公司下拉框列表数据
|
||||||
|
const selectedReviewerOptions = ref<SelectProps['options']>([])
|
||||||
|
defineExpose({
|
||||||
|
open(newFormAction: FormAction, id: number) {
|
||||||
|
selectedReviewerOptions.value = []
|
||||||
|
doRequest(selectedReviewerList(), {
|
||||||
|
onSuccess: (res: any) => {
|
||||||
|
const a = res.data.map((item: any) => {
|
||||||
|
return { label: item.name, value: item.value }
|
||||||
|
})
|
||||||
|
a.forEach((item: any) => {
|
||||||
|
selectedReviewerOptions.value?.push({
|
||||||
|
label: item.label,
|
||||||
|
value: item.value
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
openModal()
|
||||||
|
resetFields()
|
||||||
|
let record: any = null
|
||||||
|
if (newFormAction === FormAction.OTHER) {
|
||||||
|
title.value = '预约详情'
|
||||||
|
doRequest(getCustomDetails(id), {
|
||||||
|
onSuccess: (res: any) => {
|
||||||
|
record = res.data
|
||||||
|
record.comprehensiveAddress = `${record?.economize}${record?.market}${record?.distinguish}${record?.detailAddress}`
|
||||||
|
overrideProperties(formModel, record)
|
||||||
|
record.customStoreVOList.forEach((item: any) => {
|
||||||
|
const targetObj = formModel.customStoreVOList.find(
|
||||||
|
(i: any) => i.storeId === item.storeId
|
||||||
|
)
|
||||||
|
if (targetObj && item.reservationDate) {
|
||||||
|
targetObj.reservationTime =
|
||||||
|
item.reservationDate.split(' ')[0] + ' ' + item.reservationTime
|
||||||
|
}
|
||||||
|
})
|
||||||
|
formAction.value = newFormAction
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
//权重配置两列
|
||||||
|
.weightAllocation {
|
||||||
|
.ant-form {
|
||||||
|
display: grid;
|
||||||
|
// grid-auto-flow: column;
|
||||||
|
grid-template-columns: 50% 50%;
|
||||||
|
// grid-template-rows: 50% 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//数字输入框颜色
|
||||||
|
::v-deep .ant-input-number-out-of-range input {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////
|
||||||
|
.ant-list-item {
|
||||||
|
width: 330px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-list-item-meta-title {
|
||||||
|
font-size: 13x !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .ant-list-item-meta-description {
|
||||||
|
font-size: 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .ant-space-item {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.storeForm {
|
||||||
|
margin-top: 20px;
|
||||||
|
overflow-y: auto;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-list-item {
|
||||||
|
// align-items: unset;
|
||||||
|
width: 225px;
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-list-item-action > li {
|
||||||
|
// position: relative;
|
||||||
|
display: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .ant-list-item-action {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .ant-list-item-meta-title {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
::v-deep .ant-list-item-action > li {
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-btn-sm {
|
||||||
|
font-size: 12px;
|
||||||
|
height: 20px;
|
||||||
|
padding: 0px 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .amap-overlay-text-container {
|
||||||
|
z-index: 999;
|
||||||
|
white-space: unset;
|
||||||
|
overflow: unset;
|
||||||
|
text-overflow: unset;
|
||||||
|
font-size: 15px !important;
|
||||||
|
color: rgba(0, 0, 0, 0.85) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
////
|
||||||
|
#mapContainer {
|
||||||
|
width: 100%;
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .bubble-card {
|
||||||
|
z-index: 999999999;
|
||||||
|
position: relative;
|
||||||
|
// top: -62px;
|
||||||
|
padding: 15px 10px;
|
||||||
|
background-color: white;
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
|
||||||
|
font-size: 13px;
|
||||||
|
width: 180px;
|
||||||
|
filter: drop-shadow(0px 0px 1px gray);
|
||||||
|
// height: 100px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.medium-card {
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.large-card {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .bubble-card::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
bottom: -10px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
border-width: 5px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: white transparent transparent;
|
||||||
|
// transform: rotate(180deg);
|
||||||
|
// font-family: 'anticon'; /* 设置字体图标库 */
|
||||||
|
// content: '\e66a'; /* Unicode 编码为 close-outlined 图标的内容 */
|
||||||
|
// color: red;
|
||||||
|
// font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .spanDom {
|
||||||
|
position: absolute;
|
||||||
|
top: 3px;
|
||||||
|
color: #d9d2d2;
|
||||||
|
right: 3px;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
//modal头部
|
||||||
|
::v-deep .ant-modal-header {
|
||||||
|
padding: 16px 24px 0px !important;
|
||||||
|
border-bottom: unset !important;
|
||||||
|
}
|
||||||
|
//a-tabs距离下面的距离
|
||||||
|
::v-deep .ant-tabs-top > .ant-tabs-nav {
|
||||||
|
margin: 0 0 25px 0;
|
||||||
|
line-height: 0.5715;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue