tBGoodsInfo-add.jsp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html lang="zh-CN">
  5. <head>
  6. <meta charset="utf-8">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8. <title>货品信息</title>
  9. <t:base type="jquery,easyui,tools"></t:base>
  10. <meta name="description" content="">
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12. <link rel="stylesheet" href="online/template/ledefault/css/vendor.css">
  13. <link rel="stylesheet" href="online/template/ledefault/css/bootstrap-theme.css">
  14. <link rel="stylesheet" href="online/template/ledefault/css/bootstrap.css">
  15. <link rel="stylesheet" href="online/template/ledefault/css/app.css">
  16. <link rel="stylesheet" href="plug-in/Validform/css/metrole/style.css" type="text/css"/>
  17. <link rel="stylesheet" href="plug-in/Validform/css/metrole/tablefrom.css" type="text/css"/>
  18. <script type="text/javascript" src="plug-in/jquery/jquery-1.9.0.js"></script>
  19. <script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
  20. <script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
  21. <script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
  22. <script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
  23. <script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
  24. <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
  25. <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
  26. <script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
  27. <script type="text/javascript" src="plug-in/Validform/js/Validform_v5.3.1_min_zh-cn.js"></script>
  28. <script type="text/javascript" src="plug-in/Validform/js/Validform_Datatype_zh-cn.js"></script>
  29. <script type="text/javascript" src="plug-in/Validform/js/datatype_zh-cn.js"></script>
  30. <script type="text/javascript" src="plug-in/Validform/plugin/passwordStrength/passwordStrength-min.js"></script>
  31. <link rel="stylesheet" href="plug-in/uploadify/css/uploadify.css" type="text/css"></link>
  32. <script type="text/javascript" src="plug-in/uploadify/jquery.uploadify-3.1.js"></script>
  33. <link rel="stylesheet" href="plug-in/umeditor/themes/default/css/umeditor.css" type="text/css"></link>
  34. <script type="text/javascript" src="plug-in/umeditor/umeditor.config.js"></script>
  35. <script type="text/javascript" src="plug-in/umeditor/umeditor.min.js"></script>
  36. <script type="text/javascript" src="plug-in/umeditor/lang/zh-cn/zh-cn.js"></script>
  37. <script src="${webBasePath}/webpage/cn/com/lzt/useractiviti/select_user_tools.js"></script>
  38. </head>
  39. <script type="text/javascript">
  40. $(function() {
  41. var selfId = "";
  42. $('#cc').combotree({
  43. url : 'tBGoodsCategoryController.do?setPGoodsCategory&selfId=' + selfId,
  44. width: 317.25,
  45. onSelect : function(node) {
  46. //此三类货品默认值有变化
  47. if(node.text == '固定资产' || node.text == '应急采购' || node.text == '其他'){
  48. isGDZC = true;
  49. //$('#jform_tab').hide();
  50. var trList = $("#add_tBPriceInfo_table").children("tr");
  51. for(var row = 0;row < trList.length;row++){
  52. trList.eq(row).remove();
  53. }
  54. newPrice();
  55. }else{
  56. isGDZC = false;
  57. //$('#jform_tab').show();
  58. }
  59. if(node.text == '固定资产'){
  60. //设置固定资产类型必输项
  61. $("#propertytype").attr("datatype","*").attr("nullmsg","请选择!");
  62. $("#gdzcnullflag").show();
  63. $("#propertytype").show();
  64. $("#gdzctypediv").show();
  65. }else{
  66. $("#propertytype").removeAttr("datatype").removeAttr("nullmsg");
  67. $("#gdzcnullflag").hide();
  68. $("#propertytype").hide();
  69. $("#propertytype").val("");
  70. $("#gdzctypediv").hide();
  71. }
  72. }
  73. });
  74. //if('${empty pid}' == 'false') { // 设置新增页面时的父级
  75. //$('#cc').combotree('setValue', '${pid}');
  76. //}
  77. });
  78. $(document).ready(function(){
  79. init();
  80. $("#jform_tab .con-wrapper").hide(); //Hide all tab content
  81. $("#jform_tab li:first").addClass("active").show(); //Activate first tab
  82. $("#jform_tab .con-wrapper:first").show(); //Show first tab content
  83. //On Click Event
  84. $("#jform_tab li").click(function() {
  85. $("#jform_tab li").removeClass("active"); //Remove any "active" class
  86. $(this).addClass("active"); //Add "active" class to selected tab
  87. $("#jform_tab .con-wrapper").hide(); //Hide all tab content
  88. var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
  89. $(activeTab).fadeIn(); //Fade in the active content
  90. //$(""+activeTab).show();
  91. if( $(activeTab).html()!="") {
  92. return false;
  93. }else{
  94. $(activeTab).html('正在加载内容,请稍后...');
  95. var url = $(this).attr("tab-ajax-url");
  96. $.post(url, {}, function(data) {
  97. //$(this).attr("tab-ajax-cached", true);
  98. $(activeTab).html(data);
  99. });
  100. }
  101. return false;
  102. });
  103. });
  104. //初始化下标
  105. function resetTrNum(tableId) {
  106. $tbody = $("#"+tableId+"");
  107. $tbody.find('>tr').each(function(i){
  108. $(':input, select', this).each(function(){
  109. var $this = $(this), name = $this.attr('name'), val = $this.val();
  110. if(name!=null){
  111. if (name.indexOf("#index#") >= 0){
  112. $this.attr("name",name.replace('#index#',i));
  113. }else{
  114. var s = name.indexOf("[");
  115. var e = name.indexOf("]");
  116. var new_name = name.substring(s+1,e);
  117. $this.attr("name",name.replace(new_name,i));
  118. }
  119. }
  120. });
  121. $(this).find('div[name=\'xh\']').html(i+1);
  122. });
  123. }
  124. function init(){
  125. var tabHead =$("#jform_tab li:first");
  126. var tabBox = $("#jform_tab .con-wrapper:first");
  127. var url = tabHead.attr("tab-ajax-url");
  128. tabBox.html('正在加载内容,请稍后...');
  129. $.post(url, {}, function(data) {
  130. tabBox.html(data);
  131. //tabHead.attr("tab-ajax-cached", true);
  132. });
  133. }
  134. function openRelatedSelect() {
  135. selectRelatedUnit(function(selectedRows){
  136. var one = selectedRows[0];
  137. var supplierId = one.id;
  138. var supplierName = one.unitName;
  139. $('#defaultProvider').val(supplierId);
  140. $('#defaultProviderTxt').val(supplierName);
  141. });
  142. }
  143. </script>
  144. <body>
  145. <form id="formobj" action="tBGoodsInfoController.do?doAdd" name="formobj" method="post"><input type="hidden" id="btn_sub" class="btn_sub"/>
  146. <input type="hidden" id="btn_sub" class="btn_sub"/>
  147. <div class="tab-wrapper">
  148. <!-- tab -->
  149. <ul class="nav nav-tabs">
  150. <li role="presentation" class="active"><a href="javascript:void(0);">货品信息</a></li>
  151. </ul>
  152. <!-- tab内容 -->
  153. <div class="con-wrapper" style="display: block;">
  154. <div class="row form-wrapper">
  155. <div class="row show-grid">
  156. <div class="col-xs-3 text-center">
  157. <span color="red" class="requiredIcon">*</span><b>货品名称:</b>
  158. </div>
  159. <div class="col-xs-3">
  160. <input id="goodsName" name="goodsName" type="text" class="form-control" maxlength="20" datatype="s1-20">
  161. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  162. <label class="Validform_label" style="display: none">货品名称</label>
  163. </div>
  164. <div class="col-xs-3 text-center">
  165. <b>规格型号:</b>
  166. </div>
  167. <div class="col-xs-3">
  168. <input id="specification" name="specification" type="text" class="form-control" maxlength="20" ignore="ignore">
  169. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  170. <label class="Validform_label" style="display: none">规格型号</label>
  171. </div>
  172. </div>
  173. <div class="row show-grid">
  174. <div class="col-xs-3 text-center">
  175. <span color="red" class="requiredIcon">*</span><b>所属分类:</b>
  176. </div>
  177. <div class="col-xs-3">
  178. <%-- <t:dictSelect field="belongCategory" type="list" extendJson="{class:'form-control',style:'width:150px'}"
  179. dictTable="t_b_goods_category" dictField="id" dictText="category_name" hasLabel="false" title="所属分类"></t:dictSelect>--%>
  180. <input id="cc" name="belongCategory" style="float:left;height:20px;">
  181. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  182. <label class="Validform_label" style="display: none">所属分类</label>
  183. </div>
  184. <div class="col-xs-3 text-center">
  185. <b>品牌:</b>
  186. </div>
  187. <div class="col-xs-3">
  188. <input id="brand" name="brand" type="text" class="form-control" maxlength="20" datatype="s1-20" ignore="ignore">
  189. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  190. <label class="Validform_label" style="display: none">品牌</label>
  191. </div>
  192. </div>
  193. <div class="row show-grid">
  194. <div class="col-xs-3 text-center">
  195. <span color="red" class="requiredIcon">*</span><b>默认供应商:</b>
  196. </div>
  197. <div class="col-xs-3">
  198. <input type="hidden" name="defaultProvider" id="defaultProvider" value="${tBGoodsInfoPage.defaultProvider}" datatype="*"/>
  199. <input type="text" name="defaultProviderTxt" id="defaultProviderTxt" value="${relatedUnitsEntity.unitName}" readonly="readonly"
  200. onclick="openRelatedSelect()" class="form-control" style="background:#ffffff"/>
  201. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  202. <label class="Validform_label" style="display: none">默认供应商</label>
  203. </div>
  204. <div class="col-xs-3 text-center">
  205. <span color="red" class="requiredIcon">*</span><b>基本单位:</b>
  206. </div>
  207. <div class="col-xs-3">
  208. <t:dictSelect field="baseUnit" type="list" extendJson="{class:'form-control',style:'width:150px',onchange:'syncBaseUnit(this.value)'}"
  209. typeGroupCode="metering_calcu_unit" hasLabel="false" title="基本单位" datatype="*"></t:dictSelect>
  210. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  211. <label class="Validform_label" style="display: none">基本单位</label>
  212. </div>
  213. </div>
  214. <div class="row show-grid">
  215. <div class="col-xs-3 text-center">
  216. <span color="red" class="requiredIcon">*</span> <b>采购时默认计量单位:</b>
  217. </div>
  218. <div class="col-xs-3">
  219. <t:dictSelect id="purchaseUnit" field="purchaseUnit" type="list" extendJson="{class:'form-control',style:'width:150px'}"
  220. typeGroupCode="metering_calcu_unit" hasLabel="false" title="采购单位" datatype="*"></t:dictSelect>
  221. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  222. <label class="Validform_label" style="display: none">采购时默认计量单位</label>
  223. </div>
  224. <div class="col-xs-3 text-center">
  225. <span color="red" class="requiredIcon">*</span> <b>申购时默认计量单位:</b>
  226. </div>
  227. <div class="col-xs-3">
  228. <t:dictSelect id="salesUnit" field="salesUnit" type="list" extendJson="{class:'form-control',style:'width:150px'}"
  229. typeGroupCode="metering_calcu_unit" hasLabel="false" title="申购单位" datatype="*"></t:dictSelect>
  230. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  231. <label class="Validform_label" style="display: none">申购单位</label>
  232. </div>
  233. </div>
  234. <div class="row show-grid">
  235. <div class="col-xs-3 text-center">
  236. <b>货品描述:</b>
  237. </div>
  238. <div class="col-xs-3">
  239. <textarea id="goodsDesc" class="form-control" rows="6" name="goodsDesc" maxlength="100"></textarea>
  240. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  241. <label class="Validform_label" style="display: none">货品描述</label>
  242. </div>
  243. <div id="gdzctypediv" style="display: none;" class="col-xs-3 text-center">
  244. <font id="gdzcnullflag" color="red" style="display: none;">* </font> <b>固定资产类型:</b>
  245. </div>
  246. <div class="col-xs-3">
  247. <t:dictSelect id="propertytype" field="propertytype" type="list" extendJson="{class:'form-control',style:'width:150px;display:none;'}"
  248. typeGroupCode="propertytype" hasLabel="false" title="固定资产类型" ></t:dictSelect>
  249. <span class="Validform_checktip" style="float:left;height:0px;"></span>
  250. <label class="Validform_label" style="display: none">固定资产类型</label>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="con-wrapper" style="display: block;"></div>
  256. </div>
  257. <script type="text/javascript">
  258. $(function(){
  259. //查看模式情况下,删除和上传附件功能禁止使用
  260. if(location.href.indexOf("load=detail")!=-1){
  261. $(".jeecgDetail").hide();
  262. }
  263. if(location.href.indexOf("mode=read")!=-1){
  264. //查看模式控件禁用
  265. $("#formobj").find(":input").attr("disabled","disabled");
  266. }
  267. if(location.href.indexOf("mode=onbutton")!=-1){
  268. //其他模式显示提交按钮
  269. $("#sub_tr").show();
  270. }
  271. });
  272. var neibuClickFlag = false;
  273. function neibuClick() {
  274. neibuClickFlag = true;
  275. $('#btn_sub').trigger('click');
  276. }
  277. </script>
  278. <div id="jform_tab" class="tab-wrapper">
  279. <!-- tab -->
  280. <ul class="nav nav-tabs">
  281. <li role="presentation" tab-ajax-url="tBGoodsInfoController.do?tBPriceInfoList&id=${tBGoodsInfoPage.id}"><a href="#con-wrapper0">价格信息</a></li>
  282. <li role="presentation" tab-ajax-url="tBGoodsInfoController.do?tBRelatedUnitPriceInfoList&id=${tBGoodsInfoPage.id}"><a href="#con-wrapper1">供应商信息</a></li>
  283. <!--<li role="presentation" tab-ajax-url="tBGoodsInfoController.do?tBStockInfoList&id=${tBGoodsInfoPage.id}"><a href="#con-wrapper0">库存信息</a></li>-->
  284. </ul>
  285. <div class="con-wrapper" id="con-wrapper0" style="display: none;"></div>
  286. <div class="con-wrapper" id="con-wrapper1" style="display: none;"></div>
  287. </div>
  288. <div align="center" id = "sub_tr" style="display: none;" > <input type="button" value="提交" onclick="neibuClick();" class="ui_state_highlight"></div>
  289. <script type="text/javascript">
  290. $(function() {
  291. $("#formobj").Validform({
  292. tiptype: 1,
  293. btnSubmit: "#btn_sub",
  294. btnReset: "#btn_reset",
  295. ajaxPost: true,
  296. beforeSubmit: function(curform) {
  297. var tag = true;
  298. //提交前处理
  299. return tag;
  300. },
  301. usePlugin: {
  302. passwordstrength: {
  303. minLen: 6,
  304. maxLen: 18,
  305. trigger: function(obj, error) {
  306. if (error) {
  307. obj.parent().next().find(".Validform_checktip").show();
  308. obj.find(".passwordStrength").hide();
  309. } else {
  310. $(".passwordStrength").show();
  311. obj.parent().next().find(".Validform_checktip").hide();
  312. }
  313. }
  314. }
  315. },
  316. callback: function(data) {
  317. if (data.success == true) {
  318. var win = frameElement.api.opener;
  319. //如果有tableid,则为从其他入口进入此界面,非货品列表
  320. if(!win.tableId){
  321. win.reloadTable();
  322. }
  323. win.tip(data.msg);
  324. frameElement.api.close();
  325. } else {
  326. if (data.responseText == '' || data.responseText == undefined) {
  327. $.messager.alert('错误', data.msg);
  328. $.Hidemsg();
  329. } else {
  330. try {
  331. var emsg = data.responseText.substring(data.responseText.indexOf('错误描述'), data.responseText.indexOf('错误信息'));
  332. $.messager.alert('错误', emsg);
  333. $.Hidemsg();
  334. } catch(ex) {
  335. $.messager.alert('错误', data.responseText + '');
  336. }
  337. }
  338. return false;
  339. }
  340. }
  341. });
  342. });
  343. </script>
  344. </form>
  345. <!-- 添加 产品明细 模版 -->
  346. <table style="display:none" id="add_tBRelatedUnitPriceInfo_table">
  347. <tbody id="add_tBRelatedUnitPriceInfo_table_template">
  348. <tr>
  349. <th scope="row"><div name="xh"></div></th>
  350. <td><input style="width:20px;" type="checkbox" name="ck"/>
  351. <input name="tBRelatedUnitPriceInfoList[#index#].relatedunitid" type="hidden"/>
  352. </td>
  353. <td align="left">
  354. <input name="tBRelatedUnitPriceInfoList[#index#].relatedunitname" maxlength="10"
  355. type="text" class="form-control" style="width:260px;">
  356. <label class="Validform_label" style="display: none;">供应商</label>
  357. </td>
  358. <td align="left">
  359. <t:dictSelect field="tBRelatedUnitPriceInfoList[#index#].meteringUnit" type="list" extendJson="{class:'form-control',style:'width:150px'}"
  360. typeGroupCode="metering_calcu_unit" defaultVal="" hasLabel="false" title="计量单位" datatype="*"></t:dictSelect>
  361. <label class="Validform_label" style="display: none;">计量单位</label>
  362. </td>
  363. <td align="left">
  364. <input name="tBRelatedUnitPriceInfoList[#index#].retailPrice" maxlength="10"
  365. type="text" class="form-control" style="width:120px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/">
  366. <label class="Validform_label" style="display: none;">采购价格</label>
  367. </td>
  368. <td align="left">
  369. <input name="tBRelatedUnitPriceInfoList[#index#].setPrice1" maxlength="10"
  370. type="text" class="form-control" style="width:120px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/">
  371. <label class="Validform_label" style="display: none;">对外价格</label>
  372. </td>
  373. </tr>
  374. </tbody>
  375. </table>
  376. <table style="display:none" id="add_tBPriceInfo_table">
  377. <tbody id="add_tBPriceInfo_table_template">
  378. <tr>
  379. <th scope="row"><div name="xh"></div></th>
  380. <td><input style="width:20px;" type="checkbox" name="ck"/></td>
  381. <td align="left">
  382. <t:dictSelect field="tBPriceInfoList[#index#].meteringUnit" type="list" extendJson="{class:'form-control',style:'width:150px'}"
  383. typeGroupCode="metering_calcu_unit" defaultVal="" hasLabel="false" title="计量单位" datatype="*"></t:dictSelect>
  384. <label class="Validform_label" style="display: none;">计量单位</label>
  385. </td>
  386. <td align="left">
  387. <input name="tBPriceInfoList[#index#].conversion" maxlength="10"
  388. type="text" class="form-control" style="width:130px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/">
  389. <label class="Validform_label" style="display: none;">与基本单位换算</label>
  390. </td>
  391. <td align="left">
  392. <input name="tBPriceInfoList[#index#].retailPrice" maxlength="10"
  393. type="text" class="form-control" style="width:120px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/">
  394. <label class="Validform_label" style="display: none;">对外价格</label>
  395. </td>
  396. <td align="left">
  397. <input name="tBPriceInfoList[#index#].setPrice1" maxlength="10"
  398. type="text" class="form-control" style="width:120px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/">
  399. <label class="Validform_label" style="display: none;">采购价格</label>
  400. </td>
  401. </tr>
  402. </tbody>
  403. </table>
  404. <script src = "webpage/cn/com/lzt/goodsinfo/tBGoodsInfo.js"></script>
  405. </body>
  406. </html>