registration_edit.html 12 KB

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