| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375 |
- <%@ 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 }/main.css" rel="stylesheet" type="text/css" />
- <link href="/shares/js/yw/master1/liger/skins/ynet/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <link href="/shares/css/yw/master1/reset.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 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/file.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/takingStockPlan.js"></script>
- <link rel="stylesheet" type="text/css" href="/shares/css/yw/master1/win/jquery.jscrollpane.codrops1.css" />
- <!-- the mousewheel plugin -->
- <script type="text/javascript" src="/shares/js/yw/master1/jquery.mousewheel.js"></script>
- <!-- the jScrollPane script -->
- <script type="text/javascript" src="/shares/js/yw/master1/jquery.jscrollpane.min.js"></script>
- <script type="text/javascript" src="/shares/js/yw/master1/scroll-startstop.events.jquery.js"></script>
- <script type="text/javascript" src="/shares/js/yw/master1/scroll.js"></script>
- <style type="text/css">
- body {
- background:#fff;
- }
- </style>
- <script type="text/javascript">
- var takingDetailData = ${requestScope.Rows};
- var task = "${requestScope.task}";
- var locationobjs;
- var selectlocationid = "";
- $(f_initGrid);
- $(function() {
- $("input[type='text']:first").focus();
- loadTypeTree("usertree", {
- type : "singleuser",
- tab : "1,2",
- backId : "takings_principal",
- backName : "takings_principalname"
- });
- loadTypeTree("usertree2", {
- type : "singleuser",
- tab : "1,2",
- backId : "takings_operater",
- backName : "takings_operatername"
- });
- $("#takings_start_date").ligerDateEditor({
- showTime : true,
- labelAlign : 'left',
- showTime : false,
- width : 150,
- height : 21
- });
- $("#takings_end_date").ligerDateEditor({
- showTime : true,
- labelAlign : 'left',
- showTime : false,
- width : 150,
- height : 21
- });
- var selectDepotid = "${requestScope.takingStockPlan.takings_depot_id}";
- if (selectDepotid != null && selectDepotid != "") {
- $("#takings_depot_id").val(selectDepotid);
- }
- selectlocationid = "${requestScope.takingStockPlan.takings_location_id}";
- if (selectlocationid != null && selectlocationid != "") {
- getLocations();
- }
- hasDetails();
- });
- function getLocations(selectlocationid) {
- $("#takings_location_id").empty();
- $('#takings_location_id').append("<option value=''>--请选择--</option> ");
- var takings_depot_id_val = $('#takings_depot_id').val();
- $.ajax({
- url : "takingStockPlanAction.do?date=" + new Date()
- + "&task=getLocations",
- type : "post",
- dataType : "json",
- data : "takings_depot_id=" + $("#takings_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++) {
- $('#takings_location_id').append(
- "<option value='"+locationobjs[i].location_id+"'>"
- + locationobjs[i].location_name + "</option>");
- }
- $("#takings_location_id").val(selectlocationid);
- }
- }
- function isSelDepot() {
- var takings_depot_id_val = $('#takings_depot_id').val();
- var takings_location_id_val = "";
- if (takings_depot_id_val == "") {
- $.ligerDialog.warn("请先选择仓库 !");
- } else {
- if (locationobjs != null && locationobjs != ""
- && locationobjs.length > 0) {
- takings_location_id_val = $('#takings_location_id').val();
- if (takings_location_id_val == "") {
- $.ligerDialog.warn("请先选择库位 !");
- } else {
- f_import(takings_depot_id_val, takings_location_id_val);
- }
- } else {
- f_import(takings_depot_id_val, takings_location_id_val);
- }
- }
- }
-
- function checkForm() {
- var rs = $.validate({
- name : "takings_num",
- model : [ {
- type : "require",
- msg : "计划编号不能为空!"
- } ]
- });
- rs = $.validate({
- name : "takings_name",
- model : [ {
- type : "require",
- msg : "计划主题不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "takings_principalname",
- model : [ {
- type : "require",
- msg : "负责人不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "takings_operatername",
- model : [ {
- type : "require",
- msg : "盘点人不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "takings_start_date",
- model : [ {
- type : "require",
- msg : "计划开始日期不能为空!"
- } ]
- }) && rs;
- rs = $.validate({
- name : "takings_end_date",
- model : [ {
- type : "require",
- msg : "计划完成日期不能为空!"
- }, {
- type : "date",
- min : $("#takings_start_date").val(),
- msg : "完成日期不能小于开始日期"
- } ]
- }) && rs;
- rs = $.validate({
- name : "takings_depot_id",
- model : [ {
- type : "require",
- msg : "仓库不能为空!"
- } ]
- }) && rs;
- if (document.getElementById("selectloc").style.display != "none") {
- rs = $.validate({
- name : "takings_location_id",
- model : [ {
- type : "require",
- msg : "库位不能为空!"
- } ]
- }) && rs;
- }
- if (rs) {
- getData();
- var flag = isSelected();
- if (flag) {
- return true;
- }
- return false;
- }
- return false;
- }
- function hasDetails() {
- getData();
- var jsonDataVal = $("#jsonData").val();
- if (jsonDataVal.length > 2) {
- if ($("#takings_depot_id").val() != null
- && $("#takings_depot_id").val() != "") {
- $("#takings_depot_id_").val($("#takings_depot_id").val());
- $("#takings_depot_id").attr("disabled", true);
- }
- if ($("#takings_location_id").val() != null
- && $("#takings_location_id").val() != "") {
- $("#takings_location_id_").val($("#takings_location_id").val());
- $("#takings_location_id").attr("disabled", true);
- }
- } else {
- $("#takings_depot_id").attr("disabled", false);
- $("#takings_location_id").attr("disabled", false);
- }
- }
- function saveTakingStockPlan() {
- if(checkForm()){
- $("#btnSave").attr({"disabled":"disabled"});
- $("#btnCreate").attr({"disabled":"disabled"});
- var myfrom = document.getElementById("myfrom");
- myfrom.action = "mtTakingStockPlanAction.do";
- $("#task").val("doEdit");
- $("#myfrom").submit();
- }
-
- }
- function createTakingStock() {
- if(checkForm()){
- $("#btnSave").attr({"disabled":"disabled"});
- $("#btnCreate").attr({"disabled":"disabled"});
- var myfrom = document.getElementById("myfrom");
- myfrom.action = "mtTakingStockPlanAction.do";
- $("#task").val("createTakingStock");
- $("#myfrom").submit();
- }
- }
- </script>
- </head>
- <body style="background: none; overflow: hidden;" ontouchmove="event.preventDefault();">
- <form action="mtTakingStockPlanAction.do" id="myfrom" name="myfrom" method="post">
- <div class="s_title b10 f6">
- <img src="/shares/images/master1/gg_ico.png" width="27" height="26" /> 编辑盘点计划
- <div class="article_title">
- <input class="art_back" style="width: 50px;" title="返回" name="" onclick="history.back(-1);" type="button" />
- <input class="art_sub" style="width: 50px;" title="保存盘点计划" name="" type="button" value="" onclick="saveTakingStockPlan()" />
- <input class="art_pan" title="生成盘点单" name="" type="button" value="" onclick="createTakingStock()" />
- </div>
- </div>
- <div id="jp-container" class="jp-container liuyan">
- <div class="forum-container">
- <center>
- <table class="l-table-edit">
- <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%"><input type="text"
- id="takings_num" name="takings_num" value="${requestScope.takingStockPlan.takings_num}" />
- </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="takings_name" name="takings_name"
- value="${requestScope.takingStockPlan.takings_name}" /></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="hidden"
- name="takings_principal" id="takings_principal"
- value="${requestScope.takingStockPlan.takings_principal}" /> <input
- type="text" id="takings_principalname" name="takings_principalname" readonly="readonly"
- value="${requestScope.takingStockPlan.takings_principalname }" />
- <input type="button" name="usertree" id="usertree" value="选择"
- class="l-button" /><br /></td>
- <td class="l-table-edit-text">盘点人<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td"><input type="hidden"
- name="takings_operater" id="takings_operater"
- value="${requestScope.takingStockPlan.takings_operater}" /> <input
- type="text" id="takings_operatername" name="takings_operatername" readonly="readonly"
- value="${requestScope.takingStockPlan.takings_operatername }" />
- <input type="button" name="usertree2" id="usertree2" 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"><input type="text"
- id="takings_start_date" name="takings_start_date"
- value="${requestScope.takingStockPlan.takings_start_date}"
- readonly="readonly" /> <input type="hidden"
- id="takings_start_date_prompt" name="takings_start_date"
- value="" /></td>
- <td class="l-table-edit-text">计划完成日期<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td">
- <input type="text" id="takings_end_date" name="takings_end_date"
- value="${requestScope.takingStockPlan.takings_end_date}"
- readonly="readonly" />
- <input type="hidden" id="takings_end_date_prompt" name="takings_end_date" value="" />
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">仓库<FONT COLOR="red">*</FONT>:
- </td>
- <td class="l-table-edit-td"><select
- id="takings_depot_id" name="takings_depot_id" class="short-text"
- onchange="getLocations()">
- <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="takings_location_id" name="takings_location_id"
- class="short-text">
- <option value=''>--请选择--</option>
- </select>
- </span></td>
- <td class="l-table-edit-text">备注:</td>
- <td class="l-table-edit-td">
- <input type="text" name="takings_remark" id="takings_remark" size="50"
- value ="${requestScope.takingStockPlan.takings_remark }"></input>
- </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="onKeyAll()">添加全部存货</a>
- <a class="l-button" style="width: 120px; float: left; margin-left: 10px;" onclick="deleteRow()">删除选择的行</a></td>
- </tr>
- </table>
- <input type="hidden" id="jsonData" name="jsonData" value=""/>
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }"/>
- <input type="hidden" id="task" name="task" value="doEdit"/>
- <input type="hidden" id="takings_id" name="takings_id" value="${requestScope.takingStockPlan.takings_id}">
- <input type="hidden" id="takings_depot_id_" name="takings_depot_id_" value="${requestScope.takingStockPlan.takings_depot_id}"/>
- <input type="hidden" id="takings_location_id_" name="takings_location_id_" value="${requestScope.takingStockPlan.takings_location_id}"/>
- <input type="hidden" id="unit_id" name="unit_id" value="${requestScope.takingStockPlan.unit_id }">
- </center>
- </div>
- <div id="maingrid" style="margin: 0; padding: 0"></div>
- </div>
- </form>
- <%@ include file="/include/message.jsp"%>
- </body>
- </html>
|