This commit is contained in:
mkm 2024-04-22 15:32:01 +08:00
parent 9045ce63a4
commit 6844496177
7 changed files with 462 additions and 238 deletions

View File

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

View File

@ -25,7 +25,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="合同类型 ">
<el-select v-model="queryParams.contract_type" class="flex-1 ">
<el-select v-model="queryParams.contract_type" class="flex-1">
<el-option label="主合同" :value="0"></el-option>
<el-option label="框架协议" :value="1"></el-option>
<el-option label="补充协议" :value="2"></el-option>
@ -34,9 +34,12 @@
</el-col>
<el-col :span="6">
<el-form-item label="业务性质" prop="business_nature">
<el-select class="flex-1" v-model="queryParams.business_nature" clearable placeholder="请选择业务性质">
<el-option v-for="(item, index) in dictData.cost_consultation_business_nature" :key="index"
:label="item.name" :value="parseInt(item.value)" />
<el-select class="flex-1" v-model="queryParams.business_nature" clearable
placeholder="请选择业务性质">
<el-option v-for="(
item, index
) in dictData.cost_consultation_business_nature" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
@ -62,7 +65,8 @@
<el-table-column label="合同类型" prop="contract_type_text" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="甲方单位" prop="part_a_name"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="乙方单位" prop="part_b" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="乙方单位" prop="part_b"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="工程投资" prop="project_money"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="签订金额" prop="signed_amount"
@ -75,8 +79,9 @@
@click="handleDetail(row.id)">
详情
</el-button>
<el-button v-perms="['cost_project.cost_approved_project/edit']" type='warning' link>
<router-link :to="{
<el-button v-perms="['cost_project.cost_approved_project/edit']" type="warning" link
@click="link(row)">
<!-- <router-link :to="{
path: '/cost_consultation/cost_consultation_project/cost_project',
query: {
contractId: row.id,
@ -84,7 +89,8 @@
}
}">
生成项目
</router-link>
</router-link> -->
生成项目
</el-button>
</template>
</el-table-column>
@ -96,22 +102,26 @@
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<detail-popup v-if="showDetail" ref="detailRef" :dict-data="dictData" @close="showDetail = false" />
</div>
</template>
<script lang="ts" setup name="costApprovedProjectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiCostApprovedProjectLists, apiCostApprovedProjectDetail } from '@/api/cost_approved_project'
import {
apiCostApprovedProjectLists,
apiCostApprovedProjectDetail
} from '@/api/cost_approved_project'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const route = useRoute()
const router = useRouter()
const showDetail = ref(false)
//
const queryParams = reactive({
@ -120,7 +130,7 @@ const queryParams = reactive({
contract_type: '',
part_a: '',
part_b: '',
business_nature: '',
business_nature: route.query.business_nature ?? '',
industry_nature: '',
fund_sources: '',
const_area: ''
@ -135,8 +145,9 @@ const handleSelectionChange = (val: any[]) => {
}
//
const { dictData } = useDictData('cost_contract_type,cost_consultation_business_nature,cost_consultation_industry_nature,cost_consultation_fund_sources,cost_consultation_const_area,cost_consultation_file_type,cost_consultation_way,cost_consultation_seal_name')
const { dictData } = useDictData(
'cost_contract_type,cost_consultation_business_nature,cost_consultation_industry_nature,cost_consultation_fund_sources,cost_consultation_const_area,cost_consultation_file_type,cost_consultation_way,cost_consultation_seal_name'
)
//
const { pager, getLists, resetParams, resetPage } = usePaging({
@ -153,21 +164,42 @@ const handleAdd = async () => {
//
const handleEdit = async (data: any) => {
let res = await apiCostApprovedProjectDetail({ id: data.id })
const res = await apiCostApprovedProjectDetail({ id: data.id })
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(res)
}
const link = (data: any) => {
const business_nature_id = route.query.business_nature ?? 1
switch (business_nature_id) {
case '1':
router.push({
path: '/supervision/supervision_basic/supervision_project',
query: {
contractId: data.id,
contractName: data.contract_name
}
})
break
case '4':
router.push({
path: '/cost_consultation/cost_consultation_project/cost_project',
query: {
contractId: data.id,
contractName: data.contract_name
}
})
break
}
}
//
const handleDetail = async (id: any) => {
let res = await apiCostApprovedProjectDetail({ id })
const res = await apiCostApprovedProjectDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}

View File

@ -257,7 +257,6 @@
<el-input v-model="formData.mailing_number" clearable placeholder="请输入邮寄编号" type="number" />
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="评审状态">
<el-select v-model="formData.review_status" class="flex-1">
@ -275,6 +274,14 @@
</el-form-item>
</el-col> -->
<createUserLable :form-data="formData" name="录入" flag></createUserLable>
<el-col :span="8">
<el-form-item label="提交部门">
<el-select v-model="formData.submitting_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="附件">
<upload-annex :form-data="formData" />
@ -384,7 +391,8 @@ const formData = reactive({
mailing_number: '',
review_status: '',
status: '',
create_user: ''
create_user: '',
submitting_department: ''
})
const customEvent = (e) => {

View File

@ -15,7 +15,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="合同类型 ">
<el-select v-model="queryParams.contract_type" class="flex-1 ">
<el-select v-model="queryParams.contract_type" class="flex-1">
<el-option label="主合同" :value="0"></el-option>
<el-option label="框架协议" :value="1"></el-option>
<el-option label="补充协议" :value="2"></el-option>
@ -24,9 +24,11 @@
</el-col>
<el-col :span="6">
<el-form-item label="业务性质">
<el-select class='flex-1' v-model="queryParams.business_nature">
<el-option v-for="(item, index) in dictData.cost_consultation_business_nature " :key="index"
:label="item.name" :value="parseInt(item.value)"></el-option>
<el-select class="flex-1" v-model="queryParams.business_nature">
<el-option v-for="(
item, index
) in dictData.cost_consultation_business_nature" :key="index" :label="item.name"
:value="parseInt(item.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
@ -35,11 +37,8 @@
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
@ -53,12 +52,14 @@
<el-table-column label="合同类型" prop="contract_type_text" show-overflow-tooltip />
<el-table-column label="甲方单位" :render-header="pager.calcWidth" prop="part_a_name"
show-overflow-tooltip />
<el-table-column label="乙方单位" :render-header="pager.calcWidth" prop="part_b" show-overflow-tooltip />
<el-table-column label="乙方单位" :render-header="pager.calcWidth" prop="part_b"
show-overflow-tooltip />
<el-table-column label="签订金额" prop="signed_amount" show-overflow-tooltip />
<el-table-column label="签订部门" prop="signed_dept_name" show-overflow-tooltip />
<el-table-column label="签订负责人" prop="signed_head_name" show-overflow-tooltip />
<el-table-column label="业务性质" prop="business_nature_text" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="发出日期" prop="send_date" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="发出日期" prop="send_date"
show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['marketing.marketing_contract/edit']" type="primary" link
@ -74,13 +75,25 @@
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<el-dialog v-model="marketing_handover_contract" title="移交合同" width="20%">
是否移交合同到<span class="text-[red]">{{ row.business_nature_text }}</span>
<template #footer>
<div class="dialog-footer">
<el-button @click="marketing_handover_contract = false">取消</el-button>
<el-button type="primary" @click="handleClose(true)"> 确认 </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="marketingContractLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiMarketingHandoverContractLists, apiMarketingHandoverContractHandover, } from '@/api/marketing_handover_contract'
import {
apiMarketingHandoverContractLists,
apiMarketingHandoverContractHandover
} from '@/api/marketing_handover_contract'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
@ -88,7 +101,8 @@ import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
const marketing_handover_contract = ref(false)
const row = ref()
//
const queryParams = reactive({
@ -100,7 +114,7 @@ const queryParams = reactive({
fund_sources: '',
const_area: '',
signed_dept: '',
contract_type: '',
contract_type: ''
})
//
@ -112,7 +126,9 @@ const handleSelectionChange = (val: any[]) => {
}
//
const { dictData } = useDictData('cost_consultation_business_nature,fund_sources,const_area,money_source')
const { dictData } = useDictData(
'cost_consultation_business_nature,fund_sources,const_area,money_source'
)
//
const { pager, getLists, resetParams, resetPage } = usePaging({
@ -129,10 +145,19 @@ const handleAdd = async () => {
//
const handleEdit = async (data: any) => {
let res = await apiMarketingHandoverContractHandover({ id: data.id })
getLists()
// let res = await apiMarketingHandoverContractHandover({ id: data.id })
// getLists()
row.value = data
marketing_handover_contract.value = true
}
const handleClose = async (type: any) => {
if (type == false) {
marketing_handover_contract.value = false
} else {
await apiMarketingHandoverContractHandover({ id: row.value.id })
getLists()
}
}
getLists()
</script>

View File

@ -1,7 +1,9 @@
<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" :disabled="mode == 'detail'">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules"
:disabled="mode == 'detail'">
<el-row>
<el-col :span="8">
<el-form-item label="项目名称" prop="project_name">
@ -27,7 +29,8 @@
<el-col :span="8">
<el-form-item label="建设单位">
<el-input v-model="formData.build_unit" clearable placeholder="请输入建设单位" />
<el-input v-model="formData.build_unit_name" clearable placeholder="请输入建设单位"
/>
</el-form-item>
</el-col>
<el-col :span="8">
@ -56,77 +59,90 @@
</el-col>
<el-col :span="8">
<el-form-item label="总投资(元)" label-width="120px">
<el-input v-model="formData.total_investment" clearable placeholder="请输入总投资(元)" type="number" />
<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 type="date"
value-format="YYYY-MM-DD" placeholder="请选择日期">
<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="关联合同">
<el-input v-model="formData.contract" clearable placeholder="请输入关联合同" />
<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-input v-model="formData.contract_amount" clearable placeholder="请输入合同金额"
type="number" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际开工日期" label-width="120px" 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 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="实际竣工日期" label-width="120px" 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 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="计划开工日期" label-width="120px" 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 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="计划竣工日期" label-width="120px" 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 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="监管部门">
<el-input v-model="formData.supervision_department" clearable placeholder="请输入监管部门" />
<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-input v-model="formData.implementation_department" clearable placeholder="请输入实施部门" />
<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-input v-model="formData.project_department" clearable placeholder="请输入项目部" />
<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-select class="flex-1" v-model="formData.engineering_status" clearable placeholder="请选择盖章名称">
<el-select class="flex-1" v-model="formData.engineering_status" clearable
placeholder="请选择盖章名称">
<el-option v-for="(item, index) in dictData.supervision_project_status" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
@ -134,13 +150,15 @@
</el-col>
<el-col :span="8">
<el-form-item label="项目负责人员" label-width="120px">
<el-input v-model="formData.project_manager" clearable placeholder="请输入项目负责人员" />
<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-input v-model="formData.part_a_unit" clearable placeholder="请输入甲方单位"
@click="showDialog2 = true" />
</el-form-item>
</el-col>
<el-col :span="8">
@ -150,8 +168,8 @@
</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 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>
@ -163,7 +181,8 @@
</el-col>
<el-col :span="8">
<el-form-item label="项目概况">
<el-input v-model="formData.project_overview" clearable placeholder="请输入项目概况" type="textarea" />
<el-input v-model="formData.project_overview" clearable placeholder="请输入项目概况"
type="textarea" />
</el-form-item>
</el-col>
<el-col :span="8">
@ -180,11 +199,20 @@
<el-col :span="8">
<el-form-item label="附件">
<uploadAnnex :formData="formData"></uploadAnnex>
</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>
@ -192,24 +220,37 @@
<script lang="ts" setup name="supervisionProjectEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiSupervisionProjectAdd, apiSupervisionProjectEdit, apiSupervisionProjectDetail } from '@/api/supervision_project'
import {
apiSupervisionProjectAdd,
apiSupervisionProjectEdit,
apiSupervisionProjectDetail
} from '@/api/supervision_project'
import type { PropType } from 'vue'
import { apiCostApprovedProjectDetail } from '@/api/cost_approved_project'
import {
marketing_framework_agreement,
marketing_custom
} from '@/components/dialogTable/dialogTableConfig'
import { timeFormat } from '@/utils/util'
import useUserStore from "@/stores/modules/user";
const userStore = useUserStore().userInfo;
import useUserStore from '@/stores/modules/user'
const userStore = useUserStore().userInfo
const route = useRoute()
defineProps({
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(() => {
@ -224,12 +265,14 @@ const formData = reactive({
industry: '',
nature: '',
build_unit: '',
build_unit_name: '',
build_area: '',
address: '',
project_level: '',
total_investment: '',
initiation_date: '',
contract: '',
contract_name: '',
contract_amount: '',
actual_start_date: '',
actual_end_date: '',
@ -244,10 +287,12 @@ const formData = reactive({
project_department: '',
engineering_status: '',
project_manager: '',
project_manager_name: '',
part_a_unit: '',
part_a: '',
annex: [],
create_user: userStore.account,
create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss'),
create_time: timeFormat('', 'yyyy-mm-dd hh:MM:ss')
})
const chekcDate = (rule: any, value: any, callback: any) => {
@ -258,7 +303,6 @@ const chekcDate = (rule: any, value: any, callback: any) => {
}
}
const chekcDate1 = (rule: any, value: any, callback: any) => {
if (new Date(formData.planned_end_date) < new Date(formData.planned_start_date)) {
callback(new Error('计划竣工日期不能早于计划开工日期'))
@ -267,155 +311,207 @@ const chekcDate1 = (rule: any, value: any, callback: any) => {
}
}
//
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']
}],
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']
}],
initiation_date: [{
required: true,
message: '请输入立项日期',
trigger: ['blur']
}],
contract: [{
required: true,
message: '请输入关联合同',
trigger: ['blur']
}],
contract_amount: [{
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']
}],
planned_start_date: [{
required: true,
message: '请输入计划开工日期',
trigger: ['blur']
}],
planned_end_date: [{
required: true,
message: '请输入计划竣工日期',
trigger: ['blur']
},
{
validator: chekcDate1,
trigger: ['blur']
}],
contract_content: [{
required: true,
message: '请输入合同服务内容',
trigger: ['blur']
}],
project_overview: [{
required: true,
message: '请输入项目概况',
trigger: ['blur']
}],
project_requirements: [{
required: true,
message: '请输入项目要求',
trigger: ['blur']
}],
remark: [{
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']
}],
engineering_status: [{
required: true,
message: '请输入工程状态',
trigger: ['blur']
}],
project_manager: [{
required: true,
message: '请输入项目负责人员',
trigger: ['blur']
}],
part_a_unit: [{
required: true,
message: '请输入甲方单位',
trigger: ['blur']
}],
create_user: [{
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']
}
],
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']
}
],
initiation_date: [
{
required: true,
message: '请输入立项日期',
trigger: ['blur']
}
],
contract: [
{
required: true,
message: '请输入关联合同',
trigger: ['blur']
}
],
contract_amount: [
{
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']
}
],
planned_start_date: [
{
required: true,
message: '请输入计划开工日期',
trigger: ['blur']
}
],
planned_end_date: [
{
required: true,
message: '请输入计划竣工日期',
trigger: ['blur']
},
{
validator: chekcDate1,
trigger: ['blur']
}
],
contract_content: [
{
required: true,
message: '请输入合同服务内容',
trigger: ['blur']
}
],
project_overview: [
{
required: true,
message: '请输入项目概况',
trigger: ['blur']
}
],
project_requirements: [
{
required: true,
message: '请输入项目要求',
trigger: ['blur']
}
],
remark: [
{
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']
}
],
engineering_status: [
{
required: true,
message: '请输入工程状态',
trigger: ['blur']
}
],
project_manager: [
{
required: true,
message: '请输入项目负责人员',
trigger: ['blur']
}
],
part_a_unit: [
{
required: true,
message: '请输入甲方单位',
trigger: ['blur']
}
],
create_user: [
{
required: true,
message: '请输入创建人',
trigger: ['blur']
}
]
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
@ -424,8 +520,6 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
@ -435,7 +529,6 @@ const getDetail = async (row: Record<string, any>) => {
setFormData(data)
}
//
const handleSubmit = async () => {
if (mode.value == 'detail') {
@ -443,7 +536,7 @@ const handleSubmit = async () => {
return
}
await formRef.value?.validate()
const data = { ...formData, }
const data = { ...formData }
mode.value == 'edit'
? await apiSupervisionProjectEdit(data)
: await apiSupervisionProjectAdd(data)
@ -462,7 +555,57 @@ const handleClose = () => {
emit('close')
}
if (route.query.contractId) {
apiCostApprovedProjectDetail({ id: route.query.contractId }).then((res) => {
customEvent(res)
})
}
const customEvent = (e) => {
console.log(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.contract_amount = e.signed_amount
formData.supervision_department = e.supervise_dept
// formData.nature = e.industry_nature
// formData.contract_type = e.contract_type
// formData.contract_type_text = e.contract_type_text
// formData.aunit_name = e.part_a_name
// formData.aunit = e.part_a
formData.project_overview = e.project_scale
// formData.Acontact = e.part_a_contract
// showDialog.value = false;
}
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,

View File

@ -3,7 +3,6 @@
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="项目名称" prop="project_name">
<el-input v-model="queryParams.project_name" clearable placeholder="请输入项目名称" />
@ -37,7 +36,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="项目等级" prop="project_level">
<el-select class=" flex-1" v-model="queryParams.project_level" clearable placeholder="请选择行业">
<el-select class="flex-1" v-model="queryParams.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>
@ -45,7 +44,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="工程状态" prop="engineering_status">
<el-select class=" flex-1" v-model="queryParams.engineering_status" clearable
<el-select class="flex-1" v-model="queryParams.engineering_status" clearable
placeholder="请选择行业">
<el-option v-for="(item, index) in dictData.supervision_project_status" :key="index"
:label="item.name" :value="parseInt(item.value)" />
@ -85,19 +84,22 @@
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="行业" prop="industry_text"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="性质" prop="nature_text" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="性质" prop="nature_text"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="建设单位" prop="build_unit"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="建设区域" prop="build_area_text"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="项目地址" prop="address" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="项目地址" prop="address"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="项目等级" prop="project_level_text"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="总投资(元)" prop="total_investment"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="立项日期" prop="initiation_date"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="关联合同" prop="contract" show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="关联合同" prop="contract"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="合同金额" prop="contract_amount"
show-overflow-tooltip />
<el-table-column :render-header="pager.calcWidth" label="合同服务内容" prop="contract_content"
@ -133,7 +135,6 @@
@click="handleDetail(row)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -142,7 +143,8 @@
<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="getLists" @close="showEdit = false"
:deptList="deptList" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" />
</div>
</template>
@ -150,18 +152,23 @@
<script lang="ts" setup name="supervisionProjectLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionProjectLists, apiSupervisionProjectDelete, apiSupervisionProjectDetail } from '@/api/supervision_project'
import {
apiSupervisionProjectLists,
apiSupervisionProjectDelete,
apiSupervisionProjectDetail
} from '@/api/supervision_project'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'
import { deptLists } from '@/api/org/department'
const route = useRoute()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDetail = ref(false)
//
const queryParams = reactive({
project_name: '',
@ -182,7 +189,9 @@ const handleSelectionChange = (val: any[]) => {
}
//
const { dictData } = useDictData('supervision_project_industry,supervision_project_build_area,supervision_project_nature, supervision_planning_approval_type,supervision_project_level,supervision_project_status')
const { dictData } = useDictData(
'supervision_project_industry,supervision_project_build_area,supervision_project_nature, supervision_planning_approval_type,supervision_project_level,supervision_project_status'
)
//
const { pager, getLists, resetParams, resetPage } = usePaging({
@ -199,7 +208,7 @@ const handleAdd = async () => {
//
const handleEdit = async (data: any) => {
let res = await apiSupervisionProjectDetail({ id: data.id })
const res = await apiSupervisionProjectDetail({ id: data.id })
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
@ -208,20 +217,27 @@ const handleEdit = async (data: any) => {
//
const handleDetail = async (data: any) => {
let res = await apiSupervisionProjectDetail({ id: data.id })
const res = await apiSupervisionProjectDetail({ id: data.id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiSupervisionProjectDelete({ id })
getLists()
}
if (route.query.contractId) {
handleAdd()
}
const deptList = ref([])
const getDeptList = async () => {
const res = await deptLists()
deptList.value = res.lists
}
getLists()
getDeptList()
</script>

File diff suppressed because one or more lines are too long