webpackJsonp([74],{"0TUI":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=a("aA9S"),r=a.n(i),l=a("osGO"),s=a.n(l),o={data:function(){return{visible:!1,isDisable:!0,isEdit:!0,dataForm:{name:"",type:"",desc:"",mchKeyConf:"",backUrlConf:"",remark:""},typeList:[{value:"0",label:"第三方支付"},{value:"1",label:"聚合支付"},{value:"2",label:"境外支付"}],dataRule:{name:[{required:!0,message:"请输入供应商名称",trigger:"blur"}],type:[{required:!0,message:"请选择供应商类型",trigger:"change"}]},apiData:{}}},methods:{init:function(){var e=this;this.visible=!0,this.$nextTick(function(){e.$refs.dataForm.resetFields(),e.dataForm.id&&(e.isDisable=!0,e.isEdit=!0,e.getSupplier())})},getSupplier:function(){var e=this;this.$http.get(window.SITE_CONFIG["baseURL-pay"]+"/supplier/"+this.dataForm.id).then(function(t){if(0==t.ec){if(!t.dt)return!1;console.log("-----data",t),t.dt.lst.type=t.dt.lst.type+"",r()(e.dataForm,t.dt.lst),e.apiData=r()({},e.dataForm)}})},editHandle:function(){this.isEdit=!this.isEdit,this.isDisable=!this.isDisable},dataFormSubmit:function(){var e=this;this.$refs.dataForm.validate(function(t){if(!t)return console.log("error submit!!"),!1;e.filterData()})},filterData:function(){if(s()(this.dataForm,this.apiData))this.editHandle();else{var e=[];for(var t in this.dataForm)if(this.dataForm.hasOwnProperty(t)){var a=this.dataForm[t];a!=this.apiData[t]&&e.push({key:t,part:"",value:a})}this.updateDetail(e)}},updateDetail:function(e){var t=this,a={id:this.dataForm.id,lst:e};this.$http.put(window.SITE_CONFIG["baseURL-pay"]+"/supplier",a).then(function(e){e&&0===e.ec&&t.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){t.visible=!1,t.$emit("refreshDataList")}})})}}},n={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:"供应商详情","close-on-click-modal":!1,visible:e.visible},on:{"update:visible":function(t){e.visible=t}}},[a("el-form",{ref:"dataForm",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"120px"},nativeOn:{keyup:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.dataFormSubmit()}}},[a("el-form-item",{attrs:{label:"供应商名称：",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入供应商名称",disabled:e.isDisable},model:{value:e.dataForm.name,callback:function(t){e.$set(e.dataForm,"name","string"==typeof t?t.trim():t)},expression:"dataForm.name"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"供应商类型：",prop:"type"}},[a("el-select",{attrs:{placeholder:"请选择供应商类型",disabled:e.isDisable},model:{value:e.dataForm.type,callback:function(t){e.$set(e.dataForm,"type",t)},expression:"dataForm.type"}},e._l(e.typeList,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))],1),e._v(" "),a("el-form-item",{attrs:{label:"供应商说明：",prop:"desc"}},[a("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入类型说明",disabled:e.isDisable},model:{value:e.dataForm.desc,callback:function(t){e.$set(e.dataForm,"desc",t)},expression:"dataForm.desc"}})],1),e._v(" "),"sh"!=e.$config.mode?a("el-form-item",{attrs:{label:"加密信息配置：",prop:"mchKeyConf"}},[a("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入加密信息配置",disabled:e.isDisable},model:{value:e.dataForm.mchKeyConf,callback:function(t){e.$set(e.dataForm,"mchKeyConf",t)},expression:"dataForm.mchKeyConf"}})],1):e._e(),e._v(" "),"sh"!=e.$config.mode?a("el-form-item",{attrs:{label:"回调信息配置：",prop:"backUrlConf"}},[a("el-input",{attrs:{type:"textarea",rows:2,placeholder:"请输入回调信息配置",disabled:e.isDisable},model:{value:e.dataForm.backUrlConf,callback:function(t){e.$set(e.dataForm,"backUrlConf",t)},expression:"dataForm.backUrlConf"}})],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"备注：",prop:"remark"}},[a("el-input",{attrs:{type:"textarea",rows:4,placeholder:"请输入备注",disabled:e.isDisable},model:{value:e.dataForm.remark,callback:function(t){e.$set(e.dataForm,"remark",t)},expression:"dataForm.remark"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.visible=!1}}},[e._v("关闭")]),e._v(" "),e.isEdit?e._e():a("el-button",{attrs:{type:"primary"},on:{click:e.dataFormSubmit}},[e._v("保存")]),e._v(" "),e.isEdit?a("el-button",{attrs:{type:"primary"},on:{click:e.editHandle}},[e._v("编辑")]):e._e()],1)],1)},staticRenderFns:[]},d=a("C7Lr")(o,n,!1,null,null,null);t.default=d.exports}});