页面修改
This commit is contained in:
parent
cd2ca93418
commit
d0da41eeb6
@ -21,7 +21,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="上级公司" prop="parent_company">
|
<el-form-item label="上级公司" prop="parent_company">
|
||||||
<el-input v-model="formData.parent_company" placeholder="请输入上级公司" clearable
|
<el-input v-model="formData.parent_company" type="number" placeholder="请输入上级公司" clearable
|
||||||
:style="{ width: '100%' }">
|
:style="{ width: '100%' }">
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -83,6 +83,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
|
||||||
<el-card class="mb-2">
|
<el-card class="mb-2">
|
||||||
<div class="tit">主要负责人</div>
|
<div class="tit">主要负责人</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
@ -130,7 +132,47 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-card class="mb-2">
|
||||||
|
<div class="tit">其他联系人</div>
|
||||||
|
<el-row>
|
||||||
|
<template v-for="(item, index) in formData.other_contacts" :key="index">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="姓名" prop="field120">
|
||||||
|
<el-input :disabled="isDisabled" v-model="item.name" placeholder="请输入姓名" clearable
|
||||||
|
:style="{ width: '100%' }"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="职务" prop="field121">
|
||||||
|
<el-input :disabled="isDisabled" v-model="item.position" placeholder="请输入职务" clearable
|
||||||
|
:style="{ width: '100%' }"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="手机" prop="field122">
|
||||||
|
<el-input :disabled="isDisabled" v-model="item.phone" placeholder="请输入手机" clearable
|
||||||
|
:style="{ width: '100%' }"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="邮箱">
|
||||||
|
<el-input :disabled="isDisabled" v-model="item.email" placeholder="请输入邮箱" clearable
|
||||||
|
:style="{ width: '100%' }"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label prop="field126">
|
||||||
|
<el-button type="primary" :disabled="isDisabled" size="medium"
|
||||||
|
@click="other">添加联系人</el-button>
|
||||||
|
<el-button v-if="formData.other_contacts.length" type="primary" :disabled="isDisabled"
|
||||||
|
size="medium" @click="otherdelete">删除</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
<el-card class="mb-2">
|
<el-card class="mb-2">
|
||||||
<div class="tit">开票信息</div>
|
<div class="tit">开票信息</div>
|
||||||
<el-row>
|
<el-row>
|
||||||
@ -221,7 +263,7 @@ const formData = reactive({
|
|||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
custom_type: '',
|
custom_type: '',
|
||||||
parent_company: '',
|
parent_company: 5565665,
|
||||||
phone: '',
|
phone: '',
|
||||||
credit_rating: '',
|
credit_rating: '',
|
||||||
province: '',
|
province: '',
|
||||||
@ -242,6 +284,9 @@ const formData = reactive({
|
|||||||
bank_name: '',
|
bank_name: '',
|
||||||
bank_account: '',
|
bank_account: '',
|
||||||
status: '',
|
status: '',
|
||||||
|
other_contacts: [],
|
||||||
|
area: ""
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -257,9 +302,18 @@ const setFormData = async (data: Record<any, any>) => {
|
|||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
formData[key] = data[key]
|
formData[key] = data[key]
|
||||||
|
|
||||||
|
if (key == 'province') {
|
||||||
|
await getCityList()
|
||||||
|
}
|
||||||
|
if (key == 'city') {
|
||||||
|
await getAreaList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log(formData)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,10 +369,31 @@ const getCityList = async () => {
|
|||||||
};
|
};
|
||||||
const getAreaList = async () => {
|
const getAreaList = async () => {
|
||||||
const data = await apiAreaList({ area: formData.city });
|
const data = await apiAreaList({ area: formData.city });
|
||||||
datas["areaOptions"] = data;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
datas["areaOptions"] = data;
|
||||||
|
console.log(datas["areaOptions"])
|
||||||
|
|
||||||
|
};
|
||||||
|
//增加其他联系人
|
||||||
|
function other() {
|
||||||
|
formData.other_contacts.push({
|
||||||
|
name: "",
|
||||||
|
position: "",
|
||||||
|
phone: "",
|
||||||
|
email: "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//删除其他联系人
|
||||||
|
function otherdelete() {
|
||||||
|
formData.other_contacts.pop({
|
||||||
|
name: "",
|
||||||
|
position: "",
|
||||||
|
phone: "",
|
||||||
|
email: "",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getProvinceList();
|
getProvinceList();
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
|
|
||||||
|
|
||||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column label="客户名称" prop="name" show-overflow-tooltip />
|
<el-table-column label="客户名称" prop="name" show-overflow-tooltip />
|
||||||
@ -62,6 +64,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex mt-4 justify-end">
|
<div class="flex mt-4 justify-end">
|
||||||
<pagination v-model="pager" @change="getLists" />
|
<pagination v-model="pager" @change="getLists" />
|
||||||
@ -74,7 +80,7 @@
|
|||||||
<script lang="ts" setup name="customLists">
|
<script lang="ts" setup name="customLists">
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import { useDictData } from '@/hooks/useDictOptions'
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
import { apiCustomLists, apiCustomDelete } from '@/api/custom'
|
import { apiCustomLists, apiCustomDelete, apiCustomDetail } from '@/api/custom'
|
||||||
import { timeFormat } from '@/utils/util'
|
import { timeFormat } from '@/utils/util'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import EditPopup from './edit.vue'
|
import EditPopup from './edit.vue'
|
||||||
@ -121,10 +127,12 @@ const handleAdd = async () => {
|
|||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const handleEdit = async (data: any) => {
|
const handleEdit = async (data: any) => {
|
||||||
|
|
||||||
|
let res = await apiCustomDetail({ id: data.id })
|
||||||
showEdit.value = true
|
showEdit.value = true
|
||||||
await nextTick()
|
await nextTick()
|
||||||
editRef.value?.open('edit')
|
editRef.value?.open('edit')
|
||||||
editRef.value?.setFormData(data)
|
editRef.value?.setFormData(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="客户名称" prop="custom_id">
|
<el-form-item label="客户名称" prop="custom_name">
|
||||||
<el-input v-model="formData.custom_name" clearable placeholder="请选择客户"
|
<el-input v-model="formData.custom_name" clearable placeholder="请选择客户"
|
||||||
@click="showDialog = true" />
|
@click="showDialog = true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -45,8 +45,27 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-dialog v-model="showDialog">
|
|
||||||
<DialogIndex @customEvent="customEvent"></DialogIndex>
|
|
||||||
|
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||||
|
<el-table style="cursor: pointer;" :data="pager.lists" @current-change="handleCurrentChange">
|
||||||
|
<!-- <el-table-column type="selection" width="55" /> -->
|
||||||
|
<el-table-column label="客户名称" prop="name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="客户属性" prop="custom_type">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-value :options="dictData.custom_type" :value="row.custom_type" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="省" prop="province_name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="职务" prop="master_position" show-overflow-tooltip />
|
||||||
|
<el-table-column label="电话" prop="master_telephone" show-overflow-tooltip />
|
||||||
|
<el-table-column label="手机" prop="master_phone" show-overflow-tooltip />
|
||||||
|
<el-table-column label="备注" prop="master_notes" show-overflow-tooltip />
|
||||||
|
<el-table-column label="负责人" show-overflow-tooltip />
|
||||||
|
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
|
||||||
|
<el-table-column label="最后跟进" show-overflow-tooltip />
|
||||||
|
<el-table-column label="下次回访日期" show-overflow-tooltip />
|
||||||
|
</el-table>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</el-form>
|
</el-form>
|
||||||
</popup>
|
</popup>
|
||||||
@ -54,10 +73,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="customContactsEdit">
|
<script lang="ts" setup name="customContactsEdit">
|
||||||
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import type { FormInstance } from 'element-plus'
|
import type { FormInstance } from 'element-plus'
|
||||||
import Popup from '@/components/popup/index.vue'
|
import Popup from '@/components/popup/index.vue'
|
||||||
import customDialog from '@/components/custom-dialog/index.vue'
|
import customDialog from '@/components/custom-dialog/index.vue'
|
||||||
import { apiCustomContactsAdd, apiCustomContactsEdit, apiCustomContactsDetail } from '@/api/custom_contacts'
|
import { apiCustomContactsAdd, apiCustomContactsEdit, apiCustomContactsDetail } from '@/api/custom_contacts'
|
||||||
|
import { apiCustomLists } from '@/api/custom'
|
||||||
|
|
||||||
import { timeFormat } from '@/utils/util'
|
import { timeFormat } from '@/utils/util'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
defineProps({
|
defineProps({
|
||||||
@ -83,6 +105,13 @@ const popupTitle = computed(() => {
|
|||||||
return mode.value == 'edit' ? '编辑客户联系人' : '新增客户联系人'
|
return mode.value == 'edit' ? '编辑客户联系人' : '新增客户联系人'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const popTableList = reactive([])
|
||||||
|
// 分页相关
|
||||||
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
|
fetchFun: apiCustomLists,
|
||||||
|
})
|
||||||
|
getLists()
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
@ -101,16 +130,19 @@ const formData = reactive({
|
|||||||
|
|
||||||
// 表单验证
|
// 表单验证
|
||||||
const formRules = reactive<any>({
|
const formRules = reactive<any>({
|
||||||
custom_id: [{
|
custom_name: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入',
|
message: '请输入',
|
||||||
trigger: ['blur']
|
trigger: ['change']
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const setFormData = async (data: Record<any, any>) => {
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
|
||||||
|
console.log(data, 5666)
|
||||||
|
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
if (data[key] != null && data[key] != undefined) {
|
if (data[key] != null && data[key] != undefined) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
@ -140,6 +172,15 @@ const handleSubmit = async () => {
|
|||||||
emit('success')
|
emit('success')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选择客户
|
||||||
|
const handleCurrentChange = (e: any) => {
|
||||||
|
formData.custom_name = e.name
|
||||||
|
formData.custom_id = e.id
|
||||||
|
console.log(e)
|
||||||
|
|
||||||
|
showDialog.value = false
|
||||||
|
}
|
||||||
|
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
const open = (type = 'add') => {
|
const open = (type = 'add') => {
|
||||||
mode.value = type
|
mode.value = type
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<script lang="ts" setup name="customContactsLists">
|
<script lang="ts" setup name="customContactsLists">
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import { useDictData } from '@/hooks/useDictOptions'
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
import { apiCustomContactsLists, apiCustomContactsDelete } from '@/api/custom_contacts'
|
import { apiCustomContactsLists, apiCustomContactsDelete, apiCustomContactsDetail } from '@/api/custom_contacts'
|
||||||
import { timeFormat } from '@/utils/util'
|
import { timeFormat } from '@/utils/util'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import EditPopup from './edit.vue'
|
import EditPopup from './edit.vue'
|
||||||
@ -110,10 +110,11 @@ const handleAdd = async () => {
|
|||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const handleEdit = async (data: any) => {
|
const handleEdit = async (data: any) => {
|
||||||
|
let res = await apiCustomContactsDetail({ id: data.id })
|
||||||
showEdit.value = true
|
showEdit.value = true
|
||||||
await nextTick()
|
await nextTick()
|
||||||
editRef.value?.open('edit')
|
editRef.value?.open('edit')
|
||||||
editRef.value?.setFormData(data)
|
editRef.value?.setFormData(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
<el-form-item label="主题" prop="name">
|
<el-form-item label="主题" prop="name">
|
||||||
<el-input v-model="formData.name" clearable placeholder="请输入主题" />
|
<el-input v-model="formData.name" clearable placeholder="请输入主题" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="客户名称" prop="custom_id">
|
<el-form-item label="客户名称" prop="custom_name">
|
||||||
<el-input v-model="formData.custom_id" clearable placeholder="请选择客户" />
|
<el-input v-model="formData.custom_name" @click="showDialog = true" clearable placeholder="请选择客户" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系人" prop="contacts">
|
<el-form-item label="联系人" prop="contacts">
|
||||||
<el-input v-model="formData.contacts" clearable placeholder="请输入联系人" />
|
<el-input v-model="formData.contacts" clearable placeholder="请输入联系人" />
|
||||||
@ -42,6 +42,27 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</popup>
|
</popup>
|
||||||
|
|
||||||
|
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||||
|
<el-table style="cursor: pointer;" :data="pager.lists" @current-change="handleCurrentChange">
|
||||||
|
<!-- <el-table-column type="selection" width="55" /> -->
|
||||||
|
<el-table-column label="客户名称" prop="name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="客户属性" prop="custom_type">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-value :options="dictData.custom_type" :value="row.custom_type" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="省" prop="province_name" show-overflow-tooltip />
|
||||||
|
<el-table-column label="职务" prop="master_position" show-overflow-tooltip />
|
||||||
|
<el-table-column label="电话" prop="master_telephone" show-overflow-tooltip />
|
||||||
|
<el-table-column label="手机" prop="master_phone" show-overflow-tooltip />
|
||||||
|
<el-table-column label="备注" prop="master_notes" show-overflow-tooltip />
|
||||||
|
<el-table-column label="负责人" show-overflow-tooltip />
|
||||||
|
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
|
||||||
|
<el-table-column label="最后跟进" show-overflow-tooltip />
|
||||||
|
<el-table-column label="下次回访日期" show-overflow-tooltip />
|
||||||
|
</el-table>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -51,6 +72,9 @@ import Popup from '@/components/popup/index.vue'
|
|||||||
import { apiCustomFollowAdd, apiCustomFollowEdit, apiCustomFollowDetail } from '@/api/custom_follow'
|
import { apiCustomFollowAdd, apiCustomFollowEdit, apiCustomFollowDetail } from '@/api/custom_follow'
|
||||||
import { timeFormat } from '@/utils/util'
|
import { timeFormat } from '@/utils/util'
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
|
import { apiCustomLists } from '@/api/custom'
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
dictData: {
|
dictData: {
|
||||||
type: Object as PropType<Record<string, any[]>>,
|
type: Object as PropType<Record<string, any[]>>,
|
||||||
@ -61,7 +85,7 @@ const emit = defineEmits(['success', 'close'])
|
|||||||
const formRef = shallowRef<FormInstance>()
|
const formRef = shallowRef<FormInstance>()
|
||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
|
const showDialog = ref(false)
|
||||||
|
|
||||||
// 弹窗标题
|
// 弹窗标题
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
@ -73,6 +97,7 @@ const formData = reactive({
|
|||||||
id: '',
|
id: '',
|
||||||
name: '',
|
name: '',
|
||||||
custom_id: '',
|
custom_id: '',
|
||||||
|
custom_name: '',
|
||||||
contacts: '',
|
contacts: '',
|
||||||
date: '',
|
date: '',
|
||||||
types: '',
|
types: '',
|
||||||
@ -89,8 +114,12 @@ const formData = reactive({
|
|||||||
const formRules = reactive<any>({
|
const formRules = reactive<any>({
|
||||||
|
|
||||||
})
|
})
|
||||||
|
// 分页相关
|
||||||
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
|
fetchFun: apiCustomLists,
|
||||||
|
|
||||||
|
})
|
||||||
|
getLists()
|
||||||
// 获取详情
|
// 获取详情
|
||||||
const setFormData = async (data: Record<any, any>) => {
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
for (const key in formData) {
|
for (const key in formData) {
|
||||||
@ -112,6 +141,13 @@ const getDetail = async (row: Record<string, any>) => {
|
|||||||
})
|
})
|
||||||
setFormData(data)
|
setFormData(data)
|
||||||
}
|
}
|
||||||
|
// 选择客户
|
||||||
|
const handleCurrentChange = (e: any) => {
|
||||||
|
formData.custom_name = e.name
|
||||||
|
formData.custom_id = e.id
|
||||||
|
|
||||||
|
showDialog.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
|
Loading…
x
Reference in New Issue
Block a user