1 line
30 KiB
JavaScript
1 line
30 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-349b878a"],{"540f":function(t,e,a){"use strict";a("8712")},8712:function(t,e,a){},"8a2b":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:"divBox"},[a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("el-steps",{attrs:{active:t.currentTab,"align-center":"","finish-status":"success"}},[a("el-step",{attrs:{title:"选择视频号商品"}}),t._v(" "),a("el-step",{attrs:{title:"填写基础信息"}}),t._v(" "),a("el-step",{attrs:{title:"修改商品详情"}})],1)],1),t._v(" "),a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.fullscreenLoading,expression:"fullscreenLoading"}],ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:t.ruleValidate,model:t.formValidate,"label-width":"150px"},nativeOn:{submit:function(t){t.preventDefault()}}},[a("div",{directives:[{name:"show",rawName:"v-show",value:0===t.currentTab,expression:"currentTab === 0"}]},[a("el-form-item",{attrs:{label:"选择商品:",prop:"image"}},[a("div",{staticClass:"upLoadPicBox",on:{click:t.changeGood}},[t.formValidate.image?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.formValidate.image}})]):a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])])],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:1===t.currentTab,expression:"currentTab === 1"}]},[a("el-row",{attrs:{gutter:24}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品轮播图:",prop:"images"}},[a("div",{staticClass:"acea-row"},[t._l(t.formValidate.images,(function(e,i){return a("div",{key:i,staticClass:"pictrue",attrs:{draggable:"true"},on:{dragstart:function(a){return t.handleDragStart(a,e,"images")},dragover:function(a){return a.preventDefault(),t.handleDragOver(a,e,"images")},dragenter:function(a){return t.handleDragEnter(a,e,"images")},dragend:function(a){return t.handleDragEnd(a,e,"images")}}},[a("img",{attrs:{src:e}}),t._v(" "),a("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(i,"images")}}})])})),t._v(" "),t.formValidate.images.length<5?a("div",{staticClass:"upLoadPicBox",on:{click:function(e){return t.modalPicTap("2")}}},[a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])]):t._e()],2)])],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品标题:",prop:"title"}},[a("el-input",{attrs:{maxlength:"249",placeholder:"请输入商品名称"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}})],1)],1),t._v(" "),a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"单位:",prop:"unitName"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入单位"},model:{value:t.formValidate.unitName,callback:function(e){t.$set(t.formValidate,"unitName",e)},expression:"formValidate.unitName"}})],1)],1),t._v(" "),a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"运费模板:",prop:"tempId"}},[a("div",{staticClass:"acea-row"},[a("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择"},model:{value:t.formValidate.tempId,callback:function(e){t.$set(t.formValidate,"tempId",e)},expression:"formValidate.tempId"}},t._l(t.shippingList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1)])],1),t._v(" "),a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"虚拟销量:",prop:"ficti"}},[a("el-input-number",{staticClass:"selWidth",attrs:{step:1,"step-strictly":"",min:0,placeholder:"请输入虚拟销量"},model:{value:t.formValidate.ficti,callback:function(e){t.$set(t.formValidate,"ficti",e)},expression:"formValidate.ficti"}})],1)],1),t._v(" "),a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"微信商品类目:",prop:"thirdCatIdList"}},[a("el-cascader",{ref:"demoCascader",staticClass:"selWidth",attrs:{filterable:"",options:t.options,props:t.propsCatId},on:{focus:t.handleChanges},model:{value:t.formValidate.thirdCatIdList,callback:function(e){t.$set(t.formValidate,"thirdCatIdList",e)},expression:"formValidate.thirdCatIdList"}})],1)],1),t._v(" "),a("el-col",t._b({},"el-col",t.grid2,!1),[a("el-form-item",{attrs:{label:"获得积分:",prop:"giveIntegral"}},[a("el-input-number",{staticClass:"selWidth",attrs:{step:1,"step-strictly":"",min:0,placeholder:"请输入获得积分"},model:{value:t.formValidate.giveIntegral,callback:function(e){t.$set(t.formValidate,"giveIntegral",e)},expression:"formValidate.giveIntegral"}})],1)],1),t._v(" "),t.productQualificationType>0?a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品资质图:"}},[a("div",{staticClass:"acea-row"},[t._l(t.formValidate.qualificationPicsList,(function(e,i){return a("div",{key:i,staticClass:"pictrue",attrs:{draggable:"true"},on:{dragstart:function(a){return t.handleDragStart(a,e,"qualificationPics")},dragover:function(a){return a.preventDefault(),t.handleDragOver(a,e,"qualificationPics")},dragenter:function(a){return t.handleDragEnter(a,e,"qualificationPics")},dragend:function(a){return t.handleDragEnd(a,e,"qualificationPics")}}},[a("img",{attrs:{src:e}}),t._v(" "),a("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(i,"qualificationPics")}}})])})),t._v(" "),t.formValidate.qualificationPicsList.length<5?a("div",{staticClass:"upLoadPicBox",on:{click:function(e){return t.modalPicTap("3")}}},[a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])]):t._e()],2),t._v(" "),a("div",{staticClass:"fontColor3"},[t._v("\n 资质类型说明:"+t._s(t.productQualification)+"。"+t._s(1===t.productQualificationType?"必填项!":"选填项!")+"\n ")])])],1):t._e(),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{staticClass:"labeltop",attrs:{label:"商品属性:",required:""}},[a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.ManyAttrValue,"tooltip-effect":"dark"},on:{"selection-change":t.handleSelectionChange}},[t.formValidate.specType?a("el-table-column",{key:"1",attrs:{type:"selection",width:"55"}}):t._e(),t._v(" "),t.manyTabDate&&t.formValidate.specType?t._l(t.manyTabDate,(function(e,i){return a("el-table-column",{key:i,attrs:{align:"center",label:t.manyTabTit[i].title,"min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"priceBox",domProps:{textContent:t._s(e.row[i])}})]}}],null,!0)})})):t._e(),t._v(" "),a("el-table-column",{attrs:{align:"center",label:"图片","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"upLoadPicBox",on:{click:function(a){return t.modalPicTap("1","duo",e.$index)}}},[e.row.image?a("div",{staticClass:"pictrue tabPic"},[a("img",{attrs:{src:e.row.image}})]):a("div",{staticClass:"upLoad tabPic"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])])]}}])}),t._v(" "),t._l(t.attrValue,(function(e,i){return a("el-table-column",{key:i,attrs:{label:t.formThead[i].title,align:"center","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(e){return["商品价"===t.formThead[i].title?a("el-input-number",{staticClass:"priceBox",attrs:{size:"small",min:0,precision:2,step:.1},model:{value:e.row[i],callback:function(a){t.$set(e.row,i,a)},expression:"scope.row[iii]"}}):"限量"===t.formThead[i].title?a("el-input-number",{staticClass:"priceBox",attrs:{size:"small",type:"number",min:1,max:e.row.stock,step:1,"step-strictly":""},model:{value:e.row[i],callback:function(a){t.$set(e.row,i,a)},expression:"scope.row[iii]"}}):a("span",{staticClass:"priceBox",domProps:{textContent:t._s(e.row[i])}})]}}],null,!0)})}))],2)],1)],1)],1)],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:2===t.currentTab,expression:"currentTab === 2"}]},[a("el-form-item",{attrs:{label:"商品详情:"}},[a("Tinymce",{model:{value:t.formValidate.descInfo,callback:function(e){t.$set(t.formValidate,"descInfo",e)},expression:"formValidate.descInfo"}})],1)],1),t._v(" "),a("el-form-item",{staticStyle:{"margin-top":"30px"}},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:!t.$route.params.id&&t.currentTab>0||t.$route.params.id&&2===t.currentTab,expression:"(!$route.params.id && currentTab > 0) || ($route.params.id && currentTab === 2)"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:t.handleSubmitUp}},[t._v("上一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:0==t.currentTab,expression:"currentTab == 0"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleSubmitNest1("formValidate")}}},[t._v("下一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==t.currentTab,expression:"currentTab == 1"}],staticClass:"submission",attrs:{type:"primary",size:"small"},on:{click:function(e){return t.handleSubmitNest2("formValidate")}}},[t._v("下一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:2===t.currentTab,expression:"currentTab === 2"},{name:"hasPermi",rawName:"v-hasPermi",value:["admin:pay:component:product:update"],expression:"['admin:pay:component:product:update']"}],staticClass:"submission",attrs:{loading:t.loading,type:"primary",size:"small"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("提交")])],1)],1)],1),t._v(" "),a("CreatTemplates",{ref:"addTemplates",on:{getList:t.getShippingList}}),t._v(" "),a("el-dialog",{staticClass:"modalBox",attrs:{title:"提示",visible:t.dialogVisible,width:"900px","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-cascader",{ref:"demoCascader",staticClass:"modalBox",staticStyle:{width:"400px"},attrs:{filterable:"",options:t.options,props:t.propsCatId,"popper-append-to-body":!1,"popper-class":"eloption"},on:{change:t.handleChangesModel},model:{value:t.formValidate.thirdCatIdList,callback:function(e){t.$set(t.formValidate,"thirdCatIdList",e)},expression:"formValidate.thirdCatIdList"}}),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("确 定")])],1)],1)],1)},r=[],n=a("8256"),o=a("73f5"),s=a("2f2c"),l=a("b7be"),c=a("b7ac"),u=a("61f7");function d(t){return d="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},d(t)}function f(t){return g(t)||h(t)||p(t)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(t,e){if(t){if("string"===typeof t)return v(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?v(t,e):void 0}}function h(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function g(t){if(Array.isArray(t))return v(t)}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,i=new Array(e);a<e;a++)i[a]=t[a];return i}function y(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */y=function(){return e};var t,e={},a=Object.prototype,i=a.hasOwnProperty,r=Object.defineProperty||function(t,e,a){t[e]=a.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",s=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function c(t,e,a){return Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,a){return t[e]=a}}function u(t,e,a,i){var n=e&&e.prototype instanceof b?e:b,o=Object.create(n.prototype),s=new O(i||[]);return r(o,"_invoke",{value:k(t,a,s)}),o}function f(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var m="suspendedStart",p="suspendedYield",h="executing",g="completed",v={};function b(){}function w(){}function V(){}var C={};c(C,o,(function(){return this}));var I=Object.getPrototypeOf,L=I&&I(I(N([])));L&&L!==a&&i.call(L,o)&&(C=L);var T=V.prototype=b.prototype=Object.create(C);function x(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function a(r,n,o,s){var l=f(t[r],t,n);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==d(u)&&i.call(u,"__await")?e.resolve(u.__await).then((function(t){a("next",t,o,s)}),(function(t){a("throw",t,o,s)})):e.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return a("throw",t,o,s)}))}s(l.arg)}var n;r(this,"_invoke",{value:function(t,i){function r(){return new e((function(e,r){a(t,i,e,r)}))}return n=n?n.then(r,r):r()}})}function k(e,a,i){var r=m;return function(n,o){if(r===h)throw new Error("Generator is already running");if(r===g){if("throw"===n)throw o;return{value:t,done:!0}}for(i.method=n,i.arg=o;;){var s=i.delegate;if(s){var l=S(s,i);if(l){if(l===v)continue;return l}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===m)throw r=g,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=h;var c=f(e,a,i);if("normal"===c.type){if(r=i.done?g:p,c.arg===v)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(r=g,i.method="throw",i.arg=c.arg)}}}function S(e,a){var i=a.method,r=e.iterator[i];if(r===t)return a.delegate=null,"throw"===i&&e.iterator.return&&(a.method="return",a.arg=t,S(e,a),"throw"===a.method)||"return"!==i&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+i+"' method")),v;var n=f(r,e.iterator,a.arg);if("throw"===n.type)return a.method="throw",a.arg=n.arg,a.delegate=null,v;var o=n.arg;return o?o.done?(a[e.resultName]=o.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,v):o:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,v)}function P(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 $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function N(e){if(e||""===e){var a=e[o];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function a(){for(;++r<e.length;)if(i.call(e,r))return a.value=e[r],a.done=!1,a;return a.value=t,a.done=!0,a};return n.next=n}}throw new TypeError(d(e)+" is not iterable")}return w.prototype=V,r(T,"constructor",{value:V,configurable:!0}),r(V,"constructor",{value:w,configurable:!0}),w.displayName=c(V,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,V):(t.__proto__=V,c(t,l,"GeneratorFunction")),t.prototype=Object.create(T),t},e.awrap=function(t){return{__await:t}},x(_.prototype),c(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,a,i,r,n){void 0===n&&(n=Promise);var o=new _(u(t,a,i,r),n);return e.isGeneratorFunction(a)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(T),c(T,l,"Generator"),c(T,o,(function(){return this})),c(T,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),a=[];for(var i in e)a.push(i);return a.reverse(),function t(){for(;a.length;){var i=a.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=N,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach($),!e)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function r(i,r){return s.type="throw",s.arg=e,a.next=i,r&&(a.method="next",a.arg=t),!!r}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var l=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var n=r;break}}n&&("break"===t||"continue"===t)&&n.tryLoc<=e&&e<=n.finallyLoc&&(n=null);var o=n?n.completion:{};return o.type=t,o.arg=e,n?(this.method="next",this.next=n.finallyLoc,v):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),$(a),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var a=this.tryEntries[e];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var r=i.arg;$(a)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,i){return this.delegate={iterator:N(e),resultName:a,nextLoc:i},"next"===this.method&&(this.arg=t),v}},e}function b(t,e,a,i,r,n,o){try{var s=t[n](o),l=s.value}catch(c){return void a(c)}s.done?e(l):Promise.resolve(l).then(i,r)}function w(t){return function(){var e=this,a=arguments;return new Promise((function(i,r){var n=t.apply(e,a);function o(t){b(n,i,r,o,s,"next",t)}function s(t){b(n,i,r,o,s,"throw",t)}o(void 0)}))}}var V={image:"",images:[],headImg:"",title:"",ficti:0,unitName:"",sort:0,giveIntegral:0,tempId:"",attrValue:[{image:"",price:0,cost:0,otPrice:0,stock:0,quota:1,barCode:"",weight:0,volume:0}],attr:[],selectRule:"",descInfo:"",specType:!1,id:0,thirdCatId:"",thirdCatIdList:[],brandId:0,qualificationPics:"",qualificationPicsList:[]},C={price:{title:"商品价"},cost:{title:"成本价"},otPrice:{title:"原价"},stock:{title:"库存"},quota:{title:"限量"},barCode:{title:"商品编号"},weight:{title:"重量(KG)"},volume:{title:"体积(m³)"}},I={name:"creatSeckill",components:{CreatTemplates:c["a"],Tinymce:n["a"]},data:function(){return{dialogVisible:!1,props:{children:"secondCatList",label:"secondCatName",value:"secondCatId",multiple:!0,emitPath:!1},propsCatId:{emitPath:!0},options:[],pickerOptions:{disabledDate:function(t){return t.getTime()<(new Date).setTime((new Date).getTime()-864e5)}},props2:{children:"child",label:"name",value:"id",multiple:!0,emitPath:!1},grid2:{xl:8,lg:10,md:12,sm:24,xs:24},currentTab:0,formThead:Object.assign({},C),formValidate:Object.assign({},V),loading:!1,fullscreenLoading:!1,shippingList:[],ruleValidate:{primaryProductId:[{required:!0,message:"请选择商品",trigger:"change"}],title:[{required:!0,message:"请输入商品标题",trigger:"blur"}],attrValue:[{required:!0,message:"请选择商品属相",trigger:"change",type:"array",min:"1"}],ficti:[{required:!0,message:"请输入虚拟销量",trigger:"blur"}],unitName:[{required:!0,message:"请输入单位",trigger:"blur"}],tempId:[{required:!0,message:"请选择运费模板",trigger:"change"}],giveIntegral:[{required:!0,message:"请输入获得积分",trigger:"blur"}],images:[{required:!0,message:"请上传商品轮播图",type:"array",trigger:"change"}],specType:[{required:!0,message:"请选择商品规格",trigger:"change"}],thirdCatIdList:[{required:!0,message:"请选择商品类目",trigger:"change"}]},manyTabDate:{},manyTabTit:{},attrInfo:{},tempRoute:{},multipleSelection:[],primaryProductId:0,productQualificationType:0,productQualification:"",OneattrValue:[Object.assign({},V.attrValue[0])],ManyAttrValue:[Object.assign({},V.attrValue[0])]}},computed:{attrValue:function(){var t=Object.assign({},V.attrValue[0]);return delete t.image,t}},created:function(){this.$watch("formValidate.attr",this.watCh),this.tempRoute=Object.assign({},this.$route),JSON.parse(sessionStorage.getItem("videoCategory"))||this.getCatList()},mounted:function(){this.formValidate.images=[],this.$route.params.id&&(this.setTagsViewTitle(),this.getInfo(),this.currentTab=1),this.getShippingList(),this.options=JSON.parse(sessionStorage.getItem("videoCategory"))},methods:{handleClose:function(){this.dialogVisible=!1},handleChangesModel:function(t){var e=this.$refs["demoCascader"].getCheckedNodes();this.productQualificationType=e.length>0?e[0].data.productQualificationType:0,this.productQualification=e.length>0?e[0].data.productQualification:"",this.dialogVisible=!1},handleChanges:function(t){this.dialogVisible=!0},getCatList:function(){var t=this;Object(l["i"])().then((function(e){t.options=e,sessionStorage.setItem("videoCategory",JSON.stringify(e))}))},watCh:function(t){var e={},a={};this.formValidate.attr.forEach((function(t,i){e[t.attrName]={title:t.attrName},a[t.attrName]=""})),this.manyTabTit=e,this.manyTabDate=a,this.formThead=Object.assign({},this.formThead,e)},handleRemove:function(t,e){"images"===e?this.formValidate.images.splice(t,1):this.formValidate.qualificationPicsList.splice(t,1)},handleSelectionChange:function(t){this.multipleSelection=t},modalPicTap:function(t,e,a){var i=this;if("3"===t)return this.$message.warning("正在建造");this.fullscreenLoading=!0,this.$modalUpload(function(){var r=w(y().mark((function r(n){var o,s,l;return y().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if("1"!==t||e||(i.formValidate.image=n[0].sattDir,i.ManyAttrValue[0].image=n[0].sattDir),"2"!==t||e){r.next=9;break}if(!(n.length>5||n.length+i.formValidate.images.length>5)){r.next=4;break}return r.abrupt("return",this.$message.warning("最多选择5张图片!"));case 4:return r.next=6,i.getShopImgUpload(n,[]);case 6:o=r.sent,o.map((function(t){i.formValidate.images.push(t.img)})),i.fullscreenLoading=!1;case 9:if("1"!==t||"duo"!==e){r.next=15;break}return r.next=12,i.getImgData(n[0].sattDir);case 12:s=r.sent,i.ManyAttrValue[a].image=s,i.fullscreenLoading=!1;case 15:if("3"!==t){r.next=23;break}if(!(n.length>5||n.length+i.formValidate.qualificationPicsList.length>5)){r.next=18;break}return r.abrupt("return",this.$message.warning("最多选择5张图片!"));case 18:return r.next=20,i.getShopImgUpload(n,[]);case 20:l=r.sent,l.map((function(t){i.formValidate.qualificationPicsList.push(t.img)})),i.fullscreenLoading=!1;case 23:case"end":return r.stop()}}),r,this)})));return function(t){return r.apply(this,arguments)}}(),t,"content")},changeGood:function(){var t=this;this.$modalGoodList((function(e){t.formValidate.image=e.image,t.primaryProductId=e.id}))},handleSubmitNest1:function(){if(!this.formValidate.image)return this.$message.warning("请选择商品!");this.currentTab++,this.$route.params.id||this.getProdect(this.primaryProductId)},filerMerCateList:function(t){return t.map((function(t){return t.child||(t.disabled=!0),t.label=t.name,t}))},getShippingList:function(){var t=this;Object(s["m"])(this.tempData).then((function(e){t.shippingList=e.list}))},addTem:function(){this.$refs.addTemplates.dialogVisible=!0,this.$refs.addTemplates.getCityList()},getInfo:function(){this.$route.params.id?this.getDraftProdect(this.$route.params.id):this.getProdect(this.primaryProductId)},getProdect:function(t){var e=this;this.fullscreenLoading=!0,Object(o["l"])(t).then(function(){var t=w(y().mark((function t(a){var i;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=a,e.formValidate={image:e.$selfUtil.setDomain(i.image),images:JSON.parse(i.sliderImage),title:i.storeName,quota:"",unitName:i.unitName,sort:i.sort,tempId:i.tempId,attr:i.attr,selectRule:i.selectRule,descInfo:i.content,specType:i.specType,primaryProductId:i.id,giveIntegral:i.giveIntegral,ficti:i.ficti,qualificationPicsList:[],thirdCatIdList:[],thirdCatId:0,brandId:21e8,id:0},i.specType?(i.attrValue.forEach((function(t){for(var e in t.quota=t.stock,t.attrValue=JSON.parse(t.attrValue),t.attrValue)t[e]=t.attrValue[e]})),e.$nextTick((function(){i.attrValue.forEach((function(t){t.image=e.$selfUtil.setDomain(t.image),e.$refs.multipleTable.toggleRowSelection(t,!0),e.$set(t,"checked",!0)}))})),e.ManyAttrValue=i.attrValue,e.multipleSelection=i.attrValue):(i.attrValue.forEach((function(t){t.quota=t.stock})),e.ManyAttrValue=i.attrValue,e.formValidate.attr=[]),e.getShopImg(i.sliderImage,i.attrValue);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1}))},getShopImg:function(){var t=w(y().mark((function t(e,a){var i,r,n,o;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=f(JSON.parse(e)),a.map((function(t){i.push(t.image)})),r=f(new Set(i)),n=[],r.map((function(t){n.push({key:t,img:t})})),t.next=7,this.getShopImgUpload(n,[]);case 7:o=t.sent,this.formValidate.images=this.formValidate.images.map((function(t,e){if(t===o[e].key)return o[e].img})),this.ManyAttrValue.map((function(t,e){o.map((function(e,a){t.image===e.key&&(t.image=e.img)}))})),this.fullscreenLoading=!1;case 11:case"end":return t.stop()}}),t,this)})));function e(e,a){return t.apply(this,arguments)}return e}(),getShopImgUpload:function(){var t=w(y().mark((function t(e,a){var i,r;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:t.t0=y().keys(e);case 1:if((t.t1=t.t0()).done){t.next=9;break}return i=t.t1.value,t.next=5,this.getImgData(e[i].img||e[i].sattDir);case 5:r=t.sent,a.push({key:e[i].img||e[i].imgsattDir,img:r}),t.next=1;break;case 9:return t.abrupt("return",a);case 10:case"end":return t.stop()}}),t,this)})));function e(e,a){return t.apply(this,arguments)}return e}(),getImgData:function(t){var e=this;return new Promise((function(a,i){Object(l["S"])({imgUrl:t,respType:1,uploadType:1}).then((function(t){t.errcode>0?(e.fullscreenLoading=!1,e.$message.error(t.errmsg)):a(t.img_info.temp_img_url)}))}))},getDraftProdect:function(t){var e=this;this.fullscreenLoading=!0,Object(l["y"])(t).then(function(){var t=w(y().mark((function t(a){var i;return y().wrap((function(t){while(1)switch(t.prev=t.next){case 0:i=a,e.formValidate={images:JSON.parse(i.headImg),title:i.title,unitName:i.unitName,tempId:i.tempId,attr:JSON.parse(i.attr),descInfo:i.descInfo,specType:i.specType,primaryProductId:i.primaryProductId,giveIntegral:i.giveIntegral,ficti:i.ficti,thirdCatIdList:[i.catInfo.firstCatId,i.catInfo.secondCatId,i.catInfo.thirdCatId],thirdCatId:i.thirdCatId,brandId:i.brandId,qualificationPicsList:JSON.parse(i.qualificationPics)||[],id:i.productId},i.specType?(e.ManyAttrValue=JSON.parse(i.attrValue),e.$nextTick((function(){e.ManyAttrValue.forEach((function(t,a){for(var i in t.attrValue=JSON.parse(t.attrValue),t.attrValue)t[i]=t.attrValue[i];t.id&&(e.$set(t,"price",t.price),e.$set(t,"quota",t.quota),e.$nextTick((function(){e.$refs.multipleTable.toggleRowSelection(t,!0)})))}))}))):(e.ManyAttrValue=JSON.parse(i.attrValue),e.formValidate.attr=[]),e.fullscreenLoading=!1;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1}))},handleSubmitNest2:function(t){var e=this;this.$refs[t].validate((function(t){return!!t&&(e.formValidate.specType&&0===e.multipleSelection.length?e.$message.warning("请填选择至少一个商品属性!"):1===e.productQualificationType&&0===e.formValidate.qualificationPicsList.length?e.$message.warning("该类目必须上传商品资质图片,请上传!"):void e.currentTab++)}))},handleSubmit:Object(u["a"])((function(t){var e=this;this.formValidate.specType?(this.formValidate.attrValue=this.multipleSelection,this.formValidate.attrValue.forEach((function(t){t.attrValue=JSON.stringify(t.attrValue)}))):this.formValidate.attrValue=this.ManyAttrValue,this.formValidate.thirdCatId=this.formValidate.thirdCatIdList[2],this.formValidate.headImg=JSON.stringify(this.formValidate.images),this.formValidate.qualificationPics=JSON.stringify(this.formValidate.qualificationPicsList),this.$refs[t].validate((function(a){a?(e.fullscreenLoading=!0,e.loading=!0,e.$route.params.id?Object(l["A"])(e.formValidate).then(w(y().mark((function a(){return y().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success("编辑成功"),e.$router.push({path:"/marketing/videoChannel/draftList"}),e.$refs[t].resetFields(),e.formValidate.images=[],e.formValidate.qualificationPics=[],e.loading=!1;case 7:case"end":return a.stop()}}),a)})))).catch((function(){e.fullscreenLoading=!1,e.loading=!1})):Object(l["T"])(e.formValidate).then(function(){var a=w(y().mark((function a(i){return y().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success("新增成功"),e.$router.push({path:"/marketing/videoChannel/draftList"}),e.$refs[t].resetFields(),e.formValidate.images=[],e.formValidate.qualificationPics=[],e.loading=!1;case 7:case"end":return a.stop()}}),a)})));return function(t){return a.apply(this,arguments)}}()).catch((function(){e.fullscreenLoading=!1,e.loading=!1}))):e.formValidate.storeName&&e.formValidate.unitName&&e.formValidate.store_info&&e.formValidate.image&&e.formValidate.images||e.$message.warning("请填写完整商品信息!")}))})),handleSubmitUp:function(){this.productQualificationType=0,this.formValidate.thirdCatIdList=[],this.currentTab--<0&&(this.currentTab=0)},setTagsViewTitle:function(){var t="编辑视频号商品",e=Object.assign({},this.tempRoute,{title:"".concat(t,"-").concat(this.$route.params.id)});this.$store.dispatch("tagsView/updateVisitedView",e)},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,a){var i;if(t.dataTransfer.effectAllowed="move",e!==this.dragging){var r=[];r=f("images"===a?this.formValidate.images:this.formValidate.qualificationPicsList);var n=r.indexOf(this.dragging),o=r.indexOf(e);(i=r).splice.apply(i,[o,0].concat(f(r.splice(n,1)))),"images"===a?this.formValidate.images=r:this.formValidate.qualificationPicsList=r}}}},L=I,T=(a("540f"),a("2877")),x=Object(T["a"])(L,i,r,!1,null,"72722b7b",null);e["default"]=x.exports}}]); |