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

This commit is contained in:
liu.xiaofeng@ebiz-digits.com
2023-12-18 14:42:41 +08:00
parent 9351f6d80b
commit 39101a9d40
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>
<div class="public_container" :style="{paddingTop:marginTop+'px'}">
<van-pull-refresh v-model="isLoading" @refresh="onRefresh">
<div class="head">
<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)">
@@ -12,10 +11,7 @@
</div>
<div class="iconPart1">
<van-notice-bar
:left-icon="png8"
:text='getCodeValue'
/>
<van-notice-bar :left-icon="png8" :text='getCodeValue'/>
</div>
<div class="top">
@@ -61,13 +57,13 @@
</div>
<div class="chooseProductDialog" style="padding: 20px 30px 30px;font-size: 14px;">
<van-radio-group v-model="chooseProductRadio">
<van-radio v-for="(item,index) in list2" :key="index" :name="item.code" style="margin: 10px;">
<span style="margin-left: 20px;">{{item.name}}</span>
<van-radio v-for="(item,index) in projectList" :key="index" :name="item.projectCode" style="margin: 10px;">
<span style="margin-left: 20px;">{{item.projectName}}</span>
</van-radio>
</van-radio-group>
</div>
<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>
</div>
@@ -106,11 +102,54 @@ export default {
list1:[
{name:'合作单位1'},{name:'合作单位2'},{name:'合作单位3'},{name:'合作单位4'},
],
list2:[
{name:'项目名称1',code:'111'},{name:'项目名称2',code:'222'},{name:'项目名称3',code:'333'},{name:'项目名称4',code:'444'},
projectList:[
{
"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,
chooseProductRadio:'111'
chooseProductRadio:''
}
},
mounted(){
@@ -118,6 +157,76 @@ export default {
this.setMarginTop()
},
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(){
EWebBridge.webCallAppInJs("top_bar_height").then(data => {
console.log(data,'top_bar_height')
@@ -179,6 +288,17 @@ export default {
}, 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>
<style lang="scss" scoped>
@@ -186,9 +306,10 @@ export default {
font-size: 12px;
height: 100vh;
width: 100vw;
background-image: url("../../assets/YB_APP/images/2-1.png");
background-repeat: no-repeat;
background-size: contain;
/*background-image: url("../../assets/YB_APP/images/2-1.png");*/
/*background-repeat: no-repeat;*/
/*background-size: contain;*/
background: #F0F8FF;
}
.head {
position: relative;
@@ -214,7 +335,7 @@ export default {
}
}
/deep/ .van-notice-bar{
background: linear-gradient(#f4f6ff,#fff);
background: #fff;
color: #333;
letter-spacing: 1px;
}
@@ -236,7 +357,12 @@ export default {
margin: 10px;border-radius: 5px;
}
.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 {
height: 40px;