| | |
| | | } |
| | | } |
| | | this.addLoad = true |
| | | this.upHead.forEach((item,index)=>{ |
| | | if(this.data.cascaderField&&this.data.cascaderField[item.label]){ |
| | | if(this.upData[item.label]){ |
| | | this.upData[item.label] = this.upData[item.label].join(','); |
| | | }else{ |
| | | this.upData[item.label] = '' |
| | | } |
| | | } |
| | | }) |
| | | this.$axios.post(this.addUrl, this.upData, { |
| | | headers: { |
| | | 'Content-Type': 'application/json' |
| | |
| | | }, |
| | | handleCascader(e,label){ |
| | | this.upData[label] = e; |
| | | } |
| | | }, |
| | | // 批量删除 |
| | | batchDelete(){ |
| | | if(this.multipleSelection&&this.multipleSelection.length>0){ |
| | | this.$confirm('是否删除选中的数据?', "警告", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.$axios.post(this.delUrl, { |
| | | ids: JSON.stringify(this.multipleSelection.map(item => item.id)) |
| | | }).then(res => { |
| | | if (res.code === 201) { |
| | | return |
| | | } |
| | | this.$message.success('删除成功') |
| | | this.selectList() |
| | | }).catch(e => { |
| | | this.$message.error('删除失败') |
| | | }) |
| | | }).catch(() => {}) |
| | | }else{ |
| | | this.$message.error('请选择要删除的数据') |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |