jiaxing.zhou

refactor(reportingData): 优化批量修改功能

- 在 bathDeclareDate 方法调用成功或失败后,传递参数 1 到 cancelModify 方法
- 修改 cancelModify 方法,添加 val 参数以控制是否重新搜索数据
- 在 reportingData/index.vue 中,根据 cancelBatchModify 的参数决定是否搜索数据
......@@ -55,7 +55,7 @@
</div>
</el-dialog>
</template>
<script>
import { bathDeclareDate } from "@/api/declareData-api.js";
export default {
......@@ -113,31 +113,31 @@
bathDeclareDate(obj).then((res) => {
if (res.code === "200") {
this.msgSuccess('批量修改成功')
this.cancelModify()
this.cancelModify(1)
} else {
this.alertWarningMsg(res.message);
}
})
.catch((err) => {
console.log(err);
this.alertWarningMsg(err.message);
this.cancelModify()
this.cancelModify(1)
});
} else {
return false;
}
});
},
cancelModify(){
cancelModify(val){
this.batchModifyVisible = false
this.$emit('cancelBatchModify')
this.$emit('cancelBatchModify',val)
}
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/styles/variables.scss";
.modelItem {
......@@ -158,4 +158,3 @@
}
}
</style>
\ No newline at end of file
......
......@@ -983,9 +983,11 @@ export default {
}
this.batchModifyVisible = true
},
cancelBatchModify(){
cancelBatchModify(val){
this.batchModifyVisible = false
this.search(0);
if(val === 1){
this.search(0);
}
}
},
};
......