chunk-283434ee.b09c7382.js 17 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-283434ee"],{"104d":function(e,t,a){"use strict";a.d(t,"h",(function(){return r})),a.d(t,"e",(function(){return i})),a.d(t,"b",(function(){return n})),a.d(t,"d",(function(){return l})),a.d(t,"c",(function(){return d})),a.d(t,"f",(function(){return c})),a.d(t,"a",(function(){return u})),a.d(t,"g",(function(){return p}));var o=a("b775"),s={list:"/kjActivity/list",down:"/kjActivity/down",add:"/kjActivity/add",detail:"/kjActivity/detail",audit:"/kjActivity/audit",edit:"/kjActivity/edit",activityInfo:"/kjActivity/activityinfo",joinList:"/kjActivity/joinlist"};function r(e){return Object(o["b"])({url:s.list,method:"get",params:e})}function i(e){return Object(o["b"])({url:s.down,method:"post",data:e})}function n(e){return Object(o["b"])({url:s.add,method:"post",data:e})}function l(e){return Object(o["b"])({url:s.detail,method:"get",params:e})}function d(e){return Object(o["b"])({url:s.audit,method:"post",data:e})}function c(e){return Object(o["b"])({url:s.edit,method:"post",data:e})}function u(e){return Object(o["b"])({url:s.activityInfo,method:"get",params:e})}function p(e){return Object(o["b"])({url:s.joinList,method:"get",params:e})}},"2b53":function(e,t,a){"use strict";a("6b20")},"6b20":function(e,t,a){},ab4e:function(e,t,a){"use strict";a("ffd7")},d70c:function(e,t,a){"use strict";a.r(t);a("72dd"),a("edc0");var o=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form,selfUpdate:!0},on:{submit:e.handleSubmit}},[t("div",{staticClass:"tabs-content"},[t("div",{staticClass:"title"},[e._v("活动基本信息")]),t("a-form-item",{attrs:{label:"活动名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,message:"请输入活动名称"}]}],expression:"['name', { rules: [{ required: true, message: '请输入活动名称' }] }]"}],staticClass:"pageInupt",attrs:{maxLength:15,placeholder:"请输入活动名称"}}),t("span",{staticClass:"input-text_right"},[e._v("(仅内部可见)")])],1),t("a-form-item",{attrs:{label:"活动编码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{staticClass:"pageInupt",attrs:{placeholder:"请输入活动编码",disabled:""}})],1),t("a-form-item",{attrs:{label:"砍价类型",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["kj_type",{initialValue:1,rules:[{required:!0}]}],expression:"['kj_type', { initialValue: 1, rules: [{ required: true }] }]"}],on:{change:e.handleChange}},[t("a-radio",{attrs:{value:1}},[e._v("促销版")]),t("a-radio",{attrs:{value:2}},[e._v("拉新版")])],1)],1),t("a-form-item",{attrs:{label:"活动时间",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["between_time",{rules:[{required:!0,message:"请选择活动时间"}]}],expression:"[\n 'between_time',\n {\n rules: [{ required: true, message: '请选择活动时间' }],\n },\n ]"}],staticClass:"pageInupt",attrs:{"show-time":!0,format:"YYYY-MM-DD HH:mm",placeholder:["开始时间","结束时间"],"disabled-date":e.disabledDate}})],1),t("a-form-item",{attrs:{label:"砍价有效期",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["expire_hour",{rules:[{required:!0,message:"请输入砍价有效期"}]}],expression:"['expire_hour', { rules: [{ required: true, message: '请输入砍价有效期' }] }]"}],staticClass:"pageInupt",attrs:{placeholder:"请输入砍价有效期,单位:小时"},on:{change:function(e){e.target.value=e.target.value.replace(/[^0-9]/g,"")}}}),t("span",{staticClass:"input-text_right"},[e._v("自用户发起砍价到砍价截止的时间,单位:小时")])],1),t("a-form-item",{attrs:{label:"分享标题",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["share_title",{rules:[{required:!0,message:"请输入分享标题"}]}],expression:"['share_title', { rules: [{ required: true, message: '请输入分享标题' }] }]"}],staticClass:"pageInupt",attrs:{maxLength:28,placeholder:"请输入分享标题"}}),t("span",{staticClass:"input-text_right"},[e._v("字数上限 28 个字")])],1),t("a-form-item",{attrs:{label:"自己砍价",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["self_kj_percent",{rules:[{required:!0,message:"请输入自己砍价百分比"}]}],expression:"['self_kj_percent', { rules: [{ required: true, message: '请输入自己砍价百分比' }] }]"}],staticClass:"pageInupt",attrs:{placeholder:"请输入自己砍价百分比"},on:{change:function(e){e.target.value=e.target.value.replace(/[^0-9]/g,"")}}}),t("span",{staticClass:"lastTitle"},[e._v("%")]),t("span",{staticClass:"input-text_right"},[e._v("默认发起砍价时自己砍价,砍价金额 = (商品促销价 - 活动底价)x 自己砍价百分比")])],1),t("a-form-item",{attrs:{label:"最多可助力",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["limit_kj_day_cnt",{rules:[{required:!0,message:"请输入最多可助力人数"}]}],expression:"['limit_kj_day_cnt', { rules: [{ required: true, message: '请输入最多可助力人数' }] }]"}],staticClass:"pageInupt",attrs:{placeholder:"请输入最多可助力人数"},on:{change:function(e){e.target.value=e.target.value.replace(/[^0-9]/g,"")}}}),t("span",{staticClass:"lastTitle"},[e._v("人")]),t("span",{staticClass:"input-text_right"},[e._v("同一用户每日最多可帮助xx位好友砍价")])],1),t("a-form-item",{attrs:{label:"参与次数上限",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["fq_count",{rules:[{required:!0,message:"请输入参与次数上限"}]}],expression:"['fq_count', { rules: [{ required: true, message: '请输入参与次数上限' }] }]"}],staticClass:"pageInupt",on:{change:function(e){e.target.value=e.target.value.replace(/[^0-9]/g,"")}}}),t("span",{staticClass:"lastTitle"},[e._v("次")]),t("span",{staticClass:"input-text_right"},[e._v("同一用户每期砍价活动最多可以参与的次数")])],1),t("div",{staticClass:"title"},[e._v("选择活动商品")]),t("div",{staticClass:"setGoods"},[t("a-button",{staticStyle:{"margin-left":"5.5%","margin-bottom":"15px"},attrs:{type:"primary"},on:{click:e.showChoiceGooods}},[e._v("添加商品")]),t("span",{staticStyle:{"margin-left":"15px"}},[e._v("仅支持选择一款且是单规格的普通商品")]),t("a-table",{staticClass:"goodsBox",staticStyle:{"margin-left":"5.5%"},attrs:{rowKey:"goods_id",columns:e.goodsColumns,dataSource:e.goodsData,pagination:!1,bordered:""},scopedSlots:e._u([{key:"goods_image",fn:function(e){return t("span",{},[t("a",{attrs:{title:"点击查看原图",href:e,target:"_blank"}},[t("img",{staticStyle:{"object-fit":"cover"},attrs:{width:"50",height:"50",src:e,alt:"商品图片"}})])])}},{key:"goods_price_min",fn:function(a){return t("span",{},[t("p",[e._v("¥"+e._s(a))])])}},{key:"status",fn:function(a){return t("span",{},[t("p",[e._v(e._s(10==a?"上架":"下架"))])])}},{key:"floorPrice",fn:function(a){return t("span",{},[t("a-form-item",{attrs:{label:"",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["low_price",{initialValue:a,rules:[{required:!0,message:"请输入"}]}],expression:"['low_price', { initialValue: text, rules: [{ required: true, message: '请输入' }] }]"}],staticClass:"aInput",attrs:{min:0,precision:2}})],1)],1)}},{key:"userNumber",fn:function(a){return t("span",{},[t("a-form-item",{attrs:{label:"",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["help_kj_up_cnt",{initialValue:a,rules:[{required:!0,message:"请输入"}]}],expression:"[\n 'help_kj_up_cnt',\n { initialValue: text, rules: [{ required: true, message: '请输入' }] },\n ]"}],staticClass:"goodsInput",attrs:{min:0},on:{change:function(e){e.target.value=e.target.value.replace(/[^0-9]/g,"")}}})],1)],1)}},{key:"limit_stock",fn:function(a,o){return[t("a-form-item",{attrs:{label:"",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["limit_stock",{initialValue:a,rules:[{required:!0,message:"请输入"}]}],expression:"[\n 'limit_stock',\n { initialValue: text, rules: [{ required: true, message: '请输入' }] },\n ]"}],attrs:{min:1,max:o.stock_total}})],1)]}},{key:"action",fn:function(a,o,s){return t("span",{},[t("a-button",{attrs:{type:"danger"},on:{click:function(t){return e.deleteGoods(s)}}},[e._v("删除")])],1)}}])},[t("span",{attrs:{slot:"customTitle"},slot:"customTitle"},[e._v(" 帮砍人数上限 "),t("a-tooltip",{attrs:{placement:"topLeft"}},[t("template",{slot:"title"},[t("p",[e._v("帮砍人数达到上限后,价格被砍至底价")])]),t("a-icon",{attrs:{type:"question-circle",theme:"filled"}})],2)],1)])],1)],1),t("a-form-item",{staticClass:"mt-20",attrs:{"wrapper-col":{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交审核")])],1)],1),t("ChoiceGooods",{ref:"ChoiceGooods",on:{handleSubmit:e.handleChoiceGooods}})],1)],1)},s=[],r=(a("9f29"),a("0528"),a("a2bf"),a("104d")),i=a("e533"),n=a("9b2d"),l=a.n(n),d=a("2f42"),c=a.n(d),u=[{title:"商品spu编码",width:"170px",dataIndex:"goods_no"},{title:"商品标题",width:"240px",ellipsis:!0,dataIndex:"goods_name"},{title:"商品图片",width:"80px",dataIndex:"goods_image",scopedSlots:{customRender:"goods_image"}},{title:"促销价(售价)",width:"100px",dataIndex:"goods_price_min",scopedSlots:{customRender:"goods_price_min"}},{title:"状态",width:"60px",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"活动底价",width:"100px",dataIndex:"floor_price",scopedSlots:{customRender:"floorPrice"}},{width:"110px",dataIndex:"user_number",slots:{title:"customTitle"},scopedSlots:{customRender:"userNumber"}},{title:"活动商品库存(件)",width:"140px",dataIndex:"limit_stock",scopedSlots:{customRender:"limit_stock"}},{title:"操作",width:"80px",dataIndex:"action",scopedSlots:{customRender:"action"}}],p={components:{ChoiceGooods:i["a"]},data:function(){return{labelCol:{span:3},wrapperCol:{span:20},isLoading:!1,isBtnLoading:!1,form:this.$form.createForm(this),goodsColumns:u,goodsData:[],goodsDataSku:[],detail:{},isSuper:1,role:""}},created:function(){var e=this;if(this.$store.getters.roles){this.isSuper=this.$store.getters.roles.isSuper;var t=this.$store.getters.roles.permissions;t.forEach((function(t){"/activityCenter/bargain/index"==t.permissionId&&t.actionEntitySet&&t.actionEntitySet.length>0&&(e.role=t.actionEntitySet[0].action)}))}},methods:{disabledDate:function(e){return e&&e<c()().subtract(1,"days")},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){if(e)return!1;var o=[];t.goodsData&&0==t.goodsData.length?t.$message.error("请添加活动商品",1.5):(t.goodsData.forEach((function(e){o.push({goods_id:e.goods_id,goods_sku_id:e.goods_id,low_price:a.low_price,help_kj_up_cnt:a.help_kj_up_cnt,limit_stock:a.limit_stock})})),a.goods=o,a.role="activity-zg-audit"==t.role?1:2,a.start_time=t.timeFormate(a.between_time[0]),a.end_time=t.timeFormate(a.between_time[1]),t.onFormSubmit(a))}))},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,r["b"]({form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){t.$router.push("./index")}),1500)})).catch((function(){t.isBtnLoading=!1})).finally((function(){t.isLoading=!1}))},showChoiceGooods:function(){this.$refs.ChoiceGooods.open(this.goodsData)},handleChoiceGooods:function(){var e=l.a.get("selectListSpu");this.goodsData=e||[]},deleteGoods:function(e){var t=this;this.$confirm({title:"提示",content:"确认移除吗?",okText:"确定",cancelText:"取消",onOk:function(){t.goodsData.splice(e,1)}})},timeFormate:function(e){var t=new Date(e).getFullYear(),a=new Date(e).getMonth()+1<10?"0"+(new Date(e).getMonth()+1):new Date(e).getMonth()+1,o=new Date(e).getDate()<10?"0"+new Date(e).getDate():new Date(e).getDate(),s=new Date(e).getHours()<10?"0"+new Date(e).getHours():new Date(e).getHours(),r=new Date(e).getMinutes()<10?"0"+new Date(e).getMinutes():new Date(e).getMinutes(),i=new Date(e).getSeconds()<10?"0"+new Date(e).getSeconds():new Date(e).getSeconds();return t+"-"+a+"-"+o+" "+s+":"+r+":"+i},handleChange:function(e){this.form.kj_type=e.target.value}}},m=p,g=(a("ab4e"),a("829d")),h=Object(g["a"])(m,o,s,!1,null,"6e970988",null);t["default"]=h.exports},e533:function(e,t,a){"use strict";var o=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"选择商品",visible:e.visible,"confirm-loading":e.confirmLoading},on:{cancel:e.handleCancel,ok:e.handleOk}},[t("div",{staticClass:"formBox"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"商品SPU"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsNo"],expression:"['goodsNo']"}],attrs:{placeholder:"请输入商品SPU","allow-clear":""}})],1),t("a-form-item",{attrs:{label:"商品名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["goodsName"],expression:"['goodsName']"}],attrs:{placeholder:"请输入商品名称","allow-clear":""}})],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),e.visible?t("s-table",{ref:"table",attrs:{scroll:{y:"420px",scrollToFirstRowOnChange:!0},rowKey:"goods_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15,"row-selection":e.rowSelection},scopedSlots:e._u([{key:"goods_image",fn:function(e){return t("span",{},[t("a",{attrs:{title:"点击查看原图",href:e,target:"_blank"}},[t("img",{staticStyle:{"object-fit":"cover"},attrs:{width:"50",height:"50",src:e,alt:"商品图片"}})])])}},{key:"goods_price_min",fn:function(a){return t("span",{},[t("p",[e._v("¥"+e._s(a))])])}}],null,!1,4143013534)}):e._e()],1)},s=[],r=a("753f"),i=(a("9f29"),a("0528"),a("d084")),n=a("2af9"),l=a("9b2d"),d=a.n(l),c=[{title:"商品主图",width:"80px",dataIndex:"goods_image",scopedSlots:{customRender:"goods_image"}},{title:"SPU编码",width:"160px",dataIndex:"goods_no"},{title:"促销价(售价)",width:"100px",dataIndex:"goods_price_min",scopedSlots:{customRender:"goods_price_min"}},{title:"商品标题",width:"400px",ellipsis:!0,dataIndex:"goods_name"}],u={components:{STable:n["c"]},data:function(){var e=this;return{visible:!1,confirmLoading:!1,searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,columns:c,selectedRowKeys:[],selectListSpu:[],goodsData:[],loadData:function(t){return e.queryParam.status=10,e.queryParam.spec_type=10,e.queryParam.goods_type=10,i["e"](Object(r["a"])(Object(r["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},computed:{rowSelection:function(){return{type:"radio",onChange:this.onSelectChange,getCheckboxProps:this.getCheckboxProps}}},methods:{open:function(e){this.visible=!0,this.goodsData=e,this.$refs.table&&this.handleRefresh(!0)},getCheckboxProps:function(e){return e.defaultChecked=!1,this.goodsData&&this.goodsData.length>0&&this.goodsData.forEach((function(t,a){e.goods_id==t.goods_id&&(e.defaultChecked=!0)})),{props:{defaultChecked:e.defaultChecked}}},handleSearch:function(e){var t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(r["a"])(Object(r["a"])({},t.queryParam),a),t.handleRefresh(!0))}))},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.selectedRowKeys=[],this.$refs.table.refresh(e)},handleOk:function(){if(0!=this.goodsData.length){var e=[];this.goodsData&&this.goodsData.length>0&&this.goodsData.forEach((function(t){e.push({goods_name:t.goods_name,goods_no:t.goods_no,goods_image:t.goods_image,goods_price_min:t.goods_price_min,status:t.status,goods_id:t.goods_id,stock_total:t.stock_total})})),d.a.set("selectListSpu",e),this.$message.success("选择商品成功",1.5),this.handleCancel(),this.$emit("handleSubmit")}else this.$message.error("请先选择商品",1.5)},handleCancel:function(){this.visible=!1,this.searchForm.resetFields(),this.queryParam={},this.handleRefresh()},onSelectChange:function(e,t){this.selectedRowKeys=e,this.goodsData=t||[]}}},p=u,m=(a("2b53"),a("829d")),g=Object(m["a"])(p,o,s,!1,null,"30f446db",null);t["a"]=g.exports},ffd7:function(e,t,a){}}]);