chunk-323d613c.865fd869.js 9.4 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-323d613c"],{"006b":function(t,e,a){},"0b01":function(t,e,a){"use strict";var r=a("006b");a.n(r).a},"411d":function(t,e,a){"use strict";a.r(e);var r=a("5d4b"),n=a("2f62"),o=a("c4c8");function i(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function s(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var l={name:"index",components:{menusFrom:r.a},data:function(){return{grid:{xl:12,lg:12,md:12,sm:24,xs:24},grids:{xl:10,lg:10,md:12,sm:24,xs:24},brandData:{keyword:""},loading:!1,tableData:[],formValidate:{},titleFrom:""}},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?i(a,!0).forEach((function(e){s(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):i(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(n.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.getData()},methods:{search:function(){this.getData()},getData:function(){var t=this;this.loading=!0,Object(o.D)({brand_name:this.brandData.keyword}).then((function(e){t.loading=!1,t.tableData=e.data.list}))},loadChildrenMethod:function(t){var e=this,a=t.row;return new Promise((function(t,r){Object(o.D)({brand_name:e.brandData.keyword,pid:a.id}).then((function(e){var a=e.data.list;t(a)}))}))},menusAdd:function(){this.$refs.menusFrom.modals=!0,this.$refs.menusFrom.titleFrom="添加品牌分类",this.formValidate={sort:0},this.formValidate.fid=[0],this.formValidate.is_show=1,this.$refs.menusFrom.type=1},onchangeIsShow:function(t){var e=this;Object(o.C)(t.id,t.is_show).then((function(t){e.getData(),e.$Message.success(t.msg)})).catch((function(t){e.getData(),e.$Message.error(t.msg)}))},addE:function(t){this.$refs.menusFrom.modals=!0,this.$refs.menusFrom.titleFrom="添加品牌分类",this.formValidate={sort:0},this.formValidate.fid=t.is_show?t.fid_son:[],this.formValidate.is_show=1,this.$refs.menusFrom.type=3},edit:function(t){this.$refs.menusFrom.modals=!0,this.$refs.menusFrom.titleFrom="编辑品牌分类",this.formValidate=t,0==t.fid.length&&(this.formValidate.fid=[0]),this.$refs.menusFrom.type=2},del:function(t,e){var a=this,r={title:e,url:"product/brand/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(r).then((function(t){a.$Message.success(t.msg),a.$refs.menusFrom.getAddFrom(),a.getData()})).catch((function(t){a.$Message.error(t.msg)}))}}},d=(a("0b01"),a("2877")),c=Object(d.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[a("div",{staticClass:"new_card_pd"},[a("Form",{ref:"brandData",attrs:{inline:"",model:t.brandData,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("FormItem",{attrs:{label:"品牌搜索:"}},[a("Input",{staticClass:"input-add",attrs:{placeholder:"请输入品牌名称"},model:{value:t.brandData.keyword,callback:function(e){t.$set(t.brandData,"keyword",e)},expression:"brandData.keyword"}}),a("Button",{attrs:{type:"primary"},on:{click:t.search}},[t._v("查询")])],1)],1)],1)]),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Button",{attrs:{type:"primary"},on:{click:t.menusAdd}},[t._v("添加品牌")]),a("vxe-table",{ref:"xTable",staticClass:"vxeTable mt25",attrs:{border:!1,"highlight-hover-row":"","highlight-current-row":"",loading:t.loading,"header-row-class-name":"false","row-id":"id","tree-config":{lazy:!0,children:"children",hasChild:"children",loadMethod:t.loadChildrenMethod,reserve:!0},data:t.tableData}},[a("vxe-table-column",{attrs:{field:"brand_name","tree-node":"",title:"品牌名称","min-width":"240"}}),a("vxe-table-column",{attrs:{field:"brand_num",title:"使用商品","min-width":"120",tooltip:"true"}}),a("vxe-table-column",{attrs:{field:"flag",title:"状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("i-switch",{attrs:{value:r.is_show,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(r)}},model:{value:r.is_show,callback:function(e){t.$set(r,"is_show",e)},expression:"row.is_show"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("显示")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("隐藏")])])]}}])}),a("vxe-table-column",{attrs:{field:"sort",title:"排序","min-width":"120"}}),a("vxe-table-column",{attrs:{field:"add_time",title:"创建时间","min-width":"180",tooltip:"true"}}),a("vxe-table-column",{attrs:{field:"date",title:"操作",align:"center",width:"200",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[a("span",{directives:[{name:"auth",rawName:"v-auth",value:["setting-system_menus-add"],expression:"['setting-system_menus-add']"}]},[1===r.type?a("a",{on:{click:function(e){return t.addE(r)}}},[t._v("添加子品牌")]):t._e()]),1===r.type?a("Divider",{attrs:{type:"vertical"}}):t._e(),a("a",{on:{click:function(e){return t.edit(r,"编辑")}}},[t._v("编辑")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.del(r,"删除该品牌")}}},[t._v("删除")])]}}])})],1)],1),a("menus-from",{ref:"menusFrom",attrs:{formValidate:t.formValidate}})],1)}),[],!1,null,"8a92f430",null);e.default=c.exports},"5d4b":function(t,e,a){"use strict";var r=a("a34a"),n=a.n(r),o=a("c4c8");function i(t,e,a,r,n,o,i){try{var s=t[o](i),l=s.value}catch(t){return void a(t)}s.done?e(l):Promise.resolve(l).then(r,n)}var s={name:"menusFrom",props:{formValidate:{type:Object,default:null},fromName:{type:Number,default:0}},data:function(){return{ruleValidate:{brand_name:[{required:!0,message:"请输入品牌名称",trigger:"blur"}]},type:1,modals:!1,FromData:[],titleFrom:"",grid:{xl:24,lg:24,md:12,sm:24,xs:24}}},mounted:function(){this.getAddFrom()},methods:{getAddFrom:function(){var t=this;Object(o.e)().then(function(){var e,a=(e=n.a.mark((function e(a){return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.FromData=a.data;case 1:case"end":return e.stop()}}),e)})),function(){var t=this,a=arguments;return new Promise((function(r,n){var o=e.apply(t,a);function s(t){i(o,r,n,s,l,"next",t)}function l(t){i(o,r,n,s,l,"throw",t)}s(void 0)}))});return function(t){return a.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},handleReset:function(){this.modals=!1,this.$parent.getData()},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){t?2==e.type?Object(o.E)(e.formValidate.id,e.formValidate).then((function(t){e.$Message.success(t.msg),e.getAddFrom(),e.$parent.getData(),e.modals=!1})).catch((function(t){e.$Message.error(t.msg)})):Object(o.B)(e.formValidate).then((function(t){e.$Message.success(t.msg),e.getAddFrom(),e.fromName?e.$parent.getBrandList():e.$parent.getData(),e.modals=!1})).catch((function(t){e.$Message.error(t.msg)})):e.$Message.error("请输入品牌名称")}))},cancle:function(){this.modals=!1}}},l=(a("c1b5"),a("2877")),d=Object(l.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Modal",{attrs:{width:"700",scrollable:"","footer-hide":"",closable:"",title:t.titleFrom,"z-index":1,"class-name":"vertical-center-modal"},on:{"on-cancel":t.handleReset},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[a("Form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":110,rules:t.ruleValidate},nativeOn:{submit:function(t){t.preventDefault()}}},[a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"上级品牌:"}},[a("Cascader",{attrs:{data:t.FromData,placeholder:"请选择上级品牌","change-on-select":""},model:{value:t.formValidate.fid,callback:function(e){t.$set(t.formValidate,"fid",e)},expression:"formValidate.fid"}})],1)],1),a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"品牌名称:",prop:"brand_name"}},[a("Input",{attrs:{maxlength:"10",placeholder:"请输入品牌名称",prop:""},model:{value:t.formValidate.brand_name,callback:function(e){t.$set(t.formValidate,"brand_name",e)},expression:"formValidate.brand_name"}})],1)],1),a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"品牌排序:"}},[a("InputNumber",{staticStyle:{width:"100%"},attrs:{step:1,placeholder:"请输入品牌排序"},model:{value:t.formValidate.sort,callback:function(e){t.$set(t.formValidate,"sort",e)},expression:"formValidate.sort"}})],1)],1),a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"是否显示:"}},[a("i-switch",{attrs:{size:"large","true-value":1,"false-value":0},model:{value:t.formValidate.is_show,callback:function(e){t.$set(t.formValidate,"is_show",e)},expression:"formValidate.is_show"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1),a("Col",{attrs:{span:"24"}},[a("div",{staticClass:"style-add"},[a("Button",{staticClass:"mr14",attrs:{type:"default"},on:{click:t.cancle}},[t._v("取消")]),a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("确认")])],1)])],1)],1)],1)}),[],!1,null,"0f37e54f",null);e.a=d.exports},af70:function(t,e,a){},c1b5:function(t,e,a){"use strict";var r=a("af70");a.n(r).a}}]);