tyshList.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263
  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="150px" 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="标题:" prop="needName">
  28. <el-input v-model="fromList.needName" :disabled="disabled"></el-input>
  29. </el-form-item>
  30. </div>
  31. <div class="flex-header">
  32. <el-form-item label="发起人:">
  33. <el-input v-model="fromList.proposer" 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="type">
  41. <el-select v-model="fromList.type" placeholder="请选择类别" size="medium" :disabled="disabled">
  42. <el-option v-for="item in typeoptions" :key="item.code" :label="item.name" :value="item.code" />
  43. </el-select>
  44. </el-form-item>
  45. </div>
  46. <div class="flex-header">
  47. <el-form-item label="是否中心主任审批:" prop="isCenterDirectorApprove">
  48. <el-radio v-model="fromList.isCenterDirectorApprove" label="1" :disabled="disabled">是</el-radio>
  49. <el-radio v-model="fromList.isCenterDirectorApprove" label="2" :disabled="disabled">否</el-radio>
  50. </el-form-item>
  51. <el-form-item label="中心主任:" v-if="fromList.isCenterDirectorApprove == 1" prop="centerDirector">
  52. <el-select v-model="fromList.centerDirector" placeholder="请选择中心主任" size="medium"
  53. :disabled="disabled">
  54. <el-option v-for="item in centerDirectoroptions" :key="item.loginNoStr"
  55. :label="item.loginNameStr" :value="item.loginNoStr" />
  56. </el-select>
  57. </el-form-item>
  58. </div>
  59. <div class="" style="margin: 1%; border-bottom: 1px solid #e1e1e1;">
  60. <el-form-item label="备注:" prop="remark">
  61. <el-input type="textarea" v-model="fromList.remark" maxlength="500" show-word-limit
  62. :disabled="disabled"></el-input>
  63. </el-form-item>
  64. </div>
  65. <div class="flex-load" style="display: flex; flex-direction: column">
  66. <el-form-item label="上传附件:" :disabled="disabled" prop="accessoryList">
  67. <my-upload v-if="!disabled" @uploadBack="uploadBack" @delloadBack="delloadBack"
  68. @clickDownload="download" :fileInfo="fileInfo" :fileList="fromList.accessoryList"
  69. style="width: 30% !important"></my-upload>
  70. <div v-if="fromList.taskName != '发起人填写'">
  71. <div v-for="(item, index) in fromList.accessoryList" :key="index">
  72. <span style="color: blue;cursor: pointer;" @click="downloadOne(item)">{{
  73. item.fileName
  74. }}</span>
  75. </div>
  76. </div>
  77. </el-form-item>
  78. </div>
  79. </el-form>
  80. <div v-if="dialoglablesStatus">
  81. <div class="table-title">流程追踪</div>
  82. <TableId :list="lables"></TableId>
  83. </div>
  84. </el-dialog>
  85. <div v-if="destroy">
  86. <el-dialog title="处理操作" width="100%" :visible.sync="handleStatus" :before-close="handleCloses" :modal="false"
  87. v-if="handleStatus" :destroy-on-close="true">
  88. <Workflow :list="fromList" v-if="isWorkflowStatus == true" @updateForm="updateForm"
  89. :requestForm="requestForm" :request_formTitle="request_form.title" />
  90. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="updateForm"
  91. :requestForm="requestForm" :request_formTitle="request_form.title" />
  92. <!-- 后期维护 -->
  93. </el-dialog>
  94. </div>
  95. </div>
  96. </template>
  97. <script>
  98. import Tabs from "../../../components/el-tabs";
  99. import Table from "../../../components/el-form";
  100. import TableId from "../../../components/el-formid";
  101. import Seach from "../../../components/el-search";
  102. import myUpload from "../../../components/workflowUpload";
  103. import Workflow from "../../../components/workflowBase";
  104. import WorkflowEntrance from "../../../components/workflowEntrance";
  105. import getConfig from '../../../config/dev.js'
  106. import {
  107. getTodoBase,
  108. getDoneBase,
  109. getInitiateBase,
  110. getNowdata,
  111. } from "../../../http/api.js";//../../../http/api.js
  112. import { log } from "console";
  113. export default {
  114. components: {
  115. Table,
  116. TableId,
  117. Tabs,
  118. myUpload,
  119. Workflow,
  120. Seach,
  121. WorkflowEntrance
  122. },
  123. data() {
  124. let _self = this
  125. return {
  126. loading: false,
  127. isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
  128. lastManList: [],
  129. rule: {
  130. type: [
  131. { required: true, message: "请选择类别", trigger: "change" },
  132. ],
  133. isCenterDirectorApprove: [
  134. { required: true, message: "请选择是否中心主任审批", trigger: "change" },
  135. ],
  136. centerDirector: [
  137. { required: true, message: "请选择中心主任", trigger: "change" },
  138. ],
  139. remark: [
  140. { required: true, message: "请添加备注", trigger: "blur" },
  141. ],
  142. needName: [
  143. { required: true, message: "请添加标题", trigger: "blur" },
  144. ],
  145. },
  146. typeoptions: [
  147. {
  148. name: '重要通知',
  149. code: '重要通知'
  150. },
  151. {
  152. name: '文档审核',
  153. code: '文档审核'
  154. },
  155. ],
  156. centerDirectoroptions: [
  157. ],
  158. form: {
  159. }, //表单数据
  160. fromList: {
  161. }, //表单数据
  162. fileInfo: {
  163. type: "bt1n",
  164. typename: "上传文件",
  165. // limit: 5,
  166. url: "/market/waf/uploadByMinio",
  167. fileList: [],
  168. },
  169. list: {},
  170. disabled: false,
  171. pageNo: 1,//页码
  172. destroy: false,//处理
  173. handleStatus: false,//处理
  174. tableName: "TYSH_process",
  175. request_form: {
  176. userId: "",
  177. userName: "",
  178. path: this.$router.currentRoute.name,
  179. userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
  180. // path:this.$roter.options.routers,
  181. // nextDealMan:'',
  182. title: "title",
  183. businessKey: "1",
  184. processDefinitionKey: "TYSH_process",//流程key
  185. },
  186. requestForm: {
  187. // fresourceId: "345a2955-b321-11ed-886f-d6cd97160e00", // 本地环境
  188. // fresourceId: "canvas", // 生产环境
  189. // fresourceId: "4a4153db-b33f-11ed-be6b-00505687dcd3", //测试91环境
  190. fresourceId: getConfig().tyshList,
  191. processDefinitionKey: "TYSH_process",
  192. },
  193. dialogStatus: false, //dialog显示
  194. dialoglablesStatus: true, //dialogL流程追踪显示
  195. clickTagNameTop: 'First',//头部tab
  196. clickTagName: 'first',
  197. dialogTitle: '',//dialogtit
  198. startStatus: false,//处理状态按钮
  199. closeStatus: false, //关闭按钮状态
  200. saveStatus: false, //保存按钮状态
  201. lables: {
  202. height: "400",
  203. titledata: [
  204. {
  205. label: "环节名称",
  206. prop: "taskName",
  207. width: 300,
  208. },
  209. {
  210. label: "处理人",
  211. prop: "assignee",
  212. width: 300,
  213. },
  214. {
  215. label: "到达时间",
  216. prop: "startTime",
  217. width: 300,
  218. },
  219. {
  220. label: "处理时间",
  221. prop: "endTime",
  222. width: 300,
  223. },
  224. {
  225. label: "回复意见",
  226. prop: "content",
  227. width: 300,
  228. },
  229. ], //表格头
  230. data: [], //内容数据
  231. loading: true,
  232. pageData: {
  233. total: 0, // 总条数
  234. pageSizes: 10, // 每页数量
  235. pageNum: 1, // 页码
  236. },
  237. isSelection: false, // 表格有多选时设置
  238. isOperation: false, // 表格有操作列时设置
  239. isIndex: true, // 列表序号
  240. operation: {
  241. // 表格有操作列时设置
  242. label: "操作", // 列名
  243. width: "50", // 根据实际情况给宽度
  244. data: [
  245. {
  246. label: "操作", // 操作名称
  247. type: "", //按钮类型
  248. handleRow: function () { }, // 自定义事件
  249. },
  250. ],
  251. },
  252. },
  253. tabListMain: [
  254. {
  255. index: "first",
  256. label: "我的待办",
  257. number: "",
  258. name: "prosss_key",
  259. },
  260. {
  261. index: "two",
  262. label: "我的已办",
  263. number: "",
  264. },
  265. {
  266. index: "three",
  267. label: "我发起的",
  268. number: "",
  269. },
  270. ],
  271. lableTable: {},//传给子组件table
  272. firstlabel: {
  273. height: "400",
  274. titledata: [
  275. {
  276. label: "标题",
  277. prop: "need_name",
  278. width: 400,
  279. },
  280. {
  281. label: "发起人姓名",
  282. prop: "proposer",
  283. width: 400,
  284. },
  285. {
  286. label: "发起时间",
  287. prop: "proposer_time",
  288. width: 400,
  289. },
  290. {
  291. label: "当前环节",
  292. prop: "taskName",
  293. width: 400,
  294. },
  295. ], //表格头
  296. data: [], //内容数据
  297. loading: true,
  298. pageData: {
  299. total: 10, // 总条数
  300. pageSizes: 10, // 每页数量
  301. pageNum: 1, // 页码
  302. },
  303. isSelection: false, // 表格有多选时设置
  304. isOperation: false, // 表格有操作列时设置
  305. isIndex: false, // 列表序号
  306. operation: {
  307. // 表格有操作列时设置
  308. label: "操作", // 列名
  309. width: "50", // 根据实际情况给宽度
  310. data: [
  311. {
  312. label: "操作", // 操作名称
  313. type: "", //按钮类型
  314. handleRow: function () { }, // 自定义事件
  315. },
  316. ],
  317. },
  318. },
  319. twolabel: {
  320. height: "400",
  321. titledata: [
  322. {
  323. label: "标题",
  324. prop: "need_name",
  325. width: 400,
  326. },
  327. {
  328. label: "发起人姓名",
  329. prop: "proposer",
  330. width: 400,
  331. },
  332. {
  333. label: "发起时间",
  334. prop: "proposer_time",
  335. width: 400,
  336. },
  337. {
  338. label: "当前环节",
  339. prop: "taskName",
  340. width: 400,
  341. },
  342. ], //表格头
  343. data: [], //内容数据
  344. loading: true,
  345. pageData: {
  346. total: 10, // 总条数
  347. pageSizes: 10, // 每页数量
  348. pageNum: 1, // 页码
  349. },
  350. isSelection: false, // 表格有多选时设置
  351. isOperation: false, // 表格有操作列时设置
  352. isIndex: false, // 列表序号
  353. operation: {
  354. // 表格有操作列时设置
  355. label: "操作", // 列名
  356. width: "50", // 根据实际情况给宽度
  357. data: [
  358. {
  359. label: "操作", // 操作名称
  360. type: "", //按钮类型
  361. handleRow: function () { }, // 自定义事件
  362. },
  363. ],
  364. },
  365. },
  366. threelabel: {
  367. height: "400",
  368. titledata: [
  369. {
  370. label: "标题",
  371. prop: "need_name",
  372. width: 400,
  373. },
  374. {
  375. label: "发起人姓名",
  376. prop: "proposer",
  377. width: 400,
  378. },
  379. {
  380. label: "发起时间",
  381. prop: "proposer_time",
  382. width: 400,
  383. },
  384. {
  385. label: "当前环节",
  386. prop: "taskName",
  387. width: 400,
  388. },
  389. {
  390. label: "当前处理人",
  391. prop: "currentMan",
  392. width: 400,
  393. },
  394. ], //表格头
  395. data: [], //内容数据
  396. loading: true,
  397. pageData: {
  398. total: 10, // 总条数
  399. pageSizes: 10, // 每页数量
  400. pageNum: 1, // 页码
  401. },
  402. isSelection: false, // 表格有多选时设置
  403. isOperation: false, // 表格有操作列时设置
  404. isIndex: false, // 列表序号
  405. operation: {
  406. // 表格有操作列时设置
  407. label: "操作", // 列名
  408. width: "50", // 根据实际情况给宽度
  409. data: [
  410. {
  411. label: "操作", // 操作名称
  412. type: "", //按钮类型
  413. handleRow: function () { }, // 自定义事件
  414. },
  415. ],
  416. },
  417. },
  418. filterData: {
  419. timeSelect: false, //是否显示日期控件
  420. sreach: true,
  421. restet: false,
  422. elinput: [
  423. {
  424. name: "材料名称", //提示语275
  425. key: "materialName", //字段名
  426. width: 275, //宽度
  427. },
  428. ],
  429. },
  430. savestatusBtn: false,
  431. }
  432. },
  433. methods: {
  434. clickNewTag(v) {
  435. this.$http({
  436. url: "/market/TyshProcess/getNeedNo",
  437. method: "post",
  438. headers: {
  439. "Content-Type": "application/json",
  440. },
  441. data: {},
  442. }).then((res) => {
  443. console.log(res);
  444. this.fromList = {
  445. needNo: res.data.body,
  446. proposer: JSON.parse(window.sessionStorage.getItem('userInfo')).loginName,
  447. proposerNo: JSON.parse(window.sessionStorage.getItem('userInfo')).loginNoStr,
  448. proposerTime: getNowdata({ a: '-', b: ' ', c: ':' }),
  449. }
  450. let accessoryList = [];
  451. accessoryList = v;
  452. this.$set(this.fromList, "accessoryList", accessoryList);
  453. });
  454. this.lables.data = []
  455. this.startStatus = true;
  456. this.saveStatus = true;
  457. this.closeStatus = true;
  458. this.dialogStatus = true;
  459. this.isWorkflowStatus = true;
  460. this.dialoglablesStatus = true
  461. this.dialogTitle = "新建工单";
  462. this.disabled = false;
  463. },
  464. //是否最后一个人
  465. async getLastName() {
  466. console.log(this.fromList);
  467. let list = {
  468. procinstid: this.fromList.processId,
  469. taskid: this.fromList.taskId,
  470. // taskId:e.taskId
  471. };
  472. let _this = this;
  473. let obj = {
  474. url: this.$url.formList.getLastName, //流程追踪接口
  475. data: list,
  476. // status: "form",
  477. headers: {
  478. "Content-Type": "application/json",
  479. },
  480. };
  481. let res = await this.common.httpPost(obj, success);
  482. function success(data) {
  483. _this.isWorkflowStatus = data.lastMan == false ? false : true;
  484. _this.lastManList = data;
  485. // console.log(_this.isWorkflowStatus);
  486. }
  487. },
  488. downloadOne(e) {
  489. let list = {
  490. id: e.fileCode,
  491. fileName: e.fileName,
  492. };
  493. this.$http({
  494. url: "/market/waf/downFileByMinio",
  495. method: "post",
  496. headers: {
  497. "Content-Type": "application/json",
  498. },
  499. responseType: "blob",
  500. data: list,
  501. }).then((response) => {
  502. console.log(response);
  503. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  504. let blob = new Blob([response.data], {
  505. type: "application/vnd.ms-excel",
  506. });
  507. //window.navigator.msSaveOrOpenBlob(blob, this.form.needName);
  508. window.navigator.msSaveOrOpenBlob(
  509. blob,
  510. list.fileName
  511. );
  512. } else {
  513. /* 火狐谷歌的文件下载方式 */
  514. var blob = new Blob([response.data]);
  515. var downloadElement = document.createElement("a");
  516. var href = window.URL.createObjectURL(blob);
  517. downloadElement.href = href;
  518. downloadElement.download =
  519. list.fileName;
  520. document.body.appendChild(downloadElement);
  521. downloadElement.click();
  522. document.body.removeChild(downloadElement);
  523. window.URL.revokeObjectURL(href);
  524. }
  525. });
  526. },
  527. download(e) {
  528. let list = {
  529. id: e.fileCode,
  530. fileName: e.name,
  531. };
  532. this.$http({
  533. url: "/market/waf/downFileByMinio",
  534. method: "post",
  535. headers: {
  536. "Content-Type": "application/json",
  537. },
  538. responseType: "blob",
  539. data: list,
  540. }).then((response) => {
  541. console.log(response);
  542. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  543. let blob = new Blob([response.data], {
  544. type: "application/vnd.ms-excel",
  545. });
  546. //window.navigator.msSaveOrOpenBlob(blob, this.form.needName);
  547. window.navigator.msSaveOrOpenBlob(
  548. blob,
  549. list.fileName
  550. );
  551. } else {
  552. /* 火狐谷歌的文件下载方式 */
  553. var blob = new Blob([response.data]);
  554. var downloadElement = document.createElement("a");
  555. var href = window.URL.createObjectURL(blob);
  556. downloadElement.href = href;
  557. downloadElement.download =
  558. list.fileName;
  559. document.body.appendChild(downloadElement);
  560. downloadElement.click();
  561. document.body.removeChild(downloadElement);
  562. window.URL.revokeObjectURL(href);
  563. }
  564. });
  565. },
  566. //上传文件钩子函数
  567. clickUpload(file) { },
  568. uploadBack(v) {
  569. if (this.fromList.accessoryList) {
  570. this.fromList.accessoryList = [];
  571. this.fromList.accessoryList = v;
  572. } else {
  573. let accessoryList = [];
  574. accessoryList = v;
  575. this.$set(this.fromList, "accessoryList", accessoryList);
  576. }
  577. },
  578. delloadBack(v) {
  579. this.fromList.accessoryList = v;
  580. // this.$http({
  581. // url: "/market/waf/update",
  582. // method: "post",
  583. // headers: {
  584. // "Content-Type": "application/json",
  585. // },
  586. // data: this.fromList,
  587. // }).then((res) => {
  588. // console.log(res);
  589. // // if (res.data.result === 0) {
  590. // // this.$message.success("工作流更新成功");
  591. // // }
  592. // });
  593. },
  594. //获取页码
  595. changeNum(e) {
  596. console.log(e)
  597. this.pageNo = e;
  598. if (this.clickTagName == 'first') {
  599. this.firstlabel.pageData.pageNum = e;
  600. this.getQueryList();
  601. }
  602. if (this.clickTagName == 'two') {
  603. this.twolabel.pageData.pageNum = e;
  604. this.getQueryDone();
  605. }
  606. if (this.clickTagName == 'three') {
  607. this.threelabel.pageData.pageNum = e;
  608. this.getMeLaunch()
  609. }
  610. },
  611. //获取页码
  612. changeSize(e) {
  613. console.log(11111);
  614. },
  615. //点击工单状态跳转需求流程显示页面
  616. clickDemand(e, res) {
  617. console.log(e);
  618. this.isWorkflowStatus = true
  619. console.log(res);
  620. if (e === "标题") {
  621. if (this.clickTagName === "three") {//发起
  622. console.log(res.taskName)
  623. this.dialogTitle = "查看";
  624. this.closeStatus = true;
  625. if (res.taskName == "发起人填写") {
  626. this.disabled = false;
  627. this.startStatus = true;
  628. this.saveStatus = true;
  629. this.dialoglablesStatus = true
  630. } else {
  631. this.disabled = true;
  632. this.startStatus = false;
  633. this.saveStatus = false;
  634. this.dialoglablesStatus = true
  635. }
  636. }
  637. if (this.clickTagName === "first") {//代办
  638. this.dialogTitle = "处理";
  639. if (res.taskName == "发起人填写") {
  640. this.savestatusBtn = false
  641. this.disabled = false;
  642. this.startStatus = true;
  643. this.saveStatus = true;
  644. this.closeStatus = true;
  645. this.dialoglablesStatus = true
  646. } else {
  647. this.savestatusBtn = true
  648. this.disabled = true;
  649. this.closeStatus = true;
  650. this.startStatus = true;
  651. this.saveStatus = false;
  652. this.dialoglablesStatus = true
  653. }
  654. }
  655. if (this.clickTagName === "two") {//已办
  656. this.dialogTitle = "查看";
  657. this.closeStatus = true;
  658. this.startStatus = false;
  659. this.saveStatus = false;
  660. this.disabled = true;
  661. this.dialoglablesStatus = true
  662. }
  663. this.dialogStatus = true
  664. this.fromList = res;
  665. this.clickForm(res);
  666. this.getFromQuery(res);
  667. }
  668. },
  669. //查询form表单数据
  670. getFromQuery(e) {
  671. this.$http({
  672. url: "/market/TyshProcess/query",
  673. method: "post",
  674. headers: {
  675. "Content-Type": "application/json",
  676. },
  677. data: { id: e.id },
  678. }).then((res) => {
  679. this.fromList = res.data;
  680. this.dialogStatus = true;
  681. this.fromList.taskId = e.taskId
  682. this.fromList.taskName = e.taskName
  683. this.fromList.createId = e.createId
  684. if (this.fromList.accessoryList) {
  685. this.fromList.accessoryList.map((item) => {
  686. item.name = item.fileName;
  687. })
  688. }
  689. this.fromList.resourceId = e.resourceId
  690. });
  691. },
  692. async clickForm(e) {
  693. let list = {
  694. processInstanceId: e.process_id,
  695. // taskId:e.taskId
  696. };
  697. let _this = this;
  698. let obj = {
  699. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  700. data: list,
  701. headers: {
  702. "Content-Type": "application/json",
  703. },
  704. };
  705. let res = await this.common.httpPost(obj, success);
  706. function success(data) {
  707. console.log('[ 接口返回值第一曾 ] >', data)
  708. let list = [];
  709. list = data.data.data;
  710. if (data.data.lastmandata.length != 0) {
  711. data.data.lastmandata.map((item, index) => {
  712. item.id = index + 22;
  713. });
  714. }
  715. list.map((item, index) => {
  716. item.startTime = _this.$util.datetimeFormat(item.startTime);
  717. item.endTime = _this.$util.datetimeFormat(item.endTime);
  718. item.id = index + 1;
  719. item.children = [];
  720. if (data.data.lastmandata.length != 0) {
  721. let indexs = data.data.lastmandata.findIndex((items) => {
  722. if (items.taskId == item.taskId) {
  723. item.children.push(items);
  724. }
  725. });
  726. }
  727. });
  728. console.log(list);
  729. _this.lables.data = list;
  730. console.log("[ _this.lables.data ] >", _this.lables.data);
  731. _this.abc = true;
  732. }
  733. },
  734. handleClose() {//关闭弹窗
  735. this.dialogStatus = false;
  736. this.fromList = {};
  737. },
  738. async clickSave() {
  739. this.$refs.form.validate((valid) => {
  740. if (valid) {
  741. console.log(this.$refs.form.model)
  742. this.savestatusBtn = true
  743. if (this.fromList.id) {
  744. this.fromList.accessoryIdList = []
  745. console.log(this.fromList.accessoryList);
  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/TyshProcess/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/TyshProcess/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, "", e || { 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. //00440063000000000000
  1037. this.$http({
  1038. url: "/sysmgr/sysuserinfo/queryListByName",
  1039. method: "post",
  1040. headers: {
  1041. "Content-Type": "application/json",
  1042. },
  1043. data: {
  1044. groupId: '00440063000000000000'
  1045. }
  1046. }).then((res) => {
  1047. this.centerDirectoroptions = res.data;
  1048. });
  1049. let status = JSON.stringify(this.$route.query) == "{}";
  1050. if (status) {
  1051. this.lableTable = this.firstlabel
  1052. this.getQueryList()
  1053. this.usernumber()
  1054. } else {
  1055. let { id, type } = this.$route.query;
  1056. let list = {
  1057. taskId: id,
  1058. tableName: this.tableName
  1059. };
  1060. this.usernumber()
  1061. this.lableTable = this.firstlabel
  1062. this.getQueryList(list, 0);//代办
  1063. }
  1064. }
  1065. }
  1066. </script>
  1067. <style lang="scss" scoped>
  1068. .copyClass {
  1069. display: flex;
  1070. }
  1071. .flex-header-text-tree {
  1072. width: 50%;
  1073. text-align: center;
  1074. }
  1075. ::v-deep .el-form-item {
  1076. width: 100%;
  1077. }
  1078. .active {
  1079. background-color: #f3faff;
  1080. }
  1081. .flex-common {
  1082. padding: 10px 5%;
  1083. font-size: 18px;
  1084. }
  1085. .flex-buttons {
  1086. background-color: #cde4f6;
  1087. border-color: #cde4f6;
  1088. color: #606266;
  1089. }
  1090. .flex-button {
  1091. margin-top: 10px;
  1092. margin-bottom: 10px;
  1093. ::v-deep .el-button--primary {
  1094. width: 222px;
  1095. }
  1096. }
  1097. .flex-left-header-text {
  1098. height: 40px;
  1099. line-height: 40px;
  1100. color: black;
  1101. padding-left: 10px;
  1102. background-color: #cde4f6;
  1103. font-size: 18px;
  1104. font-weight: bold;
  1105. }
  1106. .flex-right-text {
  1107. margin-right: 20px;
  1108. width: 50%;
  1109. }
  1110. .flex-handle {
  1111. width: 100%;
  1112. padding: 30px;
  1113. display: flex;
  1114. .flex-right {
  1115. width: 50%;
  1116. border: 1px solid #e1e1e1;
  1117. margin-left: 20px;
  1118. }
  1119. .flex-left {
  1120. width: 50%;
  1121. display: flex;
  1122. flex-direction: column;
  1123. .flex-left-header {
  1124. display: flex;
  1125. justify-content: space-around;
  1126. }
  1127. }
  1128. }
  1129. .table-title {
  1130. height: 50px;
  1131. line-height: 50px;
  1132. background-color: #f3faff;
  1133. font-size: 18px;
  1134. font-weight: bold;
  1135. }
  1136. ::v-deep .el-dialog {
  1137. margin-top: 0 !important;
  1138. }
  1139. ::v-deep .el-table__fixed-body-wrapper {
  1140. top: 50px !important;
  1141. }
  1142. .flex-box {
  1143. display: flex;
  1144. width: calc(100% - 40px);
  1145. border-radius: 20px;
  1146. background-color: #fff;
  1147. margin: 0 auto;
  1148. margin-top: 20px;
  1149. position: relative;
  1150. flex-direction: column;
  1151. .flex-load {
  1152. display: flex;
  1153. width: 100%;
  1154. position: relative;
  1155. margin: 1%;
  1156. border-bottom: 1px solid #e1e1e1;
  1157. justify-content: space-between;
  1158. }
  1159. .flex-header {
  1160. display: flex;
  1161. // width: 100%;
  1162. position: relative;
  1163. // height: 60px;
  1164. margin: 1%;
  1165. border-bottom: 1px solid #e1e1e1;
  1166. justify-content: space-between;
  1167. // ::v-deep .el-form-item {
  1168. // width: 30%;
  1169. // margin-right: 5%;
  1170. // }
  1171. .el-button {
  1172. width: 150px;
  1173. float: right;
  1174. height: 40px !important;
  1175. margin-right: 30px;
  1176. }
  1177. }
  1178. }
  1179. //设置子组件样式
  1180. ::v-deep .el-tabs__item {
  1181. padding: 0;
  1182. margin-right: 20px;
  1183. width: 166px;
  1184. text-align: center;
  1185. background-color: #d8eaf6;
  1186. color: black;
  1187. }
  1188. ::v-deep .is-active {
  1189. color: #fff;
  1190. background-color: #0583cd;
  1191. }
  1192. ::v-deep .el-form-item__label {
  1193. text-align: center;
  1194. }
  1195. ::v-deep .el-select {
  1196. width: 100%
  1197. }
  1198. ::v-deep .el-tabs__active-bar {
  1199. display: none;
  1200. }
  1201. ::v-deep .el-tabs__nav-wrap::after {
  1202. display: none !important;
  1203. }
  1204. .flex-form {
  1205. margin-top: 50px;
  1206. }
  1207. .flex-footer-botton {
  1208. display: flex;
  1209. justify-content: space-evenly;
  1210. }
  1211. </style>