MarketInspectFacilityList.cshtml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>MarketInspectFacilityList</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. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  23. <script src="~/Content/js/js/MarketJs.js"></script>
  24. </head>
  25. <body >
  26. <section class="hidden">
  27. <input id="hid_Type" name="hid_Type" type="hidden" value="0"/>
  28. <input id="hidSetSearch_Type" name="hidSetSearch_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-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
  34. <span class="shuxian"></span>*@
  35. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
  36. <span class="shuxian"></span>
  37. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  38. <span class="shuxian"></span>
  39. <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="btn_Del()">删除</a>
  40. </div>
  41. <div class="toolbar-search">
  42. <span>【请选择查询条件】</span>
  43. <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#search',searcher:LoadTable" style="width: 300px; height: 25px;"/>
  44. <div id="search">
  45. @*<div data-options="name:'RoomSize'">检测场所面积</div>
  46. <div data-options="name:'InspectorCount'">检测人员数</div>*@
  47. <div data-options="name:'InspectorFacility'">检测设备名称</div>
  48. </div>
  49. </div>
  50. </div>
  51. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  52. data-options="singleSelect: true,
  53. method: 'post',
  54. multiSort: false,
  55. toolbar: '#tbToolBar',
  56. fitColumns: true,
  57. @*rownumbers: true,*@
  58. remoteSort: false,
  59. @*loadFilter: pagerFilter,*@
  60. onDblClickRow: function () {
  61. btn_Edit();
  62. },
  63. pagination: true,
  64. pageSize: 50,
  65. pageList: [20, 50, 100]
  66. ">
  67. <thead>
  68. <tr>
  69. <th data-options="field:'RoomSize',width:60">检测场所面积</th>
  70. <th data-options="field:'InspectorCount',width:80">检测人员数</th>
  71. <th data-options="field:'InspectorFacility',width:50">检测设备名称</th>
  72. </tr>
  73. </thead>
  74. </table>
  75. </section>
  76. <section>
  77. <div id="winModal" class="easyui-window winModal" title="检测设施登记录入维护" style="width: 450px; padding: 10px;"
  78. iconCls="icon-save" data-options="modal:true,closed:true">
  79. <div class="easyui-layout" data-options="fit:true" style="height: 99%">
  80. <div data-options="region:'center'" style="padding: 15px 25px 0;">
  81. <form id="form">
  82. @Html.Hidden("ID")
  83. <div class="panle-fluid">
  84. <span class="text-info" style="margin-top: 10px;letter-spacing:3px; display: inline-block;font-size:15px;">检测设施明细</span>
  85. <hr class="text-info" style="margin:5px 0 -2px;" />
  86. <div class="input-group">
  87. <label class="input-group-addon control-label" for="RoomSize">检测场所面积</label>
  88. <input class="form-control input-group-addon" aria-disabled="true" name="RoomSize" id="RoomSize" type="text" value="" placeholder=""/>
  89. <span class="input-group-addon control-label">平方米</span>
  90. </div>
  91. <div class="input-group">
  92. <label class="input-group-addon control-label" for="InspectorCount">检测人员数</label>
  93. <input class="form-control input-group-addon" aria-disabled="true" name="InspectorCount" id="InspectorCount" type="text" value="" placeholder=""/>
  94. </div>
  95. <div class="input-group">
  96. <label class="input-group-addon control-label" for="InspectorFacility">检测设备名称</label>
  97. <input class="form-control input-group-addon" aria-disabled="true" name="InspectorFacility" id="InspectorFacility" type="text" value="" placeholder=""/>
  98. </div>
  99. <span class="text-info" style="margin-top: 10px;letter-spacing:3px; display: inline-block;font-size:15px;">检测人员明细</span>
  100. <hr class="text-info" style="margin:5px 0 -2px;" />
  101. <div class="input-group">
  102. <label class="input-group-addon control-label" for="Inspector1Name">姓名</label>
  103. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector1Name" id="Inspector1Name" type="text" value="" placeholder="" />
  104. </div>
  105. <div class="input-group">
  106. <label class="input-group-addon control-label" for="Inspector1Gender">性别</label>
  107. <select class="form-control input-group-addon" aria-disabled="true" name="Inspector1Gender" id="Inspector1Gender" type="text" value="" placeholder="">
  108. <option value="">请选择...</option>
  109. <option value="1">男</option>
  110. <option value="0">女</option>
  111. </select>
  112. </div>
  113. <div class="input-group">
  114. <label class="input-group-addon control-label" for="Inspector1Age">年龄</label>
  115. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector1Age" id="Inspector1Age" type="text" value="" placeholder="" />
  116. </div>
  117. <div class="input-group">
  118. <label class="input-group-addon control-label" for="Inspector1DegreeTypeID">学历</label>
  119. <select class="form-control input-group-addon" aria-disabled="true" name="Inspector1DegreeTypeID" id="Inspector1DegreeTypeID" type="text" value="" placeholder="">
  120. <option value="">请选择...</option>
  121. @Html.Raw(ViewBag.SelDegreeTypeInfo)
  122. </select>
  123. </div>
  124. <div class="input-group">
  125. <label class="input-group-addon control-label" for="Inspector1Tel">电话</label>
  126. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector1Tel" id="Inspector1Tel" type="text" value="" placeholder="" />
  127. </div>
  128. <div class="input-group">
  129. <label class="input-group-addon control-label" for="Inspector2Name">姓名</label>
  130. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector2Name" id="Inspector2Name" type="text" value="" placeholder="" />
  131. </div>
  132. <div class="input-group">
  133. <label class="input-group-addon control-label" for="Inspector2Gender">性别</label>
  134. <select class="form-control input-group-addon" aria-disabled="true" name="Inspector2Gender" id="Inspector2Gender" type="text" value="" placeholder="">
  135. <option value="">请选择...</option>
  136. <option value="1">男</option>
  137. <option value="0">女</option>
  138. </select>
  139. </div>
  140. <div class="input-group">
  141. <label class="input-group-addon control-label" for="Inspector2Age">年龄</label>
  142. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector2Age" id="Inspector2Age" type="text" value="" placeholder="" />
  143. </div>
  144. <div class="input-group">
  145. <label class="input-group-addon control-label" for="Inspector2DegreeTypeID">学历</label>
  146. <select class="form-control input-group-addon" aria-disabled="true" name="Inspector2DegreeTypeID" id="Inspector2DegreeTypeID" type="text" value="" placeholder="">
  147. <option value="">请选择...</option>
  148. @Html.Raw(ViewBag.SelDegreeTypeInfo)
  149. </select>
  150. </div>
  151. <div class="input-group">
  152. <label class="input-group-addon control-label" for="Inspector2Tel">电话</label>
  153. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector2Tel" id="Inspector2Tel" type="text" value="" placeholder="" />
  154. </div>
  155. <div class="input-group">
  156. <label class="input-group-addon control-label" for="Inspector3Name">姓名</label>
  157. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector3Name" id="Inspector3Name" type="text" value="" placeholder="" />
  158. </div>
  159. <div class="input-group">
  160. <label class="input-group-addon control-label" for="Inspector3Gender">性别</label>
  161. <select class="form-control input-group-addon" aria-disabled="true" name="Inspector3Gender" id="Inspector3Gender" type="text" value="" placeholder="">
  162. <option value="">请选择...</option>
  163. <option value="1">男</option>
  164. <option value="0">女</option>
  165. </select>
  166. </div>
  167. <div class="input-group">
  168. <label class="input-group-addon control-label" for="Inspector3Age">年龄</label>
  169. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector3Age" id="Inspector3Age" type="text" value="" placeholder="" />
  170. </div>
  171. <div class="input-group">
  172. <label class="input-group-addon control-label" for="Inspector3DegreeTypeID">学历</label>
  173. <select class="form-control input-group-addon" aria-disabled="true" name="Inspector3DegreeTypeID" id="Inspector3DegreeTypeID" type="text" value="" placeholder="">
  174. <option value="">请选择...</option>
  175. @Html.Raw(ViewBag.SelDegreeTypeInfo)
  176. </select>
  177. </div>
  178. <div class="input-group">
  179. <label class="input-group-addon control-label" for="Inspector3Tel">电话</label>
  180. <input class="form-control input-group-addon" aria-disabled="true" name="Inspector3Tel" id="Inspector3Tel" type="text" value="" placeholder="" />
  181. </div>
  182. </div>
  183. </form>
  184. </div>
  185. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  186. <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width: 80px">确认</a>
  187. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width: 80px">取消</a>
  188. </div>
  189. </div>
  190. </div>
  191. </section>
  192. <script>
  193. function Save(type) {
  194. type = type || $("#hid_Type").val();
  195. //var violationsNo = (type === "Add" || type === "Edit") ? $("#ID").val() : $('#dgTable').datagrid('getSelections')[0].ID;
  196. $.ajax({
  197. url: "@Url.Action("MarketInspectFacilityOper", "MarketSystemMg")",
  198. type: "post",
  199. dataType: "json",
  200. data: {
  201. Type: type,
  202. ID: $("#ID").val(),
  203. RoomSize: $("#RoomSize").val(),
  204. InspectorCount: $("#InspectorCount").val(),
  205. InspectorFacility: $("#InspectorFacility").val(),
  206. Inspector1Name: $("#Inspector1Name").val(),
  207. Inspector1Gender: $("#Inspector1Gender").val(),
  208. Inspector1Age: $("#Inspector1Age").val(),
  209. Inspector1DegreeTypeID: $("#Inspector1DegreeTypeID").val(),
  210. Inspector1Tel: $("#Inspector1Tel").val(),
  211. Inspector2Name: $("#Inspector2Name").val(),
  212. Inspector2Gender: $("#Inspector2Gender").val(),
  213. Inspector2Age: $("#Inspector2Age").val(),
  214. Inspector2DegreeTypeID: $("#Inspector2DegreeTypeID").val(),
  215. Inspector2Tel: $("#Inspector2Tel").val(),
  216. Inspector3Name: $("#Inspector3Name").val(),
  217. Inspector3Gender: $("#Inspector3Gender").val(),
  218. Inspector3Age: $("#Inspector3Age").val(),
  219. Inspector3DegreeTypeID: $("#Inspector3DegreeTypeID").val(),
  220. Inspector3Tel: $("#Inspector3Tel").val()
  221. },
  222. success: function(data) {
  223. if (CheckAajxData(data) === false) return;
  224. var msg = data.ErrorInfo;
  225. if (data.Success === true) {
  226. LoadTable();
  227. $("#winModal").window("close");
  228. layer.alert(msg, { icon: 1, title: '提示信息' });
  229. } else {
  230. layer.alert(msg, { icon: 7, title: '提示信息' });
  231. }
  232. }
  233. });
  234. }
  235. //添加
  236. function btn_Add() {
  237. $("#hid_Type").val("Add");
  238. $("#winModal input").val("");
  239. $("#winModal select").val("");
  240. $("#winModal textarea").val("");
  241. $("#Save span.l-btn-text").html("添加");
  242. $("#winModal").window("open");
  243. }
  244. //修改
  245. function btn_Edit() {
  246. $("#hid_Type").val("Edit");
  247. $("#Save span.l-btn-text").html("修改");
  248. SetModalVal();
  249. }
  250. //modal赋值
  251. function SetModalVal() {
  252. var rows = $('#dgTable').datagrid('getSelections');
  253. if (rows.length === 1) {
  254. var row = rows[0];
  255. //console.log(row);
  256. $("#ID").val(row.ID);
  257. $("#RoomSize").val(row.RoomSize);
  258. $("#InspectorCount").val(row.InspectorCount);
  259. $("#InspectorFacility").val(row.InspectorFacility);
  260. $("#Inspector1Name").val(row.Inspector1Name);
  261. $("#Inspector1Gender").val(row.Inspector1Gender);
  262. $("#Inspector1Age").val(row.Inspector1Age);
  263. $("#Inspector1DegreeTypeID").val(row.Inspector1DegreeTypeID);
  264. $("#Inspector1Tel").val(row.Inspector1Tel);
  265. $("#Inspector2Name").val(row.Inspector2Name);
  266. $("#Inspector2Gender").val(row.Inspector2Gender);
  267. $("#Inspector2Age").val(row.Inspector2Age);
  268. $("#Inspector2DegreeTypeID").val(row.Inspector2DegreeTypeID);
  269. $("#Inspector2Tel").val(row.Inspector2Tel);
  270. $("#Inspector3Name").val(row.Inspector3Name);
  271. $("#Inspector3Gender").val(row.Inspector3Gender);
  272. $("#Inspector3Age").val(row.Inspector3Age);
  273. $("#Inspector3DegreeTypeID").val(row.Inspector3DegreeTypeID);
  274. $("#Inspector3Tel").val(row.Inspector3Tel);
  275. if ($("#hid_Type").val() === "Edit") {
  276. $("#winModal").window("open");
  277. }
  278. } else {
  279. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  280. }
  281. }
  282. //加载表格数据
  283. function LoadTable(value, item) {
  284. $('#dgTable').datagrid({
  285. url: '@Url.Action("MarketInspectFacilityResult", "GetResult")' + '?PcVal=' + escape(value) + '&PcItem=' + item
  286. });
  287. }
  288. $(function() {
  289. //加载表格数据
  290. var value = $(".textbox.searchbox .textbox-value").val(), item = $(".textbox.searchbox .textbox-value").attr("name");
  291. LoadTable(value, item);
  292. //加载日历控件
  293. //laydate({
  294. // elem: '#InspectorCount',
  295. // format: "YYYY-MM-DD",
  296. // min: "1980-01-01",
  297. // event: "focus"
  298. //});
  299. });
  300. </script>
  301. </body>
  302. </html>