2019-08-01 19:52:12 +08:00
|
|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-63a6"],{"+KKE":function(e,t,a){"use strict";a.r(t);var n=a("P2sY"),o=a.n(n),i=a("/PQ/"),l=a("ZySA"),r=a("Mz3J"),s={name:"SupplierCategory",directives:{waves:l.a},components:{Pagination:r.a},filters:{typeFilter:function(e){return{1:"供应商类别",2:"交货方式",3:"运送方式",4:"优质级别",5:"结算方式",6:"推荐程度"}[e]},iseffectiveFilter:function(e){return{1:"启用",2:"停用"}[e]}},data:function(){return{moreaction:[],categoryVisible:!1,addCategoryForm:{categoryname:"",type:"",iseffective:""},addCategoryFormRules:{category:[{required:!0,message:"请输入",trigger:"blur"}],categoryname:[{required:!0,message:"请输入",trigger:"blur"}],type:[{required:!0,message:"请选择",trigger:"change"}],iseffective:[{required:!0,message:"请选择",trigger:"change"}]},editcategoryVisible:!1,editCategoryForm:{categoryName:"",type:"",isEffective:""},editCategoryFormRules:{categoryName:[{required:!0,message:"请输入",trigger:"blur"}],isEffective:[{required:!0,message:"请选择",trigger:"change"}]},downloadLoading:!1,list:[],total:0,tableKey:0,listLoading:!0,getemplist:{categoryname:"",type:"",iseffective:"",pagenum:1,pagesize:10}}},mounted:function(){this.getlist()},methods:{getlist:function(){var e=this;this.listLoading=!0,Object(i.j)(this.getemplist).then(function(t){200===t.data.ret?(e.list=t.data.data.content.list,e.total=t.data.data.content.totalCount):e.$notify.error({title:"错误",message:"出错了",offset:100}),setTimeout(function(){e.listLoading=!1},50)})},handleFilter:function(){var e=this;this.getemplist.pagenum=1,Object(i.j)(this.getemplist).then(function(t){200===t.data.ret?(e.list=t.data.data.content.list,e.total=t.data.data.content.totalCount):e.$notify.error({title:"错误",message:"出错了",offset:100})})},handleSelectionChange:function(e){this.moreaction=e},handleCommand:function(e){var t=this,a=this.moreaction.map(function(e){return e.id}).join();"delete"===e&&this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(i.d)(a).then(function(e){200===e.data.ret?(t.$notify({title:"删除成功",type:"success",offset:100}),t.getlist()):t.$notify.error({title:"错误",message:"出错了",offset:100})})}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},handleDelete:function(e){var t=this;this.$confirm("此操作将永久删除该记录, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(i.d)(e.id).then(function(e){200===e.data.ret?(t.$notify({title:"删除成功",type:"success",offset:100}),t.getlist()):t.$notify.error({title:"错误",message:"出错了",offset:100})})}).catch(function(){t.$message({type:"info",message:"已取消删除"})})},handleEdit:function(e){console.log(e),this.editcategoryVisible=!0,this.editCategoryForm=o()({},e),this.editCategoryForm.type=String(e.type),this.editCategoryForm.isEffective=String(e.isEffective)},handleNo:function(){this.editcategoryVisible=!1},handleOk:function(){var e=this;this.$refs.editCategoryForm.validate(function(t){if(!t)return e.$notify.error({title:"错误",message:"信息未填完整",offset:100}),!1;Object(i.m)(e.editCategoryForm).then(function(t){200===t.data.ret?(e.$notify({title:"成功",message:"修改成功",type:"success",offset:100}),e.getlist(),e.$refs.editCategoryForm.clearValidate(),e.$refs.editCategoryForm.resetFields(),e.editcategoryVisible=!1):e.$notify.error({title:"错误",message:"出错了",offset:100})})})},handleAdd:function(){this.categoryVisible=!0},handlecancel:function(){this.categoryVisible=!1},restAddCategoryForm:function(){this.addCategoryForm={categoryname:"",type:"",iseffective:""}},handlesave:function(){var e=this;console.log(this.addCategoryForm),this.$refs.addCategoryForm.validate(function(t){if(!t)return e.$notify.error({title:"错误",message:"信息未填完整",offset:100}),!1;Object(i.a)(e.addCategoryForm).then(function(t){200===t.data.ret?(e.$notify({tit
|