add
This commit is contained in:
parent
8d6146aba7
commit
8f6f89cad0
32
src/views/project_alarm_set/detail.js
Normal file
32
src/views/project_alarm_set/detail.js
Normal file
@ -0,0 +1,32 @@
|
||||
const detailConfig = {
|
||||
title: "项目预警设置",
|
||||
config: [
|
||||
{
|
||||
label: "项目名称",
|
||||
value: "project_name"
|
||||
},
|
||||
{
|
||||
label: "项目编码",
|
||||
value: "project_code"
|
||||
},
|
||||
{
|
||||
label: "材料预算花费比例",
|
||||
value: "material_budget_expenditure_ratio"
|
||||
},
|
||||
{
|
||||
label: "人工预算花费比例",
|
||||
value: "labour_budget_expenditure_ratio"
|
||||
},
|
||||
{
|
||||
label: "费用预算花费比例",
|
||||
value: "cost_budget_expenditure_ratio"
|
||||
},
|
||||
{
|
||||
label: "分包预算花费比例",
|
||||
value: "subcontract_budget_expenditure_ratio"
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
export default detailConfig;
|
@ -1,137 +0,0 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目合同详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="160px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目">
|
||||
{{ formData.project_name }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目编码">
|
||||
{{ formData.project_code }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="材料预算花费比例">
|
||||
{{ formData.material_budget_expenditure_ratio }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="人工预算花费比例">
|
||||
{{ formData.labour_budget_expenditure_ratio }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="费用预算花费比例">
|
||||
{{ formData.cost_budget_expenditure_ratio }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="分包预算花费比例">
|
||||
{{ formData.subcontract_budget_expenditure_ratio }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
@ -34,8 +34,7 @@
|
||||
|
||||
<el-table-column label="项目编码" prop="project_code" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="材料预算花费比例(%)" prop="material_budget_expenditure_ratio"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column label="材料预算花费比例(%)" prop="material_budget_expenditure_ratio" show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="人工预算花费比例(%)" prop="labour_budget_expenditure_ratio" show-overflow-tooltip />
|
||||
|
||||
@ -52,7 +51,7 @@
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/detail']" link @click="handledetail(row)">
|
||||
<el-button v-perms="['project.project/detail']" link @click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
|
||||
@ -65,7 +64,8 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" :column="1"
|
||||
width="550px" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -78,13 +78,13 @@ import { getAllProjectTypes } from '@/api/projecttype'
|
||||
const protype = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
import detailConfig from './detail'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDtail = ref(false)
|
||||
|
||||
const showDetail = ref(false)
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
name: ''
|
||||
@ -133,14 +133,14 @@ const handleDelete = async (id: number | any[]) => {
|
||||
await apiProjectalarmDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiProjectalarmDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiProjectalarmDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
}
|
||||
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
@ -1,141 +0,0 @@
|
||||
<template>
|
||||
<div class="detail-popup">
|
||||
<popup ref="popupRef" title="项目费用模板详情" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
<el-card class="mb-2">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="项目类型">
|
||||
{{ formData.project_type_name
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="科目编码">
|
||||
{{ formData.subject_code
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col> <el-col :span="12">
|
||||
<el-form-item label="一级科目">
|
||||
{{ formData.first_level_subject }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="二级科目">
|
||||
{{ formData.second_level_subject }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="三级科目">
|
||||
{{ formData.third_level_subject }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="单位">
|
||||
{{ formData.unit
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否属于差旅科目">
|
||||
{{ formData.is_travel == 1 ? '是' : '否' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="customdetail">
|
||||
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiCustomDetail } from '@/api/custom'
|
||||
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 datas = reactive({
|
||||
provinceOptions: [],
|
||||
cityOptions: [],
|
||||
areaOptions: [],
|
||||
});
|
||||
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
// 获取详情
|
||||
const setFormData = async (data: Record<any, any>) => {
|
||||
Object.assign(formData, data)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiCustomDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
popupRef.value?.close()
|
||||
|
||||
}
|
||||
|
||||
//打开弹窗
|
||||
const open = () => {
|
||||
popupRef.value?.open()
|
||||
}
|
||||
|
||||
// 关闭回调
|
||||
const handleClose = () => {
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
setFormData,
|
||||
getDetail
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tit {
|
||||
font-size: 1.2em;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
:deep(.my-label) {
|
||||
width: 150px;
|
||||
}
|
||||
</style>
|
@ -12,7 +12,8 @@
|
||||
<el-input class="w-[280px]" v-model="queryParams.first_level_subject" clearable placeholder="请输入一级科目" />
|
||||
</el-form-item>
|
||||
<el-form-item label="二级科目" prop="second_level_subject">
|
||||
<el-input class="w-[280px]" v-model="queryParams.second_level_subject" clearable placeholder="请输入二级科目" />
|
||||
<el-input class="w-[280px]" v-model="queryParams.second_level_subject" clearable
|
||||
placeholder="请输入二级科目" />
|
||||
</el-form-item>
|
||||
<el-form-item label="三级科目" prop="third_level_subject">
|
||||
<el-input class="w-[280px]" v-model="queryParams.third_level_subject" clearable placeholder="请输入二级科目" />
|
||||
@ -23,7 +24,8 @@
|
||||
<el-form-item label="差旅科目" prop="unit">
|
||||
<el-select class="w-[280px]" v-model="queryParams.is_travel" clearable placeholder="请选择的是否属于差旅科目">
|
||||
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name" :value="parseInt(item.id)" />
|
||||
<el-option v-for="(item, index) in list1" :key="index" :label="item.name"
|
||||
:value="parseInt(item.id)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@ -39,7 +41,8 @@
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/delete']" :disabled="!selectData.length" @click="handleDelete(selectData)">
|
||||
<el-button v-perms="['project.project/delete']" :disabled="!selectData.length"
|
||||
@click="handleDelete(selectData)">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
@ -64,10 +67,11 @@
|
||||
<el-button v-perms="['project.project/edit']" type="primary" link @click="handleEdit(row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/delete']" type="danger" link @click="handleDelete(row.id)">
|
||||
<el-button v-perms="['project.project/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/detail']" link @click="handledetail(row)">
|
||||
<el-button v-perms="['project.project/detail']" link @click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
|
||||
@ -80,7 +84,8 @@
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||
<detailPage v-if="showDetail" ref="detailRef" @close="showDetail = false" :detailConfig="detailConfig" :column="1"
|
||||
width="550px" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -93,12 +98,14 @@ import { getAllProjectTypes } from '@/api/projecttype'
|
||||
const protype = reactive([])
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import DetailPopup from './detail.vue'
|
||||
const detailRef = shallowRef<InstanceType<typeof DetailPopup>>()
|
||||
import detailConfig from './detail'
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const detailRef = ref('')
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
const showDtail = ref(false)
|
||||
const showDetail = ref(false)
|
||||
|
||||
const list1 = ref([{
|
||||
name: '是',
|
||||
id: 1
|
||||
@ -160,9 +167,10 @@ const handleDelete = async (id: number | any[]) => {
|
||||
await apiProjectcostDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
const handledetail = async (data: any) => {
|
||||
let res = await apiProjectcostDetail({ id: data.id })
|
||||
showDtail.value = true
|
||||
// 详情
|
||||
const handleDetail = async (id: any) => {
|
||||
let res = await apiProjectcostDetail({ id })
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open()
|
||||
detailRef.value?.setFormData(res)
|
||||
|
@ -21,11 +21,6 @@
|
||||
}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
|
@ -1,33 +1,21 @@
|
||||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="项目类型" prop="project_type_id" @click="showDialog = true"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-select class="w-[280px]" v-model="formData.project_type_id" clearable placeholder="请选择项目类型">
|
||||
<el-option v-for="(item, index) in list" :key="index" :label="item.name"
|
||||
:value="parseInt(item.id)" />
|
||||
</el-select>
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="最低利润率(%)" prop="profit_rate"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.profit_rate" type="number" clearable placeholder="请输入最低利润率(%)" />
|
||||
</el-form-item> </el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item> </el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules" inline>
|
||||
<el-form-item label="项目类型" prop="project_type_id" @click="showDialog = true"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'change' }]">
|
||||
<el-select class="w-[190px]" v-model="formData.project_type_id" clearable placeholder="请选择项目类型">
|
||||
<el-option v-for="(item, index) in list" :key="index" :label="item.name"
|
||||
:value="parseInt(item.id)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="最低利润率(%)" prop="profit_rate"
|
||||
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||
<el-input v-model="formData.profit_rate" type="number" clearable placeholder="请输入最低利润率(%)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" clearable placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
||||
|
@ -3,8 +3,7 @@
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="类型名称" prop="project_type_name">
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_type_name" clearable
|
||||
placeholder="请输入类型名称" />
|
||||
<el-input class="w-[280px]" v-model="queryParams.project_type_name" clearable placeholder="请输入类型名称" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
@ -44,9 +43,9 @@
|
||||
@click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-perms="['project.project/detail']" link @click="handledetail(row)">
|
||||
<!-- <el-button v-perms="['project.project/detail']" link @click="handledetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
Loading…
x
Reference in New Issue
Block a user