myProcess.vue 22 KB

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