(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["admin/goodsManage/add"],{1743:function(t,e,n){},7665:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("7736"),i=n("01ea"),r=n("d084");function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u=function(){n.e("components/plugin/list-cell").then(function(){return resolve(n("1861"))}.bind(null,n)).catch(n.oe)},f=function(){Promise.all([n.e("common/vendor"),n.e("components/app-uploader")]).then(function(){return resolve(n("f4e1"))}.bind(null,n)).catch(n.oe)},d=n("90f4"),l={name:"goods-add",components:{TuiListCell:u,AppUploader:f},data:function(){return{status:1,form:{goodsName:"",stock:"",price:"",categoryIdList:[],autoRise:"1",needSend:"0",freightType:"0",shopImg:[],briefContent:""}}},computed:c({},(0,o.mapGetters)({categoryData:"getCategory"})),onLoad:function(){},watch:{categoryData:function(t){},"form.categoryIdList":function(t){}},methods:{init:function(){var e=this;(0,i.getCategory)().then((function(){e.option.id&&(t.setNavigationBarTitle({title:"修改商品"}),e._getDet())}))},_getDet:function(){var t=this;return(0,r.getDetailB)({id:this.option.id}).then((function(e){t.$util.isEmpty(e.data)||(Object.keys(t.form).forEach((function(n,o){t.form[n]=e.data[n]})),-1==t.form.stock&&t.$set(t.form,"stock",""),t.$set(t.form,"sold",e.data.sold),t.$set(t.form,"shopImg",e.data.imgList))}))},confirmFn:function(){var e=this;if(0==this.form.categoryIdList)return this.$msg("请选择分类"),!1;if(0==this.form.shopImg.length)return this.$msg("请上传图片"),!1;var n=this.option.id?r.updateB:r.addB,o=JSON.parse(JSON.stringify(this.form));o.shopImg=this.$util.imgSubstr(o.shopImg),""==o.stock&&(o.stock=-1),this.option.id&&(o.id=this.option.id),n(c({status:this.status},o)).then((function(n){t.navigateBack({}),e.$msg("操作成功！")}))},selCategoryFn:function(t){var e=this.form.categoryIdList.findIndex((function(e){return e==t.id}));-1==e?this.form.categoryIdList.push(t.id):this.form.categoryIdList.splice(e,1)},autoRiseChange:function(t){this.form.autoRise="0"==t?"1":"0"},needSendChange:function(t){this.form.needSend="0"==t?"1":"0"},freightChange:function(t){this.form.freightType=t.detail.value},formSubmit:function(t){var e=this,n=[{name:"goodsName",rule:["required"],msg:["请输入商品名"]},{name:"price",rule:["required"],msg:["请输入价格"]}],o=t.detail.value,i=d.validation(o,n);i?this.$msg(i):setTimeout((function(){e.confirmFn()}))}}};e.default=l}).call(this,n("f3be")["default"])},bf54:function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement,n=(t._self._c,t.__map(t.categoryData,(function(e,n){var o=t.__get_orig(e),i=t.form.categoryIdList.includes(e.id+""),r=t.form.categoryIdList.includes(1*e.id);return{$orig:o,g0:i,g1:r}})));t._isMounted||(t.e0=function(e){t.status=0},t.e1=function(e){t.status=1}),t.$mp.data=Object.assign({},{$root:{l0:n}})},r=[]},f050:function(t,e,n){"use strict";(function(t){n("6cdc");o(n("4a15"));var e=o(n("fcd3"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("f3be")["createPage"])},f749:function(t,e,n){"use strict";n.r(e);var o=n("7665"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},f970:function(t,e,n){"use strict";var o=n("1743"),i=n.n(o);i.a},fcd3:function(t,e,n){"use strict";n.r(e);var o=n("bf54"),i=n("f749");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("f970");var a,c=n("0095"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,"2e282091",null,!1,o["a"],a);e["default"]=s.exports}},[["f050","common/runtime","common/vendor"]]]);