formbaseview.jsp 57.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.*" %>
<%@ page import="java.util.*" %>
<%@page import="com.weaver.formmodel.ui.manager.*"%>
<%@page import="com.weaver.formmodel.ui.model.*"%>
<%@page import="com.weaver.formmodel.ui.base.*"%>
<%@page import="com.weaver.formmodel.ui.types.*"%>
<%@page import="com.weaver.formmodel.util.NumberHelper" %>
<%@page import="com.weaver.formmodel.ui.base.model.WebUIResouces" %>
<%@page import="weaver.hrm.*" %>
<%@page import="com.weaver.formmodel.util.StringHelper"%>
<%@page import="weaver.formmode.virtualform.VirtualFormHandler"%>
<%@page import="com.weaver.formmodel.data.model.EntityInfo"%>
<%@page import="com.weaver.formmodel.data.manager.EntityInfoManager"%>
<%@page import="com.weaver.formmodel.mobile.manager.MobileUserInit"%>
<%@page import="com.weaver.formmodel.base.model.PageModel"%>
<%@page import="com.weaver.formmodel.mobile.model.MobileAppModelInfo"%>
<%@page import="com.weaver.formmodel.mobile.manager.MobileAppModelManager"%>
<%@page import="com.weaver.formmodel.mobile.ui.manager.MobileAppUIManager"%>
<%@page import="com.weaver.formmodel.mobile.ui.model.AppFormUI"%>
<%@page import="com.weaver.formmodel.mobile.ui.manager.MobiledeviceManager"%>
<%@page import="com.weaver.formmodel.mobile.ui.model.AppFieldUI"%>
<%@page import="com.weaver.formmodel.mobile.ui.manager.MobileFieldUIManager"%>
<%@page import="weaver.formmode.setup.ModeRightInfoExtend"%>
<%@page import="com.weaver.formmodel.mobile.utils.MobileCommonUtil"%>
<%@page import="com.weaver.formmodel.mobile.types.ClientType"%>
<%@page import="net.sf.json.JSONArray"%>
<%@page import="java.net.URLEncoder"%>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ModeRightInfo" class="weaver.formmode.setup.ModeRightInfo" scope="page" />
<jsp:useBean id="FormInfoService" class="weaver.formmode.service.FormInfoService" scope="page" />
<jsp:useBean id="ModeShareManager" class="weaver.formmode.view.ModeShareManager" scope="page" />
<jsp:useBean id="FormModeRightInfo" class="weaver.formmode.search.FormModeRightInfo" scope="page" />
<jsp:useBean id="xssUtil" class="weaver.filter.XssUtil" scope="page" />
<%@ include file="/mobilemode/mobile/base.jsp"%>
<%
String billid = StringHelper.null2String(request.getParameter("billid"));
String sqlwhere=StringHelper.null2String(request.getParameter("sqlwhere"));

int isdeleted = NumberHelper.string2Int(request.getParameter("isdeleted"),0);
if(isdeleted == 1){
	String script = "<script>" +
			"var _top = null;var _win = window;try{while((_win.parent) != _win){_win = _win.parent;if(_win._mobilemode_root_page == true){_top = _win;break;}}}catch(e){}if(_top == null){_top = _win;}" +
			"if(_top && typeof(_top.backPage) == \"function\"){" +
			" 	var $activeFrame = _top.$(\"#mobileFrameContainer iframe.activeFrame\");"+
			" 	var $prevFrame = $activeFrame.prev(\"iframe.mobileFrame\");"+
			" 	if($prevFrame.length > 0){"+
			"		try{ "+
			"			var frameWin = $prevFrame[0].contentWindow;"+
			"			frameWin.Mobile_NS.refreshList();"+
			"		}catch(e){"+
			"		}"+
			"		try{ "+
			"			var frameWin = $prevFrame[0].contentWindow;"+
			"			frameWin.Mobile_NS.refreshTimelinr();"+
			"		}catch(e){"+
			"		}"+
			"		try{ "+
			"			var frameWin = $prevFrame[0].contentWindow;"+
			"			frameWin.Mobile_NS.GridTable.refresh();"+
			"		}catch(e){"+
			"		}"+
			"	}"+
			"	_top.backPage();" +
			"}"+
			"</script>";
	out.print(script);
	return;
}
String uiid = StringHelper.null2String(request.getParameter("uiid"));
if(StringHelper.isEmpty(uiid)){
	request.getRequestDispatcher("/mobilemode/message.jsp?errorCode=1387").forward(request, response);
	return;
}

MobileAppUIManager mobileAppUIManager = MobileAppUIManager.getInstance();
MobileAppModelManager mobileAppModelManager = MobileAppModelManager.getInstance();

//String clienttype = StringHelper.null2String(request.getParameter("clienttype"));	//当前访问客户端类型 可能的值:Webclient|iphone|ipad|Android
ClientType clienttype = MobileCommonUtil.getClientType(request);
int mobiledeviceid = MobiledeviceManager.getInstance().getDeviceByClienttype(clienttype);

AppFormUI appFormUI = mobileAppUIManager.getByIdAndDeviceid(Util.getIntValue(uiid), mobiledeviceid);

if(appFormUI==null){
	request.getRequestDispatcher("/mobilemode/message.jsp?errorCode=1387").forward(request, response);
	return;
}
int appid = appFormUI.getAppid();
int uitype = appFormUI.getUiType();//0:新建、1:查看、2:编辑、3:列表
MobileAppModelInfo appmodel = mobileAppModelManager.getAppModelInfo(appFormUI.getEntityId());
int modelid = appmodel.getModelId();
int formid=appFormUI.getFormId();

if(billid.trim().equals("") && (uitype == 1 || uitype == 2)){
	request.getRequestDispatcher("/mobilemode/message.jsp?errorCode=1388").forward(request, response);
	return;
}

boolean isRight = false;
boolean isEdit = false;		//是否有编辑权限,主要针对右键按钮是否显示
boolean isDel = false;		//是否有删除权限,主要针对右键按钮是否显示
boolean isVirtualForm=VirtualFormHandler.isVirtualForm(formid);
if(uitype==3){//列表
	isRight=true;
	if(!isVirtualForm){
		//自定义查询列表查看权限
		int customid=appFormUI.getSourceid();
		rs.executeSql("select * from mode_searchPageshareinfo where righttype=1 and pageid = " + customid);
		if(rs.next()){
			FormModeRightInfo.setUser(user);
			isRight = FormModeRightInfo.checkUserRight(customid,1);
		}else{
			//没有设置任何查看权限数据,则认为有权限查看
			isRight = true;
		}
	}
}else{
	//某条数据查看、编辑、删除权限
	int type=0;
	if(uitype==0){
		type=1;
	}else if(uitype==1){
		type=0;
	}else if(uitype==2){
		type=2;
	}
	if(!isVirtualForm){
		int customid = 0;
		ModeRightInfo.setModeId(modelid);
		ModeRightInfo.setType(type);
		ModeRightInfo.setUser(user);
		if(type == 1 || type == 3){//新建、监控权限判断
			//isRight = ModeRightInfo.checkUserRight(type);
			FormModeRightInfo.setUser(user);
			isRight = FormModeRightInfo.checkUserRight(customid,4);
			if(!isRight){  //如果自定义查询页面无监控权限,则检查全局监控权限
				ModeRightInfo.setModeId(modelid);
				ModeRightInfo.setType(type);
				ModeRightInfo.setUser(user);
				
				isRight = ModeRightInfo.checkUserRight(type);
			}
		}

		ModeShareManager.setModeId(modelid);
		int MaxShare = 0;
		if(type == 0 || type == 2){//查看、编辑权限
			String rightStr = ModeShareManager.getShareDetailTableByUser("formmode",user);
			rs.executeSql("select * from "+rightStr+" t where sourceid="+billid);
			if(rs.next()){
				MaxShare = rs.getInt("sharelevel");
				isRight = true;
				if(MaxShare > 1) {
					isEdit = true;		//有编辑或完全控制权限的出现编辑按钮
					if(MaxShare == 3) isDel = true;		//有编辑或者完全控制权限的出现删除按钮
				}
			}
		}
	}else{
		ModeRightInfoExtend modeRightInfoExtend=new ModeRightInfoExtend();
		modeRightInfoExtend.setModeId(modelid);
		modeRightInfoExtend.setUser(user);
		modeRightInfoExtend.setFormid(formid);
		modeRightInfoExtend.setBillid(billid);
		if(type==1){//新建
			isRight = modeRightInfoExtend.checkUserRight(1);
		}else if(type==0||type==2){//查看、编辑时判断是否显示编辑、删除按钮
			isRight=true;//查看权限
			isDel=modeRightInfoExtend.checkUserRightByRightType(3);//完全控制权限
			if(isDel){
				isEdit=true;
			}else{
				isEdit=modeRightInfoExtend.checkUserRightByRightType(2);//编辑权限
			}
		}
	}
}
if(!isRight){
	request.getRequestDispatcher("/mobilemode/message.jsp?errorCode=1389").forward(request, response);
	return;
}

