whj пре 1 година
родитељ
комит
ec0d11f9d4
2 измењених фајлова са 37 додато и 2 уклоњено
  1. 16 1
      src/api/sb/info.js
  2. 21 1
      src/views/sb/info/SbInfo.vue

+ 16 - 1
src/api/sb/info.js

@@ -321,7 +321,22 @@ export function exportSbInfo (parameter) {
     responseType: 'blob'
   })
 }
-
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function exportSbFeeInfo (parameter) {
+  return axios({
+    url: '/repair/fees/export/sbs?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
 /**
  * export file
  * parameter: { }

+ 21 - 1
src/views/sb/info/SbInfo.vue

@@ -131,6 +131,8 @@
           <div class="table-operator">
             <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
             <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExportFee()">费用导出</a-button>
+
             <a-button style="margin-left:8px;" type="primary" @click="doImport">
               <a-icon type="upload"/>
               新增导入
@@ -233,7 +235,7 @@ import BaseFormStatusLog from '@/views/sb/status-log/modules/BaseForm'
 import Detail from './modules/Detail'
 import DownloadModal from '@/views/download/DownloadModal'
 import PreviewModal from '@/views/preview/PreviewModal'
-import { getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo } from '@/api/sb/info'
+import { getSbInfoPage, deleteSbInfos, fetchSbInfo, fetchSbInfos, exportSbInfo, exportSbFeeInfo } from '@/api/sb/info'
 import { queryDept } from '@/api/upms/dept'
 import { generateSbCodeAll } from '@/api/upms/code'
 import { fetchSbTypeTree } from '@/api/sb/type'
@@ -696,6 +698,24 @@ export default {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
     },
+    doExportFee (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要导出的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      exportSbFeeInfo({
+        sbIds: ids.join(',')
+      }).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
     setTree (record = {}) {
       queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
         this.areaList = res.data