chunk-2d0c778a.58c77258.js 8.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c778a"],{5180:function(e,r,a){"use strict";a.r(r);var t=function(){var e=this,r=e.$createElement,a=e._self._c||r;return a("div",[e.onOpen?a("el-dialog",{attrs:{visible:e.onOpen,title:1===e.pageType?"新增":"编辑"},on:{close:e.onClose}},[a("el-row",{attrs:{gutter:15}},[a("el-form",{ref:"elForm",attrs:{model:e.formData,rules:e.rules,size:"medium","label-width":"120px"}},[a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"诊所名称",prop:"clinicName"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入诊所名称",clearable:"",maxlength:64},model:{value:e.formData.clinicName,callback:function(r){e.$set(e.formData,"clinicName",r)},expression:"formData.clinicName"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"IP地址",prop:"clinicIp"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入IP地址",clearable:""},model:{value:e.formData.clinicIp,callback:function(r){e.$set(e.formData,"clinicIp",r)},expression:"formData.clinicIp"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"服务器登录名",prop:"serverUser"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入服务器登录名",clearable:""},model:{value:e.formData.serverUser,callback:function(r){e.$set(e.formData,"serverUser",r)},expression:"formData.serverUser"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"服务器密码",prop:"serverPassword"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入服务器密码",clearable:""},model:{value:e.formData.serverPassword,callback:function(r){e.$set(e.formData,"serverPassword",r)},expression:"formData.serverPassword"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"端口号",prop:"serverPost"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入端口号",clearable:""},model:{value:e.formData.serverPost,callback:function(r){e.$set(e.formData,"serverPost",r)},expression:"formData.serverPost"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"socket端口号",prop:"webSocketPost"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入socket端口号",clearable:""},model:{value:e.formData.webSocketPost,callback:function(r){e.$set(e.formData,"webSocketPost",r)},expression:"formData.webSocketPost"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"诊所域名",prop:"realmName"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入诊所域名",clearable:""},model:{value:e.formData.realmName,callback:function(r){e.$set(e.formData,"realmName",r)},expression:"formData.realmName"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"版本编号",prop:"versionInfo"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入版本编号",clearable:""},model:{value:e.formData.versionInfo,callback:function(r){e.$set(e.formData,"versionInfo",r)},expression:"formData.versionInfo"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"购买时间",prop:"creatTime"}},[a("el-date-picker",{style:{width:"100%"},attrs:{format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",placeholder:"请选择购买时间",clearable:"","picker-options":e.pickerStartOptions},model:{value:e.formData.creatTime,callback:function(r){e.$set(e.formData,"creatTime",r)},expression:"formData.creatTime"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"到期时间",prop:"expireTime"}},[a("el-date-picker",{style:{width:"100%"},attrs:{format:"yyyy-MM-dd","value-format":"yyyy-MM-dd",placeholder:"请选择到期时间",clearable:"","picker-options":e.pickerEndOptions},model:{value:e.formData.expireTime,callback:function(r){e.$set(e.formData,"expireTime",r)},expression:"formData.expireTime"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"所在地区",prop:"region"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入所在地区",clearable:""},model:{value:e.formData.region,callback:function(r){e.$set(e.formData,"region",r)},expression:"formData.region"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"手机号",prop:"phone"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入手机号",clearable:""},model:{value:e.formData.phone,callback:function(r){e.$set(e.formData,"phone",r)},expression:"formData.phone"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"详细地址",prop:"address"}},[a("el-input",{style:{width:"100%"},attrs:{placeholder:"请输入详细地址",clearable:""},model:{value:e.formData.address,callback:function(r){e.$set(e.formData,"address",r)},expression:"formData.address"}})],1)],1),a("el-col",{attrs:{span:11}},[a("el-form-item",{attrs:{label:"购买版本",prop:"versionRefer"}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择购买版本",clearable:""},model:{value:e.formData.versionRefer,callback:function(r){e.$set(e.formData,"versionRefer",r)},expression:"formData.versionRefer"}},e._l(e.mobileOptions,(function(e,r){return a("el-option",{key:r,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1)],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.onClose}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确定")])],1)],1):e._e()],1)},l=[],s=a("c7eb"),o=a("1da1"),i=(a("a9e3"),a("943d")),n={components:{},props:{onOpen:{type:Boolean,default:!1},pageType:{type:Number,default:1}},data:function(){var e=this;return{formData:{clinicName:"",clinicIp:"",serverUser:"",serverPassword:"",realmName:"",creatTime:null,expireTime:null,versionInfo:"",region:"",phone:"",address:"",serverPost:"",webSocketPost:"",versionRefer:""},pickerStartOptions:{disabledDate:function(r){if(null!==e.formData.expireTime)return r.getTime()>new Date(e.formData.expireTime).getTime()}},pickerEndOptions:{disabledDate:function(r){if(null!==e.formData.creatTime)return r.getTime()<new Date(e.formData.creatTime).getTime()}},mobileOptions:[{label:"免费版",value:"免费版"},{label:"基础版",value:"基础版"},{label:"高级版",value:"高级版"},{label:"豪华版",value:"豪华版"},{label:"尊贵版",value:"尊贵版"}],rules:{clinicName:[{required:!0,message:"请输入诊所名称",trigger:"blur"}],clinicIp:[{required:!0,message:"请输入IP地址",trigger:"blur"},{pattern:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,message:"IP地址格式错误",trigger:"blur"}],serverUser:[{required:!0,message:"请输入服务器登录名",trigger:"blur"}],serverPassword:[{required:!0,message:"请输入服务器密码",trigger:"blur"}],serverPost:[{required:!0,message:"请输入端口号",trigger:"blur"}],webSocketPost:[{required:!0,message:"请输入socket端口号",trigger:"blur"}],realmName:[{required:!0,message:"请输入诊所域名",trigger:"blur"}],creatTime:[{required:!0,message:"请选择购买时间",trigger:"change"}],expireTime:[{required:!0,message:"请选择到期时间",trigger:"change"}],versionInfo:[{required:!0,message:"请输入版本编号",trigger:"blur"}],region:[{required:!0,message:"请输入所在地区",trigger:"blur"}],phone:[{required:!0,message:"请输入手机号",trigger:"blur"},{pattern:/^1(3|4|5|7|8|9)\d{9}$/,message:"手机号格式错误",trigger:"blur"}],address:[{required:!0,message:"请输入详细地址",trigger:"blur"}],versionRefer:[{required:!0,message:"请选择购买版本",trigger:"blur"}]}}},computed:{},watch:{},created:function(){},mounted:function(){},methods:{onClose:function(){this.$emit("closeDialog"),this.formData={creatTime:null,expireTime:null}},handleConfirm:function(){var e=this;this.$refs.elForm.validate(function(){var r=Object(o["a"])(Object(s["a"])().mark((function r(a){var t,l;return Object(s["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!a){r.next=15;break}if(1!==e.pageType){r.next=8;break}return r.next=4,Object(i["a"])(e.formData);case 4:t=r.sent,200===t.code?(e.$emit("closeDialog"),e.$message.success("保存成功")):e.$message.error(t.msg),r.next=13;break;case 8:return console.log(e.formData),r.next=11,Object(i["cb"])(e.formData);case 11:l=r.sent,200===l.code?(e.$emit("closeDialog"),e.$message.success("保存成功"),e.formData={creatTime:null,expireTime:null}):e.$message.error(l.msg);case 13:r.next=17;break;case 15:return console.log("error submit!!"),r.abrupt("return",!1);case 17:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}())}}},c=n,m=a("2877"),p=Object(m["a"])(c,t,l,!1,null,null,null);r["default"]=p.exports}}]);