myProcessAll.vue 13 KB

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