This commit is contained in:
mkm 2024-04-25 21:51:52 +08:00
parent c55a25a9eb
commit f2a5af731a
7 changed files with 1029 additions and 830 deletions

View File

@ -1,5 +1,5 @@
NODE_ENV = 'development'
VITE_APP_BASE_URL = 'http://a.com/'
VITE_APP_BASE_URL = 'https://ceshi-engineering.lihaink.cn/'
# VITE_APP_BASE_URL = 'http://www.eng.local/'
# VITE_APP_BASE_URL = 'http://192.168.1.5:9090/'

View File

@ -1,496 +1,571 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称" prop="project_name">
<el-input v-model="formData.project_name" clearable placeholder="请输入项目名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编号">
<el-input v-model="formData.project_code" clearable placeholder="系统自动生成" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="行业" prop="industry">
<el-select class="flex-1" v-model="formData.industry" clearable placeholder="请选择行业">
<el-option v-for="(item, index) in dictData.supervision_project_industry" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="性质" prop="nature">
<el-select class="flex-1" v-model="formData.nature" clearable placeholder="请选择性质">
<el-option v-for="(item, index) in dictData.supervision_project_nature" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="委托单位">
<el-input v-model="formData.company" clearable placeholder="请输入委托单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设区域" prop="build_area">
<el-select class="flex-1" v-model="formData.build_area" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.const_area" :key="index" :label="item.name"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目地址">
<el-input v-model="formData.address" clearable placeholder="请输入项目地址" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目级别" prop="project_level">
<el-select class="flex-1" v-model="formData.project_level" clearable placeholder="请选择项目级别">
<el-option v-for="(item, index) in dictData.supervision_project_level" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总投资(元)" prop="total_investment">
<el-input v-model="formData.total_investment" clearable placeholder="请输入总投资(元)" type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="立项日期">
<el-date-picker class="flex-1 !flex" v-model="formData.initiation_date" clearable
value-format="YYYY-MM-DD" placeholder="选择咨询结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联合同">
<el-input v-model="formData.contract" clearable placeholder="请输入关联合同" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
<el-input v-model="formData.contract_amount" clearable placeholder="请输入合同金额" type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同服务内容">
<el-input v-model="formData.contract_content" clearable placeholder="请输入合同服务内容" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目规模及概况">
<el-input v-model="formData.project_overview" clearable placeholder="请输入项目规模及概况" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询范围">
<el-input v-model="formData.consult_content" clearable placeholder="请输入咨询范围" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询开始日期" prop="consult_start_date">
<el-date-picker class="flex-1 !flex" v-model="formData.consult_start_date" clearable
value-format="YYYY-MM-DD" placeholder="选择咨询开始日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询结束日期" prop="consult_end_date">
<el-date-picker class="flex-1 !flex" v-model="formData.consult_end_date" clearable
value-format="YYYY-MM-DD" placeholder="选择咨询结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工程状态" prop="engineering_status">
<el-select class="flex-1" v-model="formData.engineering_status" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.engineering_status" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询类型" prop="consult_type">
<el-select class="flex-1" v-model="formData.consult_type" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.consult_type" :key="index" :label="item.name"
:value="item.value" />
</el-select>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称" prop="project_name">
<el-input v-model="formData.project_name" clearable placeholder="请输入项目名称"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目编号">
<el-input v-model="formData.project_code" clearable placeholder="系统自动生成" disabled/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="行业" prop="industry">
<el-select class="flex-1" v-model="formData.industry" clearable placeholder="请选择行业">
<el-option v-for="(item, index) in dictData.supervision_project_industry" :key="index"
:label="item.name" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="性质" prop="nature">
<el-select class="flex-1" v-model="formData.nature" clearable placeholder="请选择性质">
<el-option v-for="(item, index) in dictData.supervision_project_nature" :key="index"
:label="item.name" :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="委托单位">
<el-input v-model="formData.company" clearable placeholder="请输入委托单位" @click="showDialog1 = true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设区域" prop="build_area">
<el-select class="flex-1" v-model="formData.build_area" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.const_area" :key="index" :label="item.name"
:value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目地址">
<el-input v-model="formData.address" clearable placeholder="请输入项目地址"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目级别" prop="project_level">
<el-select class="flex-1" v-model="formData.project_level" clearable placeholder="请选择项目级别">
<el-option v-for="(item, index) in dictData.supervision_project_level" :key="index"
:label="item.name" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总投资(元)" prop="total_investment">
<el-input v-model="formData.total_investment" clearable placeholder="请输入总投资(元)" type="number"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="立项日期">
<el-date-picker class="flex-1 !flex" v-model="formData.initiation_date" clearable
value-format="YYYY-MM-DD" placeholder="选择咨询结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联合同">
<el-input v-model="formData.contract_name" clearable placeholder="请输入关联合同"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同金额">
<el-input v-model="formData.contract_amount" clearable placeholder="请输入合同金额" type="number"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同服务内容">
<el-input v-model="formData.contract_content" clearable placeholder="请输入合同服务内容"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目规模及概况">
<el-input v-model="formData.project_overview" clearable placeholder="请输入项目规模及概况"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询范围">
<el-input v-model="formData.consult_content" clearable placeholder="请输入咨询范围"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询开始日期" prop="consult_start_date">
<el-date-picker class="flex-1 !flex" v-model="formData.consult_start_date" clearable
value-format="YYYY-MM-DD" placeholder="选择咨询开始日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询结束日期" prop="consult_end_date">
<el-date-picker class="flex-1 !flex" v-model="formData.consult_end_date" clearable
value-format="YYYY-MM-DD" placeholder="选择咨询结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工程状态" prop="engineering_status">
<el-select class="flex-1" v-model="formData.engineering_status" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.engineering_status" :key="index"
:label="item.name" :value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="咨询类型" prop="consult_type">
<el-select class="flex-1" v-model="formData.consult_type" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.consult_type" :key="index" :label="item.name"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话" prop="telephone">
<el-input v-model="formData.telephone" clearable placeholder="请输入联系电话" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="委托联系人">
<el-input v-model="formData.consult_user" clearable placeholder="请输入委托联系人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="监管部门">
<el-input v-model="formData.supervision_department" clearable placeholder="请输入监管部门" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实施部门">
<el-input v-model="formData.implementation_department" clearable placeholder="请输入实施部门" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目部">
<el-input v-model="formData.project_department" clearable placeholder="请输入项目部" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目负责人员">
<el-input v-model="formData.project_manager" clearable placeholder="请输入项目负责人员" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方单位">
<el-input v-model="formData.part_a_unit" clearable placeholder="请输入甲方单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目归档">
<el-checkbox-group v-model="formData.project_archiving">
<el-checkbox :label="item.value" :key="i" v-for="(item, i) in dictData.project_archiving">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="归档目录">
<el-input v-model="formData.archiving_directory" clearable placeholder="请输入归档目录" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<uploadAnnex :formData="formData"></uploadAnnex>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建人" prop="create_user">
<el-input v-model="formData.create_user" clearable placeholder="请输入创建人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" prop="create_time">
<el-date-picker class="flex-1 !flex" v-model="formData.create_time" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择创建时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话" prop="telephone">
<el-input v-model="formData.telephone" clearable placeholder="请输入联系电话"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="委托联系人">
<el-input v-model="formData.consult_user_name" clearable placeholder="请输入委托联系人" @click="userclick('consult_user')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="监管部门">
<el-select v-model="formData.supervision_department" placeholder="请选择监管部门"
class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实施部门">
<el-select v-model="formData.implementation_department" placeholder="请选择实施部门"
class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目部">
<el-select v-model="formData.project_department" placeholder="请选择项目部门" class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目负责人员">
<el-input v-model="formData.project_manager_name" clearable placeholder="请输入项目负责人员" @click="userclick('project_manager')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方单位">
<el-input v-model="formData.part_a_unit" clearable placeholder="请输入甲方单位"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目归档">
<el-checkbox-group v-model="formData.project_archiving">
<el-checkbox :label="item.value" :key="i" v-for="(item, i) in dictData.project_archiving">
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="归档目录">
<el-input v-model="formData.archiving_directory" clearable placeholder="请输入归档目录"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件">
<uploadAnnex :formData="formData"></uploadAnnex>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建人" prop="create_user">
<el-input v-model="formData.create_user" clearable placeholder="请输入创建人"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" prop="create_time">
<el-date-picker class="flex-1 !flex" v-model="formData.create_time" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="选择创建时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-row>
</el-form>
</popup>
</div>
</el-form>
<div v-if="showDialog">
<personnelselector ref="personnel" @confirm="submituser" type="1">
</personnelselector>
</div>
<el-dialog v-model="showDialog1" title="选择委托单位" width="70%">
<dialogTable :config="marketing_custom" @customEvent="customEvent1"></dialogTable>
</el-dialog>
<el-dialog v-model="showDialog2" title="选择甲方单位" width="70%">
<dialogTable :config="marketing_custom" @customEvent="customEvent2"></dialogTable>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="consultProjectEdit">
import type { FormInstance } from 'element-plus'
import type {FormInstance} from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiConsultProjectAdd, apiConsultProjectEdit, apiConsultProjectDetail } from '@/api/consult_project'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
import {apiConsultProjectAdd, apiConsultProjectEdit, apiConsultProjectDetail} from '@/api/consult_project'
import {timeFormat} from '@/utils/util'
import type {PropType} from 'vue'
import useUserStore from "@/stores/modules/user";
import { checkPhone } from "@/utils/validate"
import {checkPhone} from "@/utils/validate"
import {apiCostApprovedProjectDetail} from "@/api/cost_approved_project";
import {marketing_custom} from "@/components/dialogTable/dialogTableConfig";
const userStore = useUserStore().userInfo;
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
deptList: Array
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const showDialog1 = ref(false)
const showDialog2 = ref(false)
const personnel = ref(null)
const route = useRoute()
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑项目咨询--基本信息' : '新增项目咨询--基本信息'
return mode.value == 'edit' ? '编辑项目咨询--基本信息' : '新增项目咨询--基本信息'
})
//
const formData = reactive({
id: '',
project_name: '',
project_code: '',
industry: '',
nature: '',
company: '',
build_area: '',
address: '',
project_level: '',
total_investment: '',
initiation_date: '',
contract: '',
contract_amount: '',
contract_content: '',
project_overview: '',
consult_content: '',
remark: '',
consult_start_date: '',
consult_end_date: '',
engineering_status: '',
consult_type: '',
telephone: '',
consult_user: '',
supervision_department: '',
implementation_department: '',
project_department: '',
project_manager: '',
part_a_unit: '',
project_archiving: [],
archiving_directory: '',
annex: [],
create_user: userStore.account,
create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss'),
id: '',
project_name: '',
project_code: '',
industry: '',
nature: '',
company: '',
company_name: '',
build_area: '',
address: '',
project_level: '',
total_investment: '',
initiation_date: '',
contract: '',
contract_name: '',
contract_amount: '',
contract_content: '',
project_overview: '',
consult_content: '',
remark: '',
consult_start_date: '',
consult_end_date: '',
engineering_status: '',
consult_type: '',
telephone: '',
consult_user: '',
consult_user_name: '',
supervision_department: '',
implementation_department: '',
project_department: '',
project_manager: '',
project_manager_name: '',
part_a_unit: '',
part_a: '',
project_archiving: [],
archiving_directory: '',
annex: [],
create_user: userStore.account,
create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss'),
})
const chekcDate = (rule: any, value: any, callback: any) => {
if (new Date(formData.consult_end_date) < new Date(formData.consult_start_date)) {
callback(new Error('咨询结束日期不能早于咨询开始日期'))
} else {
callback()
}
if (new Date(formData.consult_end_date) < new Date(formData.consult_start_date)) {
callback(new Error('咨询结束日期不能早于咨询开始日期'))
} else {
callback()
}
}
//
const formRules = reactive<any>({
project_name: [{
required: true,
message: '请输入项目名称',
trigger: ['blur']
}],
project_code: [{
required: true,
message: '请输入项目编号',
trigger: ['blur']
}],
industry: [{
required: true,
message: '请输入行业',
trigger: ['blur']
}],
nature: [{
required: true,
message: '请输入性质',
trigger: ['blur']
}],
company: [{
required: true,
message: '请输入委托单位',
trigger: ['blur']
}],
build_area: [{
required: true,
message: '请输入建设区域',
trigger: ['blur']
}],
address: [{
required: true,
message: '请输入项目地址',
trigger: ['blur']
}],
project_level: [{
required: true,
message: '请输入项目级别',
trigger: ['blur']
}],
total_investment: [{
required: true,
message: '请输入总投资(元)',
trigger: ['blur']
}],
initiation_date: [{
required: true,
message: '请输入立项日期',
trigger: ['blur']
}],
contract: [{
required: true,
message: '请输入关联合同',
trigger: ['blur']
}],
contract_amount: [{
required: true,
message: '请输入合同金额',
trigger: ['blur']
}],
contract_content: [{
required: true,
message: '请输入合同服务内容',
trigger: ['blur']
}],
project_overview: [{
required: true,
message: '请输入项目规模及概况',
trigger: ['blur']
}],
consult_content: [{
required: true,
message: '请输入咨询范围',
trigger: ['blur']
}],
remark: [{
required: true,
message: '请输入备注',
trigger: ['blur']
}],
consult_start_date: [{
required: true,
message: '请输入咨询开始日期',
trigger: ['blur']
}],
consult_end_date: [{
required: true,
message: '请输入咨询结束日期',
trigger: ['blur']
},
project_name: [{
required: true,
message: '请输入项目名称',
trigger: ['blur']
}],
project_code: [{
required: true,
message: '请输入项目编号',
trigger: ['blur']
}],
industry: [{
required: true,
message: '请输入行业',
trigger: ['blur']
}],
nature: [{
required: true,
message: '请输入性质',
trigger: ['blur']
}],
company: [{
required: true,
message: '请输入委托单位',
trigger: ['blur']
}],
build_area: [{
required: true,
message: '请输入建设区域',
trigger: ['blur']
}],
address: [{
required: true,
message: '请输入项目地址',
trigger: ['blur']
}],
project_level: [{
required: true,
message: '请输入项目级别',
trigger: ['blur']
}],
total_investment: [{
required: true,
message: '请输入总投资(元)',
trigger: ['blur']
}],
initiation_date: [{
required: true,
message: '请输入立项日期',
trigger: ['blur']
}],
contract: [{
required: true,
message: '请输入关联合同',
trigger: ['blur']
}],
contract_amount: [{
required: true,
message: '请输入合同金额',
trigger: ['blur']
}],
contract_content: [{
required: true,
message: '请输入合同服务内容',
trigger: ['blur']
}],
project_overview: [{
required: true,
message: '请输入项目规模及概况',
trigger: ['blur']
}],
consult_content: [{
required: true,
message: '请输入咨询范围',
trigger: ['blur']
}],
remark: [{
required: true,
message: '请输入备注',
trigger: ['blur']
}],
consult_start_date: [{
required: true,
message: '请输入咨询开始日期',
trigger: ['blur']
}],
consult_end_date: [{
required: true,
message: '请输入咨询结束日期',
trigger: ['blur']
},
{
validator: chekcDate,
trigger: ["blur"],
validator: chekcDate,
trigger: ["blur"],
},
],
engineering_status: [{
required: true,
message: '请输入工程状态',
trigger: ['blur']
}],
consult_type: [{
required: true,
message: '请输入咨询类型',
trigger: ['blur']
}],
telephone: [{
required: true,
message: '请输入联系电话',
trigger: ['blur']
},
],
engineering_status: [{
required: true,
message: '请输入工程状态',
trigger: ['blur']
}],
consult_type: [{
required: true,
message: '请输入咨询类型',
trigger: ['blur']
}],
telephone: [{
required: true,
message: '请输入联系电话',
trigger: ['blur']
},
{
validator: checkPhone,
trigger: ["blur"],
validator: checkPhone,
trigger: ["blur"],
},
],
consult_user: [{
required: true,
message: '请输入委托联系人',
trigger: ['blur']
}],
supervision_department: [{
required: true,
message: '请输入监管部门',
trigger: ['blur']
}],
implementation_department: [{
required: true,
message: '请输入实施部门',
trigger: ['blur']
}],
project_department: [{
required: true,
message: '请输入项目部',
trigger: ['blur']
}],
project_manager: [{
required: true,
message: '请输入项目负责人员',
trigger: ['blur']
}],
part_a_unit: [{
required: true,
message: '请输入甲方单位',
trigger: ['blur']
}],
archiving_directory: [{
required: true,
message: '请输入归档目录',
trigger: ['blur']
}],
create_user: [{
required: true,
message: '请输入创建人',
trigger: ['blur']
}]
],
consult_user: [{
required: true,
message: '请输入委托联系人',
trigger: ['blur']
}],
supervision_department: [{
required: true,
message: '请输入监管部门',
trigger: ['blur']
}],
implementation_department: [{
required: true,
message: '请输入实施部门',
trigger: ['blur']
}],
project_department: [{
required: true,
message: '请输入项目部',
trigger: ['blur']
}],
project_manager: [{
required: true,
message: '请输入项目负责人员',
trigger: ['blur']
}],
part_a_unit: [{
required: true,
message: '请输入甲方单位',
trigger: ['blur']
}],
archiving_directory: [{
required: true,
message: '请输入归档目录',
trigger: ['blur']
}],
create_user: [{
required: true,
message: '请输入创建人',
trigger: ['blur']
}]
})
//
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]
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
let toStringList = ['industry', 'nature', 'build_area', 'project_level', 'engineering_status', 'consult_type']
toStringList.forEach(item => {
formData[item] = String(formData[item])
})
let toStringList = ['industry', 'nature', 'build_area', 'project_level', 'engineering_status', 'consult_type']
toStringList.forEach(item => {
formData[item] = String(formData[item])
})
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiConsultProjectDetail({
id: row.id
})
setFormData(data)
const data = await apiConsultProjectDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiConsultProjectEdit(data)
: await apiConsultProjectAdd(data)
popupRef.value?.close()
emit('success')
await formRef.value?.validate()
const data = {...formData,}
mode.value == 'edit'
? await apiConsultProjectEdit(data)
: await apiConsultProjectAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
emit('close')
}
if (route.query.contractId) {
apiCostApprovedProjectDetail({id: route.query.contractId}).then((res) => {
customEvent(res)
})
}
const customEvent = (e) => {
formData.contract = e.id
formData.contract_name = e.contract_name
formData.nature = e.industry_nature
formData.project_manager = e.project_director
formData.part_a = e.part_a
formData.part_a_unit = e.part_a_name
formData.build_area = e.const_area
formData.total_investment = e.project_money
formData.supervision_department = e.supervise_dept
formData.contract_amount = e.signed_amount
formData.project_overview = e.project_scale
}
const customEvent1 = (e) => {
formData.company = e.id
formData.company_name = e.invoice_company
showDialog1.value = false
}
const customEvent2 = (e) => {
formData.part_a = e.id
formData.part_a_unit = e.invoice_company
showDialog2.value = false
}
let value
const userclick = async (val) => {
showDialog.value = true
value = val
await nextTick()
personnel.value.open()
}
const submituser = (e: any) => {
formData[value + '_name'] = e.name
formData[value] = e.id
showDialog.value = false
}
defineExpose({
open,
setFormData,
getDetail
open,
setFormData,
getDetail
})
</script>

