前端传到后端数据丢失,怎么办?

Posted Roam-G

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了前端传到后端数据丢失,怎么办?相关的知识,希望对你有一定的参考价值。

前端调试显示有这两个参数,

pickBasketls是 配货篮子,

basketNumls是分拣篮子

但是debug后端时,却显示没有这两个参数,

pickBasketls是 配货篮子,

basketNumls是分拣篮子

 

 

···

``` 

findOrderList () 
      this.tableData = [];
//			debugger;
      let params = this.conditionForm;

      // 调试
        console.log("开始AAAAAAAAAAAAAA");
				console.log("------------this.conditionForm.pickBasketls");
				console.log(this.conditionForm.pickBasketls);

				console.log("-----this.conditionForm.basketNumls");
				console.log(this.conditionForm.basketNumls);

				console.log("结束 BBBBBBBBBBBBBBBBBBBBBBBB");
				//后端没有 显示这两个数据,直接手动加上!
				params.basketNumls = this.conditionForm.basketNumls;
      	params.pickBasketls = this.conditionForm.pickBasketls;
       
//			console.log("日志----this.conditionForm.basketNumls");
//			console.log("日志----this.conditionForm.pickBasketls");
//			console.log("日志----this.conditionForm.basket");
//			console.log("日志----this.conditionForm.pickBaskets");
//				
//			console.log(this.conditionForm.basketNumls.valueOf());
//			console.log(this.conditionForm.pickBasketls);
//			console.log(this.conditionForm.basket);

			console.log("配货篮子 params.pickBasketls");
			console.log(params.pickBasketls);
			
			console.log("分拣篮子 params.basketNumls");
			console.log(params.basketNumls);
			
			console.log("params.pageSize");
		
				
      params.pageSize = this.pageSize;
    	params.currentPage = this.currentPage;
	    if(!params.hasOwnProperty("statuss") && !params.hasOwnProperty("statusList"))
						params.statusList = [1,2,3,4,5,6,7,101,102,103];
					
	    this.$emit("loadingState", true);
			params.idtype = this.idtype;
      this.errormsg = "Search...";
      wmsOrderApi.findOrderAndItemHistoryPage(params).then(data => 
        if (data.code == 200) 
          data.data.forEach((item, index) => 
            item.ischecked = false;
            item.isSelected = false;
          );
          this.tableData = data.data;
          this.total = data.totalNum;
          this.openOrderid = [];
          this.openAll = false;
          this.dialogFormVisible = false;
          this.conditionForm.platformOrderIdList = [];
          this.conditionForm.trackNumberList = [];
          this.conditionForm.stockSkuList = [];
          this.$emit("loadingState", false);
         else 
          this.total = 0;
          this.dialogFormVisible = false;
          this.conditionForm.platformOrderIdList = [];
          this.conditionForm.trackNumberList = [];
          this.conditionForm.stockSkuList = [];
          this.openOrderid = [];
          this.openAll = false;
          this.$emit("loadingState", false);
          this.errormsg = data.msg;
        
      ).catch((e) => 
        this.Commutil.showno(this, e.message);
      );
    ,
    //组装查询条件
    doSearch (type) 
      if (type == 1) 
        this.clearConditionForm(1);//清空高级搜索条件
        let sku = this.sku.trim();
        if (sku != null && sku != '') 
          if (this.skuType == 2 || this.skuType == '2') 
            this.conditionForm.originalSkuLs = sku;
           else 
            this.conditionForm.stockSkuLs = sku;
          
        
      
      //3. 调试
      console.log("1 this.basket.trim()");
			console.log(this.basket.trim());
			
      let _this = this;
      this.conditionForm.myLogisticsChannelIdList = [];
      if (this.$refs['logisticsChannel'] != null && this.$refs['logisticsChannel'].getCheckedNodes(true) != null) 
        //getCheckedNodes,参数为true表示只获取叶子节点,为false则获取所有选中的节点
        this.$refs['logisticsChannel'].getCheckedNodes(true).forEach(function (item, index) 
          _this.conditionForm.myLogisticsChannelIdList.push(item.value);
        );
      
      this.conditionForm.shopIdList = [];
      if (this.$refs['shops'] != null && this.$refs['shops'].getCheckedNodes(true) != null) 
        //getCheckedNodes,参数为true表示只获取叶子节点,为false则获取所有选中的节点
        this.$refs['shops'].getCheckedNodes(true).forEach(function (item, index) 
          _this.conditionForm.shopIdList.push(item.value);
        );
      
      this.showFlag = false;
      this.getOrderTime();
      this.findOrderList();
    ,
    batchSearchDialog () 
      this.dialogTitle = this.$t('orderList.批量搜索');
      this.dialog_stock = true;
      this.dialog_type = 1;
      this.conditionForm.platformOrderIdList = [];
      this.conditionForm.trackNumberList = [];
      this.conditionForm.stockSkuList = [];
      this.textarea = '';
      this.dialogFormVisible = true;
    ,
@RequestMapping(value = "/findOrderAndItemHistoryPage", method = RequestMethod.POST)
	@ApiOperation(value = "查询出库日志,分页")
	@ApiImplicitParams(
	@ApiImplicitParam(name = "foai", value = "传入的参数", required = true, paramType = "body", dataType = "FindOrderAndItem"))
	public ResultCode<List<TbTaskOrderAndItemHistory>> findOrderAndItemHistoryPage(@RequestBody FindTbTaskOrderAndItemHistory foai) 
		ResultCode<List<TbTaskOrderAndItemHistory>> rc = new ResultCode<List<TbTaskOrderAndItemHistory>>();
		CacheEmployee ce = (CacheEmployee) SecurityUtils.getSubject().getPrincipals().getPrimaryPrincipal();
		//如果该员工不是服务商
		if(ce == null) 
			rc.setCode(CommonEnum.NO_PERMISSION.getCode());
			rc.setMsg(CommonEnum.NO_PERMISSION.getMsg());
			return rc;//test
		
		if(ce.getSupplierId() == null || ce.getSupplierId().intValue()<=0) 
			rc.setCode(CommonEnum.NO_PERMISSION.getCode());
			rc.setMsg(CommonEnum.NO_PERMISSION.getMsg());
			return rc;
		
		if(StringUtils.isEmpty(ce.getWarehouseId())) 
			rc.setCode(CommonEnum.FAILED.getCode());
			rc.setMsg("员工没有设置负责的仓库,无法看到数据...");
			return rc;
		
		try 
			rc = taskOrderUtilService.findOrderAndItemHistoryPage(ce,foai);
		 catch (SQLException e) 
			rc.setCode(CommonEnum.SQL_EXCEPTION.getCode());
			rc.setMsg("SQLException:"+e.getMessage());
		 catch (Exception e) 
			rc.setCode(CommonEnum.OTHER_EXCEPTION.getCode());
			rc.setMsg("Exception:"+e.getMessage());
		
		return rc;
	

以上是关于前端传到后端数据丢失,怎么办?的主要内容,如果未能解决你的问题,请参考以下文章

我自己组装的json数据 传到后台 会部分丢失 是为啥 js,json,后台

node.js怎么实现从前端输入数据,点击提交传到数据库

如何把前端数据传到后端,然后把后端传出的数据显示到HTML上

axios将数据从前端传到后端是对象还是数组

前端数据如何传给后端

前端批量上传图片后端怎么接收?