webpackJsonp([21],{"1Yxf":function(t,a){},ftAF:function(t,a,e){"use strict";a.a={phone:{validator:function(t,a,e){a&&(/^1[3-9]\d{9}$/.test(a)?e():e(new Error("请输入正确的手机号")))},trigger:"blur"},number:{validator:function(t,a,e){a&&(/(^[0-9]*$)|(^[0-9]*\.[0-9]*$)/.test(a)?e():e(new Error("请输入正确的数值")))},trigger:"blur"},url:{validator:function(t,a,e){a&&(/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/.test(a)?e():e(new Error("请输入正确的网址")))},trigger:"blur"},email:{validator:function(t,a,e){a&&(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)?e():e(new Error("请输入正确的邮箱地址")))},trigger:"blur"},idCard:{validator:function(t,a,e){a&&(/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/.test(a)?e():e(new Error("请输入正确的身份证")))},trigger:"blur"},english:{validator:function(t,a,e){a&&(/[A-Za-z]/.test(a)?e():e(new Error("请输入正确的英文字符")))},trigger:"blur"}}},hcq8:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var o=e("mvHQ"),r=e.n(o),n=(e("ftAF"),{created:function(){var t=this;this.$route.query.column&&(this.subColumn=this.$route.query.column.split(",")[1],this.subValue=this.$route.query.column.split(",")[0]),this.$route.query.id?this.$http.get({url:"/couponInfo/getOne",data:{id:this.$route.query.id}}).then(function(a){a.success&&(t.formData=a.data,t.$route.query.column&&(t.formData[t.subColumn]=t.subValue))}):this.$route.query.column&&(this.formData[this.subColumn]=this.subValue)},data:function(){return{saving:!1,formData:{},rules:{},subColumn:"",subValue:""}},methods:{onSave:function(){var t=this;this.$refs.form.validate(function(a){if(!a)return!1;t.submit()})},submit:function(){var t=this,a=JSON.parse(r()(this.formData));this.$http.post({url:this.formData.id?"/couponInfo/update":"/couponInfo/save",data:a}).then(function(a){a.success?(t.$message.success("成功"),t.$router.go(-1)):t.$message.warning("失败")})},onDelete:function(){var t=this;this.$alert("删除将无法恢复，确认要删除么？","警告",{type:"error"}).then(function(){return t.$http.post({url:"/couponInfo/del",data:{id:t.formData.id}})}).then(function(){t.$message.success("删除成功"),t.$router.go(-1)}).catch(function(a){"cancel"===a?t.$message.info("删除取消"):t.$message.error("删除失败")})}}}),i={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:t.formData,rules:t.rules,"label-width":"80px","label-position":"right",size:"small"}},[e("el-form-item",{attrs:{prop:"name",label:"名称"}},[e("el-input",{attrs:{disabled:"name"==t.subColumn},model:{value:t.formData.name,callback:function(a){t.$set(t.formData,"name",a)},expression:"formData.name"}})],1),t._v(" "),e("el-form-item",{attrs:{prop:"discription",label:"描述"}},[e("el-input",{attrs:{disabled:"discription"==t.subColumn},model:{value:t.formData.discription,callback:function(a){t.$set(t.formData,"discription",a)},expression:"formData.discription"}})],1),t._v(" "),e("el-form-item",{attrs:{prop:"discountMoney",label:"抵扣金额"}},[e("el-input",{attrs:{disabled:"discountMoney"==t.subColumn},model:{value:t.formData.discountMoney,callback:function(a){t.$set(t.formData,"discountMoney",a)},expression:"formData.discountMoney"}})],1),t._v(" "),e("el-form-item",{attrs:{prop:"limitMoney",label:"限制金额"}},[e("el-input",{attrs:{disabled:"limitMoney"==t.subColumn},model:{value:t.formData.limitMoney,callback:function(a){t.$set(t.formData,"limitMoney",a)},expression:"formData.limitMoney"}})],1),t._v(" "),e("el-form-item",{attrs:{prop:"typeFlag",label:"类型"}},[e("el-input",{attrs:{disabled:"typeFlag"==t.subColumn},model:{value:t.formData.typeFlag,callback:function(a){t.$set(t.formData,"typeFlag",a)},expression:"formData.typeFlag"}})],1),t._v(" "),e("el-form-item",{attrs:{prop:"statusFlag",label:"状态"}},[e("el-input",{attrs:{disabled:"statusFlag"==t.subColumn},model:{value:t.formData.statusFlag,callback:function(a){t.$set(t.formData,"statusFlag",a)},expression:"formData.statusFlag"}})],1),t._v(" "),e("el-form-item",{attrs:{prop:"availableDays",label:"有效天数"}},[e("el-input",{attrs:{disabled:"availableDays"==t.subColumn},model:{value:t.formData.availableDays,callback:function(a){t.$set(t.formData,"availableDays",a)},expression:"formData.availableDays"}})],1),t._v(" "),e("el-form-item",[e("el-button",{attrs:{loading:t.$store.state.fetchingData,type:"primary"},on:{click:t.onSave}},[t._v("保存")]),t._v(" "),t.formData.id?e("el-button",{attrs:{type:"danger"},on:{click:t.onDelete}},[t._v("删除")]):t._e(),t._v(" "),e("el-button",{on:{click:function(a){t.$router.go(-1)}}},[t._v("取消")])],1)],1)],1)},staticRenderFns:[]};var s=e("VU/8")(n,i,!1,function(t){e("1Yxf")},"data-v-93af2462",null);a.default=s.exports},mvHQ:function(t,a,e){t.exports={default:e("qkKv"),__esModule:!0}},qkKv:function(t,a,e){var o=e("FeBl"),r=o.JSON||(o.JSON={stringify:JSON.stringify});t.exports=function(t){return r.stringify.apply(r,arguments)}}});