From 7adea4dfb1d468510d8dc840a0502e384506e177 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Tue, 14 Nov 2023 17:52:50 +0800
Subject: [PATCH] 校园安全报事详情,新增我的任务、工作日志页面
---
pages/user/center.vue | 89 +++++----
api/reporting/reporting.js | 20 +-
pages/home/index.vue | 8
subPackage/workbench/views/schoolReportDetail.vue | 2
pages.json | 24 ++
subPackage/workbench/views/hotelReportDetail.vue | 2
subPackage/label/schoolList.vue | 4
subPackage/workbench/views/workLog.vue | 150 ++++++++++++++++
subPackage/task/index.vue | 161 +++++++++++++++++
http/api.js | 50 +++-
subPackage/label/school.vue | 3
11 files changed, 441 insertions(+), 72 deletions(-)
diff --git a/api/reporting/reporting.js b/api/reporting/reporting.js
index d574aa9..c42131e 100644
--- a/api/reporting/reporting.js
+++ b/api/reporting/reporting.js
@@ -141,14 +141,6 @@
})
}
-//添加校园安全报事
-export const setSchoolReporting = (data) => {
- return http.request({
- url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/save',
- method: 'POST',
- data: data
- })
-}
//获取校园安全报事列表
export const getSchoolReportingList = (params) => {
@@ -170,9 +162,19 @@
}
})
}
-//修改校园安全报事
+//添加校园安全报事
export const saveSchoolReporting = (data) => {
return http.request({
+ url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/save',
+ method: 'POST',
+ data: data
+ })
+}
+
+
+//修改校园安全报事
+export const setSchoolReporting = (data) => {
+ return http.request({
url: '/blade-taskCampusReportingEvent/taskCampusReportingEvent/update',
method: 'POST',
data: data
diff --git a/http/api.js b/http/api.js
index de859da..ec32f02 100644
--- a/http/api.js
+++ b/http/api.js
@@ -67,15 +67,27 @@
}, config => { // 可使用async await 做异步操作
return Promise.reject(config)
})
+
+uni.showLoading({
+ title:"加载中..."
+})
+
http.interceptors.response.use((response) => {
// 若有数据返回则通过
if (response.data.access_token || response.data.key) {
return response.data
}
-
// 服务端返回的状态码不等于200,则reject()
if (response.data.code) {
if (response.data.code !== 200) {
+ uni.showToast({
+ title: response.data.msg,
+ icon: 'none'
+ });
+ return Promise.reject(response);
+ }
+ }else {
+ if(response.data.error_code !== 200){
uni.showToast({
title: response.data.msg,
icon: 'none'
@@ -86,6 +98,7 @@
//数据中台返回的数据结果
if (response.statusCode) {
+ uni.hideLoading()
if (response.statusCode !== 200) {
console.log(response.data.msg)
uni.showToast({
@@ -107,21 +120,26 @@
const currentPage = pages[pages.length - 1]
uni.setStorageSync("responIndex", 0)
uni.clearStorageSync()
-
- uni.showModal({
- title: "提示",
- content: "请登录",
- showCancel: false,
- success: res => {
- if (res.confirm) {
- uni.redirectTo({
- url: `/pages/login/login-account?redirect=/${currentPage.route}`
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
+
+ uni.redirectTo({
+ url: `/pages/login/login-account?redirect=/${currentPage.route}`
+ })
+
+
+ // uni.showModal({
+ // title: "提示",
+ // content: "请登录",
+ // showCancel: false,
+ // success: res => {
+ // if (res.confirm) {
+ // uni.redirectTo({
+ // url: `/pages/login/login-account?redirect=/${currentPage.route}`
+ // })
+ // } else if (res.cancel) {
+ // console.log('用户点击取消');
+ // }
+ // }
+ // })
diff --git a/pages.json b/pages.json
index af7189a..21d537a 100644
--- a/pages.json
+++ b/pages.json
@@ -192,6 +192,21 @@
}
]
},
+ //我的任务
+ {
+ "root":"subPackage/task",
+ "pages": [
+ {
+ "path": "index",
+ "style": {
+ "navigationBarTitleText": "我的任务",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black"
+ }
+ }
+ ]
+ },
//工作台
{
"root": "subPackage/workbench",
@@ -314,6 +329,15 @@
"navigationBarBackgroundColor": "#fff",
"navigationBarTextStyle": "black"
}
+ },
+ {
+ "path": "views/workLog",
+ "style": {
+ "navigationBarTitleText": "走访日志",
+ "enablePullDownRefresh": false,
+ "navigationBarBackgroundColor": "#fff",
+ "navigationBarTextStyle": "black"
+ }
}
]
},
diff --git a/pages/home/index.vue b/pages/home/index.vue
index df342b2..32c1e76 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -285,6 +285,14 @@
path: "/subPackage/workbench/views/report"
},
// {
+ // icon: "/static/icon/menu-04.png",
+ // text: "我的任务",
+ // style: {
+ // background: 'linear-gradient(133deg, #F9FAFE 0%, rgba(249,250,254,0) 100%)',
+ // },
+ // path: "/subPackage/task/index"
+ // },
+ // {
// icon: "/static/icon/menu-07.png",
// text: "校园安全",
// style: {
diff --git a/pages/user/center.vue b/pages/user/center.vue
index 7461e08..1948124 100644
--- a/pages/user/center.vue
+++ b/pages/user/center.vue
@@ -1,84 +1,90 @@
<template>
<view class="">
<view class="header flex a-i-c">
- <u-avatar :src="userInfo.avatar" size="80"></u-avatar>
- <view class="flex f-d-c ml-20" v-if="isLogin">
- <text class="f-36 mb-20 fw" v-if="userInfo.nick_name">{{userInfo.nick_name}}</text>
- <text class="f-36 mb-20 fw" v-else>{{userInfo.user_name}}</text>
+ <u-avatar :src="userInfo.avatar" size="80"></u-avatar>
+ <view class="flex f-d-c ml-20" v-if="isLogin">
+ <text class="f-36 mb-20 fw" v-if="userInfo.nick_name">{{userInfo.nick_name}}</text>
+ <text class="f-36 mb-20 fw" v-else>{{userInfo.user_name}}</text>
<!-- <text class="f-28 c-99">您好业主,欢迎回家</text> -->
</view>
- <view class="flex f-d-c ml-20" v-if="!isLogin">
+ <view class="flex f-d-c ml-20" v-if="!isLogin">
<text class="f-36 mb-20 fw">未登录</text>
<!-- <text class="f-28 c-99">您好业主,欢迎回家</text> -->
</view>
</view>
-
+
<view class="main">
<view class="main-cell">
<view class="cell-content">
<u-cell-group :border="false">
<u-cell @click="navigator(item)" v-for="(item, index) in menuList" :icon="item.icon"
- :title="item.title" :key="index" :border="false" :iconStyle="{width:'48rpx',height:'48rpx'}" :isLink="true" ></u-cell>
+ :title="item.title" :key="index" :border="false" :iconStyle="{width:'48rpx',height:'48rpx'}"
+ :isLink="true"></u-cell>
</u-cell-group>
</view>
</view>
-
+
</view>
</view>
</template>
<script>
export default {
- data(){
+ data() {
return {
- menuList:[
- {
- icon:"/static/icon/menu-center-01.png",
- title:"我的家人",
- url:""
+ menuList: [{
+ icon: "/static/icon/menu-center-01.png",
+ title: "我的家人",
+ url: ""
},
{
- icon:"/static/icon/menu-center-02.png",
- title:"切换角色",
- url:"/subPackage/user/role/index"
+ icon: "/static/icon/menu-center-02.png",
+ title: "切换角色",
+ url: "/subPackage/user/role/index"
},
{
- icon:"/static/icon/menu-center-03.png",
- title:"修改密码",
- url:"/subPackage/user/password/index"
+ icon: "/static/icon/menu-center-03.png",
+ title: "修改密码",
+ url: "/subPackage/user/password/index"
},
{
- icon:"/static/icon/menu-center-04.png",
- title:"退出登录",
- url:""
+ icon: "/static/icon/menu-center-04.png",
+ title: "退出登录",
+ url: ""
},
],
// userInfo:{}
}
},
-
+
onShow() {
-
-
+
+
},
-
-
- methods:{
+
+
+ methods: {
change(index) {
let url = index
this.$u.func.globalNavigator(url, "switchTab")
},
-
+
navigator(item) {
-
if (item.title == '退出登录') {
- this.logOut()
+ uni.showModal({
+ title: "提示",
+ content: "是否要退出该账号?",
+ success: (res) => {
+ if (res.confirm) {
+ this.logOut()
+ }
+ }
+ })
} else {
this.$u.func.globalNavigator(item.url)
}
-
},
-
+
logOut() {
uni.setStorageSync("responIndex", 0)
uni.clearStorageSync()
@@ -91,14 +97,15 @@
</script>
<style>
- page{
- width:100%;
- height:100%;
- background: linear-gradient(96deg, #E2EFFF 0%, rgba(255,255,255,0) 100%);
+ page {
+ width: 100%;
+ height: 100%;
+ background: linear-gradient(96deg, #E2EFFF 0%, rgba(255, 255, 255, 0) 100%);
}
- .header{
- width:100%;
- padding:120rpx 38rpx 80rpx;
+
+ .header {
+ width: 100%;
+ padding: 120rpx 38rpx 80rpx;
box-sizing: border-box;
}
</style>
\ No newline at end of file
diff --git a/subPackage/label/school.vue b/subPackage/label/school.vue
index 3dea748..54f1a80 100644
--- a/subPackage/label/school.vue
+++ b/subPackage/label/school.vue
@@ -173,8 +173,7 @@
</u-radio>
</u-radio-group>
</u-form-item>
- <u-form-item label="高空抛物监控" prop="highAltitudeMonitor" :borderBottom="false" ref="scFlag" required
- @click="isShowScStatus = true">
+ <u-form-item label="高空抛物监控" prop="highAltitudeMonitor" :borderBottom="false" ref="scFlag" required>
<u-input v-model="info.highAltitudeMonitor" border="none" placeholder="请输入"
placeholderClass="f-28 c-99" inputAlign="right"></u-input>
</u-form-item>
diff --git a/subPackage/label/schoolList.vue b/subPackage/label/schoolList.vue
index ca5ef4c..09c0209 100644
--- a/subPackage/label/schoolList.vue
+++ b/subPackage/label/schoolList.vue
@@ -10,7 +10,7 @@
</view>
<view class="item-row flex a-i-c j-c-s-b">
<text class="f-28">时间</text>
- <text class="f-28 c-66">{{i.applyTime}}</text>
+ <text class="f-28 c-66">{{i.createTime}}</text>
</view>
</view>
</view>
@@ -60,7 +60,7 @@
},
navTo(id) {
uni.navigateTo({
- url: `/subPackage/workbench/views/hotelReportDetail?id=${id}`
+ url: `/subPackage/workbench/views/schoolReportDetail?id=${id}`
})
}
}
diff --git a/subPackage/task/index.vue b/subPackage/task/index.vue
new file mode 100644
index 0000000..742c39f
--- /dev/null
+++ b/subPackage/task/index.vue
@@ -0,0 +1,161 @@
+<template>
+ <view class="">
+ <view class="block bgc-ff mb-20 mt-20">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">走访提醒</text>
+ </view>
+ </view>
+ <view class="row flex j-c-s-a">
+ <view class="flex f-d-c a-i-c">
+ <text class="fw c-main f-36 mb-20">3</text>
+ <text class="f-28">本周</text>
+ </view>
+ <view class="flex f-d-c a-i-c">
+ <text class="fw c-main f-36 mb-20">3</text>
+ <text class="f-28">半月</text>
+ </view>
+ <view class="flex f-d-c a-i-c">
+ <text class="fw c-main f-36 mb-20">3</text>
+ <text class="f-28">本月</text>
+ </view>
+ </view>
+ </view>
+ <view class="nav bgc-ff mb-20">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">公安</text>
+ </view>
+ </view>
+ <view class="nav-item flex j-c-s-b a-i-c">
+ <text class="f-28">报事报修</text>
+ <view class="flex">
+ <text class="f-28 c-99">待处理</text>
+ <view class="dot bgc-main">3</view>
+ <u-icon name="arrow-right" color="#999"></u-icon>
+ </view>
+ </view>
+ <view class="nav-item flex j-c-s-b a-i-c">
+ <text class="f-28">住户审核</text>
+ <view class="flex">
+ <text class="f-28 c-99">待处理</text>
+ <view class="dot bgc-main">3</view>
+ <u-icon name="arrow-right" color="#999"></u-icon>
+ </view>
+ </view>
+ <view class="nav-item flex j-c-s-b a-i-c">
+ <text class="f-28">工作日志</text>
+ <view class="flex">
+ <text class="f-28 c-99">待处理</text>
+ <view class="dot bgc-main">3</view>
+ <u-icon name="arrow-right" color="#999"></u-icon>
+ </view>
+ </view>
+ </view>
+
+ <view class="nav bgc-ff mb-20">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">住建</text>
+ </view>
+ </view>
+ <view class="nav-item flex j-c-s-b a-i-c">
+ <text class="f-28">出租房管理</text>
+ <view class="flex">
+ <text class="f-28 c-99">待处理</text>
+ <view class="dot bgc-main">3</view>
+ <u-icon name="arrow-right" color="#999"></u-icon>
+ </view>
+ </view>
+ </view>
+ <view class="nav bgc-ff mb-20">
+ <view class="caption">
+ <view class="flex a-i-c">
+ <view class="line"></view>
+ <text class="f-32 fw">综治</text>
+ </view>
+ </view>
+ <view class="nav-item flex j-c-s-b a-i-c">
+ <text class="f-28">综治任务</text>
+ <view class="flex">
+ <text class="f-28 c-99">待处理</text>
+ <view class="dot bgc-main">3</view>
+ <u-icon name="arrow-right" color="#999"></u-icon>
+ </view>
+ </view>
+ </view>
+ </view>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ navList: [{
+ name: "",
+
+ }]
+ }
+ }
+ }
+</script>
+
+<style lang="scss">
+ page {
+ background-color: #F5F5F5;
+ }
+
+ .block {
+ width: 690rpx;
+ margin: 20rpx auto;
+ border-radius: 4rpx;
+
+
+
+ .row {
+ padding: 30rpx 0 34rpx;
+ }
+ }
+ .caption {
+ width: 100%;
+ padding: 30rpx;
+ box-sizing: border-box;
+ border-bottom: 1px solid #F5F5F5;
+
+ .line {
+ width: 6rpx;
+ height: 28rpx;
+ background-color: #017BFC;
+ margin-right: 14rpx;
+ }
+ }
+
+ .nav {
+ width: 690rpx;
+ margin: 0 auto;
+
+ .nav-item {
+ width: 100%;
+ padding: 36rpx 30rpx;
+ box-sizing: border-box;
+ border-bottom: 1px solid #F5F5F5;
+ }
+
+ .dot {
+ width: 32rpx;
+ height: 32rpx;
+ line-height: 32rpx;
+ border-radius: 50%;
+ color: #fff;
+ text-align: center;
+ font-size: 24rpx;
+ margin: 0 10rpx 0 20rpx;
+ }
+ }
+ .mb-20{
+ margin-bottom: 20rpx;
+ }
+</style>
\ No newline at end of file
diff --git a/subPackage/workbench/views/hotelReportDetail.vue b/subPackage/workbench/views/hotelReportDetail.vue
index b24d524..66b2915 100644
--- a/subPackage/workbench/views/hotelReportDetail.vue
+++ b/subPackage/workbench/views/hotelReportDetail.vue
@@ -195,7 +195,7 @@
},
methods: {
- showPickerDate() {
+ showPicker() {
if (this.roleType == 2 && this.status != 2) return;
this.isPickerShow = true;
},
diff --git a/subPackage/workbench/views/schoolReportDetail.vue b/subPackage/workbench/views/schoolReportDetail.vue
index b96de0c..3375274 100644
--- a/subPackage/workbench/views/schoolReportDetail.vue
+++ b/subPackage/workbench/views/schoolReportDetail.vue
@@ -81,7 +81,7 @@
},
{
label: '自查位置',
- name: 'localtion',
+ name: 'location',
value: '未完善'
},
{
diff --git a/subPackage/workbench/views/workLog.vue b/subPackage/workbench/views/workLog.vue
new file mode 100644
index 0000000..b75e668
--- /dev/null
+++ b/subPackage/workbench/views/workLog.vue
@@ -0,0 +1,150 @@
+<template>
+ <view>
+ <view class="content bgc-ff">
+ <u-form labelPosition="left" :model="info" :rules="rules" ref="uForm" labelWidth="90"
+ :labelStyle="{fontSize:'28rpx'}">
+ <u-form-item label="标题" prop="info.title" borderBottom ref="item1">
+ <u-input v-model="info.title" border="none" placeholder="请输入标题" placeholderClass="f-28 c-99"
+ inputAlign="right"></u-input>
+ </u-form-item>
+ <u-form-item label="内容" borderBottom ref="item1">
+ <u-input type="textarea" v-model="info.address" border="none" placeholderClass="f-28 c-99"
+ inputAlign="right">
+
+ </u-input>
+ </u-form-item>
+
+ <u-form-item label="走访时间" prop="applyTime" borderBottom required @click="showSelectDate = true">
+ <u-input v-model="info.applyTime" disabled disabledColor="#ffffff" border="none" placeholder="请输入"
+ placeholderClass="f-28 c-99" inputAlign="right"></u-input>
+ <u-icon slot="right" name="arrow-right"></u-icon>
+ </u-form-item>
+ </u-form>
+ </view>
+ <view class="upload bgc-ff">
+ <view class="f-28">走访图片</view>
+ <view class="mt-20">
+ <u-upload :fileList="images" :previewFullImage="uploadConfig.previewFullImage"
+ :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
+ :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
+ <view class="upload-item upload-icon flex_base">
+ <u-icon name="/static/icon/upload.png" width="60rpx" height="60rpx"></u-icon>
+ </view>
+ </u-upload>
+ </view>
+ </view>
+
+ <u-datetime-picker ref="datetimePicker" :show="showSelectDate" v-model="applyTime" mode="datetime"
+ :formatter="formatter" @confirm="confirmDate" @cancel="showSelectDate = false"></u-datetime-picker>
+
+ <view class="footer">
+ <button class="footer-btn">提交</button>
+ </view>
+
+ </view>
+
+</template>
+
+<script>
+ import uploadMixin from "@/mixin/uploadMixin";
+ export default {
+ mixins: [uploadMixin],
+ data() {
+ return {
+ info: {
+ title: "",
+ content: ""
+ },
+ rules: {
+ 'title': {
+ type: 'string',
+ required: true,
+ message: '请输入工作主题',
+ trigger: ['blur', 'change']
+ },
+ 'content': {
+ type: 'string',
+ required: true,
+ message: '请输入工作内容',
+ trigger: ['blur', 'change']
+ },
+ },
+
+ images: [
+
+ ],
+ showSelectDate:false
+ }
+ },
+ methods:{
+
+ confirmDate(e) {
+ this.showSelectDate = false;
+ this.info.applyTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM:ss')
+ },
+
+
+ getLocation(){
+ uni.chooseLocation({
+ success:(res)=>{
+ console.log(res);
+ }
+ })
+ }
+ }
+ }
+</script>
+
+<style lang="less">
+ page {
+ background-color: #F5F5F5;
+ }
+
+ .content {
+ margin: 20rpx 30rpx;
+ padding: 0 30rpx;
+ }
+ .row{
+ padding:20rpx 0;
+ border-bottom:1px solid
+ }
+ .location-btn{
+ width:116rpx;
+ height:46rpx;
+ line-height: 46rpx;
+ border-radius: 4rpx;
+ border:1px solid currentColor;
+ padding:0;
+ background-color: #fff;
+ }
+
+ .upload {
+ margin: 0 30rpx;
+ padding: 30rpx;
+ .upload-item {
+ width: 140rpx;
+ height: 140rpx;
+ border: 1px solid #EEEEEE;
+ }
+ }
+
+ .footer {
+ width: 100%;
+ padding: 30rpx;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ z-index: 10;
+ box-sizing: border-box;
+
+ .footer-btn {
+ width: 100%;
+ height: 78rpx;
+ line-height: 78rpx;
+ background: linear-gradient(163deg, #01BDFC 0%, #017BFC 100%);
+ border-radius: 8rpx;
+ color: #fff;
+ font-size: 32rpx;
+ }
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3