webpackJsonp([35],{bQrt:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i("4YfN"),a=i.n(s),o=i("ATWy"),r=i("oFZM"),l={data:function(){return{dialogVisible:!1,loading:!1,dataForm:{siteId:"",hospitalCode:""},siteList:[],rules:{siteId:[{required:!0,message:"请选择站点"}],hospitalCode:[{required:!0,message:"请选择上级医院"}]}}},mounted:function(){var e=this;Object(r.d)().then(function(t){e.siteList=t.respData})},methods:{init:function(e){var t=this;this.dialogVisible=!0,this.loading=!0,e?Object(o.e)({id:e}).then(function(i){if(201===i.msg){var s=i.respData,a=s.hospitalCode,o=s.siteId;t.dataForm={id:e,hospitalCode:a,siteId:o},t.$nextTick(function(){t.loading=!1,t.$refs.dataForm.clearValidate()})}else t.$message.error(i.content)}):this.$message.error("救护车id不能为空")},submitForm:function(){var e=this;this.$refs.dataForm.validate(function(t){if(t){var i=a()({},e.dataForm),s=e.siteList.find(function(t){return t.id===e.dataForm.siteId});if(!s)return void e.$message.error("无效数据");var r=s.siteName;i.siteName=r,Object(o.a)(i).then(function(t){201===t.msg?(e.dialogVisible=!1,e.$message.success("绑定成功"),e.$emit("subsucc")):e.$message.error(t.content)})}})},closedHandler:function(){this.$refs.dataForm.resetFields()}}},n={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{title:"绑定站点",visible:e.dialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisible=t},closed:e.closedHandler}},[i("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"dataForm",attrs:{model:e.dataForm,size:"small","label-width":"150px",rules:e.rules}},[i("el-form-item",{attrs:{label:"站点名称",prop:"siteId"}},[i("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择站点"},model:{value:e.dataForm.siteId,callback:function(t){e.$set(e.dataForm,"siteId",t)},expression:"dataForm.siteId"}},e._l(e.siteList,function(e){return i("el-option",{key:e.id,attrs:{label:e.siteName,value:e.id}})}),1)],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.submitForm()}}},[e._v("确 定")])],1)],1)},staticRenderFns:[]};var d=i("C7Lr")(l,n,!1,function(e){i("vEvc")},null,null);t.default=d.exports},vEvc:function(e,t){}});
//# sourceMappingURL=35.46662e0b5891a4c3fd10.1631259377535.js.map