如何使用javascript或jquery获取自动序列号

时间:2016-03-15 05:37:29

标签: javascript jquery

如何使用javascript或jquery获取自动序列号 我的代码下面是他们提前致谢

 $.ajax({

                    type: 'POST',
                    url: invurl,
                    cache: false,
                    data: "{'" +
                        "fromdate':'" + $("#txtInvReportledgerFromDate").val() + "','" +
                        "todate':'" + $("#txtInvReportledgerToDate").val() + "','" +
                        "Itemname':'" + $("#dataItemId").val() +
                     "'}",

                    contentType: 'application/json; charset=utf-8',
                    dataType: 'JSON',

                    success: function (data) {

                        if (data.d.length > 0) {
                            for (var index = 0; index < data.d.length; index++) {
                                $("#lblitemname").text(data.d[index].ITEM_NAME);
                                $("#lblitemcode").text(data.d[index].ITEM_CODE);
                                $("#lblInventoryQtyason").text(data.d[index].TodayClosingStock);
                                $("#lblStockStatusunitprice").text(data.d[index].Todaystockunitprice);
                                if (Itemcolorindex == index) {
                                    Itemcolor = "background-color:white";
                                    Itemcolorindex = Itemcolorindex + 2;
                                }
                                else {
                                    Itemcolor = "background-color:#EFF3FB;";
                                }


                                $("#tblinvledgerreport").append("<tr style=" + Itemcolor + ">" +


                                                     "<td  align='left'>" + data.d[index].TYPE + "</td>" +
                                                     "<td align='center'>" + getOldDate(data.d[index].DATE) + "</td>" +
                                                     "<td align='left'>" + data.d[index].TransactionDescription + "</td>" +
                                                     "<td align='left'>" + data.d[index].ReferenceDoc + "</td>" +
                                                    "<td align='center'>" + (data.d[index].QTYReceipts == null ? '' : data.d[index].QTYReceipts) + "</td>" +
                                                     "<td align='center'>" + (data.d[index].UNITPRICEReceipts == null ? '' : data.d[index].UNITPRICEReceipts) + "</td>" +
                                                     "<td align='center'>" + (data.d[index].QTYISS == null ? '' : data.d[index].QTYISS) + "</td>" +
                                                    "<td align='center'>" + (data.d[index].UNITPRICEiss == null ? '' : data.d[index].UNITPRICEiss) + "</td>" +

                                                                "</tr>");
                            }

                            $("#tblinvledgerreport").append("</tbody>");

1 个答案:

答案 0 :(得分:0)

q = "Frozen/Chilled/Ambient (Please state)"
puts q.gsub(/[^a-zA-Z0-9. ]/){|s| " #{s} "}
#=> Frozen / Chilled / Ambient  ( Please state )