index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  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 getConfig from '../../../config/dev.js'
  46. import FormTable from "./formTables.vue";
  47. import { updateBase } from "../../../http/api.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. lableTable: {},
  83. abc: false,
  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: "op_process",
  114. },
  115. requestForm: {
  116. // fresourceId: "b79206a9-b258-11ed-886f-d6cd97160e00", // 本地环境
  117. // fresourceId: "1245d300-b25a-11ed-be6b-00505687dcd3", //测试环境
  118. // fresourceId:'6b9e1cb2-d918-11ed-8255-e00084564cce',//生产环境
  119. fresourceId: getConfig().opcode,
  120. processDefinitionKey: "op_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: "predealman",
  164. width: 300,
  165. },
  166. {
  167. label: "申请时间",
  168. prop: "proposer_time",
  169. width: 400,
  170. },
  171. {
  172. label: "当前环节",
  173. prop: "taskName",
  174. width: 400,
  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: 400,
  220. },
  221. {
  222. label: "当前环节",
  223. prop: "taskName",
  224. width: 400,
  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: 400,
  268. },
  269. {
  270. label: "当前环节",
  271. prop: "taskName",
  272. width: 400,
  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. console.log(e);
  368. this.$refs.TableList.page = 1;
  369. this.totalPage = "1";
  370. this.clickTagName = 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工作台]-Op_Code-' + 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. usernumber() {
  435. getInitiateBase(this.totalPage, "", { tableName: this.request_form.processDefinitionKey, }).then((res) => {
  436. this.tabList[2].number = res.data.totalRecord
  437. });
  438. getDoneBase(this.totalPage, "", { tableName: this.request_form.processDefinitionKey, }).then((res) => {
  439. this.tabList[1].number = res.data.totalRecord;
  440. });
  441. getTodoBase(this.totalPage, "", { tableName: this.request_form.processDefinitionKey, }).then((res) => {
  442. this.tabList[0].number = res.data.totalRecord
  443. });
  444. },
  445. getQueryList(e, status) {
  446. let list = {
  447. tableName: this.request_form.processDefinitionKey,
  448. };
  449. getTodoBase(this.totalPage, "", e || list).then((res) => {
  450. if (status === 0) {
  451. this.clickDemand("工单标题", res.data.data[0]);
  452. }
  453. console.log(res);
  454. this.lableTable.data = res.data.data;
  455. this.tabList[0].number = res.data.totalRecord;
  456. this.lableTable.pageData.total = res.data.totalRecord;
  457. this.loading = false;
  458. });
  459. },
  460. getQueryDone() {
  461. let list = {
  462. tableName: this.request_form.processDefinitionKey,
  463. };
  464. getDoneBase(this.totalPage, "", list).then((res) => {
  465. this.lableTable.data = res.data.data;
  466. this.lableTable.pageData.total = res.data.totalRecord;
  467. this.tabList[1].number = res.data.totalRecord;
  468. this.total = res.data.totalRecord;
  469. this.loading = false;
  470. });
  471. },
  472. getMeLaunch() {
  473. let list = {
  474. tableName: this.request_form.processDefinitionKey,
  475. };
  476. getInitiateBase(this.totalPage, "", list).then((res) => {
  477. this.lableTable.data = res.data.data;
  478. this.lableTable.pageData.total = res.data.totalRecord;
  479. this.tabList[2].number = res.data.totalRecord;
  480. this.total = res.data.totalRecord;
  481. this.loading = false;
  482. });
  483. },
  484. //新建按钮
  485. async clickNewTag() {
  486. this.dialogTitle = "新建";
  487. this.fromList = {}
  488. this.lables.data = [];
  489. this.disabled = false;
  490. this.saveStatus = true
  491. await this.getOrderNumber();
  492. },
  493. getOrderNumber() {
  494. this.$http({
  495. url: "/market/opProcess/getOrderNumber",
  496. method: "post",
  497. headers: {
  498. "Content-Type": "application/json",
  499. },
  500. data: {}
  501. }).then((res) => {
  502. this.fromList.orderNumber = res.data.body
  503. this.fromList.taskName = '填写申请单'
  504. this.dialogStatus = true;
  505. });
  506. },
  507. //获取用户部门名称
  508. getDepartmentName() {
  509. this.$http({
  510. url: "/market/waf/queryDept",
  511. method: "post",
  512. headers: {
  513. "Content-Type": "application/json",
  514. },
  515. data: {},
  516. }).then((res) => {
  517. });
  518. },
  519. clickDemand(e, res) {
  520. if (e === "工单状态" || e === "标题" || e === "工单标题") {
  521. if (this.clickTagName === "first") {
  522. this.dialogTitle = "查看";
  523. if (res.taskName === "填写申请单") {
  524. this.disabled = false;
  525. this.saveStatus = true;
  526. } else {
  527. this.disabled = true;
  528. this.saveStatus = false;
  529. }
  530. // this.clickForm(res);
  531. // this.getFromQuery(res);
  532. // setTimeout(() => {
  533. // this.getBtnStatus(res);
  534. // }, 500);
  535. }
  536. if (this.clickTagName === "two") {
  537. this.disabled = true;
  538. this.startStatus = false;
  539. this.saveStatus = false;
  540. }
  541. if (this.clickTagName === "three") {
  542. if (res.taskName === "填写申请单") {
  543. this.startStatus = true;
  544. this.disabled = false;
  545. this.saveStatus = true;
  546. } else {
  547. this.startStatus = false;
  548. this.disabled = true;
  549. this.saveStatus = false;
  550. }
  551. }
  552. this.fromList = res;
  553. this.clickForm(res);
  554. this.getFromQuery(res);
  555. }
  556. },
  557. //查询form表单数据
  558. getFromQuery(e) {
  559. this.$http({
  560. url: "/market/opProcess/query",
  561. method: "post",
  562. headers: {
  563. "Content-Type": "application/json",
  564. },
  565. data: { id: e.id },
  566. }).then((res) => {
  567. console.log(e);
  568. let list = this.convertObjKeys(e)
  569. this.fromList = { ...res.data, ...list }
  570. this.dialogStatus = true;
  571. });
  572. },
  573. async clickForm(e) {
  574. let list = {
  575. processInstanceId: e.process_id,
  576. // taskId:e.taskId
  577. };
  578. let _this = this;
  579. let obj = {
  580. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  581. data: list,
  582. headers: {
  583. "Content-Type": "application/json",
  584. },
  585. };
  586. let res = await this.common.httpPost(obj, success);
  587. function success(data) {
  588. console.log("[ 接口返回值第一曾 ] >", data);
  589. let list = [];
  590. list = data.data.data;
  591. if (data.data.lastmandata.length != 0) {
  592. data.data.lastmandata.map((item, index) => {
  593. item.id = index + 22;
  594. });
  595. }
  596. list.map((item, index) => {
  597. item.startTime = _this.$util.datetimeFormat(item.startTime);
  598. item.endTime = _this.$util.datetimeFormat(item.endTime);
  599. item.id = index + 1;
  600. item.children = [];
  601. if (data.data.lastmandata.length != 0) {
  602. let indexs = data.data.lastmandata.findIndex((items) => {
  603. if (items.taskId == item.taskId) {
  604. item.children.push(items);
  605. }
  606. });
  607. }
  608. });
  609. _this.lables.data = list;
  610. _this.abc = true;
  611. }
  612. },
  613. //获取页码
  614. changeNum(e) {
  615. let _this = this
  616. this.totalPage = e;
  617. const methodMapping = {
  618. first: (timeList) => {
  619. _this.firstTable.pageData.pageNum = e;
  620. if (timeList) {
  621. _this.getQueryList(timeList);
  622. } else {
  623. _this.getQueryList();
  624. }
  625. },
  626. two: () => {
  627. _this.twoTable.pageData.pageNum = e;
  628. _this.getQueryDone();
  629. },
  630. three: (searchLists) => {
  631. _this.threeTable.pageData.pageNum = e;
  632. if (searchLists) {
  633. _this.getMeLaunch(searchLists);
  634. } else {
  635. _this.getMeLaunch();
  636. }
  637. },
  638. }
  639. const methodToExecute = methodMapping[this.clickTagName];
  640. if (methodToExecute) {
  641. methodToExecute(this.timeList || this.searchLists);
  642. }
  643. // this.totalPage = e;
  644. },
  645. clickSave() {
  646. this.$refs.formTable.$refs.form.validate((valid) => {
  647. if (valid) {
  648. if (this.fromList.id) {
  649. this.setUpdateCopy(this.$refs.formTable.form)
  650. } else {
  651. this.getUserIds();
  652. }
  653. } else {
  654. this.$message.error("请完善表单信息");
  655. return false;
  656. }
  657. });
  658. // if (this.fromList.id) {
  659. // this.setUpdateCopy(this.$refs.formTable.form)
  660. // } else {
  661. // this.getUserIds();
  662. // this.setForm();
  663. // }
  664. },
  665. getUserIds() {
  666. this.$http({
  667. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  668. method: "post",
  669. headers: {
  670. "Content-Type": "application/json",
  671. },
  672. }).then((res) => {
  673. this.request_form.userName = res.data[0].children[0].loginNameStr;
  674. this.request_form.userId = res.data[0].children[0].loginNoStr;
  675. this.setForm();
  676. console.log(this.request_form)
  677. });
  678. },
  679. setForm(e) {
  680. this.request_form.title = '[IT工作台]-Op_Code-' + this.$refs.formTable.form.needName;
  681. this.$http({
  682. url: "/market/opProcess/add",
  683. method: "post",
  684. headers: {
  685. "Content-Type": "application/json",
  686. },
  687. data: this.$refs.formTable.form,
  688. }).then((res) => {
  689. this.request_form.businessKey = res.data.body;
  690. this.clickHandle(res.data.body);
  691. });
  692. },
  693. async clickHandle(e) {
  694. let _this = this;
  695. let obj = {
  696. url: this.$url.formList.startWork, //开始工作流接口
  697. data: _this.request_form,
  698. status: "form",
  699. headers: {
  700. "Content-Type": "application/x-www-form-urlencoded",
  701. },
  702. };
  703. let res = await this.common.httpPost(obj, success);
  704. function success(data) {
  705. console.log(data);
  706. // _this.fromList.processId = data.data;
  707. // _this.taskId = data.data;
  708. let list = {
  709. id: e,
  710. // taskId:_this.formId,
  711. tableName: _this.request_form.processDefinitionKey,
  712. processId: data.data,
  713. // resourceId: _this.nextPath.currentShape[0].resourceId,
  714. };
  715. _this.setUpdate(list);
  716. }
  717. },
  718. convertObjKeys(obj) {
  719. // 检查传入参数是否为对象
  720. if (typeof obj !== "object" || obj === null) {
  721. return obj;
  722. }
  723. // 对象遍历,使用 Object.keys() 获取所有属性名称
  724. return Object.keys(obj).reduce((result, key) => {
  725. // 下划线转驼峰命名
  726. const newKey = key.replace(/_(\w)/g, (match, p1) => p1.toUpperCase());
  727. // 将原有属性赋值到新属性中
  728. result[newKey] = obj[key];
  729. return result;
  730. }, {});
  731. },
  732. async setUpdate(e) {
  733. await updateBase(e).then((res) => {
  734. let list = this.convertObjKeys(res.data.body[0])
  735. console.log(list);
  736. // console.log(res.data.body);
  737. this.fromList = list
  738. // console.log(this.formList);
  739. // this.fromList.taskId = res.data.body[0].taskId;
  740. // this.fromList.taskId = '1111111111';
  741. // this.fromList.taskName = res.data.body[0].taskName;
  742. // this.fromList = concat;
  743. });
  744. },
  745. setUpdateCopy(e) {
  746. this.request_form.title = '[IT工作台]-Op_Code-' + this.$refs.formTable.form.needName;
  747. this.$http({
  748. url: "/market/opProcess/update",
  749. method: "post",
  750. headers: {
  751. "Content-Type": "application/json",
  752. },
  753. data: e
  754. }).then((res) => {
  755. console.log(res);
  756. this.$message.success(res.data.desc)
  757. });
  758. },
  759. clickClose() {
  760. // this.$refs.formTable.form = {}
  761. this.fromList = {}
  762. this.dialogStatus = false;
  763. this.treeList = [];
  764. this.textarea = "";
  765. this.handleStatus = false;
  766. this.handleStatus = false;
  767. this.destroy = false;
  768. this.dialogStatus = false;
  769. this.saveStatus = false;
  770. this.startStatus = true;
  771. this.usernumber()
  772. },
  773. handleCloses() {
  774. this.beforeClose()
  775. },
  776. beforeClose(e) {
  777. console.log(e);
  778. this.dialogStatus = false;
  779. this.handleStatus = false;
  780. this.usernumber()
  781. // this.handleCloses();
  782. this.getQueryList();
  783. // this.getMeLaunch();
  784. // this.getQueryDone();
  785. },
  786. },
  787. };
  788. </script>
  789. <style lang="scss" scoped>
  790. .copyClass {
  791. display: flex;
  792. }
  793. .flex-header-text-tree {
  794. width: 50%;
  795. text-align: center;
  796. }
  797. .active {
  798. background-color: #f3faff;
  799. }
  800. .flex-common {
  801. padding: 10px 5%;
  802. font-size: 18px;
  803. }
  804. .flex-buttons {
  805. background-color: #cde4f6;
  806. border-color: #cde4f6;
  807. color: #606266;
  808. }
  809. .flex-button {
  810. margin-top: 10px;
  811. margin-bottom: 10px;
  812. ::v-deep .el-button--primary {
  813. width: 222px;
  814. }
  815. }
  816. .flex-left-header-text {
  817. height: 40px;
  818. line-height: 40px;
  819. color: black;
  820. padding-left: 10px;
  821. background-color: #cde4f6;
  822. font-size: 18px;
  823. font-weight: bold;
  824. }
  825. .flex-right-text {
  826. margin-right: 20px;
  827. width: 50%;
  828. }
  829. .flex-handle {
  830. width: 100%;
  831. padding: 30px;
  832. display: flex;
  833. .flex-right {
  834. width: 50%;
  835. border: 1px solid #e1e1e1;
  836. margin-left: 20px;
  837. }
  838. .flex-left {
  839. width: 50%;
  840. display: flex;
  841. flex-direction: column;
  842. .flex-left-header {
  843. display: flex;
  844. justify-content: space-around;
  845. }
  846. }
  847. }
  848. .table-title {
  849. height: 50px;
  850. line-height: 50px;
  851. background-color: #f3faff;
  852. font-size: 18px;
  853. font-weight: bold;
  854. }
  855. ::v-deep .el-dialog {
  856. margin-top: 0 !important;
  857. }
  858. // ::v-deep .el-table__fixed-body-wrapper {
  859. // top: 50px !important;
  860. // }
  861. .flex-box {
  862. display: flex;
  863. // overflow: auto;
  864. overflow-y: auto;
  865. overflow-x: hidden;
  866. width: calc(100% - 40px);
  867. border-radius: 20px;
  868. background-color: #fff;
  869. margin: 0 auto;
  870. margin-top: 20px;
  871. position: relative;
  872. flex-direction: column;
  873. // height: 100%;
  874. .flex-header {
  875. display: flex;
  876. width: 100%;
  877. position: relative;
  878. height: 60px;
  879. margin: 1%;
  880. border-bottom: 1px solid #e1e1e1;
  881. justify-content: space-between;
  882. .el-button {
  883. width: 150px;
  884. float: right;
  885. height: 40px !important;
  886. margin-right: 30px;
  887. }
  888. }
  889. }
  890. //设置子组件样式
  891. ::v-deep .el-tabs__item {
  892. padding: 0;
  893. margin-right: 20px;
  894. width: 166px;
  895. text-align: center;
  896. background-color: #d8eaf6;
  897. color: black;
  898. }
  899. ::v-deep .is-active {
  900. color: #fff;
  901. background-color: #0583cd;
  902. }
  903. ::v-deep .el-tabs__active-bar {
  904. display: none;
  905. }
  906. ::v-deep .el-tabs__nav-wrap::after {
  907. display: none !important;
  908. }
  909. .flex-form {
  910. margin-top: 50px;
  911. }
  912. .flex-footer-botton {
  913. display: flex;
  914. justify-content: space-evenly;
  915. }
  916. </style>