(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6e1b1ddd"],{"1ae8":function(t,e,s){},"3f33":function(t,e,s){"use strict";s.d(e,"a",(function(){return a})),s.d(e,"b",(function(){return r})),s.d(e,"g",(function(){return l})),s.d(e,"c",(function(){return o})),s.d(e,"h",(function(){return n})),s.d(e,"f",(function(){return d})),s.d(e,"e",(function(){return p})),s.d(e,"d",(function(){return c}));var i=s("6b2d");const a=t=>i.a.post("/pointsshop.points_goods/add",t),r=t=>i.a.get("/pointsshop.points_goods/detail",{params:t}),l=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),d=t=>i.a.get("/pointsshop.order/list",{params:t}),p=t=>i.a.get("/pointsshop.order/detail",{params:t}),c=t=>i.a.post("/pointsshop.order/delivery",t)},c740:function(t,e,s){"use strict";s("1ae8")},c775e: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"}]}}),methods:{onUpdate(t){this.$refs[t].validate(t=>{if(!t)return!1;this.detail.image?this.detail.points_price<1?this.$message.error("所需积分不能小于1"):this.updateGood():this.$message.error("请先上传图片")})},updateGood(){Object(i.g)(this.detail).then(t=>{this.$message.success(t.msg),1==t.code&&this.$router.push({path:"/scoreshop/goods/lists"})})},getDetail(){Object(i.b)({id:this.$route.query.id}).then(t=>{1!=t.code?this.$message.success(t.msg):this.detail=t.data})}},mounted(){this.getDetail()}},r=(s("c740"),s("2877")),l=Object(r.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"},[s("el-page-header",{attrs:{content:"add"==t.mode?"添加商品":"编辑商品"},on:{back:function(e){return t.$router.go(-1)}}})],1),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.onUpdate("form")}}},[t._v("保存")])],1)])])}),[],!1,null,"37ee2ac5",null);e.default=l.exports}}]);