accountPermissions.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  1. <template>
  2. <div class="flex-box">
  3. <div :span="24" class="flex-header">
  4. <Tabs :tabList="tabListMain" @status="clickTabMains">
  5. </Tabs>
  6. <el-button v-if="clickTagName == 'first'" type="primary" @click="clickNewTag()">+新建</el-button>
  7. </div>
  8. <div class="flex-count">
  9. <Table v-loading="loading" @clickDemand="clickDemand" :list="lableTable" ref="TableList" @changeNum="changeNum"
  10. @changeSize="changeSize">
  11. </Table>
  12. </div>
  13. <el-dialog :title="dialogTitle" :visible.sync="dialogStatus" width="100%" :before-close="handleClose" :modal="false"
  14. v-if="dialogStatus" :destroy-on-close="true">
  15. <!-- 后期维护 -->
  16. <div style="position: fixed; z-index: 10000;top: 55px;">
  17. <el-button type="primary" v-if="saveStatus" @click="clickSave">保存</el-button>
  18. <el-button type="primary" v-if="startStatus" @click="clickHandles">处理</el-button>
  19. <el-button type="primary" v-if="closeStatus" @click="handleClose">关闭</el-button>
  20. </div>
  21. <el-form ref="form" :model="fromList" :rules="rule" label-width="145px" style="margin-top: 30px">
  22. <div style="text-align: center; font-size: 24px;">账号权限申请流程</div>
  23. <div class="flex-header">
  24. <el-form-item label="需求编号:">
  25. <el-input v-model="fromList.needNo" disabled></el-input>
  26. </el-form-item>
  27. </div>
  28. <div class="flex-header">
  29. <el-form-item label="申请人:">
  30. <el-input v-model="fromList.proposer" disabled></el-input>
  31. </el-form-item>
  32. <el-form-item label="申请时间:">
  33. <el-input v-model="fromList.proposerTime" disabled></el-input>
  34. </el-form-item>
  35. </div>
  36. <div class="flex-header">
  37. <el-form-item label="申请主题:" prop="needName">
  38. <el-input v-model="fromList.needName" :disabled="disabled"></el-input>
  39. </el-form-item>
  40. </div>
  41. <div class="flex-header">
  42. <el-form-item label="申请类型:" prop="proposerType">
  43. <el-select v-model="fromList.proposerType" placeholder="请选择申请类型" size="medium" :disabled="disabled">
  44. <el-option v-for="item in proposerTypeoption" :key="item.code" :label="item.name"
  45. :value="item.code" />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="八维度使用流程:" prop="dimensionalFlow">
  49. <el-select v-model="fromList.dimensionalFlow" placeholder="请选择八维度使用流程" size="medium"
  50. :disabled="disabled">
  51. <el-option v-for="item in dimensionalFlowoptions" :key="item.code" :label="item.name"
  52. :value="item.code" />
  53. </el-select>
  54. </el-form-item>
  55. </div>
  56. <div class="flex-header">
  57. <el-form-item label="主机ip/数据库实例:" prop="hostIp">
  58. <el-input v-model="fromList.hostIp" :disabled="disabled"></el-input>
  59. </el-form-item>
  60. <el-form-item label="账号名称:" prop="accountName">
  61. <el-input v-model="fromList.accountName" :disabled="disabled"></el-input>
  62. </el-form-item>
  63. </div>
  64. <div class="" style="margin: 1%; border-bottom: 1px solid #e1e1e1;">
  65. <el-form-item label="权限:" prop="authority">
  66. <el-input type="textarea" v-model="fromList.authority" maxlength="500" show-word-limit
  67. :disabled="disabled"></el-input>
  68. </el-form-item>
  69. </div>
  70. </el-form>
  71. <div v-if="dialoglablesStatus">
  72. <div class="table-title">流程追踪</div>
  73. <TableId :list="lables"></TableId>
  74. </div>
  75. </el-dialog>
  76. <div v-if="destroy">
  77. <el-dialog title="处理操作" width="100%" :visible.sync="handleStatus" :before-close="handleCloses" :modal="false"
  78. v-if="handleStatus" :destroy-on-close="true">
  79. <Workflow :list="fromList" v-if="isWorkflowStatus == true" @updateForm="updateForm"
  80. :requestForm="requestForm" :request_formTitle="request_form.title"/>
  81. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="updateForm"
  82. :requestForm="requestForm" :request_formTitle="request_form.title"/>
  83. <!-- 后期维护 -->
  84. </el-dialog>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import Tabs from "../../../components/el-tabs";
  90. import Table from "../../../components/el-form";
  91. import TableId from "../../../components/el-formid";
  92. import Seach from "../../../components/el-search";
  93. import myUpload from "../../../components/workflowUpload";
  94. import Workflow from "../../../components/workflowBase";
  95. import WorkflowEntrance from "../../../components/workflowEntrance";
  96. import getConfig from '../../../config/dev.js'
  97. import {
  98. getTodoBase,
  99. getDoneBase,
  100. getInitiateBase,
  101. getNowdata,
  102. } from "../../../http/api.js";//../../../http/api.js
  103. import { log } from "console";
  104. export default {
  105. components: {
  106. Table,
  107. TableId,
  108. Tabs,
  109. myUpload,
  110. Workflow,
  111. Seach,
  112. WorkflowEntrance
  113. },
  114. data() {
  115. let _self = this
  116. return {
  117. loading: false,
  118. isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
  119. lastManList: [],
  120. rule: {
  121. authority: [
  122. { required: true, message: "请添加权限", trigger: "blur" },
  123. ],
  124. hostIp: [
  125. { required: true, message: "请添加主机ip/数据库实例", trigger: "blur" },
  126. ],
  127. accountName: [
  128. { required: true, message: "请添加账号名称", trigger: "blur" },
  129. ],
  130. dimensionalFlow: [
  131. { required: true, message: "请选择八维度使用流程", trigger: "change" },
  132. ],
  133. proposerType: [
  134. { required: true, message: "请选择申请类型", trigger: "change" },
  135. ],
  136. needName: [
  137. { required: true, message: "请添加申请主题", trigger: "blur" },
  138. ],
  139. },
  140. form: {}, //表单数据
  141. fromList: {}, //表单数据
  142. fileInfo: {
  143. type: "bt1n",
  144. typename: "上传文件",
  145. // limit: 5,
  146. url: "/market/waf/uploadByMinio",
  147. fileList: [],
  148. },
  149. list: {},
  150. dimensionalFlowoptions: [
  151. {
  152. name: '无',
  153. code: '无'
  154. },
  155. {
  156. name: '欠费管理风险防控流程',
  157. code: '欠费管理风险防控流程'
  158. },
  159. {
  160. name: '出账及调账管理风险防控流程',
  161. code: '出账及调账管理风险防控流程'
  162. },
  163. {
  164. name: '异常话单管理风险防控流程',
  165. code: '异常话单管理风险防控流程'
  166. }
  167. ],
  168. proposerTypeoption: [
  169. {
  170. name: '主机',
  171. code: '主机'
  172. },
  173. {
  174. name: '数据库',
  175. code: '数据库'
  176. },
  177. ],
  178. disabled: false,
  179. pageNo: 1,//页码
  180. destroy: false,//处理
  181. handleStatus: false,//处理
  182. tableName: "ZHQX_process",
  183. request_form: {
  184. userId: "",
  185. userName: "",
  186. path: this.$router.currentRoute.name,
  187. userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
  188. // path:this.$roter.options.routers,
  189. // nextDealMan:'',
  190. title: "title",
  191. businessKey: "1",
  192. processDefinitionKey: "ZHQX_process",//流程key
  193. },
  194. requestForm: {
  195. // fresourceId: "14c60ff0-b1a8-11ed-886f-d6cd97160e00", // 本地环境
  196. // fresourceId: "canvas", // 生产环境
  197. // fresourceId: "2b9e648d-b24d-11ed-be6b-00505687dcd3", //测试91环境
  198. fresourceId: getConfig().accountPermissionsfresourceId,
  199. processDefinitionKey: "ZHQX_process",
  200. },
  201. dialogStatus: false, //dialog显示
  202. dialoglablesStatus: true, //dialogL流程追踪显示
  203. clickTagNameTop: 'First',//头部tab
  204. clickTagName: 'first',
  205. dialogTitle: '',//dialogtit
  206. startStatus: false,//处理状态按钮
  207. closeStatus: false, //关闭按钮状态
  208. saveStatus: false, //保存按钮状态
  209. lables: {
  210. height: "400",
  211. titledata: [
  212. {
  213. label: "环节名称",
  214. prop: "taskName",
  215. width: 300,
  216. },
  217. {
  218. label: "处理人",
  219. prop: "assignee",
  220. width: 300,
  221. },
  222. {
  223. label: "到达时间",
  224. prop: "startTime",
  225. width: 300,
  226. },
  227. {
  228. label: "处理时间",
  229. prop: "endTime",
  230. width: 300,
  231. },
  232. {
  233. label: "回复意见",
  234. prop: "content",
  235. width: 300,
  236. },
  237. ], //表格头
  238. data: [], //内容数据
  239. loading: true,
  240. pageData: {
  241. total: 0, // 总条数
  242. pageSizes: 10, // 每页数量
  243. pageNum: 1, // 页码
  244. },
  245. isSelection: false, // 表格有多选时设置
  246. isOperation: false, // 表格有操作列时设置
  247. isIndex: true, // 列表序号
  248. operation: {
  249. // 表格有操作列时设置
  250. label: "操作", // 列名
  251. width: "50", // 根据实际情况给宽度
  252. data: [
  253. {
  254. label: "操作", // 操作名称
  255. type: "", //按钮类型
  256. handleRow: function () { }, // 自定义事件
  257. },
  258. ],
  259. },
  260. },
  261. tabListMain: [
  262. {
  263. index: "first",
  264. label: "我的待办",
  265. number: 1,
  266. name: "prosss_key",
  267. },
  268. {
  269. index: "two",
  270. label: "我的已办",
  271. number: 2,
  272. },
  273. {
  274. index: "three",
  275. label: "我发起的",
  276. number: 3,
  277. },
  278. ],
  279. lableTable: {},//传给子组件table
  280. firstlabel: {
  281. height: "400",
  282. titledata: [
  283. {
  284. label: "申请主题",
  285. prop: "need_name",
  286. width: 300,
  287. },
  288. {
  289. label: "申请人",
  290. prop: "proposer",
  291. width: 300,
  292. },
  293. {
  294. label: "申请时间",
  295. prop: "proposer_time",
  296. width: 300,
  297. },
  298. {
  299. label: "账号",
  300. prop: "account_name",
  301. width: 300,
  302. },
  303. {
  304. label: "账号权限",
  305. prop: "authority",
  306. width: 300,
  307. },
  308. {
  309. label: "当前状态",
  310. prop: "taskName",
  311. width: 300,
  312. },
  313. ], //表格头
  314. data: [], //内容数据
  315. loading: true,
  316. pageData: {
  317. total: 10, // 总条数
  318. pageSizes: 10, // 每页数量
  319. pageNum: 1, // 页码
  320. },
  321. isSelection: false, // 表格有多选时设置
  322. isOperation: false, // 表格有操作列时设置
  323. isIndex: false, // 列表序号
  324. operation: {
  325. // 表格有操作列时设置
  326. label: "操作", // 列名
  327. width: "50", // 根据实际情况给宽度
  328. data: [
  329. {
  330. label: "操作", // 操作名称
  331. type: "", //按钮类型
  332. handleRow: function () { }, // 自定义事件
  333. },
  334. ],
  335. },
  336. },
  337. twolabel: {
  338. height: "400",
  339. titledata: [
  340. {
  341. label: "申请主题",
  342. prop: "need_name",
  343. width: 300,
  344. },
  345. {
  346. label: "申请人",
  347. prop: "proposer",
  348. width: 300,
  349. },
  350. {
  351. label: "申请时间",
  352. prop: "proposer_time",
  353. width: 300,
  354. },
  355. {
  356. label: "账号",
  357. prop: "account_name",
  358. width: 300,
  359. },
  360. {
  361. label: "账号权限",
  362. prop: "authority",
  363. width: 300,
  364. },
  365. {
  366. label: "当前状态",
  367. prop: "taskName",
  368. width: 300,
  369. },
  370. ], //表格头
  371. data: [], //内容数据
  372. loading: true,
  373. pageData: {
  374. total: 10, // 总条数
  375. pageSizes: 10, // 每页数量
  376. pageNum: 1, // 页码
  377. },
  378. isSelection: false, // 表格有多选时设置
  379. isOperation: false, // 表格有操作列时设置
  380. isIndex: false, // 列表序号
  381. operation: {
  382. // 表格有操作列时设置
  383. label: "操作", // 列名
  384. width: "50", // 根据实际情况给宽度
  385. data: [
  386. {
  387. label: "操作", // 操作名称
  388. type: "", //按钮类型
  389. handleRow: function () { }, // 自定义事件
  390. },
  391. ],
  392. },
  393. },
  394. threelabel: {
  395. height: "400",
  396. titledata: [
  397. {
  398. label: "申请主题",
  399. prop: "need_name",
  400. width: 300,
  401. },
  402. {
  403. label: "申请人",
  404. prop: "proposer",
  405. width: 300,
  406. },
  407. {
  408. label: "申请时间",
  409. prop: "proposer_time",
  410. width: 300,
  411. },
  412. {
  413. label: "当前处理人",
  414. prop: "currentMan",
  415. width: 300,
  416. },
  417. {
  418. label: "账号",
  419. prop: "account_name",
  420. width: 300,
  421. },
  422. {
  423. label: "账号权限",
  424. prop: "authority",
  425. width: 300,
  426. },
  427. {
  428. label: "当前状态",
  429. prop: "taskName",
  430. width: 300,
  431. },
  432. ], //表格头
  433. data: [], //内容数据
  434. loading: true,
  435. pageData: {
  436. total: 10, // 总条数
  437. pageSizes: 10, // 每页数量
  438. pageNum: 1, // 页码
  439. },
  440. isSelection: false, // 表格有多选时设置
  441. isOperation: false, // 表格有操作列时设置
  442. isIndex: false, // 列表序号
  443. operation: {
  444. // 表格有操作列时设置
  445. label: "操作", // 列名
  446. width: "50", // 根据实际情况给宽度
  447. data: [
  448. {
  449. label: "操作", // 操作名称
  450. type: "", //按钮类型
  451. handleRow: function () { }, // 自定义事件
  452. },
  453. ],
  454. },
  455. },
  456. filterData: {
  457. timeSelect: false, //是否显示日期控件
  458. sreach: true,
  459. restet: false,
  460. elinput: [
  461. {
  462. name: "材料名称", //提示语275
  463. key: "materialName", //字段名
  464. width: 275, //宽度
  465. },
  466. ],
  467. },
  468. savestatusBtn: false,
  469. }
  470. },
  471. methods: {
  472. clickNewTag(v) {
  473. this.$http({
  474. url: "/market/ZhqxProcess/getNeedNo",
  475. method: "post",
  476. headers: {
  477. "Content-Type": "application/json",
  478. },
  479. data: {},
  480. }).then((res) => {
  481. console.log(res);
  482. this.fromList = {
  483. dimensionalFlow: '无',
  484. needNo: res.data.body,
  485. proposer: JSON.parse(window.sessionStorage.getItem('userInfo')).loginName,
  486. proposerNo: JSON.parse(window.sessionStorage.getItem('userInfo')).loginNoStr,
  487. proposerTime: getNowdata({ a: '-', b: ' ', c: ':' }),
  488. }
  489. });
  490. this.lables.data = []
  491. this.startStatus = true;
  492. this.saveStatus = true;
  493. this.closeStatus = true;
  494. this.dialogStatus = true;
  495. this.isWorkflowStatus = true;
  496. this.dialoglablesStatus = true
  497. this.dialogTitle = "新建工单";
  498. this.disabled = false;
  499. },
  500. //是否最后一个人
  501. async getLastName() {
  502. console.log(this.fromList);
  503. let list = {
  504. procinstid: this.fromList.processId,
  505. taskid: this.fromList.taskId,
  506. // taskId:e.taskId
  507. };
  508. let _this = this;
  509. let obj = {
  510. url: this.$url.formList.getLastName, //流程追踪接口
  511. data: list,
  512. // status: "form",
  513. headers: {
  514. "Content-Type": "application/json",
  515. },
  516. };
  517. let res = await this.common.httpPost(obj, success);
  518. function success(data) {
  519. _this.isWorkflowStatus = data.lastMan == false ? false : true;
  520. _this.lastManList = data;
  521. // console.log(_this.isWorkflowStatus);
  522. }
  523. },
  524. //获取页码
  525. changeNum(e) {
  526. console.log(e)
  527. this.pageNo = e;
  528. if (this.clickTagName == 'first') {
  529. this.firstlabel.pageData.pageNum = e;
  530. this.getQueryList();
  531. }
  532. if (this.clickTagName == 'two') {
  533. this.twolabel.pageData.pageNum = e;
  534. this.getQueryDone();
  535. }
  536. if (this.clickTagName == 'three') {
  537. this.threelabel.pageData.pageNum = e;
  538. this.getMeLaunch()
  539. }
  540. },
  541. //获取页码
  542. changeSize(e) {
  543. console.log(11111);
  544. },
  545. //点击工单状态跳转需求流程显示页面
  546. clickDemand(e, res) {
  547. console.log(e);
  548. this.isWorkflowStatus = true
  549. console.log(res);
  550. if (e === "申请主题") {
  551. if (this.clickTagName === "three") {//发起
  552. console.log(res.taskName)
  553. this.dialogTitle = "查看";
  554. this.closeStatus = true;
  555. if (res.taskName == "申请人提出账号或权限申请") {
  556. this.disabled = false;
  557. this.startStatus = true;
  558. this.saveStatus = true;
  559. this.dialoglablesStatus = true
  560. } else {
  561. this.disabled = true;
  562. this.startStatus = false;
  563. this.saveStatus = false;
  564. this.dialoglablesStatus = true
  565. }
  566. }
  567. if (this.clickTagName === "first") {//代办
  568. this.dialogTitle = "处理";
  569. if (res.taskName == "申请人提出账号或权限申请") {
  570. this.savestatusBtn = false
  571. this.disabled = false;
  572. this.startStatus = true;
  573. this.saveStatus = true;
  574. this.closeStatus = true;
  575. this.dialoglablesStatus = true
  576. } else {
  577. this.savestatusBtn = true
  578. this.disabled = true;
  579. this.closeStatus = true;
  580. this.startStatus = true;
  581. this.saveStatus = false;
  582. this.dialoglablesStatus = true
  583. }
  584. }
  585. if (this.clickTagName === "two") {//已办
  586. this.dialogTitle = "查看";
  587. this.closeStatus = true;
  588. this.startStatus = false;
  589. this.saveStatus = false;
  590. this.disabled = true;
  591. this.dialoglablesStatus = true
  592. }
  593. this.dialogStatus = true
  594. this.fromList = res;
  595. this.clickForm(res);
  596. this.getFromQuery(res);
  597. }
  598. },
  599. //查询form表单数据
  600. getFromQuery(e) {
  601. this.$http({
  602. url: "/market/ZhqxProcess/query",
  603. method: "post",
  604. headers: {
  605. "Content-Type": "application/json",
  606. },
  607. data: { id: e.id },
  608. }).then((res) => {
  609. this.fromList = res.data;
  610. this.dialogStatus = true;
  611. this.fromList.taskId = e.taskId
  612. this.fromList.taskName = e.taskName
  613. this.fromList.createId = e.createId
  614. this.fromList.resourceId = e.resourceId
  615. });
  616. },
  617. async clickForm(e) {
  618. let list = {
  619. processInstanceId: e.process_id,
  620. // taskId:e.taskId
  621. };
  622. let _this = this;
  623. let obj = {
  624. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  625. data: list,
  626. headers: {
  627. "Content-Type": "application/json",
  628. },
  629. };
  630. let res = await this.common.httpPost(obj, success);
  631. function success(data) {
  632. console.log('[ 接口返回值第一曾 ] >', data)
  633. let list = [];
  634. list = data.data.data;
  635. if (data.data.lastmandata.length != 0) {
  636. data.data.lastmandata.map((item, index) => {
  637. item.id = index + 22;
  638. });
  639. }
  640. list.map((item, index) => {
  641. item.startTime = _this.$util.datetimeFormat(item.startTime);
  642. item.endTime = _this.$util.datetimeFormat(item.endTime);
  643. item.id = index + 1;
  644. item.children = [];
  645. if (data.data.lastmandata.length != 0) {
  646. let indexs = data.data.lastmandata.findIndex((items) => {
  647. if (items.taskId == item.taskId) {
  648. item.children.push(items);
  649. }
  650. });
  651. }
  652. });
  653. console.log(list);
  654. _this.lables.data = list;
  655. console.log("[ _this.lables.data ] >", _this.lables.data);
  656. _this.abc = true;
  657. }
  658. },
  659. handleClose() {//关闭弹窗
  660. this.dialogStatus = false;
  661. this.fromList = {};
  662. },
  663. async clickSave() {
  664. this.$refs.form.validate((valid) => {
  665. if (valid) {
  666. console.log(this.$refs.form.model)
  667. this.savestatusBtn = true
  668. if (this.fromList.id) {
  669. this.request_form.title = '[IT工作台]-账号权限申请-' + this.fromList.needName;
  670. this.$http({
  671. url: "/market/ZhqxProcess/update",
  672. method: "post",
  673. headers: {
  674. "Content-Type": "application/json",
  675. },
  676. data: this.fromList,
  677. }).then((res) => {
  678. if (res.data.result === 0) {
  679. this.$message.success("表单更新成功");
  680. }
  681. });
  682. } else {
  683. this.getUserIds();
  684. }
  685. } else {
  686. this.$message.error("请完善表单信息");
  687. return false;
  688. }
  689. });
  690. },
  691. //获取自己idname
  692. getUserIds() {
  693. this.$http({
  694. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  695. method: "post",
  696. headers: {
  697. "Content-Type": "application/json",
  698. },
  699. }).then((res) => {
  700. this.request_form.userName = res.data[0].children[0].loginNameStr;
  701. this.request_form.userId = res.data[0].children[0].loginNoStr;
  702. this.setForm();
  703. console.log(this.request_form)
  704. });
  705. },
  706. setForm(e) {
  707. // console.log(this.$refs.form)
  708. this.request_form.title = '[IT工作台]-账号权限申请-' + this.fromList.needName;
  709. // this.request_form.title = this.$refs.form.needName;
  710. // this.$refs.form.taskId = e;
  711. this.$http({
  712. url: "/market/ZhqxProcess/add",
  713. method: "post",
  714. headers: {
  715. "Content-Type": "application/json",
  716. },
  717. // data: this.$refs.form,
  718. data: this.fromList,
  719. }).then((res) => {
  720. this.request_form.businessKey = res.data.body;
  721. this.fromList.id = res.data.body;
  722. this.formWorkId = res.data.body;
  723. this.clickHandle(res.data.body);
  724. });
  725. },
  726. async clickHandle(e) {
  727. let _this = this;
  728. let obj = {
  729. url: this.$url.formList.startWork, //开始工作流接口
  730. data: _this.request_form,
  731. status: "form",
  732. headers: {
  733. "Content-Type": "application/x-www-form-urlencoded",
  734. },
  735. };
  736. let res = await this.common.httpPost(obj, success);
  737. function success(data) {
  738. // console.log(data);
  739. _this.fromList.taskId = data.data;
  740. _this.fromList.processId = data.data;
  741. // _this.fromList.resourceId = data.data;
  742. _this.taskId = data.data;
  743. // _this.fromList.taskId = data;
  744. // _this.taskId = data;
  745. let list = {
  746. id: e,
  747. // taskId:_this.formId,
  748. processId: _this.fromList.taskId,
  749. tableName: _this.request_form.processDefinitionKey,
  750. };
  751. _this.setUpdate(list);
  752. }
  753. },
  754. //更新工作流接口
  755. setUpdate(e) {
  756. this.$http({
  757. url: "/market/waf/updateBase",
  758. method: "post",
  759. headers: {
  760. "Content-Type": "application/json",
  761. },
  762. data: e,
  763. }).then((res) => {
  764. this.fromList.taskId = res.data.body[0].taskId;
  765. this.fromList.taskName = res.data.body[0].taskName;
  766. // if (res.data.body.taskName === "申请人提出账号或权限申请") {
  767. // this.isSync = res.data.body.isSync;
  768. // } else {
  769. // this.isSync = "1";
  770. // }
  771. if (res.data.result === 0) {
  772. this.$message.success("工作流更新成功");
  773. }
  774. });
  775. },
  776. //处理按钮,开始工作流接口
  777. clickHandles() {
  778. this.getNextPath(this.fromList.resourceId || "");
  779. console.log(this.fromList);
  780. // if (this.fromList.taskId) {
  781. // this.destroy = true;
  782. // this.handleStatus = true;
  783. // } else {
  784. // this.$message.error("请先点击保存按钮");
  785. // }
  786. },
  787. getNextPath(e) {
  788. let list = {
  789. fresourceId: this.requestForm.fresourceId, // 本地环境
  790. processId: this.requestForm.processDefinitionKey,
  791. // processId: "request_form_process",
  792. // resourceId: e,
  793. };
  794. if (e) {
  795. // this.propsList = [];
  796. list.resourceId = e;
  797. }
  798. console.log(11111);
  799. console.log(list);
  800. console.log(11111);
  801. this.$http({
  802. url: "/market/waf/queryPath",
  803. method: "post",
  804. headers: {
  805. "Content-Type": "application/json",
  806. },
  807. data: list,
  808. }).then((res) => {
  809. console.log(res);
  810. console.log(this.fromList);
  811. console.log(res.data.body);
  812. console.log(res.data.body.nextShapes[0].multi);
  813. if (res.data.body.nextShapes[0].multi) {
  814. if (res.data.body.nextShapes[0].multi.multi === "true") {
  815. this.getLastName();
  816. }
  817. }
  818. if (this.fromList.taskId || this.fromList.processId) {
  819. this.destroy = true;
  820. this.handleStatus = true;
  821. this.getMetirialType();
  822. } else {
  823. this.$message.error("请先点击保存按钮");
  824. }
  825. });
  826. },
  827. //获取字典表常用意见
  828. getMetirialType(e) {
  829. this.$http({
  830. url: "/market/cfgDataDict/queryList",
  831. method: "post",
  832. headers: {
  833. "Content-Type": "application/json",
  834. },
  835. data: {
  836. dictCodePks: "approval",
  837. },
  838. }).then((res) => {
  839. this.commonlyList = res.data;
  840. });
  841. },
  842. //处理关闭
  843. handleCloses() {
  844. // this.treeList = [];
  845. // this.textarea = "";
  846. this.handleStatus = false;
  847. this.usernumber()
  848. },
  849. updateForm() {
  850. this.dialogStatus = false;
  851. this.handleCloses();
  852. this.usernumber()
  853. if (this.clickTagName == 'first') {
  854. this.lableTable = this.firstlabel
  855. this.getQueryList();
  856. }
  857. if (this.clickTagName == 'two') {
  858. this.lableTable = this.twolabel
  859. this.getQueryDone();
  860. }
  861. if (this.clickTagName == 'three') {
  862. this.lableTable = this.threelabel
  863. this.getMeLaunch()
  864. }
  865. },
  866. clickTabMains(e) {
  867. console.log(e);
  868. this.clickTagName = e
  869. this.pageNo = 1
  870. this.$refs.TableList.page = 1;
  871. if (this.clickTagName == 'first') {
  872. this.lableTable = this.firstlabel
  873. this.getQueryList();
  874. }
  875. if (this.clickTagName == 'two') {
  876. this.lableTable = this.twolabel
  877. this.getQueryDone();
  878. }
  879. if (this.clickTagName == 'three') {
  880. this.lableTable = this.threelabel
  881. this.getMeLaunch()
  882. }
  883. },
  884. adminhandleSizeChange(val) {
  885. console.log(`每页 ${val} 条`);
  886. },
  887. adminhandleCurrentChange(val) {
  888. console.log(`当前页: ${val}`);
  889. },
  890. //我的待办
  891. getQueryList(e, status) {
  892. this.loading = true;
  893. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  894. if (status === 0) {
  895. this.clickDemand("申请主题", res.data.data[0]);
  896. }
  897. this.lableTable.data = res.data.data;
  898. this.lableTable.pageData.total = res.data.totalRecord;
  899. this.tabListMain[0].number = res.data.totalRecord
  900. this.loading = false;
  901. });
  902. },
  903. //我的已办
  904. getQueryDone() {
  905. this.loading = true;
  906. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  907. this.lableTable.data = res.data.data;
  908. // this.lableTable.data.map((item) => {
  909. // item.status = "2";
  910. // });
  911. this.lableTable.pageData.total = res.data.totalRecord;
  912. this.tabListMain[1].number = res.data.totalRecord
  913. this.loading = false;
  914. });
  915. },
  916. //我发起的
  917. getMeLaunch() {
  918. this.loading = true;
  919. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  920. this.lableTable.data = res.data.data;
  921. // this.lableTable.data.map((item) => {
  922. // if (item.taskName === "申请人提出账号或权限申请") {
  923. // item.status = "1";
  924. // } else {
  925. // item.status = "2";
  926. // }
  927. // });
  928. this.lableTable.pageData.total = res.data.totalRecord;
  929. this.tabListMain[2].number = res.data.totalRecord
  930. this.loading = false;
  931. });
  932. },
  933. usernumber() {
  934. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  935. this.tabListMain[2].number = res.data.totalRecord
  936. });
  937. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  938. this.tabListMain[1].number = res.data.totalRecord
  939. });
  940. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  941. this.tabListMain[0].number = res.data.totalRecord
  942. });
  943. }
  944. },
  945. created() {
  946. let status = JSON.stringify(this.$route.query) == "{}";
  947. if (status) {
  948. this.lableTable = this.firstlabel
  949. this.getQueryList()
  950. this.usernumber()
  951. } else {
  952. let { id, type } = this.$route.query;
  953. let list = {
  954. taskId: id,
  955. tableName: this.tableName
  956. };
  957. this.usernumber()
  958. this.lableTable = this.firstlabel
  959. this.getQueryList(list, 0);//代办
  960. }
  961. }
  962. }
  963. </script>
  964. <style lang="scss" scoped>
  965. .copyClass {
  966. display: flex;
  967. }
  968. .flex-header-text-tree {
  969. width: 50%;
  970. text-align: center;
  971. }
  972. ::v-deep .el-form-item {
  973. width: 100%;
  974. }
  975. .active {
  976. background-color: #f3faff;
  977. }
  978. .flex-common {
  979. padding: 10px 5%;
  980. font-size: 18px;
  981. }
  982. .flex-buttons {
  983. background-color: #cde4f6;
  984. border-color: #cde4f6;
  985. color: #606266;
  986. }
  987. .flex-button {
  988. margin-top: 10px;
  989. margin-bottom: 10px;
  990. ::v-deep .el-button--primary {
  991. width: 222px;
  992. }
  993. }
  994. .flex-left-header-text {
  995. height: 40px;
  996. line-height: 40px;
  997. color: black;
  998. padding-left: 10px;
  999. background-color: #cde4f6;
  1000. font-size: 18px;
  1001. font-weight: bold;
  1002. }
  1003. .flex-right-text {
  1004. margin-right: 20px;
  1005. width: 50%;
  1006. }
  1007. .flex-handle {
  1008. width: 100%;
  1009. padding: 30px;
  1010. display: flex;
  1011. .flex-right {
  1012. width: 50%;
  1013. border: 1px solid #e1e1e1;
  1014. margin-left: 20px;
  1015. }
  1016. .flex-left {
  1017. width: 50%;
  1018. display: flex;
  1019. flex-direction: column;
  1020. .flex-left-header {
  1021. display: flex;
  1022. justify-content: space-around;
  1023. }
  1024. }
  1025. }
  1026. .table-title {
  1027. height: 50px;
  1028. line-height: 50px;
  1029. background-color: #f3faff;
  1030. font-size: 18px;
  1031. font-weight: bold;
  1032. }
  1033. ::v-deep .el-dialog {
  1034. margin-top: 0 !important;
  1035. }
  1036. ::v-deep .el-table__fixed-body-wrapper {
  1037. top: 50px !important;
  1038. }
  1039. .flex-box {
  1040. display: flex;
  1041. width: calc(100% - 40px);
  1042. border-radius: 20px;
  1043. background-color: #fff;
  1044. margin: 0 auto;
  1045. margin-top: 20px;
  1046. position: relative;
  1047. flex-direction: column;
  1048. .flex-load {
  1049. display: flex;
  1050. width: 100%;
  1051. position: relative;
  1052. margin: 1%;
  1053. border-bottom: 1px solid #e1e1e1;
  1054. justify-content: space-between;
  1055. }
  1056. .flex-header {
  1057. display: flex;
  1058. // width: 100%;
  1059. position: relative;
  1060. // height: 60px;
  1061. margin: 1%;
  1062. border-bottom: 1px solid #e1e1e1;
  1063. justify-content: space-between;
  1064. // ::v-deep .el-form-item {
  1065. // width: 30%;
  1066. // margin-right: 5%;
  1067. // }
  1068. .el-button {
  1069. width: 150px;
  1070. float: right;
  1071. height: 40px !important;
  1072. margin-right: 30px;
  1073. }
  1074. }
  1075. }
  1076. //设置子组件样式
  1077. ::v-deep .el-tabs__item {
  1078. padding: 0;
  1079. margin-right: 20px;
  1080. width: 166px;
  1081. text-align: center;
  1082. background-color: #d8eaf6;
  1083. color: black;
  1084. }
  1085. //设置子组件样式
  1086. ::v-deep .el-form-item__label {
  1087. text-align: center;
  1088. }
  1089. ::v-deep .is-active {
  1090. color: #fff;
  1091. background-color: #0583cd;
  1092. }
  1093. ::v-deep .el-select {
  1094. width: 100%
  1095. }
  1096. ::v-deep .el-tabs__active-bar {
  1097. display: none;
  1098. }
  1099. ::v-deep .el-tabs__nav-wrap::after {
  1100. display: none !important;
  1101. }
  1102. .flex-form {
  1103. margin-top: 50px;
  1104. }
  1105. .flex-footer-botton {
  1106. display: flex;
  1107. justify-content: space-evenly;
  1108. }
  1109. </style>