myApprove.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <div>
  3. <el-row class="handle-box" style="margin-bottom: 10px">
  4. <el-col :span="24">
  5. <el-date-picker
  6. id="datePicker"
  7. v-model="CreateDate"
  8. size="small"
  9. type="daterange"
  10. align="right"
  11. unlink-panels
  12. range-separator="-"
  13. start-placeholder="发起开始日期"
  14. end-placeholder="发起结束日期"
  15. value-format="yyyy-MM-dd"
  16. @change="pickerChange"
  17. />
  18. <el-date-picker
  19. id="datePicker"
  20. v-model="CompleteDate"
  21. size="small"
  22. type="daterange"
  23. align="right"
  24. unlink-panels
  25. range-separator="-"
  26. start-placeholder="处理开始日期"
  27. end-placeholder="处理结束日期"
  28. value-format="yyyy-MM-dd"
  29. @change="pickerChange"
  30. />
  31. <el-button size="small" class="ch-button-warning" @click="handleReset()"><i class="el-icon-search" />&nbsp;重置</el-button>
  32. <el-button size="small" class="ch-button" @click="handleSearch()"><i class="el-icon-search" />&nbsp;搜索</el-button>
  33. <el-button size="small" class="ch-button-export" @click="confirmOutput()"><i class="el-icon-download" />&nbsp;导出</el-button>
  34. </el-col>
  35. </el-row>
  36. <el-row class="handle-box">
  37. <el-col :span="24">
  38. <el-tabs v-model="search.processType" @tab-click="handleSearch">
  39. <el-tab-pane v-for="item in dc_data.PROCESS_TYPE" :key="item.value" :label="item.label" :name="item.value" />
  40. </el-tabs>
  41. </el-col>
  42. <el-col :span="24">
  43. <el-table v-loading="loading" :data="AllData" height="500" stripe row-class-name="g_table_row">
  44. <el-table-column type="index" width="60" />
  45. <el-table-column label="类型" prop="processType" />
  46. <el-table-column label="标题" prop="processName" />
  47. <el-table-column label="发起人" prop="startByName" />
  48. <el-table-column label="所处理节点" prop="name" />
  49. <el-table-column label="发起时间" prop="createTime" />
  50. <el-table-column label="处理时间" prop="endTime" />
  51. <el-table-column label="操作" header-align="center" align="center" width="120">
  52. <template scope="scope">
  53. <el-button size="mini" type="primary" @click="handleOpera(scope.row)">查看</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. <div class="table-page">
  58. <el-pagination
  59. :current-page.sync="currentPage"
  60. :page-size="pageSize"
  61. background
  62. layout="total, prev, pager, next"
  63. :total="allpage"
  64. @current-change="handleCurrentChange"
  65. />
  66. </div>
  67. </el-col>
  68. </el-row>
  69. <el-dialog title="流程查看" :visible.sync="dialogVisible" width="75%" top="30px" :close-on-click-modal="false" :close-on-press-escape="false">
  70. <flow-page
  71. v-if="dialogVisible"
  72. :form-type="form.formType"
  73. :form-title="form.formTitle"
  74. :form-id="form.businessKey"
  75. :task-id="form.taskId"
  76. :task-historic="true"
  77. :flow-type="'VIEW'"
  78. @handleClose="handleClose"
  79. />
  80. </el-dialog>
  81. </div>
  82. </template>
  83. <script>
  84. import Base from '@/views/base/base'
  85. import BaseData from '@/views/base/baseData'
  86. import { getDictData } from '@/static/utils/channel'
  87. import Constant from '@/static/utils/constant'
  88. import FlowPage from './flowPage'
  89. export default {
  90. name: 'MyAudit',
  91. components: {
  92. FlowPage
  93. },
  94. mixins: [Base, BaseData],
  95. data() {
  96. return {
  97. dc_key: ['PROCESS_TYPE'],
  98. // 列表相关
  99. search: {
  100. processType: 'bidding_process_1',
  101. startUserId: '',
  102. createdFrom: '',
  103. createdTo: '',
  104. endedFrom: '',
  105. endedTo: ''
  106. },
  107. CreateDate: [],
  108. CompleteDate: [],
  109. AllData: [],
  110. loading: false,
  111. // 弹框相关
  112. dialogVisible: false,
  113. form: this.initForm()
  114. }
  115. },
  116. mounted() {
  117. getDictData(this.dc_key).then((res) => {
  118. if (res.data) {
  119. this.dc_key.forEach(key => {
  120. const dictValue = this.getDictValue(res.data, key)
  121. this.dc_data[key] = dictValue
  122. this.dc_map[key] = this.$common.transDcMap(dictValue)
  123. })
  124. }
  125. this.getData()
  126. })
  127. },
  128. methods: {
  129. getData: function() {
  130. const _this = this
  131. _this.loading = true
  132. _this.AllData = []
  133. this.search.pageNum = this.currentPage
  134. this.search.pageSize = this.pageSize
  135. this.baseRequest('findHistoryTask', this.search).then((res) => {
  136. console.log(res)
  137. if (res.data.data) {
  138. res.data.data.forEach(function(item) {
  139. const json = _this.getItemJson(item)
  140. _this.AllData.push(json)
  141. })
  142. _this.allpage = res.data.data.length
  143. }
  144. _this.loading = false
  145. }).catch(() => {
  146. })
  147. this.initOutData()
  148. },
  149. handleSearch: function() {
  150. this.getData()
  151. },
  152. handleReset: function() {
  153. for (const i in this.search) {
  154. if (i !== 'pageNum' && i !== 'pageSize' && i !== 'processType') {
  155. this.search[i] = ''
  156. }
  157. }
  158. this.CreateDate = []
  159. this.CompleteDate = []
  160. this.handleSearch()
  161. },
  162. initOutData: function() {
  163. const _this = this
  164. this.OutData = []
  165. const title = [' 类型', ' 标题', ' 发起人', ' 当前节点', ' 发起时间', ' 处理时间'
  166. ]
  167. this.OutData.push(title)
  168. this.baseRequest('findTask', this.search).then((res) => {
  169. if (res.data.data) {
  170. res.data.data.forEach(function(item) {
  171. const jsonMap = _this.getItemJson(item)
  172. const jsonArray = []
  173. jsonArray.push(jsonMap.processType)
  174. jsonArray.push(jsonMap.processTitle)
  175. jsonArray.push(jsonMap.startBy)
  176. jsonArray.push(jsonMap.name)
  177. jsonArray.push(jsonMap.createTime)
  178. jsonArray.push(jsonMap.endTime)
  179. _this.OutData.push(jsonArray)
  180. })
  181. }
  182. }).catch(() => {
  183. })
  184. },
  185. getItemJson: function(item) {
  186. item.createTime = this.$common.transDate(item.createTime, Constant.DATE_PATTERN.DATE_TIME_s_h)
  187. item.endTime = this.$common.transDate(item.endTime, Constant.DATE_PATTERN.DATE_TIME_s_h)
  188. return item
  189. },
  190. initForm: function() {
  191. return {
  192. formTitle: 'bidding_process_1',
  193. formType: '招标单',
  194. taskId: '',
  195. businessKey: ''
  196. }
  197. },
  198. pickerChange: function() {
  199. if (this.CreateDate.length > 0) {
  200. this.search.createdFrom = this.CreateDate[0]
  201. this.search.createdTo = this.CreateDate[1]
  202. }
  203. if (this.CompleteDate.length > 0) {
  204. this.search.endedFrom = this.CompleteDate[0]
  205. this.search.endedTo = this.CompleteDate[1]
  206. }
  207. this.handleSearch()
  208. },
  209. confirmOutput() {
  210. const OutSize = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }
  211. ]
  212. const fileName = 'myAudit导出 ' + new Date().Format('yyyy-MM-dd hh:mm')
  213. this.$outputXlsxFile(this.OutData, OutSize, fileName)
  214. },
  215. /* 处理*/
  216. handleOpera: function(val) {
  217. this.form = Object.assign({ taskId: val.id, businessKey: val.businessKey }, this.getFormInfo(val.processType))
  218. this.dialogVisible = true
  219. },
  220. getFormInfo: function(processType) {
  221. let formTitle = ''
  222. let formType = ''
  223. switch (processType) {
  224. case '招标审批':
  225. formTitle = '招标单'
  226. formType = 'BIDDING'
  227. break
  228. case '合同审批':
  229. formTitle = '合同单'
  230. formType = 'CONTRACT'
  231. break
  232. }
  233. return { formTitle, formType }
  234. },
  235. handleClose: function() {
  236. this.dialogVisible = false
  237. },
  238. baseRequest(opUrl, postData) {
  239. return this.$channel.globleRequest('ActivitiController', opUrl, postData, 'project')
  240. }
  241. }
  242. }
  243. </script>
  244. <style scoped>
  245. .ch-input .el-input__inner {
  246. border-color: #32323A;
  247. }
  248. .ch-input-size {
  249. width: 150px;
  250. }
  251. .ch-button {
  252. border-color: #32323A;
  253. background-color: #32323A;
  254. color: #fff;
  255. }
  256. .ch-button-warning {
  257. margin-left: 10px;
  258. border-color: #E75B5B;
  259. background-color: #E75B5B;
  260. color: #fff;
  261. }
  262. .ch-button-export {
  263. margin-left: 10px;
  264. border-color: #98CC1F;
  265. background-color: #98CC1F;
  266. color: #fff;
  267. }
  268. /deep/.el-dialog__header {
  269. padding: 10px 20px;
  270. }
  271. /deep/.el-dialog__body {
  272. padding: 10px 20px;
  273. }
  274. </style>