From de072c451bdf8b49efea074e86d129e043e9df6b Mon Sep 17 00:00:00 2001
From: 81041 <81041@DESKTOP-025NVD9>
Date: 星期二, 08 一月 2019 08:50:23 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
---
gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html | 216 ++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 146 insertions(+), 70 deletions(-)
diff --git a/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html b/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html
index f6a02f6..782da9b 100644
--- a/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html
+++ b/gx_tieta/WebRoot/mobil/batt-infor-unapproved-edit.html
@@ -17,51 +17,7 @@
<script src="mobilJs/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>
<script type="text/javascript" src="js/tbl.js"></script>
<script type="text/javascript" src="mobilJs/base.js"></script>
- <script type="text/javascript">
- function creatAllView(num){
- var allString=''
- ,i=0;
- if(num>4){return false}
- for(i=0;i<num;i++){
- allString+=creatBattView(i);
- }
- $("#battdata").html(allString);
- }
-
-
- function creatBattView(index){
- var count=index+1
- ,battTitle='<div>'+'<h1 class="hbg">'+'鐢垫睜缁�'+count+'</h1>'+
- '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'璁惧绱㈠紩'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select>'
- ,allOption=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>'
- ,battName='<tr>'+'<td>'+'鐢垫睜缁勫悕绉�'+'</td>'+'<td>'+'<input type="text" '+'id='+'battname'+index+' data-mini="true"'+'value='+'鐢垫睜缁�'+count+' />'+'</td>'+'</tr>'+'</tbody>'+'</table>'+'</div>';
- return battTitle+allOption+battName;
-
- }
-
- function selectedIndex(index){
- var selected='',
- i=0;
- for(i=0;i<4;i++){
- if(i==index){selected+='<option '+'value='+i+' selected'+'>'+i+'</option>';continue;}
- selected+='<option value='+i+'>'+i+'</option>';
-
- }
-
- return selected;
- }
- var temp = getCookie("eleparm");
- var tempindex = getCookie("eleparmindex");
- var tempnum = getCookie("eleparmnum");
- //console.info(temp);
- temp=JSON.parse(temp);
- tempindex = JSON.parse(tempindex);
- tempnum =JSON.parse(tempnum);
- var suoyin = temp[33];
-
- $(function(){creatAllView(tempindex.length)});
- </script>
- <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
+ <script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
<style type="text/css">
table {
@@ -80,7 +36,7 @@
color: #bdbdbdc4!important;
}
.ui-btn-icon-right {
- padding-right: 8.5em;
+ padding-right: 2em;
}
.hbg{
background-color:#ddd9;
@@ -91,6 +47,15 @@
.ui-select .ui-btn select{
width:77%;
}
+ .ptr0{
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin:0!important;
+ }
+ #newbattnum-button{
+ padding: 1em 1.9em;
+ }
</style>
<link rel="stylesheet" href="css/fgpanel.css">
</head>
@@ -101,7 +66,30 @@
<div data-role="header" data-position="fixed">
<a href="batt-unapproved.html" target="_top" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" style="padding-top: 0.7em; padding-bottom: 0.7em;">杩斿洖</a>
<h1>鏈�氳繃鐢宠淇敼</h1>
-
+ <!-- <div data-role="collapsible" data-type="horizontal" class="ui-btn-right" style="padding-bottom:-0.7em; padding-top:-0.7em;" >
+ <h1 id="alwaysRight">鏂板缓</h1>
+ <div>
+ <h1 class="full-width">
+ <a href="" target="_top" style="text-decoration:none;">1涓數姹犵粍</a>
+ </h1>
+ <h1 class="full-width">
+ <a href="" target="_top" style="text-decoration:none;">2涓數姹犵粍</a>
+ </h1>
+ <h1 class="full-width">
+ <a href="" target="_top" style="text-decoration:none;">3涓數姹犵粍</a>
+ </h1>
+ </div>
+ </div> -->
+ <fieldset data-role="controlgroup" class="ptr0" >
+
+
+ <select id="newbattnum" data-mini="true">
+ <option value=0>鏂板缓鐢垫睜缁�</option>
+
+ </select>
+
+
+ </fieldset>
</div>
<!-- 涓讳綋鍐呭 -->
<div data-role="main">
@@ -180,12 +168,7 @@
<input type="text" id="FBSDeviceName" data-mini="true" />
</td>
</tr>
- <tr>
- <td>鐢垫睜缁処D</td>
- <td>
- <input type="text" readonly unselectable="on" value="123" id="BattGroupId" class="unable" class="uncheck" data-mini="true" />
- </td>
- </tr>
+
<tr>
<td>鏈烘埧鍐呯數姹犵粍缂栧彿</td>
<td>
@@ -321,7 +304,70 @@
</div>
</body>
+<script type="text/javascript">
+ function creatAllView(num){
+ var allString=''
+ ,i=0;
+ if(num>4){return false}
+ for(i=0;i<num;i++){
+ allString+=creatBattView(i);
+ }
+ return $("#battdata").html(allString);
+ }
+
+
+ function creatBattView(index){
+ var count=index+1
+ ,battTitle='<div>'+'<h1 class="hbg">'+'鐢垫睜缁�'+count+'</h1>'+
+ '<table class="layout-set">'+'<tbody>'+'<tr>'+'<td>'+'璁惧绱㈠紩'+'</td>'+'<td>'+'<fieldset data-role="controlgroup" data-type="horizontal">'+'<select>'
+ ,allOption=selectedIndex(index)+'</select>'+'</fieldset>'+'</td>'+'</tr>'
+ ,battName='<tr>'+'<td>'+'鐢垫睜缁勫悕绉�'+'</td>'+'<td>'+'<input type="text" '+'id='+'battname'+index+' data-mini="true"'+'value='+'鐢垫睜缁�'+count+' />'+'</td>'+'</tr>'+'</tbody>'+'</table>'+'</div>';
+ return battTitle+allOption+battName;
+
+ }
+
+ function selectedIndex(index){
+ var selected='',
+ i=0;
+ for(i=0;i<4;i++){
+ if(i==index){selected+='<option '+'value='+i+' selected'+'>'+i+'</option>';continue;}
+ selected+='<option value='+i+'>'+i+'</option>';
+
+ }
+
+ return selected;
+ }
+
+ function creatBa(a){
+ var battnum=4-a,
+ opstring='';
+ if(a>4&&battnum<=0){return false;}
+ for(var i=0;i<=battnum;i++){
+
+ opstring+='<option value='+i+'>鏂板缓'+i+'涓數姹犵粍</option>';
+ }
+ console.warn(opstring+'ttt');
+ return $('#newbattnum').html(opstring);
+ }
+
+ var tempgroupid = getCookie("elegroupid");
+ var temp = getCookie("eleparm");
+ temp = JSON.parse(temp);
+ console.info(temp);
+ var tempgroupid = new Array() ;
+ for(var i=0;i<temp.length;i++){
+ tempgroupid.push(temp[i].binf.BattGroupId);
+ }
+ console.info(tempgroupid);//鐢垫睜缁� ID 鏁扮粍锛岋紙鑻ユ坊鍔狅紝鍒欓渶瑕佹柊寤猴級;
+ var addbattnum = temp.length;
+ $(function(){
+ creatAllView(temp.length).trigger('create');
+ creatBa(temp.length).trigger('create');
+ });
+
+
+ </script>
<script type="text/javascript">
$(function () {
//setTimes($("#startTestrecord"),'2000-01-01');
@@ -346,7 +392,7 @@
document.getElementById("FbsDeviceIp_WG").value = temp[10];
document.getElementById("FBSDeviceName").value = temp[11];
//document.getElementById("GroupIndexInFBSDevice").value = temp[12];
- document.getElementById("BattGroupId").value = temp[13];
+ //document.getElementById("BattGroupId").value = temp[13];
document.getElementById("BattGroupNum").value = temp[14];
//document.getElementById("BattGroupName").value = temp[15];
document.getElementById("FloatVolLevel").value = temp[16];
@@ -368,21 +414,22 @@
setTimes($("#startTestrecord"),temp[30]);
setTimes($("#endTestrecord"),temp[31]);
document.getElementById("install_user").value = temp[32];
- for(var i=0;i<tempindex.length;i++){
+ for(var i=0;i<temp.length;i++){
battname = "#battname"+i;
- $(battname).val(tempindex[i]);
+ //$(battname).val(tempindex[i]);
}
}
// 鏍煎紡鍖栨彁浜ゅ悗鍙颁俊鎭殑瀵硅薄鏁扮粍淇敼
function getUpdateArr(){
var arr = new Array();
- for(var i=0;i<tempindex.length;i++){
+ console.info(addbattnum);
+ for(var i=0;i<addbattnum;i++){
var battString = "#battname"+i;
var index = String(i);
console.info(battString);
var obj = {
- //apply_date : new Date().format("yyyy-MM-dd hh:mm:ss"),
+ apply_date : new Date().format("yyyy-MM-dd hh:mm:ss"),
num : tempnum[i],
binf:{
StationId : $("#StationId").val(), // 鏈烘埧缂栧彿
@@ -399,7 +446,7 @@
FbsDeviceIp_WG : $("#FbsDeviceIp_WG").val(), // 缃戝叧
FBSDeviceName : $("#FBSDeviceName").val(), //璁惧鍚嶇О
GroupIndexInFBSDevice : i, //fbs璁惧绱㈠紩
- BattGroupId : $("#BattGroupId").val(), //鐢垫睜缁刬d
+ BattGroupId : tempgroupid[i], //鐢垫睜缁刬d
BattGroupNum : $("#BattGroupNum").val(), //鏈烘埧鍐呯數姹犵粍缂栧彿
BattGroupName : $(battString).val(),
FloatVolLevel : $("#FloatVolLevel").val(), //娴厖鐢靛帇闃�鍊�
@@ -421,6 +468,7 @@
BattProductDate : $("#startTestrecord").val()+" 00:00:00", //鐢垫睜鐢熶骇鏃ユ湡
BattInUseDate : $("#endTestrecord").val()+" 00:00:00", //鐢垫睜浣跨敤鏃ユ湡
install_user : $("#install_user").val(), //瀹夎浜哄憳
+
}
}
arr.push(obj);
@@ -435,12 +483,7 @@
$(".unable").prop("readonly","readonly").attr("unselectable","on").addClass("uncheck");
$("#sure").click(function(){
editParm();
- /* function backpage(){window.location.href="ele-param1.html";}
- setTimeout(backpage,500);
- });
- $("#cancel").click(function(){
- window.location.href="ele-param1.html";
- */
+
});
});
function editParm(){
@@ -450,7 +493,7 @@
type: "post",
url: "Battinf_applyAction!updatePro",
async:true,
- dataType:'text',
+ dataType:'json',
data:"json="+JSON.stringify(parm),
success: function(data){
data = eval('('+data+')');
@@ -471,13 +514,46 @@
});
}
-
-
-
+
+ function creatBattGroupId(addbattnum){
+ $.ajax({type: "post",
+ url: "BattInfAction!searchMaxBattgroupId",
+ async:true,
+ dataType:'text',
+ data:null,
+ success: function(data){
+ data=JSON.parse(data);
+ data=data.result;
+ data =JSON.parse(data);
+ //console.info(data)
+ var groupid = data.data;
+ //console.info(groupid);
+ //tempgroupid.push(groupid);
+ console.info(tempgroupid);
+ for(var i=tempgroupid.length;i<addbattnum;i++){
+ tempgroupid.push(groupid++);
+ console.info(tempgroupid);
+ }
+ }
+ });
+ }
+
+
+ $('#newbattnum').change(function(){
+ var numbattnum = parseInt($('#newbattnum').val());
+ var index =parseInt(tempindex.length);
+ addbattnum=Math.floor((numbattnum)+(tempindex.length));
+ console.warn(addbattnum);
+ creatAllView(addbattnum).trigger('create');
+ creatBattGroupId(addbattnum);
+ });
+
+
/* 鎿嶄綔鎴愬姛
$('#changeSuc').popup('open');
鎿嶄綔澶辫触
$('#changeErr').popup('open'); */
</script>
-</html>
\ No newline at end of file
+
+</html>
--
Gitblit v1.9.1