Browse Source

路演模块接口对接完成

jwyu 3 years ago
parent
commit
a482d93a31

+ 1 - 1
README.md

@@ -2,4 +2,4 @@
 
 	1. ui使用vant 未全部引入 按需在page.json中配置
 	2. utils/config 中为项目配置
-	3. master分支为线上分支、debug为测试分支,上线时修改项目配置中的请求地址
+	3. master分支为线上分支、debug为测试分支

+ 42 - 0
api/approve/activity.js

@@ -0,0 +1,42 @@
+/**
+ * 活动模块(路演)
+ */
+import {httpGet,httpPost} from "@/utils/request.js"
+
+/**
+ * 列表
+ * @param {int}  PageSize  每页数据条数
+ * @param {int}  CurrentIndex 当前页页码,从1开始
+ * @param {string}  Status  状态:1:待接受,2:包含,已接受,已拒绝(3),已删除(4) 
+ */
+export const apiRoadShowList=params=>{
+    return httpGet('/roadshow/calendar/list',params)
+}
+
+/**
+ * 详情
+ * @param {int}  RsCalendarId 路演活动id
+ * @param {int}  RsCalendarResearcherId  活动研究员id
+ */
+export const apiRoadShowInfo=params=>{
+    return httpGet('/roadshow/calendar/detail',params)
+}
+
+/**
+ * 审批 通过
+ * @param {int}  RsCalendarId 路演活动id
+ * @param {int}  RsCalendarResearcherId  活动研究员id
+ */
+ export const apiRoadShowApproved=params=>{
+	return httpPost('/roadshow/accept',params)
+}
+
+/**
+ * 审批 拒绝
+ * @param {int}  RsCalendarId 路演活动id
+ * @param {int}  RsCalendarResearcherId  活动研究员id
+ * @param {string} RefuseReason 理由  
+ */
+export const apiRoadShowReject=params=>{
+	return httpPost('/roadshow/refuse',params)
+}

+ 236 - 0
pages-approve/activity/detail.vue

