徐总多门店
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.
 
 
 
 
 
 

1 lines
17 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-60de971c"],{"411d":function(t,e,r){"use strict";r.r(e);var n=r("5d4b"),o=r("2f62"),a=r("c4c8");function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=i(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==i(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u={name:"index",components:{menusFrom:n.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:l(l({},Object(o.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(a.G)({brand_name:this.brandData.keyword}).then((function(e){t.loading=!1,t.tableData=e.data.list}))},loadChildrenMethod:function(t){var e=this,r=t.row;return new Promise((function(t,n){Object(a.G)({brand_name:e.brandData.keyword,pid:r.id}).then((function(e){var r=e.data.list;t(r)}))}))},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(a.F)(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 r=this,n={title:e,url:"product/brand/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){r.$Message.success(t.msg),r.$refs.menusFrom.getAddFrom(),r.getData()})).catch((function(t){r.$Message.error(t.msg)}))}}},f=(r("56c9"),r("2877")),d=Object(f.a)(u,(function(){var t=this,e=t._self._c;return e("div",[e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[e("div",{staticClass:"new_card_pd"},[e("Form",{ref:"brandData",attrs:{inline:"",model:t.brandData,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("FormItem",{attrs:{label:"品牌搜索:"}},[e("Input",{staticClass:"input-add",attrs:{placeholder:"请输入品牌名称"},model:{value:t.brandData.keyword,callback:function(e){t.$set(t.brandData,"keyword",e)},expression:"brandData.keyword"}}),e("Button",{attrs:{type:"primary"},on:{click:t.search}},[t._v("查询")])],1)],1)],1)]),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("Button",{attrs:{type:"primary"},on:{click:t.menusAdd}},[t._v("添加品牌")]),e("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}},[e("vxe-table-column",{attrs:{field:"brand_name","tree-node":"",title:"品牌名称","min-width":"240"}}),e("vxe-table-column",{attrs:{field:"brand_num",title:"使用商品","min-width":"120",tooltip:"true"}}),e("vxe-table-column",{attrs:{field:"flag",title:"状态","min-width":"120"},scopedSlots:t._u([{key:"default",fn:function(r){var n=r.row;return[e("i-switch",{attrs:{value:n.is_show,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.is_show,callback:function(e){t.$set(n,"is_show",e)},expression:"row.is_show"}},[e("span",{attrs:{slot:"open"},slot:"open"},[t._v("显示")]),e("span",{attrs:{slot:"close"},slot:"close"},[t._v("隐藏")])])]}}])}),e("vxe-table-column",{attrs:{field:"sort",title:"排序","min-width":"120"}}),e("vxe-table-column",{attrs:{field:"add_time",title:"创建时间","min-width":"180",tooltip:"true"}}),e("vxe-table-column",{attrs:{field:"date",title:"操作",align:"center",width:"200",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(r){var n=r.row;return[e("span",{directives:[{name:"auth",rawName:"v-auth",value:["setting-system_menus-add"],expression:"['setting-system_menus-add']"}]},[1===n.type?e("a",{on:{click:function(e){return t.addE(n)}}},[t._v("添加子品牌")]):t._e()]),1===n.type?e("Divider",{attrs:{type:"vertical"}}):t._e(),e("a",{on:{click:function(e){return t.edit(n,"编辑")}}},[t._v("编辑")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.del(n,"删除该品牌")}}},[t._v("删除")])]}}])})],1)],1),e("menus-from",{ref:"menusFrom",attrs:{formValidate:t.formValidate}})],1)}),[],!1,null,"8a92f430",null);e.default=d.exports},"56c9":function(t,e,r){"use strict";r("988c")},"5d4b":function(t,e,r){"use strict";var n=r("c4c8");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function d(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new S(n||[]);return i(a,"_invoke",{value:E(t,r,s)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var m="suspendedStart",p="suspendedYield",v="executing",y="completed",b={};function g(){}function w(){}function _(){}var x={};f(x,l,(function(){return this}));var O=Object.getPrototypeOf,F=O&&O(O(P([])));F&&F!==r&&n.call(F,l)&&(x=F);var j=_.prototype=g.prototype=Object.create(x);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function r(a,i,s,l){var c=h(t[a],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==o(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,s,l)}),(function(t){r("throw",t,s,l)})):e.resolve(f).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,l)}))}l(c.arg)}var a;i(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function E(e,r,n){var o=m;return function(a,i){if(o===v)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var s=n.delegate;if(s){var l=V(s,n);if(l){if(l===b)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=h(e,r,n);if("normal"===c.type){if(o=n.done?y:p,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=y,n.method="throw",n.arg=c.arg)}}}function V(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,V(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[l];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,i=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(o(e)+" is not iterable")}return w.prototype=_,i(j,"constructor",{value:_,configurable:!0}),i(_,"constructor",{value:w,configurable:!0}),w.displayName=f(_,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,f(t,u,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},k(D.prototype),f(D.prototype,c,(function(){return this})),e.AsyncIterator=D,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new D(d(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(j),f(j,u,"Generator"),f(j,l,(function(){return this})),f(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(L),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function i(t,e,r,n,o,a,i){try{var s=t[a](i),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}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(n.e)().then(function(){var e,r=(e=a().mark((function e(r){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.FromData=r.data;case 1:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function s(t){i(a,n,o,s,l,"next",t)}function l(t){i(a,n,o,s,l,"throw",t)}s(void 0)}))});return function(t){return r.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(n.H)(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(n.E)(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=(r("7168"),r("2877")),c=Object(l.a)(s,(function(){var t=this,e=t._self._c;return e("div",[e("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"}},[e("Form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":110,rules:t.ruleValidate},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"上级品牌:"}},[e("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),e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"品牌名称:",prop:"brand_name"}},[e("Input",{attrs:{maxlength:"7",placeholder:"请输入品牌名称",prop:""},model:{value:t.formValidate.brand_name,callback:function(e){t.$set(t.formValidate,"brand_name",e)},expression:"formValidate.brand_name"}})],1)],1),e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"品牌排序:"}},[e("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),e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"是否显示:"}},[e("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"}},[e("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])],1)],1),e("Col",{attrs:{span:"24"}},[e("div",{staticClass:"style-add"},[e("Button",{staticClass:"mr14",attrs:{type:"default"},on:{click:t.cancle}},[t._v("取消")]),e("Button",{attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("确认")])],1)])],1)],1)],1)}),[],!1,null,"3ebb3761",null);e.a=c.exports},7168:function(t,e,r){"use strict";r("bf8c")},"988c":function(t,e,r){},bf8c:function(t,e,r){}}]);