chunk-015f2d8a.9ee9c487.js 10 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-015f2d8a"],{4531: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:"请输入产品编号"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSearch(t)}},model:{value:e.searchKeyword,callback:function(t){e.searchKeyword=t},expression:"searchKeyword"}},[r("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.handleSearch},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:"dcp_oa_code",label:"OA编号"}}),r("el-table-column",{attrs:{prop:"dcp_p_no",label:"产品编号"}}),r("el-table-column",{attrs:{prop:"dcp_name",label:"产品名称"}}),r("el-table-column",{attrs:{prop:"dcp_model",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=[],n=r("5530"),c=r("c7eb"),i=r("1da1"),l=(r("14d9"),r("498a"),r("b9c5")),u={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(i["a"])(Object(c["a"])().mark((function t(){return Object(c["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(i["a"])(Object(c["a"])().mark((function t(){var r;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:try{r={pageNum:e.pagination.currentPage,pageSize:e.pagination.pageSize,dcp_p_no:e.searchKeyword},Object(l["f"])(r).then((function(t){e.productList=t.rows,e.pagination.total=t.total}))}catch(a){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(n["a"])({},e),this.categoryDialogVisible=!0},handleCategorySubmit:function(){var e=this;return Object(i["a"])(Object(c["a"])().mark((function t(){return Object(c["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(i["a"])(Object(c["a"])().mark((function e(){return Object(c["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({path:"/cpk/ProductMent/newProduct/index",query:{title:"新建产品"}})},handleEditProduct:function(e){this.$router.push({path:"/cpk/ProductMent/newProduct/editor",query:{id:e.dcp_id,title:"编辑产品"}})},handleProductSubmit:function(){var e=this;return Object(i["a"])(Object(c["a"])().mark((function t(){return Object(c["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(i["a"])(Object(c["a"])().mark((function r(){return Object(c["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t.$confirm("确认删除该产品吗?删除后无法恢复","提示",{type:"warning"});case 3:return r.next=5,Object(l["b"])(e.dcp_id);case 5:t.$message.success("删除成功"),t.fetchProductList(),r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](0),"cancel"!==r.t0&&t.$message.error("删除失败");case 12:case"end":return r.stop()}}),r,null,[[0,9]])})))()},handleSearch:function(){this.searchKeyword.trim()?(this.pagination.currentPage=1,this.fetchProductList()):this.$message.warning("请输入搜索关键词")},handleCurrentChange:function(e){this.pagination.currentPage=e,this.fetchProductList()},handleNodeClick:function(e){this.currentCategory=e,this.pagination.currentPage=1,this.fetchProductList()}}},s=u,d=(r("bce8"),r("2877")),p=Object(d["a"])(s,a,o,!1,null,"59f2ff17",null);t["default"]=p.exports},b9c5:function(e,t,r){"use strict";r.d(t,"d",(function(){return o})),r.d(t,"a",(function(){return n})),r.d(t,"f",(function(){return c})),r.d(t,"e",(function(){return i})),r.d(t,"c",(function(){return l})),r.d(t,"b",(function(){return u}));var a=r("b775");function o(e){return Object(a["a"])({url:"/spec/getDcSpecList",method:"get",params:e})}function n(e){return Object(a["a"])({url:"/product/add",method:"post",data:e})}function c(e){return Object(a["a"])({url:"/product/list",method:"get",params:e})}function i(e){return Object(a["a"])({url:"/product/getInfo/".concat(e),method:"get"})}function l(e){return Object(a["a"])({url:"/product/edit",method:"post",data:e})}function u(e){return Object(a["a"])({url:"/product/delete/".concat(e),method:"get"})}},bce8:function(e,t,r){"use strict";r("4531")}}]);