CRM_25-12-09#story#7484,供应商培训材料问答编辑优化--敖煜

This commit is contained in:
2025-12-03 15:12:47 +08:00
parent 72fe6cc266
commit 811f232a73
4 changed files with 112 additions and 17 deletions

View File

@@ -23,6 +23,17 @@
div { div {
padding-top: 8px; padding-top: 8px;
} }
.commonNum{
padding: 2px 5px;
background-color: #9C9C9C;
color: white;
border-radius: 3px;
font-size: 13px;
margin-left: 3px;
}
.notFinish{
background-color: red;
}
.active { .active {
color: #3678FF; color: #3678FF;
position: relative; position: relative;

View File

@@ -1,6 +1,6 @@
@import "@/styles/mixin.scss"; @import "@/styles/mixin.scss";
::v-deep .van-nav-bar__content{ ::v-deep .van-nav-bar__content{
background-color: #3A3A3A !important; //background-color: #3A3A3A !important;
} }
.wrap{ .wrap{
@include wh(100%,100%); @include wh(100%,100%);

View File

@@ -1,6 +1,28 @@
<template> <template>
<div class="wrap"> <div class="wrap">
<div class="navBar"> <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 <van-nav-bar
:border="false" :border="false"
:fixed="true" :fixed="true"
@@ -24,7 +46,8 @@
</template> </template>
</van-nav-bar> </van-nav-bar>
</div> </div>
<div class="statisticContainer"> -->
<!-- <div class="statisticContainer">
<div class="statisticWrap"> <div class="statisticWrap">
<div class="line1"> <div class="line1">
<span>培训统计</span> <span>培训统计</span>
@@ -43,11 +66,12 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>-->
<div class="driver_tab_wrap"> <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}"
@click="changeTab(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> </div>
<div class="contentWrap" v-show="!showEmpty"> <div class="contentWrap" v-show="!showEmpty">
@@ -84,7 +108,8 @@ export default {
mixins:[myMixins], mixins:[myMixins],
data(){ data(){
return{ 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, activeIndex: 0,
pageList:[], pageList:[],
totalList:[], totalList:[],
@@ -115,6 +140,10 @@ export default {
}); });
}, },
methods:{ methods:{
initShow(){
this.keyword= ''
this.getTrainingList()
},
onRefresh() { onRefresh() {
this.getTrainingList() this.getTrainingList()
setTimeout(() => { setTimeout(() => {
@@ -136,17 +165,34 @@ export default {
this.totalList=[] this.totalList=[]
this.pageList=[] this.pageList=[]
this.numInfo=res.data this.numInfo=res.data
this.totalList=res.data.list if(res.data.totalNum){
let result=[] 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){ if(this.activeIndex === 0){
result=this.totalList?.filter(q => q.title === '车型技术参数'); result=this.totalList?.filter(q => q.title === '车型技术参数');
}else if(this.activeIndex === 1){ }else if(this.activeIndex === 1){
result=this.totalList?.filter(q => q.title === '中道服务规范'); result=this.totalList?.filter(q => q.title === '中道服务规范');
}else if(this.activeIndex === 2){ }else if(this.activeIndex === 2){
result=this.totalList?.filter(q => q.title === '中道小课堂'); 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){ if(result){
this.pageList=result[0].materials this.pageList=result
this.time=timeFormat(Date.now()) this.time=timeFormat(Date.now())
} }
if(this.pageList?.length === 0){ if(this.pageList?.length === 0){
@@ -163,6 +209,19 @@ export default {
@import "@/styles/mixin.scss"; @import "@/styles/mixin.scss";
@import "@/styles/docment.scss"; @import "@/styles/docment.scss";
@import "@/styles/driverDocment.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{ .read{
padding: 2px 8px; padding: 2px 8px;
border-radius: 5px; border-radius: 5px;

View File

@@ -22,9 +22,9 @@
</van-nav-bar> </van-nav-bar>
</div> </div>
<div class="tab_wrap"> <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)"> @click="changeTab(index)">
{{ item.name }} {{ item.name }}<span v-if="item.count" :class="{'commonNum':true,'notFinish':index==2}">{{item.count}}</span>
</div> </div>
</div> </div>
<div class="contentWrap" v-show="!showEmpty"> <div class="contentWrap" v-show="!showEmpty">
@@ -61,7 +61,7 @@ export default {
mixins:[myMixins], mixins:[myMixins],
data(){ data(){
return{ 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, activeIndex: 0,
pageNum:1, pageNum:1,
pageSize:10, pageSize:10,
@@ -73,6 +73,7 @@ export default {
showEmpty:false, showEmpty:false,
isLoading:false, isLoading:false,
supplierId:'', supplierId:'',
numInfo:'',
} }
}, },
mounted() { mounted() {
@@ -111,17 +112,31 @@ export default {
}) })
this.totalList=[] this.totalList=[]
this.pageList=[] 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=[] let result=[]
if(this.activeIndex === 0){ 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){ }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){ }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){ if(result){
this.pageList=result[0].materials this.pageList=result
} }
if(this.pageList?.length === 0){ if(this.pageList?.length === 0){
this.showEmpty = true this.showEmpty = true
@@ -140,6 +155,16 @@ export default {
@import "@/styles/common.scss"; @import "@/styles/common.scss";
@import "@/styles/mixin.scss"; @import "@/styles/mixin.scss";
@import "@/styles/docment.scss"; @import "@/styles/docment.scss";
.tab_wrap {
.active:after {
width: 37px;
left: 0%;
transform: translateX(0%);
}
.active1:after {
width:48px !important;
}
}
.read{ .read{
padding: 2px 8px; padding: 2px 8px;
border-radius: 5px; border-radius: 5px;