You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
68 KiB
1 lines
68 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-719ddcb0"],{"81cc":function(t,e,a){},c3f8:function(t,e,a){"use strict";var i=a("81cc"),r=a.n(i);r.a},edf7:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"article-manager video-icon form-submit",attrs:{id:"shopp-manager"}},[a("div",{staticClass:"i-layout-page-header"},[a("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[a("div",{staticClass:"acea-row row-middle",attrs:{slot:"title"},slot:"title"},[a("router-link",{attrs:{to:{path:t.routePre+"/product/index"}}},[a("div",{staticClass:"font-sm after-line"},[a("span",{staticClass:"iconfont iconfanhui"}),a("span",{staticClass:"pl10"},[t._v("返回")])])]),a("span",{staticClass:"mr20 ml16",domProps:{textContent:t._s(t.$route.params.id?"编辑商品":"添加商品")}})],1)])],1),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("div",{staticClass:"new_tab"},[a("Tabs",{on:{"on-click":t.onhangeTab},model:{value:t.currentTab,callback:function(e){t.currentTab=e},expression:"currentTab"}},t._l(t.headTab,(function(t,e){return a("TabPane",{key:e,attrs:{label:t.title,name:t.name}})})),1)],1),a("Form",{ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("Row",{directives:[{name:"show",rawName:"v-show",value:"1"===t.currentTab,expression:"currentTab === '1'"}],attrs:{gutter:24,type:"flex"}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品名称:",prop:"store_name"}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请输入商品名称"},model:{value:t.formValidate.store_name,callback:function(e){t.$set(t.formValidate,"store_name",e)},expression:"formValidate.store_name"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品分类:",prop:"cate_id"}},[a("el-cascader",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请选择商品分类",size:"mini",options:t.treeSelect,props:t.props,filterable:"",clearable:""},model:{value:t.formValidate.cate_id,callback:function(e){t.$set(t.formValidate,"cate_id",e)},expression:"formValidate.cate_id"}})],1)],1),a("Col",{staticClass:"brandName",attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品品牌:",prop:""}},[a("Cascader",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{data:t.brandData,placeholder:"请选择商品品牌","change-on-select":"",filterable:""},model:{value:t.formValidate.brand_id,callback:function(e){t.$set(t.formValidate,"brand_id",e)},expression:"formValidate.brand_id"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"单位:",prop:"unit_name"}},[a("Select",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{clearable:"",filterable:"",placeholder:"请输入单位"},model:{value:t.formValidate.unit_name,callback:function(e){t.$set(t.formValidate,"unit_name",e)},expression:"formValidate.unit_name"}},t._l(t.unitNameList,(function(e,i){return a("Option",{key:i,attrs:{value:e.name}},[t._v(t._s(e.name))])})),1)],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{staticClass:"labelClass",attrs:{label:"商品标签:",prop:"store_label_id"}},[a("div",{staticClass:"acea-row row-middle"},[a("div",{staticClass:"labelInput acea-row row-between-wrapper",on:{click:t.openStoreLabel}},[a("div",{staticStyle:{width:"90%"}},[t.storeDataLabel.length?a("div",t._l(t.storeDataLabel,(function(e,i){return a("Tag",{attrs:{closable:""},on:{"on-close":function(a){return t.closeStoreLabel(e)}}},[t._v(t._s(e.label_name))])})),1):a("span",{staticClass:"span"},[t._v("选择商品标签")])]),a("div",{staticClass:"iconfont iconxiayi"})]),a("span",{staticClass:"addClass",on:{click:t.addStoreLabel}},[t._v("新增标签")])])])],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品编码:",prop:""}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请输入商品编码"},model:{value:t.formValidate.code,callback:function(e){t.$set(t.formValidate,"code",e)},expression:"formValidate.code"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品轮播图:",prop:"slider_image"}},[a("div",{staticClass:"acea-row"},[t._l(t.formValidate.slider_image,(function(e,i){return a("div",{key:i,staticClass:"pictrue",attrs:{draggable:"true"},on:{dragstart:function(a){return t.handleDragStart(a,e)},dragover:function(a){return a.preventDefault(),t.handleDragOver(a,e)},dragenter:function(a){return t.handleDragEnter(a,e)},dragend:function(a){return t.handleDragEnd(a,e)}}},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e,expression:"item"}]}),a("Button",{staticClass:"btndel",attrs:{shape:"circle",icon:"md-close"},nativeOn:{click:function(e){return t.handleRemove(i)}}})],1)})),t.formValidate.slider_image.length<10?a("div",{staticClass:"upLoad acea-row row-center-wrapper",on:{click:function(e){return t.modalPicTap("duo")}}},[a("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1):t._e(),a("Input",{staticClass:"input-display",model:{value:t.formValidate.slider_image[0],callback:function(e){t.$set(t.formValidate.slider_image,0,e)},expression:"formValidate.slider_image[0]"}})],2),a("div",{staticClass:"tips"},[t._v(" 建议尺寸:800 * 800px,可拖拽改变图片顺序,默认首张图为主图,最多上传10张")])])],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"添加视频:"}},[a("i-switch",{attrs:{size:"large"},model:{value:t.formValidate.video_open,callback:function(e){t.$set(t.formValidate,"video_open",e)},expression:"formValidate.video_open"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1),t.formValidate.video_open?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"视频类型:"}},[a("RadioGroup",{on:{"on-change":t.changeVideo},model:{value:t.seletVideo,callback:function(e){t.seletVideo=e},expression:"seletVideo"}},[a("Radio",{staticClass:"radio",attrs:{label:0}},[t._v("本地视频")]),a("Radio",{attrs:{label:1}},[t._v("视频链接")])],1)],1)],1):t._e(),t.formValidate.video_open?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"",prop:"video_link"}},[1!=t.seletVideo||t.formValidate.video_link?t._e():a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请输入视频链接"},model:{value:t.videoLink,callback:function(e){t.videoLink=e},expression:"videoLink"}}),a("input",{ref:"refid",staticClass:"input-display",attrs:{type:"file"},on:{change:t.zh_uploadFile_change}}),0!=t.seletVideo||"1"===t.upload_type&&!t.videoLink||t.formValidate.video_link?t._e():a("div",{staticClass:"ml10 videbox",on:{click:t.zh_uploadFile}},[t._v("\n +\n ")]),1!=t.seletVideo||"1"===t.upload_type&&!t.videoLink||t.formValidate.video_link?t._e():a("Button",{staticClass:"uploadVideo",attrs:{type:"primary",icon:"ios-cloud-upload-outline"},on:{click:t.zh_uploadFile}},[t._v("确认添加")]),"1"!==t.upload_type||t.videoLink?t._e():a("Upload",{staticStyle:{display:"inline-block"},attrs:{"show-upload-list":!1,action:t.fileUrl2,"before-upload":t.videoSaveToUrl,data:t.uploadData,headers:t.header,multiple:!0}},[0!==t.seletVideo||t.formValidate.video_link?t._e():a("div",{staticClass:"videbox"},[t._v("\n +\n ")])]),t.formValidate.video_link?a("div",{staticClass:"iview-video-style"},[a("video",{staticClass:"video-style",attrs:{src:t.formValidate.video_link,controls:"controls"}},[t._v("\n 您的浏览器不支持 video 标签。\n ")]),a("div",{staticClass:"mark"}),a("Icon",{staticClass:"iconv",attrs:{type:"ios-trash-outline"},on:{click:t.delVideo}})],1):t._e(),t.upload.videoIng||t.videoIng?a("Progress",{staticClass:"progress",attrs:{percent:t.progress,"stroke-width":5}}):t._e(),a("div",{staticClass:"tips"},[t._v("建议时长:9~30秒,视频宽高比16:9")])],1)],1):t._e(),a("Col",{staticClass:"goodsShow",attrs:{span:"24"}},[a("FormItem",{attrs:{label:"上架时间:"}},[a("RadioGroup",{on:{"on-change":t.goodsOn},model:{value:t.formValidate.is_show,callback:function(e){t.$set(t.formValidate,"is_show",e)},expression:"formValidate.is_show"}},[a("Radio",{attrs:{label:1}},[a("Icon",{attrs:{type:"social-apple"}}),a("span",[t._v("立即上架")])],1),a("Radio",{attrs:{label:2}},[a("Icon",{attrs:{type:"social-android"}}),a("span",[t._v("定时上架")])],1),a("Radio",{attrs:{label:0}},[a("Icon",{attrs:{type:"social-windows"}}),a("span",[t._v("放入仓库")])],1)],1)],1)],1),2==t.formValidate.is_show?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:""}},[a("DatePicker",{staticStyle:{width:"260px"},attrs:{type:"datetime",options:t.startPickOptions,value:t.formValidate.auto_on_time,placeholder:"请选择上架时间",format:"yyyy-MM-dd HH:mm"},on:{"on-change":t.onchangeShow},model:{value:t.formValidate.auto_on_time,callback:function(e){t.$set(t.formValidate,"auto_on_time",e)},expression:"formValidate.auto_on_time"}})],1)],1):t._e(),a("Col",{staticClass:"goodsShow",attrs:{span:"24"}},[a("FormItem",{attrs:{label:"定时下架:"}},[a("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":t.goodsOff},model:{value:t.off_show,callback:function(e){t.off_show=e},expression:"off_show"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1),1==t.off_show?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:""}},[a("DatePicker",{staticStyle:{width:"260px"},attrs:{type:"datetime",options:t.endPickOptions,value:t.formValidate.auto_off_time,placeholder:"请选择下架时间",format:"yyyy-MM-dd HH:mm"},on:{"on-change":t.onchangeOff},model:{value:t.formValidate.auto_off_time,callback:function(e){t.$set(t.formValidate,"auto_off_time",e)},expression:"formValidate.auto_off_time"}}),a("div",{staticClass:"tips"},[t._v("开启定时下架后,系统会在设置时间下架该商品。下架时间需晚于开售时间,商品才能定时开售。")])],1)],1):t._e()],1),a("Row",{directives:[{name:"show",rawName:"v-show",value:"2"===t.currentTab,expression:"currentTab === '2'"}],attrs:{gutter:24,type:"flex"}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品规格:",props:"spec_type"}},[a("RadioGroup",{on:{"on-change":t.changeSpec},model:{value:t.formValidate.spec_type,callback:function(e){t.$set(t.formValidate,"spec_type",e)},expression:"formValidate.spec_type"}},[a("Radio",{staticClass:"radio",attrs:{label:0}},[t._v("单规格")]),a("Radio",{attrs:{label:1}},[t._v("多规格")])],1)],1)],1),1===t.formValidate.spec_type?a("Col",{staticClass:"noForm",attrs:{span:"24"}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"选择规格:",prop:""}},[a("div",{staticClass:"acea-row row-middle"},[a("Select",{staticStyle:{width:"23%"},model:{value:t.formValidate.selectRule,callback:function(e){t.$set(t.formValidate,"selectRule",e)},expression:"formValidate.selectRule"}},t._l(t.ruleList,(function(e,i){return a("Option",{key:i,attrs:{value:e.rule_name}},[t._v(t._s(e.rule_name))])})),1),a("Button",{staticClass:"mr20",attrs:{type:"primary"},on:{click:t.confirm}},[t._v("确认")]),a("Button",{on:{click:t.addRule}},[t._v("添加规格模板")])],1)])],1),a("Col",{attrs:{span:"24"}},[0!==t.attrs.length?a("FormItem",[a("draggable",{staticClass:"dragArea list-group",attrs:{list:t.attrs,group:"peoples",handle:".move-icon",move:t.checkMove},on:{end:t.end}},t._l(t.attrs,(function(e,i){return a("div",{key:i,staticClass:"acea-row row-middle mb10"},[a("div",{staticClass:"move-icon"},[a("span",{staticClass:"iconfont icondrag2"})]),a("div",{class:t.moveIndex===i?"borderStyle":"",staticStyle:{width:"90%"}},[a("div",{staticClass:"acea-row row-middle"},[a("span",{staticClass:"mr5"},[t._v(t._s(e.value))]),a("Icon",{staticClass:"curs",attrs:{type:"ios-close-circle",size:"14"},on:{click:function(e){return t.handleRemoveRole(i)}}})],1),a("div",{staticClass:"rulesBox"},[a("draggable",{attrs:{list:e.detail,handle:".drag"}},t._l(e.detail,(function(i,r){return a("Tag",{key:r,staticClass:"mr20 drag",attrs:{type:"dot",closable:"",color:"primary",name:i},on:{"on-close":function(a){return t.handleRemove2(e.detail,r)}}},[t._v(t._s(i))])})),1),a("Input",{staticClass:"width-add",attrs:{search:"","enter-button":"添加",placeholder:"请输入属性名称"},on:{"on-search":function(a){return t.createAttr(e.detail.attrsVal,i)}},model:{value:e.detail.attrsVal,callback:function(a){t.$set(e.detail,"attrsVal",a)},expression:"item.detail.attrsVal"}})],1)])])})),0)],1):t._e()],1),t.createBnt?a("Col",{attrs:{span:"24"}},[a("FormItem",[a("Button",{staticClass:"mr15",attrs:{type:"primary",icon:"md-add"},on:{click:t.addBtn}},[t._v("添加新规格")]),a("Button",{attrs:{type:"success"},on:{click:function(e){return t.generate(1)}}},[t._v("立即生成")])],1)],1):t._e(),t.showIput?a("Col",{attrs:{span:"24"}},[a("Col",{attrs:{xl:6,lg:9,md:10,sm:24,xs:24}},[a("FormItem",{attrs:{label:"规格:"}},[a("Input",{attrs:{placeholder:"请输入规格"},model:{value:t.formDynamic.attrsName,callback:function(e){t.$set(t.formDynamic,"attrsName",e)},expression:"formDynamic.attrsName"}})],1)],1),a("Col",{attrs:{xl:6,lg:9,md:10,sm:24,xs:24}},[a("FormItem",{attrs:{label:"规格值:"}},[a("Input",{attrs:{placeholder:"请输入规格值"},model:{value:t.formDynamic.attrsVal,callback:function(e){t.$set(t.formDynamic,"attrsVal",e)},expression:"formDynamic.attrsVal"}})],1)],1),a("Col",{attrs:{xl:6,lg:5,md:10,sm:24,xs:24}},[a("FormItem",[a("Button",{staticClass:"mr15",attrs:{type:"primary"},on:{click:t.createAttrName}},[t._v("确定")]),a("Button",{on:{click:t.offAttrName}},[t._v("取消")])],1)],1)],1):t._e(),t.manyFormValidate.length&&0!==t.formValidate.header.length&&0!==t.attrs.length?a("Col",{attrs:{xl:24,lg:24,md:24,sm:24,xs:24}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{staticClass:"labeltop",attrs:{label:"批量设置:"}},[a("Table",{attrs:{data:t.oneFormBatch,columns:1==t.formValidate.product_type?t.columnsCarMy:3==t.formValidate.product_type?t.columnsFictitious:t.columns2,border:""},scopedSlots:t._u([{key:"attr",fn:function(e){e.row,e.index;return[a("div",{staticClass:"acea-row row-between-wrapper",staticStyle:{cursor:"pointer"},on:{click:t.batchAttr}},[a("div",{staticStyle:{width:"41px"}},[t._v(t._s(t.oneFormBatch[0].attr))]),a("span",{staticClass:"iconfont icondrop-down"})])]}},{key:"pic",fn:function(e){e.row;var i=e.index;return[a("div",{staticClass:"acea-row row-middle row-center-wrapper",on:{click:function(e){return t.modalPicTap("dan","duopi",i)}}},[t.oneFormBatch[0].pic?a("div",{staticClass:"pictrue pictrueTab"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.oneFormBatch[0].pic,expression:"oneFormBatch[0].pic"}]})]):a("div",{staticClass:"upLoad pictrueTab acea-row row-center-wrapper"},[a("Icon",{staticClass:"iosfont",attrs:{type:"ios-camera-outline",size:"26"}})],1)])]}},{key:"price",fn:function(e){e.row,e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.oneFormBatch[0].price,callback:function(e){t.$set(t.oneFormBatch[0],"price",e)},expression:"oneFormBatch[0].price"}})]}},{key:"cost",fn:function(e){e.row,e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.oneFormBatch[0].cost,callback:function(e){t.$set(t.oneFormBatch[0],"cost",e)},expression:"oneFormBatch[0].cost"}})]}},{key:"ot_price",fn:function(e){e.row,e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.oneFormBatch[0].ot_price,callback:function(e){t.$set(t.oneFormBatch[0],"ot_price",e)},expression:"oneFormBatch[0].ot_price"}})]}},{key:"stock",fn:function(e){e.row,e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0,disabled:1==t.formValidate.product_type||t.openErp},model:{value:t.oneFormBatch[0].stock,callback:function(e){t.$set(t.oneFormBatch[0],"stock",e)},expression:"oneFormBatch[0].stock"}})]}},{key:"bar_code",fn:function(e){e.row,e.index;return[a("Input",{model:{value:t.oneFormBatch[0].bar_code,callback:function(e){t.$set(t.oneFormBatch[0],"bar_code",e)},expression:"oneFormBatch[0].bar_code"}})]}},{key:"code",fn:function(e){e.row,e.index;return[a("Input",{model:{value:t.oneFormBatch[0].code,callback:function(e){t.$set(t.oneFormBatch[0],"code",e)},expression:"oneFormBatch[0].code"}})]}},{key:"weight",fn:function(e){e.row,e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{step:.1,min:0},model:{value:t.oneFormBatch[0].weight,callback:function(e){t.$set(t.oneFormBatch[0],"weight",e)},expression:"oneFormBatch[0].weight"}})]}},{key:"volume",fn:function(e){e.row,e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{step:.1,min:0},model:{value:t.oneFormBatch[0].volume,callback:function(e){t.$set(t.oneFormBatch[0],"volume",e)},expression:"oneFormBatch[0].volume"}})]}},{key:"fictitious",fn:function(e){var i=e.row;e.index;return 1==t.formValidate.product_type?[i.virtual_list||i.stock?a("span",{staticClass:"seeCatMy",on:{click:function(e){return t.seeVirtual(t.oneFormBatch[0],"oneFormBatch",0)}}},[t._v("已设置")]):a("Button",{on:{click:function(e){return t.addVirtual(0,"oneFormBatch")}}},[t._v("添加卡密")])]:void 0}},{key:"action",fn:function(e){e.row,e.index;return[a("a",{on:{click:t.batchAdd}},[t._v("批量设置")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:t.batchDel}},[t._v("清空")])]}}],null,!0)})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{staticClass:"labeltop",attrs:{label:"商品属性:"}},[a("Table",{attrs:{data:t.manyFormValidate,columns:t.formValidate.header,border:""},scopedSlots:t._u([t._l(t.attrData.length,(function(e,i){return{key:"value"+(i+1),fn:function(e){e.row;var r=e.index;return[a("div",{class:t.manyFormValidate[r].select?"selectOn":""},[t._v(t._s(t.manyFormValidate[r]["value"+(i+1)]))])]}}})),{key:"pic",fn:function(e){e.row;var i=e.index;return[a("div",{staticClass:"acea-row row-middle row-center-wrapper",on:{click:function(e){return t.modalPicTap("dan","duoTable",i)}}},[t.manyFormValidate[i].pic?a("div",{staticClass:"pictrue pictrueTab"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.manyFormValidate[i].pic,expression:"manyFormValidate[index].pic"}]})]):a("div",{staticClass:"upLoad pictrueTab acea-row row-center-wrapper"},[a("Icon",{attrs:{type:"ios-camera-outline",size:"21"}})],1)])]}},{key:"price",fn:function(e){e.row;var i=e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.manyFormValidate[i].price,callback:function(e){t.$set(t.manyFormValidate[i],"price",e)},expression:"manyFormValidate[index].price"}})]}},{key:"cost",fn:function(e){e.row;var i=e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.manyFormValidate[i].cost,callback:function(e){t.$set(t.manyFormValidate[i],"cost",e)},expression:"manyFormValidate[index].cost"}})]}},{key:"ot_price",fn:function(e){e.row;var i=e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.manyFormValidate[i].ot_price,callback:function(e){t.$set(t.manyFormValidate[i],"ot_price",e)},expression:"manyFormValidate[index].ot_price"}})]}},{key:"stock",fn:function(e){e.row;var i=e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0,precision:0,disabled:1==t.formValidate.product_type||t.openErp},model:{value:t.manyFormValidate[i].stock,callback:function(e){t.$set(t.manyFormValidate[i],"stock",e)},expression:"manyFormValidate[index].stock"}})]}},{key:"fictitious",fn:function(e){var i=e.row,r=e.index;return 1==t.formValidate.product_type?[i.virtual_list&&i.virtual_list.length||i.stock?a("span",{staticClass:"seeCatMy",on:{click:function(e){return t.seeVirtual(i,"manyFormValidate",r)}}},[t._v("已设置")]):a("Button",{on:{click:function(e){return t.addVirtual(r,"manyFormValidate")}}},[t._v("添加卡密")])]:void 0}},{key:"bar_code",fn:function(e){e.row;var i=e.index;return[a("Input",{model:{value:t.manyFormValidate[i].bar_code,callback:function(e){t.$set(t.manyFormValidate[i],"bar_code",e)},expression:"manyFormValidate[index].bar_code"}})]}},{key:"code",fn:function(e){e.row;var i=e.index;return[a("Input",{model:{value:t.manyFormValidate[i].code,callback:function(e){t.$set(t.manyFormValidate[i],"code",e)},expression:"manyFormValidate[index].code"}})]}},{key:"weight",fn:function(e){e.row;var i=e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.manyFormValidate[i].weight,callback:function(e){t.$set(t.manyFormValidate[i],"weight",e)},expression:"manyFormValidate[index].weight"}})]}},{key:"volume",fn:function(e){e.row;var i=e.index;return[a("InputNumber",{staticClass:"priceBox",attrs:{min:0},model:{value:t.manyFormValidate[i].volume,callback:function(e){t.$set(t.manyFormValidate[i],"volume",e)},expression:"manyFormValidate[index].volume"}})]}},{key:"action",fn:function(e){e.row;var i=e.index;return[a("a",{on:{click:function(e){return t.delAttrTable(i)}}},[t._v("删除")])]}}],null,!0)})],1)],1)],1):t._e()],1):t._e(),0===t.formValidate.spec_type?a("div",{staticStyle:{width:"100%"}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"图片:",prop:"image"}},[a("div",{staticClass:"pictrueBox",on:{click:function(e){return t.modalPicTap("dan","danTable",0)}}},[t.oneFormValidate[0].pic?a("div",{staticClass:"pictrue"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.oneFormValidate[0].pic,expression:"oneFormValidate[0].pic"}]})]):a("div",{staticClass:"upLoad acea-row row-center-wrapper"},[a("Input",{staticClass:"input-display",model:{value:t.oneFormValidate[0].pic,callback:function(e){t.$set(t.oneFormValidate[0],"pic",e)},expression:"oneFormValidate[0].pic"}}),a("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1)])])],1),a("Col",{staticClass:"asterisk",attrs:{span:"24"}},[a("div",{staticClass:"asteriskInfo"},[t._v("*")]),a("FormItem",{attrs:{label:"售价:"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999},model:{value:t.oneFormValidate[0].price,callback:function(e){t.$set(t.oneFormValidate[0],"price",e)},expression:"oneFormValidate[0].price"}})],1)],1),a("Col",{staticClass:"asterisk",attrs:{span:"24"}},[a("div",{staticClass:"asteriskInfo on"},[t._v("*")]),a("FormItem",{attrs:{label:"成本价:"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999},model:{value:t.oneFormValidate[0].cost,callback:function(e){t.$set(t.oneFormValidate[0],"cost",e)},expression:"oneFormValidate[0].cost"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"原价:"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999},model:{value:t.oneFormValidate[0].ot_price,callback:function(e){t.$set(t.oneFormValidate[0],"ot_price",e)},expression:"oneFormValidate[0].ot_price"}})],1)],1),a("Col",{staticClass:"asterisk",attrs:{span:"24"}},[a("div",{staticClass:"asteriskInfo"},[t._v("*")]),a("FormItem",{attrs:{label:"库存:"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999,disabled:1==t.formValidate.product_type||t.openErp,precision:0},model:{value:t.oneFormValidate[0].stock,callback:function(e){t.$set(t.oneFormValidate[0],"stock",e)},expression:"oneFormValidate[0].stock"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品条形码:"}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请输入商品条形码"},model:{value:t.oneFormValidate[0].bar_code,callback:function(e){t.$set(t.oneFormValidate[0],"bar_code","string"===typeof e?e.trim():e)},expression:"oneFormValidate[0].bar_code"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品编号:"}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请输入商品编码"},model:{value:t.oneFormValidate[0].code,callback:function(e){t.$set(t.oneFormValidate[0],"code","string"===typeof e?e.trim():e)},expression:"oneFormValidate[0].code"}})],1)],1),0==t.formValidate.product_type?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"重量(KG):"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999},model:{value:t.oneFormValidate[0].weight,callback:function(e){t.$set(t.oneFormValidate[0],"weight",e)},expression:"oneFormValidate[0].weight"}})],1)],1):t._e(),0==t.formValidate.product_type?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"体积(m³):"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:99999999},model:{value:t.oneFormValidate[0].volume,callback:function(e){t.$set(t.oneFormValidate[0],"volume",e)},expression:"oneFormValidate[0].volume"}})],1)],1):t._e(),1==t.formValidate.product_type?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"卡密设置:"}},[t.oneFormValidate[0].virtual_list.length||t.oneFormValidate[0].stock?a("span",{staticClass:"seeCatMy",on:{click:function(e){return t.seeVirtual(t.oneFormValidate[0],"oneFormValidate",0)}}},[t._v("已设置")]):a("Button",{on:{click:function(e){return t.addVirtual(0,"oneFormValidate")}}},[t._v("添加卡密")])],1)],1):t._e()],1):t._e()],1),a("Row",{directives:[{name:"show",rawName:"v-show",value:"3"===t.currentTab,expression:"currentTab === '3'"}],staticClass:"mb10"},[a("Col",{attrs:{span:"16"}},[a("wangeditor",{staticStyle:{width:"100%"},attrs:{content:t.contents},on:{editorContent:t.getEditorContent}})],1),a("Col",{staticStyle:{width:"33%"},attrs:{span:"6"}},[a("div",{staticClass:"ifam"},[a("div",{staticClass:"content",domProps:{innerHTML:t._s(t.content)}})])])],1),a("Row",{directives:[{name:"show",rawName:"v-show",value:"4"===t.currentTab,expression:"currentTab === '4'"}]},[a("Col",t._b({},"Col",t.grid3,!1),[a("FormItem",{attrs:{label:"配送方式:",prop:"",required:""}},[a("CheckboxGroup",{model:{value:t.formValidate.delivery_type,callback:function(e){t.$set(t.formValidate,"delivery_type",e)},expression:"formValidate.delivery_type"}},[a("Checkbox",{attrs:{label:"3"}},[t._v("门店配送")]),a("Checkbox",{attrs:{label:"2"}},[t._v("到店自提")])],1)],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"运费设置:"}},[a("RadioGroup",{model:{value:t.formValidate.freight,callback:function(e){t.$set(t.formValidate,"freight",e)},expression:"formValidate.freight"}},[a("Radio",{attrs:{label:1}},[t._v("包邮")]),a("Radio",{attrs:{label:2}},[t._v("固定邮费")]),a("Radio",{attrs:{label:3}},[t._v("运费模板")])],1)],1)],1),2==t.formValidate.freight?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"",prop:"freight"}},[a("div",{staticClass:"acea-row row-middle"},[a("InputNumber",{staticClass:"perW20 maxW",attrs:{min:0,placeholder:"请输入金额"},model:{value:t.formValidate.postage,callback:function(e){t.$set(t.formValidate,"postage",e)},expression:"formValidate.postage"}}),a("span",{staticClass:"ml10"},[t._v("元")])],1)])],1):t._e(),3==t.formValidate.freight?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"",prop:""}},[a("div",{staticClass:"acea-row"},[a("Select",{staticClass:"perW20 maxW",attrs:{clearable:""},model:{value:t.formValidate.temp_id,callback:function(e){t.$set(t.formValidate,"temp_id",e)},expression:"formValidate.temp_id"}},t._l(t.templateList,(function(e,i){return a("Option",{key:i,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1),t.formValidate.temp_id?a("Button",{staticClass:"ml15",on:{click:t.editTemp}},[t._v("查看运费模板")]):a("Button",{staticClass:"ml15",on:{click:t.addTemp}},[t._v("添加运费模板")])],1)])],1):t._e(),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品展示:"}},[a("RadioGroup",{model:{value:t.formValidate.show_type,callback:function(e){t.$set(t.formValidate,"show_type",e)},expression:"formValidate.show_type"}},[a("Radio",{attrs:{label:0}},[t._v("全部")]),a("Radio",{attrs:{label:1}},[t._v("移动端")]),a("Radio",{attrs:{label:2}},[t._v("收银台")])],1)],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"已售数量:"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:999999,placeholder:"请输入已售数量"},model:{value:t.formValidate.ficti,callback:function(e){t.$set(t.formValidate,"ficti",e)},expression:"formValidate.ficti"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"是否限购:"}},[a("i-switch",{attrs:{"true-value":1,"false-value":0,size:"large"},on:{"on-change":t.limitTap},model:{value:t.formValidate.is_limit,callback:function(e){t.$set(t.formValidate,"is_limit",e)},expression:"formValidate.is_limit"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1),t.formValidate.is_limit?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"限购类型:"}},[a("RadioGroup",{model:{value:t.formValidate.limit_type,callback:function(e){t.$set(t.formValidate,"limit_type",e)},expression:"formValidate.limit_type"}},[a("Radio",{attrs:{label:1}},[t._v("单次限购")]),a("Radio",{attrs:{label:2}},[t._v("长期限购")])],1),a("div",{staticClass:"tips"},[t._v("\n 单次限购是限制每次下单最多购买的数量,长期限购是限制一个用户总共可以购买的数量\n ")])],1)],1):t._e(),t.formValidate.is_limit?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"限购数量:"}},[a("InputNumber",{staticClass:"perW20 maxW",attrs:{min:1,placeholder:"请输入限购数量"},model:{value:t.formValidate.limit_num,callback:function(e){t.$set(t.formValidate,"limit_num",e)},expression:"formValidate.limit_num"}})],1)],1):t._e(),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"排序:"}},[a("InputNumber",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{min:0,max:999999,placeholder:"请输入排序"},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品关键字:",prop:""}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{placeholder:"请输入商品关键字"},model:{value:t.formValidate.keyword,callback:function(e){t.$set(t.formValidate,"keyword",e)},expression:"formValidate.keyword"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品简介:",prop:""}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{type:"textarea",rows:3,placeholder:"请输入商品简介"},model:{value:t.formValidate.store_info,callback:function(e){t.$set(t.formValidate,"store_info",e)},expression:"formValidate.store_info"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品口令:"}},[a("Input",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{type:"textarea",rows:3,placeholder:"请输入商品口令"},model:{value:t.formValidate.command_word,callback:function(e){t.$set(t.formValidate,"command_word",e)},expression:"formValidate.command_word"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品推荐图:"}},[a("div",{staticClass:"pictrueBox",on:{click:function(e){return t.modalPicTap("dan","recommend_image")}}},[t.formValidate.recommend_image?a("div",{staticClass:"pictrue"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.formValidate.recommend_image,expression:"formValidate.recommend_image"}]}),a("Input",{staticClass:"input-display",model:{value:t.formValidate.recommend_image,callback:function(e){t.$set(t.formValidate,"recommend_image",e)},expression:"formValidate.recommend_image"}})],1):a("div",{staticClass:"upLoad acea-row row-center-wrapper"},[a("Input",{staticClass:"input-display",model:{value:t.formValidate.recommend_image,callback:function(e){t.$set(t.formValidate,"recommend_image",e)},expression:"formValidate.recommend_image"}}),a("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1)]),a("div",{staticClass:"tips"},[t._v("(建议图片比例5:2)")])])],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"服务保障:"}},[a("CheckboxGroup",{staticClass:"checkAlls",model:{value:t.formValidate.ensure_id,callback:function(e){t.$set(t.formValidate,"ensure_id",e)},expression:"formValidate.ensure_id"}},t._l(t.ensureData,(function(e,i){return a("Checkbox",{attrs:{label:e.id}},[t._v(t._s(e.name))])})),1)],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"商品参数:",prop:""}},[a("Select",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{clearable:"",filterable:"",placeholder:"请输入商品参数"},on:{"on-change":t.specsInfo},model:{value:t.formValidate.specs_id,callback:function(e){t.$set(t.formValidate,"specs_id",e)},expression:"formValidate.specs_id"}},t._l(t.specsData,(function(e,i){return a("Option",{key:i,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1)],1),t.formValidate.specs_id?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"",props:""}},[a("Table",{ref:"table",staticClass:"specsList",attrs:{border:"",columns:t.specsColumns,data:t.specsList,width:"700"},scopedSlots:t._u([{key:"action",fn:function(e){e.row;var i=e.index;return[i>0?a("a",{on:{click:function(e){return t.delSpecs(i)}}},[t._v("删除")]):t._e()]}}],null,!1,3048928172)}),a("Button",{staticClass:"mt20",on:{click:t.addSpecs}},[t._v("添加参数")])],1)],1):t._e(),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"自定义留言:"}},[a("i-switch",{attrs:{size:"large"},on:{"on-change":t.customMessBtn},model:{value:t.customBtn,callback:function(e){t.customBtn=e},expression:"customBtn"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])]),t.customBtn?a("div",{staticClass:"mt10"},[a("Select",{directives:[{name:"width",rawName:"v-width",value:"50%",expression:"'50%'"}],attrs:{filterable:"",placeholder:"请选择"},on:{"on-change":t.changeForm},model:{value:t.formValidate.system_form_id,callback:function(e){t.$set(t.formValidate,"system_form_id",e)},expression:"formValidate.system_form_id"}},t._l(t.formList,(function(e,i){return a("Option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name))])})),1)],1):t._e()],1)],1),t.customBtn&&t.formValidate.system_form_id?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"",props:""}},[a("Table",{ref:"table",staticClass:"specsList on",attrs:{border:"",columns:t.formColumns,data:t.formTypeList},scopedSlots:t._u([{key:"require",fn:function(e){var i=e.row;return[a("span",[t._v(t._s(i.require?"必填":"不必填"))])]}}],null,!1,469424967)})],1)],1):t._e()],1),t.spinShow?a("Spin",{attrs:{size:"large",fix:""}}):t._e()],1),a("Modal",{attrs:{width:"960px",scrollable:"","footer-hide":"",closable:"",title:"上传商品图","mask-closable":!1,"z-index":1},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?a("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic,getPicD:t.getPicD}}):t._e()],1)],1),a("Card",{staticClass:"fixed-card",style:{left:t.menuCollapse?t.isMobile?"0":"80px":"200px"},attrs:{bordered:!1,"dis-hover":""}},[a("Form",[a("FormItem",["1"!==t.currentTab?a("Button",{on:{click:t.upTab}},[t._v("上一步")]):t._e(),"4"!==t.currentTab?a("Button",{staticClass:"submission",attrs:{type:"primary"},on:{click:function(e){return t.downTab("formValidate")}}},[t._v("下一步")]):t._e(),t.$route.params.id||"4"===t.currentTab?a("Button",{staticClass:"submission",attrs:{type:"primary",disabled:t.openSubimit},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("保存")]):t._e()],1)],1)],1),a("freightTemplate",{ref:"templates",attrs:{template:t.template},on:{changeTemplate:t.changeTemplate}}),a("add-attr",{ref:"addattr",on:{getList:t.userSearchs}}),a("Modal",{attrs:{title:"商品列表",footerHide:"",scrollable:"",width:"900"},on:{"on-cancel":t.goodCancel},model:{value:t.goodsModals,callback:function(e){t.goodsModals=e},expression:"goodsModals"}},[t.goodsModals?a("goods-list",{ref:"goodslist",attrs:{ischeckbox:!0},on:{getProductId:t.getProductId}}):t._e()],1),a("Modal",{attrs:{scrollable:"",title:"选择商品标签",closable:!0,width:"540","footer-hide":!0,"mask-closable":!1},model:{value:t.storeLabelShow,callback:function(e){t.storeLabelShow=e},expression:"storeLabelShow"}},[a("labelList",{ref:"storeLabel",on:{activeData:t.activeStoreData,close:t.storeLabelClose}})],1),a("menus-from",{ref:"menusFrom",attrs:{formValidate:t.formBrand,fromName:1}}),a("Modal",{attrs:{scrollable:"",title:"请选择商品规格",closable:!1,width:"320","footer-hide":!0,"mask-closable":!1},model:{value:t.attrShow,callback:function(e){t.attrShow=e},expression:"attrShow"}},[t.attrShow?a("attr-list",{attrs:{attrs:t.attrsList},on:{activeData:t.activeAttr,close:t.labelAttr,subAttrs:t.subAttrs}}):t._e()],1)],1)},r=[],o=a("a34a"),s=a.n(o),n=a("2f62"),l=a("d708"),c=a("c276"),d=a("310e"),m=a.n(d),u=a("b0e7"),p=a("5334"),f=a("a069"),h=a("2019"),v=a("0f0e"),_=a("e449"),g=a("c4ad"),b=a("2475"),y=a("645a"),V=a("c4c8"),w=a("0fc4"),k=a("0e5c");function x(t){return $(t)||F(t)||C()}function C(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function F(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function $(t){if(Array.isArray(t)){for(var e=0,a=new Array(t.length);e<t.length;e++)a[e]=t[e];return a}}function I(t,e,a,i,r,o,s){try{var n=t[o](s),l=n.value}catch(c){return void a(c)}n.done?e(l):Promise.resolve(l).then(i,r)}function B(t){return function(){var e=this,a=arguments;return new Promise((function(i,r){var o=t.apply(e,a);function s(t){I(o,i,r,s,n,"next",t)}function n(t){I(o,i,r,s,n,"throw",t)}s(void 0)}))}}function S(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function T(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?S(a,!0).forEach((function(e){L(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):S(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function L(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var M={name:"product_productAdd",components:{uploadPictures:u["a"],freightTemplate:p["a"],goodsList:g["a"],addAttr:b["a"],couponList:_["a"],menusFrom:h["a"],attrList:y["a"],labelList:v["a"],wangeditor:f["a"],draggable:m.a},data:function(){var t=this;return{formTypeList:[],formColumns:[{title:"表单标题",key:"title",minWidth:100},{title:"表单类型",key:"name",minWidth:100},{title:"是否必填",slot:"require",minWidth:100}],routePre:l["a"].routePre,specsList:[],specsColumns:[{title:"参数名称",key:"name",align:"center",width:150,render:function(e,a){return e("div",[e("Input",{props:{value:a.row.name,placeholder:"请输入参数名称"},on:{"on-change":function(e){a.row.name=e.target.value,t.specsList[a.index].name=e.target.value}}})])}},{title:"参数值",key:"value",align:"center",width:300,render:function(e,a){return e("div",[e("Input",{props:{value:a.row.value,placeholder:"请输入参数值"},on:{"on-change":function(e){a.row.value=e.target.value,t.specsList[a.index].value=e.target.value}}})])}},{title:"排序",key:"sort",align:"center",width:100,render:function(e,a){return e("div",[e("InputNumber",{props:{value:parseInt(a.row.sort)||0,placeholder:"排序",precision:0},on:{"on-change":function(e){a.row.sort=e,t.specsList[a.index].sort=e}}})])}},{title:"操作",slot:"action",align:"center",minWidth:120}],customList:[{value:"text",label:"文本框"},{value:"number",label:"数字"},{value:"email",label:"邮件"},{value:"data",label:"日期"},{value:"time",label:"时间"},{value:"id",label:"身份证"},{value:"phone",label:"手机号"},{value:"img",label:"图片"}],headTab:[{title:"基础信息",name:"1"},{title:"规格库存",name:"2"},{title:"商品详情",name:"3"},{title:"其他设置",name:"4"}],productType:[{name:"普通商品",title:"物流发货",id:0},{name:"卡密/网盘",title:"自动发货",id:1},{name:"虚拟商品",title:"虚拟发货",id:3}],virtualList:[],carMyShow:!1,customBtn:!1,attrShow:!1,content:"",contents:"",seletVideo:0,fileUrl:l["a"].apiBaseURL+"/file/upload",fileUrl2:l["a"].apiBaseURL+"/file/video_upload",upload_type:"",uploadData:{},header:{},storeDataLabel:[],labelShow:!1,storeLabelShow:!1,props:{emitPath:!1,multiple:!0,checkStrictly:!0},type:0,goodsModals:!1,off_show:0,modals:!1,spinShow:!1,openSubimit:!1,grid2:{xl:10,lg:12,md:12,sm:24,xs:24},grid3:{xl:18,lg:18,md:20,sm:24,xs:24},oneFormBatch:[{attr:"全部",pic:"",price:0,cost:0,ot_price:0,stock:0,bar_code:"",code:"",weight:0,volume:0}],formDynamic:{attrsName:"",attrsVal:""},formDynamicNameData:[],isBtn:!1,columnsCarMy:[],columns2:[{title:"商品规格",slot:"attr",align:"center",minWidth:80},{title:"图片",slot:"pic",align:"center",minWidth:80},{title:"售价",slot:"price",align:"center",minWidth:95},{title:"成本价",slot:"cost",align:"center",minWidth:95},{title:"原价",slot:"ot_price",align:"center",minWidth:95},{title:"库存",slot:"stock",align:"center",minWidth:95},{title:"商品条形码",slot:"bar_code",align:"center",minWidth:120},{title:"商品编号",slot:"code",align:"center",minWidth:120},{title:"重量(KG)",slot:"weight",align:"center",minWidth:95},{title:"体积(m³)",slot:"volume",align:"center",minWidth:95},{title:"操作",slot:"action",align:"center",minWidth:140}],columns:[],columnsInstall:[],columnsInstal2:[],gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},formValidate:{supplier_id:0,is_limit:0,limit_type:1,limit_num:1,disk_info:"",auto_on_time:"",video_open:!1,store_name:"",freight:1,postage:0,custom_form:[],system_form_id:0,cate_id:[],ensure_id:[],keyword:"",unit_name:"",show_type:0,specs_id:0,store_info:"",bar_code:"",code:"",image:"",recommend_image:"",slider_image:[],description:"",ficti:0,sort:0,is_show:1,is_hot:0,is_benefit:0,is_best:0,is_new:0,is_good:0,is_postage:0,id:0,spec_type:0,video_link:"",temp_id:"",attrs:[],items:[{pic:"",price:0,cost:0,ot_price:0,stock:0,bar_code:"",code:""}],header:[],selectRule:"",coupon_ids:[],command_word:"",delivery_type:[],specs:[],recommend_list:[],brand_id:[],product_type:0},ruleList:[],templateList:[],createBnt:!1,showIput:!1,manyFormValidate:[],oneFormValidate:[{pic:"",price:0,cost:0,ot_price:0,stock:0,bar_code:"",code:"",weight:0,volume:0,brokerage:0,brokerage_two:0,vip_price:0,virtual_list:[]}],images:[],imagesTable:"",currentTab:"1",isChoice:"",grid:{xl:8,lg:8,md:12,sm:24,xs:24},loading:!1,modalPic:!1,template:!1,uploadList:[],treeSelect:[],labelSelect:[],ensureData:[],specsData:[],picTit:"",tableIndex:0,ruleValidate:{store_name:[{required:!0,message:"请输入商品名称",trigger:"blur"}],cate_id:[{required:!0,message:"请选择商品分类",trigger:"change",type:"array"}],keyword:[{required:!0,message:"请输入商品关键字",trigger:"blur"}],unit_name:[{required:!0,message:"请输入单位",trigger:"change"}],store_info:[{required:!0,message:"请输入商品简介",trigger:"blur"}],slider_image:[{required:!0,message:"请上传商品轮播图",type:"array",trigger:"change"}],spec_type:[{required:!0,message:"请选择商品规格",trigger:"change"}],selectRule:[{required:!0,message:"请选择商品规格属性",trigger:"change"}]},manyBrokerage:0,manyBrokerageTwo:0,manyVipPrice:0,upload:{videoIng:!1},videoIng:!1,progress:0,videoLink:"",attrs:[],updateIds:[],updateName:[],rakeBack:[{title:"一级返佣",slot:"brokerage",align:"center",width:95},{title:"二级返佣",slot:"brokerage_two",align:"center",width:95}],member:[{title:"会员价",slot:"vip_price",align:"center",width:95}],headerCarMy:{title:"卡密设置",slot:"fictitious",align:"center",width:95},columnsInstalM:[],moveIndex:"",goodsData:[],brandData:[],unitNameList:[],formBrand:{},attrsList:[],activeAtter:[],tabIndex:0,tabName:"",attrData:[],datePickerOptions:{disabledDate:function(t){return t&&t.valueOf()<Date.now()-864e5}},openErp:!1,formList:[]}},computed:T({},Object(n["e"])("admin/layout",["isMobile","menuCollapse"]),{labelWidth:function(){return this.isMobile?void 0:120},labelPosition:function(){return this.isMobile?"top":"right"},labelBottom:function(){return this.isMobile?void 0:15},startPickOptions:function(){var t=this;return{disabledDate:function(e){return t.formValidate.auto_off_time?e.getTime()>new Date(t.formValidate.auto_off_time).getTime()-864e5:""}}},endPickOptions:function(){var t=this;return{disabledDate:function(e){return"1"==t.formValidate.is_show?e.getTime()<Date.now():t.formValidate.auto_on_time?e.getTime()<new Date(t.formValidate.auto_on_time).getTime()+864e5:""}}},changeUnit:function(){var t=this.unitNameList,e=this.formValidate.unit_name;return{unitNameList:t,unit_name:e}}}),watch:{changeUnit:function(t){var e=t.unitNameList,a=t.unit_name;if(a){var i=e.find((function(t){return t.name==a}));i||(this.formValidate.unit_name="")}}},created:function(){this.columns=this.columns2.slice(1,10);var t=JSON.parse(JSON.stringify(this.columns2));t.splice(8,2,this.headerCarMy),this.columnsCarMy=t;var e=JSON.parse(JSON.stringify(this.columns2));e.splice(8,2),this.columnsFictitious=e,this.getToken(),this.getErpConfig()},mounted:function(){var t=this;this.setCopyrightShow({value:!1}),"0"!==this.$route.params.id&&this.$route.params.id||this.$route.query.copy?this.getInfo():"0"===this.$route.params.id&&Object(V["o"])().then((function(e){var a=e.data.info;if(!Array.isArray(a)){var i=a.cate_id.map(Number);t.attrs=a.items||[];var r=[],o=[];a.brand_id.forEach((function(t){o.push(t.toString())})),t.formValidate=a,t.formTypeList=a.custom_form_info||[],t.formValidate.brand_id=o,t.formValidate.coupon_ids=r,t.formValidate.is_limit=t.formValidate.is_limit?1:0,t.formValidate.limit_type=parseInt(t.formValidate.limit_type),t.updateIds=r,t.updateName=a.coupons,t.formValidate.cate_id=i,t.storeDataLabel=a.store_label_id,t.specsList=a.specs,t.oneFormValidate=a.attrs,t.formValidate.header=[],t.generate(0),t.columns=t.columns2.slice(1,10),t.formValidate.system_form_id=a.system_form_id||0,t.formValidate.system_form_id&&(t.customBtn=!0),t.spec_type=a.spec_type,0===a.spec_type?t.manyFormValidate=[]:(t.createBnt=!0,t.oneFormValidate=[{pic:a.slider_image[0],price:0,cost:0,ot_price:0,stock:0,bar_code:"",code:"",weight:0,volume:0,brokerage:0,brokerage_two:0,vip_price:0,virtual_list:[]}]),t.spinShow=!1}})).catch((function(e){t.$Message.error(e.msg)})),this.$route.query.type?(this.modals=!0,this.type=this.$route.query.type):this.type=0,this.goodsCategory(),this.productGetRule(),this.productGetTemplate(),this.getBrandList(),this.getAllUnit(),this.uploadType(),this.getProductAllEnsure(),this.getProductAllSpecs(),this.getAllSystemForm()},destroyed:function(){this.setCopyrightShow({value:!0})},methods:T({},Object(n["d"])("admin/layout",["setCopyrightShow"]),{changeForm:function(t){this.getSystemFormInfo(t,{type:1})},getSystemFormInfo:function(t,e){var a=this;Object(V["J"])(t,e).then((function(t){a.formTypeList=t.data.info})).catch((function(t){a.$Message.error(t.msg)}))},getAllSystemForm:function(){var t=this;Object(V["a"])().then((function(e){t.formList=e.data})).catch((function(e){t.$Message.error(e.msg)}))},limitTap:function(t){t?(this.formValidate.limit_type=this.formValidate.is_limit&&!this.formValidate.limit_type?1:0,this.formValidate.limit_num=this.formValidate.is_limit&&0==this.formValidate.limit_num?1:0):(this.formValidate.limit_type=0,this.formValidate.limit_num=0)},getErpConfig:function(){var t=this;Object(w["a"])().then((function(e){t.openErp=e.data.open_erp})).catch((function(e){t.$Message.error(e.msg)}))},delSpecs:function(t){this.specsList.splice(t,1)},addSpecs:function(){var t={name:"",value:"",sort:0};this.specsList.push(t)},specsInfo:function(t){var e=this;this.specsData.forEach((function(a){a.id==t&&(e.specsList=a.specs)}))},getProductAllSpecs:function(){var t=this;Object(V["j"])().then((function(e){t.specsData=e.data})).catch((function(e){t.$Message.error(e.msg)}))},getProductAllEnsure:function(){var t=this;Object(V["i"])().then((function(e){t.ensureData=e.data})).catch((function(e){t.$Message.error(e.msg)}))},changeVirtual:function(t){this.virtualList=this.virtualList.concat(t)},addVirtual:function(t,e){this.tabIndex=t,this.tabName=e,this.virtualListClear(),this.$refs.addCarMy.fixedCar={disk_info:"",stock:0},this.$refs.addCarMy.cartMyType=1,this.carMyShow=!0},fixdBtn:function(t){1==t.cartMyType?(this.$set(this[this.tabName][this.tabIndex],"disk_info",t.disk_info),this.$set(this[this.tabName][this.tabIndex],"stock",Number(t.stock)),this[this.tabName][this.tabIndex].virtual_list=[]):(this.$set(this[this.tabName][this.tabIndex],"virtual_list",t.virtualList),this.$set(this[this.tabName][this.tabIndex],"stock",t.virtualList.length),this[this.tabName][this.tabIndex].disk_info=""),this.carMyShow=!1},closeCarMy:function(){this.carMyShow=!1},virtualListClear:function(){this.virtualList=[{key:"",value:""}]},seeVirtual:function(t,e,a){this.tabName=e,this.tabIndex=a,this.virtualListClear(),this.$refs.addCarMy.fixedCar={disk_info:"",stock:0},t.virtual_list&&t.virtual_list.length?(this.$refs.addCarMy.cartMyType=2,this.virtualList=t.virtual_list):t.disk_info&&(this.$refs.addCarMy.cartMyType=1,this.$refs.addCarMy.fixedCar.disk_info=t.disk_info,this.$refs.addCarMy.fixedCar.stock=t.stock),this.carMyShow=!0},addAssembly:function(){this.formValidate.custom_form.push({title:"",label:"text",value:"",status:0})},customMessBtn:function(t){t||(this.formValidate.system_form_id=0)},addcustom:function(){this.formValidate.custom_form.length>9?this.$Message.warning("最多添加10条"):this.addAssembly()},delcustom:function(t){this.formValidate.custom_form.splice(t,1)},onchangeShow:function(t){this.formValidate.auto_on_time=t},onchangeOff:function(t){this.formValidate.auto_off_time=t},batchAttr:function(){this.attrShow=!0},getAttr:function(){this.oneFormBatch[0].attr="全部";var t=this.attrs;t.map((function(t){t.details=[],t.detail.map((function(e){t.details.push({name:e,select:!1})}))})),this.attrsList=t},activeAttr:function(t){this.attrsList=t},labelAttr:function(){this.attrShow=!1},manyEmpty:function(t){t.pic="",t.price=0,t.cost=0,t.ot_price=0,t.stock=0,t.bar_code="",t.code="",t.weight=0,t.volume=0,t.virtual_list=[]},doCombination:function(t){var e=t.length-1,a=[],i=[];return r(t,0);function r(t,o){var s=!0,n=!1,l=void 0;try{for(var c,d=t[o][Symbol.iterator]();!(s=(c=d.next()).done);s=!0){var m=c.value;a[o]=m,o<e?r(t,o+1):i.push(a.join(","));var u=a;a=[];for(var p=0,f=u;p<f.length;p++){var h=f[p];a.push(h)}}}catch(v){n=!0,l=v}finally{try{s||null==d.return||d.return()}finally{if(n)throw l}}return i}},subAttrs:function(t){var e=[];this.attrsList.forEach((function(t,a){var i=[];t.details.forEach((function(t){t.select&&i.push(t.name)})),i.length&&e.push(i)}));var a=[];e.length&&(a=this.doCombination(e)),this.attrShow=!1,this.activeAtter=e,this.oneFormBatch[0].attr=a.length?a.join(";"):"全部",this.manyFormValidate.forEach((function(t){t.select=!1,a.length?a.forEach((function(e){t.values.split("").length==e.split("").length?t.values==e&&(t.select=!0):-1!=t.values.indexOf(e)&&(t.select=!0)})):t.select=!0})),this.$set(this,"manyFormValidate",this.manyFormValidate)},goodsOn:function(t){0!=t&&1!=t||(this.formValidate.auto_on_time="")},goodsOff:function(t){t||(this.formValidate.auto_off_time="")},addBrand:function(){this.$refs.menusFrom.modals=!0,this.$refs.menusFrom.titleFrom="添加品牌分类",this.formBrand={sort:0,is_show:1},this.formBrand.fid=[0],this.$refs.menusFrom.type=1},getAllUnit:function(){var t=this;Object(V["k"])().then((function(e){t.unitNameList=e.data})).catch((function(e){t.$Message.error(e.msg)}))},addClass:function(){var t=this;this.$modalForm(Object(V["p"])()).then((function(){return t.goodsCategory()}))},addUnit:function(){var t=this;this.$modalForm(Object(V["C"])()).then((function(){return t.getAllUnit()}))},addStoreLabel:function(){this.$modalForm(Object(V["v"])()).then((function(){}))},productTypeTap:function(t,e){if(1==t){if(this.$route.params.id)return this.$Message.error("商品类型不能切换!");this.formValidate.product_type=e.id}this.formValidate.product_type?(this.headTab=[{title:"基础信息",name:"1"},{title:"规格库存",name:"2"},{title:"商品详情",name:"3"},{title:"其他设置",name:"4"}],this.formValidate.postage=0,this.formValidate.supplier_id=0):this.headTab=[{title:"基础信息",name:"1"},{title:"规格库存",name:"2"},{title:"商品详情",name:"3"},{title:"其他设置",name:"4"}]},labelClose:function(){this.labelShow=!1},closeStoreLabel:function(t){var e=this.storeDataLabel.indexOf(this.storeDataLabel.filter((function(e){return e.id==t.id}))[0]);this.storeDataLabel.splice(e,1)},activeStoreData:function(t){this.storeLabelShow=!1,this.storeDataLabel=t},openStoreLabel:function(t){this.storeLabelShow=!0,this.$refs.storeLabel.userLabel(JSON.parse(JSON.stringify(this.storeDataLabel)))},storeLabelClose:function(){this.storeLabelShow=!1},getBrandList:function(){var t=this;Object(V["d"])().then((function(e){t.initBran(e.data),t.brandData=e.data})).catch((function(e){t.$Message.error(e.msg)}))},initBran:function(t){var e=this;t.map((function(t){t.value=t.value.toString(),t.children&&t.children.length&&e.initBran(t.children)}))},getProductId:function(t){this.goodsModals=!1;var e=this.goodsData.concat(t).filter((function(t,e,a){return a.findIndex((function(e){return e.product_id==t.product_id}))==e}));this.goodsData=e.slice(0,12)},goodCancel:function(){this.goodsModals=!1},cancel:function(){this.$router.push({path:"".concat(l["a"].routePre,"/product/index")})},videoSaveToUrl:function(t){var e=this,a=["video/mp4"],i=-1!==a.indexOf(t.type);return i?(Object(k["a"])({randoms:"",file:t,pieceSize:3,success:function(t){e.formValidate.video_link=t.file_path,e.progress=100},error:function(t){e.$Message.error(t.msg)},uploading:function(t,a){e.videoIng=!0;var i=Math.floor(t/a*100);e.progress=i}}),!1):this.$Message.warning({content:"文件 "+t.name+" 格式不正确, 请选择格式正确的视频",duration:5})},getToken:function(){this.header["Authori-zation"]="Bearer "+c["a"].cookies.get("token")},handleSuccess:function(t,e,a){200===t.status?(this.formValidate.video_link=t.data.src,this.$Message.success(t.msg)):this.$Message.error(t.msg)},uploadType:function(){var t=this;Object(V["K"])().then((function(e){t.upload_type=e.data.upload_type}))},getEditorContent:function(t){this.content=t},infoData:function(t){var e=t.cate_id.map(Number);this.attrs=t.items||[];var a=[];t.coupons.map((function(t){a.push(t.id)})),this.goodsData=t.recommend_list,t.auto_off_time?this.off_show=1:this.off_show=0;var i=[];t.brand_id.forEach((function(t){i.push(t.toString())})),this.formValidate=t,this.formTypeList=t.custom_form_info,this.formValidate.brand_id=i,this.formValidate.is_limit=this.formValidate.is_limit?1:0,this.formValidate.limit_type=parseInt(t.limit_type),this.contents=t.description,this.formValidate.coupon_ids=a,this.updateIds=a,this.updateName=t.coupons,this.formValidate.cate_id=e,this.storeDataLabel=t.store_label_id,this.specsList=t.specs,t.attr&&(this.oneFormValidate=[t.attr]),this.formValidate.header=[],this.generate(0),this.formValidate.system_form_id=t.system_form_id||0,this.formValidate.system_form_id&&(this.customBtn=!0),this.spec_type=t.spec_type,0===t.spec_type?this.manyFormValidate=[]:(this.createBnt=!0,this.oneFormValidate=[{pic:"",price:0,cost:0,ot_price:0,stock:0,bar_code:"",code:"",weight:0,volume:0,brokerage:0,brokerage_two:0,vip_price:0,virtual_list:[]}])},onClose:function(t){this.modals=!1,this.infoData(t)},checkMove:function(t){this.moveIndex=t.draggedContext.index},end:function(){this.moveIndex=""},unique:function(t){var e=new Map;return t.filter((function(t){return!e.has(t.id)&&e.set(t.id,1)}))},getList:function(){this.productGetTemplate()},addTemp:function(){this.$refs.templates.isTemplate=!0},editTemp:function(){this.$refs.templates.isTemplate=!0,this.$refs.templates.editFrom(this.formValidate.temp_id)},delVideo:function(){var t=this;t.$set(t.formValidate,"video_link",""),t.$set(t,"progress",0),t.videoIng=!1,t.upload.videoIng=!1},zh_uploadFile:function(){if(1==this.seletVideo){if(!this.videoLink||"video"!=this.$getFileType(this.videoLink))return this.$Message.error("请输入正确的视频链接");this.formValidate.video_link=this.videoLink}else this.$refs.refid.click()},zh_uploadFile_change:function(t){var e=this,a=t.target.files[0].name.substr(t.target.files[0].name.indexOf("."));if(-1===a.indexOf(".mp4"))return e.$Message.error("只能上传MP4文件");var i={key:t.target.files[0].name,contentType:t.target.files[0].type};Object(V["r"])(i).then((function(a){e.$videoCloud.videoUpload({type:a.data.type,evfile:t,res:a,uploading:function(t,i){e.upload.videoIng=t,200==a.status&&(e.progress=100)}}).then((function(t){e.formValidate.video_link=t.url,e.$Message.success("视频上传成功"),e.upload.videoIng=!1})).catch((function(t){e.$Message.error(t)}))})).catch((function(t){e.$Message.error(t.msg)}))},upTab:function(){3==this.currentTab&&0!=this.formValidate.product_type?this.currentTab=(Number(this.currentTab)-2).toString():this.currentTab=(Number(this.currentTab)-1).toString()},downTab:function(t){var e=this;this.$refs[t].validate((function(t){if(t){if(2==e.formValidate.is_show&&!e.formValidate.auto_on_time)return e.$Message.warning("请填写定时上架时间");if(1==e.off_show&&!e.formValidate.auto_off_time)return e.$Message.warning("请填写定时下架时间");3==e.currentTab&&0!=e.formValidate.product_type?e.currentTab=(Number(e.currentTab)+2).toString():e.currentTab=(Number(e.currentTab)+1).toString()}else e.$Message.warning("请完善数据")}))},userSearchs:function(){this.productGetRule()},addRule:function(){this.$refs.addattr.modal=!0},vipPriceSetUp:function(){var t=this;if(t.manyVipPrice<=0)return t.$Message.error("请填写会员价在进行批量添加");var e=!0,a=!1,i=void 0;try{for(var r,o=t.manyFormValidate[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var s=r.value;this.$set(s,"vip_price",t.manyVipPrice)}}catch(n){a=!0,i=n}finally{try{e||null==o.return||o.return()}finally{if(a)throw i}}},batchDel:function(){this.oneFormBatch=[{attr:"全部",pic:"",price:0,cost:0,ot_price:0,stock:0,bar_code:"",code:"",weight:0,volume:0,virtualList:[],disk_info:""}],this.activeAtter=[];var t=!0,e=!1,a=void 0;try{for(var i,r=this.manyFormValidate[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){var o=i.value;o.select=!0}}catch(s){e=!0,a=s}finally{try{t||null==r.return||r.return()}finally{if(e)throw a}}},confirm:function(){var t=this;if(t.createBnt=!0,t.formValidate.selectRule.trim().length<=0)return t.$Message.error("请选择属性");t.ruleList.forEach((function(e,a){e.rule_name===t.formValidate.selectRule&&(t.attrs=e.rule_value)}))},productGetRule:function(){var t=this;Object(V["q"])().then((function(e){t.ruleList=e.data}))},productGetTemplate:function(){var t=this;Object(V["s"])().then((function(e){t.templateList=e.data}))},delAttrTable:function(t){var e=this.$route.params.id;e?(this.manyFormValidate.splice(t,1),this.$Message.success(res.msg)):this.manyFormValidate.splice(t,1)},batchAdd:function(){var t=!0,e=!1,a=void 0;try{for(var i,r=this.manyFormValidate[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){var o=i.value;o.select&&(this.oneFormBatch[0].pic&&this.$set(o,"pic",this.oneFormBatch[0].pic),this.oneFormBatch[0].price>0&&this.$set(o,"price",this.oneFormBatch[0].price),this.oneFormBatch[0].cost>0&&this.$set(o,"cost",this.oneFormBatch[0].cost),this.oneFormBatch[0].ot_price>0&&this.$set(o,"ot_price",this.oneFormBatch[0].ot_price),this.oneFormBatch[0].stock>0&&this.$set(o,"stock",this.oneFormBatch[0].stock),""!==this.oneFormBatch[0].bar_code&&this.$set(o,"bar_code",this.oneFormBatch[0].bar_code),""!==this.oneFormBatch[0].code&&this.$set(o,"code",this.oneFormBatch[0].code),this.oneFormBatch[0].weight>0&&this.$set(o,"weight",this.oneFormBatch[0].weight),this.oneFormBatch[0].volume>0&&this.$set(o,"volume",this.oneFormBatch[0].volume),1==this.formValidate.product_type&&(this.oneFormBatch[0].virtual_list&&this.oneFormBatch[0].virtual_list.length?this.$set(o,"virtual_list",this.oneFormBatch[0].virtual_list):this.oneFormBatch[0].disk_info&&(this.$refs.addCarMy.cartMyType=1,this.$set(o,"disk_info",this.oneFormBatch[0].disk_info))))}}catch(s){e=!0,a=s}finally{try{t||null==r.return||r.return()}finally{if(e)throw a}}},addBtn:function(){this.clearAttr(),this.createBnt=!1,this.showIput=!0},addmanyData:function(t){t.forEach((function(t){t.select=!0})),this.manyFormValidate=t},generate:function(t){var e=this;Object(V["g"])({attrs:this.attrs,product_type:this.formValidate.product_type},this.formValidate.id,t).then((function(t){var a=t.data.info,i=JSON.parse(JSON.stringify(a.header));"0"!==e.$route.params.id&&e.addmanyData(a.value),e.formValidate.header=i,e.attrData=t.data.info.attr;var r=a.header;r.pop(),e.columnsInstalM=a.header,e.$route.params.id||1!==e.formValidate.spec_type?e.$route.params.id&&(e.manyFormValidate.map((function(t){t.pic||(t.pic=e.formValidate.slider_image[0])})),e.oneFormBatch[0].pic=e.formValidate.slider_image[0]):(e.manyFormValidate.map((function(t){t.pic=e.formValidate.slider_image[0]})),e.oneFormBatch[0].pic=e.formValidate.slider_image[0]),e.getAttr()})).catch((function(t){e.$Message.error(t.msg)}))},offAttrName:function(){this.showIput=!1,this.createBnt=!0},clearAttr:function(){this.formDynamic.attrsName="",this.formDynamic.attrsVal=""},handleRemoveRole:function(t){this.attrs.splice(t,1),this.manyFormValidate.splice(t,1)},handleRemove2:function(t,e){t.splice(e,1)},createAttrName:function(){if(this.formDynamic.attrsName&&this.formDynamic.attrsVal){var t={value:this.formDynamic.attrsName,detail:[this.formDynamic.attrsVal]};this.attrs.push(t);var e={};this.attrs=this.attrs.reduce((function(t,a){return!e[a.value]&&(e[a.value]=t.push(a)),t}),[]),this.clearAttr(),this.showIput=!1,this.createBnt=!0}else this.$Message.warning("请添加完整的规格!")},createAttr:function(t,e){if(t){this.attrs[e].detail.push(t);var a={};this.attrs[e].detail=this.attrs[e].detail.reduce((function(t,e){return!a[e]&&(a[e]=t.push(e)),t}),[])}else this.$Message.warning("请添加属性")},goodsCategory:function(){var t=this;Object(V["f"])(1).then((function(e){t.treeSelect=e.data})).catch((function(e){t.$Message.error(e.msg)}))},changeVideo:function(t){this.formValidate.video_link="",this.videoLink=""},changeSpec:function(){},getInfo:function(){var t=this,e=this;e.spinShow=!0,Object(V["u"])(e.$route.params.id||this.$route.query.copy).then((function(e){var a=e.data.productInfo,i=a.delivery_type;if(Array.isArray(i)){var r=i.findIndex((function(t){return 1==t}));-1!=r&&(i.splice(r,1),a.delivery_type=i)}t.infoData(a),t.spinShow=!1})).catch((function(e){t.spinShow=!1,t.$Message.error(e.msg)}))},onhangeTab:function(t){this.currentTab=t},handleRemove:function(t){this.images.splice(t,1),this.formValidate.slider_image.splice(t,1),this.oneFormValidate[0].pic=this.formValidate.slider_image[0]},changeCancel:function(t){this.modalPic=!1},modalPicTap:function(t,e,a){this.modalPic=!0,this.isChoice="dan"===t?"单选":"多选",this.picTit=e,this.tableIndex=a},getPic:function(t){switch(this.picTit){case"danFrom":this.formValidate.image=t.att_dir,this.$route.params.id||(0===this.formValidate.spec_type?this.oneFormValidate[0].pic=t.att_dir:(this.manyFormValidate.map((function(e){e.pic=t.att_dir})),this.oneFormBatch[0].pic=t.att_dir));break;case"danTable":this.oneFormValidate[this.tableIndex].pic=t.att_dir;break;case"duopi":this.oneFormBatch[this.tableIndex].pic=t.att_dir;break;case"recommend_image":this.formValidate.recommend_image=t.att_dir;break;default:this.manyFormValidate[this.tableIndex].pic=t.att_dir}this.modalPic=!1},getPicD:function(t){var e=this;this.images=t,this.images.map((function(t){e.formValidate.slider_image.push(t.att_dir),e.formValidate.slider_image=e.formValidate.slider_image.splice(0,10)})),this.oneFormValidate[0].pic=this.formValidate.slider_image[0],this.modalPic=!1},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(t){if(!e.formValidate.store_name.trim())return e.$Message.warning("基础信息-商品名称不能为空");if(2==e.formValidate.is_show&&!e.formValidate.auto_on_time)return e.$Message.warning("基础信息-定时上架时间不能为空");if(1==e.off_show&&!e.formValidate.auto_off_time)return e.$Message.warning("基础信息-定时下架时间不能为空");if(2==e.formValidate.freight&&0==e.formValidate.product_type&&e.formValidate.postage<=0)return e.$Message.warning("物流设置-固定邮费不能为0");if(3==e.formValidate.freight&&0==e.formValidate.product_type&&!e.formValidate.temp_id)return e.$Message.warning("物流设置-运费模板不能为空");if(4==e.currentTab&&!e.formValidate.delivery_type.length)return e.$Message.warning("请选择配送方式");if(e.customBtn&&0==e.formValidate.system_form_id)return e.$Message.warning("其他设置-请选择自定义表单模板");if(e.formValidate.type=e.type,0===e.formValidate.spec_type?(e.formValidate.attrs=e.oneFormValidate,e.formValidate.header=[],e.formValidate.items=[]):(e.formValidate.items=e.attrs,e.formValidate.attrs=e.manyFormValidate),1===e.formValidate.spec_type&&0===e.manyFormValidate.length)return e.$Message.warning("规格库存-请点击生成多规格");e.formValidate.attrs;for(var a=0;a<e.specsList.length;a++){var i=e.specsList[a];if(!i.name.trim())return e.$Message.error("请输入参数名称");if(!i.value.trim())return e.$Message.error("请输入参数值")}e.openSubimit=!1,e.formValidate.description=e.formatRichText(e.content);var r=[];e.goodsData.forEach((function(t){r.push(t.product_id)})),e.formValidate.recommend_list=r;var o=[];e.storeDataLabel.forEach((function(t){o.push(t.id)})),e.formValidate.store_label_id=o,e.formValidate.specs=e.specsList,e.$route.query.copy&&(e.formValidate.id=0,e.formValidate.soure_link=""),Object(V["h"])(e.formValidate).then(function(){var t=B(s.a.mark((function t(a){return s.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.openSubimit=!0,e.$Message.success(a.msg),"0"===e.$route.params.id&&Object(V["e"])().catch((function(t){e.$Message.error(t.msg)})),setTimeout((function(){e.$router.push({path:"".concat(l["a"].routePre,"/product/index")})}),500);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.openSubimit=!1,e.$Message.error(t.msg)}))}else{if(!e.formValidate.store_name)return e.$Message.warning("基础信息-商品名称不能为空");if(!e.formValidate.cate_id.length)return e.$Message.warning("基础信息-商品分类不能为空");if(!e.formValidate.unit_name)return e.$Message.warning("基础信息-商品单位不能为空");if(!e.formValidate.slider_image.length)return e.$Message.warning("基础信息-商品轮播图不能为空")}}))},changeTemplate:function(t){this.template=t},validate:function(t,e,a){!1===e&&this.$Message.warning(a)},handleDragStart:function(t,e){this.dragging=e},handleDragEnd:function(t,e){this.dragging=null},handleDragOver:function(t){t.dataTransfer.dropEffect="move"},handleDragEnter:function(t,e){if(t.dataTransfer.effectAllowed="move",e!==this.dragging){var a=x(this.formValidate.slider_image),i=a.indexOf(this.dragging),r=a.indexOf(e);a.splice.apply(a,[r,0].concat(x(a.splice(i,1)))),this.formValidate.slider_image=a}},addCustomDialog:function(t){window.UE.registerUI("test-dialog",(function(t,e){var a=new window.UE.ui.Dialog({iframeUrl:"/store/widget.images/index.html?fodder=dialog",editor:t,name:e,title:"上传图片",cssRules:"width:1200px;height:500px;padding:20px;"});this.dialog=a;var i=new window.UE.ui.Button({name:"dialog-button",title:"上传图片",cssRules:"background-image: url(https://cdn.oss.9gt.net/prov1.1/1/icons.png);background-position: -726px -77px;",onclick:function(){a.render(),a.open()}});return i}),37),window.UE.registerUI("video-dialog",(function(t,e){var a=new window.UE.ui.Dialog({iframeUrl:"/store/widget.video/index.html?fodder=video",editor:t,name:e,title:"上传视频",cssRules:"width:1000px;height:500px;padding:20px;"});this.dialog=a;var i=new window.UE.ui.Button({name:"video-button",title:"上传视频",cssRules:"background-image: url(../../../assets/images/icons.png);background-position: -320px -20px;",onclick:function(){a.render(),a.open()}});return i}),38)},formatRichText:function(t){var e=t.replace(/<img[^>]*>/gi,(function(t,e){return t=t.replace(/style="[^"]+"/gi,"").replace(/style='[^']+'/gi,""),t=t.replace(/width="[^"]+"/gi,"").replace(/width='[^']+'/gi,""),t=t.replace(/height="[^"]+"/gi,"").replace(/height='[^']+'/gi,""),t}));return e=e.replace(/style="[^"]+"/gi,(function(t,e){return t=t.replace(/width:[^;]+;/gi,"max-width:100%;").replace(/width:[^;]+;/gi,"max-width:100%;"),t})),e=e.replace(/\<img/gi,'<img style="max-width:100%;height:auto;display:block;margin-top:0;margin-bottom:0;"'),e}})},N=M,D=(a("c3f8"),a("2877")),O=Object(D["a"])(N,i,r,!1,null,"142f8f8d",null);e["default"]=O.exports}}]); |