页面修改

This commit is contained in:
zmj 2023-11-14 18:56:09 +08:00
parent d96357b0d5
commit 8ded855acd
11 changed files with 901 additions and 15 deletions

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 项目跟进记录列表
export function apiProjectFollowUpLists(params: any) {
return request.get({ url: '/project.project_follow_up/lists', params })
}
// 添加项目跟进记录
export function apiProjectFollowUpAdd(params: any) {
return request.post({ url: '/project.project_follow_up/add', params })
}
// 编辑项目跟进记录
export function apiProjectFollowUpEdit(params: any) {
return request.post({ url: '/project.project_follow_up/edit', params })
}
// 删除项目跟进记录
export function apiProjectFollowUpDelete(params: any) {
return request.post({ url: '/project.project_follow_up/delete', params })
}
// 项目跟进记录详情
export function apiProjectFollowUpDetail(params: any) {
return request.get({ url: '/project.project_follow_up/detail', params })
}

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 售前项目成员列表
export function apiProjectPreSalesMembersLists(params: any) {
return request.get({ url: '/project.project_pre_sales_members/lists', params })
}
// 添加售前项目成员
export function apiProjectPreSalesMembersAdd(params: any) {
return request.post({ url: '/project.project_pre_sales_members/add', params })
}
// 编辑售前项目成员
export function apiProjectPreSalesMembersEdit(params: any) {
return request.post({ url: '/project.project_pre_sales_members/edit', params })
}
// 删除售前项目成员
export function apiProjectPreSalesMembersDelete(params: any) {
return request.post({ url: '/project.project_pre_sales_members/delete', params })
}
// 售前项目成员详情
export function apiProjectPreSalesMembersDetail(params: any) {
return request.get({ url: '/project.project_pre_sales_members/detail', params })
}

View File

