新增查询登录人所属项目列表接口并调整首页代码逻辑

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-12-18 14:42:41 +08:00
parent c055a9ecbb
commit 04c1a9f7b7
2 changed files with 153 additions and 16 deletions

11
src/api/ebiz/GBC/GBC.js Normal file
View File

@@ -0,0 +1,11 @@
import request from '@/assets/js/utils/request'
import getUrl from '@/assets/js/utils/get-url'
// 查询登录人所属项目列表
export function gbcProjectList(data) {
return request({
url: getUrl('/agent/gbc/project/list', 1),
method: 'post',
data
})
}

View File

@@ -1,7 +1,6 @@
<template> <template>
<div class="public_container" :style="{paddingTop:marginTop+'px'}"> <div class="public_container" :style="{paddingTop:marginTop+'px'}">
<van-pull-refresh v-model="isLoading" @refresh="onRefresh"> <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="head"> <div class="head">
<van-swipe :autoplay="3000" style="width: 100%;"> <van-swipe :autoplay="3000" style="width: 100%;">
<van-swipe-item v-for="(item, index) in activity" :key="index" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend(item)"> <van-swipe-item v-for="(item, index) in activity" :key="index" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend(item)">
@@ -12,10 +11,7 @@
</div> </div>
<div class="iconPart1"> <div class="iconPart1">
<van-notice-bar <van-notice-bar :left-icon="png8" :text='getCodeValue'/>
:left-icon="png8"
:text='getCodeValue'
/>
</div> </div>
<div class="top"> <div class="top">
@@ -61,13 +57,13 @@
</div> </div>
<div class="chooseProductDialog" style="padding: 20px 30px 30px;font-size: 14px;"> <div class="chooseProductDialog" style="padding: 20px 30px 30px;font-size: 14px;">
<van-radio-group v-model="chooseProductRadio"> <van-radio-group v-model="chooseProductRadio">
<van-radio v-for="(item,index) in list2" :key="index" :name="item.code" style="margin: 10px;"> <van-radio v-for="(item,index) in projectList" :key="index" :name="item.projectCode" style="margin: 10px;">
<span style="margin-left: 20px;">{{item.name}}</span> <span style="margin-left: 20px;">{{item.projectName}}</span>
</van-radio> </van-radio>
</van-radio-group> </van-radio-group>
</div> </div>
<div style="text-align: center;margin-bottom: 30px;"> <div style="text-align: center;margin-bottom: 30px;">
<van-button round type="danger" size="small" style="padding:0px 35px;font-size: 14px;" @click="chooseProductDialogShow = false"> <van-button round type="danger" size="small" style="padding:0px 35px;font-size: 14px;" @click="chooseProductList">
确定 确定
</van-button> </van-button>
</div> </div>
@@ -106,11 +102,54 @@ export default {
list1:[ list1:[
{name:'合作单位1'},{name:'合作单位2'},{name:'合作单位3'},{name:'合作单位4'}, {name:'合作单位1'},{name:'合作单位2'},{name:'合作单位3'},{name:'合作单位4'},
], ],
list2:[ projectList:[
{name:'项目名称1',code:'111'},{name:'项目名称2',code:'222'},{name:'项目名称3',code:'333'},{name:'项目名称4',code:'444'}, {
"projectCode": "PID0000001",
"projectName": "北京朝阳医院项目A",
"platformCode": "ID20230001",
"platformName": "北京朝阳医院",
"teamCode": "TID0000000",
"teamName": "北京朝阳医院项目A小组01",
"startDate": "2023-12-01",
"endDate": "2023-12-18",
"projectState": "1"
},
{
"projectCode": "PID0000002",
"projectName": "北京朝阳医院项目B",
"platformCode": "ID20230001",
"platformName": "北京朝阳医院",
"teamCode": "TID0000000",
"teamName": "北京朝阳医院项目A小组01",
"startDate": "2023-12-01",
"endDate": "9999-12-31",
"projectState": "1"
},
{
"projectCode": "PID0000003",
"projectName": "北京朝阳医院项目C",
"platformCode": "ID20230001",
"platformName": "北京朝阳医院",
"teamCode": "TID0000000",
"teamName": "北京朝阳医院项目A小组01",
"startDate": "2023-12-01",
"endDate": "9999-12-31",
"projectState": "1"
},
{
"projectCode": "PID0000004",
"projectName": "北京朝阳医院项目D",
"platformCode": "ID20230001",
"platformName": "北京朝阳医院",
"teamCode": "TID0000000",
"teamName": "北京朝阳医院项目A小组01",
"startDate": "2023-12-01",
"endDate": "9999-12-31",
"projectState": "1"
}
], ],
chooseProductDialogShow: true, chooseProductDialogShow: true,
chooseProductRadio:'111' chooseProductRadio:''
} }
}, },
mounted(){ mounted(){
@@ -118,6 +157,76 @@ export default {
this.setMarginTop() this.setMarginTop()
}, },
methods:{ methods:{
chooseProductList(){
if(!this.chooseProductRadio) {
this.$toast('请选择项目')
return false
}
let currentTime = new Date()
let thisEndTime = ''
let thisProductName = ''
this.projectList.forEach(item=>{
if(item.projectCode == this.chooseProductRadio) {
thisEndTime = new Date(item.endDate)
thisProductName = item.projectName
}
})
if(currentTime > thisEndTime) {
this.$toast(thisProductName+'项目服务时间已结束!')
return false
}
this.chooseProductDialogShow = false
},
goDetail(data){
if(data.title == '业绩查询'){
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/YB_APP/performanceQuery',
},
routerInfo: {
path: '/YB_APP/performanceQuery',
},
})
}
if(data.title == '上头条'){
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/YB_APP/hitTheHeadlines',
},
routerInfo: {
path: '/YB_APP/hitTheHeadlines',
},
})
}
if(data.title == '续期管理'){
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/YB_APP/renewalList',
},
routerInfo: {
path: '/YB_APP/renewalList',
},
})
}
if(data.title == '保全中心'){
this.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/YB_APP/saveallList',
},
routerInfo: {
path: '/YB_APP/saveallList',
},
})
}
},
setMarginTop(){ setMarginTop(){
EWebBridge.webCallAppInJs("top_bar_height").then(data => { EWebBridge.webCallAppInJs("top_bar_height").then(data => {
console.log(data,'top_bar_height') console.log(data,'top_bar_height')
@@ -179,6 +288,17 @@ export default {
}, 1000); }, 1000);
}, },
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
if(from && from.path){
console.log(from)
// eslint-disable-next-line no-undef
if(form.path == '/login') {
window.sessionStorage.setItem('GBCFrom','GBCLogin')
}
}
});
},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -186,9 +306,10 @@ export default {
font-size: 12px; font-size: 12px;
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
background-image: url("../../assets/YB_APP/images/2-1.png"); /*background-image: url("../../assets/YB_APP/images/2-1.png");*/
background-repeat: no-repeat; /*background-repeat: no-repeat;*/
background-size: contain; /*background-size: contain;*/
background: #F0F8FF;
} }
.head { .head {
position: relative; position: relative;
@@ -214,7 +335,7 @@ export default {
} }
} }
/deep/ .van-notice-bar{ /deep/ .van-notice-bar{
background: linear-gradient(#f4f6ff,#fff); background: #fff;
color: #333; color: #333;
letter-spacing: 1px; letter-spacing: 1px;
} }
@@ -236,7 +357,12 @@ export default {
margin: 10px;border-radius: 5px; margin: 10px;border-radius: 5px;
} }
.top{ .top{
display:flex;justify-content: space-between;margin: 10px;background: #fff;border-radius: 5px;align-items: center;padding: 15px; display:flex;
justify-content: space-between;
margin: 10px;
border-radius: 5px;
align-items: center;
padding: 15px;
} }
.title-img { .title-img {
height: 40px; height: 40px;