accountPermissions.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163
  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" :title="fromList.hostIp"></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. this.request_form.title = '[IT工作台]-账号权限申请-' + this.fromList.needName;
  781. // if (this.fromList.taskId) {
  782. // this.destroy = true;
  783. // this.handleStatus = true;
  784. // } else {
  785. // this.$message.error("请先点击保存按钮");
  786. // }
  787. },
  788. getNextPath(e) {
  789. let list = {
  790. fresourceId: this.requestForm.fresourceId, // 本地环境
  791. processId: this.requestForm.processDefinitionKey,
  792. // processId: "request_form_process",
  793. // resourceId: e,
  794. };
  795. if (e) {
  796. // this.propsList = [];
  797. list.resourceId = e;
  798. }
  799. console.log(11111);
  800. console.log(list);
  801. console.log(11111);
  802. this.$http({
  803. url: "/market/waf/queryPath",
  804. method: "post",
  805. headers: {
  806. "Content-Type": "application/json",
  807. },
  808. data: list,
  809. }).then((res) => {
  810. console.log(res);
  811. console.log(this.fromList);
  812. console.log(res.data.body);
  813. console.log(res.data.body.nextShapes[0].multi);
  814. if (res.data.body.nextShapes[0].multi) {
  815. if (res.data.body.nextShapes[0].multi.multi === "true") {
  816. this.getLastName();
  817. }
  818. }
  819. if (this.fromList.taskId || this.fromList.processId) {
  820. this.destroy = true;
  821. this.handleStatus = true;
  822. this.getMetirialType();
  823. } else {
  824. this.$message.error("请先点击保存按钮");
  825. }
  826. });
  827. },
  828. //获取字典表常用意见
  829. getMetirialType(e) {
  830. this.$http({
  831. url: "/market/cfgDataDict/queryList",
  832. method: "post",
  833. headers: {
  834. "Content-Type": "application/json",
  835. },
  836. data: {
  837. dictCodePks: "approval",
  838. },
  839. }).then((res) => {
  840. this.commonlyList = res.data;
  841. });
  842. },
  843. //处理关闭
  844. handleCloses() {
  845. // this.treeList = [];
  846. // this.textarea = "";
  847. this.handleStatus = false;
  848. this.usernumber()
  849. },
  850. updateForm() {
  851. this.dialogStatus = false;
  852. this.handleCloses();
  853. this.usernumber()
  854. if (this.clickTagName == 'first') {
  855. this.lableTable = this.firstlabel
  856. this.getQueryList();
  857. }
  858. if (this.clickTagName == 'two') {
  859. this.lableTable = this.twolabel
  860. this.getQueryDone();
  861. }
  862. if (this.clickTagName == 'three') {
  863. this.lableTable = this.threelabel
  864. this.getMeLaunch()
  865. }
  866. },
  867. clickTabMains(e) {
  868. console.log(e);
  869. this.clickTagName = e
  870. this.pageNo = 1
  871. this.$refs.TableList.page = 1;
  872. if (this.clickTagName == 'first') {
  873. this.lableTable = this.firstlabel
  874. this.getQueryList();
  875. }
  876. if (this.clickTagName == 'two') {
  877. this.lableTable = this.twolabel
  878. this.getQueryDone();
  879. }
  880. if (this.clickTagName == 'three') {
  881. this.lableTable = this.threelabel
  882. this.getMeLaunch()
  883. }
  884. },
  885. adminhandleSizeChange(val) {
  886. console.log(`每页 ${val} 条`);
  887. },
  888. adminhandleCurrentChange(val) {
  889. console.log(`当前页: ${val}`);
  890. },
  891. //我的待办
  892. getQueryList(e, status) {
  893. this.loading = true;
  894. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  895. if (status === 0) {
  896. this.clickDemand("申请主题", res.data.data[0]);
  897. }
  898. this.lableTable.data = res.data.data;
  899. this.lableTable.pageData.total = res.data.totalRecord;
  900. this.tabListMain[0].number = res.data.totalRecord
  901. this.loading = false;
  902. });
  903. },
  904. //我的已办
  905. getQueryDone() {
  906. this.loading = true;
  907. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  908. this.lableTable.data = res.data.data;
  909. // this.lableTable.data.map((item) => {
  910. // item.status = "2";
  911. // });
  912. this.lableTable.pageData.total = res.data.totalRecord;
  913. this.tabListMain[1].number = res.data.totalRecord
  914. this.loading = false;
  915. });
  916. },
  917. //我发起的
  918. getMeLaunch() {
  919. this.loading = true;
  920. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  921. this.lableTable.data = res.data.data;
  922. // this.lableTable.data.map((item) => {
  923. // if (item.taskName === "申请人提出账号或权限申请") {
  924. // item.status = "1";
  925. // } else {
  926. // item.status = "2";
  927. // }
  928. // });
  929. this.lableTable.pageData.total = res.data.totalRecord;
  930. this.tabListMain[2].number = res.data.totalRecord
  931. this.loading = false;
  932. });
  933. },
  934. usernumber() {
  935. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  936. this.tabListMain[2].number = res.data.totalRecord
  937. });
  938. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  939. this.tabListMain[1].number = res.data.totalRecord
  940. });
  941. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  942. this.tabListMain[0].number = res.data.totalRecord
  943. });
  944. }
  945. },
  946. created() {
  947. let status = JSON.stringify(this.$route.query) == "{}";
  948. if (status) {
  949. this.lableTable = this.firstlabel
  950. this.getQueryList()
  951. this.usernumber()
  952. } else {
  953. let { id, type } = this.$route.query;
  954. let list = {
  955. taskId: id,
  956. tableName: this.tableName
  957. };
  958. this.usernumber()
  959. this.lableTable = this.firstlabel
  960. this.getQueryList(list, 0);//代办
  961. }
  962. }
  963. }
  964. </script>
  965. <style lang="scss" scoped>
  966. .copyClass {
  967. display: flex;
  968. }
  969. .flex-header-text-tree {
  970. width: 50%;
  971. text-align: center;
  972. }
  973. ::v-deep .el-form-item {
  974. width: 100%;
  975. }
  976. .active {
  977. background-color: #f3faff;
  978. }
  979. .flex-common {
  980. padding: 10px 5%;
  981. font-size: 18px;
  982. }
  983. .flex-buttons {
  984. background-color: #cde4f6;
  985. border-color: #cde4f6;
  986. color: #606266;
  987. }
  988. .flex-button {
  989. margin-top: 10px;
  990. margin-bottom: 10px;
  991. ::v-deep .el-button--primary {
  992. width: 222px;
  993. }
  994. }
  995. .flex-left-header-text {
  996. height: 40px;
  997. line-height: 40px;
  998. color: black;
  999. padding-left: 10px;
  1000. background-color: #cde4f6;
  1001. font-size: 18px;
  1002. font-weight: bold;
  1003. }
  1004. .flex-right-text {
  1005. margin-right: 20px;
  1006. width: 50%;
  1007. }
  1008. .flex-handle {
  1009. width: 100%;
  1010. padding: 30px;
  1011. display: flex;
  1012. .flex-right {
  1013. width: 50%;
  1014. border: 1px solid #e1e1e1;
  1015. margin-left: 20px;
  1016. }
  1017. .flex-left {
  1018. width: 50%;
  1019. display: flex;
  1020. flex-direction: column;
  1021. .flex-left-header {
  1022. display: flex;
  1023. justify-content: space-around;
  1024. }
  1025. }
  1026. }
  1027. .table-title {
  1028. height: 50px;
  1029. line-height: 50px;
  1030. background-color: #f3faff;
  1031. font-size: 18px;
  1032. font-weight: bold;
  1033. }
  1034. ::v-deep .el-dialog {
  1035. margin-top: 0 !important;
  1036. }
  1037. ::v-deep .el-table__fixed-body-wrapper {
  1038. top: 50px !important;
  1039. }
  1040. .flex-box {
  1041. display: flex;
  1042. width: calc(100% - 40px);
  1043. border-radius: 20px;
  1044. background-color: #fff;
  1045. margin: 0 auto;
  1046. margin-top: 20px;
  1047. position: relative;
  1048. flex-direction: column;
  1049. .flex-load {
  1050. display: flex;
  1051. width: 100%;
  1052. position: relative;
  1053. margin: 1%;
  1054. border-bottom: 1px solid #e1e1e1;
  1055. justify-content: space-between;
  1056. }
  1057. .flex-header {
  1058. display: flex;
  1059. // width: 100%;
  1060. position: relative;
  1061. // height: 60px;
  1062. margin: 1%;
  1063. border-bottom: 1px solid #e1e1e1;
  1064. justify-content: space-between;
  1065. // ::v-deep .el-form-item {
  1066. // width: 30%;
  1067. // margin-right: 5%;
  1068. // }
  1069. .el-button {
  1070. width: 150px;
  1071. float: right;
  1072. height: 40px !important;
  1073. margin-right: 30px;
  1074. }
  1075. }
  1076. }
  1077. //设置子组件样式
  1078. ::v-deep .el-tabs__item {
  1079. padding: 0;
  1080. margin-right: 20px;
  1081. width: 166px;
  1082. text-align: center;
  1083. background-color: #d8eaf6;
  1084. color: black;
  1085. }
  1086. //设置子组件样式
  1087. ::v-deep .el-form-item__label {
  1088. text-align: center;
  1089. }
  1090. ::v-deep .is-active {
  1091. color: #fff;
  1092. background-color: #0583cd;
  1093. }
  1094. ::v-deep .el-select {
  1095. width: 100%
  1096. }
  1097. ::v-deep .el-tabs__active-bar {
  1098. display: none;
  1099. }
  1100. ::v-deep .el-tabs__nav-wrap::after {
  1101. display: none !important;
  1102. }
  1103. .flex-form {
  1104. margin-top: 50px;
  1105. }
  1106. .flex-footer-botton {
  1107. display: flex;
  1108. justify-content: space-evenly;
  1109. }
  1110. </style>