ソースを参照

部分页面和功能

user5 8 ヶ月 前
コミット
525df1bb47

+ 8 - 0
api/notify/notifyService.js

@@ -39,4 +39,12 @@ export default {
 			params: params,
 		});
 	},
+
+	getUnreadCountByIsSelf: function (params) {
+		return request({
+			url: "/notify/getUnreadCountByIsSelf",
+			method: "get",
+			params: params,
+		});
+	},
 };

+ 4 - 1
common/request.js

@@ -29,6 +29,7 @@ function error(res){
 	}
 }
 export function request(body){
+	console.log(body)
 	let {url,method,data,header, params, responseType} = body
 	data = data || params || {};
 	header = header || {'Content-Type': 'application/json; charset=utf-8'}
@@ -77,10 +78,12 @@ export function upload(url, filePath,filename, formData,header,success,fail){
 	let name = filename || 'file';
 	header = header || {};
 	let token = $auth.getUserToken();
+	console.log("文件上传时token:", token)
+	console.log("文件上传时header.token:", header.token)
 	if(token){
 		header.token = token;			// 获取token值
 	}
-	
+	console.log("上传的url:",BASE_URL + url)
 	let promise = new Promise((resolve,reject)=>{
 		uni.uploadFile({
 			url: BASE_URL + url,

+ 7 - 1
pages.json

@@ -164,8 +164,14 @@
 			"style": {
 				"navigationBarTitleText": "uView UI"
 			}
+		},
+		{
+			"path" : "pages/edt/PatrolWorkOrderForm",
+			"style" : {
+				"navigationBarTitleText": "建筑垃圾处理"
+			}
 		}
-    ],
+	],
 	"subPackages": [{
 		"root": "pages/example/componentsA",
 		"pages": [

+ 466 - 0
pages/edt/PatrolWorkOrderForm.vue

@@ -0,0 +1,466 @@
+<template>
+    <view>
+        <cu-custom :backUrl="'/pages/index/index?id=apps'" :isBack="true" bgColor="bg-gradual-blue" >
+            <block slot="content">建筑垃圾处理</block>
+        </cu-custom>
+        <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" v-if="!nodeFlag" >
+
+
+            <u-form-item label="巡视工单" prop="no"
+                         :rules="[
+				     ]">
+                <u--input v-model="inputForm.no" :disabled="true" placeholder="工单编号" clearable></u--input>
+            </u-form-item>
+
+            <u-form-item label="处理单位" borderBottom prop="processingUnit" :required="true">
+                <jp-picker v-model="inputForm.processingUnit" rangeKey="label" rangeValue="value" :range="[
+                    { label: '审计费', value: '1' },
+                    { label: '工程审核费', value: '2' },
+                    { label: '咨询费', value: '3' },
+                    { label: '预算编制费', value: '4' },
+                    { label: '招标代理费', value: '5' },
+                    { label: '司法鉴定费', value: '6' },
+                    { label: '其他', value: '8' },
+                    { label: '技术服务费', value: '9' },
+                    { label: '鉴证咨询服务*评估费', value: '10' },
+                    { label: '其他咨询服务*专家咨询费', value: '11' },
+                    { label: '会计服务', value: '12' },
+                    { label: '竣工决算编制费', value: '13' },
+                    { label: '*信息技术服务*技术服务费', value: '14' },
+                ]" ></jp-picker>
+            </u-form-item>
+
+            <u-form-item label="清运专员" prop="clearUserName"
+                         :rules="[
+				     ]">
+                <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="清运专员" clearable></u--input>
+            </u-form-item>
+
+            <u-form-item label="联系方式" prop="clearUserMobile"
+                         :rules="[
+				     ]">
+                <u--input v-model="inputForm.clearUserMobile" :disabled="true" placeholder="联系方式" clearable></u--input>
+            </u-form-item>
+
+            <view class="u-demo-block">
+                <text class="u-demo-block__title">基础用法</text>
+                <view class="u-demo-block__content">
+                    <view class="u-page__upload-item">
+                        <u-upload
+                                :fileList="fileList1"
+                                @afterRead="afterRead"
+                                @delete="deletePic"
+                                name="1"
+                                multiple
+                                :maxCount="10"
+                        ></u-upload>
+                    </view>
+                </view>
+            </view>
+
+        </u--form>
+    </view>
+</template>
+
+<script>
+    import {mapState, mapMutations, mapActions} from 'vuex'
+    import * as $auth from "../../common/auth";
+    export default {
+        components: {
+        },
+        computed: mapState({
+            userInfo: (state) => state.user.userInfo,
+            avatar: (state) => state.user.avatar
+        }),
+        data () {
+            return {
+                fileList1: [],
+                nodeFlag: false,
+                inputForm: {
+                    no: '',
+                    processingUnit: '',
+                    clearUserId: '',
+                    clearUserName: '',
+                    clearUserMobile: ''
+                },
+                rules: {
+                    /*'billingWorkplaceReal': [
+                        {
+                            required: true,
+                            message: '实际开票单位不能为空',
+                            trigger: ['blur', 'change']
+                        }
+                    ],*/
+                }
+            }
+        },
+        /*ossService: null,
+        materialTypeService: null,
+        wareHouseService: null,
+        commonApi: null,*/
+        // 页面加载时执行
+        created() {
+
+            /*this.ossService = new OSSService()
+            this.commonApi = new CommonApi()
+            this.materialTypeService = new MaterialTypeService()
+            this.wareHouseService = new WareHouseService()
+
+            this.inputForm.actualDrawerEmailAddress = this.userInfo.email
+            this.inputForm.handledBy = this.userInfo.name
+            this.inputForm.handledById = this.userInfo.id
+            this.inputForm.handledByOffice = this.userInfo.officeDTO.id
+            this.inputForm.handledByOfficeName = this.userInfo.officeDTO.name*/
+
+        },
+        props: {
+            status: {
+                type: String,
+                default: ''
+            }
+        },
+        watch: {
+        },
+        methods: {
+           init (id) {
+               this.nodeFlag = true
+                this.inputForm.id = id
+                /*if (id) {
+                   financeInvoiceService.queryById(id).then((data) => {
+
+                       if (this.status === 'testSee') {
+                           this.nodeFlag = true
+                           this.testFlag = true
+                       } else {
+                           this.commonApi.getTaskNameByProcInsId(data.procInsId).then((data) => {
+                               if (this.isNotEmpty(data)) {
+                                   if (data === '发起人重新申请' || this.isEmpty(data)) {
+                                       this.nodeFlag = false
+                                   } else if (data === '发票管理员审核'){
+                                       this.nodeFlag = true
+                                       this.addFlag = true
+                                   }
+                               }else {
+                                   this.testFlag = true
+                                   this.addFlag = true
+                                   console.log('没有')
+                               }
+                           })
+                       }
+
+
+                        this.inputForm = this.recover(this.inputForm, data)
+
+                        if (this.inputForm.workAttachmentDtoList) {
+                            this.inputForm.workAttachmentDtoList.forEach( (item,index) => {
+                                this.$set(this.showFileList, index, true);
+                            })
+                        }
+
+                       let i = this.inputForm.financeInvoiceBaseDTOList.length
+                       let sun = 0
+                       for (let j = 0; j < i; j++) {
+                           sun = (100*sun + 100* this.inputForm.financeInvoiceBaseDTOList[j].account)/100
+                       }
+
+                       this.inputForm.accountTotal = sun
+                       this.inputForm.billingDate = this.formatDate(new Date())
+                       if ( !this.nodeFlag && this.status !== 'testSee') {
+                           this.inputForm.financeInvoiceDetailDTOList.push({
+                               code: '',
+                               number: '',
+                               account: sun,
+                               rate: '',
+                               amount: '',
+                               tax: '',
+                               allAmount: ''
+                           })
+                       }
+
+                       if (!this.isEmpty(this.inputForm.billingWorkplaceRealId)) {
+                           this.bankList = []
+                           workClientService.queryById(this.inputForm.billingWorkplaceRealId).then((data) => {
+                               if (this.isNotEmpty(data.cwWorkClientBillingDTOList)) {
+                                   data.cwWorkClientBillingDTOList.forEach(i => {
+                                       i.ourBank = i.accountHolder
+                                       let test = {label: i.ourBank, value: i.id, account: i.account}
+                                       this.bankList.push(test)
+                                       this.$set(this.inputForm, 'openBank', i.id);
+                                   })
+                               } else {
+                                   this.bankList = []
+                               }
+                           })
+                       }
+                    })
+                }*/
+            },
+            formatDate(date) {
+                const dateNew = new Date(date); // 将日期字符串转换为 Date 对象
+                const year = dateNew.getFullYear();
+                const month = (dateNew.getMonth() + 1).toString().padStart(2, '0');
+                const day = dateNew.getDate().toString().padStart(2, '0');
+                return `${year}-${month}-${day}`;
+            },
+            isEmpty(value) {
+                let result = false;
+                if (value == null || value == undefined) {
+                    result = true;
+                }
+                if (typeof value == 'string' && (value.replace(/\s+/g, "") == "" || value == "")) {
+                    result = true;
+                }
+                if (typeof value == "object" && value instanceof Array && value.length === 0) {
+                    result = true;
+                }
+                return result;
+            },
+            isNotEmpty (value) {
+                return !this.isEmpty(value)
+            },
+            /**
+             * 判断是否为空
+             */
+            isNull(val) {
+                if (val instanceof Array) {
+                    if (val.length === 0) return true;
+                } else if (val instanceof Object) {
+                    if (JSON.stringify(val) === "{}") return true;
+                } else {
+                    if (
+                        val === "null" ||
+                        val == null ||
+                        val === "undefined" ||
+                        val === undefined ||
+                        val === ""
+                    )
+                        return true;
+                    return false;
+                }
+                return false;
+            },
+
+            formatDateNew(date) {
+                const year = date.getFullYear();
+                const month = (date.getMonth() + 1).toString().padStart(2, '0');
+                const day = date.getDate().toString().padStart(2, '0');
+                const hours = date.getHours().toString().padStart(2, '0');
+                const minutes = date.getMinutes().toString().padStart(2, '0');
+                const seconds = date.getSeconds().toString().padStart(2, '0');
+
+                return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+            },
+            saveForm(callback) {
+                return new Promise((resolve, reject) => {
+                    // 表单规则验证
+                    // ...
+
+                    let errors = [];
+
+
+                    /*if (errors.length > 0) {
+                        // 存在错误,显示提示信息
+                        errors.forEach(error => {
+                            uni.showToast({
+                                title: error,
+                                icon: 'none',
+                                duration: 2000
+                            });
+                        });
+                        reject('Form validation failed');
+                    } else {
+                        this.inputForm.account = this.inputForm.accountTotal
+                        // 所有验证通过,执行保存操作
+                        this.$refs.inputForm.validate().then(() => {
+                            uni.showLoading();
+                            this.inputForm.status = '2';
+                            financeInvoiceService.saveForm(this.inputForm).then(data => {
+                                callback(data.businessTable, data.businessId);
+                                resolve('Form saved successfully');
+                            }).catch(error => {
+                                reject('Save operation failed');
+                            });
+                        }).catch(() => {
+                            reject('Form validation failed');
+                        });
+                    }*/
+                });
+            },
+
+            // 修改状态
+            /*async updateStatusById (type, callback) {
+                if (type === 'reject' || type === 'reback') {
+                    financeInvoiceService.queryById(this.inputForm.id).then((data) => {
+                        if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+                            this.loading = false
+                            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                            throw new Error()
+                        } else {
+                            if (type === 'reject') {
+                                // 驳回
+                                this.inputForm.status = '4'
+                            }
+                            if (type === 'reback') {
+                                // 撤回
+                                this.inputForm.status = '3'
+                            }
+                            if (type === 'reject' || type === 'reback') {
+                                let param = {status: this.inputForm.status, id: this.inputForm.id}
+                                financeInvoiceService.updateStatusById(param).then(() => {
+                                    this.loading = false
+                                    callback()
+                                })
+                            }
+                        }
+                    })
+                } else if (type === 'hold') {
+                    financeInvoiceService.queryById(this.inputForm.id).then((data) => {
+                        if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+                            this.loading = false
+                            this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                            throw new Error()
+                        } else {
+                            // 终止
+                            let param = {status: '1', id: this.inputForm.id}
+                            financeInvoiceService.updateStatusById(param).then(() => {
+                                this.loading = false
+                                callback()
+                            })
+                        }
+                    })
+                }
+            },*/
+            /*reapplyForm (callback) {
+                this.loading = true
+                financeInvoiceService.queryById(this.inputForm.id).then((data) => {
+                    if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+                        this.loading = false
+                        this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                        throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+                    } else {
+                        this.startFormTrue(callback)
+                    }
+                })
+            },*/
+            // 送审
+            /*async startFormTrue (callback) {
+                this.$refs.inputForm.validate().then(res => {
+                    this.inputForm.status = '2'
+                    financeInvoiceService.saveForm(this.inputForm).then((data) => {
+                        this.inputForm.id = data.businessId
+                        callback(data.businessTable, data.businessId, this.inputForm)
+                        this.$refs.inputForm.resetFields()
+                        this.loading = false
+                    }).catch(() => {
+                        this.$refs.inputForm.resetFields()
+                    }).catch((e) => {
+
+                    })
+                })
+            },*/
+            // 通过
+            /*async agreeForm (callback) {
+
+                return new Promise((resolve, reject) => {
+                    // 表单规则验证
+                    // ...
+
+                    let errors = [];
+                    let acc = 0
+
+                    if (errors.length > 0) {
+                        // 存在错误,显示提示信息
+                        errors.forEach(error => {
+                            uni.showToast({
+                                title: error,
+                                icon: 'none',
+                                duration: 2000
+                            });
+                        });
+                        reject('Form validation failed');
+                    } else {
+                        // 所有验证通过,执行保存操作
+                        this.$refs.inputForm.validate().then(res => {
+                            this.inputForm.status = '5'
+                            financeInvoiceService.saveForm(this.inputForm).then((data) => {
+                                callback(data.businessTable, data.businessId, this.inputForm)
+                                this.$refs.inputForm.resetFields()
+                                this.loading = false
+                            }).catch(() => {
+                                this.loading = false
+                                this.$refs.inputForm.resetFields()
+                            })
+                        })
+                    }
+                });
+            },*/
+
+            // 删除图片
+            deletePic(event) {
+                this[`fileList${event.name}`].splice(event.index, 1)
+            },
+            // 新增图片
+            async afterRead(event) {
+                // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
+                let lists = [].concat(event.file)
+                let fileListLen = this[`fileList${event.name}`].length
+                lists.map((item) => {
+                    this[`fileList${event.name}`].push({
+                        ...item,
+                        status: 'uploading',
+                        message: '上传中'
+                    })
+                })
+                for (let i = 0; i < lists.length; i++) {
+                    const result = await this.uploadFilePromise(lists[i].url)
+                    let item = this[`fileList${event.name}`][fileListLen]
+                    this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
+                        status: 'success',
+                        message: '',
+                        url: result
+                    }))
+                    fileListLen++
+                }
+            },
+            uploadFilePromise(url) {
+                console.log($auth.getUserToken())
+                return new Promise((resolve, reject) => {
+                    let a = uni.uploadFile({
+                        url: 'http://localhost:8000/app/file/upload', // 仅为示例,非真实的接口地址
+                        filePath: url,
+                        name: 'file',
+                        formData: {
+                            user: this.$store.state.user.userInfo
+                        },
+                        header: {
+                            'token': $auth.getUserToken(),
+                        },
+                        success: (res) => {
+                            setTimeout(() => {
+                                resolve(res.data.data);
+                            }, 1000);
+                        },
+                        fail: (err) => {
+                            console.error('Upload failed:', err);
+                        }
+                    });
+                })
+            },
+        }
+    }
+</script>
+
+<style>
+    .cu-form-group .title {
+        min-width: calc(4em + 40px);
+    }
+
+    /* 样式示例,您可能需要根据实际情况调整 */
+    .upload-demo {
+        width: 40%;
+    }
+    .button-container {
+        margin-top: 10px;
+        text-align: right;
+    }
+</style>

