Browse Source

Merge branch 'need_pool295' into debug

shanbinzhang 3 tuần trước cách đây
mục cha
commit
593f796118

+ 83 - 4
src/views/report_manage/reportV2/components/chooseInherReportDia.vue

@@ -9,7 +9,34 @@
     @close="closeDia"
   >
       <div class="dialog-wrap">
-        <div style="margin-bottom: 20px;">
+        <div class="filter-wrap">
+          <div>
+            <el-cascader
+                @change="filterChange"
+                :options="classifyOptions"
+                v-model="filterForm.classifyIds"
+                :props="{
+                  value: 'Id',
+                  label: 'ClassifyName',
+                  children: 'Child',
+                }"
+                :show-all-levels="false"
+                :disabled="defaultClassify.length>0"
+                clearable
+                :placeholder="$t('ReportManage.smart_type_filtering')"
+                style="width:160px;"
+            ></el-cascader>
+            <el-select
+                v-model.number="filterForm.state"
+                :placeholder="$t('ReportManage.smart_status_filtering')"
+                size="medium"
+                clearable
+                style="width:160px;"
+                @change="filterChange"
+            >
+              <el-option :label="stateMap.get(item)" :value="item" v-for="item in stateOption" :key="item"></el-option>
+            </el-select>
+          </div>
           <el-input
               @input="filterChange"
               :placeholder="$t('ReportManage.ReportList.ph_report_tit')"
@@ -66,6 +93,10 @@
                 <span v-if="row.ClassifyNameThird">/ {{ row.ClassifyNameThird }}</span>
               </span>
 
+              <span v-else-if="item.key==='State'">
+                {{ stateMap.get(row.State) }}
+              </span>
+
               <span v-else-if="item.key==='CreateTime'">
                 {{ $moment(row.CreateTime).format('YYYY-MM-DD') }}
               </span>
@@ -108,6 +139,12 @@ export default {
     id: {
       type: Number,
       default: 0
+    },
+    defaultClassify: {
+      type: Array
+    },
+    classifyOptions: {
+      type: Array
     }
   },
   computed: {
@@ -115,23 +152,43 @@ export default {
       return [
         { label: this.$t('ReportManage.smart_report_title'),key: 'Title' },
         { label: this.$t('ReportManage.smart_report_type'),key: 'Classify' },
+        { label: this.$t('ReportManage.smart_status_table'),key: 'State' },
         { label: '创建时间',key: 'CreateTime' },
       ]
+    },
+
+    stateMap() {
+      return new Map([
+        [1,this.$t('ReportManage.smart_unpublished')],
+        [2,this.$t('ReportManage.smart_published')],
+        [3,this.$t('ReportManage.smart_pending')],
+        [4,this.$t('ReportManage.smart_awaiting_approval')],
+        [5,this.$t('ReportManage.smart_rejected')],
+        [6,this.$t('ReportManage.smart_approved')],
+      ])
     }
   },
   data() {
     return {
+      stateOption: [1,2,3,4,5,6],
       reportList: [],
       pageNo: 1,
       pageSize: 5,
       total: 0,
       searchTxt: '',
-      checkList: []
+      checkList: [],
+
+      filterForm: {
+        classifyIds:[],
+        state:'',
+      },
     }
   },
   watch: {
     isShow(nval) {
       if(!nval) return
+
+      this.filterForm.classifyIds = this.defaultClassify;
     }
   },
   methods:{
@@ -142,6 +199,10 @@ export default {
       this.searchTxt = '';
       this.checkList = [];
 
+      this.filterForm = {
+        classifyIds:[],
+        state:'',
+      }
       this.$emit('update:isShow',false)
     },
 
@@ -170,7 +231,21 @@ export default {
       reportV2Interface.getAuthReportList({
           CurrentIndex: this.pageNo,
           PageSize:this.pageSize,
-          Keyword:this.searchTxt
+          Keyword:this.searchTxt,
+          State: String(this.filterForm.state),
+          ClassifyIdFirst: this.filterForm.classifyIds
+            ? this.filterForm.classifyIds[0]
+            : 0,
+          ClassifyIdSecond:
+            this.filterForm.classifyIds &&
+            this.filterForm.classifyIds.length > 1
+              ? this.filterForm.classifyIds[1]
+              : 0,
+          ClassifyIdThird:
+            this.filterForm.classifyIds &&
+            this.filterForm.classifyIds.length > 2
+              ? this.filterForm.classifyIds[2]
+              : 0,
         })
         .then((res) => {
           if (res.Ret !== 200) return;
@@ -184,7 +259,11 @@ export default {
 </script>
 <style scoped lang='scss'>
 .dialog-wrap {
-
+  .filter-wrap {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 20px;
+  }
 }
 .dialog-btn{
     margin:40px 0;

+ 4 - 2
src/views/report_manage/reportV2/components/reportBaseInfoDia.vue

@@ -188,6 +188,8 @@
     <!-- 选择继承报告弹窗 -->
     <chooseInherReportDia
       :isShow.sync="isChooseInherReport"
+      :defaultClassify="formData.classify"
+      :classifyOptions="classifyArr"
       @success="chooseInheritReport"
     />
   </div>
@@ -424,8 +426,8 @@ export default {
 
       
       //获取上次报告
-      reportV2Interface
-        .getAuthReportList({
+      reportV2Interface.getAuthReportList({
+          State: '2,6',
           ClassifyIdFirst: this.formData.classify[0],
           ClassifyIdSecond: this.formData.classify[1],
           ClassifyIdThird: this.formData.classify[2],

+ 1 - 1
src/views/report_manage/reportV2/list.vue

@@ -683,7 +683,7 @@ export default {
             : "",
         ClassifyIdThird:
           this.searchform.classifyIds &&
-          this.searchform.classifyIds.length > 1
+          this.searchform.classifyIds.length > 2
             ? this.searchform.classifyIds[2]
             : "",
         State: this.searchform.state ? this.searchform.state : null,