(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-192b85c8"],{2458:function(t,e,r){},2876:function(t,e,r){"use strict";var a=r("2458");r.n(a).a},fac5f:function(t,e,r){"use strict";r.r(e),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("d9e2"),r("b0c0"),r("131a"),r("fb6a");var a=r("0122"),i=r("d0ff"),o=r("c964"),n=r("fc11"),s=r("f3f3"),l=(r("a4d3"),r("e01a"),r("d3b7"),r("159b"),r("a434"),r("4e82"),r("a9e3"),r("d81d"),r("99af"),r("2f62")),c=r("c4ad"),u=r("a069"),d=r("b0e7"),m=r("5334"),p=r("b7be"),f=r("c4c8");function h(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},n=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(e){c=function(t,e,r){return t[e]=r}}function u(t,e,r,a){var o,n,s,l;e=e&&e.prototype instanceof p?e:p,e=Object.create(e.prototype),a=new x(a||[]);return i(e,"_invoke",{value:(o=t,n=r,s=a,l="suspendedStart",function(t,e){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===t)throw e;return k()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var a=r.method,i=e.iterator[a];return void 0===i?(r.delegate=null,"throw"===a&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==a&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+a+"' method")),m):(a=d(i,e.iterator,r.arg),"throw"===a.type?(r.method="throw",r.arg=a.arg,r.delegate=null,m):(i=a.arg,i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)))}(r,s),r)){if(r===m)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===l)throw l="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(l="executing",r=d(o,n,s),"normal"===r.type){if(l=s.done?"completed":"suspendedYield",r.arg===m)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(l="completed",s.method="throw",s.arg=r.arg)}})}),e}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var m={};function p(){}function f(){}function g(){}o={};var v=(c(o,n,(function(){return this})),Object.getPrototypeOf),b=(v=v&&v(v(C([]))),v&&v!==e&&r.call(v,n)&&(o=v),g.prototype=p.prototype=Object.create(o));function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;i(this,"_invoke",{value:function(i,n){function s(){return new e((function(o,s){!function i(o,n,s,l){var c;o=d(t[o],t,n);if("throw"!==o.type)return(n=(c=o.arg).value)&&"object"==Object(a.a)(n)&&r.call(n,"__await")?e.resolve(n.__await).then((function(t){i("next",t,s,l)}),(function(t){i("throw",t,s,l)})):e.resolve(n).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,l)}));l(o.arg)}(i,n,o,s)}))}return o=o?o.then(s,s):s()}})}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function V(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(t){if(t){var e,a=t[n];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(a=function a(){for(;++ee.formValidate.attrs[a].stock)return e.$Message.error("预售限量不能超过规格库存")}e.current+=1})):this.formValidate.image?this.current+=1:this.$Message.warning("请选择商品")},step:function(){this.current--},getContent:function(t){this.formValidate.description=t},modalPicTap:function(t,e,r){this.modalPic=!0,this.isChoice="dan"===t?"单选":"多选",this.picTit=e,this.tableIndex=r},getPic:function(t){"danFrom"===this.picTit?this.formValidate.image=t.att_dir:(this.formValidate.attrs&&this.formValidate.attrs.length&&this.$set(this.specsData[this.tableIndex],"_checked",!0),this.specsData[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.images.push(t.att_dir),e.formValidate.images=e.formValidate.images.splice(0,10)})),this.modalPic=!1},handleRemove:function(t){this.images.splice(t,1),this.formValidate.images.splice(t,1)},changeGoods:function(){this.modals=!0,this.$refs.goodslist.formValidate.is_virtual=0,this.$refs.goodslist.getList(),this.$refs.goodslist.goodsCategory()},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){var r;t.dataTransfer.effectAllowed="move",e!==this.dragging&&(r=(t=Object(i.a)(this.formValidate.images)).indexOf(this.dragging),e=t.indexOf(e),t.splice.apply(t,[e,0].concat(Object(i.a)(t.splice(r,1)))),this.formValidate.images=t)}}},r("2876"),d=r("2877"),u=Object(d.a)(c,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"i-layout-page-header"},[r("div",{staticClass:"i-layout-page-header"},[r("router-link",{attrs:{to:{path:t.$routeProStr+"/marketing/presell/index"}}},[r("Button",{staticClass:"mr20",attrs:{icon:"ios-arrow-back",size:"small"}},[t._v("返回 ")])],1),r("span",{staticClass:"ivu-page-header-title mr20",domProps:{textContent:t._s(0!=t.$route.params.id?"编辑预售商品":"添加预售商品")}})],1)]),r("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[r("Row",{staticClass:"mt30 acea-row row-middle row-center",attrs:{type:"flex"}},[r("Col",{attrs:{span:"20"}},[r("Steps",{attrs:{current:t.current}},[r("Step",{attrs:{title:"选择预售商品"}}),r("Step",{attrs:{title:"填写基础信息"}}),r("Step",{attrs:{title:"修改商品详情"}})],1)],1),r("Col",{attrs:{span:"23"}},[r("Form",{ref:"formValidate",staticClass:"form mt30",attrs:{model:t.formValidate,rules:t.ruleValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},on:{"on-validate":t.validate},nativeOn:{submit:function(t){t.preventDefault()}}},[0===t.current?r("FormItem",{attrs:{label:"选择商品:",prop:"image_input"}},[r("div",{staticClass:"picBox",on:{click:t.changeGoods}},[t.formValidate.image?r("div",{staticClass:"pictrue"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.formValidate.image,expression:"formValidate.image"}]})]):r("div",{staticClass:"upLoad acea-row row-center-wrapper"},[r("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1)])]):t._e(),r("Row",{directives:[{name:"show",rawName:"v-show",value:1===t.current,expression:"current === 1"}],attrs:{type:"flex"}},[r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"商品主图:",prop:"image"}},[r("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("dan","danFrom")}}},[t.formValidate.image?r("div",{staticClass:"pictrue"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.formValidate.image,expression:"formValidate.image"}]})]):r("div",{staticClass:"upLoad acea-row row-center-wrapper"},[r("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1)])])],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"商品轮播图:",prop:"images"}},[r("div",{staticClass:"acea-row"},[t._l(t.formValidate.images,(function(e,a){return r("div",{key:a,staticClass:"pictrue",attrs:{draggable:"true"},on:{dragstart:function(r){return t.handleDragStart(r,e)},dragover:function(r){return r.preventDefault(),t.handleDragOver(r,e)},dragenter:function(r){return t.handleDragEnter(r,e)},dragend:function(r){return t.handleDragEnd(r,e)}}},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e,expression:"item"}]}),r("Button",{staticClass:"btndel",attrs:{shape:"circle",icon:"md-close"},nativeOn:{click:function(e){return t.handleRemove(a)}}})],1)})),t.formValidate.images.length<10?r("div",{staticClass:"upLoad acea-row row-center-wrapper",on:{click:function(e){return t.modalPicTap("duo")}}},[r("Icon",{attrs:{type:"ios-camera-outline",size:"26"}})],1):t._e()],2)])],1),r("Col",{attrs:{span:"24"}},[r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"预售名称:",prop:"title","label-for":"title"}},[r("Input",{attrs:{placeholder:"请输入预售名称","element-id":"title"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}})],1)],1)],1),r("Col",{attrs:{span:"24"}},[r("Col",t._b({},"Col",t.grid,!1),[r("FormItem",{attrs:{label:"预售简介:",prop:"info","label-for":"info"}},[r("Input",{attrs:{placeholder:"请输入预售简介",type:"textarea",rows:4,"element-id":"info"},model:{value:t.formValidate.info,callback:function(e){t.$set(t.formValidate,"info",e)},expression:"formValidate.info"}})],1)],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"预售活动时间:",prop:"section_time"}},[r("div",{staticClass:"acea-row row-middle"},[r("DatePicker",{staticClass:"perW20",attrs:{editable:!1,type:"datetimerange",format:"yyyy-MM-dd HH:mm",placeholder:"请选择活动时间",value:t.formValidate.section_time},on:{"on-change":t.onchangeTime},model:{value:t.formValidate.section_time,callback:function(e){t.$set(t.formValidate,"section_time",e)},expression:"formValidate.section_time"}}),r("div",{staticClass:"ml10 grey"},[t._v("设置活动开启结束时间,用户可以在设置时间内发起参与预售")])],1)])],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"发货时间:",prop:"deliver_time"}},[r("div",{staticClass:"acea-row row-middle"},[r("span",{staticClass:"mr10"},[t._v("预售活动结束后")]),r("InputNumber",{attrs:{placeholder:"请输入发货时间",precision:0,min:1},model:{value:t.formValidate.deliver_time,callback:function(e){t.$set(t.formValidate,"deliver_time",e)},expression:"formValidate.deliver_time"}}),r("span",{staticClass:"ml10"},[t._v(" 天之内 ")]),r("div",{staticClass:"ml10 grey"})],1)])],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"运费模板:",prop:"temp_id"}},[r("div",{staticClass:"acea-row row-middle"},[r("Select",{staticClass:"perW20",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){return r("Option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.name)+" ")])})),1),r("div",{staticClass:"ml10 col",on:{click:t.freight}},[t._v("添加运费模板")])],1)])],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"总购买数量限制:",prop:"num"}},[r("div",{staticClass:"acea-row row-middle"},[r("InputNumber",{staticClass:"perW20",attrs:{min:1,placeholder:"请输入总数量限制",precision:0,"element-id":"num"},model:{value:t.formValidate.num,callback:function(e){t.$set(t.formValidate,"num",e)},expression:"formValidate.num"}}),r("div",{staticClass:"ml10 grey"},[t._v("\n 该商品活动期间内,用户可购买的最大数量。例如设置为4,表示本次活动有效期内,每个用户最多可购买4件\n ")])],1)])],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"单位:",prop:"unit_name","label-for":"unit_name"}},[r("Input",{staticClass:"perW20",attrs:{placeholder:"请输入单位","element-id":"unit_name"},model:{value:t.formValidate.unit_name,callback:function(e){t.$set(t.formValidate,"unit_name",e)},expression:"formValidate.unit_name"}})],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"排序:"}},[r("InputNumber",{staticClass:"perW10",attrs:{placeholder:"请输入排序","element-id":"sort",precision:0},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"活动状态:",props:"status","label-for":"status"}},[r("RadioGroup",{attrs:{"element-id":"status"},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},[r("Radio",{staticClass:"radio",attrs:{label:1}},[t._v("上架")]),r("Radio",{attrs:{label:0}},[t._v("下架")])],1)],1)],1),r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"规格选择:"}},[r("Table",{attrs:{data:t.specsData,columns:t.columns,border:""},on:{"on-selection-change":t.changeCheckbox},scopedSlots:t._u([{key:"pic",fn:function(e){var a=e.row,i=e.index;return[r("div",{staticClass:"acea-row row-middle row-center-wrapper",on:{click:function(e){return t.modalPicTap("dan","danTable",i)}}},[a.pic?r("div",{staticClass:"pictrue pictrueTab"},[r("img",{directives:[{name:"lazy",rawName:"v-lazy",value:a.pic,expression:"row.pic"}]})]):r("div",{staticClass:"upLoad pictrueTab acea-row row-center-wrapper"},[r("Icon",{attrs:{type:"ios-camera-outline",size:"21"}})],1)])]}}])})],1)],1)],1),r("Row",{directives:[{name:"show",rawName:"v-show",value:2===t.current,expression:"current === 2"}]},[r("Col",{attrs:{span:"24"}},[r("FormItem",{attrs:{label:"内容:"}},[r("WangEditor",{staticStyle:{width:"90%"},attrs:{content:t.formValidate.description},on:{editorContent:t.getEditorContent}})],1)],1)],1),r("FormItem",[r("Button",{directives:[{name:"show",rawName:"v-show",value:0!==t.current,expression:"current !== 0"}],staticClass:"submission mr15",attrs:{disabled:t.$route.params.id&&1===t.current},on:{click:t.step}},[t._v("上一步\n ")]),r("Button",{staticClass:"submission",attrs:{type:"primary",disabled:t.submitOpen&&2===t.current},domProps:{textContent:t._s(2===t.current?"提交":"下一步")},on:{click:function(e){return t.next("formValidate")}}})],1)],1),t.spinShow?r("Spin",{attrs:{size:"large",fix:""}}):t._e()],1)],1)],1),r("Modal",{staticClass:"paymentFooter",attrs:{title:"商品列表",footerHide:"",scrollable:"",width:"900"},on:{"on-cancel":t.cancel},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[r("goods-list",{ref:"goodslist",on:{getProductId:t.getProductId}})],1),r("Modal",{attrs:{width:"950px",scrollable:"","footer-hide":"",closable:"",title:"上传商品图","mask-closable":!1,"z-index":888},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?r("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic,getPicD:t.getPicD}}):t._e()],1),r("freight-template",{ref:"template",on:{addSuccess:t.productGetTemplate}})],1)}),[],!1,null,"7c57fdce",null),e.default=u.exports}}]);