index.vue 33 KB

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