123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <!DOCTYPE html>
- <html>
- <head lang="en">
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
- <meta name="viewport" content="height=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
- <title>确认推送订单</title>
- <link rel="stylesheet" href="css/common.css" />
- <link rel="stylesheet" href="css/register.css" />
- <script type="text/javascript" src="/lib/jquery/dist/jquery.js"></script>
- <script>
- $(function () {
-
- var json = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(@ViewData["rddata"]).Replace('/','_').Replace('\\','_'))';
- var obj = JSON.parse(json);
- var group = {};
- function initGroup(feedbacks) {
- for (var t in feedbacks['pfbs']) {
- if (!group[obj['pfbs'][t]['SuppliersId']]) {
- group[obj['pfbs'][t]['SuppliersId']] = obj['pfbs'][t]['BusinessName'];
- }
- }
- var inputhtml = '<div class="message" name="group" id="group" data="">' +
- '<span id="BusinessName"></span>' +
- '发货方式:<select name="ReceiveMd" id="ReceiveMd" placeholder="发货方式" required></select>' +
- '到货日期:<input name="RequestDate" id="RequestDate" type="date" placeholder="到货日期" pattern="" required />' +
- '</div>';
- for (var i in group) {
- var htmldom = inputhtml.replace('id="group"', 'id="group_' + i + '"').replace('data=""', 'data="' + i + '"')
- .replace('BusinessName">', 'BusinessName">'+group[i]);
- $("#form66").prepend(htmldom);
- }
- }
- group = initGroup(obj);
-
-
- function submit_22() {
- if (!obj) {
- alert("数据出现错误,请联系人开发人员!");
- return false;
- }
- var groupdom = $("div[name=group]");
- for (var i = 0; i < groupdom.length; i++ ) {
- var ReceiptMd = $(groupdom[i]).find("#ReceiveMd").val();
- var RequestDate = $(groupdom[i]).find("#RequestDate").val();
- var SuppliersId = $(groupdom[i]).attr("data");
- if (jQuery.trim($("#ReceiveMd").val()) == '') {
- alert("前填写发货方式");
- return false;
- }
- if (jQuery.trim($("#RequestDate").val()) == '') {
- alert("前填写到货日期");
- return false;
- }
- for (var t in obj['pfbs']) {
- //alert(JSON.stringify(obj['pfbs'][t]));
- if (obj['pfbs'][t]['SuppliersId'] == SuppliersId) {
- obj['pfbs'][t]['ReceiptMd'] = ReceiptMd;
- obj['pfbs'][t]['RequestDate'] = RequestDate;
- }
- }
- }
- json = JSON.stringify(obj);
- $.ajax({
- headers: {
- "Sso-Token":"@ViewData["staffId"]",
- },
- type: "POST",
- url: "/web/supplypush/confirmfeedback/" + "@ViewData["staffId"]" + "/4",
- contentType: "application/json; charset=utf-8",
- data: json,
- dataType: 'json',
- beforeSend: function (request) {
- request.setRequestHeader("Sso-Token", "@ViewData["staffId"]");
- },
- success: function (message) {
- if (message.success) {
- alert("订单已提交!");
- } else {
- alert(message.msg);
- }
- },
- error: function (message) {
- $("#request-process-patent").html("提交数据失败!");
- }
- });
- }
- $("#subconfirm").on("click",submit_22);
- $.ajax({
- type: "GET",
- url: "/web/purchaseplan/receiptmds",
- contentType: "application/json; charset=utf-8",
- dataType: 'json',
- beforeSend: function (request) {
- request.setRequestHeader("Sso-Token", "@ViewData["staffId"]");
- },
- success: function (data) {
- if (data && data.length) {
- var options = '';
- for (var i in data) {
- options += '<option value=' + data[i].value + ' ' + ((data[i].value === "2") ? 'selected' : '')+ '>' + data[i].label + '</option>';
- }
- $("#ReceiveMd").append(options);
- } else {
- alert("提取数据为空!");
- }
- },
- error: function (message) {
- $("#request-process-patent").html("提取数据失败!");
- }
- });
- });
- </script>
- </head>
- <body>
- <div class="register">
- <div class="regTop">
- <span>确认推送订单</span>
- </div>
- <div class="content">
- <div class="point">
- <span>
- 订单明细:
- <br />
- <br />
- @foreach (var x in (List<Dictionary<String, Object>>)ViewData["data"])
- {
- <ul>
- <li>@x["GoodsName"]</li>
- <li>供应数量:@x["StoreGapNum"]盒</li>
- <li>需求量:@x["PurchaseTotalNum"]盒</li>
- <li>标准进价:@x["ActPrice"]</li>
- <li>实际进价:@x["PurPrice"]</li>
- <li>@x["BusinessName"]</li>
- <li>@x["GoodsSpec"]</li>
- <li>@x["Manufacturer"]</li>
- <li>@x["BrandName"]</li>
- </ul>
- <br />
- }
- </span>
- <div id="request-process-patent"></div>
- <form action="/web/supplymobile/" enctype="multipart/form-data" method="post" name="form66" id="form66">
-
- <button class="submit" type="button" id="subconfirm">确认</button>
- </form>
- </div>
-
- </div>
- </div>
- </body>
- </html>
|