registration_add.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. {Template header}
  2. <body>
  3. <div class="warp">
  4. <div class="title winnone">信息登记 - 添加</div>
  5. <ul class="setting">
  6. <li>
  7. <em>店 铺:</em><select name="shop" class="select">
  8. {loop usershop() as $val}
  9. <option value="{$val['id']}">{$val['shopname']}</option>
  10. {/loop}</select>
  11. </li>
  12. <li>
  13. <em>仓 库:</em><select name="warehouse" class="select">
  14. <option value="5">美仓</option>
  15. </select>
  16. </li>
  17. <li>
  18. <em>上门目的:</em>
  19. <select name="objective" class="select class">
  20. <option value="1">仅自提</option>
  21. <option value="2">仅退货</option>
  22. <option value="3">退换货</option>
  23. <option value="4">安装头套</option>
  24. </select>
  25. </li>
  26. <li>
  27. <em>登记状态:</em>
  28. <select name="state" class="select class">
  29. <option value="1">沟通中</option>
  30. <option value="2">待客户上门</option>
  31. </select>
  32. </li>
  33. <li>
  34. <em>上门地点:</em>
  35. <select name="address" class="select class">
  36. <option value="1">BK850</option>
  37. <option value="2">Manhattan819</option>
  38. <option value="3">Flatbush933</option>
  39. <option value="4">Dallas3333</option>
  40. </select>
  41. </li>
  42. <li>
  43. <em>预约上门时间:</em>
  44. <input class="must" value="{$registration['stime']}" name="stime" type="text" >
  45. </li>
  46. <li>
  47. <em>订单编号:</em>
  48. <input class="must" value="" name="number" type="text" >
  49. </li>
  50. <li>
  51. <em>订单号:</em>
  52. <input class="must" value="" name="orderinfo" type="text" >
  53. </li>
  54. <li class="length">
  55. <em>待取货物:</em>
  56. <input value="" name="product" type="text" >
  57. </li>
  58. <li class="length">
  59. <em>产品链接:</em>
  60. <input value="" name="url" type="text" readonly style="background-color:#ccc" >
  61. </li>
  62. <li>
  63. <em>条 数:</em>
  64. <input class="must" value="" name="num" type="text" >
  65. </li>
  66. <li>
  67. <em>订单金额:</em>
  68. <input class="must" value="" name="shouldmoney" type="text" >
  69. </li>
  70. <li>
  71. <em>客户名称:</em>
  72. <input class="must" value="" name="name" type="text" >
  73. </li>
  74. <li>
  75. <em>客户电话:</em>
  76. <input class="must" value="" name="phone" type="text" >
  77. </li>
  78. <li>
  79. <em>店员备注颜色:</em>
  80. <div class="checkbox">
  81. <span class="ckrows"><label><input class="0" name="red" type="radio" value="0" checked><font>正常</font></label></span>
  82. <span class="ckrows"><label><input class="1" name="red" type="radio" value="1"><font>红色</font></label></span>
  83. </div>
  84. </li>
  85. <li>
  86. <span class="jrdd" style="height: 32px;line-height: 32px;padding: 0 16px;color: #fff;background-color: #2084db;float: left;margin-right: 16px;border-radius: 5px;display: block;cursor: pointer;">一键加入 订单号/订单金额/客户名称/客户电话/产品链接<span>
  87. </li>
  88. <li class="length">
  89. <em>网站店员备注</em>
  90. <textarea name="content" style="height:160px;"></textarea>
  91. </li>
  92. <li class="length">
  93. <em>退货货物</em>
  94. <input value="" name="thproduct" type="text" >
  95. </li>
  96. <li class="length">
  97. <em>美店备注</em>
  98. <b></b>
  99. </li>
  100. <li class="length scimg">
  101. <em>自提/退换货单<br>图片上传</em>
  102. <span class="upimg"></span>
  103. <font>+</font>
  104. </li>
  105. <div style="clear:both;"></div>
  106. </ul>
  107. <div class="button"><font class="datasavezy">提 交</font> <font class="fh">关 闭</font></div>
  108. </div>
  109. <div style="display:none;">
  110. <input id="upload-file" name="files" accept="image/xls,image/xlsx" type="file">
  111. </div>
  112. <script>var addedit="/registration/add/";
  113. $(document).ready(function() {
  114. $(".jrdd").click(function() {
  115. var a = $("input[name=number]").val();
  116. if(a == '')
  117. {
  118. $(".ts p").html("请先填写编号");
  119. $(".ts").fadeIn();
  120. setTimeout('$(".ts").fadeOut()', 900);
  121. }
  122. $.ajax({
  123. url: "/registration/order",
  124. data: "number=" + a,
  125. type: "POST",
  126. dataType: "json",
  127. success: function(c) {
  128. if (c && c.success) {
  129. $("input[name=orderinfo]").val(c.msg['orderinfo']);
  130. $("input[name=shouldmoney]").val(c.msg['shouldmoney']);
  131. $("input[name=name]").val(c.msg['name']);
  132. $("input[name=phone]").val(c.msg['phone']);
  133. $("input[name=orderinfo]").attr("disabled","disabled");
  134. $("input[name=url]").val(c.msg['url']);
  135. $("input[name=orderinfo]").css("background-color","#ccc");
  136. $(".ts p").html("已成功填入");
  137. $(".ts").fadeIn();
  138. setTimeout('$(".ts").fadeOut()', 500);
  139. return false;
  140. } else {
  141. $(".ts p").html(c.msg);
  142. $(".ts").fadeIn();
  143. setTimeout('$(".ts").fadeOut()', 900);
  144. return false;
  145. }
  146. }
  147. });
  148. });
  149. $("select[name='sl']").change();
  150. var button = $(".scimg font"), interval;
  151. var fileType = "pic", fileNum = "one";
  152. new AjaxUpload(button, {
  153. action: "/img/",
  154. name: "userfile",
  155. onSubmit: function(file, ext) {
  156. if (fileType == "pic") {
  157. if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)) {
  158. this.setData({
  159. info: "文件类型为图片"
  160. });
  161. }
  162. else if (ext && /^(3gp|rmvb|flv|wmv|avi|mkv|mp4|mp3|wav)$/.test(ext)) {
  163. this.setData({
  164. info: "文件类型为视频"
  165. });
  166. } else {
  167. alert("提示:您上传的是非图片类型!");
  168. return false;
  169. }
  170. }
  171. $(".scimg font").hide();
  172. $(".loadimg").show();
  173. layx.load('loadId','上传中');
  174. if (fileNum == "one") {
  175. this.disable();
  176. }
  177. },
  178. onComplete: function(file, response) {
  179. eval("var obj=" + response);
  180. if (obj.ok) {
  181. layx.destroy('loadId');
  182. if (/^(.jpg|.png|.jpeg|.gif)$/.test(obj.lx)) {
  183. $(".scimg span").append('<img src="' + obj.filename + '" title="点击图片删除">');
  184. }
  185. else if (/^(.3gp|.rmvb|.flv|.wmv|.avi|.mkv|.mp4|.mp3|.wav)$/.test(obj.lx)) {
  186. $(".scimg span").append('<video src="' + obj.filename + '" controls="controls"></video>');
  187. }
  188. } else {
  189. layx.destroy('loadId');
  190. $(".ts p").html("上传失败,请重试");
  191. $(".ts").fadeIn();
  192. setTimeout('$(".ts").fadeOut()', 800);
  193. }
  194. $(".loadimg").hide();
  195. $(".scimg font").show();
  196. window.clearInterval(interval);
  197. this.enable();
  198. }
  199. });
  200. });
  201. $(".datasavezy").click(function() {
  202. $(".ts p").html("<i class='fa fa-2x fa-cog fa-spin'></i> &nbsp; 正在添加中,请稍后...");
  203. $(".ts").show();
  204. var f = "";
  205. var e = "";
  206. var x = '';
  207. $(".select").each(function() {
  208. f = f + $(this).attr("name") + "=" + $(this).children("option:selected").val() + "&";
  209. });
  210. $("input:text").each(function() {
  211. var str = $(this).val().replace(/\+/g,"%2B");
  212. var str = str.replace(/&/g,"%26");
  213. f = f + $(this).attr("name") + "=" + str + "&";
  214. });
  215. $("input:password").each(function() {
  216. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  217. });
  218. $("input:hidden").each(function() {
  219. f = f + $(this).attr("name") + "=" + $(this).val() + "&";
  220. });
  221. $("textarea").each(function() {
  222. var str2 = $(this).val().replace(/\+/g,"%2B");
  223. var str2 = str2.replace(/&/g,"%26");
  224. f = f + $(this).attr("name") + "=" + str2 + "&";
  225. });
  226. if($(".scimg img").length > 0 || $(".scimg video").length > 0)
  227. {
  228. var a = '';
  229. for (var b = 0; b < $(".scimg .upimg img").length; b++)
  230. {
  231. a = a + $(".scimg .upimg img")[b].src + "|";
  232. }
  233. for (var b = 0; b < $(".scimg .upimg video").length; b++)
  234. {
  235. a = a + $('.scimg .upimg video')[b].src + "|";
  236. }
  237. f = f + "img=" + a + "&";
  238. }
  239. for(i=0;i<$(".checkbox").length;i++)
  240. {
  241. var checkid = ""; var checkname = "";
  242. $(".checkbox:eq("+i+") .ckrows input:checked").each(function(){
  243. checkname = $(this).attr("name");
  244. checkid = checkid + $(this).val()+",";
  245. });
  246. if(checkname == "")
  247. {
  248. $(".ts p").text($(".checkbox:eq("+i+")").prevAll("em").text()+"为必填项");
  249. $(".ts").show();
  250. setTimeout('$(".ts").fadeOut()', 600);
  251. return false;
  252. }
  253. f = f + checkname + "=" + checkid + "&";
  254. }
  255. $(".dxh .xntj").each(function() {
  256. var str2 = $(this).find("textarea").val().replace(/\+/g,"%2B");
  257. var str2 = str2.replace(/&/g,"%26");
  258. x = x + $(this).find(".checkboxfbt .ckrows input:checked").val()+ "-" + str2 + "|";
  259. });
  260. f = f + "degreetext="+x+"&";
  261. var ab = 0;
  262. $(".must").each(function() {
  263. if ($.trim($(this).val()).length == 0) {
  264. $(this).css("border", "1px solid #F66");
  265. ab = ab + 1;
  266. }
  267. });
  268. if (ab > 0) {
  269. $(".ts p").text("红框为必填项");
  270. $(".ts").show();
  271. setTimeout('$(".ts").fadeOut()', 600);
  272. return false;
  273. }
  274. $.ajax({
  275. url: addedit,
  276. data: f,
  277. type: "POST",
  278. dataType: "json",
  279. success: function(a) {
  280. if (a && a.success) {
  281. $(".ts").hide();
  282. $(".express p:eq(0)").html(a.msg+"是否关闭?");
  283. $(".express p:eq(1)").html("<font class='fh'>确 定</font><font class='esc'>取 消</font>");
  284. $(".express").show();
  285. } else {
  286. $(".ts").hide();
  287. $(".ts p").html(a.msg);
  288. $(".ts").fadeIn();
  289. setTimeout('$(".ts").fadeOut()', 800);
  290. }
  291. }
  292. });
  293. });
  294. $(document).on("click", ".scimg .upimg img", function() {
  295. $(this).remove();
  296. });
  297. $(document).on("click", ".scimg .upimg video", function() {
  298. $(this).remove();
  299. });
  300. </script>
  301. <script type="text/javascript" src="{$theme}js/ajaxupload.3.5.js"></script>
  302. {Template footer}