kdniao_add.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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="/static/js/dist/area/cascade.js"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <style>
  45. .content{
  46. display:none;
  47. width:200px;
  48. height:200px;
  49. border-radius:10px;
  50. padding:20px;
  51. position:relative;
  52. top:15px;
  53. left:50%;
  54. background-color:FFFFFF;
  55. border:1px solid;
  56. }
  57. </style>
  58. </head>
  59. <body layadmin-themealias="default">
  60. <div class="layui-fluid">
  61. <div class="layui-card">
  62. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if(!empty($data['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>快递</span></div>
  63. <div class="layui-card-body" style="padding:15px;">
  64. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item">
  65. <input type="hidden" name="data[id]" value="{$item[id]}" />
  66. <div class="layui-form-item">
  67. <label class="layui-form-label mustl"><span style="color:red;"> * </span>选择快递公司</label>
  68. <div class="layui-input-block">
  69. <select id="express_code" name='data[express_code]' class="form-control select2" lay-filter="express_code" style="width:50%;">
  70. <option value="">请选择</option>
  71. <?php foreach($express_list as $k=>$v){ ?>
  72. <option value="<?php echo $v['simplecode']; ?>" <?php if($item['express_code'] == $v['simplecode']){ ?>selected="selected"<?php } ?>><?php echo $v['name']; ?></option>
  73. <?php } ?>
  74. </select>
  75. <span class='help-block'>根据需要打印的电子面单进行选择,例如:需要打印顺丰快递的,选择顺丰快递,填写对应的信息即可在订单列表中进行顺丰快递电子面单打印</span>
  76. </div>
  77. </div>
  78. <div class="layui-form-item">
  79. <label class="layui-form-label mustl">电子面单客户账号</label>
  80. <div class="layui-input-block">
  81. <input type="text" name="data[customer_name]" class="form-control" value="{$item[customer_name]}" style="width: 50%;" maxlength="50"/>
  82. <span class='help-block'>是否需要电子面单账号根据快递公司而定,具体详情咨询"<a class="text-primary" href="http://www.kdniao.com" target="_blank">快递鸟</a>"官方</span>
  83. </div>
  84. </div>
  85. <div class="layui-form-item">
  86. <label class="layui-form-label mustl">电子面单密码</label>
  87. <div class="layui-input-block">
  88. <input type="text" name="data[customer_pwd]" class="form-control" value="{$item[customer_pwd]}" style="width: 50%;" maxlength="30"/>
  89. </div>
  90. </div>
  91. <div class="layui-form-item">
  92. <label class="layui-form-label mustl">月结编码</label>
  93. <div class="layui-input-block">
  94. <input type="text" name="data[month_code]" class="form-control" value="{$item[month_code]}" style="width: 50%;" maxlength="20"/>
  95. </div>
  96. </div>
  97. <div class="layui-form-item">
  98. <label class="layui-form-label mustl">网点名称</label>
  99. <div class="layui-input-block">
  100. <input type="text" name="data[send_site]" class="form-control" value="{$item[send_site]}" style="width: 50%;" maxlength="30"/>
  101. </div>
  102. </div>
  103. <div class="layui-form-item">
  104. <label class="layui-form-label mustl">网点编码</label>
  105. <div class="layui-input-block">
  106. <input type="text" name="data[send_staff]" class="form-control" value="{$item[send_staff]}" style="width: 50%;" maxlength="30"/>
  107. </div>
  108. </div>
  109. <div class="layui-form-item">
  110. <label class="layui-form-label mustl">电子面单模板规格</label>
  111. <div class="layui-input-block">
  112. <select id="template_size" name='data[template_size]' class="form-control select2" lay-filter="template_size">
  113. </select>
  114. <span class='help-block'>电子面单打印内容的尺寸,不明确的情况下可以咨询"<a class="text-primary" href="http://www.kdniao.com" target="_blank">快递鸟</a>"官方</span>
  115. </div>
  116. </div>
  117. <div class="layui-form-item">
  118. <label class="layui-form-label">发件人公司:</label>
  119. <div class="layui-input-block">
  120. <input type="text" name="data[sender_company]" class="form-control" value="{$item['sender_company']}" maxlength="30"/>
  121. <span class='layui-form-mid layui-word-aux'>发件人公司选填</span>
  122. </div>
  123. </div>
  124. <div class="layui-form-item">
  125. <label class="layui-form-label"><span style="color:red;"> * </span>发件人名称:</label>
  126. <div class="layui-input-block">
  127. <input type="text" name="data[sender_name]" class="form-control" value="{$item['sender_name']}" maxlength="30"/>
  128. <span class='layui-form-mid layui-word-aux'>发件人名称必填</span>
  129. </div>
  130. </div>
  131. <div class="layui-form-item">
  132. <label class="layui-form-label"><span style="color:red;"> * </span>发件人电话:</label>
  133. <div class="layui-input-block">
  134. <input type="text" name="data[sender_tel]" class="form-control" value="{$item['sender_tel']}" maxlength="20"/>
  135. <span class='layui-form-mid layui-word-aux'>发件人联系电话必填</span>
  136. </div>
  137. </div>
  138. <div class="layui-form-item">
  139. <label class="layui-form-label">发件人手机:</label>
  140. <div class="layui-input-block">
  141. <input type="text" name="data[sender_mobile]" class="form-control" value="{$item['sender_mobile']}" maxlength="20"/>
  142. </div>
  143. </div>
  144. <div class="layui-form-item">
  145. <label class="layui-form-label">发件人邮编:</label>
  146. <div class="layui-input-block">
  147. <input type="text" name="data[sender_postcode]" class="form-control" value="{$item['sender_postcode']}" maxlength="10"/>
  148. <span class='layui-form-mid layui-word-aux'>快递公司为:EMS(EMS)、邮政快递包裹(YZPY)、邮政国内标快(YZBK)时必填</span>
  149. </div>
  150. </div>
  151. <div class="layui-form-item">
  152. <label class="layui-form-label"><span style="color:red;"> * </span>发件人地区:</label>
  153. <div class="layui-input-block">
  154. <select id="sel-provance" lay-ignore name="data[sender_province_name]" onChange="selectCity();" style="width:130px;display:inline;">
  155. <option value="" selected="true">省/直辖市</option>
  156. </select>
  157. <select id="sel-city" lay-ignore name="data[sender_city_name]" onChange="selectcounty(0)" style="width:135px;display:inline;">
  158. <option value="" selected="true">请选择</option>
  159. </select>
  160. <select id="sel-area" lay-ignore name="data[sender_area_name]" style="width:130px;display:inline;">
  161. <option value="" selected="true">请选择</option>
  162. </select>
  163. </div>
  164. <div class="layui-input-block"><span class='layui-form-mid layui-word-aux'>发件人省市区必填</span></div>
  165. </div>
  166. <div class="layui-form-item">
  167. <label class="layui-form-label"><span style="color:red;"> * </span>发件人详细地址:</label>
  168. <div class="layui-input-block">
  169. <input type="text" name="data[sender_address]" class="form-control" value="{$item['sender_address']}" maxlength="100"/>
  170. <span class='layui-form-mid layui-word-aux'>发件人详细地址必填</span>
  171. </div>
  172. </div>
  173. <div class="layui-form-item">
  174. <label class="layui-form-label ">订阅短信</label>
  175. <div class="layui-input-block">
  176. <label class='radio-inline'>
  177. <input type='radio' title="关闭" lay-filter="is_send_message" name='data[is_send_message]' value='0' <?php if(!isset($item['is_send_message']) || $item['is_send_message'] ==0){ ?>checked <?php } ?> />
  178. </label>
  179. <label class='radio-inline'>
  180. <input type='radio' title="开启" lay-filter="is_send_message" name='data[is_send_message]' value='1' <?php if(isset($item['is_send_message']) && $item['is_send_message'] ==1 ){ ?>checked <?php } ?> />
  181. </label>
  182. <br/>
  183. <span class='layui-form-mid layui-word-aux'>短信通知快递具体到达哪一步,订阅短信为快递鸟收费功能,具体详情咨询“<a class="text-primary" href="http://www.kdniao.com" target="_blank">快递鸟</a>”官方</span>
  184. </div>
  185. </div>
  186. <div class="layui-form-item">
  187. <label class="layui-form-label ">打印商品</label>
  188. <div class="layui-input-block">
  189. <label class='radio-inline'>
  190. <input type='radio' title="关闭" lay-filter="is_send_goods" name='data[is_send_goods]' value='0' <?php if(!isset($item['is_send_goods']) || $item['is_send_goods'] == 0){ ?>checked <?php } ?> />
  191. </label>
  192. <label class='radio-inline'>
  193. <input type='radio' title="开启" lay-filter="is_send_goods" name='data[is_send_goods]' value='1' <?php if(isset($item['is_send_goods']) && $item['is_send_goods'] ==1 ){ ?>checked <?php } ?> />
  194. </label>
  195. <br/>
  196. <span class='layui-form-mid layui-word-aux'>打印出的电子面单是否包含商品信息</span>
  197. </div>
  198. </div>
  199. <div class="layui-form-item">
  200. <label class="layui-form-label"> </label>
  201. <div class="layui-input-block">
  202. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  203. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  204. <a class="btn btn-default" style='margin-left:10px;' href="{:U('logistics/index',array('ok'=>'1'))}">返回列表</a>
  205. </div>
  206. </div>
  207. </form>
  208. </div>
  209. </div>
  210. </div>
  211. <script src="/layuiadmin/layui/layui.js"></script>
  212. <script>
  213. layui.config({
  214. base: '/layuiadmin/' //静态资源所在路径
  215. }).extend({
  216. index: 'lib/index' //主入口模块
  217. }).use('index');
  218. </script>
  219. <script>
  220. $(document).ready(function(){
  221. $(".contact").mouseover(function(){
  222. $(".content").show("slow");
  223. $(".contact").mouseout(function(){
  224. $(".content").hide("slow");
  225. });
  226. });
  227. })
  228. $(function(){
  229. <?php if(!empty($item['sender_province_name'])){?>
  230. cascdeInit("1","1","<?php echo $item['sender_province_name'];?>","<?php echo $item['sender_city_name'];?>","<?php echo $item['sender_area_name'];?>","");
  231. <?php }else{ ?>
  232. cascdeInit("1","1","","","","");
  233. <?php }?>
  234. });
  235. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  236. var layer = layui.layer;
  237. var $;
  238. var cur_open_div;
  239. layui.use(['jquery', 'layer','form'], function(){
  240. $ = layui.$;
  241. var form = layui.form;
  242. var code = "{$item['express_code']}";
  243. var template_size = "{$item['template_size']}";
  244. $.ajax({
  245. url: "{:U('logistics/select_template')}",
  246. type: "post",
  247. data: {code:code},
  248. dataType:'json',
  249. success: function (info) {
  250. if(info.code == 1){
  251. $("#template_size").empty();
  252. $.each(info.list, function(index, item) {
  253. $('#template_size').append(new Option(item.template_name + "(" +item.template_spec+")", item.template_size));//往下拉菜单里添加元素
  254. });
  255. }else{
  256. $("#template_size").empty();
  257. }
  258. $('#template_size').val(template_size);
  259. form.render();
  260. }
  261. });
  262. form.on('select(express_code)', function(data){
  263. var code = data.value;
  264. $.ajax({
  265. url: "{:U('logistics/select_template')}",
  266. type: "post",
  267. data: {code:code},
  268. dataType:'json',
  269. success: function (info) {
  270. if(info.code == 1){
  271. $("#template_size").empty();
  272. $.each(info.list, function(index, item) {
  273. $('#template_size').append(new Option(item.template_name + "(" +item.template_spec+")", item.template_size));//往下拉菜单里添加元素
  274. });
  275. }else{
  276. $("#template_size").empty();
  277. }
  278. form.render();
  279. }
  280. });
  281. });
  282. //监听提交
  283. form.on('submit(formDemo)', function(data){
  284. var loadingIndex = layer.load();
  285. $.ajax({
  286. url: data.form.action,
  287. type: data.form.method,
  288. data: data.field,
  289. dataType:'json',
  290. success: function (info) {
  291. if(info.status == 0)
  292. {
  293. layer.msg(info.result.message,{icon: 1,time: 2000});
  294. layer.close(loadingIndex);
  295. }else if(info.status == 1){
  296. var go_url = location.href;
  297. if( info.result.hasOwnProperty("url") )
  298. {
  299. go_url = info.result.url;
  300. }
  301. layer.msg('操作成功',{time: 1000,
  302. end:function(){
  303. location.href = info.result.url;
  304. }
  305. });
  306. }
  307. }
  308. });
  309. return false;
  310. });
  311. })
  312. </script>
  313. </body>