(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-038964bb"],{"1c00":function(e,t,r){"use strict";r("e3c6")},a0b0:function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",[e.addProtocolTypeDialog?r("el-dialog",{attrs:{title:e.addProtocolTypeTitle,visible:e.addProtocolTypeDialog,width:"700px","close-on-press-escape":!1,"close-on-click-modal":!1},on:{"update:visible":function(t){e.addProtocolTypeDialog=t},close:e.cancel}},[r("el-form",{ref:"ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"120px","label-position":"right"}},[r("el-form-item",{attrs:{label:"所属目录:"}},[e._v(" "+e._s(e.treeName)+" ")]),r("el-form-item",{attrs:{label:"项目编号:",prop:"projectCode"}},[r("el-input",{staticStyle:{width:"450px"},attrs:{placeholder:"请输入项目编号"},model:{value:e.ruleForm.projectCode,callback:function(t){e.$set(e.ruleForm,"projectCode",t)},expression:"ruleForm.projectCode"}})],1),r("el-form-item",{attrs:{label:"项目名称:",prop:"projectName"}},[r("el-input",{staticStyle:{width:"450px"},attrs:{placeholder:"请输入项目名称"},model:{value:e.ruleForm.projectName,callback:function(t){e.$set(e.ruleForm,"projectName",t)},expression:"ruleForm.projectName"}})],1),r("el-form-item",{attrs:{label:"单价:",prop:"unitPrice"}},[r("el-input",{staticClass:"content",staticStyle:{width:"450px"},attrs:{placeholder:"请输入单价"},on:{input:function(t){e.ruleForm.unitPrice=e.ruleForm.unitPrice.replace(/[^0-9.]/g,"")}},model:{value:e.ruleForm.unitPrice,callback:function(t){e.$set(e.ruleForm,"unitPrice",t)},expression:"ruleForm.unitPrice"}})],1),r("el-form-item",{attrs:{label:"单位:",prop:"unit"}},[r("el-select",{staticStyle:{width:"450px"},attrs:{placeholder:"请选择单位"},model:{value:e.ruleForm.unit,callback:function(t){e.$set(e.ruleForm,"unit",t)},expression:"ruleForm.unit"}},e._l(e.unitOptions,(function(e){return r("el-option",{key:e.id,attrs:{label:e.dictName,value:e.dictValue}})})),1)],1),r("el-form-item",{attrs:{label:"排序:",prop:"orderNum",placeholder:"项目编号"}},[r("el-input-number",{attrs:{min:0,placeholder:"请输入排序"},model:{value:e.ruleForm.orderNum,callback:function(t){e.$set(e.ruleForm,"orderNum",t)},expression:"ruleForm.orderNum"}})],1),r("el-form-item",{attrs:{label:"状态:",prop:"status"}},[r("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:e.ruleForm.status,callback:function(t){e.$set(e.ruleForm,"status",t)},expression:"ruleForm.status"}})],1)],1),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:e.cancel}},[e._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:e.submit}},[e._v("确 定")])],1)],1):e._e()],1)},l=[],a=r("c7eb"),i=r("1da1"),s=r("943d"),n={name:"AddProtocolTypeDialog",props:{listInId:{type:String,default:""},treeName:{type:String,default:""},editTable:{type:Object,default:{}},addProtocolTypeTitle:{type:String,default:""}},watch:{editTable:function(e){this.ruleForm=e}},data:function(){return{addProtocolTypeDialog:!1,diagnosisTypeTemplateList:[],ruleForm:{protocolTemplateName:"",status:1,protocolTemplateContent:""},unitOptions:[],rules:{projectCode:[{required:!0,message:"请输入项目编号",trigger:"blur"}],projectName:[{required:!0,message:"请输入项目名称",trigger:"blur"}],unitPrice:[{required:!0,message:"请输入单价",trigger:"blur"}],unit:[{required:!0,message:"请选择单位",trigger:"change"}],orderNum:[{required:!0,message:"请输入排序",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"change"}]}}},mounted:function(){var e=this;this.initSysUserSexerm_unit_settings(),this.$nextTick((function(){console.log(e.ruleForm,"this.ruleForm"),e.ruleForm=e.editTable}))},methods:{cancel:function(){this.addProtocolTypeDialog=!1},initSysUserSexerm_unit_settings:function(){var e=this;return Object(i["a"])(Object(a["a"])().mark((function t(){var r;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["k"])("erm_unit_settings");case 2:r=t.sent,e.unitOptions=r.data;case 4:case"end":return t.stop()}}),t)})))()},submit:function(){var e=this;this.$refs.ruleForm.validate(function(){var t=Object(i["a"])(Object(a["a"])().mark((function t(r){var o,l;return Object(a["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=24;break}if("新建"!==e.addProtocolTypeTitle){t.next=12;break}return e.ruleForm.collectCostTypeId=e.listInId,t.next=5,Object(s["s"])(e.ruleForm);case 5:if(o=t.sent,200===o.code){t.next=8;break}return t.abrupt("return",e.$message.error(o.msg));case 8:e.ruleForm={projectCode:"",projectName:"",unitPrice:"",unit:"",orderNum:"",status:1},e.$message.success("新建成功!"),t.next=20;break;case 12:return e.ruleForm.collectCostTypeId=e.listInId,t.next=15,Object(s["w"])(e.ruleForm);case 15:if(l=t.sent,200===l.code){t.next=18;break}return t.abrupt("return",e.$message.error(l.msg));case 18:e.ruleForm={projectCode:"",projectName:"",unitPrice:"",unit:"",orderNum:"",status:1},e.$message.success("编辑成功!");case 20:e.$parent.initList(),e.addProtocolTypeDialog=!1,t.next=26;break;case 24:return console.log("error submit!!"),t.abrupt("return",!1);case 26:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}}},c=n,u=(r("1c00"),r("2877")),m=Object(u["a"])(c,o,l,!1,null,"03d8c47b",null);t["default"]=m.exports},e3c6:function(e,t,r){}}]);