task#15348,列表接口获取更换

This commit is contained in:
2024-10-08 16:30:04 +08:00
parent 75e014562f
commit 31d3bcf071
4 changed files with 92 additions and 62 deletions

View File

@ -162,14 +162,32 @@ export function notifyInvoiceDetail(data){
data data
}) })
} }
// /supplier/supplierTrainingMaterials/pageList 获取培训材料列表 // 获取培训材料列表
export function pageList(data){ /*export function pageList(data){
return request({ return request({
url:'/supplierAppV2/dispatchApp/user/supplierTrainingMaterialsPageList', url:'/supplierAppV2/dispatchApp/user/supplierTrainingMaterialsPageList',
method:'POST', method:'POST',
contentType:'application/json', contentType:'application/json',
data data
}) })
}*/
//获取普通材料
export function getNormalList(key) {
return request({
url: '/supplier/supplierTraining/normalList',
method: 'GET',
params:key
});
}
//获取培训材料
export function getTrainingList(key) {
return request({
url: '/supplier/supplierTraining/trainingList',
method: 'GET',
params:key
});
} }
//用户操作权限 //用户操作权限
export function userOperationPermissions(){ export function userOperationPermissions(){

View File

@ -58,19 +58,15 @@
.common{ .common{
margin: 0 15px ; margin: 0 15px ;
} }
.time{
color: rgba(0,0,0,0.7);
}
.imgWrap{ .imgWrap{
@include wh(100%,200px); @include wh(100%,200px);
position: relative; position: relative;
img{ img{
@include wh(100%,100%); @include wh(100%,100%);
} }
/* .name{
position: absolute;
left: 30px;
bottom: 30px;
@include fontWeightSize(bold,14px);
color: #FFFFFF;
}*/
} }
.left{ .left{
color: red; color: red;

View File

@ -11,7 +11,7 @@
> >
<template slot="title"> <template slot="title">
<div v-show="!show">文档资料</div> <div v-show="!show">文档资料</div>
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getList"/> <van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getNormalList"/>
</template> </template>
<template slot="right"> <template slot="right">
<div class="rightWrap" @click="show = !show"> <div class="rightWrap" @click="show = !show">
@ -50,7 +50,7 @@
<script> <script>
import {myMixins} from "@/utils/myMixins" import {myMixins} from "@/utils/myMixins"
import {pageList} from "@/api/mine"; import {getNormalList} from "@/api/mine";
export default { export default {
name: "docmentList", name: "docmentList",
mixins:[myMixins], mixins:[myMixins],
@ -59,21 +59,22 @@ export default {
tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}, {name: '新手入列', status: 4},], tabArr: [{name: '车型技术参数', status: 1}, {name: '中道服务规范', status:2},{name: '中道小课堂', status: 3}, {name: '新手入列', status: 4},],
activeIndex: 0, activeIndex: 0,
pageList:[], pageList:[],
pageNum:1, totalList:[],
pageSize:10, /* pageNum:1,
pageSize:10,*/
keyword:'', keyword:'',
trainingType:1, // trainingType:1,
isLoading:false, isLoading:false,
show:false, show:false,
showEmpty:false showEmpty:false
} }
}, },
mounted() { mounted() {
this.getList() this.getNormalList()
}, },
methods:{ methods:{
onRefresh() { onRefresh() {
this.getList() this.getNormalList()
setTimeout(() => { setTimeout(() => {
this.$toast('刷新成功'); this.$toast('刷新成功');
this.isLoading = false; this.isLoading = false;
@ -81,32 +82,39 @@ export default {
}, },
async changeTab(index) { async changeTab(index) {
this.activeIndex = index this.activeIndex = index
this.pageNum = 1 await this.getNormalList()
this.pageList = [];
if(this.activeIndex === 0){
this.trainingType =1
}else{
this.trainingType=2
}
await this.getList()
}, },
async getList(){ async getNormalList(){
let res= await pageList({ let res= await getNormalList({
pageNum:this.pageNum, type:2,
pageSize:this.pageSize, id:33041,
docType:2, text:this.keyword || '',
trainingType:this.trainingType,
keyword:this.keyword || ''
}) })
this.pageList=res.data; this.totalList=[]
if(res.data.length === 0){ this.pageList=[]
this.totalList=res.data.list
let result=[]
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 === '中道小课堂');
}else if(this.activeIndex === 3){
result=this.totalList?.filter(q => q.title === '新手入列');
}
if(result){
this.pageList=result[0].materials
}
if(this.pageList?.length === 0){
this.showEmpty = true this.showEmpty = true
}else { }else {
this.showEmpty = false this.showEmpty = false
} }, }
},
initShow(){ initShow(){
this.keyword= '', this.keyword= '',
this.getList() this.getNormalList()
} }
} }
} }

View File

@ -11,7 +11,7 @@
> >
<template slot="title"> <template slot="title">
<div v-show="!show">培训文档</div> <div v-show="!show">培训文档</div>
<van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getList"/> <van-field v-model="keyword" placeholder="请输入关键词" v-show="show" @input="getTrainingList"/>
</template> </template>
<template slot="right"> <template slot="right">
<div class="rightWrap" @click="show = !show"> <div class="rightWrap" @click="show = !show">
@ -31,16 +31,15 @@
<van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:85vh"> <van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:85vh">
<div class="itemWrap" v-for="(item,index) in pageList" :key="index" @click="goH5Detail(item)"> <div class="itemWrap" v-for="(item,index) in pageList" :key="index" @click="goH5Detail(item)">
<div class="info flexBetween common"> <div class="info flexBetween common">
<!-- item.mustRead===1--> <div class="title">{{ item.name }}<span v-if="item.mustRead===1" class="read">必读</span></div>
<div class="title">{{ item.name }}<span class="read">必读</span></div>
<div class="time">{{ item.updateTime }}</div> <div class="time">{{ item.updateTime }}</div>
</div> </div>
<div class="imgWrap"> <div class="imgWrap">
<img :src="item.themePicture"> <img :src="item.themePicture">
</div> </div>
<div class="num common">{{ item.synopsis }}</div> <div class="num common">{{ item.synopsis }}</div>
<div style="text-align: right" v-if="item.docType?.label !== '普通材料'"> <div style="text-align: right" >
<span style="color: red;font-size: 14px;margin-right: 8px">{{ item.listShowButton==null ? '已处理' : '未处理' }}</span> <span style="color: red;font-size: 14px;margin-right: 8px">{{ item.alreadyRead===1 ? '已处理' : '未处理' }}</span>
</div> </div>
</div> </div>
</van-pull-refresh> </van-pull-refresh>
@ -53,7 +52,7 @@
<script> <script>
import {myMixins} from "@/utils/myMixins" import {myMixins} from "@/utils/myMixins"
import {pageList} from "@/api/mine" import {getTrainingList} from "@/api/mine"
export default { export default {
name: "trainDocment", name: "trainDocment",
computed: { computed: {
@ -66,6 +65,7 @@ export default {
pageNum:1, pageNum:1,
pageSize:10, pageSize:10,
pageList:[], pageList:[],
totalList:[],
keyword:'', keyword:'',
show:false, show:false,
showEmpty:false, showEmpty:false,
@ -73,11 +73,14 @@ export default {
} }
}, },
mounted() { mounted() {
this.getList(); const urlParams = new URLSearchParams(window.location.search);
const supplierId = urlParams.get('supplierId');
this.$toast(supplierId);
this.getTrainingList();
}, },
methods:{ methods:{
onRefresh() { onRefresh() {
this.getList() this.getTrainingList()
setTimeout(() => { setTimeout(() => {
this.$toast('刷新成功'); this.$toast('刷新成功');
this.isLoading = false; this.isLoading = false;
@ -85,24 +88,29 @@ export default {
}, },
async changeTab(index) { async changeTab(index) {
this.activeIndex = index this.activeIndex = index
this.pageNum = 1 await this.getTrainingList()
this.pageList = [];
if(this.activeIndex === 0){
this.trainingType =1
}else{
this.trainingType=2
}
await this.getList()
}, },
async getList(){ async getTrainingList(){
let res= await pageList({ let res= await getTrainingList({
pageNum:this.pageNum, type:2,
pageSize:this.pageSize, id:33041,
docType:1, text:this.keyword || '',
keyword:this.keyword || ''
}) })
this.pageList=res.data; this.totalList=[]
if(res.data.length === 0){ this.pageList=[]
this.totalList=res.data.list
let result=[]
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 === '中道小课堂');
}
if(result){
this.pageList=result[0].materials
}
if(this.pageList?.length === 0){
this.showEmpty = true this.showEmpty = true
}else { }else {
this.showEmpty = false this.showEmpty = false
@ -110,7 +118,7 @@ export default {
}, },
initShow(){ initShow(){
this.keyword= '', this.keyword= '',
this.getList() this.getTrainingList()
} }
} }
} }