int pageIndex = NumberHelper.string2Int(request.getParameter("pageIndex"), 1);
int pageSize = NumberHelper.string2Int(request.getParameter("pageSize"), 10);

WebUIContext uiContext = new WebUIContext();
uiContext.setClient(com.weaver.formmodel.ui.types.ClientType.CLIENT_TYPE_MOBILE);
uiContext.setBusinessid(billid);
uiContext.setModelid(modelid);
uiContext.setUIType(uitype);
uiContext.setAppid(appid);
uiContext.setCurrentUser(user);
uiContext.setPageNo(pageIndex);
uiContext.setPageSize(pageSize);
uiContext.setSqlwhere(sqlwhere);
uiContext.setAppFormUI(appFormUI);
uiContext.setRequest(request);
WebUIView uiview = WebUIManager.getInstance().getViewContent(uiContext);
int totalPageCount = 0;
int totalSize=0;
PageModel pageModel=null;
if(uitype==3){
	totalPageCount = uiview.getTotalPageCount();;
	totalSize = uiview.getTotalSize();
}

int isShowInTabV = NumberHelper.string2Int(request.getParameter("isShowInTab"), 0);
boolean isShowInTab = isShowInTabV == 1;

List<WebUIResouces> btnResoucesList = uiview.getButtonPageResources();
//boolean isUseIScroll = (uitype == 3);
boolean isUseIScroll = false;
boolean disableDownRefresh = ((uitype == 3) ? false : true);
%>

<HTML><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<title><%=uiview.getUiTitle() %></title>
	<link rel="stylesheet" href="/mobilemode/jqmobile4/css/themes/default/jquery.mobile-1.4.0.min_wev8.css">
	<link rel="stylesheet" href="/mobilemode/css/formbase_wev8.css?v=2017041801">
<style>
html, body{
	background-color: #fff;
}
*{
	font-family: 'Microsoft Yahei', Arial;
	font-size: 12px;
}
.ui-mini .ui-input-text input, .ui-mini .ui-input-search input, .ui-input-text.ui-mini input, .ui-input-search.ui-mini input, .ui-mini textarea.ui-input-text, textarea.ui-mini{
	font-size: 12px;
}
.ui-shadow-inset{
	box-shadow: none;
}
.ui-corner-all{
	border-radius: 0;
	-webkit-border-radius: 0;
}
.ui-btn-corner-all, .ui-btn.ui-corner-all, .ui-slider-track.ui-corner-all, .ui-flipswitch.ui-corner-all, .ui-li-count{
	border-radius: 0;
	-webkit-border-radius: 0;
}
.ui-shadow{
	box-shadow: none;
}
.ui-input-search{
	margin-left: 10px;
	margin-right: 10px;
}
.ui-input-text input, .ui-input-search input, textarea.ui-input-text{

}
.ui-input-text{
	margin: 2px 0;
}
.ui-slider-track{
	border: 0;
}
.ui-slider-track.ui-body-a .ui-btn-active {
	text-shadow: 0;
}
.ui-btn-uploadBtn{
	width: 70px;
	font-size: 12px;
}
.ui-loader{
	top:auto;bottom:200px;background:none;
}
#browserSearchContainer div.ui-input-search{
	display: inline-block;
}
		
.ui-filterable{
	position: relative;
}
.expandBtnDiv{
	border: 1px solid rgb(221, 221, 221);
	display: inline-block;
	position: absolute;
	top: 0px;
	right: 10px;
	height: 26px;
	line-height: 26px;
	background-color: #fff;
}
.expandBtnDivHasMore{
	padding-right: 25px;
}
.expandBtnDiv .text{
	padding: 0px 8px 0px 8px;
	display: inline-block;
	cursor: pointer;
}
.expandBtnDiv .moreFlag{
	position: absolute;
	top: 0px;
	right: 0px;
	width: 25px;
	height: 26px;
	display: none;
	background-image: url("/mobilemode/images/homepage/homepage_bottom_wev8.jpg");
	background-repeat: no-repeat;
	background-position: center center;
	cursor: pointer;
}
.expandBtnDivHasMore .moreFlag{ 
	display: block;
}
.expandBtnDivMore{
	background-color: #fff;
	border: 1px solid rgb(221, 221, 221);
	position: absolute;
	z-index: 1000;
	top:35px;
	right: 10px;
	display: none;
}
.expandBtnDivMore ul{
	list-style: none;
	margin: 0px;
	padding: 0px;
}
.expandBtnDivMore ul li{
	height: 32px;
	padding: 0px 33px 0px 8px;
	line-height: 32px;
	border-bottom: 1px solid rgb(221, 221, 221);
	cursor: pointer;
}
.expandBtnDivMore ul li:HOVER {
	background-color: rgb(93, 156, 236);
	color: #fff;
}
.nodata_border{
	background: #f6f6f6;
	padding-top: 10px;
	padding-bottom: 10px;
	margin: 8px 0;
	text-shadow: 0 1px 0 #f3f3f3;
	font-family: sans-serif;
	color: #333;
	font-weight: 700;
	overflow: hidden;
	cursor: pointer;
	border-width: 1px;
	border-style: solid;
	border-radius: 4.96px;
	border-color: #ddd;
	box-shadow: none;
}
.nodata_content{
	position: relative;
	height: 22px;
	line-height: 22px;
	padding-left: 26px;
	white-space: nowrap;
	text-align: center;
	width:150px;
	margin:0 auto;
	font-size: 16px;
}
.nodata_img{
	position: absolute;
	left: 0;
	width: 22px;
	height:22px;
	background-color: rgba(0,0,0,.3);
	border-radius: 1em;
	background-image: url('data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M7%2C0C3.134%2C0%2C0%2C3.134%2C0%2C7s3.134%2C7%2C7%2C7s7-3.134%2C7-7S10.866%2C0%2C7%2C0z%20M7%2C2c0.552%2C0%2C1%2C0.447%2C1%2C1S7.552%2C4%2C7%2C4S6%2C3.553%2C6%2C3%20S6.448%2C2%2C7%2C2z%20M9%2C11H5v-1h1V6H5V5h3v5h1V11z%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E');
	background-repeat: no-repeat;
	background-position: 4px;
}
td.promptValidateFail{
	background-color: yellow !important;
}
.isManPrompt{
	background-image: url(/mobilemode/images/isman_wev8.png);
	background-repeat: no-repeat;
	background-size: 7px 6px;
	background-position: 5px center;
}
.addtable{
	display: none;
	position: fixed;
	top: 0px;
	left: 0px;
	bottom: 0px;
	right:0px;
	z-index: 999;
}
.addtableInner{
	max-height:80%;
	overflow-y:auto ;
	position: absolute;
	left: 0px;
	bottom: 35px;
	right:0px;
	background-color: #fff;
	-webkit-transition: -webkit-transform 0.3s;
	transition: transform 0.3s;
}
.addtableInner.hide{
	-webkit-transform: translate3d(0, 100%, 0);
	transform: translate3d(0, 100%, 0);
}
.form_detail_back{
	position: absolute;
    overflow: hidden;
    left: 0px;
    bottom: 0px;
    width: 100%;
    background: #fff;
}
.form_detailbuttonStyle{
	float:right;
	width: 25px;
	height: 15px;
	line-height: normal;
	text-align:center;
	font-size: 12px;
	cursor:pointer;
	padding: 5px 10px;
	text-shadow: none;
	margin-right: 5px;
	margin-bottom: 5px;
	margin-top: 5px;
}
.addtableMask{
 	width:100%;height:100%;
 	background-color: #000;
	opacity: 0;
	-webkit-transition: opacity .282s ease-in-out;
	transition: opacity .282s ease-in-out;
}
.addtableMask.show{
	opacity: 0.4;
}
.divoverflow{
	width:100%;
	 margin-top:10px;
	overflow-x:auto;
	-webkit-overflow-scrolling:touch;
}
.entrydel{
	display: none;
}
</style>
<script src="/mobilemode/jqmobile4/js/jquery_wev8.js"></script>
<script src="/mobilemode/jqmobile4/js/jquery.mobile-1.4.0.min_wev8.js"></script>
<script src="/mobilemode/js/lazyload/jquery.lazyload.min_wev8.js"></script>
<link type="text/css" rel="stylesheet" href="/mobilemode/js/mobiscroll/css/mobiscroll-2.5.2-min.css"/>
<script type="text/javascript" src="/mobilemode/js/mobiscroll/mobiscroll-2.5.2-min.js"></script>

