(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4ffc5810"],{1231:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"company-wrapper"},[a("layout-panel",[a("div",{staticClass:"table-search pd-tb10-lr30 box-shadow-b"},[a("TableSearch",{attrs:{columns:t.searchColumns,inline:!0},on:{search:t.onSearch},scopedSlots:t._u([{key:"companyName",fn:function(e){return[a("fd-input",{attrs:{placeholder:t.$t("system.companyPlaceholder")},model:{value:e.formData["companyName"],callback:function(a){t.$set(e.formData,"companyName",a)},expression:"scope.formData['companyName']"}})]}}])})],1)]),a("layout-panel",{staticClass:"table-con-sty pd-tb20-lr30",attrs:{title:t.$t("system.companyList")}},[a("div",{attrs:{slot:"operator"},slot:"operator"},[a("fd-button",{directives:[{name:"has",rawName:"v-has",value:["system:company:importOrg"],expression:"['system:company:importOrg']"}],on:{click:t.clickUpload}},[t._v(t._s(t.$t("导入组织架构数据")))])],1),a("layout-table",{directives:[{name:"loading",rawName:"v-loading",value:"list"===t.loading,expression:"loading==='list'"}],scopedSlots:t._u([{key:"default",fn:function(){return[a("EleTable",{attrs:{loading:"list"===t.loading,"table-data":t.tableData,"table-config":t.tableConfig},on:{modalFn:t.modalFn}})]},proxy:!0},t.tableData.length>0?{key:"page",fn:function(){return[a("Pagenation",{attrs:{pageConfig:t.pageConfig},on:{pageChange:t.getCompanyList}})]},proxy:!0}:null],null,!0)})],1),a("gs-modle",{directives:[{name:"loading",rawName:"v-loading",value:"chart"===t.loading,expression:"loading==='chart'"}],attrs:{modleConfig:{title:t.$t("system.orgFramework"),modleName:"company",modleType:"query"}},scopedSlots:t._u([{key:"content",fn:function(){return[t.isFlowChart?a("Flowchart",{attrs:{nodeList:t.nodeList,lineList:t.lineList}}):t._e()]},proxy:!0}])}),a("Upload",{ref:"upload",attrs:{title:"组织关系导入",uploadInfo:t.uploadInfo},on:{refresh:t.getList}})],1)},n=[],i=(a("d3b7"),a("159b"),a("99af"),a("fe07")),s=[{label:i["a"].t("system.companyName"),id:"name"},{label:i["a"].t("system.companyCode"),id:"code"},{label:i["a"].t("createTime"),id:"createTime"},{label:i["a"].t("system.orgFramework"),key:"opt",id:"opt",width:"90px"}],l=[{label:i["a"].t("view"),type:"query",permissions:["system:company:query"]}],r=a("072e"),c=a("c7f0"),p={components:{Upload:c["a"]},data:function(){return{searchColumns:[{name:this.$t("system.companyName"),field:"companyName",type:"input",slot:!0}],queryForm:{companyName:""},tableConfig:{headers:s,opt:l,index:!0,selection:!1},tableData:[],nodeList:{},lineList:[],pageConfig:{totalCount:0,pageSize:10,pageNum:1},uploadInfo:{templateId:200,uploadFunc:r["d"]},loading:!1,isFlowChart:!1}},created:function(){this.getCompanyList()},methods:{clickUpload:function(){this.$refs.upload.show()},getCompanyList:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this.pageConfig.pageNum=e;var a={keyword:this.queryForm.companyName||""};this.loading="list",Object(r["e"])({param:a},this.pageConfig).then((function(e){t.loading=!1,"200"===e.code&&(t.tableData=e.data.dataList||[],t.pageConfig.totalCount=e.data.totalCount||0)}))},getTreeList:function(t){var e=this,a=t.data,o=t.nodeList,n=t.from,i=t.lineList,s={company:"level1",organization:"level2",factory:"level3"};a.forEach((function(t){var a=s[t.type],l=t.type,r="".concat(l,"_").concat(t.objectId),c=t.childrenList||[],p=o[a].some((function(t){return t.id===r}));p||o[a].push({nodeName:t.objectName,typeName:t.objectType,id:r,type:t.type}),n&&i.push({from:n,to:r}),e.getTreeList({data:c,nodeList:o,from:r,lineList:i})}))},getCompanyOrgChartList:function(t){var e=this;this.loading="chart",Object(r["g"])({id:t}).then((function(t){if(e.loading=!1,"200"===t.code){var a={level1:[],level2:[],level3:[]},o=[];e.getTreeList({data:t.data||[],nodeList:a,lineList:o}),e.nodeList=a,e.lineList=o,e.isFlowChart=!0}}))},modalFn:function(t){var e=t.type,a=t.row;this.isFlowChart=!1,"query"===e&&(this.$fdModal.open("company"),this.getCompanyOrgChartList(a.id))},reset:function(){this.queryForm.companyName=""},onSearch:function(t){this.queryForm=t,this.getCompanyList()}}},d=p,m=(a("b469"),a("2877")),u=Object(m["a"])(d,o,n,!1,null,"32abee47",null);e["default"]=u.exports},3259:function(t,e,a){},b469:function(t,e,a){"use strict";a("3259")}}]);