webpackJsonp([11],{"/emZ":function(e,t,o){"use strict";var n=o("woOf"),l=o.n(n),a=o("4cjj"),r=o("UgCr"),i=o("mRsl"),u={type:0,name:null,platform:0,amount:null,perLimit:1,minPoint:null,startTime:null,endTime:null,useType:0,note:null,publishCount:null,productRelationList:[],productCategoryRelationList:[]},s=[{label:"全场赠券",value:0},{label:"会员赠券",value:1},{label:"购物赠券",value:2},{label:"注册赠券",value:3}],c=[{label:"全平台",value:0},{label:"移动平台",value:1},{label:"PC平台",value:2}],p={name:"CouponDetail",props:{isEdit:{type:Boolean,default:!1}},data:function(){return{coupon:l()({},u),typeOptions:l()({},s),platformOptions:l()({},c),rules:{name:[{required:!0,message:"请输入优惠券名称",trigger:"blur"},{min:2,max:140,message:"长度在 2 到 140 个字符",trigger:"blur"}],publishCount:[{type:"number",required:!0,message:"只能输入正整数",trigger:"blur"}],amount:[{type:"number",required:!0,message:"面值只能是数值,0.01-10000,限2位小数",trigger:"blur"}],minPoint:[{type:"number",required:!0,message:"只能输入正整数",trigger:"blur"}]},selectProduct:null,selectProductLoading:!1,selectProductOptions:[],selectProductCate:null,productCateOptions:[]}},created:function(){var e=this;this.isEdit&&Object(a.d)(this.$route.query.id).then(function(t){e.coupon=t.data}),this.getProductCateList()},methods:{onSubmit:function(e){var t=this;this.$refs[e].validate(function(o){if(!o)return t.$message({message:"验证失败",type:"error",duration:1e3}),!1;t.$confirm("是否提交数据","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.isEdit?Object(a.e)(t.$route.query.id,t.coupon).then(function(o){t.$refs[e].resetFields(),t.$message({message:"修改成功",type:"success",duration:1e3}),t.$router.back()}):Object(a.a)(t.coupon).then(function(o){t.$refs[e].resetFields(),t.$message({message:"提交成功",type:"success",duration:1e3}),t.$router.back()})})})},resetForm:function(e){this.$refs[e].resetFields(),this.coupon=l()({},u)},searchProductMethod:function(e){var t=this;""!==e?(this.loading=!0,Object(r.c)({keyword:e}).then(function(e){t.loading=!1;var o=e.data;t.selectProductOptions=[];for(var n=0;n0)for(var a=0;a"+e._s(t.row.productCategoryName))]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"操作",align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(o){e.handleDeleteProductCateRelation(t.$index,t.row)}}},[e._v("删除\n ")])]}}])})],1)],1),e._v(" "),o("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.coupon.useType,expression:"coupon.useType===2"}]},[o("el-select",{attrs:{filterable:"",remote:"","reserve-keyword":"",placeholder:"商品名称/商品货号","remote-method":e.searchProductMethod,loading:e.selectProductLoading},model:{value:e.selectProduct,callback:function(t){e.selectProduct=t},expression:"selectProduct"}},e._l(e.selectProductOptions,function(t){return o("el-option",{key:t.productId,attrs:{label:t.productName,value:t.productId}},[o("span",{staticStyle:{float:"left"}},[e._v(e._s(t.productName))]),e._v(" "),o("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v("NO."+e._s(t.productSn))])])})),e._v(" "),o("el-button",{on:{click:function(t){e.handleAddProductRelation()}}},[e._v("添加")]),e._v(" "),o("el-table",{ref:"productRelationTable",staticStyle:{width:"100%","margin-top":"20px"},attrs:{data:e.coupon.productRelationList,border:""}},[o("el-table-column",{attrs:{label:"商品名称",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.productName))]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"货号",align:"center",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("NO."+e._s(t.row.productSn))]}}])}),e._v(" "),o("el-table-column",{attrs:{label:"操作",align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(o){e.handleDeleteProductRelation(t.$index,t.row)}}},[e._v("删除\n ")])]}}])})],1)],1),e._v(" "),o("el-form-item",{attrs:{label:"备注:"}},[o("el-input",{staticClass:"input-width",attrs:{type:"textarea",rows:5,placeholder:"请输入内容"},model:{value:e.coupon.note,callback:function(t){e.$set(e.coupon,"note",t)},expression:"coupon.note"}})],1),e._v(" "),o("el-form-item",[o("el-button",{attrs:{type:"primary"},on:{click:function(t){e.onSubmit("couponFrom")}}},[e._v("提交")]),e._v(" "),e.isEdit?e._e():o("el-button",{on:{click:function(t){e.resetForm("couponFrom")}}},[e._v("重置")])],1)],1)],1)},staticRenderFns:[]};var m=o("VU/8")(p,d,!1,function(e){o("WhCT")},"data-v-2e927c8f",null);t.a=m.exports},"718U":function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={name:"addCoupon",components:{CouponDetail:o("/emZ").a}},l={render:function(){var e=this.$createElement;return(this._self._c||e)("coupon-detail",{attrs:{isEdit:!1}})},staticRenderFns:[]};var a=o("VU/8")(n,l,!1,function(e){o("gP7y")},"data-v-cbf63dee",null);t.default=a.exports},WhCT:function(e,t){},gP7y:function(e,t){}}); //# sourceMappingURL=11.6e59c886413ee6e056dc.js.map