chunk-44a17f5e.c71c374b.js 10 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-44a17f5e"],{"54d4":function(t,e,r){},"76b1":function(t,e,r){"use strict";r("54d4")},8308:function(t,e,r){"use strict";r.r(e);var a=function(){var t=this,e=t.$createElement,r=t._self._c||e;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(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSearch(e)}},model:{value:t.searchKeyword,callback:function(e){t.searchKeyword=e},expression:"searchKeyword"}},[r("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:t.handleSearch},slot:"append"})],1)],1),r("el-button",{attrs:{type:"primary"},on:{click:t.handleAddProduct}},[t._v("新建产品")])],1),r("el-table",{attrs:{data:t.productList}},[r("el-table-column",{attrs:{prop:"dcp_oa_code",label:"OA编号"}}),r("el-table-column",{attrs:{prop:"dcp_p_no",label:"产品应用编号","show-overflow-tooltip":"","min-width":120},scopedSlots:t._u([{key:"default",fn:function(e){return[r("div",{staticClass:"ellipsis"},[t._v(t._s(e.row.dcp_p_no))])]}}])}),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:t._u([{key:"default",fn:function(e){return[r("el-button",{attrs:{size:"mini"},on:{click:function(r){return t.handleEditProduct(e.row)}}},[t._v("编辑")]),r("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(r){return t.handleDeleteProduct(e.row)}}},[t._v("删除")])]}}])})],1),r("div",{staticClass:"pagination-container"},[r("el-pagination",{attrs:{"current-page":t.pagination.currentPage,"page-size":t.pagination.pageSize,total:t.pagination.total,layout:"total, prev, pager, next"},on:{"current-change":t.handleCurrentChange}})],1)],1),r("el-dialog",{attrs:{title:"add"===t.dialogType?"新增分类":"编辑分类",visible:t.categoryDialogVisible,width:"500px"},on:{"update:visible":function(e){t.categoryDialogVisible=e}}},[r("el-form",{attrs:{model:t.categoryForm,"label-width":"80px"}},[r("el-form-item",{attrs:{label:"分类名称"}},[r("el-input",{attrs:{placeholder:"请输入分类名称"},model:{value:t.categoryForm.label,callback:function(e){t.$set(t.categoryForm,"label",e)},expression:"categoryForm.label"}})],1)],1),r("span",{attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){t.categoryDialogVisible=!1}}},[t._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.handleCategorySubmit}},[t._v("确 定")])],1)],1),r("el-dialog",{attrs:{title:"add"===t.dialogType?"新增产品":"编辑产品",visible:t.productDialogVisible,width:"650px"},on:{"update:visible":function(e){t.productDialogVisible=e}}},[r("el-form",{attrs:{model:t.productForm,"label-width":"100px"}},[r("el-form-item",{attrs:{label:"OA编号"}},[r("el-input",{model:{value:t.productForm.oaNumber,callback:function(e){t.$set(t.productForm,"oaNumber",e)},expression:"productForm.oaNumber"}})],1),r("el-form-item",{attrs:{label:"产品应用编号"}},[r("el-input",{model:{value:t.productForm.productCode,callback:function(e){t.$set(t.productForm,"productCode",e)},expression:"productForm.productCode"}})],1),r("el-form-item",{attrs:{label:"产品名称"}},[r("el-input",{model:{value:t.productForm.productName,callback:function(e){t.$set(t.productForm,"productName",e)},expression:"productForm.productName"}})],1),r("el-form-item",{attrs:{label:"产品描述"}},[r("el-input",{attrs:{type:"textarea"},model:{value:t.productForm.description,callback:function(e){t.$set(t.productForm,"description",e)},expression:"productForm.description"}})],1),r("el-form-item",{attrs:{label:"产品型号"}},[r("el-input",{model:{value:t.productForm.productType,callback:function(e){t.$set(t.productForm,"productType",e)},expression:"productForm.productType"}})],1),r("el-form-item",{attrs:{label:"长宽比"}},[r("el-input",{model:{value:t.productForm.length,callback:function(e){t.$set(t.productForm,"length",e)},expression:"productForm.length"}})],1),r("el-form-item",{attrs:{label:"刷新率"}},[r("el-input",{model:{value:t.productForm.resolution,callback:function(e){t.$set(t.productForm,"resolution",e)},expression:"productForm.resolution"}})],1),r("el-form-item",{attrs:{label:"屏幕材质"}},[r("el-input",{model:{value:t.productForm.screenMaterial,callback:function(e){t.$set(t.productForm,"screenMaterial",e)},expression:"productForm.screenMaterial"}})],1)],1),r("span",{attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){t.productDialogVisible=!1}}},[t._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.handleProductSubmit}},[t._v("确 定")])],1)],1)],1)},o=[],n=r("5530"),c=r("c7eb"),i=r("1da1"),l=(r("14d9"),r("498a"),r("b9c5")),s={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 t=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:try{console.log("获取分类列表")}catch(r){t.$message.error("获取分类列表失败")}case 1:case"end":return e.stop()}}),e)})))()},fetchProductList:function(){var t=this;return Object(i["a"])(Object(c["a"])().mark((function e(){var r;return Object(c["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:try{r={pageNum:t.pagination.currentPage,pageSize:t.pagination.pageSize,dcp_p_no:t.searchKeyword},Object(l["f"])(r).then((function(e){t.productList=e.rows,t.pagination.total=e.total}))}catch(a){t.$message.error("获取产品列表失败")}case 1:case"end":return e.stop()}}),e)})))()},handleAddCategory:function(){this.dialogType="add",this.categoryForm={label:"",parentId:null},this.categoryDialogVisible=!0},handleAdd:function(t){this.dialogType="add",this.categoryForm={label:"",parentId:t.id},this.categoryDialogVisible=!0},handleEdit:function(t){this.dialogType="edit",this.categoryForm=Object(n["a"])({},t),this.categoryDialogVisible=!0},handleCategorySubmit:function(){var t=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:if(e.prev=0,t.categoryForm.label.trim()){e.next=3;break}return e.abrupt("return",t.$message.warning("请输入分类名称"));case 3:"add"===t.dialogType?t.$message.success("添加分类成功"):t.$message.success("编辑分类成功"),t.categoryDialogVisible=!1,t.fetchCategoryList(),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),t.$message.error("操作失败");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))()},handleDelete:function(t,e){var r=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:return t.prev=0,t.next=3,r.$confirm("确认删除该分类吗?删除后无法恢复","提示",{type:"warning"});case 3:r.$message.success("删除成功"),r.fetchCategoryList(),t.next=10;break;case 7:t.prev=7,t.t0=t["catch"](0),"cancel"!==t.t0&&r.$message.error("删除失败");case 10:case"end":return t.stop()}}),t,null,[[0,7]])})))()},handleAddProduct:function(){this.$router.push({path:"/cpk/ProductMent/newProduct/index",query:{title:"新建产品"}})},handleEditProduct:function(t){this.$router.push({path:"/cpk/ProductMent/newProduct/editor",query:{id:t.dcp_id,title:"编辑产品"}})},handleProductSubmit:function(){var t=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:if(e.prev=0,t.productForm.productName.trim()){e.next=3;break}return e.abrupt("return",t.$message.warning("请输入产品名称"));case 3:"add"===t.dialogType?t.$message.success("添加产品成功"):t.$message.success("编辑产品成功"),t.productDialogVisible=!1,t.fetchProductList(),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](0),t.$message.error("操作失败");case 11:case"end":return e.stop()}}),e,null,[[0,8]])})))()},handleDeleteProduct:function(t){var e=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,e.$confirm("确认删除该产品吗?删除后无法恢复","提示",{type:"warning"});case 3:return r.next=5,Object(l["b"])(t.dcp_id);case 5:e.$message.success("删除成功"),e.fetchProductList(),r.next=12;break;case 9:r.prev=9,r.t0=r["catch"](0),"cancel"!==r.t0&&e.$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(t){this.pagination.currentPage=t,this.fetchProductList()},handleNodeClick:function(t){this.currentCategory=t,this.pagination.currentPage=1,this.fetchProductList()}}},u=s,d=(r("76b1"),r("2877")),p=Object(d["a"])(u,a,o,!1,null,"6aa1e134",null);e["default"]=p.exports},b9c5:function(t,e,r){"use strict";r.d(e,"d",(function(){return o})),r.d(e,"a",(function(){return n})),r.d(e,"f",(function(){return c})),r.d(e,"e",(function(){return i})),r.d(e,"c",(function(){return l})),r.d(e,"b",(function(){return s}));var a=r("b775");function o(t){return Object(a["a"])({url:"/spec/getDcSpecList",method:"get",params:t})}function n(t){return Object(a["a"])({url:"/product/add",method:"post",data:t})}function c(t){return Object(a["a"])({url:"/product/list",method:"get",params:t})}function i(t){return Object(a["a"])({url:"/product/getInfo/".concat(t),method:"get"})}function l(t){return Object(a["a"])({url:"/product/edit",method:"post",data:t})}function s(t){return Object(a["a"])({url:"/product/delete/".concat(t),method:"get"})}}}]);