registration_edit.html 12 KB

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