408249787 2 yıl önce
ebeveyn
işleme
96786e68e7
1 değiştirilmiş dosya ile 29 ekleme ve 14 silme
  1. 29 14
      src/views/dashboard/SbInfoTypeReport.vue

+ 29 - 14
src/views/dashboard/SbInfoTypeReport.vue

@@ -13,25 +13,34 @@
                 :value="parseInt(value)">{{ label }}
               </a-select-option>
             </a-select> -->
-            <a-cascader
+            <!-- <a-cascader
               :options="typeList"
               :fieldNames="fieldNames"
               :load-data="loadData"
               placeholder="请选择"
               change-on-select
               @change="onChange"
-            />
-            <!-- <a-select style="margin-left: 8px;width:150px" v-model="queryParam.typeId" placeholder="请选择">
+            /> -->
+            <a-select style="margin-left: 8px;width:150px" @change="onChange" placeholder="请选择" allowClear v-model="queryParams.typeId1">
               <a-select-option
                 v-for="{name,id} in typeList"
                 :key="id"
                 :label="name"
                 :value="id">{{ name }}
               </a-select-option>
-            </a-select> -->
+            </a-select>
+
+            <a-select style="margin-left: 8px;width:150px" placeholder="请选择" allowClear v-model="queryParams.typeId2" >
+              <a-select-option
+                v-for="{name,id} in typeList2"
+                :key="id"
+                :label="name"
+                :value="id">{{ name }}
+              </a-select-option>
+            </a-select>
             <a-button style="margin-left: 8px" type="default" @click="getData()">查询</a-button>
-            <a-button style="margin-left: 8px" type="primary" @click="handlePrint()">打印</a-button>
-            <a-button style="margin-left: 8px" type="primary" @click="doExport()">导出</a-button>
+            <!-- <a-button style="margin-left: 8px" type="primary" @click="handlePrint()">打印</a-button> -->
+            <!-- <a-button style="margin-left: 8px" type="primary" @click="doExport()">导出</a-button> -->
           </div>
           <a-tab-pane loading="true" tab="图形统计" key="1">
             <a-row>
@@ -98,9 +107,8 @@ export default {
     return {
       loading: false,
       useTypeMap: {},
-      queryParam: {
-        useType: 4,
-        typeId: ''
+      queryParams: {
+        typeId2: undefined
       },
       fieldNames: {
         label: 'name',
@@ -108,6 +116,7 @@ export default {
         children: 'children'
       },
       typeList: [],
+      typeList2: [],
       visible: true,
       chart: null, // 创建一个chart变量
       chartsData: [],
@@ -173,7 +182,10 @@ export default {
       this.getData()
     },
     getData () {
-      getMonthReport(this.queryParam)
+      const params = {
+        id: this.queryParams.typeId2 || this.queryParams.typeId1
+      }
+      getSbTypeReport(params)
         .then(res => {
           this.chartsData = res.data
           // 需要将数据分组:总数,完成数
@@ -242,11 +254,14 @@ export default {
     },
     onChange (value) {
       console.log(value)
-      if (value.length === 0) return
-      getSbTypeReport({
-        id: value[value.length - 1]
+      if (!value) return
+      this.queryParams.typeId2 = undefined
+      getSbType({
+        flag: 2,
+        type: 2,
+        parentId: value
       }).then(res => {
-        console.log(res)
+        this.typeList2 = res.data
       })
     },
     loadData (selectedOptions) {