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

239 lines
7.9 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <div class="app-container tab-container" style="height: calc(100vh - 140px);">
  3. <div class="head-container" style="display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px;">
  4. <div class="head-search" style="margin-bottom: 0;">
  5. <el-input
  6. v-model="keyWord"
  7. size="small"
  8. clearable
  9. placeholder="输入关键字可模糊检索"
  10. style="width: 245px;"
  11. class="filter-item"
  12. @clear="crud.toQuery"
  13. @keyup.enter.native="crud.toQuery"
  14. />
  15. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="crud.toQuery">搜索</el-button>
  16. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
  17. </div>
  18. <crudOperation>
  19. <template v-slot:right>
  20. <el-button size="mini" :disabled="crud.selections.length === 0" @click="handleLend(crud.selections)">
  21. <i class="iconfont icon-shengchengpandiandan" />
  22. 利用
  23. </el-button>
  24. <el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="toDelete(crud.selections)">
  25. <i class="iconfont icon-shanchu" />
  26. 删除
  27. </el-button>
  28. </template>
  29. </crudOperation>
  30. </div>
  31. <el-table
  32. ref="table"
  33. v-loading="crud.loading"
  34. class="archives-table"
  35. :data="crud.data"
  36. row-key="id"
  37. style="width: 100%;"
  38. height="calc(100vh - 266px)"
  39. @row-click="clickRowHandler"
  40. @cell-dblclick="tableDoubleClick"
  41. @selection-change="crud.selectionChangeHandler"
  42. >
  43. <el-table-column type="selection" :reserve-selection="true" width="55" align="center" />
  44. <el-table-column prop="maintitle" label="题名" />
  45. <el-table-column prop="archiveNo" label="档号" min-width="200" />
  46. <el-table-column prop="categoryName" label="门类" align="center" />
  47. <el-table-column prop="archivesClassName" label="分类" align="center" />
  48. <el-table-column prop="categoryLevel" label="层级" align="center">
  49. <template slot-scope="scope">
  50. <div>{{ scope.row.categoryLevel === 3 ? '文件' : '其他' }}</div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="processStatus" label="审批锁定" align="center">
  54. <template slot-scope="scope">
  55. <span :class="['row-state', 'row-warehousing', scope.row.processStatus !== 1 ? 'state-active' : '' ]">{{ processedStatusText(scope.row.processStatus) }}</span>
  56. </template>
  57. </el-table-column>
  58. <el-table-column prop="createTime" label="加入时间" width="200">
  59. <template slot-scope="scope">
  60. <div>{{ scope.row.createTime | parseTime }}</div>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <pagination v-if="crud.data.length !== 0" />
  65. <LendForm ref="lendFormRef" @close-dialog="closeDialog" />
  66. <!-- 档案详情 -->
  67. <ArchivesInfo ref="archivesInfo" :category-id="categoryId" :arc-id="arcId" :is-title-type="isTitleType" />
  68. </div>
  69. </template>
  70. <script>
  71. import CRUD, { presenter, crud } from '@crud/crud'
  72. import pagination from '@crud/Pagination'
  73. import crudOperation from '@crud/CRUD.operation'
  74. import LendForm from '@/views/archiveUtilize/utillizeRecord/module/utilizationProcess'
  75. import ArchivesInfo from '@/views/components/archivesDetail/detail'
  76. import { FetchDelBorrowCar } from '@/api/archiveUtilize/cart'
  77. import { mapGetters } from 'vuex'
  78. import store from '@/store'
  79. export default {
  80. name: 'Cart',
  81. components: { pagination, crudOperation, LendForm, ArchivesInfo },
  82. mixins: [presenter(), crud()],
  83. cruds() {
  84. return CRUD({
  85. url: 'api/archivesUtilize/initborrowCar',
  86. title: '借阅车',
  87. crudMethod: { },
  88. optShow: {
  89. add: false,
  90. edit: false,
  91. del: false,
  92. download: false,
  93. reset: false,
  94. group: false
  95. }
  96. })
  97. },
  98. data() {
  99. return {
  100. isTitleType: 3,
  101. keyWord: null,
  102. categoryId: null,
  103. arcId: ''
  104. }
  105. },
  106. computed: {
  107. ...mapGetters([
  108. 'user',
  109. 'baseApi'
  110. ]),
  111. processedStatusText() {
  112. return function(status) {
  113. let text = ''
  114. if (status === 1) {
  115. text = '空闲'
  116. } else if (status === 2) {
  117. text = '退回'
  118. } else if (status === 3) {
  119. text = '开放'
  120. } else if (status === 4) {
  121. text = '销毁'
  122. } else if (status === 5) {
  123. text = '利用'
  124. } else if (status === 6) {
  125. text = '内部移交'
  126. } else if (status === 7) {
  127. text = '外部移交'
  128. }
  129. return text
  130. }
  131. }
  132. },
  133. watch: {
  134. },
  135. created() {
  136. },
  137. methods: {
  138. resetQuery() {
  139. this.keyWord = null
  140. this.crud.toQuery()
  141. },
  142. [CRUD.HOOK.beforeRefresh]() {
  143. this.crud.query.search = this.keyWord
  144. },
  145. toDelete(data) {
  146. console.log(data)
  147. this.$confirm('此操作将删除所选数据' + '<span>你是否还要继续?</span>', '提示', {
  148. confirmButtonText: '继续',
  149. cancelButtonText: '取消',
  150. type: 'warning',
  151. dangerouslyUseHTMLString: true
  152. }).then(() => {
  153. const ids = data.map(item => {
  154. return item.archivesId
  155. })
  156. const params = {
  157. 'ids': ids
  158. }
  159. FetchDelBorrowCar(params).then((res) => {
  160. if (res) {
  161. this.$message({ message: '删除成功', type: 'success', offset: 8 })
  162. this.crud.refresh()
  163. store.dispatch('initborrowCar').then(() => {})
  164. } else {
  165. this.crud.notify(res.message, CRUD.NOTIFICATION_TYPE.ERROR)
  166. }
  167. this.$refs.table.clearSelection()
  168. }).catch(err => {
  169. console.log(err)
  170. })
  171. }).catch(() => {
  172. })
  173. },
  174. handleLend(data) {
  175. console.log('data', data)
  176. this.$refs.lendFormRef.lendFormVisible = true
  177. this.$nextTick(() => {
  178. this.$refs.lendFormRef.detailArcData = []
  179. data.forEach(item => {
  180. item.checkedId = [1]
  181. item.childMenu = [{
  182. value: 1,
  183. label: '电子查看'
  184. },
  185. {
  186. value: 2,
  187. label: '下载'
  188. },
  189. {
  190. value: 3,
  191. label: '打印'
  192. },
  193. {
  194. value: 4,
  195. label: '实体借阅'
  196. }]
  197. })
  198. this.$refs.lendFormRef.detailArcData = data
  199. })
  200. },
  201. clickRowHandler(row) {
  202. this.$refs.table.toggleRowSelection(row)
  203. },
  204. tableDoubleClick(row) {
  205. this.categoryId = row.categoryPid
  206. this.arcId = row.archivesId
  207. this.$nextTick(() => {
  208. if (row.categoryLevel === 2) {
  209. this.$refs.archivesInfo.isHasFile = false
  210. this.$refs.archivesInfo.detailTitle = '案卷详情'
  211. this.$refs.archivesInfo.getDetial(2, row.archivesId)
  212. } else {
  213. this.$refs.archivesInfo.isHasFile = true
  214. this.$refs.archivesInfo.detailTitle = '文件详情'
  215. this.$refs.archivesInfo.getDetial(3, row.archivesId)
  216. }
  217. // this.$refs.archivesInfo.isHasFile = true
  218. // this.$refs.archivesInfo.detailTitle = '文件详情'
  219. // this.$refs.archivesInfo.getDetial(3, row.archivesId)
  220. this.$refs.archivesInfo.isFourTest = true
  221. this.$refs.archivesInfo.archivesInfoVisible = true
  222. this.$refs.archivesInfo.archivesTabIndex = 0
  223. })
  224. },
  225. closeDialog() {
  226. this.keyWord = null
  227. this.crud.toQuery()
  228. this.$refs.table.clearSelection()
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="scss" scoped>
  234. .el-pagination{
  235. margin: 10px 0 !important;
  236. }
  237. </style>