require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/goods/specs"],{1195:function(t,e,i){},"46da":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("f076");n(i("3240"));var c=n(i("5029"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(c.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},5029:function(t,e,i){"use strict";i.r(e);var n=i("9653"),c=i("dd7e");for(var s in c)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return c[t]}))}(s);i("739f");var r=i("828b"),o=Object(r["a"])(c["default"],n["b"],n["c"],!1,null,"59fbc3a4",null,!1,n["a"],void 0);e["default"]=o.exports},"739f":function(t,e,i){"use strict";var n=i("1195"),c=i.n(n);c.a},"8e4f":function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var c=n(i("7ca3")),s=i("6af6");function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function o(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){(0,c.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var a={components:{editPrice:function(){i.e("pages/admin/goods/components/editPrice/index").then(function(){return resolve(i("7b31"))}.bind(null,i)).catch(i.oe)}},data:function(){return{attrsList:[],id:0,administer:!1,isAllSelect:!1,visiblePrice:!1,goodsInfo:{id:0,spec_type:1,attr_value:{}}}},onShow:function(){},onLoad:function(t){this.checkKefuAuth("kefu-admin-product-edit")&&(this.id=t.id,this.getAttrsList())},methods:{getIds:function(){var t=[];return this.attrsList.forEach((function(e){e.checked&&t.push(e.id)})),t},batchEdit:function(){this.checkKefuAuth("kefu-admin-product-edit")&&(this.getIds().length?(this.goodsInfo.id=this.id,this.goodsInfo.attr_value={cost:"",price:"",ot_price:"",stock:""},this.visiblePrice=!0):this.$util.Tips({title:"请选择商品规格"}))},define:function(){var e=this;if(this.checkKefuAuth("kefu-admin-product-edit")){var i={attr_value:[]};this.attrsList.forEach((function(t){i.attr_value.push({cost:t.cost,price:t.price,ot_price:t.ot_price,stock:t.stock,unique:t.unique})})),(0,s.postUpdateAttrs)(this.id,i).then((function(i){e.$util.Tips({title:i.msg},(function(){t.navigateTo({url:"/pages/admin/goods/index"})}))})).catch((function(t){e.$util.Tips({title:t})}))}},getAttrsList:function(){var t=this;this.checkKefuAuth("kefu-admin-product-edit")&&(0,s.getGetAttrs)(this.id).then((function(e){var i=e.data;i.forEach((function(t){t.checked=!1})),t.attrsList=i})).catch((function(e){t.$util.Tips({title:e})}))},checkboxChange:function(t){var e=t.detail.value;this.attrsList.forEach((function(t){-1!==e.indexOf(t.id+"")?t.checked=!0:t.checked=!1})),e.length==this.attrsList.length?this.isAllSelect=!0:this.isAllSelect=!1},forGoods:function(t){this.attrsList.length&&this.attrsList.forEach((function(e){e.checked=!!t}))},checkboxAllChange:function(t){var e=t.detail.value;e.length?(this.isAllSelect=!0,this.forGoods(1)):(this.isAllSelect=!1,this.forGoods(0))},manageTap:function(){(this.administer||this.checkKefuAuth("kefu-admin-product-edit"))&&(this.administer=!this.administer)},priceCloseDrawer:function(){this.visiblePrice=!1},successChange:function(t){this.visiblePrice=!1;var e=t;this.attrsList.forEach((function(t){t.checked&&(e.cost&&(t.cost=e.cost),e.price&&(t.price=e.price),e.ot_price&&(t.ot_price=e.ot_price),e.stock&&(t.stock=e.stock))})),this.manageTap(),this.attrsList=this.attrsList.map((function(t){return o(o({},t),{},{checked:!1})}))}}};e.default=a}).call(this,i("df3c")["default"])},9653:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return c})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement;this._self._c},c=[]},dd7e:function(t,e,i){"use strict";i.r(e);var n=i("8e4f"),c=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=c.a}},[["46da","common/runtime","common/vendor"]]]);