Your Name
2022-04-08 1f2a259f8cbb7eb0b12d12895116c309eb8cd609
1
(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-7219"],{OCd7:function(t,e,n){},lh3E:function(t,e,n){"use strict";n.d(e,"d",function(){return r}),n.d(e,"a",function(){return o}),n.d(e,"e",function(){return c}),n.d(e,"b",function(){return l}),n.d(e,"c",function(){return s});var a=n("X4fA"),i=n("t3Un");function r(t){return Object(i.a)({headers:{Authorization:Object(a.a)()},url:"http://222.92.213.21:8006/zhongtai/company",method:"get",params:t||{}})}function o(t){return Object(i.a)({headers:{Authorization:Object(a.a)()},url:"http://222.92.213.21:8006/zhongtai/addCompany",method:"post",data:t})}function c(t){return Object(i.a)({headers:{Authorization:Object(a.a)()},url:"http://222.92.213.21:8006/zhongtai/putCompany",method:"post",data:t})}function l(t){return Object(i.a)({headers:{Authorization:Object(a.a)()},url:"http://222.92.213.21:8006/zhongtai/delCompany",method:"post",data:t})}function s(){return Object(i.a)({headers:{Authorization:Object(a.a)()},url:"http://222.92.213.21:8006/zhongtai/companyList",method:"get"})}},pTOG:function(t,e,n){"use strict";var a=n("OCd7");n.n(a).a},xLns:function(t,e,n){"use strict";n.r(e);var a=n("cLjf"),i=n.n(a),r=n("hDQ3"),o=n.n(r),c=n("bS4n"),l=n.n(c),s=n("8t5x"),u=n("7Qib"),m=n("lh3E"),p=n("wk8/"),d=n("8fCU"),f=n("WZwz"),b=n("VoSJ"),h={name:"index",filters:{parseMain:function(t){return 1===t?"是":0===t?"否":void 0},parseIsBanned:function(t){return 1===t?"是":0===t?"否":void 0}},computed:l()({},Object(s.b)(["userType"])),data:function(){return{tableKey:0,unitData:[],listLoading:!1,pageSize:10,recordTotal:0,currentPage:1,pageTotal:0,title:"",company:"",code:"",unitFormVisible:!1,unitFormRules:{},unitForm:{id:"",company:"",code:"",contactname:"",contactphone:"",province:"",city:"",area:"",town:"",committee:"",isbanned:""},provinceList:[],cityList:[],districtList:[],committeeList:[],streetList:[],isMainList:[{id:1,name:"是"},{id:0,name:"否"}]}},created:function(){this.getUnitData(),this.getProvince()},methods:{getUnitData:function(){var t=this;return o()(i.a.mark(function e(){var n,a;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.listLoading=!0,(n={}).pageIndex=t.currentPage,n.pageSize=t.pageSize,n.company=t.company,n.isMain=!1,e.next=8,Object(m.d)(n);case 8:"200"===(a=e.sent).data.code?(t.recordTotal=a.data.result.totalCount,t.pageSize=a.data.result.pageSize,t.pageTotal=Object(u.a)(a.data.result.totalCount,a.data.result.pageSize),t.currentPage=a.data.result.pageIndex,t.unitData=a.data.result.result):t.$message({message:a.data.message,type:"warning"}),t.listLoading=!1;case 11:case"end":return e.stop()}},e,t)}))()},showUnitForm:function(t,e){this.unitFormVisible=!0,"新增"===e?(this.title="新增",this.unitForm={id:"",company:"",code:"",contactname:"",contactphone:"",province:"",city:"",area:"",town:"",committee:"",isbanned:""}):(this.title="修改",this.unitForm=t)},submitUnit:function(){var t=this;"新增"===this.title?Object(m.a)(this.unitForm).then(function(e){"200"===e.data.code?(t.unitFormVisible=!1,t.getUnitData(),t.$notify({type:"success",duration:2e3,message:"新增成功",title:"成功"})):t.$message({type:"warning",message:e.data.message})}):Object(m.e)(this.unitForm).then(function(e){"200"===e.data.code?(t.unitFormVisible=!1,t.getUnitData(),t.$notify({type:"success",duration:2e3,title:"成功",message:"编辑成功"})):t.$message({type:"warning",message:e.data.message})})},deleteById:function(t){var e=this;this.$confirm("删除此条信息,是否继续","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(m.b)({id:t.id}).then(function(){e.getUnitData(),e.$notify({title:"成功",message:"删除成功",type:"success",duration:2e3})})})},addBlack:function(t){var e=this;this.$confirm("将此单位添加黑名单,是否继续","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(b.a)({company:t.company}).then(function(){e.getUnitData(),e.$notify({title:"成功",message:"删除成功",type:"success",duration:2e3})})})},refreshHandle:function(){this.getUnitData()},handleSizeChange:function(t){this.pageSize=t,this.getUnitData()},handleCurrentChange:function(t){this.currentPage=t,this.getUnitData()},getProvince:function(){var t=this,e={parenttype:0,type:1};Object(p.g)(e).then(function(e){var n=e.data;200==n.code?t.provinceList=n.result:Object(d.a)({error:n.data.message,vm:_this})}).catch(function(t){})},changeArea:function(t){var e=this;return o()(i.a.mark(function n(){var a,r,o,c;return i.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if("province"!==t){n.next=12;break}return e.unitForm.city="",e.unitForm.area="",e.unitForm.town="",e.unitForm.community="",e.areaListQuery={type:2,parenttype:1,parentname:e.unitForm.province},n.next=8,Object(f.a)(e.areaListQuery);case 8:"200"===(a=n.sent).data.code&&(e.cityList=a.data.result),n.next=40;break;case 12:if("city"!==t){n.next=23;break}return e.unitForm.area="",e.unitForm.town="",e.unitForm.community="",e.areaListQuery={type:3,parenttype:2,parentname:e.unitForm.city},n.next=19,Object(f.a)(e.areaListQuery);case 19:"200"===(r=n.sent).data.code&&(e.districtList=r.data.result),n.next=40;break;case 23:if("area"!==t){n.next=33;break}return e.unitForm.town="",e.unitForm.community="",e.areaListQuery={type:4,parenttype:3,parentname:e.unitForm.area},n.next=29,Object(f.a)(e.areaListQuery);case 29:"200"===(o=n.sent).data.code&&(e.streetList=o.data.result),n.next=40;break;case 33:if("town"!==t){n.next=40;break}return e.unitForm.community="",e.areaListQuery={type:5,parenttype:4,parentname:e.unitForm.town},n.next=38,Object(f.a)(e.areaListQuery);case 38:"200"===(c=n.sent).data.code&&(e.committeeList=c.data.result);case 40:case"end":return n.stop()}},n,e)}))()}}},v=(n("pTOG"),n("ZrdR")),y=Object(v.a)(h,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("div",{staticClass:"basic_search"},[n("span",[t._v("单位名称:")]),t._v(" "),n("el-input",{staticStyle:{width:"200px"},model:{value:t.company,callback:function(e){t.company=e},expression:"company"}})],1),t._v(" "),n("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-refresh"},on:{click:t.refreshHandle}},[t._v("搜索")]),t._v(" "),n("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-plus"},on:{click:function(e){t.showUnitForm("","新增")}}},[t._v("新增")])],1),t._v(" "),n("div",{staticClass:"table_content"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],key:t.tableKey,staticStyle:{width:"100%"},attrs:{data:t.unitData,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{label:"单位名称",prop:"company",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"单位代码",prop:"code",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"是否为主体单位",prop:"ismain",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n                        "+t._s(t._f("parseMain")(e.row.ismain))+"\n                    ")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"联系人",prop:"contactname",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"联系电话",prop:"contactphone",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"地址",prop:"address",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",[n("span",[t._v(t._s(e.row.province))]),t._v(" "),null!==e.row.city&&""!==e.row.city&&void 0!==e.row.province?n("span",[t._v(t._s("-"+e.row.city))]):t._e(),t._v(" "),null!==e.row.area&&""!==e.row.area&&void 0!==e.row.city?n("span",[t._v(t._s("-"+e.row.area))]):t._e(),t._v(" "),null!==e.row.town&&""!==e.row.town&&void 0!==e.row.town?n("span",[t._v(t._s("-"+e.row.town))]):t._e(),t._v(" "),null!==e.row.committee&&""!==e.row.committee&&void 0!==e.row.committee?n("span",[t._v(t._s("-"+e.row.committee))]):t._e()]),t._v(" "),n("div")]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"创建者",prop:"createdby",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"创建时间",prop:"createddate",align:"center"}}),t._v(" "),n("el-table-column",{attrs:{label:"是否黑名单",prop:"isbanned",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(t._f("parseIsBanned")(e.row.isbanned)))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作",align:"center",width:"280","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"text"},on:{click:function(n){t.showUnitForm(e.row,"编辑")}}},[t._v("编辑")]),t._v(" "),n("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(n){t.addBlack(e.row)}}},[t._v("黑名单")])]}}])})],1),t._v(" "),n("el-pagination",{directives:[{name:"show",rawName:"v-show",value:t.recordTotal>0,expression:"recordTotal>0"}],staticStyle:{float:"right"},attrs:{"current-page":t.currentPage,"page-sizes":[10,20,30,50],"page-size":t.pageSize,total:t.recordTotal,layout:"total, sizes, prev, pager, next, jumper",background:""},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}}),t._v(" "),n("br")],1),t._v(" "),n("el-dialog",{attrs:{title:t.title,visible:t.unitFormVisible,"modal-append-to-body":!1,"close-on-click-modal":!1,width:"40%"},on:{"update:visible":function(e){t.unitFormVisible=e}}},[n("el-form",{ref:"dataForm",staticStyle:{"margin-left":"50px",width:"500px"},attrs:{rules:t.unitFormRules,model:t.unitForm,"label-position":"right","label-width":"100px"}},[n("el-form-item",{attrs:{label:"单位名称"}},[n("el-input",{model:{value:t.unitForm.company,callback:function(e){t.$set(t.unitForm,"company",e)},expression:"unitForm.company"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"单位代码"}},[n("el-input",{model:{value:t.unitForm.code,callback:function(e){t.$set(t.unitForm,"code",e)},expression:"unitForm.code"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"是否为主体单位:",prop:"ismain"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{"auto-complete":"on"},model:{value:t.unitForm.ismain,callback:function(e){t.$set(t.unitForm,"ismain","string"==typeof e?e.trim():e)},expression:"unitForm.ismain"}},t._l(t.isMainList,function(t){return n("el-option",{key:t.id,attrs:{value:t.id,label:t.name}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"联系人"}},[n("el-input",{model:{value:t.unitForm.contactname,callback:function(e){t.$set(t.unitForm,"contactname",e)},expression:"unitForm.contactname"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"联系电话"}},[n("el-input",{model:{value:t.unitForm.contactphone,callback:function(e){t.$set(t.unitForm,"contactphone",e)},expression:"unitForm.contactphone"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"省"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",filterable:""},on:{change:function(e){t.changeArea("province")}},model:{value:t.unitForm.province,callback:function(e){t.$set(t.unitForm,"province",e)},expression:"unitForm.province"}},t._l(t.provinceList,function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.name}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"市"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{prop:"city",clearable:"",filterable:""},on:{change:function(e){t.changeArea("city")}},model:{value:t.unitForm.city,callback:function(e){t.$set(t.unitForm,"city",e)},expression:"unitForm.city"}},t._l(t.cityList,function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.name}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"区"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",filterable:""},on:{change:function(e){t.changeArea("area")}},model:{value:t.unitForm.area,callback:function(e){t.$set(t.unitForm,"area",e)},expression:"unitForm.area"}},t._l(t.districtList,function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.name}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"街道"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",filterable:""},on:{change:function(e){t.changeArea("town")}},model:{value:t.unitForm.town,callback:function(e){t.$set(t.unitForm,"town",e)},expression:"unitForm.town"}},t._l(t.streetList,function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.name}})}))],1),t._v(" "),n("el-form-item",{attrs:{label:"居委会"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{clearable:"",filterable:""},model:{value:t.unitForm.community,callback:function(e){t.$set(t.unitForm,"community",e)},expression:"unitForm.community"}},t._l(t.committeeList,function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.name}})}))],1)],1),t._v(" "),n("div",{attrs:{align:"right"}},[n("el-button",{on:{click:function(e){t.unitFormVisible=!1}}},[t._v("取消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:function(e){t.submitUnit()}}},[t._v("确认")])],1)],1)],1)},[],!1,null,"065efe84",null);y.options.__file="index.vue";e.default=y.exports}}]);