<script type="text/javascript">
var _top = null;var _win = window;try{while((_win.parent) != _win){_win = _win.parent;if(_win._mobilemode_root_page == true){_top = _win;break;}}}catch(e){}if(_top == null){_top = _win;}
//默认值触发字段联动
function defaultValueLinkage(groupid){
	//浏览框类型
	fieldBrowserLinkfn(groupid);
	var $objs;
	if(groupid != undefined){
		var $container = $("#detaildiv"+groupid);
		$objs = $("input[id^=field],textarea[id^=field],select[id^=field]",$container);
	}else{
		$objs = $("input[id^=field],textarea[id^=field],select[id^=field]");
	}
	if($objs && $objs.length){
		$objs.each(function(){
			var that = $(this);
			var fieldid = that.attr("id").substring(5);
			var bid = that.attr("bid");
			var value = that.val();
			//非浏览框
			if(!bid && value){
				if(that.hasClass("field_select")){
					//选择框
					fieldLinkfn(this);
				}else{
					//字段联动-单行文本框、多行文本框、Check框
					textLinkage(fieldid);
				}
			}
		});
	}
}
//字段联动-单行文本框、多行文本框、Check框
function textLinkage(fieldid){
	var textValue = $("#field" + fieldid).val();
	var result = {"name" : textValue, "value" : textValue};
	
	//触发联动
	readyToTrigger(fieldid, result);
}

function getValueByKey(jsonObj, key){
	var value = "";
	for(var k in jsonObj){
		if(k.toLowerCase() == key.toLowerCase()){
			value = jsonObj[k];
		}
	}
	
	return value;
}
//执行SQL
function SQL(sqlstr, datasource, callbackFn){
	sqlstr = encodeURIComponent(sqlstr);
	if(!datasource){
		datasource = "";
	}
	var asyncFlag = false;
	/* if(typeof(callbackFn) == "function"){
		asyncFlag = true;
	} */
	var result = "";
	 $.ajax({
	 	type: "GET",
	 	contentType: "application/json",
	 	url: jionActionUrl("com.weaver.formmodel.mobile.security.EDAction", "action=runSQL"),
	 	data: "&content="+sqlstr+"&datasource="+datasource,
	 	async: asyncFlag,
	 	success: function(responseText, textStatus) 
	 	{
	 		var data = $.parseJSON(responseText);
	 		var status = data["status"];
	 		if(status != "-1"){	//server端没有出现未知异常
	 			result = data["result"];
	 		}
	 		if(typeof(callbackFn) == "function"){
	 			callbackFn.call(this, result);
	 		}
	 	},
	    error: function(){
	    	//alert("error");
	    }
	});
	return result;
}
</script>

<link type="text/css" rel="stylesheet" href="/mobilemode/css/browser_wev8.css"/>
<script type="text/javascript" src="/mobilemode/js/browser_wev8.js?v=2016112901"></script>
<script type="text/javascript" src="/mobilemode/js/formbaseview_wev8.js?v=201611291644"></script>
<script type="text/javascript" src="/mobilemode/js/fieldsLinkage_wev8.js?v=2017062901"></script>
<script type="text/javascript" language="javascript" src="/formmode/js/jquery/aop/jquery.aop.min_wev8.js"></script>
<script type="text/javascript" language="javascript" src="/formmode/js/json2_wev8.js"></script>
<script type="text/javascript" language="javascript" src="/mobilemode/js/FieldPrompt_wev8.js"></script>

<%if(isUseIScroll){ %>
	<script type="text/javascript">
		var disableDownRefresh = <%=disableDownRefresh%>;
	</script>
	<script type="text/javascript" src="/mobilemode/js/iscroll/iscroll5_wev8.js"></script>
	<script type="text/javascript" src="/mobilemode/js/iscroll/iScrollHandler_wev8.js"></script>
	<link type="text/css" rel="stylesheet" media="all" href="/mobilemode/css/iScroll_wev8.css" />
<%}else{%>
	<style>
	html, body {
	    overflow: hidden;
	    margin: 0;
	}
	#myPage{
		position: absolute;
		top: 0px;
		left: 0px;
		bottom: 0px;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		-webkit-overflow-scrolling:touch;
		min-height: 382px !important;
	}
	</style>
<%} %>

