|
@@ -6,6 +6,10 @@ export default {
|
|
|
type: Array,
|
|
|
default: () => [],
|
|
|
},
|
|
|
+ queryParams: {
|
|
|
+ type: Object,
|
|
|
+ default: () => {},
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -28,11 +32,14 @@ export default {
|
|
|
methods: {
|
|
|
async onClick() {
|
|
|
try {
|
|
|
- let ids = this.$props.selectData.map((item) => item.id);
|
|
|
- console.log(ids, "ids");
|
|
|
+ let { queryParams, selectData } = this.$props;
|
|
|
+ let ids = selectData.map((item) => item.id);
|
|
|
+
|
|
|
+ let params = ids.length ? { ids } : { ...queryParams };
|
|
|
+ console.log(params, "params");
|
|
|
this.download(
|
|
|
"/system/apply/material/exportApplies",
|
|
|
- { ids },
|
|
|
+ { ...params },
|
|
|
`物料申请单${new Date().getTime()}.xlsx`
|
|
|
);
|
|
|
} catch (error) {}
|
|
@@ -42,7 +49,7 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
<template>
|
|
|
- <el-button @click="onClick" :disabled="disabled" :size="$attrs.size">
|
|
|
+ <el-button @click="onClick" :size="$attrs.size">
|
|
|
{{ title }}
|
|
|
</el-button>
|
|
|
</template>
|