@@ -0,0 +1,236 @@
+<template>
+    <view class="activity-detail">
+        <!-- 路演 -->
+        <block v-if="info.RsCalendarItem.ActivityType=='路演'">
+        <view class="section white-wrap">
+            <view class="info-item flex">
+                <view class="label">活动时间:</view>
+                <view>{{info.RsCalendarResearcherItem.StartDate}}({{info.RsCalendarResearcherItem.StartWeek}}) {{info.RsCalendarResearcherItem.StartTime}}-{{info.RsCalendarResearcherItem.EndTime}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">活动类型:</view>
+                <view>{{info.RsCalendarItem.ActivityType}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">路演形式:</view>
+                <view>{{info.RsCalendarItem.RoadshowType}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">路演平台:</view>
+                <view>{{info.RsCalendarItem.RoadshowPlatform}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">客户名称:</view>
+                <view>{{info.CompanyDetail.CompanyName}}</view>
+            </view>
+        </view>
+        <view class="section white-wrap">
+            <view class="info-item flex">
+                <view class="label">客户状态:</view>
+                <view>{{info.CompanyDetail.Status}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">所属行业:</view>
+                <view>{{info.CompanyDetail.IndustryName}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">开通品种:</view>
+                <view>{{info.CompanyDetail.PermissionName}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">累计阅读报告次数:</view>
+                <view>{{info.CompanyDetail.ReportReadTotal}}</view>
+            </view>
+            <view class="line"></view>
+            <view class="info-item flex">
+                <view class="label">提交销售:</view>
+                <view>{{info.RsCalendarItem.SysUserRealName}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">提交时间:</view>
+                <view>{{info.RsCalendarItem.CreateTime}}</view>
+            </view>
+        </view>
+        <view class="section white-wrap" v-if="info.RsCalendarResearcherItem.Status==2||info.RsCalendarResearcherItem.Status==3">
+            <view class="info-item flex">
+                <view class="label">审批时间:</view>
+                <view>{{info.RsCalendarResearcherItem.Status==2?info.RsCalendarResearcherItem.ApproveTime:info.RsCalendarResearcherItem.RefuseTime}}</view>
+            </view>
+            <view class="info-item flex" v-if="info.RsCalendarResearcherItem.Status==3">
+                <view class="label">拒绝理由:</view>
+                <view>{{info.RsCalendarResearcherItem.RefuseReason}}</view>
+            </view>
+        </view>
+        </block>
+        <block v-else>
+        <view class="section white-wrap">
+            <view class="info-item flex">
+                <view class="label">活动时间:</view>
+                <view>{{info.RsCalendarResearcherItem.StartDate}}({{info.RsCalendarResearcherItem.StartWeek}}) {{info.RsCalendarResearcherItem.StartTime}}-{{info.RsCalendarResearcherItem.EndTime}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">活动类型:</view>
+                <view>{{info.RsCalendarItem.ActivityType}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">会议形式:</view>
+                <view>{{info.RsCalendarItem.RoadshowType}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">会议城市:</view>
+                <view>{{info.RsCalendarItem.Province}}{{info.RsCalendarItem.City}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">会议主题:</view>
+                <view>{{info.RsCalendarItem.Theme}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">合作方名称:</view>
+                <view>{{info.RsCalendarItem.CooperationName}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">合作方名称:</view>
+                <view>{{info.RsCalendarItem.CooperationName}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">提交销售:</view>
+                <view>{{info.RsCalendarItem.SysUserRealName}}</view>
+            </view>
+            <view class="info-item flex">
+                <view class="label">提交时间:</view>
+                <view>{{info.RsCalendarItem.CreateTime}}</view>
+            </view>
+        </view>
+        <view class="section white-wrap" v-if="info.RsCalendarResearcherItem.Status==2||info.RsCalendarResearcherItem.Status==3">
+            <view class="info-item flex">
+                <view class="label">审批时间:</view>
+                <view>{{info.RsCalendarResearcherItem.Status==2?info.RsCalendarResearcherItem.ApproveTime:info.RsCalendarResearcherItem.RefuseTime}}</view>
+            </view>
+            <view class="info-item flex" v-if="info.RsCalendarResearcherItem.Status==3">
+                <view class="label">拒绝理由:</view>
+                <view>{{info.RsCalendarResearcherItem.RefuseReason}}</view>
+            </view>
+        </view>
+        </block>
+
+        <!-- 审批按钮 -->
+		<view class="fix-bottom-wrap btns-wrap flex" v-if="info.RsCalendarResearcherItem.Status==1">
+			<button class="refuse-btn" @click="handleRefuse">拒绝</button>
+            <button class="pass-btn" @click="handlePass">接受</button>
+		</view>
+    </view>
+</template>
+
+<script>
+import {apiRoadShowInfo,apiRoadShowApproved} from '@/api/approve/activity.js'
+export default {
+    data () {
+        return {
+            RsCalendarResearcherId:null,//活动研究员id
+            RsCalendarId:null,//路演活动id
+            info:null,
+        }
+    },
+    onLoad(options) {
+        this.RsCalendarResearcherId=options.RsCalendarResearcherId
+        this.RsCalendarId=options.RsCalendarId
+    },
+    onShow() {
+        // this.getDetail()
+    },
+    methods: {
+        // 获取详情
+        async getDetail(){
+            const res=await apiRoadShowInfo({
+                RsCalendarId:this.RsCalendarId,
+                RsCalendarResearcherId:this.RsCalendarResearcherId
+            })
+            if(res.code===200){
+                this.info=res.data
+            }
+        },
+
+        handlePass(){
+            uni.showModal({
+                content: '接受申请后会加入您的日历,请确认!',
+                showCancel: true,
+                cancelColor:'#A9AFB8',
+                confirmColor:'#3385FF',
+                success: ({ confirm, cancel }) => {
+                    if (confirm) {
+                        console.log('用户点击确定');
+                        this.passApprove()
+                    } else if (cancel) {
+                        console.log('用户点击取消');
+                    }
+                }
+            })
+        },
+
+        // 通过申请
+        async passApprove(){
+            const res=await apiRoadShowApproved({
+                RsCalendarId:this.RsCalendarId,
+                RsCalendarResearcherId:this.RsCalendarResearcherId
+            })
+            if(res.code===200){
+                this.getDetail()
+                uni.$emit('activityApproveListUpdate',{
+					RsCalendarId:this.RsCalendarId,
+					RsCalendarResearcherId:this.RsCalendarResearcherId
+				})
+            }
+        },
+
+        handleRefuse(){
+			uni.navigateTo({
+				url:`./reason?RsCalendarId=${this.RsCalendarId}&RsCalendarResearcherId=${this.RsCalendarResearcherId}`
+			})
+        }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.activity-detail{
+    .section{
+        margin-bottom: 14rpx;
+        padding: 33rpx 34rpx;
+        .line{
+            width: 100%;
+            height: 0;
+            border-top: 1px dashed #707070;
+            margin: 30rpx 0;
+        }
+    }
+    .info-item{
+        .label{
+            flex-shrink: 0;
+            color: #666;
+            margin-right: 20rpx;
+            margin-bottom: 20rpx;
+        }
+    }
+    .btns-wrap {
+		justify-content: center;
+		button {
+			width: 260rpx;
+			height: 70rpx;
+			border-radius: 28px;
+			border: none;
+			margin: 0 15px;
+			font-size: 15px;
+			color: #fff;
+			line-height: 70rpx;
+		}
+		
+		.pass-btn {
+			background-color: #5890fb;
+		}
+		
+		.refuse-btn {
+			background-color: #f55768;
+		}
+	}
+}
+</style>

+ 51 - 25
pages-approve/activity/list.vue

@@ -3,34 +3,39 @@
         <van-sticky>
 			<view class="top-wrap">
 				<van-tabs swipeable id="tabs" :active="status" title-active-color="#3385FF" color="#3385FF" @change="typeChange">
-					<van-tab title="待审批" name="待审批"></van-tab>
-					<van-tab title="已审批" name="已审批"></van-tab>
+					<van-tab title="待审批" name="1"></van-tab>
+					<van-tab title="已审批" name="2"></van-tab>
 				</van-tabs>
 			</view>
 		</van-sticky>
         <van-empty description="暂无数据" :image="require('@/static/empty.png')" v-if="finished&&list.length===0"/>
         <view class="list-wrap" v-else>
-			<view class="item white-wrap" v-for="item in list" :key="item.id">
+			<view class="item white-wrap" v-for="item in list" :key="item.RsCalendarId" @click="goDetail(item)">
 				<view class="title flex">
-					<image src="../../static/man.png" mode="aspectFill" class="icon"></image>
-					<view>{{item.title}}</view>
+					<image src="../../static/man.png" mode="aspectFill" class="icon" v-if="item.ActivityType=='路演'"></image>
+					<image style="width:16px;height:16px" src="../static/icon-1.png" mode="aspectFill" class="icon" v-else></image>
+					<view>{{item.ActivityType=='路演'?item.CompanyName:item.Theme}}</view>
 				</view>
 				<view class="content">
-					<view class="info">申请类型:{{item.applyType}}</view>
-					<view class="info">申请销售:{{item.saller}}</view>
-					<view class="info">提交时间:{{item.submitTime|formatTime}}</view>
+					<view class="info">活动类型:{{item.RoadshowType}}{{item.ActivityType}}</view>
+					<view class="info">提交销售:{{item.SysUserRealName}}</view>
+					<view class="info">提交时间:{{item.CreateTime|formatTime}}</view>
 				</view>
-				<view class="status approve-list-status-wait" v-if="item.status==='待审批'">待审批</view>
+				<view class="status approve-list-status-wait" v-if="item.Status=='1'">待审批</view>
+				<view class="status approve-list-status-success" v-if="item.Status=='2'">已接受</view>
+				<view class="status approve-list-status-fail" v-if="item.Status=='3'">已拒绝</view>
+				<view class="status approve-list-status-cancel" v-if="item.Status=='4'">已删除</view>
 			</view>
 		</view>
     </view>
 </template>
 
 <script>
+import {apiRoadShowList} from '@/api/approve/activity.js'
 export default {
     data () {
         return {
-			status: '待审批',
+			status: '1',
 			list:[],
 			page:1,
 			finished:false,
@@ -38,10 +43,33 @@ export default {
     },
 	onLoad(options) {
 		this.getList()
+		uni.$on('activityApproveListUpdate',(e)=>{
+			console.log('activityApproveListUpdate' + e);
+			this.list=this.list.filter(item=>{
+				return item.RsCalendarId!=e.RsCalendarId&&item.RsCalendarResearcherId!=e.RsCalendarResearcherId
+			})
+		})
+	},
+	onUnload(){
+		uni.$off('activityApproveListUpdate')
 	},
     onShow() {
 	    this.selectComponent('#tabs').resize();// 解决初始渲染 vant tab 底部条
 	},
+	onPullDownRefresh() {
+		this.page=1
+		this.finished=false
+		this.list=[]
+		this.getList()
+		setTimeout(()=>{
+			uni.stopPullDownRefresh()
+		},1500)
+	},
+	onReachBottom() {
+		if(this.finished) return
+		this.page++
+		this.getList()
+	},
     methods: {
         typeChange(e){
 			this.status=e.detail.name
@@ -52,22 +80,20 @@ export default {
 		},
 
         async getList(){
-			let arr=[
-				{
-					title:"标题",
-					saller:'销售一',
-					submitTime:'',
-					approveTime:'',
-					backTime:'',
-					cancelTime:'',
-					status:'待审批',
-					applyType:'线上路演',
-					id:1,
-					type:'activity'
+			const res=await apiRoadShowList({PageSize:20,CurrentIndex:this.page,Status:this.status})
+			if(res.code===200){
+				if(!res.data.List||res.data.List.length===0){
+					this.finished=true
+				}else{
+					let arr=res.data.List||[]
+					this.list=[...this.list,...arr]
 				}
-			]
-			this.list=arr
-        }
+			}
+        },
+
+		goDetail(e){
+			uni.navigateTo({ url: `/pages-approve/activity/detail?RsCalendarId=${e.RsCalendarId}&RsCalendarResearcherId=${e.RsCalendarResearcherId}` })
+		}
     }
 }
 </script>

+ 109 - 0
pages-approve/activity/reason.vue

@@ -0,0 +1,109 @@
+<template>
+	<view>
+		<view class="textarea-wrap white-wrap">
+			<textarea placeholder="请输入拒绝理由" v-model="reason" maxlength="-1"></textarea>
+		</view>
+		<view class="btns-wrap flex">
+			<button class="cancel-btn" @click="handleCancel">取消</button>
+			<button class="confirm-btn" @click="handleSubmit">提交</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {apiRoadShowReject} from '@/api/approve/activity.js'
+	export default {
+		data() {
+			return {
+				reason: '',
+				RsCalendarId:null,
+				RsCalendarResearcherId:null,
+			}
+		},
+		onLoad(options) {
+			this.RsCalendarId=options.RsCalendarId
+			this.RsCalendarResearcherId=options.RsCalendarResearcherId
+		},
+		methods: {
+			async handleSubmit() {
+				if(!this.reason){
+					uni.showToast({
+						title:'请填写理由',
+						icon:"none"
+					})
+					return
+				}
+				const res=await apiRoadShowReject({
+					RsCalendarId:Number(this.RsCalendarId),
+					RsCalendarResearcherId:Number(this.RsCalendarResearcherId),
+					RefuseReason:this.reason
+				})
+				if(res.code===200){
+					uni.showToast({
+						title:"审批成功",
+						icon:'success'
+					})
+					uni.$emit('activityApproveListUpdate',{
+						RsCalendarId:this.RsCalendarId,
+						RsCalendarResearcherId:this.RsCalendarResearcherId
+					})
+					setTimeout(()=>{
+						this.handleCancel()
+					},1000)
+				}
+			},
+			
+			handleCancel(){
+				uni.navigateBack({
+					delta:1
+				})
+			}
+			
+		},
+	}
+</script>
+
+<style lang="scss">
+	.textarea-wrap {
+		padding: 17px;
+
+		textarea {
+			resize: none;
+			display: block;
+			box-sizing: border-box;
+			width: 100%;
+			height: 200px;
+			border: none;
+			font-size: 14px;
+			/* no */
+		}
+	}
+
+	.btns-wrap {
+		justify-content: center;
+		padding-top: 50px;
+		padding-bottom: 50px;
+
+		button {
+			width: 90px;
+			height: 28px;
+			border-radius: 28px;
+			border: none;
+			margin: 0 10px;
+			font-size: 14px;
+			/* no */
+			color: #fff;
+			line-height: 28px;
+		}
+
+		.confirm-btn {
+			background-color: #5890fb;
+		}
+
+		.cancel-btn {
+			border: 1px solid #5890fb;
+			color: #5890fb;
+			background-color: #fff;
+		}
+	}
+</style>

BIN
pages-approve/static/icon-1.png


+ 14 - 1
pages.json

@@ -130,7 +130,20 @@
         {
           "path": "activity/list",
           "style":{
-            "navigationBarTitleText": "活动审批"
+            "navigationBarTitleText": "活动审批",
+            "enablePullDownRefresh": true
+          }
+        },
+        {
+          "path": "activity/detail",
+          "style":{
+            "navigationBarTitleText": "审批详情"
+          }
+        },
+        {
+          "path": "activity/reason",
+          "style": {
+            "navigationBarTitleText": "拒绝理由"
           }
         }
       ]

+ 6 - 5
pages/workbench/index.vue

@@ -13,7 +13,7 @@
 			<view class="label">用印审批</view>
 		</view>
 		<view class="section white-wrap" @click="handleGoNext('activity')">
-			<image src="../../static/icon-3.png" mode="aspectFill" class="icon"></image>
+			<image src="../../static/icon-4.png" mode="aspectFill" class="icon"></image>
 			<view class="label">活动审批</view>
 		</view>
 	</view>
@@ -64,16 +64,17 @@
 <style lang="scss">
 	.workbench-page{
 		padding: 20rpx;
+		display: flex;
+		flex-wrap: wrap;
 	}
 	.section{
-		padding: 50rpx 0;
+		width: 50%;
+		padding: 84rpx 0;
 		text-align: center;
+		box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
 		font-size: 16px;
 		font-weight: 400;
 		color: #666;
-		box-shadow: 0px 3px 12px rgba(175, 175, 175, 0.16);
-		border-radius: 8px;
-		margin-bottom: 20rpx;
 		.icon{
 			width: 128rpx;
 			height: 128rpx;

BIN
static/icon-4.png