(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/goods/specs"],{"24d5":function(t,i,e){"use strict";e.r(i);var c=e("3b9d"),r=e("df91");for(var n in r)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return r[t]}))}(n);e("9330");var s=e("828b"),a=Object(s["a"])(r["default"],c["b"],c["c"],!1,null,"2b4f27a7",null,!1,c["a"],void 0);i["default"]=a.exports},"3b9d":function(t,i,e){"use strict";e.d(i,"b",(function(){return c})),e.d(i,"c",(function(){return r})),e.d(i,"a",(function(){}));var c=function(){var t=this.$createElement;this._self._c},r=[]},"3bb5":function(t,i,e){"use strict";(function(t,i){var c=e("47a9");e("1d3c");c(e("3240"));var r=c(e("24d5"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(r.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},"7d3f":function(t,i,e){},9330:function(t,i,e){"use strict";var c=e("7d3f"),r=e.n(c);r.a},df91:function(t,i,e){"use strict";e.r(i);var c=e("f53d"),r=e.n(c);for(var n in c)["default"].indexOf(n)<0&&function(t){e.d(i,t,(function(){return c[t]}))}(n);i["default"]=r.a},f53d:function(t,i,e){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var c=e("bfd8"),r={components:{editPrice:function(){e.e("pages/admin/goods/components/editPrice/index").then(function(){return resolve(e("92e4"))}.bind(null,e)).catch(e.oe)}},data:function(){return{attrsList:[],id:0,administer:!1,isAllSelect:!1,visiblePrice:!1,goodsInfo:{id:0,spec_type:1,attr_value:{}},cateId:"",isPaidMember:!1}},onShow:function(){},onLoad:function(t){this.id=t.id,this.getAttrsList()},methods:{handleInput:function(t){Number(t.vipPrice)>Number(t.price)&&(t.vipPrice=t.price-.01),Number(t.vipPrice)<=0&&(t.vipPrice=.01)},decimalNum:function(t,i){var e="";e=t.detail.value.toString(),e=e.match(/^\d*(.?\d{0,2})/g)[0]||null,this.$set(i,"price",e)},getIds:function(){var t=[];return this.attrsList.forEach((function(i){i.checked&&t.push(i.id)})),t},batchEdit:function(){this.getIds().length?(this.goodsInfo.id=this.id,this.goodsInfo.attr_value={cost:"",price:"",otPrice:"",stock:"",vipPrice:""},this.visiblePrice=!0):this.$util.Tips({title:"请选择商品规格"})},define:function(){var i=this,e={attr_value:[]};this.attrsList.forEach((function(t){e.attr_value.push({id:t.id,price:t.price,stock:t.stock,cost:t.cost,otPrice:t.otPrice,vipPrice:t.vipPrice})}));var r={attrValue:e.attr_value,cateId:this.cateId,id:this.id};(0,c.reviewFreeEdit)(r).then((function(e){200==e.code&&(i.$util.Tips({title:"操作成功"}),setTimeout((function(){t.navigateBack()}),300))}))},getAttrsList:function(){var t=this;(0,c.employeeProductInfo)(this.id).then((function(i){var e=i.data.attrValueList;t.isPaidMember=i.data.isPaidMember,t.cateId=i.data.cateId,e.forEach((function(t){t.checked=!1;var i="",e=JSON.parse(t.attrValue);for(var c in e)i+="".concat(e[c],",");i=i.slice(0,i.length-1),t.attrValue=i})),t.attrsList=e})).catch((function(i){t.$util.Tips({title:i})}))},checkboxChange:function(t){var i=t.detail.value;this.attrsList.forEach((function(t){-1!==i.indexOf(t.id+"")?t.checked=!0:t.checked=!1})),i.length==this.attrsList.length?this.isAllSelect=!0:this.isAllSelect=!1},forGoods:function(t){this.attrsList.length&&this.attrsList.forEach((function(i){i.checked=!!t}))},checkboxAllChange:function(t){var i=t.detail.value;i.length?(this.isAllSelect=!0,this.forGoods(1)):(this.isAllSelect=!1,this.forGoods(0))},manageTap:function(){this.administer=!this.administer},priceCloseDrawer:function(){this.visiblePrice=!1},successChange:function(t){this.visiblePrice=!1;var i=t;this.attrsList.forEach((function(t){t.checked&&(i.cost&&(t.cost=i.cost),i.price&&(t.price=i.price),i.otPrice&&(t.otPrice=i.otPrice),i.stock&&(t.stock=i.stock),i.vipPrice&&Number(i.vipPrice)<Number(t.price)&&(t.vipPrice=i.vipPrice),i.vipPrice&&Number(i.vipPrice)>Number(t.price)&&(t.vipPrice=t.price-.01),i.vipPrice&&Number(i.vipPrice)<=0&&(t.vipPrice=.01),i.price&&Number(i.price)<Number(t.vipPrice)&&(t.vipPrice=i.price-.01))})),this.manageTap()}}};i.default=r}).call(this,e("df3c")["default"])}},[["3bb5","common/runtime","common/vendor"]]]);