text: (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-9747"],{"+5uW":function(e,t,a){"use strict";a.d(t,"e",function(){return n}),a.d(t,"b",function(){return o}),a.d(t,"d",function(){return s}),a.d(t,"g",function(){return i}),a.d(t,"a",function(){return u}),a.d(t,"f",function(){return l}),a.d(t,"c",function(){return c});var r=a("+WsE");function n(e){return r.a.post("waimaoshuishou/person/suppliers",e)}function o(e){return r.a.post("waimaoshuishou/person/supplier",e)}function s(e){var t=e.uuid;return r.a.get("waimaoshuishou/person/supplier/"+t)}function i(e){return r.a.post("waimaoshuishou/person/categories",e)}function u(e){return r.a.post("waimaoshuishou/person/category/product",e)}function l(){return r.a.get("waimaoshuishou/person/tags")}function c(e){return r.a.post("waimaoshuishou/person/tag/product",e)}},"6DFt":function(e,t,a){},"7jfb":function(e,t,a){},KEHN:function(e,t,a){"use strict";a.r(t);var r=a("+5uW"),n={components:{pageNum:a("SMMm").a},data:function(){return{ruleForm:{key:"",status:""},statusList:[{value:"0",label:"禁用"},{value:"1",label:"启用"}],tabHeader:{"background-color":"#F4F4F4",color:"#666666","border-top":"1px solid #BBBBBB","border-bottom":"1px solid #BBBBBB","font-size":"16px","text-align":"center"},categoryList:[],pageNo:1,pageSize:10,totalNum:0,operationType:"添加类目",isShow:!1,rules:{nameCn:[{required:!0,message:"请输入类目名称",trigger:"blur"}],nameEn:[{required:!0,message:"请输入英文名称",trigger:"blur"}],orderIndex:[{required:!0,message:"请输入排序",trigger:"blur"}],status:[{required:!0,message:"请选择类目状态",trigger:"change"}],remark:[{required:!0,message:"请输入备注",trigger:"blur"},{min:5,message:"长度不少于5个字符",trigger:"blur"}]},form:{nameCn:"",nameEn:"",status:"1",orderIndex:"",remark:"",uuid:""},value:"启用"}},computed:{},watch:{form:function(){}},created:function(){},mounted:function(){this.fetchCategory()},beforeCreate:function(){},beforeMount:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},activated:function(){},methods:{search:function(e){this.pageNo=1,this.fetchCategory()},resetForm:function(e){this.ruleForm={key:"",status:""},this.$refs[e].resetFields()},fetchCategory:function(){var e=this,t="2"===this.ruleForm.status?"":this.ruleForm.status,a={key:this.ruleForm.key,pageNum:this.pageNo,pageSize:this.pageSize,status:t};Object(r.g)(a).then(function(t){if(t.data.code)return t.data.message&&e.$wran(t.data.message);e.categoryList=t.data.data.records,e.totalNum=t.data.data.total})},sizeChangeFn:function(e){this.pageSize=e,this.fetchCategory()},currentPageChange:function(e){this.pageNo=e,this.fetchCategory()},edit:function(e){this.isShow=!0,this.form=e,this.operationType="编辑类目","1"===e.status?this.form.status=1:this.form.status=0},addCategory:function(){this.isShow=!0,this.form={nameCn:"",nameEn:"",status:1,orderIndex:"",remark:"",uuid:""},this.operationType="添加类目"},close:function(e){this.$refs[e].resetFields(),this.isShow=!1,this.pageNo=1,this.fetchCategory()},onSubmit:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return t.$wran("请先检查数据是否全部填写"),!1}),Object(r.a)(this.form).then(function(e){if(e.data.code)return e.data.message&&t.$wran(e.data.message);t.$success("编辑成功"),t.close("form"),t.pageNo=1,t.fetchCategory()})},enable:function(e){var t=this;e.status=1,Object(r.a)(e).then(function(e){if(e.data.code)return e.data.message&&t.$wran(e.data.message);t.$success(e.data.message),t.pageNo=1,t.fetchCategory()})},disable:function(e){var t=this;e.status=0,Object(r.a)(e).then(function(e){if(e.data.code)return e.data.message&&t.$wran(e.data.message);t.$success(e.data.message),t.pageNo=1,t.fetchCategory()})}}},o=(a("OVvC"),a("KHd+")),s=Object(o.a)(n,function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{inline:!0,model:e.ruleForm,"label-position":"right"}},[a("el-form-item",[a("el-input",{staticStyle:{width:"200px"},attrs:{placeholder:"类目名称",clearable:""},model:{value:e.ruleForm.key,callback:function(t){e.$set(e.ruleForm,"key","string"==typeof t?t.trim():t)},expression:"ruleForm.key"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"类目状态"}},[a("el-select",{staticStyle:{width:"400px"},attrs:{clearable:"",placeholder:"请选择状态"},model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}},e._l(e.statusList,function(e){return a("el-option",{key:e.id,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.search("ruleForm")}}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{type:"info"},on:{click:function(t){e.resetForm("ruleForm")}}},[e._v("重置")]),e._v(" "),a("el-button",{attrs:{type:"success"},on:{click:e.addCategory}},[e._v("新增类目")])],1)],1),e._v(" "),a("el-table",{staticClass:"table-box",attrs:{data:e.categoryList,"header-cell-style":e.tabHeader,border:""}},[a("el-table-column",{attrs:{align:"center",prop:"orderIndex",label:"排序"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"nameCn",label:"类目名称"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"nameEn",label:"英文名称"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"remark",label:"备注"}}),e._v(" "),a("el-table-column",{attrs:{align:"center",prop:"status",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-tag",{attrs:{type:"0"===t.row.status?"warning":"success","disable-transitions":""}},[e._v(e._s("0"===t.row.status?"禁用":"启用"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){e.edit(t.row)}}},[e._v("编辑")]),e._v(" "),"0"===t.row.status?a("el-button",{attrs:{type:"success",size:"mini"},on:{click:function(a){e.enable(t.row)}}},[e._v("启用")]):e._e(),e._v(" "),"1"===t.row.status?a("el-button",{attrs:{type:"warning",size:"mini"},on:{click:function(a){e.disable(t.row)}}},[e._v("禁用")]):e._e()]}}])})],1),e._v(" "),a("div",{staticClass:"pageNumBox"},[a("pageNum",{attrs:{"current-page":e.pageNo,"page-size":e.pageSize,total:e.totalNum},on:{sizeChange:e.sizeChangeFn,currentChange:e.currentPageChange}})],1),e._v(" "),a("el-dialog",{attrs:{title:e.operationType,visible:e.isShow,width:"30%"},on:{"update:visible":function(t){e.isShow=t}}},[a("el-form",{ref:"form",attrs:{rules:e.rules,model:e.form,"label-position":"left"}},[a("el-form-item",{attrs:{label:"类目名称",prop:"nameCn"}},[a("el-input",{attrs:{placeholder:"请输入类目名称"},model:{value:e.form.nameCn,callback:function(t){e.$set(e.form,"nameCn",t)},expression:"form.nameCn"}}),e._v(" "),a("el-input",{staticStyle:{display:"none"},model:{value:e.form.uuid,callback:function(t){e.$set(e.form,"uuid",t)},expression:"form.uuid"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"英文名称",prop:"nameEn"}},[a("el-input",{attrs:{placeholder:"请输入英文名称"},model:{value:e.form.nameEn,callback:function(t){e.$set(e.form,"nameEn",t)},expression:"form.nameEn"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"排序",prop:"orderIndex"}},[a("el-input",{attrs:{type:"number",placeholder:"请输入排序"},model:{value:e.form.orderIndex,callback:function(t){e.$set(e.form,"orderIndex",t)},expression:"form.orderIndex"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"类目状态",prop:"status"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949","active-text":"启用","inactive-text":"禁用"},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"请输入至少5个字符"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.close("form")}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.onSubmit("form")}}},[e._v("提交")])],1)],1)],1)},[],!1,null,"80e96e3e",null);s.options.__file="index.vue";t.default=s.exports},OVvC:function(e,t,a){"use strict";var r=a("6DFt");a.n(r).a},SMMm:function(e,t,a){"use strict";var r=a("Uwh3"),n={props:{currentPage:{type:Number},pageSizes:{type:Array,default:function(){return[]}},pageSize:{type:Number},total:{type:Number}},components:{},data:function(){return{isShow:!1}},watch:{total:function(e){console.log("total",e),0!=e&&(this.isShow=!0)}},methods:{handleSizeChange:function(e){Object(r.c)("currentSize",e);var t=Object(r.b)("currentSize");this.$emit("sizeChange",t)},handleCurrentChange:function(e){Object(r.c)("currentPage",e);var t=Object(r.b)("currentPage");this.$emit("currentChange",t)}},mounted:function(){},updated:function(){console.log("分页组件",this.currentPage),console.log("分页组件",this.pageSize)},created:function(){}},o=(a("jTOu"),a("KHd+")),s=Object(o.a)(n,function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"pageBox"},[this.isShow?t("el-pagination",{attrs:{"current-page":this.currentPage,pageSizes:[5,10,50,100,200,300,400,500],"page-size":this.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:this.total},on:{"size-change":this.handleSizeChange,"current-change":this.handleCurrentChange}}):this._e()],1)},[],!1,null,"63f271cb",null);s.options.__file="index.vue";t.a=s.exports},jTOu:function(e,t,a){"use strict";var r=a("7jfb");a.n(r).a}}]);