(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-6e86"],{"41Be":function(t,e,a){"use strict";a.d(e,"a",function(){return i});var n=a("rerW"),r=a.n(n),o=a("Q2AE");function i(t,e){if(1==t||2==t)return!0;if(!e)return!1;var a=o.a.getters&&o.a.getters.roles;if(a&&a.length>0){var n=!0,i=!1,l=void 0;try{for(var c,u=r()(a);!(n=(c=u.next()).done);n=!0){var s=c.value.btnAccess;if(!s)return!1;var d=s.split(",");if(-1!=d.indexOf("all"))return!0;if(-1!=d.indexOf(e))return!0}}catch(t){i=!0,l=t}finally{try{!n&&u.return&&u.return()}finally{if(i)throw l}}return!1}return!1}},"5W5M":function(t,e,a){"use strict";a.d(e,"g",function(){return o}),a.d(e,"b",function(){return i}),a.d(e,"d",function(){return l}),a.d(e,"i",function(){return c}),a.d(e,"f",function(){return u}),a.d(e,"e",function(){return s}),a.d(e,"a",function(){return d}),a.d(e,"c",function(){return h}),a.d(e,"h",function(){return m});var n=a("t3Un"),r=a("X4fA");function o(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/dictionary-types",method:"get",params:t||{}})}function i(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/adddictionary-types",method:"post",data:t})}function l(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/deldictionary-types",method:"post",data:t})}function c(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/putdictionary-types",method:"post",data:t})}function u(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/dictionary-items",method:"get",params:t||{}})}function s(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/dictionaryAllItems",method:"get",params:t||{}})}function d(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/adddictionary-items",method:"post",data:t})}function h(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/deldictionary-items",method:"post",data:t})}function m(t){return Object(n.a)({headers:{Authorization:Object(r.a)()},url:"http://222.92.213.21:8006/zhongtai/putdictionary-items",method:"post",data:t})}},LXAw:function(t,e,a){"use strict";a.r(e);var n=a("xMja"),r=a("8fCU"),o=a("41Be"),i=a("4f16"),l=a("5W5M"),c={name:"productCategory",data:function(){return{categoryName:"",categoryData:[],listLoading:!0,dialogStatus:"",dialogFormVisible:!1,showMajor:!1,majorTree:[],levelOptions:[],levelArr:[],dataForm:{id:"",name:"",type:"",parentname:"",content:"",level:""}}},mounted:function(){this.queryHandle(),this.getDictionaryItemLevelList()},methods:{queryHandle:function(){var t=this;t.listLoading=!0,Object(n.i)(t.categoryName).then(function(e){"200"===e.data.code?t.categoryData=e.data.result:Object(r.a)({error:e.message,vm:t}),t.listLoading=!1})},showCreateHandle:function(){this.resetDataForm(),this.showMajor=!1,this.dialogStatus="create",this.dialogFormVisible=!0},createHandle:function(){var t=this,e="";t.levelArr.length>0&&t.levelArr.forEach(function(t){e+=t,e+=","}),t.dataForm.level=e,Object(n.a)(t.dataForm).then(function(e){var a=e.data;"200"===a.code?(t.dialogFormVisible=!1,t.$message({message:"新增成功",type:"success"}),t.queryHandle()):Object(r.a)({error:a.message,vm:t})}).catch(function(e){Object(r.a)({error:e,vm:t})})},updateHandle:function(){var t=this,e="";t.levelArr.length>0&&(t.levelArr.forEach(function(t){e+=t,e+=","}),e=e.substring(0,e.length-1)),t.dataForm.level=e,Object(n.o)(t.dataForm).then(function(e){var a=e.data;"200"===a.code?(t.dialogFormVisible=!1,t.$message({message:"更新成功",type:"success"}),t.queryHandle(),t.resetDataForm(),t.showMajor=!1):Object(r.a)({error:a.message,vm:t})}).catch(function(e){Object(r.a)({error:e,vm:t})})},showEditHandle:function(t){var e=this;this.resetDataForm(),this.dialogStatus="editor",this.dataFormSetValue(t),this.dialogFormVisible=!0,this.$nextTick(function(){e.$refs.dataForm.clearValidate()})},dataFormSetValue:function(t){this.dataForm.id=t.id,this.dataForm.name=t.name,2===t.type&&(this.showMajor=!0,this.dataForm.parentname=t.parentname),null!=t.level&&""!==t.level&&(this.levelArr=t.level.split(",")),this.dataForm.type=t.type.toString(),this.dataForm.content=t.content},deleteHandle:function(t){var e=this;i.MessageBox.confirm("确定删除信息","确定删除",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.deleteAction(t)}).catch(function(){Object(r.a)("已取消删除")})},deleteAction:function(t){var e=this,a=this;a.dataForm.id=t.id,Object(n.e)(t).then(function(t){var n=t.data;"200"===n.code?(a.$message({message:"删除成功",type:"success"}),e.queryHandle()):Object(r.a)({error:n.message,vm:a})}).catch(function(t){Object(r.a)({error:t,vm:a})})},resetDataForm:function(){this.dataForm={id:"",name:"",type:"",parentname:"",content:""},this.levelArr=[]},majorSelect:function(t){var e=this;"2"===t?(this.showMajor=!0,Object(n.f)().then(function(t){e.majorTree=t.data})):this.showMajor=!1},getDictionaryItemLevelList:function(){var t=this;if(!(t.levelOptions&&t.levelOptions.length>0)){var e={dictionaryType:"产品级别"};Object(l.e)(e).then(function(e){var a=e.data;"200"===a.code?t.levelOptions=a.result:Object(r.a)({error:a.message,vm:t})}).catch(function(e){Object(r.a)({error:e,vm:t})})}},getBtnPermission:function(t){return Object(o.a)(this.userType,t)}},computed:{typeName:function(){return function(t){return 1===t?"大类":2===t?"小类":"未分类"}}}},u=(a("R6zv"),a("ZrdR")),s=Object(u.a)(c,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container"},[a("div",{staticClass:"filter-container"},[a("el-input",{staticClass:"filter-item",staticStyle:{width:"30%",float:"left"},attrs:{placeholder:"产品名称"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.queryHandle(e):null}},model:{value:t.categoryName,callback:function(e){t.categoryName=e},expression:"categoryName"}}),t._v(" "),t.getBtnPermission("add")?a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.showCreateHandle}},[t._v("新增\n ")]):t._e(),t._v(" "),a("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.queryHandle}})],1),t._v(" "),a("div",{staticClass:"table_content"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.categoryData,border:"",fit:"",height:"800px"}},[a("el-table-column",{attrs:{type:"index",label:"序号",align:"center",width:"80"}}),t._v(" "),a("el-table-column",{attrs:{label:"类别名称",prop:"name",align:"center",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.name))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"产品类别",prop:"type",align:"center",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.typeName(e.row.type)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"大类名称",prop:"parentname",align:"center",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.parentname))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"级别",prop:"level",align:"center",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.level))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"类别定义",prop:"content",align:"center",sortable:"custom"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(e.row.content))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",width:"240","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[t.getBtnPermission("edit")?a("el-button",{attrs:{type:"text"},on:{click:function(a){t.showEditHandle(e.row)}}},[t._v("编辑")]):t._e(),t._v(" "),t.getBtnPermission("delete")?a("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(a){t.deleteHandle(e.row)}}},[t._v("删除\n ")]):t._e()]}}])})],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"create"===t.dialogStatus?"新增":"编辑",visible:t.dialogFormVisible,"modal-append-to-body":!1,"close-on-click-modal":!1,width:"700px"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{ref:"dataForm",staticStyle:{"margin-left":"50px",width:"500px"},attrs:{model:t.dataForm,"label-position":"right","label-width":"140px","element-loading-text":"保存中..."}},[a("el-form-item",{attrs:{label:"类别名称:",prop:"name"}},[a("el-input",{attrs:{disabled:"editor"===t.dialogStatus},model:{value:t.dataForm.name,callback:function(e){t.$set(t.dataForm,"name",e)},expression:"dataForm.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"类型:",prop:"name"}},[a("el-select",{on:{change:t.majorSelect},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},[a("el-option",{attrs:{value:"1",label:"大类"}},[t._v("大类")]),t._v(" "),a("el-option",{attrs:{value:"2",label:"小类"}},[t._v("小类")])],1)],1),t._v(" "),t.showMajor?a("el-form-item",{attrs:{label:"选择大类"}},[a("el-select",{model:{value:t.dataForm.parentname,callback:function(e){t.$set(t.dataForm,"parentname",e)},expression:"dataForm.parentname"}},t._l(t.majorTree,function(t){return a("el-option",{key:t.attributes,attrs:{label:t.text,value:t.text}})}))],1):t._e(),t._v(" "),a("el-form-item",{attrs:{label:"选择级别"}},[a("el-select",{attrs:{multiple:""},model:{value:t.levelArr,callback:function(e){t.levelArr=e},expression:"levelArr"}},t._l(t.levelOptions,function(t){return a("el-option",{key:t.attributes,attrs:{label:t.text,value:t.text}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"类别信息"}},[a("el-input",{attrs:{type:"textarea",row:2},model:{value:t.dataForm.content,callback:function(e){t.$set(t.dataForm,"content",e)},expression:"dataForm.content"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:function(e){"create"===t.dialogStatus?t.createHandle():t.updateHandle()}}},[t._v("确认")])],1)],1)],1)},[],!1,null,"1a9f8b62",null);s.options.__file="productCategory.vue";e.default=s.exports},OBpq:function(t,e,a){},R6zv:function(t,e,a){"use strict";var n=a("OBpq");a.n(n).a},xMja:function(t,e,a){"use strict";a.d(e,"l",function(){return o}),a.d(e,"c",function(){return i}),a.d(e,"b",function(){return l}),a.d(e,"n",function(){return c}),a.d(e,"d",function(){return u}),a.d(e,"g",function(){return s}),a.d(e,"m",function(){return d}),a.d(e,"j",function(){return h}),a.d(e,"i",function(){return m}),a.d(e,"a",function(){return p}),a.d(e,"o",function(){return f}),a.d(e,"e",function(){return b}),a.d(e,"f",function(){return g}),a.d(e,"k",function(){return v}),a.d(e,"h",function(){return y});var n=a("X4fA"),r=a("t3Un");function o(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/info",method:"get",params:t||{}})}function i(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/add",method:"post",data:t})}function l(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/addNew",method:"post",data:t})}function c(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/update",method:"post",data:t})}function u(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/delete",method:"post",data:t})}function s(){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/enterprise/manufacturerTree",method:"get"})}function d(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/setThreshold",method:"post",data:t})}function h(){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/getThreshold",method:"get"})}function m(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/categorise?name="+t,method:"get"})}function p(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/addCategory",method:"post",data:t})}function f(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/editCategory",method:"post",data:t})}function b(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/delCategory",method:"post",data:t})}function g(){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/majorTree",method:"get"})}function v(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/secondaryTree?major="+t,method:"get"})}function y(t){return Object(r.a)({headers:{Authorization:Object(n.a)()},url:"http://222.92.213.21:8006/zhongtai/product/permitLevelTree?secondary="+t,method:"get"})}}}]);
|