<%=uiview.getResLink() %>
<script type="text/javascript">
	function downloadattach(fileid,filename){
		top.location.href = "/download.do?fileid="+fileid+"&module=3&scope=11&filename="+encodeURI(filename)+"";
		if(_top && typeof(_top.hideLoading) == "function"){
			_top.hideLoading();
		}
		var e=event || window.event;
	    if (e && e.stopPropagation){
	        e.stopPropagation();    
	    }
	    else{
	        e.cancelBubble=true;
	    }
	}
	
	//显示加载器
	function showLoader() {
	    //显示加载器.for jQuery Mobile 1.2.0
	    $.mobile.loading('show', {
	        text: <%=MobileCommonUtil.getHtmlLabelName(124820,user.getLanguage(),"正在加载中...")%>, //加载器中显示的文字
	        textVisible: true, //是否显示文字
	        theme: 'a',        //加载器主题样式a-e
	        textonly: false,   //是否只显示文字
	        html: ""           //要显示的html内容,如图片等
	    });
	}
	
	//隐藏加载器.for jQuery Mobile 1.2.0
	function hideLoader()
	{
	    //隐藏加载器
	    $.mobile.loading('hide');
	}
	
	function callbackUpload(name,data,fieldid) {
		if(fieldid){
			var $uploadname = $('#uploadname'+fieldid);
			$uploadname.val('');
			var $uploaddata = $('#uploaddata'+fieldid);
			$uploaddata.val('');
			if(name){ 
				$uploadname.val(name);
			}
			if(data){
				$uploaddata.val(data);
			}
		
			var uploadKey = data.substring("emobile:upload:".length);
			var url = "/client.do?method=getupload&uploadID="+uploadKey;
			var $entryImg = $("<div class=\"field_upload_entryImg\"><img src=\""+url+"\"></img></div>");
			var $entryDelete = $("<div class=\"field_upload_deleteBtn\"></div>");
			var $entry = $("<div class=\"field_upload_entry\"></div>");
			$entry.append($entryImg).append($entryDelete);
			var $entryBtn = $("#entryBtn"+fieldid);
			var $entryWrap = $("#entryWrap" + fieldid);
			$entryWrap.children().remove();
			$entryWrap.append($entry).append($entryBtn);
			
			$entryDelete.click(function(){
				delUpload(this, fieldid); 
			});
		}
	}
	
	function delUpload(obj,fieldid,docid){
		var str="";
		var strAry=$("#field" + fieldid).val().split(",");
		for(i=0;i<strAry.length;i++){
			if(strAry[i]!=docid){
				str = str+strAry[i]+","
			}			
		}
		str = str.substring(0,str.length-1);
		$("#field" + fieldid).val(str);
		$(obj).parent().remove();
	}
	
	function clearUpload(fieldid) {
		$("#field" + fieldid).val("");
		var $entryBtn = $("#entryBtn"+fieldid);
		var $entryWrap = $("#entryWrap" + fieldid);
		$entryWrap.children().remove();
		$entryWrap.append($entryBtn);
	}
	
	function addUpload(e, fieldid) {
		if(_top && typeof(_top.registUploadWindow) == "function"){
			_top.registUploadWindow(window);
		}
		location = "emobile:upload:callbackUpload:"+fieldid+":"+e.clientY+":clearUpload";
	}
	
	function addUpload1(fieidid){
	if(fieidid){
	var file = document.getElementById("file"+fieidid);
		if(file.files && file.files[0]){
			var reader = new FileReader();
		   	reader.onload = function(evt){
				
				var $field = $("#photoField"+fieidid);
				var fieldArray = $field.val().split(",");
				var fieldNum = parseInt(fieldArray[0]);
				fieldNum += 1;
				var fieldStr = fieldNum+","+ fieidid;
				$field.val(fieldStr);
				
				var temp = 0;
				$("input[type='file']", "#entryWrap"+fieidid).each(function(){
					if($(this).attr("fileNum") > temp){
						temp = $(this).attr("fileNum");
					}
				});
				
				++temp;
				var $file = $("#file"+fieidid);
				$file.attr("name","file"+fieidid+(temp));
				$file.attr("id","file"+fieidid+(temp));
				$file.attr("fileNum",(temp));
				$file.css("display","none");
				var $entryImg = $("<div class=\"field_upload_entry\"><img src=\""+evt.target.result+"\"></img></div>");
				var $entryDelete = $("<div class=\"field_upload_DeleteBtn\"></div>");
				var $entryBorder = $("<div class=\"field_upload_entryBorder\"></div>");
				$entryBorder.append($entryImg).append($entryDelete).append($file);
				$("#photoBorder"+fieidid).before($entryBorder);
				
				$entryDelete.click(function(){
					$(this).parent().remove();
				});
				
				var $originalFile = $("<input id=\"file"+fieidid+"\" type=\"file\" name=\"file\" fileNum=\"0\" class=\"upLoadFile\" accept=\"image/jpg,image/jpeg,image/png,image/gif\" single=\"single\"  onchange=\"addUpload1('"+fieidid+"');\" data-role=\"none\"/>");
				$("#entryBtn"+fieidid).append($originalFile);
				//refreshIScroll();
				$originalFile.focus();
		   	}
		   	reader.readAsDataURL(file.files[0]);
		}
	}
}
	
	function addUploadattach(fieidid){
		if(fieidid){
		var file = document.getElementById("file"+fieidid);
			if(file.files && file.files[0]){
				var filefullname = file.files[0].name;
				var splitpoint = filefullname.lastIndexOf(".");
				var filename = filefullname.substring(0, splitpoint);
				var filetype = filefullname.substring(splitpoint + 1);
				
				var imagesrc = "";
				if(filetype.toLowerCase() == "jpg" || filetype.toLowerCase() == "jpeg" || filetype.toLowerCase() == "png" || filetype.toLowerCase() == "gif" || filetype.toLowerCase() == "bmp") {
					imagesrc = "/mobilemode/images/icon/jpg_wev8.png";
				}else if(filetype.toLowerCase() == "doc" || filetype.toLowerCase() == "docx") {
					imagesrc = "/mobilemode/images/icon/doc_wev8.png";
				}else if(filetype.toLowerCase() == "xls" || filetype.toLowerCase() == "xlsx") {
					imagesrc = "/mobilemode/images/icon/xls_wev8.png";
				}else if(filetype.toLowerCase() == "pdf") {
					imagesrc = "/mobilemode/images/icon/pdf_wev8.png";
				}else if(filetype.toLowerCase() == "htm" || filetype.toLowerCase() == "html") {
					imagesrc = "/mobilemode/images/icon/html_wev8.png";
				}else if(filetype.toLowerCase() == "ppt") {
					imagesrc = "/mobilemode/images/icon/ppt_wev8.png";
				}else {
					imagesrc = "/mobilemode/images/icon/txt_wev8.png";
				}
				
				var filesize = file.files[0].size;
            	var showfilesize = "";
            	if(filesize>=(1024 * 1024)){
            		showfilesize = (filesize / 1024 / 1024).toFixed(2) + "M";
            	} else if(filesize>=1024){
            		showfilesize = Math.floor(filesize / 1024) + "K";
            	} else{
            		showfilesize = filesize+ "B";
            	}
				
				var reader = new FileReader();
			   	reader.onload = function(evt){
					
					var $field = $("#photoField"+fieidid);
					var fieldArray = $field.val().split(",");
					var fieldNum = parseInt(fieldArray[0]);
					fieldNum += 1;
					var fieldStr = fieldNum+","+ fieidid;
					$field.val(fieldStr);
					
					var temp = 0;
					$("input[type='file']", "#entryWrap"+fieidid).each(function(){
						if($(this).attr("fileNum") > temp){
							temp = $(this).attr("fileNum");
						}
					});
					
					++temp;
					var $file = $("#file"+fieidid);
					$file.attr("name","file"+fieidid+(temp));
					$file.attr("id","file"+fieidid+(temp));
					$file.attr("fileNum",(temp));
					$file.css("display","none");
					var $attach_upload_entry = 
						$("<div class=\"attach_upload_entry\">" +
								"<table style=\"width: 100%; table-layout: fixed;\">" +
									"<tr>" +
										"<td class=\"icon\"><img width=\"20\" height=\"20\" src=\"" + imagesrc + "\"></td>" +
										"<td class=\"name\">" + filefullname + "</td>" +
										"<td class=\"size\">" + showfilesize + "</td>" +
										"<td class=\"flag\"><img width=\"20\" height=\"20\" src=\"/mobilemode/images/mec/arrow_right_wev8.png\"></td>" +
									"</tr>" +
								"</table>" +
							"</div>");
					var $attach_upload_DeleteBtn = $("<div class=\"attach_upload_DeleteBtn\"></div>");
					var $attach_upload_entryborder = $("<div class=\"attach_upload_entryborder\" style=\"padding-right: 30px;\"></div>");
					$attach_upload_entryborder.append($attach_upload_entry).append($attach_upload_DeleteBtn).append($file);
					
					$("#attachBorder"+fieidid).before($attach_upload_entryborder);
					
					$attach_upload_DeleteBtn.click(function(){
						$(this).parent().remove();
					});
					
					var $originalFile = $("<input id=\"file"+fieidid+"\" type=\"file\" name=\"file\" fileNum=\"0\" class=\"upLoadFile\" single=\"single\"  onchange=\"addUploadattach('"+fieidid+"');\" data-role=\"none\"/>");
					$("#entryBtn"+fieidid).append($originalFile);
					//refreshIScroll();
					$originalFile.focus();
			   	}
			   	reader.readAsDataURL(file.files[0]);
			}
		}
	}
	
	//附件行编辑(附件)
	function addattachtoedit(fieidid,rownum){
		$("a", "#entryWrap"+fieidid+"_"+rownum).each(function(){
			var $attach_upload_entryborder = $("<div class=\"attach_upload_entryborder\" style=\"padding-right: 30px;\"></div>");
			var attachid = $(this).attr("attachid");
			var docid = $(this).attr("docid");
			$attach_upload_entryborder.append($(this).clone()).append("<div class=\"attach_upload_DeleteBtn\" onclick=\"delUpload(this, '"+fieidid+"','"+docid+"');\"></div>");
			$("#attachBorder"+fieidid).before($attach_upload_entryborder);
		});
		
		var temp = 0;
		$("input[type='file']", "#entryWrap"+fieidid+"_"+rownum).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
		});
		for(var i = 1;  i <= temp; i++){
			var $attach_upload_entryborder =$("<div class=\"attach_upload_entryborder\" style=\"padding-right: 30px;\"></div>");
			var $field_upload_entry = $("#file"+fieidid+"_"+rownum+i).parent(".attach_upload_entryborder").children(".attach_upload_entry").clone();
			var $file = $("#file"+fieidid+"_"+rownum+i);
			$file.attr("name","file"+fieidid+i);
			$file.attr("id","file"+fieidid+i);
			var $entryDelete = $("<div class=\"attach_upload_DeleteBtn\"></div>");
			$attach_upload_entryborder.append($field_upload_entry).append($entryDelete).append($file);
			$("#attachBorder"+fieidid).before($attach_upload_entryborder);
			$entryDelete.click(function(){
				//$(this).parent().remove();
				$(this).parent().addClass("entrydel");
			});
		}
		$("#photoField"+fieidid).val(temp+","+fieidid);
		$("#field"+fieidid).val($("#field"+fieidid+"_"+rownum).val());
	}
	
	//附件行编辑(图片)
	function addimgtoedit(fieidid,rownum){
		$("img", "#entryWrap"+fieidid+"_"+rownum).each(function(){
			if(typeof($(this).attr("docid"))!="undefined"){
				var $attach_upload_entryborder = $("<div class=\"field_upload_entryBorder\"></div>");
				var $field_upload_entry = $("<div class=\"field_upload_entry\"></div>");
				$(this).removeAttr("data-groupev");
				var attachid = $(this).attr("attachid");
				var docid = $(this).attr("docid");
				$field_upload_entry.append($(this).clone());
				$attach_upload_entryborder.append($field_upload_entry).append("<div class=\"field_upload_DeleteBtn\" onclick=\"delUpload(this, '"+fieidid+"','"+docid+"');\"></div>");
				$("#photoBorder"+fieidid).before($attach_upload_entryborder);
			}
		});
		
		var temp = 0;
		$("input[type='file']", "#entryWrap"+fieidid+"_"+rownum).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
		});
		for(var i = 1;  i <= temp; i++){
			var $attach_upload_entryborder = $("<div class=\"field_upload_entryBorder\"></div>");
			var $field_upload_entry = $("#file"+fieidid+"_"+rownum+i).parent(".field_upload_entryBorder").children(".field_upload_entry").clone();
			var $file = $("#file"+fieidid+"_"+rownum+i);
			$file.attr("name","file"+fieidid+i);
			$file.attr("id","file"+fieidid+i);
			var $entryDelete = $("<div class=\"field_upload_DeleteBtn\"></div>");
			$attach_upload_entryborder.append($field_upload_entry).append($entryDelete).append($file);
			$("#photoBorder"+fieidid).before($attach_upload_entryborder);
			$entryDelete.click(function(){
				//$(this).parent().remove();
				$(this).parent().addClass("entrydel");
			});
		}
		$("#photoField"+fieidid).val(temp+","+fieidid);
		$("#field"+fieidid).val($("#field"+fieidid+"_"+rownum).val());
		Mobile_NS.groupViewImg();	
	}
	
	//附件添加行,确定(附件)
	function doaddattachobj(fieidid,rownum){
		var $entryWrap = $("#entryWrap"+fieidid+"_"+rownum);
		var temp = 0;
		$("input[type='file']", "#entryWrap"+fieidid).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
		});
		
		for(var i = 1;  i <= temp; i++){
			var $field_upload_entry = $("#file"+fieidid+i).parent(".attach_upload_entryborder").children(".attach_upload_entry");
			var $file = $("#file"+fieidid+i);
			$file.attr("name","file"+fieidid+"_"+rownum+i);
			$file.attr("id","file"+fieidid+"_"+rownum+i);
			$file.attr("isold","1");
			var $attach_upload_entryborder = $("<div class=\"attach_upload_entryborder\"></div>");
			$attach_upload_entryborder.append($field_upload_entry).append($file).append("<div id=\"addfile"+fieidid+"_"+rownum+i+"\"></div>");
			$entryWrap.append($attach_upload_entryborder);
		}
		var $fieldobj = $("#field"+fieidid);
			$fieldobj.attr("name","field"+fieidid+"_"+rownum);
			$fieldobj.attr("id","field"+fieidid+"_"+rownum);
		var $photoField = $("#photoField"+fieidid);
			$photoField.attr("name","photoField"+fieidid+"_"+rownum);
			$photoField.attr("id","photoField"+fieidid+"_"+rownum);
			$photoField.val(temp+","+fieidid+"_"+rownum);
		$entryWrap.append($fieldobj).append($photoField);	
	}
	
	//附件添加行,确定(图片)
	function doaddimgobj(fieidid,rownum){
		var $entryWrap = $("#entryWrap"+fieidid+"_"+rownum);
		var temp = 0;
		$("input[type='file']", "#entryWrap"+fieidid).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
		});
		
		for(var i = 1;  i <= temp; i++){
			var $field_upload_entry = $("#file"+fieidid+i).parent(".field_upload_entryBorder").children(".field_upload_entry");
			var $file = $("#file"+fieidid+i);
			$file.attr("name","file"+fieidid+"_"+rownum+i);
			$file.attr("id","file"+fieidid+"_"+rownum+i);
			$file.attr("isold","1");
			var $attach_upload_entryborder = $("<div class=\"field_upload_entryBorder\"></div>");
			$attach_upload_entryborder.append($field_upload_entry).append($file).append("<div id=\"addfile"+fieidid+"_"+rownum+i+"\"></div>");
			$entryWrap.append($attach_upload_entryborder);
		}
		var $fieldobj = $("#field"+fieidid);
			$fieldobj.attr("name","field"+fieidid+"_"+rownum);
			$fieldobj.attr("id","field"+fieidid+"_"+rownum);
		var $photoField = $("#photoField"+fieidid);
			$photoField.attr("name","photoField"+fieidid+"_"+rownum);
			$photoField.attr("id","photoField"+fieidid+"_"+rownum);
			$photoField.val(temp+","+fieidid+"_"+rownum);
		$entryWrap.append($fieldobj).append($photoField);	
	}
	
	//附件编辑行,确定(附件)
	function doeditattachobj(fieidid,rownum){
		$(".entrydel").remove();
		$("#field"+fieidid+"_"+rownum).remove();
		$("#entryWrap"+fieidid+"_"+rownum).children().remove();
		//已经存在的附件
		var $entryWrap = $("#entryWrap"+fieidid+"_"+rownum);
		$("#entryWrap"+fieidid+" a").each(function(){
			var $attach_upload_entryborder =$("<div class=\"attach_upload_entryborder\"></div>");
			$attach_upload_entryborder.append($(this));
			$entryWrap.append($attach_upload_entryborder);
		});
		
		//添加的附件
		var temp = 0;
		$("input[type='file']", "#entryWrap"+fieidid).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
		});
		
		for(var i = 1;  i <= temp; i++){
			var $field_upload_entry = $("#file"+fieidid+i).parent(".attach_upload_entryborder").children(".attach_upload_entry");
			var $file = $("#file"+fieidid+i);
			$file.attr("name","file"+fieidid+"_"+rownum+i);
			$file.attr("id","file"+fieidid+"_"+rownum+i);
			$file.attr("isold","1");
			var $attach_upload_entryborder = $("<div class=\"attach_upload_entryborder\"></div>");
			$attach_upload_entryborder.append($field_upload_entry).append($file).append("<div id=\"addfile"+fieidid+"_"+rownum+i+"\"></div>");
			$entryWrap.append($attach_upload_entryborder);
		}
		
		var $fieldobj = $("#field"+fieidid);
			$fieldobj.attr("name","field"+fieidid+"_"+rownum);
			$fieldobj.attr("id","field"+fieidid+"_"+rownum);
		var $photoField = $("#photoField"+fieidid);
			$photoField.attr("name","photoField"+fieidid+"_"+rownum);
			$photoField.attr("id","photoField"+fieidid+"_"+rownum);
			$photoField.val(temp+","+fieidid+"_"+rownum);
		$entryWrap.append($fieldobj).append($photoField);
	}
	
	//附件编辑行,确定(图片)
	function doeditimgobj(fieidid,rownum){
		$(".entrydel").remove();
		$("#field"+fieidid+"_"+rownum).remove();
		$("#entryWrap"+fieidid+"_"+rownum).children().remove();
		//已经存在的附件
		var $entryWrap = $("#entryWrap"+fieidid+"_"+rownum);
		$("#entryWrap"+fieidid+" img").each(function(){
			if(typeof($(this).attr("docid"))!="undefined"){
				var $attach_upload_entryborder = $("<div class=\"field_upload_entryBorder\"></div>");
				var $field_upload_entry = $("<div class=\"field_upload_entry\"></div>");
				$field_upload_entry.append($(this));
				$attach_upload_entryborder.append($field_upload_entry);
				$entryWrap.append($attach_upload_entryborder);
			}
		});
		
		//添加的附件
		var temp = 0;
		$("input[type='file']", "#entryWrap"+fieidid).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
		});
		
		for(var i = 1;  i <= temp; i++){
			var $field_upload_entry = $("#file"+fieidid+i).parent(".field_upload_entryBorder").children(".field_upload_entry");
			var $file = $("#file"+fieidid+i);
			$file.attr("name","file"+fieidid+"_"+rownum+i);
			$file.attr("id","file"+fieidid+"_"+rownum+i);
			$file.attr("isold","1");
			var $attach_upload_entryborder = $("<div class=\"field_upload_entryBorder\"></div>");
			$attach_upload_entryborder.append($field_upload_entry).append($file).append("<div id=\"addfile"+fieidid+"_"+rownum+i+"\"></div>");
			$entryWrap.append($attach_upload_entryborder);
		}
		var $fieldobj = $("#field"+fieidid);
			$fieldobj.attr("name","field"+fieidid+"_"+rownum);
			$fieldobj.attr("id","field"+fieidid+"_"+rownum);
		var $photoField = $("#photoField"+fieidid);
			$photoField.attr("name","photoField"+fieidid+"_"+rownum);
			$photoField.attr("id","photoField"+fieidid+"_"+rownum);
			$photoField.val(temp+","+fieidid+"_"+rownum);
		$entryWrap.append($fieldobj).append($photoField);
	}
	
	//附件编辑行,取消(附件)
	function addRowbacktoattach(fieidid,rownum){
		var temp = 0;
		$("input[type='file'][isold='1']", "#entryWrap"+fieidid).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
			var fileNum = $(this).attr("fileNum");
			var $file = $("#file"+fieidid+fileNum);	
			$file.attr("name","file"+fieidid+"_"+rownum+fileNum);
			$file.attr("id","file"+fieidid+"_"+rownum+fileNum);
			var $addfile = $("#addfile"+fieidid+"_"+rownum+fileNum);
			$addfile.before($file);
		});
		var $photoField = $("#photoField"+fieidid);
				$photoField.attr("name","photoField"+fieidid+"_"+rownum);
				$photoField.attr("id","photoField"+fieidid+"_"+rownum);
				$photoField.val(temp+","+fieidid+"_"+rownum);
	}
	
	//附件编辑行,取消(图片)
	function addRowbacktoimg(fieidid,rownum){
		var temp = 0;
		$("input[type='file'][isold='1']", "#entryWrap"+fieidid).each(function(){
			if($(this).attr("fileNum") > temp){
				temp = $(this).attr("fileNum");
			}
			var fileNum = $(this).attr("fileNum");
			var $file = $("#file"+fieidid+fileNum);	
			$file.attr("name","file"+fieidid+"_"+rownum+fileNum);
			$file.attr("id","file"+fieidid+"_"+rownum+fileNum);
			var $addfile = $("#addfile"+fieidid+"_"+rownum+fileNum);
			$addfile.before($file);
		});
		var $photoField = $("#photoField"+fieidid);
				$photoField.attr("name","photoField"+fieidid+"_"+rownum);
				$photoField.attr("id","photoField"+fieidid+"_"+rownum);
				$photoField.val(temp+","+fieidid+"_"+rownum);
	}
	
	var isBeScrolling = false;
	function openDetail(url){
		if(isBeScrolling){
			return;
		}
		if(_top && typeof(_top.openUrl) == "function"){
			_top.openUrl(url);
		}else{
			location.href = url;
		}
	}
	
	function onBack(){
		if(_top && typeof(_top.backPage) == "function"){
			_top.backPage();
		}
	}
	
	var pageIndex=<%=pageIndex%>;
	var totalPageCount=<%=totalPageCount%>;
	var fieldsJsonArray = [];
	$(document).ready(function(){
		//新建编辑时,给必填字段添加一个标记
		<%if(uitype == 0 || uitype == 2){%>
			$("input[ismust='true']").each(function(){
				if($(this).parents("tr").find(".field_label").length > 0){
					$(this).parents("tr").find(".field_label").addClass("isManPrompt");
				}else{
					$(this).parents("tr").find(".field_label_colspan").addClass("isManPrompt");
				}
				var id = $(this).attr("id");
				fieldsJsonArray.push(id);
			});
			$("select[ismust='true']").each(function(){
				$(this).parents("tr").find(".field_label").addClass("isManPrompt");
				var id = $(this).attr("id");
				fieldsJsonArray.push(id);
			});
			$("textarea[ismust='true']").each(function(){
				$(this).parents("tr").find(".field_label_colspan").addClass("isManPrompt");
				var id = $(this).attr("id");
				fieldsJsonArray.push(id);
			});
		<%}%>
		
		// 新建布局,字段默认值联动
		<%if(uitype == 0){%>
			defaultValueLinkage();
		<%}%>  

	   $("#moreListData").click(function(){
			if(pageIndex<totalPageCount){
				if(typeof(_top.lockPage) == "function"){
					_top.lockPage();
				}
				showLoader();
				
				var locationSearch = location.search;
				if(locationSearch.indexOf("?") > -1) {  
					locationSearch = locationSearch.substring(1,locationSearch.length);
				}
				var requestParams = "action=getListData&uiid=<%=appFormUI.getId()%>&sqlwhere=<%=xssUtil.put(sqlwhere)%>&pageSize=<%=pageSize%>&pageIndex=" +(pageIndex+1);
				if(locationSearch != ""){
					requestParams += "&"+locationSearch;
				} 
				var url = jionActionUrl("com.weaver.formmodel.ui.servlet.WebUIViewAction",requestParams);
				$.post(url, null,
	  				function(data){
						pageIndex+=1;
						if(pageIndex==totalPageCount){
							$("#moreListData").hide();
						}
						$("#myPage").trigger("create");
						var $listContainer = $("#frmmain > ul");
						var $pageObj = $(data)
						$listContainer.append($pageObj);
				        $listContainer.listview('refresh');
				        hideLoader();
				        $("img.lazy", $pageObj).lazyload({
							container : "#myPage"
						});
				        //refreshIScroll();
				        
				        if(parent && typeof(parent.changeFrameHeightByScrollHeight) == "function"){
				        	parent.changeFrameHeightByScrollHeight();
				        }else{
				        	if(_top && typeof(_top.resetActiveFrame) == "function"){
								_top.resetActiveFrame();
							}
				        }
						
						//触发查询
						var $searchText = $listContainer.prev().find("input[data-type='search']");
						if($searchText.val() != ""){
							$searchText.attr("data-lastval", "");
							$searchText.keyup();
						}
						
						if(typeof(_top.lazyReleasePage) == "function"){
				    		_top.lazyReleasePage();
				    	}
				    	
				    	Mobile_NS.groupViewImg();
	  				});
			}					
	    });	    
	   
		<%if(uitype == 3 && !btnResoucesList.isEmpty()){ //列表扩展按钮%>   
			var $uiFilterable = $('ul').prev();
			var $listSearchContainer = $uiFilterable.find("div.ui-input-search");
		  
			var $expandBtnDiv = $("div.expandBtnDiv");
			var aw = $expandBtnDiv.outerWidth(true);
			
			$listSearchContainer.width($listSearchContainer.width() - (aw+10));
			
			$uiFilterable.append($expandBtnDiv);
			
			<%if(btnResoucesList.size() > 1){%>
				var $expandBtnDivMore = $("div.expandBtnDivMore");
				
				var at = $expandBtnDiv.offset().top + $expandBtnDiv.height();
				$expandBtnDivMore.css("top", (at+3));
				
				$("div.expandBtnDiv .moreFlag").click(function(){
					$expandBtnDivMore.slideToggle(0);
				});
			<%}%>
		<%}%>
		
		Mobile_NS.groupViewImg();
		
		$("img.lazy").lazyload({
			container : "#myPage"
		});
		
		var currYear = (new Date()).getFullYear();	
		var opt={};
		opt.date = {preset : 'date'};
		opt.datetime = {preset : 'datetime'};
		opt.time = {preset : 'time'};
		opt.default = {
			theme: 'android-ics light', //皮肤样式
	        display: 'modal', //显示方式 
	        mode: 'scroller', //日期选择模式
	        dateFormat : "yy-mm-dd",
			lang:'zh',
	        startYear:currYear - 50, //开始年份
	        endYear:currYear + 50 //结束年份
		};
		var optCurrDate = $.extend(opt['date'], opt['default']);
		$(".dateStyle").mobiscroll(optCurrDate).date(optCurrDate);
		var optCurrTime = $.extend(opt['time'], opt['default']);
		$(".timeStyle").mobiscroll(optCurrTime).time(optCurrTime);
		
		$(".field_inputTime").each(function(){
			if($(this).val() != ""){
				var fieldid = $(this).attr("fieldid");
				$("#fieldSub"+fieldid).click(function(e){
					e.stopPropagation();
					var fieldval = $("#field"+fieldid).val();
					if(fieldval && fieldval != ""){
						$("#field"+fieldid).val("");
						$(this).hide();
						$(this).unbind();
					}
				}).show();
			}
		});
		
		//去掉明细水平滚动条样式,不然导致iPhone6,显示不全
		$(".divoverflow").each(function(){
			var $table = $(this).children("table");
			if($table.width() <= $(this).width()){
				$(this).css("overflow", "hidden");
			}
		});
	});
	
	// 字段联动-浏览按钮
	function fieldBrowserLinkfn(groupid){
		var $objs;
		if(groupid != undefined){
			var $container = $("#detaildiv"+groupid);
			$objs = $("input[bid]", $container);
		}else{
			$objs = $("input[bid]");
		}
		$objs.each(function(){
			var that = this;
			
			var browserid = $(that).attr("name").split("field")[1];
			var idValue = $(that).val();
			
			if(idValue != ""){
				var nameValue = "";
				var $span = $("#field"+browserid+"span");
				var $label = $span.find("label");
				if(!!$label){
					nameValue = $label.html();
				}else{
					nameValue = $span.html();
				}
				
				var rtt = {"name" : nameValue, "value" : idValue};
				readyToTrigger(browserid, rtt);
			}
			
		});
	}

	// 字段联动-选择框
	function fieldLinkfn(obj){
		var $this = $(obj);
		var value = $this.val();
		if(value != ""){
			var fieldid = $this.attr("id").substring(5);
			var text = $this.find("option:selected").text();
			var result = {"name" : text, "value" : value};
			readyToTrigger(fieldid, result);//触发联动
		}
	}
	
	function jionActionUrl(invoker, queryStr){
		if(!queryStr){
			queryStr = "";
		}
		if(queryStr.indexOf("&") != 0){
			queryStr = "&" + queryStr;
		}
		return "/mobilemode/Action.jsp?invoker=" + invoker + queryStr;
	}
	
	// 布局页面日期字段清空方法
	function showClearBtn(fieldid){
		var $clearBtn = $("#fieldSub"+fieldid);
		$clearBtn.show();
		$clearBtn.click(function(e){
			e.stopPropagation();
			var fieldval = $("#field"+fieldid).val();
			if(fieldval && fieldval != ""){
				$("#field"+fieldid).val("");
				$clearBtn.hide();
				$clearBtn.unbind();
			}
		});
	}
	
	

	
	
	if(typeof(Mobile_NS) == 'undefined'){
		Mobile_NS = {};
	}

	Mobile_NS.groupViewImg = function(source){
		$("img[data-groupid]").each(function(){
			var that = this;
			var hasEvent = $(that).attr("data-groupev") == "true";
			if(!hasEvent){
				$(that).attr("data-groupev", "true");
				$(that).click(function(e){
					var groupid = $(this).attr("data-groupid");
					var currSrc = $(this).attr("src");
					
					var imgSrcs = "";
					$("img[data-groupid='"+groupid+"']").each(function(){
						var src = $(this).attr("src");
						imgSrcs += src + "|";
					});
					if(imgSrcs != ""){
						imgSrcs = imgSrcs.substring(0, imgSrcs.length - 1);
					}
					
					imgSrcs = encodeURIComponent(imgSrcs);
					currSrc = encodeURIComponent(currSrc);
					var url = "/mobilemode/displayPicOnMobile.jsp?imgSrc="+imgSrcs+"&imgSrcActive="+currSrc+"&1=1";
					openDetail(url);
					
					e.stopPropagation();
				});
			}
		});
	};
