阅行客电子档案
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.

1824 lines
78 KiB

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