|
@@ -52,7 +52,7 @@
|
|
|
<a onclick="zTreeOprObj.addRootNode()" class="btn btn-secondary btn-sm">增加根节点</a>
|
|
|
</div>
|
|
|
<div class="tab-content">
|
|
|
- <ul id="treeDemo" class="ztree"></ul>
|
|
|
+ <ul id="rationChapterTree" class="ztree"></ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="main-content col-lg-9 p-0">
|
|
@@ -877,39 +877,26 @@
|
|
|
<script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
|
|
|
<script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
|
|
|
<script type="text/javascript" src="/lib/ztree/jquery.ztree.exedit.js"></script>
|
|
|
- <script type="text/javascript" src="/web/rationLibEditor/_zSpread.js"></script>
|
|
|
- <script type="text/javascript" src="/web/rationLibEditor/js/dinge.js"></script>
|
|
|
+ <script type="text/javascript" src="/web/rationLibEditor/js/chapterTree.js"></script>
|
|
|
+ <script type="text/javascript" src="/web/rationLibEditor/js/sheetCommon.js"></script>
|
|
|
+ <script type="text/javascript" src="/web/rationLibEditor/js/ration.js"></script>
|
|
|
+ <script type="text/javascript" src="/web/rationLibEditor/js/rationGLJ.js"></script>
|
|
|
<script type="text/javascript" src="/public/web/treeDataHelper.js"></script>
|
|
|
- <SCRIPT type="text/javascript">
|
|
|
-/*var rationName = getQueryString("rationname");*/
|
|
|
-var treeObj;
|
|
|
-var zNodes =[
|
|
|
- { id:1, pId:-1,nId:2, name:"第一章 土石方工程",isParent:true, items:[]},
|
|
|
- { id:2, pId:-1,nId:3, name:"第二章 挡墙、护坡工程",isParent:true,items:[]},
|
|
|
- { id:3, pId:-1,nId:4, name:"第三章 基础工程",isParent:true,items:[]},
|
|
|
- { id:4, pId:-1,nId:5, name:"第四章 脚手架工程",isParent:true,items:[]},
|
|
|
- { id:5, pId:-1,nId:6, name:"第五章 砌筑工程",isParent:true,items:[]},
|
|
|
- { id:6, pId:-1,nId:7, name:"第六章 混凝土及钢筋混凝土工程",isParent:true,items:[]},
|
|
|
- { id:7, pId:-1,nId:8, name:"第七章 金属工程",isParent:true,items:[]},
|
|
|
- { id:8, pId:-1,nId:9, name:"第八章 门窗、木结构",isParent:true,items:[]},
|
|
|
- { id:9, pId:-1,nId:10, name:"第九章 楼地面工程",isParent:true,items:[]},
|
|
|
- { id:10, pId:-1,nId:11, name:"第十章 层面工程",isParent:true,items:[]},
|
|
|
- { id:11, pId:-1,nId:12, name:"第十一章 防腐隔热保温工程",isParent:true,items:[]},
|
|
|
- { id:12, pId:-1,nId:13, name:"第十二章 装饰工程",isParent:true,items:[]},
|
|
|
- { id:13, pId:-1,nId:-1, name:"第十三章 其他工程",isParent:true,items:[]},
|
|
|
-];
|
|
|
-var setting = {
|
|
|
+ <script type="text/javascript">
|
|
|
+
|
|
|
+ var setting = {
|
|
|
view: {
|
|
|
// showIcon: showIconForTree,//已存在*/
|
|
|
- addHoverDom: addHoverDom,
|
|
|
- removeHoverDom: removeHoverDom,
|
|
|
+ addHoverDom: zTreeOprObj.addHoverDom,
|
|
|
+ removeHoverDom: zTreeOprObj.removeHoverDom,
|
|
|
+ expandSpeed: "",
|
|
|
selectedMulti: false
|
|
|
},
|
|
|
edit: {
|
|
|
enable: true,
|
|
|
editNameSelectAll: true,
|
|
|
- showRemoveBtn: showRemoveBtn,
|
|
|
- showRenameBtn: showRenameBtn
|
|
|
+ showRemoveBtn: true,
|
|
|
+ showRenameBtn: true
|
|
|
},
|
|
|
data: {
|
|
|
keep: {
|
|
@@ -927,528 +914,23 @@ var setting = {
|
|
|
}
|
|
|
},
|
|
|
callback:{
|
|
|
- //onClick:SectionClick,
|
|
|
- beforeDrag: beforeDrag,
|
|
|
- beforeEditName: beforeEditName,
|
|
|
- //beforeRemove: beforeRemove,
|
|
|
- beforeRename: beforeRename,
|
|
|
- //beforeClick:beforeClick,
|
|
|
+ onClick: zTreeOprObj.onClick,
|
|
|
+ beforeDrag: zTreeOprObj.beforeDrag,
|
|
|
+ beforeRename: zTreeOprObj.beforeRename,
|
|
|
beforeRemove: zTreeOprObj.onBeforeRemove,
|
|
|
- //onRemove: onRemove,
|
|
|
+ onRemove: zTreeOprObj.onRemove,
|
|
|
onRename: zTreeOprObj.onRename
|
|
|
}
|
|
|
-}; //ztree setting
|
|
|
-var log, className = "dark";
|
|
|
-var properties = {
|
|
|
-}
|
|
|
-//点击树获取定额
|
|
|
-function SectionClick(event,treeId,treeNode){
|
|
|
- var sectionID = treeNode.id;
|
|
|
- properties.selectedSection =sectionID
|
|
|
- getRationItems(sectionID);
|
|
|
-}
|
|
|
-function beforeDrag(treeId, treeNodes) {
|
|
|
- return false;
|
|
|
-}
|
|
|
-function beforeEditName(treeId, treeNode) {
|
|
|
- className = (className === "dark" ? "":"dark");
|
|
|
- var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
|
|
- zTree.selectNode(treeNode);
|
|
|
- zTree.editName(treeNode);
|
|
|
- return false;
|
|
|
-}
|
|
|
-function beforeClick(treeID,treeNode){
|
|
|
- return (treeNode.level == 2);
|
|
|
-}
|
|
|
-function beforeRemove(treeId, treeNode) {
|
|
|
- var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
|
|
- zTree.selectNode(treeNode);
|
|
|
- return true;
|
|
|
-}
|
|
|
-//删除树节点事件
|
|
|
-
|
|
|
-//级联删除章节点
|
|
|
-function caseDeleteTreeNode(arryObj){
|
|
|
- for(var i=0;i<arryObj.length;i++){
|
|
|
- {
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/deleteRation",
|
|
|
- data:{"rationName": rationName,"value":arryObj[i].RationCode},
|
|
|
- async:false,
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
-
|
|
|
- },
|
|
|
- error:function(){
|
|
|
- alert("nima")
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-//删除树节点ajax函
|
|
|
-function removeSection(id){
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/removeSection",
|
|
|
- data:{"rationName":rationName,"rationSection":id},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
- },
|
|
|
- error:function(){
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-function beforeRename(treeId, treeNode, newName, isCancel) {
|
|
|
- className = (className === "dark" ? "":"dark");
|
|
|
- if (newName.length == 0) {
|
|
|
- setTimeout(function() {
|
|
|
- var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
|
|
- zTree.cancelEditName();
|
|
|
- alert("节点名称不能为空.");
|
|
|
- }, 0);
|
|
|
- return false;
|
|
|
- }
|
|
|
- return true;
|
|
|
-}
|
|
|
-function showRemoveBtn(treeId, treeNode) {
|
|
|
- return true
|
|
|
-}
|
|
|
-function showRenameBtn(treeId, treeNode) {
|
|
|
- return true
|
|
|
-}
|
|
|
-function getTime() {
|
|
|
- var now= new Date(),
|
|
|
- h=now.getHours(),
|
|
|
- m=now.getMinutes(),
|
|
|
- s=now.getSeconds(),
|
|
|
- ms=now.getMilliseconds();
|
|
|
- return (h+":"+m+":"+s+ " " +ms);
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-function removeHoverDom(treeId, treeNode) {
|
|
|
- $("#addBtn_"+treeNode.tId).unbind().remove();
|
|
|
};
|
|
|
-function selectAll() {
|
|
|
- var zTree = $.fn.zTree.getZTreeObj("treeDemo");
|
|
|
- zTree.setting.edit.editNameSelectAll = $("#selectAll").attr("checked");
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-//新增定额事件
|
|
|
-$("#mkadd").click(function(){
|
|
|
- var section = treeObj.getSelectedNodes();
|
|
|
- if(!section.length){
|
|
|
- alert("请选择需要添加定额的章节!")
|
|
|
- return;
|
|
|
- }
|
|
|
-})
|
|
|
-$("#mkaddglj").click(function() {
|
|
|
- var s = $("#gljparam").val()
|
|
|
- if (!s) {
|
|
|
- alert("请选择需要添加工料机的定额!")
|
|
|
- return;
|
|
|
- }
|
|
|
-})
|
|
|
-$("#rationAdd").click(function(){
|
|
|
- var section = treeObj.getSelectedNodes();
|
|
|
- var rationItem = {};
|
|
|
- var code,name,danwei,jijia,xsname,qfzy;
|
|
|
- code = $("#code").val();name = $("#name").val();danwei=$("#danwei").val();jijia = $("#jijia").val();xsname = $("#xsname").val();qfzy=$("#qfzy").val();
|
|
|
- rationItem.RationCode = code;
|
|
|
- rationItem.RationName = name;
|
|
|
- rationItem.Unit = danwei;
|
|
|
- rationItem.BasePrice = Number(jijia);
|
|
|
- rationItem.SectionID = section[0].id;
|
|
|
- rationItem.ContentID = 0;
|
|
|
- rationItem.Caption = xsname;
|
|
|
- rationItem.FeeType = Number(qfzy)
|
|
|
- saveRationItem(rationItem);
|
|
|
-/* bindRationDelete()
|
|
|
- bindRationClick();*/
|
|
|
-})
|
|
|
-//保存定额条目Ajax函数
|
|
|
-function saveRationItem(obj){
|
|
|
- var rationItem = JSON.stringify(obj)
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/rationLibEditor/saveRationItem",
|
|
|
- data:{"rationName":rationName,"rationItem":rationItem},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
- getRationItems(properties.selectedSection);
|
|
|
- },
|
|
|
- error: function(jqXHR, textStatus, errorThrown){
|
|
|
- var err = JSON.parse(jqXHR.responseText);
|
|
|
- alert(err.error);
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-//获取定额条目Ajax函数
|
|
|
-function getRationItems(sectionID){
|
|
|
- $("#rationTbody").html("")
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/getRationsBySectionID",
|
|
|
- data:{"rationName": rationName,"sectionID": sectionID},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
- if(result){
|
|
|
- showRationItems(result.data);
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- error:function(){
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-//显示定额条目
|
|
|
-function showRationItems(data){
|
|
|
- //var RationJSONStr = JSON.stringify(data);
|
|
|
- var spread = $("#rationItemsSheet").data("workbook");
|
|
|
- spread.fromJSON(data);
|
|
|
-
|
|
|
-}
|
|
|
-//绑定点击定额号
|
|
|
-function bindRationClick(){
|
|
|
- var tr = $("#rationTbody tr");
|
|
|
- var td = $("td:eq(1)",tr);
|
|
|
- td.each(function() {
|
|
|
- var a;
|
|
|
- a = $('a', $(this));
|
|
|
- var str = a.text();
|
|
|
- a.click(function(){
|
|
|
- $("#gljparam").val(str);
|
|
|
- properties.selectedRation = str;
|
|
|
- getRationGLJItems(str)
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-//获取定额工料机
|
|
|
-function getRationGLJItems(str){
|
|
|
- var GLJTags = [];
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/getRationGLJItems",
|
|
|
- async: false,
|
|
|
- data:{"rationName": rationName,"rationCode":str},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result,status){
|
|
|
- if(result){
|
|
|
- var rationGLJs = result.data;
|
|
|
- for(var i=0;i<rationGLJs.length;i++){
|
|
|
- var TagItem = {};
|
|
|
- TagItem.dexh = rationGLJs[i].Amount;
|
|
|
- var gljCode = rationGLJs[i].GLJCode;
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/getGLJItem",
|
|
|
- async: false,
|
|
|
- data:{"rationName": rationName,"GLJCode":gljCode},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result1){
|
|
|
- TagItem.GLJ = result1.data[0];
|
|
|
- GLJTags[i] = TagItem;
|
|
|
- },
|
|
|
- error:function(){
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- error:function(){
|
|
|
- }
|
|
|
- })
|
|
|
- showRationGLJ(GLJTags)
|
|
|
-
|
|
|
-}
|
|
|
-//为每条定额工料机绑定删除事件
|
|
|
-function bindRationGLJDelete(){
|
|
|
- $("#rationGLJTbody tr").each(function() {
|
|
|
- var td7, a1,td1,a2;
|
|
|
- td7 = $("td:eq(7)", $(this));
|
|
|
- td1 = $("td:eq(1)", $(this));
|
|
|
- var str = td1.text();
|
|
|
- a2 = $("a:eq(1)",td7);
|
|
|
- a2.click(function(){
|
|
|
- $("#delType").val("rationGLJ");
|
|
|
- $("#delParam").val(str);
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-//为每条定额绑定编辑事件
|
|
|
-function bindRationEdit(){
|
|
|
- $("#rationTbody tr").each(function() {
|
|
|
- var td7,td1,a2;
|
|
|
- td7 = $("td:eq(7)", $(this));
|
|
|
- td1 = $("td:eq(1)", $(this));
|
|
|
- var str = td1.text();
|
|
|
- a2 = $("a:eq(0)",td7);
|
|
|
- a2.click(function(){
|
|
|
- properties.Edit = "ration";
|
|
|
- properties.EditParam =str;
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/getRationByCode",
|
|
|
- data:{"rationName": rationName,"RationCode":str},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:5000,
|
|
|
- success:function(result){
|
|
|
- var ration = result.data[0];
|
|
|
- $("#ERcode").val(ration.RationCode).attr("disabled",true);
|
|
|
- $("#ERname").val(ration.RationName);
|
|
|
- $("#ERdanwei").find("option:selected").text(ration.Unit);
|
|
|
- $("#ERjijia").val(ration.BasePrice).attr("disabled",true);
|
|
|
- $("#ERxsmc").val(ration.Caption);
|
|
|
- $("#ERqfzy").val(ration.FeeType);
|
|
|
- },
|
|
|
- error:function(err){
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-//绑定定额消耗编辑事件
|
|
|
-function bindRGLJAmountEdit(){
|
|
|
- $("#rationGLJTbody tr").each(function() {
|
|
|
- var td5, td1, a2,amount;
|
|
|
- var value = $("#gljparam").val();
|
|
|
- td5 = $("td:eq(5)", $(this));
|
|
|
- td1 = $("td:eq(1)", $(this));
|
|
|
- var str = td1.text();
|
|
|
- a2 = $("input", td5);
|
|
|
-
|
|
|
- a2.blur(function () {
|
|
|
- if(isNaN(a2.val()))
|
|
|
- alert("请输入数值!");
|
|
|
- else
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/editRGLJAmount",
|
|
|
- dataType:"json",
|
|
|
- data:{"rationName":rationName,"GLJCode":str,"RationCode":value,"Amount":Number(a2.val())},
|
|
|
-
|
|
|
- cache:false,
|
|
|
- timeout:50000,
|
|
|
- success:function(result){
|
|
|
- // getRationItems(properties.selectedSection);
|
|
|
- getRationGLJItems(value);
|
|
|
- },
|
|
|
- error:function(iqXHR,textStatus,errorThrown){
|
|
|
- alert("error "+textStatus+" "+errorThrown);
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
-}
|
|
|
-$("#Rbianji").click(function(){//设置定额号不可编辑
|
|
|
-
|
|
|
- var ERcode,ERname,ERdanwei,ERjijia,ERxsmc,ERqfzy,ration={};
|
|
|
- ERcode=$("#ERcode").val();
|
|
|
- ERname=$("#ERname").val();
|
|
|
- ERdanwei=$("#ERdanwei").val();
|
|
|
- ERjijia=$("#ERjijia").val();
|
|
|
- ERxsmc = $("#ERxsmc").val();
|
|
|
- ERqfzy=$("#ERqfzy").val();
|
|
|
- ration.RationCode = ERcode;
|
|
|
- ration.RationName = ERname;
|
|
|
- ration.Unit = ERdanwei;
|
|
|
- ration.BasePrice = Number(ERjijia);
|
|
|
- ration.SectionID = properties.selectedSection;
|
|
|
- ration.ContentID = 0;
|
|
|
- ration.Caption = ERxsmc;
|
|
|
- ration.FeeType =Number(ERqfzy);
|
|
|
- var rationItem = JSON.stringify(ration);
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/editRationItem",
|
|
|
- dataType:"json",
|
|
|
- data:{"rationName":rationName,"RationCode":properties.EditParam,"newRation":rationItem},
|
|
|
- cache:false,
|
|
|
- timeout:50000,
|
|
|
- success:function(result){
|
|
|
- getRationItems(properties.selectedSection);
|
|
|
- },
|
|
|
- error:function(iqXHR,textStatus,errorThrown){
|
|
|
- alert("error "+textStatus+" "+errorThrown);
|
|
|
- }
|
|
|
- })
|
|
|
-})
|
|
|
-//为每条定额绑定删除事件
|
|
|
-function bindRationDelete(){
|
|
|
- $("#rationTbody tr").each(function() {
|
|
|
- var td7, a1,td1,a2;
|
|
|
- td7 = $("td:eq(7)", $(this));
|
|
|
- td1 = $("td:eq(1)", $(this));
|
|
|
- var str = td1.text();
|
|
|
- a2 = $("a:eq(1)",td7);
|
|
|
- a2.click(function(){
|
|
|
- $("#delType").val("ration");
|
|
|
- $("#delParam").val(str);
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-//删除定额或定额工料机
|
|
|
-$("#shanchu").click(function(){
|
|
|
- var type = $("#delType").val();
|
|
|
- var value = $("#delParam").val();
|
|
|
- switch(type){
|
|
|
- case "ration":
|
|
|
- {$.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/deleteRation",
|
|
|
- data:{"rationName": rationName,"type":type,"value":value},
|
|
|
- async:false,
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
- getRationItems(properties.selectedSection);
|
|
|
- getRationGLJItems(value)
|
|
|
- },
|
|
|
- error:function(){
|
|
|
- alert("nima")
|
|
|
- }
|
|
|
- })
|
|
|
- break;}
|
|
|
- case "rationGLJ":
|
|
|
- { $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/deleteRationGLJ",
|
|
|
- data:{"rationName": rationName,"type":type,"value":value},
|
|
|
- async:false,
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
- var s = $("#gljparam").val();
|
|
|
- getRationGLJItems(s)
|
|
|
- },
|
|
|
- error:function(){
|
|
|
- alert("nima")
|
|
|
- }
|
|
|
- })
|
|
|
- break;}
|
|
|
- }
|
|
|
-
|
|
|
-})
|
|
|
-//显示定额工料机条目
|
|
|
-function showRationGLJ(obj){
|
|
|
- $("#bglj tbody tr").html("");
|
|
|
- var Baseprice = 0;
|
|
|
- for(var i=0;i<obj.length;i++){
|
|
|
- var code,name,danwei,jijia,dexh,leixing;
|
|
|
- code = obj[i].GLJ.GLJCode;
|
|
|
- name = obj[i].GLJ.GLJName;
|
|
|
- danwei = obj[i].GLJ.Unit;
|
|
|
- jijia = obj[i].GLJ.BasePrice;
|
|
|
- dexh = obj[i].dexh;
|
|
|
- Baseprice = Baseprice + Number(jijia)*Number(dexh);
|
|
|
- leixing =obj[i].GLJ.Type;
|
|
|
- var $tr = $('<tr><td></td><td></td><td></td><td></td><td></td><td><input></td><td></td><td> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td> </tr>')
|
|
|
- //<a href="javacript:void(0);" data-toggle="modal" data-target="#editBglj" title="编辑"><i class="fa fa-pencil-square-o"></i></a>
|
|
|
- var td0,td1,td2,td3,td4,td5,td6,a;
|
|
|
- td0 = $("td:eq(0)",$tr), td1 = $("td:eq(1)",$tr);td2 = $("td:eq(2)",$tr);td3 = $("td:eq(3)",$tr);td4 = $("td:eq(4)",$tr);td5 = $("td:eq(5)",$tr);a=$("input",td5);td6 = $("td:eq(6)",$tr);
|
|
|
- td0.text(i); td1.text(code);td2.text(name);td3.text(danwei);td4.text(jijia);a.val(dexh);td6.text(leixing)
|
|
|
- $tr.appendTo("#bglj tbody");
|
|
|
- }
|
|
|
- var s = $("#gljparam").val()
|
|
|
- $("#rationTbody tr").each(function(){
|
|
|
- var td = $("td:eq(1)",$(this))
|
|
|
- var s1 = td.text();
|
|
|
-
|
|
|
- if ( s == s1){
|
|
|
- td.next().next().next().text(Baseprice.toFixed(2));
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/setRationBasePrice",
|
|
|
- data:{"rationName": rationName,"rationCode":s,"BasePrice":Baseprice.toFixed(2)},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
-
|
|
|
- },
|
|
|
- error:function(err){
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- bindRGLJAmountEdit();
|
|
|
- bindRationGLJDelete();
|
|
|
-}
|
|
|
-//添加定额工料机ajax函数
|
|
|
-$("#bt-glj").click(function(){
|
|
|
- var rationGLJ = {};
|
|
|
- rationGLJ.RationCode = $("#gljparam").val();
|
|
|
- rationGLJ.GLJCode = $("#bt-inputCode").val();
|
|
|
- rationGLJ.Amount =Number($("#gljxh").val());
|
|
|
- rationGLJ.Type = Number($("#gljlx").val()) ;
|
|
|
- var rationglj = JSON.stringify(rationGLJ);
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/saveRationGLJ",
|
|
|
- data:{"rationName": rationName,"rationGLJ":rationglj},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:1000,
|
|
|
- success:function(result){
|
|
|
- getRationGLJItems($("#gljparam").val())
|
|
|
- },
|
|
|
- error:function(err){
|
|
|
- var error = JSON.parse(err.responseText);
|
|
|
- alert(error.error);
|
|
|
- }
|
|
|
- })
|
|
|
-})
|
|
|
-//输入工料机编号自动获取工料机信息
|
|
|
-$("#bt-inputCode").blur(function(){
|
|
|
- var gljCode = $("#bt-inputCode").val();
|
|
|
- $.ajax({
|
|
|
- type:"POST",
|
|
|
- url:"http://localhost:6060/ration/getGLJByCode",
|
|
|
- data:{"rationName": rationName,"gljCode":gljCode},
|
|
|
- dataType:"json",
|
|
|
- cache:false,
|
|
|
- timeout:5000,
|
|
|
- success:function(result){
|
|
|
- var glj = result.data[0];
|
|
|
- $("#gljName").val(glj.GLJName).attr("disabled",true);
|
|
|
- $("#gljdw").find("option:selected").text(glj.Unit).attr("disabled","disabled");
|
|
|
- $("#gljdj").val(glj.BasePrice).attr("disabled",true);
|
|
|
- $("#gljlx").val(glj.Type).attr("disabled","disabled");
|
|
|
- },
|
|
|
- error:function(err){
|
|
|
- var error = JSON.parse(err.responseText);
|
|
|
- alert(error.error);
|
|
|
- }
|
|
|
- })
|
|
|
-})
|
|
|
- </SCRIPT>
|
|
|
+ </script>
|
|
|
</body>
|
|
|
<script type="text/javascript">
|
|
|
autoFlashHeight();
|
|
|
+ $(document).ready(function(){
|
|
|
+ pageOprObj.initParam();
|
|
|
+ rationOprObj.buildSheet($("#rationItemsSheet")[0]);
|
|
|
+ rationGLJOprObj.buildSheet($("#rationGLJSheet")[0]);
|
|
|
+ });
|
|
|
</script>
|
|
|
|
|
|
</html>
|