下班
This commit is contained in:
parent
d2de213211
commit
cfe9c0311f
26
src/api/supervision_monitoring_equipment.ts
Normal file
26
src/api/supervision_monitoring_equipment.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 工程监理--监控设备信息列表
|
||||
export function apiSupervisionMonitoringEquipmentLists(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_monitoring_equipment/lists', params })
|
||||
}
|
||||
|
||||
// 添加工程监理--监控设备信息
|
||||
export function apiSupervisionMonitoringEquipmentAdd(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_monitoring_equipment/add', params })
|
||||
}
|
||||
|
||||
// 编辑工程监理--监控设备信息
|
||||
export function apiSupervisionMonitoringEquipmentEdit(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_monitoring_equipment/edit', params })
|
||||
}
|
||||
|
||||
// 删除工程监理--监控设备信息
|
||||
export function apiSupervisionMonitoringEquipmentDelete(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_monitoring_equipment/delete', params })
|
||||
}
|
||||
|
||||
// 工程监理--监控设备信息详情
|
||||
export function apiSupervisionMonitoringEquipmentDetail(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_monitoring_equipment/detail', params })
|
||||
}
|
26
src/api/supervision_monitoring_equipment_detail.ts
Normal file
26
src/api/supervision_monitoring_equipment_detail.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 工程监理--监控设备明细列表
|
||||
export function apiSupervisionMonitoringEquipmentDetailLists(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_monitoring_equipment_detail/lists', params })
|
||||
}
|
||||
|
||||
// 添加工程监理--监控设备明细
|
||||
export function apiSupervisionMonitoringEquipmentDetailAdd(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_monitoring_equipment_detail/add', params })
|
||||
}
|
||||
|
||||
// 编辑工程监理--监控设备明细
|
||||
export function apiSupervisionMonitoringEquipmentDetailEdit(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_monitoring_equipment_detail/edit', params })
|
||||
}
|
||||
|
||||
// 删除工程监理--监控设备明细
|
||||
export function apiSupervisionMonitoringEquipmentDetailDelete(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_monitoring_equipment_detail/delete', params })
|
||||
}
|
||||
|
||||
// 工程监理--监控设备明细详情
|
||||
export function apiSupervisionMonitoringEquipmentDetailDetail(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_monitoring_equipment_detail/detail', params })
|
||||
}
|
32
src/api/supervision_participating_units.ts
Normal file
32
src/api/supervision_participating_units.ts
Normal file
@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 工程监理--参建单位列表
|
||||
export function apiSupervisionParticipatingUnitsLists(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_participating_units/lists', params })
|
||||
}
|
||||
|
||||
// 添加工程监理--参建单位
|
||||
export function apiSupervisionParticipatingUnitsAdd(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_participating_units/add', params })
|
||||
}
|
||||
|
||||
// 编辑工程监理--参建单位
|
||||
export function apiSupervisionParticipatingUnitsEdit(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_participating_units/edit', params })
|
||||
}
|
||||
|
||||
// 删除工程监理--参建单位
|
||||
export function apiSupervisionParticipatingUnitsDelete(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_participating_units/delete', params })
|
||||
}
|
||||
|
||||
// 工程监理--参建单位详情
|
||||
export function apiSupervisionParticipatingUnitsDetail(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_participating_units/detail', params })
|
||||
}
|
||||
|
||||
// 工程监理--参建单位列表
|
||||
export function supervision_participating_units_contactsapi(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_participating_units_contacts/lists', params })
|
||||
}
|
||||
|
26
src/api/supervision_participating_units_contacts.ts
Normal file
26
src/api/supervision_participating_units_contacts.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 工程监理--参建单位联系人列表
|
||||
export function apiSupervisionParticipatingUnitsContactsLists(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_participating_units_contacts/lists', params })
|
||||
}
|
||||
|
||||
// 添加工程监理--参建单位联系人
|
||||
export function apiSupervisionParticipatingUnitsContactsAdd(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_participating_units_contacts/add', params })
|
||||
}
|
||||
|
||||
// 编辑工程监理--参建单位联系人
|
||||
export function apiSupervisionParticipatingUnitsContactsEdit(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_participating_units_contacts/edit', params })
|
||||
}
|
||||
|
||||
// 删除工程监理--参建单位联系人
|
||||
export function apiSupervisionParticipatingUnitsContactsDelete(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_participating_units_contacts/delete', params })
|
||||
}
|
||||
|
||||
// 工程监理--参建单位联系人详情
|
||||
export function apiSupervisionParticipatingUnitsContactsDetail(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_participating_units_contacts/detail', params })
|
||||
}
|
26
src/api/supervision_project.ts
Normal file
26
src/api/supervision_project.ts
Normal file
@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 工程监理--监理项目信息列表
|
||||
export function apiSupervisionProjectLists(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_project/lists', params })
|
||||
}
|
||||
|
||||
// 添加工程监理--监理项目信息
|
||||
export function apiSupervisionProjectAdd(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_project/add', params })
|
||||
}
|
||||
|
||||
// 编辑工程监理--监理项目信息
|
||||
export function apiSupervisionProjectEdit(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_project/edit', params })
|
||||
}
|
||||
|
||||
// 删除工程监理--监理项目信息
|
||||
export function apiSupervisionProjectDelete(params: any) {
|
||||
return request.post({ url: '/supervision_project.supervision_project/delete', params })
|
||||
}
|
||||
|
||||
// 工程监理--监理项目信息详情
|
||||
export function apiSupervisionProjectDetail(params: any) {
|
||||
return request.get({ url: '/supervision_project.supervision_project/detail', params })
|
||||
}
|
67
src/components/supervision_participating_units/index.vue
Normal file
67
src/components/supervision_participating_units/index.vue
Normal file
@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
|
||||
<el-form-item label="单位名称" prop="unit_name">
|
||||
<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-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column label="单位名称" prop="unit_name" show-overflow-tooltip />
|
||||
<el-table-column label="单位类别" prop="unit_type_text" show-overflow-tooltip />
|
||||
<el-table-column label="资质等级" prop="qualification_grade" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" prop="telephone" show-overflow-tooltip />
|
||||
<el-table-column label="责任范围" prop="duty" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { apiSupervisionParticipatingUnitsLists, } from '@/api/supervision_participating_units'
|
||||
|
||||
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
const props = defineProps({
|
||||
project_id: Number
|
||||
})
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
unit_name: '',
|
||||
qualification_grade: ""
|
||||
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionParticipatingUnitsLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
87
src/components/supervision_project/index.vue
Normal file
87
src/components/supervision_project/index.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="项目名称" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编号" prop="project_code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_code" clearable placeholder="请输入项目编号" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @cell-click="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目编号" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="行业" prop="industry_text" show-overflow-tooltip />
|
||||
<el-table-column label="性质" prop="nature_text" show-overflow-tooltip />
|
||||
<el-table-column label="建设单位" prop="build_unit" show-overflow-tooltip />
|
||||
<el-table-column label="建设区域" prop="build_area_text" show-overflow-tooltip />
|
||||
<el-table-column label="项目地址" prop="address" show-overflow-tooltip />
|
||||
<el-table-column label="项目等级" prop="project_level_text" show-overflow-tooltip />
|
||||
<el-table-column label="总投资(万元)" prop="total_investment" 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_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="project_overview" show-overflow-tooltip />
|
||||
<el-table-column label="项目要求" prop="project_requirements" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="监管部门" prop="supervision_department" show-overflow-tooltip />
|
||||
<el-table-column label="实施部门" prop="implementation_department" show-overflow-tooltip />
|
||||
<el-table-column label="项目部" prop="project_department" 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="part_a_unit" show-overflow-tooltip />
|
||||
</el-table>
|
||||
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { apiSupervisionProjectLists } from '@/api/supervision_project'
|
||||
|
||||
|
||||
import { defineEmits } from "vue"
|
||||
|
||||
const props = defineProps({
|
||||
project_id: Number
|
||||
})
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_name: '',
|
||||
project_code: ""
|
||||
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionProjectLists,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -3,7 +3,6 @@
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80vw" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-row>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同名称" prop="contract_name">
|
||||
<el-input v-model="formData.contract_name" clearable placeholder="请输入合同名称" />
|
||||
@ -266,12 +265,10 @@
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="附件">
|
||||
<annexUpload :annex="formData.annex" @handleAvatarSuccess="handleAvatarSuccess_four"
|
||||
@delFile="delFileFn" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<annexUpload :annex="formData.annex" @handleAvatarSuccess="handleAvatarSuccess_four"
|
||||
@delFile="delFileFn" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
|
@ -42,7 +42,7 @@
|
||||
<el-form-item label="客户反馈" prop="customer_feedback">
|
||||
<el-input v-model="formData.customer_feedback" clearable placeholder="请输入客户反馈" />
|
||||
</el-form-item>
|
||||
<el-form-item label="附12件" prop="field127">
|
||||
<el-form-item label="附件" prop="field127">
|
||||
<annexUpload :annex="formData.annex" @handleAvatarSuccess="handleAvatarSuccess_four"
|
||||
@delFile="delFileFn" />
|
||||
</el-form-item>
|
||||
|
@ -22,13 +22,13 @@
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['contract.subcontracting_contract/delete']" :disabled="!selectData.length"
|
||||
<!-- <el-button v-perms="['contract.subcontracting_contract/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<!-- <el-table-column type="selection" width="55" /> -->
|
||||
<el-table-column label="序号" type="index" width="55" />
|
||||
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
@ -55,10 +55,10 @@
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['contract.subcontracting_contract/delete']" type="danger" link
|
||||
<!-- <el-button v-perms="['contract.subcontracting_contract/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-perms="['contract.subcontracting_contract/detail']" link
|
||||
@click="handleDetail(row)">
|
||||
详情
|
||||
|
202
src/views/supervision_monitoring_equipment/edit.vue
Normal file
202
src/views/supervision_monitoring_equipment/edit.vue
Normal file
@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<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-item label="项目名称" prop="project_id">
|
||||
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
|
||||
@click="showDialog = true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="监控设备名称" prop="device_name" label-width="120px">
|
||||
<el-input v-model="formData.device_name" clearable placeholder="请输入监控设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="device_type">
|
||||
<el-select class="flex-1" v-model="formData.device_type" clearable placeholder="请选择设备类型">
|
||||
<el-option v-for="(item, index) in dictData.device_type" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="device_sn" label-width="100px">
|
||||
<el-input v-model="formData.device_sn" clearable placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="number">
|
||||
<el-input v-model="formData.number" clearable placeholder="请输入编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<supervision_project @customEvent="customEvent"></supervision_project>
|
||||
</el-dialog>
|
||||
<div style="margin-bottom: 30px;">设备列表</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.devices">
|
||||
<el-table-column label="序号" v-if="mode == 'add'">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.name" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否显示" prop="duties">
|
||||
<template #default="{ row }">
|
||||
<el-select class="flex-1" v-model="row.is_show" clearable placeholder="请选择设备类型">
|
||||
<el-option label="是" :value="1" />
|
||||
<el-option label="否" :value="0" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionMonitoringEquipmentEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionMonitoringEquipmentAdd, apiSupervisionMonitoringEquipmentEdit, apiSupervisionMonitoringEquipmentDetail } from '@/api/supervision_monitoring_equipment'
|
||||
import { apiSupervisionMonitoringEquipmentDetailLists } from '@/api/supervision_monitoring_equipment_detail'
|
||||
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--监控设备信息' : '新增工程监理--监控设备信息'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_name: "",
|
||||
device_name: '',
|
||||
device_type: '',
|
||||
device_sn: '',
|
||||
number: '',
|
||||
remark: '',
|
||||
devices: [{
|
||||
"name": "",
|
||||
"is_show": 0,
|
||||
},]
|
||||
})
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.project_id = e.id
|
||||
formData.project_name = e.project_name
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
formData.devices.push({
|
||||
"name": "",
|
||||
"is_show": 0,
|
||||
})
|
||||
|
||||
}
|
||||
const handleDelete = (row: any) => {
|
||||
const index = formData.devices.indexOf(row);
|
||||
formData.devices.splice(index, 1);
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
project_id: [{
|
||||
required: true,
|
||||
message: '请选择项目',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
device_name: [{
|
||||
required: true,
|
||||
message: '请输入监控设备名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
device_type: [{
|
||||
required: true,
|
||||
message: '请输入设备类型',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
device_sn: [{
|
||||
required: true,
|
||||
message: '请输入设备序列号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
number: [{
|
||||
required: true,
|
||||
message: '请输入编号',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
remark: [{
|
||||
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]
|
||||
}
|
||||
}
|
||||
let res = await apiSupervisionMonitoringEquipmentDetailLists({ device_id: data.id })
|
||||
formData.devices = res.lists
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionMonitoringEquipmentDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionMonitoringEquipmentEdit(data)
|
||||
: await apiSupervisionMonitoringEquipmentAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
133
src/views/supervision_monitoring_equipment/index.vue
Normal file
133
src/views/supervision_monitoring_equipment/index.vue
Normal file
@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
|
||||
<el-form-item label="监控设备名称" prop="device_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.device_name" clearable placeholder="请输入监控设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="device_type">
|
||||
<!-- <el-input class="w-[280px]" v-model="queryParams.device_type" clearable placeholder="请输入设备类型" /> -->
|
||||
<el-select class="w-[280px]" v-model="queryParams.device_type" clearable placeholder="请选择设备类型">
|
||||
<el-option v-for="(item, index) in dictData.device_type" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备序列号" prop="device_sn">
|
||||
<el-input class="w-[280px]" v-model="queryParams.device_sn" clearable placeholder="请输入设备序列号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="number">
|
||||
<el-input class="w-[280px]" v-model="queryParams.number" clearable placeholder="请输入编号" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['supervision_project.supervision_monitoring_equipment/add']" type="primary"
|
||||
@click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_monitoring_equipment/delete']"
|
||||
:disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="监控设备名称" prop="device_name" show-overflow-tooltip />
|
||||
<el-table-column label="设备类型" prop="device_type_text" show-overflow-tooltip />
|
||||
<el-table-column label="设备序列号" prop="device_sn" show-overflow-tooltip />
|
||||
<el-table-column label="编号" prop="number" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['supervision_project.supervision_monitoring_equipment/edit']"
|
||||
type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_monitoring_equipment/delete']"
|
||||
type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</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 feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_id: '',
|
||||
device_name: '',
|
||||
device_type: '',
|
||||
device_sn: '',
|
||||
number: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('device_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionMonitoringEquipmentLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiSupervisionMonitoringEquipmentDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
127
src/views/supervision_monitoring_equipment_detail/edit.vue
Normal file
127
src/views/supervision_monitoring_equipment_detail/edit.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<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-item label="设备信息id" prop="device_id">
|
||||
<el-input v-model="formData.device_id" clearable placeholder="请输入设备信息id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input v-model="formData.name" clearable placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否显示 0-是 1-否" prop="is_show">
|
||||
<el-input v-model="formData.is_show" clearable placeholder="请输入是否显示 0-是 1-否" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionMonitoringEquipmentDetailEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionMonitoringEquipmentDetailAdd, apiSupervisionMonitoringEquipmentDetailEdit, apiSupervisionMonitoringEquipmentDetailDetail } from '@/api/supervision_monitoring_equipment_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--监控设备明细' : '新增工程监理--监控设备明细'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
device_id: '',
|
||||
name: '',
|
||||
is_show: '',
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
device_id: [{
|
||||
required: true,
|
||||
message: '请输入设备信息id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入设备名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
is_show: [{
|
||||
required: true,
|
||||
message: '请输入是否显示 0-是 1-否',
|
||||
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]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionMonitoringEquipmentDetailDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionMonitoringEquipmentDetailEdit(data)
|
||||
: await apiSupervisionMonitoringEquipmentDetailAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
131
src/views/supervision_monitoring_equipment_detail/index.vue
Normal file
131
src/views/supervision_monitoring_equipment_detail/index.vue
Normal file
@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form
|
||||
class="mb-[-16px]"
|
||||
:model="queryParams"
|
||||
inline
|
||||
>
|
||||
<el-form-item label="设备信息id" prop="device_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.device_id" clearable placeholder="请输入设备信息id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入设备名称" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['supervision_project.supervision_monitoring_equipment_detail/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['supervision_project.supervision_monitoring_equipment_detail/delete']"
|
||||
:disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="设备信息id" prop="device_id" show-overflow-tooltip />
|
||||
<el-table-column label="设备名称" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="是否显示 0-是 1-否" prop="is_show" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-perms="['supervision_project.supervision_monitoring_equipment_detail/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['supervision_project.supervision_monitoring_equipment_detail/delete']"
|
||||
type="danger"
|
||||
link
|
||||
@click="handleDelete(row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionMonitoringEquipmentDetailLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiSupervisionMonitoringEquipmentDetailLists, apiSupervisionMonitoringEquipmentDetailDelete } from '@/api/supervision_monitoring_equipment_detail'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
device_id: '',
|
||||
name: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionMonitoringEquipmentDetailLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiSupervisionMonitoringEquipmentDetailDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
250
src/views/supervision_participating_units/edit.vue
Normal file
250
src/views/supervision_participating_units/edit.vue
Normal file
@ -0,0 +1,250 @@
|
||||
<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="90px" :rules="formRules">
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目名称" prop="project_id">
|
||||
<el-input v-model="formData.project_name" clearable placeholder="点击选择项目" readonly
|
||||
@click="showDialog = true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位名称" prop="unit_name">
|
||||
<el-input v-model="formData.unit_name" clearable placeholder="请输入单位名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位类别" prop="unit_type">
|
||||
<el-select class="flex-1" v-model="formData.unit_type" clearable placeholder="请选择单位类别">
|
||||
<el-option v-for="(item, index) in dictData.unit_type" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资质等级" prop="qualification_grade">
|
||||
<el-input v-model="formData.qualification_grade" clearable placeholder="请输入资质等级" />
|
||||
</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="责任范围" prop="duty">
|
||||
<el-input v-model="formData.duty" clearable placeholder="请输入责任范围" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<supervision_project @customEvent="customEvent"></supervision_project>
|
||||
</el-dialog>
|
||||
<div style="margin-bottom: 30px;">联系人</div>
|
||||
<div style="margin-bottom: 30px;">
|
||||
<el-table :data="formData.contacts">
|
||||
<el-table-column label="序号" v-if="mode == 'add'">
|
||||
<template #default="{ row }">
|
||||
<el-button @click="handleAdd(row)">+</el-button>
|
||||
<el-button @click="handleDelete(row)">-</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.name" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="职务" prop="duties">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.duties" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="办公电话" prop="telephone">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.telephone" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号码" prop="mobile">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.mobile" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="电子邮箱" prop="email">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.email" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="传真" prop="fax">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.fax" :readonly="mode == 'edit'" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionParticipatingUnitsEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionParticipatingUnitsAdd, apiSupervisionParticipatingUnitsEdit, apiSupervisionParticipatingUnitsDetail } from '@/api/supervision_participating_units'
|
||||
import { apiSupervisionParticipatingUnitsContactsLists } from '@/api/supervision_participating_units_contacts'
|
||||
|
||||
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
|
||||
const showDialog = ref(false)
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--参建单位' : '新增工程监理--参建单位'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_id: '',
|
||||
project_name: "",
|
||||
unit_name: '',
|
||||
unit_type: '',
|
||||
qualification_grade: '',
|
||||
telephone: '',
|
||||
duty: '',
|
||||
contacts: [
|
||||
{
|
||||
"name": "",
|
||||
"duties": "",
|
||||
"telephone": "",
|
||||
"mobile": "",
|
||||
"email": "",
|
||||
"fax": ""
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.project_id = e.id
|
||||
formData.project_name = e.project_name
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
const handleAdd = () => {
|
||||
formData.contacts.push({
|
||||
"name": "",
|
||||
"duties": "",
|
||||
"telephone": "",
|
||||
"mobile": "",
|
||||
"email": "",
|
||||
"fax": ""
|
||||
})
|
||||
|
||||
}
|
||||
const handleDelete = (row: any) => {
|
||||
const index = formData.contacts.indexOf(row);
|
||||
formData.contacts.splice(index, 1);
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
project_id: [{
|
||||
required: true,
|
||||
message: '请选择项目',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
unit_name: [{
|
||||
required: true,
|
||||
message: '请输入单位名称',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
unit_type: [{
|
||||
required: true,
|
||||
message: '请输入单位类别',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
qualification_grade: [{
|
||||
required: true,
|
||||
message: '请输入资质等级',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
telephone: [{
|
||||
required: true,
|
||||
message: '请输入联系电话',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
duty: [{
|
||||
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]
|
||||
}
|
||||
}
|
||||
let res = await apiSupervisionParticipatingUnitsContactsLists({ unit_id: data.id })
|
||||
// console.log(res.lists, 'res')
|
||||
formData.contacts = res.lists
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionParticipatingUnitsDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionParticipatingUnitsEdit(data)
|
||||
: await apiSupervisionParticipatingUnitsAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
130
src/views/supervision_participating_units/index.vue
Normal file
130
src/views/supervision_participating_units/index.vue
Normal file
@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="单位类别" prop="unit_type">
|
||||
<el-select class="w-[280px]" v-model="queryParams.unit_type" clearable placeholder="请选择行业">
|
||||
<el-option v-for="(item, index) in dictData.unit_type" :key="index" :label="item.name"
|
||||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="unit_name">
|
||||
<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-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units/add']" type="primary"
|
||||
@click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units/delete']"
|
||||
:disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<!-- <el-table-column label="项目id" prop="project_id" show-overflow-tooltip /> -->
|
||||
<el-table-column label="单位名称" prop="unit_name" show-overflow-tooltip />
|
||||
<el-table-column label="单位类别" prop="unit_type_text" show-overflow-tooltip />
|
||||
<el-table-column label="资质等级" prop="qualification_grade" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" prop="telephone" show-overflow-tooltip />
|
||||
<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>
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units/delete']"
|
||||
type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionParticipatingUnitsLists">
|
||||
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'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_id: '',
|
||||
unit_name: '',
|
||||
unit_type: '',
|
||||
qualification_grade: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('unit_type')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionParticipatingUnitsLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiSupervisionParticipatingUnitsDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiSupervisionParticipatingUnitsDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
170
src/views/supervision_participating_units_contacts/edit.vue
Normal file
170
src/views/supervision_participating_units_contacts/edit.vue
Normal file
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<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-item label="单位id" prop="unit_id">
|
||||
<el-input v-model="formData.unit_id" clearable placeholder="请输入单位id" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="单位名称" prop="unit_name">
|
||||
<el-input v-model="formData.unit_name" clearable placeholder="点击选择单位" readonly
|
||||
@click="showDialog = true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="formData.name" clearable placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职务" prop="duties">
|
||||
<el-input v-model="formData.duties" clearable placeholder="请输入职务" />
|
||||
</el-form-item>
|
||||
<el-form-item label="办公电话" prop="telephone">
|
||||
<el-input v-model="formData.telephone" clearable placeholder="请输入办公电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input v-model="formData.mobile" clearable placeholder="请输入手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电子邮箱" prop="email">
|
||||
<el-input v-model="formData.email" clearable placeholder="请输入电子邮箱" />
|
||||
</el-form-item>
|
||||
<el-form-item label="传真" prop="fax">
|
||||
<el-input v-model="formData.fax" clearable placeholder="请输入传真" />
|
||||
</el-form-item>
|
||||
<el-dialog v-model="showDialog" title="选择单位" width="70%">
|
||||
<supervision_participating_units @customEvent="customEvent"></supervision_participating_units>
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionParticipatingUnitsContactsEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionParticipatingUnitsContactsAdd, apiSupervisionParticipatingUnitsContactsEdit, apiSupervisionParticipatingUnitsContactsDetail } from '@/api/supervision_participating_units_contacts'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const showDialog = ref(false)
|
||||
|
||||
|
||||
// 弹窗标题
|
||||
const popupTitle = computed(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--参建单位联系人' : '新增工程监理--参建单位联系人'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
unit_id: '',
|
||||
unit_name: '',
|
||||
name: '',
|
||||
duties: '',
|
||||
telephone: '',
|
||||
mobile: '',
|
||||
email: '',
|
||||
fax: '',
|
||||
})
|
||||
|
||||
const customEvent = (e) => {
|
||||
formData.unit_id = e.id
|
||||
formData.unit_name = e.unit_name
|
||||
console.log(e)
|
||||
showDialog.value = false
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
unit_id: [{
|
||||
required: true,
|
||||
message: '请输入单位id',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
duties: [{
|
||||
required: true,
|
||||
message: '请输入职务',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
telephone: [{
|
||||
required: true,
|
||||
message: '请输入办公电话',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
mobile: [{
|
||||
required: true,
|
||||
message: '请输入手机号码',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
email: [{
|
||||
required: true,
|
||||
message: '请输入电子邮箱',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
fax: [{
|
||||
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]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionParticipatingUnitsContactsDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionParticipatingUnitsContactsEdit(data)
|
||||
: await apiSupervisionParticipatingUnitsContactsAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
126
src/views/supervision_participating_units_contacts/index.vue
Normal file
126
src/views/supervision_participating_units_contacts/index.vue
Normal file
@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="职务" prop="duties">
|
||||
<el-input class="w-[280px]" v-model="queryParams.duties" clearable placeholder="请输入职务" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号码" prop="mobile">
|
||||
<el-input class="w-[280px]" v-model="queryParams.mobile" clearable placeholder="请输入手机号码" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units_contacts/add']" type="primary"
|
||||
@click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units_contacts/delete']"
|
||||
:disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="单位名称" prop="unit_name" show-overflow-tooltip />
|
||||
<el-table-column label="姓名" prop="name" show-overflow-tooltip />
|
||||
<el-table-column label="职务" prop="duties" show-overflow-tooltip />
|
||||
<el-table-column label="办公电话" prop="telephone" show-overflow-tooltip />
|
||||
<el-table-column label="手机号码" prop="mobile" show-overflow-tooltip />
|
||||
<el-table-column label="电子邮箱" prop="email" show-overflow-tooltip />
|
||||
<el-table-column label="传真" prop="fax" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units_contacts/edit']"
|
||||
type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_participating_units_contacts/delete']"
|
||||
type="danger" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="supervisionParticipatingUnitsContactsLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiSupervisionParticipatingUnitsContactsLists, apiSupervisionParticipatingUnitsContactsDelete } from '@/api/supervision_participating_units_contacts'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
unit_id: '',
|
||||
name: '',
|
||||
duties: '',
|
||||
mobile: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiSupervisionParticipatingUnitsContactsLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiSupervisionParticipatingUnitsContactsDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
442
src/views/supervision_project/edit.vue
Normal file
442
src/views/supervision_project/edit.vue
Normal file
@ -0,0 +1,442 @@
|
||||
<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="90px" :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="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="parseInt(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-row>
|
||||
<el-row>
|
||||
<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.supervision_project_build_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-row>
|
||||
|
||||
<el-row>
|
||||
<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" label-width="120px">
|
||||
<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="initiation_date">
|
||||
<!-- <el-input v-model="formData.initiation_date" clearable 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-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="关联合同" prop="contract">
|
||||
<el-input v-model="formData.contract" clearable placeholder="请输入关联合同" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同金额" prop="contract_amount">
|
||||
<el-input v-model="formData.contract_amount" clearable placeholder="请输入合同金额" type="number" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际开工日期" prop="actual_start_date" label-width="120px">
|
||||
<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-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实际竣工日期" prop="actual_end_date" label-width="120px">
|
||||
<!-- <el-input v-model="formData.actual_end_date" clearable 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="计划开工日期" prop="planned_start_date" label-width="120px">
|
||||
<!-- <el-input v-model="formData.planned_start_date" clearable 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="计划竣工日期" prop="planned_end_date" label-width="120px">
|
||||
<!-- <el-input v-model="formData.planned_end_date" clearable 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-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="合同服务内容" prop="contract_content" label-width="120px">
|
||||
<el-input v-model="formData.contract_content" clearable placeholder="请输入合同服务内容" />
|
||||
</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-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" 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="implementation_department">
|
||||
<el-input v-model="formData.implementation_department" clearable placeholder="请输入实施部门" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<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-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.supervision_project_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="project_manager" label-width="120px">
|
||||
<el-input v-model="formData.project_manager" clearable placeholder="请输入项目负责人员" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<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="附件">
|
||||
<annexUpload :annex="formData.annex" @handleAvatarSuccess="handleAvatarSuccess_four"
|
||||
@delFile="delFileFn" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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 { timeFormat } from '@/utils/util'
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
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(() => {
|
||||
return mode.value == 'edit' ? '编辑工程监理--监理项目信息' : '新增工程监理--监理项目信息'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
id: '',
|
||||
project_name: '',
|
||||
project_code: '',
|
||||
industry: '',
|
||||
nature: '',
|
||||
build_unit: '',
|
||||
build_area: '',
|
||||
address: '',
|
||||
project_level: '',
|
||||
total_investment: '',
|
||||
initiation_date: '',
|
||||
contract: '',
|
||||
contract_amount: '',
|
||||
actual_start_date: '',
|
||||
actual_end_date: '',
|
||||
planned_start_date: '',
|
||||
planned_end_date: '',
|
||||
contract_content: '',
|
||||
project_overview: '',
|
||||
project_requirements: '',
|
||||
remark: '',
|
||||
supervision_department: '',
|
||||
implementation_department: '',
|
||||
project_department: '',
|
||||
engineering_status: '',
|
||||
project_manager: '',
|
||||
part_a_unit: '',
|
||||
annex: [],
|
||||
"planned_end_dat": "",
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
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']
|
||||
}],
|
||||
planned_start_date: [{
|
||||
required: true,
|
||||
message: '请输入计划开工日期',
|
||||
trigger: ['blur']
|
||||
}],
|
||||
planned_end_date: [{
|
||||
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']
|
||||
}],
|
||||
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) {
|
||||
if (data[key] != null && data[key] != undefined) {
|
||||
//@ts-ignore
|
||||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiSupervisionProjectDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiSupervisionProjectEdit(data)
|
||||
: await apiSupervisionProjectAdd(data)
|
||||
popupRef.value?.close()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = (type = 'add') => {
|
||||
mode.value = type
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
174
src/views/supervision_project/index.vue
Normal file
174
src/views/supervision_project/index.vue
Normal file
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="项目名称" prop="project_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_name" clearable placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目编号" prop="project_code">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_code" clearable placeholder="请输入项目编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="行业" prop="industry">
|
||||
<el-select class="w-[280px]" v-model="queryParams.industry" clearable placeholder="请选择行业">
|
||||
<el-option v-for="(item, index) in dictData.supervision_project_industry" :key="index"
|
||||
:label="item.name" :value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="性质" prop="nature">
|
||||
<el-select class="w-[280px]" v-model="queryParams.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-form-item label="建设单位" prop="build_unit">
|
||||
<el-input class="w-[280px]" v-model="queryParams.build_unit" clearable placeholder="请输入建设单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目等级" prop="project_level">
|
||||
<el-select class="w-[280px]" 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>
|
||||
</el-form-item>
|
||||
<el-form-item label="工程状态" prop="engineering_status">
|
||||
<el-select class="w-[280px]" 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)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||
<el-button @click="resetParams">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||
<el-button v-perms="['supervision_project.supervision_project/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_project/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
<div class="mt-4">
|
||||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="项目名称" prop="project_name" show-overflow-tooltip />
|
||||
<el-table-column label="项目编号" prop="project_code" show-overflow-tooltip />
|
||||
<el-table-column label="行业" prop="industry_text" show-overflow-tooltip />
|
||||
<el-table-column label="性质" prop="nature_text" show-overflow-tooltip />
|
||||
<el-table-column label="建设单位" prop="build_unit" show-overflow-tooltip />
|
||||
<el-table-column label="建设区域" prop="build_area_text" show-overflow-tooltip />
|
||||
<el-table-column label="项目地址" prop="address" show-overflow-tooltip />
|
||||
<el-table-column label="项目等级" prop="project_level_text" show-overflow-tooltip />
|
||||
<el-table-column label="总投资(万元)" prop="total_investment" 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_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="project_overview" show-overflow-tooltip />
|
||||
<el-table-column label="项目要求" prop="project_requirements" show-overflow-tooltip />
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="监管部门" prop="supervision_department" show-overflow-tooltip />
|
||||
<el-table-column label="实施部门" prop="implementation_department" show-overflow-tooltip />
|
||||
<el-table-column label="项目部" prop="project_department" 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="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">
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['supervision_project.supervision_project/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['supervision_project.supervision_project/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="flex justify-end mt-4">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<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 { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
project_name: '',
|
||||
project_code: '',
|
||||
industry: '',
|
||||
nature: '',
|
||||
build_unit: '',
|
||||
project_level: '',
|
||||
engineering_status: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
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({
|
||||
fetchFun: apiSupervisionProjectLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
let res = await apiSupervisionProjectDetail({ id: data.id })
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiSupervisionProjectDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user