説明なし

6.864076a13981526c6abe.js 2.2KB

    webpackJsonp([6],{"52Vs":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o={data:function(){return{form:{name:"",phone:"",operator_id:""},rules:{name:[{required:!0,message:"请输入姓名",trigger:"blur"}],phone:[{required:!0,message:"电话号码不能为空"},{validator:function(e,t,r){0==/^((1[3-8][0-9])+\d{8})$/.test(t)?r(new Error("电话号码不正确")):r()},trigger:"blur"}]}}},created:function(){void 0!=this.$route.params.operator_id&&(this.form=this.$route.params),console.log(),console.log(this.form)},methods:{onSubmit:function(e){var t=this;this.$refs[e].validate(function(e){if(!e)return console.log("error submit!!"),!1;var r=t;0!=t.form.operator_id.length?t.$axios.post("operator/update",t.form).then(function(e){200==e.data.status?(r.$message({type:"success",message:"修改成功!"}),r.$router.back()):r.$message({type:"failure",message:"修改失败!"})}):t.$axios.post("operator/add",t.form).then(function(e){200==e.data.status?(r.$message({type:"success",message:"添加成功!"}),r.$router.back()):r.$message({type:"failure",message:"添加失败!"})})})}}},a={render:function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"setting-operator-editor"},[r("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"姓名",prop:"name"}},[r("el-input",{attrs:{placeholder:"请输入姓名"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"电话",prop:"phone"}},[r("el-input",{attrs:{placeholder:"请输入电话号码",disabled:e.form.operator_id.length>0},model:{value:e.form.phone,callback:function(t){e.$set(e.form,"phone",e._n(t))},expression:"form.phone"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"密码",prop:"password"}},[r("el-input",{attrs:{placeholder:"默认为手机号后六位",disabled:!0}})],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:function(t){e.onSubmit("form")}}},[e._v("保存")])],1)],1)],1)},staticRenderFns:[]};var s=r("VU/8")(o,a,!1,function(e){r("yaVd")},"data-v-6e591122",null);t.default=s.exports},yaVd:function(e,t){}}); //# sourceMappingURL=6.864076a13981526c6abe.js.map