"use strict";(self["webpackChunkerp"]=self["webpackChunkerp"]||[]).push([[984],{9851:function(t,e,a){a.r(e),a.d(e,{default:function(){return u}});var i=function(){var t=this,e=t._self._c;return e("div",{staticClass:"pageBox"},[e("el-card",[e("div",{staticClass:"opaBox"},[e("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.handAdd}},[t._v("新增")])],1),e("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{border:"",data:t.tableData,"tooltip-effect":"dark"},on:{"selection-change":t.handleSelectionChange}},[e("el-table-column",{attrs:{prop:"name",label:"商品品牌"}}),e("el-table-column",{attrs:{prop:"",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.handEdit(a.row.id,a.row)}}},[t._v("编辑")]),e("el-button",{attrs:{type:"danger"},on:{click:function(e){return t.handdel(a.row.id)}}},[t._v("删除")])]}}])})],1),e("div",{staticClass:"page-pagination"},[e("el-pagination",{attrs:{"current-page":t.current_page,"page-sizes":[15,50,100],"page-size":t.per_page,layout:"total, sizes, prev, pager, next, jumper",total:t.Paginationdata.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)],1),e("el-dialog",{attrs:{title:"新增品牌",visible:t.dialogFormVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[e("el-form",{attrs:{model:t.form}},[e("el-form-item",{attrs:{label:"商品品牌","label-width":t.formLabelWidth}},[e("el-input",{model:{value:t.form.kindName,callback:function(e){t.$set(t.form,"kindName",e)},expression:"form.kindName"}})],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.addSubmit}},[t._v("确 定")])],1)],1),e("el-dialog",{attrs:{title:"编辑",visible:t.dialogFormVisible1,"close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogFormVisible1=e}}},[e("el-form",{attrs:{model:t.form1}},[e("el-form-item",{attrs:{label:"编辑品牌","label-width":t.formLabelWidth1}},[e("el-input",{model:{value:t.form1.kindName1,callback:function(e){t.$set(t.form1,"kindName1",e)},expression:"form1.kindName1"}})],1)],1),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.dialogFormVisible1=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.EditSubmit}},[t._v("确 定")])],1)],1)],1)},o=[],n=a(2346),r={data(){return{id:"",tableData:[],multipleSelection:[],dialogFormVisible:!1,dialogFormVisible1:!1,form:{kindName:""},form1:{kindName1:""},formLabelWidth:"120px",formLabelWidth1:"120px",newKind:[],Paginationdata:{},current_page:1,per_page:15}},created(){this.getGoods_types()},methods:{handleSelectionChange(t){this.multipleSelection=t},handleSizeChange(t){this.per_page=t,this.getGoods_types()},handleCurrentChange(t){this.current_page=t,this.getGoods_types()},handAdd(){this.form.kindName="",this.dialogFormVisible=!0},addSubmit(){var t;t=this.form.kindName.replace(/\s/g,",").split(","),(0,n.Mr)({names:t}).then((t=>{this.$message({type:"success",message:"添加成功"}),this.getGoods_types()})),this.dialogFormVisible=!1},handEdit(t,e){this.id=t,this.form1.kindName1=e.name,this.dialogFormVisible1=!0},EditSubmit(){(0,n.yq)(this.id,{name:this.form1.kindName1}).then((t=>{this.$message({type:"success",message:"编辑成功"}),this.getGoods_types()})),this.dialogFormVisible1=!1},handdel(t){this.$confirm("确定删除此条商品品牌吗?","确认删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{(0,n.e9)(t).then((t=>{this.getGoods_types()})),this.$message({type:"success",message:"删除成功!"})})).catch((()=>{this.$message({type:"info",message:"已取消删除"})}))},getGoods_types(){let t={page:this.current_page,per_page:this.per_page};(0,n.ar)(t).then((t=>{this.tableData=t.data.data,this.Paginationdata=t.data.meta}))}}},s=r,l=a(1001),d=(0,l.Z)(s,i,o,!1,null,"e385b9a8",null),u=d.exports},2346:function(t,e,a){a.d(e,{At:function(){return s},Ci:function(){return o},ER:function(){return r},Mr:function(){return c},ar:function(){return d},e9:function(){return u},io:function(){return n},yH:function(){return l},yq:function(){return m}});var i=a(8430);function o(t){return(0,i.Z)({url:"/api/goodsTypes/tree",method:"get",params:t})}function n(t){return(0,i.Z)({url:`/api/goods_types/${t}`,method:"get"})}function r(t){return(0,i.Z)({url:`/api/goods_types/${t}`,method:"delete"})}function s(t){return(0,i.Z)({url:"/api/goods_types/",method:"post",data:t})}function l(t,e){return(0,i.Z)({url:`/api/goods_types/${t}`,method:"patch",data:e})}function d(t){return(0,i.Z)({url:"/api/goods_brands",method:"get",params:t})}function u(t){return(0,i.Z)({url:`/api/goods_brands/${t}`,method:"delete"})}function c(t){return(0,i.Z)({url:"/api/goods_brands",method:"post",data:t})}function m(t,e){return(0,i.Z)({url:`/api/goods_brands/${t}`,method:"patch",data:e})}}}]);
//# sourceMappingURL=984.afbbd0d9.js.map