mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-06-19 23:02:00 +08:00
[feat] 添加项目跟踪
This commit is contained in:
parent
692907bd43
commit
4cbb3fbc31
@ -1,44 +1,49 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
|
||||||
// 客户信息 VO
|
// 客户信息 VO
|
||||||
export interface CustomerVO {
|
export interface CustomerVO {
|
||||||
id: number // 主键
|
id: number // 主键
|
||||||
name: string // 客户名称
|
name: string // 客户名称
|
||||||
code: string // 组织机构代码
|
code: string // 组织机构代码
|
||||||
contacts: string // 联系人
|
contacts: string // 联系人
|
||||||
phone: string // 电话
|
phone: string // 电话
|
||||||
address: string // 地址
|
address: string // 地址
|
||||||
}
|
}
|
||||||
|
|
||||||
// 客户信息 API
|
// 客户信息 API
|
||||||
export const CustomerApi = {
|
export const CustomerApi = {
|
||||||
// 查询客户信息分页
|
// 查询客户信息分页
|
||||||
getCustomerPage: async (params: any) => {
|
getCustomerPage: async (params: any) => {
|
||||||
return await request.get({ url: `/pm/customer/page`, params })
|
return await request.get({ url: `/pm/customer/page`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询客户信息详情
|
// 查询客户信息列表
|
||||||
getCustomer: async (id: number) => {
|
getCustomerList: async (params?: any) => {
|
||||||
return await request.get({ url: `/pm/customer/get?id=` + id })
|
return await request.get({ url: `/pm/customer/list`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 新增客户信息
|
// 查询客户信息详情
|
||||||
createCustomer: async (data: CustomerVO) => {
|
getCustomer: async (id: number) => {
|
||||||
return await request.post({ url: `/pm/customer/create`, data })
|
return await request.get({ url: `/pm/customer/get?id=` + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修改客户信息
|
// 新增客户信息
|
||||||
updateCustomer: async (data: CustomerVO) => {
|
createCustomer: async (data: CustomerVO) => {
|
||||||
return await request.put({ url: `/pm/customer/update`, data })
|
return await request.post({ url: `/pm/customer/create`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除客户信息
|
// 修改客户信息
|
||||||
deleteCustomer: async (id: number) => {
|
updateCustomer: async (data: CustomerVO) => {
|
||||||
return await request.delete({ url: `/pm/customer/delete?id=` + id })
|
return await request.put({ url: `/pm/customer/update`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导出客户信息 Excel
|
// 删除客户信息
|
||||||
exportCustomer: async (params) => {
|
deleteCustomer: async (id: number) => {
|
||||||
return await request.download({ url: `/pm/customer/export-excel`, params })
|
return await request.delete({ url: `/pm/customer/delete?id=` + id })
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
// 导出客户信息 Excel
|
||||||
|
exportCustomer: async (params) => {
|
||||||
|
return await request.download({ url: `/pm/customer/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
63
src/api/pm/projecttracking/index.ts
Normal file
63
src/api/pm/projecttracking/index.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 项目跟踪 VO
|
||||||
|
export interface ProjectTrackingVO {
|
||||||
|
id: number // 主键
|
||||||
|
name: string // 项目名称
|
||||||
|
constructionId: number // 建设单位id
|
||||||
|
contacts: string // 联系人
|
||||||
|
phone: string // 联系方式
|
||||||
|
deptId: number // 主控部门id
|
||||||
|
pmId: number // 项目负责人id
|
||||||
|
contractAmount: string // 预计合同额
|
||||||
|
provincId: number // 省份id
|
||||||
|
cityId: number // 城市id
|
||||||
|
address: string // 地址
|
||||||
|
businessType: string // 业务类型
|
||||||
|
situation: string // 项目情况
|
||||||
|
emergency: boolean // 是否为应急项目
|
||||||
|
entrustmentMethod: string // 委托方式
|
||||||
|
emergencyDocId: number // 应急项目附件id
|
||||||
|
collaborativeProjects: boolean // 是否业务合作项目
|
||||||
|
cooperativeCompanyId: number // 合作单位id
|
||||||
|
landingPossibility: string // 落地可能性
|
||||||
|
expectedTime: Date // 预计落地时间
|
||||||
|
changeOfMatters: string // 变更事项
|
||||||
|
changeReason: string // 变更原因
|
||||||
|
beforeChange: string // 变更前
|
||||||
|
afterChange: string // 变更后
|
||||||
|
entrustmentOther: string // 委托方式其他
|
||||||
|
}
|
||||||
|
|
||||||
|
// 项目跟踪 API
|
||||||
|
export const ProjectTrackingApi = {
|
||||||
|
// 查询项目跟踪 分页
|
||||||
|
getProjectTrackingPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/pm/project-tracking/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询项目跟踪 详情
|
||||||
|
getProjectTracking: async (id: number) => {
|
||||||
|
return await request.get({ url: `/pm/project-tracking/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增项目跟踪
|
||||||
|
createProjectTracking: async (data: ProjectTrackingVO) => {
|
||||||
|
return await request.post({ url: `/pm/project-tracking/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改项目跟踪
|
||||||
|
updateProjectTracking: async (data: ProjectTrackingVO) => {
|
||||||
|
return await request.put({ url: `/pm/project-tracking/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除项目跟踪
|
||||||
|
deleteProjectTracking: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/pm/project-tracking/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出项目跟踪 Excel
|
||||||
|
exportProjectTracking: async (params) => {
|
||||||
|
return await request.download({ url: `/pm/project-tracking/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
@ -1,44 +1,49 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
|
||||||
// 供应商信息 VO
|
// 供应商信息 VO
|
||||||
export interface SubcontractorVO {
|
export interface SubcontractorVO {
|
||||||
id: number // 主键
|
id: number // 主键
|
||||||
name: string // 供应商名称
|
name: string // 供应商名称
|
||||||
code: string // 组织机构代码
|
code: string // 组织机构代码
|
||||||
contacts: string // 联系人
|
contacts: string // 联系人
|
||||||
phone: string // 电话
|
phone: string // 电话
|
||||||
address: string // 地址
|
address: string // 地址
|
||||||
}
|
}
|
||||||
|
|
||||||
// 供应商信息 API
|
// 供应商信息 API
|
||||||
export const SubcontractorApi = {
|
export const SubcontractorApi = {
|
||||||
// 查询供应商信息分页
|
// 查询供应商信息分页
|
||||||
getSubcontractorPage: async (params: any) => {
|
getSubcontractorPage: async (params: any) => {
|
||||||
return await request.get({ url: `/pm/subcontractor/page`, params })
|
return await request.get({ url: `/pm/subcontractor/page`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 查询供应商信息详情
|
// 查询供应商信息列表
|
||||||
getSubcontractor: async (id: number) => {
|
getSubcontractorList: async (params?: any) => {
|
||||||
return await request.get({ url: `/pm/subcontractor/get?id=` + id })
|
return await request.get({ url: `/pm/subcontractor/list`, params })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 新增供应商信息
|
// 查询供应商信息详情
|
||||||
createSubcontractor: async (data: SubcontractorVO) => {
|
getSubcontractor: async (id: number) => {
|
||||||
return await request.post({ url: `/pm/subcontractor/create`, data })
|
return await request.get({ url: `/pm/subcontractor/get?id=` + id })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 修改供应商信息
|
// 新增供应商信息
|
||||||
updateSubcontractor: async (data: SubcontractorVO) => {
|
createSubcontractor: async (data: SubcontractorVO) => {
|
||||||
return await request.put({ url: `/pm/subcontractor/update`, data })
|
return await request.post({ url: `/pm/subcontractor/create`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除供应商信息
|
// 修改供应商信息
|
||||||
deleteSubcontractor: async (id: number) => {
|
updateSubcontractor: async (data: SubcontractorVO) => {
|
||||||
return await request.delete({ url: `/pm/subcontractor/delete?id=` + id })
|
return await request.put({ url: `/pm/subcontractor/update`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导出供应商信息 Excel
|
// 删除供应商信息
|
||||||
exportSubcontractor: async (params) => {
|
deleteSubcontractor: async (id: number) => {
|
||||||
return await request.download({ url: `/pm/subcontractor/export-excel`, params })
|
return await request.delete({ url: `/pm/subcontractor/delete?id=` + id })
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
// 导出供应商信息 Excel
|
||||||
|
exportSubcontractor: async (params) => {
|
||||||
|
return await request.download({ url: `/pm/subcontractor/export-excel`, params })
|
||||||
|
},
|
||||||
|
}
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<!-- 下面的部分:隐藏的搜索条件 -->
|
<!-- 下面的部分:隐藏的搜索条件 -->
|
||||||
<el-collapse-transition>
|
<el-collapse-transition>
|
||||||
<el-row :gutter="20" v-show="showMore">
|
<el-row :gutter="23" v-show="showMore">
|
||||||
<el-col :span="6" v-for="(field, index) in hiddenFields" :key="index">
|
<el-col :span="6" v-for="(field, index) in hiddenFields" :key="index">
|
||||||
<el-form-item :label="field.label" :prop="field.prop">
|
<el-form-item :label="field.label" :prop="field.prop">
|
||||||
<component
|
<component
|
||||||
@ -84,10 +84,10 @@
|
|||||||
</el-collapse-transition>
|
</el-collapse-transition>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- 右边部分:展开按钮 -->
|
<!-- 右边部分:展开按钮 -->
|
||||||
<el-col :span="2" style="text-align: right;" v-if="hasMoreFields">
|
<el-col :span="1" style="text-align: right;" v-if="hasMoreFields">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="text" @click="toggleShowMore">
|
<el-button type="text" @click="toggleShowMore">
|
||||||
{{ showMore ? '收起' : '展开更多' }}
|
{{ showMore ? '收起' : '展开' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -234,6 +234,9 @@ export enum DICT_TYPE {
|
|||||||
PROCESS_STATUS = "process_status", // 流程状态
|
PROCESS_STATUS = "process_status", // 流程状态
|
||||||
POSSIBILITY_OF_LANDING = "possibility_of_landing", // 可能性
|
POSSIBILITY_OF_LANDING = "possibility_of_landing", // 可能性
|
||||||
|
|
||||||
|
// =========== PM ==========
|
||||||
|
CHANGE_OF_MATTERS = "change_of_matters", // 变更事项
|
||||||
|
|
||||||
// ========== IOT - 物联网模块 ==========
|
// ========== IOT - 物联网模块 ==========
|
||||||
IOT_NET_TYPE = 'iot_net_type', // IOT 联网方式
|
IOT_NET_TYPE = 'iot_net_type', // IOT 联网方式
|
||||||
IOT_VALIDATE_TYPE = 'iot_validate_type', // IOT 数据校验级别
|
IOT_VALIDATE_TYPE = 'iot_validate_type', // IOT 数据校验级别
|
||||||
|
448
src/views/pm/projecttracking/ProjectTrackingForm.vue
Normal file
448
src/views/pm/projecttracking/ProjectTrackingForm.vue
Normal file
@ -0,0 +1,448 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="50%">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="150px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="项目名称" prop="name">
|
||||||
|
<el-input v-model="formData.name" placeholder="请输入项目名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="建设单位" prop="constructionId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.constructionId"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择建设单位">
|
||||||
|
<el-option
|
||||||
|
v-for="customer in customerList"
|
||||||
|
:key="customer.id"
|
||||||
|
:label="customer.name"
|
||||||
|
:value="customer.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="联系人" prop="contacts">
|
||||||
|
<el-input v-model="formData.contacts" placeholder="请输入联系人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="联系方式" prop="phone">
|
||||||
|
<el-input v-model="formData.phone" placeholder="请输入联系方式" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="主控部门" prop="deptId">
|
||||||
|
<el-tree-select
|
||||||
|
v-model=formData.deptId
|
||||||
|
:data="deptOptions"
|
||||||
|
:props="defaultProps"
|
||||||
|
check-strictly
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
empty-text="加载中,请稍后"
|
||||||
|
default-expand-all
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="拟派项目负责人" prop="pmId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.pmId"
|
||||||
|
placeholder="请选择项目经理"
|
||||||
|
class="w-1/1"
|
||||||
|
filterable
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in userOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.nickname"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="省份" prop="provincId">
|
||||||
|
<el-select
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择省份"
|
||||||
|
v-model="formData.provincId"
|
||||||
|
@change="onProvinceChange"
|
||||||
|
:disabled="formType !== 'create'"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in areaList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="城市" prop="cityId">
|
||||||
|
<el-select
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择城市"
|
||||||
|
v-model="formData.cityId"
|
||||||
|
:disabled="formType !== 'create'"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in cityList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="地址" prop="address">
|
||||||
|
<el-cascader
|
||||||
|
v-model="formData.address"
|
||||||
|
:options="areaList"
|
||||||
|
:props="defaultProps"
|
||||||
|
class="w-1/1"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择城市"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="预计合同额" prop="contractAmount">
|
||||||
|
<el-input v-model="formData.contractAmount" placeholder="请输入预计合同额" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="业务类型" prop="businessType">
|
||||||
|
<el-radio-group v-model="formData.businessType">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.PROJECT_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="项目情况" prop="situation">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.situation"
|
||||||
|
placeholder="请输入项目情况"
|
||||||
|
type="textarea"
|
||||||
|
:rows="3"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否应急项目" prop="emergency">
|
||||||
|
<el-radio-group v-model="formData.emergency">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" v-if="formData.emergency === true">
|
||||||
|
<el-form-item label="项目附件" prop="emergencyDocId" >
|
||||||
|
<UploadFile v-model="formData.emergencyDocId" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="委托方式" prop="entrustmentMethod">
|
||||||
|
<el-row :gutter="10" style="display: flex; align-items: flex-end;">
|
||||||
|
<el-col :span="14">
|
||||||
|
<el-radio-group v-model="formData.entrustmentMethod">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.ENTRUST_METHOD)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="10" v-if="formData.entrustmentMethod === 'other'">
|
||||||
|
<el-input
|
||||||
|
v-model="formData.entrustmentOther"
|
||||||
|
placeholder="请输入其他委托方式"
|
||||||
|
/>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否业务合作项目" prop="collaborativeProjects">
|
||||||
|
<el-radio-group v-model="formData.collaborativeProjects">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getBoolDictOptions(DICT_TYPE.INFRA_BOOLEAN_STRING)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="业务合作单位" prop="cooperativeCompanyId">
|
||||||
|
<el-select
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
placeholder="请选择业务合作单位"
|
||||||
|
v-model="formData.cooperativeCompanyId"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in subcontractorList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="落地可能性" prop="landingPossibility">
|
||||||
|
<el-radio-group v-model="formData.landingPossibility">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.POSSIBILITY_OF_LANDING)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="预计落地时间" prop="expectedTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.expectedTime"
|
||||||
|
type="date"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择预计落地时间"
|
||||||
|
style="width: 100%;"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更事项" prop="changeOfMatters">
|
||||||
|
<el-radio-group v-model="formData.changeOfMatters">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.CHANGE_OF_MATTERS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="变更原因" prop="changeReason">
|
||||||
|
<el-input v-model="formData.changeReason" placeholder="请输入变更原因" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="变更前" prop="beforeChange">
|
||||||
|
<el-input v-model="formData.beforeChange" placeholder="请输入变更前" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="变更后" prop="afterChange">
|
||||||
|
<el-input v-model="formData.afterChange" placeholder="请输入变更后" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStrDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { ProjectTrackingApi, ProjectTrackingVO } from '@/api/pm/projecttracking'
|
||||||
|
import * as AreaApi from '@/api/system/area'
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
import { CustomerApi } from "@/api/pm/customer";
|
||||||
|
import { SubcontractorApi} from "@/api/pm/subcontractor";
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
|
||||||
|
|
||||||
|
/** 项目跟踪 表单 */
|
||||||
|
defineOptions({ name: 'ProjectTrackingForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const areaList = ref([]) // 地区列表
|
||||||
|
const cityList = ref([]); // 城市options
|
||||||
|
const customerList = ref([]) // 客户列表
|
||||||
|
const subcontractorList = ref([]) // 分包商列表
|
||||||
|
const deptOptions = ref<any[]>([]) // 部门树形结构
|
||||||
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
constructionId: undefined,
|
||||||
|
contacts: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
pmId: undefined,
|
||||||
|
contractAmount: undefined,
|
||||||
|
provincId: undefined,
|
||||||
|
cityId: undefined,
|
||||||
|
address: undefined,
|
||||||
|
businessType: undefined,
|
||||||
|
situation: undefined,
|
||||||
|
emergency: undefined,
|
||||||
|
entrustmentMethod: undefined,
|
||||||
|
emergencyDocId: undefined,
|
||||||
|
collaborativeProjects: undefined,
|
||||||
|
cooperativeCompanyId: undefined,
|
||||||
|
landingPossibility: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
changeOfMatters: undefined,
|
||||||
|
changeReason: undefined,
|
||||||
|
beforeChange: undefined,
|
||||||
|
afterChange: undefined,
|
||||||
|
entrustmentOther: undefined,
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
name: [{ required: true, message: '项目名称不能为空', trigger: 'blur' }],
|
||||||
|
constructionId: [{ required: true, message: '建设单位id不能为空', trigger: 'blur' }],
|
||||||
|
contacts: [{ required: true, message: '联系人 不能为空', trigger: 'blur' }],
|
||||||
|
phone: [{ required: true, message: '联系方式不能为空', trigger: 'blur' }],
|
||||||
|
deptId: [{ required: true, message: '主控部门id不能为空', trigger: 'blur' }],
|
||||||
|
pmId: [{ required: true, message: '项目负责人id不能为空', trigger: 'blur' }],
|
||||||
|
contractAmount: [{ required: true, message: '预计合同额不能为空', trigger: 'blur' }],
|
||||||
|
provincId: [{ required: true, message: '省份id不能为空', trigger: 'change' }],
|
||||||
|
cityId: [{ required: true, message: '城市id不能为空', trigger: 'change' }],
|
||||||
|
address: [{ required: true, message: '地址不能为空', trigger: 'blur' }],
|
||||||
|
businessType: [{ required: true, message: '业务类型不能为空', trigger: 'blur' }],
|
||||||
|
situation: [{ required: true, message: '项目情况不能为空', trigger: 'blur' }],
|
||||||
|
emergency: [{ required: true, message: '是否为应急项目不能为空', trigger: 'blur' }],
|
||||||
|
entrustmentMethod: [{ required: true, message: '委托方式不能为空', trigger: 'blur' }],
|
||||||
|
collaborativeProjects: [{ required: true, message: '是否业务合作项目不能为空', trigger: 'blur' }],
|
||||||
|
cooperativeCompanyId: [{ required: true, message: '合作单位id不能为空', trigger: 'blur' }],
|
||||||
|
landingPossibility: [{ required: true, message: '落地可能性不能为空', trigger: 'blur' }],
|
||||||
|
expectedTime: [{ required: true, message: '预计落地时间不能为空', trigger: 'blur' }],
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await ProjectTrackingApi.getProjectTracking(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 获得地区列表
|
||||||
|
areaList.value = await AreaApi.getAreaTree()
|
||||||
|
// 获得客户列表
|
||||||
|
customerList.value = await CustomerApi.getCustomerList({})
|
||||||
|
// 获得部门列表
|
||||||
|
deptOptions.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||||
|
// 获得用户列表
|
||||||
|
userOptions.value = await UserApi.getSimpleUserList()
|
||||||
|
// 获得分包商列表
|
||||||
|
subcontractorList.value = await SubcontractorApi.getSubcontractorList({})
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
await formRef.value.validate()
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as unknown as ProjectTrackingVO
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ProjectTrackingApi.createProjectTracking(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ProjectTrackingApi.updateProjectTracking(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
constructionId: undefined,
|
||||||
|
contacts: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
pmId: undefined,
|
||||||
|
contractAmount: undefined,
|
||||||
|
provincId: undefined,
|
||||||
|
cityId: undefined,
|
||||||
|
address: undefined,
|
||||||
|
businessType: undefined,
|
||||||
|
situation: undefined,
|
||||||
|
emergency: undefined,
|
||||||
|
entrustmentMethod: undefined,
|
||||||
|
emergencyDocId: undefined,
|
||||||
|
collaborativeProjects: undefined,
|
||||||
|
cooperativeCompanyId: undefined,
|
||||||
|
landingPossibility: undefined,
|
||||||
|
expectedTime: undefined,
|
||||||
|
changeOfMatters: undefined,
|
||||||
|
changeReason: undefined,
|
||||||
|
beforeChange: undefined,
|
||||||
|
afterChange: undefined,
|
||||||
|
entrustmentOther: undefined,
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
// 省份更新时,刷新城市选项
|
||||||
|
const onProvinceChange = (value: number)=>{
|
||||||
|
formData.value.cityId = undefined;
|
||||||
|
cityList.value = (areaList.value.find(({id})=>id===value) as any)?.children ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
179
src/views/pm/projecttracking/index.vue
Normal file
179
src/views/pm/projecttracking/index.vue
Normal file
@ -0,0 +1,179 @@
|
|||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBarEx
|
||||||
|
:fields="allFields"
|
||||||
|
:queryParams="queryParams"
|
||||||
|
@query="handleQuery"
|
||||||
|
@reset="resetQuery"
|
||||||
|
@create="openForm('create')"
|
||||||
|
@export="handleExport"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="项目名称" align="center" prop="name" />
|
||||||
|
<el-table-column label="建设单位" align="center" prop="constructionName" />
|
||||||
|
<el-table-column label="主控部门" align="center" prop="deptName" />
|
||||||
|
<el-table-column label="项目负责人" align="center" prop="pmName" />
|
||||||
|
<el-table-column label="预计合同额" align="center" prop="contractAmount" />
|
||||||
|
<el-table-column label="业务类型" align="center" prop="businessType">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.PROJECT_TYPE" :value="scope.row.businessType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="落地可能性" align="center" prop="landingPossibility">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.POSSIBILITY_OF_LANDING" :value="scope.row.landingPossibility" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="预计落地时间"
|
||||||
|
align="center"
|
||||||
|
prop="expectedTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="操作" align="center" min-width="120px">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['pm:project-tracking:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-hasPermi="['pm:project-tracking:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<ProjectTrackingForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { ProjectTrackingApi, ProjectTrackingVO } from '@/api/pm/projecttracking'
|
||||||
|
import ProjectTrackingForm from './ProjectTrackingForm.vue'
|
||||||
|
import SearchBarEx from "@/components/SearchBar/SearchBarEx.vue";
|
||||||
|
|
||||||
|
/** 项目跟踪 列表 */
|
||||||
|
defineOptions({ name: 'ProjectTracking' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref<ProjectTrackingVO[]>([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: undefined,
|
||||||
|
constructionId: undefined,
|
||||||
|
constructionName: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
deptName: undefined,
|
||||||
|
pmName: undefined,
|
||||||
|
pmId: undefined,
|
||||||
|
contractAmount: undefined,
|
||||||
|
businessType: undefined,
|
||||||
|
landingPossibility: undefined,
|
||||||
|
})
|
||||||
|
const formRef = ref()
|
||||||
|
|
||||||
|
// 定义所有搜索字段
|
||||||
|
const allFields = [
|
||||||
|
{ label: '项目名称', prop: 'name', component: 'el-input' },
|
||||||
|
{ label: '建设单位', prop: 'constructionName', component: 'el-input' },
|
||||||
|
{ label: '主控部门', prop: 'deptName',component: 'el-input' },
|
||||||
|
{ label: '负责人', prop: 'pmName',component: 'el-input' },
|
||||||
|
{ label: '合同额', prop: 'contractAmount', component: 'el-input' },
|
||||||
|
{ label: '业务类型', prop: 'businessType', component: 'el-select', options: getStrDictOptions(DICT_TYPE.PROJECT_TYPE).map(dict => ({ label: dict.label, value: dict.value })) },
|
||||||
|
{ label: '落地性', prop: 'landingPossibility', component: 'el-select', options: getStrDictOptions(DICT_TYPE.POSSIBILITY_OF_LANDING).map(dict => ({ label: dict.label, value: dict.value })) },
|
||||||
|
]
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await ProjectTrackingApi.getProjectTrackingPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = (params: any) => {
|
||||||
|
Object.assign(queryParams, params)
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
for (const key in queryParams) {
|
||||||
|
if (key !== 'pageNo' && key !== 'pageSize') {
|
||||||
|
queryParams[key] = undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await ProjectTrackingApi.deleteProjectTracking(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
const data = await ProjectTrackingApi.exportProjectTracking(queryParams)
|
||||||
|
download.excel(data, '项目跟踪.xls')
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
x
Reference in New Issue
Block a user