1 line
9.3 KiB
JavaScript
1 line
9.3 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1c8763b4"],{"04ad":function(t,e,a){"use strict";a("62cf")},"24fd":function(t,e,a){"use strict";a.d(e,"e",(function(){return r})),a.d(e,"d",(function(){return n})),a.d(e,"a",(function(){return s})),a.d(e,"c",(function(){return o})),a.d(e,"b",(function(){return d}));var i=a("b775");function r(t){return Object(i["a"])({url:"/api/upms/org/page",method:"post",data:t})}function n(t){return Object(i["a"])({url:"/api/upms/org/get",method:"post",data:{id:t}})}function s(t){return Object(i["a"])({url:"/api/upms/org/add",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/api/upms/org/update",method:"post",data:t})}function d(t){return Object(i["a"])({url:"/api/upms/org/delete",method:"post",data:{id:t}})}},29439:function(t,e,a){"use strict";a("3387")},3387:function(t,e,a){},"534e":function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-tree",{attrs:{data:t.dataList,props:t.defaultProps},on:{"node-click":t.handleNodeClick}})},r=[],n=a("3393"),s=a.n(n),o=a("4573"),d=a.n(o),l={props:{menuList:{type:Array,default:function(){}}},data:function(){return{defaultProps:{children:"children",label:"name"},dataList:[]}},created:function(){this.init()},methods:{init:function(){var t,e,a=this;s()(t=this.dataList).call(t,0,this.dataList.length),d()(e=this.menuList).call(e,(function(t){"-1"===t.parentId?a.dataList.push(t):a.append(t)}))},append:function(t){var e,a=this;d()(e=this.menuList).call(e,(function(e){t.parentId===e.id&&(e.children||a.$set(e,"children",[]),e.children.push(t))}))},handleNodeClick:function(t){this.$emit("getOrganization",t)}}},c=l,u=(a("04ad"),a("2877")),f=Object(u["a"])(c,i,r,!1,null,"350bd2ba",null);e["a"]=f.exports},"62cf":function(t,e,a){},"66f4":function(t,e,a){"use strict";a("c8fd")},"9d60":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-container",{staticStyle:{margin:"30px"}},[a("el-aside",[t.menuList.length>0?a("side-tree",{attrs:{"menu-list":t.menuList},on:{getOrganization:t.getOrganization}}):t._e()],1),t._v(" "),a("el-main",{staticStyle:{border:"2px solid #E4E4E4","border-radius":"10px","margin-left":"10px"}},[t.addOrUpdateVisible?a("organization-manege",{ref:"addOrUpdate",on:{refreshDataList:t.getList}}):t._e()],1)],1)},r=[],n=(a("96cf"),a("1da1")),s=a("6b47"),o=a.n(s),d=a("3393"),l=a.n(d),c=a("534e"),u=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-card",{staticClass:"box-card"},[a("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[a("div",{staticStyle:{float:"right",padding:"3px 0"}},[a("el-button",{attrs:{type:"primary"},on:{click:t.showAdd}},[t._v(t._s(t._f("i18nFilter")("btn.add")))]),t._v(" "),a("el-button",{attrs:{type:"success",disabled:!t.formData.name},on:{click:function(e){t.isAdd=!1,t.isEdit=!0}}},[t._v(t._s(t._f("i18nFilter")("btn.edit")))]),t._v(" "),a("el-button",{attrs:{type:"danger"},on:{click:t.deleteOrg}},[t._v(t._s(t._f("i18nFilter")("btn.delete")))])],1)]),t._v(" "),a("el-form",{ref:"formData",attrs:{model:t.formData,rules:t.rules,size:"medium","label-width":"150px"}},[a("el-form-item",{attrs:{label:t.$t("orgManage.orgName"),prop:"name"}},[a("el-input",{style:{width:"100%"},attrs:{readonly:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.input",t.$t("orgManage.orgName")]),clearable:""},model:{value:t.formData.name,callback:function(e){t.$set(t.formData,"name",e)},expression:"formData.name"}})],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("orgManage.parentOrg"),prop:"parentId"}},[a("el-select",{style:{width:"100%"},attrs:{disabled:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.select",t.$t("orgManage.parentOrg")]),clearable:""},model:{value:t.formData.parentId,callback:function(e){t.$set(t.formData,"parentId",e)},expression:"formData.parentId"}},t._l(t.parentIdOptions,(function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.id}})})),1)],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("orgManage.address"),prop:"address"}},[a("el-input",{style:{width:"100%"},attrs:{readonly:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.input",t.$t("orgManage.address")]),clearable:""},model:{value:t.formData.address,callback:function(e){t.$set(t.formData,"address",e)},expression:"formData.address"}})],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("orgManage.phone"),prop:"phone"}},[a("el-input",{style:{width:"100%"},attrs:{readonly:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.input",t.$t("orgManage.phone")]),clearable:""},model:{value:t.formData.phone,callback:function(e){t.$set(t.formData,"phone",e)},expression:"formData.phone"}})],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("orgManage.contact"),prop:"contact"}},[a("el-input",{style:{width:"100%"},attrs:{readonly:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.input",t.$t("orgManage.contact")]),clearable:""},model:{value:t.formData.contact,callback:function(e){t.$set(t.formData,"contact",e)},expression:"formData.contact"}})],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("orgManage.email"),prop:"email"}},[a("el-input",{style:{width:"100%"},attrs:{readonly:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.input",t.$t("orgManage.email")]),clearable:""},model:{value:t.formData.email,callback:function(e){t.$set(t.formData,"email",e)},expression:"formData.email"}})],1),t._v(" "),a("el-form-item",{attrs:{label:t.$t("orgManage.remark"),prop:"remark"}},[a("el-input",{style:{width:"100%"},attrs:{readonly:!t.isEdit&&!t.isAdd,placeholder:t._f("i18nFilterForm")(["placeholder.input",t.$t("orgManage.remark")]),clearable:""},model:{value:t.formData.remark,callback:function(e){t.$set(t.formData,"remark",e)},expression:"formData.remark"}})],1)],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.isEdit||t.isAdd,expression:"isEdit||isAdd"}],staticStyle:{"text-align":"center"}},[a("el-button",{attrs:{type:"primary"},on:{click:t.resetForm}},[t._v(t._s(t._f("i18nFilter")("btn.reset")))]),t._v(" "),a("el-button",{attrs:{type:"success"},on:{click:t.submitForm}},[t._v(t._s(t._f("i18nFilter")("btn.submit")))])],1)],1)},f=[],m=a("24fd"),p={data:function(){return{isEdit:!1,isAdd:!1,formData:{id:"",name:void 0,parentId:void 0,address:void 0,phone:void 0,contact:void 0,email:void 0,remark:void 0},parentId:"",rules:{name:[{required:!0,message:this.$i18nForm(["placeholder.input",this.$t("orgManage.orgName")]),trigger:"blur"}],parentId:[],address:[],phone:[],contact:[],email:[],remark:[]},parentIdOptions:[],listQuery:{current:1,size:500}}},created:function(){this.getList()},methods:{getList:function(){var t=Object(n["a"])(o.a.mark((function t(){var e;return o.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(m["e"])(this.listQuery);case 2:e=t.sent,0===e.code&&(this.parentIdOptions=e.data.records);case 4:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),init:function(t){var e=this;this.isEdit=!1,this.isAdd=!1,this.$nextTick((function(){e.$refs["formData"].resetFields(),t&&(Object(m["d"])(t).then((function(t){e.formData=t.data,e.parentId=t.data.id})),e.formData.id=t)}))},resetForm:function(){this.$refs["formData"].resetFields()},showAdd:function(){this.isAdd=!0,this.isEdit=!1,this.$refs["formData"].resetFields(),this.formData.parentId=this.parentId},submitForm:function(){this.isAdd?this.addOrg():this.isEdit&&this.editOrg()},addOrg:function(){var t=this;this.$refs["formData"].validate((function(e){if(e){var a=t.formData;a.id="",Object(m["a"])(a).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.getList(),t.isEdit=!1,t.isAdd=!1,t.$emit("refreshDataList")}})}))}}))},editOrg:function(){var t=this;this.$refs["formData"].validate((function(e){if(e){var a=t.formData;Object(m["c"])(a).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.getList(),t.isEdit=!1,t.isAdd=!1,t.$emit("refreshDataList")}})}))}}))},deleteOrg:function(){var t=this;Object(m["b"])(this.formData.id).then((function(e){t.$message({message:t.$t("module.basicData.visual.success"),type:"success",duration:1500,onClose:function(){t.getList(),t.$refs["formData"].resetFields(),t.$emit("refreshDataList")}})}))}}},h=p,g=(a("66f4"),a("2877")),b=Object(g["a"])(h,u,f,!1,null,"1c0f2c97",null),v=b.exports,$={components:{sideTree:c["a"],organizationManege:v},data:function(){return{menuList:[],addOrUpdateVisible:!1,organizationInfo:{},defaultProps:{children:"children",label:"label"},listQuery:{current:1,size:500}}},created:function(){this.getList()},methods:{getList:function(){var t=Object(n["a"])(o.a.mark((function t(){var e,a;return o.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return l()(e=this.menuList).call(e,0,this.menuList.length),t.next=3,Object(m["e"])(this.listQuery);case 3:a=t.sent,0===a.code&&(this.menuList=a.data.records);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}(),getOrganization:function(t){this.addNew(t.id)},addNew:function(t){var e=this;this.addOrUpdateVisible=!0,this.$nextTick((function(){e.$refs.addOrUpdate.init(t)}))}}},D=$,_=(a("29439"),Object(g["a"])(D,i,r,!1,null,"0070ada1",null));e["default"]=_.exports},c8fd:function(t,e,a){}}]); |