阅读:1754
回复:0
|
表单后台取数据传到前台
版本10.3
表单从后台查询数据 根据Ajax传回前台后 文本格式的赋值都没问题 但是逻辑性的那个字段赋值后就出错、下列代码注释的就是、请问怎么改 附上代码 $.ajax({ type: "get", url: "/Portal/XiaoShouZhengCe/WuLiao", data: { F_XD_FCUSTID: F_XD_FCUSTID, F_XD_ORGID:F_XD_ORGID }, success: function (res) { if (res != null) { for (var i = 0; i < res.length; i++) { //定义循环行 var Arow = i + 1; $("a[id^='Add_SalesPolicyDetail_']").click(); //物料编码 $("input[data-datafield='SalesPolicyDetail.MaterialCoding'][data-row='" + Arow + "']").val(res.物料编码); $("input[data-datafield='SalesPolicyDetail.MateriaName'][data-row='" + Arow + "']").val(res.物料名称); $("input[data-datafield='SalesPolicyDetail.Model'][data-row='" + Arow + "']").val(res.规格型号); $("input[data-datafield='SalesPolicyDetail.Unit'][data-row='" + Arow + "']").val(res.单位名称); $("input[data-datafield='SalesPolicyDetail.UnitID'][data-row='" + Arow + "']").val(res.计量单位ID); $("input[data-datafield='SalesPolicyDetail.SellingPrice'][data-row='" + Arow + "']").val(res.销售价格); $("input[data-datafield='SalesPolicyDetail.FloorPrice'][data-row='" + Arow + "']").val(res.底价); $("input[data-datafield='SalesPolicyDetail.PriceDiscount'][data-row='" + Arow + "']").val(res.价格折扣); $("input[data-datafield='SalesPolicyDetail.SalesConversion'][data-row='" + Arow + "']").val(res.折算); //$("input[data-datafield='SalesPolicyDetail.IsUseDeductPro'][data-row='" + Arow + "']").val(res.是否启用; $("input[data-datafield='SalesPolicyDetail.BaseDeduct'][data-row='" + Arow + "']").val(res.基础量提成); $("input[data-datafield='SalesPolicyDetail.IncreaseDeduct'][data-row='" + Arow + "']").val(res.增量提成); $("input[data-datafield='SalesPolicyDetail.Form'][data-row='" + Arow + "']").val(res.提成方式名称); //$("input[data-datafield='SalesPolicyDetail.ReturnOfTheMonth'][data-row='" + Arow + "']").val(res.月返); //$("input[data-datafield='SalesPolicyDetail.ReturnOfTheSeason'][data-row='" + Arow + "']").val(res.季返); // $("input[data-datafield='SalesPolicyDetail.HalfAYear'][data-row='" + Arow + "']").val(res.半年返); // $("input[data-datafield='SalesPolicyDetail.AnnualReturn'][data-row='" + Arow + "']").val(res.年返); $("input[data-datafield='SalesPolicyDetail.AdjustmentInstructions'][data-row='" + Arow + "']").val(res.调整说明); $("input[data-datafield='SalesPolicyDetail.MaterailID'][data-row='" + Arow + "']").val(res.物料ID); $("input[data-datafield='SalesPolicyDetail.FormNumber'][data-row='" + Arow + "']").val(res.提成方式编码); $("input[data-datafield='SalesPolicyDetail.FNUMBER'][data-row='" + Arow + "']").val(res.单位编码); $("input[data-datafield='SalesPolicyDetail.F_XD_FDEDUCTMODE'][data-row='" + Arow + "']").val(res.提成方式ID); } } } }); |
|