@ -0,0 +1,134 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="客户" prop="custom_name">
<el-input class="w-[280px]" v-model="queryParams.custom_name" clearable placeholder="请输入客户昵称" />
</el-form-item>
<el-form-item label="项目类型" prop="project_type">
<el-select class="w-[280px]" v-model="queryParams.project_type" clearable placeholder="请选择项目类型">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in dictData.project_type" :key="index" :label="item.name"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<!-- <el-table :data="pager.lists" >
<el-table-column label="客户名称" property="name" />
<el-table-column label="客户属性" property="custom_type" />
<el-table-column label="信用度" property="credit_rating" />
<el-table-column label="省" property="province_name" />
<el-table-column label="市" property="city_name" />
<el-table-column label="区" property="street_name" />
<el-table-column label="主联系人" property="master_name" />
<el-table-column label="联系方式" property="master_phone" />
</el-table> -->
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
<el-table-column label="客户" prop="custom_name" show-overflow-tooltip />
<el-table-column label="项目类型" prop="project_type">
<template #default="{ row }">
<dict-value :options="dictData.project_type" :value="row.project_type" />
</template>
</el-table-column>
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
<el-table-column label="项目内容" prop="project_content">
<template #default="{ row }">
<dict-value :options="dictData.project_content" :value="row.project_content" />
</template>
</el-table-column>
<el-table-column label="项目估算" prop="project_estimation" show-overflow-tooltip />
<el-table-column label="项目所在地" prop="project_address" show-overflow-tooltip />
<el-table-column label="预计工期" prop="estimated_construction" show-overflow-tooltip />
<el-table-column label="投标时间" prop="bidding_time">
<template #default="{ row }">
<span>{{ row.bidding_time ? timeFormat(row.bidding_time, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template>
</el-table-column>
<el-table-column label="招标方式" prop="bidding_method">
<template #default="{ row }">
<dict-value :options="dictData.bidding_method" :value="row.bidding_method" />
</template>
</el-table-column>
<el-table-column label="联系人" prop="contacts" show-overflow-tooltip />
<el-table-column label="联系人职位" prop="position" show-overflow-tooltip />
<el-table-column label="联系电话" prop="telephone" show-overflow-tooltip />
<el-table-column label="联系人部门" prop="department" show-overflow-tooltip />
<el-table-column label="负责人" prop="person" show-overflow-tooltip />
<el-table-column label="关系度" prop="relationship">
<template #default="{ row }">
<dict-value :options="dictData.relationship" :value="row.relationship" />
</template>
</el-table-column>
<el-table-column label="发现时间" prop="discovery_time">
<template #default="{ row }">
<span>{{ row.discovery_time ? timeFormat(row.discovery_time, 'yyyy-mm-dd hh:MM:ss') : ''
}}</span>
</template>
</el-table-column>
<el-table-column label="战略意义" prop="strategic_significance">
<template #default="{ row }">
<dict-value :options="dictData.strategic_significance" :value="row.strategic_significance" />
</template>
</el-table-column>
<el-table-column label="所属行业" prop="industry">
<template #default="{ row }">
<dict-value :options="dictData.industry" :value="row.industry" />
</template>
</el-table-column>
<el-table-column label="单位性质" prop="unit_nature">
<template #default="{ row }">
<dict-value :options="dictData.unit_nature" :value="row.unit_nature" />
</template>
</el-table-column>
<el-table-column label="状态" prop="status" show-overflow-tooltip />
</el-table>
</div>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup>
import { usePaging } from "@/hooks/usePaging"
import { useDictData } from "@/hooks/useDictOptions"
import { apiProjectLists } from '@/api/project'
import { defineEmits } from "vue"
import { timeFormat } from '@/utils/util'
//
const queryParams = reactive({
custom_name: '',
project_type: ""
});
const { dictData } = useDictData('project_type,project_content,bidding_method,relationship,information_sources,construction_funds_sources,construction_financial_status,construction_recognition,my_construction_recognition,strategic_significance,industry,unit_nature')
//
const emits = defineEmits(["customEvent"]);
//
const handleCurrentChange = (value: any) => {
emits("customEvent", value);
};
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiProjectLists,
params: queryParams,
});
getLists();
</script>

View File

@ -369,10 +369,7 @@ const getCityList = async () => {
};
const getAreaList = async () => {
const data = await apiAreaList({ area: formData.city });
datas["areaOptions"] = data;
console.log(datas["areaOptions"])
};
//
@ -403,3 +400,9 @@ defineExpose({
getDetail
})
</script>
<style lang="scss">
.tit {
font-size: 1.2em;
margin-bottom: 10px;
}
</style>

View File

@ -69,7 +69,7 @@
</div>
<div class="flex mt-4 justify-end">
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>

View File

@ -59,15 +59,9 @@
<span style="cursor: pointer;margin-left: 5px;" @click="delFileFn(index)">x</span>
</div>
</div>
</el-form-item>
</el-col>
</el-row>
<el-dialog v-model="showDialog" title="选择客户" width="70%">
<customDialog @customEvent="customEvent"></customDialog>
</el-dialog>
@ -92,8 +86,7 @@ const base_url = configs.baseUrl + configs.urlPrefix
const userStore = useUserStore();
//
const handleAvatarSuccess_four = (
response,
uploadFile
response: any
) => {
if (response.code == 0) {
ElMessage.error(response.msg);

View File

@ -229,9 +229,6 @@
</el-form>
</popup>
</div>
</template>

View File

@ -0,0 +1,187 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="项目名称" prop="project_id">
<el-input v-model="formData.project_name" @click="showDialog = true" clearable placeholder="点击选择项目" />
</el-form-item>
<el-form-item label="执行人" prop="executor">
<el-input v-model="formData.executor" clearable placeholder="请输入执行人" />
</el-form-item>
<el-form-item label="联系人" prop="contacts">
<el-input v-model="formData.contacts" clearable placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="联系方式" prop="contact_information">
<el-input v-model="formData.contact_information" clearable placeholder="请输入联系方式" />
</el-form-item>
<el-form-item label="项目角色" prop="project_role">
<el-input v-model="formData.project_role" clearable placeholder="请输入项目角色" />
</el-form-item>
<el-form-item label="职位" prop="position">
<el-input v-model="formData.position" clearable placeholder="请输入职位" />
</el-form-item>
<el-form-item label="跟进日期" prop="follow_date">
<el-date-picker class="flex-1 !flex" v-model="formData.follow_date" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择跟进日期">
</el-date-picker>
</el-form-item>
<el-form-item label="跟进类型" prop="follow_type">
<el-select class="flex-1" v-model="formData.follow_type" clearable placeholder="请选择跟进类型">
<el-option v-for="(item, index) in dictData.types" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
<el-form-item label="主题" prop="theme">
<el-input v-model="formData.theme" clearable placeholder="请输入主题" />
</el-form-item>
<el-form-item label="行动描述" prop="action_description">
<el-input v-model="formData.action_description" clearable placeholder="请输入行动描述" />
</el-form-item>
<el-form-item label="项目把握度" prop="project_assurance">
<el-select class="flex-1" v-model="formData.project_assurance" clearable placeholder="请选择项目把握度">
<el-option v-for="(item, index) in dictData.project_assurance" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
<el-form-item label="跟进状态" prop="follow_status">
<el-select class="flex-1" v-model="formData.follow_status" clearable placeholder="请选择跟进状态">
<el-option v-for="(item, index) in dictData.follow_status" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
<el-form-item label="跟进阶段" prop="follow_stage">
<el-input v-model="formData.follow_stage" clearable placeholder="请输入跟进阶段" />
</el-form-item>
<el-form-item label="备注" prop="notes">
<el-input v-model="formData.notes" clearable placeholder="请输入备注" />
</el-form-item>
<el-form-item label="下次回访日期" prop="next_follow_up_date">
<el-date-picker class="flex-1 !flex" v-model="formData.next_follow_up_date" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择下次回访日期">
</el-date-picker>
</el-form-item>
<el-dialog v-model="showDialog" title="选择客户" width="70%">
<projectTable @customEvent="customEvent"></projectTable>
</el-dialog>
<!-- <el-form-item label="" prop="ceate_time">
<el-input v-model="formData.ceate_time" clearable placeholder="请输入" />
</el-form-item> -->
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectFollowUpEdit">
import type { FormInstance } from 'element-plus'
import projectTable from "@/components/tablieDialog/project.vue"
import Popup from '@/components/popup/index.vue'
import { apiProjectFollowUpAdd, apiProjectFollowUpEdit, apiProjectFollowUpDetail } from '@/api/project_follow_up'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
// dialog
const showDialog = ref(false)
const customEvent = (e: any) => {
formData.project_id = e.id;
formData.project_name = e.name;
showDialog.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑项目跟进记录' : '新增项目跟进记录'
})
//
const formData = reactive({
id: '',
project_id: '',
project_name: '',
executor: '',
contacts: '',
contact_information: '',
project_role: '',
position: '',
follow_date: '',
follow_type: '',
theme: '',
action_description: '',
project_assurance: '',
follow_status: '',
follow_stage: '',
notes: '',
next_follow_up_date: '',
ceate_time: '',
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.follow_date = timeFormat(formData.follow_date, 'yyyy-mm-dd hh:MM:ss')
//@ts-ignore
formData.next_follow_up_date = timeFormat(formData.next_follow_up_date, 'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiProjectFollowUpDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiProjectFollowUpEdit(data)
: await apiProjectFollowUpAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,258 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-row>
<el-col :span="6">
<el-form-item label="项目名称" prop="project_id">
<el-input v-model="queryParams.project_id" clearable placeholder="请输入项目名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="执行人" prop="executor">
<el-input v-model="queryParams.executor" clearable placeholder="请输入执行人" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="联系方式" prop="contact_information">
<el-input v-model="queryParams.contact_information" clearable placeholder="请输入联系方式" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="职位" prop="position">
<el-input v-model="queryParams.position" clearable placeholder="请输入职位" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目角色" prop="project_role">
<el-input v-model="queryParams.project_role" clearable placeholder="请输入项目角色" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="联系人" prop="contacts">
<el-input v-model="queryParams.contacts" clearable placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="跟进类型" prop="follow_type">
<el-select v-model="queryParams.follow_type" clearable placeholder="请选择跟进类型">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in dictData.types" :key="index" :label="item.name"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="主题" prop="theme">
<el-input v-model="queryParams.theme" clearable placeholder="请输入主题" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="行动描述" prop="action_description">
<el-input v-model="queryParams.action_description" clearable placeholder="请输入行动描述" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目把握度" prop="project_assurance">
<el-select v-model="queryParams.project_assurance" clearable placeholder="请选择项目把握度">
<el-option v-for="(item, index) in dictData.project_assurance" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="跟进状态" prop="follow_status">
<el-select v-model="queryParams.follow_status" clearable placeholder="请选择跟进状态">
<el-option v-for="(item, index) in dictData.follow_status" :key="index" :label="item.name"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="跟进阶段" prop="follow_stage">
<el-input v-model="queryParams.follow_stage" clearable placeholder="请输入跟进阶段" />
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="跟进日期" prop="follow_date">
<daterange-picker v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time" />
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="下次回访日期" prop="next_follow_up_date">
<daterange-picker v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
<!-- <l-form-item label="" prop="ceate_time">
<el-input v-model="queryParams.ceate_time" clearable placeholder="请输入" />
</l-form-item> -->
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['project.project_follow_up/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['project.project_follow_up/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="项目名称" prop="project_id" show-overflow-tooltip />
<el-table-column label="执行人" prop="executor" show-overflow-tooltip />
<el-table-column label="联系人" prop="contacts" show-overflow-tooltip />
<el-table-column label="联系方式" prop="contact_information" show-overflow-tooltip />
<el-table-column label="项目角色" prop="project_role" show-overflow-tooltip />
<el-table-column label="职位" prop="position" show-overflow-tooltip />
<el-table-column label="跟进日期" prop="follow_date">
<template #default="{ row }">
<span>{{ row.follow_date ? timeFormat(row.follow_date, 'yyyy-mm-dd hh:MM:ss') : '' }}</span>
</template>
</el-table-column>
<el-table-column label="跟进类型" prop="follow_type">
<template #default="{ row }">
<dict-value :options="dictData.follow_type" :value="row.follow_type" />
</template>
</el-table-column>
<el-table-column label="主题" prop="theme" show-overflow-tooltip />
<el-table-column label="行动描述" prop="action_description" show-overflow-tooltip />
<el-table-column label="项目把握度" prop="project_assurance">
<template #default="{ row }">
<dict-value :options="dictData.project_assurance" :value="row.project_assurance" />
</template>
</el-table-column>
<el-table-column label="跟进状态" prop="follow_status">
<template #default="{ row }">
<dict-value :options="dictData.follow_status" :value="row.follow_status" />
</template>
</el-table-column>
<el-table-column label="跟进阶段" prop="follow_stage" show-overflow-tooltip />
<el-table-column label="备注" prop="notes" show-overflow-tooltip />
<el-table-column label="下次回访日期" prop="next_follow_up_date">
<template #default="{ row }">
<span>{{ row.next_follow_up_date ? timeFormat(row.next_follow_up_date, 'yyyy-mm-dd hh:MM:ss') :
'' }}</span>
</template>
</el-table-column>
<el-table-column label="" prop="ceate_time" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['project.project_follow_up/edit']" type="primary" link
@click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['project.project_follow_up/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex justify-end mt-4">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="projectFollowUpLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiProjectFollowUpLists, apiProjectFollowUpDelete } from '@/api/project_follow_up'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
project_id: '',
executor: '',
contacts: '',
contact_information: '',
project_role: '',
position: '',
follow_date: '',
follow_type: '',
theme: '',
action_description: '',
project_assurance: '',
follow_status: '',
follow_stage: '',
notes: '',
next_follow_up_date: '',
ceate_time: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('types,project_assurance,follow_status')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiProjectFollowUpLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiProjectFollowUpDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -0,0 +1,122 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="项目名称" prop="project_id">
<el-input v-model="formData.project_name" @click="showDialog = true" clearable placeholder="点击选择项目" />
</el-form-item>
<el-form-item label="技术人员" prop="technician_ids">
<el-input v-model="formData.technician_ids" clearable placeholder="请输入技术人员" />
</el-form-item>
<el-form-item label="商务人员" prop="business_people_ids">
<el-input v-model="formData.business_people_ids" clearable placeholder="请输入商务人员" />
</el-form-item>
<el-form-item label="跨部门人员" prop="cross_departmental_personnel_ids">
<el-input v-model="formData.cross_departmental_personnel_ids" clearable placeholder="请输入跨部门人员" />
</el-form-item>
<el-dialog v-model="showDialog" title="选择客户" width="70%">
<projectTable @customEvent="customEvent"></projectTable>
</el-dialog>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="projectPreSalesMembersEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import projectTable from "@/components/tablieDialog/project.vue"
import { apiProjectPreSalesMembersAdd, apiProjectPreSalesMembersEdit, apiProjectPreSalesMembersDetail } from '@/api/project_pre_sales_members'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
// dialog
const showDialog = ref(false)
const customEvent = (e: any) => {
formData.project_id = e.id;
formData.project_name = e.name;
showDialog.value = false;
};
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑售前项目成员' : '新增售前项目成员'
})
//
const formData = reactive({
id: '',
project_id: '',
project_name: "",
technician_ids: '',
business_people_ids: '',
cross_departmental_personnel_ids: '',
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiProjectPreSalesMembersDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiProjectPreSalesMembersEdit(data)
: await apiProjectPreSalesMembersAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,140 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px]"
:model="queryParams"
inline
>
<el-form-item label="项目名称" prop="project_id">
<el-input class="w-[280px]" v-model="queryParams.project_id" clearable placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="技术人员" prop="technician_ids">
<el-input class="w-[280px]" v-model="queryParams.technician_ids" clearable placeholder="请输入技术人员" />
</el-form-item>
<el-form-item label="商务人员" prop="business_people_ids">
<el-input class="w-[280px]" v-model="queryParams.business_people_ids" clearable placeholder="请输入商务人员" />
</el-form-item>
<el-form-item label="跨部门人员" prop="cross_departmental_personnel_ids">
<el-input class="w-[280px]" v-model="queryParams.cross_departmental_personnel_ids" clearable placeholder="请输入跨部门人员" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['project.project_pre_sales_members/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['project.project_pre_sales_members/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="项目名称" prop="project_id" show-overflow-tooltip />
<el-table-column label="技术人员" prop="technician_ids" show-overflow-tooltip />
<el-table-column label="商务人员" prop="business_people_ids" show-overflow-tooltip />
<el-table-column label="跨部门人员" prop="cross_departmental_personnel_ids" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['project.project_pre_sales_members/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['project.project_pre_sales_members/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="projectPreSalesMembersLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiProjectPreSalesMembersLists, apiProjectPreSalesMembersDelete } from '@/api/project_pre_sales_members'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
project_id: '',
technician_ids: '',
business_people_ids: '',
cross_departmental_personnel_ids: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiProjectPreSalesMembersLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiProjectPreSalesMembersDelete({ id })
getLists()
}
getLists()
</script>