tBMaterialPurchaseOrder-update.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  2. <%@include file="/context/mytags.jsp" %>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>物料到货编辑页面</title>
  7. <style>
  8. .ui-button {
  9. display: inline-block;
  10. padding: 2px 2px;
  11. margin-bottom: 0;
  12. font-size: 8px;
  13. font-weight: normal;
  14. line-height: 1.42857143;
  15. text-align: center;
  16. white-space: nowrap;
  17. vertical-align: middle;
  18. -ms-touch-action: manipulation;
  19. touch-action: manipulation;
  20. cursor: pointer;
  21. -webkit-user-select: none;
  22. -moz-user-select: none;
  23. -ms-user-select: none;
  24. user-select: none;
  25. background-image: none;
  26. border: 1px solid transparent;
  27. border-radius: 4px;
  28. }
  29. .formtable tr:nth-child(1) {
  30. background: #CCCCCC;
  31. height: 2rem;
  32. }
  33. td {
  34. border: none !important;
  35. }
  36. tr {
  37. border: 1px solid #CCC;
  38. }
  39. .inputxt {
  40. border: none !important;
  41. }
  42. .readInput {
  43. box-shadow: 0 0 1px 1px #CCC;
  44. height: 2rem;
  45. }
  46. .readInput:hover {
  47. border-color: #409EFF;
  48. }
  49. .inputActive {
  50. box-shadow: 0 0 2px 1px #409EFF;
  51. }
  52. .inputError {
  53. color: #F56C6C;
  54. }
  55. .updateInfoBox {
  56. position: absolute;
  57. bottom: 10px;
  58. width: calc(100vw - 40px);
  59. height: auto;
  60. }
  61. .updateInfo {
  62. display: flex;
  63. }
  64. textarea {
  65. max-height: 100px;
  66. width: calc(100% - 50px);
  67. }
  68. formtable, td {
  69. border: 1px solid #CCCCCC;
  70. }
  71. #assetsDate {
  72. cursor: pointer;
  73. }
  74. .displayFlex {
  75. display: flex;
  76. justify-content: center;
  77. align-items: center;
  78. height: 30px;
  79. }
  80. .checkbox {
  81. transition: all 0.3s;
  82. color: #409EFF;
  83. cursor: pointer;
  84. padding: 5px;
  85. }
  86. .tab-wrapper-main * div {
  87. border: none;
  88. }
  89. </style>
  90. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  91. <script type="text/javascript">
  92. $(document).ready(function () {
  93. if (${viewFlag == 1}) {
  94. $("input[name='nowGoodsNum']").focus(function () {
  95. $(this).addClass("inputActive");
  96. });
  97. $("input[name='nowGoodsNum']").blur(function () {
  98. $(this).removeClass("inputActive");
  99. });
  100. } else {
  101. $("#btu_span").hide();
  102. $("#sub_tr").hide();
  103. $("input[type='button']").hide();
  104. $(".jeecgDetail").hide();
  105. $("#TBMaterialInfoEntityUpdate").find(":input").attr("disabled", "disabled");
  106. }
  107. });
  108. function getIndex(name) {
  109. var indexStart = name.indexOf('[');
  110. var indexEnd = name.indexOf(']');
  111. var index = name.substr(indexStart + 1, (indexEnd - indexStart - 1));
  112. return index;
  113. }
  114. // 修改本次到货数量
  115. function changeNowGoodsNum(obj, materialInfoNoNum) {
  116. var $this = $(obj), value = obj.value;
  117. var index = getIndex($this.attr('id'));
  118. if (parseInt(value) >= 0) {
  119. if (materialInfoNoNum < parseInt(value)) {
  120. tip("本次到货数量不能大于未到货量请重新输入!")
  121. if (!$this.hasClass("inputError")) {
  122. $this.addClass("inputError");
  123. }
  124. $this.val(0);
  125. } else {
  126. if ($this.hasClass("inputError")) {
  127. $this.removeClass("inputError");
  128. }
  129. $this.val(parseInt(value));
  130. $('#materialInfoNoNum' + index).val(parseInt(materialInfoNoNum) - parseInt(value));
  131. }
  132. } else {
  133. tip("请输入正确的本次到货数量(整数类型)")
  134. $this.addClass("inputError");
  135. $this.val(0);
  136. }
  137. }
  138. //表单验证
  139. function beforeSubmit() {
  140. if (${viewFlag == 1}) {
  141. var putTimeVal = $('input[name=putTime]').val()
  142. if (putTimeVal != null && putTimeVal != "") {
  143. return true
  144. } else {
  145. tip('请选择入库时间')
  146. return false
  147. }
  148. } else {
  149. tip('查看模式禁止提交')
  150. return false
  151. }
  152. }
  153. var checkIndex = []
  154. function clickCheck(index) {
  155. if (checkIndex.indexOf(index) >= 0) {
  156. // 已经存在的话,删除
  157. checkIndex.splice(checkIndex.indexOf(index));
  158. $("#checkbox" + index).removeClass("fa-check-square");
  159. $("#checkbox" + index).addClass("fa-square-o");
  160. } else {
  161. // 不存在的话就新增
  162. checkIndex.push(index);
  163. $("#checkbox" + index).removeClass("fa-square-o");
  164. $("#checkbox" + index).addClass("fa-check-square");
  165. }
  166. }
  167. function deleteByIndex() {
  168. if (checkIndex.length > 0) {
  169. checkIndex.forEach(item => {
  170. $("#trTag" + item).remove();
  171. })
  172. resetTrNum();
  173. } else {
  174. tip("请先选中要删除的货品!")
  175. }
  176. }
  177. //重新排序id
  178. function resetTrNum() {
  179. var $tbody = $("#tbMaterialDeliveryTable");
  180. $tbody.find('tr', this).each(function (i) {
  181. var $trItemDom = $(this);
  182. var trIndex = $trItemDom.attr("id");
  183. if (trIndex != undefined && trIndex.indexOf("trTag") != -1) {
  184. $trItemDom.attr("id", "trTag" + i);
  185. }
  186. $(':input, select, i', this).each(function () {
  187. var $this = $(this), name = $this.attr('name'), id = $this.attr('id'), val = $this.val();
  188. if (id != null) {
  189. if (id.indexOf("checkbox") != -1) {
  190. $this.attr("id", "checkbox" + i);
  191. $this.attr("onclick", "clickCheck(" + i + ")");
  192. } else if (id.indexOf("trIndex") != -1) {
  193. $this.val(i + 1);
  194. } else if (id.indexOf("materialInfoNoNum") != -1) {
  195. $this.attr("id", "materialInfoNoNum" + i);
  196. } else if (id.indexOf("nowGoodsNum") != -1) {
  197. $this.attr("id", "nowGoodsNum[" + i + "]");
  198. $this.attr("onclick", "openMaterialWindow(" + i + ")");
  199. }
  200. }
  201. });
  202. $(this).find('input[name=\'xh\']').val(i);
  203. });
  204. }
  205. </script>
  206. </head>
  207. <body style="overflow-x: hidden;">
  208. <t:formvalid formid="TBMaterialInfoEntityUpdate" dialog="true" usePlugin="password" layout="false" tiptype="1"
  209. action="tBMaterialController.do?doUpdatePurchaseOrderPage" beforeSubmit="beforeSubmit">
  210. <div style="display:none"><input type="submit" id="update_btnsub" value=""/><input id="arrivalId" name="arrivalId"
  211. type="hidden"
  212. value="${ArrivalId}"/><input
  213. id="materialId" name="materialId" type="hidden" value="${materialId}"/></div>
  214. <span id="btu_span" type="button" class="btu_element btu_danger" style="cursor: pointer;" onclick="deleteByIndex()"><i
  215. class="fa fa-trash-o"></i>删除</span>
  216. <table id="tbMaterialDeliveryTable" cellpadding="0" cellspacing="1" class="formtable"
  217. style="width: calc(100vw - 10px);">
  218. <tr>
  219. <c:if test="${viewFlag == 1}">
  220. <th>选择</th>
  221. </c:if>
  222. <th>序号</th>
  223. <th>货品名称</th>
  224. <th>计量单位</th>
  225. <th>采购数量</th>
  226. <th>累计到货数量</th>
  227. <th>未到货数量</th>
  228. <th>本次到货数量</th>
  229. <th>备注</th>
  230. </tr>
  231. <c:if test="${TBMaterialInfoEntity != null && TBMaterialInfoEntity.size() > 0}">
  232. <c:forEach items="${TBMaterialInfoEntity}" var="item" varStatus="itemStatus">
  233. <tr id="trTag${itemStatus.index}">
  234. <input id="id" name="id" type="hidden" value="${item.id}"/>
  235. <input id="materialInfoGoodsId" name="materialInfoGoodsId" type="hidden"
  236. value="${item.materialInfoGoodsId}"/>
  237. <c:if test="${viewFlag == 1}">
  238. <td class="displayFlex">
  239. <i class="fa fa-square-o checkbox" id="checkbox${itemStatus.index}" style="font-size: 16px;"
  240. onclick="clickCheck(${itemStatus.index})"></i>
  241. </td>
  242. </c:if>
  243. <td>
  244. <input id="trIndex" type="text" class="inputxt" readonly style="width:100%;" disabled="disabled"
  245. name="xh"
  246. value="${itemStatus.index + 1 }"/>
  247. </td>
  248. <td>
  249. <input name="materialInfoGoodsname" readonly type="text" class="inputxt" style="width:100%;"
  250. disabled="disabled"
  251. value="${item.materialInfoGoodsname }"/>
  252. </td>
  253. <td>
  254. <input name="baseUnit" type="text" readonly class="inputxt" style="width:100%;"
  255. disabled="disabled"
  256. value="${item.baseUnit }"/>
  257. </td>
  258. <td>
  259. <input name="materialInfoNum" type="text" readonly class="inputxt" style="width:100%;"
  260. disabled="disabled"
  261. value="${item.materialInfoNum }"/>
  262. </td>
  263. <td>
  264. <input name="countGoodsNum" type="text" readonly class="inputxt"
  265. style="width:100%;color:#67C23A;font-weight: bold;"
  266. disabled="disabled"
  267. value="${item.countGoodsNum }"/>
  268. </td>
  269. <td>
  270. <input name="materialInfoNoNum" id="materialInfoNoNum${itemStatus.index}" type="text" readonly
  271. class="inputxt" style="width:100%;color:#F56C6C;font-weight: bold;"
  272. value="${empty reportStatus || reportStatus == 1 ? item.materialInfoNoNum : item.materialInfoNoNum - item.nowGoodsNum }"/>
  273. </td>
  274. <td>
  275. <input name="nowGoodsNum" id="nowGoodsNum[${itemStatus.index}]" type="text"
  276. class="${viewFlag == 2 ? 'inputxt' : 'readInput'}"
  277. style="width:100%;font-weight: bold;"
  278. onchange="changeNowGoodsNum(this,${item.materialInfoNoNum})"
  279. value="${item.nowGoodsNum }"/>
  280. </td>
  281. <td>
  282. <input name="materialInfoRemarks" readonly type="text" class="inputxt" style="width:100%;"
  283. disabled="disabled"
  284. value="${item.materialInfoRemarks }"/>
  285. </td>
  286. </tr>
  287. </c:forEach>
  288. </c:if>
  289. </table>
  290. <div class="updateInfoBox tab-wrapper-main">
  291. <div class="updateInfo">
  292. <div style="width: 50%;">仓库:<span style="color: #909399;font-weight: bold;">${materialWarehouseId}</span>
  293. </div>
  294. <div style="width: 50%;">
  295. <span style="color: #F56C6C;" class="requiredIcon">*</span>入库时间:
  296. <input id="putTime" name="putTime" type="text" class="form-control" style="width: 200px;"
  297. placeholder="点击选择时间" autocomplete="off" value="${empty putTime ? '' : putTime.substring(0,10)}"
  298. onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" ignore="ignore">
  299. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  300. </div>
  301. </div>
  302. <div style="display: flex;padding-top: 10px;"><div>备注:</div><textarea name="ArrivalIdRemake" type="text" cols="100" rows="10">${remake}</textarea>
  303. </div>
  304. </div>
  305. </t:formvalid>
  306. </body>