ca.html 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="user-scalable=no">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
  8. <title></title>
  9. <link href="answerpage/demo/css/bootstrap.min.css" rel="stylesheet">
  10. <link type="text/css" rel="stylesheet" href="answerpage/demo/css/common.css">
  11. <style type="text/css">
  12. body {
  13. font-size: 16px;
  14. font-family: "microsoft yahei";
  15. background: #fff;
  16. padding: 0 10px;
  17. margin: 0 auto;
  18. }
  19. html {
  20. height: 100%;
  21. width: 100%;
  22. }
  23. * {
  24. margin: 0;
  25. padding: 0;
  26. }
  27. h1 {
  28. font-size: 20px;
  29. color: #1ea0fa;
  30. font-weight: bold;
  31. }
  32. h2 {
  33. font-size: 16px;
  34. margin-bottom: 10px
  35. }
  36. .input {
  37. width: 100%;
  38. color: #323232
  39. }
  40. .mar-t {
  41. margin-top: 16px
  42. }
  43. .mar-b {
  44. margin-bottom: 6px
  45. }
  46. /*
  47. li {
  48. float: left;
  49. width: 1.5em;
  50. height: 3.3em;
  51. cursor: pointer;
  52. text-indent: -9999px;
  53. display: inline-block;
  54. background: url(answerpage/img/star-off.png) no-repeat;
  55. background-size: 60%;
  56. } */
  57. /* li.on {
  58. width: 1.5em;
  59. height: 3.3em;
  60. background: url(star_choies.png) no-repeat;
  61. background-size: 60%
  62. } */
  63. /* .starCon */
  64. .modal-dialog {
  65. width: 250px;
  66. margin: auto;
  67. /* padding-top: 50%; */
  68. top: 35%;
  69. height: 100%;
  70. }
  71. .modal-content {
  72. -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  73. box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  74. }
  75. fieldset {
  76. border: 0px;
  77. margin: 0;
  78. padding: 0;
  79. }
  80. .topic__type-title {
  81. font-size: 16px;
  82. font-weight: bold;
  83. line-height: 26px;
  84. margin-bottom: 10px;
  85. }
  86. .topic__type-dry .topic__type-items {
  87. /* line-height: 1.4; */
  88. margin-bottom: 6px;
  89. }
  90. .mar fieldset{
  91. margin-top: 20px;
  92. }
  93. </style>
  94. </head>
  95. <body style=" font-family:microsoft yahei;background-image: url(img/zzpic12840.jpg);background-attachment: fixed;background-repeat: no-repeat;width:100%;height:100%;background-size:cover">
  96. <!--弹窗提示-->
  97. <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  98. <div class="modal-dialog" role="document">
  99. <div class="modal-content">
  100. <div class="modal-header">
  101. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  102. <span aria-hidden="true">×</span>
  103. </button>
  104. <h4 class="modal-title" id="myModalLabel">提示</h4>
  105. </div>
  106. <div class="modal-body" id="modal-body">
  107. <p></p>
  108. </div>
  109. <div class="modal-footer">
  110. <button type="button" data-dismiss="modal" class="btn" var="1">确定</button>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="row" style=" margin:0 auto;margin-top:150px;margin-left:30px;" id="csnrow">
  116. <div class="col-xs-6 col-sm-4">
  117. <form class="form-horizontal">
  118. <div class="form-group">
  119. <!-- <label for="inputEmail3" class="col-sm-2 control-label">身份证:</label> -->
  120. <h4 style="margin-left:20px;">身份证:</h4>
  121. <div class="col-sm-10">
  122. <input type="text" style="width: 200px" class="form-control" id="inputidl3" placeholder="请输入身份证"><span id="yanz"></span>
  123. </div>
  124. </div>
  125. <div class="form-group">
  126. <div class="col-sm-offset-2 col-sm-10" style="margin-left:20px;">
  127. <button type="button" class="btn btn-primary" id="fromque" style="width: 150px">确定</button>
  128. </div>
  129. </div>
  130. </form>
  131. </div>
  132. </div>
  133. <div id="isShow" style="display:none">
  134. <div style="text-align: center;border-bottom:1px dashed #666;padding-top:26px;padding-bottom:16px">
  135. <h1 id="reviewqu"></h1>
  136. <h2 id="reviedescribed">问卷说明:</h2>
  137. </div>
  138. <div>
  139. <div class="margu">
  140. <h2>请输入所属公司、部门(例如:物业-环境管理部):</h2>
  141. <input class="input" id="depbuname" type="text" maxlength='20' />
  142. </div>
  143. <div class="mar" id="problemVo">
  144. <!-- <h2>1.第三方第三个</h2>
  145. <input /> -->
  146. </div>
  147. <div style="margin-top:16px;text-align: center">
  148. <button id="onsumit" style="align-items: center;width:200px;height:45px;border-radius: 15px;background-color:#1ea0fa;color:#fff">提交</button>
  149. </div>
  150. </div>
  151. <div id="xinput" style="display:none"></div>
  152. </div>
  153. <script src="answerpage/js/jquery-2.1.4.min.js"></script>
  154. <script src="answerpage/js/jquery.min.js"></script>
  155. <script src="answerpage/js/bootstrap.min.js"></script>
  156. <script src="answerpage/js/jquery.raty.min.js"></script>
  157. <script>
  158. $(function () {
  159. var domain = location.hostname;
  160. var backDomain = domain + ":";//后端域名
  161. if (domain === 'localhost') { //开发
  162. backDomain = "http://localhost:9090/";
  163. }
  164. else if (domain === '192.168.124.7') { //开发
  165. backDomain = "http://192.168.124.7:6062/DPshow_depart/";
  166. }
  167. else if (domain === 'duptest.bgyfw.com') { //测试
  168. backDomain = "http://duptest.bgyfw.com:8002/DPshow_depart/";
  169. } else if (domain === 'duprc.bgyfw.com') { //预生产
  170. backDomain = "http://duprc.bgyfw.com:8012/DPshow_depart/";
  171. } else if (domain === 'dup.bgyfw.com') { //正式
  172. backDomain = "https://dup.bgyfw.com:8443/DPshow_depart/";
  173. }
  174. var url = location.search; //获取url中"?"符后的字串  
  175. var theRequest = new Object();
  176. if (url.indexOf("?") != -1) {
  177. var str = url.substr(1);
  178. strs = str.split("&");
  179. for (var i = 0; i < strs.length; i++) {
  180. theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  181. }
  182. }
  183. var pjid = theRequest.pjd;//项目id
  184. var qid = theRequest.qd;//问卷id
  185. var cid = theRequest.cd;//调查id
  186. var dataObj = "";
  187. var investigatedName = "";
  188. var questionnaireId = "";
  189. var questionnaireName = "";
  190. var questionnaireDescribed = "";
  191. var problemVo = "";
  192. var answerArray = [];
  193. var answerJson = "";
  194. var investigatedIsRepeatVo = "";
  195. var proqc = "";
  196. var problemjianweVo = "";
  197. var answerwenArray = [];
  198. var name = "";
  199. var reg = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/;
  200. var idshen;
  201. function closeCurPage() {
  202. var userAgent = navigator.userAgent.toLowerCase();
  203. if (userAgent.match(/MicroMessenger/i) == "micromessenger") {
  204. WeixinJSBridge.invoke('closeWindow', {}, function (res) { });
  205. } else if (userAgent.indexOf("ucbrowser") != -1) {
  206. alert("感谢您的回答,请点击右上角关闭!");
  207. window.close();
  208. window.history.go(-1);
  209. } else if (userAgent.indexOf("firefox") != -1 || userAgent.indexOf("chrome") != -1) {
  210. window.location.href = "about:blank";
  211. window.close();
  212. } else if (userAgent.match(/QQ/i) == "qq") {
  213. alert("感谢您的回答,请点击右上角关闭!");
  214. } else {
  215. window.opener = null;
  216. window.open("about:blank", "_self");
  217. window.close();
  218. }
  219. }
  220. $.fn.raty.defaults.path = 'static/img';
  221. $.ajax({
  222. type: "get",
  223. url: backDomain + "api/canteenInvestigate/getcantequestionnaireaca",
  224. async: true,
  225. data: { questionnaireId: qid, projectid: pjid, canteeninsdid: cid, investigatagementid: 2 },
  226. dataType: 'json',
  227. success: function (result) {
  228. // $("#ceshi").append(JSON.stringify(result));
  229. dataObj = eval(result).data;
  230. investigatedIsRepeatVo = eval(dataObj).canteenInvestigationliebiaodto;
  231. questionnaireDescribed = eval(investigatedIsRepeatVo).described;
  232. $("title").html(investigatedIsRepeatVo.title);
  233. if (investigatedIsRepeatVo.ispartake == 0) {
  234. $("#csnrow").css("display", "none")
  235. window.location.href = 'end.html?title=' + investigatedIsRepeatVo.title + '&rqname=' + investigatedIsRepeatVo.questionnaireName + '&described=' + questionnaireDescribed;
  236. return;
  237. }
  238. problemVo = eval(dataObj).problemVo;
  239. // problemjianweVo = eval(dataObj).problemjianweVo;
  240. $("#reviewqu").html(investigatedIsRepeatVo.questionnaireName);
  241. $("#reviedescribed").append(questionnaireDescribed);
  242. $("#problemVo").html("");
  243. if (problemVo.length != 0) {
  244. for (var i = 0; i < problemVo.length; i++) {
  245. //type==1为量表题
  246. if (problemVo[i].type == 1) {
  247. //var ulStr = "";
  248. for (var j = 0; j < problemVo[i].score; j++) {
  249. //ulStr += "<li><a href='javascript:;'>" + (j + 1) + "</li>";
  250. }
  251. $("#problemVo").append(
  252. // "<div>&nbsp;</div>" +
  253. // class='starTitle' "<div style='margin-left:0px' id='starproqc" + (i + 1) + "'>" + "<h4>" + problemVo[i].name + ":" + "</h4></div>" +
  254. // "<div class='starCon' id='star" + (i + 1) + "'>" +
  255. "<fieldset>" +
  256. "<legend class='topic__type-title' style='border-bottom:0px'>" + (i + 1) + "、" + problemVo[i].title + "</legend>" +
  257. // "<h2>" + (i + 1) + "、" + problemVo[i].title + "</h2>" +
  258. // "<ul>" + ulStr + "</ul>" + "<input type='hidden' display: inline; value='0' id='startProble" + i + "'/></div>" + "<div>&nbsp;</div>"
  259. "<div id='function-demo11" + i + "'class='target-demo'></div>" +
  260. "<input type='hidden' id='startProble" + i + "'>" + "<div></div>"
  261. + "</fieldset>"
  262. );
  263. for (var j = 0; j < problemVo[i].score; j++) {
  264. $('#function-demo11' + i).raty({
  265. number: j+1,//多少个星星设置
  266. score: 0,//初始值是设置
  267. targetType: 'number',//类型选择,number是数字值,hint,是设置的数组值
  268. path: 'img',
  269. cancelOff: 'cancel-off-big.png',
  270. cancelOn: 'cancel-on-big.png',
  271. size: 24,
  272. starHalf: 'star-half.png',
  273. starOff: 'star-off.png',
  274. starOn: 'star-on.png',
  275. target: '#startProble' + i,
  276. cancel: false,
  277. targetKeep: true,
  278. precision: false,//是否包含小数
  279. click: function (score, evt) {
  280. //alert('ID: ' + $(this).attr('id') + "\nscore: " + score + "\nevent: " + evt.type);
  281. }
  282. });
  283. }
  284. // starComm('star' + (i + 1));
  285. // function starComm(starId) {
  286. // var oStar = document.getElementById(starId);
  287. // var aLi = oStar.getElementsByTagName("li");
  288. // var oUl = oStar.getElementsByTagName("ul")[0];
  289. // var oP = oStar.getElementsByTagName("input")[0];
  290. // var i = iScore = iStar = 0;
  291. // for (i = 1; i <= aLi.length; i++) {
  292. // aLi[i - 1].index = i;
  293. // //点击后进行评分处理
  294. // aLi[i - 1].onclick = function () {
  295. // iStar = this.index;
  296. // fnPoint(iStar);
  297. // oP.value = iStar;
  298. // }
  299. // }
  300. // //评分处理
  301. // var fnPoint = function (iArg) {
  302. // //分数赋值
  303. // iScore = iArg || iStar;
  304. // for (i = 0; i < aLi.length; i++) aLi[i].className = i < iScore ? "on" : "";
  305. // }
  306. // }
  307. }
  308. if (problemVo[i].type == 3) {
  309. var optionStr = "";
  310. for (var j = 0; j < problemVo[i].option.length; j++) {
  311. optionStr += "<span class='topic__type-items'><input type='radio' style='margin-top:0.5%;' name='field_name" + i + "'" + "value='" + problemVo[i].option[j].optionId + "'/>" + problemVo[i].option[j].name + "(" + problemVo[i].option[j].optionScore + "分" + ")" + "</span><br>";
  312. }
  313. $("#problemVo").append(
  314. // "<div'>&nbsp</div>" +
  315. // "<div id='starproqc" + (i + 1) + "'>" + "<h4>" + problemVo[i].name + ":" + "</h4></div>" margin-left:5%' +
  316. // "<div class='starCon' id='star'>" +
  317. "<fieldset>" +
  318. "<legend class='topic__type-title' style='border-bottom:0px'>" + (i + 1) + "、" + problemVo[i].title + "</legend>" +
  319. "<div class='topic__type-dry'>"
  320. +optionStr+
  321. "</div>"
  322. +
  323. "</fieldset>"
  324. );
  325. }
  326. if (problemVo[i].type == 4) {
  327. $("#problemVo").append(
  328. // "<div'>&nbsp;</div>" +
  329. // "<div id='starproqc" + (i + 1) + "'>" + "<h4>" + problemVo[i].name + ":" + "</h4></div>" +
  330. // "<div class='starCon' id='star'>" +
  331. "<fieldset>" +
  332. "<legend class='topic__type-title' style='border-bottom:0px'>" + (i + 1) + "、" + problemVo[i].title + "</legend>" +
  333. // "<h2>" + (i + 1) + "、" + problemVo[i].title + "</h2>" +
  334. "<input type='text' class='input' placeholder='请输入答案' maxlength='200' style='margin-top:0.5%' id='textjianda" + i + "' ></input> "
  335. + "</fieldset>"
  336. );
  337. }
  338. if (problemVo[i].type == 2) {
  339. if (problemVo[i].answerDescription != null) {
  340. $("#problemVo").append(
  341. // "<div>&nbsp;</div>" +
  342. // "<div id='starproqc" + (i + 1) + "'>" + "<h4>" + problemVo[i].name + ":" + "</h4></div>" +
  343. // "<div class='starCon' id='star'>" +
  344. "<fieldset>" +
  345. "<legend class='topic__type-title' style='border-bottom:0px'>" + (i + 1) + "、" + problemVo[i].title + "</legend>" +
  346. // "<h2>" + (i + 1) + "、" + problemVo[i].title + "</h2>" +
  347. "<textarea type='text' placeholder='请输入答案' maxlength='200' style='margin-top:0.5%;width:100%;height:100px' id='text" + i + "' placeholder='" + problemVo[i].answerDescription + "'></textarea>"
  348. + "</fieldset>"
  349. )
  350. } else {
  351. $("#problemVo").append(
  352. // "<div>&nbsp;</div>" +
  353. // "<div class='starCon'>" +
  354. // "<div id='starproqc" + (i + 1) + "'>" + "<h4>" + problemVo[i].name + ":" + "</h4></div>" +
  355. "<fieldset>" +
  356. "<legend class='topic__type-title' style='border-bottom:0px'>" + (i + 1) + "、" + problemVo[i].title + "</legend>" +
  357. // "<h2>" + (i + 1) + "、" + problemVo[i].title + "</h2>" +
  358. "<textarea type='text' placeholder='请输入答案' maxlength='200' style='margin-top:0.5%;width:100%;height:100px' id='text" + i + "'></textarea>" + "</fieldset>"
  359. );
  360. }
  361. }
  362. }
  363. }
  364. }
  365. })
  366. $("#fromque").click(function () {
  367. $.ajax({
  368. type: "get",
  369. url: backDomain + "api/canteenInvestigate/getcantequestionnaireaca",
  370. async: true,
  371. data: { questionnaireId: qid, projectid: pjid, canteeninsdid: cid, investigatagementid: 2 },
  372. dataType: 'json',
  373. success: function (result) {
  374. dataObj = eval(result).data;
  375. investigatedIsRepeatVo = eval(dataObj).canteenInvestigationliebiaodto;
  376. $("title").html(investigatedIsRepeatVo.title);
  377. if (investigatedIsRepeatVo.ispartake == 0) {
  378. $("#csnrow").css("display", "none")
  379. window.location.href = 'end.html?title=' + investigatedIsRepeatVo.title + '&rqname=' + investigatedIsRepeatVo.questionnaireName + '&described=' + questionnaireDescribed;
  380. return;
  381. }
  382. }
  383. })
  384. idshen = $("#inputidl3").val();
  385. $.ajax({
  386. type: "get",
  387. url: backDomain + "api/canteenScore/bdpsndoccadati",
  388. async: true,
  389. data: { bdid: idshen, canteeninsdid: cid },
  390. dataType: 'json',
  391. success: function (result) {
  392. if (eval(result).data == "") {
  393. } else {
  394. $(".modal-footer").append("<button id='buthiden' type='button' data-dismiss='modal' class='btn' var='2'/ >取消</button>");
  395. $("#modal-body p").html("该问卷你已提交,再次提交以此份为准,是否继续")
  396. $('#myModal').modal('show')
  397. $(".btn").on("click", function () {
  398. if ($(this).attr("var") == 2) {
  399. $('#isShow').hide();
  400. // window.opener = null;
  401. // window.open(' ', '_self');
  402. // window.close();
  403. closeCurPage();
  404. return;
  405. }
  406. });
  407. }
  408. }
  409. })
  410. if (reg.test(idshen) == false) {
  411. $("#yanz").html('');
  412. $("#inputidl3").css("border-color", "#FF0000")
  413. $("#yanz").append("<img src='img/li_err.gif'></img><span style='color:#FF0000'>身份证号码不符合规范</span>")
  414. return;
  415. } else {
  416. $("#yanz").html('');
  417. $("#yanz").append("<img src='img/li_ok.gif'></img>")
  418. //46002219790309231X
  419. $.ajax({
  420. type: "get",
  421. url: backDomain + "api/canteenInvestigate/bdpsndoc",
  422. async: true,
  423. data: { bdid: idshen },
  424. dataType: 'json',
  425. success: function (result) {
  426. if (eval(result).data == null || eval(result).data == "") {
  427. $('#buthiden').hide();
  428. $("#modal-body p").html("没有此用户")
  429. $('#myModal').modal('show')
  430. return;
  431. }
  432. var data = eval(result).data;
  433. for (let index = 0; index < data.length; index++) {
  434. name = data[index].creator
  435. }
  436. if (data != null || data != "") {
  437. $("#isShow").css("display", "block")
  438. // name=
  439. $("#csnrow").css("display", "none")
  440. }
  441. }
  442. })
  443. }
  444. })
  445. $("#onsumit").click(function () {
  446. for (var i = 0; i < problemVo.length; i++) {
  447. var answer = { bdid: "", name: "", depname: "", canteeninsdid: "", problemId: "", potionId: "", score: "", anwen: "", type: "" };
  448. answer.bdid = idshen;
  449. answer.name = name;
  450. answer.depname = $("#depbuname").val();
  451. answer.type = problemVo[i].type;
  452. answer.problemId = problemVo[i].id;
  453. answer.canteeninsdid = cid;
  454. if ($("#depbuname").val() == '' || $("#depbuname").val() == null) {
  455. $('#buthiden').hide();
  456. $("#modal-body p").html("部门不能为空,请填写")
  457. $('#myModal').modal('show')
  458. answerArray = []
  459. break;
  460. }
  461. //type==1为量表题,得到星星数
  462. if (problemVo[i].type == 1) {
  463. answer.score = $("#startProble" + i).val()
  464. if (answer.score == 0) {
  465. $('#buthiden').hide();
  466. $("#modal-body p").html("问题" + (i + 1) + "不能为空,请选择")
  467. $('#myModal').modal('show')
  468. answerArray = []
  469. break;
  470. }
  471. //type==3为单选,得到选中的id
  472. } else if (problemVo[i].type == 3) {
  473. var potionId = $("input[name='field_name" + i + "']:checked").val();
  474. if (potionId == undefined) {
  475. $('#buthiden').hide();
  476. $("#modal-body p").html("问题" + (i + 1) + "不能为空,请选择")
  477. $('#myModal').modal('show')
  478. answerArray = []
  479. break;
  480. } else {
  481. var optionStr = problemVo[i].option;
  482. for (var j = 0; j < optionStr.length; j++) {
  483. if (optionStr[j].optionId == potionId) {
  484. answer.score = optionStr[j].optionScore;
  485. answer.potionId = potionId;
  486. }
  487. }
  488. }
  489. } else if (problemVo[i].type == 4) {//简答题
  490. answer.anwen = $("#textjianda" + i).val();
  491. if (answer.anwen == "" || answer.anwen == null) {
  492. $('#buthiden').hide();
  493. $("#modal-body p").html("简答题不能为空,请选择")
  494. $('#myModal').modal('show')
  495. answerArray = []
  496. break;
  497. }
  498. } else if (problemVo[i].type == 2) {
  499. answer.anwen = $("#text" + i).val();
  500. if (answer.anwen == "" || answer.anwen == null) {
  501. $('#buthiden').hide();
  502. $("#modal-body p").html("问答题不能为空,请选择")
  503. $('#myModal').modal('show')
  504. answerArray = []
  505. break;
  506. }
  507. }
  508. answerArray.push(answer)
  509. }
  510. if (answerArray.length != 0) {
  511. $.ajax({
  512. type: "post",
  513. url: backDomain + "api/canteenScore/updatescore",
  514. async: true,
  515. data: { bdid: idshen, canteeninsdid: cid },
  516. dataType: 'json',
  517. success: function (result) { }
  518. });
  519. $.ajax({
  520. type: "post",
  521. url: backDomain + "api/canteenScore/add",
  522. async: true,
  523. data: { answer: JSON.stringify(answerArray) },
  524. dataType: 'json',
  525. success: function (result) {
  526. answerArray = [];
  527. // answerwenArray = [];
  528. $("input[ type='text' ] ").val("");
  529. $("textarea[ type='text' ] ").val("");
  530. $("input[ type='radio' ]").attr("checked", false);
  531. $(".starCon li").css("background", "url(answerpage/img/star-off.png) no-repeat")
  532. $('#buthiden').hide();
  533. $("#modal-body p").html("提交成功")
  534. $('#myModal').modal('show')
  535. $(".btn").click(function () {
  536. // window.opener = null;
  537. // window.open(' ', '_self');
  538. // window.close();
  539. closeCurPage();
  540. })
  541. }, error: function (XmlHttpRequest, textStatus, errorThrown) {
  542. $('#buthiden').hide();
  543. $("#modal-body p").html("提交失败")
  544. $('#myModal').modal('show')
  545. }
  546. })
  547. }
  548. })
  549. })
  550. </script>
  551. </body>
  552. </html>