myProcessAll.vue 17 KB

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