</script>
<script>
<%=uiview.getResScript()%>
</script>
<style>
	
</style>
</HEAD>
<body>
<div data-role="page" id="myPage" data-dom-cache="true">

<%if(isUseIScroll){ %>
<div id="scroll_wrapper">
	<div id="scroll_scroller">
		<%if(!disableDownRefresh){%>
			<div id="pullDown">
				<span class="pullDownIcon"></span><span class="pullDownLabel"><%=MobileCommonUtil.getHtmlLabelName(389564,user.getLanguage(),"下拉刷新")%></span>
			</div>
		<%} %>
<!-- 滚动条包裹区域 (start)-->		
<%} %>

<%if(uitype == 3 && !btnResoucesList.isEmpty()){ //列表扩展按钮
	WebUIResouces f_btnResouces = btnResoucesList.get(0);
	String className = btnResoucesList.size() > 1 ? " expandBtnDivHasMore" : "";
%>
	<div class="expandBtnDiv<%=className%>">
		<div class="text" onclick="javascript:openDetail('<%=f_btnResouces.getResourceContent()%>');"><%=f_btnResouces.getResourceName() %></div>
		<div class="moreFlag"></div>
	</div>
	
	<%if(btnResoucesList.size() > 1){%>
		<div class="expandBtnDivMore">
			<ul>
				<%for(int i = 1; i < btnResoucesList.size(); i++){
					WebUIResouces btnResouces = btnResoucesList.get(i);
				%>
					<li onclick="javascript:openDetail('<%=btnResouces.getResourceContent()%>');"><%=btnResouces.getResourceName() %></li>
				<%} %>
			</ul>
		</div>
	<%} %>
<%} %>

