(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-9fd91a62"],{"3f33":function(t,e,s){"use strict";s.d(e,"a",(function(){return a})),s.d(e,"b",(function(){return l})),s.d(e,"g",(function(){return r})),s.d(e,"c",(function(){return o})),s.d(e,"h",(function(){return n})),s.d(e,"f",(function(){return p})),s.d(e,"e",(function(){return d})),s.d(e,"d",(function(){return u}));var i=s("6b2d");const a=t=>i.a.post("/pointsshop.points_goods/add",t),l=t=>i.a.get("/pointsshop.points_goods/detail",{params:t}),r=t=>i.a.post("/pointsshop.points_goods/update",t),o=t=>i.a.get("/pointsshop.points_goods/list",{params:t}),n=t=>i.a.post("/pointsshop.points_goods/status",t),p=t=>i.a.get("/pointsshop.order/list",{params:t}),d=t=>i.a.get("/pointsshop.order/detail",{params:t}),u=t=>i.a.post("/pointsshop.order/delivery",t)},e1b0:function(t,e,s){"use strict";s.r(e);var i=s("3f33"),a={components:{MaterialSelect:s("b3ad").a},data:()=>({mode:"",detail:{name:"",image:"",description:"",points_price:0,stock:0,limit_per_user:0,status:0},rules:{name:[{required:!0,message:"请输入商品名称",trigger:"blur"}],points_price:[{required:!0,message:"请输入所需积分",trigger:"blur"},{type:"number",message:"积分必须为数字值",trigger:"blur"}]},table:{currentPage:1,pageSizes:[10],total:0,data:null},imgHost:""}),methods:{onSubmit(t){this.$refs[t].validate(t=>{if(!t)return!1;this.detail.image?this.detail.points_price<1?this.$message.error("所需积分不能小于1"):this.addGood():this.$message.error("请先上传图片")})},addGood(){Object(i.a)(this.detail).then(t=>{this.$message.success(t.msg),1==t.code&&this.$router.push({path:"/scoreshop/goods/lists"})})}},mounted(){}},l=(s("e6ff"),s("2877")),r=Object(l.a)(a,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"substance_edit-help"},[s("div",{staticClass:"ls-card m-t-16 form-container"},[s("div",{staticClass:"form-left"},[s("el-form",{ref:"form",attrs:{rules:t.rules,model:t.detail,"label-width":"120px",size:"small"}},[s("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[s("el-input",{staticClass:"ls-input",attrs:{"show-word-limit":"",placeholder:"请输入商品名称"},model:{value:t.detail.name,callback:function(e){t.$set(t.detail,"name",e)},expression:"detail.name"}})],1),s("el-form-item",{attrs:{label:"商品图片",prop:"image"}},[s("material-select",{attrs:{limit:1},model:{value:t.detail.image,callback:function(e){t.$set(t.detail,"image",e)},expression:"detail.image"}})],1),s("el-form-item",{attrs:{label:"商品描述",prop:"description"}},[s("el-input",{attrs:{type:"textarea",rows:5,placeholder:"请输入商品描述内容"},model:{value:t.detail.description,callback:function(e){t.$set(t.detail,"description",e)},expression:"detail.description"}})],1),s("el-form-item",{attrs:{label:"所需积分",prop:"points_price"}},[s("el-input",{staticClass:"ls-input",attrs:{type:"number",placeholder:"请设置所需积分"},model:{value:t.detail.points_price,callback:function(e){t.$set(t.detail,"points_price",t._n(e))},expression:"detail.points_price"}})],1),s("el-form-item",{attrs:{label:"库存数量",prop:"stock"}},[s("el-input-number",{attrs:{min:1,label:"描述文字"},model:{value:t.detail.stock,callback:function(e){t.$set(t.detail,"stock",e)},expression:"detail.stock"}})],1),s("el-form-item",{attrs:{label:"每人限购数量",prop:"limit_per_user"}},[s("el-input-number",{attrs:{min:1,label:"描述文字"},model:{value:t.detail.limit_per_user,callback:function(e){t.$set(t.detail,"limit_per_user",e)},expression:"detail.limit_per_user"}})],1),s("el-form-item",{attrs:{label:"状态",prop:"status"}},[s("el-radio",{attrs:{label:1},model:{value:t.detail.status,callback:function(e){t.$set(t.detail,"status",e)},expression:"detail.status"}},[t._v("上架")]),s("el-radio",{attrs:{label:0},model:{value:t.detail.status,callback:function(e){t.$set(t.detail,"status",e)},expression:"detail.status"}},[t._v("下架")])],1)],1)],1)]),s("div",{staticClass:"bg-white ls-fixed-footer"},[s("div",{staticClass:"row-center flex",staticStyle:{height:"100%"}},[s("el-button",{attrs:{size:"small"},on:{click:function(e){return t.$router.go(-1)}}},[t._v("取消")]),s("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.onSubmit("form")}}},[t._v("保存")])],1)])])}),[],!1,null,"2b97cf38",null);e.default=r.exports},e4b6:function(t,e,s){},e6ff:function(t,e,s){"use strict";s("e4b6")}}]);