| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <!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="${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>
- <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></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/ligerDateEditor.js" type="text/javascript"></script>
- <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript"></script>
- <!-- 选择窗口需要加载的js文件 start-->
- <script src="${pageContext.request.contextPath}/liger/lib/json2.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/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/yw/erp/stockRemove.js"></script>
- <script type="text/javascript">
- var stockRemoveDetailData = ${requestScope.Rows };
- var task = "${requestScope.task}";
- var locationobjs;
- $(f_initGrid);
- $(function() {
- $("#stock_remove_title").focus();
- closeAndReloadList();
- loadTypeTree("usertree", {
- type : "singleuser",
- tab : "1,2",
- backId : "stock_remove_user",
- backName : "stock_remove_user_name"
- });
- $("#stock_remove_date").ligerDateEditor({
- showTime : true,
- labelAlign : 'left',
- showTime : false,
-
- format :"yyyy-MM-dd",
- initValue : '${requestScope.stockRemove.stock_remove_date_str }'
- });
- var selectFromDepot = "${requestScope.stockRemove.stock_remove_from_depot}";
- if (selectFromDepot != null && selectFromDepot != "") {
- $("#stock_remove_from_depot").val(selectFromDepot);
- }
- var selectFromLocation = "${requestScope.stockRemove.stock_remove_from_location}";
- if (selectFromLocation != null && selectFromLocation != "") {
- getLocations("stock_remove_from_depot",
- "stock_remove_from_location");
- }
- ;
- var selectToDepot = "${requestScope.stockRemove.stock_remove_to_depot}";
- if (selectToDepot != null && selectToDepot != "") {
- $("#stock_remove_to_depot").val(selectToDepot);
- }
- var selectToLocation = "${requestScope.stockRemove.stock_remove_to_location}";
- if (selectToLocation != null && selectToLocation != "") {
- getLocations("stock_remove_to_depot", "stock_remove_to_location");
- }
- hasDetails();
- });
- function getLocations(depot, location) {
- $("#" + location).empty();
- $('#' + location).append("<option value=''>--请选择--</option> ");
- var depot_val = $('#' + depot).val();
- $
- .ajax({
- url : "locationAction.do?date=" + new Date()
- + "&task=getLocations",
- type : "post",
- dataType : "json",
- data : "depot_id=" + $("#" + depot).val(),
- success : function(data) {
- locationobjs = data;
- if (locationobjs.length == 0) {
- if (depot == "stock_remove_from_depot")
- $("#selectloc1").hide();
- else
- $("#selectloc2").hide();
- } else {
- if (depot == "stock_remove_from_depot")
- $("#selectloc1").show();
- else
- $("#selectloc2").show();
- for ( var i = 0; i < locationobjs.length; i++) {
- $('#' + location).append(
- "<option value='"+locationobjs[i].location_id+"'>"
- + locationobjs[i].location_name
- + "</option>");
- }
- if (depot == "stock_remove_from_depot")
- $("#" + location)
- .val(
- "${requestScope.stockRemove.stock_remove_from_location}");
- else
- $("#" + location)
- .val(
- "${requestScope.stockRemove.stock_remove_to_location}");
- }
- ;
- hasDetails();
- }
- });
- }
- function closeAndReloadList(){
- var isAddSucc = "${requestScope.isAddSucc}";
- if(isAddSucc == "true"){
- var tabid = getCurrentTabId();
- var listTabid = 'stockRemoveAction.do?task=toListStockRemove';
- if(window.parent.tab.isTabItemExist(listTabid)){
- window.parent.f_selectTab(listTabid);
- window.parent.f_reloadTab(listTabid);
- }else{
- window.parent.f_addTab(listTabid, '库存调拨单', 'stockRemoveAction.do?task=toListStockRemove');
- }
- window.parent.f_closeTab(tabid);
- }
- }
- function isSelDepot() {
- var stock_remove_depot_val = $('#stock_remove_from_depot').val();
- if (stock_remove_depot_val == "") {
- $.ligerDialog.warn("请先选择转出仓库 !");
- } else {
- if (locationobjs != null && locationobjs != ""
- && locationobjs.length > 0) {
- var stock_remove_location_val = $('#stock_remove_from_location')
- .val();
- if (stock_remove_location_val == "") {
- $.ligerDialog.warn("请先选择库位 !");
- } else {
- f_import();
- }
- } else {
- f_import();
- }
- }
- }
- function checkForm() {
- var rs = $.validate({
- name : "stock_remove_num",
- model : [ {
- type : "require",
- msg : "调拨单号不能为空!"
- } ]
- });
- var rs = $.validate({
- name : "stock_remove_title",
- model : [ {
- type : "require",
- msg : "调拨主题不能为空!"
- } ]
- });
- rs = $.validate({
- name : "stock_remove_user_name",
- model : [ {
- type : "require",
- msg : "调拨人不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "stock_remove_date",
- model : [ {
- type : "require",
- msg : "调拨日期不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "stock_remove_from_depot",
- model : [ {
- type : "require",
- msg : "转出仓库不能为空!"
- } ]
- }) && rs;
- if (document.getElementById("selectloc1").style.display != "none") {
- rs = $.validate({
- name : "stock_remove_from_location",
- model : [ {
- type : "require",
- msg : "库位不能为空!"
- } ]
- }) && rs;
- }
- rs = $.validate({
- name : "stock_remove_to_depot",
- model : [ {
- type : "require",
- msg : "转入仓库不能为空!"
- } ]
- }) && rs;
- if (document.getElementById("selectloc2").style.display != "none") {
- rs = $.validate({
- name : "stock_remove_to_location",
- model : [ {
- type : "require",
- msg : "库位不能为空!"
- } ]
- }) && rs;
- }
- if ($("#stock_remove_from_depot").val() != ""
- && $("#stock_remove_to_depot").val() != "") {
- if (($("#stock_remove_from_depot").val() == $(
- "#stock_remove_to_depot").val())
- && ($("#stock_remove_from_location").val() == $(
- "#stock_remove_to_location").val())) {
- $.ligerDialog.warn("转出仓库和转入仓库不能相同 !");
- rs = false;
- }
- }
- if (rs) {
- getData();
- if(isSelected()){
- return true;
- }
- return false;
- }
- return false;
- }
- function hasDetails() {
- getData();
- var jsonDataVal = $("#jsonData").val();
- if (jsonDataVal.length > 2) {
- if ($("#stock_remove_from_depot").val() != null
- && $("#stock_remove_from_depot").val() != "") {
- $("#stock_remove_from_depot_").val(
- $("#stock_remove_from_depot").val());
- $("#stock_remove_from_depot").attr("disabled", true);
- }
- if ($("#stock_remove_from_location").val() != null
- && $("#stock_remove_from_location").val() != "") {
- $("#stock_remove_from_location_").val(
- $("#stock_remove_from_location").val());
- $("#stock_remove_from_location").attr("disabled", true);
- }
- ;
- } else {
- $("#stock_remove_from_depot").attr("disabled", false);
- $("#stock_remove_from_location").attr("disabled", false);
- }
- ;
- }
- function savestock_remove() {
- getData();
- var myfrom = document.getElementById("myfrom");
- myfrom.action = "stockRemoveAction.do";
- $("#task").val("doEdit");
- }
- function createstock_removetock() {
- var myfrom = document.getElementById("myfrom");
- myfrom.action = "stockRemovetockAction.do";
- $("#task").val("add");
- }
-
- //保存
- function btnSaveRemove(){
- if(checkForm()){
- $("#btnSave").attr({"disabled":"disabled"});
- $("#myfrom").submit();
- }
- }
- </script>
- <style type="text/css">
- .file-style {
- width: 550px;
- }
- .file-style input[type='file'] {
- width: 385px;
- height: 24px;
- line-height: 22px;
- vertical-align: bottom;
- background-color: #fff;
- border: 1px solid #cccccc;
- margin-top: 2px;
- margin-bottom: 2px;
- }
- </style>
- </head>
- <body>
- <form action="stockRemoveAction.do" id="myfrom" name="myfrom" method="post">
- <div id="title" class="form-button">
- <input id="btnSave" type="button" class="l-button" value="保存" onclick="btnSaveRemove();" />
- <input type="button" value="关闭" class="l-button" onclick="closeWindow();" />
- </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" width="15%">调拨单号<FONT
- COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td" width="35%">
- <jsp:include page="/yw/erp/include/codeReadonly.jsp">
- <jsp:param name="name" value="stock_remove_num" />
- <jsp:param name="value" value="${requestScope.stockRemove.stock_remove_num}" />
- </jsp:include>
- </td>
- <td class="l-table-edit-text" width="15%">主题<FONT
- COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td" width="35%"><input type="text"
- id="stock_remove_title" name="stock_remove_title"
- value="${requestScope.stockRemove.stock_remove_title}" /></td>
- </tr>
- <tr>
- <td class="l-table-edit-text" width="15%">调拨日期<FONT
- COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td" width="35%"><input type="text"
- id="stock_remove_date" name="stock_remove_date"
- readonly="readonly"
- value="${requestScope.stockRemove.stock_remove_date }" /> <input
- type="hidden" name="stock_remove_date"
- id="stock_remove_date_hidden" value="" /></td>
- <td class="l-table-edit-text">调拨人<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td"><input type="hidden"
- name="stock_remove_user" id="stock_remove_user"
- value="${requestScope.stockRemove.stock_remove_user}" /> <input
- type="text" id="stock_remove_user_name"
- name="stock_remove_user_name" readonly="readonly"
- value="${requestScope.stockRemove.stock_remove_user_name}" /> <input
- type="button" name="usertree" id="usertree" value="选择"
- class="l-button" /><br /></td>
- </tr>
- <tr>
- <td class="l-table-edit-text">转出仓库<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td"><select
- id="stock_remove_from_depot" name="stock_remove_from_depot"
- class="short-text"
- onchange="getLocations('stock_remove_from_depot','stock_remove_from_location')">
- <option value="">--请选择--</option>
- <c:forEach items="${depotlist}" var="depotlist">
- <option value="${depotlist.depot_id}">${depotlist.depot_name}</option>
- </c:forEach>
- </select> <span id="selectloc1" style="display: none;"> <select
- id="stock_remove_from_location"
- name="stock_remove_from_location" 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"><select
- id="stock_remove_to_depot" name="stock_remove_to_depot"
- class="short-text"
- onchange="getLocations('stock_remove_to_depot','stock_remove_to_location')">
- <option value="">--请选择--</option>
- <c:forEach items="${depotlist}" var="depotlist">
- <option value="${depotlist.depot_id}">${depotlist.depot_name}</option>
- </c:forEach>
- </select> <span id="selectloc2" style="display: none;"> <select
- id="stock_remove_to_location" name="stock_remove_to_location"
- class="short-text">
- <option value=''>--请选择--</option>
- </select>
- </span></td>
- </tr>
- <tr>
- <td class="l-table-edit-text">备注</td>
- <td class="l-table-edit-td" colspan="3"><textarea
- name="stock_remove_remark" cols="120" rows="2">${requestScope.stockRemove.stock_remove_remark }</textarea>
- </td>
- </tr>
- <tr>
- <th colspan="4">调拨明细</th>
- </tr>
- <tr>
- <td colspan="4"><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="deleteRow()">删除选择的行</a></td>
- </tr>
- </table>
- <input type="hidden" id="jsonData" name="jsonData" value="">
- <input type="hidden" id="unit_id" name="unit_id" value="${requestScope.stockRemove.unit_id }">
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
- <input type="hidden" id="task" name="task" value="doEdit">
- <input type="hidden" id="stock_remove_id" name="stock_remove_id" value="${requestScope.stockRemove.stock_remove_id}">
- <input type="hidden" id="stock_remove_from_depot_" name="stock_remove_from_depot_" value="${requestScope.stockRemove.stock_remove_from_depot}">
- <input type="hidden" id="stock_remove_from_location_" name="stock_remove_from_location_" value="${requestScope.stockRemove.stock_remove_from_location}">
- </center>
- </div>
- <div id="maingrid" style="margin: 0; padding: 0"></div>
- </div>
- </form>
- <%@ include file="/include/message.jsp"%>
- </body>
- </html>
|