1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-755d03b1"],{1283:function(t,e,a){"use strict";var r=a("e76a");a.n(r).a},"31b4":function(t,e,a){"use strict";var r=a("9860"),n=a.n(r),i=a("b6bd"),o=a("2f62");function s(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 c(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:"edit",components:{formCreate:n.a.$form()},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?s(a,!0).forEach((function(e){c(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):s(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(o.e)("admin/userLevel",["taskId","levelId"])),props:{FromData:{type:Object,default:null},userEdit:{type:Number,default:0}},data:function(){return{modals:!1,type:0,config:{global:{upload:{props:{onSuccess:function(t,e){200===t.status?e.url=t.data.src:this.Message.error(t.msg)}}}}},isDisable:!1}},methods:{couponsType:function(){this.$parent.addType(this.type)},onSubmit:function(t){var e,a=this;(setTimeout((function(){a.isDisable=!1}),1e3),this.isDisable)||(this.isDisable=!0,e=t,Object(i.a)({url:this.FromData.action,method:this.FromData.method,data:e}).then((function(t){a.$parent.getList(),a.$Message.success(t.msg),a.modals=!1,setTimeout((function(){a.$emit("submitFail")}),1e3)})).catch((function(t){a.$Message.error(t.msg)})))},cancel:function(){this.type=0}}},u=(a("1283"),a("2877")),d=Object(u.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.FromData?a("div",[a("Modal",{class:t.userEdit?"userEdit":"",attrs:{scrollable:"","footer-hide":"",closable:"",title:t.FromData.title,width:"700"},on:{"on-cancel":t.cancel},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[["/marketing/coupon/save.html"===t.FromData.action?a("div",{staticClass:"radio acea-row row-middle"},[a("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),a("Radio-group",{on:{"on-change":t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[a("Radio",{attrs:{label:0}},[t._v("通用券")]),a("Radio",{attrs:{label:1}},[t._v("品类券")]),a("Radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],a("form-create",{ref:"fc",staticClass:"formBox",attrs:{option:t.config,rule:Array.from(t.FromData.rules),handleIcon:"false"},on:{"on-submit":t.onSubmit}})],2)],1):t._e()}),[],!1,null,"d1a058f8",null);e.a=d.exports},"54fa":function(t,e,a){"use strict";var r=a("5cbd");a.n(r).a},"5cbd":function(t,e,a){},"8aca":function(t,e,a){"use strict";a.r(e);var r=a("a34a"),n=a.n(r),i=a("2f62"),o=a("c4c8");function s(t,e,a,r,n,i,o){try{var s=t[i](o),c=s.value}catch(t){return void a(t)}s.done?e(c):Promise.resolve(c).then(r,n)}function c(t){return function(){var e=this,a=arguments;return new Promise((function(r,n){var i=t.apply(e,a);function o(t){s(i,r,n,o,c,"next",t)}function c(t){s(i,r,n,o,c,"throw",t)}o(void 0)}))}}function l(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 u(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var d={name:"product_productClassify",components:{editFrom:a("31b4").a},data:function(){return{treeSelect:[],FromData:null,grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,artFrom:{pid:0,is_show:"",page:1,cate_name:"",limit:15,id:0},total:0,tableData:[]}},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(a,!0).forEach((function(e){u(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(i.e)("admin/layout",["isMobile"]),{},Object(i.e)("admin/userLevel",["categoryId"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.goodsCategory(),this.getList()},methods:{goodsCategory:function(){var t=this;Object(o.rb)(0).then((function(e){t.treeSelect=e.data})).catch((function(e){t.$Message.error(e.msg)}))},getList:function(){var t=this;this.loading=!0,this.artFrom.is_show=this.artFrom.is_show||"",Object(o.T)(this.artFrom).then(function(){var e=c(n.a.mark((function e(a){var r;return n.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.data,t.tableData=r.list,t.total=r.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},loadChildrenMethod:function(t){var e=t.row;return new Promise((function(t,a){Object(o.T)({pid:e.id}).then((function(e){var a=e.data.list;t(a)}))}))},pageChange:function(t){this.artFrom.page=t,this.getList()},addClass:function(){var t=this;this.$modalForm(Object(o.G)()).then((function(){t.artFrom.pid=0,t.getList(),t.goodsCategory()}))},edit:function(t){var e=this;this.$modalForm(Object(o.H)(t.id)).then((function(){e.artFrom.pid=0,e.getList(),e.goodsCategory()}))},findSupId:function(t,e,a){!function t(e,r){if(e&&e.length>0)for(var n in e){if(e[n].id==r)return e[n].cate_name=a.data.cate_name,e[n].is_show=a.data.is_show,e[n].sort=a.data.sort,void(e[n].pic=a.data.pic);e[n].children&&e[n].children.length>0&&t(e[n].children,r)}}(t,e)},onchangeIsShow:function(t){var e=this,a={id:t.id,is_show:t.is_show};Object(o.pb)(a).then(function(){var t=c(n.a.mark((function t(a){return n.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(a.msg),e.artFrom.pid=0,e.getList();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},handleCheckChange:function(t){var e="",a="";this.list=[],this.artFrom.pid=0,t.forEach((function(t,r){e+="".concat(t.id,","),a+="".concat(t.title,",")})),e=e.substring(0,e.length-1),a=a.substring(0,a.length-1),this.list.push({value:e,title:a}),this.artFrom.pid=e,this.getList()},del:function(t,e,a){var r=this,n={title:e,num:a,url:"product/category/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){r.$Message.success(t.msg),r.artFrom.pid=0,r.getList(),r.goodsCategory()})).catch((function(t){r.$Message.error(t.msg)}))},userSearchs:function(){this.artFrom.pid=0,this.artFrom.page=1,this.getList()}}},f=(a("54fa"),a("2877")),m=Object(f.a)(d,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"article-manager"},[a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[a("div",{staticClass:"new_card_pd"},[a("Form",{ref:"artFrom",attrs:{model:t.artFrom,"label-width":t.labelWidth,inline:"","label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("FormItem",{attrs:{label:"商品分类:",prop:"pid","label-for":"pid"}},[a("Select",{staticClass:"input-add",attrs:{clearable:""},on:{"on-change":t.userSearchs},model:{value:t.artFrom.id,callback:function(e){t.$set(t.artFrom,"id",e)},expression:"artFrom.id"}},t._l(t.treeSelect,(function(e){return a("Option",{key:e.id,attrs:{value:e.id}},[t._v(t._s(e.cate_name))])})),1)],1),a("FormItem",{attrs:{label:"状态:","label-for":"is_show"}},[a("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},on:{"on-change":t.userSearchs},model:{value:t.artFrom.is_show,callback:function(e){t.$set(t.artFrom,"is_show",e)},expression:"artFrom.is_show"}},[a("Option",{attrs:{value:"1"}},[t._v("显示")]),a("Option",{attrs:{value:"0"}},[t._v("隐藏")])],1)],1),a("FormItem",{attrs:{label:"分类名称:","label-for":"status2"}},[a("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入"},model:{value:t.artFrom.cate_name,callback:function(e){t.$set(t.artFrom,"cate_name",e)},expression:"artFrom.cate_name"}}),a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.userSearchs()}}},[t._v("查询")])],1)],1)],1)]),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("div",[a("Button",{directives:[{name:"auth",rawName:"v-auth",value:["product-save-cate"],expression:"['product-save-cate']"}],staticClass:"bnt",attrs:{type:"primary"},on:{click:t.addClass}},[t._v("添加分类")])],1),a("vxe-table",{ref:"xTable",staticClass:"ivu-mt",attrs:{data:t.tableData,"highlight-hover-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}}},[a("vxe-table-column",{attrs:{field:"id",title:"ID",tooltip:"",width:"80"}}),a("vxe-table-column",{attrs:{field:"cate_name","tree-node":"",title:"分类名称","min-width":"250"}}),a("vxe-table-column",{attrs:{field:"pic",title:"分类图标","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(t){var e=t.row;return[a("viewer",[a("div",{staticClass:"tabBox_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.pic,expression:"row.pic"}]})])])]}}])}),a("vxe-table-column",{attrs:{field:"sort",title:"排序","min-width":"100",tooltip:"true"}}),a("vxe-table-column",{attrs:{field:"is_show",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:"date",title:"操作",width:"250",align:"left"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row,n=e.index;return[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,"删除商品分类",n)}}},[t._v("删除")])]}}])})],1)],1),a("edit-from",{ref:"edits",attrs:{FromData:t.FromData},on:{submitFail:t.userSearchs}})],1)}),[],!1,null,"4b419f82",null);e.default=m.exports},e76a:function(t,e,a){}}]);
|