"use strict";(self["webpackChunkvoghion_vue_admin"]=self["webpackChunkvoghion_vue_admin"]||[]).push([[35456],{35456:function(t,e,o){o.r(e),o.d(e,{default:function(){return g}});o(81454);var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"g-pa-md goodsEditContainer",staticStyle:{background:"white"}},[e("h3",[t._v("基本信息")]),e("el-form",{ref:"form",attrs:{model:t.form,"label-width":"100px","label-position":"right"}},[e("el-form-item",{attrs:{label:"商品名称"}},[e("span",[t._v(t._s(t.form.name))])]),e("el-form-item",{attrs:{label:"属性图片"}},t._l(t.form.bidGoodsPropertyVOS,(function(o,i){return e("div",{key:i,staticClass:"g-mt-md g-flex g-flex-center goodsdetail-property-value-container-item"},[e("div",[t._v(t._s(o.propertyValue))]),o.imgUrl&&o.imgUrl.length>0?e("div",{staticClass:"g-ml-md",staticStyle:{position:"relative"}},[e("el-image",{staticStyle:{width:"50px",height:"50px"},attrs:{src:o.imgUrl,"preview-src-list":[o.imgUrl]}})],1):e("div")])})),0),e("el-form-item",{attrs:{label:"SKU图片"}},[e("el-row",{staticStyle:{"background-color":"rgba(228, 229, 231, 1)"},attrs:{gutter:12}},[e("el-col",{attrs:{span:3}},[t._v("sku")]),e("el-col",{attrs:{span:2}},[t._v("配图")])],1),t._l(t.form.bidGoodsItemVO,(function(o,i){return e("div",{key:i,staticStyle:{"border-bottom":"1px solid rgba(228, 229, 231, 1)"}},[e("el-row",{attrs:{type:"flex",gutter:12,align:"middle"}},[e("el-col",{attrs:{span:3}},[t._v(t._s(o.name))]),e("el-col",[o.imageUrl&&""!==o.imageUrl?e("div",[e("img",{staticStyle:{width:"100px",height:"100px"},attrs:{src:o.imageUrl,alt:""}})]):t._e()])],1)],1)}))],2),e("el-form-item",{attrs:{label:"商品主图"}},t._l(t.form.bidGoodsImageVOS,(function(o,i){return e("el-image",{key:i,staticStyle:{width:"148px",height:"148px"},attrs:{src:o.url,"preview-src-list":t.form.bidGoodsImageVOS.map((t=>t.url))}})})),1),e("h3",[t._v("商品详情说明")]),e("el-form-item",{attrs:{label:"详情文字"}},[e("el-input",{staticStyle:{width:"50%"},attrs:{type:"textarea",rows:"3"},model:{value:t.form.description,callback:function(e){t.$set(t.form,"description",e)},expression:"form.description"}})],1),e("el-form-item",{attrs:{label:"详情图片"}},t._l(t.form.bidGoodsDetailImageVOS,(function(o,i){return e("el-image",{key:i,staticStyle:{width:"148px",height:"148px"},attrs:{src:o.url,"preview-src-list":t.form.bidGoodsDetailImageVOS.map((t=>t.url))}})})),1)],1)],1)},a=[],r=o(7896),s={components:{},data(){return{upLoadFileUrl:r.Lo,form:{packageSize:{},description:""},goodsImages:[],detailsImgs:[]}},computed:{},mounted(){this.fetchDataSource()},methods:{isEditPage(){return this.$route.params&&this.$route.params.id},async fetchDataSource(){this.$store.dispatch({type:"goods/getBidGoodsDetail",payload:{templateId:this.$route.params.id}}).then((t=>{t&&(this.form=t,this.goodsImages=t.bidGoodsImageVOS?t.bidGoodsImageVOS.map(((t,e)=>({uid:e,url:t.url}))):[],this.detailsImgs=t.bidGoodsDetailImageVOS?t.bidGoodsDetailImageVOS.map(((t,e)=>({uid:e,url:t.url}))):[])}))},deletePropertyValueImg(t){t.imgUrl=""},handlePropertyValueFileChange(t,e,o){console.log(t,e,o);const{files:i}=t.target;(0,r.Fx)(i[0]).then((t=>{this.$set(e,"imgUrl",t.data)}))},updateGoodsHandle(){this.$store.dispatch({type:"goods/editBidGoods",payload:{...this.form,bidGoodsDetailImageVOS:this.form.bidGoodsDetailImageVOS.map((t=>({...t,goodsId:this.form.goodsId}))),bidGoodsImageVOS:this.form.bidGoodsImageVOS.map((t=>({...t,goodsId:this.form.goodsId})))}}).then((t=>{t&&this.$router.go(-1)}))},deleteSkuImg(t){t.imageUrl=""},handleSkuFileChange(t,e){console.log(t);const{files:o}=t.target;(0,r.Fx)(o[0]).then((t=>{this.$set(e,"imageUrl",t.data)}))},goBackOnClick(){this.$router.go(-1)}}},l=s,d=o(81656),m=(0,d.A)(l,i,a,!1,null,null,null),g=m.exports}}]);