workbench.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  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 == '巡视员' || userInfo.roleNames == '乡镇巡查员' " type="primary" text="巡视工单" @click="start()"></u-button>
  178. <u-button v-if="userInfo.roleNames == '村负责人' " type="primary" text="清运工单" @click="start()"></u-button>
  179. </view>
  180. </view>
  181. </template>
  182. <style scoped>
  183. .container {
  184. display: flex;
  185. flex-direction: column;
  186. height: 100vh;
  187. position: relative; /* 为 footer-div 提供定位上下文 */
  188. }
  189. .page {
  190. flex: 1;
  191. padding-bottom: 130px; /* 留出空间给 footer-div 和额外的 20px 间距 */
  192. overflow-y: auto;
  193. }
  194. .footer-div {
  195. height: 50px; /* 页脚高度 */
  196. text-align: center;
  197. line-height: 50px; /* 垂直居中内容 */
  198. position: fixed; /* 固定在视口底部 */
  199. bottom: 70px; /* 距离底部 100px */
  200. left: 0;
  201. width: 100%;
  202. }
  203. </style>
  204. <script>
  205. import userSelect from '@/components/user-select/user-select.vue'
  206. import pick from 'lodash.pick'
  207. import moment from 'moment'
  208. import {mapState, mapMutations, mapActions} from 'vuex'
  209. import actCategoryService from "@/api/flowable/actCategoryService"
  210. import processService from "@/api/flowable/processService"
  211. import taskService from "@/api/flowable/taskService"
  212. import notifyService from "@/api/notify/notifyService";
  213. import userService from "@/api/sys/userService"
  214. import { EventBus } from '@/store/eventBus.js';
  215. import disposeRubbishService from '@/api/garbageClearance/disposeRubbishService'
  216. import flowCopyService from "@/api/flowable/flowCopyService"
  217. export default {
  218. components:{
  219. userSelect
  220. },
  221. data() {
  222. return {
  223. tabIndex: 0,
  224. showType: 'task',
  225. status: 'loadmore',
  226. searchForm: {
  227. title: '',
  228. procInsName: ''
  229. },
  230. sprocessForm: {
  231. filterText: ''
  232. },
  233. tablePage: {
  234. pages: 0,
  235. currentPage: 0,
  236. pageSize: 10,
  237. orders: [{ column: "a.create_time", asc: false }],
  238. },
  239. loading: false,
  240. cardCur: 0,
  241. dataList: [],
  242. categoryList: [],
  243. processMap: new Map(),
  244. swiperList: [/*{
  245. id: 0,
  246. type: 'image',
  247. url: '/static/swiper/1.svg'
  248. }, {
  249. id: 1,
  250. type: 'image',
  251. url: '/static/swiper/2.svg'
  252. }, {
  253. id: 2,
  254. type: 'image',
  255. url: '/static/swiper/3.svg'
  256. }, {
  257. id: 3,
  258. type: 'image',
  259. url: '/static/swiper/4.svg'
  260. }, {
  261. id: 4,
  262. type: 'image',
  263. url: '/static/swiper/5.svg'
  264. }, {
  265. id: 5,
  266. type: 'image',
  267. url: '/static/swiper/6.svg'
  268. }, {
  269. id: 6,
  270. type: 'image',
  271. url: '/static/swiper/7.svg'
  272. }*/],
  273. dotStyle: false,
  274. towerStart: 0,
  275. direction: ''
  276. };
  277. },
  278. onLoad() {
  279. this.loadmore()
  280. },
  281. onShow() {
  282. this.loadmore()
  283. },
  284. computed:{
  285. ...mapState({
  286. username: (state) => state.user.username,
  287. userInfo: (state) => state.user.userInfo,
  288. userId: (state) => state.user.id
  289. }),
  290. dynamicStyle() {
  291. // 增加空值检查
  292. if (!this.userInfo || !this.userInfo.roleNames) {
  293. // 如果 userInfo 或 roleNames 不存在,返回一个默认样式
  294. return {
  295. height: '130px',
  296. borderRadius: '15px',
  297. backgroundImage: 'linear-gradient(to right, #3cb54b 0%, #88c546 100%)'
  298. };
  299. }
  300. // 直接通过 this.userInfo 访问 userInfo 中的属性
  301. // 如果 userInfo 存在,继续执行原来的逻辑
  302. let roleNames = this.userInfo.roleNames;
  303. if(this.userInfo && this.userInfo.roleNames){
  304. roleNames = this.userInfo.roleNames;
  305. }
  306. // 根据从 Vuex 获取的状态来判断样式
  307. switch (roleNames) {
  308. case '过磅专员':
  309. return {
  310. height: '130px',
  311. borderRadius: '15px',
  312. backgroundImage: 'linear-gradient(to right, #3cb54b 0%, #88c546 100%)'
  313. };
  314. case '村负责人':
  315. return {
  316. height: '130px',
  317. borderRadius: '15px',
  318. backgroundImage: 'linear-gradient(to right, #0285f7 0%, #19b3bd 100%)'
  319. };
  320. case '巡视员':
  321. case '乡镇巡查员':
  322. return {
  323. height: '130px',
  324. borderRadius: '15px',
  325. backgroundImage: 'linear-gradient(to right, #fd8e03 0%, #f02d1f 100%)'
  326. };
  327. default:
  328. return {
  329. height: '130px',
  330. borderRadius: '15px',
  331. backgroundImage: 'linear-gradient(to right, #3cb54b 0%, #88c546 100%)'
  332. };
  333. }
  334. },
  335. },
  336. async mounted() {
  337. this.loadmore()
  338. //获取当前人对应的负责流程的信息
  339. this.fetchUserInfo(); // 模拟获取用户信息
  340. },
  341. created() {
  342. if(!this.username) {
  343. this.refreshUserInfo()
  344. }
  345. },
  346. methods: {
  347. async fetchUserInfo() {
  348. try {
  349. // 这里调用获取数据的 API 或者 Vuex action
  350. await this.$store.dispatch('fetchUserInfo'); // 示例
  351. this.isLoading = false; // 数据加载完成,关闭加载状态
  352. } catch (error) {
  353. console.error('获取用户信息失败:', error);
  354. this.isLoading = false; // 即使加载失败也需要关闭加载状态
  355. }
  356. },
  357. tabSelect(index) {
  358. this.tabIndex = index;
  359. this.tablePage.currentPage = 0
  360. if(1 === index){
  361. const roleNames = this.userInfo.roleNames;
  362. // 根据从 Vuex 获取的状态来判断样式
  363. if('村负责人' === roleNames){
  364. this.flowCopyShow()
  365. }else{
  366. this.haveDone()
  367. }
  368. }else {
  369. this.loadmore()
  370. }
  371. },
  372. openPatrolWorkOrderForm () {
  373. uni.navigateTo({
  374. url: '/pages/edt/PatrolWorkOrderForm',
  375. //url: '/pages/test/mobile/TestMobileForm',
  376. success: function(res) {
  377. // 跳转成功后的处理
  378. console.log('跳转成功');
  379. },
  380. fail: function(err) {
  381. // 跳转失败后的处理
  382. console.log('跳转失败', err);
  383. },
  384. complete: function() {
  385. // 无论跳转成功还是失败都会执行
  386. console.log('跳转完成');
  387. }
  388. })
  389. },
  390. // 跳转到详细页面
  391. todo (row) {
  392. taskService.getTaskDef({
  393. taskId: row.task.id,
  394. taskName: row.task.name,
  395. taskDefKey: row.task.taskDefinitionKey,
  396. procInsId: row.task.processInstanceId,
  397. procDefId: row.task.processDefinitionId,
  398. procDefKey: row.task.processDefKey,
  399. status: row.status
  400. }).then((data) => {
  401. let query = {formTitle: `${row.vars.title}`, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')};
  402. uni.navigateTo({
  403. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  404. })
  405. })
  406. },
  407. // 跳转到详细页面
  408. toDetail (row) {
  409. taskService.getTaskDef({
  410. taskDefKey: row.taskDefinitionKey,
  411. procInsId: row.processInstanceId,
  412. procDefId: row.processDefinitionId
  413. }).then((data) => {
  414. 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')}
  415. uni.navigateTo({
  416. url: '/pages/workbench/task/TaskFormDetail?flow='+JSON.stringify(query)
  417. })
  418. })
  419. },
  420. // 输入监听
  421. inputWord(e){
  422. this.searchTimer && clearTimeout(this.searchTimer)
  423. this.searchTimer = setTimeout(()=>{
  424. this.doSearch()
  425. },300)
  426. },
  427. // 搜索
  428. doSearch(){
  429. this.dataList = [];
  430. this.tablePage.currentPage = 0;
  431. this.tablePage.pageSize = 10;
  432. this.tablePage.pages = 0;
  433. this.loadmore()
  434. },
  435. onReachBottom() {
  436. this.loadmore()
  437. },
  438. loadmore() {
  439. /*if(this.tablePage.currentPage!==0 && this.tablePage.pages <= this.tablePage.currentPage ) {
  440. this.status = 'nomore';
  441. return;
  442. }*/
  443. if(this.showType === 'history'){
  444. this.dataList = []
  445. this.showType = 'task'
  446. this.tablePage.currentPage = 0
  447. }
  448. this.tablePage.currentPage = ++ this.tablePage.currentPage;
  449. //联网加载数据
  450. this.status = 'loading';
  451. taskService.todoList({
  452. current: this.tablePage.currentPage,
  453. size: this.tablePage.pageSize,
  454. orders: this.tablePage.orders,
  455. ...this.searchForm
  456. }).then((data)=>{
  457. var idList = []
  458. for (const value of this.dataList) {
  459. idList.push(value.task.id)
  460. }
  461. for (const value of data.records) {
  462. if(!idList.includes(value.task.id)){
  463. this.dataList=this.dataList.concat(value);
  464. }
  465. }
  466. //追加新数据
  467. this.tablePage.pages = data.pages;
  468. if(this.tablePage.pages <= this.tablePage.currentPage){
  469. this.status = 'nomore'
  470. } else {
  471. this.status = 'loadmore'
  472. }
  473. if(this.showType === 'history'){
  474. this.dataList = []
  475. this.tablePage.currentPage = 0;
  476. this.haveDone()
  477. }
  478. })
  479. notifyService.getUnreadCountByIsSelf({
  480. isSelf: true,
  481. ...this.searchForm
  482. }).then((data)=>{
  483. EventBus.$emit('dataFromMessage', data); // 触发事件,传递参数
  484. })
  485. },
  486. //已办数据
  487. async haveDone() {
  488. if(this.showType === 'task'){
  489. this.dataList = [];
  490. this.showType = 'history';
  491. this.tablePage.currentPage = 0;
  492. }
  493. this.tablePage.currentPage++;
  494. this.status = 'loading';
  495. try {
  496. // 获取历史数据
  497. const data = await taskService.historicList({
  498. current: this.tablePage.currentPage,
  499. size: this.tablePage.pageSize,
  500. orders: this.tablePage.orders,
  501. ...this.searchForm
  502. });
  503. // 使用 for...of 和 await 来处理异步操作
  504. var procInsIdList = []
  505. for (const value of data.records) {
  506. if('垃圾处理流程' === value.processDefinitionName && '1' === value.vars.disposeType ){
  507. procInsIdList.push(value.processInstanceId)
  508. }
  509. }
  510. if(procInsIdList){
  511. const rubbishStationList = await disposeRubbishService.getByProcInsId(procInsIdList);
  512. for (const rubbishStation of rubbishStationList) {
  513. for (const value of data.records) {
  514. if(value.processInstanceId === rubbishStation.procInsId){
  515. value.weight = rubbishStation.weight;
  516. value.transportMileage = rubbishStation.transportMileage;
  517. value.subsidy = rubbishStation.subsidy;
  518. value.status = rubbishStation.status;
  519. }
  520. }
  521. }
  522. }
  523. this.dataList = this.dataList.concat(data.records);
  524. this.tablePage.pages = data.pages;
  525. this.status = this.tablePage.pages <= this.tablePage.currentPage ? 'nomore' : 'loadmore';
  526. if(this.showType === 'task'){
  527. this.dataList = []
  528. this.tablePage.currentPage = 0;
  529. this.loadmore()
  530. }
  531. } catch (error) {
  532. console.error('Error loading data:', error);
  533. }
  534. try {
  535. // 获取未读通知数量
  536. const unreadCount = await notifyService.getUnreadCountByIsSelf({
  537. isSelf: true,
  538. ...this.searchForm
  539. });
  540. EventBus.$emit('dataFromMessage', unreadCount);
  541. } catch (error) {
  542. console.error('Error getting unread count:', error);
  543. }
  544. },
  545. //抄送数据
  546. async flowCopyShow() {
  547. if(this.showType === 'task'){
  548. this.dataList = [];
  549. this.showType = 'history';
  550. this.tablePage.currentPage = 0;
  551. }
  552. this.tablePage.currentPage++;
  553. this.status = 'loading';
  554. try {
  555. // 获取历史数据
  556. const data = await flowCopyService.list({
  557. current: this.tablePage.currentPage,
  558. size: this.tablePage.pageSize,
  559. orders: this.tablePage.orders,
  560. ...this.searchForm
  561. });
  562. // 使用 for...of 和 await 来处理异步操作
  563. var procInsIdList = []
  564. for (const value of data.records) {
  565. procInsIdList.push(value.processInstanceId)
  566. }
  567. if(procInsIdList){
  568. const rubbishStationList = await disposeRubbishService.getByProcInsId(procInsIdList);
  569. for (const rubbishStation of rubbishStationList) {
  570. for (const value of data.records) {
  571. if(value.processInstanceId === rubbishStation.procInsId){
  572. value.weight = rubbishStation.weight;
  573. value.transportMileage = rubbishStation.transportMileage;
  574. value.subsidy = rubbishStation.subsidy;
  575. value.status = rubbishStation.status;
  576. }
  577. }
  578. }
  579. }
  580. this.dataList = this.dataList.concat(data.records);
  581. this.tablePage.pages = data.pages;
  582. this.status = this.tablePage.pages <= this.tablePage.currentPage ? 'nomore' : 'loadmore';
  583. if(this.showType === 'task'){
  584. this.dataList = []
  585. this.tablePage.currentPage = 0;
  586. this.loadmore()
  587. }
  588. } catch (error) {
  589. console.error('Error loading data:', error);
  590. }
  591. try {
  592. // 获取未读通知数量
  593. const unreadCount = await notifyService.getUnreadCountByIsSelf({
  594. isSelf: true,
  595. ...this.searchForm
  596. });
  597. EventBus.$emit('dataFromMessage', unreadCount);
  598. } catch (error) {
  599. console.error('Error getting unread count:', error);
  600. }
  601. },
  602. ...mapActions(['refreshUserInfo']),
  603. toApplyList (mail) {
  604. uni.navigateTo({
  605. url: '/pages/workbench/task/ApplyList'
  606. })
  607. },
  608. toTodoList (mail) {
  609. uni.navigateTo({
  610. url: '/pages/workbench/task/TodoList'
  611. })
  612. },
  613. toHistoryList (mail) {
  614. uni.navigateTo({
  615. url: '/pages/workbench/task/HistoryList'
  616. })
  617. },
  618. toFlowCopyList (mail) {
  619. uni.navigateTo({
  620. url: '/pages/workbench/task/FlowCopyList'
  621. })
  622. },
  623. async start () {
  624. var row = null;
  625. //根据当前人的权限获取对应的流程信息
  626. const roleNames = this.userInfo.roleNames;
  627. // 根据从 Vuex 获取的状态来判断样式
  628. switch (roleNames) {
  629. case '村负责人':
  630. this.sprocessForm.filterText = '垃圾处理流程'
  631. //根据用户id查询流程id
  632. await taskService.getProcessDefIdByRoleName({
  633. filter: "processes",
  634. modelType: 0,
  635. ...this.sprocessForm,
  636. }).then((data) => {
  637. row = data.records[0].procDef
  638. });
  639. break;
  640. case '巡视员':
  641. case '乡镇巡查员':
  642. this.sprocessForm.filterText = '巡视工单流程'
  643. //根据用户id查询流程id
  644. await taskService.getProcessDefIdByRoleName({
  645. filter: "processes",
  646. modelType: 0,
  647. ...this.sprocessForm,
  648. }).then((data) => {
  649. row = data.records[0].procDef
  650. });
  651. break;
  652. }
  653. // 读取流程表单
  654. taskService.getTaskDef({
  655. procDefId: row.id,
  656. status: 'start'
  657. }).then((data) => {
  658. let processTitle = `${this.userInfo.officeDTO.name} 在 ${moment(new Date()).format('MM-DD')} 发起了 [${row.name}]`
  659. let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
  660. uni.navigateTo({
  661. url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
  662. })
  663. })
  664. }
  665. }
  666. }
  667. </script>
  668. <style>
  669. .cu-list.card-menu {
  670. overflow: hidden;
  671. margin-right: 5px;
  672. margin-left: 5px;
  673. border-radius: 7px;
  674. }
  675. .cu-list.card-menu.margin-top-20 {
  676. margin-top: -20px;
  677. }
  678. .cu-list.menu>.cu-item .content>uni-view:first-child {
  679. display: -webkit-box;
  680. display: -webkit-flex;
  681. display: flex;
  682. -webkit-box-align: center;
  683. /* -webkit-align-items: center; */
  684. /* align-items: center; */
  685. display: inline-block;
  686. margin-right: 5px;
  687. width: 1.6em;
  688. text-align: center;
  689. }
  690. .font-size-35{
  691. font-size: 35px!important;
  692. }
  693. .circle-button{
  694. width: 44px;
  695. height: 44px;
  696. border-radius: 18px;
  697. padding-top: 4px;
  698. }
  699. .circle-button-box{
  700. width: 25%;
  701. margin-top: 10px;
  702. display: -webkit-box;
  703. display: -webkit-flex;
  704. display: flex;
  705. -webkit-box-orient: vertical;
  706. -webkit-box-direction: normal;
  707. -webkit-flex-direction: column;
  708. flex-direction: column;
  709. -webkit-box-align: center;
  710. -webkit-align-items: center;
  711. align-items: center;
  712. -webkit-box-pack: center;
  713. -webkit-justify-content: center;
  714. justify-content: center;
  715. box-sizing: border-box;
  716. }
  717. .font-b {
  718. vertical-align: middle;
  719. font-size: 18px;
  720. font-weight: 500;
  721. color: #3a3a3a;
  722. }
  723. </style>