webpackJsonp([35],{LbNj:function(t,e){},aM3g:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("4YfN"),o=a.n(i),s=a("oFZM"),r=a("t5DY"),l=a("55us"),d={computed:{title:function(){var t="武汉市医疗急救站点信息";return"add"===this.type?t+="填写":"update"===this.type?t+="修改":"detail"===this.type&&(t+="详情"),t}},data:function(){return{dialogVisible:!1,loading:!1,formDisabled:!1,type:"add",dataForm:{siteName:"",area:"",siteLocation:"",siteLongitude:"",siteLatitude:"",hospitalCode:"",siteStatus:""},areaList:[],hospitalList:[],rules:{siteName:[{required:!0,message:"请输入站点名称"}],area:[{required:!0,message:"请选择辖区"}],siteStatus:[{required:!0,message:"请选择站点状态"}]}}},mounted:function(){var t=this;Object(r.e)().then(function(e){t.hospitalList=e.respData}),Object(l.a)(["area"]).then(function(e){t.areaList=e.area})},methods:{init:function(t,e){var a=this;if(this.dialogVisible=!0,this.loading=!0,this.type=t,this.formDisabled="detail"===t,"update"===t||"detail"===t){if(!e)return void this.$message.error("救护车id不能为空");Object(s.c)({id:e}).then(function(t){201===t.msg?(a.dataForm=t.respData||{},a.$nextTick(function(){a.loading=!1,a.$refs.dataForm.clearValidate()})):a.$message.error(t.content)})}else this.dataForm={},this.$nextTick(function(){a.loading=!1,a.$refs.dataForm.clearValidate()})},submitForm:function(){var t=this;this.$refs.dataForm.validate(function(e){if(e){var a=o()({},t.dataForm,{auditStatus:1}),i=t.hospitalList.find(function(e){return e.hospitalCode===t.dataForm.hospitalCode});if(!i)return void t.$message.error("无效数据");var r=i.hospitalName;a.hospitalName=r;var l=t.areaList.find(function(e){return e.id===t.dataForm.area});if(!l)return void t.$message.error("无效数据");var d=l.name;a.areaName=d,Object(s.f)(a).then(function(e){201===e.msg?(t.dialogVisible=!1,t.$message.success("add"===t.type?"新增成功！":"修改成功"),t.$emit("subsucc")):t.$message.error(e.content)})}})},closedHandler:function(){this.$refs.dataForm.resetFields()}}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{attrs:{title:t.title,visible:t.dialogVisible,width:"600px","close-on-click-modal":!1},on:{"update:visible":function(e){t.dialogVisible=e},closed:t.closedHandler}},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],ref:"dataForm",attrs:{model:t.dataForm,size:"small","label-width":"300px",rules:t.rules,disabled:t.formDisabled}},[a("el-form-item",{attrs:{label:"站点名称(请填写单位全称)",prop:"siteName"}},[a("el-input",{attrs:{placeholder:"请输入站点名称"},model:{value:t.dataForm.siteName,callback:function(e){t.$set(t.dataForm,"siteName",e)},expression:"dataForm.siteName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"辖区（多个院区则填写主院区所属辖区）",prop:"area"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择辖区"},model:{value:t.dataForm.area,callback:function(e){t.$set(t.dataForm,"area",e)},expression:"dataForm.area"}},t._l(t.areaList,function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.val}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"站点位置",prop:"siteLocation"}},[a("el-input",{attrs:{placeholder:"请输入站点位置"},model:{value:t.dataForm.siteLocation,callback:function(e){t.$set(t.dataForm,"siteLocation",e)},expression:"dataForm.siteLocation"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"站点经度",prop:"siteLongitude"}},[a("el-input",{attrs:{placeholder:"请输入站点经度"},model:{value:t.dataForm.siteLongitude,callback:function(e){t.$set(t.dataForm,"siteLongitude",e)},expression:"dataForm.siteLongitude"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"站点纬度",prop:"siteLatitude"}},[a("el-input",{attrs:{placeholder:"请输入站点纬度"},model:{value:t.dataForm.siteLatitude,callback:function(e){t.$set(t.dataForm,"siteLatitude",e)},expression:"dataForm.siteLatitude"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"上级医院名称",prop:"hospitalCode"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择上级医院"},model:{value:t.dataForm.hospitalCode,callback:function(e){t.$set(t.dataForm,"hospitalCode",e)},expression:"dataForm.hospitalCode"}},t._l(t.hospitalList,function(t){return a("el-option",{key:t.id,attrs:{label:t.hospitalName,value:t.hospitalCode}})}),1)],1),t._v(" "),a("el-form-item",{attrs:{label:"站点状态",prop:"siteStatus"}},[a("el-radio-group",{model:{value:t.dataForm.siteStatus,callback:function(e){t.$set(t.dataForm,"siteStatus",e)},expression:"dataForm.siteStatus"}},[a("el-radio",{attrs:{label:1}},[t._v("启用")]),t._v(" "),a("el-radio",{attrs:{label:2}},[t._v("停用")])],1)],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"small",disabled:t.formDisabled},on:{click:function(e){return t.submitForm()}}},[t._v("确 定")])],1)],1)},staticRenderFns:[]};var u=a("C7Lr")(d,n,!1,function(t){a("LbNj")},null,null);e.default=u.exports}});
//# sourceMappingURL=35.8d8efe9abb5aa9cf4022.1629880373763.js.map