This commit is contained in:
zmj 2024-03-18 10:20:21 +08:00
parent eaa590066a
commit 64c8269476
17 changed files with 299 additions and 38 deletions

View File

@ -1,8 +1,8 @@
<template>
<div class="detail-popup">
<popup ref="popupRef" :async="true" width="80%" @close="handleClose" :showFootBtn="false">
<popup ref="popupRef" :async="true" :width="width" @close="handleClose" :showFootBtn="false">
<el-form ref="formRef" :model="formData" label-width="100px">
<el-descriptions :column="3" :title="detailConfig?.title || '详情'" border>
<el-descriptions :column="column" :title="detailConfig?.title || '详情'" border>
<el-descriptions-item :label="item.label" label-align="left" align="left"
v-for="(item, index) in detailConfig?.config.filter(item => !item.column)" :key="index">
{{ formData[item.value] }}
@ -23,11 +23,11 @@
</el-descriptions-item>
</el-descriptions>
</el-form>
<el-card class="mt-5">
<el-card class="mt-5" v-if="detailConfig?.table">
<template #header>
{{ detailConfig.table.title }}列表
</template>
<el-table :data="tableLists" v-if="detailConfig?.table">
<el-table :data="tableLists">
<el-table-column :label="item.label" :prop="item.value" show-overflow-tooltip
v-for="(item, index) in detailConfig.table.tableConfig" :key="index" />
</el-table>
@ -46,6 +46,15 @@ const props = defineProps({
detailConfig: {
type: Object,
require: true
},
column: {
type: Number,
default: 3
},
width: {
type: String,
default: '80vw'
}
})

View File

@ -67,7 +67,8 @@
</div>
</el-card>
<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" />
<detailPage v-if="showDetail" ref="detailRef" @close="showEdit = false" :detailConfig="detailConfig"
:column="2" />
</div>
</template>

View File

@ -2,7 +2,7 @@
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" :disabled="mode == 'detail'">
<el-form-item label="项目名称" prop="project_id">
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
@click="showDialog = true" />
@ -48,7 +48,7 @@ const showDialog = ref(false)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑工程监理--第一次工地会议' : '新增工程监理--第一次工地会议'
return mode.value == 'edit' ? '编辑工程监理--第一次工地会议' : '工程监理--第一次工地会议'
})
//

View File

@ -53,6 +53,10 @@
type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_const_prepare.supervision_commencement_report/detail']"
type="primary" link @click="handleEdit(row, 'detail')">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -109,10 +113,10 @@ const handleAdd = async () => {
}
//
const handleEdit = async (data: any) => {
const handleEdit = async (data: any, mode = 'add') => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.open(mode)
editRef.value?.setFormData(data)
}

View File

