|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-dialog title="查看卡密" :visible.sync="camiloShow" :before-close="close">
|
|
|
+ <el-button type="primary" style="margin-bottom: 10px;" size="mini" :loading="exportLoading" @click="exportData">导出</el-button>
|
|
|
<el-table :data="camiloData">
|
|
|
<el-table-column property="cardNo" label="卡号" min-width="250" align="center">
|
|
|
<template slot-scope="{row}">
|
|
@@ -16,7 +17,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {cradCamiloList} from "../../api/business/goods";
|
|
|
+import {cradCamiloList,exportCradCamiloList} from "../../api/business/goods";
|
|
|
|
|
|
export default {
|
|
|
name: "camilo",
|
|
@@ -37,6 +38,7 @@ export default {
|
|
|
pageSize: 10
|
|
|
},
|
|
|
loading: false,
|
|
|
+ exportLoading:false,
|
|
|
camiloData: [],
|
|
|
total: 0,
|
|
|
};
|
|
@@ -48,13 +50,25 @@ export default {
|
|
|
close() {
|
|
|
this.$emit('cancel')
|
|
|
},
|
|
|
+ exportData(){
|
|
|
+ this.exportLoading = true;
|
|
|
+ exportCradCamiloList( {goodsId: this.camiloGoodsId}).then(res => {
|
|
|
+ this.exportLoading = false
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.download(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ this.exportLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
getList() {
|
|
|
if (this.loading) {
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|
|
|
cradCamiloList('pageNum=' + this.pageParams.pageNum + '&pageSize=' + this.pageParams.pageSize + '&', {goodsId: this.camiloGoodsId}).then(res => {
|
|
|
- this.loading = false
|
|
|
+ this.loading = false;
|
|
|
+
|
|
|
if (res.code === 0) {
|
|
|
this.camiloData = res.rows
|
|
|
this.total = res.total
|