家政小程序
Ви не можете вибрати більше 25 тем Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4.2f595c38189af3cac3e1.chunk.js 5.5KB

1
  1. webpackJsonp([4],{245:function(t,s,o){o(797);var a=o(1)(o(798),o(807),null,null);t.exports=a.exports},797:function(t,s){},798:function(t,s,o){"use strict";function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(s,"__esModule",{value:!0});var e=o(799),i=a(e),n=o(803),r=a(n);s.default={name:"classify",components:{add:i.default,edit:r.default},computed:{prosHandle:function(){var t=[];return this.products.forEach(function(s,o){t.push({id:++o,classify:s})}),t}},data:function(){var t=this;return{row:{},total:0,pageSize:20,proShow:!0,addShow:!1,editShow:!1,formContent:{},columns:[{title:"序号",key:"id"},{title:"产品分类",key:"classify",align:"center"},{title:"操作",key:"action",align:"center",render:function(s,o){return s("div",[s("Button",{props:{type:"primary",size:"default"},style:{marginRight:"5px"},on:{click:function(){t.row=o.row,t.editShow=!0}}},"修改"),s("Button",{props:{type:"error",size:"default"},style:{marginRight:"5px"},on:{click:function(){var s=o.row.classify;t.products=t.products.filter(function(t){return t!=s}),t.axios.post("product_classify/store",{classify:t.products.join(",")}).then(function(s){t.$message.success("删除成功")})}}},"删除")])}}],products:[]}},methods:{add:function(){this.addShow=!0},pubSuccess:function(){this.proShow=!0,this.getData()},getData:function(t){var s=this;this.axios.get("product_classify",{params:{page:t||1}}).then(function(t){s.products=t.data.data,s.pageSize=t.data.per_page,s.total=t.data.total})},closeModal:function(t){this.editShow=!1,t&&t.classifys&&(this.products=t.classifys)},closeAddModal:function(t){this.addShow=!1,t&&t.classifys&&(this.products=t.classifys)}},created:function(){this.getData()}}},799:function(t,s,o){o(800);var a=o(1)(o(801),o(802),null,null);t.exports=a.exports},800:function(t,s){},801:function(t,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default={name:"add",data:function(){return{classify:"",loading:!0,addModal:!1}},watch:{addShow:function(){this.addModal=this.addShow},addModal:function(){this.addModal||this.$emit("close")}},props:{products:Array,addShow:Boolean},methods:{submit:function(){var t=this;this.classify||(this.$emit("close",{classifys:classifys}),this.loading=!1);var s=this.products.concat(this.classify);this.axios.post("/product_classify/store",{classify:s.join(",")}).then(function(o){t.$emit("close",{classifys:s}),t.loading=!1})}}}},802:function(t,s){t.exports={render:function(){var t=this,s=t.$createElement,o=t._self._c||s;return o("Modal",{attrs:{loading:t.loading},model:{value:t.addModal,callback:function(s){t.addModal=s},expression:"addModal"}},[o("p",{attrs:{slot:"header"},slot:"header"},[o("Icon",{attrs:{type:"information-circled"}}),t._v(" "),o("span",[t._v("新增")])],1),t._v(" "),o("div",[o("Form",{ref:"form",attrs:{"label-width":80}},[o("FormItem",{attrs:{label:"分类"}},[o("Input",{model:{value:t.classify,callback:function(s){t.classify=s},expression:"classify"}})],1)],1)],1),t._v(" "),o("div",{attrs:{slot:"footer"},slot:"footer"},[o("Button",{attrs:{type:"primary"},on:{click:t.submit}},[t._v("确定")])],1)])},staticRenderFns:[]}},803:function(t,s,o){o(804);var a=o(1)(o(805),o(806),null,null);t.exports=a.exports},804:function(t,s){},805:function(t,s,o){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.default={name:"edit",data:function(){return{loading:!0,id:this.row.id,classify:this.row.classify,editModal:!1}},watch:{row:function(){this.classify=this.row.classify,this.id=this.row.id},editShow:function(){this.editModal=this.editShow},editModal:function(){this.editModal||this.$emit("close")}},props:{editClassify:Array,editShow:Boolean,row:Object},methods:{submit:function(){var t=this,s=[],o=[];this.editClassify.forEach(function(a){a.id==t.id&&(a.classify=t.classify),o.push(a.classify),s.push(a)});var a=o.join(",");this.axios.post("/product_classify/store",{classify:a}).then(function(s){t.$emit("close",{classifys:o}),t.loading=!1})}}}},806:function(t,s){t.exports={render:function(){var t=this,s=t.$createElement,o=t._self._c||s;return o("Modal",{attrs:{loading:t.loading},model:{value:t.editModal,callback:function(s){t.editModal=s},expression:"editModal"}},[o("p",{attrs:{slot:"header"},slot:"header"},[o("Icon",{attrs:{type:"information-circled"}}),t._v(" "),o("span",[t._v("修改")])],1),t._v(" "),o("div",[o("Form",{ref:"form",attrs:{"label-width":80}},[o("FormItem",{attrs:{label:"分类"}},[o("Input",{model:{value:t.classify,callback:function(s){t.classify=s},expression:"classify"}})],1)],1)],1),t._v(" "),o("div",{attrs:{slot:"footer"},slot:"footer"},[o("Button",{attrs:{type:"primary"},on:{click:t.submit}},[t._v("确定")])],1)])},staticRenderFns:[]}},807:function(t,s){t.exports={render:function(){var t=this,s=t.$createElement,o=t._self._c||s;return o("div",[o("Row",{directives:[{name:"show",rawName:"v-show",value:t.proShow,expression:"proShow"}],staticClass:"margin-top-10"},[o("Col",[o("Card",[o("p",{attrs:{slot:"title"},slot:"title"},[o("Icon",{attrs:{type:"android-remove"}}),t._v("\n 产品分类\n "),o("Button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("新增")])],1),t._v(" "),o("div",{staticClass:"edittable-table-height-con"},[o("Table",{attrs:{columns:t.columns,data:t.prosHandle}}),t._v(" "),o("Page",{attrs:{total:t.total,"page-size":t.pageSize},on:{"on-change":t.getData}})],1)])],1)],1),t._v(" "),o("add",{attrs:{addShow:t.addShow,products:t.products},on:{close:t.closeAddModal}}),t._v(" "),o("edit",{attrs:{editShow:t.editShow,editClassify:t.prosHandle,row:t.row},on:{close:t.closeModal}})],1)},staticRenderFns:[]}}});