View File

@ -70,7 +70,7 @@
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="success()" @close="success()" :deptList="deptList" />
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" />
</div>
</template>
@ -82,13 +82,15 @@ import { apiConsultProjectLists, apiConsultProjectDelete, apiConsultProjectDetai
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'
import {deptLists} from "@/api/org/department";
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDetail = ref(false)
const route = useRoute()
const router = useRouter()
//
@ -148,6 +150,20 @@ const handleDetail = async (row) => {
detailRef.value?.setFormData(res)
}
if (route.query.contractId) {
handleAdd()
}
const success = () => {
router.push({
path: '/management/manage_basic/manage_project',
})
}
const deptList = ref([])
const getDeptList = async () => {
const res = await deptLists()
deptList.value = res.lists
}
getDeptList()
getLists()
</script>

View File

@ -100,7 +100,7 @@
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="success()" @close="success()" />
<detail-popup v-if="showDetail" ref="detailRef" :dict-data="dictData" @close="showDetail = false" />
</div>
</template>
@ -183,6 +183,24 @@ const link = (data: any) => {
}
})
break
case '2':
router.push({
path: '/management/manage_basic/manage_project',
query: {
contractId: data.id,
contractName: data.contract_name
}
})
break
case '3':
router.push({
path: '/consult/consult_basic/consult_project',
query: {
contractId: data.id,
contractName: data.contract_name
}
})
break
case '4':
router.push({
path: '/cost_consultation/cost_consultation_project/cost_project',

View File

@ -1,480 +1,555 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称" prop="project_name">
<el-input v-model="formData.project_name" clearable placeholder="请输入项目名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="性质" prop="nature">
<el-select class="flex-1" v-model="formData.nature" clearable placeholder="请选择性质">
<el-option v-for="(item, index) in dictData.supervision_project_nature" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="行业" prop="industry">
<el-select class="flex-1" v-model="formData.industry" clearable placeholder="请选择行业">
<el-option v-for="(item, index) in dictData.industry" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设单位" prop="build_unit">
<el-input v-model="formData.build_unit" clearable placeholder="请输入建设单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设区域" prop="build_area">
<el-select class="flex-1" v-model="formData.build_area" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.const_area" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目地址" prop="address">
<el-input v-model="formData.address" clearable placeholder="请输入项目地址" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目级别" prop="project_level">
<el-select class="flex-1" v-model="formData.project_level" clearable placeholder="请选择项目级别">
<el-option v-for="(item, index) in dictData.supervision_project_level" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总投资(元)" prop="total_investment">
<el-input v-model="formData.total_investment" clearable placeholder="请输入总投资(元)" type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工程状态" prop="engineering_status">
<el-select class="flex-1" v-model="formData.engineering_status" clearable placeholder="请选择工程状态">
<el-option v-for="(item, index) in dictData.engineering_status" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称" prop="project_name">
<el-input v-model="formData.project_name" clearable placeholder="请输入项目名称"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="性质" prop="nature">
<el-select class="flex-1" v-model="formData.nature" clearable placeholder="请选择性质">
<el-option v-for="(item, index) in dictData.supervision_project_nature" :key="index"
:label="item.name" :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="行业" prop="industry">
<el-select class="flex-1" v-model="formData.industry" clearable placeholder="请选择行业">
<el-option v-for="(item, index) in dictData.industry" :key="index" :label="item.name"
:value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设单位" prop="build_unit">
<el-input v-model="formData.build_unit_name" clearable placeholder="请输入建设单位" @click="showDialog1 = true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="建设区域" prop="build_area">
<el-select class="flex-1" v-model="formData.build_area" clearable placeholder="请选择建设区域">
<el-option v-for="(item, index) in dictData.const_area" :key="index" :label="item.name"
:value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目地址" prop="address">
<el-input v-model="formData.address" clearable placeholder="请输入项目地址"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目级别" prop="project_level">
<el-select class="flex-1" v-model="formData.project_level" clearable placeholder="请选择项目级别">
<el-option v-for="(item, index) in dictData.supervision_project_level" :key="index"
:label="item.name" :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总投资(元)" prop="total_investment">
<el-input v-model="formData.total_investment" clearable placeholder="请输入总投资(元)" type="number"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工程状态" prop="engineering_status">
<el-select class="flex-1" v-model="formData.engineering_status" clearable placeholder="请选择工程状态">
<el-option v-for="(item, index) in dictData.engineering_status" :key="index"
:label="item.name" :value="parseInt(item.value)"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同服务内容" prop="contract_content">
<el-input v-model="formData.contract_content" clearable placeholder="请输入合同服务内容"
type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目概况" prop="project_overview">
<el-input v-model="formData.project_overview" clearable placeholder="请输入项目概况" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目要求" prop="project_requirements">
<el-input v-model="formData.project_requirements" clearable placeholder="请输入项目要求" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划开工日期" prop="planned_start_date">
<el-date-picker class="flex-1 !flex" v-model="formData.planned_start_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划竣工日期" prop="planned_end_date">
<el-date-picker class="flex-1 !flex" v-model="formData.planned_end_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际开工日期" prop="actual_start_date">
<el-date-picker class="flex-1 !flex" v-model="formData.actual_start_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际竣工日期" prop="actual_end_date">
<el-date-picker class="flex-1 !flex" v-model="formData.actual_end_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实施部门" prop="implementation_department">
<el-input v-model="formData.implementation_department" clearable placeholder="请输入实施部门" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="监管部门" prop="supervision_department">
<el-input v-model="formData.supervision_department" clearable placeholder="请输入监管部门" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目经理" prop="project_manager">
<el-input v-model="formData.project_manager" clearable placeholder="请输入项目经理" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="立项日期" prop="initiation_date">
<el-date-picker class="flex-1 !flex" v-model="formData.initiation_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目负责人" prop="project_leader">
<el-input v-model="formData.project_leader" clearable placeholder="请输入项目负责人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目部" prop="project_department">
<el-input v-model="formData.project_department" clearable placeholder="请输入项目部" />
</el-form-item>
</el-col>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同服务内容" prop="contract_content">
<el-input v-model="formData.contract_content" clearable placeholder="请输入合同服务内容"
type="textarea"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目概况" prop="project_overview">
<el-input v-model="formData.project_overview" clearable placeholder="请输入项目概况"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目要求" prop="project_requirements">
<el-input v-model="formData.project_requirements" clearable placeholder="请输入项目要求"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划开工日期" prop="planned_start_date">
<el-date-picker class="flex-1 !flex" v-model="formData.planned_start_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划竣工日期" prop="planned_end_date">
<el-date-picker class="flex-1 !flex" v-model="formData.planned_end_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际开工日期" prop="actual_start_date">
<el-date-picker class="flex-1 !flex" v-model="formData.actual_start_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际竣工日期" prop="actual_end_date">
<el-date-picker class="flex-1 !flex" v-model="formData.actual_end_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实施部门" prop="implementation_department">
<el-select v-model="formData.implementation_department" placeholder="请选择实施部门"
class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="监管部门" prop="supervision_department">
<el-select v-model="formData.supervision_department" placeholder="请选择监管部门"
class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目经理" prop="project_manager">
<el-input v-model="formData.project_manager_name" clearable placeholder="请输入项目经理" @click="userclick('project_manager')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="立项日期" prop="initiation_date">
<el-date-picker class="flex-1 !flex" v-model="formData.initiation_date" clearable type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目负责人" prop="project_leader">
<el-input v-model="formData.project_leader_name" clearable placeholder="请输入项目负责人" @click="userclick('project_leader')"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="项目部" prop="project_department">
<el-select v-model="formData.project_department" placeholder="请选择项目部门" class="flex-1">
<el-option :label="item.name" :value="item.id" v-for="item in deptList">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联合同" prop="contract">
<el-input v-model="formData.contract" clearable placeholder="请输入关联合同" v-type="'code'" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方单位" prop="part_a_unit">
<el-input v-model="formData.part_a_unit" clearable placeholder="请输入甲方单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="关联合同" prop="contract">
<el-input v-model="formData.contract_name" clearable placeholder="请输入关联合同" v-type="'code'"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="甲方单位" prop="part_a_unit">
<el-input v-model="formData.part_a_unit" clearable placeholder="请输入甲方单位" @click="showDialog2 = true"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建人" prop="create_user">
<el-input v-model="formData.create_user" clearable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" prop="create_time">
<el-date-picker class="flex-1 !flex" v-model="formData.create_time" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件" prop="annex">
<uploadAnnex :formData="formData"></uploadAnnex>
<el-col :span="8">
<el-form-item label="创建人" prop="create_user">
<el-input v-model="formData.create_user" clearable/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" prop="create_time">
<el-date-picker class="flex-1 !flex" v-model="formData.create_time" clearable type="datetime"
value-format="YYYY-MM-DD HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注">
<el-input v-model="formData.remark" clearable placeholder="请输入备注" type="textarea"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="附件" prop="annex">
<uploadAnnex :formData="formData"></uploadAnnex>
</el-form-item>
</el-col>
</el-row>
</el-form>
</popup>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div v-if="showDialog">
<personnelselector ref="personnel" @confirm="submituser" type="1">
</personnelselector>
</div>
<el-dialog v-model="showDialog1" title="选择建设单位" width="70%">
<dialogTable :config="marketing_custom" @customEvent="customEvent1"> </dialogTable>
</el-dialog>
<el-dialog v-model="showDialog2" title="选择甲方单位" width="70%">
<dialogTable :config="marketing_custom" @customEvent="customEvent2"> </dialogTable>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="manageProjectEdit">
import type { FormInstance } from 'element-plus'
import type {FormInstance} from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiManageProjectAdd, apiManageProjectEdit, apiManageProjectDetail } from '@/api/manage_project'
import type { PropType } from 'vue'
import { timeFormat } from '@/utils/util'
import {apiManageProjectAdd, apiManageProjectEdit, apiManageProjectDetail} from '@/api/manage_project'
import type {PropType} from 'vue'
import {timeFormat} from '@/utils/util'
import useUserStore from "@/stores/modules/user";
import {apiCostApprovedProjectDetail} from "@/api/cost_approved_project";
import {marketing_custom} from "@/components/dialogTable/dialogTableConfig";
const userStore = useUserStore().userInfo;
const route = useRoute()
// create_user: userStore.account,
// create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss'),
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
},
deptList: Array
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
const showDialog1 = ref(false)
const showDialog2 = ref(false)
const personnel = ref(null)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑项目管理--项目信息' : '新增项目管理--项目信息'
return mode.value == 'edit' ? '编辑项目管理--项目信息' : '新增项目管理--项目信息'
})
//
const formData = reactive({
id: '',
project_name: '',
nature: '',
industry: '',
build_unit: '',
build_area: '',
address: '',
project_level: '',
total_investment: '',
engineering_status: '',
contract_content: '',
project_overview: '',
project_requirements: '',
planned_start_date: '',
planned_end_date: '',
actual_start_date: '',
actual_end_date: '',
implementation_department: '',
supervision_department: '',
project_manager: '',
initiation_date: '',
project_leader: '',
project_department: '',
remark: '',
contract: '',
part_a_unit: '',
annex: [],
create_user: userStore.account,
create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss'),
id: '',
project_name: '',
nature: '',
industry: '',
build_unit: '',
build_unit_name: '',
build_area: '',
address: '',
project_level: '',
total_investment: '',
engineering_status: '',
contract_content: '',
project_overview: '',
project_requirements: '',
planned_start_date: '',
planned_end_date: '',
actual_start_date: '',
actual_end_date: '',
implementation_department: '',
supervision_department: '',
project_manager: '',
project_manager_name: '',
initiation_date: '',
project_leader: '',
project_leader_name: '',
project_department: '',
remark: '',
contract: '',
contract_name: '',
part_a_unit: '',
part_a: '',
annex: [],
create_user: userStore.account,
create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss'),
})
const chekcDate = (rule: any, value: any, callback: any) => {
if (new Date(formData.actual_end_date) < new Date(formData.actual_start_date)) {
callback(new Error('实际竣工日期不能早于实际开工日期'))
} else {
callback()
}
if (new Date(formData.actual_end_date) < new Date(formData.actual_start_date)) {
callback(new Error('实际竣工日期不能早于实际开工日期'))
} else {
callback()
}
}
const chekcDate1 = (rule: any, value: any, callback: any) => {
if (new Date(formData.planned_end_date) < new Date(formData.planned_start_date)) {
callback(new Error('计划竣工日期不能早于计划开工日期'))
} else {
callback()
}
if (new Date(formData.planned_end_date) < new Date(formData.planned_start_date)) {
callback(new Error('计划竣工日期不能早于计划开工日期'))
} else {
callback()
}
}
const chekcDate2 = (rule: any, value: any, callback: any) => {
if (new Date(formData.actual_start_date) < new Date(formData.initiation_date)) {
callback(new Error('立项日期早于实际开工日期'))
} else {
callback()
}
if (new Date(formData.actual_start_date) < new Date(formData.initiation_date)) {
callback(new Error('立项日期早于实际开工日期'))
} else {
callback()
}
}
//
const formRules = reactive<any>({
project_name: [{
required: true,
message: '请输入项目名称',
trigger: ['blur']
}],
project_code: [{
required: true,
message: '请输入项目编号',
trigger: ['blur']
}],
nature: [{
required: true,
message: '请输入性质',
trigger: ['blur']
}],
industry: [{
required: true,
message: '请输入行业',
trigger: ['blur']
}],
build_unit: [{
required: true,
message: '请输入建设单位',
trigger: ['blur']
}],
build_area: [{
required: true,
message: '请输入建设区域',
trigger: ['blur']
}],
address: [{
required: true,
message: '请输入项目地址',
trigger: ['blur']
}],
project_level: [{
required: true,
message: '请输入项目级别',
trigger: ['blur']
}],
total_investment: [{
required: true,
message: '请输入总投资(元)',
trigger: ['blur']
}],
engineering_status: [{
required: true,
message: '请输入工程状态',
trigger: ['blur']
}],
contract_content: [{
required: true,
message: '请输入合同服务内容',
trigger: ['blur']
}],
project_overview: [{
required: true,
message: '请输入项目概况',
trigger: ['blur']
}],
project_requirements: [{
required: true,
message: '请输入项目要求',
trigger: ['blur']
}],
planned_start_date: [{
required: true,
message: '请输入计划开工日期',
trigger: ['blur']
}],
planned_end_date: [{
required: true,
message: '请输入计划竣工日期',
trigger: ['blur']
},
project_name: [{
required: true,
message: '请输入项目名称',
trigger: ['blur']
}],
project_code: [{
required: true,
message: '请输入项目编号',
trigger: ['blur']
}],
nature: [{
required: true,
message: '请输入性质',
trigger: ['blur']
}],
industry: [{
required: true,
message: '请输入行业',
trigger: ['blur']
}],
build_unit: [{
required: true,
message: '请输入建设单位',
trigger: ['blur']
}],
build_area: [{
required: true,
message: '请输入建设区域',
trigger: ['blur']
}],
address: [{
required: true,
message: '请输入项目地址',
trigger: ['blur']
}],
project_level: [{
required: true,
message: '请输入项目级别',
trigger: ['blur']
}],
total_investment: [{
required: true,
message: '请输入总投资(元)',
trigger: ['blur']
}],
engineering_status: [{
required: true,
message: '请输入工程状态',
trigger: ['blur']
}],
contract_content: [{
required: true,
message: '请输入合同服务内容',
trigger: ['blur']
}],
project_overview: [{
required: true,
message: '请输入项目概况',
trigger: ['blur']
}],
project_requirements: [{
required: true,
message: '请输入项目要求',
trigger: ['blur']
}],
planned_start_date: [{
required: true,
message: '请输入计划开工日期',
trigger: ['blur']
}],
planned_end_date: [{
required: true,
message: '请输入计划竣工日期',
trigger: ['blur']
},
{
validator: chekcDate1,
trigger: ['blur']
validator: chekcDate1,
trigger: ['blur']
}],
actual_start_date: [{
required: true,
message: '请输入实际开工日期',
trigger: ['blur']
}],
actual_end_date: [{
required: true,
message: '请输入实际竣工日期',
trigger: ['blur']
},
actual_start_date: [{
required: true,
message: '请输入实际开工日期',
trigger: ['blur']
}],
actual_end_date: [{
required: true,
message: '请输入实际竣工日期',
trigger: ['blur']
},
{
validator: chekcDate,
trigger: ['blur']
validator: chekcDate,
trigger: ['blur']
}],
implementation_department: [{
required: true,
message: '请输入实施部门',
trigger: ['blur']
}],
supervision_department: [{
required: true,
message: '请输入监管部门',
trigger: ['blur']
}],
project_manager: [{
required: true,
message: '请输入项目经理',
trigger: ['blur']
}],
initiation_date: [{
required: true,
message: '请输入立项日期',
trigger: ['blur']
},
implementation_department: [{
required: true,
message: '请输入实施部门',
trigger: ['blur']
}],
supervision_department: [{
required: true,
message: '请输入监管部门',
trigger: ['blur']
}],
project_manager: [{
required: true,
message: '请输入项目经理',
trigger: ['blur']
}],
initiation_date: [{
required: true,
message: '请输入立项日期',
trigger: ['blur']
},
{
validator: chekcDate2,
trigger: ['blur']
validator: chekcDate2,
trigger: ['blur']
}],
project_leader: [{
required: true,
message: '请输入项目负责人',
trigger: ['blur']
}],
project_department: [{
required: true,
message: '请输入项目部',
trigger: ['blur']
}],
remark: [{
required: true,
message: '请输入备注',
trigger: ['blur']
}],
contract: [{
required: true,
message: '请输入关联合同',
trigger: ['blur']
}],
part_a_unit: [{
required: true,
message: '请输入甲方单位',
trigger: ['blur']
}],
create_user: [{
required: true,
message: '请输入创建人',
trigger: ['blur']
}],
create_time: [{
required: true,
message: '请输入创建时间',
trigger: ['blur']
}]
project_leader: [{
required: true,
message: '请输入项目负责人',
trigger: ['blur']
}],
project_department: [{
required: true,
message: '请输入项目部',
trigger: ['blur']
}],
remark: [{
required: true,
message: '请输入备注',
trigger: ['blur']
}],
contract: [{
required: true,
message: '请输入关联合同',
trigger: ['blur']
}],
part_a_unit: [{
required: true,
message: '请输入甲方单位',
trigger: ['blur']
}],
create_user: [{
required: true,
message: '请输入创建人',
trigger: ['blur']
}],
create_time: [{
required: true,
message: '请输入创建时间',
trigger: ['blur']
}]
})
//
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]
}
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 apiManageProjectDetail({
id: row.id
})
setFormData(data)
const data = await apiManageProjectDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiManageProjectEdit(data)
: await apiManageProjectAdd(data)
popupRef.value?.close()
emit('success')
await formRef.value?.validate()
const data = {...formData,}
mode.value == 'edit'
? await apiManageProjectEdit(data)
: await apiManageProjectAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
emit('close')
}
if (route.query.contractId) {
apiCostApprovedProjectDetail({id: route.query.contractId}).then((res) => {
customEvent(res)
})
}
const customEvent = (e) => {
formData.contract = e.id
formData.contract_name = e.contract_name
formData.nature = e.industry_nature
formData.planned_start_date = e.start_date
formData.planned_end_date = e.end_date
formData.project_manager = e.project_director
formData.part_a = e.part_a
formData.part_a_unit = e.part_a_name
formData.build_area = e.const_area
formData.total_investment = e.project_money
formData.supervision_department = e.supervise_dept
formData.project_overview = e.project_scale
}
const customEvent1 = (e) => {
formData.build_unit = e.id
formData.build_unit_name = e.invoice_company
showDialog1.value = false
}
const customEvent2 = (e) => {
formData.part_a = e.id
formData.part_a_unit = e.invoice_company
showDialog2.value = false
}
let value
const userclick = async (val) => {
showDialog.value = true
value = val
await nextTick()
personnel.value.open()
}
const submituser = (e: any) => {
formData[value + '_name'] = e.name
formData[value] = e.id
showDialog.value = false
}
defineExpose({
open,
setFormData,
getDetail
open,
setFormData,
getDetail
})
</script>

View File

@ -114,7 +114,7 @@
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="success()" @close="success()" :deptList="deptList" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" />
</div>
@ -127,7 +127,10 @@ import { apiManageProjectLists, apiManageProjectDelete, apiManageProjectDetail }
import detailConfig from './detail'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import {deptLists} from "@/api/org/department";
const route = useRoute()
const router = useRouter()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
@ -194,7 +197,20 @@ const handleDetail = async (id: any) => {
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
if (route.query.contractId) {
handleAdd()
}
const success = () => {
router.push({
path: '/management/manage_basic/manage_project',
})
}
const deptList = ref([])
const getDeptList = async () => {
const res = await deptLists()
deptList.value = res.lists
}
getDeptList()
getLists()
</script>

View File

@ -244,7 +244,6 @@ const success = () => {
path: '/supervision/supervision_basic/supervision_project',
})
}
getLists()
getDeptList()