customer.html 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <div class="fixed">
  5. <ul class="search">
  6. <li>店铺名称:<select name="shop" class="select" style="width:180px;">
  7. <option value="">请选择</option>
  8. {loop usershop() as $val}
  9. <option value="{$val['id']}">{$val['shopname']}</option>{/loop}</select></li>
  10. <li>客户类型:<select name="level" class="select" style="width:180px;">
  11. <option value="">请选择</option>
  12. <option value="1">网红</option>
  13. <option value="2">批发</option>
  14. <option value="3">店铺转线下</option>
  15. <option value="4">线下其他</option>
  16. <option value="5">店内客户</option>
  17. <option value="0">未定义</option>
  18. </select></li>
  19. <li>国家:<select name="country" class="select class">
  20. <option value="">请选择</option>
  21. {loop country(1000) as $val}
  22. <option value="{$val['id']}">{$val['name']}</option>
  23. {/loop}
  24. </select>
  25. </li>
  26. <li>交易次数:<select name="num" class="select" style="width:180px;">
  27. <option value="">不限制</option>
  28. <option value="0">0</option>
  29. <option value="1">1</option>
  30. <option value="2">2</option>
  31. <option value="3">3</option>
  32. <option value="4">4</option>
  33. <option value="5">5</option>
  34. <option value="6">6</option>
  35. <option value="7">7</option>
  36. <option value="8">8</option>
  37. <option value="9">9</option>
  38. <option value="10">10+</option>
  39. <option value="2a">2次及以上</option>
  40. </select></li>
  41. <li>电话号码:<input value="" name="numphone" type="text" ></li>
  42. <li>客户名称:<input value="" name="name" type="text" ></li>
  43. <li>客户邮箱:<input value="" name="email" type="text" style="width:200px;"></li>
  44. <li>客户地址:<input value="" name="address" type="text" style="width:300px;"></li>
  45. <li>下单时间:<input id="timetk" value="2017-01-01 00:00" name="timetk" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})">
  46. 至&nbsp;&nbsp;&nbsp;&nbsp; <input id="timetj" value="{date('Y-m-d 00:00',time()+24*3600)}" name="timetj" type="text" onClick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"></li>
  47. <li><span>确 定</span></li>
  48. </ul>
  49. <div class="control">
  50. <a href="javascript:void(0);" class="window" data-h="/customer/add/" data-t="客户管理 - 添加">新增客户</a>
  51. {if $vip == 1}
  52. <a href="javascript:void(0);" class="check">删 除</a>
  53. {/if}
  54. <a href="javascript:void(0);" id="excel">导入客户</a>
  55. <a href="/customer/down?excela=1">下载导入模板</a>
  56. {if $userkz != 1}
  57. <a href="javascript:void(0);" class="ctex" data-ex="1">下载老客户订单列表</a>
  58. <a href="javascript:void(0);" class="ctex" data-ex="2">下载老客户列表</a>
  59. <a href="javascript:void(0);" class="indexexcel">按条件导出</a>
  60. {/if}
  61. <a href="javascript:void(0);" id="temuexcel">导入TEMU客户</a>
  62. </div>
  63. <table class="datatitle data" border="0" style="border-collapse:collapse;">
  64. <tr>
  65. <td><label onClick="swapCheck()"><input name="checkbox" type="checkbox" class="regular-checkbox"></label></td>
  66. <td>所属店铺</td>
  67. <td>客户来源</td>
  68. <td>客户名称</td>
  69. <td>客户邮箱</td>
  70. <td>客户电话</td>
  71. <td>国家</td>
  72. <td>客户类型</td>
  73. <td>总额</td>
  74. <td>次数</td>
  75. <td>客单价</td>
  76. <td>最后购买日期</td>
  77. <td>备注</td>
  78. <td>操作</td>
  79. </tr>
  80. </table>
  81. </div>
  82. <table class="datatext data" border="0" style="border-collapse:collapse;">
  83. </table>
  84. <div class="bomf"></div>
  85. </div>
  86. <script>
  87. var dataurl = "/customer";var fdataurl = "/customer";
  88. var editurl = "/customer/edit/";
  89. var editdj = 4;
  90. var editt = "客户管理 - 修改";
  91. var customon = 1;
  92. function custom(){
  93. $(".data tr").each(function() {
  94. $(this).find('td:eq(1)').css("width","8%");
  95. $(this).find('td:eq(2)').css("width","6%");
  96. $(this).find('td:eq(3)').css("width","10%");
  97. $(this).find('td:eq(4)').css("width","15%");
  98. $(this).find('td:eq(8)').css("width","5%");
  99. $(this).find('td:eq(9)').css("width","3%");
  100. $(this).find('td:eq(10)').css("width","4%");
  101. $(this).find('td:eq(12)').css("width","13%");
  102. });}
  103. $(document).ready(function() {
  104. var button = $("#temuexcel"), interval;
  105. var fileType = "pic", fileNum = "one";
  106. new AjaxUpload(button, {
  107. action: dataurl+"/temuexcel",
  108. name: "userfile",
  109. onSubmit: function(file, ext) {
  110. if (fileType == "pic") {
  111. if (ext && /^(xls|xlsx)$/.test(ext)) {
  112. this.setData({
  113. info: "文件类型为xls"
  114. });
  115. } else {
  116. $(".ts p").html("上传的文件类型不正确");
  117. $(".ts").fadeIn();
  118. setTimeout('$(".ts").fadeOut()', 700);
  119. return false;
  120. }
  121. }
  122. $(".express p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在处理中,请稍后...");
  123. $(".express p:eq(1)").html("");
  124. $(".express").show();
  125. if (fileNum == "one") {
  126. this.disable();
  127. }
  128. },
  129. onComplete: function(file, response) {
  130. eval("var obj=" + response);
  131. if (obj.success) {
  132. $(".express").hide();
  133. $(".express p:eq(0)").html("<i class='fa fa-2x fa-check-square-o'></i> &nbsp; "+obj.msg);
  134. $(".express p:eq(1)").html("<font class='sx'>确 定</font><font class='sx'>取 消</font>");
  135. $(".express").show();
  136. } else {
  137. $(".express").hide();
  138. $(".ts p").html(obj.msg);
  139. $(".ts").fadeIn();
  140. setTimeout('$(".ts").fadeOut()', 700);
  141. return false;
  142. }
  143. window.clearInterval(interval);
  144. this.enable();
  145. }
  146. });
  147. var button = $("#excel"), interval;
  148. var fileType = "pic", fileNum = "one";
  149. new AjaxUpload(button, {
  150. action: dataurl+"/excela",
  151. name: "userfile",
  152. onSubmit: function(file, ext) {
  153. if (fileType == "pic") {
  154. if (ext && /^(xls|xlsx)$/.test(ext)) {
  155. this.setData({
  156. info: "文件类型为xls"
  157. });
  158. } else {
  159. $(".ts p").html("上传的文件类型不正确");
  160. $(".ts").fadeIn();
  161. setTimeout('$(".ts").fadeOut()', 700);
  162. return false;
  163. }
  164. }
  165. $(".express p:eq(0)").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在处理中,请稍后...");
  166. $(".express p:eq(1)").html("");
  167. $(".express").show();
  168. if (fileNum == "one") {
  169. this.disable();
  170. }
  171. },
  172. onComplete: function(file, response) {
  173. eval("var obj=" + response);
  174. if (obj.success) {
  175. $(".express").hide();
  176. $(".express p:eq(0)").html("<i class='fa fa-2x fa-check-square-o'></i> &nbsp; "+obj.msg);
  177. $(".express p:eq(1)").html("<font class='sx'>确 定</font><font class='sx'>取 消</font>");
  178. $(".express").show();
  179. } else {
  180. $(".express").hide();
  181. $(".ts p").html(obj.msg);
  182. $(".ts").fadeIn();
  183. setTimeout('$(".ts").fadeOut()', 700);
  184. return false;
  185. }
  186. window.clearInterval(interval);
  187. this.enable();
  188. }
  189. });
  190. });
  191. $(".ctex").click(function() {
  192. var f = "";
  193. $(".select").each(function() {
  194. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  195. });
  196. $("input:text").each(function() {
  197. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  198. });
  199. window.location.href = "/customer/excel?excel="+$(this).data("ex")+"&"+f;
  200. });
  201. $(".indexexcel").click(function() {
  202. var f = "";
  203. var a = "";
  204. $(".datatext input[name='check']:checked").each(function() {
  205. a = a + $(this).val()+",";
  206. });
  207. f = f + "sid=" + a + "&";
  208. $(".select").each(function() {
  209. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  210. });
  211. $("input:text").each(function() {
  212. f = f + $(this).attr("name") + "=" + encodeURIComponent($(this).val()) + "&";
  213. });
  214. $("input:hidden").each(function() {
  215. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  216. });
  217. window.location.href = "/customer/indexexcel?excel=1&"+f;
  218. });
  219. </script>
  220. <script src="{$theme}js/ajaxupload.3.5.js"></script>
  221. <script type="text/javascript" src="{$theme}js/laydate.js"></script>
  222. {Template footer}