resourceApply.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149
  1. <template>
  2. <div class="container">
  3. <div class="titbox">
  4. <div class="titbox-flex">
  5. <eltabs :tabList="tabList" @status="clickTabs"></eltabs>
  6. <el-button type="primary" @click="newMake()" style="width: 150px; height: 40px; margin: 10px 15px 0 0"
  7. v-if="editstatus">+新建</el-button>
  8. </div>
  9. <tableList :list="Table" ref="TableList" @clickDemand="clickDemand" @changeNum="changeNum"></tableList>
  10. <el-dialog :title="dialogTitle + '工单'" :visible.sync="dialogVisible" v-if="dialogVisible"
  11. :before-close="handleClose" width="100%" height="500vh" class="dialogClass" top="0" :modal="false"
  12. :modal-append-to-body="true">
  13. <span class="dialog-body">
  14. <div class="flex-title">系统资源申请</div>
  15. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
  16. <!--dialogVisible1 = true -->
  17. <el-form-item style="position: fixed; top: 70px; left: -60px; z-index: 1000">
  18. <el-button type="primary" @click="newFormgong" v-if="baocun">保存</el-button>
  19. <el-button type="primary" v-if="deal" @click="dealwith()">处理</el-button>
  20. <el-button type="primary" @click="close()">关闭</el-button>
  21. <!-- <el-button type="primary" @click="submitForm()" v-if = "baocun">保存</el-button> -->
  22. </el-form-item>
  23. <div class="flex-header">
  24. <el-form-item label="文件标题" prop="needName" style="width: 33%">
  25. <el-input v-model="ruleForm.needName" :disabled="isdisabled"></el-input>
  26. </el-form-item>
  27. <el-form-item label="发起人" prop="proposer" style="width: 33%">
  28. <el-input v-model="ruleForm.proposer" disabled></el-input>
  29. </el-form-item>
  30. <el-form-item label="工单流水号" prop="workOrderNo" style="width: 33%">
  31. <el-input v-model="ruleForm.workOrderNo" disabled></el-input>
  32. </el-form-item>
  33. </div>
  34. <div class="flex-header">
  35. <el-form-item label="申请类别" style="width: 31.5%;" prop="proposerType">
  36. <el-select v-model="ruleForm.proposerType" placeholder="请选择" @change="changeSelect"
  37. :disabled="isdisabled">
  38. <el-option label="主机" value="主机"></el-option>
  39. <el-option label="数据库" value="数据库"></el-option>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item prop="dealMan" label="处理部门接收人" style="width:34.5%" label-width="121px">
  43. <el-select v-model="ruleForm.dealMan" placeholder="请选择" :disabled="isdisabled">
  44. <el-option v-for="(item, index) in optionList" :label="item.name" :value="item.name"
  45. :key="index"></el-option>
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="发起时间" prop="proposerTime" style="width: 33%">
  49. <el-input v-model="ruleForm.proposerTime" disabled></el-input>
  50. </el-form-item>
  51. </div>
  52. <!-- @change="changeDeptValue" -->
  53. <div class="flex-header-input">
  54. <el-form-item label="申请内容:" label-width="92px" prop="proposerContent" style="width: 100%">
  55. <el-input type="textarea" :rows="2" v-model="ruleForm.proposerContent" id="input1"
  56. :disabled="isdisabled"></el-input>
  57. </el-form-item>
  58. </div>
  59. <!-- -->
  60. <div class="flex-header-upload flex-upload" style="display: flex; flex-direction: column">
  61. <el-form-item label="附件:" prop="mkFileShareAttachList" label-width="68px">
  62. <my-upload @uploadBack="uploadBack" @clickDownload="download" :disabled="updisabled" :fileInfo="fileInfo"
  63. :fileList="fileInfo.fileList" ref="myupload" style="width: 15% ; heigth: 120% !important">
  64. </my-upload>
  65. </el-form-item>
  66. </div>
  67. </el-form>
  68. <div class="table-title">
  69. <h2>流程追踪</h2>
  70. </div>
  71. <div class="flex-header-process">
  72. <!-- <tableList :list="processTable" ref="el-form" @clickDemand = "clickDemand"></tableList> -->
  73. <el-table :data="tableData" row-key="id" :header-cell-style="{ textAlign: 'center' }"
  74. :cell-style="{ textAlign: 'center' }" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
  75. style="width: 100%" max-height="350">
  76. <el-table-column type="index" label="序号" width="50">
  77. </el-table-column>
  78. <el-table-column prop="taskName" label="环节名称" width="280" class="is-center">
  79. </el-table-column>
  80. <el-table-column prop="assignee" label="处理人" width="280">
  81. </el-table-column>
  82. <el-table-column prop="startTime" label="到达时间" width="280">
  83. </el-table-column>
  84. <el-table-column prop="endTime" label="处理时间" width="280">
  85. </el-table-column>
  86. <el-table-column prop="content" label="回复意见" width="280">
  87. </el-table-column>
  88. </el-table>
  89. </div>
  90. </span>
  91. </el-dialog>
  92. </div>
  93. <div class="containtbox">
  94. <el-dialog title="处理操作" :visible.sync="dialogVisible1" v-if="dialogVisible1" :before-close="handleCloses"
  95. width="100%" height="100vh" class="dialogClass" top="0" :modal="false" :modal-append-to-body="true"
  96. :destroy-on-close="true">
  97. <!-- -->
  98. <!-- <Workflow :list="ruleForm" :requestForm="requestForm" @dialogVisible1 = "Visible1"/> -->
  99. <Workflow :list="ruleForm" @updateForm="updateForm" :requestForm="requestForm" :request_formTitle="request_form.title"/>
  100. <!-- @dialogVisible1 = "Visible1" -->
  101. <!-- <WorkflowEntrance
  102. :list="ruleForm"
  103. v-else
  104. :lastManList="lastManList"
  105. @beforeClose = "beforeClose"
  106. :requestForm="requestForm"
  107. /> -->
  108. <span slot="footer" class="dialog-footer">
  109. </span>
  110. </el-dialog>
  111. </div>
  112. </div>
  113. </template>
  114. <script>
  115. import eltabs from "../../../components/el-tabs";
  116. import tableList from "../../../components/el-form";
  117. import myUpload from "../../../components/uploadfour";
  118. import Workflow from "../../../components/workflowBase";
  119. // import Workflow from "../../../components/workflow";
  120. import WorkflowEntrance from "../../../components/workflowEntrance";
  121. import getConfig from '../../../config/dev.js'
  122. import {
  123. getTodoBase,
  124. getDoneBase,
  125. getInitiateBase,
  126. } from "../../../http/api.js";
  127. export default {
  128. components: {
  129. eltabs,
  130. tableList,
  131. myUpload,
  132. Workflow,
  133. WorkflowEntrance,
  134. },
  135. data() {
  136. return {
  137. editstatus: true,
  138. dialogVisible: false,
  139. deal: true,
  140. baocun: true,
  141. isdisabled: false,
  142. xiaohu: false,
  143. dialogVisible1: false,
  144. updisabled: false,
  145. xinzeng: true,
  146. shanchu: true,
  147. isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
  148. childname: 'first',
  149. dialogTitle: "",
  150. page: "1",
  151. currentPage: "1", //当前页数
  152. pageSize: "10", //每页显示十条
  153. fileInfo: {
  154. type: "bt1n",
  155. typename: "上传文件",
  156. limit: 50,
  157. url: "/market/waf/uploadByMinio",
  158. fileList: [],
  159. },
  160. tableData: [],
  161. optionList: [],
  162. mkFileShareAttachList: [],
  163. requestForm: {
  164. // fresourceId: "569ffe50-b25a-11ed-886f-d6cd97160e00",
  165. // fresourceId: "1f6a7842-b25c-11ed-be6b-00505687dcd3",//91
  166. fresourceId: getConfig().resourceApply,
  167. processDefinitionKey: "ZYSQ_process",
  168. taskId: "",
  169. },
  170. request_form: {
  171. userId: "",
  172. userName: "",
  173. path: this.$router.currentRoute.name,
  174. userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
  175. title: "",
  176. businessKey: "",
  177. processDefinitionKey: "ZYSQ_process",
  178. },
  179. lastManList: [],
  180. fufujian: [],
  181. fuback: [],
  182. ruleForm: {
  183. // domains: [{
  184. // value: ''
  185. // }],
  186. // attId:[],
  187. // bsAccount: [],
  188. // bsAmount: [],
  189. // tzOutNo: [],
  190. // tzInNo: [],
  191. },
  192. tabList: [
  193. {
  194. index: "first",
  195. label: "我的待办",
  196. number: "",
  197. name: "prosss_key",
  198. },
  199. {
  200. index: "two",
  201. label: "我的已办",
  202. number: "",
  203. },
  204. {
  205. index: "three",
  206. label: "我发起的",
  207. number: "",
  208. },
  209. ],
  210. Table: {},
  211. firstTable: {
  212. name: "first",
  213. height: "500",
  214. titledata: [
  215. {
  216. label: "文件标题",
  217. prop: "need_name",
  218. width: 310,
  219. },
  220. {
  221. label: "发起人",
  222. prop: "proposer",
  223. width: 310,
  224. },
  225. {
  226. label: "发起时间",
  227. prop: "proposer_time",
  228. width: 310,
  229. },
  230. {
  231. label: "当前环节",
  232. prop: "taskName",
  233. width: 310,
  234. },
  235. ], //表格头
  236. data: [
  237. {
  238. label: "文件标题", // 操作名
  239. handleRow: (e, r, o) => {
  240. this.operationZuo(r);
  241. }
  242. }
  243. ], //内容数据
  244. loading: true,
  245. pageData: {
  246. total: 100, // 总条数
  247. pageSize: 10, // 每页数量
  248. pageNum: 1, // 页码
  249. },
  250. isSelection: false, // 表格有多选时设置
  251. isOperation: false, // 表格有操作列时设置
  252. isIndex: false, // 列表序号
  253. operation: {
  254. // 表格有操作列时设置
  255. label: "操作", // 列名
  256. width: "50", // 根据实际情况给宽度
  257. data: [],
  258. },
  259. },
  260. twoTable: {
  261. name: "two",
  262. titledata: [
  263. {
  264. label: "文件标题",
  265. prop: "need_name",
  266. width: 310,
  267. },
  268. {
  269. label: "发起人",
  270. prop: "proposer",
  271. width: 310,
  272. },
  273. {
  274. label: "发起时间",
  275. prop: "proposer_time",
  276. width: 310,
  277. },
  278. {
  279. label: "当前环节",
  280. prop: "taskName",
  281. width: 310,
  282. },
  283. ],
  284. data: [], //内容数据
  285. loading: true,
  286. pageData: {
  287. total: 100, // 总条数
  288. pageSize: 10, // 每页数量
  289. pageNum: 1, // 页码
  290. },
  291. isSelection: false,
  292. },
  293. threeTable: {
  294. name: "three",
  295. titledata: [
  296. {
  297. label: "文件标题",
  298. prop: "need_name",
  299. width: 250,
  300. },
  301. {
  302. label: "发起人",
  303. prop: "proposer",
  304. width: 250,
  305. },
  306. {
  307. label: "发起时间",
  308. prop: "proposer_time",
  309. width: 300,
  310. },
  311. {
  312. label: "当前环节",
  313. prop: "taskName",
  314. width: 250,
  315. },
  316. {
  317. label: "当前处理人",
  318. prop: "currentMan",
  319. width: 250,
  320. },
  321. ],
  322. data: [], //内容数据
  323. loading: true,
  324. pageData: {
  325. total: 100, // 总条数
  326. pageSize: 10, // 每页数量
  327. pageNum: 1, // 页码
  328. },
  329. isSelection: false,
  330. },
  331. rules: {
  332. needName: [{ required: true, message: "请输入文件标题", trigger: "blur" },],
  333. proposer: [{ required: true, message: "请输入发起人", trigger: "blur" }],
  334. workOrderNo: [{ required: true, message: "请输入文件流水号", trigger: "blur" }],
  335. proposerType: [{ required: true, message: "请选择申请类别", trigger: "change" }],
  336. dealMan: [{ required: true, message: "请选择处理部门接收人", trigger: "change" }],
  337. proposerTime: [{ required: true, message: "请输入拟稿时间", trigger: "blur" }],
  338. proposerContent: [{ required: true, message: "请输入申请内容", trigger: "blur" }],
  339. },
  340. };
  341. },
  342. watch: {
  343. "ruleForm.taskName1": {
  344. handler(e) {
  345. if (e != "填写资源申请单") {
  346. this.disshan = true;
  347. this.disxin = true;
  348. } else {
  349. }
  350. }
  351. },
  352. },
  353. methods: {
  354. download(u) {
  355. // if (this.ruleForm.wfFileShareAttachList.length > 1) {
  356. this.$http({
  357. url: "/market/waf/downAllFileByMinio",
  358. method: "post",
  359. headers: {
  360. "Content-Type": "application/json",
  361. },
  362. responseType: "blob",
  363. data: { wfFileShareAttachList: this.fileInfo.fileList },
  364. }).then((response) => {
  365. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  366. let blob = new Blob([response.data], {
  367. type: "application/vnd.ms-excel",
  368. });
  369. window.navigator.msSaveOrOpenBlob(
  370. blob,
  371. new Date().getTime().toString() + ".zip"
  372. );
  373. } else {
  374. /* 火狐谷歌的文件下载方式 */
  375. var blob = new Blob([response.data]);
  376. var downloadElement = document.createElement("a");
  377. var href = window.URL.createObjectURL(blob);
  378. downloadElement.href = href;
  379. // downloadElement.download = this.ruleForm.fileName + ".zip";
  380. downloadElement.download = "附件.zip";
  381. document.body.appendChild(downloadElement);
  382. downloadElement.click();
  383. document.body.removeChild(downloadElement);
  384. window.URL.revokeObjectURL(href);
  385. }
  386. if (this.infolist.authType === "3") {
  387. this.dialogCli(10);
  388. }
  389. });
  390. },
  391. handleClose() {
  392. this.ruleForm = {};
  393. this.backlogTodo();
  394. this.haveDone();
  395. this.iniTiate();
  396. this.getneedNo();
  397. this.dialogVisible = false;
  398. this.tableData = [];
  399. this.fileInfo.fileList = [];
  400. },
  401. handleCloses() {
  402. this.treeList = [];
  403. this.textarea = "";
  404. this.dialogVisible1 = false;
  405. },
  406. clickTabs(name) {
  407. this.$refs.TableList.page = 1;
  408. this.childname = name;
  409. this.page = 1;
  410. this.baocun = false;
  411. if (name == "first") {
  412. this.Table = this.firstTable;
  413. this.backlogTodo();
  414. this.deal = true;
  415. this.baocun = false;
  416. this.editstatus = true;
  417. } else {
  418. this.editstatus = false;
  419. }
  420. if (name == "two") {
  421. this.Table = this.twoTable;
  422. this.haveDone();
  423. this.deal = false;
  424. this.baocun = false;
  425. }
  426. if (name == "three") {
  427. this.Table = this.threeTable;
  428. this.iniTiate();
  429. this.baocun = false;
  430. }
  431. },
  432. clickDemand(e, r) {
  433. if (e === "文件标题") {
  434. if (this.childname == "first") {
  435. if (r.taskName == "填写资源申请单") {
  436. this.isdisabled = false;
  437. this.deal = true;
  438. this.baocun = true;
  439. this.shanchu = true;
  440. this.xinzeng = true;
  441. } else {
  442. this.isdisabled = true;
  443. this.deal = true;
  444. this.baocun = false;
  445. this.shanchu = false;
  446. this.xinzeng = false;
  447. }
  448. }
  449. if (this.childname == "two") {
  450. this.isdisabled = true;
  451. this.deal = false;
  452. this.baocun = false;
  453. this.shanchu = false;
  454. this.xinzeng = false;
  455. }
  456. if (this.childname == "three") {
  457. this.shanchu = false;
  458. this.xinzeng = false;
  459. this.isdisabled = true;
  460. if (r.taskName == "填写资源申请单") {
  461. this.isdisabled = false;
  462. this.deal = true;
  463. this.baocun = true;
  464. } else {
  465. this.deal = false;
  466. this.baocun = false;
  467. }
  468. }
  469. this.operationZuo(r);
  470. this.clickForm(r);
  471. }
  472. },
  473. operationZuo(r) {
  474. let list = {}
  475. list.id = r.id,
  476. this.$http({
  477. url: "/market/zysqProcess/query",
  478. method: "post",
  479. headers: {
  480. "Content-Type": "application/json",
  481. },
  482. data: list,
  483. }).then((res) => {
  484. this.dialogTitle = "查看";
  485. this.dialogVisible = true;
  486. this.ruleForm = res.data;
  487. this.ruleForm.taskId = r.taskId;
  488. this.ruleForm.resourceId = r.resourceId;
  489. this.ruleForm.createId = r.createId;
  490. this.ruleForm.taskName1 = r.taskName;
  491. this.fileInfo.fileList = res.data.mkFileShareAttachList;
  492. if (r.taskName == "填写资源申请单") {
  493. this.ruleForm.tableName1 = "填写资源申请单"
  494. } else {
  495. this.baocun = false;
  496. }
  497. if (r.taskName != "填写资源申请单") {
  498. this.updisabled = true;
  499. } else {
  500. this.updisabled = false;
  501. }
  502. this.handleCloses();
  503. });
  504. },
  505. changeNum(val) {
  506. this.page = val;
  507. switch (this.childname) {
  508. case "first":
  509. this.backlogTodo();
  510. // this.iniTiate();
  511. break;
  512. case "two":
  513. this.haveDone();
  514. break;
  515. case "three":
  516. this.iniTiate();
  517. // this.Table = this.thirdTable;
  518. }
  519. },
  520. uploadBack(u) {
  521. this.attList = u;
  522. },
  523. close() {
  524. this.handleClose();
  525. },
  526. newMake() {
  527. this.dialogTitle = "新建";
  528. this.baocun = true;
  529. this.dialogVisible = true;
  530. // this.ruleForm = {}
  531. this.isdisabled = false;
  532. this.getUser();
  533. this.time();
  534. },
  535. getUser() {
  536. this.userInfo = JSON.parse(window.sessionStorage.userInfo);
  537. // this.ruleForm.docId = this.userInfo.loginNo;
  538. this.ruleForm.proposer = this.userInfo.loginName;
  539. },
  540. time() {
  541. // this.ruleForm.createTime = this.formatDateTime;
  542. this.ruleForm.proposerTime = this.$formatDate(new Date(), "YYYY-MM-DD");
  543. // this.ruleForm.docId = this.$formatDate(new Date(), "YYYYMMDDHHmmss");
  544. },
  545. changeSelect(e) { },
  546. newFormgong() {
  547. this.submitForm();
  548. },
  549. submitForm(formName) {
  550. this.$refs.ruleForm.validate((valid) => {
  551. if (valid) {
  552. this.$message.success("保存成功");
  553. this.getUserIds();
  554. // this.iniTiate();
  555. // this.newForm();
  556. // if(this.ruleForm.tableName1 == "填写资源申请单" || this.ruleForm.id){
  557. // this.newUpdate();
  558. // }else{
  559. // this.newForm();
  560. // }
  561. } else {
  562. this.$message.error("请完善表单信息");
  563. return false;
  564. }
  565. });
  566. },
  567. newForm() {
  568. // for(let i = 0; i<this.fuback.length; i++){
  569. // this.ruleForm.attId.push(this.fuback[i].id);
  570. // }
  571. this.ruleForm.mkFileShareAttachList = this.attList;
  572. this.$http({
  573. url: "/market/zysqProcess/add",
  574. method: "post",
  575. headers: {
  576. "Content-Type": "application/json",
  577. },
  578. data: this.ruleForm,
  579. }).then((res) => {
  580. this.ruleForm.id = res.data.body;
  581. this.request_form.businessKey = res.data.body;
  582. this.request_form.title = '[IT工作台]-' + '系统资源申请-' + this.$refs.ruleForm.model.needName;
  583. this.clickHandle(this.ruleForm);
  584. if (res.data.body == null) {
  585. this.$message.error("请先点保存");
  586. }
  587. });
  588. },
  589. newUpdate() {
  590. // for(let i = 0; i<this.fuback.length; i++){
  591. // this.ruleForm.attId.push(this.fuback[i].id);
  592. // }
  593. if (this.attList == null) {
  594. this.ruleForm.mkFileShareAttachList = this.fileInfo.fileList
  595. } else {
  596. this.ruleForm.mkFileShareAttachList = this.attList;
  597. }
  598. this.request_form.title = '[IT工作台]-' + '系统资源申请-' + this.$refs.ruleForm.model.needName;
  599. this.$http({
  600. url: "/market/zysqProcess/update",
  601. method: "post",
  602. headers: {
  603. "Content-Type": "application/json",
  604. },
  605. data: this.ruleForm,
  606. }).then((res) => {
  607. });
  608. },
  609. //获取userID
  610. getUserIds() {
  611. let id = JSON.parse(window.sessionStorage.userInfo).loginNo
  612. this.$http({
  613. url: "/market//api/user/info/queryNodePers?params=" + id,
  614. method: "post",
  615. headers: {
  616. "Content-Type": "application/json",
  617. },
  618. data: {
  619. // params: JSON.parse(window.sessionStorage.userInfo).loginNo,
  620. },
  621. }).then((res) => {
  622. this.request_form.userName = res.data[0].children[0].loginNameStr;
  623. this.request_form.userId = res.data[0].children[0].loginNoStr;
  624. this.request_form.title = '[IT工作台]-' + '系统资源申请-' + this.$refs.ruleForm.model.needName;
  625. if (this.ruleForm.tableName1 == "填写资源申请单" || this.ruleForm.id) {
  626. this.newUpdate();
  627. } else {
  628. this.newForm();
  629. }
  630. });
  631. },
  632. async clickHandle(e) {
  633. let _this = this;
  634. let obj = {
  635. url: this.$url.formList.startWork, //开始工作流接口
  636. data: _this.request_form,
  637. status: "form",
  638. headers: {
  639. "Content-Type": "application/x-www-form-urlencoded",
  640. },
  641. };
  642. let res = await this.common.httpPost(obj, success);
  643. function success(data) {
  644. //         _this.ruleForm.taskId = _this.ruleForm.taskId;
  645. // a = a
  646. //         _this.taskId = data.data;
  647. _this.ruleForm.processId = data.data;
  648. let list = {
  649. id: e.id,
  650. // taskId:_this.formId,
  651. processId: data.data,
  652. tableName: _this.requestForm.processDefinitionKey,
  653. // resourceId: _this.nextPath.currentShape[0].resourceId,
  654. };
  655. _this.setUpdate(list);
  656. }
  657. },
  658. //更新工作流接口
  659. setUpdate(e) {
  660. this.$http({
  661. url: "/market/waf/updateBase",
  662. method: "post",
  663. headers: {
  664. "Content-Type": "application/json",
  665. },
  666. data: e,
  667. }).then((res) => {
  668. this.ruleForm.taskId = res.data.body[0].taskId;
  669. });
  670. },
  671. async clickForm(r) {
  672. let list = {
  673. processInstanceId: r.process_id,
  674. // taskId:e.taskId
  675. };
  676. let _this = this;
  677. let obj = {
  678. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  679. data: list,
  680. headers: {
  681. "Content-Type": "application/json",
  682. },
  683. };
  684. let res = await this.common.httpPost(obj, success);
  685. function success(data) {
  686. _this.tableData = data.data.data;
  687. data.data.data.map((item) => {
  688. item.startTime = _this.$util.datetimeFormat(item.startTime);
  689. item.endTime = _this.$util.datetimeFormat(item.endTime);
  690. });
  691. // _this.getProcess(e, data.data);
  692. _this.tableData = data.data.data;
  693. }
  694. },
  695. // async clickForm(r) {
  696. // let list = {
  697. // processInstanceId: r.process_id,
  698. // // taskId:e.taskId
  699. // };
  700. // let _this = this;
  701. // let obj = {
  702. // url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  703. // data: list,
  704. // headers: {
  705. // "Content-Type": "application/json",
  706. // },
  707. // };
  708. // let res = await this.common.httpPost(obj, success);
  709. // function success(data) {
  710. // console.log('[ 接口返回值第一曾 ] >', data)
  711. // let list = [];
  712. // list = data.data.data;
  713. // // list.map((item,index) => {
  714. // // item.startTime = _this.$util.datetimeFormat(item.startTime);
  715. // // item.endTime = _this.$util.datetimeFormat(item.endTime);
  716. // // item.id = index + 1;
  717. // // if (item.traceList) {
  718. // // if (item.traceList.length > 0) {
  719. // // item.children = item.traceList;
  720. // // }
  721. // // }
  722. // // });
  723. // // console.log(list);
  724. // if (data.data.lastmandata.length != 0) {
  725. // data.data.lastmandata.map((item, index) => {
  726. // item.id = index + 22;
  727. // });
  728. // }
  729. // list.map((item, index) => {
  730. // item.startTime = _this.$util.datetimeFormat(item.startTime);
  731. // item.endTime = _this.$util.datetimeFormat(item.endTime);
  732. // item.id = index + 1;
  733. // item.children = [];
  734. // if (data.data.lastmandata.length != 0) {
  735. // let indexs = data.data.lastmandata.findIndex((items) => {
  736. // if (items.taskId == item.taskId) {
  737. // item.children.push(items);
  738. // }
  739. // });
  740. // }
  741. // console.log(item.children);
  742. // });
  743. // console.log(list);
  744. // // _this.lables.data = list;
  745. // _this.tableData = list;
  746. // // console.log("[ _this.lables.data ] >", _this.lables.data);
  747. // // _this.abc = true;
  748. // }
  749. // },
  750. //处理按钮,开始工作流接口
  751. dealwith() {
  752. if (this.ruleForm.id) {
  753. this.dialogVisible1 = true;
  754. this.request_form.title = '[IT工作台]-' + '系统资源申请-' + this.$refs.ruleForm.model.needName;
  755. } else {
  756. this.$message.error("请先点保存按钮");
  757. }
  758. },
  759. //需求编号
  760. getneedNo() {
  761. this.$http({
  762. url: "/market/zysqProcess/getNeedNo",
  763. method: "post",
  764. headers: {
  765. "Content-Type": "application/json",
  766. },
  767. }).then((res) => {
  768. this.ruleForm.workOrderNo = res.data.body;
  769. });
  770. },
  771. getdealMan() {
  772. let id = "itcThird"
  773. this.$http({
  774. url: "/market//api/user/info/queryNodePers?params=" + id,
  775. method: "post",
  776. headers: {
  777. "Content-Type": "application/json",
  778. },
  779. }).then((res) => {
  780. for (let i = 0; i < res.data.length; i++) {
  781. for (let j = 0; j < res.data[i].children.length; j++) {
  782. this.optionList.push({
  783. name: res.data[i].children[j].label
  784. })
  785. }
  786. }
  787. });
  788. },
  789. backlogTodo() {
  790. let list = {
  791. tableName: this.requestForm.processDefinitionKey,
  792. };
  793. // getInitiateBase getTodoBase
  794. getTodoBase(this.page, "", list).then((res) => {
  795. this.firstTable.data = res.data.data;
  796. this.firstTable.pageData.total = res.data.totalRecord;
  797. // this.Table = this.firstTable;
  798. this.tabList[0].number = res.data.totalRecord;
  799. })
  800. },
  801. iniTiate() {
  802. let list = {
  803. tableName: this.requestForm.processDefinitionKey
  804. };
  805. getInitiateBase(this.page, "", list).then((res) => {
  806. this.threeTable.data = res.data.data;
  807. this.threeTable.pageData.total = res.data.totalRecord;
  808. this.tabList[2].number = res.data.totalRecord;
  809. })
  810. },
  811. //我的已办
  812. haveDone() {
  813. // let list = {}
  814. // list.tableName = this.requestForm.processDefinitionKey,
  815. // this.$http({
  816. // url: "/market/waf/queryDoneBase",
  817. // method: "post",
  818. // headers: {
  819. // "Content-Type": "application/json",
  820. // page: '{"pageNo":"' + this.totalPage + '","pageSize":"10"}',
  821. // },
  822. // data: list,
  823. // }).then((res) => {
  824. // this.tabList[1].number = res.data.totalRecord;
  825. // this.twoTable.data = res.data.data;
  826. // this.twoTable.pageData.total = res.data.totalRecord;
  827. // this.Table = this.twoTable;
  828. // });
  829. let list = {
  830. tableName: this.requestForm.processDefinitionKey
  831. }
  832. getDoneBase(this.page, "", list).then((res) => {
  833. this.twoTable.data = res.data.data;
  834. this.twoTable.pageData.total = res.data.totalRecord;
  835. this.tabList[1].number = res.data.totalRecord;
  836. })
  837. },
  838. updateForm() {
  839. this.handleClose();
  840. this.iniTiate();
  841. this.haveDone();
  842. this.handleCloses();
  843. },
  844. },
  845. mounted() {
  846. },
  847. created() {
  848. this.Table = this.firstTable;
  849. this.haveDone();
  850. this.iniTiate();
  851. this.backlogTodo();
  852. this.getneedNo();
  853. this.getdealMan();
  854. // this.getDept();
  855. },
  856. };
  857. </script>
  858. <style scoped lang="scss">
  859. .container {
  860. height: 650px;
  861. }
  862. .titbox {
  863. width: 100%;
  864. }
  865. .titbox-flex {
  866. width: 100%;
  867. height: 75px;
  868. display: flex;
  869. justify-content: space-between;
  870. border-bottom: 1px solid #e1e1e1;
  871. }
  872. ::v-deep .el-tabs__nav {
  873. margin: 12px 0 0 12px;
  874. }
  875. ::v-deep .el-tabs__nav-wrap::after {
  876. display: none;
  877. }
  878. ::v-deep .el-tabs__active-bar {
  879. display: none;
  880. }
  881. ::v-deep .el-tabs .is-active {
  882. color: #fff;
  883. background-color: #0583cd;
  884. }
  885. ::v-deep .el-tabs__item {
  886. padding: 0;
  887. margin-right: 20px;
  888. width: 166px;
  889. text-align: center;
  890. background-color: #d8eaf6;
  891. color: #000;
  892. height: 40px;
  893. box-sizing: border-box;
  894. line-height: 40px;
  895. display: inline-block;
  896. list-style: none;
  897. font-size: 14px;
  898. font-weight: 500;
  899. color: #303133;
  900. position: relative;
  901. }
  902. ::v-deep .el-form-item__content {
  903. display: flex;
  904. }
  905. // ::v-deep .el-input__inner{
  906. // width:162px;
  907. // }
  908. ::v-deep .container .el-upload-dragger {
  909. width: 192px !important;
  910. height: 116px !important;
  911. }
  912. .containtbox {
  913. ::v-deep .el-dialog.import-dialog {
  914. height: auto;
  915. max-height: 80vh;
  916. }
  917. }
  918. // ::v-deep .el-dialog {
  919. // height: auto;
  920. // max-height: 1500vh;
  921. // }
  922. .flex-title {
  923. width: 100%;
  924. height: 63px;
  925. margin-top: 10px;
  926. text-align: center;
  927. font-size: 24px;
  928. line-height: 60px;
  929. border-bottom: 1px solid #e1e1e1;
  930. font-weight: 700;
  931. }
  932. .flex-header {
  933. width: 100%;
  934. height: 63px;
  935. margin-top: 20px;
  936. display: flex;
  937. border-bottom: 1px solid #e1e1e1;
  938. span {
  939. margin: 10px 0 0 22px;
  940. }
  941. .el-input {
  942. width: 162px;
  943. }
  944. ::v-deep .el-input__inner {
  945. width: 162px;
  946. }
  947. }
  948. .flex-header-dongtai {
  949. margin-top: 20px;
  950. display: flex;
  951. // border-bottom: 1px solid #e1e1e1;
  952. span {
  953. margin: 10px 0 0 22px;
  954. }
  955. .el-input {
  956. width: 162px;
  957. }
  958. ::v-deep .el-input__inner {
  959. width: 162px;
  960. }
  961. }
  962. .flex-header-input {
  963. width: 100%;
  964. height: 63px;
  965. margin-top: 20px;
  966. display: flex;
  967. border-bottom: 1px solid #e1e1e1;
  968. ::v-deep .el-form-item {
  969. width: 100%;
  970. // margin-right: 5%;
  971. }
  972. .el-input {
  973. width: 100%;
  974. }
  975. }
  976. .flex-header-upload {
  977. width: 100%;
  978. height: 200px;
  979. margin-top: 20px;
  980. display: flex;
  981. border-bottom: 1px solid #e1e1e1;
  982. overflow: auto;
  983. span {
  984. margin: 10px 0 0 25px;
  985. }
  986. ::v-deep .el-form-item__content {
  987. line-height: 25px;
  988. }
  989. ::v-deep .container .el-upload {
  990. width: 200%;
  991. }
  992. // ::v-deep .el-form-item {
  993. // width: 150%;
  994. // }
  995. }
  996. .flex-upload {
  997. ::v-deep .el-form-item {
  998. width: 100%;
  999. }
  1000. ::v-deep .container__el-upload {
  1001. width: 200%;
  1002. }
  1003. }
  1004. .table-title {
  1005. width: 100%;
  1006. height: 50px;
  1007. line-height: 50px;
  1008. background-color: rgb(243, 250, 255);
  1009. // font-size: 18px;
  1010. font-weight: 700;
  1011. }
  1012. .flex-header-process {
  1013. width: 100%;
  1014. // height: 242px;
  1015. display: flex;
  1016. }
  1017. .flex-header-process .el-table .el-table__cell .is-center {
  1018. text-align: center;
  1019. }
  1020. // .el-upload__tip{
  1021. // }
  1022. </style>