adddeliverylist.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style type="text/css">
  45. .multi-img-details, .multi-audio-details {
  46. width: 100%;
  47. max-width: 700px;
  48. padding: 0;
  49. margin: 0;
  50. margin-top: .5em;
  51. }
  52. .input-group {
  53. position: relative;
  54. display: table;
  55. border-collapse: separate;
  56. }
  57. .multi-audio-details .multi-audio-item {
  58. width: 155px;
  59. height: 40px;
  60. position: relative;
  61. float: left;
  62. margin-right: 5px;
  63. }
  64. .multi-audio-details .btn-default {
  65. background: #eee !important;
  66. color: #6b6b6b;
  67. border: 1px solid #efefef !important;
  68. outline: none;
  69. }
  70. .multi-img-details .multi-item {
  71. max-height: 100px;
  72. max-width: 100px;
  73. position: relative;
  74. float: left;
  75. margin-right: 18px;
  76. margin-top: 10px;
  77. height: auto;
  78. }
  79. .multi-img-details .multi-item img {
  80. max-height: 100px;
  81. max-width: 100px;
  82. }
  83. .img-thumbnail {
  84. display: inline-block;
  85. max-width: 100%;
  86. height: auto;
  87. padding: 4px;
  88. line-height: 1.42857143;
  89. background-color: #fff;
  90. border: 1px solid #ddd;
  91. border-radius: 4px;
  92. -webkit-transition: all .2s ease-in-out;
  93. -o-transition: all .2s ease-in-out;
  94. transition: all .2s ease-in-out;
  95. }
  96. .img-thumbnail {
  97. border-radius: 0 !important;
  98. }
  99. .multi-img-details .img-nickname {
  100. position: absolute;
  101. line-height: 25px;
  102. height: 25px;
  103. color: #fff;
  104. text-align: center;
  105. width: 90px;
  106. left: 5px;
  107. top: 8px;
  108. background: rgba(0,0,0,0.8);
  109. }
  110. .multi-img-details .multi-item em {
  111. position: absolute;
  112. top: 0;
  113. right: -14px;
  114. }
  115. </style>
  116. </head>
  117. <body layadmin-themealias="default">
  118. <div class="layui-fluid">
  119. <div class="layui-card">
  120. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if( !empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?><?php if( !empty($item['id'])){ ?>({$item['name']})<?php } ?></span></div>
  121. <div class="layui-card-body" style="padding:15px;">
  122. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  123. <input type="hidden" name="data[id]" value="{$item['id']}"/>
  124. <div class="layui-form-item">
  125. <label class="layui-form-label must">线路名称</label>
  126. <div class="layui-input-block ">
  127. <input type="text" id='title' name="data[name]" class="layui-input" value="{$item['name']}" lay-verify="required"/>
  128. </div>
  129. </div>
  130. <div class="layui-form-item">
  131. <label class="layui-form-label must">关联司机</label>
  132. <div class="layui-input-block">
  133. <div class="input-group " style="margin: 0;">
  134. <input type="text" disabled value="{$item['clerk_id']}" class="form-control valid" name="clerk_id" placeholder="" id="clerk_id">
  135. <span class="input-group-btn">
  136. <span data-input="#clerk_id" id="chose_clerk_id" class="btn btn-default">选择司机</span>
  137. </span>
  138. </div>
  139. <?php if( $saler){ ?>
  140. <div class="input-group " style="margin: 0;">
  141. <div class="layadmin-text-center choose_user">
  142. <img style="" src="{:tomedia($saler['avatar'])}">
  143. <div class="layadmin-maillist-img" style="">{$saler['nickname']}</div>
  144. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'clerk_id')"><i class="layui-icon">&#xe640;</i></button>
  145. </div>
  146. </div>
  147. <?php } ?>
  148. </div>
  149. </div>
  150. <div class="layui-form-item">
  151. <label class="layui-form-label must">关联小区</label>
  152. <div class="layui-input-block">
  153. <div class="input-group " style="margin: 0;">
  154. <input type="text" disabled value="{$item['head_id']}" class="form-control valid" name="head_id" placeholder="" id="head_id">
  155. <span class="input-group-btn">
  156. <span data-input="#head_id" id="chose_head_id" class="btn btn-default">选择小区</span>
  157. </span>
  158. </div>
  159. <div class="input-group multi-audio-details container">
  160. <?php if( $headlist){ ?>
  161. <?php foreach($headlist as $v){ ?>
  162. <div class="multi-audio-item " data-id="{$v['id']}">
  163. <div class="input-group">
  164. <input type="text" class="form-control img-textname" readonly="" value="{$v['community_name']}">
  165. <input type="hidden" value="{$v['id']}" name="head_id[]">
  166. <div class="input-group-btn">
  167. <button class="btn btn-default" data-id="{$v['id']}" onclick="cancle_head(this, {$v['id']})" type="button"><i class="fa fa-remove"></i></button>
  168. </div>
  169. </div>
  170. </div>
  171. <?php } ?>
  172. <?php } ?>
  173. </div>
  174. </div>
  175. </div>
  176. <div class="layui-form-item">
  177. <label class="layui-form-label"></label>
  178. <div class="layui-input-block">
  179. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary"/>
  180. </div>
  181. </div>
  182. </form>
  183. </div>
  184. </div>
  185. </div>
  186. <script src="/layuiadmin/layui/layui.js"></script>
  187. <script>
  188. layui.config({
  189. base: '/layuiadmin/' //静态资源所在路径
  190. }).extend({
  191. index: 'lib/index' //主入口模块
  192. }).use('index');
  193. </script>
  194. <script>
  195. var layer = layui.layer;
  196. var $;
  197. var cur_open_div;
  198. layui.use(['jquery', 'layer','form'], function(){
  199. $ = layui.$;
  200. var form = layui.form;
  201. form.on('radio(linktype)', function(data){
  202. if (data.value == 2) {
  203. $('#typeGroup').show();
  204. } else {
  205. $('#typeGroup').hide();
  206. }
  207. });
  208. $('#chose_link').click(function(){
  209. cur_open_div = $(this).attr('data-input');
  210. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  211. layer.open({
  212. type: 1,
  213. area: '930px',
  214. content: shtml //注意,如果str是object,那么需要字符拼接。
  215. });
  216. });
  217. })
  218. form.verify({
  219. title: [
  220. /^[\S]{1,}$/,'标题不能为空'
  221. ]
  222. });
  223. //监听提交
  224. form.on('submit(formDemo)', function(data){
  225. var loadingIndex = layer.load();
  226. $.ajax({
  227. url: data.form.action,
  228. type: data.form.method,
  229. data: data.field,
  230. dataType:'json',
  231. success: function (info) {
  232. if(info.status == 0)
  233. {
  234. layer.msg(info.result.message,{icon: 2,time: 2000});
  235. layer.close(loadingIndex);
  236. }else if(info.status == 1){
  237. var go_url = location.href;
  238. if( info.result.hasOwnProperty("url") )
  239. {
  240. go_url = info.result.url;
  241. }
  242. layer.msg('操作成功',{time: 1000,
  243. end:function(){
  244. var backurl = "{:U('delivery/delivery_line',array('ok'=>'1'))}";
  245. location.href = backurl;
  246. // location.href = info.result.url;
  247. }
  248. });
  249. }
  250. }
  251. });
  252. return false;
  253. });
  254. })
  255. $('#chose_clerk_id').click(function(){
  256. cur_open_div = $(this).attr('data-input');
  257. $.post("{:U('delivery/queryclerk', array('ok' => 1))}", {}, function(shtml){
  258. layer.open({
  259. type: 1,
  260. area: '930px',
  261. content: shtml //注意,如果str是object,那么需要字符拼接。
  262. });
  263. });
  264. })
  265. $('#chose_head_id').click(function(){
  266. cur_open_div = $(this).attr('data-input');
  267. $.post("{:U('communityhead/lineheadquery', array('is_just_line' => 1))}", {}, function(shtml){
  268. layer.open({
  269. type: 1,
  270. area: '930px',
  271. content: shtml //注意,如果str是object,那么需要字符拼接。
  272. });
  273. });
  274. })
  275. function cancle_bind(obj,sdiv)
  276. {
  277. $('#'+sdiv).val('');
  278. $('#clerk_id').val('');
  279. $(obj).parent().parent().remove();
  280. }
  281. function cancle_head(obj,sdiv)
  282. {
  283. $('#'+sdiv).val('');
  284. $(obj).parents('.multi-audio-item').remove();
  285. }
  286. </script>
  287. </body>
  288. </html>