2 Commits 501231062a ... 5e0dedfe26

Author SHA1 Message Date
  song 5e0dedfe26 判断巡查员权限 1 week ago
  song b6c9549ff4 判断巡查员权限 1 week ago
2 changed files with 155 additions and 137 deletions
  1. 76 68
      add.html
  2. 79 69
      addTest.html

+ 76 - 68
add.html

@@ -456,6 +456,7 @@
                         obj.img = img[0].src;
                         objimgs.push(obj);
                     }
+                    //保存到一户一档
 					var strSqlTask="insert INTO HEALTH.一户一档 (ID,NAME,BODY," +
 						"REGISTERE,IDTYPE,COUNTY,COUNTYSSTRING," +
 						"MAJOR,STREET,STREETID,SENDMONTH,SENDYEAR,SENDTIME,SOURCE,SOURCESUB,NUM)" +
@@ -466,56 +467,60 @@
 						",'"+document.getElementById("select_num").value+"')";
                     new WsCommonClass("QueryDataBaseJson", ["sql"], [strSqlTask], querySuccess, "AddInfo");
 					//alert(strSqlTask)
-                    // for(i=0;i<=objimgs.length;i++){
-                    //console.log(objimgs[i].img+"===****"+objimgs[i].imge+"");
-                    if (objimgs.length == 0) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
-                            "values( "+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    } else if (objimgs.length == 1) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','')";
-                       //alert(strSql)
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    } else if (objimgs.length == 2) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    } else if (objimgs.length == 3) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    }
-                    else if (objimgs.length == 4) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    }
-                    else if (objimgs.length == 5) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4,照片5) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + currentClickid + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "','" + objimgs[4].img + "')";
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    }
+					// 巡查员用户&区级管理员用户
+					if(role == "21" || role == "3"){
+						// for(i=0;i<=objimgs.length;i++){
+						//console.log(objimgs[i].img+"===****"+objimgs[i].imge+"");
+						if (objimgs.length == 0) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
+									"values( "+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						} else if (objimgs.length == 1) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','')";
+							//alert(strSql)
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						} else if (objimgs.length == 2) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						} else if (objimgs.length == 3) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						}
+						else if (objimgs.length == 4) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						}
+						else if (objimgs.length == 5) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4,照片5) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + currentClickid + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "','" + objimgs[4].img + "')";
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						}
 
-                    var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
-                        ", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
-                        " LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
-                        ",WHETHERINSCENE" +
-                        ",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
-						"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
-                        "values (SEQ_TASKSTATUS_ID.NEXTVAL, "+SEQ_REPORT_ID+" " +
-                        ","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
-                        ","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
-                        ","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
-                        ","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
-						","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
-                    //alert(strSql1)
-					new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+						var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
+								", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
+								" LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
+								",WHETHERINSCENE" +
+								",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
+								"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
+								"values (SEQ_TASKSTATUS_ID.NEXTVAL, "+SEQ_REPORT_ID+" " +
+								","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
+								","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
+								","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
+								","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
+								","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
+						//alert(strSql1)
+						new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+					}
                 }else{
+                	//保存到一户一档
                     var strSqlTask="insert INTO HEALTH.一户一档 (ID,NAME,BODY," +
                         "REGISTERE,IDTYPE,COUNTY,COUNTYSSTRING," +
                         "MAJOR,STREET,STREETID,SENDMONTH,SENDYEAR,SENDTIME,SOURCE,SOURCESUB,NUM)" +
@@ -525,26 +530,29 @@
                         ",'"+$("#select_town option:selected").text()+"','"+$("#select_town option:selected").val()+"',"+month+","+year+",sysdate,"+souce+","+soucesub+
 						",'"+document.getElementById("select_num").value+"')";
                     new WsCommonClass("QueryDataBaseJson", ["sql"], [strSqlTask], querySuccess, "AddInfo");
-                   //alert(strSqlTask)
-                    var strSql = "insert into 巡检状态(ID,一户一档ID,状态,手机,照片1,照片2 ) " +
-                        "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
-                    //new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "queryUser");
-                    var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
-                        ", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
-                        " LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
-                        ",WHETHERINSCENE" +
-                        ",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
-						"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
-                        "values (seq_taskstatus_id.nextval,"+SEQ_REPORT_ID+"" +
-                        ","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
-                        ","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
-                        ","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
-                        ","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
-						","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
-                    //alert(strSql)
-					//alert(strSql1)
-                    new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+                    //alert(strSqlTask)
+					// 巡查员用户&区级管理员用户
+					if(role == "21" || role == "3"){
+						var strSql = "insert into 巡检状态(ID,一户一档ID,状态,手机,照片1,照片2 ) " +
+								"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
+						//new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "queryUser");
+						var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
+								", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
+								" LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
+								",WHETHERINSCENE" +
+								",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
+								"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
+								"values (seq_taskstatus_id.nextval,"+SEQ_REPORT_ID+"" +
+								","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
+								","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
+								","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
+								","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
+								","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
+						//alert(strSql)
+						//alert(strSql1)
+						new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+					}
                 }
 			}
 			var address;

