凯云水利水电工程造价管理系统 技术解释(十三) 中间单价(四)

来源:互联网 发布:汉景帝铺路 知乎 编辑:程序博客网 时间:2024/04/28 05:57
中间单价
功能实现

中间单价包含三个部分:一个是中间单价列表,一个是中间单价定额组成表,一个是中间单价定额人材机组成表,中间单价列表,你可以对其进行新增,删除和修改。当点击时,点击添加会在datagrid里面增加一行数据,而数据里面的代号是自动增加,增加完一行数据,你就可以对他进行相应的修改,而修改是在datagrid里面操作的。

    中间单价定额组成表数据处理包括添加定额、新建定额、删除 。

 

   点击一下中间单价的添加定额、会弹出一个窗体,里面有数据的我们·可以通过多条件查询把数据给查询出来,然后双击把数据添加到定额表,而定额里面的数据,我们也可以通过新建定额来进行添加。我们如果觉得数据不好还可以把它给删除。

中间人材机的功能有添加,删去,替换,复制、粘贴,上移,下移:复制现有的数据,复制后的数据代号后会有”复制“两字,整数进行区分。然后进行粘贴到最后一行。





//下面就是增加人材机的方法

第一步:点击确定后给添加人材机赋值、存储过程


第二步:点击确定后增加人材机、逻辑层

 public int confirmaddtAlentsChance(string Str_Code, string Str_Name, string Int_Unit, string Str_Amount, int Int_CenterPriceQuoteComeposeID, string Int_BudgetPrice, string Str_Type, string Str_Remark)        {            SqlParameter[] mySQL = {                                                                           new SqlParameter("@type",SqlDbType.Char),                                                               new SqlParameter("@Code",SqlDbType.Char),                                         new SqlParameter("@Name",SqlDbType.Char),                                           new SqlParameter("@Unit",SqlDbType.Char),                                             new SqlParameter("@QuoteAmout",SqlDbType.Char),                                             new SqlParameter("@CenterPriceQuoteComeposeID",SqlDbType.Int),                                         new SqlParameter("@BudgetPrice",SqlDbType.Char),                                             new SqlParameter("@Type1",SqlDbType.Char),                                        new SqlParameter("@Remark",SqlDbType.Char),                                        };            mySQL[0].Value = "confirmaddtAlentsChance";//这是对应了存储过程@type类型            mySQL[1].Value = Str_Code;            mySQL[2].Value = Str_Name;            mySQL[3].Value = Int_Unit;            mySQL[4].Value = Str_Amount;            mySQL[5].Value = Int_CenterPriceQuoteComeposeID;            mySQL[6].Value = Int_BudgetPrice;            mySQL[7].Value = Str_Type;            mySQL[8].Value = Str_Remark;             int i = Centre.DAL_OPTableDB_Par("CenterPrice", mySQL);//这是把参数传进数据库            return i;        }

第三步:点击确定后增加人材机、控制器

  string BudgetPrice = "";        public ContentResult confirmaddtAlentsChance(string Str_Code, string Str_Name, string Int_Unit, string Str_Amount, string Int_CenterPriceQuoteComeposeID, string Int_BudgetPrice, string Str_Type, string Str_Remark)        {            if (Int_BudgetPrice == "null")            {                BudgetPrice = "";            }            else            {                BudgetPrice = Int_BudgetPrice;            }            int i = Centre.confirmaddtAlentsChance(Str_Code, Str_Name, Int_Unit, Str_Amount, Convert.ToInt32(Int_CenterPriceQuoteComeposeID), BudgetPrice, Str_Type, Str_Remark);//这是调用逻辑层的方法            string k = i.ToString();            return Content(k);        }

第四步:点击确定后增加人材机、界面层

 function confirmaddtAlentsChance(){                                    for(var i=0;i<  $('#Addconfirmcount').datagrid('getData').rows.length;i++){//这是遍历所有数据,增加进数据库                                     $.getJSON("/ZhongJianDanJia/confirmaddtAlentsChance?Str_Code=" +  $('#Addconfirmcount').datagrid('getData').rows[i]["daihao"]+ "&"                                           +"Str_Name="+ $('#Addconfirmcount').datagrid('getData').rows[i]["mingcheng"]+"&"                                                                                        +"Int_Unit="+ $('#Addconfirmcount').datagrid('getData').rows[i]["danwei"]+"&"                                            +"Str_Amount="+$('#Addconfirmcount').datagrid('getData').rows[i]["shuliang"]+"&"                                            +"Int_CenterPriceQuoteComeposeID="+$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+"&"                                            +"Int_BudgetPrice="+  $('#Addconfirmcount').datagrid('getData').rows[i]["yusuanjiage"]+"&"                                            +"Str_Type="+ $('#Addconfirmcount').datagrid('getData').rows[i]["leixing"]+"&"                                            +"Str_Remark="+$('#Addconfirmcount').datagrid('getData').rows[i]["Remark"]+"&"                                                                                  ,                function (data) {                                machinery=0; manpower=0;  material=0; coordinate=0;                                $('#w添加人材机').window('close');//这是关闭窗体                                 $('#Addconfirmcount').datagrid('loadData',{total:0,rows:[]});   //这是清空数据                                 //查询人材机                            $.getJSON("/ZhongJianDanJia/inquireAlentsChance?Int_CenterPriceQuoteComeposeID=" +$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+ "&",                                                                         function(data){                                                                                                                                                  $('#AmongConstitute').datagrid('loadData',data);//这是把查出来的数据绑定给相应的datagrid                                                                                                                                                  });                                       });                }                        } 

//接下来就到了删去的方法


第一步:删去人材机、存储过程


第二步:删去人材机、逻辑层

 public int deleteRowtalents(int Int_CenterPriceQuoteMachineID)        {            SqlParameter[] mySQL = {                                   new SqlParameter("@type",SqlDbType.Char),                                                                                                                                                                                                    new SqlParameter("@CenterPriceQuoteMachineID",SqlDbType.Char),                                                                                                                                                               };            mySQL[0].Value = "deleteRowtalents";            mySQL[1].Value = Int_CenterPriceQuoteMachineID;            int i = Centre.DAL_OPTableDB_Par("CenterPrice", mySQL);            return i;        }

第三步:删去人材机、控制器

   public ContentResult deleteRowtalents(string Int_CenterPriceQuoteMachineID)        {            int i = Centre.deleteRowtalents(Convert.ToInt32(Int_CenterPriceQuoteMachineID));            string k = i.ToString();            return Content(k);        }

第四步:删去人材机、界面层

function deleteRowtalents(){               $.getJSON("/ZhongJianDanJia/deleteRowtalents?Int_CenterPriceQuoteMachineID=" +$('#AmongConstitute').datagrid('getSelected').CenterPriceQuoteMachineID+ "&",                                                                         function(data){//这就是调用控制器的方法来进行数据的删去                                                                         alert("删去成功");                                                                        $.getJSON("/ZhongJianDanJia/inquireAlentsChance?Int_CenterPriceQuoteComeposeID=" +$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+ "&",                                                                         function(data){                                                                                                                                                   $('#AmongConstitute').datagrid('loadData',data);//这是把查出来的数据进行相应的绑定                                                                                                                                                        for(var i=0;i< $('#AmongConstitute').datagrid('getData').rows.length;i++){//这是遍历所有人材机的价格进行相加                                                                                     CombineGetprice =CombineGetprice + $('#AmongConstitute').datagrid('getData').rows[i]["CombineGetprice"]*1                                                                                                                                                                        }                                                                                sum();//这是调用下面计算价格的方法                                                                                                                                                  });                                                                                                                                                  });     }

   //计算定额的总数

   var centreGetPrice=0;           function sum(){                         $('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]=CombineGetprice;//这是把人材机的价格赋值给定额组成的价格              CombineGetprice=0;                $('#CentreConstitute').datagrid('getData').rows[indexdecide]["CombineGetprice"]= $('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]* $('#CentreConstitute').datagrid('getData').rows[indexdecide]["Counts"];               //这是把定额组成的数量和人材机价格乘起来                 $('#CentreConstitute').datagrid('refreshRow',indexdecide);//这是刷新这一行,把数据提取出来              $.getJSON("/ZhongJianDanJia/CentreConstitutesum?Str_BudgetPrice=" +$('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]+ "&"                                                              +"Int_CenterPriceQuoteComeposeID="+$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+"&"                                                              +"Str_CombineGetprice="+  $('#CentreConstitute').datagrid('getData').rows[indexdecide]["CombineGetprice"],                                                            function(data){                                                                    //这是把价格增进数据库                                                                     for(var i=0;i< $('#CentreConstitute').datagrid('getData').rows.length;i++){//这是遍历定额组成里面所有合价将其加起来                                                                                                                                                                            centreGetPrice =centreGetPrice +   $('#CentreConstitute').datagrid('getData').rows[i]["CombineGetprice"]*1//这就是把所有合价加起来                                                                                                                                                                        }                                                                              sum_centreGetPrice();//这是调用下面的方法,把价格增进中间列表                                                                                                                           });              $('#CentreConstitute').datagrid('selectRow',indexdecide);//这是选择一行               $('#CentreConstitute').datagrid('beginEdit', indexdecide);//开始编制                 CombineGetprice=0;                         }

//第二步:核算中间单价的价格

  function sum_centreGetPrice(){                     $('#centreGetPrice').datagrid('getData').rows[sum_Index]["BudgetPrice"]=centreGetPrice;//这是把价格赋给中间单间列表的预算价格                     centreGetPrice=0; //赋完值就要清0                         $.getJSON("/ZhongJianDanJia/sum_centreGetPrice?Str_BudgetPrice=" +$('#centreGetPrice').datagrid('getData').rows[sum_Index]["BudgetPrice"]+ "&"                                             +"Int_CenterPriceID="+$('#centreGetPrice').datagrid('getSelected').CenterPriceID+"&",                               function (data) { //中间很好                                       $.getJSON("/ZhongJianDanJia/inquire?Int_BuildProjectID=" + @Session["项目ID"]+ "&",                                        function (data) {                                         $('#centreGetPrice').datagrid('loadData',data);//加载数据给相应的datagrid                                         UnitMingCheng="";GetPriceClassifyMingCheng="";//这是清空数据好用来判断                                        circulate=0;//这是点击事件用来判断下一次执行                                         $('#centreGetPrice').datagrid('selectRow',sum_Index);//这是选中一行                                       });                                });                    $('#CentreConstitute').datagrid('selectRow',indexdecide);  //选中一行           }

打开替换的窗体;


下面就是打开替换窗体的html代码

  <div id="replace"  title="替换"  class="easyui-dialog" style="left:100px;top:30px">      <div class="easyui-tabs" style="width:600px;height:300px">      <div title="机械列表"style="padding:10px" >       <table id="MachineryListingreplace" class="easyui-datagrid" style="width:570px;height:230px"  data-options="onDblClickRow:onClickMachineryListingreplace,singleSelect:true">       <thead>         <tr>                <th field="Code" width="60" align="center">代号</th>                <th field="Name" width="160" align="center">名称</th><th field="Unit" width="80" align="center">单位</th><th field="BudgetPrice" width="100" align="center">预算价格</th><th field="Remark" width="130" align="center">备注</th>        </tr>        </thead>       </table>         </div>      <div title="人工列表" style="padding:10px" >           <table id="PopleListingreplace1" class="easyui-datagrid" style="width:570px;height:230px" data-options="onDblClickRow:onClickPopleListingreplace,singleSelect:true">       <thead>        <tr>                 <th field="Number" width="60" align="center">代号</th>                <th field="Name" width="160" align="center">名称</th><th field="Unit" width="80" align="center">单位</th><th field="BudgetPrice" width="100" align="center">预算价格</th><th field="Remark" width="130" align="center">备注</th>        </tr>        </thead>       </table>          </div>      <div  title="材料单价" style="padding:10px" @*data-options="iconCls:'icon-help'"*@>        <table id="MaterialListingreplace" class="easyui-datagrid" style="width:570px;height:230px" data-options="onDblClickRow:onClickMaterialListingreplace,singleSelect:true">       <thead>         <tr>                <th field="Code" width="60" align="center">代号</th>                <th field="Name" width="160" align="center">名称</th><th field="Unit" width="80" align="center">单位</th><th field="BudgetPrice" width="100" align="center">预算价格</th><th field="beizhu" width="130" align="center">备注</th>        </tr>        </thead>       </table>          </div>      <div title="配合比单价" style="padding:10px"  >      <table id="CoordinateGetpricereplace" class="easyui-datagrid" style="width:570px;height:230px" data-options="onDblClickRow:onClickCoordinateGetpricereplace,singleSelect:true">       <thead>        <tr>                 <th field="Code" width="60" align="center">代号</th>                <th field="MixProportionPriceName" width="160" align="center">名称</th><th field="Unit" width="80" align="center">单位</th><th field="BudgetPrice" width="100" align="center">预算价格</th><th field="Remark" width="130" align="center">备注</th>        </tr>        </thead>       </table>              </div>       </div>      </div>

这是打开替换的窗体

 function replacewindow(){         if($('#AmongConstitute').datagrid('getSelected')){           $('#replace').window('open');           }else{             alert("请选择人材机");                      }      }  

//这是双击配合比单价赋值给人材机、就以双击配合比单价为例

  var gg=0;          function   onClickCoordinateGetpricereplace(){                         for(var i=0;i<  $('#AmongConstitute').datagrid('getData').rows.length;i++){//这是遍历人材机                    if($('#AmongConstitute').datagrid('getData').rows[i]["Code"]==$('#CoordinateGetpricereplace').datagrid('getSelected').Code&$('#AmongConstitute').datagrid('getData').rows[i]["Name"]==$('#CoordinateGetpricereplace').datagrid('getSelected').MixProportionPriceName){//这是判断人材机,和配合比单价是否有重复                          gg=1;                    } else{                     }                            }            if(gg==1){            alert("已有相同");            gg=0;            } else{           $.getJSON("/ZhongJianDanJia/onClickCoordinateGetpricereplace?Str_Code="+$('#CoordinateGetpricereplace').datagrid('getSelected').Code.trim()+ "&"                                           +"Str_Name="+$('#CoordinateGetpricereplace').datagrid('getSelected').MixProportionPriceName+"&"                                                                                        +"Int_Unit="+$('#CoordinateGetpricereplace').datagrid('getSelected').Unit.trim()+"&"                                            +"Str_Amount="+1+"&"                                            +"Int_CenterPriceQuoteMachineID="+$('#AmongConstitute').datagrid('getSelected').CenterPriceQuoteMachineID+"&"                                            +"Int_BudgetPrice="+$('#CoordinateGetpricereplace').datagrid('getSelected').BudgetPrice+"&"                                            +"Str_Type="+"配合比"+"&"                                            +"Str_Remark="+$('#CoordinateGetpricereplace').datagrid('getSelected').Remark+"&",                                            function(data){                                            alert("替换成功");                                                   $.getJSON("/ZhongJianDanJia/inquireAlentsChance?Int_CenterPriceQuoteComeposeID=" +$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+ "&",                                                                         function(data){                                                                            $('#replace').window('close');//这是关闭窗体                                                                               $('#AmongConstitute').datagrid('loadData',data);//这是绑定数据                                                                            $('#AmongConstitute').datagrid('selectRow',Index);//选中下拉树                                                                          $('#AmongConstitute').datagrid('getData').rows[Index]["CombineGetprice"]=  $('#AmongConstitute').datagrid('getData').rows[Index]["CountNumber"]*1*$('#AmongConstitute').datagrid('getData').rows[Index]["BudgetPrice"]*1;//这是把人材机的数量和人材机的预算价格乘起来赋值给人材机的合价                                                                           $('#AmongConstitute').datagrid('refreshRow',Index); //这是刷新那一行,把数据显示出来                                                                          $.getJSON("/ZhongJianDanJia/onAfterConstitute?Str_CombineGetprice=" +  $('#AmongConstitute').datagrid('getData').rows[Index]["CombineGetprice"]+ "&"                                                                       +"Str_CountNumber="+$('#AmongConstitute').datagrid('getData').rows[Index]["CountNumber"]*1+"&"             +"Str_QuoteAmout="+$('#AmongConstitute').datagrid('getData').rows[Index]["QuoteAmout"]*1+"&"     +"Str_BudgetPrice="+$('#AmongConstitute').datagrid('getData').rows[Index]["BudgetPrice"]*1+"&"                   +"Int_CenterPriceQuoteMachineID="+$('#AmongConstitute').datagrid('getData').rows[Index]["CenterPriceQuoteMachineID"],                                                                         function(data){//这是修改定额组成的人材机价格和合价 $.getJSON("/ZhongJianDanJia/inquireAlentsChance?Int_CenterPriceQuoteComeposeID=" +$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+ "&",                                                                         function(data){ //这是查询一遍定额组成                                                                           $('#AmongConstitute').datagrid('loadData',data);//把查出来的数据赋值给相应的datagrid                                                                              $('#AmongConstitute').datagrid('selectRow',Index);//这是选中一行                                                                            for(var i=0;i< $('#AmongConstitute').datagrid('getData').rows.length;i++){//这是遍历定额人材机                                                                                     CombineGetprice =CombineGetprice + $('#AmongConstitute').datagrid('getData').rows[i]["CombineGetprice"]*1  //这是把所有定额人材机的合价,加起来                                                                                             }                                                                                sum();//这是调用下面的方法核算价格                                                                        });                                                                          });                                                                          });                                                                                        });                                            gg=0;                   }        }  

   //计算定额的总数

 var centreGetPrice=0;           function sum(){                         $('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]=CombineGetprice;//这是把人材机的价格赋值给定额组成的价格              CombineGetprice=0;                $('#CentreConstitute').datagrid('getData').rows[indexdecide]["CombineGetprice"]= $('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]* $('#CentreConstitute').datagrid('getData').rows[indexdecide]["Counts"];               //这是把定额组成的数量和人材机价格乘起来                 $('#CentreConstitute').datagrid('refreshRow',indexdecide);//这是刷新这一行,把数据提取出来              $.getJSON("/ZhongJianDanJia/CentreConstitutesum?Str_BudgetPrice=" +$('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]+ "&"                                                              +"Int_CenterPriceQuoteComeposeID="+$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+"&"                                                              +"Str_CombineGetprice="+  $('#CentreConstitute').datagrid('getData').rows[indexdecide]["CombineGetprice"],                                                            function(data){                                                                    //这是把价格增进数据库                                                                     for(var i=0;i< $('#CentreConstitute').datagrid('getData').rows.length;i++){//这是遍历定额组成里面所有合价将其加起来                                                                                                                                                                            centreGetPrice =centreGetPrice +   $('#CentreConstitute').datagrid('getData').rows[i]["CombineGetprice"]*1//这就是把所有合价加起来                                                                                                                                                                        }                                                                              sum_centreGetPrice();//这是调用下面的方法,把价格增进中间列表                                                                                                                           });              $('#CentreConstitute').datagrid('selectRow',indexdecide);//这是选择一行               $('#CentreConstitute').datagrid('beginEdit', indexdecide);//开始编制                 CombineGetprice=0;                         }

//第二步:核算中间单价的价格

  function sum_centreGetPrice(){                     $('#centreGetPrice').datagrid('getData').rows[sum_Index]["BudgetPrice"]=centreGetPrice;//这是把价格赋给中间单间列表的预算价格                     centreGetPrice=0; //赋完值就要清0                         $.getJSON("/ZhongJianDanJia/sum_centreGetPrice?Str_BudgetPrice=" +$('#centreGetPrice').datagrid('getData').rows[sum_Index]["BudgetPrice"]+ "&"                                             +"Int_CenterPriceID="+$('#centreGetPrice').datagrid('getSelected').CenterPriceID+"&",                               function (data) { //中间很好                                       $.getJSON("/ZhongJianDanJia/inquire?Int_BuildProjectID=" + @Session["项目ID"]+ "&",                                        function (data) {                                         $('#centreGetPrice').datagrid('loadData',data);//加载数据给相应的datagrid                                         UnitMingCheng="";GetPriceClassifyMingCheng="";//这是清空数据好用来判断                                        circulate=0;//这是点击事件用来判断下一次执行                                         $('#centreGetPrice').datagrid('selectRow',sum_Index);//这是选中一行                                       });                                });                    $('#CentreConstitute').datagrid('selectRow',indexdecide);  //选中一行           }


接下来就到定额人材机的复制

var Code="";        var Name="";        var Unit="";        var BudgetPrice="";        var dingeshuliang="";        var tiaozhenggongshi="";        var jisuanshuliang="";        var Remark="";        var Type1="";        var Copy3=0;         //复制         function Copy(){            if( $('#AmongConstitute').datagrid('getSelected')){//这是判断是否选中哪一行          Code  = $('#AmongConstitute').datagrid('getSelected').Code;//把选中哪一行的值赋值给变量           Name= $('#AmongConstitute').datagrid('getSelected').Name; //把选中哪一行的值赋值给变量           Unit =$('#AmongConstitute').datagrid('getSelected').Unit;           BudgetPrice =$('#AmongConstitute').datagrid('getSelected').BudgetPrice;                   QuoteAmout =$('#AmongConstitute').datagrid('getSelected').QuoteAmout;           CombineGetprice1= $('#AmongConstitute').datagrid('getSelected').CombineGetprice;          CountNumber = $('#AmongConstitute').datagrid('getSelected').CountNumber;           Remark =$('#AmongConstitute').datagrid('getSelected').Remark;           Type1 =$('#AmongConstitute').datagrid('getSelected').Type1;          Copy3=1;//这是用来判断是否有复制过          }        }  

//下面就是粘贴

第一步:粘贴人材机、存储过程


第二步:粘贴人材机、逻辑层

 public int patse(string Str_Code, string Str_Name, string Int_Unit, string Str_QuoteAmout, int Int_CenterPriceQuoteComeposeID, string Int_BudgetPrice, string Str_Type, string Str_Remark, string Str_CountNumber, string Str_CombineGetprice)        {            SqlParameter[] mySQL = {                                                                           new SqlParameter("@type",SqlDbType.Char),                                                                                                                                                                                                    new SqlParameter("@Code",SqlDbType.Char),                                         new SqlParameter("@Name",SqlDbType.Char),                                           new SqlParameter("@Unit",SqlDbType.Char),                                             new SqlParameter("@QuoteAmout",SqlDbType.Char),                                             new SqlParameter("@CenterPriceQuoteComeposeID",SqlDbType.Int),                                         new SqlParameter("@BudgetPrice",SqlDbType.Char),                                             new SqlParameter("@Type1",SqlDbType.Char),                                        new SqlParameter("@Remark",SqlDbType.Char),                                        new SqlParameter("@CountNumber",SqlDbType.Char),                                             new SqlParameter("@CombineGetprice",SqlDbType.Char),                                   };            mySQL[0].Value = "patse";            mySQL[1].Value = Str_Code;            mySQL[2].Value = Str_Name;            mySQL[3].Value = Int_Unit;            mySQL[4].Value = Str_QuoteAmout;            mySQL[5].Value = Int_CenterPriceQuoteComeposeID;            mySQL[6].Value = Int_BudgetPrice;            mySQL[7].Value = Str_Type;            mySQL[8].Value = Str_Remark;            mySQL[9].Value = Str_CountNumber;            mySQL[10].Value = Str_CombineGetprice;             int i = Centre.DAL_OPTableDB_Par("CenterPrice", mySQL);//这就是给存储过程传参数mySQL            return i;        }

第三步:粘贴人材机、控制器

  public ContentResult patse(string Str_Code, string Str_Name, string Int_Unit, string Str_QuoteAmout, string Int_CenterPriceQuoteComeposeID, string Int_BudgetPrice, string Str_Type, string Str_Remark, string Str_CountNumber, string Str_CombineGetprice)        {            int i = Centre.patse(Str_Code, Str_Name, Int_Unit, Str_QuoteAmout, Convert.ToInt32(Int_CenterPriceQuoteComeposeID), Int_BudgetPrice, Str_Type, Str_Remark, Str_CountNumber, Str_CombineGetprice);//这就是调用逻辑层的方法            string k = i.ToString();            return Content(k);//这就是把值返回给界面层        }

第四步:粘贴人材机、界面层

 var pastePanDuan=0;         function patse(){              if(Copy3==1){                  var y= Code;                $.getJSON("/JiXieDanJia/oddnumbers/"                                        ,                      function (data) { //这就是一个每查询一遍就加一的方法                   var t="_复制_"+data[0].oddnumbers;                     var tr= Code.trim()+t; //这就是拼接字符窜                   for(var i=0;i<$('#AmongConstitute').datagrid('getData').rows.length;i++){//这是一个遍历所有数据                                      if($('#AmongConstitute').datagrid('getData').rows[i]["Code"]==tr){ //这就是用定额人材机里面的所有数据和拼接的字符窜判断是否有重复                        pastePanDuan=1                  }else{                     pastePanDuan=0;                  }              }                if(pastePanDuan==0){               if(confirm('是否需要粘贴?')){ //这是一个系统的提醒方法            $.getJSON("/ZhongJianDanJia/patse?Str_Code=" + tr+ "&"                                           +"Str_Name="+  Name+"&"                                             +"Int_Unit="+ Unit+"&"                                            +"Str_QuoteAmout="+ QuoteAmout+"&"                                            +"Int_CenterPriceQuoteComeposeID="+   $('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+"&"                                            +"Int_BudgetPrice="+ BudgetPrice+"&"                                            +"Str_Type="+Type1+"&"                                            +"Str_Remark="+ Remark+"&"                                            +"Str_CountNumber="+CountNumber+"&"                                            +"Str_CombineGetprice="+CombineGetprice1,                                            function(data){                                            alert("成功");                                                   $.getJSON("/ZhongJianDanJia/inquireAlentsChance?Int_CenterPriceQuoteComeposeID=" +$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+ "&",                                                                         function(data){                                                                                                                                                    $('#AmongConstitute').datagrid('loadData',data);//这是把查出来的数据绑定给相应的datagrid                                                                        for(var i=0;i< $('#AmongConstitute').datagrid('getData').rows.length;i++){//这是定额人材机里面的合价,把合价全部加起来                                                                                                                                                                                                                                                              CombineGetprice =CombineGetprice*1 + $('#AmongConstitute').datagrid('getData').rows[i]["CombineGetprice"]*1//把合价全部加起来                                                                                                                                                                     }                                                                                sum(); //这也是调用了下面的核算方法                                                                         });                                                                         });                                                       }                            }else{                              alert("代号已有重复,请再次粘贴");                            }                             });                             }else{                                                          alert("请先复制11");                             }        }

//计算定额的总数

  var centreGetPrice=0;           function sum(){                         $('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]=CombineGetprice;//这是把人材机的价格赋值给定额组成的价格              CombineGetprice=0;                $('#CentreConstitute').datagrid('getData').rows[indexdecide]["CombineGetprice"]= $('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]* $('#CentreConstitute').datagrid('getData').rows[indexdecide]["Counts"];               //这是把定额组成的数量和人材机价格乘起来                 $('#CentreConstitute').datagrid('refreshRow',indexdecide);//这是刷新这一行,把数据提取出来              $.getJSON("/ZhongJianDanJia/CentreConstitutesum?Str_BudgetPrice=" +$('#CentreConstitute').datagrid('getData').rows[indexdecide]["BudgetPrice"]+ "&"                                                              +"Int_CenterPriceQuoteComeposeID="+$('#CentreConstitute').datagrid('getSelected').CenterPriceQuoteComeposeID+"&"                                                              +"Str_CombineGetprice="+  $('#CentreConstitute').datagrid('getData').rows[indexdecide]["CombineGetprice"],                                                            function(data){                                                                    //这是把价格增进数据库                                                                     for(var i=0;i< $('#CentreConstitute').datagrid('getData').rows.length;i++){//这是遍历定额组成里面所有合价将其加起来                                                                                                                                                                            centreGetPrice =centreGetPrice +   $('#CentreConstitute').datagrid('getData').rows[i]["CombineGetprice"]*1//这就是把所有合价加起来                                                                                                                                                                        }                                                                              sum_centreGetPrice();//这是调用下面的方法,把价格增进中间列表                                                                                                                           });              $('#CentreConstitute').datagrid('selectRow',indexdecide);//这是选择一行               $('#CentreConstitute').datagrid('beginEdit', indexdecide);//开始编制                 CombineGetprice=0;                         }

//第二步:核算中间单价的价格

 function sum_centreGetPrice(){                     $('#centreGetPrice').datagrid('getData').rows[sum_Index]["BudgetPrice"]=centreGetPrice;//这是把价格赋给中间单间列表的预算价格                     centreGetPrice=0; //赋完值就要清0                         $.getJSON("/ZhongJianDanJia/sum_centreGetPrice?Str_BudgetPrice=" +$('#centreGetPrice').datagrid('getData').rows[sum_Index]["BudgetPrice"]+ "&"                                             +"Int_CenterPriceID="+$('#centreGetPrice').datagrid('getSelected').CenterPriceID+"&",                               function (data) { //中间很好                                       $.getJSON("/ZhongJianDanJia/inquire?Int_BuildProjectID=" + @Session["项目ID"]+ "&",                                        function (data) {                                         $('#centreGetPrice').datagrid('loadData',data);//加载数据给相应的datagrid                                         UnitMingCheng="";GetPriceClassifyMingCheng="";//这是清空数据好用来判断                                        circulate=0;//这是点击事件用来判断下一次执行                                         $('#centreGetPrice').datagrid('selectRow',sum_Index);//这是选中一行                                       });                                });                    $('#CentreConstitute').datagrid('selectRow',indexdecide);  //选中一行           }

上移

  var dex="";         function UpMove(){                    if(dex==""){//这是判断如果它等空,就索引减一                   dex =Index-1;// Index就是点击的索引                 }else{                   dex=dex-1;                                   }                $('#AmongConstitute').datagrid('selectRow',dex)//这就是选中的行                                               }


     下移

 function below(){             if(dex==""){//这就是判断如果它等空,就索引减一                   dex =Index+1;// Index这就是点击的索引                 }else{                   dex=dex+1;                                   }                             $('#AmongConstitute').datagrid('selectRow',dex)//这就是选中的行         }

仅供学习,禁止用于商业用途









0 0
原创粉丝点击