(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-63969e2d"],{"34ec":function(t,e,i){"use strict";i("570a")},"3ca6":function(t,e,i){},"4d66":function(t,e,i){"use strict";i("d243")},"4f85":function(t,e,i){"use strict";var o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("el-tag",{staticClass:"product-tag",staticStyle:{color:"black"},attrs:{color:t.isSelectNew?"gray":"white"},on:{click:t.newLabelClick}},[t._v("New")]),t._l(t.labels,(function(e,o){return i("el-tag",{key:e.name+o,staticClass:"product-tag",style:{color:"black"},attrs:{color:e.checked?"gray":"white"},on:{click:function(e){return t.onLabelClick(o)}}},[t._v(t._s(e.name))])}))],2)},r=[],s=i("6d68"),n={name:"ProductTagsSelector",data(){return{labels:[],isSelectNew:!1}},mounted(){this.getLabels()},methods:{async getLabels(){const t=await Object(s["b"])();if(this.labels=t.data.records,this.labels&&this.labels.length)for(const e of this.labels)e.checked=!1},onLabelClick(t){var e=Object.assign({},this.labels[t]);e.checked=!e.checked,this.$set(this.labels,t,e),this.emitChange()},newLabelClick(){this.isSelectNew=!this.isSelectNew,this.emitChange()},emitChange(){var t={};if(t.isSelectNew=this.isSelectNew,t.labelIds=[],this.labels&&this.labels.length)for(const e of this.labels)e.checked&&t.labelIds.push(e.id);this.$emit("change",t)}}},a=n,l=(i("34ec"),i("2877")),c=Object(l["a"])(a,o,r,!1,null,"3672090d",null);e["a"]=c.exports},"570a":function(t,e,i){},"5ec2":function(t,e,i){"use strict";i("3ca6")},"6d68":function(t,e,i){"use strict";i.d(e,"c",(function(){return r})),i.d(e,"d",(function(){return s})),i.d(e,"a",(function(){return n})),i.d(e,"b",(function(){return a}));var o=i("66a5");const r=t=>Object(o["a"])({url:"/shopapi/blankProduct/page",method:"post",data:t}),s=t=>Object(o["a"])({url:"/shopapi/blankProduct/type/list",method:"post",data:t}),n=t=>Object(o["a"])({url:"/shopapi/blankProduct/detail",method:"post",data:t}),a=t=>Object(o["a"])({url:"/shopapi/blankProduct/label/list",method:"post",data:t})},7848:function(t,e,i){"use strict";i("b763")},"8f03":function(t,e,i){"use strict";var o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"product-list"},[t.title?i("div",{staticClass:"product-top"},[i("div",{staticClass:"product-title"},[t._v(t._s(t.title))])]):t._e(),i("div",{staticClass:"product-bottom"},[t.productList.length?t._l(t.productList,(function(e){return i("div",{key:e.id,staticClass:"product-item-box"},[i("div",{staticClass:"product-item"},[i("r-link",{attrs:{to:"/product/"+e.handle}},[i("ProductImg",{staticClass:"product-item-img",attrs:{"main-img":e.mainShowImageUrl,"hover-img":e.suspendImageUrl}}),i("div",{staticClass:"product-tag-box"},[t._l(e.labels,(function(e,o){return i("el-tag",{key:e.name+o,staticClass:"product-tag",style:{color:e.fontColor,border:e.fontColor},attrs:{color:e.bgColor}},[t._v(t._s(e.name))])})),e.isNew?i("el-tag",{staticClass:"product-tag",staticStyle:{border:"#4D7FAD",color:"#4D7FAD"},attrs:{color:"#DDEDF8"}},[t._v("New")]):t._e(),Number(e.productDiscount)>0?i("el-tag",{staticClass:"product-tag",staticStyle:{border:"#EC3E3E",color:"#EC3E3E"},attrs:{color:"#FFE1E1"}},[t._v("-"+t._s(100*e.productDiscount)+"%")]):t._e()],2),i("div",{staticClass:"product-item-info"},[i("div",{staticClass:"product-item-title surplus-hidden"},[t._v(t._s(e.fullName))]),i("div",{staticClass:"product-item-style"},[t._v(t._s(e.optionInfo))]),i("div",{staticClass:"product-item-msg",domProps:{innerHTML:t._s(e.blankContent)}}),i("div",{staticClass:"product-item-price"},[i("span",{staticClass:"product-item-price-num"},[t._v("$"+t._s(e.favorablePrice||e.price))])])])],1),i("div",{staticClass:"product-item-button"},[i("r-link",{staticStyle:{flex:"1"},attrs:{to:"/product/"+e.handle}},[i("el-button",{staticClass:"button-item"},[t._v("Get Sample")])],1),2!==t.currentShop.shopType?i("el-button",{staticClass:"button-item",staticStyle:{"margin-left":"5px"},attrs:{type:e.dropshiped?"":"primary",loading:e.dropshipedLoading},on:{click:function(i){i.stopPropagation(),e.dropshiped?t.dropshiperCancel(e):t.callNewPage("/Dropshinpper/"+e.id)}},nativeOn:{mouseenter:function(i){return t.showCancelFn(e,!0)},mouseleave:function(i){return t.showCancelFn(e,!1)}}},[e.dropshiped?i("span",[t._v(" "+t._s(e.showCancel?"Cancel":"Dropshiped ("+e.dropShipSkuNum+" sku)")+" ")]):i("span",[t._v("Dropship it ("+t._s(e.skuNum)+" sku)")])]):t._e()],1)],1)])})):[i("el-empty",{staticStyle:{margin:"0 auto"},attrs:{description:"No products"}})]],2)])},r=[],s=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("my-img",{staticStyle:{width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},attrs:{"image-style":{width:"100%",height:"100%"},width:746,height:746,src:t.imgSrc,onerror:"this.src='"+i("e803")+"'"},on:{mouseenter:function(e){t.isHover=!0},mouseleave:function(e){t.isHover=!1}}})],1)},n=[],a={name:"ProductImg",props:{mainImg:{type:String,default:null},hoverImg:{type:String,default:null}},data(){return{isHover:!1}},computed:{imgSrc(){return this.isHover?this.hoverImg:this.mainImg}}},l=a,c=i("2877"),d=Object(c["a"])(l,s,n,!1,null,"7b926177",null),u=d.exports,p=i("2f69"),h=i("2f62"),f={name:"ProductList",components:{ProductImg:u},props:{title:{type:String,default:""},list:{type:Array,default:()=>[]}},data(){return{productList:[]}},computed:{...Object(h["b"])("user",{currentShop:"getCurrentShop"})},watch:{list:{handler(t){this.productList=t.map(t=>(t.isHover=!1,t.labels=t.labels||[],t))},immediate:!0,deep:!0}},methods:{showCancelFn(t,e){this.$set(t,"showCancel",e)},async dropshiperCancel(t){this.$set(t,"dropshipedLoading",!0),await Object(p["a"])(t.id),t.dropshiped=!1,this.$set(t,"dropshipedLoading",!1),this.$message.success("Cancel success")}}},m=f,b=(i("5ec2"),Object(c["a"])(m,o,r,!1,null,"0833fca8",null));e["a"]=b.exports},"8f8f":function(t,e,i){"use strict";var o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.show?i("div",{ref:"bathcDistributionDialog",staticClass:"batch-distribution-dialog",attrs:{id:"batch-distribution-dialog"}},[i("el-card",{staticClass:"batch-distribution-dialog-card",attrs:{id:"batch-distribution-dialog-card",shadow:"always"}},[i("div",{staticClass:"batch-distribution-dialog-card-title",attrs:{id:"batch-distribution-dialog-title"}},[t._v("Bulk distribution")]),i("i",{staticClass:"el-icon-close close cursor-pointer",on:{click:function(e){return e.target!==e.currentTarget?null:t.hiddenDialog.apply(null,arguments)}}}),i("el-divider"),i("div",{directives:[{name:"show",rawName:"v-show",value:1===t.showComponent,expression:"showComponent === 1"}],staticClass:"batch-distribution-page"},[i("div",[t.loadBlankProductData?i("product-tags-selector",{on:{change:t.onSelectLabelChange}}):t._e(),i("el-row",{staticClass:"btn-row"},[i("el-button",{attrs:{disabled:!t.selectProducts.length},on:{click:t.toEditProfit}},[t._v("Edit profit")]),i("el-button",{attrs:{disabled:!t.selectProducts.length},on:{click:t.toEditComparePrice}},[t._v("Edit compare price")])],1),i("el-row",{staticClass:"table-title",attrs:{gutter:5}},[i("el-col",{attrs:{span:9}},[i("el-checkbox",{staticClass:"check",attrs:{size:"medium",indeterminate:t.selectAllIndeterminate},on:{change:t.onCheckAll}}),t.selectProducts.length?i("span",{staticClass:"check-text"},[t._v("Selected "+t._s(t.selectProducts.length))]):t._e(),i("span",[t._v("Undistributed product")])],1),i("el-col",{attrs:{span:8}},[i("span",[t._v("Profit margin")])]),i("el-col",{attrs:{span:3}},[i("span",[t._v("Profit")])]),i("el-col",{attrs:{span:4}},[i("span",[t._v("Compare price percentage")])])],1),t._l(t.productList,(function(e,o){return i("div",{key:e.id},[i("el-row",{staticClass:"product-item",attrs:{gutter:5}},[i("el-col",{attrs:{span:9}},[i("div",[i("el-checkbox",{staticClass:"check",on:{change:function(e){return t.onProductCheckChange(o)}},model:{value:t.productList[o].checked,callback:function(e){t.$set(t.productList[o],"checked",e)},expression:"productList[itemIndex].checked"}})],1),i("img",{staticClass:"product-item-image",attrs:{src:e.mainShowImageUrl||e.mainImageUrl}}),i("div",{staticClass:"product-item-name"},[i("div",{staticClass:"product-item-title"},[t._v(t._s(e.fullName||e.title))]),i("div",{staticClass:"product-item-title"},[t._v(t._s(e.minSkuPrice)+"-"+t._s(e.maxSkuPrice))]),i("div",{staticClass:"product-item-attr"},[t._v(t._s(e.optionInfo))])])]),i("el-col",{staticClass:"profile-margin",attrs:{span:8}},[i("el-row",[i("m-input-number",{staticClass:"input",attrs:{disabled:t.productList[o].custom,controls:!1,min:0,max:9999},model:{value:t.productList[o].bulkDistributionDefaultPriceRate,callback:function(e){t.$set(t.productList[o],"bulkDistributionDefaultPriceRate",t._n(e))},expression:"productList[itemIndex].bulkDistributionDefaultPriceRate"}},[i("span",{staticClass:"input-suffix",attrs:{slot:"suffix"},slot:"suffix"},[t._v("%")])]),i("span",{staticClass:"plus"},[t._v("+")]),i("m-input-number",{staticClass:"input",attrs:{disabled:t.productList[o].custom,controls:!1,min:0,max:9999},model:{value:t.productList[o].bulkDistributionDefaultPriceAdd,callback:function(e){t.$set(t.productList[o],"bulkDistributionDefaultPriceAdd",t._n(e))},expression:"productList[itemIndex].bulkDistributionDefaultPriceAdd"}},[i("span",{staticClass:"input-suffix",attrs:{slot:"suffix"},slot:"suffix"},[t._v("$")])])],1)],1),i("el-col",{staticClass:"profile",attrs:{span:3}},[i("span",[t._v(t._s(t._f("profileFilter")(t.productList[o])))])]),i("el-col",{staticClass:"compare-price-percentage",attrs:{span:4}},[i("el-row",[i("el-col",{attrs:{span:20}},[i("m-input-number",{attrs:{disabled:t.productList[o].custom,controls:!1,min:0,max:9999},model:{value:t.productList[o].bulkDistributionCompareAtPriceRate,callback:function(e){t.$set(t.productList[o],"bulkDistributionCompareAtPriceRate",e)},expression:"productList[itemIndex].bulkDistributionCompareAtPriceRate"}},[i("span",{attrs:{slot:"suffix"},slot:"suffix"},[t._v("%")])])],1),i("el-col",{attrs:{span:4}},[i("i",{staticClass:"el-icon-arrow-right more-btn",on:{click:function(e){return t.toEditMore(o)}}})])],1)],1),t.productList[o].custom?i("el-row",{staticStyle:{color:"red",float:"right"}},[t._v(" The value has been set in the distribution details ")]):t._e()],1)],1)})),t.productList.length?t._e():i("el-row",[i("el-empty")],1)],2),i("el-row",{staticClass:"bottom"},[i("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.continueLoading,expression:"continueLoading"}],staticClass:"continue-btn",attrs:{disabled:!t.selectProducts.length,type:"primary"},on:{click:t.toContinue}},[t._v("Continue")]),t.loadBlankProductData?i("el-pagination",{staticClass:"pagination",attrs:{"current-page":t.page.current,"page-size":t.page.size,layout:"total, prev, pager, next, jumper",total:t.page.total,background:"","hide-on-single-page":""},on:{"current-change":t.handleCurrentChange}}):t._e()],1)],1),i("dropship-detail",{directives:[{name:"show",rawName:"v-show",value:2===t.showComponent,expression:"showComponent === 2"}],ref:"dropshipDetail",on:{save:t.onDropshipDetailSave,back:t.onDropshipDetailBack}}),i("store-detail",{directives:[{name:"show",rawName:"v-show",value:3===t.showComponent,expression:"showComponent === 3"}],ref:"storeDetail",on:{save:t.onStoreDetailSave,back:t.onStoreDetailBack}})],1),i("el-dialog",{staticClass:"edit-profit-dialog",attrs:{visible:t.editProfitDialog.show,"close-on-click-modal":!1,"lock-scroll":!1,"append-to-body":"",title:"Edit profit"},on:{"update:visible":function(e){return t.$set(t.editProfitDialog,"show",e)}}},[i("el-form",[i("el-form-item",{staticClass:"profile-margin text-align-center"},[i("m-input-number",{staticClass:"input",attrs:{controls:!1,min:0,max:9999},model:{value:t.editProfitDialog.bulkDistributionDefaultPriceRate,callback:function(e){t.$set(t.editProfitDialog,"bulkDistributionDefaultPriceRate",t._n(e))},expression:"editProfitDialog.bulkDistributionDefaultPriceRate"}},[i("span",{staticClass:"input-suffix",attrs:{slot:"suffix"},slot:"suffix"},[t._v("%")])]),i("span",{staticClass:"plus"},[t._v("+")]),i("m-input-number",{staticClass:"input",attrs:{controls:!1,min:0,max:9999},model:{value:t.editProfitDialog.bulkDistributionDefaultPriceAdd,callback:function(e){t.$set(t.editProfitDialog,"bulkDistributionDefaultPriceAdd",t._n(e))},expression:"editProfitDialog.bulkDistributionDefaultPriceAdd"}},[i("span",{staticClass:"input-suffix",attrs:{slot:"suffix"},slot:"suffix"},[t._v("$")])])],1)],1),i("el-row",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.editProfitDialog.show=!1}}},[t._v("Close")]),i("el-button",{attrs:{type:"primary"},on:{click:t.doEditProfit}},[t._v("Edit")])],1)],1),i("el-dialog",{staticClass:"edit-compare-price-dialog",attrs:{visible:t.editComparePriceDialog.show,"close-on-click-modal":!1,"lock-scroll":!1,"append-to-body":"",title:"Edit compare price"},on:{"update:visible":function(e){return t.$set(t.editComparePriceDialog,"show",e)}}},[i("el-form",[i("el-form-item",{staticClass:"text-align-center"},[i("m-input-number",{attrs:{controls:!1,min:0,max:9999},model:{value:t.editComparePriceDialog.bulkDistributionCompareAtPriceRate,callback:function(e){t.$set(t.editComparePriceDialog,"bulkDistributionCompareAtPriceRate",e)},expression:"editComparePriceDialog.bulkDistributionCompareAtPriceRate"}},[i("span",{attrs:{slot:"suffix"},slot:"suffix"},[t._v("%")])])],1)],1),i("el-row",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(e){t.editComparePriceDialog.show=!1}}},[t._v("Close")]),i("el-button",{attrs:{type:"primary"},on:{click:t.doEditComparePrice}},[t._v("Edit")])],1)],1)],1):t._e()},r=[],s=i("6d68"),n=i("2f69"),a=i("4f85"),l=i("2f62"),c=i("f13c"),d=i.n(c),u=i("ed08"),p=i("b4c1"),h=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dropshinpper-detail"},[i("el-form",{ref:"dropshinpperForm",attrs:{model:t.dropshinpperForm,rules:t.dropshinpperRules,"label-width":"100px","label-position":"top"}},[i("div",{staticClass:"dropshinpper-title"},[t._v(t._s(t.detailInfo.customProductInfo.title))]),i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Mockups")]),i("Mockups",{attrs:{images:t.detailInfo.images},model:{value:t.dropshinpperForm.mainImageUrl,callback:function(e){t.$set(t.dropshinpperForm,"mainImageUrl",e)},expression:"dropshinpperForm.mainImageUrl"}})],1),i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Variants")]),i("Variants",{attrs:{"custom-product-info":t.detailInfo.customProductInfo,"variant-list":t.detailInfo.variantList},on:{change:t.changeVariants}})],1),i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Description")]),i("Description",{attrs:{"custom-product-info":t.detailInfo.customProductInfo},on:{change:t.changeDescription}})],1),i("div",{staticClass:"dropshinpper-button"},[i("el-button",{on:{click:t.toBack}},[t._v("Back")]),i("el-button",{attrs:{type:"primary"},on:{click:t.toSave}},[t._v("Save")])],1)])],1)},f=[],m=i("1635"),b=i("48c2"),g=i("cd9e"),v={name:"DropshipDetail",components:{Mockups:m["a"],Variants:b["a"],Description:g["a"]},data(){return{detailInfo:{customProductInfo:{tags:[]},images:[{url:""}],level1Fittings:[{id:""}],level2Fittings:[{id:""}],level1Fittingses:[],level2Fittingses:[],level3Fittings:[{id:""}],variantList:[{retailPrice:0,profit:0,profitMargin:0}]},dropshinpperForm:{blankProductId:0,mainImageUrl:"",title:"",description:"",isAddMertic:!0,tags:[],variantList:[],hiddenInStore:!1,blankFittingsLevel:1,collectionId:""},dropshinpperRules:{blankProductId:[{required:!0,message:"The BlankProductId field is required",trigger:"blur"}],mainImageUrl:[{required:!0,message:"The MainImageUrl field is required",trigger:"blur"}],title:[{required:!0,message:"The Title field is required",trigger:"blur"}],description:[{required:!0,message:"The Description field is required",trigger:"blur"}],variantList:[{required:!0,message:"The VariantList field is required",trigger:"blur"}]}}},methods:{init({detail:t,form:e}){this.detailInfo=t,this.dropshinpperForm=e},changeStore(t){this.dropshinpperForm=Object.assign(this.dropshinpperForm,t)},changeVariants(t){this.dropshinpperForm.variantList=t},changeDescription(t){this.dropshinpperForm=Object.assign(this.dropshinpperForm,t)},toBack(){this.$emit("back")},toSave(){this.$refs.dropshinpperForm.validate(t=>{t&&this.$emit("save",this.dropshinpperForm)})}}},D=v,k=(i("9b98"),i("2877")),C=Object(k["a"])(D,h,f,!1,null,"fb70e02e",null),P=C.exports,w=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dropshinpper-detail"},[i("el-form",{ref:"dropshinpperForm",attrs:{model:t.dropshinpperForm,rules:t.dropshinpperRules,"label-width":"100px","label-position":"top"}},[i("div",{staticClass:"dropshinpper-card"},[i("div",{staticClass:"dropshinpper-card-title"},[t._v("Store details")]),i("StoreDetails",{attrs:{"greeting-cards":t.greetingCards,"fittings-id":t.dropshinpperForm.fittingsId,"blank-fittings-level":t.dropshinpperForm.blankFittingsLevel,"collection-id":t.dropshinpperForm.collectionId,"hidden-in-store":t.dropshinpperForm.hiddenInStore,"blank-greeting-card-id":t.dropshinpperForm.blankGreetingCardId,"level-fittings":t.fittingses},on:{"update:fittingsId":function(e){return t.$set(t.dropshinpperForm,"fittingsId",e)},"update:fittings-id":function(e){return t.$set(t.dropshinpperForm,"fittingsId",e)},"update:blankFittingsLevel":function(e){return t.$set(t.dropshinpperForm,"blankFittingsLevel",e)},"update:blank-fittings-level":function(e){return t.$set(t.dropshinpperForm,"blankFittingsLevel",e)},"update:collectionId":function(e){return t.$set(t.dropshinpperForm,"collectionId",e)},"update:collection-id":function(e){return t.$set(t.dropshinpperForm,"collectionId",e)},"update:hiddenInStore":function(e){return t.$set(t.dropshinpperForm,"hiddenInStore",e)},"update:hidden-in-store":function(e){return t.$set(t.dropshinpperForm,"hiddenInStore",e)},"update:blankGreetingCardId":function(e){return t.$set(t.dropshinpperForm,"blankGreetingCardId",e)},"update:blank-greeting-card-id":function(e){return t.$set(t.dropshinpperForm,"blankGreetingCardId",e)}}})],1),i("div",{staticClass:"dropshinpper-button"},[i("el-button",{attrs:{disabled:t.doing},on:{click:t.toBack}},[t._v("Previous")]),i("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.doing,expression:"doing"}],attrs:{disabled:t.doing,type:"primary"},on:{click:t.toSave}},[t._v("Bulk distribution")])],1)])],1)},I=[],y=i("afad"),S=i("b0dc"),L=i("623f"),F={name:"StoreDetail",components:{StoreDetails:y["a"]},data(){return{fittingses:[],greetingCards:[],dropshinpperForm:{hiddenInStore:!1,blankFittingsLevel:1,collectionId:"",fittingsId:null,blankGreetingCardId:null},dropshinpperRules:{hiddenInStore:[{required:!0,message:"The HiddenInStore field is required",trigger:"blur"}],blankFittingsLevel:[{required:!0,message:"The BlankFittingsLevel field is required",trigger:"blur"}]},doing:!1}},mounted(){this.loadBlankFittings(),this.loadGreetingCards()},methods:{async loadGreetingCards(){var t=await Object(L["h"])({});this.greetingCards=t.data||[]},loadBlankFittings(){Object(S["a"])({fittingAll:!0}).then(t=>{if(200===t.code){var e=t.data.records||[];this.fittingses=e,this.fittingses&&this.fittingses.length&&(this.dropshinpperForm.fittingsId=this.fittingses[0].id)}})},toBack(){this.$emit("back")},toSave(){this.$refs.dropshinpperForm.validate(t=>{t&&(this.$emit("save",{blankFittingsLevel:this.dropshinpperForm.blankFittingsLevel,fittingsId:this.dropshinpperForm.fittingsId,collectionId:this.dropshinpperForm.collectionId,hiddenInStore:this.dropshinpperForm.hiddenInStore,blankGreetingCardId:this.dropshinpperForm.blankGreetingCardId}),this.doing=!0)})}}},_=F,x=(i("4d66"),Object(k["a"])(_,w,I,!1,null,"d988bffa",null)),A=x.exports,T={name:"BatchDistributionDialog",components:{ProductTagsSelector:a["a"],MInputNumber:p["a"],DropshipDetail:P,StoreDetail:A},filters:{profileFilter(t){if(null==t.bulkDistributionDefaultPriceRate||null==t.bulkDistributionDefaultPriceAdd){if(t.dropShippingForm){let e=-1/0,i=1/0;for(const o of t.dropShippingForm.variantList){const t=Number(o.retailPrice)-Number(o.costs);t>e&&(e=t),to&&(o=t.costs),t.costs{this.$emit("update:show",!1)},500)},handleCurrentChange(t){this.page.current=t,this.getProducts()},async getProducts(){if(!this.loadBlankProductData)return;this.productLoading=!0;var t={isDropshipped:!1};t.isNew=this.isSelectNew,t.labelIds=this.selectLabelIds,t.current=this.page.current,t.size=this.page.size;const e=await Object(s["c"])(t);this.productLoading=!1,this.page.total=e.data.total,this.productList=[];for(const i of e.data.records)i.checked=!1,i.bulkDistributionDefaultPriceRate=100*this.userInfo.bulkDistributionDefaultPriceRate,i.bulkDistributionDefaultPriceAdd=this.userInfo.bulkDistributionDefaultPriceAdd,i.bulkDistributionCompareAtPriceRate=100*this.userInfo.bulkDistributionCompareAtPriceRate,this.productList.push(i);this.scrollToTop()},scrollToTop(){d.a.scrollTo("#batch-distribution-dialog-title",500,{offset:-120,easing:"ease-in-out",container:"#batch-distribution-dialog-card"})},reloadProducts(){this.page.current=1,this.getProducts()},onSelectLabelChange({isSelectNew:t,labelIds:e}){this.isSelectNew=t,this.selectLabelIds=e,this.reloadProducts()},onCheckAll(t){if(t)for(const e of this.productList)e.checked=!0;else for(const e of this.productList)e.checked=!1;this.selectAllIndeterminate=!1,this.productList.splice()},onProductCheckChange(){this.productList.splice();let t=0;for(const e of this.productList)e.checked&&(t+=1);this.selectAll=t>0&&t===this.productList.length,this.selectAllIndeterminate=t>0&&t{const e=Number(t.retailPrice)-Number(t.costs),i=Number(t.profit)/Number(t.costs)*100;t.profit=e,t.profitMargin=i})),t},async toEditMore(t){var e=this.productList[t];await this.loadProductDetail(e),null!=e.bulkDistributionDefaultPriceRate&&null!=e.bulkDistributionDefaultPriceAdd&&e.dropShippingForm.variantList.forEach(t=>{const i=t.costs*e.bulkDistributionDefaultPriceRate/100+e.bulkDistributionDefaultPriceAdd,o=Number(t.profit)/Number(t.costs)*100;t.retailPrice=Object(u["d"])(t.costs+i),t.profit=i,t.profitMargin=o}),null!=e.bulkDistributionCompareAtPriceRate&&e.dropShippingForm.variantList.forEach(t=>{t.compareAtPrice=t.costs*e.bulkDistributionCompareAtPriceRate/100,t.compareAtPrice=Object(u["d"])(t.compareAtPrice)}),this.$refs.dropshipDetail.init({detail:e.dropShippingDetailInfo,form:e.dropShippingForm}),this.dropShippingDetailForm.productInfoIndex=t,this.dropShippingDetailForm.productInfo=e,this.showComponent=this.showComponentEnum.DROPSHIP_DETAIL,this.scrollToTop()},onDropshipDetailSave(t){console.log("on dropship detail save",t),this.productList[this.dropShippingDetailForm.productInfoIndex].dropShippingForm=t,this.productList[this.dropShippingDetailForm.productInfoIndex].custom=!0,this.productList[this.dropShippingDetailForm.productInfoIndex].bulkDistributionDefaultPriceRate=void 0,this.productList[this.dropShippingDetailForm.productInfoIndex].bulkDistributionDefaultPriceAdd=void 0,this.productList[this.dropShippingDetailForm.productInfoIndex].bulkDistributionCompareAtPriceRate=void 0,this.showComponent=this.showComponentEnum.MAIN,this.scrollToTop()},onDropshipDetailBack(){this.showComponent=this.showComponentEnum.MAIN,this.scrollToTop()},async toContinue(){this.showComponent=this.showComponentEnum.STORE_DETAIL},async onStoreDetailSave({blankFittingsLevel:t,collectionId:e,fittingsId:i,blankGreetingCardId:o,hiddenInStore:r}){var s={},a=[];s.records=a;for(const n of this.selectProducts){var l={};l.blankProductId=n.id,n.dropShippingForm&&(l.mainImageUrl=n.dropShippingForm.mainImageUrl,l.title=n.dropShippingForm.title,l.description=n.dropShippingForm.description,l.isAddMertic=n.dropShippingForm.isAddMertic,l.tags=n.dropShippingForm.tags,l.variantList=n.dropShippingForm.variantList),l.blankGreetingCardId=o,l.hiddenInStore=r,l.blankFittingsLevel=t,l.fittingsId=i,l.collectionId=e,l.bulkDistributionDefaultPriceRate=n.bulkDistributionDefaultPriceRate,l.bulkDistributionDefaultPriceRate&&(l.bulkDistributionDefaultPriceRate=Object(u["d"])(l.bulkDistributionDefaultPriceRate/100)),l.bulkDistributionDefaultPriceAdd=n.bulkDistributionDefaultPriceAdd,l.bulkDistributionCompareAtPriceRate=n.bulkDistributionCompareAtPriceRate,l.bulkDistributionCompareAtPriceRate&&(l.bulkDistributionCompareAtPriceRate=Object(u["d"])(l.bulkDistributionCompareAtPriceRate/100)),a.push(l)}var c=await Object(n["h"])(s);200===c.code?(c=await Object(n["m"])({customProductIds:c.data}),200===c.code?(this.$message.success("Bulk distribution success!"),this.hiddenDialog(),this.$emit("success"),this.callNewPage("/DropshinpperList")):this.$message.error(c.msg)):this.$message.error(c.msg)},onStoreDetailBack(){this.showComponent=this.showComponentEnum.MAIN,this.scrollToTop()},toEditProfit(){this.editProfitDialog.bulkDistributionDefaultPriceRate=void 0,this.editProfitDialog.bulkDistributionDefaultPriceAdd=void 0,this.editProfitDialog.show=!0},doEditProfit(){for(const t of this.selectProducts)t.custom||(t.bulkDistributionDefaultPriceRate=this.editProfitDialog.bulkDistributionDefaultPriceRate,t.bulkDistributionDefaultPriceAdd=this.editProfitDialog.bulkDistributionDefaultPriceAdd);this.editProfitDialog.show=!1},toEditComparePrice(){this.editComparePriceDialog.bulkDistributionCompareAtPriceRate=void 0,this.editComparePriceDialog.show=!0},doEditComparePrice(){for(const t of this.selectProducts)t.custom||(t.bulkDistributionCompareAtPriceRate=this.editComparePriceDialog.bulkDistributionCompareAtPriceRate);this.editComparePriceDialog.show=!1}}},O=T,$=(i("7848"),Object(k["a"])(O,o,r,!1,null,"8321f0da",null));e["a"]=$.exports},"9b98":function(t,e,i){"use strict";i("aaaa")},aaaa:function(t,e,i){},b0dc:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var o=i("66a5");const r=t=>Object(o["a"])({url:"/shopapi/blankFittings/list",method:"post",data:t})},b763:function(t,e,i){},c4a0:function(t,e,i){"use strict";i.r(e);var o=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"product-page"},[t.productTypeLoad?i("div",{staticClass:"product-type-list"},t._l(t.typeList,(function(e){return i("div",{key:e.id,staticClass:"product-type-item div-hover",on:{click:function(i){return t.selectType(e)}}},[i("my-img",{staticClass:"product-type-img",attrs:{src:e.fileUrl,alt:"product type img"}}),i("div",{class:["product-type-text",{decoration:t.currentType.id===e.id}]},[t._v(t._s(e.name))])],1)})),0):i("el-skeleton",[i("template",{slot:"template"},[i("div",{staticClass:"product-type-list"},t._l(5,(function(t){return i("div",{key:t,staticClass:"product-type-item div-hover"},[i("el-skeleton-item",{staticStyle:{width:"150px",height:"150px"},attrs:{variant:"image"}})],1)})),0)])],2),t.currentType.advertiseFileUrl?i("img",{staticClass:"product-banner",attrs:{src:t.currentType.advertiseFileUrl,alt:"banner"}}):i("el-skeleton",[i("template",{slot:"template"},[i("el-skeleton-item",{staticStyle:{width:"100%",height:"500px"},attrs:{variant:"image"}})],1)],2),i("div",{staticClass:"product-list-box",attrs:{id:"product-list-box"}},[i("el-row",{staticClass:"search-form",attrs:{type:"flex",justify:"space-between"}},[i("div",[i("el-input",{staticClass:"keyword-input",attrs:{placeholder:"Product name or product ID","max-length":"50"},on:{change:t.reloadProduct},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.reloadProduct.apply(null,arguments)}},model:{value:t.form.keyword,callback:function(e){t.$set(t.form,"keyword","string"===typeof e?e.trim():e)},expression:"form.keyword"}}),t.userInfo.login&&2!==t.currentShop.shopType?i("el-button",{staticClass:"bulk-distribution-button",attrs:{type:"primary"},on:{click:t.showBulkDistributionDialog}},[i("i",{staticClass:"el-icon-s-unfold"}),t._v("Bulk distribution")]):t._e()],1),i("el-select",{on:{change:t.reloadProduct},model:{value:t.form.isDropshipped,callback:function(e){t.$set(t.form,"isDropshipped",e)},expression:"form.isDropshipped"}},[i("el-option",{attrs:{value:null,label:"ALL"}}),i("el-option",{attrs:{value:!1,label:"Not distributed"}}),i("el-option",{attrs:{value:!0,label:"Distributed"}})],1)],1),i("el-row",[i("product-tags-selector",{on:{change:t.onSelectLabelChange}})],1),i("ProductList",{directives:[{name:"loading",rawName:"v-loading",value:t.productLoading,expression:"productLoading"}],attrs:{list:t.productList}}),i("el-pagination",{staticClass:"pagination",attrs:{"current-page":t.page.current,"page-size":t.page.size,layout:"total, prev, pager, next, jumper",total:t.page.total,background:"","hide-on-single-page":""},on:{"current-change":t.handleCurrentChange}})],1),t.batchDistributionDialog.show?i("batch-distribution",{attrs:{show:t.batchDistributionDialog.show},on:{"update:show":function(e){return t.$set(t.batchDistributionDialog,"show",e)}}}):t._e()],1)},r=[],s=i("6d68"),n=i("8f03"),a=i("f13c"),l=i.n(a),c=i("8f8f"),d=i("4f85"),u=i("2f62"),p={name:"ProductsPricing",components:{ProductList:n["a"],BatchDistribution:c["a"],ProductTagsSelector:d["a"]},data(){return{typeList:[],currentType:{},productList:[],productLoading:!1,form:{keyword:null,isDropshipped:null,isNew:!1,labelIds:[]},page:{total:0,current:1,size:16},batchDistributionDialog:{show:!1},productTypeLoad:!1,hasDeactivated:!1}},computed:{...Object(u["b"])("user",{currentShop:"getCurrentShop",userInfo:"getUserBaseInfo"})},async mounted(){this.ssrCountSet(1),await this.getTypeList(),this.getProductList().finally(()=>{this.ssrCountDown()})},activated(){this.hasDeactivated&&this.getProductList()},deactivated(){this.hasDeactivated=!0},methods:{showBulkDistributionDialog(){this.batchDistributionDialog.show=!0},onSelectLabelChange({isSelectNew:t,labelIds:e}){this.form.isNew=t,this.form.labelIds=e,this.reloadProduct()},async getTypeList(){const t=await Object(s["d"])();this.typeList=t.data.records,this.currentType=this.typeList[0],this.productTypeLoad=!0},async getProductList(){const t={typeId:this.currentType.id,...this.page,...this.form};this.productLoading=!0;const e=await Object(s["c"])(t);this.productLoading=!1,this.page.total=e.data.total,this.productList=e.data.records,this.scrollToList()},scrollToList(){l.a.scrollTo("#product-list-box",800,{offset:-120,easing:"ease-in-out"})},selectType(t){this.currentType=this.typeList.find(e=>e.id===t.id),this.reloadProduct()},reloadProduct(){this.page.current=1,this.getProductList()},handleCurrentChange(t){this.page.current=t,this.getProductList()}}},h=p,f=(i("fb1b"),i("2877")),m=Object(f["a"])(h,o,r,!1,null,"acc917a8",null);e["default"]=m.exports},d243:function(t,e,i){},f13c:function(t,e,i){ /*! * vue-scrollto v2.20.0 * (c) 2019 Randjelovic Igor * @license MIT */ (function(e,i){t.exports=i()})(0,(function(){"use strict";function t(e){return t="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){return e=Object.assign||function(t){for(var e=1;e0?i=l:e=l}while(Math.abs(a)>r&&++c=o?m(e,u,t,i):0===p?u:f(e,r,r+a,t,i)}return function(t){return 0===t?0:1===t?1:p(d(t),e,r)}},v={ease:[.25,.1,.25,1],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},D=!1;try{var k=Object.defineProperty({},"passive",{get:function(){D=!0}});window.addEventListener("test",null,k)}catch(E){}var C={$:function(t){return"string"!==typeof t?t:document.querySelector(t)},on:function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{passive:!1};e instanceof Array||(e=[e]);for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if("object"===t(S)?L=S:"number"===typeof S&&(L.duration=S),e=C.$(m),!e)return console.warn("[vue-scrollto warn]: Trying to scroll to an element that is not on the page: "+m);if(i=C.$(L.container||w.container),o=L.hasOwnProperty("duration")?L.duration:w.duration,s=L.hasOwnProperty("lazy")?L.lazy:w.lazy,r=L.easing||w.easing,n=L.hasOwnProperty("offset")?L.offset:w.offset,a=L.hasOwnProperty("force")?!1!==L.force:w.force,l=L.hasOwnProperty("cancelable")?!1!==L.cancelable:w.cancelable,c=L.onStart||w.onStart,d=L.onDone||w.onDone,u=L.onCancel||w.onCancel,p=void 0===L.x?w.x:L.x,h=void 0===L.y?w.y:L.y,"function"===typeof n&&(n=n(e,i)),f=E(i),b=$(i),R(),y=!1,!a){var x="body"===i.tagName.toLowerCase()?document.documentElement.clientHeight||window.innerHeight:i.offsetHeight,A=b,T=A+x,j=D-n,B=j+e.offsetHeight;if(j>=A&&B<=T)return void(d&&d(e))}if(c&&c(e),I||k)return"string"===typeof r&&(r=v[r]||v["ease"]),_=g.apply(g,r),C.on(i,P,O,{passive:!0}),window.requestAnimationFrame(N),function(){F=null,y=!0};d&&d(e)}return M},S=y(),L=[];function F(t){for(var e=0;e