Browse Source

批量删除

feature
是小王呀\24601 1 year ago
parent
commit
81921d05fb
  1. 6
      src/views/components/checkBox.vue
  2. 11
      src/views/modules/base/smartExport/exset.vue
  3. 147
      src/views/modules/base/smartExport/index.vue

6
src/views/components/checkBox.vue

@ -28,6 +28,10 @@ export default {
list: {
type: Array,
default: () => []
},
leftList:{
type: Array,
default: () => []
}
},
data() {
@ -41,7 +45,9 @@ export default {
}
},
created() {
console.log(this.leftList,"sfsdfd");
this.boxList = this.list.filter(item => item.itemType != 'inputRange')
console.log(this.boxList,"kdsflkljf");
this.pid = this.list[0].itemGroupId
},
methods: {

11
src/views/modules/base/smartExport/exset.vue

@ -773,6 +773,7 @@ specialCategoryList: [
if (code === 0) {
this.form= JSON.parse(data.list[0].filterCriteria).searchForm
console.log(JSON.parse(data.list[0].filterCriteria).exportConfig.itemList);
console.log(JSON.parse(data.list[0].filterCriteria).exportConfig,"this.rigist");
this.rightList=JSON.parse(data.list[0].filterCriteria).exportConfig.itemList
console.log(this.rightList,"this.rightList");
this.rightList.forEach(item => {
@ -917,19 +918,18 @@ specialCategoryList: [
},
//
async exportTemplate() {
debugger
if(!this.form.name){
return this.$message.error("请输入模板名称")
}
debugger
let url = "/actual/base/residentBaseInfo/exportExcelCustom"
let params = {
templateId: this.originId,
// templateId: this.originId,
searchForm: {...this.form},
formCode: 'resident_base_info',
exportConfig: {
...this.form,
formCode: 'resident_base_info',
originId:this.originId,
itemList: this.rightList.map(item => {
return {
itemId: item.id,
@ -942,11 +942,9 @@ specialCategoryList: [
}
}
debugger
if(this.virtualResi){
params.searchForm.gridType = 'virtual'
}
debugger
await this.$http({
method: 'POST',
url,
@ -1231,10 +1229,8 @@ specialCategoryList: [
}
},
formatData(res) {
debugger
const fileReader = new FileReader()
console.log(fileReader.result,);
debugger
fileReader.onloadend = () => {
try {
if (fileReader.result) {
@ -1250,7 +1246,6 @@ specialCategoryList: [
this.downloadFile(res)
}
}
debugger
fileReader.readAsText(res.data)
},
downloadFile(res) {

147
src/views/modules/base/smartExport/index.vue

@ -2,7 +2,7 @@
<div class="g-main">
<div v-show="pageType == 'list'">
<div class="m-search">
<el-form :inline="true" :label-width="'100px'">
<el-form :inline="true" :label-width="'100px'" >
<el-form-item label="表格名称">
<el-input v-model.trim="tableName" placeholder="请输入表格名称关键字" size="small"
class="u-item-width-normal" clearable></el-input>
@ -33,9 +33,18 @@
<div class="m-table">
<div class="div_btn">
<el-button size="small" @click="handleAdd" type="primary" icon="el-icon-plus">新建导出</el-button>
<el-button
@click="onDeleteBatch"
style="margin: 0 10px"
size="small"
type="primary"
>
批量删除
</el-button>
</div>
<el-table :data="tableData" border v-loading="tableLoading" class="m-table-item" style="width: 100%"
:height="maxTableHeight">
:height="maxTableHeight" @selection-change="onMultiSelection">
<el-table-column type="selection" fixed="left" align="center" width="50" />
<el-table-column prop="tableName" align="center" label="表格名称" :show-overflow-tooltip="true">
</el-table-column>
@ -68,7 +77,7 @@
size="small">取消导入</el-button> -->
<!-- <el-button @click="handleCloseCheck(scope.row)" v-if="scope.row.importCategory === 'processing'" type="text" size="small">确认完成</el-button> -->
<el-button @click="handleAdd(scope.row)" type="text" size="small">查看</el-button>
<el-button @click="handleDetail(scope.row)" type="text" size="small">删除</el-button>
<el-button @click="handleDelete(scope.row)" type="text" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -111,6 +120,7 @@
agencyStaffTableListData: [],
see:[],
type:"",
multiSelection:[],
exportList: [],
showDialog: false,
SearchData: {
@ -126,6 +136,7 @@
binaryOptionList,
formData: {},
pageNo: 1,
total:"",
tableName:"",
createdBy:"",
createdTimeEnd:"",
@ -201,6 +212,7 @@
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.tableData=data.list
this.total=data.total
} else {
this.$message.error(msg);
}
@ -315,14 +327,123 @@
this.pageType="set"
},
//
async handleDetail(row) {
this.pageType = "add";
const {taskId,fileCode,processStatus} = row;
this.taskId = taskId;
this.fileCode = fileCode;
this.processStatus = processStatus;
},
//
async handleDelete(row) {
console.log(row,"riw");
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let ids = [row.originId];
//
this.deleteImport(ids, false);
})
.catch((err) => {
if (err == "cancel") {
}
});
},
async deleteImport(ids) {
const url = "/commonservice/exportRecord/deleteList";
// let params = {
// ids
// }
const { data, code, msg } = await requestPost(url, ids);
if (code === 0) {
this.$message({
type: "success",
message: "删除成功",
});
this.$emit("refreshTree");
this.recordList()
} else if (code > 8000) {
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteRoom(ids, true);
})
.catch((err) => {
if (err == "cancel") {
}
});
} else {
this.$message.error(msg);
}
},
//
onDeleteBatch() {
if (this.multiSelection.length == 0) {
this.$message.warning("请先选中至少一项");
return;
}
console.log(this.multiSelection,"skhfsdb");
this.$confirm("删除之后无法恢复,确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.handleDeleteAll(this.multiSelection.map((e) => e));
})
.catch((err) => {
console.error(err);
this.$message.error("删除失败");
});
},
//
onMultiSelection(rows) {
this.multiSelection = rows;
},
//
handleDeleteAll(rows){
let ides=[]
console.log(rows);
rows.map((item)=>{
console.log(item.originId);
ides.push(item.originId)
})
console.log(ides);
const url = "/commonservice/exportRecord/deleteList";
// const { data, code, msg } = requestPost(url, ides);
requestPost(url, ides).then(res=>{
console.log(res,"dsklf");
if (res.code === 0){
this.$message({
type: "success",
message: "删除成功",
});
this.$emit("refreshTree");
this.recordList()
}
else{
this.$message.error(res.msg);
}
})
console.log(data,code,msg);
// if (code === 0) {
// console.log("dfgldkfk");
// this.$message({
// type: "success",
// message: "",
// });
// this.$emit("refreshTree");
// this.recordList()
// }
},
//
handleClose() {
@ -389,13 +510,13 @@
handleSizeChange(val) {
this.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getTableData();
this.recordList()
},
//
handleCurrentChange(val) {
this.pageNo = val;
this.getTableData();
this.recordList()
},
//
resetSearch() {

Loading…
Cancel
Save