registration_add.html 9.8 KB

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