product.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  1. var update_color_id_suff = "X_";
  2. var update_color_id = "1"; //添加时的临时ID
  3. var color_is_update = 1; //1是添加 2是修改
  4. /**
  5. * 添加颜色
  6. */
  7. function add_color(isUpdate){
  8. $("#addInventoryHtml").hide();
  9. var $node = $("#addColorHtml");
  10. var flag = verificationColor();
  11. if(!flag){
  12. return false;
  13. }
  14. var colorId = $node.find(".colorId").val();
  15. if(color_is_update == 1){
  16. if(!isEmpty(isUpdate)){
  17. isUpdate = 2;
  18. colorId = update_color_id_suff+update_color_id;
  19. }
  20. update_color_id++;
  21. var colorHtml = '<tr class="text-c">' +
  22. '<input type="hidden" class="colorId" name="" id="" value="'+ colorId +'">'+
  23. '<input type="hidden" class="isUpdate" name="" id="" value="'+ isUpdate +'">';
  24. colorHtml += '<td width="40" class="colorIdHtml">-</td>';
  25. colorHtml += '<td width="40" class="colorName">'+$node.find(".colorName").val()+'</td>';
  26. colorHtml += '<td width="40" class="colorAbbreviation">'+$node.find(".colorAbbreviation").val()+'</td>';
  27. colorHtml += '<td width="40" class="colorDiscount">'+$node.find(".colorDiscount").val()+'</td>';
  28. colorHtml += '<td width="40" class="colorPrice">'+$node.find(".colorPrice").val()+'</td>';
  29. colorHtml += '<td width="40" class="colorBar">'+$node.find(".colorBar").val()+'</td>';
  30. colorHtml += '<td width="40" class="colorJdProductId">'+$node.find(".colorJdProductId").val()+'</td>';
  31. colorHtml += '<td width="40" class="colorIsWeight">'+$node.find(".colorIsWeight").val()+'</td>';
  32. colorHtml += '<td width="40" class="colorMode">'+$node.find(".colorMode").val()+'</td>';
  33. var colorIsMachine = $(':radio[name="colorIsMachine"]:checked').val();
  34. var colorIsMachineStr = '';
  35. if(colorIsMachine == 1){
  36. colorIsMachineStr = '水机产品';
  37. }else{
  38. colorIsMachineStr = '其他产品';
  39. }
  40. colorHtml += '<td width="40" ><span class="colorIsMachineMsg">'+colorIsMachineStr+'</span><input type="hidden" class="colorIsMachine" name="colorIsMachine" id="colorIsMachine" value="'+ colorIsMachine +'"></td>';
  41. var colorStatus = $(':radio[name="colorStatus"]:checked').val();
  42. var colorStatusStr = '';
  43. if(colorStatus == 1){
  44. colorStatusStr = '使用';
  45. }else{
  46. colorStatusStr = '禁用';
  47. }
  48. colorHtml += '<td width="40" ><span class="colorStatusMsg">'+colorStatusStr+'</span><input type="hidden" class="colorStatus" value="'+ colorStatus +'"></td>';
  49. var img = $node.find(".colorPicture").val();
  50. var showImg = '';
  51. if(isEmpty(img)){
  52. showImg = url_path +"/"+ img;
  53. }
  54. colorHtml += '<td width="40" >'
  55. + '<img style="width: 40px;" src="' + showImg + '" class="colorPictureMsg" >'
  56. + '<input type="hidden" class="colorPicture" value="'+ img +'">'
  57. + '</td>';
  58. colorHtml += '<td width="40" >' +
  59. '<input type="hidden" class="colorInventory" value="0">'+
  60. '<span class="colorInventoryMsg" >0</span>'+
  61. '</td>';
  62. colorHtml += '<td width="40">' +
  63. '<a href="javascript:void(0)" class="del_product all_down" onclick="updTr($(this))" >修改</a>&nbsp;&nbsp;' +
  64. '<a href="javascript:void(0)" class="del_product all_down" onclick="delTr($(this))" >删除</a><br>' +
  65. '<a href="javascript:void(0)" class="del_product all_down" onclick="to_inventory($(this))" >添加库存</a>' +
  66. '</td>';
  67. colorHtml += '</tr>';
  68. if(isHaveColorList == 2){
  69. $("#add_color_id").html(colorHtml);
  70. isHaveColorList = 1;
  71. }else{
  72. $("#add_color_id").append(colorHtml);
  73. }
  74. }else{
  75. var noHaveColorId = true;
  76. $("#add_color_id").find("tr").each(function () {
  77. if($(this).find(".colorId").val() == colorId){
  78. noHaveColorId = false;
  79. $(this).find(".isUpdate").val(1);
  80. if(colorId.indexOf(update_color_id_suff) < 0){
  81. $(this).find(".colorIdHtml").html(colorId);
  82. }
  83. $(this).find(".colorName").html($node.find(".colorName").val());
  84. $(this).find(".colorAbbreviation").html($node.find(".colorAbbreviation").val());
  85. $(this).find(".colorDiscount").html($node.find(".colorDiscount").val());
  86. $(this).find(".colorPrice").html($node.find(".colorPrice").val());
  87. $(this).find(".colorBar").html($node.find(".colorBar").val());
  88. $(this).find(".colorJdProductId").html($node.find(".colorJdProductId").val());
  89. $(this).find(".colorIsWeight").html($node.find(".colorIsWeight").val());
  90. $(this).find(".colorMode").html($node.find(".colorMode").val());
  91. $(this).find(".colorPicture").val($node.find(".colorPicture").val());
  92. var colorIsMachine = $(':radio[name="colorIsMachine"]:checked').val();
  93. $(this).find(".colorIsMachine").val(colorIsMachine);
  94. var colorIsMachineStr = '';
  95. if(colorIsMachine == 1){
  96. colorIsMachineStr = '水机产品';
  97. }else{
  98. colorIsMachineStr = '其他产品';
  99. }
  100. $(this).find(".colorIsMachineMsg").html(colorIsMachineStr);
  101. var colorStatus = $(':radio[name="colorStatus"]:checked').val();
  102. $(this).find(".colorStatus").val(colorStatus);
  103. var colorStatusStr = '';
  104. if(colorStatus == 1){
  105. colorStatusStr = '使用';
  106. }else{
  107. colorStatusStr = '禁用';
  108. }
  109. $(this).find(".colorStatusMsg").html(colorStatusStr);
  110. var img = $node.find(".colorPicture").val();
  111. var showImg = '';
  112. if(isEmpty(img)){
  113. showImg = url_path +"/"+ img;
  114. }
  115. $(this).find(".colorPictureMsg").attr("src",showImg);
  116. }
  117. });
  118. if(noHaveColorId){
  119. var index = layer.confirm('该颜色已被删除,点击确认恢复。', {
  120. btn: ['确认','取消'] //按钮
  121. }, function(){
  122. color_is_update = 1;
  123. add_color(1);
  124. layer.closeAll();
  125. }, function(){
  126. colorClear();
  127. layer.closeAll();
  128. });
  129. }
  130. }
  131. $("#addColorHtml").hide();
  132. }
  133. /**
  134. * 取消颜色
  135. */
  136. function cancel_color() {
  137. $(".add-color-button").val("添加");
  138. $("#addColorHtml").hide();
  139. color_is_update = 1;
  140. $("#addColorHtml").find(".colorId").val("");
  141. colorClear();
  142. }
  143. /**
  144. * 验证
  145. */
  146. function verificationColor() {
  147. var flag = true;
  148. $("#addColorHtml").find(".add_color").each(function () {
  149. var $node = $(this);
  150. var myValue = $node.val();
  151. var myMinlength = $node.attr("myMinlength");
  152. if(!isEmpty(myMinlength)){
  153. myMinlength = 0;
  154. }
  155. if(!isEmpty(myValue) && myMinlength != 0){
  156. vailErrorMsg_3($(this),$(this).attr("errormsg"));
  157. flag = false;
  158. return false;
  159. }
  160. var myMaxlength = $node.attr("myMaxlength");
  161. if(isEmpty(myMaxlength)){
  162. if(myValue.length > myMaxlength){
  163. vailErrorMsg_3($(this),$(this).attr("errormsg"));
  164. flag = false;
  165. return false;
  166. }
  167. }
  168. });
  169. //判断是否有sku相等,京东69码相等,名称与简称相等
  170. var colorName = $("#addColorHtml").find(".colorName").val();
  171. var colorAbbreviation = $("#addColorHtml").find(".colorAbbreviation").val();
  172. var colorBar = $("#addColorHtml").find(".colorBar").val();
  173. var colorJdProductId = $("#addColorHtml").find(".colorJdProductId").val();
  174. $("#add_color_id").find("tr").each(function () {
  175. var tdcolorName = $(this).find(".colorName").html();
  176. var tdcolorAbbreviation = $(this).find(".colorAbbreviation").html();
  177. var tdcolorBar = $(this).find(".colorBar").html();
  178. var tdcolorJdProductId = $(this).find(".colorJdProductId").html();
  179. if(colorName == tdcolorName && colorAbbreviation == tdcolorAbbreviation && color_is_update == 1){
  180. vailErrorMsg_3($("#addColorHtml").find(".colorName"),"请勿重复添加");
  181. flag = false;
  182. return false;
  183. }
  184. if(colorBar == tdcolorBar && color_is_update == 1){
  185. vailErrorMsg_3($("#addColorHtml").find(".colorBar"),"69码重复");
  186. flag = false;
  187. return false;
  188. }
  189. if(isEmpty(tdcolorJdProductId) && colorJdProductId == tdcolorJdProductId && color_is_update == 1){
  190. vailErrorMsg_3($("#addColorHtml").find(".colorJdProductId"),"京东SKU重复");
  191. flag = false;
  192. return false;
  193. }
  194. });
  195. return flag;
  196. }
  197. function fileOnclick(node){
  198. $(node).parents(".upload_color_class").find('.color_file').click();
  199. }
  200. $(function(){
  201. $("#upload_color_img").change(function() {
  202. fileUpload("upload_color_img");
  203. });
  204. });
  205. $(function(){
  206. var loadIndex = 0;
  207. $("#form-order-add").Validform({
  208. tiptype: function (msg, o, cssctl) {
  209. if (o.type == 3) {//失败
  210. layer.msg(msg, {icon: 5, time: 3000});
  211. $(window).scrollTop(o.obj.offset().top - 40);
  212. }
  213. },
  214. datatype: {//自定义验证类型
  215. },
  216. ignoreHidden: true,
  217. tipSweep: true, //若为true,则只在表单提交时验证
  218. ajaxPost: true, //异步提交
  219. beforeCheck: function (curform) { //验证通过之前执行的函数
  220. var flag = false;
  221. },
  222. beforeSubmit: function (curform) { //验证通过之后执行的函数
  223. if(!$("#addColorHtml").is(':hidden')){//表示显示
  224. vailErrorMsg_3($("#addColorHtml"),"操作未完成,请‘确定’或者‘取消’颜色的更改。");
  225. return false;
  226. }
  227. var colorList = getColorList();
  228. if(colorList == null || colorList.length < 1){
  229. vailErrorMsg_3($("#add_color_id"),"至少需要一个颜色");
  230. return false;
  231. }
  232. $("#colorListJson").val(JSON.stringify(colorList));
  233. var productAreaRelaStr = '';
  234. $(".son_checkbox").each(function () {
  235. if($(this).is(':checked')){
  236. if(productAreaRelaStr == ''){
  237. productAreaRelaStr = $(this).val();
  238. }else{
  239. productAreaRelaStr += ','+$(this).val();
  240. }
  241. }
  242. });
  243. $("#productAreaRelaStr").val(productAreaRelaStr);
  244. var flag = false;
  245. /*封装订单项*/
  246. var orderItemArray = new Array();
  247. var combination = parseInt($("input[name='productIsCombination']:checked").val());
  248. if(combination === 2){
  249. $("#add_product").find("tr").each(function(){
  250. var orderItem = new Object();
  251. orderItem.combinatItemColorId = $(this).find(".color_id").val();
  252. orderItem.combinatItemNum = $(this).find(".item-num").val();
  253. orderItemArray.push(orderItem);
  254. flag = true;
  255. });
  256. if(!flag){
  257. vailErrorMsg($(".add-order-button"),"必须要有一个产品");
  258. return false;
  259. }
  260. $("#productString").val(JSON.stringify(orderItemArray));
  261. }
  262. loadIndex = layer.load(1, {
  263. shade: [0.5,'#fff'] //0.1透明度的白色背景
  264. });
  265. },
  266. callback: function (data) {//异步回调函数
  267. if (data) {
  268. var index = layer.alert(data.resultMsg, function (index) {
  269. if (data.returnCode == 200) {
  270. location.href = url_path + "/admin/product/product_page";
  271. }else {
  272. layer.close(index);
  273. }
  274. });
  275. if(loadIndex != 0 ){
  276. layer.close(loadIndex);
  277. }
  278. }
  279. return false;
  280. }
  281. });
  282. });
  283. /**
  284. * 获取颜色集合
  285. */
  286. function getColorList(){
  287. var colorList = new Array();
  288. $("#add_color_id").find("tr").each(function(){
  289. var color = new Object();
  290. if(!isEmpty($(this).find(".colorName").html()) || !isEmpty($(this).find(".colorBar").html())){
  291. return false;
  292. }
  293. var colorId = $(this).find(".colorId").val();
  294. if(colorId.indexOf(update_color_id_suff) > -1){ //新加的颜色
  295. color.isUpdate=2; //是否修改过 1:修改过 2:未曾修改
  296. }else{
  297. color.colorId = colorId;
  298. color.isUpdate = $(this).find(".isUpdate").val();
  299. }
  300. color.colorName = $(this).find(".colorName").html();
  301. color.colorAbbreviation = cufte($(this).find(".colorAbbreviation").html());
  302. var colorDiscount = cufte($(this).find(".colorDiscount").html());
  303. var colorPrice = cufte($(this).find(".colorPrice").html());
  304. color.colorDiscount = accMul(colorDiscount,100);
  305. color.colorPrice = accMul(colorPrice,100);
  306. color.colorBar = cufte($(this).find(".colorBar").html());
  307. color.colorJdProductId = cufte($(this).find(".colorJdProductId").html());
  308. color.colorIsWeight = cufte($(this).find(".colorIsWeight").html());
  309. color.colorMode = cufte($(this).find(".colorMode").html());
  310. color.colorPicture = cufte($(this).find(".colorPicture").val());
  311. color.colorIsMachine = cufte($(this).find('.colorIsMachine').val());
  312. color.colorStatus = cufte($(this).find('.colorStatus').val());
  313. color.inventoryGoodProductNum = cufte($(this).find('.colorInventory').val());
  314. colorList.push(color);
  315. });
  316. return colorList;
  317. }
  318. /**
  319. * 展示出添加color
  320. */
  321. function show_add_color() {
  322. $(".add-color-button").val("添加");
  323. $("#addColorHtml").show();
  324. color_is_update = 1;
  325. $("#addColorHtml").find(".colorId").val("");
  326. colorClear();
  327. }
  328. /**
  329. * 清除color
  330. */
  331. function colorClear() {
  332. $(".str").val("");
  333. $(".num").val(0);
  334. var uploadHtml = '<div class="download_file"><a href="javascript:void(0)" class="del_product all_down" onclick="fileOnclick(this)">上传图片</a></div>';
  335. $("#addColorHtml").find(".download_file").html(uploadHtml);
  336. $("#addColorHtml").find(".colorPicture").val("");
  337. $("#upload_color_img").change(function() {
  338. fileUpload("upload_color_img");
  339. });
  340. $(".colorNoMachine").iCheck('check');
  341. $(".colorIsStatus").iCheck('check');
  342. }
  343. /**
  344. * 修改
  345. */
  346. function updTr($this) {
  347. $this = $this.parents("tr");
  348. var $addColor = $("#addColorHtml");
  349. $addColor.find(".colorId").val($this.find(".colorId").val());
  350. $addColor.find(".colorName").val($this.find(".colorName").html());
  351. $addColor.find(".colorAbbreviation").val($this.find(".colorAbbreviation").html());
  352. $addColor.find(".colorDiscount").val($this.find(".colorDiscount").html());
  353. $addColor.find(".colorPrice").val($this.find(".colorPrice").html());
  354. $addColor.find(".colorBar").val($this.find(".colorBar").html());
  355. $addColor.find(".colorJdProductId").val($this.find(".colorJdProductId").html());
  356. $addColor.find(".colorIsWeight").val($this.find(".colorIsWeight").html());
  357. $addColor.find(".colorMode").val($this.find(".colorMode").html());
  358. var colorPicture = $this.find(".colorPicture").val();
  359. var html ='';
  360. if(isEmpty(colorPicture)){
  361. html = '<div class="download_file"><img style="width: 75px;" src="' + url_path +"/"+ colorPicture + '" class="" >&nbsp;&nbsp;<a href="javascript:void(0)" onclick="fileOnclick(this)">重新上传</a></div>';
  362. }else{
  363. html = '<div class="download_file"><a href="javascript:void(0)" class="del_product all_down" onclick="fileOnclick(this)">上传图片</a></div>';
  364. }
  365. $(".download_file").html(html);
  366. $(".upload_color_class").find(".colorPicture").val(colorPicture);
  367. $("#upload_color_img").change(function() {
  368. fileUpload("upload_color_img");
  369. });
  370. var colorIsMachine = $this.find('.colorIsMachine').val();
  371. if(colorIsMachine == 1){
  372. $(".colorIsMachine").iCheck('check');
  373. }else{
  374. $(".colorNoMachine").iCheck('check');
  375. }
  376. var colorStatus = $this.find('.colorStatus').val();
  377. if(colorStatus == 1){
  378. $(".colorIsStatus").iCheck('check');
  379. }else{
  380. $(".colorNoStatus").iCheck('check');
  381. }
  382. $(".add-color-button").val("修改");
  383. $("#addColorHtml").show();
  384. color_is_update = 2;
  385. }
  386. /**
  387. * 删除商品
  388. */
  389. function delTr($this){
  390. var length= $("#add_color_id").find("tr").length;
  391. if(length < 2){
  392. vailErrorMsg_3($("#add_color_id"),"必须要要有一个颜色");
  393. }else{
  394. $this.parents("tr").remove();
  395. }
  396. }
  397. function fileUpload(idValue) {
  398. $.ajaxFileUpload({
  399. url: url_path + "/admin/product/fileUpload",
  400. secureuri: false,
  401. fileElementId: idValue,//文件选择框的id属性/名称
  402. dataType: 'json', //json
  403. success: function (data) {
  404. if (data.returnCode == 200) {
  405. var html = '<div><img style="width: 75px;" src="' + url_path + "/" + data.returnMsg.imgUrl + '" class="del_product all_down " >&nbsp;&nbsp;<a href="javascript:void(0)" onclick="fileOnclick(this)">重新上传</a></div>';
  406. $("#" + idValue).parent().find(".download_file").html(html);
  407. $("#" + idValue).parent().find(".colorPicture").val(data.returnMsg.imgUrl);
  408. $("#upload_color_img").change(function () {
  409. fileUpload("upload_color_img");
  410. });
  411. } else {
  412. layer.msg('上传失败,请重试!', {icon: 5, time: 2000});
  413. }
  414. }
  415. });
  416. }
  417. /**
  418. * 取消添加库存
  419. */
  420. function cancel_inventory() {
  421. $("#addInventoryHtml").hide();
  422. }
  423. /**
  424. * 添加库存
  425. */
  426. function to_inventory($this) {
  427. $this = $this.parents("tr");
  428. var $addColor = $("#addInventoryHtml");
  429. $addColor.find(".inventoryProductColorId").val($this.find(".colorId").val());
  430. $("#addInventoryHtml").show();
  431. $("#addColorHtml").hide();
  432. }
  433. function addProductInventory() {
  434. var $addColor = $("#addInventoryHtml");
  435. var colorId = $addColor.find(".inventoryProductColorId").val();
  436. var inventoryGoodProductNum = $("#inventoryGoodProductNum").val();
  437. $("#add_color_id").find("tr").each(function () {
  438. if($(this).find(".colorId").val() == colorId){
  439. $(this).find(".colorInventory").val(inventoryGoodProductNum);
  440. $(this).find(".colorInventoryMsg").html(inventoryGoodProductNum);
  441. $addColor.find(".inventoryProductColorId").val("");
  442. /* layer.msg('产品添加完成后,请联系业务经理添加产品在各个客户的销售价格,并联系采购部门增加采购成本价格', {icon: 5, time: 5000});*/
  443. layer.confirm('产品添加完成后,请联系业务经理添加产品在各个客户的销售价格,并联系采购部门增加采购成本价格', {
  444. btn: ['确认'] //按钮
  445. }, function(){
  446. layer.closeAll();
  447. });
  448. }
  449. })
  450. $("#addInventoryHtml").hide();
  451. }
  452. /**
  453. * 打开商品列表
  454. */
  455. function add_product() {
  456. layer_show("商品列表",url_path + "/admin/salesOrder/to_add_product","1000","500");
  457. }
  458. /**
  459. * 选择商品回调
  460. * @param colorIds
  461. */
  462. function setSelectProduct(colorIds){
  463. var index = layer.load(1, {
  464. shade: [0.5,'#fff'] //0.1透明度的白色背景
  465. });
  466. $("#all_add_product").show();
  467. var colorIdArray = colorIds.split("_");
  468. for(var j=0;j<colorIdArray.length;j++){
  469. var colorId = colorIdArray[j];
  470. if(colorId == ""){
  471. break;
  472. }
  473. var flag = true;
  474. $("#add_product").find("tr").each(function (){
  475. var colId = $(this).find(".color_id").eq(0).val();
  476. if(colId == colorId){
  477. flag = false;
  478. }
  479. });
  480. if(!flag){
  481. continue;
  482. }
  483. var salesOrderStatus = 2;
  484. $.ajax({
  485. type: "POST",
  486. data: {
  487. colorId : colorId,
  488. salesOrderStatus : salesOrderStatus
  489. },
  490. url: url_path +"/admin/salesOrder/get_product",
  491. async:false,
  492. success: function(data){
  493. var html = "";
  494. if (data.returnCode == 200 && data.returnMsg.productColorList.length > 0 ) {
  495. //所选店铺是否自营 1:自营 2:非自营
  496. dealerSelfOperated = data.returnMsg.dealerSelfOperated;
  497. for(var i=0;i<data.returnMsg.productColorList.length;i++){
  498. var productColor = data.returnMsg.productColorList[i];
  499. var discount = accDiv(productColor.colorDiscount,100);
  500. html += '<tr class="text-c">' +
  501. '<input type="hidden" class="color_id" id="" value="'+ productColor.colorId +'" >' +
  502. ' <td>'+ cufte(productColor.productName) +'</td>' +
  503. ' <td>'+ cufte(productColor.colorName) +'</td>' +
  504. ' <td>'+ cufte(productColor.colorBar) +'</td>' +
  505. ' <td style="width: 30px;"><input type="text" class="input-text input-number item-num" style="text-align: center" value="1" name="" id="" placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>' +
  506. ' <td><a href="javascript:void(0)" class="del_product all_down" onclick="delProduct($(this))" >删除</a></td>' +
  507. ' </tr>';
  508. }
  509. }else{
  510. $("#product_color_error").html(data.resultMsg);
  511. return false;
  512. }
  513. $("#add_product").append(html);
  514. }
  515. });
  516. }
  517. layer.close(index);
  518. }
  519. /**
  520. * 删除商品
  521. */
  522. function delProduct($this){
  523. $this.parents("tr").remove();
  524. calculatePrice();
  525. }
  526. $("input[name='productIsCombination']").change(function (){
  527. var combination = parseInt($("input[name='productIsCombination']:checked").val());
  528. if(combination === 1){
  529. $("#product_color").hide();
  530. }
  531. if(combination === 2){
  532. $("#product_color").show();
  533. }
  534. })