easypay-admin/crmebadmin/static/js/chunk-062d96b8.9d6d1e31.js
2023-12-20 21:43:49 +08:00

1 line
28 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-062d96b8"],{"3e1d":function(t,e,a){"use strict";a.r(e);var r=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:"image"}},[a("div",{staticClass:"upLoadPicBox",on:{click:function(e){return t.modalPicTap("1")}}},[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("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"商品轮播图:",prop:"images"}},[a("div",{staticClass:"acea-row"},[t._l(t.formValidate.imagess,(function(e,r){return a("div",{key:r,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",{attrs:{src:e}}),t._v(" "),a("i",{staticClass:"el-icon-error btndel",on:{click:function(e){return t.handleRemove(r)}}})])})),t._v(" "),t.formValidate.imagess.length<10?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:"selWidthd",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:"sort"}},[a("el-input-number",{staticClass:"selWidthd",attrs:{max:9999,placeholder:"请输入排序"},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"活动日期:",prop:"timeVal"}},[a("el-date-picker",{staticClass:"mr20",attrs:{type:"daterange","value-format":"yyyy-MM-dd",format:"yyyy-MM-dd","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期","picker-options":t.pickerOptions},on:{change:t.onchangeTime},model:{value:t.formValidate.timeVal,callback:function(e){t.$set(t.formValidate,"timeVal",e)},expression:"formValidate.timeVal"}}),t._v(" "),a("span",[t._v("设置活动开启结束时间,用户可以在设置时间内发起参与砍价")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"砍价人数:",prop:"peopleNum"}},[a("el-input-number",{staticClass:"selWidthd mr20",attrs:{min:2,step:1,"step-strictly":"",placeholder:"请输入砍价人数"},model:{value:t.formValidate.peopleNum,callback:function(e){t.$set(t.formValidate,"peopleNum",e)},expression:"formValidate.peopleNum"}}),t._v(" "),a("span",[t._v("需邀请多少人砍价成功")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"帮砍次数:",prop:"bargainNum"}},[a("el-input-number",{staticClass:"selWidthd mr20",attrs:{min:1,step:1,"step-strictly":"",placeholder:"请输入帮砍次数"},model:{value:t.formValidate.bargainNum,callback:function(e){t.$set(t.formValidate,"bargainNum",e)},expression:"formValidate.bargainNum"}}),t._v(" "),a("span",[t._v("单个商品用户可以帮砍的次数次数设置为1甲和乙同时将商品A的砍价链接发给丙丙只能帮甲或乙其中一个人砍价")])],1)],1),t._v(" "),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"购买数量限制:",prop:"num"}},[a("el-input-number",{staticClass:"selWidthd mr20",attrs:{min:1,step:1,"step-strictly":"",placeholder:"请输入购买数量限制"},model:{value:t.formValidate.num,callback:function(e){t.$set(t.formValidate,"num",e)},expression:"formValidate.num"}}),t._v(" "),a("span",[t._v("单个活动每个用户发起砍价次数限制")])],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:"selWidthd",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",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"活动状态:",required:""}},[a("el-radio-group",{model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},[a("el-radio",{staticClass:"radio",attrs:{label:0}},[t._v("关闭")]),t._v(" "),a("el-radio",{attrs:{label:1}},[t._v("开启")])],1)],1)],1),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"}},[a("el-table-column",{attrs:{label:"选择",width:"50"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-radio",{attrs:{label:e.row},nativeOn:{change:function(a){return t.changeType(e.row)}},model:{value:t.radio,callback:function(e){t.radio=e},expression:"radio"}},[t._v(" \n ")])]}}])}),t._v(" "),t.manyTabDate&&t.formValidate.specType?t._l(t.manyTabDate,(function(e,r){return a("el-table-column",{key:r,attrs:{align:"center",label:t.manyTabTit[r].title,"min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticClass:"priceBox",domProps:{textContent:t._s(e.row[r])}})]}}],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,r){return a("el-table-column",{key:r,attrs:{label:t.formThead[r].title,align:"center","min-width":"140"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;e.$index;return["砍价起始金额"===t.formThead[r].title?a("el-input-number",{staticClass:"priceBox",attrs:{size:"small",min:0,precision:2,step:.1},model:{value:i[r],callback:function(e){t.$set(i,r,e)},expression:"row[iii]"}}):"砍价最低价"===t.formThead[r].title?a("el-input-number",{staticClass:"priceBox",attrs:{size:"small",min:0,max:parseFloat(i.price),precision:2,step:.1},model:{value:i[r],callback:function(e){t.$set(i,r,e)},expression:"row[iii]"}}):"限量"===t.formThead[r].title?a("el-input-number",{staticClass:"priceBox",attrs:{size:"small",type:"number",min:1,max:i.stock,step:1,"step-strictly":""},model:{value:i[r],callback:function(e){t.$set(i,r,e)},expression:"row[iii]"}}):a("span",{staticClass:"priceBox",domProps:{textContent:t._s(i[r])}})]}}],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.content,callback:function(e){t.$set(t.formValidate,"content",e)},expression:"formValidate.content"}})],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:bargain:update"],expression:"['admin:bargain: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}})],1)},i=[],n=a("8256"),o=a("73f5"),s=a("2f2c"),l=a("02df"),c=a("b7be"),u=a("b7ac"),m=a("ed08"),d=a("61f7");function f(t){return f="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},f(t)}function p(t){return b(t)||v(t)||g(t)||h()}function h(){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 g(t,e){if(t){if("string"===typeof t)return y(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)?y(t,e):void 0}}function v(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function b(t){if(Array.isArray(t))return y(t)}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}function V(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */V=function(){return e};var t,e={},a=Object.prototype,r=a.hasOwnProperty,i=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,r){var n=e&&e.prototype instanceof b?e:b,o=Object.create(n.prototype),s=new I(r||[]);return i(o,"_invoke",{value:$(t,a,s)}),o}function m(t,e,a){try{return{type:"normal",arg:t.call(e,a)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",h="executing",g="completed",v={};function b(){}function y(){}function w(){}var T={};c(T,o,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(P([])));_&&_!==a&&r.call(_,o)&&(T=_);var k=w.prototype=b.prototype=Object.create(T);function N(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function a(i,n,o,s){var l=m(t[i],t,n);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==f(u)&&r.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;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){a(t,r,e,i)}))}return n=n?n.then(i,i):i()}})}function $(e,a,r){var i=d;return function(n,o){if(i===h)throw new Error("Generator is already running");if(i===g){if("throw"===n)throw o;return{value:t,done:!0}}for(r.method=n,r.arg=o;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=h;var c=m(e,a,r);if("normal"===c.type){if(i=r.done?g:p,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function C(e,a){var r=a.method,i=e.iterator[r];if(i===t)return a.delegate=null,"throw"===r&&e.iterator.return&&(a.method="return",a.arg=t,C(e,a),"throw"===a.method)||"return"!==r&&(a.method="throw",a.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var n=m(i,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 S(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 O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function P(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 i=-1,n=function a(){for(;++i<e.length;)if(r.call(e,i))return a.value=e[i],a.done=!1,a;return a.value=t,a.done=!0,a};return n.next=n}}throw new TypeError(f(e)+" is not iterable")}return y.prototype=w,i(k,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=c(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,c(t,l,"GeneratorFunction")),t.prototype=Object.create(k),t},e.awrap=function(t){return{__await:t}},N(L.prototype),c(L.prototype,s,(function(){return this})),e.AsyncIterator=L,e.async=function(t,a,r,i,n){void 0===n&&(n=Promise);var o=new L(u(t,a,r,i),n);return e.isGeneratorFunction(a)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},N(k),c(k,l,"Generator"),c(k,o,(function(){return this})),c(k,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),a=[];for(var r in e)a.push(r);return a.reverse(),function t(){for(;a.length;){var r=a.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=P,I.prototype={constructor:I,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(O),!e)for(var a in this)"t"===a.charAt(0)&&r.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 i(r,i){return s.type="throw",s.arg=e,a.next=r,i&&(a.method="next",a.arg=t),!!i}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var n=i;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),O(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 r=a.completion;if("throw"===r.type){var i=r.arg;O(a)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,r){return this.delegate={iterator:P(e),resultName:a,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function w(t,e,a,r,i,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(r,i)}function T(t){return function(){var e=this,a=arguments;return new Promise((function(r,i){var n=t.apply(e,a);function o(t){w(n,r,i,o,s,"next",t)}function s(t){w(n,r,i,o,s,"throw",t)}o(void 0)}))}}var x={image:"",images:"",imagess:[],title:"",num:1,unitName:"",sort:0,giveIntegral:0,ficti:0,isShow:!1,tempId:"",attrValue:[{image:"",price:0,minPrice:0,cost:0,otPrice:0,stock:0,quota:1,weight:0,volume:0,barCode:""}],attr:[],selectRule:"",content:"",specType:!1,id:0,timeId:"",startTime:"",stopTime:"",timeVal:[],status:0},_={price:{title:"砍价起始金额"},minPrice:{title:"砍价最低价"},cost:{title:"成本价"},otPrice:{title:"原价"},stock:{title:"库存"},quota:{title:"限量"},weight:{title:"重量KG"},volume:{title:"体积(m³)"},barCode:{title:"商品编号"}},k={name:"creatSeckill",components:{CreatTemplates:u["a"],Tinymce:n["a"]},data:function(){return{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({},_),formValidate:Object.assign({},x),loading:!1,fullscreenLoading:!1,merCateList:[],shippingList:[],seckillTime:[],ruleValidate:{productId:[{required:!0,message:"请选择商品",trigger:"change"}],title:[{required:!0,message:"请输入砍价活动名称",trigger:"blur"}],attrValue:[{required:!0,message:"请选择商品属相",trigger:"change",type:"array",min:"1"}],num:[{required:!0,message:"请输入购买数量限制",trigger:"blur"}],unitName:[{required:!0,message:"请输入单位",trigger:"blur"}],tempId:[{required:!0,message:"请选择运费模板",trigger:"change"}],timeId:[{required:!0,message:"请选择活动时间",trigger:"change"}],image:[{required:!0,message:"请上传商品图",trigger:"change"}],imagess:[{required:!0,message:"请上传商品轮播图",type:"array",trigger:"change"}],specType:[{required:!0,message:"请选择商品规格",trigger:"change"}],timeVal:[{required:!0,message:"请选择活动日期",trigger:"change",type:"array"}],bargainNum:[{required:!0,message:"请输入帮砍次数",trigger:"blur"}],peopleNum:[{required:!0,message:"请输入砍价人数",trigger:"blur"}],price:[{required:!0,message:"333333",trigger:"blur"}]},manyTabDate:{},manyTabTit:{},attrInfo:{},tempRoute:{},multipleSelection:[],productId:0,radio:"",ManyAttrValue:[Object.assign({},x.attrValue[0])]}},computed:{attrValue:function(){var t=Object.assign({},x.attrValue[0]);return delete t.image,t}},created:function(){this.$watch("formValidate.attr",this.watCh),this.tempRoute=Object.assign({},this.$route)},mounted:function(){var t=this;Object(l["a"])(1).then((function(e){t.seckillTime=e.list})),this.formValidate.imagess=[],this.$route.params.id&&(this.setTagsViewTitle(),this.getInfo(),this.currentTab=1),this.getShippingList(),this.getCategorySelect()},methods:{changeType:function(t,e){t.checked=!0,this.multipleSelection=[t]},watCh:function(t){var e={},a={};this.formValidate.attr.forEach((function(t,r){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){this.formValidate.imagess.splice(t,1)},modalPicTap:function(t,e,a){var r=this;this.$modalUpload((function(i){if("1"!==t||e||(r.formValidate.image=i[0].sattDir,r.ManyAttrValue[0].image=i[0].sattDir),"2"===t&&!e){if(i.length>10)return this.$message.warning("最多选择10张图片");if(i.length+r.formValidate.imagess.length>10)return this.$message.warning("最多选择10张图片");i.map((function(t){r.formValidate.imagess.push(t.sattDir)}))}"1"===t&&"duo"===e&&(r.ManyAttrValue[a].image=i[0].sattDir)}),t,"content")},onchangeTime:function(t){this.formValidate.timeVal=t,this.formValidate.startTime=t?t[0]:"",this.formValidate.stopTime=t?t[1]:""},changeGood:function(){var t=this;this.$modalGoodList((function(e){t.formValidate.image=e.image,t.productId=e.id}))},handleSubmitNest1:function(){this.formValidate.image?(this.currentTab++,this.$route.params.id||this.getProdect(this.productId)):this.$message.warning("请选择商品!")},getCategorySelect:function(){var t=this;Object(o["d"])({status:-1,type:1}).then((function(e){t.merCateList=t.filerMerCateList(e)}))},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.getSekllProdect(this.$route.params.id):this.getProdect(this.productId)},getProdect:function(t){var e=this;this.fullscreenLoading=!0,Object(o["l"])(t).then(function(){var t=T(V().mark((function t(a){return V().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.formValidate={image:e.$selfUtil.setDomain(a.image),imagess:JSON.parse(a.sliderImage),title:a.storeName,storeName:a.storeName,unitName:a.unitName,sort:a.sort,tempId:a.tempId,attr:a.attr,attrValue:a.attrValue,selectRule:a.selectRule,content:a.content,specType:a.specType,productId:a.id,giveIntegral:a.giveIntegral,ficti:a.ficti,startTime:a.startTime||"",stopTime:a.stopTime||"",timeVal:[],status:0,num:1,bargainNum:2,peopleNum:1},a.specType?(a.attrValue.forEach((function(t){for(var a in t.quota=t.stock,t.attrValue=JSON.parse(t.attrValue),t.attrValue)t[a]=t.attrValue[a];t.image=e.$selfUtil.setDomain(t.image)})),e.ManyAttrValue=a.attrValue,e.multipleSelection=a.attrValue):(a.attrValue.forEach((function(t){t.quota=t.stock,t.image=e.$selfUtil.setDomain(t.image)})),e.ManyAttrValue=a.attrValue,e.radio=a.attrValue[0]),e.fullscreenLoading=!1;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.fullscreenLoading=!1}))},getSekllProdect:function(t){var e=this;this.fullscreenLoading=!0,Object(c["b"])({id:t}).then(function(){var t=T(V().mark((function t(a){return V().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.formValidate={image:e.$selfUtil.setDomain(a.image),imagess:JSON.parse(a.sliderImage),title:a.title,storeName:a.storeName,unitName:a.unitName,sort:a.sort,tempId:a.tempId,attr:a.attr,selectRule:a.selectRule,content:a.content,specType:a.specType,productId:a.productId,giveIntegral:a.giveIntegral,ficti:a.ficti,startTime:a.startTime||"",stopTime:a.stopTime||"",timeVal:a.startTime&&a.stopTime?[Object(m["c"])(new Date(a.startTime),"yyyy-MM-dd"),Object(m["c"])(new Date(a.stopTime),"yyyy-MM-dd")]:[],status:a.status,num:a.num,bargainNum:a.bargainNum,peopleNum:a.peopleNum,id:a.id},a.specType?(e.ManyAttrValue=a.attrValue,e.$nextTick((function(){e.ManyAttrValue.forEach((function(t,a){for(var r in t.attrValue=JSON.parse(t.attrValue),t.attrValue)t[r]=t.attrValue[r];t.image=e.$selfUtil.setDomain(t.image),t.id&&(e.radio=t)}))}))):(e.ManyAttrValue=a.attrValue,e.ManyAttrValue.forEach((function(t,a){t.image=e.$selfUtil.setDomain(t.image)})),e.radio=a.attrValue[0]),e.fullscreenLoading=!1;case 3: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){if(!t)return!1;if(!e.radio)return e.$message.warning("请选择一个商品属性!");if(!e.radio.price)return e.$message.warning("请填写砍价起始金额!");if(!e.radio.minPrice&&0!=e.radio.minPrice)return e.$message.warning("请填写砍价最低价!");if(!e.radio.quota)return e.$message.warning("请填写限量!");var a=.01*e.formValidate.peopleNum+e.radio.minPrice;if(e.radio.price<a)return e.$message.warning("砍价起始金额不能小于".concat(a,""));e.currentTab++}))},handleSubmit:Object(d["a"])((function(t){var e=this;this.formValidate.specType?(this.radio.attrValue=JSON.stringify(this.radio.attrValue),this.formValidate.attrValue=[this.radio]):this.formValidate.attrValue=this.ManyAttrValue,this.formValidate.startTime=this.formValidate.timeVal[0],this.formValidate.stopTime=this.formValidate.timeVal[1],this.formValidate.images=JSON.stringify(this.formValidate.imagess),this.$refs[t].validate((function(a){a?(e.fullscreenLoading=!0,e.loading=!0,e.$route.params.id?Object(c["h"])({id:e.$route.params.id},e.formValidate).then(T(V().mark((function a(){return V().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success("编辑成功"),e.$router.push({path:"/marketing/bargain/bargainGoods"}),e.$refs[t].resetFields(),e.formValidate.images=[],e.loading=!1;case 6:case"end":return a.stop()}}),a)})))).catch((function(){e.fullscreenLoading=!1,e.loading=!1})):Object(c["f"])(e.formValidate).then(function(){var a=T(V().mark((function a(r){return V().wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.fullscreenLoading=!1,e.$message.success("新增成功"),e.$router.push({path:"/marketing/bargain/bargainGoods"}),e.$refs[t].resetFields(),e.formValidate.images=[],e.loading=!1;case 6: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.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){if(t.dataTransfer.effectAllowed="move",e!==this.dragging){var a=p(this.formValidate.imagess),r=a.indexOf(this.dragging),i=a.indexOf(e);a.splice.apply(a,[i,0].concat(p(a.splice(r,1)))),this.formValidate.imagess=a}}}},N=k,L=(a("77f12"),a("2877")),$=Object(L["a"])(N,r,i,!1,null,"39d3d06e",null);e["default"]=$.exports},"77f12":function(t,e,a){"use strict";a("ff7f")},ff7f:function(t,e,a){}}]);