启程易购后端代码
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.
 
 
 
 
 
 
qicheng_shop_backend/public/system/js/chunk-7ac193bd.6d9883ef.js

1 lines
14 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7ac193bd"],{"945a":function(e,t,a){"use strict";a("afa9")},"9b92":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"divBox"},[a("el-card",{staticClass:"box-card mb20"},[e.tabList.length>0?a("el-tabs",{model:{value:e.currentTab,callback:function(t){e.currentTab=t},expression:"currentTab"}},e._l(e.tabList,(function(e,t){return a("el-tab-pane",{key:t,attrs:{name:e.value,label:e.title}})})),1):e._e(),e._v(" "),a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.fullscreenLoading,expression:"fullscreenLoading"}],ref:"formValidate",staticClass:"formValidate mt20",attrs:{rules:e.ruleValidate,model:e.formValidate,"label-width":"100px",size:"small"},nativeOn:{submit:function(e){e.preventDefault()}}},[a("div",{directives:[{name:"show",rawName:"v-show",value:1==e.currentTab,expression:"currentTab == 1"}]},[a("el-form-item",{attrs:{label:"边框名称",prop:"activity_name"}},[a("el-input",{staticClass:"selWidth",attrs:{size:"small",placeholder:"请输入边框名称"},model:{value:e.formValidate.activity_name,callback:function(t){e.$set(e.formValidate,"activity_name",t)},expression:"formValidate.activity_name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"活动时间:",required:""}},[a("el-date-picker",{staticClass:"selWidth",attrs:{size:"small",type:"datetimerange",placement:"bottom-end",placeholder:"请选择显示时间","default-time":["00:00:00","23:59:59"]},on:{change:e.onchangeTime},model:{value:e.timeVal,callback:function(t){e.timeVal=t},expression:"timeVal"}}),e._v(" "),a("p",{staticClass:"desc mt10"},[e._v("设置活动氛围图在商城展示时间")])],1),e._v(" "),a("el-form-item",{attrs:{label:"边框图:"}},[a("div",{staticClass:"upLoadPicBox",on:{click:function(t){return e.modalPicTap("1","dan")}}},[e.formValidate.pic?a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:e.formValidate.pic}})]):a("div",{staticClass:"upLoad"},[a("i",{staticClass:"el-icon-camera cameraIconfont"})])]),e._v(" "),a("p",{staticClass:"desc mt10"},[e._v("宽750px,高750px\n "),a("el-popover",{attrs:{placement:"bottom-start",title:"","min-width":"200",trigger:"hover"}},[a("img",{staticStyle:{height:"270px"},attrs:{src:e.baseURL+"/statics/system/activityBackground.png",alt:""}}),e._v(" "),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[e._v("查看示例")])],1)],1)]),e._v(" "),a("el-form-item",{attrs:{label:"是否开启:"}},[a("el-switch",{attrs:{width:56,"active-value":1,"inactive-value":0,"active-text":"开启","inactive-text":"关闭"},model:{value:e.formValidate.is_show,callback:function(t){e.$set(e.formValidate,"is_show",t)},expression:"formValidate.is_show"}})],1)],1),e._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:2==e.currentTab,expression:"currentTab == 2"}]},[a("el-form-item",{attrs:{"label-width":"0"}},[a("el-radio-group",{model:{value:e.formValidate.scope_type,callback:function(t){e.$set(e.formValidate,"scope_type",t)},expression:"formValidate.scope_type"}},[a("el-radio",{attrs:{label:0}},[e._v("全部商品参与")]),e._v(" "),a("el-radio",{attrs:{label:1}},[e._v("指定商品参与")]),e._v(" "),a("el-radio",{attrs:{label:2}},[e._v("指定分类参与")]),e._v(" "),a("el-radio",{attrs:{label:3}},[e._v("指定商户参与")]),e._v(" "),a("el-radio",{attrs:{label:4}},[e._v("指定商品标签")])],1)],1),e._v(" "),1==e.formValidate.scope_type?a("el-form-item",{attrs:{"label-width":"0"}},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.addGoods}},[e._v("添加商品")]),e._v(" "),a("el-button",{attrs:{size:"small",disabled:!e.multipleSelection.length},on:{click:e.batchDel}},[e._v("批量删除")])],1):e._e(),e._v(" "),1==e.formValidate.scope_type?a("el-form-item",{attrs:{"label-width":"0"}},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],ref:"tableList",attrs:{data:e.tableData.data,size:"small"},on:{"selection-change":e.handleSelectionChange,"select-all":e.selectAll,select:e.selectOne}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),e._v(" "),a("el-table-column",{attrs:{prop:"product_id",width:"90"},scopedSlots:e._u([{key:"header",fn:function(t){return[a("el-dropdown",{attrs:{szie:"mini"},on:{command:e.handleCommand}},[a("span",{staticClass:"el-dropdown-link"},[e._v("选择页"),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),e._v(" "),a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},e._l(e.options,(function(t){return a("el-dropdown-item",{key:t.value,attrs:{command:t.value}},[e._v(e._s(t.label))])})),1)],1)]}}],null,!1,1537211165)}),e._v(" "),a("el-table-column",{attrs:{label:"商品图","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("div",{staticClass:"demo-image__preview"},[a("el-image",{attrs:{src:e.row.image,"preview-src-list":[e.row.image]}})],1)]}}],null,!1,1825039654)}),e._v(" "),a("el-table-column",{attrs:{prop:"store_name",label:"商品名称","min-width":"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"price",label:"售价","min-width":"90"}}),e._v(" "),a("el-table-column",{attrs:{prop:"sales",label:"库存","min-width":"70"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"140",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.handleDelete(t.$index,t.row)}}},[e._v("删除")])]}}],null,!1,1945863928)})],1),e._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":e.tableFrom.limit,"current-page":e.tableFrom.page,layout:"total, prev, pager, next, jumper",total:e.tableData.total},on:{"size-change":e.handleSizeChange,"current-change":e.pageChange}})],1)],1):e._e(),e._v(" "),2==e.formValidate.scope_type?a("el-form-item",{attrs:{label:"选择分类:",span:24,"label-width":"80px",prop:"cate_ids"}},[a("el-cascader",{staticClass:"selWidth",attrs:{props:e.props,options:e.categoryList,multiple:"","show-all-levels":!1,clearable:""},model:{value:e.formValidate.cate_ids,callback:function(t){e.$set(e.formValidate,"cate_ids",t)},expression:"formValidate.cate_ids"}})],1):e._e(),e._v(" "),3==e.formValidate.scope_type?a("el-form-item",{attrs:{label:"选择商户:",span:24,"label-width":"80px",prop:"mer_ids"}},[a("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:"",multiple:"",filterable:""},model:{value:e.formValidate.mer_ids,callback:function(t){e.$set(e.formValidate,"mer_ids",t)},expression:"formValidate.mer_ids"}},e._l(e.merchantList,(function(e){return a("el-option",{key:e.mer_id,attrs:{label:e.mer_name,value:e.mer_id}})})),1)],1):e._e(),e._v(" "),4==e.formValidate.scope_type?a("el-form-item",{attrs:{label:"选择标签:",span:24,"label-width":"80px",prop:"label_ids"}},[a("el-select",{staticClass:"selWidth",attrs:{placeholder:"请选择",clearable:"",multiple:"",filterable:""},model:{value:e.formValidate.label_ids,callback:function(t){e.$set(e.formValidate,"label_ids",t)},expression:"formValidate.label_ids"}},e._l(e.labelList,(function(e){return a("el-option",{key:e._id,attrs:{label:e.name,value:e.id}})})),1)],1):e._e()],1)])],1),e._v(" "),a("el-card",{staticClass:"fixed-card"},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:1==e.currentTab,expression:"currentTab == 1"}],attrs:{size:"small",type:"primary"},on:{click:function(t){e.currentTab="2"}}},[e._v("下一步")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:2==e.currentTab,expression:"currentTab == 2"}],attrs:{size:"small"},on:{click:function(t){e.currentTab="1"}}},[e._v("上一步")]),e._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:2==e.currentTab,expression:"currentTab == 2"}],attrs:{size:"small",type:"primary"},on:{click:function(t){return e.submitForm("formValidate")}}},[e._v("保存")])],1),e._v(" "),a("goodsList",{ref:"goodsList",on:{onSelectList:e.selectList}})],1)},s=[],l=(a("1c4c"),a("20d6"),a("6b54"),a("ac6a"),a("5df3"),a("4f7f"),a("75fc")),r=a("b7be"),o=a("c4c8"),n=a("bbcc"),c=a("83d6"),d=a("ecc0"),m={name:"addBorder",data:function(){return{baseURL:n["a"].httpUrl||"http://localhost:8080",pickerOptions:{disabledDate:function(e){return e.getTime()>Date.now()}},props:{multiple:!0,emitPath:!1},roterPre:c["roterPre"],currentTab:"1",tabList:[{value:"1",title:"基础设置"},{value:"2",title:"使用范围"}],fullscreenLoading:!1,timeVal:"",formValidate:{activity_name:"",start_time:"",end_time:"",pic:"",cate_ids:[],mer_ids:[],is_show:0,scope_type:0,spu_ids:[]},ruleValidate:{activity_name:[{required:!0,message:"请输入名称",trigger:"blur"}]},listLoading:!1,selectGoods:!1,multipleSelection:[],categoryList:[],merchantList:[],labelList:[],tableData:{data:[],total:0},options:[{value:"all",label:"所有页"},{value:"one",label:"当前页"}],tableFrom:{page:1,limit:20,spu_ids:[]},ids:[]}},components:{goodsList:d["a"]},computed:{isEdit:function(){return!!this.$route.params.id}},mounted:function(){this.$route.params.id&&(this.setTagsViewTitle(),this.getInfo(this.$route.params.id)),this.getMerSelect(),this.getCategorySelect(),this.getLabelLst()},methods:{onchangeTime:function(e){this.timeVal=e,this.formValidate.start_time=e?this.moment(e[0]).format("YYYY-MM-DD HH:mm:ss"):"",this.formValidate.end_time=e?this.moment(e[1]).format("YYYY-MM-DD HH:mm:ss"):""},modalPicTap:function(e,t){var a=this;this.$modalUpload((function(e){a.formValidate.pic=e[0]}),e)},setTagsViewTitle:function(){var e="编辑商品边框",t=Object.assign({},this.tempRoute,{title:"".concat(e,"-").concat(this.$route.params.id)});this.$store.dispatch("tagsView/updateVisitedView",t)},getMerSelect:function(){var e=this;Object(o["Q"])().then((function(t){e.merchantList=t.data})).catch((function(t){e.$message.error(t.message)}))},getCategorySelect:function(){var e=this;Object(o["w"])({type:1}).then((function(t){e.categoryList=t.data})).catch((function(t){e.$message.error(t.message)}))},getLabelLst:function(){var e=this;Object(o["A"])().then((function(t){e.labelList=t.data})).catch((function(t){e.$message.error(t.message)}))},getInfo:function(e){var t=this;this.fullscreenLoading=!0,Object(r["q"])(e).then((function(e){var a=e.data;t.formValidate={activity_name:a.activity_name,start_time:a.start_time,end_time:a.end_time,cate_ids:a.cate_ids,mer_ids:a.mer_ids,spu_ids:a.spu_ids,pic:a.pic,is_show:a.is_show,label_ids:a.label_ids,scope_type:a.scope_type},t.fullscreenLoading=!1,t.timeVal=[new Date(e.data.start_time),new Date(e.data.end_time)],1==a.scope_type&&(t.$set(t.tableFrom,"spu_ids",a.spu_ids),t.getList(""))})).catch((function(e){t.$message.error(e.message),t.fullscreenLoading=!1}))},addGoods:function(){this.$refs.goodsList.dialogVisible=!0},selectList:function(e){var t,a;(this.listLoading=!0,(t=console).log.apply(t,Object(l["a"])(e)),this.tableFrom.spu_ids.length)?((a=this.tableFrom.spu_ids).push.apply(a,Object(l["a"])(e)),this.tableFrom.spu_ids=Object(l["a"])(new Set(this.tableFrom.spu_ids))):this.$set(this.tableFrom,"spu_ids",e);this.getList("")},getList:function(e){var t=this;this.tableFrom.page=e||this.tableFrom.page,Object(r["Rb"])({spu_ids:this.tableFrom.spu_ids.toString(),page:this.tableFrom.page,limit:this.tableFrom.limit}).then((function(e){var a;(t.tableData.data=e.data.list,t.tableData.total=e.data.count,"all"==t.selectAllPage)&&((a=t.multipleSelection).push.apply(a,Object(l["a"])(t.tableData.data)),t.multipleSelection.forEach((function(e){t.$refs.tableList.toggleRowSelection(e,!0)})));t.listLoading=!1})).catch((function(e){t.$message.error(e.message),t.listLoading=!1}))},handleDelete:function(e,t){this.tableData.data.splice(e,1);var a=this.tableFrom.spu_ids.findIndex((function(e){return e==t.product_id}));this.tableFrom.spu_ids.splice(a,1)},batchDel:function(){var e=this,t=this.tableData.data;this.$refs.tableList.selection.forEach((function(a,i){for(var s=0;s<e.tableFrom.spu_ids.length;s++){var l=e.tableFrom.spu_ids[s];l==a.spu_ids&&e.tableFrom.spu_ids.splice(s,1)}for(var r=0;r<t.length;r++){l=t[r].spu_id;l==a.spu_id&&t.splice(r,1)}e.multipleSelection=[]}))},handleSelectionChange:function(e){this.multipleSelection=e;var t=[];this.multipleSelection.map((function(e){t.push(e.spu_id)}))},selectAll:function(e){var t=e.map((function(e,t){return e.spu_id}));this.ids=Array.from(new Set([].concat(Object(l["a"])(this.ids),Object(l["a"])(t))))},selectOne:function(e,t){var a=e.map((function(e,t){return e.spu_id})),i=this.ids.findIndex((function(e){return e==t.spu_id}));this.ids.splice(i,1),this.ids=Array.from(new Set([].concat(Object(l["a"])(this.ids),Object(l["a"])(a))))},handleCommand:function(e){var t=this;this.$message("click on item "+e),this.selectAllPage="all"===e,this.$nextTick((function(){t.$refs.tableList.toggleAllSelection()}))},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){return!!e&&(t.formValidate.spu_ids=t.tableFrom.spu_ids.toString(),1==t.formValidate.scope_type&&""==t.formValidate.spu_ids?t.$message.error("请选择商品"):""==t.formValidate.pic?t.$message.error("请上传氛围图"):void(t.isEdit?Object(r["t"])(t.$route.params.id,t.formValidate).then((function(e){t.$message.success(e.message),t.$router.push({path:t.roterPre+"/marketing/border/list"})})).catch((function(e){t.$message.error(e.message)})):Object(r["Y"])(t.formValidate).then((function(e){t.$message.success(e.message),t.$router.push({path:t.roterPre+"/marketing/border/list"})})).catch((function(e){t.$message.error(e.message)}))))}))},pageChange:function(e){this.tableFrom.page=e,this.getList("")},handleSizeChange:function(e){this.tableFrom.limit=e,this.getList("")}}},u=m,p=(a("945a"),a("2877")),h=Object(p["a"])(u,i,s,!1,null,"b94ed076",null);t["default"]=h.exports},afa9:function(e,t,a){}}]);