u9_product.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. {Template header}
  2. <style>
  3. .lv_fatiao{
  4. display: block;
  5. }
  6. .lv_fakuai{
  7. display: none;
  8. }
  9. .lv_fakuai_two{
  10. display: none;
  11. }
  12. .lv_toutao{
  13. display: none;
  14. }
  15. .lv_jiefa{
  16. display: none;
  17. }
  18. .lv_liwu{
  19. display: none;
  20. }
  21. .lv_peijian{
  22. display: none;
  23. }
  24. .lv_huaqiantoutao{
  25. display: none;
  26. }
  27. .lv_huaqianqita{
  28. display: none;
  29. }
  30. </style>
  31. <link href="{$theme}js/select2/select2.min.css?v={time()}" rel="stylesheet" />
  32. <script src="{$theme}js/select2/select2.full.min.js?v={time()}"></script>
  33. <body>
  34. <div class="warp">
  35. <ul class="setting">
  36. <li >
  37. <em>类 目:</em>
  38. <select name="category" class="select">
  39. {loop typeclass(16) as $val}
  40. <option value="{$val['id']}">{$val['title']} - {$val['zh']}</option>
  41. {/loop}
  42. </select>
  43. </li>
  44. {Template product/fatiao}
  45. {Template product/fakuai}
  46. {Template product/toutao}
  47. {Template product/jiefa}
  48. {Template product/liwu}
  49. {Template product/peijian}
  50. {Template product/huaqiantoutao}
  51. {Template product/huaqianqita}
  52. <li class="length" id="lv_liwu_show">
  53. <em>长 度:</em>
  54. <div class="checkbox">
  55. {loop typeclass(14) as $val}
  56. <span class="ckrows"><label><input class="{$val['id']}" name="size" type="radio"
  57. value="{$val['id']}">
  58. <font>{$val['title']}</font>
  59. </label></span>
  60. {/loop}
  61. </div>
  62. </li>
  63. <li class="length" style="display: block;" id="lv_hyu9lh"><font class="tbu9" style="width:180px;height: 50px;line-height: 50px; color: #fff;background-color: #2084db;border-radius: 5px;display: block;cursor: pointer;text-align: center;margin:35px auto 0 auto">创建U9料号</font></li>
  64. <li class="length" style="display: none;" id="lv_beizhu">
  65. <em>备 注:</em>
  66. <div style="background-color: #fff;padding: 10px;text-align: left;">
  67. </div>
  68. </li>
  69. <!-- <li class="length" style="display: none;" id="lv_tbu9lh">
  70. <font class="tbu9" style="width:180px;height: 50px;line-height: 50px; color: #fff;background-color: #2084db;border-radius: 5px;display: block;cursor: pointer;text-align: center;margin:35px auto 0 auto">同步U9料号</font>
  71. </li> -->
  72. </ul>
  73. <div class="hidden">
  74. </div>
  75. <div class="systemwindow">
  76. <div>
  77. <p>是否确定删除所选信息?</p>
  78. <p>
  79. <font class="button">确 定</font>
  80. <font class="esc">取 消</font>
  81. </p>
  82. </div>
  83. </div>
  84. </div>
  85. <script>
  86. function closeproducr(){
  87. $(".lv_fatiao").css("display","none");
  88. $(".lv_fakuai").css("display","none");
  89. $(".lv_fakuai_two").css("display","none");
  90. $(".lv_toutao").css("display","none");
  91. $(".lv_jiefa").css("display","none");
  92. $(".lv_liwu").css("display","none");
  93. $(".lv_peijian").css("display","none");
  94. $(".lv_huaqiantoutao").css("display","none");
  95. $(".lv_huaqianqita").css("display","none");
  96. }
  97. $("select[name='category']").on("change",function(){
  98. let category = $(this).val();
  99. closeproducr();
  100. if(category == 126){
  101. $(".lv_fatiao").css("display","block");
  102. $("#lv_liwu_show").css('display','block')
  103. }
  104. if(category == 127){
  105. $(".lv_fakuai").css("display","block");
  106. $("#lv_liwu_show").css('display','block')
  107. }
  108. if(category == 128){
  109. $(".lv_toutao").css("display","block");
  110. $("#lv_liwu_show").css('display','block')
  111. }
  112. if(category == 130){
  113. $(".lv_jiefa").css("display","block");
  114. $("#lv_liwu_show").css('display','block')
  115. }
  116. if(category == 131){
  117. $(".lv_liwu").css("display","block");
  118. $("#lv_liwu_show").css('display','none')
  119. }
  120. if(category == 133){
  121. $(".lv_peijian").css("display","block");
  122. $("#lv_liwu_show").css('display','block')
  123. }
  124. if(category == 1297){
  125. $(".lv_huaqiantoutao").css("display","block");
  126. $("#lv_liwu_show").css('display','block')
  127. }
  128. if(category == 1702){
  129. $(".lv_huaqianqita").css("display","block");
  130. $("#lv_liwu_show").css('display','block')
  131. }
  132. })
  133. $(function () {
  134. $("select[name='category']").on("change", function () {
  135. $('.select_two').select2("destroy");
  136. $('.select_two').select2({
  137. placeholder: "请选择",
  138. allowClear: true,
  139. });
  140. })
  141. /**发块的类型**/
  142. $("select[name='type']").on("change", function () {
  143. let type = $(this).val();
  144. //发块 对应的蕾丝尺寸是 25
  145. if(type == 195){
  146. $("#lv_fakuai_25").css("display","block");
  147. $("#lv_fakuai_26").css("display","none");
  148. }
  149. //蕾丝前头 对应的蕾丝尺寸是 26
  150. if(type == 197){
  151. $("#lv_fakuai_25").css("display","none");
  152. $("#lv_fakuai_26").css("display","block");
  153. }
  154. })
  155. $('.select_two').select2({
  156. placeholder: "请选择",
  157. allowClear: true,
  158. });
  159. })
  160. $(".tbu9").on("click",function(){
  161. let arr = {};
  162. $(".warp .setting li").each(function(){
  163. if($(this).css("display") != "none" ){
  164. if($(this).find("input[type='radio']:checked").val()){
  165. arr[$(this).find("input").attr('name')] = $(this).find("input[type='radio']:checked").val();
  166. }
  167. if($(this).find("select").val()){
  168. arr[$(this).find("select").attr('name')] = $(this).find("select").val();
  169. }
  170. }
  171. })
  172. $.post("/u9tools/cjlp",arr,function(res){
  173. if(res.code == 1){
  174. let str = "<div style='padding-top:30px'>";
  175. str += "<div>U9分类:" + res.data.bm + "</div>";
  176. str += "<div>U9料号:" + res.data.jm + "</div>";
  177. str += "<div>中文名称:" + res.data.zh + "</div>";
  178. str += "<div>英文名称:" + res.data.title + "</div>";
  179. //str += "<div>erp sku:" + res.data.sku + "</div>";
  180. str += "</div>";
  181. $("#lv_beizhu div").html(str);
  182. $("#lv_hyu9lh").css("display","none");
  183. $("#lv_beizhu").css("display","block");
  184. $("#lv_tbu9lh").css("display","block");
  185. }else{
  186. layx.confirm('提示',res.msg,null,{
  187. buttons:[
  188. {
  189. label:'确定',
  190. callback:function(id, button, event){
  191. layx.destroy(id);
  192. }
  193. }
  194. ],dialogIcon:'error',shadable:0.6
  195. });
  196. }
  197. },'json')
  198. })
  199. function ceshi(){
  200. let tmp_list = "85,-126-80-57-101-";
  201. var list = tmp_list.replace(/\-(0|163|164|165|166)\-/, '-')
  202. console.log(list)
  203. cc = list.split(",");
  204. console.log(cc)
  205. listqc = list.replace(/\d{1,3}\,/, '');
  206. console.log(listqc)
  207. listqc = listqc.substring(0, listqc.length - 1);
  208. console.log(listqc)
  209. data = listqc.split("-");
  210. console.log(data)
  211. var t = "";
  212. var fpdg = "";
  213. let wl = "";
  214. var zrflx = 0; //是否有真人发类型
  215. for (i = 1; i < data.length; i++) {
  216. if (i == 2) {
  217. //if(data[i] == 2090)
  218. if ((data[i] == 2090) || (data[i] == 1620) || (data[i] == 2480) || (data[i] == 2469)) {
  219. zrflx++;
  220. t = t + data[i];
  221. fpdg = fpdg + '-' + data[i];
  222. } else {
  223. if (cc[0] != list) {
  224. t = t + data[i] + cc[0];
  225. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  226. } else {
  227. t = t + data[i];
  228. fpdg = fpdg + '-' + data[i];
  229. }
  230. }
  231. } else if (i == 3 && zrflx > 0) {
  232. if (cc[0] != list) {
  233. t = t + data[i] + cc[0];
  234. fpdg = fpdg + '-' + data[i] + '-' + cc[0];
  235. } else {
  236. t = t + data[i];
  237. fpdg = fpdg + '-' + data[i];
  238. }
  239. } else {
  240. t = t + data[i];
  241. fpdg = fpdg + '-' + data[i];
  242. }
  243. }
  244. wl = wl + t + '-' + '|';
  245. console.log(wl)
  246. }
  247. </script>
  248. <script src="{$theme}js/goodsrules.js?v={time()}"></script>
  249. {Template footer}