| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK">
- <title>出库单编辑</title>
- <link href="main.css" rel="stylesheet" type="text/css"></link>
- <link href="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath}/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/json2.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/yw/erp2/erpCommon.js"></script>
- <script type="text/javascript" src="/shares/js/yw/erp2/stock/outstock/outStock.js"></script>
- <script type="text/javascript" src="/shares/js/yw/erp2/common/control/deptLookup.js"></script>
- <script type="text/javascript" src="/shares/js/yw/erp2/common/control/productLookup.js"></script>
- <script type="text/javascript">
- var outStockDetailData = ${requestScope.Rows};
- var locationobjs;
-
- $(function() {
- checkFowOnOff("${requestScope.flowIsOpen}","${requestScope.flowOnOff}", "对不起,出库单登记流程未配置,请通知流程管理员配置后,再提交!");
-
- $("#outs_batch_num").focus();
- closeAndReloadList();
-
- $(f_initGrid);
-
- loadTypeTree("selectbutton", {
- type : "detpusersingle",
- backId : "outs_operater",
- backName : "outs_operater_name",
- tab : 1
- });
-
- loadTypeTree("receiveButton", {
- type : "detpusersingle",
- backId : "receive_user_id",
- backName : "receive_user_name",
- tab : 1
- });
-
-
- var outsid = "${requestScope.outStock.outs_id}";
- if(outsid != null && outsid != ''){
- if("${requestScope.outStock.outs_depot_id}" != "" && typeof ("${requestScope.outStock.outs_depot_id}") != "undefined"){
- $("#outs_depot_id_").val("${requestScope.outStock.outs_depot_id}");
- $("#outs_depot_id").attr("disabled",true);
- }
- if("${requestScope.outStock.outs_location_id}" != "" && typeof ("${requestScope.outStock.outs_location_id}") != "undefined"){
- $("#outs_location_id_").val("");
- $("#outs_location_id").attr("disabled",true);
- }
- $("#outs_outstock_date").ligerDateEditor({
- labelAlign : 'left',
- width : 160,
- format :"yyyy-MM-dd",
- initValue : '${requestScope.outStock.outs_outstock_date }'
- });
- }else{
- $("#outs_outstock_date").ligerDateEditor({
- labelAlign : 'left',
- width : 160,
- format :"yyyy-MM-dd",
- initValue : '${requestScope.datestr }'
- });
- }
-
- var selectDepotid = "${requestScope.outStock.outs_depot_id}";
- if (selectDepotid != null && selectDepotid != "") {
- $("#outs_depot_id").val(selectDepotid);
- }
- selectlocationid = "${requestScope.outStock.outs_location_id}";
- if (selectlocationid != null && selectlocationid != "") {
- getLocations();
- }
-
- var selectOutstype = "${requestScope.outStock.outs_type}";
- if (selectOutstype != null && selectOutstype != "") {
- $("#outs_type").val(selectOutstype);
- }
-
-
- });
-
- function closeAndReloadList(){
- var isAddSucc = "${requestScope.isAddSucc}";
- if(isAddSucc == "true"){
- var tabid = getCurrentTabId();
- var listTabid = 'outStockAction.do?task=toList';
- if(window.parent.tab.isTabItemExist(listTabid)){
- window.parent.f_selectTab(listTabid);
- window.parent.f_reloadTab(listTabid);
- }else{
- window.parent.f_addTab(listTabid, '出库列表', 'outStockAction.do?task=toList');
- }
- window.parent.f_closeTab(tabid);
- }
- }
-
- function getLocations(selectlocationid){
- $(f_initGrid);
- $("#outs_location_id").empty();
- $('#outs_location_id').append("<option value=''>--请选择--</option> ");
- var outs_depot_id_val=$('#outs_depot_id').val();
- $.ajax({
- url:"takingStockAction.do?date="+new Date()+"&task=getLocations",
- type:"post",
- dataType:"json",
- data:"takings_depot_id="+ $("#outs_depot_id").val(),
- success:callback
- });
- }
-
- function callback(json){
- locationobjs = json;
- if(locationobjs.length == 0){
- $("#selectloc").hide();
- }else{
- $("#selectloc").show();
- for(var i=0;i<locationobjs.length;i++){
- $('#outs_location_id').append("<option value='"+locationobjs[i].location_id+"'>"+locationobjs[i].location_name+"</option>");
- }
- $("#outs_location_id").val(selectlocationid);
- }
-
- }
- var pids = "";
- function isSelDepot(){
- var outs_depot_id_val=$('#outs_depot_id').val();
- if(outs_depot_id_val == ""){
- $.ligerDialog.warn("请先选择仓库 !");
- }else{
- if(locationobjs != null && locationobjs != "" && locationobjs.length > 0){
- var outs_location_id_val = $('#outs_location_id').val();
- if(outs_location_id_val == ""){
- $.ligerDialog.warn("请先选择库位 !");
- }else{
- openProductLookup();
- // f_import();
- }
- }else{
- openProductLookup();
- // f_import();
- }
-
- }
- }
- function hasDetails(){
- getData();
- var jsonDataVal = $("#jsonData").val();
- if (jsonDataVal.length > 2) {
- if($("#outs_depot_id").val()!= null && $("#outs_depot_id").val()!= ""){
- $("#outs_depot_id_").val($("#outs_depot_id").val());
- $("#outs_depot_id").attr("disabled",true);
- }
- if($("#outs_location_id").val()!= null && $("#outs_location_id").val()!= ""){
- $("#outs_location_id_").val($("#outs_location_id").val());
- $("#outs_location_id").attr("disabled",true);
- }
- }else{
- $("#outs_depot_id").attr("disabled",false);
- $("#outs_location_id").attr("disabled",false);
- }
- }
- function isSelDepotForMark(){
- var outs_depot_id_val=$('#outs_depot_id').val();
- if(outs_depot_id_val == ""){
- $.ligerDialog.warn("请先选择仓库 !");
- }else{
- if(locationobjs != null && locationobjs != "" && locationobjs.length > 0){
- var outs_location_id_val = $('#outs_location_id').val();
- if(outs_location_id_val == ""){
- $.ligerDialog.warn("请先选择库位 !");
- }else{
- searchProByMark();
- }
- }else{
- searchProByMark();
- }
-
- }
- }
- function checkForm() {
- var rs = $.validate({
- name : "outs_operater_name",
- model : [ {
- type : "require",
- msg : "仓管员不能为空!"
- } ]
- });
- rs = $.validate({
- name : "outs_outstock_date",
- model : [ {
- type : "require",
- msg : "出库日期不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "outs_depot_id",
- model : [ {
- type : "require",
- msg : "仓库不能为空!"
- } ]
- }) && rs;
- if (document.getElementById("selectloc").style.display != "none") {
- rs = $.validate({
- name : "outs_location_id",
- model : [ {
- type : "require",
- msg : "库位不能为空!"
- } ]
- }) && rs;
- }
- rs = $.validate({
- name : "outs_type",
- model : [ {
- type : "require",
- msg : "出库类别不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "outs_deptname",
- model : [ {
- type : "require",
- msg : "领用部门不能为空!",
- msgField : "outs_deptButton"
- } ]
- }) && rs;
- rs = $.validate({
- name : "receive_user_name",
- model : [ {
- type : "require",
- msg : "领用人不能为空!",
- msgField : "receiveButton"
- } ]
- }) && rs;
- if (rs) {
- getData();
- var flag = isSelected();
- if (flag) {
- var jsonarr = eval('(' + $("#jsonData").val() + ')');
- for ( var i = 0; i < jsonarr.length; i++) {
- if (jsonarr[i].outsd_product_count <= 0) {
- $.ligerDialog.warn(jsonarr[i].product_name + "的出库数量必须大于0!");
- return false;
- }
- /* if (jsonarr[i].outsd_totalprice <= 0) {
- $.ligerDialog.warn(jsonarr[i].product_name + "-"
- + jsonarr[i].product_num + "的金额必须大于0!");
- return false;
- } */
- if (jsonarr[i].product_is_serial == 1
- && jsonarr[i].serialcount != jsonarr[i].outsd_product_count) {
- $.ligerDialog.warn(jsonarr[i].product_name
- + "的序列号选择数量与出库数量不匹配!");
- return false;
- }
- }
- return true;
- }
- return false;
- }
- return false;
- }
- // 保存
- function btnSaveOut() {
- if (checkForm()) {
- $("#outstock_save").attr('disabled', true);
- $("#outStockForm").submit();
- }
- }
- </script>
- </head>
- <body>
- <%@ include file="/include/message.jsp"%>
- <form id="outStockForm" action="outStockAction.do" method="post">
- <div id="title" class="form-button">
- <c:if test="${requestScope.outStock.outs_id==null}">
- <input id="outstock_save" name="outstock_save" type="button" class="l-button" value="保存" onclick="btnSaveOut();" />
- <input type="button" value="关闭" class="l-button" onclick="closeWindow();"/>
-
- </c:if>
- <c:if test="${requestScope.outStock.outs_id!=null}">
- <input id="outstock_save" name="outstock_save" type="button" class="l-button" value="保存" onclick="btnSaveOut();"/>
- <input type="button" value="关闭" class="l-button" onclick="closeWindow();"/>
- </c:if>
- </div>
- <div class="container-layout">
- <div class="forum-container">
- <center>
- <table class="l-table-edit line">
- <tr>
- <th colspan="4">出库单信息</th>
- </tr>
- <tr>
- <td class="l-table-edit-text">出库单号<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td">
- <jsp:include page="/yw/erp2/include/codeReadonly.jsp">
- <jsp:param name="name" value="outs_num"/>
- <jsp:param name="value" value="${requestScope.outStock.outs_num }"/>
- </jsp:include>
- </td>
- <td class="l-table-edit-text">批次号:
- </td>
- <td class="l-table-edit-td">
- <input type="text" id="outs_batch_num" name="outs_batch_num" value="${requestScope.outStock.outs_batch_num }" style="width:150px">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">仓库<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <select id="outs_depot_id" name="outs_depot_id" class="short-text" onchange="getLocations()" style="width:150px;">
- <option value="">--请选择--</option>
- <c:forEach items="${depotlist}" var="depotlist">
- <option value="${depotlist.depot_id}" >${depotlist.depot_name}</option>
- </c:forEach>
- </select>
- <span id="selectloc" style="display:none;">
- <select id="outs_location_id" name="outs_location_id" class="short-text" >
- <option value=''>--请选择--</option>
- </select>
- </span>
- </td>
- <td class="l-table-edit-text">仓管员<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td">
- <input type="hidden" name="outs_operater" id="outs_operater" readonly="readonly" value="${requestScope.outStock.outs_operater }" />
- <input type="text" id="outs_operater_name" name="outs_operater_name" style="width: 120px" readonly="readonly" value="${requestScope.outStock.outs_operater_name }" />
- <input type="button" class="l-button" id="selectbutton" value="选择人员" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">出库类别<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <select name="outs_type" id="outs_type" style="width:150px">
- <option value=''>--请选择--</option>
- <c:forEach items="${outstypelist}" var="outstype">
- <option value="${outstype.dvalue}" >${outstype.dname}</option>
- </c:forEach>
- </select>
- </td>
- <td class="l-table-edit-text">出库日期<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td">
- <input type="text" id="outs_outstock_date" name="outs_outstock_date" value="" style="width:150px">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">领用部门<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="hidden" id="outs_dept" name="outs_dept" value="${requestScope.outStock.outs_dept}" />
- <input type="text" id="outs_deptname" name="outs_deptname" readonly="readonly" style="width: 130px" value="${requestScope.outStock.outs_deptname}" />
- <!-- <input type="button" class="l-button" value="请选择" id="outs_deptButton" name="outs_deptButton" onclick="f_choseDept({outs_dept:'outs_dept',outs_deptname:'outs_deptname'});"/> -->
- <input type="button" class="l-button" value="请选择" id="outs_deptButton" name="outs_deptButton" onclick="deptLookup({width:400, height:450, outs_dept:'outs_dept',outs_deptname:'outs_deptname'});"/>
- </td>
- <td class="l-table-edit-text">领用人<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="hidden" name="receive_user_id" id="receive_user_id" value="${requestScope.outStock.receive_user_id}" />
- <input type="text" id="receive_user_name" name="receive_user_name" readonly="readonly" value="${requestScope.outStock.receive_user_name}" />
- <input type="button" class="l-button" id="receiveButton" value="选择人员" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">备注:
- </td>
- <td class="l-table-edit-td">
- <input type="text" id="outs_remark" name="outs_remark" value="${requestScope.outStock.outs_remark }" style="width:80%">
- </td>
- <td class="l-table-edit-text">库存量:</td>
- <td class="l-table-edit-td">
- <input type="text" id="outStock_count" name="outStock_count" style="border-style: none;" readonly="readonly" />
- </td>
- </tr>
- <tr>
- <th colspan="4">出库明细</th>
- </tr>
- <tr>
- <td colspan="4">
- <!-- 明细 start -->
- <div style="padding-top:5px;">
- <a class="l-button" style="width:100px;float:left; margin-left:10px;" onclick="isSelDepot()">选择存货</a>
- <!-- <a class="l-button" style="width:100px;float:left; margin-left:10px;" onclick="f_importSaleInvoice();">选择发货单</a> -->
- <a class="l-button" style="width:100px;float:left; margin-left:10px;" onclick="isSelDepotForMark();">条码扫描</a>
- <a class="l-button" style="width:120px;float:left; margin-left:10px;" onclick="deleteRow()">删除选择的行</a>
- </div>
- <div class="l-clear"></div>
- <div id="maingrid" style="margin-top:5px"></div>
- <div style="display:none;">
- </div>
- <!-- 明细 end -->
- </td>
- </tr>
- </table>
- <input type="hidden" id="jsonData" name="jsonData" value="">
- <c:if test="${requestScope.outStock.flow_id!=0}">
- <input type="hidden" id="flow_id" name="flow_id" value="${requestScope.outStock.flow_id}">
- </c:if>
- <c:if test="${requestScope.outStock.flow_id==0}">
- <input type="hidden" id="flow_id" name="flow_id" >
- </c:if>
- <input type="hidden" id="state" name="state" value="${state}"> <%-- 审核状态5,代表不需要流程引擎插件 --%>
- <input type="hidden" id="outs_id" name="outs_id" value="${requestScope.outStock.outs_id }">
- <input type="hidden" id="outsd_product_count" name="outsd_product_count" value="1">
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
- <input type="hidden" id="check_status" name="check_status" value="${requestScope.outStock.check_status}">
- <input type="hidden" id="unit_id" name="unit_id" value="${requestScope.outStock.unit_id }">
- <input type="hidden" id="task" name="task" value="doEditOutStock">
- <input type="hidden" name="outs_status" id="outs_status" value="1">
- <input type="hidden" id="check_user_id" name="check_user_id" value="${requestScope.outStock.check_user_id}">
- <input type="hidden" id="out_deleted" name="out_deleted" value="${requestScope.outStock.out_deleted }">
- <input type="hidden" id="outs_depot_id_" name="outs_depot_id_" value="">
- <input type="hidden" id="outs_location_id_" name="outs_location_id_" value="">
- <!-- 流程ID -->
- <input type="hidden" id="tmodelId" name="tmodelId" value="${requestScope.tmodel.tmodelId }">
- <input type="hidden" id="modelId" name="modelId" value="${requestScope.fmodel.modelId }">
- <input type="hidden" id="flowTheme" name="flowTheme" value="${requestScope.flowTheme}"/>
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|