2 files modified
3 files added
| New file |
| | |
| | | <template> |
| | | <el-dialog |
| | | class="gd-dialog" |
| | | v-model="visible" |
| | | title="配置" |
| | | @closed="visible = false" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-form |
| | | class="gd-dialog-form" |
| | | ref="formRef" |
| | | :model="formData" |
| | | :rules="rules" |
| | | label-width="140px" |
| | | v-loading="loading" |
| | | > |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="关联流程" prop="processDefinitionId"> |
| | | <el-select |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="formData.processDefinitionId" |
| | | placeholder="请选择" |
| | | clearable |
| | | filterable |
| | | > |
| | | <el-option v-for="item in flowList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="材料" prop="materialIds"> |
| | | <el-select |
| | | class="gd-select" |
| | | popper-class="gd-select-popper" |
| | | v-model="formData.materialIds" |
| | | placeholder="请选择" |
| | | clearable |
| | | filterable |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip |
| | | > |
| | | <el-option v-for="item in materialsList" :key="item.id" :label="item.materialName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button color="#F2F3F5" @click="visible = false">取消</el-button> |
| | | <el-button class="save-btn" color="#4C34FF" :loading="submitting" :disabled="submitting" @click="handleSubmit"> |
| | | 保存 |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules } from '@ztzf/utils' |
| | | import { getConfigDetailApi, saveConfigApi } from './inventoryApi' |
| | | import { managerList } from '@/api/flow/flow' |
| | | import { materialsPageApi } from '../materials/materialsApi' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | | implementListId: null, |
| | | processDefinitionId: '', |
| | | processInstanceId: '', |
| | | materialIds: [], |
| | | }) |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const visible = defineModel() // 弹框显隐 |
| | | const submitting = ref(false) // 提交中 |
| | | const loading = ref(false) // 加载中 |
| | | const flowList = ref([]) // 流程列表 |
| | | const materialsList = ref([]) // 材料列表 |
| | | const currentRow = ref(null) // 当前操作的行 |
| | | |
| | | // 表单校验规则 |
| | | const rules = { |
| | | processDefinitionId: fieldRules(false), |
| | | materialIds: fieldRules(false), |
| | | } |
| | | |
| | | // 获取流程列表 |
| | | async function getFlowList() { |
| | | try { |
| | | const res = await managerList(1, 999, {}) |
| | | flowList.value = res?.data?.data?.records ?? [] |
| | | } catch (error) { |
| | | console.error('获取流程列表失败:', error) |
| | | } |
| | | } |
| | | |
| | | // 获取材料列表 |
| | | async function getMaterialsList() { |
| | | try { |
| | | const res = await materialsPageApi({ current: 1, size: 999 }) |
| | | materialsList.value = res?.data?.data?.records ?? [] |
| | | } catch (error) { |
| | | console.error('获取材料列表失败:', error) |
| | | } |
| | | } |
| | | |
| | | // 加载配置详情 |
| | | async function loadConfigDetail(id) { |
| | | loading.value = true |
| | | try { |
| | | const res = await getConfigDetailApi({ id }) |
| | | const data = res?.data?.data ?? {} |
| | | |
| | | // 设置流程定义ID |
| | | formData.value.processDefinitionId = data.processDefinitionId || '' |
| | | formData.value.processInstanceId = data.processInstanceId || '' |
| | | |
| | | // 从关联材料中提取材料ID列表 |
| | | if (data.thingListMaterialRels && data.thingListMaterialRels.length > 0) { |
| | | formData.value.materialIds = data.thingListMaterialRels.map(item => item.materialId) |
| | | } else { |
| | | formData.value.materialIds = [] |
| | | } |
| | | } catch (error) { |
| | | console.error('加载配置详情失败:', error) |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | // 提交配置 |
| | | async function handleSubmit() { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | const submitData = { |
| | | implementListId: formData.value.implementListId, |
| | | processDefinitionId: formData.value.processDefinitionId, |
| | | processInstanceId: formData.value.processInstanceId || '', |
| | | materialIds: formData.value.materialIds || [], |
| | | } |
| | | await saveConfigApi(submitData) |
| | | ElMessage.success('配置保存成功') |
| | | visible.value = false |
| | | emit('success') |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | | } |
| | | |
| | | // 打开弹框 |
| | | async function open({ row } = {}) { |
| | | currentRow.value = row |
| | | formData.value = initForm() |
| | | formData.value.implementListId = row?.id |
| | | |
| | | // 加载流程和材料列表 |
| | | await Promise.all([getFlowList(), getMaterialsList()]) |
| | | |
| | | // 加载已配置的信息 |
| | | if (row?.id) { |
| | | await loadConfigDetail(row.id) |
| | | } |
| | | } |
| | | |
| | | defineExpose({ open }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| New file |
| | |
| | | <template> |
| | | <el-dialog |
| | | class="gd-dialog" |
| | | v-model="visible" |
| | | :title="titleEnum[dialogMode]" |
| | | @closed="visible = false" |
| | | destroy-on-close |
| | | :close-on-click-modal="false" |
| | | > |
| | | <el-row class="detail-row-view" v-if="dialogReadonly"> |
| | | <el-col :span="12"> |
| | | <div class="label">所属区划</div> |
| | | <div class="val">{{ formData.areaName }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">实施清单名称</div> |
| | | <div class="val">{{ formData.implementName }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">事项名称</div> |
| | | <div class="val">{{ formData.matterName }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div class="label">所属机构</div> |
| | | <div class="val">{{ formData.orgName }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-form |
| | | class="gd-dialog-form" |
| | | v-else |
| | | ref="formRef" |
| | | :model="formData" |
| | | :rules="rules" |
| | | :disabled="dialogReadonly" |
| | | label-width="140px" |
| | | > |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属区划" prop="areaCode"> |
| | | <el-tree-select |
| | | class="gd-select" |
| | | popper-class="gd-tree-select-popper" |
| | | v-model="formData.areaCode" |
| | | node-key="id" |
| | | :default-expanded-keys="expandedKeys" |
| | | :props="treeSelectProps" |
| | | placeholder="请选择" |
| | | clearable |
| | | filterable |
| | | :check-strictly="true" |
| | | lazy |
| | | :load="loadRegionNode" |
| | | :render-after-expand="false" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="实施清单名称" prop="implementName"> |
| | | <el-input class="gd-input" v-model="formData.implementName" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="事项名称" prop="matterName"> |
| | | <el-input class="gd-input" v-model="formData.matterName" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="所属机构" prop="orgCode"> |
| | | <el-tree-select |
| | | class="gd-select" |
| | | popper-class="gd-tree-select-popper" |
| | | v-model="formData.orgCode" |
| | | node-key="id" |
| | | :data="deptTree" |
| | | :props="treeProps" |
| | | placeholder="请选择" |
| | | check-strictly |
| | | clearable |
| | | @change="handleOrgChange" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer v-if="!dialogReadonly"> |
| | | <el-button color="#F2F3F5" @click="visible = false">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button class="save-btn" color="#4C34FF" :loading="submitting" :disabled="submitting" @click="handleSubmit"> |
| | | 保存 |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref, inject } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules } from '@ztzf/utils' |
| | | import { inventorySubmitApi, inventoryDetailApi, regionLazyTreeApi } from './inventoryApi' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | | areaCode: '', |
| | | areaName: '', |
| | | implementName: '', |
| | | implementCode: '', |
| | | matterName: '', |
| | | matterCode: '', |
| | | orgCode: '', |
| | | orgName: '', |
| | | id: null, |
| | | }) |
| | | |
| | | // 注入字典和部门树 |
| | | const dictObj = inject('dictObj') |
| | | const deptTree = inject('deptTree') |
| | | const treeProps = inject('treeProps') |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const visible = defineModel() // 弹框显隐 |
| | | const dialogMode = ref('add') // 弹框模式 |
| | | const submitting = ref(false) // 提交中 |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' }) |
| | | const expandedKeys = ref([]) // 树形选择器展开的节点 |
| | | const regionNodeCache = ref(new Map()) // 缓存区域节点及其父节点关系 |
| | | |
| | | // 区域树形选择器配置 |
| | | const treeSelectProps = ref({ |
| | | value: 'id', |
| | | label: 'name', |
| | | children: 'children', |
| | | // 判断叶子节点 |
| | | isLeaf: (data, node) => { |
| | | // 如果是第二级节点,则认为是叶子节点 |
| | | return node.level >= 2 |
| | | }, |
| | | }) |
| | | |
| | | // 表单校验规则 |
| | | const rules = { |
| | | areaCode: fieldRules(true), |
| | | implementName: fieldRules(true), |
| | | matterName: fieldRules(true), |
| | | orgCode: fieldRules(true), |
| | | } |
| | | |
| | | // 处理机构变更,同步机构名称 |
| | | function handleOrgChange(value) { |
| | | if (!value) { |
| | | formData.value.orgName = '' |
| | | return |
| | | } |
| | | // 递归查找选中的机构名称 |
| | | const findNode = (nodes, id) => { |
| | | for (const node of nodes) { |
| | | if (node.id === id) { |
| | | return node |
| | | } |
| | | if (node.children?.length) { |
| | | const found = findNode(node.children, id) |
| | | if (found) return found |
| | | } |
| | | } |
| | | return null |
| | | } |
| | | const node = findNode(deptTree.value, value) |
| | | formData.value.orgName = node?.title || '' |
| | | } |
| | | |
| | | // 提交新增/编辑 |
| | | async function handleSubmit() { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | await inventorySubmitApi(formData.value) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | | } |
| | | |
| | | // 加载详情 |
| | | async function loadDetail() { |
| | | if (!formData.value.id) return |
| | | const res = await inventoryDetailApi({ id: formData.value.id }) |
| | | const data = res?.data?.data ?? {} |
| | | // 将 areaCode 转换为字符串类型 |
| | | if (data.areaCode !== undefined) { |
| | | data.areaCode = String(data.areaCode) |
| | | } |
| | | formData.value = data |
| | | |
| | | // 如果是编辑模式,获取区域节点的路径以展开树形选择器 |
| | | if (dialogMode.value === 'edit' && data.areaCode) { |
| | | await loadRegionPath(data.areaCode) |
| | | } |
| | | } |
| | | |
| | | // 加载区域节点路径 |
| | | async function loadRegionPath(areaCode) { |
| | | try { |
| | | const path = [] |
| | | const queue = [{ code: '360800000000', currentPath: ['360800000000'] }] |
| | | let found = false |
| | | |
| | | // 广度优先搜索,逐层加载节点直到找到目标节点 |
| | | while (queue.length > 0 && !found) { |
| | | const { code, currentPath } = queue.shift() |
| | | |
| | | // 获取当前节点的子节点 |
| | | const res = await regionLazyTreeApi({ parentCode: code }) |
| | | const nodes = res?.data?.data || [] |
| | | |
| | | for (const node of nodes) { |
| | | const nodeId = node.id || node.value |
| | | |
| | | // 缓存节点及其父节点关系 |
| | | regionNodeCache.value.set(nodeId, { |
| | | id: nodeId, |
| | | name: node.name || node.title || node.label, |
| | | parentId: code, |
| | | hasChildren: node.hasChildren || false, |
| | | }) |
| | | |
| | | // 检查是否找到目标节点 |
| | | if (nodeId === areaCode) { |
| | | path.push(...currentPath, nodeId) |
| | | found = true |
| | | break |
| | | } |
| | | |
| | | // 如果有子节点,加入队列继续搜索 |
| | | if (node.hasChildren) { |
| | | queue.push({ |
| | | code: nodeId, |
| | | currentPath: [...currentPath, nodeId], |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (path.length > 0) { |
| | | expandedKeys.value = path |
| | | } |
| | | } catch (error) { |
| | | console.error('加载区域路径失败:', error) |
| | | } |
| | | } |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode = 'add', row } = {}) { |
| | | dialogMode.value = mode |
| | | formData.value = dialogMode.value === 'add' ? initForm() : row |
| | | if (dialogMode.value !== 'add') { |
| | | await loadDetail() |
| | | } |
| | | } |
| | | |
| | | // 懒加载获取区域节点数据 |
| | | async function loadRegionNode(node, resolve) { |
| | | try { |
| | | // 限制只加载两级,当前节点 level >= 1 时不加载子节点 |
| | | if (node.level >= 2) { |
| | | resolve([]) |
| | | return |
| | | } |
| | | // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数 |
| | | const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' } |
| | | const parentCode = node.data?.id || '360800000000' |
| | | const res = await regionLazyTreeApi(params) |
| | | const nodes = res?.data?.data || [] |
| | | |
| | | // 处理返回的节点数据 |
| | | const processedNodes = nodes.map(item => { |
| | | const nodeId = item.id || item.value |
| | | // 缓存节点及其父节点关系 |
| | | regionNodeCache.value.set(nodeId, { |
| | | id: nodeId, |
| | | name: item.name || item.title || item.label, |
| | | parentId: parentCode, |
| | | hasChildren: item.hasChildren || false, |
| | | }) |
| | | |
| | | return { |
| | | id: nodeId, |
| | | name: item.name || item.title || item.label, |
| | | hasChildren: item.hasChildren || false, |
| | | } |
| | | }) |
| | | |
| | | resolve(processedNodes) |
| | | } catch (error) { |
| | | console.error('获取区域数据失败:', error) |
| | | resolve([]) |
| | | } |
| | | } |
| | | |
| | | defineExpose({ open }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"></style> |
| | |
| | | <template> |
| | | <div> |
| | | 实施清单 |
| | | </div> |
| | | <basic-container> |
| | | <el-form ref="queryParamsRef" :model="searchParams" class="gd-search-form"> |
| | | <el-form-item label="事项名称" prop="matterName"> |
| | | <el-input |
| | | class="gd-input gray" |
| | | v-model="searchParams.matterName" |
| | | placeholder="请输入" |
| | | clearable |
| | | @clear="handleSearch" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="所属区划" prop="areaCode"> |
| | | <el-tree-select |
| | | class="gd-select gray" |
| | | popper-class="gd-tree-select-popper" |
| | | v-model="searchParams.areaCode" |
| | | node-key="id" |
| | | :props="treeSelectProps" |
| | | placeholder="请选择" |
| | | clearable |
| | | filterable |
| | | @change="handleSearch" |
| | | :check-strictly="true" |
| | | lazy |
| | | :load="loadRegionNode" |
| | | :render-after-expand="false" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item class="gd-search-actions"> |
| | | <el-button :icon="RefreshRight" @click="resetForm"></el-button> |
| | | <el-button class="search-btn" :icon="Search" @click="handleSearch"></el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <div class="gd-table-toolbar"> |
| | | <el-button :icon="Plus" color="#4C34FF" type="primary" @click="openForm('add')">新增</el-button> |
| | | </div> |
| | | |
| | | <div class="gd-table-container" v-loading="loading"> |
| | | <div class="gd-table-content gd-table-content-bg"> |
| | | <el-table class="gd-table" :data="list"> |
| | | <el-table-column label="序号" width="80"> |
| | | <template v-slot="{ $index }"> |
| | | {{ $index + 1 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="areaName" show-overflow-tooltip label="所属区划" /> |
| | | <el-table-column prop="implementName" show-overflow-tooltip label="实施清单名称" /> |
| | | <el-table-column prop="matterName" show-overflow-tooltip label="事项名称" /> |
| | | <el-table-column prop="orgName" show-overflow-tooltip label="所属机构" /> |
| | | <el-table-column label="操作" class-name="operation-btns" width="250"> |
| | | <template v-slot="{ row }"> |
| | | <el-link type="primary" @click="openForm('view', row)">查看</el-link> |
| | | <el-link type="primary" @click="openForm('edit', row)">编辑</el-link> |
| | | <el-link type="primary" @click="handleDelete(row)">删除</el-link> |
| | | <el-link type="primary" @click="openConfigDialog(row)">配置</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <div class="gd-pagination-parent"> |
| | | <el-pagination |
| | | popper-class="gd-select-popper" |
| | | v-model:current-page="searchParams.current" |
| | | v-model:page-size="searchParams.size" |
| | | layout="total, prev, pager, next, sizes" |
| | | :total="total" |
| | | @change="getList" |
| | | /> |
| | | </div> |
| | | </div> |
| | | |
| | | <FormDiaLog ref="dialogRef" @success="getList" v-if="dialogVisible" v-model="dialogVisible" /> |
| | | <ConfigDiaLog ref="configDialogRef" @success="getList" v-if="configDialogVisible" v-model="configDialogVisible" /> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script setup > |
| | | /** |
| | | * @description index |
| | | * @date 2026-02-02 (周一) 09:25:52 |
| | | */ |
| | | defineOptions({ |
| | | name: 'index' |
| | | <script setup> |
| | | import { Search, RefreshRight, Plus } from '@element-plus/icons-vue' |
| | | import { onMounted, ref, provide, nextTick } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | import ConfigDiaLog from './ConfigDiaLog.vue' |
| | | import { inventoryPageApi, inventoryRemoveApi, regionLazyTreeApi, deptTreeApi } from './inventoryApi' |
| | | |
| | | // 初始化查询参数 |
| | | const initSearchParams = () => ({ |
| | | matterName: '', // 事项名称 |
| | | areaCode: '', // 所属区划 |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | }) |
| | | |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const total = ref(0) // 总条数 |
| | | const loading = ref(true) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | | const queryParamsRef = ref(null) // 查询表单实例 |
| | | const dialogRef = ref(null) // 弹框实例 |
| | | const dialogVisible = ref(false) // 新增/编辑弹框显隐 |
| | | const configDialogRef = ref(null) // 配置弹框实例 |
| | | const configDialogVisible = ref(false) // 配置弹框显隐 |
| | | const dictObj = ref({}) // 字典对象 |
| | | const deptTree = ref([]) // 部门树数据 |
| | | |
| | | // 树形选择器配置 |
| | | const treeSelectProps = { |
| | | value: 'id', |
| | | label: 'name', |
| | | children: 'children', |
| | | // 添加isLeaf配置,告诉组件如何判断叶子节点 |
| | | isLeaf: (data, node) => { |
| | | return data.leaf === true |
| | | }, |
| | | } |
| | | |
| | | // 部门树配置 |
| | | const treeProps = { |
| | | value: 'id', |
| | | label: 'title', |
| | | children: 'children', |
| | | } |
| | | |
| | | // 注入到子组件 |
| | | provide('dictObj', dictObj) |
| | | provide('deptTree', deptTree) |
| | | provide('treeProps', treeProps) |
| | | |
| | | // 懒加载获取区域节点数据 |
| | | async function loadRegionNode(node, resolve) { |
| | | try { |
| | | // 限制只加载两级,当前节点 level >= 1 时不加载子节点 |
| | | if (node.level >= 2) { |
| | | resolve([]) |
| | | return |
| | | } |
| | | |
| | | // 初始化加载时传递 code 参数,加载子节点时传递 parentCode 参数 |
| | | const params = node.data?.id ? { parentCode: node.data.id } : { code: '360800000000' } |
| | | const res = await regionLazyTreeApi(params) |
| | | const nodes = res?.data?.data || [] |
| | | |
| | | // 处理返回的节点数据 |
| | | const processedNodes = nodes.map(item => { |
| | | // 判断是否为叶子节点:如果是第二级(node.level === 1)则为叶子节点 |
| | | const isLeaf = node.level === 1 |
| | | |
| | | return { |
| | | id: item.id || item.value, |
| | | name: item.name || item.title || item.label, |
| | | hasChildren: item.hasChildren || false, |
| | | // 关键:设置leaf属性,告知Tree组件该节点是否为叶子节点 |
| | | leaf: isLeaf, |
| | | } |
| | | }) |
| | | |
| | | resolve(processedNodes) |
| | | } catch (error) { |
| | | console.error('获取区域数据失败:', error) |
| | | resolve([]) |
| | | } |
| | | } |
| | | |
| | | // 获取部门树数据 |
| | | async function getDeptTree() { |
| | | try { |
| | | const res = await deptTreeApi() |
| | | deptTree.value = res?.data?.data || [] |
| | | } catch (error) { |
| | | console.error('获取部门树失败:', error) |
| | | } |
| | | } |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const res = await inventoryPageApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | // 查询 |
| | | function handleSearch() { |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 重置查询 |
| | | function resetForm() { |
| | | queryParamsRef.value?.resetFields() |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 新增/编辑/查看 弹框 |
| | | function openForm(mode, row) { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | dialogRef.value?.open({ mode, row }) |
| | | }) |
| | | } |
| | | |
| | | // 打开配置弹框 |
| | | function openConfigDialog(row) { |
| | | configDialogVisible.value = true |
| | | nextTick(() => { |
| | | configDialogRef.value?.open({ row }) |
| | | }) |
| | | } |
| | | |
| | | // 删除 |
| | | async function handleDelete(row) { |
| | | await ElMessageBox.confirm('确认删除该条记录吗?', '提示', { |
| | | type: 'warning', |
| | | customClass: 'gd-confirm-custom', |
| | | confirmButtonClass: 'gd-confirm-button', |
| | | cancelButtonClass: 'gd-confirm-cancel-button', |
| | | }) |
| | | await inventoryRemoveApi({ ids: row.id }) |
| | | ElMessage.success('删除成功') |
| | | getList() |
| | | } |
| | | |
| | | onMounted(() => { |
| | | getDeptTree() |
| | | getList() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped > |
| | | </style> |
| | | <style scoped lang="scss"></style> |
| New file |
| | |
| | | import request from '@/axios' |
| | | |
| | | // 分页查询实施清单列表 |
| | | export const inventoryPageApi = params => { |
| | | return request({ |
| | | url: `/drone-gd/implement/gdImplementList/page`, |
| | | method: 'get', |
| | | params: { ...params }, |
| | | }) |
| | | } |
| | | |
| | | // 获取实施清单详情 |
| | | export const inventoryDetailApi = params => { |
| | | return request({ |
| | | url: `/drone-gd/implement/gdImplementList/detail`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 新增或编辑实施清单 |
| | | export const inventorySubmitApi = data => { |
| | | return request({ |
| | | url: `/drone-gd/implement/gdImplementList/submit`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | // 删除实施清单 |
| | | export const inventoryRemoveApi = params => { |
| | | return request({ |
| | | url: `/drone-gd/implement/gdImplementList/remove`, |
| | | method: 'post', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 获取配置详情(材料关联、流程关联) |
| | | export const getConfigDetailApi = params => { |
| | | return request({ |
| | | url: `/drone-gd/implement/gdImplementList/getThingListMaterialRelation`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 保存配置(材料关联、流程关联) |
| | | export const saveConfigApi = data => { |
| | | return request({ |
| | | url: `/drone-gd/implement/gdImplementList/thingListMaterialRelation`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | // 懒加载区域树 |
| | | export const regionLazyTreeApi = params => { |
| | | return request({ |
| | | url: `/blade-system/region/lazy-tree`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 获取部门树列表 |
| | | export const deptTreeApi = params => { |
| | | return request({ |
| | | url: `/blade-system/dept/tree`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |
| | | |
| | | |
| | | |
| | | |
| | | ## 查询配置实施清单-材料关联、流程关联 |
| | | |
| | | |
| | | **接口地址**:`/drone-gd/implement/gdImplementList/getThingListMaterialRelation` |
| | | |
| | | |
| | | **请求方式**:`GET` |
| | | |
| | | |
| | | **请求数据类型**:`application/x-www-form-urlencoded` |
| | | |
| | | |
| | | **响应数据类型**:`*/*` |
| | | |
| | | |
| | | **接口描述**:<p>传入gdImplementList</p> |
| | | |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | |
| | | | -------- | -------- | ----- | -------- | -------- | ------ | |
| | | |id|主键|query|true|integer(int64)|| |
| | | |
| | | |
| | | **响应状态**: |
| | | |
| | | |
| | | | 状态码 | 说明 | schema | |
| | | | -------- | -------- | ----- | |
| | | |200|OK|R«GetThingListMaterialRelationVO»| |
| | | |401|Unauthorized|| |
| | | |403|Forbidden|| |
| | | |404|Not Found|| |
| | | |
| | | |
| | | **响应参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 类型 | schema | |
| | | | -------- | -------- | ----- |----- | |
| | | |code|状态码|integer(int32)|integer(int32)| |
| | | |data|承载数据|GetThingListMaterialRelationVO|GetThingListMaterialRelationVO| |
| | | |  implementListId|关联实施清单ID|integer(int64)|| |
| | | |  processDefinitionId|流程定义主键|string|| |
| | | |  processInstanceId|流程实例主键|string|| |
| | | |  thingListMaterialRels|实施清单-材料关联表(情形化配置)|array|GdThingListMaterialRel对象| |
| | | |    createDept|创建部门|integer|| |
| | | |    createTime|创建时间|string|| |
| | | |    createUser|创建人|integer|| |
| | | |    id|主键id|integer|| |
| | | |    implementListId|关联实施清单ID|integer|| |
| | | |    isDeleted|是否已删除|integer|| |
| | | |    materialId|关联材料ID|integer|| |
| | | |    scenarioConfig|材料情形化配置:{"scenario_name":"情形1","is_need":1,"remark":"仅情形1需提供"}|string|| |
| | | |    sort|材料序号(列表展示字段)|integer|| |
| | | |    status|业务状态|integer|| |
| | | |    updateTime|更新时间|string|| |
| | | |    updateUser|更新人|integer|| |
| | | |msg|返回消息|string|| |
| | | |success|是否成功|boolean|| |
| | | |
| | | |
| | | **响应示例**: |
| | | ```javascript |
| | | { |
| | | "code": 0, |
| | | "data": { |
| | | "implementListId": 0, |
| | | "processDefinitionId": "", |
| | | "processInstanceId": "", |
| | | "thingListMaterialRels": [ |
| | | { |
| | | "createDept": 0, |
| | | "createTime": "", |
| | | "createUser": 0, |
| | | "id": 0, |
| | | "implementListId": 0, |
| | | "isDeleted": 0, |
| | | "materialId": 0, |
| | | "scenarioConfig": "", |
| | | "sort": 0, |
| | | "status": 0, |
| | | "updateTime": "", |
| | | "updateUser": 0 |
| | | } |
| | | ] |
| | | }, |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |
| | | |
| | | |
| | | |
| | | ## 配置实施清单-材料关联、流程关联 |
| | | |
| | | |
| | | **接口地址**:`/drone-gd/implement/gdImplementList/thingListMaterialRelation` |
| | | |
| | | |
| | | **请求方式**:`POST` |
| | | |
| | | |
| | | **请求数据类型**:`application/json` |
| | | |
| | | |
| | | **响应数据类型**:`*/*` |
| | | |
| | | |
| | | **接口描述**:<p>传入gdImplementList</p> |
| | | |
| | | |
| | | |
| | | **请求示例**: |
| | | |
| | | |
| | | ```javascript |
| | | { |
| | | "implementListId": 0, |
| | | "materialIds": [], |
| | | "processDefinitionId": "", |
| | | "processInstanceId": "" |
| | | } |
| | | ``` |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | |
| | | | -------- | -------- | ----- | -------- | -------- | ------ | |
| | | |param|param|body|true|ThingListMaterialRelationParam|ThingListMaterialRelationParam| |
| | | |  implementListId|关联实施清单ID||false|integer(int64)|| |
| | | |  materialIds|关联材料ids||false|array|integer(int64)| |
| | | |  processDefinitionId|流程定义主键||false|string|| |
| | | |  processInstanceId|流程实例主键||false|string|| |
| | | |
| | | |
| | | **响应状态**: |
| | | |
| | | |
| | | | 状态码 | 说明 | schema | |
| | | | -------- | -------- | ----- | |
| | | |200|OK|R«boolean»| |
| | | |201|Created|| |
| | | |401|Unauthorized|| |
| | | |403|Forbidden|| |
| | | |404|Not Found|| |
| | | |
| | | |
| | | **响应参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 类型 | schema | |
| | | | -------- | -------- | ----- |----- | |
| | | |code|状态码|integer(int32)|integer(int32)| |
| | | |data|承载数据|boolean|| |
| | | |msg|返回消息|string|| |
| | | |success|是否成功|boolean|| |
| | | |
| | | |
| | | **响应示例**: |
| | | ```javascript |
| | | { |
| | | "code": 0, |
| | | "data": true, |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |