修改问题

pull/781/head
zy 2025-04-27 17:18:40 +08:00
parent 938e430186
commit da4d175e91
10 changed files with 51 additions and 25 deletions

View File

@ -4,7 +4,7 @@ NODE_ENV=development
VITE_DEV=true
# 请求路径
VITE_BASE_URL='http://192.168.251.60:48080'
VITE_BASE_URL='http://172.22.3.6:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传,仅支持 S3 服务
VITE_UPLOAD_TYPE=server

View File

@ -18,6 +18,7 @@
<el-select
v-model="formData.ownerUserId"
:disabled="formType !== 'create'"
filterable
class="w-1/1"
>
<el-option
@ -36,6 +37,7 @@
<el-select
:disabled="formData.customerDefault"
v-model="formData.customerId"
filterable
placeholder="请选择客户"
class="w-1/1"
>
@ -113,7 +115,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="直属上级" prop="parentId">
<el-select v-model="formData.parentId" placeholder="请选择直属上级" class="w-1/1">
<el-select v-model="formData.parentId" filterable placeholder="请选择直属上级" class="w-1/1">
<el-option
v-for="item in contactList"
:key="item.id"

View File

@ -1,5 +1,5 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle">
<Dialog v-model="dialogVisible" :title="dialogTitle" width="50%">
<el-form
ref="formRef"
v-loading="formLoading"

View File

@ -12,8 +12,8 @@
<el-descriptions-item label="客户来源">
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_SOURCE" :value="customer.source" />
</el-descriptions-item>
<el-descriptions-item label="合作类型">{{ customer.cooperationType }}</el-descriptions-item>
<el-descriptions-item label="合作地区">{{ customer.cooperationArea }}</el-descriptions-item>
<el-descriptions-item label="合作类型">{{ getName(getIntDictOptions(DICT_TYPE.CRM_COOPERATION_TYPE),customer.cooperationType) }}</el-descriptions-item>
<el-descriptions-item label="合作地区">{{ getName(getIntDictOptions(DICT_TYPE.CRM_COOPERATION_AREA),customer.cooperationArea) }}</el-descriptions-item>
<el-descriptions-item label="客户级别">
<dict-tag :type="DICT_TYPE.CRM_CUSTOMER_LEVEL" :value="customer.level" />
</el-descriptions-item>
@ -66,7 +66,7 @@
</template>
<script lang="ts" setup>
import * as CustomerApi from '@/api/crm/customer'
import { DICT_TYPE } from '@/utils/dict'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
defineOptions({ name: 'CrmCustomerDetailsInfo' })
@ -75,5 +75,11 @@ const { customer } = defineProps<{
}>()
const activeNames = ref(['basicInfo', 'systemInfo']) //
const getName = (opt, val) => {
console.log('%csrc/views/crm/customer/detail/CustomerDetailsInfo.vue:79 opt, val', 'color: #007acc;', opt, val);
const arr = opt.filter(v => v.value == val)
console.log('%csrc/views/crm/customer/detail/CustomerDetailsInfo.vue:81 arr', 'color: #007acc;', arr);
return arr.length ? arr[0]['label'] : ''
}
</script>
<style lang="scss" scoped></style>

View File

@ -51,7 +51,7 @@
<el-tab-pane label="联系人" lazy>
<ContactList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>
<!-- <el-tab-pane label="团队成员">
<el-tab-pane label="团队成员">
<PermissionList
ref="permissionListRef"
:biz-id="customer.id!"
@ -59,7 +59,7 @@
:show-action="!permissionListRef?.isPool || false"
@quit-team="close"
/>
</el-tab-pane> -->
</el-tab-pane>
<el-tab-pane label="商机" lazy>
<BusinessList :biz-id="customer.id!" :biz-type="BizTypeEnum.CRM_CUSTOMER" />
</el-tab-pane>

View File

