index.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985
  1. <template>
  2. <div class="flex-box">
  3. <!-- v-show="lable.name === 'first'" -->
  4. <div class="flex-header" :span="24">
  5. <Tabs :tabList="tabList" @status="clickTabTops" />
  6. <el-button type="primary" @click="clickNewTag" v-show="lableTable.name === 'first'">+新建</el-button>
  7. </div>
  8. <div class="flex-count">
  9. <Table @clickDemand="clickDemand" :list="lableTable" ref="TableList" @changeNum="changeNum">
  10. </Table>
  11. </div>
  12. <el-dialog v-if="dialogStatus" :before-close="clickClose" :title="dialogTitle + '需求'" :visible.sync="dialogStatus"
  13. width="100%" :modal="false" style="display: flex; flex-direction: column">
  14. <!-- 后期维护 -->
  15. <div style="">
  16. <el-button type="primary" v-if="saveStatus" @click="clickSave">保存</el-button>
  17. <el-button type="primary" v-if="startStatus" @click="clickHandles">处理</el-button>
  18. <el-button type="primary" v-if="closeStatus" @click="clickClose">关闭</el-button>
  19. </div>
  20. <FormTable :list="fromList" :disabled="disabled" class="flex-form" ref="formTable" />
  21. <div>
  22. <div class="table-title">流程追踪</div>
  23. <div v-if="abc == true">
  24. <Tables :list="lables"></Tables>
  25. </div>
  26. </div>
  27. </el-dialog>
  28. <div v-if="destroy">
  29. <el-dialog title="处理操作" width="100%" :visible.sync="handleStatus" :before-close="handleCloses" :modal="false"
  30. v-if="handleStatus" :destroy-on-close="true">
  31. <Workflow ref="workflow" :list="fromList" v-if="isWorkflowStatus == true" @updateForm="beforeClose"
  32. :requestForm="requestForm" :adminResourceId="adminResourceId" :request_formTitle="request_form.title"/>
  33. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="beforeClose"
  34. :requestForm="requestForm" :request_formTitle="request_form.title"/>
  35. </el-dialog>
  36. </div>
  37. </div>
  38. </template>
  39. <script>
  40. import Workflow from "../../../components/workflowBase";
  41. import WorkflowEntrance from "../../../components/workflowEntrance";
  42. import Tabs from "../../../components/el-tabs.vue";
  43. import Table from "../../../components/el-form.vue";
  44. import Tables from "../../../components/el-forms.vue";
  45. import FormTable from "./formTable.vue";
  46. import { updateBase } from "../../../http/api.js";
  47. import getConfig from '../../../config/dev.js'
  48. import {
  49. getTodoBase,
  50. getDoneBase,
  51. getInitiateBase,
  52. } from "../../../http/api.js";
  53. import { log } from "console";
  54. export default {
  55. components: {
  56. Tabs,
  57. Table,
  58. Tables,
  59. FormTable,
  60. Workflow,
  61. WorkflowEntrance
  62. },
  63. created() {
  64. let status = JSON.stringify(this.$route.query) == "{}";
  65. if (status) {
  66. this.lableTable = this.firstTable
  67. this.getQueryList()
  68. this.usernumber()
  69. } else {
  70. let { id, type } = this.$route.query;
  71. let list = {
  72. taskId: id,
  73. tableName: this.request_form.processDefinitionKey
  74. };
  75. this.usernumber()
  76. this.lableTable = this.firstTable
  77. this.getQueryList(list, 0);//代办
  78. }
  79. },
  80. data() {
  81. return {
  82. abc: false,
  83. lableTable: {},
  84. handleClose: false,
  85. isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
  86. buttonStatus: true,
  87. copyStatus: false,
  88. dialogTitle: "",
  89. disabled: true,
  90. destroy: false,
  91. //分页数据
  92. totalPage: "1", //默认第一页
  93. currentPage: "1", //当前页数
  94. pageSize: "10", //每页显示十条
  95. currentPageList: ["1", "2"],
  96. startStatus: true,
  97. closeStatus: true, //关闭按钮状态
  98. forwardStatus: false, //转需求管理平台状态
  99. exportBtnStatus: false, //导出按钮状态
  100. saveStatus: true, //保存按钮状态
  101. fromList: {}, //表单数据
  102. rejectStatus: true,
  103. taskId: "", //工单taskID
  104. request_form: {
  105. userId: "",
  106. userName: "",
  107. path: this.$router.currentRoute.name,
  108. userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
  109. // path:this.$roter.options.routers,
  110. // nextDealMan:'',
  111. title: "title",
  112. businessKey: "288",
  113. processDefinitionKey: "fhq_process",
  114. },
  115. requestForm: {
  116. // fresourceId: "9d7c2f92-b251-11ed-886f-d6cd97160e00", // 本地环境
  117. // fresourceId: "86e7c09e-b256-11ed-be6b-00505687dcd3", //测试环境
  118. // fresourceId:'3c3df7fb-d918-11ed-8255-e00084564cce',//生产环境
  119. fresourceId: getConfig().firewall,
  120. processDefinitionKey: "fhq_process",
  121. },
  122. treeList: [], //候选人列表
  123. treeCopyList: [], //抄送人列表
  124. editStatus: false,
  125. querryList: [], //已选人员名单
  126. commonlyList: [
  127. //常用意见列表页
  128. ],
  129. textarea: "未填写意见",
  130. num: 0,
  131. dialogStatus: false, //新建dialog显示
  132. handleStatus: false, //处理按钮状态
  133. tabList: [
  134. {
  135. index: "first",
  136. label: "我的待办",
  137. number: 0,
  138. name: "prosss_key",
  139. },
  140. {
  141. index: "two",
  142. label: "我的已办",
  143. number: 0,
  144. },
  145. {
  146. index: "three",
  147. label: "我发起的",
  148. number: 0,
  149. },
  150. ],
  151. firstTable: {
  152. name: "first",
  153. height: 500,
  154. titledata: [
  155. {
  156. label: "标题",
  157. prop: "need_name",
  158. //width: 300,
  159. color: "#0682CD",
  160. },
  161. {
  162. label: "申请人",
  163. prop: "applicant",
  164. //width: 300,
  165. },
  166. {
  167. label: "申请时间",
  168. prop: "proposer_time",
  169. //width: 300,
  170. },
  171. {
  172. label: "当前环节",
  173. prop: "taskName",
  174. //width: 300,
  175. },
  176. ], //表格头
  177. data: [], //内容数据
  178. loading: true,
  179. pageData: {
  180. total: 100, // 总条数
  181. pageSize: 10, // 每页数量
  182. pageNum: 1, // 页码
  183. },
  184. isSelection: false, // 表格有多选时设置
  185. isOperation: false, // 表格有操作列时设置
  186. isIndex: false, // 列表序号
  187. operation: {
  188. // 表格有操作列时设置
  189. label: "操作", // 列名
  190. width: "50", // 根据实际情况给宽度
  191. data: [
  192. {
  193. label: "操作", // 操作名称
  194. type: "", //按钮类型
  195. handleRow: (e, r, o) => {
  196. }, // 自定义事件
  197. },
  198. ],
  199. },
  200. },
  201. twoTable: {
  202. name: "two",
  203. disabled: true,
  204. titledata: [
  205. {
  206. label: "标题",
  207. prop: "need_name",
  208. //width: 300,
  209. color: "#0682CD",
  210. },
  211. {
  212. label: "申请人",
  213. prop: "applicant",
  214. //width: 300,
  215. },
  216. {
  217. label: "申请时间",
  218. prop: "proposer_time",
  219. //width: 300,
  220. },
  221. {
  222. label: "当前环节",
  223. prop: "taskName",
  224. //width: 300,
  225. },
  226. ], //表格头
  227. data: [], //内容数据
  228. loading: true,
  229. pageData: {
  230. total: 100, // 总条数
  231. pageSize: 10, // 每页数量
  232. pageNum: 1, // 页码
  233. },
  234. isSelection: false, // 表格有多选时设置
  235. isOperation: false, // 表格有操作列时设置
  236. isIndex: false, // 列表序号
  237. operation: {
  238. // 表格有操作列时设置
  239. label: "操作", // 列名
  240. width: "50", // 根据实际情况给宽度
  241. data: [
  242. {
  243. label: "操作", // 操作名称
  244. type: "", //按钮类型
  245. handleRow: function () { }, // 自定义事件
  246. },
  247. ],
  248. },
  249. },
  250. threeTable: {
  251. name: "three",
  252. titledata: [
  253. {
  254. label: "标题",
  255. prop: "need_name",
  256. //width: 300,
  257. color: "#0682CD",
  258. },
  259. {
  260. label: "申请人",
  261. prop: "applicant",
  262. //width: 300,
  263. },
  264. {
  265. label: "申请时间",
  266. prop: "proposer_time",
  267. //width: 300,
  268. },
  269. {
  270. label: "当前环节",
  271. prop: "taskName",
  272. //width: 300,
  273. },
  274. {
  275. label: "当前处理人",
  276. prop: "currentMan",
  277. width: 200,
  278. },
  279. ], //表格头
  280. data: [], //内容数据
  281. loading: true,
  282. pageData: {
  283. total: 100, // 总条数
  284. pageSize: 10, // 每页数量
  285. pageNum: 1, // 页码
  286. },
  287. isSelection: false, // 表格有多选时设置
  288. isOperation: false, // 表格有操作列时设置
  289. isIndex: false, // 列表序号
  290. operation: {
  291. // 表格有操作列时设置
  292. label: "支撑状态", // 列名
  293. width: "100", // 根据实际情况给宽度
  294. data: [
  295. {
  296. label: "查看", // 操作名称
  297. type: "", //按钮类型
  298. handleRow: (e, r, o) => {
  299. }, // 自定义事件
  300. },
  301. ],
  302. },
  303. },
  304. lable: {},
  305. lables: {
  306. height: "400",
  307. titledata: [
  308. {
  309. id: 1,
  310. label: "环节名称",
  311. prop: "taskName",
  312. //width: 300,
  313. },
  314. {
  315. id: 2,
  316. label: "处理人",
  317. prop: "assignee",
  318. //width: 300,
  319. },
  320. {
  321. id: 3,
  322. label: "到达时间",
  323. prop: "startTime",
  324. //width: 300,
  325. },
  326. {
  327. id: 4,
  328. label: "处理时间",
  329. prop: "endTime",
  330. //width: 300,
  331. },
  332. {
  333. id: 5,
  334. label: "回复意见",
  335. prop: "content",
  336. //width: 300,
  337. },
  338. ], //表格头
  339. data: [], //内容数据
  340. loading: true,
  341. pageData: {
  342. total: 0, // 总条数
  343. pageSize: 10, // 每页数量
  344. pageNum: 1, // 页码
  345. },
  346. isSelection: false, // 表格有多选时设置
  347. isOperation: false, // 表格有操作列时设置
  348. isIndex: true, // 列表序号
  349. operation: {
  350. // 表格有操作列时设置
  351. label: "操作", // 列名
  352. width: "50", // 根据实际情况给宽度
  353. data: [
  354. {
  355. label: "操作", // 操作名称
  356. type: "", //按钮类型
  357. handleRow: function () { }, // 自定义事件
  358. },
  359. ],
  360. },
  361. },
  362. clickTagName: "first",
  363. };
  364. },
  365. methods: {
  366. clickTabTops(e) {
  367. this.$refs.TableList.page = 1;
  368. this.totalPage = "1";
  369. this.clickTagName = e;
  370. console.log(e);
  371. const options = {
  372. first: {
  373. setTable: function () {
  374. this.lableTable = this.firstTable;
  375. this.getQueryList();
  376. }.bind(this)
  377. },
  378. two: {
  379. setTable: function () {
  380. this.lableTable = this.twoTable;
  381. this.getQueryDone();
  382. }.bind(this)
  383. },
  384. three: {
  385. setTable: function () {
  386. this.lableTable = this.threeTable;
  387. this.getMeLaunch();
  388. }.bind(this)
  389. }
  390. };
  391. options[e]?.setTable?.();
  392. },
  393. //处理按钮,开始工作流接口
  394. clickHandles() {
  395. this.getNextPath(this.fromList.resourceId || "");
  396. this.request_form.title = '[IT工作台]-防火墙策略-' + this.$refs.formTable.form.needName;
  397. },
  398. getNextPath(e) {
  399. let list = {
  400. fresourceId: this.requestForm.fresourceId, // 本地环境
  401. processId: this.requestForm.processDefinitionKey,
  402. };
  403. if (e) {
  404. list.resourceId = e;
  405. }
  406. this.$http({
  407. url: "/market/waf/queryPath",
  408. method: "post",
  409. headers: {
  410. "Content-Type": "application/json",
  411. },
  412. data: list,
  413. }).then((res) => {
  414. if (res.data.body.nextShapes[0].multi) {
  415. if (res.data.body.nextShapes[0].multi.multi === "true") {
  416. this.getLastName();
  417. } else {
  418. this.adminResourceId = "";
  419. }
  420. } else {
  421. this.adminResourceId = "";
  422. // this.destroy = true;
  423. // this.handleStatus = true;
  424. }
  425. console.log(this.fromList);
  426. if (this.fromList.processId || this.fromList.taskId) {
  427. this.destroy = true;
  428. this.handleStatus = true;
  429. } else {
  430. this.$message.error("请先点击保存按钮");
  431. }
  432. });
  433. },
  434. getQueryList(e, status) {
  435. let list = {
  436. tableName: this.request_form.processDefinitionKey,
  437. };
  438. getTodoBase(this.totalPage, "", e || list).then((res) => {
  439. if (status === 0) {
  440. this.clickDemand("标题", res.data.data[0]);
  441. }
  442. this.lableTable.data = res.data.data;
  443. this.tabList[0].number = res.data.totalRecord;
  444. this.lableTable.pageData.total = res.data.totalRecord;
  445. this.loading = false;
  446. });
  447. },
  448. getQueryDone() {
  449. let list = {
  450. tableName: this.request_form.processDefinitionKey,
  451. };
  452. getDoneBase(this.totalPage, "", list).then((res) => {
  453. this.lableTable.data = res.data.data;
  454. this.lableTable.pageData.total = res.data.totalRecord;
  455. // this.tableData.map((item) => {
  456. // item.status = "2";
  457. // });
  458. this.tabList[1].number = res.data.totalRecord;
  459. this.total = res.data.totalRecord;
  460. this.loading = false;
  461. });
  462. },
  463. getMeLaunch() {
  464. let list = {
  465. tableName: this.request_form.processDefinitionKey,
  466. };
  467. getInitiateBase(this.totalPage, "", list).then((res) => {
  468. this.lableTable.data = res.data.data;
  469. this.lableTable.pageData.total = res.data.totalRecord;
  470. this.tabList[2].number = res.data.totalRecord;
  471. this.lableTable.data.map((item) => {
  472. item.startTime = this.formatTimestamp(item.startTime)
  473. })
  474. // this.tableData.map((item) => {
  475. // if (item.taskName === "起草") {
  476. // item.status = "1";
  477. // } else {
  478. // item.status = "2";
  479. // }
  480. // });
  481. this.total = res.data.totalRecord;
  482. this.loading = false;
  483. });
  484. },
  485. formatTimestamp(timestamp) {
  486. var date = new Date(timestamp);
  487. var year = date.getFullYear();
  488. var month = ('0' + (date.getMonth() + 1)).slice(-2);
  489. var day = ('0' + date.getDate()).slice(-2);
  490. var hours = ('0' + date.getHours()).slice(-2);
  491. var minutes = ('0' + date.getMinutes()).slice(-2);
  492. var seconds = ('0' + date.getSeconds()).slice(-2);
  493. return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
  494. },
  495. //新建按钮
  496. async clickNewTag() {
  497. this.dialogTitle = "新建";
  498. this.lables.data = [];
  499. this.fromList = {}
  500. this.disabled = false;
  501. this.saveStatus = true
  502. await this.getDepartmentName();
  503. await this.getOrderNumber()
  504. },
  505. getOrderNumber() {
  506. this.$http({
  507. url: "/market/fhqProcess/getOrderNumber",
  508. method: "post",
  509. headers: {
  510. "Content-Type": "application/json",
  511. },
  512. data: {}
  513. }).then((res) => {
  514. this.dialogStatus = true;
  515. console.log(this.$refs.formTable);
  516. this.fromList.orderNumber = res.data.body
  517. this.fromList.taskName = '需求发起人'
  518. });
  519. },
  520. //获取用户部门名称
  521. getDepartmentName() {
  522. this.$http({
  523. url: "/market/waf/queryDept",
  524. method: "post",
  525. headers: {
  526. "Content-Type": "application/json",
  527. },
  528. data: {},
  529. }).then((res) => {
  530. let list = {
  531. applyDept: res.data,
  532. applyDepartment: JSON.parse(window.sessionStorage.userInfo).groupName,
  533. proposer: JSON.parse(window.sessionStorage.userInfo).loginName,
  534. };
  535. // this.fromList = list;
  536. if (this.$refs.formTable) {
  537. // this.$refs.formTable.form = list;
  538. }
  539. });
  540. },
  541. clickDemand(e, res) {
  542. if (e === "工单状态" || e === "标题") {
  543. if (this.clickTagName === "first") {
  544. this.dialogTitle = "查看";
  545. if (res.taskName === "需求发起人") {
  546. this.disabled = false;
  547. this.saveStatus = true;
  548. } else {
  549. this.disabled = true;
  550. this.saveStatus = false;
  551. }
  552. // this.clickForm(res);
  553. // this.getFromQuery(res);
  554. // setTimeout(() => {
  555. // this.getBtnStatus(res);
  556. // }, 500);
  557. }
  558. if (this.clickTagName === "two") {
  559. this.disabled = true;
  560. this.startStatus = false;
  561. this.saveStatus = false;
  562. }
  563. if (this.clickTagName === "three") {
  564. if (res.taskName === "需求发起人") {
  565. this.startStatus = true;
  566. this.disabled = false;
  567. this.saveStatus = true;
  568. } else {
  569. this.startStatus = false;
  570. this.disabled = true;
  571. this.saveStatus = false;
  572. }
  573. }
  574. this.fromList = res;
  575. this.clickForm(res);
  576. this.getFromQuery(res);
  577. }
  578. },
  579. //查询form表单数据
  580. getFromQuery(e) {
  581. this.$http({
  582. url: "/market/fhqProcess/query",
  583. method: "post",
  584. headers: {
  585. "Content-Type": "application/json",
  586. },
  587. data: { id: e.id },
  588. }).then((res) => {
  589. console.log(e);
  590. let list = this.convertObjKeys(e)
  591. this.fromList = { ...res.data, ...list }
  592. console.log(this.fromList);
  593. this.dialogStatus = true;
  594. });
  595. },
  596. async clickForm(e) {
  597. let list = {
  598. processInstanceId: e.process_id,
  599. // taskId:e.taskId
  600. };
  601. let _this = this;
  602. let obj = {
  603. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  604. data: list,
  605. headers: {
  606. "Content-Type": "application/json",
  607. },
  608. };
  609. let res = await this.common.httpPost(obj, success);
  610. function success(data) {
  611. let list = [];
  612. list = data.data.data;
  613. if (data.data.lastmandata.length != 0) {
  614. data.data.lastmandata.map((item, index) => {
  615. item.id = index + 22;
  616. });
  617. }
  618. list.map((item, index) => {
  619. item.startTime = _this.$util.datetimeFormat(item.startTime);
  620. item.endTime = _this.$util.datetimeFormat(item.endTime);
  621. item.id = index + 1;
  622. item.children = [];
  623. if (data.data.lastmandata.length != 0) {
  624. let indexs = data.data.lastmandata.findIndex((items) => {
  625. if (items.taskId == item.taskId) {
  626. item.children.push(items);
  627. }
  628. });
  629. }
  630. });
  631. _this.lables.data = list;
  632. _this.abc = true;
  633. }
  634. },
  635. //获取页码
  636. changeNum(e) {
  637. this.totalPage = e;
  638. const methodMapping = {
  639. first: (timeList) => {
  640. if (timeList) {
  641. this.getQueryList(timeList);
  642. } else {
  643. this.getQueryList();
  644. }
  645. },
  646. two: () => {
  647. this.getMeDone();
  648. },
  649. three: (searchLists) => {
  650. if (searchLists) {
  651. this.getMeLaunch(searchLists);
  652. } else {
  653. this.getMeLaunch();
  654. }
  655. },
  656. }
  657. const methodToExecute = methodMapping[this.clickTagName];
  658. if (methodToExecute) {
  659. methodToExecute(this.timeList || this.searchLists);
  660. }
  661. // this.totalPage = e;
  662. },
  663. clickSave() {
  664. this.$refs.formTable.$refs.form.validate((valid) => {
  665. if (valid) {
  666. if (this.fromList.id) {
  667. this.setUpdateCopy(this.$refs.formTable.form)
  668. } else {
  669. this.getUserIds();
  670. }
  671. } else {
  672. this.$message.error("请完善表单信息");
  673. return false;
  674. }
  675. });
  676. // if (this.fromList.id) {
  677. // this.setUpdateCopy(this.$refs.formTable.form)
  678. // } else {
  679. // this.getUserIds();
  680. // this.setForm();
  681. // }
  682. },
  683. getUserIds() {
  684. this.$http({
  685. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  686. method: "post",
  687. headers: {
  688. "Content-Type": "application/json",
  689. },
  690. }).then((res) => {
  691. this.request_form.userName = res.data[0].children[0].loginNameStr;
  692. this.request_form.userId = res.data[0].children[0].loginNoStr;
  693. this.setForm();
  694. console.log(this.request_form)
  695. });
  696. },
  697. setForm(e) {
  698. this.request_form.title = '[IT工作台]-防火墙策略-' + this.$refs.formTable.form.needName;
  699. this.$http({
  700. url: "/market/fhqProcess/add",
  701. method: "post",
  702. headers: {
  703. "Content-Type": "application/json",
  704. },
  705. data: this.$refs.formTable.form,
  706. }).then((res) => {
  707. this.request_form.businessKey = res.data.body;
  708. this.clickHandle(res.data.body);
  709. });
  710. },
  711. async clickHandle(e) {
  712. let _this = this;
  713. let obj = {
  714. url: this.$url.formList.startWork, //开始工作流接口
  715. data: _this.request_form,
  716. status: "form",
  717. headers: {
  718. "Content-Type": "application/x-www-form-urlencoded",
  719. },
  720. };
  721. let res = await this.common.httpPost(obj, success);
  722. function success(data) {
  723. console.log(data);
  724. // _this.fromList.processId = data.data;
  725. // _this.taskId = data.data;
  726. let list = {
  727. id: e,
  728. // taskId:_this.formId,
  729. tableName: _this.request_form.processDefinitionKey,
  730. processId: data.data,
  731. // resourceId: _this.nextPath.currentShape[0].resourceId,
  732. };
  733. _this.setUpdate(list);
  734. }
  735. },
  736. convertObjKeys(obj) {
  737. // 检查传入参数是否为对象
  738. if (typeof obj !== "object" || obj === null) {
  739. return obj;
  740. }
  741. // 对象遍历,使用 Object.keys() 获取所有属性名称
  742. return Object.keys(obj).reduce((result, key) => {
  743. // 下划线转驼峰命名
  744. const newKey = key.replace(/_(\w)/g, (match, p1) => p1.toUpperCase());
  745. // 将原有属性赋值到新属性中
  746. result[newKey] = obj[key];
  747. return result;
  748. }, {});
  749. },
  750. async setUpdate(e) {
  751. await updateBase(e).then((res) => {
  752. let list = this.convertObjKeys(res.data.body[0])
  753. console.log(list);
  754. // console.log(res.data.body);
  755. this.fromList = list
  756. // console.log(this.formList);
  757. // this.fromList.taskId = res.data.body[0].taskId;
  758. // this.fromList.taskId = '1111111111';
  759. // this.fromList.taskName = res.data.body[0].taskName;
  760. // this.fromList = concat;
  761. });
  762. },
  763. setUpdateCopy(e) {
  764. this.request_form.title = '[IT工作台]-防火墙策略-' + this.$refs.formTable.form.needName;
  765. this.$http({
  766. url: "/market/fhqProcess/update",
  767. method: "post",
  768. headers: {
  769. "Content-Type": "application/json",
  770. },
  771. data: e
  772. }).then((res) => {
  773. console.log(res);
  774. this.$message.success(res.data.desc)
  775. });
  776. },
  777. usernumber() {
  778. getInitiateBase(this.totalPage, "", { tableName: this.request_form.processDefinitionKey, }).then((res) => {
  779. this.tabList[2].number = res.data.totalRecord
  780. });
  781. getDoneBase(this.totalPage, "", { tableName: this.request_form.processDefinitionKey, }).then((res) => {
  782. this.tabList[1].number = res.data.totalRecord;
  783. });
  784. getTodoBase(this.totalPage, "", { tableName: this.request_form.processDefinitionKey, }).then((res) => {
  785. this.tabList[0].number = res.data.totalRecord
  786. });
  787. },
  788. clickClose() {
  789. // this.$refs.formTable.form = {}
  790. this.fromList = {}
  791. this.dialogStatus = false;
  792. this.treeList = [];
  793. this.textarea = "";
  794. this.handleStatus = false;
  795. this.handleStatus = false;
  796. this.destroy = false;
  797. this.saveStatus = false;
  798. this.startStatus = true;
  799. this.usernumber()
  800. },
  801. handleCloses() {
  802. this.beforeClose()
  803. },
  804. beforeClose(e) {
  805. this.usernumber()
  806. this.dialogStatus = false;
  807. this.handleStatus = false;
  808. // this.handleCloses();
  809. this.getQueryList();
  810. },
  811. },
  812. };
  813. </script>
  814. <style lang="scss" scoped>
  815. .copyClass {
  816. display: flex;
  817. }
  818. .flex-header-text-tree {
  819. width: 50%;
  820. text-align: center;
  821. }
  822. .active {
  823. background-color: #f3faff;
  824. }
  825. .flex-common {
  826. padding: 10px 5%;
  827. font-size: 18px;
  828. }
  829. .flex-buttons {
  830. background-color: #cde4f6;
  831. border-color: #cde4f6;
  832. color: #606266;
  833. }
  834. .flex-button {
  835. margin-top: 10px;
  836. margin-bottom: 10px;
  837. ::v-deep .el-button--primary {
  838. width: 222px;
  839. }
  840. }
  841. .flex-left-header-text {
  842. height: 40px;
  843. line-height: 40px;
  844. color: black;
  845. padding-left: 10px;
  846. background-color: #cde4f6;
  847. font-size: 18px;
  848. font-weight: bold;
  849. }
  850. .flex-right-text {
  851. margin-right: 20px;
  852. width: 50%;
  853. }
  854. .flex-handle {
  855. width: 100%;
  856. padding: 30px;
  857. display: flex;
  858. .flex-right {
  859. width: 50%;
  860. border: 1px solid #e1e1e1;
  861. margin-left: 20px;
  862. }
  863. .flex-left {
  864. width: 50%;
  865. display: flex;
  866. flex-direction: column;
  867. .flex-left-header {
  868. display: flex;
  869. justify-content: space-around;
  870. }
  871. }
  872. }
  873. .table-title {
  874. height: 50px;
  875. line-height: 50px;
  876. background-color: #f3faff;
  877. font-size: 18px;
  878. font-weight: bold;
  879. }
  880. ::v-deep .el-dialog {
  881. margin-top: 0 !important;
  882. }
  883. // ::v-deep .el-table__fixed-body-wrapper {
  884. // top: 50px !important;
  885. // }
  886. .flex-box {
  887. display: flex;
  888. // overflow: auto;
  889. overflow-y: auto;
  890. overflow-x: hidden;
  891. width: calc(100% - 40px);
  892. border-radius: 20px;
  893. background-color: #fff;
  894. margin: 0 auto;
  895. margin-top: 20px;
  896. position: relative;
  897. flex-direction: column;
  898. // height: 100%;
  899. .flex-header {
  900. display: flex;
  901. width: 100%;
  902. position: relative;
  903. height: 60px;
  904. margin: 1%;
  905. border-bottom: 1px solid #e1e1e1;
  906. justify-content: space-between;
  907. .el-button {
  908. width: 150px;
  909. float: right;
  910. height: 40px !important;
  911. margin-right: 30px;
  912. }
  913. }
  914. }
  915. //设置子组件样式
  916. ::v-deep .el-tabs__item {
  917. padding: 0;
  918. margin-right: 20px;
  919. width: 166px;
  920. text-align: center;
  921. background-color: #d8eaf6;
  922. color: black;
  923. }
  924. ::v-deep .is-active {
  925. color: #fff;
  926. background-color: #0583cd;
  927. }
  928. ::v-deep .el-tabs__active-bar {
  929. display: none;
  930. }
  931. ::v-deep .el-tabs__nav-wrap::after {
  932. display: none !important;
  933. }
  934. .flex-form {
  935. margin-top: 50px;
  936. }
  937. .flex-footer-botton {
  938. display: flex;
  939. justify-content: space-evenly;
  940. }
  941. </style>