zx/public/mer/js/chunk-1ebf3d75.5ce9a19e.js

1 line
10 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1ebf3d75"],{"302a":function(e,t,a){},"64c1":function(e,t,a){"use strict";a("302a")},"741a":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"divBox"},[a("div",{staticClass:"selCard"},[a("el-form",{ref:"searchForm",attrs:{model:e.tableFrom,inline:"",size:"small","label-width":"85px"}},[a("el-form-item",{attrs:{label:"标签类型:",prop:"type"}},[a("el-select",{staticClass:"filter-item selWidth mr20",attrs:{placeholder:"请选择",size:"small",clearable:""},on:{change:function(t){return e.getList(1)}},model:{value:e.tableFrom.type,callback:function(t){e.$set(e.tableFrom,"type",t)},expression:"tableFrom.type"}},e._l(e.labelTypeList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"标签名称:",prop:"keyword"}},[a("el-input",{staticClass:"selWidth",attrs:{clearable:"",placeholder:"请输入标签名称"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.getList(1)}},model:{value:e.tableFrom.keyword,callback:function(t){e.$set(e.tableFrom,"keyword",t)},expression:"tableFrom.keyword"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.getList(1)}}},[e._v("搜索")]),e._v(" "),a("el-button",{attrs:{size:"small"},on:{click:function(t){return e.searchReset()}}},[e._v("重置")])],1)],1)],1),e._v(" "),a("el-card",{staticClass:"mt14"},[a("el-button",{staticClass:"mb20",attrs:{size:"small",type:"primary"},on:{click:e.onAdd}},[e._v("设置自动标签")]),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.tableData.data,size:"small","highlight-current-row":""}},[a("el-table-column",{attrs:{label:"ID",prop:"label_rule_id","min-width":"60"}}),e._v(" "),a("el-table-column",{attrs:{label:"标签名称",prop:"label.label_name","min-width":"120"}}),e._v(" "),a("el-table-column",{attrs:{label:"标签类型","min-width":"90"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(0===t.row.type?"订单数":"订单金额"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"标签规则","min-width":"180"},scopedSlots:e._u([{key:"default",fn:function(t){return["0.00"===t.row.min&&"0.00"===t.row.max?a("span",[e._v("从未支付的客户")]):a("span",[1===t.row.type?a("span",[e._v("订单金额在"+e._s(t.row.min)+" - "+e._s(t.row.max)+"的客户")]):a("span",[e._v("支付订单数在"+e._s(Math.trunc(t.row.min))+" - "+e._s(Math.trunc(t.row.max))+"的客户")])])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"客户数",prop:"user_num","min-width":"60"}}),e._v(" "),a("el-table-column",{attrs:{label:"更新时间","min-width":"180"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.update_time?t.row.update_time:"未更新"))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.onUpdate(t.row.label_rule_id)}}},[e._v("更新")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.onEdit(t.row)}}},[e._v("编辑")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.handleDelete(t.row.label_rule_id,t.$index)}}},[e._v("删除")])]}}])})],1),e._v(" "),a("div",{staticClass:"block"},[a("el-pagination",{attrs:{background:"","page-size":e.tableFrom.limit,"current-page":e.tableFrom.page,layout:"total, prev, pager, next, jumper",total:e.tableData.total},on:{"size-change":e.handleSizeChange,"current-change":e.pageChange}})],1)],1),e._v(" "),a("el-dialog",{attrs:{title:e.title,visible:e.dialogVisible,width:"660px"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.fullscreenLoading,expression:"fullscreenLoading"}],ref:"formValidate",staticClass:"formValidate",attrs:{model:e.formValidate,"label-width":"110px"},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",{attrs:{label:"标签类型:"}},[a("el-radio-group",{on:{change:e.initCount},model:{value:e.formValidate.type,callback:function(t){e.$set(e.formValidate,"type",t)},expression:"formValidate.type"}},[a("el-radio",{attrs:{label:0}},[e._v("订单次数标签")]),e._v(" "),a("el-radio",{attrs:{label:1}},[e._v("订单金额标签")])],1)],1),e._v(" "),a("el-form-item",{attrs:{label:"标签名称:"}},[a("el-input",{attrs:{size:"small",placeholder:"请输入标签名称"},model:{value:e.formValidate.label_name,callback:function(t){e.$set(e.formValidate,"label_name",t)},expression:"formValidate.label_name"}})],1),e._v(" "),1===e.formValidate.type?a("el-form-item",{attrs:{label:"消费金额设置:"}},[a("el-input",{staticClass:"number_input",attrs:{type:"number",min:1,size:"small"},model:{value:e.formValidate.min,callback:function(t){e.$set(e.formValidate,"min",t)},expression:"formValidate.min"}}),e._v("元\n "),a("span",[e._v("-")]),e._v(" "),a("el-input",{staticClass:"number_input",staticStyle:{"margin-left":"10px"},attrs:{type:"number",min:e.formValidate.min,size:"small"},model:{value:e.formValidate.max,callback:function(t){e.$set(e.formValidate,"max",t)},expression:"formValidate.max"}}),e._v("元\n ")],1):a("el-form-item",{attrs:{label:"消费次数设置:"}},[a("el-input",{staticClass:"number_input",attrs:{type:"number",value:Math.trunc(e.formValidate.min),min:1,size:"small"},nativeOn:{keyup:function(t){return e.number(t)}},model:{value:e.formValidate.min,callback:function(t){e.$set(e.formValidate,"min",e._n(t))},expression:"formValidate.min"}}),e._v("次\n "),a("span",[e._v("-")]),e._v(" "),a("el-input",{staticClass:"number_input",staticStyle:{"margin-left":"10px"},attrs:{type:"number",min:e.formValidate.min,size:"small"},nativeOn:{keyup:function(t){return e.number(t)}},model:{value:e.formValidate.max,callback:function(t){e.$set(e.formValidate,"max",e._n(t))},expression:"formValidate.max"}}),e._v("次\n ")],1),e._v(" "),a("el-form-item",{staticStyle:{"margin-top":"30px","text-align":"right"}},[a("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleSubmit("formValidate")}}},[e._v("提交")])],1)],1)],1)],1)},i=[],n=a("c80c"),s=(a("96cf"),a("3b8d")),r=(a("84b4"),a("6b54"),a("a481"),a("c24f")),o={name:"UserGroup",data:function(){return{tableFrom:{page:1,limit:20,type:"",keyword:""},labelTypeList:[{label:"订单次数",value:0},{label:"订单金额",value:1}],tableData:{data:[],total:0},formValidate:{type:0,label_name:"",min:"",max:""},listLoading:!0,dialogVisible:!1,fullscreenLoading:!1,title:"添加标签",label_id:""}},mounted:function(){this.getList("")},methods:{searchReset:function(){this.$refs.searchForm.resetFields(),this.getList(1)},number:function(){this.formValidate.min=this.formValidate.min.toString().replace(/[^\.\d]/g,""),this.formValidate.min=this.formValidate.min.toString().replace(".",""),this.formValidate.max=this.formValidate.max.toString().replace(/[^\.\d]/g,""),this.formValidate.max=this.formValidate.max.toString().replace(".","")},initCount:function(){this.formValidate.min=this.formValidate.max=""},getList:function(e){var t=this;this.listLoading=!0,this.tableFrom.page=e||this.tableFrom.page,Object(r["c"])(this.tableFrom).then((function(e){t.tableData.data=e.data.list,t.tableData.total=e.data.count,console.log(t.tableData),t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},pageChange:function(e){this.tableFrom.page=e,this.getList("")},handleSizeChange:function(e){this.tableFrom.limit=e,this.getList("")},onAdd:function(){this.dialogVisible=!0,this.title="添加标签",this.label_id="",this.formValidate={type:0,label_name:"",min:"",max:""}},onEdit:function(e){this.dialogVisible=!0,this.title="编辑标签",this.label_id=e.label_rule_id,this.formValidate={type:e.type,label_name:e.label&&e.label.label_name?e.label.label_name:"",min:1===e.type?e.min:Math.trunc(e.min),max:1===e.type?e.max:Math.trunc(e.max)}},onUpdate:function(e){var t=this;Object(r["d"])(e).then(function(){var e=Object(s["a"])(Object(n["a"])().mark((function e(a){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.$message.success(a.message),t.getList("");case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$message.error(e.message)}))},handleDelete:function(e,t){var a=this;this.$modalSure("删除该标签").then((function(){Object(r["b"])(e).then((function(e){var l=e.message;a.$message.success(l),a.tableData.data.splice(t,1)})).catch((function(e){var t=e.message;a.$message.error(t)}))}))},handleSubmit:function(e){var t=this;this.label_id?Object(r["e"])(this.label_id,this.formValidate).then(function(){var e=Object(s["a"])(Object(n["a"])().mark((function e(a){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.fullscreenLoading=!1,t.$message.success(a.message),t.dialogVisible=!1,t.getList("");case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.fullscreenLoading=!1,t.$message.error(e.message)})):Object(r["a"])(this.formValidate).then(function(){var e=Object(s["a"])(Object(n["a"])().mark((function e(a){return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.fullscreenLoading=!1,t.$message.success(a.message),t.dialogVisible=!1,t.getList("");case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.fullscreenLoading=!1,t.$message.error(e.message)}))}}},m=o,c=(a("64c1"),a("2877")),u=Object(c["a"])(m,l,i,!1,null,"6e388ef2",null);t["default"]=u.exports},"84b4":function(e,t,a){var l=a("5ca1");l(l.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})}}]);