zx/public/mer/js/chunk-e663cd82.c41a17ee.js

1 line
35 KiB
JavaScript
Raw Permalink 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-e663cd82"],{"18a8":function(t,e,a){},2661:function(t,e,a){"use strict";a("18a8")},"84df":function(t,e,a){},ab53:function(t,e,a){"use strict";a("84df")},bb8a: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("div",{staticClass:"container_box"},[a("pages-header",{ref:"pageHeader",attrs:{title:t.isLook?"查看活动":"参加活动",backUrl:"/marketing/seckill/store_seckill/list"}}),t._v(" "),a("el-card",{staticClass:"box-card box-body mt14",attrs:{bordered:!1,shadow:"never"}},[a("el-tabs",{model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"活动信息",name:"first"}}),t._v(" "),t.isEdit?a("el-tab-pane",{attrs:{label:"秒杀商品",name:"second"}}):t._e(),t._v(" "),a("el-tab-pane",{attrs:{label:"已加商品",name:"third"}})],1),t._v(" "),a("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:t.ruleForm,rules:t.rules,"label-width":"120px",size:"small"}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},["first"==t.activeName?[a("el-form-item",{attrs:{label:"活动名称:",prop:"name"}},[a("el-input",{staticClass:"pageWidth",attrs:{disabled:"",placeholder:"请输入活动名称"},model:{value:t.ruleForm.name,callback:function(e){t.$set(t.ruleForm,"name",e)},expression:"ruleForm.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"活动日期:",prop:"timeVal"}},[a("el-date-picker",{staticStyle:{width:"460px"},attrs:{disabled:"","value-format":"yyyy-MM-dd",align:"right","unlink-panels":"",format:"yyyy-MM-dd",size:"small",type:"daterange",placement:"bottom-end",placeholder:"自定义时间","picker-options":t.pickerOptions},on:{change:t.onchangeTime},model:{value:t.ruleForm.timeVal,callback:function(e){t.$set(t.ruleForm,"timeVal",e)},expression:"ruleForm.timeVal"}}),t._v(" "),a("p",{staticClass:"desc mt10"},[t._v("设置活动开始日期与结束日期,用户可以在有效时间内参与秒杀")])],1),t._v(" "),a("el-form-item",{attrs:{label:"秒杀场次:",prop:"seckill_time_ids"}},[a("el-select",{staticClass:"pageWidth disabled",attrs:{disabled:"",placeholder:"请选择秒杀场次",multiple:"",cearable:""},model:{value:t.ruleForm.seckill_time_ids,callback:function(e){t.$set(t.ruleForm,"seckill_time_ids",e)},expression:"ruleForm.seckill_time_ids"}},t._l(t.spikeTimeList,(function(t){return a("el-option",{key:t.seckill_time_id+"onl",attrs:{label:t.title+" | "+t.start_time+"-"+t.end_time,value:t.seckill_time_id.toString(),disabled:0===t.status}})})),1),t._v(" "),a("p",{staticClass:"desc mt10"},[t._v("\n 选择商品开始时间段,该时间段内用户可参与购买;其它时间段会显示活动未开始或已结束,可多选\n ")])],1),t._v(" "),a("el-form-item",{attrs:{label:"活动限购:"}},[a("el-input-number",{staticClass:"pageWidth",attrs:{disabled:"","controls-position":"right",min:0,max:99999},model:{value:t.ruleForm.all_pay_count,callback:function(e){t.$set(t.ruleForm,"all_pay_count",e)},expression:"ruleForm.all_pay_count"}}),t._v(" "),a("p",{staticClass:"desc mt10"},[t._v("\n 活动有效期内每个用户可购买该商品总数限制。例如设置为4表示本次活动有效期内每个用户最多可购买总数4个0和空为不限购\n ")])],1),t._v(" "),a("el-form-item",{attrs:{label:"单次限购:"}},[a("el-input-number",{staticClass:"pageWidth",attrs:{disabled:"","controls-position":"right",min:0,max:99999},model:{value:t.ruleForm.once_pay_count,callback:function(e){t.$set(t.ruleForm,"once_pay_count",e)},expression:"ruleForm.once_pay_count"}}),t._v(" "),a("p",{staticClass:"desc mt10"},[t._v("\n 用户参与秒杀时一次购买最大数量限制。例如设置为2表示参与秒杀时用户一次购买数量最大可选择2个0和空为不限购\n ")])],1),t._v(" "),t.ruleForm.product_category_ids&&t.ruleForm.product_category_ids.length>0?a("el-form-item",{attrs:{label:"商品范围:"}},[a("el-select",{staticClass:"pageWidth disabled",attrs:{disabled:"",multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"请选择商品分类"},model:{value:t.ruleForm.product_category_ids,callback:function(e){t.$set(t.ruleForm,"product_category_ids",e)},expression:"ruleForm.product_category_ids"}},t._l(t.categoryList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value.toString()}})})),1),t._v(" "),a("p",{staticClass:"desc mt10"},[t._v("设置秒杀活动可以参与的商品分类,可多选,不选为全品类商品。")])],1):t._e(),t._v(" "),t.ruleForm.border_pic?a("el-form-item",{attrs:{label:"活动边框图:"}},[a("div",{staticClass:"acea-row row-middle"},[a("div",{staticClass:"upLoadPicBox disabled"},[a("div",{staticClass:"pictrue"},[a("img",{attrs:{src:t.ruleForm.border_pic}})])]),t._v(" "),a("p",{staticClass:"desc ml10"},[t._v("宽750px高750px\n "),a("el-popover",{attrs:{placement:"bottom-start",title:"","min-width":"200",trigger:"hover"}},[a("img",{staticStyle:{height:"270px"},attrs:{src:t.baseURL+"/statics/system/activityBackground.png",alt:""}}),t._v(" "),a("el-button",{attrs:{slot:"reference",type:"text"},slot:"reference"},[t._v("查看示例")])],1)],1)]),t._v(" "),a("p",{staticClass:"desc mt10"},[t._v("展示在商品列表的活动边框图")])]):t._e(),t._v(" "),a("el-form-item",{attrs:{label:"是否开启:"}},[a("el-switch",{attrs:{disabled:"",width:56,"active-value":1,"inactive-value":0,"active-text":"开启","inactive-text":"关闭"},model:{value:t.ruleForm.status,callback:function(e){t.$set(t.ruleForm,"status",e)},expression:"ruleForm.status"}})],1)]:t._e(),t._v(" "),"second"==t.activeName&&t.isEdit?[t.isLook?t._e():a("div",{staticClass:"acea-row row-between-wrapper"},[a("div",{staticClass:"acea-row mb20"},[a("el-button",{staticClass:"mr14",attrs:{size:"small",type:"primary"},on:{click:function(e){return t.addGoods()}}},[t._v("添加商品")]),t._v(" "),a("el-dropdown",{staticClass:"dropdown mr14",class:{disabled:t.isShowCheck},attrs:{disabled:t.isShowCheck},on:{command:t.setPrice}},[a("span",{staticClass:"el-dropdown-link"},[t._v("\n 批量设置"),a("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),t._v(" "),t.isShowCheck?t._e():a("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[a("el-dropdown-item",{attrs:{command:"limit"}},[t._v("设置限量")]),t._v(" "),a("el-dropdown-item",{attrs:{command:"price"}},[t._v("设置价格")]),t._v(" "),a("el-dropdown-item",{attrs:{command:"open"}},[t._v("批量开启")]),t._v(" "),a("el-dropdown-item",{attrs:{command:"close"}},[t._v("批量关闭")])],1)],1),t._v(" "),a("el-button",{attrs:{size:"small",disabled:t.isShowCheck},on:{click:t.batchDel}},[t._v("批量删除")])],1)]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"tableList",attrs:{"row-key":"product_id",data:t.proData,size:"small","default-expand-all":"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[a("el-table-column",{key:"1",attrs:{"min-width":"30"}}),t._v(" "),t.isLook?t._e():a("el-table-column",{key:"2",attrs:{"min-width":"50"},scopedSlots:t._u([{key:"header",fn:function(e){return[a("el-checkbox",{attrs:{indeterminate:t.isIndeterminate},on:{change:t.handleCheckAllChange},model:{value:t.checkAll,callback:function(e){t.checkAll=e},expression:"checkAll"}})]}},{key:"default",fn:function(e){return[a("el-checkbox",{attrs:{value:e.row.checked},on:{change:function(a){return t.handleCheckOneChange(a,e.row)}}})]}}],null,!1,1890012580)}),t._v(" "),a("el-table-column",{key:"3",attrs:{prop:"product_id",label:"商品ID","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.sku?t._e():a("span",[t._v(t._s(e.row.product_id))])]}}],null,!1,1613001260)}),t._v(" "),a("el-table-column",{key:"4",attrs:{"min-width":"220",label:"商品信息"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"acea-row"},[a("div",{staticClass:"demo-image__preview mr10 line-heightOne"},[a("el-image",{attrs:{src:e.row.image,"preview-src-list":[e.row.image]}})],1),t._v(" "),a("div",{staticClass:"row_title line2"},[t._v(t._s(e.row.store_name))])])]}}],null,!1,2144815874)}),t._v(" "),a("el-table-column",{key:"5",attrs:{label:"商品分类","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.storeCategory?e.row.storeCategory.cate_name:"-"))])]}}],null,!1,1610769387)}),t._v(" "),a("el-table-column",{key:"7",attrs:{prop:"ot_price",label:"售价","min-width":"80"}}),t._v(" "),a("el-table-column",{key:"10",attrs:{prop:"price",label:"秒杀价","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.sku?[t.isLook?a("span",[t._v(t._s(e.row.price))]):a("el-input-number",{staticClass:"input_width",attrs:{type:"number",precision:2,min:.01,max:99999,controls:!1},model:{value:e.row.price,callback:function(a){t.$set(e.row,"price",a)},expression:"scope.row.price"}})]:void 0}}],null,!0)}),t._v(" "),a("el-table-column",{key:"8",attrs:{prop:"old_stock",label:"库存","min-width":"80"}}),t._v(" "),a("el-table-column",{key:"9",attrs:{label:"限量",prop:"stock","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.sku?[t.isLook?a("span",[t._v(t._s(e.row.stock))]):a("el-input-number",{staticClass:"input_width",attrs:{precision:0,min:0,max:e.row.old_stock,controls:!1},model:{value:e.row.stock,callback:function(a){t.$set(e.row,"stock",a)},expression:"scope.row.stock"}})]:void 0}}],null,!0)}),t._v(" "),t.isLook?t._e():a("el-table-column",{key:"11",attrs:{prop:"is_show",label:"是否开启","min-width":"90"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{width:56,"active-value":1,"inactive-value":0,"active-text":"开启","inactive-text":"关闭"},on:{change:function(a){return t.changeStatus(e.row)}},model:{value:e.row.is_show,callback:function(a){t.$set(e.row,"is_show",a)},expression:"scope.row.is_show"}})]}}],null,!1,1760173763)}),t._v(" "),a("el-table-column",{key:"12",attrs:{prop:"sort",label:"排序","min-width":"110"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.sku||""==e.row.sku?void 0:[t.isLook?a("span",[t._v(t._s(e.row.sort))]):a("el-input-number",{staticClass:"input_width",attrs:{type:"number",precision:0,min:0,max:99999,controls:!1},model:{value:e.row.sort,callback:function(a){t.$set(e.row,"sort",a)},expression:"scope.row.sort"}})]}}],null,!0)}),t._v(" "),t.isLook?t._e():a("el-table-column",{key:"13",attrs:{label:"操作","min-width":"60",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.sku||""==e.row.sku?t._e():a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.$index,e.row)}}},[t._v("删除")])]}}],null,!1,704783066)})],1)]:t._e(),t._v(" "),"third"==t.activeName?[a("el-form",{attrs:{size:"small",inline:""}},[a("el-form-item",{attrs:{label:"商品审核状态:",prop:"status"}},[a("el-select",{staticClass:"filter-item selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getJoinedList(1)}},model:{value:t.tableFrom.status,callback:function(e){t.$set(t.tableFrom,"status",e)},expression:"tableFrom.status"}},[a("el-option",{attrs:{label:"待审核",value:"0"}}),t._v(" "),a("el-option",{attrs:{label:"审核通过",value:"1"}}),t._v(" "),a("el-option",{attrs:{label:"审核失败",value:"-1"}})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"商品搜索:"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入商品名称或ID",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getJoinedList(1)}},model:{value:t.tableFrom.keyword,callback:function(e){t.$set(t.tableFrom,"keyword",e)},expression:"tableFrom.keyword"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.getJoinedList(1)}}},[t._v("搜索")])],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.selectedLoading,expression:"selectedLoading"}],ref:"selectedData",attrs:{"row-key":"product_id",data:t.tableData.data,size:"small","default-expand-all":t.isExpand,"tree-props":{children:"children",hasChildren:"hasChildren"}}},[a("el-table-column",{key:"14",attrs:{prop:"product_id",label:"商品ID","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.sku?t._e():a("span",[t._v(t._s(e.row.product_id))])]}}],null,!1,1613001260)}),t._v(" "),a("el-table-column",{key:"15",attrs:{"min-width":"220",label:"商品信息"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"acea-row"},[a("div",{staticClass:"demo-image__preview mr10 line-heightOne"},[a("el-image",{attrs:{src:e.row.image,"preview-src-list":[e.row.image]}})],1),t._v(" "),a("div",{staticClass:"row_title line2"},[t._v(t._s(e.row.store_name))])])]}}],null,!1,2144815874)}),t._v(" "),a("el-table-column",{key:"16",attrs:{label:"商品分类","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.storeCategory?e.row.storeCategory.cate_name:"-"))])]}}],null,!1,1610769387)}),t._v(" "),a("el-table-column",{key:"18",attrs:{prop:"ot_price",label:"售价","min-width":"80"}}),t._v(" "),a("el-table-column",{key:"21",attrs:{prop:"price",label:"秒杀价","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.sku?[a("span",[t._v(t._s(e.row.price))])]:void 0}}],null,!0)}),t._v(" "),a("el-table-column",{key:"19",attrs:{prop:"old_stock",label:"库存","min-width":"80"}}),t._v(" "),a("el-table-column",{key:"20",attrs:{label:"限量",prop:"stock","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.sku?[a("span",[t._v(t._s(e.row.stock))])]:void 0}}],null,!0)}),t._v(" "),a("el-table-column",{key:"22",attrs:{prop:"sort",label:"排序","min-width":"110"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.sku||""==e.row.sku?void 0:[a("span",[t._v(t._s(e.row.sort))])]}}],null,!0)})],1),t._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"total, prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}})],1)]:t._e()],2)])],1),t._v(" "),t.isLook?t._e():a("el-card",{staticClass:"fixed-card box-card",attrs:{"dis-hover":"",bordered:!1,shadow:"never"}},[a("div",{staticClass:"acea-row row-center-wrapper"},[a("el-button",{directives:[{name:"show",rawName:"v-show",value:"second"==t.activeName,expression:"activeName == 'second'"}],attrs:{size:"small",type:"primary"},on:{click:function(e){t.activeName="first"}}},[t._v("上一步")]),t._v(" "),a("el-button",{directives:[{name:"show",rawName:"v-show",value:"first"==t.activeName,expression:"activeName == 'first'"}],attrs:{size:"small",type:"primary"},on:{click:function(e){t.activeName="second"}}},[t._v("下一步")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.submitForm("ruleForm")}}},[t._v("保存")])],1)])],1),t._v(" "),a("activity",{key:"keyNum",ref:"activityModal",on:{onChange:t.setActivity}}),t._v(" "),a("goodsList",{ref:"goodsList",attrs:{pid:t.ruleForm.product_category_ids,proData:t.proData,activeId:t.active_id},on:{onSelectList:t.selectList}})],1)},s=[],l=a("db72"),r=(a("55dd"),a("20d6"),a("7f7f"),a("ac6a"),a("b7be")),o=a("c4c8"),n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.dialogVisible?a("el-dialog",{attrs:{title:"商品信息",visible:t.dialogVisible,width:"1100px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("div",{staticClass:"divBox"},[a("div",{staticClass:"header clearfix"},[a("div",{staticClass:"container mt14"},[a("el-form",{attrs:{size:"small",inline:"","label-width":"80px"}},[a("el-form-item",{attrs:{label:"商品搜索:"}},[a("el-input",{staticClass:"selWidth",attrs:{placeholder:"请输入商品关键字",clearable:""},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.getList(1)}},model:{value:t.tableFrom.keyword,callback:function(e){t.$set(t.tableFrom,"keyword",e)},expression:"tableFrom.keyword"}},[a("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(e){return t.getList(1)}},slot:"append"})],1)],1),t._v(" "),a("el-form-item",{attrs:{label:"平台分类:"}},[a("el-select",{staticClass:"selWidth",attrs:{filterable:"",clearable:"","default-first-option":"",placeholder:"请选择平台商品分类"},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.cate_ids,callback:function(e){t.$set(t.tableFrom,"cate_ids",e)},expression:"tableFrom.cate_ids"}},t._l(t.sysCateList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value,disabled:t.pid&&t.pid.length>0&&-1==t.pid.indexOf(e.value.toString())},on:{change:function(e){return t.getList(1)}}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"商户分类:"}},[a("el-select",{staticClass:"selWidth",attrs:{filterable:"",clearable:"","default-first-option":"",placeholder:"请选择商户商品分类"},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.category_id,callback:function(e){t.$set(t.tableFrom,"category_id",e)},expression:"tableFrom.category_id"}},t._l(t.merCateList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"商品标签:"}},[a("el-select",{staticClass:"filter-item selWidth",attrs:{placeholder:"请选择",clearable:"",filterable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.sys_labels,callback:function(e){t.$set(t.tableFrom,"sys_labels",e)},expression:"tableFrom.sys_labels"}},t._l(t.merProductLabelList,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"商品状态:",prop:"us_status"}},[a("el-select",{staticClass:"filter-item selWidth",attrs:{placeholder:"请选择",clearable:""},on:{change:function(e){return t.getList(1)}},model:{value:t.tableFrom.us_status,callback:function(e){t.$set(t.tableFrom,"us_status",e)},expression:"tableFrom.us_status"}},t._l(t.productStatusList,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1)],1)]),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"mainTable",attrs:{data:t.tableData.data,size:"small","max-height":"400"}},[a("el-table-column",{attrs:{width:"55"},scopedSlots:t._u([{key:"header",fn:function(e){return[a("el-checkbox",{attrs:{slot:"reference",value:t.isChecked&&t.checkedPage.indexOf(t.tableFrom.page)>-1},on:{change:t.changeType},slot:"reference"})]}},{key:"default",fn:function(e){return[a("el-checkbox",{attrs:{value:t.checkedIds.indexOf(e.row.product_id)>-1},on:{change:function(a){return t.changeOne(a,e.row)}}})]}}],null,!1,594851932)}),t._v(" "),a("el-table-column",{attrs:{label:"ID",prop:"product_id",width:"55"}}),t._v(" "),a("el-table-column",{attrs:{label:"商品图","min-width":"80"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("div",{staticClass:"demo-image__preview"},[a("el-image",{staticStyle:{width:"36px",height:"36px"},attrs:{src:t.row.image,"preview-src-list":[t.row.image]}})],1)]}}],null,!1,2331550732)}),t._v(" "),a("el-table-column",{attrs:{label:"商品名称","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"row_title line2"},[t._v(t._s(e.row.store_name))])]}}],null,!1,2346630169)}),t._v(" "),a("el-table-column",{attrs:{label:"商品分类","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.storeCategory?e.row.storeCategory.cate_name:"-"))])]}}],null,!1,1610769387)}),t._v(" "),a("el-table-column",{attrs:{prop:"old_stock",label:"库存","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{label:"商品状态","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(0==e.row.is_show?"下架":"上架"))])]}}],null,!1,3823054164)})],1),t._v(" "),a("div",{staticClass:"acea-row row-between row-bottom"},[a("el-pagination",{attrs:{"page-size":t.tableFrom.limit,"current-page":t.tableFrom.page,layout:"prev, pager, next, jumper",total:t.tableData.total},on:{"size-change":t.handleSizeChange,"current-change":t.pageChange}}),t._v(" "),a("div",[a("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.submitProduct}},[t._v("确定")])],1)],1)],1)]):t._e()},c=[],d=(a("6b54"),a("178b")),u=a("3953"),p=a("e630"),m=a("1df6");function h(t){return Object(d["a"])(t)||Object(u["a"])(t)||Object(p["a"])(t)||Object(m["a"])()}var _=a("2f62"),f=a("83d6"),v={name:"GoodsList",props:{pid:{type:Array,default:function(){return[]}},proData:{type:Array,default:function(){return[]}}},data:function(){return{dialogVisible:!1,roterPre:f["roterPre"],listLoading:!0,productStatusList:[{label:"上架",value:1},{label:"下架",value:0}],tableData:{data:[],total:0},cate_ids:"",tableFrom:{page:1,limit:5,cate_ids:"",keyword:"",category_id:"",us_status:"",sys_labels:[],type_id:"",active_id:this.$route.params.id},mer_ids:[],props:{emitPath:!1},multipleSelection:[],checked:[],selectAllPage:!1,checkedPage:[],checkBox:[],isChecked:!1,checkedIds:[]}},computed:Object(l["a"])({},Object(_["b"])(["merCateList","merProductLabelList","sysCateList"])),mounted:function(){this.merCateList.length||this.$store.dispatch("product/getMerCateSelect"),this.sysCateList.length||this.$store.dispatch("product/getSysCategoryList",{lv:1}),this.merProductLabelList.length||this.$store.dispatch("product/getProductLabel")},methods:{setCheckedProduct:function(t){if(t.length){var e=h(t),a=e.slice(0);this.checkBox=a,this.checkedIds=a.map((function(t){return t.old_product_id}))}else this.checkedIds=[]},getList:function(t){var e=this;this.listLoading=!0,this.tableFrom.page=t||this.tableFrom.page,this.tableFrom.level_one_cate_ids=this.pid.length&&this.pid.toString()||"",Object(r["S"])(this.tableFrom).then((function(t){e.tableData.data=t.data.list,e.tableData.total=t.data.count,e.listLoading=!1})).catch((function(t){e.listLoading=!1,e.$message.error(t.message)}))},changeType:function(t){this.isChecked=t;var e=this.checkedPage.indexOf(this.tableFrom.page);this.isIndex=e,this.checkedPage.push(this.tableFrom.page),e>-1&&this.checkedPage.splice(e,1),this.syncCheckedId(t)},changeOne:function(t,e){if(t){var a=this.checkedIds.indexOf(e.product_id);-1===a&&(this.checkedIds.push(e.product_id),this.checkBox.push(e))}else{var i=this.checkedIds.indexOf(e.product_id);i>-1&&(this.checkedIds.splice(i,1),this.checkBox.splice(i,1))}},syncCheckedId:function(t){var e=this;this.tableData.data.map((function(t){return t.product_id}));t?this.tableData.data.forEach((function(t){var a=e.checkedIds.indexOf(t.product_id);-1===a&&(e.checkedIds.push(t.product_id),e.checkBox.push(t))})):this.tableData.data.forEach((function(t){var a=e.checkedIds.indexOf(t.product_id);a>-1&&(e.checkedIds.splice(a,1),e.checkBox.splice(a,1))}))},handleSelectionChange:function(t){var e=[];t.map((function(t){e.push({src:t.image,product_id:t.product_id})})),this.multipleSelection=e},submitProduct:function(){if(this.checkBox.length>100)return this.$message.warning("最多可选择100个商品");this.dialogVisible=!1,this.$emit("onSelectList",this.checkBox)},pageChange:function(t){this.tableFrom.page=t,this.getList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getList("")}}},b=v,k=(a("ab53"),a("2877")),g=Object(k["a"])(b,n,c,!1,null,"32dc88ea",null),y=g.exports,w=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{"before-close":t.onClose,title:"批量设置",visible:t.showStatus,width:"620px"},on:{"update:visible":function(e){t.showStatus=e}}},[a("el-form",{ref:"form",attrs:{size:"small",model:t.form,"label-width":"80px"}},["limit"==t.type?a("el-form-item",{attrs:{label:"限量:"}},[a("el-radio-group",{model:{value:t.form.limit_type,callback:function(e){t.$set(t.form,"limit_type",e)},expression:"form.limit_type"}},[a("el-radio",{attrs:{label:"0"}},[t._v("增加")]),t._v(" "),a("el-radio",{attrs:{label:"1"}},[t._v("减少")]),t._v(" "),a("el-radio",{attrs:{label:"2"}},[t._v("固定数量")])],1)],1):t._e(),t._v(" "),"limit"==t.type?a("el-form-item",[a("el-input-number",{staticClass:"pageWidth",attrs:{step:1,"step-strictly":"",type:"number","controls-position":"right",min:1,max:99999},model:{value:t.form.activity_stock,callback:function(e){t.$set(t.form,"activity_stock",e)},expression:"form.activity_stock"}})],1):t._e(),t._v(" "),"price"==t.type?a("el-form-item",{attrs:{label:"秒杀价:"}},[a("el-radio-group",{model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},[a("el-radio",{attrs:{label:"0"}},[t._v("增加")]),t._v(" "),a("el-radio",{attrs:{label:"1"}},[t._v("减少")]),t._v(" "),a("el-radio",{attrs:{label:"2"}},[t._v("折扣(%)")]),t._v(" "),a("el-radio",{attrs:{label:"3"}},[t._v("固定价格")])],1)],1):t._e(),t._v(" "),"price"==t.type?a("el-form-item",[a("el-input-number",{staticClass:"pageWidth",attrs:{type:"number",precision:2,min:0,max:99999,"controls-position":"right"},model:{value:t.form.price,callback:function(e){t.$set(t.form,"price",e)},expression:"form.price"}}),t._v("  "+t._s(2==t.form.type?"%":"元")+"\n "),a("p",{staticStyle:{color:"#F56464","font-size":"13px"}},[t._v("注:批量设置价格为敏感操作,请谨慎操作!")])],1):t._e(),t._v(" "),a("el-form-item",{attrs:{label:"是否开启:"}},[a("el-switch",{attrs:{width:55,"active-value":1,"inactive-value":0,"active-text":"开启","inactive-text":"关闭"},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:t.onClose}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.confirmSet}},[t._v("确 定")])],1)],1)},C=[],x=a("bd86"),$={name:"",data:function(){return{type:"limit",showStatus:!1,form:Object(x["a"])({type:"0",limit_type:"0",status:1,price:"",discount:"",activity_stock:""},"status",1)}},methods:{showModal:function(t){this.type=t,this.showStatus=!0},onClose:function(){this.showStatus=!1,setTimeout((function(){that.form={limit_type:"0",type:"0",status:1,price:"",discount:"",activity_stock:""}}),500)},confirmSet:function(){this.$emit("onChange",this.form,this.type),this.onClose()}}},L=$,F=Object(k["a"])(L,w,C,!1,null,"77b0656e",null),S=F.exports,D=a("61f7"),O=a("bbcc"),I={name:"StoreCreatSeckill",components:{activity:S,goodsList:y},data:function(){return{pageType:"",roterPre:f["roterPre"],baseURL:O["a"].httpUrl||"http://localhost:8080",activeName:"first",props:{multiple:!0,emitPath:!0},ruleForm:{seckill_time_ids:[],start_day:"",end_day:"",once_pay_count:"",all_pay_count:"",name:"",product_category_ids:[],product_list:[],timeVal:[],proCategorylist:[],atmosphere_pic:"",border_pic:""},rules:{name:[{required:!0,message:"请输入活动名称",trigger:"blur"}],seckill_time_ids:[{required:!0,message:"请选择秒杀场次",trigger:"change"}],timeVal:[{required:!0,message:"请选择活动日期"}],timeVal2:[{type:"array",required:!0,message:"请选择秒杀场次",trigger:"change"}],merStars:[{required:!0,message:"请选择商户星级",trigger:"change"}]},pickerOptions:{disabledDate:function(t){return t.getTime()<Date.now()-864e5}},categoryList:[],spikeTimeList:[],multipleSelection:[],activityType:null,proData:[],spu_ids:[],tableData:{data:[],total:0},tableFrom:{page:1,limit:5,status:"",keyword:""},listLoading:!1,checkAll:!0,isIndeterminate:!0,tempRoute:{},isShowCheck:!1,keyNum:0,loading:!1,selectedLoading:!1,isExpand:!1,active_id:""}},created:function(){},watch:{"$route.params.id":{handler:function(t,e){t!==e&&this.getInfo()},immediate:!1,deep:!0}},mounted:function(){this.getSeckillIntervalList(),this.$route.params.id&&this.getInfo(),this.getCategoryList(),this.isCkecked()},computed:{isEdit:function(){return!("edit"!=this.$route.params.type||!this.$route.params.id)},isLook:function(){return!("look"!=this.$route.params.type||!this.$route.params.id)},title:function(){return"look"==this.$route.params.type&&this.$route.params.id?"查看":"添加"}},methods:{getCategoryList:function(){var t=this;Object(o["t"])({type:0,lv:0}).then((function(e){t.categoryList=e.data})).catch((function(e){t.$message.error(e.message)}))},changeStatus:function(t){if(t.children&&t.children.length>0)t.children.forEach((function(e){e.is_show=t.is_show}));else{var e=this.findFirstIndex(this.proData,t);-1!=e&&this.proData[e]["children"]&&this.proData[e]["children"].length>0&&(this.proData[e]["children"].every((function(t){return 0==t.is_show}))?this.proData[e]["is_show"]=0:(this.proData[e]["children"].every((function(t){return 1==t.is_show}))||this.proData[e]["children"].some((function(t){return 1===t.is_show})))&&(this.proData[e]["is_show"]=1))}},findFirstIndex:function(t,e){for(var a=0;a<t.length;a++)if(t[a].product_id===e.id)return a;return-1},isCkecked:function(){var t=this.proData.filter((function(t){return t.checked}));t.length?this.isShowCheck=!1:this.isShowCheck=!0},handleCheckAllChange:function(t){var e=this;this.isIndeterminate=!this.isIndeterminate,this.proData.forEach((function(a){e.$set(a,"checked",t),a.children.forEach((function(a){e.$set(a,"checked",t)}))})),this.isCkecked()},handleCheckOneChange:function(t,e){var a=this,i=this.proData.length,s=0;this.$set(e,"checked",t),e.children&&e.children.length&&e.children.forEach((function(e){a.$set(e,"checked",t)})),this.proData.forEach((function(e){e.checked===t&&s++})),this.checkAll=i===s?t:!t,this.isIndeterminate=s>0&&s<i,this.isCkecked()},getInfo:function(){var t=this;this.loading=!0,Object(r["cb"])(this.$route.params.id).then((function(e){t.active_id=e.data.seckill_active_id;var a=e.data;t.ruleForm={all_pay_count:a.all_pay_count,end_day:a.end_day,name:a.name,once_pay_count:a.once_pay_count,start_day:a.start_day,seckill_time_ids:a.seckill_time_ids,product_category_ids:a.product_category_ids||[],timeVal:[a.start_day,a.end_day],status:a.status,atmosphere_pic:a.atmosphere_pic,border_pic:a.border_pic},t.tableFrom.seckill_active_id=e.data.seckill_active_id,t.getJoinedList(),t.isEdit||t.getProductList(e.data.seckill_active_id),t.loading=!1})).catch((function(e){t.loading=!1}))},getProductList:function(){var t=this;this.listLoading=!0,Object(r["T"])({seckill_active_id:id}).then((function(e){t.proData=e.data.list,t.getAttrValue(t.proData,!0),t.listLoading=!1})).catch((function(e){t.listLoading=!1}))},getJoinedList:function(t){var e=this;this.tableFrom.page=t||this.tableFrom.page,this.selectedLoading=!0,Object(r["lb"])(this.tableFrom).then((function(t){e.tableData.data=t.data.list,e.tableData.total=t.data.count,e.getAttrValue(e.tableData.data,!1),e.selectedLoading=!1})).catch((function(t){e.selectedLoading=!1}))},pageChange:function(t){this.tableFrom.page=t,this.getJoinedList("")},handleSizeChange:function(t){this.tableFrom.limit=t,this.getJoinedList("")},back:function(){this.$router.push({path:"/marketing/seckill/store_seckill/list"})},handleDelete:function(t,e){var a=this;this.$modalSure("删除该秒杀商品吗?").then((function(){var t=a.proData.findIndex((function(t){return t==e}));a.proData.splice(t,1)}))},setActivity:function(t,e){var a=this;this.proData.forEach((function(i){i.children.forEach((function(s){i.checked&&s.checked&&("limit"==e?0==t.limit_type?a.$set(s,"stock",s.stock+t.activity_stock):1==t.limit_type?a.$set(s,"stock",s.stock-t.activity_stock>0?s.stock-t.activity_stock:0):2==t.limit_type&&a.$set(s,"stock",t.activity_stock):"price"==e?0==t.type?a.$set(s,"price",s.price+t.price):1==t.type?a.$set(s,"price",s.price-t.price>0?s.price-t.price:.01):2==t.type?a.$set(s,"price",s.price*t.price/100):3==t.type&&a.$set(s,"price",t.price):("0"==e?a.$set(s,"is_show",0):"1"==e&&(a.$set(i,"is_show",1),a.$set(s,"is_show",1)),i["children"].every((function(t){return 0==t.is_show}))?a.$set(i,"is_show",0):(i["children"].every((function(t){return 1==t.is_show}))||i["children"].some((function(t){return 1===t.is_show})))&&a.$set(i,"is_show",1)))}))}))},getSeckillIntervalList:function(){var t=this;Object(r["gb"])({active_id:this.ruleForm.seckill_active_id}).then((function(e){t.spikeTimeList=e.data}))},addGoods:function(){this.$refs.goodsList.dialogVisible=!0,this.$refs.goodsList.getList(""),this.$refs.goodsList.setCheckedProduct(this.proData)},selectList:function(t){this.getAttrValue(t,!0),this.isCkecked()},getAttrValue:function(t,e){var a=this;t.map((function(t){a.$set(t,"sort",t.sort?t.sort:0),a.$set(t,"is_show",1),a.$set(t,"checked",!0),a.$set(t,"is_show",1),t.attrValue.map((function(t){a.$set(t,"checked",!0),a.$set(t,"store_name",t.sku||"默认"),a.$set(t,"sku",t.sku||"默认"),a.$set(t,"is_show",1),a.$set(t,"stock",t.stock?t.stock:0),a.$set(t,"old_stock",t.old_stock?t.old_stock:0),a.$set(t,"price",t.price?t.price:0),a.$set(t,"id",t.product_id?t.product_id:0),a.$set(t,"product_id",t.value_id?t.value_id:0)})),a.$set(t,"children",t.attrValue)})),e?(a.proData=t,a.isCkecked()):a.tableData.data=t},batchDel:function(){var t=this;this.$modalSure("批量删除商品吗?").then((function(){t.proData=t.proData.filter((function(t){return!t.checked}))}))},setPrice:function(t){var e=this;this.keyNum=Math.random(),"limit"==t||"price"==t?this.$refs.activityModal.showModal(t):"open"==t?this.$modalSure("确定批量开启秒杀商品").then((function(){e.setActivity(null,"1")})):this.$modalSure("确定批量关闭秒杀商品").then((function(){e.setActivity(null,"0")}))},onchangeTime:function(t){this.ruleForm.timeVal=t,this.ruleForm.start_day=t?t[0]:"",this.ruleForm.end_day=t?t[1]:""},filterIsShowOne:function(t){return t.map((function(t){if(t.attrValue&&t.attrValue.length>0){var e=t.attrValue.filter((function(t){return 1==t.is_show}));return Object(l["a"])(Object(l["a"])({},t),{},{attrValue:e})}return t}))},submitForm:Object(D["a"])((function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return!1;var a=[];if(e.proData.length>0){var i=0,s=0;e.proData.map((function(t){t.children.map((function(t){i+=t.stock,s+=t.price}))}));var l=e.proData.filter((function(t){return 1===t.is_show}));if(a=e.filterIsShowOne(l),!i&&0!==i&&e.ruleForm.product_list.length>0)return e.$message.warning("商品限量不能为空");if(!s&&e.ruleForm.product_list.length>0)return e.$message.warning("商品秒杀价格不能为空");if(i<e.proData.length&&e.ruleForm.product_list.length>0)return e.$message.warning("商品限量总和不能小于0")}var o={active_id:e.active_id,product_list:a};Object(r["a"])(o).then((function(t){e.$message.success(t.message),e.$router.push({path:"".concat(e.roterPre,"/marketing/seckill/store_seckill/list")})})).catch((function(t){e.$message.error(t.message)}))}))}))}},z=I,P=(a("2661"),Object(k["a"])(z,i,s,!1,null,"d8845f3a",null));e["default"]=P.exports}}]);