workbench.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. <template>
  2. <view class="container">
  3. <!-- 顶部自定义导航栏 -->
  4. <cu-custom bgColor="bg-blue">
  5. <block slot="content"> 工作台</block>
  6. </cu-custom>
  7. <!-- 信息区域 -->
  8. <view class="col-1 no-border fixed" style="margin:5px 10px 5px 10px;">
  9. <view :style="dynamicStyle">
  10. <view class="col-1 no-border fixed" style="padding:20px 40px 20px 40px;">
  11. <!-- 个人信息 -->
  12. <view class="ellipsis-description" style="font-size: 16px">
  13. <span style="padding:5px;display: inline-block; width: 80px">
  14. <span style="font-weight: bold">{{userInfo.roleNames}}</span>
  15. </span>
  16. <span style="padding-left: 30px;display: inline-block;">
  17. <span class="cuIcon-locationfill" style="color: #FFFFFF;margin-right: 5px;"></span>
  18. <span style="color: #FFFFFF;font-weight: bold">{{userInfo.officeDTO.name}}</span>
  19. </span>
  20. </view>
  21. <view class="ellipsis-description" style="font-size: 16px">
  22. <span style="padding:5px;display: inline-block; width: 80px">
  23. <span style="color: #FFFFFF;font-weight: bold">姓名</span>
  24. </span>
  25. <span style="padding-left: 30px;display: inline-block;">
  26. <span style="color: #FFFFFF;font-weight: bold">{{userInfo.name}}</span>
  27. </span>
  28. </view>
  29. <view class="ellipsis-description" style="font-size: 16px">
  30. <span style="padding:5px;display: inline-block; width: 80px">
  31. <span style="color: #FFFFFF;font-weight: bold">联系方式</span>
  32. </span>
  33. <span style="padding-left: 30px;display: inline-block;">
  34. <span style="color: #FFFFFF;font-weight: bold">{{userInfo.mobile}}</span>
  35. </span>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 功能按钮区域 -->
  41. <view class="cu-list grid col-4 no-border fixed">
  42. <view @tap="toTodoList" class="circle-button-box">
  43. <view class="cuIcon-time text-blue circle-button font-size-35"></view>
  44. <text>待办事项</text>
  45. </view>
  46. <view @tap="toHistoryList" class="circle-button-box">
  47. <view class="cuIcon-roundcheck text-blue circle-button font-size-35"></view>
  48. <text>已办事项</text>
  49. </view>
  50. <view @tap="toApplyList" class="circle-button-box">
  51. <view class="cuIcon-peoplelist text-blue circle-button font-size-35"></view>
  52. <text>我发起的</text>
  53. </view>
  54. <view @tap="toFlowCopyList" class="circle-button-box">
  55. <view class="cuIcon-copy text-blue circle-button font-size-35"></view>
  56. <text>抄送给我</text>
  57. </view>
  58. </view>
  59. <!-- 标签切换区域 -->
  60. <view>
  61. <u-subsection
  62. :list="['待处理', '已处理']"
  63. mode="button"
  64. :fontSize="16"
  65. :current="tabIndex"
  66. @change="tabSelect"
  67. ></u-subsection>
  68. </view>
  69. <!-- 过磅记录 -->
  70. <view style="margin: 11px 28px;">
  71. <view class="ellipsis-description" style="font-size: 20px">
  72. <span style="margin-right: 10px;">
  73. <span class="cuIcon-title" style="color: #f67e1f;margin-right: 5px;"></span>
  74. <span v-if="userInfo.roleNames == '过磅专员' " style="font-weight: bold">过磅记录</span>
  75. <span v-if="userInfo.roleNames == '村负责人' " style="font-weight: bold">清运记录</span>
  76. <span v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " style="font-weight: bold">垃圾巡视</span>
  77. </span>
  78. </view>
  79. </view>
  80. <!-- 可滚动内容区域 -->
  81. <scroll-view scroll-y class="page">
  82. <!-- 其他可滚动内容 -->
  83. <u-swipe-action v-if="this.showType == 'task'">
  84. <view v-for="(row, index) in dataList" :key="index">
  85. <u-swipe-action-item @click="todo(row)" :key="row.id" :threshold="60" duration="500"
  86. :options="[{ text: '办理', style: { backgroundColor: '#3c9cff' } }]">
  87. <u-cell-group>
  88. <u-cell @click="todo(row)">
  89. <view slot="title" class="content" style="line-height: 1.5;">
  90. <view class="text-bold text-grey">
  91. <view class="ellipsis-description" style="font-size: 16px">
  92. <span style="margin-right: 10px;">
  93. <span class="cuIcon-timefill" style="color: #3c9cff;margin-right: 5px;"></span>
  94. <span>{{row.vars.startDate}}</span>
  95. </span>
  96. <span style="margin-right: 10px;">
  97. <span class="cuIcon-locationfill" style="color: #f67e1f;margin-right: 5px;"></span>
  98. <span>{{row.vars.title}}</span>
  99. </span>
  100. </view>
  101. </view>
  102. <view class="text-grey text-sm" style="font-size: 16px">
  103. <div style="margin-right: 20px; float: left">
  104. <u-tag-small text="进行中" plain shape="circle" type="error"></u-tag-small>
  105. </div>
  106. <div style="margin-right: 10px; float: left">
  107. <!--<span class="cuIcon-deliver" style="color: #d95141;margin-right: 5px;"></span>
  108. <span>12.5km</span>-->
  109. </div>
  110. <div style="margin-right: 10px;">
  111. <!--<span class="cuIcon-deletefill" style="color: #38b64b;margin-right: 5px;"></span>
  112. <span>2.2t</span>-->
  113. </div>
  114. </view>
  115. </view>
  116. <view slot="right-icon" class="action">
  117. <u-tag text="处理" plain bgColor="#38b64b" color="white" plainFill shape="circle" type="success" @click="todo(row)"></u-tag>
  118. </view>
  119. </u-cell>
  120. </u-cell-group>
  121. </u-swipe-action-item>
  122. </view>
  123. <!-- 加载更多 -->
  124. <u-loadmore :status="status" @loadmore="loadmore" :line="true" />
  125. </u-swipe-action>
  126. <u-swipe-action v-else>
  127. <view v-for="(row, index) in dataList" :key="index">
  128. <u-swipe-action-item @click="toDetail(row)" :key="row.id" :threshold="60" duration="500"
  129. :options="[{ text: '办理', style: { backgroundColor: '#3c9cff' } }]">
  130. <u-cell-group>
  131. <u-cell @click="toDetail(row)">
  132. <view slot="title" class="content" style="line-height: 1.5;">
  133. <view class="text-bold text-grey">
  134. <view class="ellipsis-description" style="font-size: 16px">
  135. <span style="margin-right: 10px;">
  136. <span class="cuIcon-timefill" style="color: #3c9cff;margin-right: 5px;"></span>
  137. <span>{{row.vars.startDate}}</span>
  138. </span>
  139. <span style="margin-right: 10px;">
  140. <span class="cuIcon-locationfill" style="color: #f67e1f;margin-right: 5px;"></span>
  141. <span>{{row.vars.title}}</span>
  142. </span>
  143. </view>
  144. </view>
  145. <view class="text-grey text-sm" style="font-size: 16px">
  146. <div style="margin-right: 20px; float: left" v-if="row.status === '2'">
  147. <u-tag-small text="进行中" plain shape="circle" type="error"></u-tag-small>
  148. </div>
  149. <div style="margin-right: 20px; float: left" v-else>
  150. <u-tag-small text="已处理" plain shape="circle" type="error"></u-tag-small>
  151. </div>
  152. <div style="margin-right: 10px; float: left" v-if="row.transportMileage">
  153. <span class="cuIcon-deliver" style="color: #d95141;margin-right: 5px;"></span>
  154. <span>{{row.transportMileage}}km</span>
  155. </div>
  156. <div style="margin-right: 10px;" v-if="row.weight">
  157. <span class="cuIcon-deletefill" style="color: #38b64b;margin-right: 5px;"></span>
  158. <span>{{row.weight}}t</span>
  159. </div>
  160. </view>
  161. </view>
  162. <view slot="right-icon" class="action">
  163. <u-tag text="详情" plain bgColor="#38b64b" color="white" plainFill shape="circle" type="success" @click="toDetail(row)"></u-tag>
  164. </view>
  165. </u-cell>
  166. </u-cell-group>
  167. </u-swipe-action-item>
  168. </view>
  169. <!-- 加载更多 -->
  170. <u-loadmore :status="status" @loadmore="haveDone" :line="true" />
  171. </u-swipe-action>
  172. <u-back-top :scrollTop="0" mode="square"></u-back-top>
  173. </scroll-view>
  174. <!-- 页脚区域 -->
  175. <view class="footer-div">
  176. <u-button v-if="userInfo.roleNames == '巡视员' || userInfo.roleNames == '乡镇巡查员' " type="primary" text="巡视工单" @click="openPatrolWorkOrderForm()"></u-button>
  177. <u-button v-if="userInfo.roleNames == '村负责人' " type="primary" text="清运工单" @click="start()"></u-button>
  178. </view>
  179. </view>
  180. </template>
  181. <style scoped>
  182. .container {
  183. display: flex;
  184. flex-direction: column;
  185. height: 100vh;
  186. position: relative; /* 为 footer-div 提供定位上下文 */
  187. }
  188. .page {
  189. flex: 1;
  190. padding-bottom: 130px; /* 留出空间给 footer-div 和额外的 20px 间距 */
  191. overflow-y: auto;
  192. }
  193. .footer-div {
  194. height: 50px; /* 页脚高度 */
  195. text-align: center;
  196. line-height: 50px; /* 垂直居中内容 */
  197. position: fixed; /* 固定在视口底部 */
  198. bottom: 70px; /* 距离底部 100px */
  199. left: 0;
  200. width: 100%;
  201. }
  202. </style>
  203. <script>
  204. import userSelect from '@/components/user-select/user-select.vue'
  205. import pick from 'lodash.pick'
  206. import moment from 'moment'
  207. import {mapState, mapMutations, mapActions} from 'vuex'
  208. import actCategoryService from "@/api/flowable/actCategoryService"
  209. import processService from "@/api/flowable/processService"
  210. import taskService from "@/api/flowable/taskService"
  211. import notifyService from "@/api/notify/notifyService";
  212. import userService from "@/api/sys/userService"
  213. import { EventBus } from '@/store/eventBus.js';
  214. import disposeRubbishService from '@/api/garbageClearance/disposeRubbishService'
  215. import flowCopyService from "@/api/flowable/flowCopyService"
  216. export default {
  217. components:{
  218. userSelect
  219. },
  220. data() {
  221. return {
  222. tabIndex: 0,
  223. showType: 'task',
  224. status: 'loadmore',
  225. searchForm: {
  226. title: '',
  227. procInsName: ''
  228. },
  229. sprocessForm: {
  230. filterText: ''
  231. },
  232. tablePage: {
  233. pages: 0,
  234. currentPage: 0,
  235. pageSize: 10,
  236. orders: [{ column: "a.create_time", asc: false }],
  237. },
  238. loading: false,
  239. cardCur: 0,
  240. dataList: [],
  241. categoryList: [],
  242. processMap: new Map(),
  243. swiperList: [/*{
  244. id: 0,
  245. type: 'image',
  246. url: '/static/swiper/1.svg'
  247. }, {
  248. id: 1,
  249. type: 'image',
  250. url: '/static/swiper/2.svg'
  251. }, {
  252. id: 2,
  253. type: 'image',
  254. url: '/static/swiper/3.svg'
  255. }, {
  256. id: 3,
  257. type: 'image',
  258. url: '/static/swiper/4.svg'
  259. }, {
  260. id: 4,
  261. type: 'image',
  262. url: '/static/swiper/5.svg'
  263. }, {
  264. id: 5,
  265. type: 'image',
  266. url: '/static/swiper/6.svg'
  267. }, {
  268. id: 6,
  269. type: 'image',
  270. url: '/static/swiper/7.svg'
  271. }*/],
  272. dotStyle: false,
  273. towerStart: 0,
  274. direction: ''
  275. };
  276. },
  277. onLoad() {
  278. this.loadmore()
  279. },
  280. onShow() {
  281. this.loadmore()
  282. },
  283. computed:{
  284. ...mapState({
  285. username: (state) => state.user.username,
  286. userInfo: (state) => state.user.userInfo,
  287. userId: (state) => state.user.id
  288. }),
  289. dynamicStyle() {
  290. // 增加空值检查
  291. if (!this.userInfo || !this.userInfo.roleNames) {
  292. // 如果 userInfo 或 roleNames 不存在,返回一个默认样式
  293. return {
  294. height: '130px',
  295. borderRadius: '15px',
  296. backgroundImage: 'linear-gradient(to right, #3cb54b 0%, #88c546 100%)'
  297. };
  298. }
  299. // 直接通过 this.userInfo 访问 userInfo 中的属性
  300. // 如果 userInfo 存在,继续执行原来的逻辑
  301. const roleNames = this.userInfo.roleNames;
  302. // 根据从 Vuex 获取的状态来判断样式
  303. switch (roleNames) {
  304. case '过磅专员':
  305. return {
  306. height: '130px',
  307. borderRadius: '15px',
  308. backgroundImage: 'linear-gradient(to right, #3cb54b 0%, #88c546 100%)'
  309. };
  310. case '村负责人':
  311. return {
  312. height: '130px',
  313. borderRadius: '15px',
  314. backgroundImage: 'linear-gradient(to right, #0285f7 0%, #19b3bd 100%)'
  315. };
  316. case '巡视员':
  317. case '乡镇巡查员':
  318. return {
  319. height: '130px',
  320. borderRadius: '15px',
  321. backgroundImage: 'linear-gradient(to right, #fd8e03 0%, #f02d1f 100%)'
  322. };
  323. default:
  324. return {
  325. height: '130px',
  326. borderRadius: '15px',
  327. backgroundImage: 'linear-gradient(to right, #3cb54b 0%, #88c546 100%)'
  328. };
  329. }
  330. },
  331. },
  332. async mounted() {
  333. this.loadmore()
  334. //获取当前人对应的负责流程的信息
  335. this.fetchUserInfo(); // 模拟获取用户信息
  336. },
  337. created() {
  338. if(!this.username) {
  339. this.refreshUserInfo()
  340. }
  341. },
  342. methods: {
  343. async fetchUserInfo() {
  344. try {
  345. // 这里调用获取数据的 API 或者 Vuex action
  346. await this.$store.dispatch('fetchUserInfo'); // 示例
  347. this.isLoading = false; // 数据加载完成,关闭加载状态
  348. } catch (error) {
  349. console.error('获取用户信息失败:', error);
  350. this.isLoading = false; // 即使加载失败也需要关闭加载状态
  351. }
  352. },
  353. tabSelect(index) {
  354. this.tabIndex = index;
  355. this.tablePage.currentPage = 0
  356. if(1 === index){
  357. const roleNames = this.userInfo.roleNames;
  358. // 根据从 Vuex 获取的状态来判断样式
  359. if('村负责人' === roleNames){
  360. this.flowCopyShow()
  361. }else{
  362. this.haveDone()
  363. }
  364. }else {
  365. this.loadmore()
  366. }
  367. },
  368. openPatrolWorkOrderForm () {
  369. uni.navigateTo({
  370. url: '/pages/edt/PatrolWorkOrderForm',
  371. //url: '/pages/test/mobile/TestMobileForm',
  372. success: function(res) {
  373. // 跳转成功后的处理
  374. console.log('跳转成功');
  375. },
  376. fail: function(err) {
  377. // 跳转失败后的处理
  378. console.log('跳转失败', err);
  379. },
  380. complete: function() {
  381. // 无论跳转成功还是失败都会执行
  382. console.log('跳转完成');
  383. }
  384. })
  385. },
  386. // 跳转到详细页面
  387. todo (row) {
  388. taskService.getTaskDef({
  389. taskId: row.task.id,
  390. taskName: row.task.name,
  391. taskDefKey: row.task.taskDefinitionKey,
  392. procInsId: row.task.processInstanceId,
  393. procDefId: row.task.processDefinitionId,
  394. procDefKey: row.task.processDefKey,
  395. status: row.status
  396. }).then((data) => {
  397. let query = {formTitle: `${row.vars.title}`, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')};
  398. uni.navigateTo({
  399. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  400. })
  401. })
  402. },
  403. // 跳转到详细页面
  404. toDetail (row) {
  405. taskService.getTaskDef({
  406. taskDefKey: row.taskDefinitionKey,
  407. procInsId: row.processInstanceId,
  408. procDefId: row.processDefinitionId
  409. }).then((data) => {
  410. let query = {readOnly: true, taskId: row.executionId, title: `${row.name}【${row.name}】`, formTitle: `${row.name}`, ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
  411. uni.navigateTo({
  412. url: '/pages/workbench/task/TaskFormDetail?flow='+JSON.stringify(query)
  413. })
  414. })
  415. },
  416. // 输入监听
  417. inputWord(e){
  418. this.searchTimer && clearTimeout(this.searchTimer)
  419. this.searchTimer = setTimeout(()=>{
  420. this.doSearch()
  421. },300)
  422. },
  423. // 搜索
  424. doSearch(){
  425. this.dataList = [];
  426. this.tablePage.currentPage = 0;
  427. this.tablePage.pageSize = 10;
  428. this.tablePage.pages = 0;
  429. this.loadmore()
  430. },
  431. onReachBottom() {
  432. this.loadmore()
  433. },
  434. loadmore() {
  435. /*if(this.tablePage.currentPage!==0 && this.tablePage.pages <= this.tablePage.currentPage ) {
  436. this.status = 'nomore';
  437. return;
  438. }*/
  439. if(this.showType === 'history'){
  440. this.dataList = []
  441. this.showType = 'task'
  442. this.tablePage.currentPage = 0
  443. }
  444. this.tablePage.currentPage = ++ this.tablePage.currentPage;
  445. //联网加载数据
  446. this.status = 'loading';
  447. taskService.todoList({
  448. current: this.tablePage.currentPage,
  449. size: this.tablePage.pageSize,
  450. orders: this.tablePage.orders,
  451. ...this.searchForm
  452. }).then((data)=>{
  453. var idList = []
  454. for (const value of this.dataList) {
  455. idList.push(value.task.id)
  456. }
  457. for (const value of data.records) {
  458. if(!idList.includes(value.task.id)){
  459. this.dataList=this.dataList.concat(value);
  460. }
  461. }
  462. //追加新数据
  463. this.tablePage.pages = data.pages;
  464. if(this.tablePage.pages <= this.tablePage.currentPage){
  465. this.status = 'nomore'
  466. } else {
  467. this.status = 'loadmore'
  468. }
  469. if(this.showType === 'history'){
  470. this.dataList = []
  471. this.tablePage.currentPage = 0;
  472. this.haveDone()
  473. }
  474. })
  475. notifyService.getUnreadCountByIsSelf({
  476. isSelf: true,
  477. ...this.searchForm
  478. }).then((data)=>{
  479. EventBus.$emit('dataFromMessage', data); // 触发事件,传递参数
  480. })
  481. },
  482. //已办数据
  483. async haveDone() {
  484. if(this.showType === 'task'){
  485. this.dataList = [];
  486. this.showType = 'history';
  487. this.tablePage.currentPage = 0;
  488. }
  489. this.tablePage.currentPage++;
  490. this.status = 'loading';
  491. try {
  492. // 获取历史数据
  493. const data = await taskService.historicList({
  494. current: this.tablePage.currentPage,
  495. size: this.tablePage.pageSize,
  496. orders: this.tablePage.orders,
  497. ...this.searchForm
  498. });
  499. // 使用 for...of 和 await 来处理异步操作
  500. var procInsIdList = []
  501. for (const value of data.records) {
  502. if('垃圾处理流程' === value.processDefinitionName && '1' === value.vars.disposeType ){
  503. procInsIdList.push(value.processInstanceId)
  504. }
  505. }
  506. if(procInsIdList){
  507. const rubbishStationList = await disposeRubbishService.getByProcInsId(procInsIdList);
  508. for (const rubbishStation of rubbishStationList) {
  509. for (const value of data.records) {
  510. if(value.processInstanceId === rubbishStation.procInsId){
  511. value.weight = rubbishStation.weight;
  512. value.transportMileage = rubbishStation.transportMileage;
  513. value.subsidy = rubbishStation.subsidy;
  514. value.status = rubbishStation.status;
  515. }
  516. }
  517. }
  518. }
  519. this.dataList = this.dataList.concat(data.records);
  520. this.tablePage.pages = data.pages;
  521. this.status = this.tablePage.pages <= this.tablePage.currentPage ? 'nomore' : 'loadmore';
  522. if(this.showType === 'task'){
  523. this.dataList = []
  524. this.tablePage.currentPage = 0;
  525. this.loadmore()
  526. }
  527. } catch (error) {
  528. console.error('Error loading data:', error);
  529. }
  530. try {
  531. // 获取未读通知数量
  532. const unreadCount = await notifyService.getUnreadCountByIsSelf({
  533. isSelf: true,
  534. ...this.searchForm
  535. });
  536. EventBus.$emit('dataFromMessage', unreadCount);
  537. } catch (error) {
  538. console.error('Error getting unread count:', error);
  539. }
  540. },
  541. //抄送数据
  542. async flowCopyShow() {
  543. if(this.showType === 'task'){
  544. this.dataList = [];
  545. this.showType = 'history';
  546. this.tablePage.currentPage = 0;
  547. }
  548. this.tablePage.currentPage++;
  549. this.status = 'loading';
  550. try {
  551. // 获取历史数据
  552. const data = await flowCopyService.list({
  553. current: this.tablePage.currentPage,
  554. size: this.tablePage.pageSize,
  555. orders: this.tablePage.orders,
  556. ...this.searchForm
  557. });
  558. // 使用 for...of 和 await 来处理异步操作
  559. var procInsIdList = []
  560. for (const value of data.records) {
  561. procInsIdList.push(value.processInstanceId)
  562. }
  563. if(procInsIdList){
  564. const rubbishStationList = await disposeRubbishService.getByProcInsId(procInsIdList);
  565. for (const rubbishStation of rubbishStationList) {
  566. for (const value of data.records) {
  567. if(value.processInstanceId === rubbishStation.procInsId){
  568. value.weight = rubbishStation.weight;
  569. value.transportMileage = rubbishStation.transportMileage;
  570. value.subsidy = rubbishStation.subsidy;
  571. value.status = rubbishStation.status;
  572. }
  573. }
  574. }
  575. }
  576. this.dataList = this.dataList.concat(data.records);
  577. this.tablePage.pages = data.pages;
  578. this.status = this.tablePage.pages <= this.tablePage.currentPage ? 'nomore' : 'loadmore';
  579. if(this.showType === 'task'){
  580. this.dataList = []
  581. this.tablePage.currentPage = 0;
  582. this.loadmore()
  583. }
  584. } catch (error) {
  585. console.error('Error loading data:', error);
  586. }
  587. try {
  588. // 获取未读通知数量
  589. const unreadCount = await notifyService.getUnreadCountByIsSelf({
  590. isSelf: true,
  591. ...this.searchForm
  592. });
  593. EventBus.$emit('dataFromMessage', unreadCount);
  594. } catch (error) {
  595. console.error('Error getting unread count:', error);
  596. }
  597. },
  598. ...mapActions(['refreshUserInfo']),
  599. toApplyList (mail) {
  600. uni.navigateTo({
  601. url: '/pages/workbench/task/ApplyList'
  602. })
  603. },
  604. toTodoList (mail) {
  605. uni.navigateTo({
  606. url: '/pages/workbench/task/TodoList'
  607. })
  608. },
  609. toHistoryList (mail) {
  610. uni.navigateTo({
  611. url: '/pages/workbench/task/HistoryList'
  612. })
  613. },
  614. toFlowCopyList (mail) {
  615. uni.navigateTo({
  616. url: '/pages/workbench/task/FlowCopyList'
  617. })
  618. },
  619. async start () {
  620. var row = null;
  621. //根据当前人的权限获取对应的流程信息
  622. const roleNames = this.userInfo.roleNames;
  623. // 根据从 Vuex 获取的状态来判断样式
  624. switch (roleNames) {
  625. case '村负责人':
  626. this.sprocessForm.filterText = '垃圾处理流程'
  627. //根据用户id查询流程id
  628. await taskService.getProcessDefIdByRoleName({
  629. filter: "processes",
  630. modelType: 0,
  631. ...this.sprocessForm,
  632. }).then((data) => {
  633. row = data.records[0].procDef
  634. });
  635. break;
  636. }
  637. // 读取流程表单
  638. taskService.getTaskDef({
  639. procDefId: row.id,
  640. status: 'start'
  641. }).then((data) => {
  642. let processTitle = `${this.userInfo.officeDTO.name} 在 ${moment(new Date()).format('MM-DD')} 发起了 [${row.name}]`
  643. let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
  644. uni.navigateTo({
  645. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  646. })
  647. })
  648. }
  649. }
  650. }
  651. </script>
  652. <style>
  653. .cu-list.card-menu {
  654. overflow: hidden;
  655. margin-right: 5px;
  656. margin-left: 5px;
  657. border-radius: 7px;
  658. }
  659. .cu-list.card-menu.margin-top-20 {
  660. margin-top: -20px;
  661. }
  662. .cu-list.menu>.cu-item .content>uni-view:first-child {
  663. display: -webkit-box;
  664. display: -webkit-flex;
  665. display: flex;
  666. -webkit-box-align: center;
  667. /* -webkit-align-items: center; */
  668. /* align-items: center; */
  669. display: inline-block;
  670. margin-right: 5px;
  671. width: 1.6em;
  672. text-align: center;
  673. }
  674. .font-size-35{
  675. font-size: 35px!important;
  676. }
  677. .circle-button{
  678. width: 44px;
  679. height: 44px;
  680. border-radius: 18px;
  681. padding-top: 4px;
  682. }
  683. .circle-button-box{
  684. width: 25%;
  685. margin-top: 10px;
  686. display: -webkit-box;
  687. display: -webkit-flex;
  688. display: flex;
  689. -webkit-box-orient: vertical;
  690. -webkit-box-direction: normal;
  691. -webkit-flex-direction: column;
  692. flex-direction: column;
  693. -webkit-box-align: center;
  694. -webkit-align-items: center;
  695. align-items: center;
  696. -webkit-box-pack: center;
  697. -webkit-justify-content: center;
  698. justify-content: center;
  699. box-sizing: border-box;
  700. }
  701. .font-b {
  702. vertical-align: middle;
  703. font-size: 18px;
  704. font-weight: 500;
  705. color: #3a3a3a;
  706. }
  707. </style>