| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <template>
- <view class="blacklog-container">
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- title="我的待办"
- @clickLeft="back"
- background-color="#157A2C"
- color="#fff"
- ></uni-nav-bar>
- <view class="list-container">
- <u-list @scrolltolower="scrolltolower">
- <u-list-item v-for="(item, index) in list" :key="index">
- <view class="kd-card">
- <view class="card-title">
- <text>{{ item.processInstance.name }}</text>
- <text class="card-time">{{ item.createTime }}</text>
- </view>
- <view>
- <view class="card-body">
- <view class="card-col" v-for="itm in colOptions">
- <text class="label">{{ itm.label }}</text>
- <text class="content">{{ item[itm.key] }}</text>
- </view>
- </view>
- <view class="card-footer">
- <u-button
- type="success"
- @click="handleDetail(item, 'handle')"
- v-if="
- ['0', '2'].includes(
- item.extensionProperty.taskHandlePlatform,
- )
- "
- >处理</u-button
- >
- <u-button v-else type="error">请在PC端处理</u-button>
- <u-button type="info" @click="handleDetail(item, 'detail')"
- >流程详情</u-button
- >
- </view>
- </view>
- </view>
- </u-list-item>
- </u-list>
- </view>
- <view v-show="list.length === 0" class="no_data">
- <u-empty mode="data" textSize="30"></u-empty>
- </view>
- </view>
- </template>
- <script>
- import { getTodoTaskPage } from "@/api/wt/index.js";
- let [page, size, isEnd] = [1, 10, true];
- export default {
- computed: {
- colOptions() {
- return [
- {
- label: "流程节点",
- key: "name",
- },
- {
- label: "流程发起人",
- key: `startUserNickname`,
- },
- ];
- },
- },
- data() {
- return {
- list: [],
- params: {
- status: "",
- name: "",
- },
- };
- },
- onShow() {
- page = 1;
- this.list = [];
- this.getList();
- },
- methods: {
- scrolltolower() {
- if (isEnd) return;
- page++;
- this.getList();
- },
- //miniHandleRouter
- handleDetail(item, type) {
- console.log("111~~~", item);
- //'pages/home' + this.listData.miniHandleRouter
- ///wt/components/feeApplication/taskSubmit
- if (type == "handle") {
- console.log(Object.keys(item.formJson).length);
- if (Object.keys(item.formJson).length) {
- let params = JSON.stringify({
- id: item.id,
- processInstanceId: item.processInstance.id || "",
- type: type,
- });
- let queryParams = `params=${params}`;
- let url = "/pages/home/wt/components/formParser/routerView";
- uni.navigateTo({
- url: `${url}?${queryParams}`,
- });
- } else {
- let queryParams = `id=${item.processInstance.id}&businessId=${item.businessId}&taskId=${item.id}&taskDefinitionKey=${item.taskDefinitionKey}&miniHandleRouter=${item.miniHandleRouter}&miniViewRouter=${item.miniViewRouter}`;
- let url =
- "/pages/home" +
- item.miniHandleRouter.replace("taskForm", "processTask");
- console.log("url~~~", `${url}?${queryParams}`);
- uni.navigateTo({
- url: `${url}?${queryParams}`,
- });
- }
- //
- } else {
- uni.navigateTo({
- url: `/pages/home/wt/components/detail?processInstanceId=${item.processInstance.id}`,
- });
- }
- },
- async getList() {
- let paging = {
- pageNo: page,
- pageSize: size,
- processType: 0,
- };
- let par = Object.assign(paging, this.params);
- isEnd = false;
- const data = await getTodoTaskPage(par);
- this.list.push(...data.list);
- this.list.forEach((item) => {
- item.startUserNickname = item.processInstance.startUserNickname;
- });
- isEnd = this.list.length >= data.count;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .blacklog-container {
- height: 100vh;
- display: flex;
- flex-direction: column;
- }
- .list-container {
- flex: 1;
- padding: 24rpx;
- background: $page-bg;
- flex: 1;
- overflow: hidden;
- // position: absolute;
- // top: 88rpx;
- // bottom: 0;
- // left: 0;
- // right: 0;
- /deep/ .u-list {
- height: 100% !important;
- }
- }
- .no_data {
- position: fixed;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- color: #999;
- font-size: 50rpx;
- }
- .kd-card {
- font-size: 34rpx;
- color: #333;
- background-color: #fff;
- border-radius: 10rpx;
- word-break: break-all;
- margin-bottom: 24rpx;
- .status {
- font-weight: normal;
- }
- .card-title {
- font-size: 1rem;
- font-weight: bold;
- .card-time {
- font-weight: normal;
- color: #bfbfbf;
- font-size: 0.9rem;
- align-self: center;
- }
- }
- .card-footer,
- .card-title {
- display: flex;
- justify-content: space-between;
- padding: 30rpx 30rpx;
- }
- .card-footer {
- padding: 10rpx 30rpx 18rpx 30rpx;
- font-size: 0.8rem;
- /deep/ .u-button {
- width: 48%;
- }
- }
- .card-body {
- padding: 0 28rpx;
- position: relative;
- min-height: 150rpx;
- }
- .card-body:after {
- content: "";
- position: absolute;
- left: auto;
- top: auto;
- bottom: 10rpx;
- right: auto;
- height: 1rpx;
- width: 91%;
- background-color: #f1f1f1;
- }
- .card-col {
- padding: 8rpx 0;
- display: flex;
- // line-height: ;
- .content {
- flex: 1;
- overflow: hidden;
- font-size: 0.9rem;
- }
- .label {
- font-size: 0.9rem;
- color: #999;
- width: 25%;
- }
- }
- }
- </style>
|