rltzjlList.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  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="">
  17. <el-button type="primary" v-if="saveStatus" @click="clickSave">保存</el-button>
  18. <el-button type="primary" v-if="startStatus" @click="clickHandles">处理</el-button>
  19. <el-button type="primary" v-if="closeStatus" @click="handleClose">关闭</el-button>
  20. </div>
  21. <el-form ref="form" :model="fromList" :rules="rule" label-width="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" :request_formTitle="request_form.title"/>
  85. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="updateForm"
  86. :requestForm="requestForm" :request_formTitle="request_form.title"/>
  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.request_form.title = '[IT工作台]-容量调整记录-' + this.fromList.needName;
  752. this.$http({
  753. url: "/market/RltzProcess/update",
  754. method: "post",
  755. headers: {
  756. "Content-Type": "application/json",
  757. },
  758. data: this.fromList,
  759. }).then((res) => {
  760. if (res.data.result === 0) {
  761. this.$message.success("表单更新成功");
  762. }
  763. });
  764. } else {
  765. this.getUserIds();
  766. }
  767. } else {
  768. this.$message.error("请完善表单信息");
  769. return false;
  770. }
  771. });
  772. },
  773. //获取自己idname
  774. getUserIds() {
  775. this.$http({
  776. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  777. method: "post",
  778. headers: {
  779. "Content-Type": "application/json",
  780. },
  781. }).then((res) => {
  782. this.request_form.userName = res.data[0].children[0].loginNameStr;
  783. this.request_form.userId = res.data[0].children[0].loginNoStr;
  784. this.setForm();
  785. console.log(this.request_form)
  786. });
  787. },
  788. setForm(e) {
  789. // console.log(this.$refs.form)
  790. this.request_form.title = '[IT工作台]-容量调整记录-' + this.fromList.needName;
  791. // this.request_form.title = this.$refs.form.needName;
  792. // this.$refs.form.taskId = e;
  793. this.fromList.accessoryIdList = []
  794. console.log(this.fromList.accessoryList);
  795. if (this.fromList.accessoryList) {
  796. this.fromList.accessoryList.map((item) => {
  797. this.fromList.accessoryIdList.push(item.id);
  798. })
  799. }
  800. this.$http({
  801. url: "/market/RltzProcess/add",
  802. method: "post",
  803. headers: {
  804. "Content-Type": "application/json",
  805. },
  806. // data: this.$refs.form,
  807. data: this.fromList,
  808. }).then((res) => {
  809. this.request_form.businessKey = res.data.body;
  810. this.fromList.id = res.data.body;
  811. this.formWorkId = res.data.body;
  812. this.clickHandle(res.data.body);
  813. });
  814. },
  815. async clickHandle(e) {
  816. let _this = this;
  817. let obj = {
  818. url: this.$url.formList.startWork, //开始工作流接口
  819. data: _this.request_form,
  820. status: "form",
  821. headers: {
  822. "Content-Type": "application/x-www-form-urlencoded",
  823. },
  824. };
  825. let res = await this.common.httpPost(obj, success);
  826. function success(data) {
  827. // console.log(data);
  828. _this.fromList.taskId = data.data;
  829. _this.fromList.processId = data.data;
  830. // _this.fromList.resourceId = data.data;
  831. _this.taskId = data.data;
  832. // _this.fromList.taskId = data;
  833. // _this.taskId = data;
  834. let list = {
  835. id: e,
  836. // taskId:_this.formId,
  837. processId: _this.fromList.taskId,
  838. tableName: _this.request_form.processDefinitionKey,
  839. };
  840. _this.setUpdate(list);
  841. }
  842. },
  843. //更新工作流接口
  844. setUpdate(e) {
  845. this.$http({
  846. url: "/market/waf/updateBase",
  847. method: "post",
  848. headers: {
  849. "Content-Type": "application/json",
  850. },
  851. data: e,
  852. }).then((res) => {
  853. this.fromList.taskId = res.data.body[0].taskId;
  854. this.fromList.taskName = res.data.body[0].taskName;
  855. // if (res.data.body.taskName === "工单发起") {
  856. // this.isSync = res.data.body.isSync;
  857. // } else {
  858. // this.isSync = "1";
  859. // }
  860. if (res.data.result === 0) {
  861. this.$message.success("工作流更新成功");
  862. }
  863. });
  864. },
  865. //处理按钮,开始工作流接口
  866. clickHandles() {
  867. this.getNextPath(this.fromList.resourceId || "");
  868. console.log(this.fromList);
  869. this.request_form.title = '[IT工作台]-容量调整记录-' + this.fromList.needName;
  870. // if (this.fromList.taskId) {
  871. // this.destroy = true;
  872. // this.handleStatus = true;
  873. // } else {
  874. // this.$message.error("请先点击保存按钮");
  875. // }
  876. },
  877. getNextPath(e) {
  878. let list = {
  879. fresourceId: this.requestForm.fresourceId, // 本地环境
  880. processId: this.requestForm.processDefinitionKey,
  881. // processId: "request_form_process",
  882. // resourceId: e,
  883. };
  884. if (e) {
  885. // this.propsList = [];
  886. list.resourceId = e;
  887. }
  888. console.log(11111);
  889. console.log(list);
  890. console.log(11111);
  891. this.$http({
  892. url: "/market/waf/queryPath",
  893. method: "post",
  894. headers: {
  895. "Content-Type": "application/json",
  896. },
  897. data: list,
  898. }).then((res) => {
  899. console.log(res);
  900. console.log(this.fromList);
  901. console.log(res.data.body);
  902. console.log(res.data.body.nextShapes[0].multi);
  903. if (res.data.body.nextShapes[0].multi) {
  904. if (res.data.body.nextShapes[0].multi.multi === "true") {
  905. this.getLastName();
  906. }
  907. }
  908. if (this.fromList.taskId || this.fromList.processId) {
  909. this.destroy = true;
  910. this.handleStatus = true;
  911. this.getMetirialType();
  912. } else {
  913. this.$message.error("请先点击保存按钮");
  914. }
  915. });
  916. },
  917. //获取字典表常用意见
  918. getMetirialType(e) {
  919. this.$http({
  920. url: "/market/cfgDataDict/queryList",
  921. method: "post",
  922. headers: {
  923. "Content-Type": "application/json",
  924. },
  925. data: {
  926. dictCodePks: "approval",
  927. },
  928. }).then((res) => {
  929. this.commonlyList = res.data;
  930. });
  931. },
  932. //处理关闭
  933. handleCloses() {
  934. // this.treeList = [];
  935. // this.textarea = "";
  936. this.handleStatus = false;
  937. this.usernumber()
  938. },
  939. updateForm() {
  940. this.dialogStatus = false;
  941. this.handleCloses();
  942. this.usernumber()
  943. if (this.clickTagName == 'first') {
  944. this.lableTable = this.firstlabel
  945. this.getQueryList();
  946. }
  947. if (this.clickTagName == 'two') {
  948. this.lableTable = this.twolabel
  949. this.getQueryDone();
  950. }
  951. if (this.clickTagName == 'three') {
  952. this.lableTable = this.threelabel
  953. this.getMeLaunch()
  954. }
  955. },
  956. clickTabMains(e) {
  957. console.log(e);
  958. this.clickTagName = e
  959. this.pageNo = 1
  960. this.$refs.TableList.page = 1;
  961. if (this.clickTagName == 'first') {
  962. this.lableTable = this.firstlabel
  963. this.getQueryList();
  964. }
  965. if (this.clickTagName == 'two') {
  966. this.lableTable = this.twolabel
  967. this.getQueryDone();
  968. }
  969. if (this.clickTagName == 'three') {
  970. this.lableTable = this.threelabel
  971. this.getMeLaunch()
  972. }
  973. },
  974. adminhandleSizeChange(val) {
  975. console.log(`每页 ${val} 条`);
  976. },
  977. adminhandleCurrentChange(val) {
  978. console.log(`当前页: ${val}`);
  979. },
  980. //我的待办
  981. getQueryList(e, status) {
  982. this.loading = true;
  983. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  984. if (status === 0) {
  985. this.clickDemand("标题", res.data.data[0]);
  986. }
  987. this.lableTable.data = res.data.data;
  988. this.lableTable.pageData.total = res.data.totalRecord;
  989. this.tabListMain[0].number = res.data.totalRecord
  990. this.loading = false;
  991. });
  992. },
  993. //我的已办
  994. getQueryDone() {
  995. this.loading = true;
  996. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  997. this.lableTable.data = res.data.data;
  998. // this.lableTable.data.map((item) => {
  999. // item.status = "2";
  1000. // });
  1001. this.lableTable.pageData.total = res.data.totalRecord;
  1002. this.tabListMain[1].number = res.data.totalRecord
  1003. this.loading = false;
  1004. });
  1005. },
  1006. //我发起的
  1007. getMeLaunch() {
  1008. this.loading = true;
  1009. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  1010. this.lableTable.data = res.data.data;
  1011. // this.lableTable.data.map((item) => {
  1012. // if (item.taskName === "工单发起") {
  1013. // item.status = "1";
  1014. // } else {
  1015. // item.status = "2";
  1016. // }
  1017. // });
  1018. this.lableTable.pageData.total = res.data.totalRecord;
  1019. this.tabListMain[2].number = res.data.totalRecord
  1020. this.loading = false;
  1021. });
  1022. },
  1023. usernumber() {
  1024. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  1025. this.tabListMain[2].number = res.data.totalRecord
  1026. });
  1027. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  1028. this.tabListMain[1].number = res.data.totalRecord
  1029. });
  1030. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  1031. this.tabListMain[0].number = res.data.totalRecord
  1032. });
  1033. }
  1034. },
  1035. created() {
  1036. let status = JSON.stringify(this.$route.query) == "{}";
  1037. if (status) {
  1038. this.lableTable = this.firstlabel
  1039. this.getQueryList()
  1040. this.usernumber()
  1041. } else {
  1042. let { id, type } = this.$route.query;
  1043. let list = {
  1044. taskId: id,
  1045. tableName: this.tableName
  1046. };
  1047. this.usernumber()
  1048. this.lableTable = this.firstlabel
  1049. this.getQueryList(list, 0);//代办
  1050. }
  1051. }
  1052. }
  1053. </script>
  1054. <style lang="scss" scoped>
  1055. .copyClass {
  1056. display: flex;
  1057. }
  1058. .flex-header-text-tree {
  1059. width: 50%;
  1060. text-align: center;
  1061. }
  1062. ::v-deep .el-form-item {
  1063. width: 100%;
  1064. }
  1065. .active {
  1066. background-color: #f3faff;
  1067. }
  1068. .flex-common {
  1069. padding: 10px 5%;
  1070. font-size: 18px;
  1071. }
  1072. .flex-buttons {
  1073. background-color: #cde4f6;
  1074. border-color: #cde4f6;
  1075. color: #606266;
  1076. }
  1077. .flex-button {
  1078. margin-top: 10px;
  1079. margin-bottom: 10px;
  1080. ::v-deep .el-button--primary {
  1081. width: 222px;
  1082. }
  1083. }
  1084. .flex-left-header-text {
  1085. height: 40px;
  1086. line-height: 40px;
  1087. color: black;
  1088. padding-left: 10px;
  1089. background-color: #cde4f6;
  1090. font-size: 18px;
  1091. font-weight: bold;
  1092. }
  1093. .flex-right-text {
  1094. margin-right: 20px;
  1095. width: 50%;
  1096. }
  1097. .flex-handle {
  1098. width: 100%;
  1099. padding: 30px;
  1100. display: flex;
  1101. .flex-right {
  1102. width: 50%;
  1103. border: 1px solid #e1e1e1;
  1104. margin-left: 20px;
  1105. }
  1106. .flex-left {
  1107. width: 50%;
  1108. display: flex;
  1109. flex-direction: column;
  1110. .flex-left-header {
  1111. display: flex;
  1112. justify-content: space-around;
  1113. }
  1114. }
  1115. }
  1116. .table-title {
  1117. height: 50px;
  1118. line-height: 50px;
  1119. background-color: #f3faff;
  1120. font-size: 18px;
  1121. font-weight: bold;
  1122. }
  1123. ::v-deep .el-dialog {
  1124. margin-top: 0 !important;
  1125. }
  1126. ::v-deep .el-table__fixed-body-wrapper {
  1127. top: 50px !important;
  1128. }
  1129. .flex-box {
  1130. display: flex;
  1131. width: calc(100% - 40px);
  1132. border-radius: 20px;
  1133. background-color: #fff;
  1134. margin: 0 auto;
  1135. margin-top: 20px;
  1136. position: relative;
  1137. flex-direction: column;
  1138. .flex-load {
  1139. display: flex;
  1140. width: 100%;
  1141. position: relative;
  1142. margin: 1%;
  1143. border-bottom: 1px solid #e1e1e1;
  1144. justify-content: space-between;
  1145. }
  1146. .flex-header {
  1147. display: flex;
  1148. // width: 100%;
  1149. position: relative;
  1150. // height: 60px;
  1151. margin: 1%;
  1152. border-bottom: 1px solid #e1e1e1;
  1153. justify-content: space-between;
  1154. // ::v-deep .el-form-item {
  1155. // width: 30%;
  1156. // margin-right: 5%;
  1157. // }
  1158. .el-button {
  1159. width: 150px;
  1160. float: right;
  1161. height: 40px !important;
  1162. margin-right: 30px;
  1163. }
  1164. }
  1165. }
  1166. //设置子组件样式
  1167. ::v-deep .el-tabs__item {
  1168. padding: 0;
  1169. margin-right: 20px;
  1170. width: 166px;
  1171. text-align: center;
  1172. background-color: #d8eaf6;
  1173. color: black;
  1174. }
  1175. ::v-deep .el-form-item__label {
  1176. text-align: center;
  1177. }
  1178. ::v-deep .is-active {
  1179. color: #fff;
  1180. background-color: #0583cd;
  1181. }
  1182. ::v-deep .el-select {
  1183. width: 100%
  1184. }
  1185. ::v-deep .el-tabs__active-bar {
  1186. display: none;
  1187. }
  1188. ::v-deep .el-tabs__nav-wrap::after {
  1189. display: none !important;
  1190. }
  1191. .flex-form {
  1192. margin-top: 50px;
  1193. }
  1194. .flex-footer-botton {
  1195. display: flex;
  1196. justify-content: space-evenly;
  1197. }
  1198. </style>