editInStock.jsp 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=GBK">
  6. <title>入库单编辑</title>
  7. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
  8. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  9. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  10. <script type="text/javascript" src="/shares/js/constant.js"></script>
  11. <script type="text/javascript" src="/shares/js/common.js"></script>
  12. <script type="text/javascript" src="/shares/js/file.js"></script>
  13. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  14. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  15. <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/json2.js"></script>
  16. <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
  17. <!-- 选择窗口需要加载的js文件 start-->
  18. <script type="text/javascript" src="/shares/js/yw/erp/inStock.js"></script>
  19. <script type="text/javascript" src="/shares/js/yw/erp/supplierLookup.js"></script>
  20. <script type="text/javascript" src="/shares/js/yw/erp/insStockLookup.js"></script>
  21. <script type="text/javascript">
  22. var inStockDetailData = ${requestScope.Rows};
  23. //var depotData = ${requestScope.depotRows};
  24. var selectlocationid = "";
  25. var locationobjs;
  26. //var locationData = [];
  27. //var locationData = ${requestScope.locationRows};
  28. $(function() {
  29. $("#ins_batch_num").focus();
  30. closeAndReloadList();
  31. loadTypeTree("selectbutton", {
  32. type : "detpusersingle",
  33. backId : "ins_operater",
  34. backName : "ins_operater_name",
  35. tab : 1
  36. });
  37. loadTypeTree("selectCheckUser", {
  38. type : "detpusersingle",
  39. backId : "check_user_id",
  40. backName : "check_user_name",
  41. tab : 1
  42. });
  43. var insid = "${requestScope.inStock.ins_id}";
  44. if(insid != null && insid != ''){
  45. if("${requestScope.inStock.ins_depot_id}" != "" && typeof ("${requestScope.inStock.ins_depot_id}") != "undefined"){
  46. $("#ins_depot_id_").val("${requestScope.inStock.ins_depot_id}");
  47. $("#ins_depot_id").attr("disabled",true);
  48. }
  49. if("${requestScope.inStock.ins_location_id}" != "" && typeof ("${requestScope.inStock.ins_location_id}") != "undefined"){
  50. $("#ins_location_id_").val("");
  51. $("#ins_location_id").attr("disabled",true);
  52. }
  53. // alert("a"+'${requestScope.inStock.ins_instock_date }');
  54. // $("#ins_instock_date").ligerDateEditor({
  55. // labelAlign : 'left',
  56. // format :"yyyy-MM-dd",
  57. // initValue : '${requestScope.inStock.ins_instock_date }'
  58. // });
  59. }
  60. // else{
  61. // alert("b"+'${requestScope.datestr }');
  62. // $("#ins_instock_date").ligerDateEditor({
  63. // labelAlign : 'left',
  64. // format :"yyyy-MM-dd",
  65. // initValue : ${requestScope.datestr }
  66. // });
  67. // }
  68. var selectDepotid = "${requestScope.inStock.ins_depot_id}";
  69. if (selectDepotid != null && selectDepotid != "") {
  70. $("#ins_depot_id").val(selectDepotid);
  71. }
  72. selectlocationid = "${requestScope.inStock.ins_location_id}";
  73. if (selectlocationid != null && selectlocationid != "") {
  74. getLocations();
  75. }
  76. var selectInstype = "${requestScope.inStock.ins_type}";
  77. if (selectInstype != null && selectInstype != "") {
  78. $("#ins_type").val(selectInstype);
  79. }
  80. if('${requestScope.flowOnOff}'!="" && typeof('${requestScope.flowOnOff}')!="undefined"){
  81. var obj = window.top;
  82. $("#instock_save").attr({"disabled":"disabled"});
  83. obj.$.ligerDialog.alert("对不起,入库单流程未配置,请通知流程管理员配置后,再提交!", function (action){
  84. closeWindow();
  85. });
  86. }
  87. billTypeChange("${requestScope.inStock.ins_bill_type}");
  88. });
  89. // wzf start 2015-1-23
  90. function billType(){
  91. var selectDepotid = "${requestScope.inStock.ins_depot_id}";
  92. if (selectDepotid != null && selectDepotid != "") {
  93. $("#ins_depot_id").val(selectDepotid);
  94. }
  95. var ins_batch_num="${requestScope.inStock.ins_batch_num }";
  96. if (ins_batch_num != null && ins_batch_num != "") {
  97. $("#ins_batch_num").val(ins_batch_num);
  98. }
  99. var ins_instock_date="${requestScope.inStock.ins_instock_date }";
  100. if (ins_instock_date != null && ins_instock_date != "") {
  101. $("#ins_instock_date").val(ins_instock_date);
  102. }
  103. var suppliers_name="${requestScope.inStock.suppliers_name }";
  104. if (suppliers_name != null && suppliers_name != "") {
  105. $("#suppliers_name").val(suppliers_name);
  106. }
  107. var suppliers_id="${requestScope.inStock.suppliers_id }";
  108. if (suppliers_id != null && suppliers_id != "") {
  109. $("#suppliers_id").val(suppliers_id);
  110. }
  111. var relevance_ins_id="${requestScope.inStock.relevance_ins_id }";
  112. if (relevance_ins_id != null && relevance_ins_id != "" && relevance_ins_id!='0') {
  113. $("#relevance_ins_id").val(relevance_ins_id);
  114. $("#relevance_ins_name").val(relevance_ins_id);
  115. }
  116. var ins_remark="${requestScope.inStock.ins_remark }";
  117. if (ins_remark != null && ins_remark != "") {
  118. $("#ins_remark").val(ins_remark);
  119. }
  120. selectlocationid = "${requestScope.inStock.ins_location_id}";
  121. if (selectlocationid != null && selectlocationid != "") {
  122. getLocations();
  123. }
  124. var selectInstype = "${requestScope.inStock.ins_type}";
  125. if (selectInstype != null && selectInstype != "") {
  126. $("#ins_type").val(selectInstype);
  127. }
  128. }
  129. // wzf start 2015-1-23
  130. //选择单据类型事件
  131. function billTypeChange(value){
  132. var bill_type="${requestScope.inStock.ins_bill_type}";
  133. if (bill_type != value ) {
  134. inStockDetailData = [];
  135. }else{
  136. inStockDetailData = ${requestScope.Rows};
  137. }
  138. if(value==1){
  139. selectOpShow();
  140. $("#relevance3").show();
  141. $("#relevance").hide();
  142. $("#relevance4").hide();
  143. $("#relevance5").show();
  144. f_initGrid();
  145. // wzf start 2015-1-23
  146. var initTime='${inStock.instock_date}';
  147. if (initTime != null && initTime != "") {
  148. $("#ins_instock_date").val(initTime);
  149. }
  150. if (bill_type == value ) {
  151. billType()
  152. }
  153. // wzf end 2015-1-23
  154. }else if(value==2){
  155. selectOpHide();
  156. $("#relevance3").hide();
  157. $("#relevance").show();
  158. $("#relevance4").show();
  159. $("#relevance5").hide();
  160. f_initRedGrid();
  161. // wzf start 2015-1-23
  162. var initTime='${inStock.instock_date}';
  163. if (initTime != null && initTime != "") {
  164. $("#ins_instock_date").val(initTime);
  165. }
  166. if (bill_type == value ) {
  167. billType();
  168. }
  169. // wzf end 2015-1-23
  170. }else if(value==3){
  171. selectOpBlueShow();
  172. $("#relevance5").hide();
  173. $("#relevance3").hide();
  174. $("#relevance").show();
  175. $("#relevance4").show();
  176. f_initGrid();
  177. // wzf start 2015-1-23
  178. var initTime='${inStock.instock_date}';
  179. if (initTime != null && initTime != "") {
  180. $("#ins_instock_date").val(initTime);
  181. }
  182. if (bill_type == value ) {
  183. billType();
  184. }
  185. // wzf end 2015-1-23
  186. }else{
  187. selectOpShow();
  188. $("#relevance3").show();
  189. $("#relevance5").show();
  190. $("#relevance").hide();
  191. $("#relevance4").hide();
  192. f_initGrid();
  193. // wzf start 2015-1-23
  194. var initTime='${inStock.instock_date}';
  195. if (initTime != null && initTime != "") {
  196. $("#ins_instock_date").val(initTime);
  197. }
  198. $("#ins_bill_type").val("1");
  199. billType();
  200. // wzf end 2015-1-23
  201. }
  202. }
  203. //刷新列表
  204. function closeAndReloadList(){
  205. var isAddSucc = "${requestScope.isAddSucc}";
  206. if(isAddSucc == "true"){
  207. var tabid = getCurrentTabId();
  208. var listTabid = 'inStockAction.do?task=toList';
  209. if(window.parent.tab.isTabItemExist(listTabid)){
  210. window.parent.f_selectTab(listTabid);
  211. window.parent.f_reloadTab(listTabid);
  212. }else{
  213. window.parent.f_addTab(listTabid, '入库列表', 'inStockAction.do?task=toList');
  214. }
  215. window.parent.f_closeTab(tabid);
  216. }
  217. }
  218. function getLocations(selectlocationid){
  219. $("#ins_location_id").empty();
  220. $('#ins_location_id').append("<option value=''>--请选择--</option> ");
  221. var ins_depot_id_val=$('#ins_depot_id').val();
  222. $.ajax({
  223. url:"takingStockAction.do?date="+new Date()+"&task=getLocations",
  224. type:"post",
  225. dataType:"json",
  226. data:"takings_depot_id="+ $("#ins_depot_id").val(),
  227. success:callback
  228. });
  229. }
  230. function callback(json){
  231. var locationobjs = json;
  232. if(locationobjs.length == 0){
  233. $("#selectloc").hide();
  234. }else{
  235. $("#selectloc").show();
  236. for(var i=0;i<locationobjs.length;i++){
  237. $('#ins_location_id').append("<option value='"+locationobjs[i].location_id+"'>"+locationobjs[i].location_name+"</option>");
  238. }
  239. $("#ins_location_id").val(selectlocationid);
  240. }
  241. }
  242. function checkForm() {
  243. var rs = $.validate({
  244. name : "ins_operater_name",
  245. model : [ {
  246. type : "require",
  247. msg : "仓管员不能为空!"
  248. } ]
  249. });
  250. rs = $.validate({
  251. name : "ins_bill_type",
  252. model : [ {
  253. type : "require",
  254. msg : "单据类型不能为空!"
  255. } ]
  256. }) && rs;
  257. rs = $.validate({
  258. name : "ins_instock_date",
  259. model : [ {
  260. type : "require",
  261. msg : "入库日期不能为空!",
  262. msgBox:"empty_ins_instock_date"
  263. } ]
  264. }) && rs;
  265. rs = $.validate({
  266. name : "ins_depot_id",
  267. model : [ {
  268. type : "require",
  269. msg : "仓库不能为空!"
  270. } ]
  271. }) && rs;
  272. if (document.getElementById("selectloc").style.display != "none") {
  273. rs = $.validate({
  274. name : "ins_location_id",
  275. model : [ {
  276. type : "require",
  277. msg : "库位不能为空!"
  278. } ]
  279. }) && rs;
  280. }
  281. rs = $.validate({
  282. name : "ins_type",
  283. model : [ {
  284. type : "require",
  285. msg : "入库类别不能为空!"
  286. } ]
  287. }) && rs;
  288. // wzf start 2015-1-23
  289. var ins_bill_type= $("#ins_bill_type").val();
  290. if(ins_bill_type!='1'){
  291. rs = $.validate({
  292. name : "relevance_ins_name",
  293. model : [ {
  294. type : "require",
  295. msg : "冲账改帐入库单号不能为空!",
  296. msgField : "btn_choseInstock"
  297. } ]
  298. }) && rs;
  299. }
  300. // wzf end 2015-1-23
  301. // rs = $.validate({
  302. // name : "suppliers_name",
  303. // model : [ {
  304. // type : "require",
  305. // msg : "供应商不能为空!"
  306. // } ]
  307. // }) && rs;
  308. if (rs) {
  309. getData();
  310. var flag = isSelected();
  311. if (flag) {
  312. var jsonarr = eval('(' + $("#jsonData").val() + ')');
  313. for ( var i = 0; i < jsonarr.length; i++) {
  314. if (jsonarr[i].insd_product_count <= 0) {
  315. $.ligerDialog.warn(jsonarr[i].product_name + "的入库数量必须大于0!");
  316. return false;
  317. }
  318. // if (jsonarr[i].insd_totalprice <= 0) {
  319. // $.ligerDialog.warn(jsonarr[i].product_name + "-"
  320. // + jsonarr[i].product_num + "的金额必须大于0!");
  321. // return false;
  322. // }
  323. if(jsonarr[i].arrived_number<jsonarr[i].insd_product_count){
  324. $.ligerDialog.warn(jsonarr[i].product_name + "的入库数量必须小于到货数量"+jsonarr[i].arrived_number);
  325. return false;
  326. }
  327. }
  328. return true;
  329. }
  330. return false;
  331. }
  332. return false;
  333. }
  334. //保存
  335. function btnSaveIn() {
  336. var obj = window.top;
  337. if (checkForm()) {
  338. var ins_id = $("#ins_id").val();
  339. var flowTheme = $("#flowTheme").val();
  340. if(ins_id != "" && typeof (ins_id) != "undefined"){
  341. // wzf start 2015-1-23
  342. $("#instock_save").attr('disabled', true);
  343. $("#inStockForm").submit();
  344. // obj.$.ligerDialog.prompt('流程标题',flowTheme, function (yes,value){
  345. // if(yes){
  346. // if(value != "" && typeof (value) != "undefined"){
  347. // $("#flowTheme").val("");
  348. // $("#flowTheme").val(value);
  349. // $("#instock_save").attr('disabled', true);
  350. // $("#inStockForm").submit();
  351. // }else{
  352. // obj.$.ligerDialog.warn("流程标题不能为空!");
  353. // return;
  354. // }
  355. // }
  356. // });
  357. // wzf end 2015-1-23
  358. }else{
  359. // wzf start 2015-1-23
  360. $("#instock_save").attr('disabled', true);
  361. $("#inStockForm").submit();
  362. // if(flowTheme != "" && typeof (flowTheme) != "undefined"){
  363. // obj.$.ligerDialog.prompt('流程标题',flowTheme, function (yes,value){
  364. // if(yes){
  365. // if(value != "" && typeof (value) != "undefined"){
  366. // $("#flowTheme").val("");
  367. // $("#flowTheme").val(value);
  368. // $("#instock_save").attr('disabled', true);
  369. // $("#inStockForm").submit();
  370. // }else{
  371. // obj.$.ligerDialog.warn("流程标题不能为空!");
  372. // return;
  373. // }
  374. // }
  375. // });
  376. // }else{
  377. // $("#instock_save").attr('disabled', true);
  378. // $("#inStockForm").submit();
  379. // }
  380. // wzf end 2015-1-23
  381. }
  382. }
  383. }
  384. function isSelDepot() {
  385. var ins_depot_id_val = $('#ins_depot_id').val();
  386. if (ins_depot_id_val == "") {
  387. $.ligerDialog.warn("请先选择仓库 !");
  388. } else {
  389. if (locationobjs != null && locationobjs != ""
  390. && locationobjs.length > 0) {
  391. var ins_location_id_val = $('#ins_location_id').val();
  392. if (ins_location_id_val == "") {
  393. $.ligerDialog.warn("请先选择库位 !");
  394. } else {
  395. f_import();
  396. }
  397. } else {
  398. f_import();
  399. }
  400. }
  401. }
  402. function hasDetails() {
  403. getData();
  404. var jsonDataVal = $("#jsonData").val();
  405. if (jsonDataVal.length > 2) {
  406. if ($("#ins_depot_id").val() != null && $("#ins_depot_id").val() != "") {
  407. $("#ins_depot_id_").val($("#ins_depot_id").val());
  408. $("#ins_depot_id").attr("disabled", true);
  409. }
  410. if ($("#ins_location_id").val() != null
  411. && $("#ins_location_id").val() != "") {
  412. $("#ins_location_id_").val($("#ins_location_id").val());
  413. $("#ins_location_id").attr("disabled", true);
  414. }
  415. } else {
  416. $("#ins_depot_id").attr("disabled", false);
  417. $("#ins_location_id").attr("disabled", false);
  418. }
  419. }
  420. /**
  421. * 选择到货单
  422. */
  423. function f_importArrived() {
  424. var obj = window.top;
  425. var ins_depot_id_val = $('#ins_depot_id').val();
  426. if (ins_depot_id_val == "") {
  427. $.ligerDialog.warn("请先选择仓库 !");
  428. } else {
  429. if (locationobjs != null && locationobjs != "" && locationobjs.length > 0) {
  430. var ins_location_id_val = $('#ins_location_id').val();
  431. if (ins_location_id_val == "") {
  432. $.ligerDialog.warn("请先选择库位 !");
  433. } else {
  434. if ($("#ins_depot_id").val() != null && $("#ins_depot_id").val() != "") {
  435. $("#ins_depot_id_").val($("#ins_depot_id").val());
  436. }
  437. if ($("#ins_location_id").val() != null && $("#ins_location_id").val() != "") {
  438. $("#ins_location_id_").val($("#ins_location_id").val());
  439. }
  440. var ins_depot_id_val = $("#ins_depot_id_").val();
  441. var ins_location_id_val = $("#ins_location_id_").val();
  442. if (obj != undefined && obj != null) {
  443. obj.$.ligerDialog.open({
  444. title : '选择到货',
  445. width : 1000,
  446. height : 400,
  447. url : 'erpPurchaseArrivedAction.do?task=toSelectArrived',
  448. buttons : [ {
  449. text : '确定',
  450. onclick : f_importArrivedOK
  451. }, {
  452. text : '取消',
  453. onclick : f_importArrivedCancel
  454. } ]
  455. });
  456. }
  457. }
  458. } else {
  459. if ($("#ins_depot_id").val() != null && $("#ins_depot_id").val() != "") {
  460. $("#ins_depot_id_").val($("#ins_depot_id").val());
  461. }
  462. if ($("#ins_location_id").val() != null && $("#ins_location_id").val() != "") {
  463. $("#ins_location_id_").val($("#ins_location_id").val());
  464. }
  465. var ins_depot_id_val = $("#ins_depot_id_").val();
  466. var ins_location_id_val = $("#ins_location_id_").val();
  467. if (obj != undefined && obj != null) {
  468. obj.$.ligerDialog.open({
  469. title : '选择到货',
  470. width : 1000,
  471. height : 400,
  472. url : 'erpPurchaseArrivedAction.do?task=toSelectArrived',
  473. buttons : [ {
  474. text : '确定',
  475. onclick : f_importArrivedOK
  476. }, {
  477. text : '取消',
  478. onclick : f_importArrivedCancel
  479. } ]
  480. });
  481. }
  482. }
  483. }
  484. }
  485. /**
  486. * 到货单数据导入
  487. */
  488. function f_importArrivedOK(item, dialog) {
  489. //获取采购id
  490. $("#purchase_order_request_id").val("");
  491. $("#purchase_order_request_id").val(dialog.frame.getPurcharseRequestId());
  492. var rows = dialog.frame.f_select();
  493. var newrows = new Array(); // 先声明一维
  494. for ( var i = 0; i < rows.length; i++) { // 一维长度
  495. newrows[i] = new Array(); // 在声明二维
  496. }
  497. if (rows.length == 0) {
  498. var obj = window.top;
  499. obj.$.ligerDialog.warn('请选择采购货物!');
  500. return;
  501. }
  502. for ( var i = 0; i < rows.length; i++) {
  503. var manager = $("#maingrid").ligerGetGridManager();
  504. var data = manager.getData();
  505. var flag = true;
  506. for ( var j = 0; j < data.length; j++) {
  507. if (data[j].purcharse_detail_id == rows[i].purchase_detail_id) {
  508. flag = false;
  509. }
  510. }
  511. if (flag) {
  512. newrows[i].purcharse_detail_id = rows[i].purchase_detail_id;
  513. newrows[i].purcharse_id = rows[i].purchase_id;
  514. newrows[i].insd_product_id = rows[i].product_id;
  515. newrows[i].request_detail_id = rows[i].request_detail_id;
  516. newrows[i].request_id = rows[i].request_id;
  517. newrows[i].product_num = rows[i].product_num;
  518. newrows[i].product_standard = rows[i].product_model_standard;
  519. newrows[i].product_name = rows[i].product_name;
  520. newrows[i].product_unit = rows[i].product_unit_name;
  521. //newrows[i].product_unit_name = rows[i].purchase_product_unit;
  522. newrows[i].insd_product_count = rows[i].arrived_number;
  523. newrows[i].insd_price = rows[i].purchase_product_sell_price;
  524. newrows[i].insd_totalprice = rows[i].arrived_number * rows[i].purchase_product_sell_price;
  525. newrows[i].insd_warranty = rows[i].purchase_product_guarantee;
  526. newrows[i].insd_purchase_date = rows[i].purchase_date;
  527. newrows[i].insd_rate = 0;
  528. newrows[i].insd_totallevied = rows[i].arrived_number * rows[i].purchase_product_sell_price;
  529. newrows[i].arrived_detail_id = rows[i].arrived_detail_id;
  530. newrows[i].arrived_number = rows[i].arrived_number;
  531. newrows[i].insd_purchase_date = rows[i].purchase_date;
  532. g.addRow(newrows[i]);
  533. }
  534. }
  535. hasDetails();
  536. buttonType("arrived");
  537. dialog.close();
  538. }
  539. /**
  540. * 取消到货单输入导入
  541. */
  542. function f_importArrivedCancel(item, dialog) {
  543. dialog.close();
  544. }
  545. function buttonType(type){
  546. if("arrived"==type){
  547. $("#btn_choseProduct").attr("disabled","disabled");
  548. $("#btn_Mark").attr("disabled","disabled");
  549. }else if("purchase"==type){
  550. $("#btn_choseProduct").attr("disabled","disabled");
  551. $("#btn_choseArrived").attr("disabled","disabled");
  552. $("#btn_Mark").attr("disabled","disabled");
  553. }else if("product"==type){
  554. $("#btn_choseArrived").attr("disabled","disabled");
  555. }else{
  556. $("#btn_choseProduct").attr("disabled","");
  557. $("#btn_choseArrived").attr("disabled","");
  558. $("#btn_Mark").attr("disabled","");
  559. }
  560. }
  561. $(document).ready(function(){
  562. $("input[type='text']:first").focus();
  563. var initTime='';
  564. var t='${requestScope.inStock.ins_instock_date }'
  565. if (t == null || t == "") {
  566. initTime='${inStock.instock_date}';
  567. }else{
  568. initTime='${requestScope.inStock.ins_instock_date }';
  569. }
  570. $("#ins_instock_date").ligerDateEditor({
  571. labelAlign : 'left',
  572. showTime : true,
  573. format :"yyyy-MM-dd",
  574. initValue: initTime
  575. });
  576. });
  577. </script>
  578. </head>
  579. <body>
  580. <%@ include file="/include/message.jsp"%>
  581. <form id="inStockForm" action="inStockAction.do" method="post">
  582. <div id="title" class="form-button">
  583. <!-- <input id="instock_save" name="instock_save" type="button" class="l-button" value="保存" onClick="btnSaveIn();"/> -->
  584. <c:choose>
  585. <c:when test="${flowOnOff=='off' }">
  586. <input id="btnSave" type="button" class="l-button" value="提交" disabled="disabled" />
  587. <span style="color:red;">请先配置审核流程</span>
  588. </c:when>
  589. <c:when test="${fmodel_state=='0' }">
  590. <input id="btnSave" type="button" class="l-button" value="提交" disabled="disabled" />
  591. <span style="color:red;">请先启用审核流程</span>
  592. </c:when>
  593. <c:otherwise>
  594. <input id="btnSave" type="button" class="l-button" value="提交" onclick="btnSaveIn()" />
  595. </c:otherwise>
  596. </c:choose>
  597. <input type="button" value="关闭" class="l-button" onClick="closeWindow();"/>
  598. </div>
  599. <div class="container-layout">
  600. <div class="forum-container">
  601. <center>
  602. <table class="l-table-edit line">
  603. <tr>
  604. <th colspan="4">入库单信息</th>
  605. </tr>
  606. <tr>
  607. <td class="l-table-edit-text">入库单号:
  608. </td>
  609. <td class="l-table-edit-td">
  610. <jsp:include page="/yw/erp/include/codeReadonly.jsp">
  611. <jsp:param name="name" value="ins_num"/>
  612. <jsp:param name="value" value="${requestScope.inStock.ins_num }"/>
  613. </jsp:include>
  614. </td>
  615. <td class="l-table-edit-text">批次号 :
  616. </td>
  617. <td class="l-table-edit-td">
  618. <input type="text" id="ins_batch_num" name="ins_batch_num" value="${requestScope.inStock.ins_batch_num }">
  619. </td>
  620. </tr>
  621. <tr>
  622. <td class="l-table-edit-text">单据类型<FONT COLOR="red">*</FONT>:</td>
  623. <td class="l-table-edit-td" id="relevance2">
  624. <select name="ins_bill_type" id="ins_bill_type" style="width:130px" onChange="billTypeChange(this.value);">
  625. <option value=''>--请选择--</option>
  626. <c:forEach items="${ins_bill_type}" var="ins_bill_type">
  627. <option value="${ins_bill_type.dvalue}" ${requestScope.inStock.ins_bill_type==ins_bill_type.dvalue ?"selected":"" } >${ins_bill_type.dname}</option>
  628. </c:forEach>
  629. </select>
  630. </td>
  631. <!-- <td class="l-table-edit-td" id="relevance5" colspan="2"> -->
  632. <!-- </td> -->
  633. <!-- <td class="l-table-edit-td" id="relevance3" colspan="3"> -->
  634. <!-- <select name="ins_bill_type" id="ins_bill_type" style="width:130px" onChange="billTypeChange(this.value);"> -->
  635. <!-- <option value=''>--请选择--</option> -->
  636. <%-- <c:forEach items="${ins_bill_type}" var="ins_bill_type"> --%>
  637. <%-- <option value="${ins_bill_type.dvalue}" ${1==ins_bill_type.dvalue ?"selected":"" }>${ins_bill_type.dname}</option> --%>
  638. <%-- </c:forEach> --%>
  639. <!-- </select> -->
  640. <!-- </td> -->
  641. <td class="l-table-edit-text">入库日期<FONT COLOR="red">*</FONT>:
  642. </td>
  643. <td class="l-table-edit-td">
  644. <input type="text" id="ins_instock_date" name="ins_instock_date" value="${inStock.instock_date}" readonly="readonly" >
  645. <label id="empty_ins_instock_date"></label>
  646. </td>
  647. </tr>
  648. <tr>
  649. <td class="l-table-edit-text">仓库<FONT COLOR="red">*</FONT>:</td>
  650. <td class="l-table-edit-td">
  651. <select id="ins_depot_id" name="ins_depot_id" class="short-text" onChange="getLocations()" style="width:130px;">
  652. <c:choose>
  653. <c:when test="${typefp eq 1 }">
  654. <c:forEach items="${depotlist}" var="depotlist">
  655. <option value="${depotlist.depot_id}" >${depotlist.depot_name}</option>
  656. </c:forEach>
  657. </c:when>
  658. <c:otherwise>
  659. <option value="">--请选择--</option>
  660. <c:forEach items="${depotlist}" var="depotlist">
  661. <option value="${depotlist.depot_id}" ${depotlist.depot_id==requestScope.inStock.ins_depot_id ?"selected":""} >${depotlist.depot_name}</option>
  662. </c:forEach>
  663. </c:otherwise>
  664. </c:choose>
  665. </select>
  666. <span id="selectloc" style="display:none;">
  667. <select id="ins_location_id" name="ins_location_id" class="short-text" >
  668. <option value=''>--请选择--</option>
  669. </select>
  670. </span>
  671. </td>
  672. <td class="l-table-edit-text">仓管员<FONT COLOR="red"></FONT>:
  673. </td>
  674. <td class="l-table-edit-td">
  675. ${requestScope.inStock.ins_operater_name}
  676. <input type="hidden" name="ins_operater" id="ins_operater2" value="${requestScope.inStock.ins_operater}" />
  677. <input type="hidden" id="ins_operater_name2" name="ins_operater_name" readonly="readonly" value="${requestScope.inStock.ins_operater_name}"/>
  678. <!-- <input type="button" class="l-button" id="selectbutton" value="选择人员" /> -->
  679. </td>
  680. </tr>
  681. <tr>
  682. <c:if test="${typefp==1}">
  683. <td class="l-table-edit-text">入库类别<FONT COLOR="red">*</FONT>:</td>
  684. <td class="l-table-edit-td" >
  685. <select name="ins_type" id="ins_type2" style="width:130px" onchange="selectInsType(this.value);">
  686. <option value=''>--请选择--</option>
  687. <c:forEach items="${instypelist}" var="instype">
  688. <option value="${instype.dvalue}" ${11 == instype.dvalue ? "selected" : ""} >${instype.dname}</option>
  689. </c:forEach>
  690. </select>
  691. <input type="hidden" name="ins_type_hide" id="ins_type_hide" value=""/>
  692. </td>
  693. </c:if>
  694. <c:if test="${typefp!=1}">
  695. <td class="l-table-edit-text">入库类别<FONT COLOR="red">*</FONT>:</td>
  696. <td class="l-table-edit-td">
  697. <select name="ins_type" id="ins_type2" style="width:130px" onchange="selectInsType(this.value);">
  698. <option value=''>--请选择--</option>
  699. <c:forEach items="${instypelist}" var="instype">
  700. <option value="${instype.dvalue}" ${11 == instype.dvalue ? "selected" : ""} >${instype.dname}</option>
  701. </c:forEach>
  702. </select>
  703. <input type="hidden" name="ins_type_hide" id="ins_type_hide" value=""/>
  704. </td>
  705. </c:if>
  706. <td class="l-table-edit-text">备注:</td>
  707. <td class="l-table-edit-td">
  708. <input type="text" id="ins_remark" name="ins_remark" value="${requestScope.inStock.ins_remark }" />
  709. </td>
  710. </tr>
  711. <c:if test="${typefp!=1}">
  712. <tr>
  713. <td class="l-table-edit-text">供应商<FONT COLOR="red"></FONT>:</td>
  714. <td class="l-table-edit-td">
  715. <input type="hidden" id="suppliers_id" name="suppliers_id" value="${requestScope.inStock.suppliers_id}"/>
  716. <input type="text" id="suppliers_name" name="suppliers_name" value="${requestScope.inStock.suppliers_name}" size="20" readonly="readonly"/>
  717. <input id="btn_suppliers" type="button" class="l-button" value="请选择" onclick="chooseSupplier({sid:'suppliers_id',sname:'suppliers_name'});" />
  718. </td>
  719. <td class="l-table-edit-td" id="relevance5" colspan="2">
  720. </td>
  721. <td class="l-table-edit-text" id="relevance">冲账改帐入库单号<FONT COLOR="red">*</FONT>:</td>
  722. <td class="l-table-edit-td" id="relevance4">
  723. <input type="hidden" id="relevance_ins_id" name="relevance_ins_id" value="${requestScope.inStock.relevance_ins_id}"/>
  724. <input type="text" id="relevance_ins_name" name="relevance_ins_name" value="${requestScope.inStock.relevance_ins_id}" size="20" readonly="readonly"/>
  725. <input id="btn_choseInstock" type="button" class="l-button" value="请选择" onclick="chooseInsStock({ins_id:'relevance_ins_id',ins_num:'relevance_ins_name',ins_batch_num:'ins_batch_num',ins_operater:'ins_operater',ins_operater_name:'ins_operater_name',suppliers_id:'suppliers_id',suppliers_name:'suppliers_name',ins_instock_date:'ins_instock_date',ins_remark:'ins_remark'});" />
  726. </td>
  727. </tr>
  728. </c:if>
  729. <c:if test="${typefp==1}">
  730. <tr>
  731. <td class="l-table-edit-text" id="relevance">冲账改帐入库单号<FONT COLOR="red">*</FONT>:</td>
  732. <td class="l-table-edit-td" id="relevance4" colspan="3">
  733. <input type="hidden" id="relevance_ins_id" name="relevance_ins_id" value="${requestScope.inStock.relevance_ins_id}"/>
  734. <input type="text" id="relevance_ins_name" name="relevance_ins_name" value="${requestScope.inStock.relevance_ins_id}" size="20" readonly="readonly"/>
  735. <input id="btn_choseInstock" type="button" class="l-button" value="请选择" onclick="chooseInsStock({ins_id:'relevance_ins_id',ins_num:'relevance_ins_name',ins_batch_num:'ins_batch_num',ins_operater:'ins_operater',ins_operater_name:'ins_operater_name',suppliers_id:'suppliers_id',suppliers_name:'suppliers_name',ins_instock_date:'ins_instock_date',ins_remark:'ins_remark'});" />
  736. </td>
  737. </tr>
  738. </c:if>
  739. <!-- <tr> -->
  740. <!-- <td class="l-table-edit-text">库存量:</td> -->
  741. <!-- <td class="l-table-edit-td" colspan="3"> -->
  742. <input type="hidden" id="instock_count" name="instock_count" style="border-style: none;" readonly="readonly" />
  743. <!-- </td> -->
  744. <!-- </tr> -->
  745. <tr>
  746. <th colspan="4">入库明细</th>
  747. </tr>
  748. <tr>
  749. <td colspan="4">
  750. <!-- 明细 start -->
  751. <div style="padding-top:5px;">
  752. <a id="btn_choseProduct" class="l-button" style="width:100px;float:left; margin-left:10px;" onClick="isSelDepot();">选择存货</a>
  753. <!-- <a id="btn_chosePurchase" class="l-button" style="width:100px;float:left; margin-left:10px;" onClick="f_importPurchase();">选择采购单</a> -->
  754. <c:if test="${typefp!=1}">
  755. <a id="btn_choseArrived" class="l-button" style="width:100px;float:left; margin-left:10px;" onClick="f_importArrived();">选择到货单</a>
  756. <a id="btn_Mark" class="l-button" style="width:100px;float:left; margin-left:10px;" onClick="searchProByMark();">条码扫描</a>
  757. </c:if>
  758. <a id="btn_delete" class="l-button" style="width:120px;float:left; margin-left:10px;" onClick="deleteRow();">删除选择的行</a>
  759. </div>
  760. <div class="l-clear"></div>
  761. <div id="maingrid" style="margin-top:5px"></div>
  762. <div style="display:none;">
  763. </div>
  764. <!-- 明细 end -->
  765. </td>
  766. </tr>
  767. </table>
  768. <input type="hidden" id="typefp" name="typefp" value="${typefp}">
  769. <input type="hidden" id="purchase_order_request_id" name="purchase_order_request_id" value="">
  770. <input type="hidden" id="jsonData" name="jsonData" value="">
  771. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
  772. <input type="hidden" id="task" name="task" value="doEditInStock">
  773. <input type="hidden" id="ins_creater" name="ins_creater" value="${requestScope.inStock.ins_creater }">
  774. <input type="hidden" id="ins_id" name="ins_id" value="${requestScope.inStock.ins_id }">
  775. <input type="hidden" name="ins_status" id="ins_status" value="1">
  776. <input type="hidden" id="ins_depot_id_" name="ins_depot_id_" value="">
  777. <input type="hidden" id="ins_location_id_" name="ins_location_id_" value="">
  778. <input type="hidden" id="check_status" name="check_status" value="${requestScope.inStock.check_status}">
  779. <input type="hidden" id="check_user_id" name="check_user_id" value="${requestScope.inStock.check_user_id}">
  780. <input type="hidden" id="ins_deleted" name="ins_deleted" value="${requestScope.inStock.ins_deleted}">
  781. <input type="hidden" id="unit_id" name="unit_id" value="${requestScope.inStock.unit_id}">
  782. <input type="hidden" id="flow_id" name="flow_id" value="${requestScope.inStock.flow_id}">
  783. <!-- 流程ID -->
  784. <input type="hidden" name="tabid" id="tabid" />
  785. <input type="hidden" name="fmodel" value="${fmodel.modelId }">
  786. <input type="hidden" name="tmodel" value="${tmodel.tmodelId }">
  787. <input type="hidden" name="flow_ins_id" value="${inStock.flow_ins_id }">
  788. <input type="hidden" name="audit_status" value="${inStock.audit_status }"/>
  789. <!-- 判断使用哪个按钮 -->
  790. <input type="hidden" id="btn_type" name="btn_type" value="">
  791. </center>
  792. </div>
  793. </div>
  794. </form>
  795. </body>
  796. </html>