@ -2,7 +2,7 @@
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" :disabled="mode == 'detail'">
<el-form-item label="项目名称" prop="project_id">
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
@click="showDialog = true" />
@ -123,6 +123,7 @@ const handleSubmit = async () => {
//
const open = (type = 'add') => {
mode.value = type
console.log(mode.value, "value")
popupRef.value?.open()
}

View File

@ -40,6 +40,10 @@
type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_prepare.supervision_contract_disclosure/detail']"
type="primary" link @click="handleEdit(row, 'detail')">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -96,11 +100,11 @@ const handleAdd = async () => {
}
//
const handleEdit = async (data: any) => {
const handleEdit = async (data: any, mode = 'edit') => {
let res = await apiSupervisionContractDisclosureDetail({ id: data.id })
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.open(mode)
editRef.value?.setFormData(res)
}
@ -111,5 +115,8 @@ const handleDelete = async (id: number | any[]) => {
getLists()
}
getLists()
</script>

View File

@ -0,0 +1,53 @@
import { apiSupervisionMonitoringEquipmentDetailLists } from '@/api/supervision_monitoring_equipment_detail'
const detailConfig = {
title: "工程监理--监控设备信息",
config: [
{
label: "项目名称",
value: "project_name"
},
{
label: "监控设备名称",
value: "device_name"
},
{
label: "设备类型",
value: "device_type"
},
{
label: "设备序列号",
value: "device_sn"
},
{
label: "编号",
value: "number"
},
{
label: "备注",
value: "remark",
column: 1
},
],
table: {
title: "设备",
tableConfig: [
{
label: "设备名称",
value: 'name',
},
{
label: "是否显示",
value: 'is_show'
},
],
query: 'device_id',
fetchFun: apiSupervisionMonitoringEquipmentDetailLists,
}
}
export default detailConfig;

View File

@ -72,6 +72,10 @@
type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_project.supervision_monitoring_equipment/detail']"
type="danger" link @click="handleDetail(row.id)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -81,20 +85,25 @@
</div>
</el-card>
<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" :column="2"
width="60vw" />
</div>
</template>
<script lang="ts" setup name="supervisionMonitoringEquipmentLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionMonitoringEquipmentLists, apiSupervisionMonitoringEquipmentDelete } from '@/api/supervision_monitoring_equipment'
import { timeFormat } from '@/utils/util'
import { apiSupervisionMonitoringEquipmentLists, apiSupervisionMonitoringEquipmentDelete, apiSupervisionMonitoringEquipmentDetail } from '@/api/supervision_monitoring_equipment'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDetail = ref(false)
//
@ -145,5 +154,13 @@ const handleDelete = async (id: number | any[]) => {
getLists()
}
//
const handleDetail = async (id: any) => {
let res = await apiSupervisionMonitoringEquipmentDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

View File

@ -0,0 +1,69 @@
import {
apiSupervisionParticipatingUnitsContactsLists,
} from "@/api/supervision_participating_units_contacts";
const detailConfig = {
title: "工程监理--参建单位",
config: [
{
label: "项目名称",
value: "project_name"
},
{
label: "单位名称",
value: "unit_name"
},
{
label: "单位类别",
value: "unit_type"
},
{
label: "资质等级",
value: "qualification_grade"
},
{
label: "联系电话",
value: "telephone"
},
{
label: "责任范围",
value: "duty"
},
],
table: {
title: "联系人",
tableConfig: [
{
label: "姓名",
value: 'name',
},
{
label: "职务",
value: 'duties'
},
{
label: "办公电话",
value: 'telephone',
},
{
label: "手机号码",
value: 'mobile',
},
{
label: "电子邮箱",
value: 'email',
},
{
label: "传真",
value: 'fax',
},
],
query: 'unit_id',
fetchFun: apiSupervisionParticipatingUnitsContactsLists,
}
}
export default detailConfig;

View File

@ -12,7 +12,8 @@
<el-input class="w-[280px]" v-model="queryParams.unit_name" clearable placeholder="请输入单位名称" />
</el-form-item>
<el-form-item label="资质等级" prop="qualification_grade">
<el-input class="w-[280px]" v-model="queryParams.qualification_grade" clearable placeholder="请输入资质等级" />
<el-input class="w-[280px]" v-model="queryParams.qualification_grade" clearable
placeholder="请输入资质等级" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
@ -43,14 +44,18 @@
<el-table-column label="责任范围" prop="duty" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button v-perms="['supervision_project.supervision_participating_units/edit']" type="primary"
link @click="handleEdit(row)">
<el-button v-perms="['supervision_project.supervision_participating_units/edit']"
type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['supervision_project.supervision_participating_units/delete']"
type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_project.supervision_participating_units/detail']"
type="danger" link @click="handleDetail(row.id)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -60,6 +65,8 @@
</div>
</el-card>
<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"
:column="2" />
</div>
</template>
@ -67,13 +74,15 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionParticipatingUnitsLists, apiSupervisionParticipatingUnitsDelete, apiSupervisionParticipatingUnitsDetail } from '@/api/supervision_participating_units'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDetail = ref(false)
//
@ -124,7 +133,14 @@ const handleDelete = async (id: number | any[]) => {
getLists()
}
//
const handleDetail = async (id: any) => {
let res = await apiSupervisionParticipatingUnitsDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

View File

@ -0,0 +1,66 @@
import { apiSupervisionMonitoringEquipmentDetailLists } from '@/api/supervision_monitoring_equipment_detail'
const detailConfig = {
title: "工程监理--监理规划",
config: [
{
label: "项目名称",
value: "project_name"
},
{
label: "专项审批类型",
value: "approval_type"
},
{
label: "评审人员",
value: "approval_user"
},
{
label: "方案名称",
value: "scheme_name"
},
{
label: "创建人",
value: "create_user"
},
{
label: "创建时间",
value: "create_time"
},
{
label: "评审内容",
value: "approval_content"
},
{
label: "备注",
value: "remark",
column: 1
},
{
label: "附件",
value: "annex",
column: 1
},
],
table: {
title: "设备",
tableConfig: [
{
label: "设备名称",
value: 'name',
},
{
label: "是否显示",
value: 'is_show_text'
},
],
query: 'device_id',
fetchFun: apiSupervisionMonitoringEquipmentDetailLists,
}
}
export default detailConfig;

View File

@ -58,15 +58,6 @@ const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
const showDialog = ref(false)
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(() => {
return mode.value == 'edit' ? '编辑工程监理--监理规划' : '新增工程监理--监理规划'

View File

@ -71,6 +71,10 @@
@click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_prepare.supervision_planning/detail']" type="primary" link
@click="handleDetail(row.id)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -80,6 +84,8 @@
</div>
</el-card>
<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" :column="2"
width="60vw" />
</div>
</template>
@ -87,13 +93,16 @@
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupervisionPlanningLists, apiSupervisionPlanningDelete, apiSupervisionPlanningDetail } from '@/api/supervision_planning'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import detailConfig from './detail'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = ref('')
//
const showEdit = ref(false)
const showDetail = ref(false)
//
@ -145,5 +154,15 @@ const handleDelete = async (id: number | any[]) => {
getLists()
}
//
const handleDetail = async (id: any) => {
let res = await apiSupervisionPlanningDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>

View File

@ -2,7 +2,7 @@
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" :disabled="mode == 'detail'">
<el-form-item label="项目名称" prop="project_id">
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
@click="showDialog = true" />
@ -49,7 +49,7 @@ const showDialog = ref(false)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑工程监理--第一次工地会议' : '新增工程监理--第一次工地会议'
return mode.value == 'edit' ? '编辑工程监理--第一次工地会议' : '工程监理--第一次工地会议'
})
//

View File

@ -51,6 +51,10 @@
link @click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_const_prepare.supervision_rules/detail']" type="primary"
link @click="handleEdit(row, 'detail')">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -107,10 +111,10 @@ const handleAdd = async () => {
}
//
const handleEdit = async (data: any) => {
const handleEdit = async (data: any, mode = 'add') => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.open(mode)
editRef.value?.setFormData(data)
}

View File

@ -2,7 +2,7 @@
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit"
@close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules" :disabled="mode == 'detail'">
<el-form-item label="项目名称" prop="project_name">
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
@click="showDialog = true" />
@ -49,7 +49,7 @@ const showDialog = ref(false)
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑工程监理--第一次工地会议' : '新增工程监理--第一次工地会议'
return mode.value == 'edit' ? '编辑工程监理--第一次工地会议' : '工程监理--第一次工地会议'
})
//

View File

@ -53,6 +53,10 @@
type="danger" link @click="handleDelete(row.id)">
删除
</el-button>
<el-button v-perms="['supervision_const_prepare.supervision_rules_disclosure/detail']"
type="primary" link @click="handleEdit(row, 'detail')">
详情
</el-button>
</template>
</el-table-column>
</el-table>
@ -109,10 +113,10 @@ const handleAdd = async () => {
}
//
const handleEdit = async (data: any) => {
const handleEdit = async (data: any, mode = 'detail') => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.open(mode)
editRef.value?.setFormData(data)
}