| | |
| | | <template> |
| | | <el-dialog :visible.sync="dialogPush" append-to-body :close-on-click-modal="false" @close="recoverPage" title="导出"> |
| | | <div style="margin-bottom: 10px"> |
| | | <el-button type="success" |
| | | @click="handleExcel">下载 多级表头excel</el-button> |
| | | <el-radio-group v-model="radio"> |
| | | <el-radio :label="0">选择</el-radio> |
| | | <el-radio :label="1">全部</el-radio> |
| | |
| | | :data="data"> |
| | | </el-transfer> |
| | | </div> |
| | | <div style="display: flex;justify-content: flex-end;"> |
| | | <el-button size="small" plain type="success" @click="handleExcel">确定</el-button> |
| | | <el-button size="small" plain >取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {exportCode} from '@/api/GetItem' |
| | | export default { |
| | | name: "MasterTransfer", |
| | | props:['visible','tableHeadData','codeClassifyOid','tableData'], |
| | | props:['visible','tableHeadData','codeClassifyOid','tableData','selectRow'], |
| | | data(){ |
| | | return { |
| | | data: [], |
| | |
| | | option:{ |
| | | title: '文档标题', |
| | | column: [{ |
| | | label: '多级表头', |
| | | label: '主数据', |
| | | prop: 'header', |
| | | children: [] |
| | | }], |
| | |
| | | this.$emit('update:visible', false); |
| | | }, |
| | | handleExcel(){ |
| | | this.$Export.excel({ |
| | | title: this.option.title, |
| | | columns: this.option.column, |
| | | data: this.option.data |
| | | }); |
| | | // this.$Export.excel({ |
| | | // title: this.option.title, |
| | | // columns: this.option.column, |
| | | // data: this.option.data |
| | | // }); |
| | | if(this.radio === 0){ |
| | | if(this.selectRow.length<=0){ |
| | | this.$message.warning('请选择要导出的模板') |
| | | }else { |
| | | const selectList=[] |
| | | let exportArr=[] |
| | | this.selectRow.forEach(item=>{ |
| | | selectList.push( |
| | | item.oid |
| | | ) |
| | | }) |
| | | exportArr=this.value.map(index => this.tableHeadData[index].prop); |
| | | exportCode({codeClassifyOid:this.codeClassifyOid,'conditionMap[oid]':selectList,'attrIdIndexMap[index]':exportArr}).then(res=>{ |
| | | console.log(res) |
| | | }) |
| | | } |
| | | }; |
| | | }, |
| | | } |
| | | } |