123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830 |
- <template>
- <hc-body :loading="!isAppLoading" :project-nmae="projectInfo?.name" class="hc-file-collection-page" split>
- <template #tree>
- <HcTree
- ref="treeRef" :auto-expand-keys="treeAutoExpandKeys" :contract-id="contractId" :menus="ElTreeMenu"
- :project-id="projectId"
- @node-tap="projectTreeClick" @node-loading="treeNodeLoading" @menu-tap="ElTreeMenuClick"
- />
- </template>
- <hc-new-card>
- <template #header>
- <HcTooltip keys="file_collection_btn_upload_scanned_files">
- <el-button hc-btn type="primary" @click="uploadModalClick">上传扫描文件</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_sorting">
- <el-button hc-btn type="success" @click="sortingClick">分盒整理</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_download">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn>下载</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_certified">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="certificationModalClick">认证</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_report">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn type="warning" @click="reportModalClick">上报</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_edit">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="batchEditClick">编辑</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_repeal">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn @click="repealModalClick">废除</el-button>
- </HcTooltip>
- <HcTooltip keys="file_collection_btn_del">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn type="danger" @click="delModalClick">删除</el-button>
- </HcTooltip>
- <el-button :disabled="tableCheckedKeys.length <= 0" :loading="onlineLoading" color="#e03997" hc-btn @click="batchOnline">在线验签</el-button>
- </template>
- <template #extra>
- <HcTooltip keys="file_collection_btn_moves">
- <el-button color="#626aef" hc-btn @click="movesClick">跨目录移动</el-button>
- </HcTooltip>
- </template>
- <template #search>
- <div class="w-40">
- <el-select v-model="searchForm.isApprovalValue" clearable placeholder="审批状态">
- <el-option v-for="item in approvalStatus" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </div>
- <div class="ml-2 w-40">
- <el-select v-model="searchForm.isCertificationValue" clearable placeholder="认证状态">
- <el-option v-for="item in certifiedStatus" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </div>
- <div class="ml-2 w-64">
- <el-input v-model="searchForm.queryValue" clearable placeholder="请输入名称关键词检索" @keyup="keyUpEvent" />
- </div>
- <div class="ml-2">
- <el-button type="primary" @click="searchClick">搜索</el-button>
- </div>
- </template>
- <HcTable
- ref="tableRef" :check-style="{ width: 29 }" :column="tableColumn" :datas="tableData"
- :index-style="{ width: 80 }" :loading="tableLoading" is-check is-new
- @selection-change="tableSelection"
- >
- <template #table-column-header-num>
- <HcTooltip keys="file_collection_btn_sort">
- <span class="text-link text-lg" @click="tableSortClick">
- <HcIcon name="arrow-up-down" />
- </span>
- </HcTooltip>
- </template>
- <template #isApprovalValue="{ row }">
- <el-tag v-if="row?.isApprovalValue" :type="`${row.isApprovalValue === '已审批' ? 'success' : row.isApprovalValue === '待审批' ? 'warning' : row.isApprovalValue === '已废除' ? 'danger' : 'info'}`" class="mx-1" effect="dark">
- {{ row.isApprovalValue }}
- </el-tag>
- </template>
- <template #fileName="{ row }">
- <span class="text-link" @click="tableRowName(row)">{{ row?.fileName }}</span>
- </template>
- <template #sourceType="{ row }">
- <span>{{ row?.sourceType === 1 ? '原生' : '数字化' }}</span>
- </template>
- <template #fileTime="{ row }">
- <span>{{ getTableFileTime(row.fileTime) }}</span>
- </template>
- </HcTable>
- <template #action>
- <div class="lr-dialog-footer h-full">
- <div class="left hc-flex h-full text-14px">
- <span class="text">当前页的文件总页数:</span>
- <span>{{ fileTotalPage || 0 }}</span>
- </div>
- <div class="right">
- <HcPages :pages="searchForm" :sizes="[20, 50, 100, 200, 300, 500]" @change="pageChange" />
- </div>
- </div>
- </template>
- </hc-new-card>
- <!-- 预组卷整理 -->
- <hc-new-dialog v-model="sortingModal" is-row-footer is-table title="预组卷整理" widths="850px" @close="sortingModalClose">
- <div class="hc-sorting-modal-collapse">
- <el-collapse v-model="sortingActiveKey">
- <template v-for="(item, index) in sortingItemData" :key="index">
- <el-collapse-item :id="`item-${index}`" :name="`item-${index}`" disabled>
- <template #title>
- <div class="hc-collapse-item-header">
- <div class="item-index">盒{{ index + 1 }}</div>
- <el-divider direction="vertical" />
- <div class="item-input">
- <el-input
- v-model="item.boxName" :class="item.isName ? 'is-error' : ''"
- placeholder="请输入案卷题名"
- @change="tableIsInput($event, item, 'isName')"
- @input="tableIsInput($event, item, 'isName')"
- />
- </div>
- <el-divider direction="vertical" />
- <div class="item-action">
- <el-button type="primary" @click="sortingSelectFile(item, index)">选择文件</el-button>
- <el-button type="danger" @click="sortingDelData(item, index)">删除</el-button>
- </div>
- </div>
- </template>
- <HcTable
- ref="sorTableRef" :check-style="{ width: 29 }" :column="sortingTableColumn" :datas="item.list"
- :index-style="{ width: 60 }" :loading="sortingTableLoading" is-check is-new
- @selection-change="rows => sortingTableSelection(rows, item.list, index)"
- @single-select="singleCheck"
- >
- <template #name="{ row }">
- <span class="text-link">{{ row?.fileName }}</span>
- </template>
- </HcTable>
- </el-collapse-item>
- </template>
- </el-collapse>
- </div>
- <template #leftRowFooter>
- <el-button hc-btn type="primary" @click="addSortingModalClick">
- <HcIcon name="add" />
- <span>添加分盒</span>
- </el-button>
- </template>
- <template #rightRowFooter>
- <el-button hc-btn @click="sortingModalClose">
- <HcIcon name="close" />
- <span>取消</span>
- </el-button>
- <el-button :loading="sortingModalLoading" hc-btn type="primary" @click="sortingModalSave">
- <HcIcon name="check" />
- <span>确认</span>
- </el-button>
- </template>
- </hc-new-dialog>
- <!-- 预组卷整理 无数据 -->
- <hc-new-dialog v-model="sortingNoneModal" is-row-footer is-table title="预组卷整理" widths="850px" @close="sortingNoneModalClose">
- <div class="flex-center">
- <i class="el-icon" data-v-029747aa="" style="font-size: 200px;color:#81b337;cursor: pointer;" @click="toSortingModal">
- <svg data-v-029747aa="" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg">
- <path d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0v147.2z" fill="currentColor" />
- </svg>
- </i>
- <span>添加分盒</span>
- </div>
- </hc-new-dialog>
- <!-- 跨目录移动 -->
- <hc-new-dialog v-model="movesModal" :loading="movesModalLoading" is-table title="跨目录移动" widths="990px" @close="movesModalClose" @save="movesModalSave">
- <div class="hc-moves-transfer-box">
- <div class="hc-moves-transfer-panel">
- <div class="panel-header">
- <div class="panel-header-label">
- <el-checkbox v-model="movesCheckAll" :indeterminate="isIndeterminate" class="space size-xl" @change="handleCheckAllChange">
- 选择需要迁移的文件
- </el-checkbox>
- </div>
- <div class="panel-header-extra">{{ checkedMoves.length }}/{{ fileDatasList.length }}</div>
- </div>
- <div class="panel-body">
- <el-scrollbar v-loading="fileDatasListLoading">
- <el-checkbox-group v-model="checkedMoves" @change="handleCheckedMovesChange">
- <!-- <div v-for="item in fileDatasList" :key="item.id" class="hc-file-checkbox">
- <el-checkbox class="size-xl space" :label="item">
- {{ item.fileName }}
- </el-checkbox>
- </div> -->
- <recycle-scroller
- :buffer="1000" :item-size="110" :items="fileDatasList"
- :prerender="200" class="virtual-list" key-field="id"
- style="height: 900px"
- >
- <template #default="{ item, index }">
- <div :key="index">
- <el-checkbox :value="item" class="space mt-5 size-xl">{{ item.fileName }}</el-checkbox>
- </div>
- </template>
- </recycle-scroller>
- </el-checkbox-group>
- </el-scrollbar>
- </div>
- </div>
- <div class="hc-moves-transfer-buttons">
- <HcIcon name="arrow-right-double" style="font-size: 22px;" type="primary" />
- </div>
- <div class="hc-moves-transfer-panel">
- <div class="panel-header">选择移动目录</div>
- <div v-loading="treePanelLoading" class="panel-body">
- <el-scrollbar>
- <HcTree
- :contract-id="contractId" :is-show-menu="false" :project-id="projectId"
- :show-radio-fun="showRadioFun" id-prefix="hc-tree-moves-" is-radio
- @radio-change="radioChange" @node-loading="panelTreeLoading"
- />
- </el-scrollbar>
- </div>
- </div>
- </div>
- </hc-new-dialog>
- <!-- 调整排序 -->
- <hc-new-dialog v-model="sortModal" is-row-footer is-table title="调整排序" widths="80vw" @close="sortModalClose">
- <el-alert :closable="false" title="可拖动排序,也可在后面点击图标,切换排序" type="error" />
- <div class="hc-table-h">
- <HcTable
- :column="sortTableColumn" :datas="sortTableData" :index-style="{ width: 80 }"
- :loading="sortTableLoading"
- is-new is-row-drop quick-sort ui="hc-table-row-drop"
- @row-drop="sortTableRowDrop" @row-sort="sortTableRowDrop"
- >
- <template #action="{ index }">
- <span class="text-link text-xl" @click="upSortClick(index)">
- <HcIcon fill name="arrow-up" />
- </span>
- <span class="text-link ml-2 text-xl" @click="downSortClick(index)">
- <HcIcon fill name="arrow-down" />
- </span>
- </template>
- </HcTable>
- </div>
- <template #leftRowFooter>
- <el-button hc-btn @click="sortModalClose">
- <HcIcon name="close" />
- <span>取消</span>
- </el-button>
- <el-button :loading="sortModalLoading" hc-btn type="primary" @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>
- </hc-new-dialog>
- <!-- 新增编辑文件 -->
- <hc-new-dialog v-model="showUploadModal" is-table title="上传工程文件" widths="90vw" @close="uploadModalClose">
- <HcTable
- :column="tableUploadColumn" :datas="tableUploadData" :index-style="{ width: 80 }"
- :loading="uploadSaveLoading"
- is-new is-sort ui="hc-form-table" @row-sort="tableUploadRowSort"
- >
- <template #fileNumber="{ row }">
- <!-- <el-input v-model="row.fileNumber" :class="row['isFileNumber'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileNumber')"/> -->
- <el-input v-model="row.fileNumber" />
- </template>
- <template #fileName="{ row }">
- <el-input v-model="row.fileName" :class="row.isFileName ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileName')" />
- </template>
- <template #fileTime="{ row }">
- <div class="relative w-full">
- <el-date-picker v-model="row.fileTime" class="w-full!" :clearable="false" format="YYYYMMDD" type="date" value-format="YYYYMMDD" />
- </div>
- <!-- <el-input v-model="row.fileTime" :class="row['isFileTime'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileTime')"/> -->
- </template>
- <template v-if="isBuiltDrawing === 2" #sheetType="{ row }">
- <el-select v-model="row.sheetType">
- <el-option v-for="item in sheetType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </template>
- <template v-if="isBuiltDrawing === 2" #sheetSource="{ row }">
- <el-select v-model="row.sheetSource">
- <el-option v-for="item in sheetSourceType" :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
- </el-select>
- </template>
- <template v-if="isBuiltDrawing === 2" #drawingNo="{ row }">
- <el-input v-model="row.drawingNo" />
- </template>
- <template v-if="isBuiltDrawing === 2" #citeChangeNumber="{ row }">
- <el-input v-model="row.citeChangeNumber" />
- </template>
- <template #isApproval="{ row }">
- <el-select v-model="row.isApproval">
- <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </template>
- <template #isNeedCertification="{ row }">
- <el-select v-model="row.isNeedCertification">
- <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </template>
- <template #dutyUser="{ row }">
- <el-input v-model="row.dutyUser" />
- </template>
- <template #isElement="{ row }">
- <el-select v-model="row.isElement">
- <el-option :value="1" label="是" />
- <el-option :value="0" label="否" />
- </el-select>
- </template>
- <template #action="{ row, index }">
- <el-button v-if="tableUploadType === 'edit'" plain size="small" type="warning" @click="tableRowName(row)">查看文件</el-button>
- <el-button v-if="tableUploadType === 'edit'" :loading="row.newBtnLoading" plain size="small" type="primary" @click="substitutionClick(row)">替换</el-button>
- <el-button :loading="row.delBtnLoading" plain size="small" type="danger" @click="delUploadData(row, index)">删除</el-button>
- </template>
- </HcTable>
- <template #footer>
- <div class="lr-dialog-footer">
- <div class="left flex items-center">
- <el-button v-if="tableUploadType === 'add'" hc-btn type="primary" @click="uploadFileClick">
- <HcIcon name="add-circle" />
- <span>新增上传</span>
- </el-button>
- </div>
- <div class="right">
- <el-button size="large" :loading="uploadSaveLoading" @click="batchUploadCancel">
- <HcIcon name="close" />
- <span>取消</span>
- </el-button>
- <el-button :loading="uploadSaveLoading" hc-btn type="primary" @click="batchUploadSave">
- <HcIcon name="save" />
- <span>提交保存</span>
- </el-button>
- </div>
- </div>
- </template>
- </hc-new-dialog>
- <!-- 批量认证 -->
- <hc-new-dialog v-model="showCertificationModal" is-table title="批量认证" widths="80vw">
- <div class="hc-card-body-flex">
- <div class="flex-table">
- <HcTable
- :column="CertColumns" :datas="CertData" :index-style="{ width: 80 }"
- is-new ui="hc-form-table"
- @row-click="CertRowClick"
- >
- <template #action="{ row, index }">
- <el-button plain size="small" type="primary" @click.stop="CertRowClick2(row)">预览</el-button>
- </template>
- </HcTable>
- </div>
- <div v-if="CertPdf" class="flex-iframe">
- <iframe :src="CertPdf" allow="display-capture" frameborder="1" height="100%" width="100%" />
- </div>
- <div v-else class="flex-iframe hc-no-table-form">
- <div class="table-form-no">
- <img :src="notableform" alt="">
- <div class="desc">暂无 PDF 数据</div>
- </div>
- </div>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button size="large" @click="showCertificationModal = false">
- <HcIcon name="close" />
- <span>取消</span>
- </el-button>
- <el-button :loading="CertLoading" hc-btn type="primary" @click="CertClick">
- <HcIcon name="save" />
- <span>确认认证</span>
- </el-button>
- </div>
- </template>
- </hc-new-dialog>
- <!-- 批量编辑 -->
- <HcReport :data="reportData" :show="isReport" @finish="reportFinish" @hide="isReport = false" />
- <!-- 在线验签 -->
- <hc-new-drawer v-model="isOnlineVerifyDrawer" modal-class="hc-online-verify-drawer" to-id="app" @close="onlineVerifyDrawerClose">
- <hc-new-card>
- <template #header>
- <div class="online-verify-title">这是标题名称</div>
- </template>
- <template #extra>
- <div class="online-verify-icon" @click="onlineVerifyDrawerClose">
- <HcIcon name="close-circle" />
- <span class="ml-1">关闭</span>
- </div>
- </template>
- <hc-body :options="onlineVerifyOptions" padding="0px" split>
- <template #left>
- <hc-new-card>
- <HcPdf :src="onlineVerifyData.pdfUrl" />
- </hc-new-card>
- </template>
- <hc-new-card>
- <HcTable :column="cscTableColumn" :datas="cscTableData" :index-style="{ width: 60 }" is-new />
- </hc-new-card>
- </hc-body>
- </hc-new-card>
- </hc-new-drawer>
- </hc-body>
- </template>
- <script setup>
- import { useAppStore } from '~src/store'
- import { getStoreValue, setStoreValue } from '~src/utils/storage'
- import { computed, nextTick, onMounted, ref, watch } from 'vue'
- import HcTree from '~src/components/tree/hc-tree.vue'
- import HcReport from './components/HcReport.vue'
- import notableform from '~src/assets/view/notableform.svg'
- import { rowsToId } from '~uti/tools'
- import { HcDelMsg, HcUploadFileApi } from 'hc-vue3-ui'
- import archiveFileApi from '~api/archiveFile/archiveFile'
- import tasksFlowApi from '~api/tasks/flow'
- import { arrKeySort, arrToId, deepClone, getArrValue, getObjVal, isNullES } from 'js-fast-way'
- import tasksApi from '~api/tasks/data'
- import ossApi from '~api/oss'
- import { toPdfPage } from '~uti/btn-auth'
- //变量
- const useAppState = useAppStore()
- const projectId = ref(useAppState.getProjectId)
- const contractId = ref(useAppState.getContractId)
- const projectInfo = ref(useAppState.getProjectInfo)
- const isCollapse = ref(useAppState.getCollapse)
- //上传进度
- const uploadsLoading = ref(false)
- const treeRef = ref(null)
- //监听
- watch(() => [
- useAppState.getCollapse,
- ], ([Collapse]) => {
- isCollapse.value = Collapse
- })
- //监听
- watch(() => [useAppState.getProjectId, useAppState.getContractId, useAppState.getProjectInfo], ([pid, cid, info]) => {
- projectId.value = pid
- contractId.value = cid
- projectInfo.value = info
- }, { deep: true })
- //加载中
- const isAppLoading = computed(() => {
- return !isNullES(projectId.value) && !isNullES(contractId.value)
- })
- //监听变化
- watch(() => isAppLoading.value, (val) => {
- if (val) {
- treeLoading.value = true
- setTableColumns()
- }
- })
- //渲染完成
- onMounted(() => {
- if (isAppLoading.value) {
- treeLoading.value = true
- setTableColumns()
- }
- })
- //设置树菜单数据
- const ElTreeMenu = ref([
- { icon: 'add-circle', label: '新增', key: 'add' },
- { icon: 'draft', label: '编辑', key: 'edit' },
- { icon: 'delete-bin', label: '删除', key: 'del' },
- { icon: 'refresh', label: '目录同步', key: 'sync' },
- { icon: 'sort-asc', label: '排序', key: 'sort' },
- ])
- const dutyUser = ref('')
- //设置责任者
- const setdutyUser = async () => {
- const { error, code, data } = await archiveFileApi.getDutyUser({
- contractId: treecontractId.value,
- projectId: projectId.value,
- })
- if (!error && code === 200) {
- if (data?.contractType === 1) {
- dutyUser.value = data?.constructionUnitName || ''
- } else if (data?.contractType === 2) {
- dutyUser.value = data?.supervisionUnitName || ''
- } else if (data?.contractType === 3) {
- dutyUser.value = data?.contractorUnitName || ''
- }
- }
- }
- //打开文件选择框
- const uploadFileClick = () => {
- HcUploadFileApi({
- multiple: true,
- progress: () => {
- uploadsLoading.value = true
- },
- success: (file, res) => {
- uploadsChange(file.id, res.data)
- },
- error: (file) => {
- uploadsLoading.value = false
- window.$message.error(`${file.name} 上传失败`)
- },
- finish: () => {
- uploadsLoading.value = false
- window.$message.success('全部上传完成')
- },
- })
- }
- //替换文件
- const substitutionClick = (row) => {
- HcUploadFileApi({
- multiple: false,
- progress: () => {
- uploadsLoading.value = true
- },
- success: (_, { data }) => {
- //更新数据
- row.fileName = data?.originalName
- row.ossFileName = data?.name || ''
- row.fileUrl = data?.link || ''
- row.pdfFileUrl = data?.pdfUrl || ''
- row.filePage = data?.page || ''
- row.isUpdateUrl = 1
- uploadsLoading.value = false
- window.$message.success('上传成功')
- },
- error: (file) => {
- uploadsLoading.value = false
- window.$message.error(`${file.name} 上传失败`)
- },
- })
- }
- //树加载
- const treeLoading = ref(false)
- const treeNodeLoading = () => {
- treeLoading.value = false
- }
- const treePanelLoading = ref(false)
- const panelTreeLoading = () => {
- treePanelLoading.value = false
- }
- //审批状态
- const approvalStatus = ref([
- { label: '未上报', value: '0' },
- { label: '待审批', value: '1' },
- { label: '已审批', value: '2' },
- ])
- //认证状态
- const certifiedStatus = ref([
- { label: '已认证', value: '1' },
- { label: '未认证', value: '0' },
- ])
- //搜索表单
- const searchForm = ref({
- nodeIds: '',
- approval: null, certified: null, queryValue: null,
- current: 1, size: 20, total: 0,
- })
- //树相关的变量
- const isBuiltDrawing = ref(0)
- const isStorageNode = ref(0)
- const nodeIds = ref('')
- const treecontractId = ref('')
- //自动展开缓存
- const treeAutoExpandKeys = ref(getStoreValue('wbsTreeExpandKeys') || [])
- const projectTreeClick = ({ data, keys }) => {
- setStoreValue('wbsTreeExpandKeys', keys)
- treeAutoExpandKeys.value = keys || []
- nodeIds.value = data.id || ''
- isStorageNode.value = data['isStorageNode'] || 0
- treecontractId.value = data?.contractId || ''
- //设置搜索数据
- searchForm.value.current = 1
- searchForm.value.nodeIds = data.id || ''
- sortSearchForm.value.nodeIds = data.id || ''
- isBuiltDrawing.value = data.storageType
- getTableData()
- }
- //树菜单被点击
- const ElTreeMenuClick = async ({ data, keys }) => {
- // debugger
- setStoreValue('wbsTreeExpandKeys', keys)
- treeAutoExpandKeys.value = keys || []
- if (data?.extType === 2) {
- // 声像节点显示声像文件同步菜单
- ElTreeMenu.value = [
- { icon: 'add-circle', label: '新增', key: 'add' },
- { icon: 'draft', label: '编辑', key: 'edit' },
- { icon: 'delete-bin', label: '删除', key: 'del' },
- { icon: 'refresh', label: '目录同步', key: 'sync' },
- { icon: 'refresh', label: '文件同步', key: 'fileSync' },
- { icon: 'sort-asc', label: '排序', key: 'sort' },
- ]
- } else {
- if (data?.associationType === 3) {
- //声像
- ElTreeMenu.value = [
- { icon: 'add-circle', label: '新增', key: 'add' },
- { icon: 'draft', label: '编辑', key: 'edit' },
- { icon: 'delete-bin', label: '删除', key: 'del' },
- //{ icon: 'refresh', label: '目录同步', key: 'sync' },
- { icon: 'sort-asc', label: '排序', key: 'sort' },
- { icon: 'refresh', label: '声像文件同步', key: 'syncVocie' },
- ]
- } else if (data?.associationType === 6) {
- //日志
- ElTreeMenu.value = [
- { icon: 'add-circle', label: '新增', key: 'add' },
- { icon: 'draft', label: '编辑', key: 'edit' },
- { icon: 'delete-bin', label: '删除', key: 'del' },
- //{ icon: 'refresh', label: '目录同步', key: 'sync' },
- { icon: 'sort-asc', label: '排序', key: 'sort' },
- { icon: 'refresh', label: '日志文件同步', key: 'syncVocie' },
- ]
- } else if (data?.associationType === 2) {
- //试验
- ElTreeMenu.value = [
- { icon: 'add-circle', label: '新增', key: 'add' },
- { icon: 'draft', label: '编辑', key: 'edit' },
- { icon: 'delete-bin', label: '删除', key: 'del' },
- //{ icon: 'refresh', label: '目录同步', key: 'sync' },
- { icon: 'sort-asc', label: '排序', key: 'sort' },
- { icon: 'refresh', label: '试验文件同步', key: 'syncVocie' },
- ]
- } else {
- ElTreeMenu.value = [
- { icon: 'add-circle', label: '新增', key: 'add' },
- { icon: 'draft', label: '编辑', key: 'edit' },
- { icon: 'delete-bin', label: '删除', key: 'del' },
- { icon: 'refresh', label: '目录同步', key: 'sync' },
- { icon: 'sort-asc', label: '排序', key: 'sort' },
- ]
- }
- }
- }
- //回车搜索
- const keyUpEvent = (e) => {
- if (e.key === 'Enter') {
- searchForm.value.current = 1
- getTableData()
- }
- }
- //搜索
- const searchClick = () => {
- searchForm.value.current = 1
- getTableData()
- }
- //分页被点击
- const pageChange = ({ current, size }) => {
- searchForm.value.current = current
- searchForm.value.size = size
- getTableData()
- }
- //表格数据
- const tableRef = ref(null)
- const tableColumn = ref([])
- //设置表头
- const setTableColumns = () => {
- if (isBuiltDrawing.value === 1) {
- tableColumn.value = [
- { key: 'sourceType', name: '文件来源', width: 100 },
- { key: 'fileNumber', name: '文件编号', width: 100, autoWidth: true },
- { key: 'fileName', name: '文件名称' },
- { key: 'filePage', name: '文件页数', width: 120 },
- { key: 'sheetType', name: '图幅', width: 110 },
- { key: 'sheetSourceValue', name: '图表来源', width: 110 },
- { key: 'drawingNo', name: '图号', width: 110 },
- { key: 'citeChangeNumber', name: '引用变更令编号', width: 110 },
- { key: 'isCertificationValue', name: '认证状态', width: 100 },
- { key: 'isApprovalValue', name: '状态', width: 100 },
- { key: 'fileTime', name: '文件时间', width: 120, autoWidth: true },
- { key: 'dutyUser', name: '责任者', width: 140 },
- ]
- sheetTypeStatus()
- sheetSourceStatus()
- } else {
- tableColumn.value = [
- { key: 'sourceType', name: '文件来源', width: 100 },
- { key: 'fileNumber', name: '文件编号', width: 100, autoWidth: true },
- { key: 'fileName', name: '文件名称' },
- { key: 'filePage', name: '文件页数', width: 100 },
- { key: 'isCertificationValue', name: '认证状态', width: 100 },
- { key: 'isApprovalValue', name: '状态', width: 100 },
- { key: 'fileTime', name: '文件时间', width: 120, autoWidth: true },
- { key: 'dutyUser', name: '责任者', width: 140 },
- ]
- }
- }
- const tableData = ref([])
- //获取数据
- const tableLoading = ref(false)
- const getTableData = async () => {
- tableLoading.value = true
- fileTotalPage.value = 0
- const { error, code, data } = await archiveFileApi.getarchiveFilePage({
- ...searchForm.value,
- projectId: projectId.value,
- contractId: contractId.value,
- })
- 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
- }
- getFileTotalPage()
- }
- //获取当前页的总页数
- const fileTotalPage = ref(0)
- const getFileTotalPage = () => {
- const arr = tableData.value
- if (arr.length <= 0) {
- fileTotalPage.value = 0
- return
- }
- //遍历数据
- let newPage = 0
- for (let i = 0; i < arr.length; i++) {
- newPage = newPage + Number(arr[i].filePage || 0)
- }
- fileTotalPage.value = newPage
- }
- //多选
- const tableCheckedKeys = ref([])
- const tableSelection = (rows) => {
- tableCheckedKeys.value = rows
- }
- //分盒整理
- const sortingModal = ref(false)
- const sortingClick = async () => {
- if (nodeIds.value && isStorageNode.value === 1) {
- const { error, code, data } = await archiveFileApi.getBoxNameAndBoxNumber({
- nodeId: nodeIds.value,
- })
- if (!error && code === 200) {
- if (data.length > 0) {
- sortingActiveKey.value = []
- sortingModal.value = true
- sortingItemData.value = getArrValue(data)
- sortingOldData.value = deepClone(sortingItemData.value)
- } else {
- console.log(1111111)
- sortingNoneModal.value = true
- }
- }
- } else {
- window?.$message?.warning('请先选择一个子节点')
- }
- }
- const sortingNoneModal = ref(false)//无数据显示的弹窗
- const toSortingModal = () => {
- sortingNoneModal.value = false
- sortingActiveKey.value = []
- sortingItemData.value = []
- sortingModal.value = true
- }
- const sortingNoneModalClose = () => {
- sortingNoneModal.value = false
- }
- const sortingItemData = ref([])
- const sortingOldData = ref([])//旧数据,用来对比是否修改名字
- //校验
- const tableIsInput = (val, row, key) => {
- //检测是否改过案卷名字
- if (key === 'isName') {
- row.isChange = true
- }
- row[key] = !val
- }
- const sortingActiveKey = ref([])
- const tableIndex = ref('')
- const sortingSelectFile = (row, index) => {
- tableIndex.value = index
- const key = `item-${index}`
- const indexNum = sortingActiveKey.value.indexOf(key)
- if (indexNum > -1) {
- sortingActiveKey.value.splice(indexNum, 1)
- } else {
- sortingActiveKey.value.push(key)
- if (!(row.list && row.list.length > 0)) {
- getSortingTableData(row, index)
- }
- }
- }
- //表格
- const sortingTableColumn = [
- { key: 'name', name: '文件名称' },
- ]
- //获取数据
- const sortingTableLoading = ref(false)
- const getSortingTableData = async (row, index) => {
- sortingTableLoading.value = true
- tableindex.value = index
- const { error, code, data } = await archiveFileApi.pageByBoxName({
- size: 99999,
- current: 1,
- projectId: projectId.value,
- contractId: contractId.value,
- nodeIds: nodeIds.value,
- boxName: row.boxName ? row.boxName : '',
- })
- sortingTableLoading.value = false
- if (!error && code === 200) {
- row.list = getArrValue(data['records'])
- setTableCheck(row, index).then()
- } else {
- row.list = []
- }
- }
- //表格ref
- const sorTableRef = ref([])
- const tableindex = ref('')
- //回显勾选
- const setTableCheck = async (row, index) => {
- if (row.ids) {
- const keys = row.ids.split(','), list = row.list
- for (let i = 0; i < list.length; i++) {
- const item = list[i]
- if (keys.indexOf(item.id) > -1) {
- item.checked = true
- await nextTick()
- // console.log(sorTableRef.value[index], 'sorTableRef.value[index]')
- sorTableRef.value[index].toggleRowSelection(item, true)
- }
- }
- }
- }
- //多选
- const checkList = ref([])
- const arrfliter = ref([])
- const singleCheck = async ({ row }) => {
- let isCheck = false
- let checkrow = JSON.parse(JSON.stringify(row))
- if (checkrow.checked === false || checkrow.checked === undefined) {
- if (checkList.value.length > 0) {
- let arr = checkList.value.filter(e => e.id === checkrow.id)
- if (arr.length > 0) {
- window.$message.warning('多个盒子不能选择同一份文件')
- await nextTick()
- sorTableRef.value[tableindex.value].toggleRowSelection(row, false)
- isCheck = true
- } else {
- isCheck = false
- row.tableindex = tableindex.value
- checkList.value.push(row)
- }
- } else {
- row.tableindex = tableindex.value
- checkList.value.push(row)
- }
- } else {
- let arr = checkList.value.filter(e => e.id === checkrow.id)
- if (isCheck === false && arr[0]?.checked === true || isCheck) {
- arrfliter.value = checkList.value.filter(e => e.id !== checkrow.id)
- } else {
- arrfliter.value = checkList.value
- }
- let newarr = []
- arrfliter.value.forEach((item) => {
- newarr.push(JSON.parse(JSON.stringify(item)))
- })
- checkList.value = newarr
- }
- }
- const sortingTableSelection = (rows, list, index) => {
- tableindex.value = index
- if (list) {
- list.forEach(element => {
- element.checked = false
- })
- }
- rows.forEach((element) => {
- element.checked = true
- })
- }
- //删除
- const sortingDelData = (row, index) => {
- sortingItemData.value.splice(index, 1)
- console.log(checkList.value, 'checkList.value')
- // checkList.value=[]
- //过滤掉当前选择的文件
- checkList.value = checkList.value.filter(e => e.tableindex !== index)
- if (row.boxNumber) {
- HcDelMsg(async (resolve) => {
- const { error, code } = await archiveFileApi.removeAllocation({
- boxName: row.boxName,
- boxNumber: row.boxNumber,
- })
- if (!error && code === 200) {
- window.$message?.success('删除成功!')
- sortingClick()
- }
- resolve() //关闭弹窗的回调
- })
- }
- }
- //添加分盒
- const addSortingModalClick = () => {
- console.log('添加分盒')
- sortingItemData.value.push({
- boxName: '',
- })
- }
- //确认保存
- const sortingModalLoading = ref(false)
- const sortingModalSave = async () => {
- sortingModalLoading.value = true
- //检测案卷名是否重复
- let nameRes = await checkNames()
- //console.log(nameRes)
- //return;
- for (let i = 0; i < nameRes.length; i++) {
- if (typeof nameRes[i].data == 'string') {
- window.$message?.error(nameRes[i].data + ',案卷名重复')
- sortingModalLoading.value = false
- return
- }
- }
- //组装数据
- let rows = []
- sortingItemData.value.forEach((item, index) => {
- let obj = {
- ids: '',
- boxName: item.boxName,
- boxNumber: index + 1,
- }
- let list = []
- if (item.list) {
- item.list.forEach((item2) => {
- if (item2.checked) {
- list.push(item2.id)
- }
- })
- obj.ids = list.join(',')
- } else {
- obj.ids = item.ids
- }
- rows.push(obj)
- })
- console.log(rows, 'rows')
- if (rows[0]?.ids) {
- const { error, code, data } = await archiveFileApi.allocation({
- list: rows,
- })
- if (!error && code === 200) {
- window.$message?.success('保存成功')
- sortingModal.value = false
- } else {
- window.$message?.error('保存失败')
- }
- } else {
- window.$message?.warning('空数据不能提交')
- }
- sortingModalLoading.value = false
- }
- const checkNames = () => {
- const arr = []
- sortingItemData.value.forEach((item) => {
- if (item.boxNumber) {
- if (item.isChange) {
- //是否修改过
- //对比旧的数据,是否相同
- for (let i = 0; i < sortingOldData.value.length; i++) {
- if (sortingOldData.value[i].boxNumber == item.boxNumber) {
- if (sortingOldData.value[i].boxName != item.boxName) {
- arr.push(
- archiveFileApi.getIsBoxName({
- boxName: item.boxName,
- }),
- )
- }
- return
- }
- }
- }
- } else {
- arr.push(
- archiveFileApi.getIsBoxName({
- boxName: item.boxName,
- }),
- )
- }
- })
- return Promise.all(arr)
- }
- //关闭
- const sortingModalClose = () => {
- sortingModal.value = false
- }
- //删除
- const delModalClick = () => {
- const rows = tableCheckedKeys.value
- //待审批,已审批都不能删除 豆海涛说,先取消限制
- /*const result = rows.some(({ isApprovalValue }) => {
- return isApprovalValue === '待审批' || isApprovalValue === '已审批'
- })
- if (result) {
- window.$message.warning('待审批或者已审批的文件都不能删除')
- return
- }
- if (rows.length <= 0) {
- window.$message?.error('请选择需要删除的数据')
- } else {
- HcDelMsg(async (resolve) => {
- const keys = arrToId(rows)
- const { error, code } = await archiveFileApi.removeFile({
- ids: keys,
- })
- if (!error && code === 200) {
- window.$message?.success('删除成功!')
- searchClick()
- }
- resolve() //关闭弹窗的回调
- })
- }*/
- HcDelMsg(async (resolve) => {
- const keys = arrToId(rows)
- const { error, code } = await archiveFileApi.removeFile({
- ids: keys,
- })
- if (!error && code === 200) {
- window.$message?.success('删除成功!')
- searchClick()
- }
- resolve() //关闭弹窗的回调
- })
- }
- //废除
- const repealModalClick = async () => {
- const rows = tableCheckedKeys.value
- if (rows.length <= 0) {
- window.$message?.error('请选择需要废除的数据')
- } else {
- window?.$messageBox?.alert('请谨慎考虑后,确认是否需要废除?', '废除提醒', {
- showCancelButton: true,
- confirmButtonText: '确认废除',
- cancelButtonText: '取消',
- type: 'warning',
- callback: async (action, instance, done) => {
- if (action === 'confirm') {
- instance.confirmButtonLoading = true
- const keys = arrToId(rows)
- const { error, code } = await tasksFlowApi.batchRepealTaskArchive({
- ids: keys,
- type: 1,
- projectId: projectId.value,
- contractId: contractId.value,
- })
- if (!error && code === 200) {
- window.$message?.success('废除成功!')
- searchClick()
- }
- instance.confirmButtonLoading = false
- done()
- } else {
- done()
- }
- },
- })
- }
- }
- //跨目录移动
- const movesModal = ref(false)
- const movesClick = async () => {
- movesModal.value = true
- checkedMoves.value = []
- movesCheckAll.value = false
- treePanelLoading.value = true
- fileDatasListLoading.value = true
- const { error, code, data } = await archiveFileApi.getarchiveFilePage({
- ...searchForm.value,
- current: 1,
- size: 50000,
- projectId: projectId.value,
- contractId: contractId.value,
- })
- fileDatasListLoading.value = false
- if (!error && code === 200) {
- fileDatasList.value = getArrValue(data['records'])
- } else {
- fileDatasList.value = []
- }
- }
- //选择需要迁移的文件
- const movesCheckAll = ref(false)
- const isIndeterminate = ref(true)
- const checkedMoves = ref([])
- //左侧待迁移文件
- const fileDatasList = ref([])
- const fileDatasListLoading = ref(false)
- //全选
- const handleCheckAllChange = (val) => {
- console.log(val, 'val')
- const checked = fileDatasList.value
- checkedMoves.value = val ? checked : []
- isIndeterminate.value = false
- }
- //勾选
- const handleCheckedMovesChange = (value) => {
- const keys = fileDatasList.value
- const checkedCount = value.length
- movesCheckAll.value = checkedCount === keys.length
- isIndeterminate.value = checkedCount > 0 && checkedCount < keys.length
- }
- //右侧radio
- let radioNodeId = ''
- const radioChange = (id) => {
- //console.log(id)
- radioNodeId = id
- }
- //只显示储存节点的单选
- const showRadioFun = (data) => {
- if (data.isStorageNode == 1) {
- return true
- } else {
- return false
- }
- }
- //保存
- const movesModalLoading = ref(false)
- const movesModalSave = async () => {
- const keys = rowsToId(checkedMoves.value)
- let ids = keys
- if (checkedMoves.value.length < 1) {
- window.$message?.warning('请勾选需要迁移的文件')
- return
- }
- if (radioNodeId == '') {
- window.$message?.warning('请选择要移动到的节点')
- return
- }
- movesModalLoading.value = true
- const { error, code, data } = await archiveFileApi.migrateFile({
- ids: ids,
- nodeId: radioNodeId,
- })
- movesModalLoading.value = false
- if (!error && code === 200) {
- window.$message?.success('保存成功')
- movesModal.value = false
- getTableData()
- } else {
- window.$message?.error('保存失败')
- }
- }
- //关闭
- const movesModalClose = () => {
- movesModal.value = false
- }
- //表格排序
- const sortModal = ref(false)
- //显示
- const tableSortClick = () => {
- sortModal.value = true
- getSortTableData()
- }
- //搜索表单
- const sortSearchForm = ref({
- nodeIds: '',
- current: 1, size: 20, total: 0,
- })
- //分页被点击
- const sortPageChange = ({ current, size }) => {
- sortSearchForm.value.current = current
- sortSearchForm.value.size = size
- getSortTableData()
- }
- //表格数据
- const sortTableColumn = ref([
- { key: 'fileNumber', name: '文件编号', width: 160 },
- { key: 'fileName', name: '文件名称' },
- { key: 'fileTime', name: '文件时间', width: 120 },
- { key: 'action', name: '排序', width: 90 },
- ])
- const sortTableData = ref([])
- const sortTableLoading = ref(false)
- const getSortTableData = async () => {
- sortTableLoading.value = true
- const { error, code, data } = await archiveFileApi.getarchiveFilePage({
- ...sortSearchForm.value,
- projectId: projectId.value,
- contractId: contractId.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
- }
- }
- //拖动完成
- const sortTableRowDrop = (rows) => {
- sortTableData.value = [] // 先清空,否则排序会异常
- nextTick(() => {
- 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 = async () => {
- await batchEditSaveApi(sortTableData.value)
- sortModal.value = false
- }
- //关闭
- const sortModalClose = () => {
- sortModal.value = false
- }
- //获取认证状态
- const certificationType = ref([])
- const certificationStatus = async () => {
- const { error, code, data } = await tasksApi.queryTaskTypeStatus({
- typeOrStatus: 'certification_status',
- })
- //处理数据
- if (!error && code === 200) {
- certificationType.value = getArrValue(data)
- } else {
- certificationType.value = []
- }
- }
- //获取图幅类型
- const sheetType = ref([])
- const sheetTypeStatus = async () => {
- console.log(1111111)
- const { error, code, data } = await tasksApi.queryTaskTypeStatus({
- typeOrStatus: 'sheet_type',
- })
- //处理数据
- if (!error && code === 200) {
- sheetType.value = getArrValue(data)
- } else {
- sheetType.value = []
- }
- }
- //获取图表来源
- const sheetSourceType = ref([])
- const sheetSourceStatus = async () => {
- const { error, code, data } = await tasksApi.queryTaskTypeStatus({
- typeOrStatus: 'sheet_source',
- })
- //处理数据
- if (!error && code === 200) {
- sheetSourceType.value = getArrValue(data)
- } else {
- sheetSourceType.value = []
- }
- }
- //新增文件
- const tableUploadType = ref('add')
- const showUploadModal = ref(false)
- const uploadModalClick = () => {
- if (nodeIds.value && isStorageNode.value === 1) {
- tableUploadType.value = 'add'
- setTableUploadColumn()
- uploadSaveLoading.value = false
- tableUploadData.value = []
- showUploadModal.value = true
- setdutyUser()
- } else {
- window?.$message?.warning('请先选择一个子节点')
- }
- }
- const uploadModalClose = () => {
- batchUploadCancel()
- }
- //设置文件表头
- const tableUploadColumn = ref([
- { key: 'fileNumber', name: '文件编号' },
- { key: 'fileName', name: '文件名称' },
- { key: 'fileTime', name: '文件时间' },
- { key: 'isApproval', name: '是否需要审批', width: 80 },
- { key: 'isNeedCertification', name: '是否需要认证', width: 80 },
- { key: 'dutyUser', name: '责任者' },
- { key: 'isElement', name: '是否四要素' },
- { key: 'action', name: '操作', width: 220 },
- ])
- const setTableUploadColumn = () => {
- const type = tableUploadType
- if (isBuiltDrawing.value === 2) {
- tableUploadColumn.value = [
- { key: 'fileNumber', name: '文件编号', width: 200 },
- { key: 'fileName', name: '文件名称', minWidth: 400 },
- { key: 'fileTime', name: '文件时间', width: 140 },
- { key: 'sheetType', name: '图幅', width: 100 },
- { key: 'sheetSource', name: '图表来源', width: 100 },
- { key: 'drawingNo', name: '图号', width: 140 },
- { key: 'citeChangeNumber', name: '引用变更令编号', width: 140 },
- { key: 'isApproval', name: '是否需要审批', width: 100 },
- { key: 'isNeedCertification', name: '是否需要认证', width: 100 },
- { key: 'dutyUser', name: '责任者', width: 160 },
- { key: 'isElement', name: '是否四要素', width: 90 },
- {
- key: 'action', name: '操作',
- width: type.value === 'edit' ? 220 : 70,
- align: 'center', fixed: 'right',
- },
- ]
- sheetTypeStatus()
- sheetSourceStatus()
- } else {
- tableUploadColumn.value = [
- { key: 'fileNumber', name: '文件编号', width: 200 },
- { key: 'fileName', name: '文件名称' },
- { key: 'fileTime', name: '文件时间', width: 140 },
- { key: 'isApproval', name: '是否需要审批', width: 100 },
- { key: 'isNeedCertification', name: '是否需要认证', width: 100 },
- { key: 'dutyUser', name: '责任者', width: 160 },
- { key: 'isElement', name: '是否四要素', width: 90 },
- {
- key: 'action', name: '操作',
- width: type.value === 'edit' ? 220 : 70,
- align: 'center', fixed: 'right',
- },
- ]
- }
- }
- const tableUploadData = ref([])
- //上传的文件结果
- const uploadsChange = (fileId, item) => {
- if (getObjVal(item)) {
- let newArr = tableUploadData.value
- const sheet = sheetType.value, source = sheetSourceType.value
- let name = item['originalName'] || ''
- let fileName = name.substring(0, name.lastIndexOf('.'))
- newArr.push({
- fileUploadId: fileId,
- projectId: projectId.value,
- contractId: contractId.value,
- nodeId: nodeIds.value,
- fileNumber: '',
- fileName: fileName,
- ossFileName: item?.name || '',
- fileTime: null,
- fileUrl: item?.link || '',
- sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '' : '',
- sheetSource: source.length > 0 ? source[0]['dictKey'] || '' : '',
- drawingNo: '',
- citeChangeNumber: '',
- isApproval: 1,
- isNeedCertification: 1,
- dutyUser: dutyUser.value,
- pdfFileUrl: item?.pdfUrl || '',
- filePage: item?.page || '',
- isElement: 0,
- isUpdateUrl: 0,
- fileSize: item?.fileSize,
- })
- //tableUploadData.value = newArr
- tableUploadData.value = arrKeySort(newArr, 'fileUploadId')
- } else {
- console.log(item)
- }
- }
- //表单下拉数据
- const whetherData = ref([
- { label: '不需要', value: 0 },
- { label: '需要', value: 1 },
- ])
- //表格数据排序
- const tableUploadRowSort = (arr) => {
- tableUploadData.value = arr
- }
- //删除
- const delUploadData = async (row, index) => {
- if (row['ossFileName']) {
- row['delBtnLoading'] = true
- await ossApi.removeFile({ fileName: row['ossFileName'] })
- row['delBtnLoading'] = false
- tableUploadData.value.splice(index, 1)
- } else {
- tableUploadData.value.splice(index, 1)
- }
- }
- //批量上传保存
- const uploadSaveLoading = ref(false)
- const batchUploadSave = async () => {
- const rows = tableUploadData.value
- if (rows.length > 0) {
- //验证表单数据
- uploadSaveLoading.value = true
- let isTableRows = false
- for (let i = 0; i < rows.length; i++) {
- // if (!rows[i]['fileNumber']) {
- // rows[i]['isFileNumber'] = true
- // isTableRows = true
- // } else if (!rows[i]['fileName']) {
- // rows[i]['isFileName'] = true
- // isTableRows = true
- // }
- // if (!rows[i]['fileTime']) {
- // rows[i]['isFileTime'] = true
- // isTableRows = true
- // }
- // else
- if (!rows[i]['fileName']) {
- rows[i]['isFileName'] = true
- isTableRows = true
- }
- }
- //判断数据
- if (isTableRows) {
- uploadSaveLoading.value = false
- window.$message?.warning('请先完善表单信息')
- } else {
- if (tableUploadType.value === 'add') {
- await batchUploadSaveApi(rows)
- } else {
- await batchEditSaveApi(rows)
- }
- }
- } else {
- window.$message?.warning('请先上传文件')
- }
- }
- //确认上传保存
- 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 batchUploadCancel = () => {
- tableUploadData.value = []
- uploadSaveLoading.value = false
- uploadsLoading.value = false
- showUploadModal.value = false
- }
- //上传新文件
- // const newUploadsChange = ({fileList}, row) => {
- // if (fileList.length > 0) {
- // tableUploadType.value = 'edit'
- // const item = fileList[0]
- // const name = item['originalName'] || ''
- // const fileName = name.substring(0, name.lastIndexOf("."))
- // //更新数据
- // row.fileName = fileName;
- // row.ossFileName = item?.name || ''
- // row.fileUrl = item?.link || ''
- // row.pdfFileUrl = item?.pdfUrl || ''
- // row.filePage = item?.page || ''
- // row.isUpdateUrl=1
- // }
- // }
- // const newUploadsProgress = (val, row) => {
- // row.newBtnLoading = val
- // }
- //批量编辑
- const batchEditClick = () => {
- const rows = deepClone(tableCheckedKeys.value)
- //判断是否满足条件 豆海涛说,先取消限制
- /*const result = rows.every(({ status }) => {
- return status !== 1 && status !== 2
- })
- //判断状态
- if (result) {
- tableUploadType.value = 'edit'
- setTableUploadColumn()
- uploadSaveLoading.value = false
- tableUploadData.value = rows
- showUploadModal.value = true
- } else {
- window.$message?.warning('已上报或已审批的文件不能编辑')
- }*/
- tableUploadType.value = 'edit'
- setTableUploadColumn()
- uploadSaveLoading.value = false
- tableUploadData.value = rows
- showUploadModal.value = true
- }
- //确认编辑上传保存
- const batchEditSaveApi = async (rows) => {
- uploadSaveLoading.value = true
- const { error, code } = await archiveFileApi.batchUpdateSort({
- list: rows,
- }, false)
- //判断状态
- uploadSaveLoading.value = false
- if (!error && code === 200) {
- window.$message?.success('保存成功')
- batchUploadCancel()
- getTableData()
- } else {
- window.$message?.error('保存失败')
- }
- }
- //批量认证
- const CertData = ref([])
- const CertIds = ref([])
- const CertPdf = ref('')
- const CertColumns = [
- { key: 'fileName', name: '文件名称' },
- { key: 'action', name: '操作', width: 100 },
- ]
- //批量认证弹窗
- const showCertificationModal = ref(false)
- const certificationModalClick = () => {
- const rows = tableCheckedKeys.value
- CertData.value = rows
- CertIds.value = rowsToId(rows)
- CertPdf.value = rows[0]?.pdfFileUrl || ''
- const result = rows.every(({ isCertification }) => {
- return isCertification === 0
- })
- const result1 = rows.every(({ status }) => {
- return status === 0 || status === 3
- })//已上报不能认证
- if (!result1) {
- window.$message.warning('已上报的文件不能进行认证')
- } else {
- if (result) {
- CertData.value = rows
- CertIds.value = rowsToId(rows)
- CertPdf.value = rows[0]?.pdfFileUrl || ''
- showCertificationModal.value = true
- } else {
- window.$message?.warning('已认证的文件不能再认证')
- }
- }
- }
- //认证行被点击
- const CertRowClick = ({ row }) => {
- const pdfFileUrl = row?.pdfFileUrl || ''
- if (CertPdf.value !== pdfFileUrl) {
- CertPdf.value = pdfFileUrl
- }
- }
- //认证预览被点击
- const CertRowClick2 = ({ pdfFileUrl }) => {
- const pdfUrl = pdfFileUrl || ''
- if (CertPdf.value !== pdfUrl) {
- CertPdf.value = pdfUrl
- }
- }
- //确认认证
- const CertLoading = ref(false)
- const CertClick = async () => {
- CertLoading.value = true
- const { error, code, msg } = await tasksFlowApi.batchCertification({
- ids: CertIds.value,
- }, false)
- //判断状态
- CertLoading.value = false
- if (!error && code === 200) {
- window.$message?.success('认证成功')
- showCertificationModal.value = false
- searchClick()
- } else {
- window.$message?.error(msg)
- }
- }
- //名称被点击
- const tableRowName = (row) => {
- if (row?.isCertificationValue === '已认证' || row?.isApprovalValue === '已审批') {
- if (row['eVisaFile']) {
- toPdfPage(row['eVisaFile'])
- } else if (row['pdfFileUrl']) {
- toPdfPage(row['pdfFileUrl'])
- } else {
- window.$message?.warning('文件不存在')
- }
- } else {
- if (row['pdfFileUrl']) {
- toPdfPage(row['pdfFileUrl'])
- } else {
- window.$message?.warning('文件不存在')
- }
- }
- }
- //上报
- const isReport = ref(false)
- const reportData = ref([])
- const reportModalClick = () => {
- reportData.value = []
- const rows = tableCheckedKeys.value
- //判断是否满足条件
- const result = rows.every(({ status }) => {
- return status === 0 || status === 3
- })
- const result1 = rows.every(({ isCertification }) => {
- return isCertification === 1
- })
- if (result1) {
- window.$message?.warning('已认证的文件不能进行上报')
- return false
- } else {
- if (!result) {
- window.$message?.warning('已上报的文件不能进行再次上报')
- return false
- }
- }
- rows.sort((a, b) => a.sort - b.sort)
- //展示上报弹窗
- reportData.value = rows
- console.log(reportData.value, ' reportData.valu')
- isReport.value = true
- }
- //上报完成
- const reportFinish = () => {
- searchClick()
- }
- //在线验签
- const onlineLoading = ref(false)
- const onlineVerifyData = ref({})
- const isOnlineVerifyDrawer = ref(false)
- const onlineVerifyOptions = {
- sizes: [50, 50],
- snapOffset: 0,
- minSize: ['10%', '80%'],
- }
- const batchOnline = async () => {
- const rows = tableCheckedKeys.value
- if (rows.length > 1) {
- window.$message?.warning('在线验签只能勾选一条数据进行验签')
- return
- }
- //判断是否满足条件
- const result = rows.every(({ status }) => {
- return status === 2
- })
- //判断状态
- if (!result) {
- window.$message?.warning('存在未审批或未上报数据')
- return
- }
- //发起请求
- //const ids = arrToId(rows)
- onlineLoading.value = true
- /*const { error, code, msg, data } = await queryApi.onlineVerify({
- ids: ids,
- })
- //处理数据
- onlineLoading.value = false
- if (!error && code === 200) {
- onlineVerifyData.value = getObjValue(data)
- //cscTableData.value = getArrValue(data['certBeanVOList'])
- isOnlineVerifyDrawer.value = true
- } else {
- onlineVerifyData.value = {}
- window.$message?.error(msg ?? '操作失败')
- }*/
- onlineVerifyData.value = {}
- isOnlineVerifyDrawer.value = true
- }
- //签名信息
- const cscTableColumn = [
- { key: 'user', name: '签名者', width: 300 },
- { key: 'time', name: '签名时间', width: 200 },
- { key: 'val', name: '摘要' },
- ]
- const cscTableData = ref([])
- //在线验签抽屉被关闭
- const onlineVerifyDrawerClose = () => {
- isOnlineVerifyDrawer.value = false
- onlineLoading.value = false
- }
- //处理时间
- const getTableFileTime = (time) => {
- if (isNullES(time)) return ''
- return time.replace(/-/g, '')
- }
- </script>
- <style lang="scss">
- @import '~style/file/collection.scss';
- //在线验签
- .hc-online-verify-drawer .el-card.hc-new-card-box {
- .hc-card-header-box {
- .online-verify-title {
- font-size: 20px;
- }
- .online-verify-icon {
- display: flex;
- align-items: center;
- cursor: pointer;
- color: #5a5959;
- i {
- font-size: 18px;
- }
- &:hover {
- color: var(--el-color-primary);
- }
- }
- }
- }
- html.dark .hc-online-verify-drawer .el-card.hc-new-card-box {
- background-color: var(--hc-bg-color);
- .hc-card-header-box {
- .online-verify-icon {
- color: var(--el-color-primary);
- }
- }
- }
- </style>
|