CleansingCheckLogList.cshtml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>CleansingCheckLogList</title>
  10. <link href="~/easyui/themes/default/easyui.css" rel="stylesheet" />
  11. <link rel="stylesheet" type="text/css" href="~/easyui/themes/icon.css" />
  12. <link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
  13. <link href="~/Content/js/plugins/layer/skin/layer.css" rel="stylesheet" />
  14. <script src="~/Content/js/jquery.min.js"></script>
  15. <script src="~/Content/js/bootstrap.min.js"></script>
  16. <script src="~/easyui/jquery.easyui.min.js"></script>
  17. <script src="~/easyui/jquery.easyui.mobile.js"></script>
  18. <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
  19. <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
  20. <script src="~/Content/js/plugins/layer/layer.min.js"></script>
  21. <script src="~/js/Utils.js"></script>
  22. <script src="~/Content/plugins/ajaxFileUpload/ajaxFileUpload-M.js"></script>
  23. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  24. <script src="~/Content/js/js/MarketJs.js"></script>
  25. </head>
  26. <body >
  27. <section class="hidden">
  28. <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
  29. </section>
  30. <section style="height:95vh; padding: 10px 20px;">
  31. <div class="row tbToolBar" id="tbToolBar">
  32. <div class="toolbar" id="CurdTool">
  33. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
  34. <span class="shuxian"></span>
  35. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  36. <span class="shuxian"></span>
  37. <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="btn_Del()">删除</a>
  38. </div>
  39. <div class="toolbar-search">
  40. <span>【请选择查询条件】</span>
  41. <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#search',searcher:LoadTable" style="width: 300px; height: 25px;"/>
  42. <div id="search">
  43. <div data-options="name:'Executor'">检查员</div>
  44. <div data-options="name:'MarketName'">市场名称</div>
  45. </div>
  46. </div>
  47. </div>
  48. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  49. data-options="singleSelect: true,
  50. method: 'post',
  51. multiSort: false,
  52. toolbar: '#tbToolBar',
  53. fitColumns: true,
  54. @*rownumbers: true,*@
  55. remoteSort: false,
  56. @*loadFilter: pagerFilter,*@
  57. onDblClickRow: function () {
  58. btn_Edit();
  59. },
  60. pagination: true,
  61. pageSize: 50,
  62. pageList: [20, 50, 100]
  63. ">
  64. <thead>
  65. <tr>
  66. <th data-options="field:'MarketName',width:100">市场名称</th>
  67. <th data-options="field:'AssessLevelName',width:150">检查结果</th>
  68. <th data-options="field:'LogDate',width:80">检查日期</th>
  69. <th data-options="field:'Executor',width:50">检查员</th>
  70. </tr>
  71. </thead>
  72. </table>
  73. </section>
  74. <section>
  75. <div id="winModal" class="easyui-window winModal" title="卫生检查录入维护" style="width: 450px;height:500px; padding:10px;"
  76. iconCls="icon-save" data-options="modal:true,closed:true">
  77. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  78. <div data-options="region:'center'" style="padding:15px 25px 0;" >
  79. <form id="form">
  80. @Html.Hidden("ID")
  81. <div class="panle-fluid">
  82. <div class="input-group">
  83. <label class="input-group-addon control-label" for="RegionID">所属辖区</label>
  84. <select class="form-control input-group-addon" type="text" id="RegionID" name="RegionID" onchange="GetMarketSelStr();">
  85. <option value="">全部</option>
  86. @Html.Raw(ViewBag.SelRegionInfo)
  87. </select>
  88. </div>
  89. <div class="input-group">
  90. <label class="input-group-addon control-label" for="MarketID">市场名称</label>
  91. <select class="form-control input-group-addon" aria-disabled="true" name="MarketID" id="MarketID" type="text" value="" placeholder="选择市场">
  92. </select>
  93. </div>
  94. <div class="input-group">
  95. <label class="input-group-addon control-label" for="Executor">检查员</label>
  96. <input class="form-control input-group-addon" aria-disabled="true" name="Executor" id="Executor" type="text" value="" placeholder="" />
  97. </div>
  98. <div class="input-group">
  99. <label class="input-group-addon control-label" for="LogDate">检查日期</label>
  100. <input class="form-control input-group-addon laydate-icon" aria-disabled="true" name="LogDate" id="LogDate" type="text" value="" placeholder=""/>
  101. </div>
  102. <div class="input-group">
  103. <label class="input-group-addon control-label" for="AssessLevelID">检查结果</label>
  104. <select class="form-control input-group-addon" aria-disabled="true" name="AssessLevelID" id="AssessLevelID" type="text" value="" placeholder="">
  105. @Html.Raw(ViewBag.SelAssessLevelInfo)
  106. </select>
  107. </div>
  108. <div class="input-group">
  109. <label class="input-group-addon control-label" for="SelfCheckFlag">是否自检</label>
  110. <select class="form-control input-group-addon" aria-disabled="true" name="SelfCheckFlag" id="SelfCheckFlag" type="text" value="" placeholder="">
  111. <option value="1">是</option>
  112. <option value="0">否</option>
  113. </select>
  114. </div>
  115. <div class="input-group">
  116. <label class="input-group-addon control-label" for="FileTitle">附件名称</label>
  117. <input class="form-control input-group-addon" aria-disabled="true" name="FileTitle" id="FileTitle" type="text" value="" placeholder=""/>
  118. </div>
  119. <div class="input-group">
  120. <label class="input-group-addon control-label" for="AttachFile">上传附件</label>
  121. <input class="form-control input-group-addon" aria-disabled="true" name="AttachFile" id="AttachFile" type="file" value="" placeholder="" onchange="FileCheck(this,'fileInfo')" />
  122. <input type="hidden" name="fileInfo" id="fileInfo" value="" />
  123. <input type="hidden" name="fileName" id="fileName" value="" />
  124. <input type="hidden" name="fileExt" id="fileExt" value="" />
  125. </div>
  126. <div class="input-group">
  127. <label class="input-group-addon control-label" for="Reason">备注</label>
  128. <textarea class="form-control input-group-addon" aria-disabled="true" rows="5" name="Reason" id="Reason" type="text" value="" placeholder=""></textarea>
  129. </div>
  130. </div>
  131. </form>
  132. </div>
  133. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  134. <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width:80px">确认</a>
  135. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
  136. </div>
  137. </div>
  138. </div>
  139. </section>
  140. <script>
  141. function FileCheck(that, id) {
  142. FileInputCheck(that, id, false, 100, function (fileName) {
  143. var name = fileName.substring(0, fileName.lastIndexOf("."));
  144. var ext = fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length);
  145. $("#fileName").val(name);
  146. $("#fileExt").val(ext);
  147. });
  148. }
  149. function Save(type) {
  150. type = type || $("#hid_Type").val();
  151. var id = (type === "Add" || type === "Edit") ? $("#ID").val() : $('#dgTable').datagrid('getSelections')[0].ID;
  152. @*$.ajaxFileUpload({
  153. url: "@Url.Action("CleansingCheckLogOper", "MarketSystem")",
  154. secureuri: false, //一般设置为false
  155. fileElementId: 'AttachFile',
  156. type: "post",
  157. dataType: "json",
  158. data: {
  159. Type: type,
  160. UploadFile: "true",
  161. ID: id,
  162. MarketID: $("#MarketID").val(),
  163. AssessLevelID: $("#AssessLevelID").val(),
  164. Executor: $("#Executor").val(),
  165. SelfCheckFlag: $("#SelfCheckFlag").val(),
  166. Reason: $("#Reason").val(),
  167. LogDate: $("#LogDate").val(),
  168. FileTitle: $("#FileTitle").val(),
  169. FileInfo: $("#fileInfo").val(),
  170. FileExt: $("#fileExt").val(),
  171. FileName:$("#fileName").val()
  172. },
  173. success: function (data) {
  174. if (CheckAajxData(data) === false) return;
  175. var msg = data.ErrorInfo;
  176. if (data.Success === true) {
  177. LoadTable();
  178. $("#winModal").window("close");
  179. layer.alert(msg, { icon: 1, title: '提示信息' });
  180. } else {
  181. layer.alert(msg, { icon: 7, title: '提示信息' });
  182. }
  183. }
  184. });*@
  185. $.ajax({
  186. url: "@Url.Action("CleansingCheckLogOper", "MarketSystem")",
  187. type: "post",
  188. dataType: "json",
  189. data: {
  190. Type: type,
  191. UploadFile: "true",
  192. ID: id,
  193. MarketID: $("#MarketID").val(),
  194. AssessLevelID: $("#AssessLevelID").val(),
  195. Executor: $("#Executor").val(),
  196. SelfCheckFlag: $("#SelfCheckFlag").val(),
  197. Reason: $("#Reason").val(),
  198. LogDate: $("#LogDate").val(),
  199. FileTitle: $("#FileTitle").val(),
  200. FileInfo: $("#fileInfo").val(),
  201. FileExt: $("#fileExt").val(),
  202. FileName:$("#fileName").val()
  203. },
  204. success: function (data) {
  205. if (CheckAajxData(data) === false) return;
  206. var msg = data.ErrorInfo;
  207. if (data.Success === true) {
  208. LoadTable();
  209. $("#winModal").window("close");
  210. layer.alert(msg, { icon: 1, title: '提示信息' });
  211. } else {
  212. layer.alert(msg, { icon: 7, title: '提示信息' });
  213. }
  214. }
  215. });
  216. }
  217. //modal赋值
  218. function SetModalVal() {
  219. var rows = $('#dgTable').datagrid('getSelections');
  220. if (rows.length === 1) {
  221. var row = rows[0];
  222. //console.log(row);
  223. GetMarketSelStr();
  224. $("#ID").val(row.ID);
  225. $("#MarketID").val(row.MarketID);
  226. $("#AssessLevelID").val(row.AssessLevelID);
  227. $("#Executor").val(row.Executor);
  228. $("#SelfCheckFlag").val(row.SelfCheckFlag);
  229. $("#Reason").val(row.Reason);
  230. $("#LogDate").val(row.LogDate);
  231. $("#FileTitle").val("");
  232. ClearFile("#AttachFile");
  233. if ($("#hid_Type").val()==="Edit") {
  234. $("#winModal").window("open");
  235. }
  236. } else {
  237. layer.alert('请选择一条记录进行设置', {title:'提示信息'});
  238. }
  239. }
  240. //添加
  241. function btn_Add() {
  242. $("#hid_Type").val("Add");
  243. $("#winModal input").val("");
  244. $("#winModal textarea").val("");
  245. $("#Save span.l-btn-text").html("添加");
  246. GetMarketSelStr();
  247. $("#winModal").window("open");
  248. }
  249. //修改
  250. function btn_Edit() {
  251. $("#hid_Type").val("Edit");
  252. $("#Save span.l-btn-text").html("修改");
  253. //GetMarketSelStr();
  254. SetModalVal();
  255. }
  256. //根据辖区获取市场下拉框的option
  257. function GetMarketSelStr() {
  258. $.ajax({
  259. url: "/GetResult/GetMarketSelStrResult",
  260. type: "post",
  261. dataType: "json",
  262. //data: { RegionID: $("input.textbox-value[name='SearchRegionID']").val() },
  263. data: { RegionID: $("#RegionID").val() },
  264. success: function (data) {
  265. //console.log(msg);
  266. if (CheckAajxData(data) === false) return;
  267. var rows = data.rows;
  268. //var str1 = "<option value=\"";
  269. var str2 = "";
  270. for (var i = 0; i < rows.length; i++) {
  271. //str1 += (str1 === "<option value=\"" ? "" : "@@|@@") + rows[i].MarketID;
  272. str2 += "<option value=\"" + rows[i].MarketID + "\">" + rows[i].Names + "</option>";
  273. }
  274. //str1 += "\">全部</option>";
  275. $('#MarketID').empty().html(str2);
  276. }
  277. });
  278. }
  279. //加载表格数据
  280. function LoadTable(value, item) {
  281. $('#dgTable').datagrid({
  282. url: '@Url.Action("CleansingCheckLogResult", "GetResult")' + '?PcVal=' + escape(value) + '&PcItem=' + item
  283. });
  284. }
  285. function ClearFile(idStr) {
  286. var file = $(idStr);
  287. file.after(file.clone().val(""));
  288. file.remove();
  289. }
  290. $(function () {
  291. //加载表格数据
  292. var value = $(".textbox.searchbox .textbox-value").val(), item = $(".textbox.searchbox .textbox-value").attr("name");
  293. LoadTable(value, item);
  294. //加载日历控件
  295. laydate({
  296. elem: '#LogDate',
  297. format: "YYYY-MM-DD",
  298. min: "1980-01-01",
  299. event: "focus"
  300. });
  301. });
  302. </script>
  303. </body>
  304. </html>