|
@@ -178,13 +178,13 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
|
|
|
- <el-dropdown size="small" @command="handleCommand">
|
|
|
+ <el-dropdown size="small" @command="handleExport">
|
|
|
<el-button size="small" type="primary" style="margin: 0 10px;">
|
|
|
导出<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
|
|
|
- <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="选中导出">选中导出</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="全部导出">全部导出</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
|
|
@@ -245,7 +245,7 @@
|
|
|
<script>
|
|
|
import Add from './add.vue'
|
|
|
import CollapseTransition from '@/components/MyCollapse/collapse.vue'
|
|
|
-import {getDemandList, delDemand, downLoadDemand} from '@/api/purchase/purchaseDemand.js'
|
|
|
+import {getDemandList, delDemand, downLoadDemand, exportDemand } from '@/api/purchase/purchaseDemand.js'
|
|
|
export default {
|
|
|
name: 'PurchaseDemandList',
|
|
|
components: {
|
|
@@ -326,6 +326,23 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ handleExport(command) {
|
|
|
+ if(command == '选中导出') {
|
|
|
+ if (this.ids.length == 0) {
|
|
|
+ this.$modal.msgWarning("请选中至少一条数据");
|
|
|
+ } else {
|
|
|
+ let param = {all: false, ids: this.ids}
|
|
|
+ exportDemand(param).then(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let param2 = {all: true}
|
|
|
+ exportDemand(param2).then(res => {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
addDivision() {
|
|
|
this.isList = false
|
|
|
this.page = 'add'
|
|
@@ -346,7 +363,7 @@ export default {
|
|
|
// 行内删除
|
|
|
deleteids(row) {
|
|
|
console.log('row', row)
|
|
|
- this.$modal.confirm('确认信息').then(() => {
|
|
|
+ this.$modal.confirm('确定删除选择数据?').then(() => {
|
|
|
delDemand(row.id).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
this.$modal.msgSuccess("删除成功");
|