addsupply.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501
  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. </head>
  45. <body layadmin-themealias="default">
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if( !empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>供应商 <small><?php if( !empty($item['id'])){ ?>修改【{$item['shopname']}】<?php } ?></small></span></div>
  49. <div class="layui-card-body" style="padding:15px;">
  50. <div class="page-content">
  51. <form action="" method='post' class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data">
  52. <input type="hidden" name="id" value="{$item['id']}">
  53. <div class="layui-form-item">
  54. <label class="layui-form-label must">供应商名称</label>
  55. <div class="layui-input-block">
  56. <input type="text" name="shopname" lay-verify="required" class="form-control" value="{$item['shopname']}" />
  57. <span class='help-block'></span>
  58. </div>
  59. </div>
  60. <div class="layui-form-item">
  61. <label class="layui-form-label must">店铺名称</label>
  62. <div class="layui-input-block">
  63. <input type="text" name="storename" lay-verify="required" class="form-control" value="{$item['storename']}" />
  64. <span class='help-block'></span>
  65. </div>
  66. </div>
  67. <div class="layui-form-item">
  68. <label class="layui-form-label must">关联会员</label>
  69. <div class="layui-input-block">
  70. <div class="input-group " style="margin: 0;">
  71. <input type="text" disabled value="{$item['member_id']}" class="form-control valid" name="member_id" placeholder="" id="member_id" >
  72. <span class="input-group-btn">
  73. <span data-input="#member_id" id="chose_member_id" class="btn btn-default">选择会员</span>
  74. </span>
  75. </div>
  76. <?php if( !empty($saler) ){ ?>
  77. <div class="input-group " style="margin: 0;">
  78. <div class="layadmin-text-center choose_user">
  79. <img style="" src="{$saler['avatar']}">
  80. <div class="layadmin-maillist-img" style="">{$saler['nickname']}</div>
  81. <?php if(!empty($item['id'])){ ?>
  82. <?php }else{ ?>
  83. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'member_id')"><i class="layui-icon">&#xe640;</i></button>
  84. <?php } ?>
  85. </div>
  86. </div>
  87. <?php } ?>
  88. </div>
  89. </div>
  90. <div class="layui-form-item">
  91. <label class="layui-form-label">供应商标志</label>
  92. <div class="layui-input-block">
  93. {:tpl_form_field_image2('logo', $item['logo'])}
  94. </div>
  95. </div>
  96. <div class="layui-form-item">
  97. <label class="layui-form-label">店铺顶部图</label>
  98. <div class="layui-input-block">
  99. {:tpl_form_field_image2('banner', $item['banner'])}
  100. </div>
  101. </div>
  102. <div class="layui-form-item">
  103. <label class="layui-form-label must">供应商联系人</label>
  104. <div class="layui-input-block">
  105. <input type="text" name="name" lay-verify="required" class="form-control" value="{$item['name']}" />
  106. <span class='help-block'></span>
  107. </div>
  108. </div>
  109. <div class="layui-form-item">
  110. <label class="layui-form-label must"> 供应商手机号</label>
  111. <div class="layui-input-block">
  112. <input type="text" name="mobile" class="form-control" value="{$item['mobile']}" data-rule-required="true" />
  113. </div>
  114. </div>
  115. <div class="layui-form-item">
  116. <label class="layui-form-label must"> 产品</label>
  117. <div class="layui-input-block">
  118. <input type="text" name="product" class="form-control" value="{$item['product']}" readonly/>
  119. </div>
  120. </div>
  121. <?php if( $item['id'] == 0 ){ ?>
  122. <div class="layui-form-item">
  123. <label class="layui-form-label">是否审核</label>
  124. <div class="layui-input-block" >
  125. <input type="radio" name="state" value="1" <?php if( $item['state'] == 1 || !empty($item)){ ?>checked="true"<?php } ?> title="是" />
  126. <input type="radio" name="state" value="0" <?php if( $item['state'] == 0 && empty($item)){ ?>checked="true"<?php } ?> title="否" />
  127. </div>
  128. </div>
  129. <?php }else{ ?>
  130. <div class="layui-form-item">
  131. <label class="layui-form-label">是否审核</label>
  132. <div class="layui-input-block" style="padding-top: 6px;">
  133. <td>
  134. <?php if( $item['state'] == 0 ){ ?>
  135. <?php if( $item['goods_count'] <= 0 ){ ?>
  136. <p style="color: red; display:inline;padding-right: 15px;">待审核</p>
  137. <input type="hidden" name="state" value="0" />
  138. <a style="display:inline;" class='op layui-btn layui-btn-xs' data-toggle="ajaxModal" href="javascript:;" data-href="{:U('supply/agent_check_first', array('id' => $item['id'],'type' => $item['type'] ))}" >
  139. <i class="icow icow-yibiaoji" style="color: #999;display: inline-block;vertical-align: middle" title="点击审核,选择供应商类型" ></i>
  140. &nbsp;通&nbsp;过&nbsp;
  141. </a>
  142. <?php }else{ ?>
  143. <input type="checkbox" name="" lay-filter="statewsitch" data-href="{:U('supply/agent_check', array('id'=>$item['id']))}" <?php if($item['state']==1){ ?>checked<?php } ?> lay-skin="switch" lay-text="启用|禁用">
  144. <?php } ?>
  145. <p style="color: red; display:inline;padding-right: 15px;"></p>
  146. <input type="checkbox" name="" lay-filter="statewsitchunable" data-href="{:U('supply/agent_check', array('id'=>$item['id']))}" <?php if($item['state']==1){ ?>checked<?php } ?> lay-skin="switch" lay-text="已拒绝|拒绝">
  147. <?php }else if( $item['state'] == 1 ){ ?>
  148. <p style="color: red; display:inline;padding-right: 15px;" >已通过</p>
  149. <input type="hidden" name="state" value="1" />
  150. <?php }else if( $item['state'] == 2 ){ ?>
  151. <p style="color: red; display:inline;padding-right: 15px;">已拒绝</p>
  152. <input type="hidden" name="state" value="2" />
  153. <a style="display:inline;" data-toggle="ajaxModal" href="javascript:;" data-href="{:U('supply/agent_check_first', array('id' => $item['id']))}" >
  154. <p style="color: blue;display:inline; ">重新审核</p>
  155. </a>
  156. <?php }else if( $item['state'] == 3 ){ ?>
  157. <p style="color: red; display:inline;padding-right: 15px;" >已通过</p>
  158. <input type="hidden" name="state" value="3" />
  159. <?php } ?>
  160. </td>
  161. </div>
  162. </div>
  163. <?php } ?>
  164. <?php if( !empty($item['id']) ){ ?>
  165. <div class="layui-form-item">
  166. <label class="layui-form-label">供应商类型</label>
  167. <div class="layui-input-block" >
  168. <input type="radio" name="type" disabled value="0" <?php if( $item['type'] == 0 || empty($item) ){ ?>checked="true"<?php } ?> title="平台供应商" />
  169. <input type="radio" name="type" disabled value="1" <?php if( !empty($item) && $item['type'] == 1 ){ ?>checked="true"<?php } ?> title="独立供应商" />
  170. <span class='help-block'>请根据需要的类型进行选择,供应商类型只能在供应商审核的时候选择一次,后续不可修改</span>
  171. </div>
  172. </div>
  173. <?php }else{ ?>
  174. <div class="layui-form-item">
  175. <label class="layui-form-label">供应商类型</label>
  176. <div class="layui-input-block" >
  177. <input type="radio" lay-filter="type" name="type" value="0" <?php if( $item['type'] == 0 || empty($item) ){ ?>checked="true" <?php } ?> title="平台供应商" />
  178. <input type="radio" lay-filter="type" name="type" value="1" <?php if( !empty($item) && $item['type'] == 1 ){ ?>checked="true" <?php } ?> title="独立供应商" />
  179. <span class='help-block'>请根据需要的类型进行选择,供应商类型只能在供应商审核的时候选择一次,后续不可修改</span>
  180. </div>
  181. </div>
  182. <?php } ?>
  183. <?php if( $supply_is_open_mobilemanage == 1 ){ ?>
  184. <?php if( empty($item) || (!empty($item['id']) && $item['type'] == 1) ){ ?>
  185. <div class="layui-form-item" id="is_open_mobilemanage">
  186. <label class="layui-form-label">供应商手机端</label>
  187. <?php if( !empty($item['id']) ){ ?>
  188. <div class="layui-input-block" >
  189. <input type="radio" name="is_open_mobilemanage" value="0" <?php if( $item['is_open_mobilemanage'] == 0 || empty($item) ){ ?>checked="true" <?php } ?> title="关闭" />
  190. <input type="radio" name="is_open_mobilemanage" value="1" <?php if( !empty($item) && $item['is_open_mobilemanage'] == 1 ){ ?>checked="true" <?php } ?> title="开启" />
  191. </div>
  192. <?php }else{ ?>
  193. <div class="layui-input-block" >
  194. <input type="radio" disabled="true" name="is_open_mobilemanage" value="0" <?php if( $item['is_open_mobilemanage'] == 0 || empty($item) ){ ?>checked="true" <?php } ?> title="关闭" />
  195. <input type="radio" disabled="true" name="is_open_mobilemanage" value="1" <?php if( !empty($item) && $item['is_open_mobilemanage'] == 1 ){ ?>checked="true" <?php } ?> title="开启" />
  196. </div>
  197. <?php } ?>
  198. </div>
  199. <?php }?>
  200. <?php } ?>
  201. <div class="layui-form-item">
  202. <label class="layui-form-label must"> 技术服务费</label>
  203. <div class="layui-input-block">
  204. <input type="text" name="commiss_bili" class="form-control" value="{$item['commiss_bili']}" data-rule-required="true" />
  205. <span class='help-block'>请填写百分比,例如:6 那么平台抽成是6%。实付金额的百分比,扣除此比例 再扣除团长佣金,剩余货款归供应商</span>
  206. </div>
  207. </div>
  208. <div class="layui-form-item" >
  209. <label class="layui-form-label">工商资质图片</label>
  210. <div class="layui-input-block">
  211. {:tpl_form_field_multi_image3('goods_industrial',$piclist)}
  212. </div>
  213. </div>
  214. <blockquote class="layui-elem-quote" style="margin-left: 80px;">登录信息</blockquote>
  215. <div class="layui-form-item">
  216. <label class="layui-form-label must">登录账户</label>
  217. <div class="layui-input-block">
  218. <input type="text" name="login_name" class="form-control" value="{$item['login_name']}" />
  219. <span class='help-block'></span>
  220. </div>
  221. </div>
  222. <div class="layui-form-item">
  223. <label class="layui-form-label must">登录密码</label>
  224. <div class="layui-input-block">
  225. <input type="text" name="login_password" class="form-control" value="" />
  226. <span class='help-block'>留空则不修改密码</span>
  227. </div>
  228. </div>
  229. <div class="layui-form-item">
  230. <label class="layui-form-label"></label>
  231. <div class="layui-input-block">
  232. <input type="submit" name="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  233. </div>
  234. </div>
  235. </form>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. <div id="ajaxModal" class="modal fade" style="display: none;">
  241. </div>
  242. <script src="/layuiadmin/layui/layui.js"></script>
  243. <script>
  244. layui.config({
  245. base: '/layuiadmin/' //静态资源所在路径
  246. }).extend({
  247. index: 'lib/index' //主入口模块
  248. }).use('index');
  249. </script>
  250. <script>
  251. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  252. var layer = layui.layer;
  253. var $;
  254. layui.use(['jquery', 'layer','form','colorpicker'], function(){
  255. $ = layui.$;
  256. var form = layui.form;
  257. var colorpicker = layui.colorpicker;
  258. //表单赋值
  259. colorpicker.render({
  260. elem: '#minicolors'
  261. ,color: '{$data['nav_bg_color']}'
  262. ,done: function(color){
  263. $('#test-colorpicker-form-input').val(color);
  264. }
  265. });
  266. form.on('radio(linktype)', function(data){
  267. if (data.value == 1) {
  268. $('#is_open_mobilemanage').show();
  269. } else {
  270. $('#is_open_mobilemanage').hide();
  271. }
  272. });
  273. $('#chose_member_id').click(function(){
  274. cur_open_div = $(this).attr('data-input');
  275. $.post("{:U('user/zhenquery', array('ok' => 1))}", {}, function(shtml){
  276. layer.open({
  277. type: 1,
  278. area: '930px',
  279. content: shtml //注意,如果str是object,那么需要字符拼接。
  280. });
  281. });
  282. })
  283. //监听提交
  284. form.on('submit(formDemo)', function(data){
  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. }else if(info.status == 1){
  295. var go_url = location.href;
  296. if( info.result.hasOwnProperty("url") )
  297. {
  298. go_url = info.result.url;
  299. }
  300. layer.msg('操作成功',{time: 1000,
  301. end:function(){
  302. var backurl = "{:U('supply/index',array('ok'=>'1'))}";
  303. location.href = backurl;
  304. // location.href = info.result.url;
  305. }
  306. });
  307. }
  308. }
  309. });
  310. return false;
  311. });
  312. form.on('switch(statewsitchunable)', function(data){
  313. var s_url = $(this).attr('data-href')
  314. var s_value = 2;
  315. $.ajax({
  316. url:s_url,
  317. type:'post',
  318. dataType:'json',
  319. data:{state:s_value},
  320. success:function(info){
  321. if(info.status == 0)
  322. {
  323. layer.msg(info.result.message,{icon: 1,time: 2000});
  324. }else if(info.status == 1){
  325. var go_url = location.href;
  326. if( info.result.hasOwnProperty("url") )
  327. {
  328. go_url = info.result.url;
  329. }
  330. layer.msg('操作成功',{time: 1000,
  331. end:function(){
  332. location.href = info.result.url;
  333. }
  334. });
  335. }
  336. }
  337. })
  338. });
  339. form.on('switch(statewsitch)', function(data){
  340. var s_url = $(this).attr('data-href')
  341. var s_value = 1;
  342. if(data.elem.checked)
  343. {
  344. s_value = 1;
  345. }else{
  346. s_value = 3;
  347. }
  348. $.ajax({
  349. url:s_url,
  350. type:'post',
  351. dataType:'json',
  352. data:{state:s_value},
  353. success:function(info){
  354. if(info.status == 3)
  355. {
  356. layer.msg(info.result.message,{icon: 1,time: 2000});
  357. }else if(info.status == 1){
  358. var go_url = location.href;
  359. if( info.result.hasOwnProperty("url") )
  360. {
  361. go_url = info.result.url;
  362. }
  363. layer.msg('操作成功',{time: 1000,
  364. end:function(){
  365. location.href = info.result.url;
  366. }
  367. });
  368. }
  369. }
  370. })
  371. });
  372. form.on('checkbox(checkboxall)', function(data){
  373. if(data.elem.checked)
  374. {
  375. $("input[name=item_checkbox]").each(function() {
  376. $(this).prop("checked", true);
  377. });
  378. $("input[name=checkall]").each(function() {
  379. $(this).prop("checked", true);
  380. });
  381. }else{
  382. $("input[name=item_checkbox]").each(function() {
  383. $(this).prop("checked", false);
  384. });
  385. $("input[name=checkall]").each(function() {
  386. $(this).prop("checked", false);
  387. });
  388. }
  389. form.render('checkbox');
  390. });
  391. })
  392. $("[data-toggle='ajaxModal']").click(function () {
  393. var s_url = $(this).attr('data-href');
  394. ajax_url = s_url;
  395. console.log(23);
  396. $.ajax({
  397. url:s_url,
  398. type:"get",
  399. success:function(shtml){
  400. $('#ajaxModal').html(shtml);
  401. $("#ajaxModal").modal();
  402. }
  403. })
  404. });
  405. $(document).delegate(".modal-footer .btn-primary","click",function(){
  406. var s_data = $('#ajaxModal form').serialize();
  407. $.ajax({
  408. url:ajax_url,
  409. type:'post',
  410. dataType:'json',
  411. data:s_data,
  412. success:function(info){
  413. if(info.status == 0)
  414. {
  415. layer.msg(info.result.message,{icon: 1,time: 2000});
  416. }else if(info.status == 1){
  417. var go_url = location.href;
  418. if( info.result.hasOwnProperty("url") )
  419. {
  420. go_url = info.result.url;
  421. }
  422. layer.msg('操作成功',{time: 1000,
  423. end:function(){
  424. location.href = info.result.url;
  425. }
  426. });
  427. }
  428. }
  429. })
  430. return false;
  431. })
  432. </script>
  433. </body>
  434. </html>