| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
- <%@include file="/context/mytags.jsp" %>
- <!DOCTYPE html>
- <html>
- <head>
- <title>物料到货编辑页面</title>
- <style>
- .ui-button {
- display: inline-block;
- padding: 2px 2px;
- margin-bottom: 0;
- font-size: 8px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
- }
- .formtable tr:nth-child(1) {
- background: #CCCCCC;
- height: 2rem;
- }
- td {
- border: none !important;
- }
- tr {
- border: 1px solid #CCC;
- }
- .inputxt {
- border: none !important;
- }
- .readInput {
- box-shadow: 0 0 1px 1px #CCC;
- height: 2rem;
- }
- .readInput:hover {
- border-color: #409EFF;
- }
- .inputActive {
- box-shadow: 0 0 2px 1px #409EFF;
- }
- .inputError {
- color: #F56C6C;
- }
- .updateInfoBox {
- position: absolute;
- bottom: 10px;
- width: calc(100vw - 40px);
- height: auto;
- }
- .updateInfo {
- display: flex;
- }
- textarea {
- max-height: 100px;
- width: calc(100% - 50px);
- }
- formtable, td {
- border: 1px solid #CCCCCC;
- }
- #assetsDate {
- cursor: pointer;
- }
- .displayFlex {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 30px;
- }
- .checkbox {
- transition: all 0.3s;
- color: #409EFF;
- cursor: pointer;
- padding: 5px;
- }
- .tab-wrapper-main * div {
- border: none;
- }
- </style>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <script type="text/javascript">
- $(document).ready(function () {
- if (${viewFlag == 1}) {
- $("input[name='nowGoodsNum']").focus(function () {
- $(this).addClass("inputActive");
- });
- $("input[name='nowGoodsNum']").blur(function () {
- $(this).removeClass("inputActive");
- });
- } else {
- $("#btu_span").hide();
- $("#sub_tr").hide();
- $("input[type='button']").hide();
- $(".jeecgDetail").hide();
- $("#TBMaterialInfoEntityUpdate").find(":input").attr("disabled", "disabled");
- }
- });
- function getIndex(name) {
- var indexStart = name.indexOf('[');
- var indexEnd = name.indexOf(']');
- var index = name.substr(indexStart + 1, (indexEnd - indexStart - 1));
- return index;
- }
- // 修改本次到货数量
- function changeNowGoodsNum(obj, materialInfoNoNum) {
- var $this = $(obj), value = obj.value;
- var index = getIndex($this.attr('id'));
- if (parseInt(value) >= 0) {
- if (materialInfoNoNum < parseInt(value)) {
- tip("本次到货数量不能大于未到货量请重新输入!")
- if (!$this.hasClass("inputError")) {
- $this.addClass("inputError");
- }
- $this.val(0);
- } else {
- if ($this.hasClass("inputError")) {
- $this.removeClass("inputError");
- }
- $this.val(parseInt(value));
- $('#materialInfoNoNum' + index).val(parseInt(materialInfoNoNum) - parseInt(value));
- }
- } else {
- tip("请输入正确的本次到货数量(整数类型)")
- $this.addClass("inputError");
- $this.val(0);
- }
- }
- //表单验证
- function beforeSubmit() {
- if (${viewFlag == 1}) {
- var putTimeVal = $('input[name=putTime]').val()
- if (putTimeVal != null && putTimeVal != "") {
- return true
- } else {
- tip('请选择入库时间')
- return false
- }
- } else {
- tip('查看模式禁止提交')
- return false
- }
- }
- var checkIndex = []
- function clickCheck(index) {
- if (checkIndex.indexOf(index) >= 0) {
- // 已经存在的话,删除
- checkIndex.splice(checkIndex.indexOf(index));
- $("#checkbox" + index).removeClass("fa-check-square");
- $("#checkbox" + index).addClass("fa-square-o");
- } else {
- // 不存在的话就新增
- checkIndex.push(index);
- $("#checkbox" + index).removeClass("fa-square-o");
- $("#checkbox" + index).addClass("fa-check-square");
- }
- }
- function deleteByIndex() {
- if (checkIndex.length > 0) {
- checkIndex.forEach(item => {
- $("#trTag" + item).remove();
- })
- resetTrNum();
- } else {
- tip("请先选中要删除的货品!")
- }
- }
- //重新排序id
- function resetTrNum() {
- var $tbody = $("#tbMaterialDeliveryTable");
- $tbody.find('tr', this).each(function (i) {
- var $trItemDom = $(this);
- var trIndex = $trItemDom.attr("id");
- if (trIndex != undefined && trIndex.indexOf("trTag") != -1) {
- $trItemDom.attr("id", "trTag" + i);
- }
- $(':input, select, i', this).each(function () {
- var $this = $(this), name = $this.attr('name'), id = $this.attr('id'), val = $this.val();
- if (id != null) {
- if (id.indexOf("checkbox") != -1) {
- $this.attr("id", "checkbox" + i);
- $this.attr("onclick", "clickCheck(" + i + ")");
- } else if (id.indexOf("trIndex") != -1) {
- $this.val(i + 1);
- } else if (id.indexOf("materialInfoNoNum") != -1) {
- $this.attr("id", "materialInfoNoNum" + i);
- } else if (id.indexOf("nowGoodsNum") != -1) {
- $this.attr("id", "nowGoodsNum[" + i + "]");
- $this.attr("onclick", "openMaterialWindow(" + i + ")");
- }
- }
- });
- $(this).find('input[name=\'xh\']').val(i);
- });
- }
- </script>
- </head>
- <body style="overflow-x: hidden;">
- <t:formvalid formid="TBMaterialInfoEntityUpdate" dialog="true" usePlugin="password" layout="false" tiptype="1"
- action="tBMaterialController.do?doUpdatePurchaseOrderPage" beforeSubmit="beforeSubmit">
- <div style="display:none"><input type="submit" id="update_btnsub" value=""/><input id="arrivalId" name="arrivalId"
- type="hidden"
- value="${ArrivalId}"/><input
- id="materialId" name="materialId" type="hidden" value="${materialId}"/></div>
- <span id="btu_span" type="button" class="btu_element btu_danger" style="cursor: pointer;" onclick="deleteByIndex()"><i
- class="fa fa-trash-o"></i>删除</span>
- <table id="tbMaterialDeliveryTable" cellpadding="0" cellspacing="1" class="formtable"
- style="width: calc(100vw - 10px);">
- <tr>
- <c:if test="${viewFlag == 1}">
- <th>选择</th>
- </c:if>
- <th>序号</th>
- <th>货品名称</th>
- <th>计量单位</th>
- <th>采购数量</th>
- <th>累计到货数量</th>
- <th>未到货数量</th>
- <th>本次到货数量</th>
- <th>备注</th>
- </tr>
- <c:if test="${TBMaterialInfoEntity != null && TBMaterialInfoEntity.size() > 0}">
- <c:forEach items="${TBMaterialInfoEntity}" var="item" varStatus="itemStatus">
- <tr id="trTag${itemStatus.index}">
- <input id="id" name="id" type="hidden" value="${item.id}"/>
- <input id="materialInfoGoodsId" name="materialInfoGoodsId" type="hidden"
- value="${item.materialInfoGoodsId}"/>
- <c:if test="${viewFlag == 1}">
- <td class="displayFlex">
- <i class="fa fa-square-o checkbox" id="checkbox${itemStatus.index}" style="font-size: 16px;"
- onclick="clickCheck(${itemStatus.index})"></i>
- </td>
- </c:if>
- <td>
- <input id="trIndex" type="text" class="inputxt" readonly style="width:100%;" disabled="disabled"
- name="xh"
- value="${itemStatus.index + 1 }"/>
- </td>
- <td>
- <input name="materialInfoGoodsname" readonly type="text" class="inputxt" style="width:100%;"
- disabled="disabled"
- value="${item.materialInfoGoodsname }"/>
- </td>
- <td>
- <input name="baseUnit" type="text" readonly class="inputxt" style="width:100%;"
- disabled="disabled"
- value="${item.baseUnit }"/>
- </td>
- <td>
- <input name="materialInfoNum" type="text" readonly class="inputxt" style="width:100%;"
- disabled="disabled"
- value="${item.materialInfoNum }"/>
- </td>
- <td>
- <input name="countGoodsNum" type="text" readonly class="inputxt"
- style="width:100%;color:#67C23A;font-weight: bold;"
- disabled="disabled"
- value="${item.countGoodsNum }"/>
- </td>
- <td>
- <input name="materialInfoNoNum" id="materialInfoNoNum${itemStatus.index}" type="text" readonly
- class="inputxt" style="width:100%;color:#F56C6C;font-weight: bold;"
- value="${empty reportStatus || reportStatus == 1 ? item.materialInfoNoNum : item.materialInfoNoNum - item.nowGoodsNum }"/>
- </td>
- <td>
- <input name="nowGoodsNum" id="nowGoodsNum[${itemStatus.index}]" type="text"
- class="${viewFlag == 2 ? 'inputxt' : 'readInput'}"
- style="width:100%;font-weight: bold;"
- onchange="changeNowGoodsNum(this,${item.materialInfoNoNum})"
- value="${item.nowGoodsNum }"/>
- </td>
- <td>
- <input name="materialInfoRemarks" readonly type="text" class="inputxt" style="width:100%;"
- disabled="disabled"
- value="${item.materialInfoRemarks }"/>
- </td>
- </tr>
- </c:forEach>
- </c:if>
- </table>
- <div class="updateInfoBox tab-wrapper-main">
- <div class="updateInfo">
- <div style="width: 50%;">仓库:<span style="color: #909399;font-weight: bold;">${materialWarehouseId}</span>
- </div>
- <div style="width: 50%;">
- <span style="color: #F56C6C;" class="requiredIcon">*</span>入库时间:
- <input id="putTime" name="putTime" type="text" class="form-control" style="width: 200px;"
- placeholder="点击选择时间" autocomplete="off" value="${empty putTime ? '' : putTime.substring(0,10)}"
- onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" ignore="ignore">
- <span class="Validform_checktip" style="float:left;height:0px;"></span>
- </div>
- </div>
- <div style="display: flex;padding-top: 10px;"><div>备注:</div><textarea name="ArrivalIdRemake" type="text" cols="100" rows="10">${remake}</textarea>
- </div>
- </div>
- </t:formvalid>
- </body>
|