rltzjlList.vue 44 KB

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