+ 79 - 69
addTest.html

@@ -456,6 +456,7 @@
                         obj.img = img[0].src;
                         objimgs.push(obj);
                     }
+					//保存到一户一档
 					var strSqlTask="insert INTO HEALTH.一户一档 (ID,NAME,BODY," +
 						"REGISTERE,IDTYPE,COUNTY,COUNTYSSTRING," +
 						"MAJOR,STREET,STREETID,SENDMONTH,SENDYEAR,SENDTIME,SOURCE,SOURCESUB,NUM)" +
@@ -467,57 +468,62 @@
 					console.log(strSqlTask);
                     new WsCommonClass("QueryDataBaseJson", ["sql"], [strSqlTask], querySuccess, "AddInfo");
 					//alert(strSqlTask)
-                    // for(i=0;i<=objimgs.length;i++){
-                    //console.log(objimgs[i].img+"===****"+objimgs[i].imge+"");
-                    if (objimgs.length == 0) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
-                            "values( "+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    } else if (objimgs.length == 1) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','')";
-                       //alert(strSql)
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    } else if (objimgs.length == 2) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    } else if (objimgs.length == 3) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    }
-                    else if (objimgs.length == 4) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "')";
-                        console.log(strSql);
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    }
-                    else if (objimgs.length == 5) {
-                        var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4,照片5) " +
-                            "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + currentClickid + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "','" + objimgs[4].img + "')";
-                        new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    }
+					// 巡查员用户&区级管理员用户
+					if(role == "21" || role == "3"){
+						// for(i=0;i<=objimgs.length;i++){
+						//console.log(objimgs[i].img+"===****"+objimgs[i].imge+"");
+						if (objimgs.length == 0) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
+									"values( "+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						} else if (objimgs.length == 1) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','')";
+							//alert(strSql)
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						} else if (objimgs.length == 2) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						} else if (objimgs.length == 3) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						}
+						else if (objimgs.length == 4) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "')";
+							console.log(strSql);
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						}
+						else if (objimgs.length == 5) {
+							var strSql = "insert into health.巡检状态(ID,一户一档ID,状态,手机,照片1,照片2,照片3,照片4,照片5) " +
+									"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + currentClickid + "','"+localStorage.getItem("mobile")+"','" + objimgs[0].img + "','" + objimgs[1].img + "','" + objimgs[2].img + "','" + objimgs[3].img + "','" + objimgs[4].img + "')";
+							new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						}
+
+						var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
+								", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
+								" LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
+								",WHETHERINSCENE" +
+								",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
+								"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
+								"values (SEQ_TASKSTATUS_ID.NEXTVAL, "+SEQ_REPORT_ID+" " +
+								","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
+								","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
+								","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
+								","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
+								","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
+						// alert(strSql1)
+						console.log(strSql1);
+						new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+					}
 
