(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-09cc295c"],{"3a0e":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"app-container"},[t._m(0),o("div",{staticClass:"app-section-container"},[o("div",{staticClass:"app-section-container-left"},[o("tabbar-left",{attrs:{position:t.position},on:{tabSwitch:t.tabSwitch}},t._l(t.tabbarOptions,(function(t){return o("tabbar-item",{key:t.value,attrs:{label:t.label,"icon-name":t.iconName,name:t.value,disabled:t.disabled}})})),1)],1),o("div",{staticClass:"app-section-container-right"},[o("Form",{directives:[{name:"show",rawName:"v-show",value:"1"==t.position,expression:"position == '1'"}],attrs:{form:t.protocolForm},on:{"update:form":function(e){t.protocolForm=e},submit:t.submitForm,goBack:t.goBack}}),o("CustomTextTemplate",{directives:[{name:"show",rawName:"v-show",value:"2"==t.position,expression:"position == '2'"}],attrs:{customTextTemplate:t.customTextTemplateList},on:{submit:t.submitFormField,"update:customTextTemplate":function(e){t.customTextTemplateList=e},"update:custom-text-template":function(e){t.customTextTemplateList=e},goBack:t.goBack}})],1)])])},a=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"app-container--hd pb-20 mb20"},[o("h3",[t._v("协议编辑")])])}],r=(o("2397"),o("ac6a"),o("55dd"),o("96cf"),o("1da1")),n=o("d4ec"),c=o("bee2"),s=o("99de"),u=o("7e84"),l=o("262e"),p=o("9ab4"),d=o("60a3"),m=o("ad3d"),f=o("cc94"),b=o("7d41"),h=o("1e5e"),v=o("3a9d");function _(t,e,o){return e=Object(u["a"])(e),Object(s["a"])(t,w()?Reflect.construct(e,o||[],Object(u["a"])(t).constructor):e.apply(t,o))}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(w=function(){return!!t})()}var O=function(t){function e(){var t;return Object(n["a"])(this,e),t=_(this,e,arguments),t.protocolForm={protocol_id:null,trade_type_id:"",title:"",status:1,protocol:"",mobile_sign:0,is_protocol:1},t.position="1",t.customTextTemplateList=[],t.tabbarOptions=[{label:"基本信息",value:"1",iconName:"icon_project",disabled:!1},{label:"采集项配置",value:"2",iconName:"icon_project",disabled:!1}],t}return Object(l["a"])(e,t),Object(c["a"])(e,[{key:"protocol_id",get:function(){return this.$route.query.protocol_id}},{key:"goBack",value:function(){this.$router.back()}},{key:"tabSwitch",value:function(t){this.position=t}},{key:"submitForm",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(v["g"])(e);case 2:this.position="2";case 3:case"end":return t.stop()}}),t,this)})));function e(e){return t.apply(this,arguments)}return e}()},{key:"getProtocolFieldDetail",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,o;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(v["e"])({protocol_id:this.protocol_id});case 2:e=t.sent,o=e.data,this.customTextTemplateList=o.map((function(t){var e=t.field_id,o=t.field_name,i=t.field_select_value,a=t.sort,r=t.field_type,n=t.is_require;return{field_id:e,field_name:o,sort:a,field_type:r,is_require:n,field_select_value:i?JSON.parse(i):""}}));case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"submitFormField",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=JSON.parse(JSON.stringify(this.customTextTemplateList)),e.forEach((function(t,e){t.sort=e,t.field_id=t.field_id<1e5?t.field_id:0,t.field_select_value=JSON.stringify(t.field_select_value)})),t.next=4,Object(v["b"])({protocol_id:this.protocolForm.protocol_id,field_info:JSON.stringify(e)});case 4:this.$message.success("操作成功"),this.goBack();case 6:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"created",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!this.protocol_id){t.next=7;break}return t.next=3,Object(v["d"])({protocol_id:this.protocol_id});case 3:for(i in e=t.sent,o=e.data,this.protocolForm)this.protocolForm[i]=o[i];this.getProtocolFieldDetail();case 7:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}]),e}(d["i"]);O=Object(p["a"])([Object(d["a"])({name:"EditProtocol",components:{Form:b["default"],TabbarLeft:m["a"],tabbarItem:f["a"],CustomTextTemplate:h["default"]}})],O);var g=O,k=g,x=(o("a565"),o("2877")),y=Object(x["a"])(k,i,a,!1,null,"29fad4d0",null);e["default"]=y.exports},7930:function(t,e,o){},a565:function(t,e,o){"use strict";o("7930")}}]);