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

197 lines
7.0 KiB

3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
1 year ago
2 years ago
3 years ago
2 years ago
2 years ago
1 year ago
2 years ago
3 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
3 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
3 years ago
  1. <template>
  2. <div>
  3. <el-table :data="tableData" style="width: 100%" height="320" @cell-dblclick="tableDoubleClick">
  4. <el-table-column type="index" align="center" width="55" />
  5. <el-table-column prop="fondsName" label="所属全宗" min-width="120" />
  6. <el-table-column prop="categoryName" label="门类名称" min-width="120" />
  7. <el-table-column prop="categoryLevel" label="整理方式">
  8. <template slot-scope="scope">
  9. <span>{{ scope.row.categoryLevel === 2 ? '案卷整理' : '按件整理' }}</span>
  10. </template>
  11. </el-table-column>
  12. <el-table-column prop="archiveNo" label="项目号/档号" min-width="200" />
  13. <el-table-column prop="maintitle" label="题名" min-width="200" />
  14. <el-table-column v-if="isUtilize" prop="utilizeType" label="利用方式" width="300">
  15. <template slot-scope="scope">
  16. <el-checkbox-group v-model="scope.row.utilizeType" class="checkbox-style">
  17. <el-checkbox v-for="item in uselist" :key="item.value" :label="item.value" disabled>{{ item.label }}</el-checkbox>
  18. </el-checkbox-group>
  19. </template>
  20. </el-table-column>
  21. <el-table-column v-if="isUtilize" prop="utilizeState" label="是否允许借阅" align="center" width="160">
  22. <template slot-scope="scope">
  23. <el-select
  24. v-if="isFlowableForm"
  25. v-model="scope.row.utilizeState"
  26. placeholder="请选择"
  27. style="width: 140px;"
  28. @change="handleChange(scope.row.archivesId,$event)"
  29. >
  30. <el-option
  31. v-for="item in utilizeStateOptions"
  32. :key="item.value"
  33. :label="item.label"
  34. :value="item.value"
  35. />
  36. </el-select>
  37. <div v-else>
  38. <!-- 实体利用状态 -1.未确认流程(未审批) 0.无需借阅 1.同意借阅 2.不允许借阅 3.已归还 -->
  39. <span v-if="scope.row.utilizeState === -1" class="row-state soon-state">审批中</span>
  40. <span v-if="scope.row.utilizeState === 0" class="row-state end-state">无需借阅</span>
  41. <span v-if="scope.row.utilizeState === 1" class="row-state end-state">同意借阅</span>
  42. <span v-if="scope.row.utilizeState === 2" class="row-state cancel-state">不允许借阅</span>
  43. <span v-if="scope.row.utilizeState === 3" class="row-state end-state">已归还</span>
  44. </div>
  45. </template>
  46. </el-table-column>
  47. </el-table>
  48. <el-pagination :page-size.sync="setPage.size" :total="setPage.total" :current-page.sync="setPage.page+1" style="margin-top: 8px;" layout="total, prev, pager, next, sizes" @size-change="sizeChangeHandler($event)" @current-change="pageChangeHandler" />
  49. <ArchivesInfo ref="archivesInfo" :category-id="categoryId" :arc-id="arcId" :is-title-type="isTitleType" />
  50. </div>
  51. </template>
  52. <script>
  53. import ArchivesInfo from '@/views/components/archivesDetail/detail'
  54. import { parseTime } from '@/utils/index'
  55. export default {
  56. name: 'BusinessDetails',
  57. components: { ArchivesInfo },
  58. props: {
  59. tableData: {
  60. type: Array,
  61. default: null
  62. },
  63. isUtilize: {
  64. type: Boolean,
  65. default: false
  66. },
  67. isFlowableForm: {
  68. type: Boolean,
  69. default: false
  70. },
  71. setPage: {
  72. type: Object,
  73. default: function() {
  74. return {
  75. total: 0,
  76. size: 10,
  77. page: 0
  78. }
  79. }
  80. },
  81. baseInfo: {
  82. type: Object,
  83. default: function() {
  84. return { }
  85. }
  86. }
  87. },
  88. data() {
  89. return {
  90. categoryId: null,
  91. arcId: '',
  92. isTitleType: 3,
  93. uselist: [
  94. {
  95. value: 1,
  96. label: '电子查看'
  97. },
  98. {
  99. value: 2,
  100. label: '下载'
  101. },
  102. // {
  103. // value: 3,
  104. // label: '打印'
  105. // }
  106. {
  107. value: 4,
  108. label: '实体借阅'
  109. }
  110. ],
  111. utilizeStateOptions: [
  112. {
  113. value: 1,
  114. label: '同意借阅'
  115. },
  116. {
  117. value: 2,
  118. label: '不允许借阅'
  119. }
  120. ]
  121. }
  122. },
  123. mounted() {
  124. },
  125. methods: {
  126. formatDate(date) {
  127. const year = date.getFullYear()
  128. const month = String(date.getMonth() + 1).padStart(2, '0')
  129. const day = String(date.getDate()).padStart(2, '0')
  130. const hours = String(date.getHours()).padStart(2, '0')
  131. const minutes = String(date.getMinutes()).padStart(2, '0')
  132. const seconds = String(date.getSeconds()).padStart(2, '0')
  133. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
  134. },
  135. handleChange(id, value) {
  136. this.$emit('select-change', { id, value })
  137. },
  138. // table - 双击查看详情
  139. tableDoubleClick(row) {
  140. // 利用得情况会是true
  141. // console.log('666baseInfo', this.baseInfo)
  142. // console.log('baseInfo.status === 3 ???', this.baseInfo.status)
  143. // console.log('giveStartTime ???', parseTime(this.baseInfo.giveStartTime))
  144. // console.log('giveEndTime ???', parseTime(this.baseInfo.giveEndTime))
  145. // console.log('isUtilize', this.isUtilize)
  146. // console.log('row', row)
  147. this.categoryId = row.categoryPid
  148. this.arcId = row.archivesId
  149. this.$nextTick(() => {
  150. const currentDate = new Date()
  151. const formattedDate = this.formatDate(currentDate)
  152. // console.log('currentDate', currentDate)
  153. // console.log(parseTime(this.baseInfo.giveStartTime))
  154. const isStartTimeValid = parseTime(this.baseInfo.giveStartTime) <= formattedDate
  155. const isEndTimeValid = parseTime(this.baseInfo.giveEndTime) >= formattedDate
  156. console.log(isStartTimeValid)
  157. console.log(isEndTimeValid)
  158. // 根据条件设置 isShowUtilizeHandleBtn
  159. if (this.isUtilize && this.baseInfo.status === 3 && isStartTimeValid && isEndTimeValid) {
  160. this.$refs.archivesInfo.isShowUtilizeHandleBtn = true
  161. } else {
  162. this.$refs.archivesInfo.isShowUtilizeHandleBtn = false
  163. }
  164. this.$refs.archivesInfo.archivesInfoVisible = true
  165. this.$refs.archivesInfo.archivesTabIndex = 0
  166. this.$refs.archivesInfo.isFourTest = true
  167. if (row.categoryLevel === 2) {
  168. this.$refs.archivesInfo.isHasFile = false
  169. this.$refs.archivesInfo.detailTitle = '案卷详情'
  170. this.$refs.archivesInfo.getDetial(2, row.archivesId)
  171. } else {
  172. this.$refs.archivesInfo.isHasFile = true
  173. this.$refs.archivesInfo.detailTitle = '文件详情'
  174. this.$refs.archivesInfo.getDetial(3, row.archivesId)
  175. }
  176. })
  177. },
  178. // 当前页改变
  179. pageChangeHandler(e) {
  180. this.$emit('page-change', e)
  181. },
  182. // 每页条数改变
  183. sizeChangeHandler(e) {
  184. this.$emit('size-change', e)
  185. }
  186. }
  187. }
  188. </script>
  189. <style lang='scss' scoped>
  190. </style>