CRM_25-12-09#story#7484,供应商培训材料问答编辑优化--敖煜
This commit is contained in:
@@ -1,6 +1,28 @@
|
||||
<template>
|
||||
<div class="wrap">
|
||||
<div class="navBar">
|
||||
<van-nav-bar
|
||||
left-arrow
|
||||
left-arrow-color="#FFFFFF"
|
||||
:border="false"
|
||||
:fixed="true"
|
||||
:safe-area-inset-top="true"
|
||||
@click-left="goBack"
|
||||
>
|
||||
<template slot="title">
|
||||
<div v-show="!show">培训文档</div>
|
||||
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getTrainingList"/>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<div class="rightWrap" @click="show = !show">
|
||||
<img src="@/assets/serach.png" class="img2" v-show="!show"/>
|
||||
<img src="@/assets/delKey.png" class="img2" v-show="show" @click="initShow"/>
|
||||
</div>
|
||||
</template>
|
||||
</van-nav-bar>
|
||||
</div>
|
||||
|
||||
<!-- <div class="navBar">
|
||||
<van-nav-bar
|
||||
:border="false"
|
||||
:fixed="true"
|
||||
@@ -24,7 +46,8 @@
|
||||
</template>
|
||||
</van-nav-bar>
|
||||
</div>
|
||||
<div class="statisticContainer">
|
||||
-->
|
||||
<!-- <div class="statisticContainer">
|
||||
<div class="statisticWrap">
|
||||
<div class="line1">
|
||||
<span>培训统计</span>
|
||||
@@ -43,11 +66,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="driver_tab_wrap">
|
||||
</div>-->
|
||||
<div class="tab_wrap">
|
||||
<div v-for="(item, index) in tabArr" :key="index" :class="{'active' : activeIndex == index}"
|
||||
@click="changeTab(index)">
|
||||
{{ item.name }}
|
||||
{{ item.name }}<span v-if="item.count" :class="{'commonNum':true,'notFinish':index==2}">{{item.count}}</span>
|
||||
<!-- {{ item.name }}-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="contentWrap" v-show="!showEmpty">
|
||||
@@ -84,7 +108,8 @@ export default {
|
||||
mixins:[myMixins],
|
||||
data(){
|
||||
return{
|
||||
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}],
|
||||
tabArr: [{name: '全部文档', status: 1,count:0}, {name: '已培训', status:2,count:0},{name: '未培训', status: 3,count:0}],
|
||||
// tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}],
|
||||
activeIndex: 0,
|
||||
pageList:[],
|
||||
totalList:[],
|
||||
@@ -115,6 +140,10 @@ export default {
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
initShow(){
|
||||
this.keyword= ''
|
||||
this.getTrainingList()
|
||||
},
|
||||
onRefresh() {
|
||||
this.getTrainingList()
|
||||
setTimeout(() => {
|
||||
@@ -136,17 +165,34 @@ export default {
|
||||
this.totalList=[]
|
||||
this.pageList=[]
|
||||
this.numInfo=res.data
|
||||
this.totalList=res.data.list
|
||||
let result=[]
|
||||
if(res.data.totalNum){
|
||||
this.tabArr[0].count=res.data.totalNum
|
||||
}
|
||||
if(res.data.readNum){
|
||||
this.tabArr[1].count=res.data.readNum
|
||||
}
|
||||
if(res.data.notReadNum){
|
||||
this.tabArr[2].count=res.data.notReadNum
|
||||
}
|
||||
/* this.totalList=res.data.list
|
||||
if(this.activeIndex === 0){
|
||||
result=this.totalList?.filter(q => q.title === '车型技术参数');
|
||||
}else if(this.activeIndex === 1){
|
||||
result=this.totalList?.filter(q => q.title === '中道服务规范');
|
||||
}else if(this.activeIndex === 2){
|
||||
result=this.totalList?.filter(q => q.title === '中道小课堂');
|
||||
}*/
|
||||
let result=[]
|
||||
this.totalList=res?.data?.list ? res?.data?.list[0]?.materials : []
|
||||
if(this.activeIndex === 0){
|
||||
result=this.totalList || []
|
||||
}else if(this.activeIndex === 1){
|
||||
result=this.totalList?.filter(item => item.alreadyRead==1) || []
|
||||
}else if(this.activeIndex === 2){
|
||||
result=this.totalList?.filter(item => item.alreadyRead!=1) || []
|
||||
}
|
||||
if(result){
|
||||
this.pageList=result[0].materials
|
||||
this.pageList=result
|
||||
this.time=timeFormat(Date.now())
|
||||
}
|
||||
if(this.pageList?.length === 0){
|
||||
@@ -163,6 +209,19 @@ export default {
|
||||
@import "@/styles/mixin.scss";
|
||||
@import "@/styles/docment.scss";
|
||||
@import "@/styles/driverDocment.scss";
|
||||
/*::v-deep .van-nav-bar__content{
|
||||
background-color: #3A3A3A !important;
|
||||
}*/
|
||||
.tab_wrap {
|
||||
.active:after {
|
||||
width: 37px;
|
||||
left: 0%;
|
||||
transform: translateX(0%);
|
||||
}
|
||||
.active1:after {
|
||||
width:48px !important;
|
||||
}
|
||||
}
|
||||
.read{
|
||||
padding: 2px 8px;
|
||||
border-radius: 5px;
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
</van-nav-bar>
|
||||
</div>
|
||||
<div class="tab_wrap">
|
||||
<div v-for="(item, index) in tabArr" :key="index" :class="{'active' : activeIndex == index}"
|
||||
<div v-for="(item, index) in tabArr" :key="index" :class="{'active' : activeIndex == index,'active1':activeIndex==0}"
|
||||
@click="changeTab(index)">
|
||||
{{ item.name }}
|
||||
{{ item.name }}<span v-if="item.count" :class="{'commonNum':true,'notFinish':index==2}">{{item.count}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="contentWrap" v-show="!showEmpty">
|
||||
@@ -61,7 +61,7 @@ export default {
|
||||
mixins:[myMixins],
|
||||
data(){
|
||||
return{
|
||||
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}],
|
||||
tabArr: [{name: '全部文档', status: 1,count:0}, {name: '已培训', status:2,count:0},{name: '未培训', status: 3,count:0}],
|
||||
activeIndex: 0,
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
@@ -73,6 +73,7 @@ export default {
|
||||
showEmpty:false,
|
||||
isLoading:false,
|
||||
supplierId:'',
|
||||
numInfo:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -111,17 +112,31 @@ export default {
|
||||
})
|
||||
this.totalList=[]
|
||||
this.pageList=[]
|
||||
this.totalList=res.data.list
|
||||
this.totalList=res?.data?.list ? res?.data?.list[0]?.materials : []
|
||||
this.numInfo=res.data
|
||||
if(res.data.totalNum){
|
||||
this.tabArr[0].count=res.data.totalNum
|
||||
}
|
||||
if(res.data.readNum){
|
||||
this.tabArr[1].count=res.data.readNum
|
||||
}
|
||||
if(res.data.notReadNum){
|
||||
this.tabArr[2].count=res.data.notReadNum
|
||||
}
|
||||
console.log(' this.totalList',this.totalList)
|
||||
let result=[]
|
||||
if(this.activeIndex === 0){
|
||||
result=this.totalList?.filter(q => q.title === '车型技术参数');
|
||||
result=this.totalList || []
|
||||
// result=this.totalList?.filter(q => q.title === '车型技术参数');
|
||||
}else if(this.activeIndex === 1){
|
||||
result=this.totalList?.filter(q => q.title === '中道服务规范');
|
||||
// result=this.totalList?.filter(q => q.title === '中道服务规范');
|
||||
result=this.totalList?.filter(item => item.alreadyRead==1) || []
|
||||
}else if(this.activeIndex === 2){
|
||||
result=this.totalList?.filter(q => q.title === '中道小课堂');
|
||||
result=this.totalList?.filter(item => item.alreadyRead!=1) || []
|
||||
// result=this.totalList?.filter(q => q.title === '中道小课堂');
|
||||
}
|
||||
if(result){
|
||||
this.pageList=result[0].materials
|
||||
this.pageList=result
|
||||
}
|
||||
if(this.pageList?.length === 0){
|
||||
this.showEmpty = true
|
||||
@@ -140,6 +155,16 @@ export default {
|
||||
@import "@/styles/common.scss";
|
||||
@import "@/styles/mixin.scss";
|
||||
@import "@/styles/docment.scss";
|
||||
.tab_wrap {
|
||||
.active:after {
|
||||
width: 37px;
|
||||
left: 0%;
|
||||
transform: translateX(0%);
|
||||
}
|
||||
.active1:after {
|
||||
width:48px !important;
|
||||
}
|
||||
}
|
||||
.read{
|
||||
padding: 2px 8px;
|
||||
border-radius: 5px;
|
||||
|
||||
Reference in New Issue
Block a user