阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2074 lines
88 KiB

3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
7 months ago
7 months ago
2 years ago
3 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
3 years ago
1 year ago
1 year ago
3 years ago
4 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
4 weeks ago
3 years ago
1 year ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
1 year ago
1 year ago
4 months ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
4 months ago
4 months ago
3 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
5 months ago
3 years ago
2 weeks ago
2 weeks ago
2 weeks ago
2 weeks ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
4 months ago
4 months ago
4 months ago
4 months ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
5 months ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
4 months ago
3 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
4 weeks ago
4 weeks ago
4 weeks ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
4 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
3 years ago
  1. <template>
  2. <div>
  3. <div class="collect-header">
  4. <h4 :class="classType">{{ collectTitle }} </h4>
  5. <div class="collect-filter">
  6. <treeselect
  7. v-if="selectedCategory.arrangeType === 3 && isTitleType !== 4 && isTitleType !== 6 && activeIndex !== 1"
  8. v-model="query.project_class"
  9. :options="projectOptions"
  10. style="width: 180px;"
  11. :flat="false"
  12. :multiple="false"
  13. :normalizer="normalizerProject"
  14. :default-expand-level="Infinity"
  15. :placeholder="projectPlaceholder"
  16. @input="handleSearch(collectLevel)"
  17. @select="handleSearch(collectLevel)"
  18. >
  19. <p
  20. slot="option-label"
  21. slot-scope="{node}"
  22. style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;"
  23. :title="node.label"
  24. >
  25. <template> {{ node.label }} </template>
  26. </p>
  27. </treeselect>
  28. <treeselect
  29. v-if="isTitleType !== 6 && isTitleType !== 2"
  30. v-model="query.archive_ctg_no"
  31. :options="classifyOptions"
  32. style="width: 180px;"
  33. :flat="false"
  34. :multiple="false"
  35. :normalizer="normalizer"
  36. placeholder="请选择档案分类"
  37. @input="handleSearch(collectLevel)"
  38. @select="handleSearch(collectLevel)"
  39. >
  40. <p
  41. slot="option-label"
  42. slot-scope="{node}"
  43. style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; width: 100%; padding-left: 10px;"
  44. :title="node.label"
  45. >
  46. <template> {{ node.label }} </template>
  47. </p>
  48. </treeselect>
  49. </div>
  50. <div v-if="isTitleType !== 6" class="head-search">
  51. <!-- 搜索 -->
  52. <el-input v-model="query.search" clearable size="small" :placeholder="placeholderType" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="handleSearch(collectLevel)" @clear="handleSearch(collectLevel)" />
  53. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleSearch(collectLevel)">搜索</el-button>
  54. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="handleAdvancedSearchClick">高级检索</el-button>
  55. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  56. </div>
  57. <div v-if="!isRecycle" class="collect-menu">
  58. <el-menu
  59. :default-active="activeMenuIndex"
  60. mode="horizontal"
  61. @select="handleSelect"
  62. >
  63. <el-submenu index="1">
  64. <template slot="title">
  65. <i class="iconfont icon-changgui" />
  66. <span>常规</span>
  67. </template>
  68. <el-menu-item-group class="collect-submenu-group">
  69. <el-menu-item v-if="isTitleType !== 6" index="1-1" @click="handleForm('add',0)">新增</el-menu-item>
  70. <el-menu-item v-if="isTitleType !== 6" index="1-2" @click="handleForm('edit',0)">编辑</el-menu-item>
  71. <el-menu-item v-if="isTitleType !== 4" index="1-3" @click="toDelete">删除</el-menu-item>
  72. <el-menu-item v-if="isTitleType === 4" index="1-4" @click="toMove">移出</el-menu-item>
  73. <el-menu-item v-if="isTitleType !== 6" index="1-6" @click="handleForm('copy',0)">追加条目</el-menu-item>
  74. </el-menu-item-group>
  75. <el-menu-item-group v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1)" class="collect-submenu-group submenu-tree">
  76. <template slot="title">原文上传</template>
  77. <!-- <el-menu-item index="1-5" @click="fileUpload(0)">普通上传</el-menu-item> -->
  78. <el-menu-item index="1-7" @click="fileUpload(1)">文件上传</el-menu-item>
  79. </el-menu-item-group>
  80. </el-submenu>
  81. <el-submenu v-if="isTitleType !== 6" index="2">
  82. <template slot="title">
  83. <i class="iconfont icon-zhengli" />
  84. <span>整理</span>
  85. </template>
  86. <el-menu-item-group class="collect-submenu-group">
  87. <el-menu-item v-if="isTitleType !== 2" index="2-1" @click="handleBlukImport">批量导入</el-menu-item>
  88. <!-- 项目 / 案卷 / 卷内 / 文件-->
  89. <el-menu-item v-if="activeIndex !== 1 || (isTitleType === 3 && selectedCategory.arrangeType === 1 && activeIndex === 1)" index="2-2" @click="handleBlukEditing">批量修改</el-menu-item>
  90. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-3" @click="handleJnSeqAdjustment('anjuan')">案卷顺序调整</el-menu-item>
  91. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-12" @click="handleJnSeqAdjustment('juannei')">卷内顺序调整</el-menu-item>
  92. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType === 1" index="2-3" @click="handleJnSeqAdjustment('file')">文件顺序调整</el-menu-item>
  93. <el-menu-item v-if="isTitleType !== 2 && !(isTitleType === 3 && (selectedCategory.arrangeType === 1|| selectedCategory.arrangeType === 2) && activeIndex === 1) && isTitleType !== 4" index="2-4" @click="handleFileNumberUpdate(0)">档号更新</el-menu-item>
  94. <!-- 案卷 -->
  95. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1 " index="2-5" @click="handleFileNumberUpdate(1)">卷内档号更新</el-menu-item>
  96. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-6" @click="handleUncoil">拆卷</el-menu-item>
  97. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0 && selectedCategory.arrangeType !== 1" index="2-7" @click="handleCombineFile">合卷</el-menu-item>
  98. <el-menu-item v-if="isTitleType === 3 && selectedCategory.arrangeType !== 1" index="2-8" @click="handleInsertFile">插件</el-menu-item>
  99. <!-- 案卷 / 卷内 / 文件 -->
  100. <el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || (isTitleType === 3 && activeIndex === 1) || (isTitleType === 4 ) " index="2-9" @click="handleCollectMoveFile">移动</el-menu-item>
  101. <!-- 案卷 -->
  102. <el-menu-item v-if="isTitleType === 3 && activeIndex === 0" index="2-10" @click="handleFiling">归档</el-menu-item>
  103. <!-- 文件 -->
  104. <el-menu-item v-if="(isTitleType === 3 && selectedCategory.arrangeType === 1) || (isTitleType === 3 && activeIndex === 1)" index="2-11" @click="handleReturn">退回预归档库</el-menu-item>
  105. </el-menu-item-group>
  106. <el-menu-item-group v-if="isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1" class="collect-submenu-group submenu-tree">
  107. <template slot="title">组卷</template>
  108. <el-menu-item index="2-12" @click="handleQuickPaper">快速组卷</el-menu-item>
  109. <el-menu-item index="2-13" @click="handlePaper">手工组卷</el-menu-item>
  110. </el-menu-item-group>
  111. <!-- <el-menu-item-group v-if="isTitleType !== 4" class="collect-submenu-group submenu-tree">
  112. <template slot="title">档案装盒</template>
  113. <el-menu-item index="2-2" @click="handlePackingBox(0)">装盒</el-menu-item>
  114. <el-menu-item v-if="selectedCategory.arrangeType !== 1 " index="2-3" @click="handlePackingBox(1)">分卷装盒</el-menu-item>
  115. </el-menu-item-group> -->
  116. </el-submenu>
  117. <el-submenu index="3">
  118. <template slot="title">
  119. <i class="iconfont icon-gengduo" />
  120. <span>更多</span>
  121. </template>
  122. <el-menu-item-group class="collect-submenu-group">
  123. <el-menu-item v-if="isTitleType !== 6" index="3-1" @click="handleExport">导出</el-menu-item>
  124. <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6)" index="3-2" @click="handlePrint">打印</el-menu-item>
  125. <el-menu-item v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 6) && isTitleType !== 4" index="3-3" @click="handleFourTest">四性检测</el-menu-item>
  126. <el-menu-item v-if="isTitleType === 6" index="3-4" @click="handleOriginalDownload">下载</el-menu-item>
  127. </el-menu-item-group>
  128. <el-menu-item-group v-if="!(isTitleType === 3 && (selectedCategory.arrangeType === 3 || selectedCategory.arrangeType === 2) && activeIndex === 1) && (isTitleType !== 2 && isTitleType !== 4 && isTitleType !== 6)" class="collect-submenu-group submenu-tree">
  129. <template slot="title">电子文件目录</template>
  130. <el-menu-item index="3-5" @click="handleCatalogDownload">目录下载</el-menu-item>
  131. <el-menu-item index="3-6" @click="fileUpload(2)">目录上传</el-menu-item>
  132. </el-menu-item-group>
  133. </el-submenu>
  134. </el-menu>
  135. </div>
  136. <div v-if="isRecycle && (isTitleType === 2 || isTitleType === 3)" class="collect-menu">
  137. <el-button class="filter-item" size="mini" type="success" @click="toRecover"><i class="iconfont icon-huifu" />恢复</el-button>
  138. <el-button class="filter-item" size="mini" type="success" @click="toCompletelyDelete"><i class="iconfont icon-shanchu" />彻底删除</el-button>
  139. </div>
  140. <!--新增 / 编辑 表单组件-->
  141. <!-- v-el-drag-dialog -->
  142. <!-- :class="isAiAutoCategory ? 'preview-dialog ai-preview-dialog' :'preview-dialog'" -->
  143. <el-dialog :class="formPreviewData.length && (formIsAddOrEdit === 'add' || formIsAddOrEdit === 'copy') ? 'preview-dialog ai-preview-dialog' :'preview-dialog'" :modal-append-to-body="false" :close-on-click-modal="false" append-to-body :before-close="handleClose" :visible="formVisible" :title="formTitle">
  144. <span class="dialog-right-top" />
  145. <span class="dialog-left-bottom" />
  146. <div class="setting-dialog">
  147. <!-- form @emitTableList="getTableList" -->
  148. <div style="display: flex; justify-content: flex-start;">
  149. <PreviewForm
  150. v-if="formPreviewData.length"
  151. ref="previewForm"
  152. :is-has-code="true"
  153. :is-disabled="false"
  154. :form-preview-data.sync="formPreviewData"
  155. :selected-category="selectedCategory"
  156. :arc-id="arcId"
  157. :is-des-form-type="isDesFormType"
  158. :is-title-type="isTitleType"
  159. :collect-level="collectLevel"
  160. :category-menu="categoryMenu"
  161. :uploaded-file-data="uploadedFileData"
  162. @close-dialog="closeDialog"
  163. @handleForm="handleForm"
  164. @formLoadingShow="formLoadingShow"
  165. @repeatDataShow="repeatDataShow"
  166. />
  167. <!-- 嵌入版原文上传组件 -->
  168. <EmbedUpload
  169. v-if="formPreviewData.length && (formIsAddOrEdit === 'add' || formIsAddOrEdit === 'copy' )"
  170. ref="embedUploadRef"
  171. :selected-category="selectedCategory"
  172. :arc-id="arcId"
  173. @onUploadSuccess="handleUploadSuccess"
  174. @showRepeatModal="handleShowRepeatModal"
  175. />
  176. <div v-if="isAiAutoCategory" v-loading="aiResultCaLoading" style="flex: 1; margin-left: 10px; ">
  177. <pre ref="typingContainer" v-highlightjs="displayedText">{{ displayedText }}</pre>
  178. </div>
  179. </div>
  180. <div slot="footer" class="dialog-footer" style="margin-top: 85px !important;">
  181. <!-- <el-button v-if="formIsAddOrEdit==='add' && ((isTitleType === 3 && selectedCategory.arrangeType === 1) || isTitleType === 4 || isTitleType === 6 || (isTitleType === 3 && activeIndex === 1))" type="text" style="width: 84px; border-color: #0348f3; color: #0348f3; " @click="handleAiCategory">AI辅助著录</el-button> -->
  182. <el-button v-if="formIsAddOrEdit==='add'" type="primary" style="width: 140px; " @click="handlerArchivesSubmit(1)">保存并新增下一条</el-button>
  183. <el-button :loading="archivesBtnLoading" type="primary" @click="handlerArchivesSubmit(0)">保存</el-button>
  184. </div>
  185. </div>
  186. </el-dialog>
  187. <!-- AI辅助著录未处理已解析的文件 -->
  188. <el-dialog class="aiAssist-dialog" title="AI已解析文件" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="aIAssistEnterVisible" :before-close="handleAIClose">
  189. <div class="setting-dialog">
  190. <!-- @select="crud.selectChange"
  191. @select-all="crud.selectAllChange"
  192. @cell-dblclick="tableDoubleClick"
  193. @selection-change="crud.selectionChangeHandler" -->
  194. <el-table
  195. ref="table"
  196. v-loading="aiCategoryloading"
  197. class="archives-table"
  198. :data="aiCategoryData"
  199. row-key="id"
  200. height="calc(100vh - 300px)"
  201. :default-expanded-rows="expandedRows"
  202. @expand-change="handleExpandChange"
  203. >
  204. <el-table-column type="selection" width="55" align="center" />
  205. <el-table-column type="expand">
  206. <template slot-scope="{row }">
  207. <el-table v-loading="row.childLoading" :data="row.children" class="child-table" :show-header="false">
  208. <el-table-column width="100" align="center" />
  209. <el-table-column prop="fileName" label="文件名称" show-overflow-tooltip min-width="200">
  210. <template slot-scope="scope">
  211. <i class="iconfont icon-attachment" />
  212. <span style="margin-left: 10px">{{ scope.row.fileName }}</span>
  213. </template>
  214. </el-table-column>
  215. <!-- <el-table-column prop="fileType" label="格式" min-width="60" align="center" /> -->
  216. <el-table-column prop="fileSize" label="大小" min-width="85" align="center">
  217. <template slot-scope="scope">
  218. {{ getFileSize(scope.row.fileSize) }}
  219. </template>
  220. </el-table-column>
  221. <el-table-column prop="fileThumbnail" label="缩略图" min-width="60" align="center">
  222. <template slot-scope="scope">
  223. <div v-if="scope.row.fileType === 'jpg' || scope.row.fileType === 'jpeg' || scope.row.fileType === 'png' || scope.row.fileType === 'bmp'|| scope.row.fileType === 'gif'">
  224. <i class="fileIcon icon-image" />
  225. </div>
  226. <div v-else-if="scope.row.fileType === 'xlsx' || scope.row.fileType === 'xls'">
  227. <i class="fileIcon icon-excel" />
  228. </div>
  229. <div v-else-if="scope.row.fileType === 'docx' || scope.row.fileType === 'doc'">
  230. <i class="fileIcon icon-word" />
  231. </div>
  232. <div v-else-if="scope.row.fileType === 'pdf'">
  233. <i class="fileIcon icon-pdf" />
  234. </div>
  235. <div v-else-if="scope.row.fileType === 'ppt' || scope.row.fileType === 'pptx'">
  236. <i class="fileIcon icon-ppt" />
  237. </div>
  238. <div v-else-if="scope.row.fileType === 'zip' || scope.row.fileType === 'rar'">
  239. <i class="fileIcon icon-zip" />
  240. </div>
  241. <div v-else-if="scope.row.fileType === 'txt'">
  242. <i class="fileIcon icon-txt" />
  243. </div>
  244. <div v-else>
  245. <i class="fileIcon icon-other" />
  246. </div>
  247. </template>
  248. </el-table-column>
  249. </el-table>
  250. </template>
  251. </el-table-column>
  252. <el-table-column label="任务编号" prop="id" min-width="280" />
  253. <el-table-column label="文件数量" prop="fileNum" />
  254. <el-table-column label="创建人" prop="create_by" />
  255. <el-table-column label="创建时间" prop="update_time" align="center" width="160">
  256. <template slot-scope="scope">
  257. <div v-if="scope.row.update_time">{{ scope.row.update_time | parseTime }}</div>
  258. <div v-else>-</div>
  259. </template>
  260. </el-table-column>
  261. <el-table-column label="解析完成时间" prop="analysisTime" align="center" width="160">
  262. <template slot-scope="scope">
  263. <div v-if="scope.row.analysisTime">{{ scope.row.analysisTime | parseTime }}</div>
  264. <div v-else>-</div>
  265. </template>
  266. </el-table-column>
  267. <el-table-column label="状态" prop="status" align="center" width="80">
  268. <template slot-scope="scope">
  269. <span v-if="!scope.row.isAnalysis" class="row-state row-warehousing state-active">解析中</span>
  270. <span v-else class="row-state row-binding state-active">已解析</span>
  271. </template>
  272. </el-table-column>
  273. <el-table-column label="操作" prop="status" align="center" width="140">
  274. <template slot-scope="scope">
  275. <el-button v-if="scope.row.isAnalysis" size="mini" class="check-btn" style="padding: 5px;" @click="getDoHandleEnterAnalysis(scope.row)">
  276. <i class="iconfont icon-tianjiawenjian" />
  277. 新增档案
  278. </el-button>
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. </div>
  283. </el-dialog>
  284. <!--卷内移出 组件-->
  285. <el-dialog class="tip-dialog" title="提示" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="moveVisible">
  286. <div class="setting-dialog">
  287. <div class="tip-content">
  288. <p class="tipMsg">此操作将把所选条目放入未整理列表</p>
  289. <span>你是否还要继续?</span>
  290. </div>
  291. <div slot="footer" class="dialog-footer">
  292. <el-button type="text" @click="moveVisible = false">取消</el-button>
  293. <el-button type="primary" @click.native="handleMoveConfirm">确定</el-button>
  294. </div>
  295. </div>
  296. </el-dialog>
  297. <!--档案号重复得list-->
  298. <el-dialog title="档号重复" :close-on-click-modal="false" :modal-append-to-body="false" append-to-body :visible.sync="repeatVisible" :before-close="handleRepeatClose">
  299. <div class="setting-dialog">
  300. <div v-if="repeatResponseData.delcount === 0" class="double-click-btn" style="position: static; margin: -10px 0 10px 0;"><i style="color: #ff4949;" class="iconfont icon-zhuyi-lan" /><span style="color: #ff4949; font-weight: bold;">因档号重复当前操作无法保存</span><span>建议修改当前输入的档号</span></div>
  301. <div v-else class="double-click-btn" style="position: static; margin: -10px 0 10px 0;"><i style="color: #ff4949;" class="iconfont icon-zhuyi-lan" /><span style="color: #ff4949; font-weight: bold;">因档号重复当前操作无法保存</span><span>建议删除回收站相关数据 或者 修改当前输入的档号</span></div>
  302. <el-table
  303. ref="table"
  304. v-loading="repeatLoading"
  305. class="archives-table"
  306. :data="repeatData"
  307. row-key="id"
  308. >
  309. <el-table-column label="所属门类" prop="categoryName" />
  310. <el-table-column v-if="repeatResponseData.delcount === 0" label="所属位置" prop="collectFormal">
  311. <template slot-scope="scope">
  312. <div v-if="scope.row.collectFormal === 1">收集库</div>
  313. <div v-if="scope.row.collectFormal === 2">归档中</div>
  314. <div v-if="scope.row.collectFormal === 3">管理库</div>
  315. </template>
  316. </el-table-column>
  317. <el-table-column v-else label="所属位置" prop="isDeleteMan">
  318. <template slot-scope="scope">
  319. <div v-if="scope.row.isDeleteMan">回收站</div>
  320. </template>
  321. </el-table-column>
  322. <el-table-column label="题名" prop="maintitle" show-overflow-tooltip min-width="130" />
  323. <el-table-column label="创建人" prop="createBy" />
  324. <el-table-column label="创建时间" prop="createTime" align="center" width="160">
  325. <template slot-scope="scope">
  326. <div v-if="scope.row.createTime">{{ scope.row.createTime | parseTime }}</div>
  327. <div v-else>-</div>
  328. </template>
  329. </el-table-column>
  330. </el-table>
  331. </div>
  332. </el-dialog>
  333. <!-- 原文上传 -->
  334. <UploadOriginal ref="uploadOriginalRef" :selected-category="selectedCategory" :arc-id="arcId" @close-dialog="closeDialog" />
  335. <!-- 大文件上传 -->
  336. <BigUpload ref="uploadBigRef" :selected-category="selectedCategory" :archive-info="archiveInfo" :arc-id="arcId" @close-dialog="closeDialog" />
  337. <!-- 批量导入 -->
  338. <BlukImport ref="blukImportRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  339. <!-- 批量修改 -->
  340. <BlukEditing ref="blukEditingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  341. <!-- 档案调整 -->
  342. <!-- <FileNumberAdjustment ref="fileNumberAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" /> -->
  343. <!-- 案卷/文件/卷内 顺序调整 -->
  344. <FileSeqAdjustment ref="fileSeqAdjustmentRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  345. <!-- 合卷 -->
  346. <CombineFile ref="combineFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  347. <!-- 插件 -->
  348. <InsertFile ref="insertFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  349. <!-- 移动 -->
  350. <CollectMoveFile ref="collectMoveFileRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  351. <!-- 打印 -->
  352. <Print ref="printRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" />
  353. <!-- 四性检测 -->
  354. <FourTest ref="fourTestRef" :selected-category="selectedCategory" :collect-level="collectLevel" @close-dialog="closeDialog" />
  355. <!-- 快速组卷 -->
  356. <QuickPaper ref="quickPaperRef" :selected-category="selectedCategory" :arc-id="arcId" :collect-level="collectLevel" @close-dialog="closeDialog" />
  357. <!-- 归档 -->
  358. <ArchivesFilling ref="archivesFillingRef" :selected-category="selectedCategory" :collect-level="collectLevel" :selections="selections" @close-dialog="closeDialog" @handleFillingToFourTest="handleFillingToFourTest" />
  359. <!-- 高级检索弹窗 -->
  360. <AdvancedSearchModal
  361. :selected-category="selectedCategory"
  362. :collect-level="collectLevel"
  363. :visible.sync="showAdvancedSearchModal"
  364. :initial-conditions="advancedSearchConditions"
  365. @search="handleAdvancedSearch"
  366. />
  367. <!-- 装盒 / 分卷装盒 -->
  368. <PackingBox ref="packingBox" :selected-category="selectedCategory" :selections="selections" :total-sum-all="totalSumAll" @close-dialog="closeDialog" />
  369. </div>
  370. <div style="display: flex; justify-content: space-between; height: 30px; line-height: 30px; padding: 0 20px; ">
  371. <p v-if="query.condition" style="font-size: 12px; cursor: pointer; color: #409EFF;" @click="openAdvancedSearchModal">高级检索{{ advancedSearchDisplayText }}</p>
  372. <span v-if="(isTitleType !== 2 && selectedCategory.arrangeType === 3 ) || ((isTitleType === 4 || isTitleType === 6) && selectedCategory.arrangeType === 2) || (isTitleType === 6 && selectedCategory.arrangeType === 1)" style="font-size: 12px;">{{ test }}</span>
  373. <div v-if="isTitleType !== 2 && !isRecycle && isTitleType !== 6 && !(isTitleType === 3 && activeIndex === 1 && selectedCategory.arrangeType !== 1 )" class="mangement-fixed-top">
  374. <el-checkbox v-model="parentsData.fixedStatusBar" @change="statusBarChecked">隐藏状态栏</el-checkbox>
  375. </div>
  376. </div>
  377. </div>
  378. </template>
  379. <script>
  380. import CRUD, { crud } from '@crud/crud'
  381. import { collectionLibraryCrud } from '../mixins/index'
  382. import { FetchInitCategoryInputFieldByPid, FetchCategoryMenu } from '@/api/system/category/category'
  383. import { FetchDetailsById, collectDel, FetchRemoveArchivesSingle, FetchDeleteArchivesFile, FetchUpdateArchivesNo, FetchDisbandArchives, FetchReturnReDocument, FetchCompleteDelArchives, FetchRestoreArchives, FetchMaxItemNoByParentId, FetchMaxItemNoByArchivesNo } from '@/api/collect/collect'
  384. import { FetchInitAssistEnter, FetchDoHandleEnterAnalysis, FetchInitAssistEnterTemp } from '@/api/ai/ai'
  385. import { FetchArchivesClassTree } from '@/api/system/archivesClass'
  386. import Treeselect from '@riophae/vue-treeselect'
  387. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  388. import PreviewForm from '@/views/components/category/PreviewForm'
  389. import UploadOriginal from './uploadOriginal/index'
  390. import BigUpload from './uploadOriginal/bigUpload'
  391. import EmbedUpload from './uploadOriginal/embedUpload'
  392. import AdvancedSearchModal from './advancedSearchModal'
  393. import BlukImport from './bulkImport/index'
  394. import BlukEditing from './blukEditing/index'
  395. import FileSeqAdjustment from './fileSeqAdjustment/index'
  396. import CombineFile from './combineFile/index'
  397. import InsertFile from './insertFile/index'
  398. import CollectMoveFile from './collectMoveFile/index'
  399. import Print from './print/index'
  400. import FourTest from './fourTest/index'
  401. import QuickPaper from './quickPaper/index'
  402. import PackingBox from './packingBox/index'
  403. import ArchivesFilling from './archivesFilling/index'
  404. import qs from 'qs'
  405. import { downloadFile, exportFile } from '@/utils/index'
  406. import { mapGetters } from 'vuex'
  407. import elDragDialog from '@/utils/dialog'
  408. import { getToken } from '@/utils/auth'
  409. export default {
  410. name: 'CollectHeader',
  411. directives: {
  412. elDragDialog
  413. },
  414. components: { Treeselect, PreviewForm, UploadOriginal, BigUpload, EmbedUpload, AdvancedSearchModal, BlukImport, BlukEditing, FileSeqAdjustment, CombineFile, InsertFile, CollectMoveFile, Print, FourTest, QuickPaper, PackingBox, ArchivesFilling },
  415. mixins: [collectionLibraryCrud, crud()],
  416. props: {
  417. selectedCategory: {
  418. type: Object,
  419. default: function() {
  420. return {}
  421. }
  422. },
  423. isTitleType: {
  424. type: Number,
  425. default: 2
  426. },
  427. selections: {
  428. type: Array,
  429. default: () => []
  430. },
  431. activeIndex: {
  432. type: Number,
  433. default: 0
  434. },
  435. isTabFile: {
  436. type: Boolean,
  437. default: false
  438. },
  439. isRecycle: {
  440. type: Boolean,
  441. default: false
  442. },
  443. test: {
  444. type: String,
  445. default: ''
  446. }
  447. },
  448. inject: ['parentsData'],
  449. data() {
  450. return {
  451. archivesBtnLoading: false,
  452. activeMenuIndex: '1',
  453. formVisible: false,
  454. formTitle: '项目',
  455. formPreviewData: [], // 预览界面data
  456. projectOptions: [],
  457. classifyOptions: [],
  458. moveVisible: false,
  459. recoverVisible: false,
  460. isDesFormType: 'arcives', // 区分是门类得还是档案得
  461. arcId: null,
  462. quickPaper: false,
  463. quickPaperArcId: [],
  464. totalSumAll: 0,
  465. categoryMenu: [],
  466. isAiAutoCategory: false,
  467. displayedText: '',
  468. formIsAddOrEdit: '',
  469. showAdvancedSearchModal: false,
  470. aIAssistEnterVisible: false,
  471. aiCategoryData: [],
  472. aiCategoryloading: false,
  473. childLoading: false,
  474. expandedRows: [],
  475. aiResultCaLoading: true, // ai分析得内容结果前得loading
  476. isDialogClosed: false, // 新增标志位,用于控制是否继续处理流式响应
  477. reader: null, // 用于存储响应体的读取器
  478. repeatVisible: false,
  479. repeatLoading: false,
  480. repeatResponseData: {},
  481. repeatData: [],
  482. archiveInfo: {},
  483. advancedSearchConditions: [],
  484. uploadedFileData: null
  485. }
  486. },
  487. computed: {
  488. ...mapGetters([
  489. 'baseApi'
  490. ]),
  491. collectTitle() {
  492. if (this.isTitleType === 2) {
  493. return '项目'
  494. } else if (this.isTitleType === 3) {
  495. if (this.selectedCategory.arrangeType === 1) {
  496. return '文件'
  497. } else {
  498. if (this.activeIndex === 1) {
  499. return '文件'
  500. } else {
  501. return '案卷'
  502. }
  503. }
  504. } else if (this.isTitleType === 4) {
  505. return '卷内'
  506. } else if (this.isTitleType === 6) {
  507. return '原文'
  508. }
  509. return ''
  510. },
  511. collectLevel() {
  512. if (this.isTitleType === 2) {
  513. return 1
  514. } else if (this.isTitleType === 3) {
  515. if (this.selectedCategory.arrangeType === 1) {
  516. return 3
  517. } else {
  518. if (this.activeIndex === 1) {
  519. if (this.quickPaper) {
  520. return 2
  521. } else {
  522. return 3
  523. }
  524. } else {
  525. return 2
  526. }
  527. }
  528. } else if (this.isTitleType === 4) {
  529. return 3
  530. } else if (this.isTitleType === 6) {
  531. return 4
  532. }
  533. return null
  534. },
  535. classType() {
  536. if (this.isTitleType === 2) {
  537. return ''
  538. } else if (this.isTitleType === 3) {
  539. if (this.selectedCategory.arrangeType === 1) {
  540. return 'is-juannei'
  541. } else {
  542. if (this.activeIndex === 1) {
  543. return 'is-juannei'
  544. } else {
  545. return 'is-anjuan'
  546. }
  547. }
  548. } else if (this.isTitleType === 4) {
  549. return 'is-juannei'
  550. } else if (this.isTitleType === 6) {
  551. return 'is-file'
  552. }
  553. return ''
  554. },
  555. placeholderType() {
  556. if (this.isTitleType === 2) {
  557. return '输入项目名称或编号'
  558. } else if (this.isTitleType === 3 || this.isTitleType === 4) {
  559. return '输入题名或档号'
  560. }
  561. return '输入项目名称或编号'
  562. },
  563. projectPlaceholder() {
  564. if (this.isTitleType === 2) {
  565. return '请选择项目分类'
  566. } else if (this.isTitleType === 3) {
  567. return '请选择项目阶段'
  568. }
  569. return '请选择项目分类'
  570. },
  571. // 格式化高级检索条件显示文案
  572. advancedSearchDisplayText() {
  573. if (!this.advancedSearchConditions || this.advancedSearchConditions.length === 0) {
  574. return ''
  575. }
  576. return this.advancedSearchConditions.map(item => {
  577. if (item.field) {
  578. // 字段条件
  579. let keywordDisplay = item.keyWord
  580. if (item.symbol === '包含' || item.symbol === '不包含') {
  581. keywordDisplay = `'%${item.keyWord}%'`
  582. } else if (item.keyWord && isNaN(parseInt(item.keyWord))) {
  583. keywordDisplay = `'${item.keyWord}'`
  584. }
  585. return `${item.field} ${item.symbol} ${keywordDisplay}`
  586. } else if (item.connector) {
  587. // 连接符
  588. return item.connector
  589. } else if (item.bracket) {
  590. // 括号
  591. return item.bracket
  592. }
  593. return ''
  594. }).join(' ')
  595. }
  596. },
  597. watch: {
  598. selectedCategory: function(newValue, oldValue) {
  599. if (newValue && newValue.id) {
  600. this.getInitArchivesClass()
  601. }
  602. },
  603. isTitleType: function(newValue, oldValue) {
  604. console.log('isTitleType', newValue)
  605. },
  606. activeIndex: function(newValue, oldValue) {
  607. if (newValue === 1) {
  608. this.parentsData.isTabFile = true
  609. } else {
  610. this.parentsData.isTabFile = false
  611. }
  612. }
  613. },
  614. created() {
  615. },
  616. mounted() {
  617. // 从 localStorage 恢复高级检索条件
  618. // this.restoreAdvancedSearchConditions()
  619. this.getInitArchivesClass()
  620. this.getCategoryDataTree()
  621. },
  622. methods: {
  623. // 从 localStorage 恢复高级检索条件
  624. restoreAdvancedSearchConditions() {
  625. const savedConditions = localStorage.getItem('advancedSearchConditions')
  626. const savedSql = localStorage.getItem('advancedSearchSql')
  627. if (savedConditions && savedSql) {
  628. try {
  629. this.advancedSearchConditions = JSON.parse(savedConditions)
  630. this.query.condition = savedSql
  631. } catch (e) {
  632. console.error('err:', e)
  633. }
  634. }
  635. },
  636. getCategoryDataTree() {
  637. FetchCategoryMenu().then(res => {
  638. this.categoryMenu = res
  639. })
  640. },
  641. resetQuery() {
  642. this.query = {
  643. 'search': null,
  644. 'condition': null,
  645. 'project_class': null,
  646. 'archive_ctg_no': null
  647. }
  648. this.advancedSearchConditions = []
  649. // 清除 localStorage 中的高级检索条件
  650. localStorage.removeItem('advancedSearchConditions')
  651. localStorage.removeItem('advancedSearchSql')
  652. localStorage.removeItem('currentPageSize')
  653. localStorage.removeItem('currentPage')
  654. this.handleSearch(this.collectLevel)
  655. },
  656. // 筛选 - 档案分类
  657. getInitArchivesClass() {
  658. this.classifyOptions = []
  659. this.query = {
  660. 'search': null,
  661. 'condition': null,
  662. 'project_class': null,
  663. 'archive_ctg_no': null
  664. }
  665. this.advancedSearchConditions = []
  666. // 清除 localStorage 中的高级检索条件
  667. localStorage.removeItem('advancedSearchConditions')
  668. localStorage.removeItem('advancedSearchSql')
  669. const params = {
  670. 'categoryId': this.selectedCategory.id
  671. }
  672. FetchArchivesClassTree(params).then((res) => {
  673. this.classifyOptions = JSON.parse(JSON.stringify(res))
  674. }).catch(err => {
  675. console.log(err)
  676. })
  677. },
  678. normalizer(node) {
  679. if (node.childArchivesClass === null) {
  680. delete node.childArchivesClass
  681. }
  682. return {
  683. id: node.code,
  684. label: `${node.name} - ${node.code}`,
  685. children: node.childArchivesClass
  686. }
  687. },
  688. handleSelect(key, keyPath) {
  689. console.log(key, keyPath)
  690. },
  691. // 著录界面-form/详情-api
  692. handleForm(type, isPaper) {
  693. if (this.$refs.previewForm) {
  694. this.$refs.previewForm.resetForm()
  695. }
  696. // 清空formPreviewData
  697. this.formPreviewData = []
  698. // 清空上传文件数据
  699. this.uploadedFileData = null
  700. // 重置嵌入版上传组件的上传结果
  701. if (this.$refs.embedUploadRef) {
  702. this.$refs.embedUploadRef.resetUploadedResults()
  703. }
  704. this.formIsAddOrEdit = type
  705. if (type === 'add') {
  706. if (this.parentsData.parentsProjectId && this.isTitleType === 3) {
  707. console.log('项目下的案卷')
  708. } else {
  709. console.log('111')
  710. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  711. this.$message({ message: '当前档案处于归档流程中,不可操作新增,请先确认!', offset: 8 })
  712. return false
  713. }
  714. }
  715. this.arcId = null
  716. if (isPaper) {
  717. this.quickPaper = true
  718. this.formTitle = '新增案卷'
  719. } else {
  720. console.log('222')
  721. this.quickPaperArcId = []
  722. this.formTitle = '新增' + this.collectTitle
  723. this.quickPaper = false
  724. }
  725. } else if (type === 'edit') {
  726. this.quickPaper = false
  727. if (this.selections.length === 0) {
  728. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  729. return false
  730. } else if (this.selections.length > 1) {
  731. this.$message({ message: '编辑操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  732. return false
  733. } else if (this.selections[0].collect_formal === 2) {
  734. this.$message({ message: '当前所选的档案处于归档流程中,不可操作编辑,请先确认!', offset: 8 })
  735. return false
  736. }
  737. this.arcId = this.selections[0].id
  738. this.formTitle = '编辑' + this.collectTitle
  739. } else if (type === 'copy') {
  740. this.quickPaper = false
  741. if (this.selections.length === 0) {
  742. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  743. return false
  744. } else if (this.selections.length > 1) {
  745. this.$message({ message: '追加复制操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  746. return false
  747. }
  748. this.arcId = this.selections[0].id
  749. this.formTitle = '追加复制' + this.collectTitle
  750. }
  751. // this.form.dictionaryConfigId = {}
  752. // this.formPreviewData = []
  753. // 档案预编辑获取字段
  754. this.formVisible = true
  755. this.$nextTick(() => {
  756. this.getFormInfo(type)
  757. })
  758. },
  759. getFormInfo(type) {
  760. const currentPageSize = localStorage.getItem('currentPageSize')
  761. if (currentPageSize) {
  762. this.page.size = parseInt(currentPageSize)
  763. } else {
  764. this.page.size = 10
  765. }
  766. if (type === 'edit') {
  767. const params = {
  768. 'categoryId': this.selectedCategory.id,
  769. 'categoryLevel': this.collectLevel,
  770. 'id': this.arcId
  771. }
  772. FetchDetailsById(params).then(data => {
  773. // const showFiledAll = data.showFiled.filter(item => item.isSequence).sort((a, b) => a.isSequence - b.isSequence)
  774. const showFiledAll = data.showFiled
  775. this.$nextTick(() => {
  776. this.formPreviewData = showFiledAll
  777. this.isDesFormType = 'arcives'
  778. this.$nextTick(() => {
  779. this.$refs.previewForm.archivesType = 'edit'
  780. this.$refs.previewForm.addOrUpdateForm = data.echo
  781. // this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  782. if (data.echo.fonds_name === '' || data.echo.fonds_name === null) {
  783. this.$set(this.$refs.previewForm.addOrUpdateForm, 'fonds_name', this.selectedCategory.fondName)
  784. }
  785. })
  786. })
  787. })
  788. } else if (type === 'copy') {
  789. const params = {
  790. 'categoryId': this.selectedCategory.id,
  791. 'categoryLevel': this.collectLevel,
  792. 'id': this.arcId
  793. }
  794. FetchDetailsById(params).then(data => {
  795. const showFiledAll = data.showFiled
  796. this.$nextTick(() => {
  797. this.formPreviewData = showFiledAll
  798. this.isDesFormType = 'arcives'
  799. this.$nextTick(() => {
  800. this.$refs.previewForm.archivesType = 'add'
  801. this.$refs.previewForm.addOrUpdateForm = data.echo
  802. if (data.echo.fonds_name === '' || data.echo.fonds_name === null) {
  803. this.$set(this.$refs.previewForm.addOrUpdateForm, 'fonds_name', this.selectedCategory.fondName)
  804. }
  805. console.log('data.echo', data.echo)
  806. const archivesNo = data.echo.archive_no
  807. if (archivesNo) {
  808. const categoryId = this.selectedCategory.id
  809. this.$refs.previewForm.FetchNoFormatField(categoryId).then(() => {
  810. FetchMaxItemNoByArchivesNo({ archivesNo, categoryId, categoryLevel: this.collectLevel }).then(res => {
  811. if (res) {
  812. const newItemNo = (parseInt(res)).toString()
  813. const field = this.formPreviewData.find(item => item.fieldName === 'item_no')
  814. if (field && field.isFilling) {
  815. const fillingDigit = field.fillingDigit
  816. this.$set(this.$refs.previewForm.addOrUpdateForm, 'item_no', newItemNo.padStart(fillingDigit, '0'))
  817. } else {
  818. this.$set(this.$refs.previewForm.addOrUpdateForm, 'item_no', newItemNo)
  819. }
  820. this.$refs.previewForm.maxItemNo = newItemNo
  821. this.$refs.previewForm.handleAuto()
  822. this.arcId = null
  823. }
  824. })
  825. })
  826. }
  827. })
  828. })
  829. })
  830. } else {
  831. const params = {
  832. 'categoryId': this.selectedCategory.id,
  833. 'categoryLevel': this.collectLevel
  834. }
  835. FetchInitCategoryInputFieldByPid(params).then(data => {
  836. this.formPreviewData = data
  837. this.isDesFormType = 'arcives'
  838. this.$nextTick(() => {
  839. this.$refs.previewForm.archivesType = 'add'
  840. this.$refs.previewForm.activeIndex = this.activeIndex
  841. console.log('this.parentsData.parentsAnjuanRow ', this.parentsData.parentsAnjuanRow)
  842. console.log('this.collectTitle', this.collectTitle)
  843. const savePrevFromData = JSON.parse(localStorage.getItem('savePrevFromData'))
  844. console.log('savePrevFromData', savePrevFromData)
  845. if (savePrevFromData) {
  846. if ('record_no' in savePrevFromData && 'item_no' in savePrevFromData) {
  847. if (savePrevFromData.item_no && !isNaN(Number(savePrevFromData.item_no))) {
  848. savePrevFromData.item_no = (parseInt(savePrevFromData.item_no) + 1).toString()
  849. }
  850. } else if ('record_no' in savePrevFromData) {
  851. if (savePrevFromData.record_no && !isNaN(Number(savePrevFromData.record_no))) {
  852. savePrevFromData.record_no = (parseInt(savePrevFromData.record_no) + 1).toString()
  853. }
  854. } else if ('item_no' in savePrevFromData) {
  855. if (savePrevFromData.item_no && !isNaN(Number(savePrevFromData.item_no))) {
  856. savePrevFromData.item_no = (parseInt(savePrevFromData.item_no) + 1).toString()
  857. }
  858. }
  859. // 查找 item_no 或 record_no 字段并进行补零操作
  860. const findAndPadField = (fieldName) => {
  861. const field = this.formPreviewData.find(item => item.fieldName === fieldName)
  862. if (field && field.isFilling) {
  863. const fillingDigit = field.fillingDigit
  864. if (savePrevFromData[fieldName]) {
  865. savePrevFromData[fieldName] = savePrevFromData[fieldName].toString().padStart(fillingDigit, '0')
  866. }
  867. }
  868. }
  869. findAndPadField('item_no')
  870. findAndPadField('record_no')
  871. this.$refs.previewForm.addOrUpdateForm = savePrevFromData
  872. } else if (this.collectTitle === '卷内' && this.parentsData.parentsAnjuanRow) {
  873. // 全宗fonds_no、门类archival_category_code、档案分类archive_ctg_no、年度archive_year、保管期限retention、案卷号record_no、责任者signer
  874. const rowAjData = this.parentsData.parentsAnjuanRow
  875. const fields = ['archive_ctg_no', 'archive_year', 'retention', 'record_no', 'signer']
  876. console.log('this.selectedCategory', this.selectedCategory)
  877. const result = { is_entity: 1, 'fonds_no': this.selectedCategory.fondsNo, 'archival_category_code': this.selectedCategory.code }
  878. fields.forEach(field => {
  879. if (rowAjData.hasOwnProperty(field)) {
  880. result[field] = rowAjData[field]
  881. }
  882. })
  883. const params = {
  884. 'archivesId': this.parentsData.parentsAnjuanRow.id
  885. }
  886. FetchMaxItemNoByParentId(params).then((res) => {
  887. if (res) {
  888. const field = this.formPreviewData.find(item => item.fieldName === 'item_no')
  889. if (field && field.isFilling) {
  890. const fillingDigit = field.fillingDigit
  891. result.item_no = (parseInt(res) + 1).toString().padStart(fillingDigit, '0')
  892. } else {
  893. result.item_no = this.incrementString(res)
  894. }
  895. } else {
  896. result.item_no = ''
  897. }
  898. }).catch(err => {
  899. console.log(err)
  900. })
  901. console.log('result', result)
  902. this.$refs.previewForm.addOrUpdateForm = result
  903. }
  904. this.$refs.previewForm.FetchNoFormatField(this.selectedCategory.id)
  905. })
  906. })
  907. }
  908. },
  909. incrementString(str) {
  910. const num = parseInt(str, 10)
  911. const incrementedNum = num + 1
  912. const numLength = str.length
  913. if (/^0+$/.test(str.replace(/\d/g, '0'))) {
  914. return incrementedNum.toString().padStart(numLength, '0')
  915. }
  916. return incrementedNum.toString()
  917. },
  918. // form - submit
  919. handlerArchivesSubmit(type) {
  920. if (this.$refs.embedUploadRef && this.$refs.embedUploadRef.hasPendingFiles()) {
  921. this.$message.warning('请先上传文件列表里的文件才可保存')
  922. return
  923. }
  924. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId, type)
  925. },
  926. handlerArchivesSubmitAndAdd() {
  927. this.$refs.previewForm.submitForm('addOrUpdateForm', this.selectedCategory.id, this.quickPaperArcId)
  928. },
  929. formLoadingShow(loadingType) {
  930. this.archivesBtnLoading = loadingType
  931. },
  932. repeatDataShow(data) {
  933. this.repeatVisible = true
  934. this.repeatLoading = true
  935. this.repeatData = []
  936. if (data) {
  937. this.repeatResponseData = data
  938. this.repeatData.push(data.archivesSummary)
  939. setTimeout(() => {
  940. this.repeatLoading = false
  941. }, 500)
  942. }
  943. },
  944. handleRepeatClose() {
  945. this.repeatResponseData = {}
  946. this.repeatData = []
  947. this.repeatLoading = false
  948. this.repeatVisible = false
  949. },
  950. // 关闭
  951. handleClose(done) {
  952. this.formVisible = false
  953. this.quickPaper = false
  954. localStorage.removeItem('savePrevFromData')
  955. this.aiCategoryData = []
  956. this.isAiAutoCategory = false
  957. this.displayedText = ''
  958. this.isDialogClosed = true
  959. this.uploadedFileData = null
  960. if (this.reader) {
  961. this.reader.cancel()
  962. }
  963. // 核心新增:重置PreviewForm组件状态
  964. this.$nextTick(() => {
  965. if (this.$refs.previewForm) {
  966. this.$refs.previewForm.resetForm()
  967. // 额外清空formPreviewData(可选,根据业务需求)
  968. this.formPreviewData = []
  969. }
  970. // 重置嵌入版上传组件的上传结果
  971. if (this.$refs.embedUploadRef) {
  972. this.$refs.embedUploadRef.resetUploadedResults()
  973. }
  974. })
  975. done()
  976. },
  977. // 嵌入版上传成功回调
  978. handleUploadSuccess(fileData) {
  979. console.log('fileData', fileData)
  980. this.uploadedFileData = fileData
  981. console.log('嵌入版上传成功', this.uploadedFileData)
  982. },
  983. // 显示重复文件弹窗
  984. handleShowRepeatModal(repeatData) {
  985. // 这里可以处理重复文件的逻辑,比如调用已有的重复文件处理机制
  986. console.log('重复文件:', repeatData)
  987. },
  988. // 打开高级检索弹窗
  989. handleAdvancedSearchClick() {
  990. this.showAdvancedSearchModal = true
  991. },
  992. // 点击文案打开高级检索弹窗(还原之前的条件)
  993. openAdvancedSearchModal() {
  994. this.showAdvancedSearchModal = true
  995. },
  996. // 处理高级检索
  997. handleAdvancedSearch(condition) {
  998. console.log('condition', condition)
  999. console.log('this.parentsData', this.parentsData)
  1000. this.showAdvancedSearchModal = false
  1001. this.smartQuery = this.parentsData.smartQuery
  1002. // 设置检索条件(SQL)
  1003. this.query.condition = condition.sql
  1004. // 保存原始条件数据用于显示文案
  1005. this.advancedSearchConditions = condition.conditions
  1006. this.handleSearch(this.collectLevel)
  1007. },
  1008. // 删除
  1009. toDelete() {
  1010. if (this.selections.length === 0) {
  1011. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1012. return false
  1013. }
  1014. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1015. if (isHasFillFormal) {
  1016. this.$message({ message: '您所选的条目有正在归档流程中,不可操作删除,请先确认!', offset: 8 })
  1017. return false
  1018. }
  1019. if (this.collectLevel === 4) {
  1020. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  1021. this.$message({ message: '当前档案处于归档流程中,不可操作删除,请先确认!', offset: 8 })
  1022. return false
  1023. }
  1024. }
  1025. console.log('this.collectLevel', this.collectLevel)
  1026. console.log('this.activeIndex', this.activeIndex)
  1027. let messageTip
  1028. if (this.activeIndex === 1) {
  1029. messageTip = '此删除将把所选条目与其子集彻底删除'
  1030. } else {
  1031. if (this.collectLevel === 4) {
  1032. messageTip = '此删除将把所选条目彻底删除'
  1033. } else {
  1034. messageTip = '此删除将把所选条目与其子集放入回收站'
  1035. }
  1036. }
  1037. this.$confirm(messageTip + '<span>你是否还要继续?</span>', '提示', {
  1038. confirmButtonText: '继续',
  1039. cancelButtonText: '取消',
  1040. type: 'warning',
  1041. dangerouslyUseHTMLString: true
  1042. }).then(() => {
  1043. if (this.activeIndex === 1) {
  1044. const archivesIds = []
  1045. this.selections.forEach(val => {
  1046. archivesIds.push(val.id)
  1047. })
  1048. const params = {
  1049. 'categoryId': this.selectedCategory.id,
  1050. 'categoryLevel': this.collectLevel,
  1051. 'archivesIds': archivesIds
  1052. }
  1053. FetchCompleteDelArchives(params).then((res) => {
  1054. if (res.code !== 500) {
  1055. this.$message({ message: res, type: 'success', offset: 8 })
  1056. localStorage.removeItem('currentPageSize')
  1057. localStorage.removeItem('currentPage')
  1058. this.handleSearch(this.collectLevel)
  1059. } else {
  1060. this.$message({ message: '删除所选档案失败', type: 'error', offset: 8 })
  1061. }
  1062. }).catch(err => {
  1063. console.log(err)
  1064. })
  1065. } else {
  1066. this.handleDelConfirm()
  1067. }
  1068. }).catch(() => {
  1069. })
  1070. },
  1071. // 卷内 - 移除
  1072. toMove() {
  1073. if (this.selections.length === 0) {
  1074. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1075. return false
  1076. }
  1077. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1078. if (isHasFillFormal) {
  1079. this.$message({ message: '您所选的条目有正在归档流程中,不可操作删除,请先确认!', offset: 8 })
  1080. return false
  1081. }
  1082. this.moveVisible = true
  1083. },
  1084. // 删除 - 确认
  1085. handleDelConfirm() {
  1086. if (this.collectLevel === 4) {
  1087. const params = this.selections.map((item) => {
  1088. const json = {}
  1089. json.archivesId = item.archive_id
  1090. json.categoryId = this.selectedCategory.id
  1091. json.documentFileId = item.document_file_id
  1092. json.documentId = item.document_id
  1093. json.id = item.id
  1094. return json
  1095. })
  1096. FetchDeleteArchivesFile(params).then((res) => {
  1097. if (res === 'SUCCESS') {
  1098. localStorage.removeItem('currentPageSize')
  1099. localStorage.removeItem('currentPage')
  1100. this.$message({ message: '删除成功', type: 'success', offset: 8 })
  1101. this.handleSearch(this.collectLevel)
  1102. } else {
  1103. this.$message({ message: '删除所选电子原文失败', type: 'error', offset: 8 })
  1104. }
  1105. }).catch(err => {
  1106. console.log(err)
  1107. })
  1108. } else {
  1109. const archivesIds = []
  1110. this.selections.forEach(val => {
  1111. archivesIds.push(val.id)
  1112. })
  1113. const params = {
  1114. 'categoryId': this.selectedCategory.id,
  1115. 'categoryLevel': this.collectLevel,
  1116. 'archivesIds': archivesIds
  1117. }
  1118. collectDel(params).then((res) => {
  1119. if (res.includes('成功')) {
  1120. localStorage.removeItem('currentPageSize')
  1121. localStorage.removeItem('currentPage')
  1122. this.$message({ message: '删除成功', type: 'success', offset: 8 })
  1123. this.handleSearch(this.collectLevel)
  1124. } else {
  1125. this.$message({ message: res, type: 'error', offset: 8 })
  1126. }
  1127. }).catch(err => {
  1128. console.log(err)
  1129. })
  1130. }
  1131. },
  1132. // 卷内 - 移出 确认
  1133. handleMoveConfirm() {
  1134. const archivesIds = []
  1135. this.selections.forEach(val => {
  1136. archivesIds.push(val.id)
  1137. })
  1138. const params = {
  1139. 'categoryId': this.selectedCategory.id,
  1140. 'categoryLevel': this.collectLevel,
  1141. 'archivesIds': archivesIds,
  1142. 'parentsId': this.parentsData.parentsAnjuanId
  1143. }
  1144. FetchRemoveArchivesSingle(params).then((res) => {
  1145. if (res === true) {
  1146. localStorage.removeItem('currentPageSize')
  1147. localStorage.removeItem('currentPage')
  1148. this.$message({ message: '移出成功', type: 'success', offset: 8 })
  1149. this.handleSearch(this.collectLevel)
  1150. } else {
  1151. this.$message({ message: '移出失败', type: 'error', offset: 8 })
  1152. }
  1153. this.moveVisible = false
  1154. }).catch(err => {
  1155. console.log(err)
  1156. })
  1157. },
  1158. // 原文上传
  1159. fileUpload(uploadType) {
  1160. if (uploadType !== 2) {
  1161. if (this.isTitleType !== 6) {
  1162. if (this.selections.length === 0) {
  1163. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1164. return false
  1165. }
  1166. if (this.selections.length > 1) {
  1167. this.$message({ message: '上传操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  1168. return false
  1169. }
  1170. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1171. if (isHasFillFormal) {
  1172. this.$message({ message: '您所选的条目有正在归档流程中,不可操作原文上传,请先确认!', offset: 8 })
  1173. return false
  1174. }
  1175. this.arcId = this.selections[0].id
  1176. this.archiveInfo = this.selections[0]
  1177. } else {
  1178. console.log('this.parentsData', this.parentsData)
  1179. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  1180. this.$message({ message: '当前档案处于归档流程中,不可操作原文上传,请先确认!', offset: 8 })
  1181. return false
  1182. }
  1183. if (this.selectedCategory.arrangeType === 1) {
  1184. this.arcId = this.parentsData.parentsAnjuanId
  1185. this.archiveInfo = this.parentsData.parentsAnjuanRow
  1186. } else {
  1187. if (this.parentsData.isTabFile) {
  1188. this.arcId = this.parentsData.parentsAnjuanId
  1189. this.archiveInfo = this.parentsData.parentsAnjuanRow
  1190. } else {
  1191. this.arcId = this.parentsData.parentsJuanneiId
  1192. this.archiveInfo = this.parentsData.parentsJuanneiRow
  1193. }
  1194. }
  1195. }
  1196. }
  1197. if (uploadType === 0) {
  1198. this.$refs.uploadOriginalRef.uploadTitle = '普通上传'
  1199. this.$refs.uploadOriginalRef.uploadVisible = true
  1200. } else if (uploadType === 1) {
  1201. this.$refs.uploadBigRef.updateUploadOptions(1)
  1202. this.$refs.uploadBigRef.fileList = []
  1203. } else if (uploadType === 2) {
  1204. this.$refs.uploadBigRef.updateUploadOptions(2)
  1205. this.$refs.uploadBigRef.fileList = []
  1206. }
  1207. if (this.$refs.uploadOriginalRef.uploadVisible) {
  1208. this.$refs.uploadOriginalRef.uploadType = uploadType
  1209. this.$refs.uploadOriginalRef.fileList = []
  1210. }
  1211. },
  1212. // 批量导入
  1213. handleBlukImport() {
  1214. if (this.parentsData.parentsAnjuanRow && this.parentsData.parentsAnjuanRow.collect_formal === 2) {
  1215. this.$message({ message: '当前档案处于归档流程中,不可操作批量导入,请先确认!', offset: 8 })
  1216. return false
  1217. }
  1218. this.$nextTick(() => {
  1219. this.$refs.blukImportRef.bulkImportVisible = true
  1220. this.$refs.blukImportRef.getInitCategoryInputFieldByPid()
  1221. })
  1222. },
  1223. // 批量修改
  1224. handleBlukEditing() {
  1225. if (this.selections.length === 0) {
  1226. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1227. return false
  1228. }
  1229. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1230. if (isHasFillFormal) {
  1231. this.$message({ message: '您所选的条目有正在归档流程中,不可操作批量修改,请先确认!', offset: 8 })
  1232. return false
  1233. }
  1234. this.$nextTick(() => {
  1235. this.$refs.blukEditingRef.bulkEditingVisible = true
  1236. this.$refs.blukEditingRef.getInitCategoryInputFieldByPid()
  1237. })
  1238. },
  1239. // 案卷/文件/卷内顺序调整
  1240. handleJnSeqAdjustment(type) {
  1241. if (type === 'juannei') {
  1242. if (this.selections.length === 0) {
  1243. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1244. return false
  1245. }
  1246. if (this.selections.length > 1) {
  1247. this.$message({ message: '卷内顺序调整操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  1248. return false
  1249. }
  1250. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1251. if (isHasFillFormal) {
  1252. this.$message({ message: '您所选的条目有正在归档流程中,不可操作卷内顺序调整,请先确认!', offset: 8 })
  1253. return false
  1254. }
  1255. this.$nextTick(() => {
  1256. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '卷内顺序调整'
  1257. this.$refs.fileSeqAdjustmentRef.isJuannei = true
  1258. })
  1259. } else {
  1260. if (this.selections.length < 2) {
  1261. this.$message({ message: '请选择多个' + (type === 'file' ? '文件' : '案卷') + '后进行操作!', offset: 8 })
  1262. return false
  1263. }
  1264. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1265. if (isHasFillFormal) {
  1266. this.$message({ message: '您所选的条目有正在归档流程中,不可操作案卷/文件顺序调整,请先确认!', offset: 8 })
  1267. return false
  1268. }
  1269. this.$nextTick(() => {
  1270. if (type === 'anjuan') {
  1271. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '案卷顺序调整'
  1272. } else {
  1273. this.$refs.fileSeqAdjustmentRef.titleAdjustment = '文件顺序调整'
  1274. }
  1275. this.$refs.fileSeqAdjustmentRef.isJuannei = false
  1276. })
  1277. }
  1278. this.$nextTick(() => {
  1279. this.$refs.fileSeqAdjustmentRef.getDoArchivesAdjust()
  1280. })
  1281. },
  1282. // 档号更新
  1283. handleFileNumberUpdate(type) {
  1284. if (this.selections.length === 0) {
  1285. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1286. return false
  1287. }
  1288. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1289. if (isHasFillFormal) {
  1290. this.$message({ message: '您所选的条目有正在归档流程中,不可操作档号更新,请先确认!', offset: 8 })
  1291. return false
  1292. }
  1293. this.$confirm('此操作将会自动重新生成档号' + '<span>你是否还要继续?</span>', '提示', {
  1294. confirmButtonText: '继续',
  1295. cancelButtonText: '取消',
  1296. type: 'warning',
  1297. dangerouslyUseHTMLString: true
  1298. }).then(() => {
  1299. // updateType 更新类别 1.档号更新 2.卷内档号更新
  1300. let updateType
  1301. if (type === 0) {
  1302. updateType = 1
  1303. } else {
  1304. updateType = 2
  1305. }
  1306. const archivesIds = []
  1307. this.selections.forEach(val => {
  1308. archivesIds.push(val.id)
  1309. })
  1310. const params = {
  1311. 'categoryId': this.selectedCategory.id,
  1312. 'categoryLevel': this.collectLevel,
  1313. 'archivesIds': archivesIds,
  1314. 'updateType': updateType
  1315. }
  1316. FetchUpdateArchivesNo(params).then((res) => {
  1317. if (res.code !== 500) {
  1318. this.$message({ message: '档号更新成功', type: 'success', offset: 8 })
  1319. this.handleSearch(this.collectLevel)
  1320. } else {
  1321. this.$message({ message: res.message, type: 'error', offset: 8 })
  1322. }
  1323. }).catch(err => {
  1324. console.log(err)
  1325. })
  1326. }).catch(() => {
  1327. })
  1328. },
  1329. // 拆卷
  1330. handleUncoil() {
  1331. if (this.selections.length === 0) {
  1332. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1333. return false
  1334. }
  1335. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1336. if (isHasFillFormal) {
  1337. this.$message({ message: '您所选的条目有正在归档流程中,不可操作拆卷,请先确认!', offset: 8 })
  1338. return false
  1339. }
  1340. this.$confirm('拆卷之后,对应的案卷数据将会自动删除' + '<span>你是否还要继续?</span>', '提示', {
  1341. confirmButtonText: '继续',
  1342. cancelButtonText: '取消',
  1343. type: 'warning',
  1344. dangerouslyUseHTMLString: true
  1345. }).then(() => {
  1346. const archivesIds = []
  1347. this.selections.forEach(val => {
  1348. archivesIds.push(val.id)
  1349. })
  1350. const params = {
  1351. 'categoryId': this.selectedCategory.id,
  1352. 'archivesIds': archivesIds
  1353. }
  1354. FetchDisbandArchives(params).then((res) => {
  1355. if (res.code !== 500) {
  1356. this.$message({ message: '拆卷成功', type: 'success', offset: 8 })
  1357. this.handleSearch(this.collectLevel)
  1358. } else {
  1359. this.$message({ message: '拆卷失败', type: 'error', offset: 8 })
  1360. }
  1361. }).catch(err => {
  1362. console.log(err)
  1363. })
  1364. }).catch(() => {
  1365. })
  1366. },
  1367. // 合卷
  1368. handleCombineFile() {
  1369. if (this.selections.length < 2) {
  1370. this.$message({ message: '合卷操作至少勾选2个案卷,请重试!', offset: 8 })
  1371. return false
  1372. }
  1373. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1374. if (isHasFillFormal) {
  1375. this.$message({ message: '您所选的条目有正在归档流程中,不可操作合卷,请先确认!', offset: 8 })
  1376. return false
  1377. }
  1378. this.$refs.combineFileRef.getTargetList()
  1379. },
  1380. // 插件
  1381. handleInsertFile() {
  1382. if (this.collectLevel === 3) {
  1383. if (this.selections.length === 0) {
  1384. this.$confirm('您未勾选条目,否则直接选择所有条目' + '<span>你是否还要继续?</span>', '提示', {
  1385. confirmButtonText: '继续',
  1386. cancelButtonText: '取消',
  1387. type: 'warning',
  1388. dangerouslyUseHTMLString: true
  1389. }).then(() => {
  1390. this.$refs.insertFileRef.fileNoSelectionData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1391. this.$refs.insertFileRef.getInsertViewTable()
  1392. }).catch(() => {
  1393. })
  1394. } else {
  1395. this.$refs.insertFileRef.getInsertViewTable()
  1396. }
  1397. } else {
  1398. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1399. if (this.selections.length !== 1) {
  1400. this.$message({ message: '插卷操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  1401. return false
  1402. } else if (isHasFillFormal) {
  1403. this.$message({ message: '您所选的条目有正在归档流程中,不可操作插件,请先确认!', offset: 8 })
  1404. return false
  1405. } else {
  1406. this.$refs.insertFileRef.getInsertViewTable()
  1407. }
  1408. }
  1409. },
  1410. // 移动
  1411. handleCollectMoveFile() {
  1412. if (this.selections.length === 0) {
  1413. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1414. return false
  1415. }
  1416. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1417. if (isHasFillFormal) {
  1418. this.$message({ message: '您所选的条目有正在归档流程中,不可操作移动,请先确认!', offset: 8 })
  1419. return false
  1420. }
  1421. // if (this.isTitleType === 2) {
  1422. // this.$refs.collectMoveFileRef.parentsId = null
  1423. // } else if (this.isTitleType === 3) {
  1424. // if (this.selectedCategory.arrangeType === 1) {
  1425. // this.$refs.collectMoveFileRef.parentsId = null
  1426. // } else {
  1427. // if (this.activeIndex === 1) {
  1428. // this.$refs.collectMoveFileRef.parentsId = null
  1429. // } else {
  1430. // this.$refs.collectMoveFileRef.parentsId = this.parentsData.parentsProjectId
  1431. // }
  1432. // }
  1433. // } else if (this.isTitleType === 4) {
  1434. // this.$refs.collectMoveFileRef.parentsId = this.parentsData.parentsAnjuanId
  1435. // } else if (this.isTitleType === 6) {
  1436. // if (this.selectedCategory.arrangeType === 1) {
  1437. // this.$refs.collectMoveFileRef.parentsId = this.parentsData.parentsAnjuanId
  1438. // } else {
  1439. // if (this.parentsData.isTabFile) {
  1440. // this.$refs.collectMoveFileRef.parentsId = this.parentsData.parentsAnjuanId
  1441. // } else {
  1442. // this.$refs.collectMoveFileRef.parentsId = this.parentsData.parentsJuanneiId
  1443. // }
  1444. // }
  1445. // }
  1446. this.$nextTick(() => {
  1447. this.$refs.collectMoveFileRef.collectMoveFileVisible = true
  1448. if (!this.isTitleType) {
  1449. // 默认行为:如果 isTitleType 未定义,设置为 null
  1450. this.setParentsId(this.$refs, null)
  1451. } else if (this.isTitleType === 2 ||
  1452. (this.isTitleType === 3 && this.selectedCategory.arrangeType === 1) ||
  1453. (this.isTitleType === 3 && this.activeIndex === 1)) {
  1454. // 统一处理 null 的情况
  1455. this.setParentsId(this.$refs, null)
  1456. } else if (this.isTitleType === 3) {
  1457. this.setParentsId(this.$refs, this.parentsData?.parentsProjectId ?? null)
  1458. } else if (this.isTitleType === 4) {
  1459. this.setParentsId(this.$refs, this.parentsData?.parentsAnjuanId ?? null)
  1460. } else if (this.isTitleType === 6) {
  1461. if (this.selectedCategory.arrangeType === 1 || this.parentsData.isTabFile) {
  1462. this.setParentsId(this.$refs, this.parentsData?.parentsAnjuanId ?? null)
  1463. } else {
  1464. this.setParentsId(this.$refs, this.parentsData?.parentsJuanneiId ?? null)
  1465. }
  1466. }
  1467. })
  1468. },
  1469. setParentsId(safeRef, value) {
  1470. if (safeRef && safeRef.collectMoveFileRef) {
  1471. safeRef.collectMoveFileRef.parentsId = value
  1472. } else {
  1473. console.warn('collectMoveFileRef is not available')
  1474. }
  1475. },
  1476. // 归档
  1477. handleFiling() {
  1478. if (this.selections.length === 0) {
  1479. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1480. return false
  1481. }
  1482. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1483. if (isHasFillFormal) {
  1484. this.$message({ message: '您所选的条目有正在归档流程中,勿重复操作,请先确认!!', offset: 8 })
  1485. return false
  1486. }
  1487. this.$refs.archivesFillingRef.archivesFillingVisible = true
  1488. },
  1489. handleFillingToFourTest(resultList) {
  1490. this.$refs.fourTestRef.fourTestVisible = true
  1491. this.$refs.fourTestRef.tableData = this.selections
  1492. this.$refs.fourTestRef.updateTableData(resultList, this.selections)
  1493. this.$refs.fourTestRef.isCheck = true
  1494. },
  1495. // 退回预归档库
  1496. handleReturn() {
  1497. if (this.selections.length === 0) {
  1498. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1499. return false
  1500. }
  1501. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1502. if (isHasFillFormal) {
  1503. this.$message({ message: '您所选的条目有正在归档流程中,不可操作退回预归档库,请先确认!!', offset: 8 })
  1504. return false
  1505. }
  1506. this.$confirm('此操作将把会所选条目退回到预归档库' + '<span>你是否还要继续?</span>', '提示', {
  1507. confirmButtonText: '继续',
  1508. cancelButtonText: '取消',
  1509. type: 'warning',
  1510. dangerouslyUseHTMLString: true
  1511. }).then(() => {
  1512. const archivesIds = this.selections.map(item => item.id)
  1513. const params = {
  1514. 'categoryId': this.selectedCategory.id,
  1515. 'archivesIds': archivesIds
  1516. }
  1517. FetchReturnReDocument(params).then((res) => {
  1518. if (res.code !== 500) {
  1519. if (res === 0) {
  1520. this.crud.notify('', CRUD.NOTIFICATION_TYPE.INFO)
  1521. this.$message({ message: '当前数据中不包含预归档数据,无法返回', offset: 8 })
  1522. } else {
  1523. this.$message({ message: '已成功返回' + res + '条来自预归档的数据', type: 'success', offset: 8 })
  1524. }
  1525. this.handleSearch(this.collectLevel)
  1526. } else {
  1527. this.$message({ message: res.message, type: 'error', offset: 8 })
  1528. }
  1529. }).catch(err => {
  1530. console.log(err)
  1531. })
  1532. }).catch(() => {
  1533. })
  1534. },
  1535. // 导出
  1536. handleExport() {
  1537. if (this.selections.length === 0) {
  1538. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1539. return false
  1540. }
  1541. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  1542. confirmButtonText: '继续',
  1543. cancelButtonText: '取消',
  1544. type: 'warning',
  1545. dangerouslyUseHTMLString: true
  1546. }).then(() => {
  1547. const archivesIds = []
  1548. this.selections.forEach(val => {
  1549. archivesIds.push(val.id)
  1550. })
  1551. const params = {
  1552. 'categoryId': this.selectedCategory.id,
  1553. 'categoryLevel': this.collectLevel,
  1554. 'archivesIds': archivesIds
  1555. }
  1556. exportFile(this.baseApi + '/api/collect/exportDate?' + qs.stringify(params, { indices: false }))
  1557. }).catch(() => {
  1558. })
  1559. },
  1560. // 打印
  1561. handlePrint() {
  1562. if (this.selections.length === 0) {
  1563. this.$refs.printRef.form.printRange = '当页条目'
  1564. let currentTableData = []
  1565. if (this.collectLevel === 2) {
  1566. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1567. } else if (this.collectLevel === 3) {
  1568. if (this.isTitleType === 3) {
  1569. currentTableData = this.parentsData.$refs.anjuanEle.$refs.ajContent.$refs.tableList.anjuanData
  1570. } else {
  1571. currentTableData = this.parentsData.$refs.juanneiEle.junneiData
  1572. }
  1573. }
  1574. this.$refs.printRef.currentTable = JSON.parse(JSON.stringify(currentTableData))
  1575. } else {
  1576. this.$refs.printRef.form.printRange = '勾选条目'
  1577. }
  1578. this.$refs.printRef.printVisible = true
  1579. },
  1580. // 四性检测
  1581. handleFourTest() {
  1582. if (this.selections.length === 0) {
  1583. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1584. return false
  1585. }
  1586. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1587. if (isHasFillFormal) {
  1588. this.$message({ message: '您所选的条目有正在归档流程中,不可操作四性检测,请先确认!', offset: 8 })
  1589. return false
  1590. }
  1591. this.$refs.fourTestRef.fourTestVisible = true
  1592. this.selections.forEach((item, index) => {
  1593. this.$set(this.selections[index], 'reportResult', {})
  1594. })
  1595. this.$refs.fourTestRef.tableData = this.selections
  1596. },
  1597. // 目录下载
  1598. handleCatalogDownload() {
  1599. if (this.selections.length === 0) {
  1600. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1601. return false
  1602. }
  1603. this.$confirm('此操作将下载所选条目目录' + '<span>你是否还要继续?</span>', '提示', {
  1604. confirmButtonText: '继续',
  1605. cancelButtonText: '取消',
  1606. type: 'warning',
  1607. dangerouslyUseHTMLString: true
  1608. }).then(() => {
  1609. const archivesIds = []
  1610. this.selections.forEach(val => {
  1611. archivesIds.push(val.id)
  1612. })
  1613. const params = {
  1614. 'categoryId': this.selectedCategory.id,
  1615. 'categoryLevel': this.collectLevel,
  1616. 'archivesIds': archivesIds
  1617. }
  1618. exportFile(this.baseApi + '/api/collect/catalogDownload?' + qs.stringify(params, { indices: false }))
  1619. }).catch(() => {
  1620. })
  1621. },
  1622. // 快速组卷
  1623. handleQuickPaper() {
  1624. this.$refs.quickPaperRef.quickVisible = true
  1625. },
  1626. // 手工组卷
  1627. handlePaper() {
  1628. if (this.selections.length === 0) {
  1629. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1630. return false
  1631. }
  1632. this.quickPaperArcId = this.selections.map(item => item.id)
  1633. this.handleForm('add', 1)
  1634. },
  1635. // 装盒 / 分卷装盒
  1636. handlePackingBox(type) {
  1637. if (this.selections.length === 0) {
  1638. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1639. return false
  1640. }
  1641. const isHasFillFormal = this.selections.some(item => item.collect_formal === 2)
  1642. if (isHasFillFormal) {
  1643. this.$message({ message: '您所选的条目有正在归档流程中,不可操作装盒,请先确认!!', offset: 8 })
  1644. return false
  1645. }
  1646. if (this.selectedCategory.arrangeType === 2) {
  1647. if (type === 1) {
  1648. if (this.selections.length > 1) {
  1649. this.$message({ message: '只可勾选唯一目标条目,请先确认!', offset: 8 })
  1650. return false
  1651. }
  1652. }
  1653. if (this.selections[0].child === 0) {
  1654. this.$message({ message: '当前选中的档案无相关卷内文件,不可装盒!', type: 'error', offset: 8 })
  1655. return
  1656. }
  1657. }
  1658. if (this.selections[0].case_no) {
  1659. this.$message({ message: '当前档案已装盒,请勿重复操作!', type: 'error', offset: 8 })
  1660. return
  1661. }
  1662. // 后面与后端对接确定字段name
  1663. // const existsNotEmpty = this.selections.some(item => item.caseNum)
  1664. // if (existsNotEmpty) {
  1665. // this.$message('所选条目中存在已装盒档案,请勿重复操作!')
  1666. // return false
  1667. // }
  1668. this.$refs.packingBox.packingVisible = true
  1669. this.$refs.packingBox.isPackingOrPartType = type
  1670. this.$refs.packingBox.packFileCategory = this.parentsData.listCategory
  1671. if (type === 0) {
  1672. this.$refs.packingBox.packingTitle = '装盒'
  1673. } else {
  1674. this.$refs.packingBox.packingTitle = '分卷装盒'
  1675. this.$refs.packingBox.getViewTable()
  1676. }
  1677. this.getTotalSumAll()
  1678. },
  1679. getTotalSumAll() {
  1680. this.totalSumAll = 0
  1681. this.selections.map((item) => { if (!isNaN(item.child)) this.totalSumAll += item.child })
  1682. if (isNaN(this.totalSumAll)) {
  1683. return 0
  1684. }
  1685. return this.totalSumAll
  1686. },
  1687. // 原文内的附件下载
  1688. handleOriginalDownload() {
  1689. if (this.selections.length > 1 || this.selections.length === 0) {
  1690. this.$message({ message: '下载操作只可勾选唯一目标条目,请先确认!', offset: 8 })
  1691. return false
  1692. }
  1693. // const url = this.baseApi + '/downloadFile' + this.selections[0].file_path
  1694. // fetch(url).then(res => res.blob()).then(blob => {
  1695. // downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
  1696. // }).catch(() => {
  1697. // this.$message({ message: '下载文件失败!', type: 'error', offset: 8 })
  1698. // })
  1699. const url = this.baseApi + '/api/minioUpload/getFile?filePath=' + this.selections[0].file_path + '&bucketType=2'
  1700. const fetchOptions = {
  1701. method: 'GET',
  1702. headers: {
  1703. 'Authorization': getToken()
  1704. }
  1705. }
  1706. fetch(url, fetchOptions).then(res => res.blob()).then(blob => {
  1707. downloadFile(blob, this.selections[0].file_name.split('.')[0], this.selections[0].file_type)
  1708. this.downloading = false
  1709. }).catch(() => {
  1710. this.$message({ message: '下载文件失败', type: 'error', offset: 8 })
  1711. this.downloading = false
  1712. })
  1713. },
  1714. // 回收站 - 恢复
  1715. toRecover() {
  1716. if (this.selections.length === 0) {
  1717. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1718. return false
  1719. }
  1720. this.$confirm('此恢复将会把所选条目及其子集一并恢复' + '<span>你是否还要继续?</span>', '提示', {
  1721. confirmButtonText: '继续',
  1722. cancelButtonText: '取消',
  1723. type: 'warning',
  1724. dangerouslyUseHTMLString: true
  1725. }).then(() => {
  1726. const archivesIds = []
  1727. this.selections.forEach(val => {
  1728. archivesIds.push(val.id)
  1729. })
  1730. const params = {
  1731. 'categoryId': this.selectedCategory.id,
  1732. 'categoryLevel': this.collectLevel,
  1733. 'archivesIds': archivesIds,
  1734. 'collectFormal': this.isTitleType === 2 ? 1 : null
  1735. }
  1736. FetchRestoreArchives(params).then((res) => {
  1737. if (res.code !== 500) {
  1738. localStorage.removeItem('currentPageSize')
  1739. localStorage.removeItem('currentPage')
  1740. if (res.includes('成功')) {
  1741. this.$message({ message: res, type: 'success', offset: 8 })
  1742. } else {
  1743. this.$message({ message: res, type: 'error', offset: 8 })
  1744. }
  1745. this.handleSearch(this.collectLevel)
  1746. } else {
  1747. this.$message({ message: '恢复所选档案失败', type: 'error', offset: 8 })
  1748. }
  1749. }).catch(err => {
  1750. console.log(err)
  1751. })
  1752. }).catch(() => {
  1753. })
  1754. },
  1755. // 回收站 - 彻底删除
  1756. toCompletelyDelete() {
  1757. if (this.selections.length === 0) {
  1758. this.$message({ message: '您还未勾选需要操作的条目,请先确认!', offset: 8 })
  1759. return false
  1760. }
  1761. this.$confirm('此删除将把会所选条目与其子集彻底删除' + '<span>你是否还要继续?</span>', '提示', {
  1762. confirmButtonText: '继续',
  1763. cancelButtonText: '取消',
  1764. type: 'warning',
  1765. dangerouslyUseHTMLString: true
  1766. }).then(() => {
  1767. const archivesIds = []
  1768. this.selections.forEach(val => {
  1769. archivesIds.push(val.id)
  1770. })
  1771. const params = {
  1772. 'categoryId': this.selectedCategory.id,
  1773. 'categoryLevel': this.collectLevel,
  1774. 'archivesIds': archivesIds
  1775. }
  1776. FetchCompleteDelArchives(params).then((res) => {
  1777. if (res.code !== 500) {
  1778. localStorage.removeItem('currentPageSize')
  1779. localStorage.removeItem('currentPage')
  1780. this.$message({ message: res, type: 'success', offset: 8 })
  1781. this.handleSearch(this.collectLevel)
  1782. } else {
  1783. this.$message({ message: '删除所选档案失败', type: 'error', offset: 8 })
  1784. }
  1785. }).catch(err => {
  1786. console.log(err)
  1787. })
  1788. }).catch(() => {
  1789. })
  1790. },
  1791. closeDialog(data) {
  1792. this.formVisible = false
  1793. this.quickPaper = false
  1794. setTimeout(() => {
  1795. this.handleSearch(this.collectLevel)
  1796. })
  1797. },
  1798. handleAiCategory() {
  1799. this.aIAssistEnterVisible = true
  1800. this.aiCategoryloading = true
  1801. const params = {
  1802. 'page': 0,
  1803. 'size': 10,
  1804. 'isHandle': 0
  1805. }
  1806. FetchInitAssistEnter(params).then(data => {
  1807. data.forEach(function(item, index) {
  1808. item.hasChildren = true
  1809. item.children = null
  1810. item.childLoading = false
  1811. })
  1812. this.aiCategoryData = data
  1813. this.aiCategoryloading = false
  1814. })
  1815. },
  1816. // 获取自动分析内容和提问
  1817. getDoHandleEnterAnalysis(row) {
  1818. this.isAiAutoCategory = true
  1819. this.aIAssistEnterVisible = false
  1820. const params = {
  1821. 'categoryId': this.selectedCategory.id,
  1822. 'anId': row.id
  1823. }
  1824. FetchDoHandleEnterAnalysis(params).then(data => {
  1825. // const inputMessage = data.query + '需要提取得内容部分是' + data.context
  1826. this.sendMessage(data.query, data.context)
  1827. })
  1828. },
  1829. handleExpandChange(row, expandedRows) {
  1830. if (expandedRows.length > 0) {
  1831. // 展开行
  1832. this.loadFile(row)
  1833. } else {
  1834. // 收起行
  1835. row.children = null
  1836. }
  1837. },
  1838. loadFile(row) {
  1839. row.childLoading = true
  1840. const params = {
  1841. 'anId': row ? row.id : null
  1842. }
  1843. FetchInitAssistEnterTemp(params).then(data => {
  1844. row.children = data
  1845. setTimeout(() => {
  1846. row.childLoading = false
  1847. }, 500)
  1848. }).catch(error => {
  1849. console.error('请求接口失败', error)
  1850. setTimeout(() => {
  1851. row.childLoading = false
  1852. }, 500)
  1853. })
  1854. },
  1855. handleAIClose() {
  1856. this.aiCategoryData = []
  1857. this.aIAssistEnterVisible = false
  1858. },
  1859. getFileSize(fileSize) {
  1860. // 1. 先将接口返回的KB值转为数字,处理非数字/空值情况
  1861. const sizeInKB = Number(fileSize)
  1862. if (isNaN(sizeInKB) || sizeInKB < 0) {
  1863. return '0 KB' // 异常值默认显示0 KB
  1864. }
  1865. // 2. 定义单位换算关系(1 MB = 1024 KB,1 GB = 1024 MB)
  1866. const KB = 1
  1867. const MB = 1024 * KB
  1868. const GB = 1024 * MB
  1869. // 3. 根据大小自动选择单位并格式化
  1870. if (sizeInKB >= GB) {
  1871. // 大于等于1GB,显示GB(保留2位小数)
  1872. return (sizeInKB / GB).toFixed(2) + ' GB'
  1873. } else if (sizeInKB >= MB) {
  1874. // 大于等于1MB且小于1GB,显示MB(保留2位小数)
  1875. return (sizeInKB / MB).toFixed(2) + ' MB'
  1876. } else if (sizeInKB < 1) {
  1877. // 不足1KB,统一显示1 KB(保持你之前的需求)
  1878. return '1 KB'
  1879. } else {
  1880. // 1KB到1MB之间,显示KB(保留2位小数)
  1881. return sizeInKB + ' KB'
  1882. }
  1883. },
  1884. // 向deepseek发出提问和分析内容
  1885. async sendMessage(prompt, context) {
  1886. const linkSrc = process.env.NODE_ENV === 'production' ? window.g.AIDeepSeekUrl : process.env.VUE_APP_AIDEEPSEEK_API
  1887. this.displayedText = ''
  1888. this.isDialogClosed = false // 重置标志位
  1889. try {
  1890. // { 'role': 'system', 'content': '你是一个数据分析助手' },
  1891. const messages = [
  1892. { 'role': 'user', 'content': `${context}\n\n${prompt}` }
  1893. ]
  1894. const response = await fetch(linkSrc + '/api/generate', {
  1895. method: 'POST',
  1896. headers: {
  1897. 'Content-Type': 'application/json'
  1898. },
  1899. body: JSON.stringify({
  1900. model: 'deepseek-r1:14b',
  1901. // model: 'qwen:7b',
  1902. prompt: messages[0].content,
  1903. stream: true
  1904. })
  1905. })
  1906. if (!response.ok) {
  1907. throw new Error(`HTTP error! status: ${response.status}`)
  1908. }
  1909. this.reader = response.body.getReader() // 存储读取器
  1910. const decoder = new TextDecoder('utf-8')
  1911. let done = false
  1912. while (!done && !this.isDialogClosed) { // 检查标志位
  1913. this.aiResultCaLoading = false
  1914. const { done: isDone, value } = await this.reader.read()
  1915. done = isDone
  1916. if (done) break
  1917. const chunk = decoder.decode(value)
  1918. const lines = chunk.split('\n')
  1919. lines.forEach(line => {
  1920. if (line.trim() !== '') {
  1921. try {
  1922. const data = JSON.parse(line)
  1923. if (data.response && !this.isDialogClosed) { // 再次检查标志位
  1924. this.displayedText += data.response
  1925. }
  1926. } catch (error) {
  1927. console.error('解析JSON数据出错:', error)
  1928. }
  1929. }
  1930. })
  1931. // 滚动条始终保持在底部
  1932. const container = this.$refs.typingContainer
  1933. if (container) {
  1934. container.scrollTop = container.scrollHeight
  1935. }
  1936. }
  1937. } catch (error) {
  1938. console.error('请求出错:', error)
  1939. this.displayedText = '请求出错,请稍后再试。'
  1940. this.aiResultCaLoading = false
  1941. } finally {
  1942. this.aiResultCaLoading = false
  1943. if (!this.isDialogClosed) {
  1944. // 去除 <think> 和 </think> 之间的内容
  1945. const thinkStartIndex = this.displayedText.indexOf('<think>')
  1946. const thinkEndIndex = this.displayedText.indexOf('</think>')
  1947. let lastContent = this.displayedText
  1948. if (thinkStartIndex !== -1 && thinkEndIndex !== -1) {
  1949. lastContent = lastContent.slice(0, thinkStartIndex) + lastContent.slice(thinkEndIndex + '</think>'.length)
  1950. }
  1951. // 提取 JSON 部分
  1952. const startIndex = lastContent.indexOf('{')
  1953. const endIndex = lastContent.lastIndexOf('}')
  1954. if (startIndex !== -1 && endIndex !== -1 && endIndex > startIndex) {
  1955. const jsonStr = lastContent.slice(startIndex, endIndex + 1)
  1956. const jsonData = JSON.parse(jsonStr)
  1957. console.log('提取并过滤后的 JSON 数据:', jsonData)
  1958. jsonData.fonds_no = this.selectedCategory.fondsNo
  1959. jsonData.archival_category_code = this.selectedCategory.code
  1960. jsonData.is_entity = 1
  1961. console.log('jsonData', jsonData)
  1962. this.$refs.previewForm.addOrUpdateForm = jsonData
  1963. }
  1964. }
  1965. this.reader = null // 清空读取器
  1966. }
  1967. },
  1968. replaceSeparators(str) {
  1969. return str.replace(/[,,、]/g, ' ')
  1970. }
  1971. }
  1972. }
  1973. </script>
  1974. <style lang='scss' scoped>
  1975. ::v-deep .vue-treeselect__list-item{
  1976. width: 220px;
  1977. }
  1978. ::v-deep .vue-treeselect__menu {
  1979. padding: 20px 0;
  1980. }
  1981. ::v-deep .vue-treeselect__option--highlight{
  1982. background: #f5f9fc !important;
  1983. color: #0348f3 !important;
  1984. }
  1985. ::v-deep .vue-treeselect__option-arrow-container .vue-treeselect__option-arrow{
  1986. color: #1c1c1c !important;
  1987. }
  1988. ::v-deep .vue-treeselect__placeholder{
  1989. font-size: 14px;
  1990. }
  1991. ::v-deep .vue-treeselect__label-container{
  1992. font-size: 14px;
  1993. height: 34px;
  1994. line-height: 34px;
  1995. color: #1c1c1c;
  1996. }
  1997. ::v-deep .vue-treeselect__option.vue-treeselect__option--disabled{
  1998. .vue-treeselect__label-container{
  1999. color: #545b65 !important;
  2000. }
  2001. }
  2002. ::v-deep.vue-treeselect--has-value .vue-treeselect__single-value{
  2003. font-size: 14px;
  2004. }
  2005. .ai-preview-dialog{
  2006. ::v-deep .el-dialog{
  2007. width: 1300px !important;
  2008. .preview-content{
  2009. width: 728px !important;
  2010. }
  2011. }
  2012. }
  2013. .aiAssist-dialog{
  2014. ::v-deep .el-dialog{
  2015. width: 1160px !important;
  2016. }
  2017. }
  2018. pre {
  2019. background-color: #f4f4f4;
  2020. padding: 10px;
  2021. border: 1px solid #ccc;
  2022. border-radius: 4px;
  2023. white-space: pre-wrap;
  2024. word-wrap: break-word;
  2025. height: calc(100vh - 330px);
  2026. overflow: hidden;
  2027. overflow-y: auto;
  2028. }
  2029. ::v-deep .el-table.child-table tr{
  2030. background-color: #f0f9eb;
  2031. }
  2032. </style>