Commit e20dce7f by 黑潮

Merge branch 'master' of git.gicdev.com:memberTag/memberTag-web

# Conflicts:
#	dist/index.html
#	dist/static/css/app.112c794571a2627627bcfc7e59fe8a18.css
#	dist/static/css/app.847726f066e9546b1254ecbade16bb63.css
#	dist/static/css/app.9602ae8cf2ea6dac315d5b919c48c0bc.css
#	dist/static/js/0.1630ce6e78dc79fffa64.js
#	dist/static/js/0.5066328835a9678fa280.js
#	dist/static/js/0.b3c2370721a138d80d1d.js
#	dist/static/js/2.3d59765934cb9e9dd593.js
#	dist/static/js/2.59ab092e0673c76a8304.js
#	dist/static/js/2.ae2306cc7ec456d248a2.js
#	dist/static/js/manifest.c85bc1e08eccbf29f02b.js
parents a3bd6bad d33a6389
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC-会员标签</title><link rel="shortcut icon" href=./favicon.ico><link href=./static/css/app.847726f066e9546b1254ecbade16bb63.css rel=stylesheet></head><body style="background-color: #f0f2f5;min-width: 1400px;"><div id=app></div><script>(function() {
<!DOCTYPE html><html><head><meta charset=utf-8><link rel="shortcut icon" href=./static/img/favicon.ico><title>GIC-会员标签</title><link rel="shortcut icon" href=./favicon.ico><link href=./static/css/app.b45a2b8d17c0096ffd2fa6c2fcddee75.css rel=stylesheet></head><body style="background-color: #f0f2f5;min-width: 1400px;"><div id=app></div><script>(function() {
var src = '/component/static/import-component.js?timestrap='+ new Date().getTime();
var host = window.location.host;
host = host.indexOf('localhost') > -1 || host.indexOf('192.168') > -1 ? 'gicdev.demogic.com' : host;
document.write('<script src="//'+ host + src +'"><\/script>')
})()</script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script type=text/javascript src=./static/js/manifest.e2b3f6df927e88f150dd.js></script><script type=text/javascript src=./static/js/vendor.54a87a2d59473a797f33.js></script><script type=text/javascript src=./static/js/app.794150bfd469e704eddd.js></script></body></html>
\ No newline at end of file
})()</script><script src=//web-1251519181.file.myqcloud.com/components/track.1.0.4.js></script><script src=//web-1251519181.file.myqcloud.com/components/pagination.1.0.8.js></script><script type=text/javascript src=./static/js/manifest.92be156725837a238e9e.js></script><script type=text/javascript src=./static/js/vendor.54a87a2d59473a797f33.js></script><script type=text/javascript src=./static/js/app.794150bfd469e704eddd.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,f,t){for(var o,d,b,i=0,u=[];i<a.length;i++)d=a[i],n[d]&&u.push(n[d][0]),n[d]=0;for(o in f)Object.prototype.hasOwnProperty.call(f,o)&&(e[o]=f[o]);for(c&&c(a,f,t);u.length;)u.shift()();if(t)for(i=0;i<t.length;i++)b=r(r.s=t[i]);return b};var a={},n={37:0};function r(c){if(a[c])return a[c].exports;var n=a[c]={i:c,l:!1,exports:{}};return e[c].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.e=function(e){var c=n[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,r){c=n[e]=[a,r]});c[2]=a;var f=document.getElementsByTagName("head")[0],t=document.createElement("script");t.type="text/javascript",t.charset="utf-8",t.async=!0,t.timeout=12e4,r.nc&&t.setAttribute("nonce",r.nc),t.src=r.p+"static/js/"+e+"."+{0:"b9f9e34264ca972a9d9c",1:"61b1089acf1f67b03444",2:"ae2306cc7ec456d248a2",3:"268bf9c77718732f4ab1",4:"37f74389ac01dab46816",5:"2ee69586c565312b98ba",6:"4d2510addecf658b0c20",7:"9b0ae8734c44e090563c",8:"32d8d381c26ff8d9c2f8",9:"c96c3600195bd75ca92c",10:"f82027d73a741225715e",11:"a36558c5aaddbcd83437",12:"19068df02dc02857dcc4",13:"77398c419d61853709fe",14:"77c93d2a460a03cc6acb",15:"a18365fab4e9beac0f46",16:"9a5908682c769ead69af",17:"06d390348833f9865c60",18:"fa87b247658c044bb61c",19:"09c65aedd2b8df7c581f",20:"d284e0fc21a390176f6a",21:"38cb32f7870b0aaf6e5c",22:"f97c04968d78b5b99e89",23:"a0c2dfb1838c5d9a1341",24:"c38f1e8597e12bd94f24",25:"26842b8c66a272ce99df",26:"05d64153d4b9aac22ba8",27:"4843e9eb1f5254ef32a5",28:"e9c16a97e3597fc2ed91",29:"be4c11ef91366adf5754",30:"d5f6231fe7e24e3cb344",31:"f13999a01d2a2e7ca51c",32:"e105586900bb6262274c",33:"4f76bdffa1b0785f24fd",34:"37903af596b5b2dad1d1"}[e]+".js";var o=setTimeout(d,12e4);function d(){t.onerror=t.onload=null,clearTimeout(o);var c=n[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),n[e]=void 0)}return t.onerror=t.onload=d,f.appendChild(t),a},r.m=e,r.c=a,r.d=function(e,c,a){r.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(c,"a",c),c},r.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},r.p="./",r.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
!function(e){var c=window.webpackJsonp;window.webpackJsonp=function(a,r,t){for(var o,d,b,i=0,u=[];i<a.length;i++)d=a[i],f[d]&&u.push(f[d][0]),f[d]=0;for(o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);for(c&&c(a,r,t);u.length;)u.shift()();if(t)for(i=0;i<t.length;i++)b=n(n.s=t[i]);return b};var a={},f={37:0};function n(c){if(a[c])return a[c].exports;var f=a[c]={i:c,l:!1,exports:{}};return e[c].call(f.exports,f,f.exports,n),f.l=!0,f.exports}n.e=function(e){var c=f[e];if(0===c)return new Promise(function(e){e()});if(c)return c[2];var a=new Promise(function(a,n){c=f[e]=[a,n]});c[2]=a;var r=document.getElementsByTagName("head")[0],t=document.createElement("script");t.type="text/javascript",t.charset="utf-8",t.async=!0,t.timeout=12e4,n.nc&&t.setAttribute("nonce",n.nc),t.src=n.p+"static/js/"+e+"."+{0:"1630ce6e78dc79fffa64",1:"61b1089acf1f67b03444",2:"ae2306cc7ec456d248a2",3:"b4af3875975b358a8fa3",4:"37f74389ac01dab46816",5:"e74c2c9a3c8bdb6954be",6:"4d2510addecf658b0c20",7:"c67df202532a8b8444c7",8:"32d8d381c26ff8d9c2f8",9:"c96c3600195bd75ca92c",10:"f82027d73a741225715e",11:"a36558c5aaddbcd83437",12:"19068df02dc02857dcc4",13:"77398c419d61853709fe",14:"77c93d2a460a03cc6acb",15:"a18365fab4e9beac0f46",16:"9a5908682c769ead69af",17:"06d390348833f9865c60",18:"fa87b247658c044bb61c",19:"09c65aedd2b8df7c581f",20:"d284e0fc21a390176f6a",21:"38cb32f7870b0aaf6e5c",22:"f97c04968d78b5b99e89",23:"a0c2dfb1838c5d9a1341",24:"c38f1e8597e12bd94f24",25:"26842b8c66a272ce99df",26:"05d64153d4b9aac22ba8",27:"4843e9eb1f5254ef32a5",28:"e9c16a97e3597fc2ed91",29:"be4c11ef91366adf5754",30:"d5f6231fe7e24e3cb344",31:"f13999a01d2a2e7ca51c",32:"e105586900bb6262274c",33:"4f76bdffa1b0785f24fd",34:"37903af596b5b2dad1d1"}[e]+".js";var o=setTimeout(d,12e4);function d(){t.onerror=t.onload=null,clearTimeout(o);var c=f[e];0!==c&&(c&&c[1](new Error("Loading chunk "+e+" failed.")),f[e]=void 0)}return t.onerror=t.onload=d,r.appendChild(t),a},n.m=e,n.c=a,n.d=function(e,c,a){n.o(e,c)||Object.defineProperty(e,c,{configurable:!1,enumerable:!0,get:a})},n.n=function(e){var c=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(c,"a",c),c},n.o=function(e,c){return Object.prototype.hasOwnProperty.call(e,c)},n.p="./",n.oe=function(e){throw console.error(e),e}}([]);
\ No newline at end of file
......@@ -806,6 +806,57 @@
</div>
</template>
<!-- 是否同意隐私协议(新) tag026 -->
<template v-if="parent.templateCode == 'tag026'">
<div class="m-b-20" :key="'tag026' + pindex">
<div>
<label class="inline-block m-r-20 label-unit">渠道<el-tooltip popper-class="edit-tag-tooltip" placement="top" open-delay="100" effect="light">
<div slot="content">若商户对接了微盟,客户除了在达摩侧会员小程序中会进行协议文件的授权,还可能在微盟微商城小程序中进行协议的授权,因此可区分不同渠道进行筛选;</div>
<i class="iconfont icon-tishi m-l-4" style="color: #909399"></i></el-tooltip>
</label><el-radio-group v-model="parent.channel" @change="parent.ids=[]">
<el-radio :label="0">达摩</el-radio>
<el-radio :label="1">微盟</el-radio>
</el-radio-group>
</div>
<div class="m-t-18" v-if="parent.channel===0">
<label class="inline-block m-r-20 label-unit">状态<el-tooltip popper-class="edit-tag-tooltip" placement="top" open-delay="100" effect="light">
<div slot="content">同意:同意授权协议;<br/>未同意:未授权/拒绝/取消授权协议;</div>
<i class="iconfont icon-tishi m-l-4" style="color: #909399"></i></el-tooltip>
</label><el-radio-group v-model="parent.isAgree" @change="parent.ids=[]">
<el-radio :label="1">同意</el-radio>
<el-radio :label="0">未同意</el-radio>
</el-radio-group>
</div>
<div class="m-t-18" v-if="parent.channel===1">
<label class="inline-block m-r-20 label-unit">事由<el-tooltip popper-class="edit-tag-tooltip" placement="top" open-delay="100" effect="light">
<div slot="content">商户在微盟侧可以配置在用户“访问”微商城小程序或进行“登录”时,要求同意协议,因此客户在微盟侧同意隐私协议的来源可能不同,您可基于您在微盟侧的协议配置情况来进行筛选。比如在微盟侧将“隐私协议”配置在了“访问”场景下,那么在筛选客户同意协议情况时就筛选“访问”来源下的授权情况;</div>
<i class="iconfont icon-tishi m-l-4" style="color: #909399"></i></el-tooltip>
</label><el-radio-group v-model="parent.event" @change="parent.ids=[]">
<el-radio :label="0">访问</el-radio>
<el-radio :label="1">登录</el-radio>
</el-radio-group>
</div>
<div class="m-t-18" v-if="(parent.channel===0&&parent.isAgree===1)||(parent.channel===1)">
<label class="inline-block m-r-20 label-unit">时间<el-tooltip popper-class="edit-tag-tooltip" placement="top" open-delay="100" effect="light">
<div slot="content">可根据客户最新一次同意协议的时间来筛选符合条件的客户。由于协议可能存在更新,客户同意协议的版本可能不一,建议根据“后台最新一次上传协议文件的时间至当前时间”来筛选出同意了最新版协议的客户;</div>
<i class="iconfont icon-tishi m-l-4" style="color: #909399"></i></el-tooltip></label>
<el-date-picker v-model="parent.date" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择日期"></el-date-picker><span class="m-l-16">&nbsp;&nbsp;当前时间</span>
<el-popover placement="bottom" width="600" trigger="click" :open-delay="200" v-if="!parent.channel">
<el-table :data="parent.options" max-height="400">
<el-table-column min-width="150" property="agreementName" label="协议名称"></el-table-column>
<el-table-column width="100" property="agreementType" label="协议类型">
<template slot-scope="{row}">{{row.agreementType|agreementTypeFilter}}</template>
</el-table-column>
<el-table-column width="200" property="createTime" label="上传时间">
<template slot-scope="{row}">{{row.createTime|formatDate}}</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="text" class="m-l-16">查看上传记录</el-button>
</el-popover>
</div>
</div>
</template>
<!-- 会员标签嵌入卡券选择器 com024 -->
<!-- v-if="parent.templateCode == 'com024'" -->
<div v-if="parent.templateCode == 'com024'" style="min-height: 100px">
......@@ -842,6 +893,7 @@ import qs from 'qs';
import tagDetails from '@/components/tagDetail/mixin/index';
import VueGicCard from '@/components/card/card';
import { aliasNames } from '@/config'
import timeFormat from '@/common/js/timeFormat';
import { getTagType, findWidget, findOndJson } from '@/request/tagConfig';
import moment from 'moment'
......@@ -1117,6 +1169,13 @@ export default {
ids: [],
options: []
},
tag026: {
channel: 0, // 渠道 0达摩 1微盟
isAgree: 1, // 状态 0未同意 1同意
event: 0, // 事由 0访问 1登录
date: null,
options: []
},
cardListData: [],
com024: {},
com025: {},
......@@ -1270,7 +1329,6 @@ export default {
if (this.currentComputeType === 1) {
this.postCompute = templateVal.compute.compute;
}
// 门店
if (!!templateVal.valWidgetId) {
await this.getTemplateCodeById(templateVal.valWidgetId);
......@@ -1313,8 +1371,8 @@ export default {
this.getcityData();
}
// 隐私协议
if (data.templateCode === 'tag025') {
this.getPrivacyGgreement();
if (['tag025','tag026'].includes(data.templateCode)) {
this.getPrivacyGgreement(data.templateCode);
}
// 如果是给了 计算属性值
if (!!this.postCompute) {
......@@ -1451,13 +1509,13 @@ export default {
/**
* 隐私协议列表
*/
getPrivacyGgreement() {
getPrivacyGgreement(templateCode) {
const para = { requestProject: 'member-tag',agreementType: 1 };
this.axios
.post(`${this.baseUrl}/api-admin/list-service-privacy-agreement`, qs.stringify(para))
.then(res => {
if (res.data.errorCode === 0) {
this.tag025.options = [].concat(res.data.result||[]);
this[templateCode].options =[].concat(res.data.result||[])
}
})
.catch(err => {
......@@ -1728,11 +1786,8 @@ export default {
for (let i = 0; i < this.templateData.length; i++) {
if (this.templateData[i].templateCode === 'tag008') {
// 这里有多个value
console.log(this.templateData[i].addSelectTags);
value = tagValue.val[0].data.value.split(' ');
selectVal = tagParams.selectedVal[1].split(',');
console.log(tagValue.val[0].data.value);
console.log(selectVal);
selectVal.forEach((el, inx) => {
let item = this.templateData[i].addSelectTags.find(val => val.value === el);
if (!item) {
......@@ -1906,8 +1961,19 @@ export default {
}
}
// this.confirmSelector();
// this.select.expends = false;
break;
case 'tag026':
for (let i = 0; i < tagParams.template.length; i++) {
if (tagParams.template[i].templateCode == 'tag026') {
this.templateData[i].channel=tagValue.val[0].data.key==='consentPrivacyProtocolTime'?0:1;
if (this.templateData[i].channel) {
this.templateData[i].event=tagValue.val[0].data.key==='wemobVisitConsentProtocolTime'?0:1;
}else{
this.templateData[i].isAgree=tagValue.val[0].data.compute==='!'?0:1;
}
this.templateData[i].date=timeFormat.timeToDateTime(tagValue.val[0].data.value)||null
}
}
break;
case 'com022':
......@@ -2094,8 +2160,15 @@ export default {
return '';
},
formatDate(date) {
return moment(date).format('YYYY-MM-DD hh:mm:ss');
}
return moment(date).format('YYYY-MM-DD HH:mm:ss');
},
agreementTypeFilter(v) {
switch (v) {
case 1:return '隐私协议';break;
case 2:return '服务协议';break;
default:return '';break;
}
},
}
};
</script>
......
......@@ -466,6 +466,30 @@ export default {
tagValue.val[0].data.compute = that.templateData[0].ids.length?'in':'=';
tagValue.val[0].data.value = that.templateData[0].ids.length?that.templateData[0].ids.join(' '):that.templateData[0].isAgree;
}
if (code === 'tag026' && that.templateData.length === 1) {
if (!that.templateData[0].date) {
if ((!that.templateData[0].channel&&that.templateData[0].isAgree)||that.templateData[0].channel) {
that.$message.error({ message: '请选择开始时间' });
return false
}
}
// 渠道 0达摩 1微盟
if (that.templateData[0].channel) {
tagValue.val[0].data.key=that.templateData[0].event?'wemobLoginConsentProtocolTime':'wemobVisitConsentProtocolTime'
tagValue.val[0].data.compute='>'
tagValue.val[0].data.value=new Date(that.templateData[0].date).getTime()
that.postTemplateData.selectedVal=['微盟',that.templateData[0].event?'登录':'访问',that.templateData[0].date]
}else{
tagValue.val[0].data.key='consentPrivacyProtocolTime'
tagValue.val[0].data.compute=that.templateData[0].isAgree?'>':'!'
if (that.templateData[0].isAgree) {
tagValue.val[0].data.value=new Date(that.templateData[0].date).getTime()
that.postTemplateData.selectedVal=['达摩','同意',that.templateData[0].date]
}else{
that.postTemplateData.selectedVal=['达摩','未同意']
}
}
}
/**
* 商品选择必选
*/
......@@ -517,6 +541,7 @@ export default {
if ((code === 'tag014' || code === 'tag017' || code === 'tag019' || code === 'tag020' || code === 'tag015')) {
for (let k of this.templateData) {
console.log(k);
if (!k.timeChecked && !k.timeAfterChecked && k.radio == 2) {
let tips = k.timeRadio == 1 ? '天' : k.timeRadio == 2 ? '月' : '年';
this.$message.warning({
......@@ -526,7 +551,7 @@ export default {
}
// 如果选择最近选项 必须添加后面的具体天数
if (k.timeAfterChecked) {
if (k.radio == 2&&k.timeAfterChecked) {
if (!k.timeInput) {
let timeFlag = k.timeRadio == 1 ? '天' : k.timeRadio == 2 ? '月' : '年';
this.$message.warning({
......@@ -1115,7 +1140,7 @@ export default {
if (Array.isArray(tagParams.selectedVal) && tagParams.selectedVal.length) {
tagParams.selectedVal = tagParams.selectedVal.map(el => el.replace(/(null|undefined)/g, ''));
}
// console.log(this.postTemplateData.conditionList);
// console.log(this.postTemplateData.conditionList);
await this.addToTemp(tagValue, tagParams);
return true;
},
......@@ -1839,7 +1864,6 @@ export default {
let selectVal = null;
let checkedCount = null;
// compute 是计算属性的区间值 value是选中的值
for(let i = 0; i < this.templateDataList.templateCode.length; i++) {
switch (this.templateDataList.templateCode[i]) {
......@@ -2031,7 +2055,6 @@ export default {
}
}
break;
// 之后的天数
case 'tag006':
for (let i = 0; i < this.templateData.length; i++) {
......
......@@ -11,7 +11,7 @@
<p class="tag-desc">{{ tagDataAssgin.tagDescribe }}</p>
</div>
<p v-if="tagId" class="m-t-20 m-b-20 tag-config">标签值设置<el-tooltip v-if="tagDataAssgin.columnKey==='haobanWechatRelatedTime'||(Object.keys(tagDataAssgin).length&&tagDataAssgin.tagValue&&JSON.parse(tagDataAssgin.tagValue).val[0].data.key==='haobanWechatRelatedTime')" popper-class="edit-tag-tooltip" placement="top" open-delay="100" effect="light"
><div slot="content"><span style="font-weight:600">固定时段:</span>在所选时间段内首次添加导购企微好友的;<br/><span style="font-weight:600">相对时段:</span>相对于“标签统计时间”(每天凌晨计算统计一次)的前X天/月/年内首次添加导购企微好友的,例:选择相对时段为“最近2天”,那么系统在5号凌晨进行统计时,统计的是在3号、4号首次添加导购企微好友的顾客;系统在6号凌晨统计时,统计的是4号、5号首次添加导购企微好友的顾客。</div><i class="iconfont icon-tishi"></i></el-tooltip></p>
><div slot="content"><span style="font-weight:600">固定时段:</span>在所选时间段内与关联了好办导购账号的企微员工成为好友的;<br/><span style="font-weight:600">相对时段:</span>在“标签统计时间”(每天凌晨计算统计一次)的前X天/月/年与某员工成为好友的。例:选择相对时段为“最近2天”,那么系统在5号凌晨进行统计时,统计的是在3号、4号与某员工成为企微好友的用户;系统在6号凌晨统计时,统计的是在4号、5号与某员工成为企微好友的客户;</div><i class="iconfont icon-tishi"></i></el-tooltip></p>
<!-- 所有标签的配置项 -->
<div class="tag-config-options">
<tag-config-options v-if="isAddFlag" :creatorId="creatorId" :tagId="tagDataAssgin.tagId" :columnKey="tagDataAssgin.columnKey" ref="tagConfig" :templateDataList="templateObj" @returnTagData="returnTagData"></tag-config-options>
......
......@@ -48,9 +48,11 @@
<el-date-picker
v-model="ruleForm.effectiveDateTmp"
type="date"
:clearable="false"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="23:59:59"
:picker-options="pickerOptions"
@change="validPeriodDateChange"
></el-date-picker>
</el-form-item>
<el-form-item label prop :class="{'m-l-60': ruleForm.selectedTags.length > 1}">
......@@ -225,7 +227,8 @@ import { getMemberTagCount } from '@/request/memberGroup.js';
import { getMemberTagList, memberGroupList, getIsAllowAdd, groupCount } from '@/request/api.js';
import { parseTime } from '@/utils'
const fixBeginTime = +new Date() + (1000 * 60 * 60 * 24);
let fixBeginTime = +new Date() + (1000 * 60 * 60 * 24);
let fixEndTime = +new Date() + (1000 * 3600 * 24 * 91);
export default {
name: 'memberGroupEdit',
......@@ -288,7 +291,7 @@ export default {
effectiveStatus: 1,
fixedType: 0, // 是否固化人群
fixedTime: parseTime(fixBeginTime, '{y}-{m}-{d}'), // 期初固化时间
fixedEndTime: parseTime(fixBeginTime + 2 * 365 * 24 * 3600 * 1000, '{y}-{m}-{d}'), // 期末固化时间
fixedEndTime: parseTime(fixEndTime, '{y}-{m}-{d}'), // 期末固化时间
},
refreshList: {},
......@@ -301,8 +304,8 @@ export default {
pickerOptions: {
disabledDate(time) {
let curDate = new Date().getTime();
let oneYear = 2 * 365 * 24 * 3600 * 1000;
let y = curDate + oneYear;
let twoYears = 2 * 365 * 24 * 3600 * 1000;
let y = curDate + twoYears;
return time.getTime() < Date.now() - 8.64e7 || time.getTime() > y;
}
},
......@@ -310,7 +313,7 @@ export default {
disabledDate(date) {
let beginDate = parseTime(fixBeginTime, '{y}-{m}-{d}');
beginDate = `${beginDate} 00:00:00`
return new Date(date) < new Date(beginDate);
return new Date(date) < new Date(beginDate)||new Date(date) > new Date(fixEndTime);
}
},
// 会员分组分类
......@@ -424,9 +427,9 @@ export default {
* 1=实时 0=非实时
*/
watch: {
'ruleForm.selectedTags': {
ruleForm: {
deep: true,
handler() {
handler: function(n,o){
let flag =
this.ruleForm.selectedTags.length === 0 ||
this.ruleForm.selectedTags.some(tagsGroup => {
......@@ -437,6 +440,20 @@ export default {
}
},
methods: {
validPeriodDateChange(v){
fixEndTime=+new Date(v) + (1000 * 60 * 60 * 24)
this.ruleForm.fixedEndTime=parseTime(fixEndTime)
this.ruleForm.fixedTime=parseTime(fixBeginTime)
},
// 设置默认的分组有效期
defaultDate() {
let date = new Date(new Date().getTime() + 90 * 24 * 3600 * 1000);
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
this.ruleForm=Object.assign({},this.ruleForm,{effectiveDateTmp: Y + M + D + '23:59:59'})
},
_groupCount() {
groupCount().then(res => {
if (res.errorCode == 1) {
......@@ -522,6 +539,10 @@ export default {
this.$message.error({ message: '请至少保留一个标签!' });
return false;
}
if (this.ruleForm.fixedType===2&&new Date(this.ruleForm.fixedTime) >new Date(this.ruleForm.fixedEndTime)) {
this.$message.error({ message: '固化开始时间不允许晚于结束时间!' });
return false;
}
this.postSave();
}
});
......@@ -742,6 +763,7 @@ export default {
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
this.ruleForm.effectiveDateTmp = Y + M + D + '23:59:59';
}
this.defaultDate();
this.getTagsList();
this.getTagsGroupList();
this.getMemberGroupList();
......
......@@ -92,7 +92,7 @@
<i class="form-tip-icon">i</i>
</el-tooltip>
</label>
<el-date-picker class="w-220" v-model="tagConfig.date" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" type="date" placeholder="选择日期"> </el-date-picker>
<el-date-picker class="w-220" :clearable="false" v-model="tagConfig.date" :picker-options="pickerOptions" value-format="yyyy-MM-dd HH:mm:ss" type="date" placeholder="选择日期" @change="validPeriodDateChange"> </el-date-picker>
</div>
<div :class="['form-item', {'margin-60': marginSixty}]">
<label for="">分组所属分类</label>
......@@ -161,7 +161,8 @@ import Trash from '@/components/Trash.vue';
import { parseTime } from '@/utils'
Vue.component(CollapseTransition.name, CollapseTransition);
const fixBeginTime = +new Date() + (1000 * 60 * 60 * 24);
let fixBeginTime = +new Date() + (1000 * 60 * 60 * 24);
let fixEndTime = +new Date() + (1000 * 3600 * 24 * 91);
export default {
......@@ -197,7 +198,7 @@ export default {
effectiveStatus: 1, // 有效状态nage
fixedType: 0, // 是否固化人群
fixedTime: parseTime(fixBeginTime, '{y}-{m}-{d}'), // 期初固化时间
fixedEndTime: parseTime(fixBeginTime + 2 * 365 * 24 * 3600 * 1000, '{y}-{m}-{d}'), // 期末固化时间
fixedEndTime: parseTime(fixEndTime, '{y}-{m}-{d}'), // 期末固化时间
},
activeTagsGroupIndex: 0,
activeTagIndex: 0,
......@@ -207,8 +208,8 @@ export default {
pickerOptions: {
disabledDate(time) {
let curDate = new Date().getTime();
let oneYear = 2 * 365 * 24 * 3600 * 1000;
let y = curDate + oneYear;
let twoYears = 2 * 365 * 24 * 3600 * 1000;
let y = curDate + twoYears;
return time.getTime() < Date.now() - 8.64e7 || time.getTime() > y;
}
},
......@@ -216,7 +217,7 @@ export default {
disabledDate(date) {
let beginDate = parseTime(fixBeginTime, '{y}-{m}-{d}');
beginDate = `${beginDate} 00:00:00`
return new Date(date) < new Date(beginDate);
return new Date(date) < new Date(beginDate)||new Date(date) > new Date(fixEndTime);
}
},
// 面包屑参数
......@@ -227,11 +228,11 @@ export default {
relocation: true
},
{
name: '会员管理',
name: '客户管理',
path: ''
},
{
name: '会员标签',
name: '客户标签',
path: ''
}
],
......@@ -310,7 +311,6 @@ export default {
isSync: false // 是否开启自动同步开关
};
},
computed: {
groupListNumber() {
let listNumber = 0;
......@@ -329,6 +329,11 @@ export default {
},
methods: {
validPeriodDateChange(v){
fixEndTime=+new Date(v) + (1000 * 60 * 60 * 24)
this.tagConfig.fixedEndTime=parseTime(fixEndTime)
this.tagConfig.fixedTime=parseTime(fixBeginTime)
},
getMemberTagGradeEnsure() {
getMemberTagGradeEnsure({ requestProject: 'gic-member-tag-web' })
.then(res => this.memberTagGradeEnsure = res.result);
......@@ -342,7 +347,7 @@ export default {
},
// 设置默认的分组有效期
defaultDate() {
let date = new Date(new Date().getTime() + 2 * 365 * 24 * 3600 * 1000);
let date = new Date(new Date().getTime() + 90 * 24 * 3600 * 1000);
let Y = date.getFullYear() + '-';
let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
......@@ -417,6 +422,11 @@ export default {
return;
}
if (param.fixedType===2&&new Date(this.tagConfig.fixedTime) >new Date(this.tagConfig.fixedEndTime)) {
this.$message.error({ message: '固化开始时间不允许晚于结束时间!' });
return false;
}
if(param.fixedType) {
param.fixedTime = this.tagConfig.fixedTime;
param.fixedEndTime = this.tagConfig.fixedEndTime;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment