1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d228cd5"],{db78:function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:e.loadingFull,expression:"loadingFull",modifiers:{fullscreen:!0,lock:!0}}]}),e._v(" "),n("div",{staticClass:"filter-container"},[n("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-edit",size:"mini"},on:{click:function(){e.getStaffList(),e.visible.type="add",e.visible.station=!0}}},[e._v("\n 添加战区\n ")])],1),e._v(" "),n("el-table",{staticClass:"tableBorder",attrs:{data:e.table,"header-cell-style":{background:"#f8fbfc"},border:"",stripe:""}},[n("el-table-column",{attrs:{prop:"id",label:"#",width:"70",align:"center"}}),e._v(" "),n("el-table-column",{attrs:{prop:"name",label:"战区名",align:"center"}}),e._v(" "),n("el-table-column",{attrs:{label:"负责政委",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.row;return[e._v("\n "+e._s(n.admin&&n.admin.name)+"\n ")]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"代理公司",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.levels;return n("span",{},[e._v(e._s(a.filter((function(e){return 3===e.level})).length>0?a.filter((function(e){return 3===e.level}))[0]["num"]:0))])}}])}),e._v(" "),n("el-table-column",{attrs:{label:"代理经理",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.levels;return n("span",{},[e._v(e._s(a.filter((function(e){return 2===e.level})).length>0?a.filter((function(e){return 2===e.level}))[0]["num"]:0))])}}])}),e._v(" "),n("el-table-column",{attrs:{label:"代理主管",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row.levels;return n("span",{},[e._v(e._s(a.filter((function(e){return 1===e.level})).length>0?a.filter((function(e){return 1===e.level}))[0]["num"]:0))])}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"status",label:"状态",width:"150",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-tag",{attrs:{type:0!==a.status?"danger":"success"}},[e._v(e._s(0===a.status?"正常":"已禁用"))])]}}])}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"230",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(t){return e.handleEditStation(a)}}},[e._v("\n 修改\n ")]),e._v(" "),n("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.handleDisableStation(a)}}},[e._v("\n "+e._s(0===a.status?"禁用":"启用")+"\n ")]),e._v(" "),n("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.handleDeleteStation(a)}}},[e._v("\n 删除\n ")])]}}])})],1),e._v(" "),n("pagination",{attrs:{total:e.tableTotal,limit:e.listQuery.page_size,page:e.listQuery.page_index},on:{pagination:e.changePagination,"update:limit":e.changePagination}}),e._v(" "),n("el-dialog",{attrs:{title:"add"===e.visible.type?"添加战区":"修改战区",visible:e.visible.station,"close-on-click-modal":!1,"show-close":!1,"close-on-press-escape":!1},on:{"update:visible":function(t){return e.$set(e.visible,"station",t)},"before-close":e.closeDialog}},[n("el-form",{ref:"stationForm",attrs:{model:e.stationForm,rules:e.stationRules,"label-width":"80px"}},[n("el-form-item",{attrs:{label:"战区名:",prop:"name"}},[n("el-input",{attrs:{placeholder:"战区名"},model:{value:e.stationForm.name,callback:function(t){e.$set(e.stationForm,"name",t)},expression:"stationForm.name"}})],1),e._v(" "),n("el-form-item",{attrs:{label:"战区政委:",prop:"manager"}},[n("el-select",{model:{value:e.stationForm.manager,callback:function(t){e.$set(e.stationForm,"manager",t)},expression:"stationForm.manager"}},e._l(e.managerList,(function(e){return n("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),e._v(" "),n("el-form-item",[n("el-button",{attrs:{size:"mini"},on:{click:e.closeDialog}},[e._v("\n 取消\n ")]),e._v(" "),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.handleSubmitAdd}},[e._v("\n "+e._s("add"===e.visible.type?"添加":"修改")+"\n ")])],1)],1)],1)],1)},i=[],s=(n("7f7f"),n("96cf"),n("1da1")),r=n("b775");function o(e){return Object(r["a"])({url:"/warea/uploadwarea",method:"post",data:e})}function l(e){return Object(r["a"])({url:"/warea/getwarealist",method:"get",params:e})}function c(e){return Object(r["a"])({url:"/warea/destorywarea",method:"post",data:e})}function u(e){return Object(r["a"])({url:"/warea/updatewarea",method:"post",data:e})}function m(e){return Object(r["a"])({url:"/warea/shelvedwarea",method:"post",data:e})}function d(){return Object(r["a"])({url:"/warea/getcommissarinfo",method:"get"})}var g={data:function(){return{table:[],visible:{station:!1,type:"add"},managerList:[],stationForm:{id:"",name:"",manager:""},stationRules:{name:[{required:!0,message:"请输入战区名",trigger:"blur"}],manager:[{required:!0,message:"请输入战区政委",trigger:"change"}]},listQuery:{page_index:1,page_size:20},tableTotal:0,loadingFull:!1}},created:function(){this.stationList()},methods:{closeDialog:function(){this.visible.station=!1,this.visible.type="add",this.stationForm={id:"",name:"",manager:""},this.$refs.stationForm.resetFields()},stationList:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n,a,i,s,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loadingFull=!0,e.prev=1,e.next=4,l(this.listQuery);case 4:t=e.sent,n=t.message,a=t.code,200===a?(i=t.data,s=i.list,r=i.total,this.table=s,this.tableTotal=r):this.$message.error(n),e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](1),console.log("战区设置失败:".concat(e.t0));case 12:this.loadingFull=!1;case 13:case"end":return e.stop()}}),e,this,[[1,9]])})));function t(){return e.apply(this,arguments)}return t}(),changePagination:function(e){var t=e.page,n=e.limit;this.listQuery.page_size=n,this.listQuery.page_index=t,this.getList()},handleSubmitAdd:function(){var e=this;this.$refs.stationForm.validate((function(t){if(!t)return!1;if("add"===e.visible.type){var n=e.stationForm,a=n.name,i=n.manager,s=e.managerList.filter((function(e){return e.id===i}));s=s.length>0?s[0].name:"",e.addStation({name:a,admin_id:i,admin_name:s})}else{var r=e.stationForm,o=r.name,l=r.manager,c=r.id,u=e.managerList.filter((function(e){return e.id===l}));u=u.length>0?u[0].name:"",e.editStation({name:o,admin_id:l,admin_name:u,id:c})}}))},addStation:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,a,i,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,o(t);case 2:n=e.sent;try{a=n.message,i=n.code,200===i?(this.closeDialog(),this.$message.success(a),this.stationList()):this.$message.error(a)}catch(r){s=n.message?n.message:r.message,s=r.message?r.message:"请求失败",this.$message.error(s)}case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),editStation:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,a,i,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,u(t);case 2:n=e.sent;try{a=n.message,i=n.code,200===i?(this.closeDialog(),this.$message.success(a),this.stationList()):this.$message.error(a)}catch(r){s=n.message?n.message:r.message,s=r.message?r.message:"请求失败",this.$message.error(s)}case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),queryManagerSearch:function(e,t){var n=this.managerList,a=e?n.filter((function(t){return 0===t.name.toLowerCase().indexOf(e.toLowerCase())})):n;t(a)},getStaffList:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.loadingFull=!0,e.next=3,d().then((function(e){t.loadingFull=!1,200===e.code?t.managerList=e.data:t.$message.error(e.message)})).catch((function(e){t.loadingFull=!1}));case 3:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),handleDeleteStation:function(e){var t=this,n=e.id,a=e.name;this.$confirm("确认删除".concat(a,"?"),"删除战区",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.deleteStation(n)}))},deleteStation:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,a,i,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c({id:t});case 2:n=e.sent;try{a=n.message,i=n.code,200===i?(this.$message.success(a),this.stationList()):this.$message.error(a)}catch(r){s=n.message?n.message:r.message,s=r.message?r.message:"请求失败",this.$message.error(s)}case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),handleEditStation:function(e){this.getStaffList();var t=e.id,n=e.name,a=e.admin;this.stationForm.name=n||"",this.stationForm.manager=a&&a.id?a.id:"",this.stationForm.id=t,this.visible.type="edit",this.visible.station=!0},handleDisableStation:function(e){var t=this,n=e.id,a=e.status;0===a?this.$confirm("确认禁用该战区吗?","禁用战区",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.disableStation(n)})):this.disableStation(n)},disableStation:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,a,i,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,m({id:t});case 2:n=e.sent;try{a=n.message,i=n.code,200===i?(this.$message.success(a),this.stationList()):this.$message.error(a)}catch(r){s=n.message?n.message:r.message,s=r.message?r.message:"请求失败",this.$message.error(s)}case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()}},f=g,h=n("2877"),p=Object(h["a"])(f,a,i,!1,null,null,null);t["default"]=p.exports}}]);
|