detailProjDept.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>企业管理</title>
  8. <link rel="stylesheet" href="../../../assets/libs/layui/css/layui.css"/>
  9. <link rel="stylesheet" href="../../../assets/module/formSelects/formSelects-v4.css"/>
  10. <link rel="stylesheet" href="../../../assets/module/city-picker/city-picker.css"/>
  11. <link rel="stylesheet" href="../../../assets/module/zTree/css/metroStyle/metroStyle.css"/>
  12. <link rel="stylesheet" href="../../../assets/module/admin.css?v=312"/>
  13. <link rel="stylesheet" href="../../../assets/module/uParas.css?v=312"/>
  14. <script src="../../../assets/module/city-picker/city-picker.data.js"></script>
  15. <style>
  16. .layui-form-item {
  17. margin-bottom: 0px !important;
  18. }
  19. .layui-form-label {
  20. width: 230px !important;
  21. margin-top: 2px !important;
  22. }
  23. .layui-input-inline {
  24. min-height: 36px;
  25. margin-top: 2px !important;
  26. }
  27. .layui-input-block {
  28. margin-left: 260px !important;
  29. min-height: 36px;
  30. margin-top: 2px !important;
  31. }
  32. /* 城市选择器自适应宽度 */
  33. .city-picker-span {
  34. width: auto !important;
  35. padding-right: 20px !important;;
  36. min-width: 163px !important;;
  37. }
  38. /* 日期组件不显示秒 */
  39. .laydate-time-list li:last-child {
  40. display: none;
  41. }
  42. .laydate-time-list li {
  43. width: 50% !important;
  44. }
  45. .laydate-time-list ol li {
  46. padding-left: 55px !important;
  47. width: 100% !important;
  48. }
  49. .menuContent {
  50. width: 368px;
  51. /*max-width: 678px;*/
  52. /*min-width: 264px;*/
  53. display: none;
  54. position: absolute;
  55. top: 32px;
  56. left: 0px;
  57. background-color: #fff;
  58. z-index: 10;
  59. border: 1px solid #ccc;
  60. }
  61. .ztree * {
  62. font-size: 13px;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <!-- 页面加载loading -->
  68. <div class="page-loading">
  69. <div class="ball-loader">
  70. <span></span><span></span><span></span><span></span>
  71. </div>
  72. </div>
  73. <!-- 正文开始 -->
  74. <div class="layui-fluid">
  75. <div class="layui-card" style="padding-bottom :75px;">
  76. <div class="layui-card-header">
  77. 项目部信息
  78. <div class="layui-inline pull-right">
  79. <button onclick="history.back()" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-normal"><i
  80. class="layui-icon">&#xe65c;</i>返回
  81. </button>
  82. </div>
  83. </div>
  84. <div class="layui-card-body">
  85. <!--项目部名称-->
  86. <form class="layui-form" id="thisform" lay-filter="thisform" style="width:1200px;margin-left:6%;">
  87. <input type="hidden" name="cId" id="cId"/>
  88. <input type="hidden" name="id" id="id"/>
  89. <div class="layui-form-item">
  90. <label class="layui-form-label">项目部名称:</label>
  91. <div class="layui-input-block">
  92. <input type="text" class="layui-input" readonly id="name" name="name"
  93. maxlength="180" style="width:663px;"/>
  94. </div>
  95. </div>
  96. <div class="layui-form-item">
  97. <label class="layui-form-label">&nbsp;</label>
  98. <div class="layui-input-block" style="padding-left: 200px;padding-top: 30px;font-size: 17px;">五牌一图
  99. </div>
  100. </div>
  101. <div class="layui-form-item">
  102. <label class="layui-form-label">工程概况牌:</label>
  103. <div class="layui-input-block text-left">
  104. <div id="fileDiv0" style="padding-top: 10px;"></div>
  105. </div>
  106. </div>
  107. <div class="layui-form-item">
  108. <label class="layui-form-label">管理人员名单及监督电话牌:</label>
  109. <div class="layui-input-block text-left">
  110. <div id="fileDiv1" style="padding-top: 10px;"></div>
  111. </div>
  112. </div>
  113. <div class="layui-form-item">
  114. <label class="layui-form-label">消防保卫牌:</label>
  115. <div class="layui-input-block text-left">
  116. <div id="fileDiv2" style="padding-top: 10px;"></div>
  117. </div>
  118. </div>
  119. <div class="layui-form-item">
  120. <label class="layui-form-label">安全生产牌:</label>
  121. <div class="layui-input-block text-left">
  122. <div id="fileDiv3" style="padding-top: 10px;"></div>
  123. </div>
  124. </div>
  125. <div class="layui-form-item">
  126. <label class="layui-form-label">文明施工牌:</label>
  127. <div class="layui-input-block text-left">
  128. <div id="fileDiv4" style="padding-top: 10px;"></div>
  129. </div>
  130. </div>
  131. <div class="layui-form-item">
  132. <label class="layui-form-label">施工现场平面图:</label>
  133. <div class="layui-input-block text-left">
  134. <div id="fileDiv5" style="padding-top: 10px;"></div>
  135. </div>
  136. </div>
  137. </form>
  138. </div>
  139. </div>
  140. </div>
  141. </form>
  142. <!-- js部分 -->
  143. <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
  144. <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
  145. <script>
  146. var uploadIndex = 0;
  147. var $;
  148. layui.use(['layer', 'form', 'admin', 'zTree', 'uParas', 'laydate', 'citypicker', 'upload'], function () {
  149. $ = layui.jquery;
  150. var layer = layui.layer;
  151. var form = layui.form;
  152. var admin = layui.admin;
  153. var uParas = layui.uParas;
  154. var laydate = layui.laydate;
  155. var cityPicker = layui.citypicker;
  156. var upload = layui.upload;
  157. var cId = uParas.getUrlParam('cId');
  158. var url1 = uParas.baseUrl + '/gent/company/getProjDept/' + cId;
  159. admin.req(url1, {}, function (resp) {
  160. if (resp.code == 1) {
  161. form.val('thisform', resp.data); // 回显数据
  162. var data = resp.data;
  163. // $('#id').val(data.id);
  164. // $('#name').val(data.name);
  165. renderUploadFile(0, data.attachOne, data.attachNameOne);
  166. renderUploadFile(1, data.attachTwo, data.attachNameTwo);
  167. renderUploadFile(2, data.attachThree, data.attachNameThree);
  168. renderUploadFile(3, data.attachFour, data.attachNameFour);
  169. renderUploadFile(4, data.attachFive, data.attachNameFive);
  170. renderUploadFile(5, data.attachSix, data.attachNameSix);
  171. } else {
  172. layer.msg(resp.msg)
  173. }
  174. }, 'GET');
  175. form.verify({
  176. qymc: function (value) {
  177. if (value.length < 4) {
  178. return '公司名称至少4个字符!'
  179. }
  180. },
  181. // phone: [/^1\d{10}$/,'手机必须11位,只能是数字!'],
  182. // email: [/^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$|^1[3|4|5|7|8]\d{9}$/, '邮箱格式不对'],
  183. });
  184. //上传实例
  185. // upload.render({
  186. // // elem: '#test1', //绑定元素
  187. // elem: 'button[name="uploadBtn"]',
  188. // url: uParas.baseUrl+'/admin/uploadFile', //上传接口
  189. // accept:'image',
  190. // size:30720,//设置文件最大可允许上传的大小,单位 KB。不支持ie8/9
  191. // done: function(response){
  192. // $("#img_" + uploadIndex).remove();
  193. //
  194. // //debugger
  195. // //上传完毕回调
  196. // //var response = eval('(' + responseObject.response + ')');
  197. // var ext = response.data.ext;
  198. // //文件图标
  199. // var icon = '';
  200. // if(ext === 'bmp' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif'){
  201. // icon = '<img style="width: 30px;height: 30px;" src="/assets/module/img/uploader/img.png" alt="">';
  202. // }
  203. // //文件信息置入隐藏域
  204. // var html = '';
  205. // html+='<div id="img_'+ uploadIndex +'" style="height: 30px;padding-top: 6px;padding-right: 10px;" class="note note-danger note-bordered">';
  206. // // html+='<input type="hidden" name="attachTitle" value="' + response.data.oriFileName + '"/>';
  207. // var attachName = '';
  208. // var attachFileName = '';
  209. // switch (uploadIndex) {
  210. // case 0: attachName = 'attachOne'; attachFileName = 'attachNameOne'; break;
  211. // case 1: attachName = 'attachTwo'; attachFileName = 'attachNameTwo'; break;
  212. // case 2: attachName = 'attachThree'; attachFileName = 'attachNameThree'; break;
  213. // case 3: attachName = 'attachFour'; attachFileName = 'attachNameFour'; break;
  214. // case 4: attachName = 'attachFive'; attachFileName = 'attachNameFive'; break;
  215. // default : attachName = 'attachSix'; attachFileName = 'attachNameSix';;
  216. // }
  217. // html+='<input type="hidden" name="'+ attachName +'" value="' + response.data.path + '"/>';
  218. // html+='<input type="hidden" name="'+ attachFileName +'" value="' + response.data.oriFileName + '"/>';
  219. // // html+='<input type="hidden" name="attachExt" value="' + response.data.ext + '"/>';
  220. // html+=icon;
  221. // html+='<a style="color: blueviolet;margin-left: 19px;" target="_blank" href="' + response.data.path + '">' + response.data.oriFileName + '</a>';
  222. // // html+='<a style="margin-left: 37px;color: indianred;float: right;margin-top: 5px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
  223. // html+='<a onclick="deleteFile(this)">删除</a>';
  224. // html+='</div>';
  225. // $("#fileDiv" + uploadIndex).append(html);
  226. //
  227. // renderUploadFile(uploadIndex);
  228. // }
  229. // ,error: function() {
  230. // //请求异常回调
  231. // }
  232. // });
  233. function renderUploadFile(index, path, fileName) {
  234. if (fileName && fileName.length > 0 && path && path.length > 0) {
  235. //文件信息置入隐藏域
  236. // var icon = '<img style="width: 30px;height: 30px;" src="/assets/module/img/uploader/img.png" alt="">';
  237. var html = '';
  238. html += '<div id="img_' + index + '" style="height: 30px;padding-top: 6px;padding-right: 10px;" class="note note-danger note-bordered">';
  239. // html+='<input type="hidden" name="attachTitle" value="' + response.data.oriFileName + '"/>';
  240. var attachName = '';
  241. switch (index) {
  242. case 0:
  243. attachName = 'attachOne';
  244. break;
  245. case 1:
  246. attachName = 'attachTwo';
  247. break;
  248. case 2:
  249. attachName = 'attachThree';
  250. break;
  251. case 3:
  252. attachName = 'attachFour';
  253. break;
  254. case 4:
  255. attachName = 'attachFive';
  256. break;
  257. default :
  258. attachName = 'attachSix';
  259. }
  260. // html+='<input type="hidden" name="'+ attachName +'" value="' + path + '"/>';
  261. // html+='<input type="hidden" name="attachExt" value="' + response.data.ext + '"/>';
  262. // html+=icon;
  263. html += '<a style="color: blueviolet;margin-left: 19px;" target="_blank" href="' + path + '">' + fileName + '</a>';
  264. // html+='<a style="margin-left: 37px;color: indianred;float: right;margin-top: 5px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
  265. // html+='<a onclick="deleteFile(this)">删除</a>';
  266. html += '</div>';
  267. $("#fileDiv" + index).append(html);
  268. }
  269. }
  270. // 更新
  271. // form.on('submit(formSubmit)' ,function(data) {
  272. // layer.load();
  273. //
  274. // var url = uParas.baseUrl + '/gent/company/updateProjDept';
  275. // admin.req(url ,data.field ,function(resp){
  276. // layer.closeAll('loading');
  277. // if (resp.code == 1) {
  278. // layer.msg(resp.msg);
  279. // location.href ='./index.html';
  280. // } else {
  281. // layer.msg(resp.msg);
  282. // }
  283. // }, 'POST');
  284. //
  285. // return false;
  286. // });
  287. });
  288. //删除附件
  289. // function deleteFile(obj) {
  290. // var pDiv = $(obj).parent();
  291. // pDiv.remove();
  292. // }
  293. </script>
  294. </body>
  295. </html>