@ -4,7 +4,7 @@
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
label-width="110px"
v-loading="formLoading"
>
<el-row>
@ -69,7 +69,7 @@
<Icon class="mr-5px" icon="ep:plus" />
添加联系人
</el-button>
<FollowUpRecordContactForm :contacts="formData.contacts" />
<FollowUpRecordContactForm @success="del" :contacts="formData.contacts" />
</el-form-item>
</el-col>
</el-row>
@ -111,7 +111,9 @@ const formData = ref({
nextTime: undefined,
picUrls: undefined,
fileUrls: undefined,
contactIds: undefined
contactIds: undefined,
contacts: []
})
const formRef = ref() // Ref
const formRules = reactive({
@ -126,6 +128,18 @@ const contactTableSelectRef = ref<InstanceType<typeof ContactListModal>>()
const handleOpenContact = () => {
contactTableSelectRef.value?.open()
}
const handleAddContact = (contactId: [], newContacts: ContactApi.ContactVO[]) => {
newContacts.forEach((contact) => {
if (!formData.value.contacts.some((item) => item.id === contact.id)) {
formData.value.contacts.push(contact)
}
})
}
const del = (index: number) => {
formData.value.contacts.splice(index, 1)
}
/** 打开弹窗 */
const open = async (bizType: number, bizId: number) => {
dialogVisible.value = true
@ -145,14 +159,12 @@ const submitForm = async () => {
//
formLoading.value = true
try {
const data = formData.value as unknown as ReturnVisitRecordVO
if (formType.value === 'create') {
await ReturnVisitRecordApi.createReturnVisitRecord(data)
message.success(t('common.createSuccess'))
} else {
await ReturnVisitRecordApi.updateReturnVisitRecord(data)
message.success(t('common.updateSuccess'))
}
const data = {
...formData.value,
contactIds: formData.value.contacts.map((item) => item.id),
} as unknown as ReturnVisitRecordVO
await ReturnVisitRecordApi.createReturnVisitRecord(data)
message.success(t('common.createSuccess'))
dialogVisible.value = false
//
emit('success')
@ -172,6 +184,7 @@ const resetForm = () => {
nextTime: undefined,
picUrls: undefined,
fileUrls: undefined,
contacts: [] ,
contactIds: undefined
}
formRef.value?.resetFields()

View File

@ -50,7 +50,6 @@
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['crm:return-visit-record:delete']"
>
删除
</el-button>

View File

@ -52,7 +52,7 @@
<Icon class="mr-5px" icon="ep:plus" />
添加联系人
</el-button>
<FollowUpRecordContactForm :contacts="formData.contacts" />
<FollowUpRecordContactForm @success="del" :contacts="formData.contacts" />
</el-form-item>
</el-col>
<el-col :span="24" v-if="formData.bizType == BizTypeEnum.CRM_CUSTOMER">
@ -162,6 +162,10 @@ const handleAddContact = (contactId: [], newContacts: ContactApi.ContactVO[]) =>
})
}
const del = (index: number) => {
formData.value.contacts.splice(index, 1)
}
/** 关联商机 */
const businessTableSelectRef = ref<InstanceType<typeof BusinessListModal>>()
const handleOpenBusiness = () => {

View File

@ -17,7 +17,7 @@
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="130">
<template #default="scope">
<el-button link type="danger" @click="handleDelete(scope.row.id)"> </el-button>
<el-button link type="danger" @click="handleDelete(scope.$index)"> </el-button>
</template>
</el-table-column>
</el-table>
@ -40,8 +40,10 @@ watch(
{ immediate: true }
)
const emit = defineEmits(['success']) // success
/** 删除按钮操作 */
const handleDelete = (index: number) => {
formData.value.splice(index, 1)
emit('success', index)
}
</script>

View File

@ -1,10 +1,10 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<Dialog :title="dialogTitle" v-model="dialogVisible" width="50%">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
label-width="110px"
v-loading="formLoading"
>
<el-row>