jwyu hace 2 años
padre
commit
a75b44bd7c
Se han modificado 2 ficheros con 26 adiciones y 21 borrados
  1. 6 4
      api/report.js
  2. 20 17
      pages-report/reportForVariety/list.vue

+ 6 - 4
api/report.js

@@ -110,18 +110,20 @@ export const apiReportPPtImgs=params=>{
 }
 
 /**
- * 大宗商品中用户已绑定的品种权限(不包含宏观权限)
+ * 品种类型报告中品种筛选项
+ * @param classify_id 分类id
  */
-export const apiGoodsPermissionList=()=>{
-    return httpGet('/company/permission/commodities',{})
+export const apiGoodsPermissionList=params=>{
+    return httpGet('/company/permission/commodities',params)
 }
 
 /**
  * 按品种查询报告列表
  * @param chart_permission_id 品种id
+ * @param classify_id 分类id
  * @param current_index
  * @param page_size
  */
 export const apiReportListForVariety=params=>{
-    return httpGet('/report/commodities/collect',params)
+    return httpGet('/report/variety/list',params)
 }

+ 20 - 17
pages-report/reportForVariety/list.vue

@@ -1,24 +1,23 @@
 <template>
     <view class="varietyauth-report-list">
-
-            <view class="top-variety-box">
-                <view class="first-nav">
-                    <text 
-                        :class="['first-nav-item',item.id===firstVarietyId?'active':'']" 
-                        v-for="item in varietyList" 
-                        :key="item.id"
-                        @click="handleSelectFirstVariety(item)"
-                    >{{item.classify_name}}</text>
-                </view>
-                <view class="sub-nav">
-                    <text 
+        <view class="top-variety-box">
+            <view class="first-nav">
+                <text 
+                    :class="['first-nav-item',item.id===firstVarietyId?'active':'']" 
+                    v-for="item in varietyList" 
+                    :key="item.id"
+                    @click="handleSelectFirstVariety(item)"
+                >{{item.classify_name}}</text>
+            </view>
+            <view class="sub-nav">
+                <text 
                     :class="['sub-nav-item',item.chart_permission_id===secVarietyId?'active':'']" 
                     v-for="item in secVarietyList" 
                     :key="item.chart_permission_id"
                     @click="handleSelectSecVariety(item)"
                 >{{item.chart_permission_name}}</text>
-                </view>
             </view>
+        </view>
         <view class="report-empty-box" v-if="finished&&list.length==0">
             <image :src="globalImgUrls.chartEmpty" mode="widthFix" />
             <view>暂无报告</view>
@@ -30,13 +29,12 @@
                     <view class="van-multi-ellipsis--l2 title">{{item.title}}</view>
                     <view class="info">{{item.classify_name_second}} · {{item.stage}}期 | {{item.publish_time|formatReportTime}}</view>
                 </view>
-                <view class="audio-box">
+                <view class="audio-box" @click.stop="handleClickAudio(item)">
                     <image src="../static/a-pause.png" mode="aspectFill"/>
                 </view>
             </view>
         </view>
 
-
         <!-- 音频弹窗 -->
         <audioBox v-if="showAudioPop"></audioBox>
 
@@ -162,7 +160,9 @@ export default {
 
         //获取用户已绑定品种
         async getPermissionList(){
-            const res=await apiGoodsPermissionList()
+            const res=await apiGoodsPermissionList({
+                classify_id:Number(this.classifyId),
+            })
             if(res.code===200){
                 this.varietyList=res.data.permission_list
                 this.handleSelectFirstVariety(this.varietyList[0])
@@ -187,11 +187,13 @@ export default {
         async getList(){
             const res=await apiReportListForVariety({
                 chart_permission_id:Number(this.secVarietyId),
+                classify_id:Number(this.classifyId),
                 current_index:this.page,
                 page_size:this.pageSize
             })
             if(res.code===200){
-                this.list=[...this.list,...res.data.list]
+                const arr=res.data.list||[]
+                this.list=[...this.list,...arr]
                 this.finished=res.data.paging.is_end
             }
         },
@@ -246,6 +248,7 @@ page{
     left: 0;
     right: 0;
     top: 0;
+    z-index: 50;
     .first-nav-item{
         display: inline-block;
         min-width: 140rpx;