+ 33 - 15
pages/index/index.vue

@@ -15,7 +15,7 @@
 			<view class="action" @click="NavChange" data-cur="message">
 				<view :class="PageCur=='message'?'text-blue':'text-gray'">
 					<text class="lg" :class="PageCur=='message'?'cuIcon-messagefill':'cuIcon-message'">
-						<text class='cu-tag badge'>0</text>
+						<text class='cu-tag badge'>{{notificationCount}}</text>
 					</text>
 					<text>消息</text>
 				</view>
@@ -44,34 +44,52 @@
 </template>
 
 <script>
-	import addressbook from '@/pages/addressbook/addressbook.vue'
-	import person from '@/pages/user/person/person.vue'
-	import message from '@/pages/message/message.vue'
-	import workbench from '@/pages/workbench/workbench.vue'
-	import apps from '@/pages/apps/apps.vue'
+	import { mapState, mapActions } from 'vuex';
+	import addressbook from '@/pages/addressbook/addressbook.vue';
+	import person from '@/pages/user/person/person.vue';
+	import message from '@/pages/message/message.vue';
+	import workbench from '@/pages/workbench/workbench.vue';
+	import apps from '@/pages/apps/apps.vue';
+	import { EventBus } from '@/store/eventBus.js';
+
 	export default {
-		components:{
+		components: {
+			addressbook,
 			person,
 			message,
 			workbench,
-			apps,
-			addressbook
+			apps
 		},
 		data() {
 			return {
-				PageCur: 'workbench'
-			}
+				PageCur: 'workbench',
+				notificationCount: 0
+			};
+		},
+		computed: {
+			...mapState({
+				messageDataList: state => state.messageDataList // 映射 Vuex state 到组件的计算属性
+			})
+		},
+		mounted() {
+			EventBus.$on('dataFromMessage', (data) => {
+				this.handleMessageData(data); // 处理接收到的数据
+			});
 		},
 		methods: {
 			NavChange: function(e) {
 				this.PageCur = e.currentTarget.dataset.cur
+			},
+			handleMessageData(data) {
+				// 处理 message.vue 传递过来的参数
+				this.notificationCount = data
 			}
 		}
-	}
+	};
 </script>
 
 <style>
