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

562 lines
19 KiB

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
  1. <template>
  2. <div class="app-container">
  3. <div class="collect-paper-header">
  4. <div class="paper-step-item paper-step1">
  5. <i />
  6. <p>选择组卷条件</p>
  7. </div>
  8. <div :class="['paper-step-dot', step===2 || step===3 ? 'dot-active':'']" />
  9. <div :class="['paper-step-item paper-step2', step===2 || step===3 ? 'paper-step2-active':'']">
  10. <i />
  11. <p>确认组卷条目</p>
  12. </div>
  13. <div :class="['paper-step-dot', step===3 ? 'dot-active':'']" />
  14. <div :class="['paper-step-item', 'paper-step3', step===3 ? 'paper-step3-active':'']">
  15. <i />
  16. <p>补充案卷数据</p>
  17. </div>
  18. </div>
  19. <div class="collect-paper-filter">
  20. <div class="collect-paper-form">
  21. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  22. <el-row>
  23. <el-col :span="12">
  24. <el-form-item label="年份" prop="years">
  25. <el-select v-model="form.years" placeholder="请选择" style="width: 110px;" :disabled="step===2 || step===3">
  26. <el-option
  27. v-for="item in yearsOptions"
  28. :key="item"
  29. :label="item"
  30. :value="item"
  31. />
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="12">
  36. <el-form-item label="月份" prop="month">
  37. <el-select v-model="form.month" placeholder="请选择" style="width: 110px;" :disabled="step===2 || step===3">
  38. <el-option
  39. v-for="item in monthOptions"
  40. :key="item.value"
  41. :label="item.label"
  42. :value="item.value"
  43. />
  44. </el-select>
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. <el-form-item label="全宗" prop="fonds.id">
  49. <el-select v-model="form.fonds.id" placeholder="请选择" style="width: 320px;" :disabled="step===2 || step===3" @click.native="lastValue = form.fonds.id" @change="changeFondsValue($event)">
  50. <el-option
  51. v-for="(item,index) in fondsOptions"
  52. :key="index"
  53. :label="item.fondsName"
  54. :value="item.id"
  55. />
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item label="档案门类" prop="categoryId">
  59. <treeselect
  60. v-model="form.categoryId"
  61. :options="categoryDatas"
  62. placeholder="请选择"
  63. flat
  64. :multiple="false"
  65. :normalizer="normalizer"
  66. :disabled="step===2 || step===3"
  67. @select="selectCategoryTree"
  68. />
  69. </el-form-item>
  70. <el-form-item label="档案分类" prop="archivesClassId">
  71. <treeselect
  72. v-model="form.archivesClassId"
  73. :options="classifyOptions"
  74. :normalizer="classifyNormalizer"
  75. :disabled="step===2 || step===3"
  76. placeholder="请选择"
  77. no-options-text="暂无数据"
  78. />
  79. </el-form-item>
  80. <el-button v-if="step === 1" class="step-btn next-btn" type="primary" @click="nextFilterStep('form')">下一步</el-button>
  81. </el-form>
  82. </div>
  83. <div :class="['collect-paper-list',{'paper-step2-list': step === 2}]">
  84. <div v-if="step===1" class="collect-no-data">选择组卷条件后自动获取数据</div>
  85. <div v-if="step===2 || step===3" class="collect-paper-table">
  86. <div class="paper-table-header">
  87. <p>成功获得待组卷文件<span>7</span>选中<span>N</span>条进行组卷</p>
  88. <div class="head-search">
  89. <el-input v-model="blurry" clearable size="small" placeholder="输入题名或档号搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" />
  90. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search">搜索</el-button>
  91. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left">重置</el-button>
  92. </div>
  93. <el-button class="filter-item remove-btn" size="mini" type="success" :disabled="selections.length === 0" @click="toMove(selections)"><i class="iconfont icon-shanchu" />移除</el-button>
  94. </div>
  95. <el-table
  96. ref="table"
  97. v-loading="loading"
  98. class="archives-table"
  99. :data="tableData"
  100. style="width: 100%;"
  101. height="calc(100vh - 706px)"
  102. @select-all="selectAll"
  103. @row-click="clickRowHandler"
  104. @select="handleCurrentChange"
  105. >
  106. <el-table-column type="selection" align="center" width="55" />
  107. <el-table-column prop="category_type" label="门类级别" align="center" min-width="100">
  108. <template slot-scope="scope">
  109. <span v-if="scope.row.category_type === 5" style="width:56px">文件级</span>
  110. <span v-if="scope.row.category_type === 4" style="width:56px">卷内级</span>
  111. <span v-if="scope.row.category_type === 3" style="width:56px">案卷级</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column prop="category_name" label="门类名称" align="center" show-overflow-tooltip min-width="170" />
  115. <el-table-column prop="child" label="子条数目" align="center" width="100" />
  116. <el-table-column prop="archive_no" label="档号" align="center" show-overflow-tooltip min-width="220" />
  117. <el-table-column prop="maintitle" label="题名" show-overflow-tooltip align="center" min-width="240" />
  118. <el-table-column prop="doc_no" label="发文字号" show-overflow-tooltip width="140" align="center" />
  119. <el-table-column prop="serial_no" label="序号" width="100" align="center" />
  120. <el-table-column prop="fonds_no" label="全宗号" align="center" min-width="180" />
  121. <el-table-column prop="archive_year" label="年度" align="center" min-width="100" />
  122. <el-table-column prop="security_class" label="密级" align="center" min-width="100" />
  123. <el-table-column prop="retention" label="保管期限" align="center" min-width="100" />
  124. <el-table-column prop="arrive_class" label="收发类别" width="140" align="center" />
  125. <el-table-column prop="temp_no" label="临时卷号" show-overflow-tooltip width="140" align="center" />
  126. <el-table-column prop="created_date" label="成文日期" align="center" min-width="180" />
  127. <el-table-column prop="case_name" label="盒名称" show-overflow-tooltip align="center" min-width="200" />
  128. </el-table>
  129. <div class="paper-table-bottom">
  130. <el-button class="step-btn" type="primary" @click="step = 1">上一步</el-button>
  131. <el-button class="step-btn" type="primary" :disabled="selections.length === 0" @click="nextSelectedTable">下一步</el-button>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <eForm ref="eform" />
  137. </div>
  138. </template>
  139. <script>
  140. import { FetchFondsAll } from '@/api/system/fonds'
  141. import { FetchCategoryMenu } from '@/api/system/category/category'
  142. import { FetchArchivesClassTree } from '@/api/system/archivesClass'
  143. import Treeselect from '@riophae/vue-treeselect'
  144. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  145. import eForm from './form'
  146. import tableData from './table.json'
  147. export default {
  148. name: 'BatchPaper',
  149. components: { eForm, Treeselect },
  150. data() {
  151. return {
  152. form: {
  153. years: null,
  154. month: null,
  155. fonds: { id: null },
  156. categoryId: null,
  157. archivesClassId: null
  158. },
  159. yearsOptions: [],
  160. monthOptions: [
  161. { label: '一月', value: 1 },
  162. { label: '二月', value: 2 },
  163. { label: '三月', value: 3 },
  164. { label: '四月', value: 4 },
  165. { label: '五月', value: 5 },
  166. { label: '六月', value: 6 },
  167. { label: '七月', value: 7 },
  168. { label: '八月', value: 8 },
  169. { label: '九月', value: 9 },
  170. { label: '十月', value: 10 },
  171. { label: '十一月', value: 11 },
  172. { label: '十二月', value: 12 }
  173. ],
  174. fondsOptions: [],
  175. lastValue: '',
  176. categoryDatas: [],
  177. classifyOptions: [],
  178. blurry: null,
  179. tableData: [],
  180. loading: false,
  181. selections: [],
  182. step: 1,
  183. rules: {
  184. years: [{ required: true, message: '请选择年份', trigger: 'change' }],
  185. month: [{ required: true, message: '请选择月份', trigger: 'change' }],
  186. 'fonds.id': [{ required: true, message: '请选择全宗', trigger: 'change' }],
  187. categoryId: [{ required: true, message: '请选择档案门类', trigger: 'change' }]
  188. }
  189. }
  190. },
  191. computed: {
  192. },
  193. mounted() {
  194. this.generateYears()
  195. this.getFondsDatas()
  196. this.getCategoryDataTree()
  197. },
  198. methods: {
  199. nextFilterStep(formName) {
  200. this.$refs[formName].validate((valid) => {
  201. if (valid) {
  202. this.step = 2
  203. this.tableData = tableData.data.content
  204. } else {
  205. console.log('error submit!!')
  206. return false
  207. }
  208. })
  209. },
  210. generateYears() {
  211. const currentYear = new Date().getFullYear()
  212. for (let i = 0; i < 11; i++) {
  213. this.yearsOptions.push(currentYear - i)
  214. }
  215. },
  216. getFondsDatas() {
  217. const parent = {}
  218. parent.id = 0
  219. parent.fondsName = '全宗选择'
  220. FetchFondsAll().then(res => {
  221. // res.forEach(item => {
  222. // item.children = item.depts
  223. // })
  224. // parent.children = res
  225. // this.fondsDatas.push(parent)
  226. this.fondsOptions = res
  227. // this.$nextTick(() => {
  228. // Vue.set(this.defaultExpandedKeys, 0, this.fondsDatas[0].children[0].children[0].id)
  229. // this.$refs.tree.setCurrentKey(this.fondsDatas[0].children[0].children[0].id)
  230. // this.handleNodeClick(this.fondsDatas[0].children[0].children[0])
  231. // })
  232. })
  233. },
  234. changeFondsValue(value) {
  235. console.log(this.lastValue)
  236. if (this.lastValue) {
  237. if (value !== this.lastValue) {
  238. this.form.dept.id = null
  239. }
  240. }
  241. },
  242. filterData(data) {
  243. return data.filter(node => {
  244. if (node.children && node.children.length > 0) {
  245. node.children = this.filterData(node.children) // 递归处理子节点
  246. }
  247. return node.isType !== 3 // 过滤掉isType为3的节点
  248. })
  249. },
  250. getCategoryDataTree() {
  251. FetchCategoryMenu().then(res => {
  252. this.categoryDatas = this.filterData(res)
  253. })
  254. },
  255. selectCategoryTree(val) {
  256. this.getClassifyTree(val.id)
  257. },
  258. getClassifyTree(categoryId) {
  259. FetchArchivesClassTree({ 'categoryId': categoryId }).then(res => {
  260. this.classifyOptions = res.map(function(obj) {
  261. if (obj.childArchivesClass !== null) {
  262. obj.hasChildren = true
  263. } else {
  264. obj.hasChildren = false
  265. }
  266. if (obj.hasChildren) {
  267. obj.children = null
  268. }
  269. return obj
  270. })
  271. })
  272. },
  273. normalizer(node) {
  274. if (node.children === null) {
  275. delete node.children
  276. }
  277. return {
  278. id: node.id,
  279. label: node.cnName,
  280. children: node.children,
  281. isDisabled: node.isType !== 2
  282. }
  283. },
  284. classifyNormalizer(node) {
  285. if (node.childArchivesClass === null) {
  286. delete node.childArchivesClass
  287. }
  288. return {
  289. id: node.id,
  290. label: node.name,
  291. children: node.childArchivesClass
  292. }
  293. },
  294. nextSelectedTable() {
  295. this.step = 3
  296. this.handleForm('add')
  297. },
  298. // table - 全选
  299. selectAll(val) {
  300. this.selections = val
  301. },
  302. // table - 当前选中得row
  303. clickRowHandler(row) {
  304. this.$refs.table.clearSelection()
  305. this.$refs.table.toggleRowSelection(row)
  306. this.selections = []
  307. this.selections.push(row)
  308. },
  309. // 触发单选
  310. handleCurrentChange(selection, row) {
  311. this.selections = selection
  312. },
  313. // 著录界面-form/详情-api
  314. handleForm(type) {
  315. this.$refs.eform.formVisible = true
  316. // if (type === 'add') {
  317. // this.$refs.eform.formTitle = '新增档案'
  318. // } else if (type === 'edit') {
  319. // this.$refs.eform.formTitle = '编辑文件'
  320. // }
  321. this.$refs.eform.formTitle = '新增档案'
  322. // 档案预编辑获取字段
  323. const params = {
  324. categoryId: this.categoryId,
  325. archivesId: this.arcId
  326. }
  327. this.getFormInfo(params, type)
  328. },
  329. getFormInfo(params, type, isAnOrJuan) {
  330. // FetchFormDisplayFields(params).then(data => {
  331. // this.formPreviewData = data.showFiled
  332. // this.$nextTick(() => {
  333. // if (type === 'edit') {
  334. // this.$refs.previewForm.addOrUpdateForm = data.echo
  335. // } else {
  336. // if (this.recycleMain.selectedCategory.isType !== 5) {
  337. // // 新增时拿到项目和案卷的相同的字段的值
  338. // this.formPreviewData.forEach(item => {
  339. // if (isAnOrJuan === 1) {
  340. // if (this.recycleMain.selectedCategory.isType !== 3) {
  341. // if (this.recycleMain.projectSelection[item.fieldName]) {
  342. // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.projectSelection))
  343. // }
  344. // }
  345. // } else if (isAnOrJuan === 2) {
  346. // if (this.recycleMain.anjuanSelection[item.fieldName]) {
  347. // this.$refs.previewForm.addOrUpdateForm = JSON.parse(JSON.stringify(this.recycleMain.anjuanSelection))
  348. // }
  349. // }
  350. // })
  351. // }
  352. // }
  353. // this.isDesFormType = 'arcives'
  354. // this.$refs.previewForm.FetchNoFormatField(this.categoryId)
  355. // })
  356. // })
  357. },
  358. // 删除用户
  359. toMove(datas) {
  360. this.$confirm('此操作将把所选条目从此次批量组卷中移除' + '<span>你是否还要继续?</span>', '提示', {
  361. confirmButtonText: '继续',
  362. cancelButtonText: '取消',
  363. type: 'warning',
  364. dangerouslyUseHTMLString: true
  365. }).then(() => {
  366. // this.crud.delAllLoading = true
  367. const userIds = []
  368. datas.forEach(val => {
  369. userIds.push(val.userId)
  370. })
  371. // crudUser.del(userIds).then(() => {
  372. // this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
  373. // this.crud.delAllLoading = false
  374. // this.crud.refresh()
  375. // }).catch(err => {
  376. // this.crud.delAllLoading = false
  377. // console.log(err)
  378. // })
  379. }).catch(() => {
  380. })
  381. }
  382. }
  383. }
  384. </script>
  385. <style lang='scss' scoped>
  386. .collect-paper-header{
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. height: 154px;
  391. background: linear-gradient(180deg, #F3F5F8 29%, #fff 100%);
  392. border: 2px solid #fff;
  393. .paper-step-item{
  394. display: flex;
  395. flex-wrap: wrap;
  396. align-items: center;
  397. justify-content: center;
  398. width: 100px;
  399. font-size: 16px;
  400. font-weight: 600;
  401. color: #0C0E1E;
  402. i{
  403. display: block;
  404. height: 60px;
  405. }
  406. p{
  407. margin-top: 15px;
  408. }
  409. &.paper-step1{
  410. i{
  411. width: 65px;
  412. background: url('~@/assets/images/collect/one.png') no-repeat center center;
  413. background-size: 65px 60px;
  414. }
  415. }
  416. &.paper-step2{
  417. i{
  418. width: 41px;
  419. background: url('~@/assets/images/collect/two.png') no-repeat bottom center;
  420. background-size: 41px 41px;
  421. }
  422. &.paper-step2-active{
  423. i{
  424. width: 65px;
  425. background: url('~@/assets/images/collect/two2.png') no-repeat center center;
  426. background-size: 65px 60px;
  427. }
  428. }
  429. }
  430. &.paper-step3{
  431. i{
  432. width: 41px;
  433. background: url('~@/assets/images/collect/three.png') no-repeat bottom center;
  434. background-size: 41px 41px;
  435. }
  436. &.paper-step3-active{
  437. i{
  438. width: 65px;
  439. background: url('~@/assets/images/collect/three2.png') no-repeat center center;
  440. background-size: 65px 60px;
  441. }
  442. }
  443. }
  444. }
  445. .paper-step-dot{
  446. width: 146px;
  447. text-align: center;
  448. height: 5px;
  449. background: url('~@/assets/images/collect/dot.png') no-repeat center center;
  450. background-size: contain;
  451. &.dot-active{
  452. background: url('~@/assets/images/collect/dot2.png') no-repeat center center;
  453. background-size: contain;
  454. }
  455. }
  456. }
  457. .collect-paper-filter{
  458. margin-top: 20px;
  459. height: calc(100vh - 313px);
  460. background-color: #fff;
  461. .collect-paper-form{
  462. width: 420px;
  463. padding-top: 30px;
  464. margin: 0 auto;
  465. ::v-deep .el-form{
  466. .el-form-item__label{
  467. color: #0C0E1E;
  468. }
  469. }
  470. }
  471. .step-btn{
  472. color: #fff;
  473. background-color: #0348f3;
  474. border-color: #0348f3;
  475. &.el-button.is-disabled,
  476. &.el-button.is-disabled:hover,
  477. &.el-button.is-disabled:focus{
  478. color: #fff;
  479. background-color: #0348f3;
  480. border-color: #0348f3;
  481. opacity: 0.5 !important;
  482. }
  483. }
  484. .next-btn{
  485. margin-left: 220px;
  486. }
  487. .collect-paper-list{
  488. position: relative;
  489. // display: flex;
  490. // justify-content: center;
  491. // align-items: center;
  492. height: calc(100% - 314px);
  493. margin: 20px;
  494. background-color: #EDEFF3;
  495. &.paper-step2-list{
  496. height: calc(100% - 262px);
  497. }
  498. .collect-no-data{
  499. position: absolute;
  500. left: 50%;
  501. top: 50%;
  502. transform: translate(-50%,-50%);
  503. font-size: 20px;
  504. color: #A6ADB6;
  505. text-align: center;
  506. }
  507. }
  508. }
  509. .collect-paper-table{
  510. padding: 20px;
  511. }
  512. .paper-table-header{
  513. display: flex;
  514. justify-content: space-between;
  515. p{
  516. flex: 1;
  517. padding-left: 52px;
  518. margin-top: -8px;
  519. color: #0C0E1E;
  520. font-size: 15px;
  521. line-height: 52px;
  522. background: url('~@/assets/images/collect/jn.png') no-repeat left top;
  523. background-size: 46px 49px;
  524. span{
  525. padding: 0 2px;
  526. color: #0348F3;
  527. }
  528. }
  529. ::v-deep .el-input__inner,
  530. .filter-refresh{
  531. background-color: transparent !important;
  532. border-color: #D9D9D9;
  533. }
  534. .filter-search,
  535. .filter-refresh{
  536. margin-left: 10px;
  537. }
  538. .remove-btn{
  539. height: 32px;
  540. margin-left: 60px;
  541. }
  542. }
  543. .paper-table-bottom{
  544. display: flex;
  545. justify-content: center;
  546. margin-top: 10px;
  547. }
  548. ::v-deep .el-table {
  549. .el-table__body-wrapper {
  550. tr{
  551. background-color: #fff !important;
  552. }
  553. }
  554. }
  555. </style>