add
This commit is contained in:
parent
649534850b
commit
abb49b0794
@ -1,25 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div
|
<div class="flex-1 min-h-0 menu" :class="themeClass" :style="isCollapsed ? '' : `--aside-width: ${width}px`">
|
||||||
class="flex-1 min-h-0 menu"
|
|
||||||
:class="themeClass"
|
|
||||||
:style="isCollapsed ? '' : `--aside-width: ${width}px`"
|
|
||||||
>
|
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<el-menu
|
<el-menu v-bind="config" :default-active="activeMenu" :collapse="isCollapsed" mode="vertical"
|
||||||
v-bind="config"
|
:unique-opened="uniqueOpened" @select="$emit('select')">
|
||||||
:default-active="activeMenu"
|
<menu-item v-for="route in routes" :key="route.path" :route="route" :route-path="route.path"
|
||||||
:collapse="isCollapsed"
|
:popper-class="themeClass" />
|
||||||
mode="vertical"
|
|
||||||
:unique-opened="uniqueOpened"
|
|
||||||
@select="$emit('select')"
|
|
||||||
>
|
|
||||||
<menu-item
|
|
||||||
v-for="route in routes"
|
|
||||||
:key="route.path"
|
|
||||||
:route="route"
|
|
||||||
:route-path="route.path"
|
|
||||||
:popper-class="themeClass"
|
|
||||||
/>
|
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
@ -56,10 +41,16 @@ const props = defineProps({
|
|||||||
|
|
||||||
defineEmits(['select'])
|
defineEmits(['select'])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const activeMenu = computed<string>(() => route.meta?.activeMenu || route.path)
|
const activeMenu = computed<string>(() => route.meta?.activeMenu || route.path)
|
||||||
const themeClass = computed(() => `theme-${props.theme}`)
|
const themeClass = computed(() => `theme-${props.theme}`)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@ -72,28 +63,34 @@ const themeClass = computed(() => `theme-${props.theme}`)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-menu--collapse) {
|
:deep(.el-menu--collapse) {
|
||||||
.el-sub-menu.is-active .el-sub-menu__title {
|
.el-sub-menu.is-active .el-sub-menu__title {
|
||||||
@apply bg-primary #{!important};
|
@apply bg-primary #{!important};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.theme-light {
|
&.theme-light {
|
||||||
:deep(.el-menu) {
|
:deep(.el-menu) {
|
||||||
.el-menu-item {
|
.el-menu-item {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
|
|
||||||
&.is-active {
|
&.is-active {
|
||||||
@apply bg-primary-light-9 border-r-2 border-primary;
|
@apply bg-primary-light-9 border-r-2 border-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu-item:hover,
|
.el-menu-item:hover,
|
||||||
.el-sub-menu__title:hover {
|
.el-sub-menu__title:hover {
|
||||||
color: var(--el-color-primary);
|
color: var(--el-color-primary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-menu {
|
.el-menu {
|
||||||
border-right: none;
|
border-right: none;
|
||||||
|
|
||||||
&:not(.el-menu--collapse) {
|
&:not(.el-menu--collapse) {
|
||||||
width: var(--aside-width);
|
width: var(--aside-width);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,9 @@ export function createRouteRecord(route: any, firstRoute: boolean): RouteRecordR
|
|||||||
export function loadRouteView(component: string) {
|
export function loadRouteView(component: string) {
|
||||||
try {
|
try {
|
||||||
const key = Object.keys(modules).find((key) => {
|
const key = Object.keys(modules).find((key) => {
|
||||||
return key.includes(`${component}.vue`)
|
// return key.includes(`${component}.vue`)
|
||||||
|
return key.includes(`/src/views/${component}.vue`)
|
||||||
|
|
||||||
})
|
})
|
||||||
if (key) {
|
if (key) {
|
||||||
return modules[key]
|
return modules[key]
|
||||||
|
153
src/views/build_process_settings/detail.vue
Normal file
153
src/views/build_process_settings/detail.vue
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
<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.division_engineering }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="子分部工程">
|
||||||
|
{{ formData.sub_division_engineering }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="分项工程">
|
||||||
|
{{ formData.subentry_engineering }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="分项工程编码">
|
||||||
|
{{ formData.subentry_engineering_code }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工序步骤号">
|
||||||
|
{{ formData.process_step_no }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="工序步骤">
|
||||||
|
{{ formData.process_step }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="质量控制点">
|
||||||
|
{{ formData.quality_control_points }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="质量控制点">
|
||||||
|
{{ formData.quality_control_points }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="图例说明">
|
||||||
|
<div v-if="formData.annex && formData.annex.length > 0">
|
||||||
|
<material-picker v-model="formData.annex" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
暂无文件
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</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>
|
204
src/views/build_process_settings/edit.vue
Normal file
204
src/views/build_process_settings/edit.vue
Normal file
@ -0,0 +1,204 @@
|
|||||||
|
<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="auto" :rules="formRules">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-row :gutter="10">
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="分部工程" prop="division_id" @click="showDialog = true"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="division_engineering" readonly clearable placeholder="点击选择分部分项工程" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="子分部工程" prop="division_id"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="sub_division_engineering" clearable disabled placeholder="系统自动填写" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="分项工程" prop="division_id"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="subentry_engineering" clearable disabled placeholder="系统自动填写" />
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="分项工程编码" prop="division_id"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="subentry_engineering_code" clearable disabled placeholder="系统自动填写" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="工序步骤号" prop="process_step_no"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="formData.process_step_no" clearable placeholder="请输入工序步骤号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="工序步骤" prop="process_step"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="formData.process_step" clearable placeholder="请输入工序步骤" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="图例说明">
|
||||||
|
<!-- <material-picker v-model="formData.annex" :limit="100" /> -->
|
||||||
|
<annexUpload :annex="formData.annex" @handleAvatarSuccess="handleAvatarSuccess_four"
|
||||||
|
@delFile="delFileFn" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="质量控制点" prop="quality_control_points"
|
||||||
|
:rules="[{ required: true, message: '不可为空', trigger: 'blur' }]">
|
||||||
|
<el-input v-model="formData.quality_control_points" clearable placeholder="请输入质量控制点" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<el-dialog v-model="showDialog" title="选择客户" width="70%">
|
||||||
|
<customDialog @customEvent="customEvent"></customDialog>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</popup>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="projectEdit">
|
||||||
|
import customDialog from '@/components/build_division/index.vue'
|
||||||
|
import type { FormInstance } from 'element-plus'
|
||||||
|
import Popup from '@/components/popup/index.vue'
|
||||||
|
import { buildprocesssettingsAdd, buildprocesssettingsEdit, buildprocesssettingsDetail } from '@/api/build/build_process_settings'
|
||||||
|
import type { PropType } from 'vue'
|
||||||
|
// 上传文件
|
||||||
|
import annexUpload from "@/components/annexUpload/index.vue"
|
||||||
|
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 showDialog = ref(false)
|
||||||
|
const subentry_engineering = ref('')
|
||||||
|
const subentry_engineering_code = ref('')
|
||||||
|
const sub_division_engineering = ref('')
|
||||||
|
const division_engineering = ref('')
|
||||||
|
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: '',
|
||||||
|
process_step_no: '',
|
||||||
|
process_step: '',
|
||||||
|
quality_control_points: '',
|
||||||
|
division_id: '',
|
||||||
|
annex: []
|
||||||
|
})
|
||||||
|
|
||||||
|
const customEvent = (e) => {
|
||||||
|
formData.division_id = e.id;
|
||||||
|
subentry_engineering.value = e.subentry_engineering
|
||||||
|
subentry_engineering_code.value = e.subentry_engineering_code
|
||||||
|
sub_division_engineering.value = e.sub_division_engineering
|
||||||
|
division_engineering.value = e.division_engineering
|
||||||
|
showDialog.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单验证
|
||||||
|
const formRules = reactive<any>({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取详情
|
||||||
|
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 buildprocesssettingsDetail({
|
||||||
|
id: row.id
|
||||||
|
})
|
||||||
|
setFormData(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const handleSubmit = async () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
await formRef.value?.validate()
|
||||||
|
|
||||||
|
const data = { ...formData }
|
||||||
|
mode.value == 'edit'
|
||||||
|
? await buildprocesssettingsEdit(data)
|
||||||
|
: await buildprocesssettingsAdd(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>
|
166
src/views/build_process_settings/index.vue
Normal file
166
src/views/build_process_settings/index.vue
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="!border-none mb-4" shadow="never">
|
||||||
|
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||||
|
|
||||||
|
<el-form-item label="工序步骤" prop="process_step">
|
||||||
|
<el-input v-model="queryParams.process_step" clearable placeholder="请输入工序步骤" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="resetPage">查询</el-button>
|
||||||
|
<el-button @click="reset">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
|
||||||
|
<el-button v-perms="['build.build_process_settings/add']" type="primary" @click="handleAdd">
|
||||||
|
<template #icon>
|
||||||
|
<icon name="el-icon-Plus" />
|
||||||
|
</template>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['build.build_process_settings/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="序号" type="index" width="55" />
|
||||||
|
<el-table-column label="分部工程" prop="division_engineering" show-overflow-tooltip />
|
||||||
|
<el-table-column label="子分部工程" prop="sub_division_engineering" show-overflow-tooltip />
|
||||||
|
<el-table-column label="分项工程" prop="subentry_engineering" show-overflow-tooltip />
|
||||||
|
<el-table-column label="分项工程编码" prop="subentry_engineering_code" show-overflow-tooltip />
|
||||||
|
<el-table-column label="工序步骤号" prop="process_step_no" show-overflow-tooltip />
|
||||||
|
<el-table-column label="工序步骤" prop="process_step" show-overflow-tooltip />
|
||||||
|
<el-table-column label="质量控制点" prop="quality_control_points" show-overflow-tooltip />
|
||||||
|
<el-table-column label="图例说明" prop="file" show-overflow-tooltip>
|
||||||
|
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div v-if="row.annex && row.annex.length > 0">
|
||||||
|
<div v-for="(item, i) in row.annex " :key='i'>
|
||||||
|
<el-link :href="item.uri" target="_blank">文件{{ i + 1 }}</el-link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
暂无文件
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="150" fixed="right">
|
||||||
|
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button v-perms="['build.build_process_settings/edit']" type="primary" link
|
||||||
|
@click="handleEdit(row)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['build.build_process_settings/delete']" type="danger" link
|
||||||
|
@click="handleDelete(row.id)">
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
<el-button v-perms="['build.build_process_settings/detail']" link
|
||||||
|
@click="handledetail(row)">
|
||||||
|
详情
|
||||||
|
</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" />
|
||||||
|
<detail-popup v-if="showDtail" ref="detailRef" :dict-data="dictData" @close="showDtail = false" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup name="projectLists">
|
||||||
|
import { usePaging } from '@/hooks/usePaging'
|
||||||
|
import { useDictData } from '@/hooks/useDictOptions'
|
||||||
|
import { buildprocesssettingsLists, buildprocesssettingsDelete, buildprocesssettingsDetail } from '@/api/build/build_process_settings'
|
||||||
|
import { timeFormat } from '@/utils/util'
|
||||||
|
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>>()
|
||||||
|
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||||
|
// 是否显示编辑框
|
||||||
|
const showEdit = ref(false)
|
||||||
|
const showDtail = ref(false)
|
||||||
|
const dtimevalue = ref([])
|
||||||
|
// 查询条件
|
||||||
|
const queryParams = reactive({
|
||||||
|
process_step: ""
|
||||||
|
})
|
||||||
|
//查询
|
||||||
|
const dateclick = (e: any) => {
|
||||||
|
queryParams.start_time = e[0]
|
||||||
|
queryParams.deliver_time = e[1]
|
||||||
|
}
|
||||||
|
|
||||||
|
//重置
|
||||||
|
const reset = () => {
|
||||||
|
Object.assign(queryParams, {
|
||||||
|
project_approval_date: '',
|
||||||
|
start_date: '',
|
||||||
|
delivery_date: '',
|
||||||
|
})
|
||||||
|
dtimevalue.value = ''
|
||||||
|
getLists()
|
||||||
|
}
|
||||||
|
// 选中数据
|
||||||
|
const selectData = ref<any[]>([])
|
||||||
|
|
||||||
|
// 表格选择后回调事件
|
||||||
|
const handleSelectionChange = (val: any[]) => {
|
||||||
|
selectData.value = val.map(({ id }) => id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取字典数据
|
||||||
|
const { dictData } = useDictData('')
|
||||||
|
// 分页相关
|
||||||
|
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||||
|
fetchFun: buildprocesssettingsLists,
|
||||||
|
params: queryParams
|
||||||
|
})
|
||||||
|
|
||||||
|
// 添加
|
||||||
|
const handleAdd = async () => {
|
||||||
|
showEdit.value = true
|
||||||
|
await nextTick()
|
||||||
|
editRef.value?.open('add')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
const handleEdit = async (data: any) => {
|
||||||
|
let res = await buildprocesssettingsDetail({ 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 buildprocesssettingsDelete({ id })
|
||||||
|
getLists()
|
||||||
|
}
|
||||||
|
const handledetail = async (data: any) => {
|
||||||
|
let res = await buildprocesssettingsDetail({ id: data.id })
|
||||||
|
showDtail.value = true
|
||||||
|
await nextTick()
|
||||||
|
detailRef.value?.open()
|
||||||
|
detailRef.value?.setFormData(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getLists()
|
||||||
|
</script>
|
@ -20,8 +20,8 @@
|
|||||||
<el-select class="w-[280px]" v-model="queryParams.strategic_significance" clearable
|
<el-select class="w-[280px]" v-model="queryParams.strategic_significance" clearable
|
||||||
placeholder="请选择战略意义">
|
placeholder="请选择战略意义">
|
||||||
<el-option label="全部" value=""></el-option>
|
<el-option label="全部" value=""></el-option>
|
||||||
<el-option v-for="(item, index) in dictData.strategic_significance" :key="index" :label="item.name"
|
<el-option v-for="(item, index) in dictData.strategic_significance" :key="index"
|
||||||
:value="item.value" />
|
:label="item.name" :value="item.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="所属行业" prop="industry">
|
<el-form-item label="所属行业" prop="industry">
|
||||||
@ -46,7 +46,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="信息来源" prop="information_sources">
|
<el-form-item label="信息来源" prop="information_sources">
|
||||||
<el-select class="w-[280px]" v-model="queryParams.information_sources" clearable placeholder="请选择信息来源">
|
<el-select class="w-[280px]" v-model="queryParams.information_sources" clearable
|
||||||
|
placeholder="请选择信息来源">
|
||||||
<el-option label="全部" value=""></el-option>
|
<el-option label="全部" value=""></el-option>
|
||||||
<el-option v-for="(item, index) in dictData.information_sources" :key="index" :label="item.name"
|
<el-option v-for="(item, index) in dictData.information_sources" :key="index" :label="item.name"
|
||||||
:value="item.value" />
|
:value="item.value" />
|
||||||
@ -216,4 +217,3 @@ list()
|
|||||||
|
|
||||||
getLists()
|
getLists()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user