1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-02a01fc8"],{"04e1":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"goodclassedit"},[a("el-dialog",{attrs:{title:e.title,visible:e.dialogFormVisible,width:"800px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.close}},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"分类排序"}},[a("el-input",{attrs:{type:"number",placeholder:"请输入分类排序"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),a("el-form-item",{attrs:{label:"分类名称",prop:"name",required:!0}},[a("el-input",{attrs:{placeholder:"请输入分类名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"分类图标"}},[e.form.icon?a("div",{staticClass:"uploadSource bor_de rel flex"},[a("label",{staticClass:"statusLabel curs",on:{mouseenter:function(t){return e.enter(1)},mouseleave:function(t){return e.leave(1)}}},[a("i",{ref:"imgicon1",staticClass:"el-icon-check"}),a("i",{staticClass:"el-icon-close",on:{click:function(t){return e.deleteMultiImage(e.form.icon,1)}}})]),a("img",{staticClass:"wid",attrs:{src:e.form.icon},on:{click:function(t){return e.test(1)}}})]):a("div",{staticClass:"uploadSource flex-center curs",on:{click:function(t){return e.test(1)}}},[a("i",{staticClass:"el-icon-plus fon_40 color_d9"})]),a("attachment-img",{ref:"img1",attrs:{type:"img"},on:{attachment:e.imgadd1}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"medium"},on:{click:e.close}},[e._v("取 消")]),a("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.save}},[e._v("确 定")])],1)],1)],1)},r=[],i=(a("c975"),a("a434"),a("96cf"),a("1da1")),s=a("fc6e"),o=a("5a4a"),c={name:"goodlistedit",components:{attachmentImg:s["a"]},created:function(){},data:function(){return{form:{id:"",pid:"",sort:"1",name:"",describe:"",icon:""},title:"",dialogFormVisible:!1,type:""}},methods:{showEdit:function(e){this.title="编辑",this.form=Object.assign({},e),this.form.type=this.type,this.dialogFormVisible=!0},enter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="none"},leave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="inline-block"},test:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;console.log(this.$refs,e),this.$refs["img"+e].dialogVisible=!0},imgadd1:function(e){this.form.icon=e.str},deleteMultiImage:function(e,t,a){if(Array.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.splice(t,1)},!a)switch(t){case 1:this.form.icon="";break}},close:function(){this.$refs["form"].resetFields(),this.form=this.$options.data().form,this.dialogFormVisible=!1},setStoreId:function(e){this.form.storeId=e},setInType:function(e){this.form.type=e,this.type=e},save:function(){var e=this;this.$refs["form"].validate(function(){var t=Object(i["a"])(regeneratorRuntime.mark((function t(a){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=10;break}return t.next=3,Object(o["V"])(e.form);case 3:n=t.sent,r=n.msg,e.$baseMessage(r,"success"),e.$emit("fetchData"),e.close(),t.next=11;break;case 10:return t.abrupt("return",!1);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},l=c,u=a("2877"),d=Object(u["a"])(l,n,r,!1,null,null,null);t["a"]=d.exports},"2e1f":function(e,t,a){"use strict";var n=a("ca0b"),r=a.n(n);r.a},"8afc":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"outmain ba_f"},[e._m(0),a("el-tabs",{on:{"tab-click":e.handleTabClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"普通分类",name:"1"}}),a("el-tab-pane",{attrs:{label:"特色分类",name:"2"}})],1),"1"==e.activeName?a("div",{staticClass:"mar_t20"},[a("el-button",{attrs:{type:"primary",size:"medium"},on:{click:e.handleEdit}},[e._v("新增分类")]),a("el-button",{attrs:{size:"medium"},on:{click:e.handleDelete}},[e._v("批量删除")])],1):e._e(),"1"==e.activeName?a("div",{staticClass:"tabledata mar_t20 goodclass"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,"element-loading-text":e.elementLoadingText,stripe:"","row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},on:{"selection-change":e.setSelectRows}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"sort",label:"排序",width:"150"}}),a("el-table-column",{attrs:{prop:"name",label:"分类名称",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"bixuan"},[e._v(" "+e._s(t.row.name)+" "),a("el-tag",{directives:[{name:"show",rawName:"v-show",value:t.row.isRequire&&"1"==t.row.isRequire,expression:"scope.row.isRequire && scope.row.isRequire=='1'"}],attrs:{size:"medium",type:"danger"}},[e._v("必选分类")]),a("div",{staticClass:"color_9 fon_12"},[e._v("分类ID: "+e._s(t.row.id))])],1)]}}],null,!1,1451989415)}),a("el-table-column",{attrs:{prop:"icon",label:"分类图标"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex flex-y-top"},[a("img",{staticClass:"goodlogo bor_rad5",attrs:{src:e.row.icon}})])]}}],null,!1,733310097)}),a("el-table-column",{attrs:{prop:"shijianduan",label:"分类时间段",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return["1"==t.row.timeType?a("div",[e._v("不限制")]):a("div",[t.row.startTime?a("div",[e._v(e._s(t.row.startTime)+"-"+e._s(t.row.endTime))]):e._e(),a("div",[e._v(e._s(t.row.weekStr&&t.row.weekStr.map((function(e){return e})).join()))])])]}}],null,!1,359556310)}),a("el-table-column",{attrs:{prop:"spfl",label:"启用状态",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(a){return e.changeSwitch(t.row)}},model:{value:t.row.display,callback:function(a){e.$set(t.row,"display",a)},expression:"scope.row.display"}})]}}],null,!1,1591604254)}),a("el-table-column",{attrs:{prop:"kc",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[0==t.row.pid?a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit2(t.row.id)}}},[e._v("新增二级分类 ")]):e._e(),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit(t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])],1)]}}],null,!1,3844959162)})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page.total,"page-size":e.page.pagesize,"current-page":e.page.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page,"currentPage",t)},"current-change":e.handleCurrentChange}}),a("edit",{ref:"edit",on:{fetchData:e.fetchData}})],1):e._e(),"2"==e.activeName?a("div",{staticClass:"tabledata mar_t20 goodclass"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading2,expression:"listLoading2"}],staticStyle:{width:"100%"},attrs:{data:e.list2,"element-loading-text":e.elementLoadingText2,stripe:"","row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}},on:{"selection-change":e.setSelectRows2}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"sort",label:"排序",width:"150"}}),a("el-table-column",{attrs:{prop:"name",label:"分类名称",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"bixuan"},[e._v(" "+e._s(t.row.name)+" "),a("div",{staticClass:"color_9 fon_12"},[e._v("默认文字: "+e._s(t.row.customName))])])]}}],null,!1,2665754451)}),a("el-table-column",{attrs:{prop:"icon",label:"分类图标"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("div",{staticClass:"flex flex-y-top"},[a("img",{staticClass:"goodlogo bor_rad5",attrs:{src:e.row.icon}})])]}}],null,!1,733310097)}),a("el-table-column",{attrs:{prop:"spfl",label:"启用状态",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:function(a){return e.changeSwitch2(t.row)}},model:{value:t.row.display,callback:function(a){e.$set(t.row,"display",a)},expression:"scope.row.display"}})]}}],null,!1,1666075980)}),a("el-table-column",{attrs:{prop:"kc",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"flex"},[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleEdit3(t.row)}}},[e._v("编辑")])],1)]}}],null,!1,3195855603)})],1),a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.page2.total,"page-size":e.page2.pagesize,"current-page":e.page2.currentPage},on:{"update:currentPage":function(t){return e.$set(e.page2,"currentPage",t)},"update:current-page":function(t){return e.$set(e.page2,"currentPage",t)},"current-change":e.handleCurrentChange2}}),a("edit",{ref:"edit",on:{fetchData:e.fetchData}}),a("edit2",{ref:"edit2",on:{fetchData:e.fetchData2}})],1):e._e()],1)},r=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("商品分类")])])])}],i=(a("d81d"),a("96cf"),a("1da1")),s=a("1fc3"),o=a("04e1"),c=a("5a4a"),l=(a("aa47"),{components:{Edit:s["a"],Edit2:o["a"]},created:function(){this.fetchData()},data:function(){return{activeName:"1",list:[],listLoading:!0,selectRows:"",elementLoadingText:"正在加载...",page:{total:0,size:10,currentPage:1},list2:[],listLoading2:!0,selectRows2:"",elementLoadingText2:"正在加载...",page2:{total:0,size:10,currentPage:1},isInStore:""}},methods:{handleTabClick:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:"1"==e.activeName&&e.fetchData(),"2"==e.activeName&&e.fetchData2();case 2:case"end":return t.stop()}}),t)})))()},fetchData:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var a,n,r,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading=!0,t.next=3,Object(c["f"])({page:e.page.currentPage});case 3:a=t.sent,n=a.data,r=a.count,i=a.isInStore,e.list=n,e.page.total=r,e.isInStore=i,setTimeout((function(){e.listLoading=!1}),300);case 11:case"end":return t.stop()}}),t)})))()},fetchData2:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var a,n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.listLoading2=!0,t.next=3,Object(c["Y"])({page:e.page2.currentPage,item:12});case 3:a=t.sent,n=a.data,r=a.count,e.list2=n,e.page2.total=r,setTimeout((function(){e.listLoading2=!1}),300);case 9:case"end":return t.stop()}}),t)})))()},handleDelete:function(e){var t=this;if(e.id)this.$baseConfirm("你确定要删除当前项吗",null,Object(i["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(c["e"])({id:e.id});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)}))));else{if(!(this.selectRows.length>0))return this.$baseMessage("未选中任何行","error"),!1;var a=this.selectRows.map((function(e){return e.id}));this.$baseConfirm("你确定要删除选中项吗",null,Object(i["a"])(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["e"])({id:a});case 2:n=e.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return e.stop()}}),e)}))))}},synchroGoods:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:e.id&&t.$baseConfirm("您确定要将此商品分类以及此分类下面的商品全部复制到店内商品吗",null,Object(i["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(c["bb"])({typeId:e.id});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)}))));case 1:case"end":return a.stop()}}),a)})))()},handleEdit:function(e){e.id?this.$refs["edit"].showEdit(e):this.$refs["edit"].showEdit()},handleEdit3:function(e){e.id&&this.$refs["edit2"].showEdit(e)},handleEdit2:function(e){this.$refs["edit"].showEdit2(e)},setSelectRows:function(e){this.selectRows=e},handleCurrentChange:function(e){this.page.currentPage=e,this.fetchData()},handleCurrentChange2:function(e){this.page2.currentPage=e,this.fetchData2()},setSelectRows2:function(e){this.selectRows2=e},changeSwitch:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(c["i"])({id:e.id,display:e.display});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData();case 6:case"end":return a.stop()}}),a)})))()},changeSwitch2:function(e){var t=this;return Object(i["a"])(regeneratorRuntime.mark((function a(){var n,r;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(c["Q"])({id:e.id,display:e.display});case 2:n=a.sent,r=n.msg,t.$baseMessage(r,"success"),t.fetchData2();case 6:case"end":return a.stop()}}),a)})))()}}}),u=l,d=(a("2e1f"),a("2877")),f=Object(d["a"])(u,n,r,!1,null,null,null);t["default"]=f.exports},ca0b:function(e,t,a){}}]); |