provincialWorkOrderArea.vue 47 KB

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