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

(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-423b897e"],{"6fd3":function(t,e,r){"use strict";var a=r("2f62"),i=r("c4c8");function n(t){return(n="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 o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function s(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){l(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function l(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,e||"default");if("object"!=n(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var c={name:"addAttr",data:function(){return{spinShow:!1,modal_loading:!1,grid:{xl:3,lg:3,md:12,sm:24,xs:24},modal:!1,index:1,rules:{rule_name:[{required:!0,message:"请输入分类名称",trigger:"blur"}]},formDynamic:{rule_name:"",spec:[]},attrsName:"",attrsVal:"",formDynamicNameData:[],isBtn:!1,formDynamicName:[],results:[],result:[],ids:0,title:"添加商品规格"}},computed:s(s({},Object(a.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:110},labelPosition:function(){return this.isMobile?"top":"right"}}),methods:{onCancel:function(){this.clear()},addBtn:function(){if(""==this.formDynamic.rule_name.trim())return this.$Message.error("请输入分类名称");this.isBtn=!0},getIofo:function(t){var e=this;this.spinShow=!0,this.ids=t.id,this.title="编辑商品规格",Object(i.rb)(t.id).then((function(t){e.formDynamic=t.data.info,e.spinShow=!1})).catch((function(t){e.spinShow=!1,e.$Message.error(t.msg)}))},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){return!!t&&(0===e.formDynamic.spec.length?e.$Message.warning("请至少添加一条商品规格!"):(e.modal_loading=!0,void setTimeout((function(){Object(i.qb)(e.formDynamic,e.ids).then((function(t){e.$Message.success(t.msg),setTimeout((function(){e.modal=!1,e.modal_loading=!1}),500),setTimeout((function(){e.$emit("getList"),e.clear()}),600)})).catch((function(t){e.modal_loading=!1,e.$Message.error(t.msg)}))}),1200)))}))},clear:function(){this.$refs.formDynamic.resetFields(),this.formDynamic.spec=[],this.isBtn=!1,this.ids=0,this.title="添加商品规格",this.attrsName="",this.attrsVal=""},offAttrName:function(){this.isBtn=!1},cancle:function(){this.modal=!1,this.clear()},handleRemove:function(t){this.formDynamic.spec.splice(t,1)},handleRemove2:function(t,e){t.splice(e,1)},createAttrName:function(){if(this.attrsName&&this.attrsVal){var t={value:this.attrsName,detail:[this.attrsVal]};this.formDynamic.spec.push(t);var e={};this.formDynamic.spec=this.formDynamic.spec.reduce((function(t,r){return!e[r.value]&&(e[r.value]=t.push(r)),t}),[]),this.attrsName="",this.attrsVal="",this.isBtn=!1}else this.$Message.warning("请添加规格名称或规格值")},createAttr:function(t,e){if(t){this.formDynamic.spec[e].detail.push(t);var r={};this.formDynamic.spec[e].detail=this.formDynamic.spec[e].detail.reduce((function(t,e){return!r[e]&&(r[e]=t.push(e)),t}),[])}else this.$Message.warning("请添加属性")}}},u=(r("86f7"),r("2877")),m=Object(u.a)(c,(function(){var t=this,e=t._self._c;return e("Modal",{attrs:{scrollable:"",title:t.title,"class-name":"vertical-center-modal",width:"950"},on:{"on-cancel":t.onCancel},model:{value:t.modal,callback:function(e){t.modal=e},expression:"modal"}},[e("Form",{ref:"formDynamic",staticClass:"attrFrom",attrs:{model:t.formDynamic,rules:t.rules,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Row",{attrs:{gutter:24}},[e("Col",{attrs:{span:"24"}},[e("Col",{staticClass:"mb15",attrs:{span:"8"}},[e("FormItem",{attrs:{label:"分类名称:",prop:"rule_name"}},[e("Input",{attrs:{placeholder:"请输入分类名称",maxlength:20},model:{value:t.formDynamic.rule_name,callback:function(e){t.$set(t.formDynamic,"rule_name",e)},expression:"formDynamic.rule_name"}})],1)],1)],1),t._l(t.formDynamic.spec,(function(r,a){return e("Col",{key:a,staticClass:"noForm",attrs:{span:"23"}},[e("FormItem",[e("div",{staticClass:"acea-row row-middle"},[e("span",{staticClass:"mr5"},[t._v(t._s(r.value))]),e("Icon",{attrs:{type:"ios-close-circle"},on:{click:function(e){return t.handleRemove(a)}}})],1),e("div",{staticClass:"rulesBox"},[t._l(r.detail,(function(a,i){return e("Tag",{key:i,attrs:{type:"dot",closable:"",color:"primary",name:a},on:{"on-close":function(e){return t.handleRemove2(r.detail,i)}}},[t._v(t._s(a))])})),e("Input",{staticClass:"width20",attrs:{maxlength:"30","show-word-limit":"",search:"","enter-button":"添加",placeholder:"请输入属性名称"},on:{"on-search":function(e){return t.createAttr(r.detail.attrsVal,a)}},model:{value:r.detail.attrsVal,callback:function(e){t.$set(r.detail,"attrsVal",e)},expression:"item.detail.attrsVal"}})],2)])],1)})),t.isBtn?e("Col",{staticClass:"mt10",attrs:{span:"24"}},[e("Col",{staticClass:"mt10 mr15",attrs:{span:"8"}},[e("FormItem",{attrs:{label:"规格名称:"}},[e("Input",{attrs:{placeholder:"请输入规格名称",maxlength:"30","show-word-limit":""},model:{value:t.attrsName,callback:function(e){t.attrsName=e},expression:"attrsName"}})],1)],1),e("Col",{staticClass:"mt10 mr20",attrs:{span:"8"}},[e("FormItem",{attrs:{label:"规格值:"}},[e("Input",{attrs:{maxlength:"30","show-word-limit":"",placeholder:"请输入规格值"},model:{value:t.attrsVal,callback:function(e){t.attrsVal=e},expression:"attrsVal"}})],1)],1),e("Col",{staticClass:"mr20",attrs:{span:"8"}},[e("div",{staticClass:"sub"},[e("Button",{staticClass:"mr20",attrs:{type:"primary"},on:{click:t.createAttrName}},[t._v("确定")]),e("Button",{on:{click:t.offAttrName}},[t._v("取消")])],1)])],1):t._e(),t.spinShow?e("Spin",{attrs:{size:"large",fix:""}}):t._e()],2),t.isBtn?t._e():e("Button",{staticClass:"ml95 mt10",attrs:{type:"primary"},on:{click:t.addBtn}},[t._v("添加新规格")])],1),e("div",{attrs:{slot:"footer"},slot:"footer"},[e("Button",{on:{click:t.cancle}},[t._v("取消")]),e("Button",{attrs:{type:"primary",loading:t.modal_loading},on:{click:function(e){return t.handleSubmit("formDynamic")}}},[t._v("确定")])],1)],1)}),[],!1,null,"07a10b5d",null);e.a=m.exports},7611:function(t,e,r){},"7f08":function(t,e,r){"use strict";r.r(e);var a=r("2f62"),i=r("6fd3"),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 s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}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"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,e||"default");if("object"!=o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(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:"productAttr",components:{addAttr:i.a},data:function(){return{loading:!1,artFrom:{page:1,limit:10,rule_name:""},columns4:[{title:"ID",key:"id",width:80},{title:"分类",key:"rule_name",minWidth:150},{title:"规格名",key:"attr_name",minWidth:250},{title:"规格值",slot:"attr_value",minWidth:300},{title:"操作",slot:"action",fixed:"right",width:120}],tableList:[],total:0}},computed:l(l(l({},Object(a.e)("admin/layout",["isMobile"])),Object(a.e)("admin/order",["orderChartType"])),{},{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getDataList()},methods:{del:function(t,e,r){var a=this,i={title:e,num:r,url:"product/product/rule/delete/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(i).then((function(t){a.$Message.success(t.msg),a.tableList.splice(r,1),a.tableList.length||(a.artFrom.page=1==a.artFrom.page?1:a.artFrom.page-1),a.getDataList()})).catch((function(t){a.$Message.error(t.msg)}))},addAttr:function(){this.$refs.addattr.ids=0,this.$refs.addattr.modal=!0},edit:function(t){this.$refs.addattr.modal=!0,this.$refs.addattr.getIofo(t)},getDataList:function(){var t=this;this.loading=!0,Object(n.sb)(this.artFrom).then((function(e){var r=e.data;t.tableList=r.list,t.total=e.data.count,t.loading=!1})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.artFrom.page=t,this.getDataList()},userSearchs:function(){this.artFrom.page=1,this.getDataList()}}},m=(r("fb1a4"),r("2877")),d=Object(m.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:"artFrom",staticClass:"tabform",attrs:{inline:"",model:t.artFrom,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Row",{attrs:{gutter:24,type:"flex",justify:"end"}},[e("Col",{staticClass:"ivu-text-left",attrs:{span:"24"}},[e("FormItem",{attrs:{label:"规格搜索:"}},[e("Input",{staticClass:"input-add",attrs:{placeholder:"请输入规格分类名称"},model:{value:t.artFrom.rule_name,callback:function(e){t.$set(t.artFrom,"rule_name",e)},expression:"artFrom.rule_name"}}),e("Button",{attrs:{type:"primary"},on:{click:t.userSearchs}},[t._v("查询")])],1)],1)],1)],1)],1)]),e("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[e("Button",{directives:[{name:"auth",rawName:"v-auth",value:["product-rule-save"],expression:"['product-rule-save']"}],staticClass:"mr20",attrs:{type:"primary"},on:{click:t.addAttr}},[t._v("添加商品规格")]),e("Table",{ref:"selection",staticClass:"mt25",attrs:{columns:t.columns4,data:t.tableList,loading:t.loading,"highlight-row":"","no-data-text":"暂无数据","no-filtered-data-text":"暂无筛选结果"},scopedSlots:t._u([{key:"attr_value",fn:function(r){var a=r.row;return t._l(a.attr_value,(function(r,a){return e("span",{key:a,staticStyle:{display:"block"},domProps:{textContent:t._s(r)}})}))}},{key:"action",fn:function(r){var a=r.row,i=r.index;return[e("a",{on:{click:function(e){return t.edit(a)}}},[t._v("编辑")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.del(a,"删除规格",i)}}},[t._v("删除")])]}}])}),e("div",{staticClass:"acea-row row-right page"},[e("Page",{attrs:{total:t.total,current:t.artFrom.page,"show-elevator":"","show-total":"","page-size":t.artFrom.limit},on:{"on-change":t.pageChange}})],1)],1),e("add-attr",{ref:"addattr",on:{getList:t.userSearchs}})],1)}),[],!1,null,"d6472908",null);e.default=d.exports},"86f7":function(t,e,r){"use strict";r("7611")},be5f:function(t,e,r){},fb1a4:function(t,e,r){"use strict";r("be5f")}}]);