-.cu-tag.badge {
-	right: 4px;
-}
+	.cu-tag.badge {
+		right: 4px;
+	}
 </style>

+ 11 - 2
pages/message/message.vue

@@ -54,7 +54,8 @@
 </template>
 
 <script>
-	import notifyService from "@/api/notify/notifyService";	
+	import notifyService from "@/api/notify/notifyService";
+	import { EventBus } from '@/store/eventBus.js';
 	export default {
 		data() {
 			return {
@@ -115,7 +116,7 @@
 			onReachBottom() {
 				this.loadmore()
 			},
-			loadmore() {
+			async loadmore() {
 				if(this.tablePage.currentPage!==0 && this.tablePage.pages <= this.tablePage.currentPage ) {
 					this.status = 'nomore';
 					return;
@@ -139,6 +140,14 @@
 						this.status = 'loadmore'
 					}
 				})
+
+				notifyService.getUnreadCountByIsSelf({
+					isSelf: true,
+					...this.searchForm
+				}).then((data)=>{
+					EventBus.$emit('dataFromMessage', data); // 触发事件,传递参数
+				})
+
 				
 			},
 			del (id) {

+ 13 - 0
pages/user/person/person.vue

@@ -67,12 +67,17 @@
   import userService from "@/api/sys/userService"
   import loginService from "@/api/auth/loginService"
   import fileService from "@/api/file/fileService.js"
+  import notifyService from "@/api/notify/notifyService";
+  import { EventBus } from '@/store/eventBus.js';
   export default {
 	name: "person",
 	computed: mapState({
 		 userInfo: (state) => state.user.userInfo,
 		 avatar: (state) => state.user.avatar
 		}),
+	  created() {
+		  this.getUnreadCountByIsSelf()
+	  },
     methods: {
 	  ...mapActions(['refreshUserInfo']),
       /**
@@ -83,6 +88,14 @@
           url: '/pages/user/setting/password/password'
         })
       },
+		getUnreadCountByIsSelf() {
+		  notifyService.getUnreadCountByIsSelf({
+			  isSelf: true,
+			  ...this.searchForm
+		  }).then((data)=>{
+			  EventBus.$emit('dataFromMessage', data); // 触发事件,传递参数
+		  })
+      },
 	 ChooseImage() {
 	 	uni.chooseImage({
 	 		count: 4, //默认9

+ 340 - 102
pages/workbench/workbench.vue

@@ -1,71 +1,212 @@
 <template>
-	<view>
+	<view class="container">
+		<!-- 顶部自定义导航栏 -->
 		<cu-custom bgColor="bg-blue">
 			<block slot="content"> 工作台</block>
 		</cu-custom>
-		<swiper class="screen-swiper square-dot bg-blue"  :indicator-dots="true" :circular="true"
-		 :autoplay="true" interval="2000" duration="500">
-			<swiper-item v-for="(item,index) in swiperList"  :key="index">
-				<image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
-				<video :src="item.url" autoplay loop muted :show-play-btn="false" :controls="false" objectFit="cover" v-if="item.type=='video'"></video>
-			</swiper-item>
-		</swiper>
+
+		<!-- 信息区域 -->
+		<view class="col-1 no-border fixed" style="margin:5px 10px 5px 10px;">
+			<view style="height:130px;border-radius: 15px;background-image: linear-gradient(to right, #3cb54b 0%, #88c546 100%);">
+				<view class="col-1 no-border fixed" style="padding:20px 40px 20px 40px;">
+					<!-- 个人信息 -->
+					<view class="ellipsis-description" style="font-size: 16px">
+            <span style="padding:5px;display: inline-block; width: 80px">
+              <span style="font-weight: bold">过磅专员</span>
+            </span>
+						<span style="padding-left: 30px;display: inline-block;">
+              <span class="cuIcon-locationfill" style="color: #FFFFFF;margin-right: 5px;"></span>
+              <span style="color: #FFFFFF;font-weight: bold">前进村建筑垃圾清理处</span>
+            </span>
+					</view>
+					<view class="ellipsis-description" style="font-size: 16px">
+            <span style="padding:5px;display: inline-block; width: 80px">
+              <span style="color: #FFFFFF;font-weight: bold">姓名</span>
+            </span>
+						<span style="padding-left: 30px;display: inline-block;">
+              <span style="color: #FFFFFF;font-weight: bold">张红旗</span>
+            </span>
+					</view>
+					<view class="ellipsis-description" style="font-size: 16px">
+            <span style="padding:5px;display: inline-block; width: 80px">
+              <span style="color: #FFFFFF;font-weight: bold">联系方式</span>
+            </span>
+						<span style="padding-left: 30px;display: inline-block;">
+              <span style="color: #FFFFFF;font-weight: bold">13900000001</span>
+            </span>
+					</view>
+				</view>
+			</view>
+		</view>
+
+		<!-- 功能按钮区域 -->
 		<view class="cu-list grid col-4 no-border fixed">
 			<view @tap="toTodoList" class="circle-button-box">
 				<view class="cuIcon-time text-blue circle-button font-size-35"></view>
 				<text>待办事项</text>
 			</view>
 			<view @tap="toHistoryList" class="circle-button-box">
-				<view class="cuIcon-roundcheck  text-blue circle-button font-size-35"></view>
+				<view class="cuIcon-roundcheck text-blue circle-button font-size-35"></view>
 				<text>已办事项</text>
 			</view>
 			<view @tap="toApplyList" class="circle-button-box">
-				<view   class="cuIcon-peoplelist text-blue circle-button font-size-35"></view>
+				<view class="cuIcon-peoplelist text-blue circle-button font-size-35"></view>
 				<text>我发起的</text>
 			</view>
 			<view @tap="toFlowCopyList" class="circle-button-box">
-				<view class="cuIcon-copy  text-blue circle-button font-size-35"></view>
+				<view class="cuIcon-copy text-blue circle-button font-size-35"></view>
 				<text>抄送给我</text>
 			</view>
 		</view>
+
+		<!-- 标签切换区域 -->
+		<view>
+			<u-subsection
+					:list="['待处理', '已处理']"
+					mode="button"
+					:fontSize="16"
+					:current="tabIndex"
+					@change="tabSelect"
+			></u-subsection>
+		</view>
+
+		<!-- 过磅记录 -->
+		<view style="margin: 11px 28px;">
+			<view class="ellipsis-description" style="font-size: 20px">
+        <span style="margin-right: 10px;">
+          <span class="cuIcon-title" style="color: #f67e1f;margin-right: 5px;"></span>
+          <span style="font-weight: bold">过磅记录</span>
+        </span>
+			</view>
+		</view>
+
+		<!-- 可滚动内容区域 -->
 		<scroll-view scroll-y class="page">
-			<template v-for="key in processMap.keys()">
-				<view class="cu-bar bg-white solid-bottom margin-top">
-					<view class="action">
-						<text class=" text-orange font-b">{{key}}</text>
-					</view>
-				</view>
-				<view class="cu-list grid col-4 no-border">
-				<view class="circle-button-box" @click="start(act)" v-for="(act, index) in processMap.get(key)" :key="index">
-					<view class="cuIcon-calendar bg-blue text-white circle-button font-size-35"></view>
-					<text class="ellipsis-description">{{act.name}}</text>
-				</view>
+			<!-- 其他可滚动内容 -->
+			<u-swipe-action>
+				<view v-for="(row, index) in dataList" :key="index">
+					<u-swipe-action-item @click="todo(row)" :key="row.id" :threshold="60" duration="500"
+										 :options="[{ text: '办理', style: { backgroundColor: '#3c9cff' } }]">
+						<u-cell-group>
+							<u-cell @click="todo(row)">
+								<view slot="title" class="content" style="line-height: 1.5;">
+									<view class="text-bold text-grey">
+										<view class="ellipsis-description" style="font-size: 16px">
+                      <span style="margin-right: 10px;">
+                        <span class="cuIcon-timefill" style="color: #3c9cff;margin-right: 5px;"></span>
+                        <span>08-20</span>
+                      </span>
+											<span style="margin-right: 10px;">
+                        <span class="cuIcon-locationfill" style="color: #f67e1f;margin-right: 5px;"></span>
+                        <span>前进村</span>
+                      </span>
+										</view>
+									</view>
+									<view class="text-grey text-sm" style="font-size: 16px">
+										<div style="margin-right: 20px; float: left">
+											<u-tag-small text="进行中" plain shape="circle" type="error"></u-tag-small>
+										</div>
+										<div style="margin-right: 10px; float: left">
+											<span class="cuIcon-deliver" style="color: #d95141;margin-right: 5px;"></span>
+											<span>12.5km</span>
+										</div>
+										<div style="margin-right: 10px;">
+											<span class="cuIcon-deletefill" style="color: #38b64b;margin-right: 5px;"></span>
+											<span>2.2t</span>
+										</div>
+									</view>
+								</view>
+								<view slot="right-icon" class="action">
+									<u-tag text="处理" plain bgColor="#38b64b" color="white" plainFill shape="circle" type="success" @click="todo(row)"></u-tag>
+								</view>
+							</u-cell>
+						</u-cell-group>
+					</u-swipe-action-item>
 				</view>
-			</template>
+			</u-swipe-action>
 
-			<u-gap height="80" bgColor="#fff"></u-gap>
+			<!-- 加载更多 -->
+			<u-loadmore :status="status" @loadmore="loadmore" :line="true" />
+			<u-back-top :scrollTop="0" mode="square"></u-back-top>
 		</scroll-view>
+
+		<!-- 页脚区域 -->
+		<view class="footer-div">
+			<u-button type="primary" text="创建工单" @click="openPatrolWorkOrderForm()"></u-button>
+		</view>
 	</view>
 </template>
 
+<style scoped>
+	.container {
+		display: flex;
+		flex-direction: column;
+		height: 100vh;
+		position: relative; /* 为 footer-div 提供定位上下文 */
+	}
+
+	.page {
+		flex: 1;
+		padding-bottom: 130px; /* 留出空间给 footer-div 和额外的 20px 间距 */
+		overflow-y: auto;
+	}
+
+	.footer-div {
+		height: 50px; /* 页脚高度 */
+		text-align: center;
+		line-height: 50px; /* 垂直居中内容 */
+		position: fixed; /* 固定在视口底部 */
+		bottom: 70px; /* 距离底部 100px */
+		left: 0;
+		width: 100%;
+	}
+</style>
+
+
+
+
+
+
+
 <script>
+	import userSelect from '@/components/user-select/user-select.vue'
+	import pick from 'lodash.pick'
 	import moment from 'moment'
 	import {mapState, mapMutations, mapActions} from 'vuex'
 	import actCategoryService from "@/api/flowable/actCategoryService"
 	import processService from "@/api/flowable/processService"
 	import taskService from "@/api/flowable/taskService"
+	import notifyService from "@/api/notify/notifyService";
+	import userService from "@/api/sys/userService"
+	import { EventBus } from '@/store/eventBus.js';
 	export default {
+		components:{
+			userSelect
+		},
 		data() {
+
 			return {
+				tabIndex: 0,
+				status: 'loadmore',
+				searchForm: {
+					title: ''
+				},
+				tablePage: {
+					pages: 0,
+					currentPage: 0,
+					pageSize: 10,
+					orders: [{ column: "a.create_time", asc: false }],
+				},
+				loading: false,
 				cardCur: 0,
 				dataList: [],
 				categoryList: [],
 				processMap: new Map(),
-				swiperList: [{
+				swiperList: [/*{
 					id: 0,
 					type: 'image',
 					url: '/static/swiper/1.svg'
-				}/*, {
+				}, {
 					id: 1,
 					type: 'image',
 					url: '/static/swiper/2.svg'
@@ -95,12 +236,20 @@
 				direction: ''
 			};
 		},
+		onLoad() {
+			console.log('onLoad')
+			this.loadmore()
+		},
 		computed: mapState({
-			 username: (state) => state.user.username
+			 username: (state) => state.user.username,
+			 userId: (state) => state.user.id
 		}),
-	    async mounted() {
-			
-			let res = await actCategoryService.treeData()
+		async mounted() {
+			this.loadmore()
+			//获取当前人对应的负责流程的信息
+
+
+			/*let res = await actCategoryService.treeData()
 			let data = await processService.list({current: 1, size: -1})
 			this.processMap = new Map()
 			res.forEach((item)=>{
@@ -115,110 +264,199 @@
 					this.processMap.set(item.category, [item])
 				}
 			})
-			
+
 			for(let [key,value] of this.processMap){
 			    console.log(key,value);
-			}
-			
-			
+			}*/
+
+
 		},
 		created() {
 			if(!this.username) {
 				this.refreshUserInfo()
 			}
 		},
+
 		methods: {
-			 ...mapActions(['refreshUserInfo']),
+			tabSelect(index) {
+				this.tabIndex = index;
+			},
+			openPatrolWorkOrderForm () {
+				uni.navigateTo({
+					url: '/pages/edt/PatrolWorkOrderForm',
+					//url: '/pages/test/mobile/TestMobileForm',
+					success: function(res) {
+						// 跳转成功后的处理
+						console.log('跳转成功');
+					},
+					fail: function(err) {
+						// 跳转失败后的处理
+						console.log('跳转失败', err);
+					},
+					complete: function() {
+						// 无论跳转成功还是失败都会执行
+						console.log('跳转完成');
+					}
+				})
+			},
+			// 跳转到详细页面
+			todo (row) {
+				taskService.getTaskDef({
+					taskId: row.task.id,
+					taskName: row.task.name,
+					taskDefKey: row.task.taskDefinitionKey,
+					procInsId: row.task.processInstanceId,
+					procDefId: row.task.processDefinitionId,
+					procDefKey: row.task.processDefKey,
+					status: row.status
+				}).then((data) => {
+					let query = {formTitle: `${row.vars.title}`, title: `审批【${row.task.name || ''}】`, ...pick(data, 'formType', 'formReadOnly', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')};
+					uni.navigateTo({
+						url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
+					})
+				})
+			},
+			// 输入监听
+			inputWord(e){
+				this.searchTimer && clearTimeout(this.searchTimer)
+				this.searchTimer = setTimeout(()=>{
+					this.doSearch()
+				},300)
+			},
+			// 搜索
+			doSearch(){
+				this.dataList = [];
+				this.tablePage.currentPage = 0;
+				this.tablePage.pageSize = 10;
+				this.tablePage.pages = 0;
+				this.loadmore()
+			},
+			onReachBottom() {
+				this.loadmore()
+			},
+			loadmore() {
+				if(this.tablePage.currentPage!==0 && this.tablePage.pages <= this.tablePage.currentPage ) {
+					this.status = 'nomore';
+					return;
+				}
+				this.tablePage.currentPage = ++ this.tablePage.currentPage;
+				//联网加载数据
+				this.status = 'loading';
+				taskService.todoList({
+					current: this.tablePage.currentPage,
+					size: this.tablePage.pageSize,
+					orders: this.tablePage.orders,
+					...this.searchForm
+				}).then((data)=>{
+					//追加新数据
+					this.dataList=this.dataList.concat(data.records);
+					this.tablePage.pages = data.pages;
+					if(this.tablePage.pages <= this.tablePage.currentPage){
+						this.status = 'nomore'
+					} else {
+						this.status = 'loadmore'
+					}
+				})
+
+				notifyService.getUnreadCountByIsSelf({
+					isSelf: true,
+					...this.searchForm
+				}).then((data)=>{
+					EventBus.$emit('dataFromMessage', data); // 触发事件,传递参数
+				})
+
+			},
+			...mapActions(['refreshUserInfo']),
 			toApplyList (mail) {
 				uni.navigateTo({
-				   url: '/pages/workbench/task/ApplyList'
+					url: '/pages/workbench/task/ApplyList'
 				})
 			},
 			toTodoList (mail) {
 				uni.navigateTo({
-				    url: '/pages/workbench/task/TodoList'
+					url: '/pages/workbench/task/TodoList'
 				})
 			},
 			toHistoryList (mail) {
 				uni.navigateTo({
-				    url: '/pages/workbench/task/HistoryList'
+					url: '/pages/workbench/task/HistoryList'
 				})
 			},
 			toFlowCopyList (mail) {
 				uni.navigateTo({
-				    url: '/pages/workbench/task/FlowCopyList'
+					url: '/pages/workbench/task/FlowCopyList'
 				})
 			},
 			start (row) {
-				  // 读取流程表单
+				// 读取流程表单
 				taskService.getTaskDef({
-				  procDefId: row.id,
-				  status: 'start'
+					procDefId: row.id,
+					status: 'start'
 				}).then((data) => {
-				  let processTitle = `${this.username} 在 ${moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [${row.name}]`
-				  let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
-				  uni.navigateTo({
-					 url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
-				  })
+					let processTitle = `${this.username} 在 ${moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [${row.name}]`
+					let query = {procDefId: row.id, procDefKey: row.key, status: 'start', title: `发起流程【${row.name}】`, formType: data.formType, formUrl: data.formUrl, formTitle: processTitle}
+					uni.navigateTo({
+						url: '/pages/workbench/task/TaskForm?flow='+JSON.stringify(query)
+					})
 				})
-		  }
+			}
 		}
 	}
 </script>
 
 <style>
-  .cu-list.card-menu {
-      overflow: hidden;
-      margin-right: 5px;
-      margin-left: 5px;
-      border-radius: 7px;
-  }
-  .cu-list.card-menu.margin-top-20 {
-      margin-top: -20px;
-  }
-  .cu-list.menu>.cu-item .content>uni-view:first-child {
-      display: -webkit-box;
-      display: -webkit-flex;
-      display: flex;
-      -webkit-box-align: center;
-      /* -webkit-align-items: center; */
-      /* align-items: center; */
-      display: inline-block;
-      margin-right: 5px;
-      width: 1.6em;
-      text-align: center;
-  }
-  .font-size-35{
-	 font-size: 35px!important;
-  }
-  .circle-button{
-	 width: 44px;
-	 height: 44px;
-	 border-radius: 18px;
-	 padding-top: 4px;
-  }
-  .circle-button-box{
-	  width: 25%;
-	  margin-top: 10px;
-	  display: -webkit-box;
-	  display: -webkit-flex;
-	  display: flex;
-	  -webkit-box-orient: vertical;
-	  -webkit-box-direction: normal;
-	  -webkit-flex-direction: column;
-	  flex-direction: column;
-	  -webkit-box-align: center;
-	  -webkit-align-items: center;
-	  align-items: center;
-	  -webkit-box-pack: center;
-	  -webkit-justify-content: center;
-	  justify-content: center;
-	  box-sizing: border-box;
-  }
-  .font-b {
-	  vertical-align: middle;
-	  font-size: 18px;
-	  font-weight: 500;
-	  color: #3a3a3a;
-  }
+	.cu-list.card-menu {
+		overflow: hidden;
+		margin-right: 5px;
+		margin-left: 5px;
+		border-radius: 7px;
+	}
+	.cu-list.card-menu.margin-top-20 {
+		margin-top: -20px;
+	}
+	.cu-list.menu>.cu-item .content>uni-view:first-child {
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-align: center;
+		/* -webkit-align-items: center; */
+		/* align-items: center; */
+		display: inline-block;
+		margin-right: 5px;
+		width: 1.6em;
+		text-align: center;
+	}
+	.font-size-35{
+		font-size: 35px!important;
+	}
+	.circle-button{
+		width: 44px;
+		height: 44px;
+		border-radius: 18px;
+		padding-top: 4px;
+	}
+	.circle-button-box{
+		width: 25%;
+		margin-top: 10px;
+		display: -webkit-box;
+		display: -webkit-flex;
+		display: flex;
+		-webkit-box-orient: vertical;
+		-webkit-box-direction: normal;
+		-webkit-flex-direction: column;
+		flex-direction: column;
+		-webkit-box-align: center;
+		-webkit-align-items: center;
+		align-items: center;
+		-webkit-box-pack: center;
+		-webkit-justify-content: center;
+		justify-content: center;
+		box-sizing: border-box;
+	}
+	.font-b {
+		vertical-align: middle;
+		font-size: 18px;
+		font-weight: 500;
+		color: #3a3a3a;
+	}
 </style>

+ 18 - 1
store/index.js

@@ -1,11 +1,28 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 import user from './modules/user'
+import notifyService from "@/api/notify/notifyService";
 
 Vue.use(Vuex)
 
 export default new Vuex.Store({
 	modules: {
 		user
-	 }
+	 },
+	state: {
+		messageDataList: []
+	},
+	mutations: {
+		setMessageDataList(state, dataList) {
+			state.messageDataList = dataList;
+		}
+	},
+	actions: {
+		async loadmore({ commit }) {
+			const data = await notifyService.getUnreadCountByIsSelf({
+				isSelf: true
+			});
+			return data; // 返回数据,如果需要
+		}
+	}
 })