-                    var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
-                        ", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
-                        " LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
-                        ",WHETHERINSCENE" +
-                        ",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
-						"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
-                        "values (SEQ_TASKSTATUS_ID.NEXTVAL, "+SEQ_REPORT_ID+" " +
-                        ","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
-                        ","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
-                        ","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
-                        ","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
-						","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
-                    // alert(strSql1)
-					console.log(strSql1);
-					new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
                 }else{
+					//保存到一户一档
                     var strSqlTask="insert INTO HEALTH.一户一档 (ID,NAME,BODY," +
                         "REGISTERE,IDTYPE,COUNTY,COUNTYSSTRING," +
                         "MAJOR,STREET,STREETID,SENDMONTH,SENDYEAR,SENDTIME,SOURCE,SOURCESUB,NUM)" +
@@ -527,26 +533,30 @@
                         ",'"+$("#select_town option:selected").text()+"','"+$("#select_town option:selected").val()+"',"+month+","+year+",sysdate,"+souce+","+soucesub+
 						",'"+document.getElementById("select_num").value+"')";
                     new WsCommonClass("QueryDataBaseJson", ["sql"], [strSqlTask], querySuccess, "AddInfo");
-                   //alert(strSqlTask)
-                    var strSql = "insert into 巡检状态(ID,一户一档ID,状态,手机,照片1,照片2 ) " +
-                        "values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
-                    //new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "queryUser");
-                    var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
-                        ", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
-                        " LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
-                        ",WHETHERINSCENE" +
-                        ",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
-						"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
-                        "values (seq_taskstatus_id.nextval,"+SEQ_REPORT_ID+"" +
-                        ","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
-                        ","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
-                        ","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
-                        ","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
-						","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
-                    //alert(strSql)
-					//alert(strSql1)
-                    new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
-                    new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+                    //alert(strSqlTask)
+					// 巡查员用户&区级管理员用户
+					if(role == "21" || role == "3"){
+						var strSql = "insert into 巡检状态(ID,一户一档ID,状态,手机,照片1,照片2 ) " +
+								"values("+SEQ_REPORT_ID+",'" + SEQ_TASK_ID + "','" + status + "','"+localStorage.getItem("mobile")+"','','')";
+						//new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "queryUser");
+						var strSql1 = "insert into health.PATROLSTATUS (ID,PATROLSTATUSID" +
+								", DRUG,DRUGNUM,INSTRUMENT,INSTRUMENTNUM,WASTE,WASTENUM," +
+								" LISTED,LISTEDNAME,ADLET,DENTALCHAIR,INSIDERASK,SCENEOTHER,SCENEOTHERCONTENT" +
+								",WHETHERINSCENE" +
+								",INTERNALMEDICINE,DENTAL,MEDICAKBEAUTY, MEDICINEOTHER,MEDICINEOTHERCONTENT,"+
+								"MOVEDACCORDING,MOVEDOTHER,NOTPRACTICINGACCORDING,NOTPRACTICINGOTHER)" +
+								"values (seq_taskstatus_id.nextval,"+SEQ_REPORT_ID+"" +
+								","+yp+",'"+document.getElementById("ypNum").value+"',"+ylqx+",'"+document.getElementById("ylqxNum").value+"'" +
+								","+ylfqw+",'"+document.getElementById("ylfqwNum").value+"',"+gpmc+",'"+document.getElementById("gpmcName").value+"'" +
+								","+xmp+","+yy+","+xwhqy+","+xcqt+",'"+document.getElementById("xcqtContent").value+"',"+medicine+","+nk+"" +
+								","+yk+","+ylmr+","+xyqt+",'"+document.getElementById("xyqtContent").value+"'"+
+								","+_yblStatus+",'"+_yblyjContent+"',"+_wzyStatus+",'"+_wzyyjContent+"')";
+						//alert(strSql)
+						//alert(strSql1)
+						new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql], querySuccess, "AddInfo");
+						new WsCommonClass("QueryDataBaseJson", ["sql"], [strSql1], querySuccess, "AddInfo");
+					}
+
                 }
 			}
 			var address;