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