myProcess.vue 23 KB

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