2026-03-23 14:57:47 +08:00

1 line
4.0 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/goods/specs"],{"0d9e":function(t,e,i){"use strict";i.r(e);var n=i("2f27"),c=i("6fdf");for(var r in c)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return c[t]}))}(r);i("bcfc");var s=i("828b"),o=Object(s["a"])(c["default"],n["b"],n["c"],!1,null,"24c8b160",null,!1,n["a"],void 0);e["default"]=o.exports},"2f27":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=[]},"4f48":function(t,e,i){"use strict";(function(t,e){var n=i("47a9");i("89bd");n(i("3240"));var c=n(i("0d9e"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(c.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},"6fdf":function(t,e,i){"use strict";i.r(e);var n=i("fed7"),c=i.n(n);for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);e["default"]=c.a},"74aa":function(t,e,i){},bcfc:function(t,e,i){"use strict";var n=i("74aa"),c=i.n(n);c.a},fed7: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")),r=i("df17");function s(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?s(Object(i),!0).forEach((function(e){(0,c.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(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("0754"))}.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.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.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,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,r.postUpdateAttrs)(this.id,i).then((function(i){e.$util.Tips({title:i.msg},(function(){t.redirectTo({url:"/pages/admin/goods/index"})}))})).catch((function(t){e.$util.Tips({title:t})}))},getAttrsList:function(){var t=this;(0,r.getManageProductAttr)(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.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"])}},[["4f48","common/runtime","common/vendor"]]]);