(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0c1d91"],{4890:function(e,a,t){"use strict";t.r(a);var l=function(){var e=this,a=e.$createElement,t=e._self._c||a;return t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("j-form-container",{attrs:{disabled:e.formDisabled}},[t("a-form-model",{ref:"form",attrs:{slot:"detail",model:e.model,rules:e.validatorRules},slot:"detail"},[t("a-row",[t("a-col",{attrs:{span:24}},[t("a-form-model-item",{attrs:{label:"租户名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{attrs:{placeholder:"请输入租户名称"},model:{value:e.model.name,callback:function(a){e.$set(e.model,"name",a)},expression:"model.name"}})],1)],1),t("a-col",{attrs:{span:24}},[t("a-form-model-item",{attrs:{label:"租户编号",labelCol:e.labelCol,wrapperCol:e.wrapperCol,prop:"id"}},[t("a-input-number",{staticStyle:{width:"100%"},attrs:{min:1,placeholder:"请输入租户编号",disabled:e.disabledId},model:{value:e.model.id,callback:function(a){e.$set(e.model,"id",a)},expression:"model.id"}})],1)],1),t("a-col",{attrs:{span:24}},[t("a-form-model-item",{attrs:{label:"开始时间",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("j-date",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择开始时间","show-time":!0,"date-format":"YYYY-MM-DD HH:mm:ss"},model:{value:e.model.beginDate,callback:function(a){e.$set(e.model,"beginDate",a)},expression:"model.beginDate"}})],1)],1),t("a-col",{attrs:{span:24}},[t("a-form-model-item",{attrs:{label:"结束时间",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("j-date",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择结束时间","show-time":!0,"date-format":"YYYY-MM-DD HH:mm:ss"},model:{value:e.model.endDate,callback:function(a){e.$set(e.model,"endDate",a)},expression:"model.endDate"}})],1)],1),t("a-col",{attrs:{span:24}},[t("a-form-model-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{attrs:{name:"tenantStatus"},model:{value:e.model.status,callback:function(a){e.$set(e.model,"status",a)},expression:"model.status"}},[t("a-radio",{attrs:{value:1}},[e._v("正常")]),t("a-radio",{attrs:{value:0}},[e._v("冻结")])],1)],1)],1),e.showFlowSubmitButton?t("a-col",{staticStyle:{"text-align":"center"},attrs:{span:24}},[t("a-button",{on:{click:e.submitForm}},[e._v("提 交")])],1):e._e()],1)],1)],1)],1)},o=[],s=t("0fea"),r=(t("ca00"),t("c681")),i=t("2dab"),n=t("7b16"),d={name:"TenantForm",components:{JFormContainer:r["default"],JDate:i["default"],JDictSelectTag:n["default"]},props:{formData:{type:Object,default:function(){},required:!1},normal:{type:Boolean,default:!1,required:!1},disabled:{type:Boolean,default:!1,required:!1}},data:function(){return{model:{status:1},id:"",labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,validatorRules:{id:[{required:!0,message:"请输入租户编号!"}]},url:{add:"/sys/tenant/add",edit:"/sys/tenant/edit",queryById:"/sys/tenant/queryById"}}},computed:{formDisabled:function(){return!1===this.normal?!1!==this.formData.disabled:this.disabled},disabledId:function(){return!!this.id},showFlowSubmitButton:function(){return!1===this.normal&&!1===this.formData.disabled}},created:function(){this.showFlowData()},methods:{show:function(e){this.model=e?Object.assign({},e):this.model,this.id=e?e.id:"",this.visible=!0},showFlowData:function(){var e=this;if(!1===this.normal){var a={id:this.formData.dataId};Object(s["c"])(this.url.queryById,a).then((function(a){a.success&&e.edit(a.result)}))}},submitForm:function(){var e=this,a=this;a.$refs.form.validate((function(t){if(!t)return!1;a.confirmLoading=!0;var l="",o="";e.id?(l+=e.url.edit,o="put"):(l+=e.url.add,o="post"),Object(s["h"])(l,e.model,o).then((function(t){t.success?(a.$message.success(t.message),a.$emit("ok")):("该编号已存在!"==t.message&&(e.model.id=""),a.$message.warning(t.message))})).finally((function(){a.confirmLoading=!1}))}))},popupCallback:function(e){this.model=Object.assign(this.model,e)}}},m=d,u=t("2877"),c=Object(u["a"])(m,l,o,!1,null,null,null);a["default"]=c.exports}}]);