index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. <template>
  2. <div class="ele-body">
  3. <el-card class="card_box" :body-style="{display:'flex',flexDirection: 'column',alignItems: 'flex-start'}"
  4. shadow="never">
  5. <!-- 动态表单配置-->
  6. <div class="content-box">
  7. <div v-for="category in Object.keys(templateList)" :key="category" class="category_box">
  8. <div class="category_box_title">{{ getDictV('collaborative_type', category) }}</div>
  9. <div class="category_box_content">
  10. <div v-for="v in templateList[category]" :key="v.id" class="category_content"
  11. :title="v.name"
  12. @click="handleStartProcess(v)">
  13. <svg-icon
  14. style="width: 1.5em;height: 1.5em;"
  15. :icon-class="v.icon"
  16. className="svg-icon-set"
  17. ></svg-icon>
  18. <span>
  19. {{ v.name.length>3?v.name[0]+v.name[1]+v.name[2]+'...':v.name }}
  20. </span>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="tab-box el-form-box">
  26. <el-tabs type="border-card">
  27. <el-tab-pane label="个人记录">
  28. <ele-pro-table
  29. ref="table"
  30. :toolkit="[]"
  31. height="calc(100vh - 450px)"
  32. :columns="columns"
  33. :datasource="datasource"
  34. cache-key="datasource-1"
  35. :init-load="false"
  36. >
  37. <template v-slot:toolbar="{ row }">
  38. <div class="filter-container">
  39. <el-form
  40. class="ele-form-search"
  41. @keyup.enter.native="reload"
  42. @submit.native.prevent
  43. >
  44. <el-row :gutter="15" style="display: flex;align-items: center">
  45. <el-col v-bind="{ span: 3 }">
  46. <el-form-item label="分类:" label-width="60px">
  47. <el-select v-model="params.formId">
  48. <el-option v-for="(item,index) in defaultTemplateList" :key="index" :value="item.id"
  49. :label="item.name"></el-option>
  50. </el-select>
  51. </el-form-item>
  52. </el-col>
  53. <el-col v-bind="{ span: 4 }">
  54. <el-form-item label="结果:" prop="result" label-width="60px">
  55. <!-- <el-select
  56. v-model="params.status"
  57. placeholder="请选择状态"
  58. clearable
  59. >
  60. <el-option
  61. v-for="dict in statusList"
  62. :key="dict.value"
  63. :label="dict.label"
  64. :value="dict.value"
  65. />
  66. </el-select> -->
  67. <DictSelection
  68. dictName="流程实例的结果"
  69. clearable
  70. v-model="params.result"
  71. >
  72. </DictSelection>
  73. </el-form-item>
  74. </el-col>
  75. <el-col v-bind="styleResponsive ? { lg: 8, md: 12 } : { span: 10 }">
  76. <el-form-item label="创建时间:" prop="createTime" label-width="90px">
  77. <el-date-picker
  78. v-model="params.createTime"
  79. style="width: 100%"
  80. value-format="yyyy-MM-dd HH:mm:ss"
  81. type="daterange"
  82. range-separator="-"
  83. start-placeholder="开始日期"
  84. end-placeholder="结束日期"
  85. :default-time="['00:00:00', '23:59:59']"
  86. />
  87. </el-form-item>
  88. </el-col>
  89. </el-row>
  90. </el-form>
  91. </div>
  92. </template>
  93. <template v-slot:toolkit="{ row }">
  94. <div class="filter-container">
  95. <div class="ele-form-actions">
  96. <el-button
  97. type="primary"
  98. icon="el-icon-search"
  99. class="ele-btn-icon"
  100. @click="reload"
  101. >
  102. 查询
  103. </el-button>
  104. <el-button @click="reset">重置</el-button>
  105. </div>
  106. </div>
  107. </template>
  108. <template v-slot:result="{ row }">
  109. <el-tag size="medium" :type="getTimelineItemType(getDictValue('流程实例的结果', row.result))">
  110. {{ getDictValue('流程实例的结果', row.result) }}
  111. </el-tag>
  112. </template>
  113. <template v-slot:durationInMillis="{ row }">
  114. {{ getDateTime(row.durationInMillis) }}
  115. </template>
  116. <template v-slot:name="{ row }">
  117. <el-link type="primary" :underline="false" @click="handleDetail(row)">
  118. {{ row.name }}
  119. </el-link
  120. >
  121. </template>
  122. <template v-if="formColumnList.length" v-for="(item,index) in formColumnList"
  123. v-slot:[item.model]="{ row }">
  124. <div v-if="item.type=='imgupload'">
  125. <el-image
  126. v-if="row[item.model].length"
  127. style="width: 100px; height: 100px"
  128. :src="row[item.model][0].url"
  129. :preview-src-list="row[item.model].map(i=>i.url)">
  130. </el-image>
  131. </div>
  132. <div v-else-if="item.type=='fileupload'">
  133. <el-button type="text" @click="getFiles(row[item.model])">下载</el-button>
  134. </div>
  135. <div v-else-if="item.type=='userSelect'">
  136. {{ getUserName(row[item.model]) }}
  137. </div>
  138. <div v-else-if="item.type=='deptAndUserCascader'">
  139. {{ getDeptAndUserName(row[item.model]) }}
  140. </div>
  141. <div v-else-if="item.type=='deptCascader'">
  142. {{ getDeptName(row[item.model]) }}
  143. </div>
  144. <div v-else>
  145. {{ row[item.model] }}
  146. </div>
  147. </template>
  148. <!-- 操作列 -->
  149. <template v-slot:action="{ row }">
  150. <el-button
  151. size="mini"
  152. type="text"
  153. icon="el-icon-edit"
  154. @click="handleAudit(row)"
  155. >详情
  156. </el-button
  157. >
  158. </template>
  159. </ele-pro-table>
  160. </el-tab-pane>
  161. <el-tab-pane label="部门记录">
  162. <ele-pro-table
  163. ref="deptTable"
  164. :columns="deptColumns"
  165. :datasource="deptDatasource"
  166. cache-key="deptDatasource"
  167. :toolkit="[]"
  168. height="calc(100vh - 450px)"
  169. :init-load="false"
  170. >
  171. <template v-slot:toolbar="{ row }">
  172. <div class="filter-container">
  173. <el-form
  174. class="ele-form-search"
  175. @keyup.enter.native="deptReload"
  176. @submit.native.prevent
  177. >
  178. <el-row :gutter="15" style="display: flex;align-items: center">
  179. <el-col v-bind="{ span: 3 }">
  180. <el-form-item label="分类:" label-width="60px">
  181. <el-select v-model="params.formId">
  182. <el-option v-for="(item,index) in defaultTemplateList" :key="index" :value="item.id"
  183. :label="item.name"></el-option>
  184. </el-select>
  185. </el-form-item>
  186. </el-col>
  187. <el-col v-bind="{ span: 4 }">
  188. <el-form-item label="结果:" prop="result" label-width="60px">
  189. <!-- <el-select
  190. v-model="params.status"
  191. placeholder="请选择状态"
  192. clearable
  193. >
  194. <el-option
  195. v-for="dict in statusList"
  196. :key="dict.value"
  197. :label="dict.label"
  198. :value="dict.value"
  199. />
  200. </el-select> -->
  201. <DictSelection
  202. dictName="流程实例的结果"
  203. clearable
  204. v-model="params.result"
  205. >
  206. </DictSelection>
  207. </el-form-item>
  208. </el-col>
  209. <el-col v-bind="{ span: 4 }">
  210. <el-form-item label="发起人:" prop="startUserName" label-width="70px">
  211. <el-input v-model="params.startUserName"></el-input>
  212. </el-form-item>
  213. </el-col>
  214. <el-col v-bind="{ span: 10 }">
  215. <el-form-item label="创建时间:" prop="createTime" label-width="90px">
  216. <el-date-picker
  217. v-model="params.createTime"
  218. style="width: 100%"
  219. value-format="yyyy-MM-dd HH:mm:ss"
  220. type="daterange"
  221. range-separator="-"
  222. start-placeholder="开始日期"
  223. end-placeholder="结束日期"
  224. :default-time="['00:00:00', '23:59:59']"
  225. />
  226. </el-form-item>
  227. </el-col>
  228. </el-row>
  229. </el-form>
  230. </div>
  231. </template>
  232. <template v-slot:toolkit="{ row }">
  233. <div class="filter-container">
  234. <div class="ele-form-actions">
  235. <el-button
  236. type="primary"
  237. icon="el-icon-search"
  238. class="ele-btn-icon"
  239. @click="deptReload"
  240. >
  241. 查询
  242. </el-button>
  243. <el-button @click="deptReset">重置</el-button>
  244. </div>
  245. </div>
  246. </template>
  247. <template v-if="formColumnList.length" v-for="(item,index) in formColumnList"
  248. v-slot:[item.model]="{ row }">
  249. <div v-if="item.type=='imgupload'">
  250. <el-image
  251. v-if="row[item.model].length"
  252. style="width: 100px; height: 100px"
  253. :src="row[item.model][0].url"
  254. :preview-src-list="row[item.model].map(i=>i.url)">
  255. </el-image>
  256. </div>
  257. <div v-else-if="item.type=='fileupload'">
  258. <el-button type="text" @click="getFiles(row[item.model])">下载</el-button>
  259. </div>
  260. <div v-else-if="item.type=='userSelect'">
  261. {{ getUserName(row[item.model]) }}
  262. </div>
  263. <div v-else-if="item.type=='deptAndUserCascader'">
  264. {{ getDeptAndUserName(row[item.model]) }}
  265. </div>
  266. <div v-else-if="item.type=='deptCascader'">
  267. {{ getDeptName(row[item.model]) }}
  268. </div>
  269. <div v-else>
  270. {{ row[item.model] }}
  271. </div>
  272. </template>
  273. <template v-slot:result="{ row }">
  274. <el-tag size="medium" :type="getTimelineItemType(getDictValue('流程实例的结果', row.result))">
  275. {{ getDictValue('流程实例的结果', row.result) }}
  276. </el-tag>
  277. </template>
  278. <template v-slot:durationInMillis="{ row }">
  279. {{ getDateTime(row.durationInMillis) }}
  280. </template>
  281. <template v-slot:name="{ row }">
  282. <el-link type="primary" :underline="false" @click="handleDetail(row)">
  283. {{ row.name }}
  284. </el-link
  285. >
  286. </template>
  287. <!-- 操作列 -->
  288. <template v-slot:action="{ row }">
  289. <el-button
  290. size="mini"
  291. type="text"
  292. icon="el-icon-edit"
  293. @click="handleAudit(row)"
  294. >详情
  295. </el-button
  296. >
  297. </template>
  298. </ele-pro-table>
  299. </el-tab-pane>
  300. <el-tab-pane label="通知我的记录">
  301. <ele-pro-table
  302. ref="noticeTable"
  303. :columns="deptColumns"
  304. :datasource="noticeDatasource"
  305. cache-key="noticeDatasource"
  306. height="calc(100vh - 450px)"
  307. :toolkit="[]"
  308. :init-load="false"
  309. >
  310. <template v-slot:toolbar="{ row }">
  311. <div class="filter-container">
  312. <el-form
  313. class="ele-form-search"
  314. @keyup.enter.native="noticeReload"
  315. @submit.native.prevent
  316. >
  317. <el-row :gutter="15" style="display: flex;align-items: center">
  318. <el-col v-bind="{ span: 3 }">
  319. <el-form-item label="分类:" label-width="60px">
  320. <el-select v-model="params.formId">
  321. <el-option v-for="(item,index) in defaultTemplateList" :key="index" :value="item.id"
  322. :label="item.name"></el-option>
  323. </el-select>
  324. </el-form-item>
  325. </el-col>
  326. <el-col v-bind="{ span: 4 }">
  327. <el-form-item label="结果:" prop="result" label-width="60px">
  328. <!-- <el-select
  329. v-model="params.status"
  330. placeholder="请选择状态"
  331. clearable
  332. >
  333. <el-option
  334. v-for="dict in statusList"
  335. :key="dict.value"
  336. :label="dict.label"
  337. :value="dict.value"
  338. />
  339. </el-select> -->
  340. <DictSelection
  341. dictName="流程实例的结果"
  342. clearable
  343. v-model="params.result"
  344. >
  345. </DictSelection>
  346. </el-form-item>
  347. </el-col>
  348. <el-col v-bind="{ span: 4 }">
  349. <el-form-item label="发起人:" prop="startUserName" label-width="70px">
  350. <el-input v-model="params.startUserName"></el-input>
  351. </el-form-item>
  352. </el-col>
  353. <el-col v-bind="{ span: 10 }">
  354. <el-form-item label="创建时间:" prop="createTime" label-width="90px">
  355. <el-date-picker
  356. v-model="params.createTime"
  357. style="width: 100%"
  358. value-format="yyyy-MM-dd HH:mm:ss"
  359. type="daterange"
  360. range-separator="-"
  361. start-placeholder="开始日期"
  362. end-placeholder="结束日期"
  363. :default-time="['00:00:00', '23:59:59']"
  364. />
  365. </el-form-item>
  366. </el-col>
  367. </el-row>
  368. </el-form>
  369. </div>
  370. </template>
  371. <template v-slot:toolkit="{ row }">
  372. <div class="filter-container">
  373. <div class="ele-form-actions">
  374. <el-button
  375. type="primary"
  376. icon="el-icon-search"
  377. class="ele-btn-icon"
  378. @click="noticeReload"
  379. >
  380. 查询
  381. </el-button>
  382. <el-button @click="noticeReset">重置</el-button>
  383. </div>
  384. </div>
  385. </template>
  386. <template v-if="formColumnList.length" v-for="(item,index) in formColumnList"
  387. v-slot:[item.model]="{ row }">
  388. <div v-if="item.type=='imgupload'">
  389. <el-image
  390. v-if="row[item.model].length"
  391. style="width: 100px; height: 100px"
  392. :src="row[item.model][0].url"
  393. :preview-src-list="row[item.model].map(i=>i.url)">
  394. </el-image>
  395. </div>
  396. <div v-else-if="item.type=='fileupload'">
  397. <el-button type="text" @click="getFiles(row[item.model])">下载</el-button>
  398. </div>
  399. <div v-else-if="item.type=='userSelect'">
  400. {{ getUserName(row[item.model]) }}
  401. </div>
  402. <div v-else-if="item.type=='deptAndUserCascader'">
  403. {{ getDeptAndUserName(row[item.model]) }}
  404. </div>
  405. <div v-else-if="item.type=='deptCascader'">
  406. {{ getDeptName(row[item.model]) }}
  407. </div>
  408. <div v-else>
  409. {{ row[item.model] }}
  410. </div>
  411. </template>
  412. <template v-slot:result="{ row }">
  413. <el-tag size="medium" :type="getTimelineItemType(getDictValue('流程实例的结果', row.result))">
  414. {{ getDictValue('流程实例的结果', row.result) }}
  415. </el-tag>
  416. </template>
  417. <template v-slot:durationInMillis="{ row }">
  418. {{ getDateTime(row.durationInMillis) }}
  419. </template>
  420. <template v-slot:name="{ row }">
  421. <el-link type="primary" :underline="false" @click="handleDetail(row)">
  422. {{ row.name }}
  423. </el-link
  424. >
  425. </template>
  426. <!-- 操作列 -->
  427. <template v-slot:action="{ row }">
  428. <el-button
  429. size="mini"
  430. type="text"
  431. icon="el-icon-edit"
  432. @click="handleAudit(row)"
  433. >详情
  434. </el-button
  435. >
  436. </template>
  437. </ele-pro-table>
  438. </el-tab-pane>
  439. </el-tabs>
  440. </div>
  441. </el-card>
  442. <process-submit-dialog :process-submit-dialog-flag.sync="processSubmitDialogFlag" v-if="processSubmitDialogFlag"
  443. ref="processSubmitDialogRef" @reload="reload"></process-submit-dialog>
  444. <detail ref="detailRef"></detail>
  445. <formDetail v-if="formDetailDialogFlag" ref="formDetailDialogRef" :form-detail-dialog-flag.sync="formDetailDialogFlag"></formDetail>
  446. </div>
  447. </template>
  448. <script>
  449. import {
  450. getBpmCustomFormList,
  451. getProcessInstanceDeptPage,
  452. getProcessInstanceNoticePage,
  453. getProcessInstancePage
  454. } from "@/api/bpm/task";
  455. import {getDate} from "@/utils/dateUtils";
  456. import dictMixins from "@/mixins/dictMixins";
  457. import detail from "@/views/bpm/processInstance/detail.vue";
  458. import formDetail from './detail.vue'
  459. import {getByCode} from "@/api/system/dictionary-data";
  460. import {getFile} from "@/api/system/file";
  461. import {getUserPage} from '@/api/tickets';
  462. import {listOrganizations} from "@/api/system/organization";
  463. // 默认表单数据
  464. const defaultParams = {
  465. status: '',
  466. name: '',
  467. formId: ''
  468. };
  469. export default {
  470. name: "index",
  471. components: {
  472. detail,
  473. formDetail
  474. },
  475. mixins: [dictMixins],
  476. data() {
  477. return {
  478. configFormDialogFlag: false,
  479. processSubmitDialogFlag: false,
  480. formDetailDialogFlag: false,
  481. templateList: {},
  482. dictList: {},
  483. defaultTemplateList: [],
  484. userList: [],
  485. deptList: [],
  486. params: {...defaultParams},
  487. statusList: [],
  488. formColumnList: [],
  489. }
  490. },
  491. computed: {
  492. // 是否开启响应式布局
  493. styleResponsive() {
  494. return this.$store.state.theme.styleResponsive;
  495. },
  496. columns() {
  497. let list = this.formColumnList.map(item => {
  498. return {
  499. prop: item.model,
  500. label: item.name,
  501. align: 'center',
  502. slot: item.model,
  503. showOverflowTooltip: true,
  504. minWidth: 120
  505. }
  506. })
  507. return [
  508. {
  509. columnKey: 'index',
  510. label: '序号',
  511. type: 'index',
  512. width: 55,
  513. align: 'center',
  514. showOverflowTooltip: true,
  515. fixed: 'left'
  516. },
  517. {
  518. prop: 'formName',
  519. label: '分类',
  520. align: 'center',
  521. slot: 'formName',
  522. showOverflowTooltip: true,
  523. minWidth: 100
  524. },
  525. {
  526. prop: 'name',
  527. label: '名称',
  528. align: 'center',
  529. slot: 'name',
  530. showOverflowTooltip: true,
  531. minWidth: 100
  532. },
  533. ...list,
  534. {
  535. prop: 'result',
  536. slot: 'result',
  537. label: '结果',
  538. align: 'center',
  539. showOverflowTooltip: true,
  540. minWidth: 100
  541. },
  542. {
  543. prop: 'endTime',
  544. label: '审批时间',
  545. align: 'center',
  546. showOverflowTooltip: true,
  547. minWidth: 180
  548. },
  549. {
  550. prop: 'createTime',
  551. label: '创建时间',
  552. align: 'center',
  553. showOverflowTooltip: true,
  554. minWidth: 180
  555. },
  556. // {
  557. // prop: 'durationInMillis',
  558. // slot: 'durationInMillis',
  559. // label: '耗时',
  560. // align: 'center',
  561. // showOverflowTooltip: true,
  562. // minWidth: 130
  563. // },
  564. {
  565. columnKey: 'action',
  566. label: '操作',
  567. width: 100,
  568. align: 'center',
  569. resizable: false,
  570. slot: 'action',
  571. showOverflowTooltip: true,
  572. fixed: 'right'
  573. }
  574. ]
  575. },
  576. deptColumns() {
  577. let list = this.formColumnList.map(item => {
  578. return {
  579. prop: item.model,
  580. label: item.name,
  581. align: 'center',
  582. slot: item.model,
  583. showOverflowTooltip: true,
  584. minWidth: 120
  585. }
  586. })
  587. return [
  588. {
  589. columnKey: 'index',
  590. label: '序号',
  591. type: 'index',
  592. width: 55,
  593. align: 'center',
  594. showOverflowTooltip: true,
  595. fixed: 'left'
  596. },
  597. {
  598. prop: 'formName',
  599. label: '分类',
  600. align: 'center',
  601. slot: 'formName',
  602. showOverflowTooltip: true,
  603. minWidth: 150
  604. },
  605. {
  606. prop: 'name',
  607. label: '名称',
  608. align: 'center',
  609. slot: 'name',
  610. showOverflowTooltip: true,
  611. minWidth: 150
  612. },
  613. {
  614. prop: 'startUserName',
  615. label: '发起人',
  616. align: 'center',
  617. showOverflowTooltip: true,
  618. minWidth: 180
  619. },
  620. ...list,
  621. {
  622. prop: 'result',
  623. slot: 'result',
  624. label: '结果',
  625. align: 'center',
  626. showOverflowTooltip: true,
  627. minWidth: 100
  628. },
  629. {
  630. prop: 'endTime',
  631. label: '审批时间',
  632. align: 'center',
  633. showOverflowTooltip: true,
  634. minWidth: 180
  635. },
  636. {
  637. prop: 'createTime',
  638. label: '创建时间',
  639. align: 'center',
  640. showOverflowTooltip: true,
  641. minWidth: 180
  642. },
  643. // {
  644. // prop: 'durationInMillis',
  645. // slot: 'durationInMillis',
  646. // label: '耗时',
  647. // align: 'center',
  648. // showOverflowTooltip: true,
  649. // minWidth: 130
  650. // },
  651. // {
  652. // columnKey: 'action',
  653. // label: '操作',
  654. // width: 230,
  655. // align: 'center',
  656. // resizable: false,
  657. // slot: 'action',
  658. // showOverflowTooltip: true,
  659. // fixed: 'right'
  660. // }
  661. ]
  662. },
  663. getUserName() {
  664. return (id) => {
  665. if (!id) return ''
  666. let find = this.userList.find(item => item.id == id) || {}
  667. return find.name
  668. }
  669. },
  670. getDeptAndUserName() {
  671. return (id = []) => {
  672. if (!id.length) return ''
  673. let find = this.userList.find(item => item.id == id[id.length - 1]) || {}
  674. return find.name
  675. }
  676. },
  677. getDeptName() {
  678. return (id = []) => {
  679. if (!id.length) return ''
  680. let find = this.deptList.find(item => item.id == id[id.length - 1]) || {}
  681. console.log(find.name,'===========');
  682. return find.name
  683. }
  684. },
  685. },
  686. watch: {
  687. 'params.formId': {
  688. handler(val) {
  689. this.reload()
  690. this.deptReload()
  691. this.reload()
  692. this.noticeReload()
  693. }
  694. }
  695. },
  696. async created() {
  697. await this.getDictList('collaborative_type')
  698. await this.getTemplateList()
  699. await this.getUserList()
  700. await this.getDeptList()
  701. },
  702. methods: {
  703. getDictV(code, val) {
  704. if (!this.dictList[code]) return '';
  705. return this.dictList[code].find(item => item.value == val)?.label
  706. },
  707. async getDictList(code) {
  708. let {data: res} = await getByCode(code)
  709. this.dictList[code] = res.map(item => {
  710. let values = Object.keys(item)
  711. return {
  712. value: values[0],
  713. label: item[values[0]]
  714. }
  715. })
  716. },
  717. //获取人员数据
  718. async getUserList() {
  719. let params = {pageNum: 1, size: -1};
  720. let {list} = await getUserPage(params);
  721. this.userList = list
  722. },
  723. //获取部门数据
  724. async getDeptList() {
  725. this.deptList = await listOrganizations()
  726. console.log(this.deptList);
  727. },
  728. getFiles(row = []) {
  729. row.forEach(item => {
  730. getFile({objectName: item.storePath}, item.name);
  731. })
  732. },
  733. async getTemplateList() {
  734. this.defaultTemplateList = await getBpmCustomFormList({status:1})
  735. this.templateList = _.groupBy(this.defaultTemplateList, 'dictType');
  736. this.params.formId = this.defaultTemplateList[0]?.id
  737. let makingJson = JSON.parse(this.defaultTemplateList[0].formJson.makingJson) || {}
  738. this.formColumnList = makingJson.list
  739. console.log(this.formColumnList);
  740. },
  741. handleStartProcess(i) {
  742. this.processSubmitDialogFlag = true;
  743. this.$nextTick(() => {
  744. this.$refs.processSubmitDialogRef.init(i);
  745. })
  746. },
  747. /* 表格数据源 */
  748. async datasource({page, limit, where, order}) {
  749. let data = await getProcessInstancePage({
  750. pageNo: page,
  751. pageSize: limit,
  752. ...this.params,
  753. processType: '1',
  754. });
  755. data = data.list.map(item => {
  756. return {
  757. ...
  758. item,
  759. ...
  760. item.valueJson
  761. }
  762. })
  763. return data
  764. },
  765. /* 刷新表格 */
  766. reload(where) {
  767. let find = this.defaultTemplateList.find(item => item.id == this.params.formId) || {};
  768. let makingJson = JSON.parse(find.formJson.makingJson) || {}
  769. this.formColumnList = makingJson.list
  770. console.log(this.formColumnList);
  771. this.$refs.table.reload({page: 1, where});
  772. this.$refs.table.reRenderTable()
  773. },
  774. /* 重置 */
  775. reset() {
  776. this.params = {...defaultParams};
  777. this.params.formId = this.defaultTemplateList[0]?.id
  778. this.reload();
  779. },
  780. /* 表格数据源 */
  781. async deptDatasource({page, limit, where, order}) {
  782. let data = await getProcessInstanceDeptPage({
  783. pageNo: page,
  784. pageSize: limit,
  785. ...this.params,
  786. processType: '1',
  787. });
  788. data = data.list.map(item => {
  789. return {
  790. ...
  791. item,
  792. ...
  793. item.valueJson
  794. }
  795. })
  796. return data
  797. },
  798. /* 刷新表格 */
  799. deptReload(where) {
  800. let find = this.defaultTemplateList.find(item => item.id == this.params.formId) || {};
  801. let makingJson = JSON.parse(find.formJson.makingJson) || {}
  802. this.formColumnList = makingJson.list
  803. this.$refs.deptTable.reload({page: 1, where});
  804. },
  805. /* 重置 */
  806. deptReset() {
  807. this.params = {...defaultParams};
  808. this.params.formId = this.defaultTemplateList[0]?.id
  809. this.deptReload();
  810. },
  811. /* 表格数据源 */
  812. async noticeDatasource({page, limit, where, order}) {
  813. let data = await getProcessInstanceNoticePage({
  814. pageNo: page,
  815. pageSize: limit,
  816. ...this.params,
  817. processType: '1',
  818. });
  819. data = data.list.map(item => {
  820. return {
  821. ...
  822. item,
  823. ...
  824. item.valueJson
  825. }
  826. })
  827. return data
  828. },
  829. /* 刷新表格 */
  830. noticeReload(where) {
  831. let find = this.defaultTemplateList.find(item => item.id == this.params.formId) || {};
  832. let makingJson = JSON.parse(find.formJson.makingJson) || {}
  833. this.formColumnList = makingJson.list
  834. this.$refs.noticeTable.reload({page: 1, where});
  835. },
  836. /* 重置 */
  837. noticeReset() {
  838. this.params = {...defaultParams};
  839. this.params.formId = this.defaultTemplateList[0]?.id
  840. this.noticeReload();
  841. },
  842. /** */
  843. handleAudit(row) {
  844. this.$refs.detailRef.open(row.id);
  845. },
  846. /** */
  847. handleDetail(row) {
  848. this.formDetailDialogFlag = true
  849. this.$nextTick(()=>{
  850. this.$refs.formDetailDialogRef.open(row);
  851. })
  852. },
  853. getTimelineItemType(result) {
  854. if (result === '通过') {
  855. return 'success';
  856. }
  857. if (result === '不通过') {
  858. return 'danger';
  859. }
  860. if (result === '取消') {
  861. return 'info';
  862. }
  863. if (result === '处理中') {
  864. return 'warning';
  865. }
  866. return '';
  867. },
  868. getDateTime(ms) {
  869. return getDate(ms)
  870. },
  871. }
  872. }
  873. </script>
  874. <style scoped lang="scss">
  875. .ele-body {
  876. padding: 15px;
  877. }
  878. .content-box {
  879. width: 100%;
  880. //max-width: 273px;
  881. //min-width: 90px;
  882. margin-right: 10px;
  883. display: flex;
  884. flex-direction: row;
  885. flex-wrap: wrap;
  886. //justify-content: space-between;
  887. .category_box {
  888. border-left: 1px solid #e1e1e1;
  889. border-bottom: 1px solid #e1e1e1;
  890. border-radius: 1px;
  891. flex: 1 0 25%;
  892. margin-top: 5px;
  893. overflow: auto;
  894. .category_box_title {
  895. font-size: 14px;
  896. font-weight: bold;
  897. color: #fff8f8;
  898. height: 39px;
  899. display: flex;
  900. padding: 5px 20px;
  901. align-items: center;
  902. background: #1890ffd6;
  903. border-bottom: 1px solid #e1e1e1;
  904. }
  905. .category_box_content {
  906. display: flex;
  907. flex-direction: row;
  908. flex-wrap: wrap;
  909. height: 60px;
  910. overflow: auto;
  911. .category_content {
  912. min-width: 60px;
  913. min-height: 60px;
  914. //flex: 1 1 0;
  915. display: flex;
  916. flex-direction: column;
  917. border-right: 1px solid #e1e1e1;
  918. border-bottom: 1px solid #e1e1e1;
  919. align-items: center;
  920. justify-content: center;
  921. // font-weight: bold;
  922. &:nth-child(n) {
  923. span:nth-child(1) {
  924. transform: scale(2);
  925. }
  926. span:nth-child(2) {
  927. padding-top: 5px;
  928. }
  929. }
  930. }
  931. .category_content:hover {
  932. cursor: pointer;
  933. background-color: rgba(135, 181, 243, 0.29);
  934. }
  935. }
  936. }
  937. .category_box:last-child {
  938. border-right: 1px solid #e1e1e1;
  939. }
  940. }
  941. .tab-box {
  942. width: 100%;
  943. //max-width: 1100px;
  944. //min-width: 600px;
  945. margin-top: 6px;
  946. height: 98%;
  947. .el-tabs--border-card {
  948. height: 100%;
  949. }
  950. }
  951. ::v-deep .card_box {
  952. .el-card__body {
  953. padding: 10px;
  954. height: 86vh;
  955. }
  956. }
  957. </style>