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

208 lines
6.5 KiB

  1. <template>
  2. <!-- 开放清册 -->
  3. <div class="app-container row-container">
  4. <div class="connection-header collect-header" style="margin-bottom: 20px;">
  5. <div class="head-search" style="margin-bottom: 0;">
  6. <el-select
  7. v-model="status"
  8. style="margin-right: 10px; width: 110px;"
  9. placeholder="请选择"
  10. @change="getBusinessFlowHistory"
  11. >
  12. <el-option
  13. v-for="item in stateOptions"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value"
  17. />
  18. </el-select>
  19. <el-input v-model="search" clearable size="small" placeholder="输入关键字可模糊搜索" prefix-icon="el-icon-search" style="width: 200px;" class="filter-item" @keyup.enter.native="getBusinessFlowHistory" @clear="getBusinessFlowHistory" />
  20. <el-button class="filter-item filter-search" size="mini" type="success" icon="el-icon-search" @click="getBusinessFlowHistory">搜索</el-button>
  21. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery">重置</el-button>
  22. </div>
  23. <el-button size="mini" :disabled="selections.length === 0" @click="doExport(selections)">
  24. <i class="iconfont icon-daochu" />
  25. 导出
  26. </el-button>
  27. </div>
  28. <el-table ref="table" :data="tableData" style="width: 100%;" height="calc(100vh - 330px)" @select="handleCurrentChange" @selection-change="selectionChangeHandler" @row-dblclick="handleDetail">
  29. <el-table-column type="selection" align="center" width="55" />
  30. <el-table-column v-if="inventType===6" prop="business_type" label="类型">
  31. <template>
  32. <div>内部移交</div>
  33. </template>
  34. </el-table-column>
  35. <el-table-column prop="title" label="标题" min-width="180" />
  36. <el-table-column prop="reason" label="申请理由" />
  37. <el-table-column prop="applicant" label="申请人" />
  38. <el-table-column prop="deptsName" label="申请部门" />
  39. <el-table-column prop="createTime" label="申请时间">
  40. <template slot-scope="scope">
  41. <div>{{ scope.row.createTime }}</div>
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="completeTime" label="完成时间">
  45. <template slot-scope="scope">
  46. <div>{{ scope.row.completeTime }}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column prop="createTime" label="状态" width="80">
  50. <template slot-scope="scope">
  51. <span v-if="scope.row.status === 1" class="row-state ing-state">进行中</span>
  52. <span v-if="scope.row.status === 2" class="row-state case-cancel">已取消</span>
  53. <span v-if="scope.row.status === 3" class="row-state end-state">已完成</span>
  54. <span v-if="scope.row.status === 4" class="row-state cancel-state">不通过</span>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <!--分页组件-->
  59. <el-pagination
  60. v-if="tableData.length !== 0"
  61. :current-page="page.page"
  62. :total="page.total"
  63. :page-size="page.size"
  64. :pager-count="5"
  65. layout="total, prev, pager, next, sizes"
  66. @size-change="handleSizeChange"
  67. @current-change="handleCurrentPage"
  68. />
  69. <Detail ref="mDetail" :invent-type="inventType" />
  70. </div>
  71. </template>
  72. <script>
  73. import Detail from './module/detail'
  74. import { FetchBusinessFlowHistory } from '@/api/archivesManage/library'
  75. import qs from 'qs'
  76. import { exportFile } from '@/utils/index'
  77. import { mapGetters } from 'vuex'
  78. export default {
  79. name: 'OpenInventory',
  80. components: { Detail },
  81. props: {
  82. inventType: {
  83. type: Number,
  84. default: 3
  85. }
  86. },
  87. data() {
  88. return {
  89. status: null,
  90. stateOptions: [
  91. {
  92. value: 1,
  93. label: '进行中'
  94. },
  95. {
  96. value: 2,
  97. label: '已取消'
  98. },
  99. {
  100. value: 3,
  101. label: '已完成'
  102. },
  103. {
  104. value: 4,
  105. label: '不通过'
  106. }
  107. ],
  108. businessType: this.inventType,
  109. search: '',
  110. tableData: [],
  111. selections: [],
  112. page: {
  113. page: 0,
  114. size: 10,
  115. total: 0
  116. }
  117. }
  118. },
  119. computed: {
  120. ...mapGetters([
  121. 'baseApi'
  122. ])
  123. },
  124. created() {
  125. },
  126. mounted() {
  127. this.getBusinessFlowHistory()
  128. },
  129. methods: {
  130. resetQuery() {
  131. this.search = ''
  132. this.status = null
  133. this.getBusinessFlowHistory()
  134. },
  135. getBusinessFlowHistory() {
  136. const params = {
  137. 'status': this.status,
  138. 'search': this.search,
  139. 'businessType': this.businessType,
  140. 'page': this.page.page,
  141. 'size': this.page.size
  142. }
  143. FetchBusinessFlowHistory(params).then((res) => {
  144. if (res.code !== 500) {
  145. this.tableData = res.content
  146. this.page.total = res.totalElements
  147. } else {
  148. this.$message.error('获取数据失败')
  149. }
  150. }).catch(err => {
  151. console.log(err)
  152. })
  153. },
  154. handleDetail(row) {
  155. this.$refs.mDetail.rowCurrent = row
  156. this.$refs.mDetail.detialVisible = true
  157. },
  158. // 触发单选
  159. handleCurrentChange(selection, row) {
  160. this.selections = selection
  161. },
  162. handleSizeChange(size) {
  163. this.page.size = size
  164. this.page.page = 1
  165. },
  166. handleCurrentPage(val) {
  167. this.page.page = val
  168. },
  169. selectionChangeHandler(val) {
  170. this.selections = val
  171. },
  172. doExport(data) {
  173. this.$confirm('此操作将导出所选数据' + '<span>你是否还要继续?</span>', '提示', {
  174. confirmButtonText: '继续',
  175. cancelButtonText: '取消',
  176. type: 'warning',
  177. dangerouslyUseHTMLString: true
  178. }).then(() => {
  179. const ids = []
  180. data.forEach(val => {
  181. ids.push(val.id)
  182. })
  183. const params = {
  184. 'businessIds': ids,
  185. 'businessType': this.businessType
  186. }
  187. exportFile(this.baseApi + '/api/control/exportBusinessFlow?' + qs.stringify(params, { indices: false }))
  188. }).catch(() => {
  189. })
  190. }
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. @import "~@/assets/styles/collect-reorganizi.scss";
  196. .connection-header{
  197. padding: 0 !important;
  198. }
  199. .case-cancel{
  200. color: #a6adb6;
  201. border: 1px solid #e6e8ed;
  202. background-color: #f3f5f9;
  203. }
  204. </style>