123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983 |
- <template>
- <div class="hc-page-layout-box">
- <div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'">
- <div class="hc-project-box">
- <div class="hc-project-icon-box">
- <HcIcon name="stack"/>
- </div>
- <div class="ml-2 project-name-box">
- <span class="text-xl text-cut project-alias">{{ projectInfo['projectAlias'] }}</span>
- <div class="text-xs text-cut project-name">{{ projectInfo['name'] }}</div>
- </div>
- </div>
- <div class="hc-tree-box" v-loading="treeLoading" element-loading-text="加载中...">
- <el-scrollbar>
- <HcTree :projectId="projectId" :contractId="contractId" @nodeTap="nodeElTreeClick" @menuTap="ElTreeMenuClick" :autoExpandKeys="treeAutoExpandKeys"
- @nodeLoading="treeNodeLoading"/>
- </el-scrollbar>
- </div>
- <!--左右拖动-->
- <div class="horizontal-drag-line" @mousedown="onmousedown"/>
- </div>
- <div class="hc-page-content-box">
- <HcCard>
- <template #header>
- <div class="hc-card-header-table-title">
- 已形成的案卷
- </div>
- </template>
- <template #extra>
- <!--transfer_initial_expert_btn_sampling-->
- <HcTooltip keys="archives_tuning_btn_num">
- <el-button hc-btn @click="refreshFileNumberClick" :loading="refreshFileNumberLoading">
- <HcIcon name="folder-shared"/>
- <span>档号整理</span>
- </el-button>
- </HcTooltip>
- <HcTooltip keys="archives_tuning_btn_lock">
- <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="lockarchives"
- :loading="lockLoad">
- <HcIcon name="file-lock"/>
- <span>档案锁定</span>
- </el-button>
- </HcTooltip>
- <HcTooltip keys="archives_tuning_btn_unlock">
- <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="unlockarchives"
- :loading="unlockLoad">
- <HcIcon name="lock-unlock"/>
- <span>档案解锁</span>
- </el-button>
- </HcTooltip>
- <HcTooltip keys="archives_tuning_btn_remove">
- <el-button hc-btn @click="movesClick" :disabled="tableCheckedKeys.length <= 0">
- <HcIcon name="git-pull-request"/>
- <span>跨目录移动</span>
- </el-button>
- </HcTooltip>
- <HcTooltip keys="archives_tuning_btn_edit">
- <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="batchEditClick(1)">
- <HcIcon name="edit"/>
- <span>编辑</span>
- </el-button>
- </HcTooltip>
- <HcTooltip keys="archives_tuning_btn_disassemble">
- <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="tunModalClick">
- <HcIcon name="archive-drawer"/>
- <span>拆卷</span>
- </el-button>
- </HcTooltip>
- <!-- <HcTooltip keys="archives_tuning_btn_del">
- <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="delModalClick">
- <HcIcon name="delete-bin"/>
- <span>删除</span>
- </el-button>
- </HcTooltip> -->
- </template>
- <div class="body" :class="tableFileShow?'file-table':''">
- <div class="hc-c-table-box">
- <HcTable ref="tableRef"
- :column="tableColumn"
- :datas="tableData"
- :loading="tableLoading"
- isCheck
- @selection-change="tableSelection"
- @row-click="tableRowClick"
- :ui="hoverHand?'hover-hand':''"
- :isArrIndex="false"
- isCurrentRow
- >
- <template #table-column-header-num>
- <HcTooltip keys="archives_tuning_btn_sort">
- <span class="text-link text-lg" @click="tableSortClick">
- <HcIcon name="arrow-up-down"
- />
- </span>
- </HcTooltip>
- </template>
- <template #name="{row}">
- <span class="text-link" @click="viewPdf(row.id)">{{ row?.name }}</span>
- </template>
- </HcTable>
- </div>
- <div class="hc-f-table-box" v-if="tableFileShow">
- <div class="header-box">
- <div class="header">卷内文件</div>
- <div>
- <HcIcon name="edit" @click="batchEditClick(2)" class="hc-icon-close text-hover"
- style=" color:rgb(64, 149, 229);"/>
- <!-- <HcIcon name="delete-bin" @click="delModalClick" class="hc-icon-close text-hover"
- style="margin-left:5px;margin-right:5px;color: rgb(189, 49, 36);"/> -->
- <HcIcon name="close" @click="closetableFile" class="hc-icon-close text-hover"
- style=" color:rgb(64, 149, 229);"/>
- </div>
- </div>
- <div class="hc-file-table-box">
- <HcTable
- :loading="intableLoading"
- ref="tableFileRef"
- :column="innertableColumn"
- :datas="intableData"
- isCheck
- @selection-change="intableSelection"
- >
- <template #table-column-header-num>
- <HcTooltip keys="archives_tuning_btn_sort">
- <span class="text-link text-lg" @click="intableSortClick">
- <HcIcon name="arrow-up-down"
- :class="text-hover"/>
- </span>
- </HcTooltip>
- </template>
- </HcTable>
- <!-- <HcPages :pages="insearchForm" @change="inpageChange"/> -->
- </div>
- </div>
- </div>
- <template #action>
- <HcPages :pages="searchForm" @change="pageChange"/>
- </template>
- </HcCard>
- </div>
- <!--跨目录移动-->
- <HcDialog :show="movesModal" title="跨目录移动" widths="990px" isTable @close="movesModalClose"
- @save="movesModalSave" :loading="movesModalLoading">
- <div class="hc-moves-transfer-box">
- <div class="hc-moves-transfer-panel">
- <div class="panel-header">
- <div class="panel-header-label">
- <el-checkbox class="size-xl space" v-model="movesCheckAll" :indeterminate="isIndeterminate"
- @change="handleCheckAllChange">选择需要迁移的文件
- </el-checkbox>
- </div>
- <div class="panel-header-extra">{{ checkedMoves.length }}/{{ tableCheckedKeys.length }}</div>
- </div>
- <div class="panel-body">
- <el-scrollbar>
- <el-checkbox-group v-model="checkedMoves" @change="handleCheckedMovesChange">
- <div class="hc-file-checkbox" v-for="item in tableCheckedKeys" :key="item.id">
- <el-checkbox class="size-xl space" :label="item.id">{{ item.name }}</el-checkbox>
- </div>
- </el-checkbox-group>
- </el-scrollbar>
- </div>
- </div>
- <div class="hc-moves-transfer-buttons">
- <!-- <el-button hc-btn _icon size="small"
- :type="tableCheckedKeys.length <= 0 || checkedMoves.length <= 0 ? '' : 'primary'"
- :disabled="tableCheckedKeys.length <= 0 || checkedMoves.length <= 0">
- <HcIcon name="arrow-right"/>
- </el-button> -->
- <HcIcon type="primary" name="arrow-right-double" style="font-size: 22px;"/>
- </div>
- <div class="hc-moves-transfer-panel">
- <div class="panel-header">选择移动目录</div>
- <div class="panel-body">
- <el-scrollbar>
- <HcTree idPrefix="hc-tree-moves-" :projectId="projectId" :contractId="contractId" isRadio
- @noderadio="nodeRadio" :isShowMenu="false"/>
- </el-scrollbar>
- </div>
- </div>
- </div>
- </HcDialog>
- <!--调整排序-->
- <HcDialog :show="sortModal" title="调整排序" widths="980px" isTable isRowFooter @close="sortModalClose">
- <el-alert title="可拖动排序,也可在后面点击图标,切换排序" type="error" :closable="false"/>
- <div class="hc-table-h">
- <HcTable ui="hc-table-row-drop" :column="sortTableColumn" :datas="sortTableData"
- :loading="sortTableLoading" isRowDrop @row-drop="sortTableRowDrop">
- <template #action="{index}">
- <span class="text-link text-xl" @click="upSortClick(index)">
- <HcIcon name="arrow-up" fill/>
- </span>
- <span class="text-link text-xl ml-2" @click="downSortClick(index)">
- <HcIcon name="arrow-down" fill/>
- </span>
- </template>
- </HcTable>
- </div>
- <template #leftRowFooter>
- <el-button hc-btn @click="sortModalClose">
- <HcIcon name="close"/>
- <span>取消</span>
- </el-button>
- <el-button type="primary" hc-btn :loading="sortModalLoading" @click="sortModalSave">
- <HcIcon name="check"/>
- <span>确认</span>
- </el-button>
- </template>
- <template #rightRowFooter>
- <HcPages :pages="sortSearchForm" :sizes="[10, 20, 50, 100, 200, 300, 400, 500, 600]"
- @change="sortPageChange"/>
- </template>
- </HcDialog>
- <!--编辑案卷信息-->
- <el-dialog v-model="showUploadModal" :title="editTitle" width="80vw" class="hc-modal-border hc-modal-table">
- <HcTable ui="hc-form-table" :column="tableUploadColumn" :datas="tableUploadData"
- :loading="uploadSaveLoading">
- <template #name="{row}">
- <el-input v-model="row.name" :class="row['isFileNumber'] ? 'is-error' : ''"
- @input="tableIsInput($event, row, 'name')"/>
- </template>
- <template #fileNumber="{row}">
- <el-input v-model="row.fileNumber" :class="row['isFileNumber'] ? 'is-error' : ''"
- @input="tableIsInput($event, row, 'isFileNumber')"/>
- </template>
- <template #fileName="{row}">
- <el-input v-model="row.fileName" :class="row['isFileName'] ? 'is-error' : ''"
- @input="tableIsInput($event, row, 'isFileName')"/>
- </template>
- <template #fileTime="{row}" v-if="editType === 2">
- <el-date-picker v-model="row.fileTime" type="date" format="YYYYMMDD" value-format="YYYYMMDD"
- :clearable="false"/>
- </template>
- <template #unit="{row}">
- <el-input v-model="row.unit"/>
- </template>
- <template #remark="{row}">
- <el-input v-model="row.remark" type="textarea"/>
- </template>
- </HcTable>
- <template #footer>
- <div class="lr-dialog-footer">
- <div class="left flex items-center">
- </div>
- <div class="right">
- <el-button size="large" @click="batchUploadCancel">
- <HcIcon name="close"/>
- <span>取消</span>
- </el-button>
- <el-button type="primary" hc-btn :disabled="uploadSaveLoading" :loading="uploadSaveLoading"
- @click="batchUploadSave">
- <HcIcon name="save"/>
- <span>保存</span>
- </el-button>
- </div>
- </div>
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import {ref, watch, onMounted} from "vue";
- import {useAppStore} from "~src/store";
- import HcTree from "~src/components/tree/hc-tree.vue"
- import {downloadBlob, getArrValue, deepClone} from "js-fast-way"
- import {delMessage, rowsToId, rowsToIdNumArr} from "~uti/tools";
- import tuningApi from "~api/archiveConfig/tuning.js";
- import archiveFileApi from "~api/archiveFile/archiveFileAuto.js";
- import {getStoreValue, setStoreValue} from '~src/utils/storage'
- //变量
- const useAppState = useAppStore()
- const projectId = ref(useAppState.getProjectId);
- const contractId = ref(useAppState.getContractId);
- const projectInfo = ref(useAppState.getProjectInfo);
- const isCollapse = ref(useAppState.getCollapse)
- const hoverHand = ref(true)
- //监听
- watch(() => [
- useAppState.getCollapse
- ], ([Collapse]) => {
- isCollapse.value = Collapse
- })
- //渲染完成
- onMounted(() => {
- // getClassIfyList()
- setTableColumns()
- })
- //树加载
- const treeLoading = ref(true)
- const treeNodeLoading = () => {
- treeLoading.value = false
- }
- //项目树被点击
- const nodeIds = ref('')
- const isStorageNode = ref(0)
- // const isBuiltDrawing = ref(0)
- //自动展开缓存
- const treeAutoExpandKeys = ref(getStoreValue('turningExpandKeys') || [])
- const nodeElTreeClick = ({node, data, keys, key}) => {
- //缓存展开的节点
- setStoreValue('turningExpandKeys', keys)
- treeAutoExpandKeys.value = keys || []
- console.log('点击', data);
- searchForm.value.total = 0
- searchForm.value.current = 1
- searchForm.value.size = 20
- searchForm.value.nodeIds = data.id || '';
- getTableData()
- }
- //树菜单被点击
- const ElTreeMenuClick = async ({key, node, data, keys}) => {
- setStoreValue('turningExpandKeys', keys)
- treeAutoExpandKeys.value = keys || []
- }
- const nodeRadio = ({node, data, keys, key}) => {
- console.log(data, 'data33333');
- chnodeId.value = data.id || '';
- console.log(chnodeId.value, ' chnodeId.value');
- }
- //搜索表单
- const searchForm = ref({
- contractId: null, type: null, approval: null,
- current: 1, size: 20, total: 0
- })
- const insearchForm = ref({
- contractId: null, type: null, approval: null,
- current: 1, size: 1000, total: 0
- })
- //树相关的变量
- const primaryKeyId = ref('')
- //分页被点击
- const pageChange = ({current, size}) => {
- searchForm.value.current = current
- searchForm.value.size = size
- getTableData()
- }
- //分页被点击
- const inpageChange = ({current, size}) => {
- insearchForm.value.current = current
- insearchForm.value.size = size
- getintableData()
- }
- //表格数据
- const tableRef = ref(null)
- const tableColumn = ref([])
- //设置表头
- const setTableColumns = () => {
- tableColumn.value = [
- {key: 'fileNumber', name: '档号'},
- {key: 'name', name: '案卷题名', width: 500},
- {key: 'storageTimeValue', name: '保管期限'},
- {key: 'pageN', name: '总页数'},
- ]
- }
- const tableData = ref([])
- //获取数据
- const tableLoading = ref(false)
- const getTableData = async () => {
- tableFileShow.value = false
- tableLoading.value = true
- const {error, code, data} = await tuningApi.pageByArchive({
- ...searchForm.value,
- projectId: projectId.value,
- contractId: contractId.value,
- isArchive: 1
- })
- tableLoading.value = false
- if (!error && code === 200) {
- tableData.value = getArrValue(data?.records)
- searchForm.value.total = data?.total || 0
- } else {
- tableData.value = []
- searchForm.value.total = 0
- }
- }
- const innertableColumn = ref([])
- const intableData = ref([])
- //设置表头
- const setInnertableColumn = () => {
- innertableColumn.value = [
- {key: 'fileNumber', name: '文件编号'},
- {key: 'fileName', name: '文件题名', width: 500},
- {key: 'fileTime', name: '文件日期'},
- {key: 'dutyUser', name: '责任者'},
- {key: 'pageNum', name: '页数'},
- ]
- }
- const intableLoading = ref(false)
- //获取卷内文件
- const getintableData = async () => {
- intableLoading.value = true
- const {error, code, data} = await tuningApi.getarchiveFilePage({
- ...insearchForm.value,
- nodeIds: searchForm.value.nodeIds,
- archiveId: checkInid.value
- })
- intableLoading.value = false
- if (!error && code === 200) {
- intableData.value = getArrValue(data['records'])
- insearchForm.value.total = data['total'] || 0
- } else {
- intableData.value = []
- insearchForm.value.total = data['total'] || 0
- }
- }
- //多选
- const tableCheckedKeys = ref([]);
- const intableCheckedKeys = ref([]);
- const tableSelection = (rows) => {
- tableCheckedKeys.value = rows
- }
- const intableSelection = (rows) => {
- intableCheckedKeys.value = rows
- }
- //删除
- const delModalClick = () => {
- let ids = ''
- const rows = intableCheckedKeys.value;
- ids = rowsToId(rows)
- if(rows.length>0){
- window?.$messageBox?.alert('请谨慎考虑是否要批量删除卷内文件?', '删除文件', {
- showCancelButton: true,
- confirmButtonText: '确认删除',
- cancelButtonText: '取消',
- type: 'warning',
- callback: async (action, ctx, close) => {
- ctx.confirmButtonLoading = true;
- if (action === 'confirm') {
- const {error, code, data, msg} = await tuningApi.removeFiles({
- ids: ids,
- archiveId: checkInid.value
- })
- ctx.confirmButtonLoading = false;
- if (!error && code === 200) {
- window.$message?.success(msg)
- getintableData()
- } else {
- window.$message?.warning(msg)
- }
- }
- }
- })
- }else{
- window.$message.warning('请先选择文件')
- }
-
- }
- const splitLoad = ref(false)
- const tunModalClick = () => {
- splitLoad.value = true
- window?.$messageBox?.alert('请谨慎考虑是否要批量拆除已经案卷及卷内文件?', '拆除案卷', {
- showCancelButton: true,
- confirmButtonText: '确认拆卷',
- cancelButtonText: '取消',
- type: 'warning',
- callback: async (action, ctx, close) => {
- if (action === 'confirm') {
- console.log(1111);
- ctx.confirmButtonLoading = true;
- let ids = ''
- const rows = tableCheckedKeys.value;
- ids = rowsToId(rows)
- const {error, code, data, msg} = await tuningApi.splitArchive({
- ids: ids
- })
- ctx.confirmButtonLoading = true;
- if (!error && code === 200) {
- window.$message?.success(msg)
- getTableData()
- }
- // else {
- // window.$message?.warning(msg)
- // }
- }
- }
- })
- }
- //左右拖动,改变树形结构宽度
- const leftWidth = ref(382);
- const onmousedown = () => {
- const leftNum = isCollapse.value ? 142 : 272
- document.onmousemove = (ve) => {
- let diffVal = ve.clientX - leftNum;
- if (diffVal >= 310 && diffVal <= 900) {
- leftWidth.value = diffVal;
- }
- }
- document.onmouseup = () => {
- document.onmousemove = null;
- document.onmouseup = null;
- }
- }
- //跨目录移动
- const movesModal = ref(false)
- const movesClick = () => {
- movesModal.value = true
- }
- //选择需要迁移的文件
- const movesCheckAll = ref(false)
- const isIndeterminate = ref(true)
- const checkedMoves = ref([])
- //全选
- const handleCheckAllChange = (val) => {
- const checked = tableCheckedKeys.value
- const keys = rowsToIdNumArr(checked);
- checkedMoves.value = val ? keys : []
- isIndeterminate.value = false
- }
- //勾选
- const handleCheckedMovesChange = (value) => {
- const keys = tableCheckedKeys.value
- const checkedCount = value.length
- movesCheckAll.value = checkedCount === keys.length
- isIndeterminate.value = checkedCount > 0 && checkedCount < keys.length
- }
- //保存
- const movesModalLoading = ref(false)
- const chnodeId = ref('')
- const movesModalSave = async () => {
- movesModalLoading.value = true
- console.log(checkedMoves.value, 'checkedMoves.value');
- let ids = checkedMoves.value.join(',')
- const {error, code, data, msg} = await tuningApi.moveArchive({
- ids: ids,
- nodeId: chnodeId.value
- })
- movesModalLoading.value = false
- if (!error && code === 200) {
- console.log(msg, 'msg');
- window.$message?.success(msg)
- getTableData()
- } else {
- window.$message?.warning(msg)
- }
- movesModal.value = false
- }
- //关闭
- const movesModalClose = () => {
- movesModal.value = false
- }
- //表格排序
- const sortModal = ref(false)
- //显示
- const tableSortClick = () => {
-
- sortModal.value = true
- sortType.value = 1
- setsortTableColumn()
- getSortTableData()
-
- }
- const intableSortClick = () => {
-
- sortModal.value = true
- sortType.value = 2
- setsortTableColumn()
- getSortTableData()
-
- }
- //表格行被点击
- const tableFileShow = ref(false)
- const checkInid = ref('')
- const tableRowClick = ({row}) => {
- tableFileShow.value = true;
- checkInid.value = row.id
- setInnertableColumn()
- getintableData()
- }
- //收起卷内文件
- const closetableFile = () => {
- tableFileShow.value = false
- }
- //卷内文件点击
- //搜索表单
- const sortSearchForm = ref({
- current: 1, size: 20, total: 0
- })
- //分页被点击
- const sortPageChange = ({current, size}) => {
- searchForm.value.current = current
- searchForm.value.size = size
- getSortTableData()
- }
- const setsortTableColumn = () => {
- if (sortType.value === 1) {
- sortTableColumn.value = [
- {key: 'fileNumber', name: '档号', width: 160},
- {key: 'name', name: '案卷名称'},
- {key: 'action', name: '排序', width: 90},
- ]
- } else if (sortType.value === 2) {
- sortTableColumn.value = [
- {key: 'fileNumber', name: '文件编号', width: 160},
- {key: 'fileName', name: '文件名称'},
- {key: 'action', name: '排序', width: 90},
- ]
- }
- }
- //表格数据
- const sortTableColumn = ref([
- {key: 'fileNumber', name: '档号', width: 160},
- {key: 'name', name: '案卷名称'},
- {key: 'action', name: '排序', width: 90},
- ])
- const sortTableData = ref([])
- const sortTableLoading = ref(false)
- const sortType = ref()
- const getSortTableData = async() => {
- // if (sortType.value === 1) {
- // sortTableData.value = tableCheckedKeys.value
- // sortSearchForm.value.total = sortTableData.value.length
- // } else if (sortType.value === 2) {
- // sortTableData.value = intableCheckedKeys.value
- // sortSearchForm.value.total = intableCheckedKeys.value.length
- // }
- // sortSearchForm.value.current = 1
- if(sortType.value === 1){
- sortTableLoading.value = true
- const {error, code, data} = await tuningApi.pageByArchive({
- ...searchForm.value,
- projectId: projectId.value,
- contractId: contractId.value,
- isArchive: 0
- })
- sortTableLoading.value = false
- if (!error && code === 200) {
- sortTableData.value = getArrValue(data['records'])
- sortSearchForm.value.total = data['total'] || 0
- } else {
- sortTableData.value = []
- sortSearchForm.value.total = 0
- }
- }else if(sortType.value === 2){
- sortTableLoading.value = true
- const {error, code, data} = await tuningApi.getarchiveFilePage({
- ...insearchForm.value,
- nodeIds: searchForm.value.nodeIds,
- archiveId: checkInid.value
- })
- sortTableLoading.value = false
- if (!error && code === 200) {
- sortTableData.value = getArrValue(data['records'])
- sortSearchForm.value.total = data['total'] || 0
- } else {
- sortTableData.value = []
- sortSearchForm.value.total = 0
- }
- }
- sortSearchForm.value.current = 1
- }
- //拖动完成
- const sortTableRowDrop = (rows) => {
- sortTableData.value = rows
- }
- //向下
- const downSortClick = (index) => {
- const indexs = index + 1
- const data = sortTableData.value
- if (indexs !== data.length) {
- const tmp = data.splice(indexs, 1);
- sortTableData.value.splice(index, 0, tmp[0]);
- } else {
- window?.$message?.warning('已经处于置底,无法下移')
- }
- }
- //向上
- const upSortClick = (index) => {
- const data = sortTableData.value || []
- if (index !== 0) {
- const tmp = data.splice(index - 1, 1);
- sortTableData.value.splice(index, 0, tmp[0]);
- } else {
- window?.$message?.warning('已经处于置顶,无法上移')
- }
- }
- //保存
- const sortModalLoading = ref(false)
- const sortModalSave = () => {
- sortModal.value = false
- }
- //关闭
- const sortModalClose = () => {
- sortModal.value = false
- }
- //编辑
- const showUploadModal = ref(false)
- const isBuiltDrawing = ref(0)
- const editTitle = ref('')
- const editType = ref()
- //批量上传保存
- const uploadSaveLoading = ref(false)
- //批量编辑
- //批量编辑
- const batchEditClick = (type) => {
- let rows = []
- if (type === 1) {
- editTitle.value = '编辑案卷信息'
- editType.value = 1
- rows = deepClone(tableCheckedKeys.value)
- } else {
- editTitle.value = '编辑文件信息'
- editType.value = 2
- rows = deepClone(intableCheckedKeys.value)
- }
- //判断状态
- setTableUploadColumn(type)
- uploadSaveLoading.value = false
- tableUploadData.value = rows
- if(rows.length>0){
- showUploadModal.value = true
- }else{
- window.$message.warning('请先选择文件')
- }
-
- }
- //设置文件表头
- const tableUploadColumn = ref([])
- const setTableUploadColumn = (type) => {
- if (type === 1) {
- tableUploadColumn.value = [
- {key: 'fileNumber', name: '档号'},
- {key: 'name', name: '案卷题名'},
- {key: 'unit', name: '立卷单位'},
- {key: 'remark', name: '备注'},
- ]
- } else {
- tableUploadColumn.value = [
- {key: 'fileNumber', name: '文件编号'},
- {key: 'fileName', name: '文件题名'},
- {key: 'fileTime', name: '文件日期'},
- {key: 'dutyUser', name: '责任者'},
-
- ]
- }
- }
- const tableUploadData = ref([])
- const batchUploadCancel = () => {
- showUploadModal.value = false
- tableUploadData.value = []
- }
- //确认上传保存
- const batchUploadSaveApi = async (rows) => {
- uploadSaveLoading.value = true
- const {error, code} = await archiveFileApi.batchUploadSave({
- list: rows
- }, false)
- //判断状态
- uploadSaveLoading.value = false
- if (!error && code === 200) {
- window.$message?.success('保存成功')
- batchUploadCancel()
- getTableData()
- } else {
- window.$message?.error('保存失败')
- }
- }
- //确认上传保存
- const archiveFileBatchUpdate = async (rows) => {
- uploadSaveLoading.value = true
- const {error, code} = await tuningApi.archiveFileBatchUpdate({
- list: rows
- }, false)
- //判断状态
- uploadSaveLoading.value = false
- if (!error && code === 200) {
- window.$message?.success('保存成功')
- batchUploadCancel()
- getTableData()
- } else {
- window.$message?.error('保存失败')
- }
- }
- //批量新增编辑保存
- const batchUploadSave = async () => {
- const rows = tableUploadData.value
- if (rows.length > 0) {
- //验证表单数据
- uploadSaveLoading.value = true
- let isTableRows = false;
- //判断数据
- if (isTableRows) {
- uploadSaveLoading.value = false
- window.$message?.warning('请先完善表单信息')
- } else {
- console.log(rows, 'rows');
- if (editType.value === 2) {
- //数据处理
- rows.forEach((element, index) => {
- const {dates} = element
- element.startDate = dates ? dates[0] : null
- element.endDate = dates ? dates[1] : null
- element.autoFileSort = index + 1
- })
- await archiveFileBatchUpdate(rows)
- } else {
- await batchUploadSaveApi(rows)
- }
- // if (tableUploadType.value === 'add') {
- // await batchUploadSaveApi(rows)
- // } else {
- // await batchEditSaveApi(rows)
- // }
- }
- } else {
- window.$message?.warning('请先上传文件')
- }
- }
- const lockLoad = ref(false)
- const unlockLoad = ref(false)
- //档案锁定
- const lockarchives = async () => {
- lockLoad.value = true
- let ids = ''
- const rows = tableCheckedKeys.value;
- ids = rowsToId(rows)
- const {error, code, data, msg} = await tuningApi.archivesautoLock({
- ids: ids
- })
- lockLoad.value = false
- if (!error && code === 200) {
- console.log(msg, 'msg');
- window.$message?.success(msg)
- getTableData()
- } else {
- window.$message?.warning(msg)
- }
- }
- const unlockarchives = async () => {
- unlockLoad.value = true
- let ids = ''
- const rows = tableCheckedKeys.value;
- ids = rowsToId(rows)
- const {error, code, data, msg} = await tuningApi.archivesautoUnLock({
- ids: ids
- })
- unlockLoad.value = false
- if (!error && code === 200) {
- window.$message?.success(msg)
- getTableData()
- } else {
- window.$message?.warning(msg)
- }
- }
- const viewPdf = async (id) => {
- window.$message?.info('预览案卷需要合并pdf,需要一点时间')
- const {error, code, data, msg} = await tuningApi.printArchive({
- id: id
- })
- if (!error && code === 200) {
- if (data) {
- window.open(data, '_blank')
- } else {
- window.$message?.warning('文件不存在')
- }
- }
- // else {
- // window.$message?.warning(msg)
- // }
- }
- //档号整理
- const refreshFileNumberLoading = ref(false)
- const refreshFileNumberClick = async () => {
- const {error, code, msg} = await tuningApi.refreshFileNumber({
- projectId: projectId.value,
- contractId: contractId.value,
- nodeId: searchForm.value.nodeIds || '',
- })
- if (!error && code === 200) {
- window.$message?.success(msg)
- } else {
- window.$message?.warning(msg)
- }
- }
- </script>
- <style lang="scss" scoped>
- .hc-card-header-table-title {
- font-size: 1.125rem;
- line-height: 1.75rem;
- }
- .rowbox {
- text-align: center;
- }
- .body {
- position: relative;
- // height: calc(100% - 140px);
- height: calc(100% - 0px);
- padding: 16px;
- .hc-c-table-box {
- position: relative;
- height: 100%;
- }
- .hc-f-table-box {
- position: relative;
- height: 300px;
- margin-top: 24px;
- background: #f1f5f8;
- .header-box {
- border-bottom: initial;
- display: flex;
- justify-content: space-between;
- height: 60px;
- background-color: var(--el-fill-color-lighter);
- line-height: 60px;
- padding-left: 15px;
- padding-right: 15px;
- .hc-icon-close {
- font-size: 18px;
- }
- }
- .hc-file-table-box {
- position: relative;
- height: calc(100% - 55px);
- }
- }
- &.file-table .hc-c-table-box {
- height: calc(100% - 324px);
- }
- }
- @import '~style/file/scoped/collection.scss';
- </style>
- <style lang="scss">
- @import '~style/file/collection.scss';
- .text-disable {
- cursor: not-allowed
- }
- .hover-hand {
- cursor: pointer;
- }
- </style>
|