Commit 5ba2a8a7 authored by dragondean@qq.com's avatar dragondean@qq.com

异常订单导出和权限配置

parent 2903c444
......@@ -100,4 +100,14 @@ export function getBmpDetailByBusinessId(businessId) {
method: 'get',
params: {businessId}
})
}
// 导出订单异常 Excel
export function exportExcel(params) {
return request({
url: '/ecw/order-exception/export-excel',
method: 'get',
params,
responseType: 'arraybuffer'
})
}
\ No newline at end of file
......@@ -95,7 +95,10 @@
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<el-col :span="12">
<el-button type="primary" size="mini" @click="exportSearch" v-hasPermi="['ecw:exception:export']">导出</el-button>
</el-col>
<el-col :span="12"><right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar></el-col>
</el-row>
<!-- 列表 -->
......@@ -181,7 +184,7 @@
</template>
<script>
import {getOrderExceptionPage} from "@/api/ecw/orderException"
import {getOrderExceptionPage, exportExcel} from "@/api/ecw/orderException"
import {getTradeCityList} from '@/api/ecw/region'
import {DICT_TYPE} from '@/utils/dict'
// import { userList } from "@/api/system/user"
......@@ -302,7 +305,22 @@ export default {
tag += this.$t('(空)')
}
return tag
}
},
exportSearch(){
this.exportExcel(exportExcel, this.queryParams, this.$t('异常订单'))
},
// 通用导出函数
exportExcel(func, params, fileName = null){
this.exportLoading = true;
func(params).then(res => {
if(!fileName){
fileName = this.$t('订单')
}
this.$download.excel(res, fileName + '.xls');
}).finally(() => {
this.exportLoading = false
})
},
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment