add
This commit is contained in:
parent
76f0e78fba
commit
e0b651973c
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -4,6 +4,9 @@
|
||||
"editor.defaultFormatter": "Vue.volar"
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"[javascript]": {
|
||||
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
@ -46,7 +46,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { useDictData } from "@/hooks/useDictOptions"
|
||||
@ -55,7 +55,7 @@ import { defineEmits } from "vue"
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
|
||||
name: ""
|
||||
});
|
||||
|
||||
const { dictData } = useDictData('bill_type ')
|
||||
|
33
src/components/dialogTable/dialogTableConfig.js
Normal file
33
src/components/dialogTable/dialogTableConfig.js
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
import { apiSupervisionProjectLists } from '@/api/supervision_project'
|
||||
|
||||
export const configA = {
|
||||
queryParams: {
|
||||
project_name: "",
|
||||
project_code: "",
|
||||
},
|
||||
fetchFn: apiSupervisionProjectLists,
|
||||
serchList: [
|
||||
{
|
||||
label: '项目名称',
|
||||
value: "project_name"
|
||||
},
|
||||
{
|
||||
label: '项目编号',
|
||||
value: "project_code"
|
||||
},
|
||||
// {
|
||||
// label: '项目分类',
|
||||
// value: "project_type",
|
||||
// select: [
|
||||
// { label: "是", value: 0 },
|
||||
// { label: "否", value: 1 }
|
||||
// ]
|
||||
// }
|
||||
],
|
||||
tableList: [
|
||||
{ project_name: "项目名称" },
|
||||
{ project_code: "项目编号" },
|
||||
{ industry_text: "行业" },
|
||||
]
|
||||
}
|
106
src/components/dialogTable/index.vue
Normal file
106
src/components/dialogTable/index.vue
Normal file
@ -0,0 +1,106 @@
|
||||
<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="item.label" v-for="(item, index) in config.serchList" :key="index">
|
||||
<el-select v-model="queryParams[item.value]" v-if="item.select">
|
||||
<el-option :label="i.label" :value="i.value" v-for="i in item.select"></el-option>
|
||||
</el-select>
|
||||
|
||||
<el-input class="w-[280px]" v-model="queryParams[item.value]" clearable
|
||||
:placeholder="`请输入${item.label}`" v-else />
|
||||
</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">
|
||||
<fragment v-for="item in config.tableList ">
|
||||
<el-table-column :label="item[(Object.keys(item))[0]]" :prop="(Object.keys(item))[0]"
|
||||
show-overflow-tooltip />
|
||||
</fragment>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- <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="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({
|
||||
config: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
...props.config.queryParams
|
||||
});
|
||||
|
||||
|
||||
// 选中数据
|
||||
const emits = defineEmits(["customEvent"]);
|
||||
|
||||
// 选中数据子父传递
|
||||
const handleCurrentChange = (value: any) => {
|
||||
emits("customEvent", value);
|
||||
};
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: props.config.fetchFn,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
getLists();
|
||||
</script>
|
@ -28,10 +28,6 @@
|
||||
<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 />
|
||||
@ -51,7 +47,7 @@
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { usePaging } from "@/hooks/usePaging"
|
||||
import { apiSupervisionProjectLists } from '@/api/supervision_project'
|
||||
|
@ -4,7 +4,7 @@ import install from './install'
|
||||
import './permission'
|
||||
import './styles/index.scss'
|
||||
import 'virtual:svg-icons-register'
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(install)
|
||||
// app.use(Fragment.Plugin)
|
||||
app.mount('#app')
|
||||
|
@ -19,8 +19,10 @@
|
||||
</div>
|
||||
|
||||
<el-table :data="pager.lists" style="width: 100%">
|
||||
<el-table-column :label="item.label" :prop='item.prop' v-for="(item, index) in baseData.columnList" :key="index" />
|
||||
<el-table-column :label="item.label" :prop='item.prop' v-for="(item, index) in baseData.columnList"
|
||||
:key="index" />
|
||||
<el-table-column label="操作" fixed="right" align="center" v-if="!isAction">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['project.project/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
@ -36,6 +38,7 @@
|
||||
</div>
|
||||
<EditPopup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" :project="project" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
import { ref, reactive, defineProps, toRaw, defineAsyncComponent } from "vue"
|
||||
@ -59,6 +62,7 @@ const showEdit = ref(false)
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
// FIXME:网络请求阻塞页面的打开
|
||||
setTimeout(() => {
|
||||
editRef.value?.open('add')
|
||||
}, 700);
|
||||
@ -68,6 +72,7 @@ const handleAdd = async () => {
|
||||
const handleEdit = async (data) => {
|
||||
let res = await props.baseData.editApi({ id: data.id })
|
||||
showEdit.value = true
|
||||
// FIXME:网络请求阻塞页面的打开
|
||||
setTimeout(() => {
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(res)
|
||||
@ -93,6 +98,7 @@ getLists()
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
|
@ -30,7 +30,9 @@
|
||||
@delFile="delFileFn" />
|
||||
</el-form-item>
|
||||
<el-dialog v-model="showDialog" title="选择项目" width="70%">
|
||||
<supervision_project @customEvent="customEvent"></supervision_project>
|
||||
<!-- <supervision_project @customEvent="customEvent"></supervision_project> -->
|
||||
<dialogTable @customEvent="customEvent" :config="configA" />
|
||||
|
||||
</el-dialog>
|
||||
</el-form>
|
||||
</popup>
|
||||
@ -42,6 +44,7 @@ import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiSupervisionPlanningAdd, apiSupervisionPlanningEdit, apiSupervisionPlanningDetail } from '@/api/supervision_planning'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import { configA } from "@/components/dialogTable/dialogTableConfig"
|
||||
import type { PropType } from 'vue'
|
||||
defineProps({
|
||||
dictData: {
|
||||
|
@ -2,9 +2,6 @@
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<!-- <el-form-item label="项目id" prop="project_id">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_id" clearable placeholder="请选择项目" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="专项审批类型" prop="approval_type">
|
||||
<el-select class="w-[280px]" v-model="queryParams.approval_type" clearable placeholder="请选择专项审批类型">
|
||||
<el-option v-for="(item, index) in dictData.supervision_planning_approval_type" :key="index"
|
||||
@ -48,6 +45,7 @@
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="创建人" prop="create_user_name" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
|
||||
<template #default="{ row }">
|
||||
<el-button v-perms="['supervision_prepare.supervision_planning/edit']" type="primary" link
|
||||
@click="handleEdit(row)">
|
||||
@ -133,4 +131,3 @@ const handleDelete = async (id: number | any[]) => {
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user