From 7b64e3cebf5e95f57875d59198809b874f6c41fb Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Wed, 21 Apr 2021 15:59:35 +0800 Subject: [PATCH] merge score_shop --- zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html | 169 ++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 108 insertions(+), 61 deletions(-) diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html index f547d4c..71c4cae 100644 --- a/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html +++ b/zq-erp/src/main/resources/templates/views/admin/hive/store/projServiceStartpl-list.html @@ -1,84 +1,90 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> -<meta charset="utf-8"> -<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> -<meta name="renderer" content="webkit|ie-comp|ie-stand"> -<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> -<meta name="viewport" - content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -<meta http-equiv="Cache-Control" content="no-siteapp" /> -<!-- 本框架基本脚本和样式 --> -<script type="text/javascript" - th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> -<script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> + <meta charset="utf-8"> + <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> + <meta name="renderer" content="webkit|ie-comp|ie-stand"> + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" + content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> + <meta http-equiv="Cache-Control" content="no-siteapp" /> + <!-- 本框架基本脚本和样式 --> + <script type="text/javascript" + th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> + <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script> </head> <body> - <div class="ibox-content"> - <form class="form-horizontal" id="dataform" - onsubmit="javascripr:return false;"> +<div class="ibox-content"> + <form class="form-horizontal" id="dataform" + onsubmit="javascripr:return false;"> - <input autocomplete="off" type="hidden" name="id" th:value="${serviceId} " > + <input autocomplete="off" type="hidden" name="id" th:value="${serviceId} " > - <table class="table table-bordered" id="waptable"> - <tbody th:each="projInfo,outList:${projInfoList}"> + <table class="table table-bordered" id="waptable"> + <tbody th:each="projInfo,outList:${projInfoList}"> - <tr class="success"> - <td colspan="6" th:text="'项目名称:'+${projInfo.name}"></td> - </tr> - <tr> - <td colspan="6"> - <table class="table"> - <thead> - <tr> - <th>序号</th> - <th>配料名称</th> - <th>推荐消耗</th> - <th>实际消耗</th> - <th>配料备注</th> - </tr> - </thead> - <tbody > + <tr class="success"> + <td colspan="5" th:text="'项目名称:'+${projInfo.name}"></td> + <td colspan="1" ><button type="button" class="btn btn-primary btn-xs" th:onclick="'javascript:openPlList('+ ${outList.index} +')'">添加配料</button></td> + </tr> + <tr> + <td colspan="6"> + <table class="table"> + <thead> + <tr> + <th>序号</th> + <th>配料名称</th> + <th>推荐消耗</th> + <th>实际消耗</th> + <th>配料备注</th> + </tr> + </thead> + <tbody th:attrappend="id=${outList.index}" > - <tr class="group" th:each="projGoods,list:${projInfo.assembleGoods}"> - <td th:text="${list.index+1}" ></td> - <td th:text="${projGoods.shoppingGoods.name}"></td> - <td > - <span th:text="${projGoods.total}+''+${projGoods.shoppingGoods.measure}"></span> - </td> - <td > - <input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="amount" placeholder="实际用量" > - <span style="line-height: 30px;margin-left: 10px;" th:text="${projGoods.shoppingGoods.measure}"></span> - </td> - <td> - <input autocomplete="off" type="hidden" name="skuId" th:value="${projGoods.assembleGoodId} " > + <tr class="group" th:each="projGoods,list:${projInfo.assembleGoods}"> + <td th:text="${list.index+1}" ></td> + <td th:text="${projGoods.shoppingGoods.name}"></td> + <td > + <span th:text="${projGoods.total}+''+${projGoods.shoppingGoods.measure}"></span> + </td> + <td > + <input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="amount" placeholder="实际用量" > + <span style="line-height: 30px;margin-left: 10px;" th:text="${projGoods.shoppingGoods.measure}"></span> + </td> + <td><input autocomplete="off" type="hidden" name="skuId" th:value="${projGoods.assembleGoodId} " > - <input autocomplete="off" type="text" name="remark" class="form-control" placeholder="配料备注"></td> + <input autocomplete="off" type="text" name="remark" class="form-control" placeholder="配料备注"></td> - </tr> - </tbody> - </table> - </td> - </tr> + </tr> + </tbody> + </table> + </td> + </tr> - </tbody> - </table> - <div class="form-group " style="position: fixed;bottom: 0px;left: 49%;z-index: 9999;background: #ffffff;text-align: center;"> - <div class="col-sm-12 text-center"> - <a href="javascript:;" onclick="myForm.submit()" - class="btn btn-success radius">配料完成</a> - </div> + </tbody> + </table> + <div class="form-group " style="position: fixed;bottom: 0px;left: 49%;z-index: 9999;background: #ffffff;text-align: center;"> + <div class="col-sm-12 text-center"> + <a href="javascript:;" onclick="myForm.submit()" + class="btn btn-success radius">配料完成</a> </div> - </form> - </div> + </div> + </form> +</div> </body> <script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script> <script th:inline="javascript"> + var plList = [[${projInfoList}]]; + var projIndex = 0; var myForm=MForm.initForm({ invokeUrl:basePath+"/admin/projService/endPl", + beforeSubmit : function() { + var fieldArray = $("#dataform").serializeArray(); + console.log(fieldArray); + }, afterSubmit:function(){ if (parent.myGrid) { parent.myGrid.serchData(); @@ -100,6 +106,47 @@ }); index++; }); - </script> + + function openPlList(value) { + projIndex = value; + layer.full(layer.open({ + type: 2, + title: "选择配料", + maxmin: true, + area: [MUI.SIZE_L, '450px'], + content: [basePath + '/admin/redirect/hive/instore/store-list-pl'] + })); + } + + function selectPl(rows) { + console.log(rows); + if (rows) { + var projInfo = plList[projIndex]; + var idSelect = "#"+projIndex; + var allGroup = $(".group").length; + console.log(idSelect); + var groupLength = $(idSelect + " .group").length; + for(var i = 0; i < rows.length; i++) { + var row = rows[i]; + var nextIndex = groupLength + i + 1; + var outItemIndex = allGroup + i; + var html = '<tr class="group">' + + '<td>'+ nextIndex +'</td>' + + '<td>'+ row.goods.name +'</td>' + + '<td><span></span></td>' + + '<td ><input autocomplete="off" class="form-control" style="width: 200px;float: left;" type="text" name="outStoreItem['+ outItemIndex +'].amount" placeholder="实际用量" >' + + '<span style="line-height: 30px;margin-left: 10px;">'+ row.goods.measure +'</span></td>' + + '<td><input autocomplete="off" type="hidden" name="outStoreItem['+ outItemIndex +'].skuId" value="'+ row.goods.id +'">' + + '<input autocomplete="off" type="text" name="outStoreItem['+ outItemIndex +'].remark" class="form-control" placeholder="配料备注"></td></tr>'; + + if ($(idSelect).children(':last').length <= 0) { + $(idSelect).html(html); + } else { + $(idSelect).children(':last').after(html); + } + } + } + } +</script> </body> </html> \ No newline at end of file -- Gitblit v1.9.1