赞
踩
- //批量申报
- DeclarationFn: function () {
- let selected = this.$refs.dataTable.getSelectedRows();
- if (!selected || selected.length == 0) {
- this.$warning("请选择需要申报的单证!");
- return;
- }
- var map = selected.map((item) => item.state);
- if (map.includes(1)) {
- this.$warning("请选择需要未上报的单证!");
- return;
- }
- this.$showConfrim({
- content: "此操作将永久性删除数据,是否继续?"
- }).then(() => {
- customsService.declareSelected(selected.map((item) => item.id)).then((res) => {
- if (res.status) {
- this.$success("申报成功!");
- this.search();
- } else {
- this.$warning(res.msg ? res.msg : "申报失败");
- }
- });
- });
- },

- customsService.declareSelected = function (idList) {
- return new Promise((resolve, reject) => {
- api.post("/kzy-customs/declare?idList="+idList, null).then(response => {
- var result = {};
- result.status = response.code == "200";
- result.msg = response.msg;
- resolve(result);
- }).catch(err => {
- reject(err);
- })
- });
- }
前端传的数据格式为:
-
- //方法一直接使用List<String>接收 前端会自动转义为集合
- @PostMapping("/declare")
- public OutputBean declare(@RequestParam List<String> idList) {
- }
- //方法二使用String接收
- @PostMapping("/declare")
- public OutputBean declare(@RequestParam String idList) {
- }
-
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。