add
This commit is contained in:
parent
c21c4496d8
commit
aa49c71aba
79
src/components/detailPage/index.vue
Normal file
79
src/components/detailPage/index.vue
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
<template>
|
||||||
|
<div class="detail-popup">
|
||||||
|
<popup ref="popupRef" :async="true" width="80%" @close="handleClose" :showFootBtn="false">
|
||||||
|
<el-form ref="formRef" :model="formData" label-width="100px">
|
||||||
|
<el-descriptions :column="3" :title="detailConfig?.title || '详情'" border>
|
||||||
|
|
||||||
|
<el-descriptions-item :label="item.label" label-align="left" align="left"
|
||||||
|
v-for="(item, index) in detailConfig?.config" :key="index">
|
||||||
|
{{ formData[item.value] }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
</el-descriptions>
|
||||||
|
<el-descriptions :column="1" border v-if="formData.annex">
|
||||||
|
<el-descriptions-item label="附件" label-align="left" align="left" v-show="formData.annex">
|
||||||
|
<el-link :href="item.uri" type="primary" target="_blank" v-for="item in formData.annex"
|
||||||
|
class="mr-5">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-link>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="customdetail">
|
||||||
|
|
||||||
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
|
||||||
|
import { defineProps, ref, reactive, defineExpose } from "vue"
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
|
||||||
|
detailConfig: {
|
||||||
|
type: Object,
|
||||||
|
require: true
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
const emit = defineEmits(['success', 'close'])
|
||||||
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
|
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formData = ref({})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
const setFormData = async (data: Record<any, any>) => {
|
||||||
|
formData.value = data
|
||||||
|
console.log(formData.value, 'formData')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//打开弹窗
|
||||||
|
const open = () => {
|
||||||
|
popupRef.value?.open()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭回调
|
||||||
|
const handleClose = () => {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
setFormData,
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
@ -41,10 +41,9 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
||||||
import { ref, reactive, defineProps, toRaw, defineAsyncComponent } from "vue"
|
import { ref, defineProps, defineAsyncComponent } from "vue"
|
||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import { useDictData } from '@/hooks/useDictOptions'
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
baseData: Object,
|
baseData: Object,
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="detail-popup">
|
<div class="detail-popup">
|
||||||
<popup ref="popupRef" title="项目立项详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
<popup ref="popupRef" title="项目立项详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||||
|
112
src/views/supervision_project/detail.js
Normal file
112
src/views/supervision_project/detail.js
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
const detailConfig = {
|
||||||
|
title: "工程监理--监理项目信息详情",
|
||||||
|
config: [
|
||||||
|
{
|
||||||
|
label: "项目名称",
|
||||||
|
value: "project_name"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "行业",
|
||||||
|
value: "industry"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "性质",
|
||||||
|
value: "nature"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "建设单位",
|
||||||
|
value: "build_unit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "建设区域",
|
||||||
|
value: "build_area"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "项目地址",
|
||||||
|
value: "address"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "项目等级",
|
||||||
|
value: "project_level"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "总投资(万元)",
|
||||||
|
value: "total_investment"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "立项日期",
|
||||||
|
value: "initiation_date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "关联合同",
|
||||||
|
value: "contract"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "合同金额",
|
||||||
|
value: "contract_amount"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "实际开工日期",
|
||||||
|
value: "actual_start_date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "实际竣工日期",
|
||||||
|
value: "actual_end_date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "计划开工日期",
|
||||||
|
value: "planned_start_date"
|
||||||
|
}, {
|
||||||
|
label: "计划竣工日期",
|
||||||
|
value: "planned_end_date"
|
||||||
|
}, {
|
||||||
|
label: "合同服务内容",
|
||||||
|
value: "contract_content"
|
||||||
|
}, {
|
||||||
|
label: "项目概况",
|
||||||
|
value: "project_overview"
|
||||||
|
}, {
|
||||||
|
label: "项目要求",
|
||||||
|
value: "project_requirements"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "备注",
|
||||||
|
value: "remark"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "监管部门",
|
||||||
|
value: "supervision_department"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "实施部门",
|
||||||
|
value: "implementation_department"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "项目部",
|
||||||
|
value: "project_department"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "工程状态",
|
||||||
|
value: "engineering_status"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "项目负责人员",
|
||||||
|
value: "project_manager"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "甲方单位",
|
||||||
|
value: "part_a_unit"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "创建人",
|
||||||
|
value: "create_user"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "创建时间",
|
||||||
|
value: "create_time"
|
||||||
|
},
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
}
|
||||||
|
export default detailConfig;
|
@ -227,13 +227,6 @@ const formRef = shallowRef<FormInstance>()
|
|||||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||||
const mode = ref('add')
|
const mode = ref('add')
|
||||||
|
|
||||||
const handleAvatarSuccess_four = (response: any) => {
|
|
||||||
// @ts-ignore
|
|
||||||
response.code != 0 ? formData.annex.push({ uri: response.data.uri, name: response.data.name }) : ElMessage.error(response.msg);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除上传的文件
|
|
||||||
const delFileFn = (index: number) => { formData.annex.splice(index, 1) }
|
|
||||||
// 弹窗标题
|
// 弹窗标题
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == 'edit' ? '编辑工程监理--监理项目信息' : '新增工程监理--监理项目信息'
|
return mode.value == 'edit' ? '编辑工程监理--监理项目信息' : '新增工程监理--监理项目信息'
|
||||||
|
@ -92,10 +92,6 @@
|
|||||||
<el-table-column label="立项日期" prop="initiation_date" show-overflow-tooltip />
|
<el-table-column label="立项日期" prop="initiation_date" show-overflow-tooltip />
|
||||||
<el-table-column label="关联合同" prop="contract" show-overflow-tooltip />
|
<el-table-column label="关联合同" prop="contract" show-overflow-tooltip />
|
||||||
<el-table-column label="合同金额" prop="contract_amount" show-overflow-tooltip />
|
<el-table-column label="合同金额" prop="contract_amount" show-overflow-tooltip />
|
||||||
<!-- <el-table-column label="实际开工日期" prop="actual_start_date" show-overflow-tooltip />
|
|
||||||
<el-table-column label="实际竣工日期" prop="actual_end_date" show-overflow-tooltip />
|
|
||||||
<el-table-column label="计划开工日期" prop="planned_start_date" show-overflow-tooltip />
|
|
||||||
<el-table-column label="计划竣工日期" prop="planned_end_date" show-overflow-tooltip /> -->
|
|
||||||
<el-table-column label="合同服务内容" prop="contract_content" show-overflow-tooltip />
|
<el-table-column label="合同服务内容" prop="contract_content" show-overflow-tooltip />
|
||||||
<el-table-column label="项目概况" prop="project_overview" show-overflow-tooltip />
|
<el-table-column label="项目概况" prop="project_overview" show-overflow-tooltip />
|
||||||
<el-table-column label="项目要求" prop="project_requirements" show-overflow-tooltip />
|
<el-table-column label="项目要求" prop="project_requirements" show-overflow-tooltip />
|
||||||
@ -106,8 +102,6 @@
|
|||||||
<el-table-column label="工程状态" prop="engineering_status_text" show-overflow-tooltip />
|
<el-table-column label="工程状态" prop="engineering_status_text" show-overflow-tooltip />
|
||||||
<el-table-column label="项目负责人员" prop="project_manager" show-overflow-tooltip />
|
<el-table-column label="项目负责人员" prop="project_manager" show-overflow-tooltip />
|
||||||
<el-table-column label="甲方单位" prop="part_a_unit" show-overflow-tooltip />
|
<el-table-column label="甲方单位" prop="part_a_unit" show-overflow-tooltip />
|
||||||
<!-- <el-table-column label="附件" prop="annex" show-overflow-tooltip />
|
|
||||||
<el-table-column label="创建人" prop="create_user" show-overflow-tooltip /> -->
|
|
||||||
<el-table-column label="操作" width="120" fixed="right">
|
<el-table-column label="操作" width="120" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button v-perms="['supervision_project.supervision_project/edit']" type="primary" link
|
<el-button v-perms="['supervision_project.supervision_project/edit']" type="primary" link
|
||||||
@ -118,6 +112,10 @@
|
|||||||
@click="handleDelete(row.id)">
|
@click="handleDelete(row.id)">
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button v-perms="['supervision_project.supervision_project/detail']" type="danger" link
|
||||||
|
@click="handleDetail(row)">
|
||||||
|
详情
|
||||||
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -128,6 +126,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</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" />
|
||||||
|
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -135,13 +134,15 @@
|
|||||||
import { usePaging } from '@/hooks/usePaging'
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
import { useDictData } from '@/hooks/useDictOptions'
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
import { apiSupervisionProjectLists, apiSupervisionProjectDelete, apiSupervisionProjectDetail } from '@/api/supervision_project'
|
import { apiSupervisionProjectLists, apiSupervisionProjectDelete, apiSupervisionProjectDetail } from '@/api/supervision_project'
|
||||||
import { timeFormat } from '@/utils/util'
|
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import EditPopup from './edit.vue'
|
import EditPopup from './edit.vue'
|
||||||
|
import detailConfig from './detail'
|
||||||
|
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||||
|
const detailRef = ref('')
|
||||||
// 是否显示编辑框
|
// 是否显示编辑框
|
||||||
const showEdit = ref(false)
|
const showEdit = ref(false)
|
||||||
|
const showDetail = ref(false)
|
||||||
|
|
||||||
|
|
||||||
// 查询条件
|
// 查询条件
|
||||||
@ -191,10 +192,10 @@ const handleEdit = async (data: any) => {
|
|||||||
// 详情
|
// 详情
|
||||||
const handleDetail = async (data: any) => {
|
const handleDetail = async (data: any) => {
|
||||||
let res = await apiSupervisionProjectDetail({ id: data.id })
|
let res = await apiSupervisionProjectDetail({ id: data.id })
|
||||||
showEdit.value = true
|
showDetail.value = true
|
||||||
await nextTick()
|
await nextTick()
|
||||||
editRef.value?.open('detail')
|
detailRef.value?.open()
|
||||||
editRef.value?.setFormData(res)
|
detailRef.value?.setFormData(res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user