detailProjDept.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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 class="layui-icon">&#xe65c;</i>返回</button>
  80. </div>
  81. </div>
  82. <div class="layui-card-body">
  83. <!--项目部名称-->
  84. <form class="layui-form" id="thisform" lay-filter="thisform" style="width:1200px;margin-left:6%;">
  85. <input type="hidden" name="cId" id="cId"/>
  86. <input type="hidden" name="id" id="id"/>
  87. <div class="layui-form-item">
  88. <label class="layui-form-label">项目部名称:</label>
  89. <div class="layui-input-block">
  90. <input type="text" class="layui-input" readonly id="name" name="name"
  91. maxlength="180" style="width:663px;"/>
  92. </div>
  93. </div>
  94. <div class="layui-form-item">
  95. <label class="layui-form-label">&nbsp;</label>
  96. <div class="layui-input-block" style="padding-left: 200px;padding-top: 30px;font-size: 17px;">五牌一图</div>
  97. </div>
  98. <div class="layui-form-item">
  99. <label class="layui-form-label">工程概况牌:</label>
  100. <div class="layui-input-block text-left">
  101. <div id="fileDiv0" style="padding-top: 10px;"></div>
  102. </div>
  103. </div>
  104. <div class="layui-form-item">
  105. <label class="layui-form-label">管理人员名单及监督电话牌:</label>
  106. <div class="layui-input-block text-left">
  107. <div id="fileDiv1" style="padding-top: 10px;"></div>
  108. </div>
  109. </div>
  110. <div class="layui-form-item">
  111. <label class="layui-form-label">消防保卫牌:</label>
  112. <div class="layui-input-block text-left">
  113. <div id="fileDiv2" style="padding-top: 10px;"></div>
  114. </div>
  115. </div>
  116. <div class="layui-form-item">
  117. <label class="layui-form-label">安全生产牌:</label>
  118. <div class="layui-input-block text-left">
  119. <div id="fileDiv3" style="padding-top: 10px;"></div>
  120. </div>
  121. </div>
  122. <div class="layui-form-item">
  123. <label class="layui-form-label">文明施工牌:</label>
  124. <div class="layui-input-block text-left">
  125. <div id="fileDiv4" style="padding-top: 10px;"></div>
  126. </div>
  127. </div>
  128. <div class="layui-form-item">
  129. <label class="layui-form-label">施工现场平面图:</label>
  130. <div class="layui-input-block text-left">
  131. <div id="fileDiv5" style="padding-top: 10px;"></div>
  132. </div>
  133. </div>
  134. </form>
  135. </div>
  136. </div>
  137. </div>
  138. </form>
  139. <!-- js部分 -->
  140. <script type="text/javascript" src="../../../assets/libs/layui/layui.js"></script>
  141. <script type="text/javascript" src="../../../assets/js/common.js?v=312"></script>
  142. <script>
  143. var uploadIndex = 0;
  144. var $;
  145. layui.use(['layer' ,'form' ,'admin' ,'zTree' ,'uParas' ,'laydate' ,'citypicker','upload'] ,function(){
  146. $ = layui.jquery;
  147. var layer = layui.layer;
  148. var form = layui.form;
  149. var admin = layui.admin;
  150. var uParas = layui.uParas;
  151. var laydate= layui.laydate;
  152. var cityPicker = layui.citypicker;
  153. var upload = layui.upload;
  154. var cId = uParas.getUrlParam('cId');
  155. var url1 = uParas.baseUrl + '/gent/company/getProjDept/'+ cId;
  156. admin.req(url1 ,{} ,function(resp) {
  157. if (resp.code == 1) {
  158. form.val('thisform',resp.data ); // 回显数据
  159. var data = resp.data;
  160. // $('#id').val(data.id);
  161. // $('#name').val(data.name);
  162. renderUploadFile(0, data.attachOne, data.attachNameOne);
  163. renderUploadFile(1, data.attachTwo, data.attachNameTwo);
  164. renderUploadFile(2, data.attachThree, data.attachNameThree);
  165. renderUploadFile(3, data.attachFour, data.attachNameFour);
  166. renderUploadFile(4, data.attachFive, data.attachNameFive);
  167. renderUploadFile(5, data.attachSix, data.attachNameSix);
  168. } else {
  169. layer.msg(resp.msg)
  170. }
  171. },'GET');
  172. form.verify({
  173. qymc: function(value) {
  174. if (value.length < 4) {
  175. return '公司名称至少4个字符!'
  176. }
  177. },
  178. // phone: [/^1\d{10}$/,'手机必须11位,只能是数字!'],
  179. // email: [/^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$|^1[3|4|5|7|8]\d{9}$/, '邮箱格式不对'],
  180. });
  181. //上传实例
  182. // upload.render({
  183. // // elem: '#test1', //绑定元素
  184. // elem: 'button[name="uploadBtn"]',
  185. // url: uParas.baseUrl+'/admin/uploadFile', //上传接口
  186. // accept:'image',
  187. // size:30720,//设置文件最大可允许上传的大小,单位 KB。不支持ie8/9
  188. // done: function(response){
  189. // $("#img_" + uploadIndex).remove();
  190. //
  191. // //debugger
  192. // //上传完毕回调
  193. // //var response = eval('(' + responseObject.response + ')');
  194. // var ext = response.data.ext;
  195. // //文件图标
  196. // var icon = '';
  197. // if(ext === 'bmp' || ext === 'jpg' || ext === 'jpeg' || ext === 'png' || ext === 'gif'){
  198. // icon = '<img style="width: 30px;height: 30px;" src="/assets/module/img/uploader/img.png" alt="">';
  199. // }
  200. // //文件信息置入隐藏域
  201. // var html = '';
  202. // html+='<div id="img_'+ uploadIndex +'" style="height: 30px;padding-top: 6px;padding-right: 10px;" class="note note-danger note-bordered">';
  203. // // html+='<input type="hidden" name="attachTitle" value="' + response.data.oriFileName + '"/>';
  204. // var attachName = '';
  205. // var attachFileName = '';
  206. // switch (uploadIndex) {
  207. // case 0: attachName = 'attachOne'; attachFileName = 'attachNameOne'; break;
  208. // case 1: attachName = 'attachTwo'; attachFileName = 'attachNameTwo'; break;
  209. // case 2: attachName = 'attachThree'; attachFileName = 'attachNameThree'; break;
  210. // case 3: attachName = 'attachFour'; attachFileName = 'attachNameFour'; break;
  211. // case 4: attachName = 'attachFive'; attachFileName = 'attachNameFive'; break;
  212. // default : attachName = 'attachSix'; attachFileName = 'attachNameSix';;
  213. // }
  214. // html+='<input type="hidden" name="'+ attachName +'" value="' + response.data.path + '"/>';
  215. // html+='<input type="hidden" name="'+ attachFileName +'" value="' + response.data.oriFileName + '"/>';
  216. // // html+='<input type="hidden" name="attachExt" value="' + response.data.ext + '"/>';
  217. // html+=icon;
  218. // html+='<a style="color: blueviolet;margin-left: 19px;" target="_blank" href="' + response.data.path + '">' + response.data.oriFileName + '</a>';
  219. // // html+='<a style="margin-left: 37px;color: indianred;float: right;margin-top: 5px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
  220. // html+='<a onclick="deleteFile(this)">删除</a>';
  221. // html+='</div>';
  222. // $("#fileDiv" + uploadIndex).append(html);
  223. //
  224. // renderUploadFile(uploadIndex);
  225. // }
  226. // ,error: function() {
  227. // //请求异常回调
  228. // }
  229. // });
  230. function renderUploadFile(index, path, fileName) {
  231. if (fileName && fileName.length > 0 && path && path.length > 0) {
  232. //文件信息置入隐藏域
  233. // var icon = '<img style="width: 30px;height: 30px;" src="/assets/module/img/uploader/img.png" alt="">';
  234. var html = '';
  235. html+='<div id="img_'+ index +'" style="height: 30px;padding-top: 6px;padding-right: 10px;" class="note note-danger note-bordered">';
  236. // html+='<input type="hidden" name="attachTitle" value="' + response.data.oriFileName + '"/>';
  237. var attachName = '';
  238. switch (index) {
  239. case 0: attachName = 'attachOne'; break;
  240. case 1: attachName = 'attachTwo'; break;
  241. case 2: attachName = 'attachThree'; break;
  242. case 3: attachName = 'attachFour'; break;
  243. case 4: attachName = 'attachFive'; break;
  244. default : attachName = 'attachSix';
  245. }
  246. // html+='<input type="hidden" name="'+ attachName +'" value="' + path + '"/>';
  247. // html+='<input type="hidden" name="attachExt" value="' + response.data.ext + '"/>';
  248. // html+=icon;
  249. html+='<a style="color: blueviolet;margin-left: 19px;" target="_blank" href="' + path + '">' + fileName + '</a>';
  250. // html+='<a style="margin-left: 37px;color: indianred;float: right;margin-top: 5px;" class="delete-upImg" onclick="deleteFile(this)">删除</a>';
  251. // html+='<a onclick="deleteFile(this)">删除</a>';
  252. html+='</div>';
  253. $("#fileDiv" + index).append(html);
  254. }
  255. }
  256. // 更新
  257. // form.on('submit(formSubmit)' ,function(data) {
  258. // layer.load();
  259. //
  260. // var url = uParas.baseUrl + '/gent/company/updateProjDept';
  261. // admin.req(url ,data.field ,function(resp){
  262. // layer.closeAll('loading');
  263. // if (resp.code == 1) {
  264. // layer.msg(resp.msg);
  265. // location.href ='./index.html';
  266. // } else {
  267. // layer.msg(resp.msg);
  268. // }
  269. // }, 'POST');
  270. //
  271. // return false;
  272. // });
  273. });
  274. //删除附件
  275. // function deleteFile(obj) {
  276. // var pDiv = $(obj).parent();
  277. // pDiv.remove();
  278. // }
  279. </script>
  280. </body>
  281. </html>