|
@@ -0,0 +1,411 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <ibps-layout ref="layout">
|
|
|
|
|
+ <div slot="west">
|
|
|
|
|
+ <ibps-type-tree
|
|
|
|
|
+ :width="width"
|
|
|
|
|
+ :height="height"
|
|
|
|
|
+ :category-key="categoryKey"
|
|
|
|
|
+ :has-permission="true"
|
|
|
|
|
+ @refresh="refresh"
|
|
|
|
|
+ @node-click="handleNodeClick"
|
|
|
|
|
+ @expand-collapse="handleExpandCollapse"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <ibps-container :margin-left="width + 'px'" class="page">
|
|
|
|
|
+ <template-list
|
|
|
|
|
+ :template-id="templateId"
|
|
|
|
|
+ :dynamic-params="dynamicParams"
|
|
|
|
|
+ />
|
|
|
|
|
+ </ibps-container>
|
|
|
|
|
+ </ibps-layout>
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import ActionUtils from '@/utils/action'
|
|
|
|
|
+import FixHeight from '@/mixins/height'
|
|
|
|
|
+import TemplateList from '@/views/platform/data/dataTemplate/template-list.vue'
|
|
|
|
|
+import { queryPaperOpRecod, removePaperOpRecod } from '@/api/business/general'
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ TemplateList,
|
|
|
|
|
+ IbpsTypeTree: () => import('./left-tree.vue')
|
|
|
|
|
+ },
|
|
|
|
|
+ provide() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ registerGrandChildMethod: (method) => {
|
|
|
|
|
+ this.grandChildMethod = method
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mixins: [FixHeight],
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const {
|
|
|
|
|
+ userId,
|
|
|
|
|
+ isSuper,
|
|
|
|
|
+ role,
|
|
|
|
|
+ deptList = [],
|
|
|
|
|
+ userList = []
|
|
|
|
|
+ } = this.$store.getters || {}
|
|
|
|
|
+ const { first, second } = this.$store.getters.level || {}
|
|
|
|
|
+ const hasRole = localStorage.getItem('hasHighRole') === '1'
|
|
|
|
|
+ const userOption = userList.map((item) => ({
|
|
|
|
|
+ label: item.userName,
|
|
|
|
|
+ value: item.userId
|
|
|
|
|
+ }))
|
|
|
|
|
+ const deptOption = deptList.map((item) => ({
|
|
|
|
|
+ label: item.positionName,
|
|
|
|
|
+ value: item.positionId
|
|
|
|
|
+ }))
|
|
|
|
|
+ const roleList = ['xtgljs', 'wjglzzc', 'wjgly']
|
|
|
|
|
+ const hasEditRole = role.some((item) => roleList.includes(item.alias))
|
|
|
|
|
+ const filterOption = [
|
|
|
|
|
+ {
|
|
|
|
|
+ descVal: '2',
|
|
|
|
|
+ includeSub: true,
|
|
|
|
|
+ old: 'position',
|
|
|
|
|
+ partyId: this.$store.getters.userInfo.employee.positions,
|
|
|
|
|
+ partyName: '',
|
|
|
|
|
+ scriptContent: '',
|
|
|
|
|
+ type: 'user',
|
|
|
|
|
+ userType: 'position'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ return {
|
|
|
|
|
+ grandChildMethod: null,
|
|
|
|
|
+ userId,
|
|
|
|
|
+ isSuper,
|
|
|
|
|
+ hasRole,
|
|
|
|
|
+ userOption,
|
|
|
|
|
+ deptOption,
|
|
|
|
|
+ filterOption,
|
|
|
|
|
+ level: second || first,
|
|
|
|
|
+ width: 210,
|
|
|
|
|
+ typeId: null,
|
|
|
|
|
+ allSelectedNodeId: [],
|
|
|
|
|
+ height: document.clientHeight,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ filterText: '',
|
|
|
|
|
+ categoryKey: 'FLOW_TYPE',
|
|
|
|
|
+ pkKey: 'id', // 主键 如果主键不是pk需要传主键
|
|
|
|
|
+ defId: '1072813170935988224', // 以往体系运行记录流程ID
|
|
|
|
|
+ formKey: 'ywyxjlb', // 以往体系运行记录表单
|
|
|
|
|
+ dialogFormVisible: false,
|
|
|
|
|
+ pkValue: '',
|
|
|
|
|
+ addDataCont: {},
|
|
|
|
|
+ templateKey: 'ywyxjlsc',
|
|
|
|
|
+ tableTitle: '',
|
|
|
|
|
+ editDialogVisible: false,
|
|
|
|
|
+ dynamicParams: {},
|
|
|
|
|
+ templateId: '',
|
|
|
|
|
+ editToolbars: [
|
|
|
|
|
+ {
|
|
|
|
|
+ button_type: 'close',
|
|
|
|
|
+ label: '关闭',
|
|
|
|
|
+ key: 'close'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ button_type: 'save',
|
|
|
|
|
+ label: '保存',
|
|
|
|
|
+ key: 'save'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ listData: [],
|
|
|
|
|
+ searchParams: {
|
|
|
|
|
+ dept: '',
|
|
|
|
|
+ submitBy: ''
|
|
|
|
|
+ },
|
|
|
|
|
+ hasEditRole,
|
|
|
|
|
+ listConfig: {
|
|
|
|
|
+ // 工具栏
|
|
|
|
|
+ toolbars: [{ key: 'search' }, { key: 'add' }, { key: 'remove' }],
|
|
|
|
|
+ // 查询条件
|
|
|
|
|
+ searchForm: {
|
|
|
|
|
+ forms: [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // prop: 'Q^nian_du_^SL',
|
|
|
|
|
+ // label: '记录月份',
|
|
|
|
|
+ // fieldType: 'date',
|
|
|
|
|
+ // dateType: 'month',
|
|
|
|
|
+ // dateFormat: 'yyyy-MM',
|
|
|
|
|
+ // itemWidth: 150
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // prop: 'bian_zhi_bu_men_',
|
|
|
|
|
+ // label: '部门',
|
|
|
|
|
+ // fieldType: 'slot',
|
|
|
|
|
+ // slotName: 'dept',
|
|
|
|
|
+ // itemWidth: 120
|
|
|
|
|
+ // },
|
|
|
|
|
+ { prop: 'Q^biao_dan_ming_che^SL', label: '表单名称', width: 150 }
|
|
|
|
|
+ // { prop: 'Q^shi_wu_shuo_ming_^SL', label: '事务说明', width: 150 },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // prop: ['Q^bian_zhi_shi_jian^DL', 'Q^bian_zhi_shi_jian^DG'],
|
|
|
|
|
+ // label: '上传时间',
|
|
|
|
|
+ // fieldType: 'daterange'
|
|
|
|
|
+ // },
|
|
|
|
|
+ // {
|
|
|
|
|
+ // prop: 'bian_zhi_ren_',
|
|
|
|
|
+ // label: '上传人',
|
|
|
|
|
+ // fieldType: 'slot',
|
|
|
|
|
+ // slotName: 'user'
|
|
|
|
|
+ // }
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ // 表格字段配置
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ // { prop: 'fenLei', label: '表单分类', width: 120 },
|
|
|
|
|
+ { prop: '', label: '条款号', width: 100 },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'bianZhiBuMen',
|
|
|
|
|
+ label: '条款简称',
|
|
|
|
|
+ tags: deptOption,
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ sortable: true
|
|
|
|
|
+ },
|
|
|
|
|
+ { prop: 'biaoDanMingChe', label: '表单名称', width: 200 },
|
|
|
|
|
+ { prop: 'fuJian', label: '超链接', slotName: 'file', minWidth: 250 }
|
|
|
|
|
+ ],
|
|
|
|
|
+ rowHandle: {
|
|
|
|
|
+ effect: 'display',
|
|
|
|
|
+ actions: [
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'edit',
|
|
|
|
|
+ label: '编辑',
|
|
|
|
|
+ type: 'primary',
|
|
|
|
|
+ icon: 'ibps-icon-edit',
|
|
|
|
|
+ hidden: function () {
|
|
|
|
|
+ return !hasEditRole
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ pagination: {},
|
|
|
|
|
+ sorts: {},
|
|
|
|
|
+ pageKey: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ filterText(val) {
|
|
|
|
|
+ this.$refs.tree.filter(val)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.pageKey = this.$route?.meta?.name
|
|
|
|
|
+ this.templateId = this.pageKey.split('_')[1] || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ // mounted() {
|
|
|
|
|
+ // this.loadData()
|
|
|
|
|
+ // },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ refresh() {
|
|
|
|
|
+ this.typeId = ''
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ handleExpandCollapse(isExpand, readonly = false) {
|
|
|
|
|
+ this.width = isExpand ? 200 : 50
|
|
|
|
|
+ },
|
|
|
|
|
+ search() {
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ loadData() {
|
|
|
|
|
+ if (this.grandChildMethod) {
|
|
|
|
|
+ this.grandChildMethod(this.addDataCont)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ handleNodeClick(nodeId, nodeData, treeDatas) {
|
|
|
|
|
+ // 避免重复请求
|
|
|
|
|
+ if (this.typeId === nodeId) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 文件控制-纸质运行记录上传页面,无下级菜单且无添加按钮时显示添加按钮(仅对纸质运行记录上传列表生效)
|
|
|
|
|
+ if (this.pageKey === 'ywyxjlsc') {
|
|
|
|
|
+ const noChildren = !nodeData.children?.length
|
|
|
|
|
+ const hasAddBtn = this.listConfig.toolbars.some(
|
|
|
|
|
+ (el) => el.key === 'add'
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ if (!noChildren && hasAddBtn) {
|
|
|
|
|
+ // 有下级菜单时,去除添加按钮
|
|
|
|
|
+ this.listConfig.toolbars = this.listConfig.toolbars.filter(
|
|
|
|
|
+ (el) => el.key !== 'add'
|
|
|
|
|
+ )
|
|
|
|
|
+ } else if (noChildren && !hasAddBtn && this.depth !== 0) {
|
|
|
|
|
+ // 无下级菜单且无添加按钮时,显示添加按钮(排除非根节点)
|
|
|
|
|
+ this.listConfig.toolbars.splice(1, 0, { key: 'add' })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const result = this.getTail(nodeData)
|
|
|
|
|
+ // 获取所选节点及所有子节点ID
|
|
|
|
|
+ this.allSelectedNodeId = result.map((i) => i.id)
|
|
|
|
|
+ this.typeId = nodeId
|
|
|
|
|
+ this.addDataCont = {
|
|
|
|
|
+ ...nodeData,
|
|
|
|
|
+ allSelectedNodeId: this.allSelectedNodeId
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 递归获取所有子节点
|
|
|
|
|
+ */
|
|
|
|
|
+ getTail(node) {
|
|
|
|
|
+ const result = [node] // 将自身信息添加到结果中
|
|
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
|
|
+ // 如果有子节点,则递归获取子节点的信息
|
|
|
|
|
+ node.children.forEach((child) => {
|
|
|
|
|
+ result.push(...this.getTail(child)) // 将子节点信息添加到结果中
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ return result
|
|
|
|
|
+ },
|
|
|
|
|
+ closeHandle(v) {
|
|
|
|
|
+ this.dialogFormVisible = v
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ editClose(v) {
|
|
|
|
|
+ this.editDialogVisible = v
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取格式化参数
|
|
|
|
|
+ */
|
|
|
|
|
+ getSearchFormData() {
|
|
|
|
|
+ const params = this.$refs['crud']
|
|
|
|
|
+ ? this.$refs['crud'].getSearcFormData()
|
|
|
|
|
+ : {}
|
|
|
|
|
+ params['Q^di_dian_^S'] = this.level
|
|
|
|
|
+ if (this.$utils.isNotEmpty(this.typeId)) {
|
|
|
|
|
+ params['Q^fen_lei_id_^S'] = this.allSelectedNodeId
|
|
|
|
|
+ }
|
|
|
|
|
+ const { dept, submitBy } = this.searchParams
|
|
|
|
|
+ if (this.$utils.isNotEmpty(dept)) {
|
|
|
|
|
+ params[`Q^bian_zhi_bu_men_^S`] = dept.split(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.$utils.isNotEmpty(submitBy)) {
|
|
|
|
|
+ params[`Q^bian_zhi_ren_^S`] = submitBy.split(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ if (params['Q^nian_du_^SL']) {
|
|
|
|
|
+ params[`Q^nian_du_^SL`] = this.$common.getFormatDate(
|
|
|
|
|
+ 'string',
|
|
|
|
|
+ 7,
|
|
|
|
|
+ params[`Q^nian_du_^SL`]
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ // console.log(params)
|
|
|
|
|
+ const result = {
|
|
|
|
|
+ parameters: this.formatParameters(params),
|
|
|
|
|
+ ...ActionUtils.formatParams(null, this.pagination, this.sorts)
|
|
|
|
|
+ }
|
|
|
|
|
+ return result
|
|
|
|
|
+ },
|
|
|
|
|
+ formatParameters(data) {
|
|
|
|
|
+ if (this.$utils.isEmpty(data)) {
|
|
|
|
|
+ return []
|
|
|
|
|
+ }
|
|
|
|
|
+ const parameters = Object.entries(data).map(([key, value]) =>
|
|
|
|
|
+ Array.isArray(value)
|
|
|
|
|
+ ? {
|
|
|
|
|
+ relation: 'OR',
|
|
|
|
|
+ parameters: value.map((v) => ({
|
|
|
|
|
+ key,
|
|
|
|
|
+ value: v,
|
|
|
|
|
+ param: this.$utils.guid()
|
|
|
|
|
+ }))
|
|
|
|
|
+ }
|
|
|
|
|
+ : { key, value }
|
|
|
|
|
+ )
|
|
|
|
|
+ return parameters.length === 1
|
|
|
|
|
+ ? [parameters[0]]
|
|
|
|
|
+ : [{ relation: 'AND', parameters }]
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理按钮事件
|
|
|
|
|
+ */
|
|
|
|
|
+ handleAction(command, position, selection, data, index, button) {
|
|
|
|
|
+ switch (command) {
|
|
|
|
|
+ case 'search': // 查询
|
|
|
|
|
+ ActionUtils.setFirstPagination(this.pagination)
|
|
|
|
|
+ this.search()
|
|
|
|
|
+ break
|
|
|
|
|
+ case 'remove':
|
|
|
|
|
+ console.log(selection, data)
|
|
|
|
|
+ this.handleRemove(selection)
|
|
|
|
|
+ break
|
|
|
|
|
+ case 'add': // 添加
|
|
|
|
|
+ this.dialogFormVisible = true
|
|
|
|
|
+ this.pkValue = ''
|
|
|
|
|
+ break
|
|
|
|
|
+ case 'edit': // 编辑
|
|
|
|
|
+ this.editDialogVisible = true
|
|
|
|
|
+ this.pkValue = data.id
|
|
|
|
|
+ break
|
|
|
|
|
+ default:
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除记录
|
|
|
|
|
+ */
|
|
|
|
|
+ handleRemove(ids) {
|
|
|
|
|
+ if (!ids || !ids.length) {
|
|
|
|
|
+ return this.$message.warning('请选择要删除的数据!')
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$confirm(
|
|
|
|
|
+ `将删除所选中的 ${ids.length} 条数据,数据删除后无法恢复,确定要继续吗?`,
|
|
|
|
|
+ '提示',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确认',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ showClose: false,
|
|
|
|
|
+ closeOnClickModal: false
|
|
|
|
|
+ }
|
|
|
|
|
+ ).then(() => {
|
|
|
|
|
+ removePaperOpRecod({ ids: ids.join(',') })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ ActionUtils.removeSuccessMessage()
|
|
|
|
|
+ this.search()
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {})
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理分页事件
|
|
|
|
|
+ */
|
|
|
|
|
+ handlePaginationChange(page) {
|
|
|
|
|
+ ActionUtils.setPagination(this.pagination, page)
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 处理排序
|
|
|
|
|
+ */
|
|
|
|
|
+ handleSortChange(sort) {
|
|
|
|
|
+ // 处理字段长度,可能出现排序字段与数据库字段不一致情况
|
|
|
|
|
+ sort.sortBy = sort.sortBy.slice(0, 17)
|
|
|
|
|
+ ActionUtils.setSorts(this.sorts, sort)
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
|
+.title {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ margin: 21px 5px 5px;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .el-tree-node__content {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .el-form-item__label {
|
|
|
|
|
+ text-align: left;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/ .el-dialog__footer {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|