chunk-5c7909e0.84175136.js 9.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5c7909e0"],{4990:function(e,t,r){},8308:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"product-management"},[r("div",{staticClass:"product-content"},[r("div",{staticClass:"content-header"},[r("div",{staticClass:"search-area"},[r("el-input",{staticClass:"search-input",attrs:{placeholder:"请输入关键字搜索"},model:{value:e.searchKeyword,callback:function(t){e.searchKeyword=t},expression:"searchKeyword"}},[r("el-button",{attrs:{slot:"append",icon:"el-icon-search"},slot:"append"})],1)],1),r("el-button",{attrs:{type:"primary"},on:{click:e.handleAddProduct}},[e._v("新建产品")])],1),r("el-table",{attrs:{data:e.productList}},[r("el-table-column",{attrs:{prop:"oaNumber",label:"OA编号"}}),r("el-table-column",{attrs:{prop:"productCode",label:"产品编号"}}),r("el-table-column",{attrs:{prop:"productName",label:"产品名称"}}),r("el-table-column",{attrs:{prop:"description",label:"产品描述"}}),r("el-table-column",{attrs:{prop:"productType",label:"产品型号"}}),r("el-table-column",{attrs:{prop:"length",label:"长宽比"}}),r("el-table-column",{attrs:{prop:"resolution",label:"刷新率"}}),r("el-table-column",{attrs:{prop:"screenMaterial",label:"屏幕材质"}}),r("el-table-column",{attrs:{label:"操作",width:"200"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{size:"mini"},on:{click:function(r){return e.handleEditProduct(t.row)}}},[e._v("编辑")]),r("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(r){return e.handleDeleteProduct(t.row)}}},[e._v("删除")])]}}])})],1),r("div",{staticClass:"pagination-container"},[r("el-pagination",{attrs:{"current-page":e.pagination.currentPage,"page-size":e.pagination.pageSize,total:e.pagination.total,layout:"total, prev, pager, next"},on:{"current-change":e.handleCurrentChange}})],1)],1),r("el-dialog",{attrs:{title:"add"===e.dialogType?"新增分类":"编辑分类",visible:e.categoryDialogVisible,width:"500px"},on:{"update:visible":function(t){e.categoryDialogVisible=t}}},[r("el-form",{attrs:{model:e.categoryForm,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"分类名称"}},[r("el-input",{attrs:{placeholder:"请输入分类名称"},model:{value:e.categoryForm.label,callback:function(t){e.$set(e.categoryForm,"label",t)},expression:"categoryForm.label"}})],1)],1),r("span",{attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.categoryDialogVisible=!1}}},[e._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:e.handleCategorySubmit}},[e._v("确 定")])],1)],1),r("el-dialog",{attrs:{title:"add"===e.dialogType?"新增产品":"编辑产品",visible:e.productDialogVisible,width:"650px"},on:{"update:visible":function(t){e.productDialogVisible=t}}},[r("el-form",{attrs:{model:e.productForm,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"OA编号"}},[r("el-input",{model:{value:e.productForm.oaNumber,callback:function(t){e.$set(e.productForm,"oaNumber",t)},expression:"productForm.oaNumber"}})],1),r("el-form-item",{attrs:{label:"产品编号"}},[r("el-input",{model:{value:e.productForm.productCode,callback:function(t){e.$set(e.productForm,"productCode",t)},expression:"productForm.productCode"}})],1),r("el-form-item",{attrs:{label:"产品名称"}},[r("el-input",{model:{value:e.productForm.productName,callback:function(t){e.$set(e.productForm,"productName",t)},expression:"productForm.productName"}})],1),r("el-form-item",{attrs:{label:"产品描述"}},[r("el-input",{attrs:{type:"textarea"},model:{value:e.productForm.description,callback:function(t){e.$set(e.productForm,"description",t)},expression:"productForm.description"}})],1),r("el-form-item",{attrs:{label:"产品型号"}},[r("el-input",{model:{value:e.productForm.productType,callback:function(t){e.$set(e.productForm,"productType",t)},expression:"productForm.productType"}})],1),r("el-form-item",{attrs:{label:"长宽比"}},[r("el-input",{model:{value:e.productForm.length,callback:function(t){e.$set(e.productForm,"length",t)},expression:"productForm.length"}})],1),r("el-form-item",{attrs:{label:"刷新率"}},[r("el-input",{model:{value:e.productForm.resolution,callback:function(t){e.$set(e.productForm,"resolution",t)},expression:"productForm.resolution"}})],1),r("el-form-item",{attrs:{label:"屏幕材质"}},[r("el-input",{model:{value:e.productForm.screenMaterial,callback:function(t){e.$set(e.productForm,"screenMaterial",t)},expression:"productForm.screenMaterial"}})],1)],1),r("span",{attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.productDialogVisible=!1}}},[e._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:e.handleProductSubmit}},[e._v("确 定")])],1)],1)],1)},o=[],c=r("5530"),n=r("c7eb"),l=r("1da1"),i=(r("14d9"),r("498a"),{name:"ProductManagement",data:function(){return{searchKeyword:"",categoryData:[{id:1,label:"LED产品",children:[]},{id:2,label:"LCD产品",children:[]},{id:3,label:"集成产品",children:[{id:31,label:"集成产品A"},{id:32,label:"集成产品B"},{id:33,label:"集成产品C"}]}],productList:[],categoryDialogVisible:!1,productDialogVisible:!1,dialogType:"add",categoryForm:{label:"",parentId:null},productForm:{oaNumber:"",productCode:"",productName:"",description:"",productType:"",length:"",resolution:"",screenMaterial:"",categoryId:null},currentCategory:null,pagination:{currentPage:1,pageSize:10,total:0}}},mounted:function(){this.fetchCategoryList(),this.fetchProductList()},methods:{fetchCategoryList:function(){var e=this;return Object(l["a"])(Object(n["a"])().mark((function t(){return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:try{console.log("获取分类列表")}catch(r){e.$message.error("获取分类列表失败")}case 1:case"end":return t.stop()}}),t)})))()},fetchProductList:function(){var e=this;return Object(l["a"])(Object(n["a"])().mark((function t(){return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:try{console.log("获取产品列表")}catch(r){e.$message.error("获取产品列表失败")}case 1:case"end":return t.stop()}}),t)})))()},handleAddCategory:function(){this.dialogType="add",this.categoryForm={label:"",parentId:null},this.categoryDialogVisible=!0},handleAdd:function(e){this.dialogType="add",this.categoryForm={label:"",parentId:e.id},this.categoryDialogVisible=!0},handleEdit:function(e){this.dialogType="edit",this.categoryForm=Object(c["a"])({},e),this.categoryDialogVisible=!0},handleCategorySubmit:function(){var e=this;return Object(l["a"])(Object(n["a"])().mark((function t(){return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,e.categoryForm.label.trim()){t.next=3;break}return t.abrupt("return",e.$message.warning("请输入分类名称"));case 3:"add"===e.dialogType?e.$message.success("添加分类成功"):e.$message.success("编辑分类成功"),e.categoryDialogVisible=!1,e.fetchCategoryList(),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](0),e.$message.error("操作失败");case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))()},handleDelete:function(e,t){var r=this;return Object(l["a"])(Object(n["a"])().mark((function e(){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r.$confirm("确认删除该分类吗?删除后无法恢复","提示",{type:"warning"});case 3:r.$message.success("删除成功"),r.fetchCategoryList(),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),"cancel"!==e.t0&&r.$message.error("删除失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()},handleAddProduct:function(){this.$router.push("/cpk/ProductMent/newProduct/index")},handleEditProduct:function(e){this.dialogType="edit",this.productForm=Object(c["a"])({},e),this.productDialogVisible=!0},handleProductSubmit:function(){var e=this;return Object(l["a"])(Object(n["a"])().mark((function t(){return Object(n["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,e.productForm.productName.trim()){t.next=3;break}return t.abrupt("return",e.$message.warning("请输入产品名称"));case 3:"add"===e.dialogType?e.$message.success("添加产品成功"):e.$message.success("编辑产品成功"),e.productDialogVisible=!1,e.fetchProductList(),t.next=11;break;case 8:t.prev=8,t.t0=t["catch"](0),e.$message.error("操作失败");case 11:case"end":return t.stop()}}),t,null,[[0,8]])})))()},handleDeleteProduct:function(e){var t=this;return Object(l["a"])(Object(n["a"])().mark((function e(){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.$confirm("确认删除该产品吗?删除后无法恢复","提示",{type:"warning"});case 3:t.$message.success("删除成功"),t.fetchProductList(),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),"cancel"!==e.t0&&t.$message.error("删除失败");case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))()},handleSearch:function(){this.pagination.currentPage=1,this.fetchProductList()},handleCurrentChange:function(e){this.pagination.currentPage=e,this.fetchProductList()},handleNodeClick:function(e){this.currentCategory=e,this.pagination.currentPage=1,this.fetchProductList()}}}),s=i,u=(r("8879"),r("2877")),d=Object(u["a"])(s,a,o,!1,null,"c8f36222",null);t["default"]=d.exports},8879:function(e,t,r){"use strict";r("4990")}}]);