whj 2 年之前
父節點
當前提交
07fef2fa5b
共有 2 個文件被更改,包括 33 次插入3 次删除
  1. 15 0
      src/api/report/sbinfo.js
  2. 18 3
      src/views/dashboard/SbInfoTypeReport.vue

+ 15 - 0
src/api/report/sbinfo.js

@@ -33,3 +33,18 @@ export function exportMonthReport (parameter) {
     responseType: 'blob'
   })
 }
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getSbType () {
+  return axios({
+    url: '/sb/types',
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 18 - 3
src/views/dashboard/SbInfoTypeReport.vue

@@ -4,7 +4,8 @@
       <div class="salesCard">
         <a-tabs default-active-key="1" size="large" :tab-bar-style="{marginBottom: '24px', paddingLeft: '16px'}">
           <div class="table-operator" style="margin-bottom: 8px;margin-top: 8px;" slot="tabBarExtraContent">
-            <a-select style="margin-left: 8px" v-model="queryParam.useType" placeholder="请选择">
+
+            <a-select style="margin-left: 8px;width:150px" v-model="queryParam.useType" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in useTypeMap"
                 :key="value"
@@ -12,6 +13,14 @@
                 :value="parseInt(value)">{{ label }}
               </a-select-option>
             </a-select>
+            <a-select style="margin-left: 8px;width:150px" v-model="queryParam.typeId" placeholder="请选择">
+              <a-select-option
+                v-for="{name,id} in typeList"
+                :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>
@@ -58,7 +67,7 @@
 </template>
 
 <script>
-import { getMonthReport, exportMonthReport } from '@/api/report/sbinfo'
+import { getMonthReport, exportMonthReport, getSbType } from '@/api/report/sbinfo'
 import { Chart } from '@antv/g2'
 import PrintInSbInfoTypeReport from '@/views/dashboard/modules/PrintInSbInfoTypeReport'
 import DetailMeasureLogReport from '@/views/dashboard/modules/DetailMeasureLogReport'
@@ -82,8 +91,10 @@ export default {
       loading: false,
       useTypeMap: {},
       queryParam: {
-        useType: 4
+        useType: 4,
+        typeId: ''
       },
+      typeList: [],
       visible: true,
       chart: null, // 创建一个chart变量
       chartsData: [],
@@ -126,6 +137,10 @@ export default {
   },
   created () {
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+    getSbType().then(res => {
+      console.log(res)
+      this.typeList = res.data
+    })
   },
   mounted () {
     this.$nextTick(function () {