@using System.Diagnostics @using Hyt.Model @{ ViewBag.Title = "订单发货"; Layout = "~/Views/Shared/_Layout.cshtml"; } @section HeadCss{ <link href='@Url.Content("~/Theme/css/tips.css")' rel="stylesheet" type="text/css" media="all" /> <style type="text/css"> .shopNO { 30px; text-align: center; } .prompt_qty { color: #999999; vertical-align: middle; /*background: url(~/Theme/images/tips_iconrow.png) no-repeat 0 -97px;*/ padding-left: 18px; padding-top: 2px; padding-bottom: 2px; } </style> } @section headjs{ <script type="text/javascript" src="~/Theme/scripts/UI.yui.js"></script> <script type="text/javascript" src="/Theme/scripts/Utils.yui.js"></script> <script type="text/javascript" src="/Theme/Plugins/Date/WdatePicker.js"></script> <script src="~/Theme/scripts/layer/layer.js"></script> <script type="text/javascript"> var checkedSysNOlist = ""; var vals = ""; $(function () { addOrderItem(); initDialog(); }); function initDialog() { var parent = art.dialog.parent, // 父页面window对象 api = art.dialog.open.api; //art.dialog.open扩展方法 //$("#OrderShipForm").serialize() if (!api) return; // 自定义按钮 api.button( { name: '保存', callback: function () { //取商品 $(".pdCount").each(function () { var count = $(this).val(); var id = $(this).next().val(); var checked = $(this).parent().parent().children("td").children(".checktd").is(':checked'); //所有数量 var quantity = $(this).next().next().children('.v_star').html(); //已发货数量 var realQuantity = $(this).next().next().children('.v_star').next('.real').html(); //判断数量 if (Number(quantity) - Number(realQuantity) < Number(count) || Number(count) <= 0 ) { UI.Alert({content: "请输入正确的数量" }); return false; } //取输入的数据 if (checked == true) { var SysNo = "{"sysNo":"" + id + "","quantity":"" + count + ""}"; if (checkedSysNOlist == '') checkedSysNOlist += SysNo; else checkedSysNOlist += ("," + SysNo); } console.log(checkedSysNOlist); }); if ($("#OrderShipForm").valid()) { $.post('/Order/Ship', { "orderId": '@ViewBag.soOrderSysNo', "expressNo": $.trim($("#expressNo").val()), "productList": "[" + checkedSysNOlist + "]", "fstatus": vals }, function (result) { if (result.Status) { try { UI.Dialog.opener.doSearch(); } catch (e) { }; UI.Dialog.close(); } else { var message = "操作失败"; if (!!result && !!result.Message) { message = result.Message; } UI.tips.tip_alert("tips_wrong", message); UI.Alert({ content: message }); } }); return false; } else { return false; } }, focus: true }, { name: '取消' } ); } function addOrderItem() { var sysid = '@ViewBag.soOrderSysNo'; var deliveryTypeName = '@ViewBag.deliveryTypeName'; Ajax.get("/Order/GetOrderItem/?r=" + Math.random(), "Search", function (p) { p.setParams("id", sysid); p.setParams("deliveryTypeName", deliveryTypeName); }, function (data) { $('#paging').empty(); $('#paging').html(data); // Utils.MaskStop(); }); } //$(".shopNO").keyup(function () { // alert(1); // if (isNaN($(this).val()) || parseInt($(this).val()) < 1) { // $(this).val("1"); // return; // } //}); </script> } <div id="paging"> </div>