|
@@ -0,0 +1,633 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div :class="{'ibps-fixed-toolbar':checkMode}">
|
|
|
|
|
+ <van-sticky>
|
|
|
|
|
+ <van-nav-bar
|
|
|
|
|
+ :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
|
|
|
|
|
+ :left-text="$t('common.button.back')"
|
|
|
|
|
+ left-arrow
|
|
|
|
|
+ @click-left="$router.push({ name: 'dashboard' })"
|
|
|
|
|
+ @click-right="toCheckMode()"
|
|
|
|
|
+ />
|
|
|
|
|
+ <van-search v-model="subject" show-action placeholder="请输入搜索关键词" @search="onSearch">
|
|
|
|
|
+ <template #left>
|
|
|
|
|
+ <van-icon
|
|
|
|
|
+ name="bars"
|
|
|
|
|
+ :class="{'ibps-active':$utils.isNotEmpty(typeId)}"
|
|
|
|
|
+ class="ibps-pr-5"
|
|
|
|
|
+ @click="clickType"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #action>
|
|
|
|
|
+ <!-- <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" /> -->
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </van-search>
|
|
|
|
|
+ </van-sticky>
|
|
|
|
|
+ <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
|
|
|
+ <van-list v-model="loading" :finished="finished" @load="loadData">
|
|
|
|
|
+ <van-checkbox-group v-model="checkedIds">
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ v-for="(item,index) in listData"
|
|
|
|
|
+ :key="item.id+index"
|
|
|
|
|
+ :title="item.wen_jian_ming_che"
|
|
|
|
|
+ @click="onClick(item,index)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot="icon">
|
|
|
|
|
+ <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.id" class="ibps-mr-10" />
|
|
|
|
|
+ <ibps-avatar
|
|
|
|
|
+ v-else
|
|
|
|
|
+ :icon="_randomIcon(index)"
|
|
|
|
|
+ :text="item.name"
|
|
|
|
|
+ :bg-color="_randomColor(index)"
|
|
|
|
|
+ radius="4"
|
|
|
|
|
+ icon-prefix="ibps-icon"
|
|
|
|
|
+ class="ibps-mr-10"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #label>
|
|
|
|
|
+ <van-row>
|
|
|
|
|
+ <van-col span="8">文件编号/版本</van-col>
|
|
|
|
|
+ <van-col span="16">{{ item.wen_jian_bian_hao==''?'/':item.wen_jian_bian_hao==null?'/':item.wen_jian_bian_hao==undefined?'/':item.wen_jian_bian_hao }}-{{ item.ban_ben_==''?'/':item.ban_ben_==null?'/':item.ban_ben_==undefined?'/':item.ban_ben_ }}</van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ <van-row>
|
|
|
|
|
+ <van-col span="8">文件类型</van-col>
|
|
|
|
|
+ <van-col span="16">{{ item.wen_jian_xi_lei_===''?'/':item.wen_jian_xi_lei_===null?'/':item.wen_jian_xi_lei_===undefined?'/':item.wen_jian_xi_lei_ }}</van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ <van-row>
|
|
|
|
|
+ <van-col span="8">发布时间</van-col>
|
|
|
|
|
+ <van-col span="16">{{ item.fa_fang_shi_jian_===''?'/':item.fa_fang_shi_jian_===null?'/':item.fa_fang_shi_jian_===undefined?'/':item.fa_fang_shi_jian_ }}</van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ <!-- <van-row> -->
|
|
|
|
|
+ <!-- <van-col span="12">附件</van-col>
|
|
|
|
|
+ <van-col span="12">{{ item.fu_jian_===''?'/':item.fu_jian_===null?'/':item.fu_jian_===undefined?'/':item.fu_jian_ }}</van-col> -->
|
|
|
|
|
+ <!-- </van-row> -->
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <!-- <span>{{ item.createTime|formatRelativeTime }}</span> -->
|
|
|
|
|
+ <!-- <div>
|
|
|
|
|
+ <van-tag
|
|
|
|
|
+ size="medium"
|
|
|
|
|
+ :color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'color','type')"
|
|
|
|
|
+ :text-color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'textColor','type')"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.status| optionsFilter(bpmnStatusOptions) }}</van-tag>
|
|
|
|
|
+ </div> -->
|
|
|
|
|
+ </van-cell>
|
|
|
|
|
+ </van-checkbox-group>
|
|
|
|
|
+ <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
|
|
|
|
|
+ </van-list>
|
|
|
|
|
+ </van-pull-refresh>
|
|
|
|
|
+
|
|
|
|
|
+ <ibps-toolbar v-show="checkMode" :actions="mainActions" />
|
|
|
|
|
+
|
|
|
|
|
+ <ibps-more-search
|
|
|
|
|
+ :show="moreSearchPopup"
|
|
|
|
|
+ :search-forms="searchForms"
|
|
|
|
|
+ @callback="onMoreSearch"
|
|
|
|
|
+ @close="show => moreSearchPopup = show"
|
|
|
|
|
+ @reset-form="resetForm"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <ibps-type-tree
|
|
|
|
|
+ ref="typeTree"
|
|
|
|
|
+ v-model="typeTreePopup"
|
|
|
|
|
+ title="文件分类"
|
|
|
|
|
+ category-key="FILE_TYPE"
|
|
|
|
|
+ @node-click="clickTypeNode"
|
|
|
|
|
+ @close="visible => typeTreePopup = visible"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <ibps-bpmn-formrender-dialog
|
|
|
|
|
+ :visible="formrenderVisible"
|
|
|
|
|
+ :title="formrenderTitle"
|
|
|
|
|
+ :pro-inst-id="proInstId"
|
|
|
|
|
+ :def-id="defId"
|
|
|
|
|
+ @close="visible => formrenderVisible = visible"
|
|
|
|
|
+ @callback="onSearch"
|
|
|
|
|
+ />
|
|
|
|
|
+ <van-divider v-if="footText">到底了~</van-divider>
|
|
|
|
|
+ <van-empty v-if="noData" description="暂无数据" />
|
|
|
|
|
+ <van-popup v-model="documentsSon" position="bottom" :style="{height:'100%',width:'100%'}">
|
|
|
|
|
+ <LookDocument :son-data="sonData" @son="son" />
|
|
|
|
|
+ </van-popup>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+</template>
|
|
|
|
|
+<script>
|
|
|
|
|
+import { myDraft, removeDraft } from '@/api/platform/office/bpmInitiated'
|
|
|
|
|
+import curdPost from '@/utils/joinCURD.js'
|
|
|
|
|
+import ActionUtils from '@/utils/action'
|
|
|
|
|
+import i18n from '@/utils/i18n'
|
|
|
|
|
+import random from '@/mixins/random'
|
|
|
|
|
+import bpmnStatus from '@/mixins/bpmnStatus'
|
|
|
|
|
+
|
|
|
|
|
+import IbpsMoreSearch from '@/components/ibps-more-search'
|
|
|
|
|
+import IbpsTypeTree from '@/business/platform/cat/type/tree'
|
|
|
|
|
+import IbpsAvatar from '@/components/ibps-avatar'
|
|
|
|
|
+import IbpsToolbar from '@/components/ibps-toolbar'
|
|
|
|
|
+import IbpsListResultPage from '@/components/ibps-list-result-page'
|
|
|
|
|
+import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
|
|
|
|
|
+import LookDocument from './lookDocument'
|
|
|
|
|
+const _ = require('lodash')
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ IbpsMoreSearch,
|
|
|
|
|
+ IbpsTypeTree,
|
|
|
|
|
+ IbpsAvatar,
|
|
|
|
|
+ IbpsToolbar,
|
|
|
|
|
+ IbpsListResultPage,
|
|
|
|
|
+ IbpsBpmnFormrenderDialog,
|
|
|
|
|
+ LookDocument
|
|
|
|
|
+ },
|
|
|
|
|
+ mixins: [random, bpmnStatus],
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const { userId, userList = [], deptList, menus, userInfo, role } = this.$store.getters
|
|
|
|
|
+ const depArrs = []
|
|
|
|
|
+ var fileDownloadAuthority = false
|
|
|
|
|
+ for (var i of deptList) {
|
|
|
|
|
+ depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
|
|
|
|
|
+ }
|
|
|
|
|
+ const roleKey = ['xtgljs', 'syszr', 'dagly', 'xxgljs']
|
|
|
|
|
+ for (const i of roleKey) {
|
|
|
|
|
+ if (role.some(so => { return so.alias === i })) {
|
|
|
|
|
+ fileDownloadAuthority = true
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return {
|
|
|
|
|
+ documentsSon: false,
|
|
|
|
|
+ sonData: '',
|
|
|
|
|
+ stateActive: false,
|
|
|
|
|
+ moreSearchPopup: false,
|
|
|
|
|
+ typeTreePopup: false,
|
|
|
|
|
+ searchForms: {
|
|
|
|
|
+ forms: [
|
|
|
|
|
+ // { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
|
|
|
|
|
+ { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
|
|
|
|
|
+ { prop: 'Q^subject_^SL', label: '事务说明', fieldType: 'text' },
|
|
|
|
|
+ { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ subject: '',
|
|
|
|
|
+ typeId: '',
|
|
|
|
|
+ moreParams: {},
|
|
|
|
|
+
|
|
|
|
|
+ listData: [],
|
|
|
|
|
+ pagination: {},
|
|
|
|
|
+ sorts: {},
|
|
|
|
|
+
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ finished: false,
|
|
|
|
|
+ refreshing: false,
|
|
|
|
|
+ resultType: 'init',
|
|
|
|
|
+ errorType: null,
|
|
|
|
|
+ resultMessage: null,
|
|
|
|
|
+
|
|
|
|
|
+ checkMode: false,
|
|
|
|
|
+ checkedIds: [],
|
|
|
|
|
+ mainActions: [{
|
|
|
|
|
+ 'name': this.$t('common.button.remove'),
|
|
|
|
|
+ 'type': 'danger',
|
|
|
|
|
+ 'callback': this.onRemove
|
|
|
|
|
+ }],
|
|
|
|
|
+
|
|
|
|
|
+ proInstId: '',
|
|
|
|
|
+ defId: '',
|
|
|
|
|
+ formrenderVisible: false,
|
|
|
|
|
+ formrenderTitle: '',
|
|
|
|
|
+ fileTypesDatas: {
|
|
|
|
|
+ comAuthority: [],
|
|
|
|
|
+ buMenAuthority: [],
|
|
|
|
|
+ authority: []
|
|
|
|
|
+ }, // 存放所点击列表的分类信息
|
|
|
|
|
+ searchWhere: {},
|
|
|
|
|
+ sqlWhere: {},
|
|
|
|
|
+ addDataCont: {},
|
|
|
|
|
+ oldorgId: '',
|
|
|
|
|
+ listConfig: {
|
|
|
|
|
+ // 工具栏
|
|
|
|
|
+ toolbars: [
|
|
|
|
|
+ { key: 'search' },
|
|
|
|
|
+ {
|
|
|
|
|
+ key: 'colect',
|
|
|
|
|
+ label: '收藏或取消收藏',
|
|
|
|
|
+ type: 'success'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 查询条件
|
|
|
|
|
+ searchForm: {
|
|
|
|
|
+ forms: []
|
|
|
|
|
+ },
|
|
|
|
|
+ // 表格字段配置
|
|
|
|
|
+ columns: []
|
|
|
|
|
+ },
|
|
|
|
|
+ pageKey: '',
|
|
|
|
|
+ depArrs,
|
|
|
|
|
+ fileDownloadAuthority,
|
|
|
|
|
+ current: 0,
|
|
|
|
|
+ footText: false,
|
|
|
|
|
+ noData: false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ rightText() {
|
|
|
|
|
+ return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
|
|
|
|
|
+ },
|
|
|
|
|
+ selectedIds() {
|
|
|
|
|
+ return this.checkedIds.join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ const timer = setInterval(() => {
|
|
|
|
|
+ console.log(1111)
|
|
|
|
|
+ if (this.$refs.typeTree && this.$refs.typeTree.treeData[0]) {
|
|
|
|
|
+ this.clickTypeNode(this.$refs.typeTree.treeData[0])
|
|
|
|
|
+ clearInterval(timer)
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 200)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.pageKey = this.$route.name
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ generateTitle(name, title) { // generateTitle by vue-i18n
|
|
|
|
|
+ return i18n.generateTitle(name, title)
|
|
|
|
|
+ },
|
|
|
|
|
+ getData() {
|
|
|
|
|
+ const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
|
|
|
|
|
+ const { fileType, sorts } = this.sqlWhere
|
|
|
|
|
+ // this.listData = []
|
|
|
|
|
+ let wheres1 = '' // 共用
|
|
|
|
|
+ let wheres2 = '' // 部门
|
|
|
|
|
+ let wheres3 = '' // 受限
|
|
|
|
|
+ let start = ''
|
|
|
|
|
+ const positionsDatas = this.$store.getters.userInfo.positions
|
|
|
|
|
+ const needSelType = []
|
|
|
|
|
+ if (this.$store.getters.userInfo.positions === 0) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: '该账户并没有所属部门,请先归属部门再来操作。',
|
|
|
|
|
+ type: 'error'
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ for (var i in this.searchWhere) {
|
|
|
|
|
+ // console.log('i', i)
|
|
|
|
|
+ if (i === 'b') {
|
|
|
|
|
+ start = this.searchWhere[i]
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i === 'i') {
|
|
|
|
|
+ wheres1 = wheres1 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
|
|
|
|
|
+ wheres2 = wheres2 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
|
|
|
|
|
+ wheres3 = wheres3 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
|
|
|
|
|
+ }
|
|
|
|
|
+ if (i !== 'i' && i !== 'b') {
|
|
|
|
|
+ const likeWhere = i === 'nian_du_' ? this.searchWhere[i].getFullYear() : this.searchWhere[i]
|
|
|
|
|
+ wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
|
|
|
|
|
+ wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
|
|
|
|
|
+ wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 一样
|
|
|
|
|
+ if (fileType) {
|
|
|
|
|
+ if (this.pageKey === 'test') {
|
|
|
|
|
+ if (comAuthority.length !== 0) {
|
|
|
|
|
+ wheres1 = wheres1 + ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
|
|
|
|
|
+ }
|
|
|
|
|
+ if (buMenAuthority.length !== 0) {
|
|
|
|
|
+ let orSql = ''
|
|
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
|
|
+ for (const i in positionsDatas) {
|
|
|
|
|
+ if (i === '0') {
|
|
|
|
|
+ orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
|
|
|
|
|
+ } else {
|
|
|
|
|
+ orSql = orSql + `or wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ wheres2 = wheres2 + ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
|
|
|
|
|
+ }
|
|
|
|
|
+ if (authority.length !== 0) {
|
|
|
|
|
+ wheres3 = wheres3 + ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // 没走
|
|
|
|
|
+ if (sorts) {
|
|
|
|
|
+ if (JSON.stringify(sorts) !== '{}') {
|
|
|
|
|
+ wheres1 = wheres1 + ` order by ${sorts.sortBy} ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
|
|
|
|
|
+ wheres2 = wheres2 + ` order by ${sorts.sortBy} ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const selectSql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
|
|
|
|
|
+ wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_, wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
|
|
|
|
|
+ wj.bian_zhi_ren_ AS bian_zhi_ren_,
|
|
|
|
|
+ wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
|
|
|
|
|
+ wj.wen_jian_lei_xing AS wen_jian_lei_xing,
|
|
|
|
|
+ wj.quan_xian_lei_xin AS quan_xian_lei_xin,
|
|
|
|
|
+ wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,
|
|
|
|
|
+ wj.poct_shi_yong_ AS shi_yong_bu_men_,
|
|
|
|
|
+ "" AS cha_yue_jie_zhi_s from`
|
|
|
|
|
+ const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
|
|
|
|
|
+ left join (select id_,parent_id_ from t_wjscjl group by parent_id_) sc on sc.parent_id_ = wj.id_
|
|
|
|
|
+ left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_`
|
|
|
|
|
+ // 内外部文件查阅时候查所有文件
|
|
|
|
|
+ const allSql = ``
|
|
|
|
|
+ // 共用文件
|
|
|
|
|
+ const comSql = `${selectSql} t_wjxxb wj ${leftSql} where wj.shi_fou_guo_shen_ ='有效' AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') and (${this.depArrs.join(' or ')}) ${wheres1} `
|
|
|
|
|
+ // 部门权限文件
|
|
|
|
|
+ const buMenSql = `${selectSql} t_wjxxb wj ${leftSql}
|
|
|
|
|
+ where wj.shi_fou_guo_shen_ in ('有效','使用') AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') ${wheres2} `
|
|
|
|
|
+ // 受限文件:结合查阅授权模块的截止时间
|
|
|
|
|
+ const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
|
|
|
|
|
+ wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_, wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
|
|
|
|
|
+ wj.bian_zhi_ren_ AS bian_zhi_ren_,
|
|
|
|
|
+ wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
|
|
|
|
|
+ wj.wen_jian_lei_xing AS wen_jian_lei_xing,
|
|
|
|
|
+ wj.quan_xian_lei_xin AS quan_xian_lei_xin,
|
|
|
|
|
+ wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,
|
|
|
|
|
+ wj.poct_shi_yong_ AS shi_yong_bu_men_,
|
|
|
|
|
+ sq.cha_yue_jie_zhi_s from
|
|
|
|
|
+ t_wjxxb wj
|
|
|
|
|
+ left join (select *from t_skwjcysqsqzb order by create_time_ desc limit 1) sq on wj.id_=sq.wen_jian_id_
|
|
|
|
|
+ ${leftSql}
|
|
|
|
|
+ WHERE wj.shi_fou_guo_shen_ ='有效' AND(wj.wen_jian_ming_che LIKE '%${this.subject}%') and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
|
|
|
|
|
+ and wj.quan_xian_xin_xi_ like '%${this.userId}%' ${wheres3} `
|
|
|
|
|
+ const sqlArr = [comSql, buMenSql, authoritySql]
|
|
|
|
|
+ let oldRecordSql = ''
|
|
|
|
|
+ const buMenWhere = []
|
|
|
|
|
+ if (this.pageKey !== 'test') {
|
|
|
|
|
+ if (this.$store.getters.deptList.length !== 0) {
|
|
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
|
|
+ for (var i of this.$store.getters.deptList) {
|
|
|
|
|
+ buMenWhere.push(`bian_zhi_bu_men_ like '%${i.positionId}%'`)
|
|
|
|
|
+ }
|
|
|
|
|
+ oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj
|
|
|
|
|
+ left join ibps_party_employee ee on wj.bian_zhi_ren_ = ee.id_
|
|
|
|
|
+ LEFT JOIN ibps_party_entity en ON en.id_= bian_zhi_bu_men_
|
|
|
|
|
+ where (${buMenWhere.join(' or ')}) ${wheres1} order by bian_zhi_shi_jian desc`
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log('没有部门组织')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
|
|
+ for (var i in Object.keys(this.fileTypesDatas)) {
|
|
|
|
|
+ var key = Object.keys(this.fileTypesDatas)[i] // key
|
|
|
|
|
+ var value = this.fileTypesDatas[key] // value
|
|
|
|
|
+ if (value.length !== 0) {
|
|
|
|
|
+ needSelType.push(`(${sqlArr[i]})`)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ const fileSearchSql = needSelType.join('union all')
|
|
|
|
|
+ const sql = this.pageKey === 'test' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC` : oldRecordSql
|
|
|
|
|
+ return fileSearchSql ? sql : ''
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 加载数据
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ loadData() {
|
|
|
|
|
+ let page = 0
|
|
|
|
|
+ if (this.current === 0) {
|
|
|
|
|
+ page = 0
|
|
|
|
|
+ } else {
|
|
|
|
|
+ page = this.current * 10
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ // this.refreshing = false
|
|
|
|
|
+ const sqlPart = this.getData()
|
|
|
|
|
+ if (!sqlPart) return
|
|
|
|
|
+ const sql = sqlPart + ' ' + `LIMIT ${page},10`
|
|
|
|
|
+ curdPost('sql', sql).then(res => {
|
|
|
|
|
+ if (this.current === 0 && res.variables.data.length === 0) {
|
|
|
|
|
+ this.noData = true
|
|
|
|
|
+ this.footText = false
|
|
|
|
|
+ this.finished = true
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.finished = false
|
|
|
|
|
+ const data = res.variables.data
|
|
|
|
|
+ this.listData.push(...data)
|
|
|
|
|
+ this.noData = false
|
|
|
|
|
+ if (this.listData.length !== 0 && (this.listData.length) % 10 !== 0) {
|
|
|
|
|
+ this.footText = true
|
|
|
|
|
+ this.finished = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.current++
|
|
|
|
|
+ }
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ }).catch(e => {
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取格式化参数
|
|
|
|
|
+ */
|
|
|
|
|
+ getSearcFormData() {
|
|
|
|
|
+ let params = {}
|
|
|
|
|
+ if (this.$utils.isNotEmpty(this.subject)) {
|
|
|
|
|
+ params['Q^subject_^SL'] = this.subject
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.$utils.isNotEmpty(this.moreParams)) {
|
|
|
|
|
+ params = Object.assign(params, this.moreParams)
|
|
|
|
|
+ }
|
|
|
|
|
+ return ActionUtils.formatParams(
|
|
|
|
|
+ params,
|
|
|
|
|
+ this.pagination,
|
|
|
|
|
+ this.sorts)
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 下拉刷新
|
|
|
|
|
+ */
|
|
|
|
|
+ onRefresh() {
|
|
|
|
|
+ this.footText = false
|
|
|
|
|
+ this.noData = false
|
|
|
|
|
+ this.refreshing = true
|
|
|
|
|
+ this.finished = false
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ this.onSearch()
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查询
|
|
|
|
|
+ */
|
|
|
|
|
+ onSearch() {
|
|
|
|
|
+ this.stateActive = false
|
|
|
|
|
+ ActionUtils.initListData(this)
|
|
|
|
|
+ this.current = 0
|
|
|
|
|
+ this.listData = []
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 高级查询
|
|
|
|
|
+ */
|
|
|
|
|
+ onMoreSearch(params) {
|
|
|
|
|
+ if (this.$utils.isNotEmpty(this.typeId)) {
|
|
|
|
|
+ params['Q^type_id_^SL'] = this.typeId
|
|
|
|
|
+ }
|
|
|
|
|
+ this.moreParams = params
|
|
|
|
|
+ this.onSearch()
|
|
|
|
|
+ if (this.$utils.isNotEmpty(params)) {
|
|
|
|
|
+ this.stateActive = true
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 弹窗更多查询条件
|
|
|
|
|
+ */
|
|
|
|
|
+ clickMoreSearch() {
|
|
|
|
|
+ this.moreSearchPopup = true
|
|
|
|
|
+ this.stateActive = false
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 重置表单
|
|
|
|
|
+ */
|
|
|
|
|
+ resetForm() {
|
|
|
|
|
+ this.typeId = ''
|
|
|
|
|
+ },
|
|
|
|
|
+ getTaskDesc(v) {
|
|
|
|
|
+ if (!v.includes('#')) {
|
|
|
|
|
+ return ''
|
|
|
|
|
+ }
|
|
|
|
|
+ return v.split('#')[1] || ''
|
|
|
|
|
+ },
|
|
|
|
|
+ // 点击左边显示
|
|
|
|
|
+ clickType() {
|
|
|
|
|
+ this.typeTreePopup = true
|
|
|
|
|
+ },
|
|
|
|
|
+ clickTypeNode(nodeData) {
|
|
|
|
|
+ this.current = 0
|
|
|
|
|
+ // this.listData = []
|
|
|
|
|
+ this.typeId = nodeData.id
|
|
|
|
|
+ // this.onMoreSearch({})
|
|
|
|
|
+ var nodeId = nodeData.id
|
|
|
|
|
+ this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
|
|
|
|
|
+ const fileTypes = []
|
|
|
|
|
+ if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // 判断是否存在下级菜单
|
|
|
|
|
+ const noHadNext = nodeData.children === undefined
|
|
|
|
|
+ if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
|
|
|
|
|
+ const chongfu = this.listConfig.toolbars.filter(el => {
|
|
|
|
|
+ return el.key === 'add'
|
|
|
|
|
+ })
|
|
|
|
|
+ if (chongfu.length === 0 && this.depth !== 0) {
|
|
|
|
|
+ this.listConfig.toolbars.splice(1, 0, { key: 'add' })
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.listConfig.toolbars = this.listConfig.toolbars.filter(el => {
|
|
|
|
|
+ return el.key !== 'add'
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ this.fileTypesDatas = {
|
|
|
|
|
+ comAuthority: [],
|
|
|
|
|
+ buMenAuthority: [],
|
|
|
|
|
+ authority: [],
|
|
|
|
|
+ shiJiSql: [],
|
|
|
|
|
+ sheBeiSql: []
|
|
|
|
|
+ }
|
|
|
|
|
+ if (nodeData.children === undefined) {
|
|
|
|
|
+ const authorityName = JSON.parse(nodeData.authorityName)
|
|
|
|
|
+ fileTypes.push(nodeId)
|
|
|
|
|
+ if (authorityName.chaYue === '公用查阅') {
|
|
|
|
|
+ this.fileTypesDatas.comAuthority.push(nodeId)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (authorityName.chaYue === '部门查阅') {
|
|
|
|
|
+ this.fileTypesDatas.buMenAuthority.push(nodeId)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (authorityName.chaYue === '受限查阅') {
|
|
|
|
|
+ this.fileTypesDatas.authority.push(nodeId)
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const getTail = item => item.children && item.children.length > 0 ? item.children.map(m => getTail(m)) : [item]
|
|
|
|
|
+ const result = _.flattenDeep(nodeData.children.map(m => getTail(m)))
|
|
|
|
|
+ for (var i of result) {
|
|
|
|
|
+ fileTypes.push(i.id)
|
|
|
|
|
+ const authorityName = JSON.parse(i.authorityName)
|
|
|
|
|
+ if (authorityName.chaYue === '公用查阅') {
|
|
|
|
|
+ this.fileTypesDatas.comAuthority.push(i.id)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (authorityName.chaYue === '部门查阅') {
|
|
|
|
|
+ this.fileTypesDatas.buMenAuthority.push(i.id)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (authorityName.chaYue === '受限查阅') {
|
|
|
|
|
+ this.fileTypesDatas.authority.push(i.id)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.oldorgId = nodeId
|
|
|
|
|
+ this.sqlWhere = {
|
|
|
|
|
+ fileType: fileTypes.join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ this.listData = []
|
|
|
|
|
+ this.loadData()
|
|
|
|
|
+ },
|
|
|
|
|
+ son() {
|
|
|
|
|
+ this.documentsSon = false
|
|
|
|
|
+ },
|
|
|
|
|
+ onClick(item, index) {
|
|
|
|
|
+ this.documentsSon = true
|
|
|
|
|
+ this.sonData = item
|
|
|
|
|
+ // if (this.checkMode) {
|
|
|
|
|
+ // this.$refs.checkboxes[index].toggle()
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // this.proInstId = item.id
|
|
|
|
|
+ // this.defId = item.procDefId
|
|
|
|
|
+
|
|
|
|
|
+ // this.formrenderTitle = item.procDefName
|
|
|
|
|
+ // this.formrenderVisible = true
|
|
|
|
|
+ // }
|
|
|
|
|
+ },
|
|
|
|
|
+ onRefreshPage() {
|
|
|
|
|
+ this.checkedIds = []
|
|
|
|
|
+ this.checkMode = false
|
|
|
|
|
+ this.onRefresh()
|
|
|
|
|
+ },
|
|
|
|
|
+ toCheckMode() {
|
|
|
|
|
+ if (this.$utils.isEmpty(this.listData)) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.checkMode) {
|
|
|
|
|
+ // this.show = true
|
|
|
|
|
+ this.checkedIds = []
|
|
|
|
|
+ }
|
|
|
|
|
+ this.checkMode = !this.checkMode
|
|
|
|
|
+ },
|
|
|
|
|
+ onRemove() {
|
|
|
|
|
+ if (this.checkedIds.length === 0) {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ message: this.$t('common.dialog.selectedRecords')
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$dialog.confirm({
|
|
|
|
|
+ title: this.$t('common.dialog.warn'),
|
|
|
|
|
+ message: this.$t('common.operate.makeSure')
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ removeDraft({ ids: this.selectedIds }).then(response => {
|
|
|
|
|
+ this.$notify({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '删除草稿成功!'
|
|
|
|
|
+ })
|
|
|
|
|
+ this.onRefreshPage()
|
|
|
|
|
+ }).catch((e) => {
|
|
|
|
|
+ console.error(e)
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+ ::v-deep .van-cell__title {
|
|
|
|
|
+ width: 65%;
|
|
|
|
|
+
|
|
|
|
|
+ .van-cell__label {
|
|
|
|
|
+ overflow-wrap: break-word;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|