45.909fe77f1c95b93296f4.js 6.2 KB

12
  1. webpackJsonp([45],{m4zK:function(t,e){},wbLX:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("KhLR"),n={name:"productAttrCateList",data:function(){return{list:null,total:null,listLoading:!0,listQuery:{pageNum:1,pageSize:5},dialogVisible:!1,dialogTitle:"",productAttrCate:{name:"",id:null,sort:0},rules:{name:[{required:!0,message:"请输入类型名称",trigger:"blur"}],sort:[{required:!0,message:"请输入排序值",trigger:"blur"}]}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(i.c)(this.listQuery).then(function(e){t.listLoading=!1,t.list=e.data.list,t.total=e.data.total})},addProductAttrCate:function(){this.dialogVisible=!0,this.dialogTitle="添加类型"},handleSizeChange:function(t){this.listQuery.pageNum=1,this.listQuery.pageSize=t,this.getList()},handleCurrentChange:function(t){this.listQuery.pageNum=t,this.getList()},handleDelete:function(t,e){var a=this;this.$confirm("是否要删除该类型","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(i.b)(e.id).then(function(t){a.$message({message:"删除成功",type:"success",duration:1e3}),a.getList()})})},handleUpdate:function(t,e){this.dialogVisible=!0,this.dialogTitle="编辑类型",this.productAttrCate.name=e.name,this.productAttrCate.id=e.id,this.productAttrCate.sort=e.sort},getAttrList:function(t,e){this.$router.push({path:"/pms/productAttrList",query:{cid:e.id,cname:e.name,type:0}})},getParamList:function(t,e){this.$router.push({path:"/pms/productAttrList",query:{cid:e.id,cname:e.name,type:1}})},handleConfirm:function(t){var e=this;this.$refs[t].validate(function(t){if(!t)return console.log("error submit!!"),e.productAttrCate.name="",!1;var a={name:e.productAttrCate.name,sort:e.productAttrCate.sort};"添加类型"===e.dialogTitle?Object(i.a)(a).then(function(t){e.$message({message:"添加成功",type:"success",duration:1e3}),e.dialogVisible=!1,e.productAttrCate.name="",e.productAttrCate.sort="",e.getList()}):Object(i.e)(e.productAttrCate.id,a).then(function(t){e.$message({message:"修改成功",type:"success",duration:1e3}),e.productAttrCate.name="",e.productAttrCate.sort="",e.dialogVisible=!1,e.getList()})})},handleClose:function(){!this.dialogVisible&&this.$refs.productAttrCatForm&&(this.$refs.productAttrCatForm.clearValidate(),this.productAttrCate.name="")}}},r={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("el-card",{staticClass:"operate-container",attrs:{shadow:"never"}},[a("i",{staticClass:"el-icon-tickets",staticStyle:{"margin-top":"5px"}}),t._v(" "),a("span",{staticStyle:{"margin-top":"5px"}},[t._v("数据列表")]),t._v(" "),a("el-button",{staticClass:"btn-add",attrs:{size:"mini"},on:{click:function(e){t.addProductAttrCate()}}},[t._v("\n 添加\n ")])],1),t._v(" "),a("div",{staticClass:"table-container"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],ref:"productAttrCateTable",staticStyle:{width:"100%"},attrs:{data:t.list,border:""}},[a("el-table-column",{attrs:{label:"编号",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.id))]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"类型名称",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.name))]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"排序",align:"center",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(e.row.sort))]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"属性数量",width:"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(null==e.row.attributeCount?0:e.row.attributeCount))]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"参数数量",width:"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(t._s(null==e.row.paramCount?0:e.row.paramCount))]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"设置",width:"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"mini"},on:{click:function(a){t.getAttrList(e.$index,e.row)}}},[t._v("属性列表\n ")])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",width:"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{size:"mini"},on:{click:function(a){t.handleUpdate(e.$index,e.row)}}},[t._v("编辑\n ")]),t._v(" "),a("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(a){t.handleDelete(e.$index,e.row)}}},[t._v("删除\n ")])]}}])})],1)],1),t._v(" "),a("div",{staticClass:"pagination-container"},[a("el-pagination",{attrs:{background:"",layout:"total, sizes,prev, pager, next,jumper","page-size":t.listQuery.pageSize,"page-sizes":[5,10,15],"current-page":t.listQuery.pageNum,total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange,"update:currentPage":function(e){t.$set(t.listQuery,"pageNum",e)}}})],1),t._v(" "),a("el-dialog",{attrs:{title:t.dialogTitle,visible:t.dialogVisible,"before-close":t.handleClose(),width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{ref:"productAttrCatForm",attrs:{model:t.productAttrCate,rules:t.rules,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"类型名称",prop:"name"}},[a("el-input",{attrs:{"auto-complete":"off"},model:{value:t.productAttrCate.name,callback:function(e){t.$set(t.productAttrCate,"name",e)},expression:"productAttrCate.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"排序值",prop:"sort"}},[a("el-input",{attrs:{"auto-complete":"off"},model:{value:t.productAttrCate.sort,callback:function(e){t.$set(t.productAttrCate,"sort",t._n(e))},expression:"productAttrCate.sort"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.handleConfirm("productAttrCatForm")}}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var o=a("VU/8")(n,r,!1,function(t){a("m4zK")},"data-v-35d4f886",null);e.default=o.exports}});
  2. //# sourceMappingURL=45.909fe77f1c95b93296f4.js.map