<form  name=frmmain id=frmmain method="post" enctype="multipart/form-data">
<div id="uploaddiv"></div>
<%=uiview.getUiContent()%>

<div style="display: none;">
	<input type=hidden name=formmodeid id="formmodeid" value="<%=modelid%>">
	<input type=hidden name=billid id="billid" value="<%=billid%>">
	<input type=hidden name="client" id="client" value="mobile">
	<input type=hidden name=appid id="appid" value="<%=appid%>">
	<input type=hidden name=uiid id="uiid" value="<%=uiid%>">
	<input type=hidden name="isShowInTab" id="isShowInTab" value="<%=isShowInTabV%>">
	<%=uiview.getHiddenContent() %>
</div>
<%
if(uitype!=3) {
	AppFormUI appFormUIEdit=mobileAppUIManager.getFormUI(appFormUI,2);
	String edituuid = "";
	if(appFormUIEdit!=null){
		edituuid = ""+appFormUIEdit.getId();
	}
JSONArray promptFieldArr = FormInfoService.getPromptFieldWithJSON(formid);
%>
<script type="text/javascript">
var formId = "<%=formid%>";
var dataId = "<%=billid%>";
var promptFieldArr = <%=promptFieldArr.toString()%>;	
function onSave(obj){
	var showIsMan = "";
	for(var k = 0; fieldsJsonArray && k < fieldsJsonArray.length; k++){
   		var v_fieldid = fieldsJsonArray[k];
   		v_fieldid = v_fieldid.replace("field", "");
		if($("#field"+v_fieldid).val() == ""){
			//图片、附件
			var photovalue = $("#photoField"+v_fieldid).val();
	   		if(photovalue==null||photovalue=="0"){
	   			showIsMan += ($("#field"+v_fieldid).parents("tr").find(".isManPrompt").text()+"\n");
	   		}
		}
   	}
   	if(showIsMan != ""){
   		alert(<%=MobileCommonUtil.getHtmlLabelName(389727,user.getLanguage(),"以下必填项未填写")%>+":\n"+showIsMan);
   		return;
   	}
	var submitClass = "form_buttonStyle_onsubmit";
	if(obj.className.indexOf(submitClass) == -1){
		$(obj).addClass("form_buttonStyle_onsubmit");
		//判断字段唯一性
		$(".promptValidateFail").removeClass("promptValidateFail");
		var changedFiledInfo = [];
		for(var i = 0; i < promptFieldArr.length; i++){
			var promptField = promptFieldArr[i];
			promptField["checkStatus"] = "true";
			var fieldInfo = promptField["fieldInfo"];
			var fieldElement = getFieldElement(fieldInfo); //获取相应的字段元素
			if(!fieldElement){	//字段在页面中不存在,或者这种字段类型暂时不做唯一性验证
				continue;
			}
			var isChanged = fieldIsChanged(fieldElement);	//判断该元素值是否有被改变过
			if(isChanged){
				var v = getFieldValue(fieldInfo);
				promptField["val"] = v;
				if(v){	//此处值判断一来是判断防止程序出现未期值,更重要的目的是过滤掉如果改变为空值的情况将不参与唯一性验证
					changedFiledInfo.push({"fieldid":fieldInfo["id"], "fieldname":fieldInfo["fieldname"], "changedValue":v});
				}					
			}
		}
		if(changedFiledInfo.length > 0){	//有需要唯一性验证的改变数据的字段
			//createLoadingTip();
			var jsonstr = JSON.stringify(changedFiledInfo);
			var paramData = {"data":encodeURI(jsonstr), "formId":formId, "dataId":dataId};
			var url = jionActionUrl("com.weaver.formmodel.data.servlet.BusinessDataAction", "action=validatePromptFieldData");
			$.post(url,paramData,function (res) {
					res = eval("(" + res + ")");
			    	//dropLoadingTip();
			    	for(var i = 0; res && i < res.length; i++){
			    		var r_fieldid = res[i]["fieldid"];
			    		var r_dcount = res[i]["dcount"];
			    		if(r_dcount > 0){
			    			//此处统一更改集合中的状态,提示啥的再后面统一做,代码剥离
			    			for(var j = 0; j < promptFieldArr.length; j++){
								var promptField = promptFieldArr[j];
								var fieldInfo = promptField["fieldInfo"];
								var p_fieldid = fieldInfo["id"];
								if(r_fieldid == p_fieldid){
									promptField["checkStatus"] = "false";
									break;
								}
							}
			    		}
			    	}
			    	
			    	//验证加提醒
			    	var isSuccess = true;
			    	var fieldTipHtml = "";
			    	for(var i = 0; i < promptFieldArr.length; i++){
			    		var promptField = promptFieldArr[i];
			    		if(promptField["checkStatus"] == "false"){
			    			isSuccess = false;
			    			
			    			var fieldInfo = promptField["fieldInfo"];
							var fieldElement = getFieldElement(fieldInfo); //获取相应的字段元素
							var $p_td = $(fieldElement).parent("td");
							$p_td.addClass("promptValidateFail");
							
							fieldTipHtml += "【"+fieldInfo["labelName"]+":\""+promptField["val"]+"\"】,";
			    		}
			    	}
	
			    	if(isSuccess){

						var b_flag = true;
			    		if(typeof(beforeOnSave) == "function"){
			    			b_flag = beforeOnSave();
			    		}
			    		if(b_flag){
			    			document.frmmain.action = jionActionUrl("com.weaver.formmodel.data.servlet.BusinessDataAction", "action=create");
							document.frmmain.submit();
			    		}

			    	}else{	//有字段数据违反了唯一性验证
			    		$(obj).removeClass("form_buttonStyle_onsubmit");
			    		var msg = "";
						msg += <%=MobileCommonUtil.getHtmlLabelName(127772,user.getLanguage(),"您录入的")%>;
						msg += fieldTipHtml.substring(0,fieldTipHtml.length-1);
						msg += <%=MobileCommonUtil.getHtmlLabelName(127773,user.getLanguage(),"已存在,违反了唯一性验证,请重新录入")%>;
						alert(msg);
			    	}
			    });
		}else{
			var b_flag = true;
    		if(typeof(beforeOnSave) == "function"){
    			b_flag = beforeOnSave();
    		}
    		if(b_flag){
    			document.frmmain.action = jionActionUrl("com.weaver.formmodel.data.servlet.BusinessDataAction", "action=create");
				document.frmmain.submit();
    		}
		}
	}
}

function onEdit(){
	location.href="/mobilemode/formbaseview.jsp?uiid=<%=edituuid%>&billid=<%=billid%>";
}
function onDelete(){
	document.frmmain.action =  jionActionUrl("com.weaver.formmodel.data.servlet.BusinessDataAction", "action=delete");
	document.frmmain.submit();
}
function doInterfacesAction(interfaceurl, openurl){
	var url = jionActionUrl("com.weaver.formmodel.data.servlet.BusinessDataAction", "action=doInterfacesAction");
	jQuery.ajax({
		url : url,
		type : "get",
		processData : false,
		data : interfaceurl+"&billid=<%=billid%>",
		dataType : "text",
		async : true,//改为异步
		success: function do4Success(msg){}
	});
	jsORopenUrl(openurl);
}
function jsORopenUrl(url){
	url = decodeURIComponent(url);
	if(url.substring(0,11) == "javascript:"){
		eval(url.substring(11));
	}else{
		openDetail(url);
	}
}
function dodetailcheck(){
	var e=event || window.event;
    if (e && e.stopPropagation){
        e.stopPropagation();    
    }
    else{
        e.cancelBubble=true;
    }
}

function adddetailshow(groupid){
	var $addtable = $("#addtable"+groupid);
	$addtable.show();
	setTimeout(function(){
		$(".addtableMask", $addtable).addClass("show");
		$(".addtableInner", $addtable).removeClass("hide");
	}, 10);
}

function showafter(groupid){
	var $addtable = $("#addtable"+groupid);
	<%if(uitype == 0 || uitype == 2){%>
		$("#addtable"+groupid).find("input[ismust='true']").each(function(){
			if($(this).parents("tr").find(".field_label").length > 0){
				$(this).parents("tr").find(".field_label").addClass("isManPrompt");
			}else{
				$(this).parents("tr").find(".field_label_colspan").addClass("isManPrompt");
			}
		});
		$("#addtable"+groupid).find("select[ismust='true']").each(function(){
			$(this).parents("tr").find(".field_label").addClass("isManPrompt");
		});
		$("#addtable"+groupid).find("textarea[ismust='true']").each(function(){
			$(this).parents("tr").find(".field_label").addClass("isManPrompt");
		});
		
		var currYear = (new Date()).getFullYear();	
		var opt={};
		opt.date = {preset : 'date'};
		opt.datetime = {preset : 'datetime'};
		opt.time = {preset : 'time'};
		opt.default = {
			theme: 'android-ics light', //皮肤样式
	        display: 'modal', //显示方式 
	        mode: 'scroller', //日期选择模式
	        dateFormat : "yy-mm-dd",
			lang:'zh',
	        startYear:currYear - 10, //开始年份
	        endYear:currYear + 10 //结束年份
		};
		var optCurrDate = $.extend(opt['date'], opt['default']);
		$("#addtable"+groupid).find(".dateStyle").mobiscroll(optCurrDate).date(optCurrDate);
		var optCurrTime = $.extend(opt['time'], opt['default']);
		$("#addtable"+groupid).find(".timeStyle").mobiscroll(optCurrTime).time(optCurrTime);
		
		$("#addtable"+groupid).find(".field_inputTime").each(function(){
			if($(this).val() != ""){
				var fieldid = $(this).attr("fieldid");
				$("#fieldSub"+fieldid).click(function(e){
					e.stopPropagation();
					var fieldval = $("#field"+fieldid).val();
					if(fieldval && fieldval != ""){
						$("#field"+fieldid).val("");
						$(this).hide();
						$(this).unbind();
					}
				}).show();
			}
		});
		$addtable.trigger("create");
	<%}%>
}

function replaceGN(s){
	return s.replace(/\n/g,"<BR>").replace(/\r/g,"<BR>");
}

function adddetailhide(groupid){
	var $table = $("#divoverflow"+groupid).children("table");
	if($table.width() > $("#divoverflow"+groupid).width()){
		$("#divoverflow"+groupid).css("overflow", "auto");
	}
		
	var $addtable = $("#addtable"+groupid);
	$(".addtableMask", $addtable).removeClass("show");
	$(".addtableInner", $addtable).addClass("hide");
	setTimeout(function(){
		$addtable.hide();
	}, 300);
	$("#addrowindex"+groupid).val("");
}
</script>
<div class="footerBtnContainer">
	<%if(uitype==1&&isEdit){%>
	<div class="form_buttonStyle  form_buttonStyle_edit" onclick="onEdit()"><%=MobileCommonUtil.getHtmlLabelName(126036,user.getLanguage(),"编辑")%></div>
	<%}      
	if(uitype==0||uitype==2){%>
	<div class="form_buttonStyle  form_buttonStyle_edit" onclick="onSave(this)"><%=MobileCommonUtil.getHtmlLabelName(615,user.getLanguage(),"提交")%></div>
	<%}
	if((uitype==1||uitype==2)&&isDel){%>
	<div class="form_buttonStyle  form_buttonStyle_delete" onclick="onDelete()"><%=MobileCommonUtil.getHtmlLabelName(125426,user.getLanguage(),"删除")%></div>
	<%}%>
	<%
		for(WebUIResouces btnResouces : btnResoucesList){
			String resourceContent = "";
			try {
				resourceContent = URLEncoder.encode(btnResouces.getResourceContent().trim(), "UTF-8").replaceAll("\\+","%20");
			} catch (Exception e) {
				e.printStackTrace();
			}
			if(btnResouces.getInterfaceUrl() == null){
			%>
				<div class="form_buttonStyle  form_buttonStyle_delete" onclick="javascript:jsORopenUrl('<%=resourceContent%>');"><%=btnResouces.getResourceName() %></div>
			<%		
			}else{
			%>
				<div class="form_buttonStyle  form_buttonStyle_delete" onclick="doInterfacesAction('<%=btnResouces.getInterfaceUrl()%>','<%=resourceContent%>');"><%=btnResouces.getResourceName() %></div>
			<%	
			}
		}
	%>
</div>
<%}else{%>
	<% if(totalSize==0){ %>
		<div  class="nodata_border"><div class="nodata_content"><div class="nodata_img"></div><%=MobileCommonUtil.getHtmlLabelName(83320,user.getLanguage(),"没有可显示的数据")%></div></div>
	<% }else if(totalPageCount>1){ %>
		<a href="javascript:void(0);" data-role="button" data-corners="true" id="moreListData" ><%=MobileCommonUtil.getHtmlLabelName(82720,user.getLanguage(),"加载更多")%></a>
	<% } %>
<%}%>
</form>

<%if(isUseIScroll){ %>
<!-- 滚动条包裹区域 (end)-->	
	</div>
</div>
<%} %>

</div>
</body>
</html>