myProcess.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. <template>
  2. <!-- 我的流程主页 -->
  3. <div>
  4. <el-row class="handle-box labeldom" style="margin-bottom: 10px">
  5. <el-col :span="22">
  6. <el-tabs v-model="activeName" @tab-click="handleClick()">
  7. <el-tab-pane label="待办事项" name="待办事项"/>
  8. <el-tab-pane label="已办事项" name="已办事项"/>
  9. <el-tab-pane label="我的申请" name="我的申请"/>
  10. <el-tab-pane label="抄送事项" name="抄送事项"/>
  11. <el-tab-pane label="委托待办事项" name="委托待办事项"/>
  12. <el-tab-pane label="我的委托" name="我的委托"/>
  13. </el-tabs>
  14. </el-col>
  15. <el-col :span="2">
  16. <el-dropdown style="float:right" trigger="click">
  17. <span class="el-dropdown-link">
  18. 流程发起<i
  19. class="el-icon-arrow-down el-icon--right"
  20. />
  21. </span>
  22. <el-dropdown-menu slot="dropdown">
  23. <el-dropdown-item
  24. v-for="(item, index) in dropdownList"
  25. :key="index"
  26. @click.native="openDianlog(item.ref)"
  27. >
  28. {{ item.name }}
  29. </el-dropdown-item>
  30. </el-dropdown-menu>
  31. </el-dropdown>
  32. </el-col>
  33. <el-form
  34. ref="elForm"
  35. :model="search"
  36. :rules="rules"
  37. label-width="100px"
  38. size="medium"
  39. >
  40. <el-col :span="6">
  41. <el-form-item label="流程名称" prop="field101">
  42. <el-input
  43. v-model="search.field101"
  44. :style="{ width: '100%' }"
  45. clearable
  46. placeholder="请输入流程名称"
  47. />
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="6">
  51. <el-form-item label="主题" prop="field102">
  52. <el-input
  53. v-model="search.field102"
  54. :style="{ width: '100%' }"
  55. clearable
  56. placeholder="请输入主题"
  57. />
  58. </el-form-item>
  59. </el-col>
  60. <el-col v-if="this.activeName != '我的申请'" :span="6">
  61. <el-form-item label="发起人" prop="field103">
  62. <el-input
  63. v-model="search.field103"
  64. :style="{ width: '100%' }"
  65. clearable
  66. placeholder="请输入发起人"
  67. />
  68. </el-form-item>
  69. </el-col>
  70. <el-col :span="6">
  71. <el-form-item size="large">
  72. <el-button
  73. class="ch-button-warning"
  74. plain
  75. size="small"
  76. @click="handleReset()"
  77. ><i class="el-icon-aim"/>&nbsp;重置
  78. </el-button>
  79. <el-button
  80. class="ch-button"
  81. size="small"
  82. @click="handleSearch()"
  83. ><i class="el-icon-search"/>&nbsp;搜索
  84. </el-button>
  85. </el-form-item>
  86. </el-col>
  87. </el-form>
  88. </el-row>
  89. <el-row class="handle-box">
  90. <el-col :span="24">
  91. <el-table
  92. v-loading="loading"
  93. :data="tableData"
  94. row-class-name="g_table_row"
  95. stripe
  96. style="width: 100%"
  97. >
  98. <el-table-column type="index" width="60"/>
  99. <el-table-column label="流程名称" prop="flowName"/>
  100. <el-table-column label="主题" prop="applyTheme">
  101. <template slot-scope="scope">
  102. <a v-if="activeName=='我的申请'||'我的委托'||'抄送事项'" style="color: #1890ff"
  103. @click="openDetailsDialog(scope.row.flowType,scope.row)"
  104. >
  105. {{ scope.row.applyTheme }}
  106. </a>
  107. <span v-else>
  108. {{ scope.row.applyTheme }}
  109. </span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column label="发起人" prop="applyUserName"/>
  113. <el-table-column label="所在部门" prop="applyDeptName"/>
  114. <el-table-column label="发起时间" prop="createdAt">
  115. <template slot-scope="scope">
  116. {{ $common.transTime(scope.row.createdAt) }}
  117. <!-- {{ (row.createdAt) }}-->
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="当前流转状态" prop="flowStatusString"/>
  121. <el-table-column label="审核结果" prop="auditResultString"/>
  122. <el-table-column align="center" fixed="right" header-align="center" label="操作" width="250px">
  123. <template scope="scope">
  124. <el-button
  125. :disabled="scope.row.returnStatus==1"
  126. v-if="activeName=='我的申请'&& (scope.row.flowStatusString=='已撤回'||scope.row.flowStatusString=='退回发起人')"
  127. size="mini"
  128. @click="applyAgain(scope.row,scope.row.flowType)"
  129. >
  130. <!-- -->
  131. 重新发起
  132. </el-button>
  133. <el-button
  134. v-if="activeName=='我的申请'&&scope.row.flowStatusString!='已撤回'&&scope.row.flowStatusString!='已结束'&&scope.row.flowStatusString!='退回发起人'"
  135. size="mini"
  136. @click="recallApply(scope.row,scope.row,scope.row.flowType)"
  137. >
  138. 撤回
  139. </el-button>
  140. <el-button
  141. v-if="activeName=='待办事项'||activeName=='委托待办事项'"
  142. :disabled="scope.row.flowStatusString=='已撤回'"
  143. size="mini"
  144. type="primary"
  145. @click="handleAudit(scope.row,scope.row.flowType)"
  146. >审核
  147. </el-button>
  148. <el-button
  149. v-if="activeName=='待办事项'"
  150. size="mini"
  151. type="primary"
  152. @click="openChangeClientDialog(scope.row)"
  153. >委托办理
  154. </el-button>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. <div class="table-page">
  159. <el-pagination
  160. :current-page.sync="currentPage"
  161. :page-size="pageSize"
  162. :total="allpage"
  163. background
  164. layout="total, prev, pager, next"
  165. @current-change="handleCurrentChange"
  166. />
  167. </div>
  168. </el-col>
  169. <!-- <el-image-->
  170. <!-- :src="$constant.BASE_URI-->
  171. <!-- +'/ActController/readByPid?processInstanceId='-->
  172. <!-- + 65001 " fit="scale-down"/>-->
  173. </el-row>
  174. <apply-cost ref="applyCsot" @getData="getData()"/>
  175. <apply-holiday ref="applyHoliday" @getData="getData()"/>
  176. <apply-pay ref="applyPay" @getData="getData()"/>
  177. <apply-pay-confirm ref="applyPayConfirm" @getData="getData()"/>
  178. <apply-cost-confirm ref="applyCostConfirm" @getData="getData()"/>
  179. <apply-holiday-confirm ref="applyHolidayConfirm" @getData="getData()"/>
  180. <apply-lx-work-confirm ref="applyLxWorkConfirm" @getData="getData()" />
  181. <change-client ref="changeClient" @getData="getData"/>
  182. <apply-again-cost ref="applyAgainCost" @getData="getData"/>
  183. <apply-pay-details ref="applyPayDetails" @getData="getData"/>
  184. <apply-again-pay ref="applyAgainPay" @getData="getData"/>
  185. <apply-cost-details ref="applyCostDetails"/>
  186. <holiday-details ref="holidayDetails" @getData="getData"/>
  187. <apply-again-holiday ref="applyAgainHoliday" @getData="getData"/>
  188. <apply-add-work ref="applyAddWork" @getData="getData()"/>
  189. <apply-add-work-confirm ref="applyAddWorkConfirm" @getData="getData()"/>
  190. <apply-add-work-detail ref="applyAddWorkDetail"/>
  191. <apply-lx-work-detail ref="applyLxWorkDetail"/>
  192. <apply-lx-work ref="applyLxWork" @getData="getData()"/>
  193. <apply-again-add-work ref="applyAgainAddWork" @getData="getData()"/>
  194. <apply-lx-sj-work ref="applyLxSjWork" @getData="getData()"/>
  195. <apply-again-li-sj-work ref="applyAgainLxSjWork" @getData="getData"/>
  196. <apply-again-lx-work ref="applyAgainLxWork" @getData="getData"/>
  197. <apply-lx-sj-work-detail ref="applyLxSjWorkDetail"/>
  198. <apply-lx-sj-work-confirm ref="applyLxSjWorkConfirm" @getData="getData()" />
  199. </div>
  200. </template>
  201. <script>
  202. import applyHoliday from '@/views/workflow/components/myProcess/applyHoliday.vue'
  203. import applyCost from '@/views/workflow/components/myProcess/applyCost.vue'
  204. import applyAgainCost from '@/views/workflow/components/myProcess/applyAgainCost.vue'
  205. import applyPay from '@/views/workflow/components/myProcess/applyPay.vue'
  206. import changeClient from '@/views/workflow/components/myProcess/changeClient.vue'
  207. import applyAgainPay from '@/views/workflow/components/myProcess/applyAgainPay.vue'
  208. import applyAgainHoliday from '@/views/workflow/components/myProcess/applyAgainHoliday.vue'
  209. import applyAddWork from '@/views/workflow/components/myProcess/applyAddWork.vue'
  210. import applyAgainAddWork from '@/views/workflow/components/myProcess/applyAgainAddWork.vue'
  211. import applyHolidayConfirm from '@/views/workflow/components/myProcess/applyHolidayConfirm.vue'
  212. import applyCostConfirm from '@/views/workflow/components/myProcess/applyCostConfirm.vue'
  213. import applyPayConfirm from '@/views/workflow/components/myProcess/applyPayConfirm.vue'
  214. import applyAddWorkConfirm from '@/views/workflow/components/myProcess/applyAddWorkConfirm.vue'
  215. import applyPayDetails from '@/views/workflow/components/myProcess/applyPayDetails.vue'
  216. import applyAddWorkDetail from '@/views/workflow/components/myProcess/applyAddWorkDetail.vue'
  217. import applyCostDetails from '@/views/workflow/components/myProcess/applyCostDetails.vue'
  218. import holidayDetails from '@/views/workflow/components/myProcess/holidayDetails.vue'
  219. import applyLxWork from '@/views/workflow/components/myProcess/applyLxWork.vue'
  220. import applyLxWorkDetail from '@/views/workflow/components/myProcess/applyLxWorkDetail.vue'
  221. import applyLxWorkConfirm from '@/views/workflow/components/myProcess/applyLxWorkConfirm.vue'
  222. import applyLxSjWork from '@/views/workflow/components/myProcess/applyLxSjWork.vue'
  223. import applyLxSjWorkDetail from '@/views/workflow/components/myProcess/applyLxSjWorkDetail.vue'
  224. import applyLxSjWorkConfirm from '@/views/workflow/components/myProcess/applyLxSjWorkConfirm.vue'
  225. import applyAgainLiSjWork from '@/views/workflow/components/myProcess/applyAgainLxSjWork.vue'
  226. import applyAgainLxWork from '@/views/workflow/components/myProcess/applyAgainLxWork.vue'
  227. export default {
  228. components: {
  229. applyAgainAddWork,
  230. applyAddWork,
  231. applyLxWork,
  232. applyLxSjWork,
  233. applyCostDetails,
  234. applyHoliday,
  235. applyCost,
  236. applyAgainCost,
  237. applyAgainPay,
  238. applyPay,
  239. applyPayConfirm,
  240. applyCostConfirm,
  241. applyHolidayConfirm,
  242. changeClient,
  243. applyPayDetails,
  244. holidayDetails,
  245. applyLxWorkConfirm,
  246. applyLxSjWorkDetail,
  247. applyLxSjWorkConfirm,
  248. applyAgainHoliday,
  249. applyAddWorkConfirm,
  250. applyAddWorkDetail,
  251. applyAgainLiSjWork,
  252. applyAgainLxWork,
  253. applyLxWorkDetail
  254. },
  255. data() {
  256. return {
  257. // 查询数据的内容
  258. search: {},
  259. dropdownList: [
  260. // { name: '请假申请单', ref: 'applyHoliday' },
  261. // { name: '费用报支申请', ref: 'applyCsot' },
  262. // { name: '付款申请单', ref: 'applyPay' },
  263. // { name: '加班申请单', ref: 'applyAddWork' },
  264. // { name: '立项申请灵锡', ref: 'applyLxWork' },
  265. // { name: '立项申请运营', ref: 'applyLxSjWork' }
  266. // {name: '付款审核', ref: 'applyPayConfirm'},
  267. // {name: '请假审核', ref: 'applyHolidayConfirm'}
  268. ],
  269. activeName: '待办事项',
  270. // 通用字典项
  271. AUDIT_TYPE: [],
  272. dc_map: {},
  273. // 列表相关
  274. cusName: '',
  275. auditStatus: '',
  276. auditType: '',
  277. proName: '',
  278. applyBy: '',
  279. tableData: [],
  280. loading: false,
  281. UserData: [
  282. { label: '审批中', value: '审批中' },
  283. { label: '已通过', value: '已通过' },
  284. { label: '已拒绝', value: '已拒绝' },
  285. { label: '已退回', value: '已退回' }
  286. ],
  287. UserMap: {},
  288. // 分页
  289. currentPage: 1,
  290. allpage: 0,
  291. pageSize: 12,
  292. // 弹框相关
  293. currAuditId: '',
  294. dialogVisible: false,
  295. dialogTitle: '新增',
  296. isAdd: true,
  297. detailList: [],
  298. rules: {}
  299. }
  300. },
  301. mounted() {
  302. const _this = this
  303. _this.dropdownList = []
  304. const groupId = _this.$common.currUser().groupId
  305. if('808'===groupId){
  306. _this.dropdownList.push({ name: '立项申请运营', ref: 'applyLxSjWork' })
  307. }else if('806'===groupId){
  308. _this.dropdownList.push( { name: '立项申请灵锡', ref: 'applyLxWork' })
  309. }
  310. _this.getData()
  311. },
  312. methods: {
  313. handleCurrentChange: function(val) {
  314. this.currentPage = val
  315. this.getData()
  316. },
  317. openChangeClientDialog(row) {
  318. this.$refs.changeClient.setVisible(true, row)
  319. },
  320. handleAudit(row, type) {
  321. switch (type) {
  322. case 'use_money' :
  323. this.$refs.applyCostConfirm.setVisible(true, row)
  324. break
  325. case 'paymen' :
  326. this.$refs.applyPayConfirm.setVisible(true, row)
  327. break
  328. case 'off_work' :
  329. this.$refs.applyHolidayConfirm.setVisible(true, row)
  330. break
  331. case 'add_work' :
  332. this.$refs.applyAddWorkConfirm.setVisible(true, row)
  333. break
  334. case 'lx_work' :
  335. this.$refs.applyLxWorkConfirm.setVisible(true, row)
  336. break
  337. case 'lx_sj_work' :
  338. this.$refs.applyLxSjWorkConfirm.setVisible(true, row)
  339. break
  340. }
  341. },
  342. openDetailsDialog(type, row) {
  343. switch (type) {
  344. case 'use_money' :
  345. this.$refs.applyCostDetails.setVisible(true, row)
  346. break
  347. case 'paymen' :
  348. this.$refs.applyPayDetails.setVisible(true, row)
  349. break
  350. case 'off_work':
  351. this.$refs.holidayDetails.setVisible(true, row)
  352. break
  353. case 'add_work':
  354. this.$refs.applyAddWorkDetail.setVisible(true, row)
  355. break
  356. case 'lx_work':
  357. this.$refs.applyLxWorkDetail.setVisible(true, row)
  358. break
  359. case 'lx_sj_work':
  360. this.$refs.applyLxSjWorkDetail.setVisible(true, row)
  361. break
  362. }
  363. },
  364. applyAgain(row, type) {
  365. debugger
  366. switch (type) {
  367. case 'use_money' :
  368. this.$refs.applyAgainCost.setVisible(true, row)
  369. break
  370. case 'paymen' :
  371. this.$refs.applyAgainPay.setVisible(true, row)
  372. break
  373. case 'off_work':
  374. this.$refs.applyAgainHoliday.setVisible(true, row)
  375. break
  376. case 'add_work':
  377. this.$refs.applyAgainAddWork.setVisible(true, row)
  378. break
  379. case 'lx_work':
  380. this.$refs.applyAgainLxWork.setVisible(true, row)
  381. break
  382. case 'lx_sj_work':
  383. this.$refs.applyAgainLxSjWork.setVisible(true, row)
  384. break
  385. }
  386. },
  387. recallApply: function(row, type) {
  388. const _this = this
  389. _this.$confirm('该流程已经在审核中,撤回后原审核内容将作废确认撤回吗?', '提示', {
  390. confirmButtonText: '确定',
  391. cancelButtonText: '取消',
  392. type: 'warning'
  393. }).then(function() {
  394. const deleting = _this.$notify({
  395. title: '正在撤回,请稍等',
  396. type: 'warning'
  397. })
  398. const postData = {
  399. flowMainid: row.id
  400. }
  401. console.log('row', row)
  402. if (row.flowType == 'off_work') {//请假申请的时候要单独调请假时期的接口
  403. _this.baseRequest2(
  404. 'ApplyOffWorkController',
  405. 'recallApply',
  406. postData).then(res => {
  407. if (res.data.code === 200) {
  408. _this.getData()
  409. deleting.close()
  410. _this.$notify({
  411. title: '撤回成功',
  412. type: 'info'
  413. })
  414. } else {
  415. deleting.close()
  416. _this.dialogVisible = false
  417. _this.$notify({
  418. title: '撤回失败',
  419. type: 'info'
  420. })
  421. }
  422. }).catch((err) => {
  423. deleting.close()
  424. _this.$alert(err)
  425. })
  426. } else {
  427. _this.baseRequest2(
  428. 'FlowMainController',
  429. 'recallApply',
  430. postData).then(res => {
  431. if (res.data.code === 200) {
  432. _this.getData()
  433. deleting.close()
  434. _this.$notify({
  435. title: '撤回成功',
  436. type: 'info'
  437. })
  438. } else {
  439. deleting.close()
  440. _this.dialogVisible = false
  441. _this.$notify({
  442. title: '撤回失败',
  443. type: 'info'
  444. })
  445. }
  446. }).catch((err) => {
  447. deleting.close()
  448. _this.$alert(err)
  449. })
  450. }
  451. }).catch(function(error) {
  452. console.error(error)
  453. })
  454. },
  455. // 初始化获取数据
  456. getData() {
  457. const _this = this
  458. const postData = {
  459. applyUserName: _this.search.field103, // 申请人名称
  460. applyTheme: _this.search.field102, // 主题名称
  461. flowName: _this.search.field101, // 流程名称
  462. auditUser: this.$common.currUser()
  463. ? this.$common.currUser().id
  464. : '',
  465. pageNum: _this.currentPage,
  466. pageSize: _this.pageSize
  467. }
  468. let url = ''
  469. if (_this.activeName == '待办事项') {
  470. url = 'toDolisAndEntrusttByInfo'
  471. } else if (_this.activeName == '已办事项') {
  472. url = 'hasDolistByInfo'
  473. } else if (_this.activeName == '我的申请') {
  474. url = 'myApplylistByInfo'
  475. } else if (_this.activeName == '抄送事项') {
  476. url = 'cclistByInfo'
  477. } else if (_this.activeName == '委托待办事项') {
  478. url = 'entrustToDolistByInfo'
  479. } else if (_this.activeName == '我的委托') {
  480. url = 'myEntrustlistByInfo'
  481. }
  482. _this.baseRequest1(url, postData).then(res => {
  483. if (res.data) {
  484. _this.tableData = []
  485. res.data.rows.forEach(item => {
  486. _this.tableData.push(_this.getItemJson(item))
  487. })
  488. _this.allpage = res.data.total
  489. } else {
  490. _this.tableData = []
  491. }
  492. })
  493. },
  494. getItemJson: function(item) {
  495. item.xxx = '111'
  496. return item
  497. },
  498. handleSearch: function() {
  499. this.getData()
  500. },
  501. handleReset: function() {
  502. for (const i in this.search) {
  503. if (i !== 'pageNum' && i !== 'pageSize') {
  504. this.search[i] = ''
  505. }
  506. }
  507. this.handleSearch()
  508. },
  509. // 打开流程发起菜单
  510. openDianlog(ref) {
  511. console.log(ref)
  512. this.$refs[ref].setVisible(true)
  513. },
  514. handleClick(tab, event) {
  515. this.getData()
  516. },
  517. // 请求封装,继承类中调用,必须存在
  518. baseRequest1(opUrl, postData) {
  519. return this.$channel.globleRequest(
  520. 'FlowMainController',
  521. opUrl,
  522. postData,
  523. 'project task'
  524. )
  525. },
  526. baseRequest2(controller, opUrl, postData) {
  527. return this.$channel.globleRequest(
  528. controller,
  529. opUrl,
  530. postData,
  531. 'project task'
  532. )
  533. }
  534. }
  535. }
  536. </script>
  537. <style lang="scss">
  538. .holidayRow {
  539. .el-select {
  540. width: 100%;
  541. }
  542. }
  543. .el-dropdown-link {
  544. cursor: pointer;
  545. color: rgba(39, 78, 219, 1);
  546. }
  547. .demonstration {
  548. display: block;
  549. color: #8492a6;
  550. font-size: 14px;
  551. margin-bottom: 20px;
  552. }
  553. .labeldom {
  554. .el-tabs__nav-wrap::after {
  555. background: none;
  556. }
  557. }
  558. .w200px {
  559. width: 200px;
  560. }
  561. </style>
  562. <style scoped>
  563. .ch-input .el-input__inner {
  564. border-radius: 0px;
  565. border-color: #32323a;
  566. }
  567. .ch-input-size {
  568. width: 150px;
  569. }
  570. .ch-button {
  571. borderund-color: #32323a;
  572. color: #fff;
  573. }
  574. .ch-button-warning {
  575. margin-left: 10px;
  576. border-radius: 0px;
  577. border-color: #E75B5B;
  578. background-color: #E75B5B;
  579. color: #fff;
  580. }
  581. </style>