瀏覽代碼

修复隐患问题已知bug及需求变更

凉纪 2 年之前
父節點
當前提交
b23657c19d

+ 10 - 0
src/components/selectCell/index.vue

@@ -44,6 +44,10 @@ export default {
       type: Array,
       default: ()=>[],
     },
+    isAll:{
+      type: Boolean,
+      default: false,
+    },
     //自定义字段
     prop:{
       type: Object,
@@ -63,6 +67,12 @@ export default {
   },
   computed:{
     columns(){
+      if(this.isAll){
+        let obj = {};
+        obj[this.prop.label] = '全部';
+        obj[this.prop.value] = null;
+        return [obj,...this.dataList];
+      }
       return this.dataList;
     },
     selected(){

+ 0 - 1
src/views/menu/message/index.vue

@@ -124,7 +124,6 @@ export default {
       this.getDataList();
     },
     getDataList(){
-      console.log(11111)
       if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
         this.pullup = false;
         this.$toast('已加载完毕');

+ 14 - 10
src/views/menu/problemItem/detail.vue

@@ -23,10 +23,11 @@
             <van-cell title="发现日期" :label="taskInfo.submitTime" />
             <van-cell title="提出人" :label="taskInfo.submitorName" />
             <van-cell title="整改期限" :label="formatDate(taskInfo.reformDeadline,'YYYY-MM-DD')" />
-            <van-cell title="隐患图片" :border="false" >
-              <div v-if="v.img" class="nfc-img" v-for="(v,i) in taskInfo.images" :key="v.img" @click="preViewNFC(i)">
-                <img :src="imgUrl(v.img)" alt="" >
-                <span>{{v.checkName}}</span>
+            <van-cell title="隐患图片" v-if="taskInfo.images && taskInfo.images.length > 0" :border="false" >
+              <div slot="label">
+                <div class="nfc-img" v-for="(v,i) in taskInfo.images" :key="v" @click="clickImage(taskInfo.images,i)">
+                  <img :src="imgUrl(v)" alt="" >
+                </div>
               </div>
             </van-cell>
           </div>
@@ -60,13 +61,13 @@
             <van-cell title="整改日期" :label="formatDate(taskInfo.reform.executeTime,'YYYY-MM-DD')"></van-cell>
 <!--            <van-cell title="审核结果" :label="taskInfo.reform.executeStatus === 0 ? '已整改' : '未整改'"></van-cell>-->
             <van-cell title="整改描述" :label="taskInfo.reform.description"></van-cell>
-            <div class="upload-box" v-if="taskInfo.reform.images.length > 0">
-              <van-cell>
+            <van-cell title="上传信息" v-if="taskInfo.reform.images.length > 0">
+              <div slot="label" v-if="taskInfo.reform.images.length > 0">
                 <div class="nfc-img van-hairline--surround" v-for="(v,i) in taskInfo.reform.images" :key="v" @click="clickImage(taskInfo.reform.images,i)">
                   <img :src="imgUrl(v)" alt="" >
                 </div>
-              </van-cell>
-            </div>
+              </div>
+            </van-cell>
           </div>
         </van-panel>
       </div>
@@ -347,14 +348,17 @@ export default {
   align-items: center;
 }
 .upload-box{
-  margin: 30px;
+  padding: 20px 30px;
 }
 .nfc-img{
   display: inline-block;
   width: 140px;
   height: 140px;
-  margin: 0 10px;
+  margin: 10px;
   position: relative;
+  &:first-child{
+    margin-left: 0;
+  }
   >img{
     width: 100%;
     height: 100%;

+ 47 - 24
src/views/menu/problemItem/index.vue

@@ -5,20 +5,23 @@
       <van-search v-model="query.searchKey" class="van-hairline--bottom" placeholder="请输入搜索关键词" />
       <org-tree v-model="query.orgId"  @change="refreshData"></org-tree>
       <div class="search-flex">
-        <select-cell class="van-hairline--right" title="确认状态" v-model="query.confirmStatus" :data-list="getDictItem('question_confirm_status')" @change="refreshData"/>
-        <date-cell title="发现日期"  v-model="query.submitTime" @change="refreshData"/>
+        <select-cell
+          class="van-hairline--right"
+          title="确认状态"
+          :isAll="true"
+          v-model="query.confirmStatus"
+          :data-list="getDictItem('question_confirm_status')"
+          @change="refreshData"/>
+        <date-cell title="日期"  v-model="query.submitTime" @change="refreshData"/>
       </div>
       <div class="card-list">
-        <van-empty description="暂无数据" v-if="!dataList || dataList.length === 0" />
         <Scroll
-          v-else
-          @pulldown="refreshData"
-          @pullup="getDataList"
-          :data='dataList'
-          :pullup="pullup"
-          class="wrapper"
-          ref="wrapper">
-            <van-cell-group  v-for="(v,i) in dataList">
+          ref="Scroll"
+          @refresh="refreshData"
+          @loadMore="getDataList"
+          :pullup="pullup">
+          <van-empty description="暂无数据" v-if="!dataList || dataList.length === 0" />
+          <card v-else  v-for="(v,i) in dataList">
               <van-cell :title="v.orgName">
                 <template #extra>
                   <van-button
@@ -65,7 +68,7 @@
                   </div>
                 </template>
               </van-cell>
-            </van-cell-group>
+            </card>
         </Scroll>
       </div>
     </div>
@@ -75,6 +78,7 @@
 import NavBar from '@/components/NavBar'
 import OrgTree from '@/components/orgTree'
 import Scroll from '@/components/scroll/scroll'
+import Card from '@/components/card'
 import dateCell from '@/components/dateCell'
 import selectCell from '@/components/selectCell'
 import {dataList} from './api'
@@ -85,15 +89,16 @@ export default {
     NavBar,
     OrgTree,
     Scroll,
+    Card,
     dateCell,
-    selectCell
+    selectCell,
   },
   data() {
     return {
       query:{
         submitTime:`${formatDate(new Date(),'YYYY-MM-DD')}`,
         orgId:null,
-        confirmStatus:'0',
+        confirmStatus:null,
         pageSize:10,
         pageNum:1,
       },
@@ -129,8 +134,9 @@ export default {
   },
   methods: {
     refreshData(){
+      this.pullup = true;
       this.query.pageNum = 1;
-      this.pullup = false;
+      this.total = 0;
       this.dataList = [];
       this.getDataList();
     },
@@ -142,28 +148,45 @@ export default {
     },
     //获取数据列表
     getDataList(){
+      if(!this.query.orgId) return this.$toast('请选择机构');
+      if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
+        this.pullup = false;
+        this.$toast('已加载完毕');
+        return;
+      }
       let data = {
-        ...this.query
+        ...this.query,
       }
-      if(!this.query.orgId) return this.$toast('请选择机构');
       dataList(data).then(res=>{
-        this.loading = false;
-        this.dataList = [...this.dataList,...res.rows];
-        this.query.pageNum = res.pageNum;
+        if(res.total === '0'){
+          this.pullup = false;
+          this.$toast('已加载完毕');
+          return
+        }
+        this.total = res.total;
+        if(this.dataList.length < res.total) {
+          this.dataList = [...this.dataList,...res.rows] ;
+          this.pullup = true;
+          this.query.pageNum++;
+          this.$refs.Scroll.refresh();
+        }
       })
     },
     clickItem(id,type){
       this.$router.push({
         path:'/problemDetail',
-        query:{
-          id,type
-        }
+        query:{id,type}
       });
     }
   }
 }
 </script>
 <style lang="scss">
+.card {
+  >.van-cell{
+    padding: 0;
+  }
+}
 .van-cell-group{
   margin-bottom: 20px;
 }
@@ -185,7 +208,7 @@ export default {
 
 }
 .card-list{
-  padding: 20px;
+  padding:0 20px;
   height: calc(100vh - 518px);
   overflow:  auto;
 }