Commit 3f668448 by wuwx

Merge branch 'v2.0.0' into wuwx_dev_v2.0.0

2 parents a1dcea77 69963964
Showing 63 changed files with 2526 additions and 443 deletions
......@@ -1668,7 +1668,7 @@
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/abbrev/-/abbrev-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"accepts": {
......@@ -1846,7 +1846,7 @@
},
"are-we-there-yet": {
"version": "1.1.7",
"resolved": "https://registry.npmmirror.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
"integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==",
"requires": {
"delegates": "^1.0.0",
......@@ -3519,7 +3519,7 @@
},
"core-js-pure": {
"version": "3.21.1",
"resolved": "https://registry.npmmirror.com/core-js-pure/-/core-js-pure-3.21.1.tgz",
"resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.21.1.tgz",
"integrity": "sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ=="
},
"core-util-is": {
......@@ -5409,7 +5409,7 @@
},
"fstream": {
"version": "1.0.12",
"resolved": "https://registry.npmmirror.com/fstream/-/fstream-1.0.12.tgz",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
"requires": {
"graceful-fs": "^4.1.2",
......@@ -5479,7 +5479,7 @@
},
"gaze": {
"version": "1.1.3",
"resolved": "https://registry.npmmirror.com/gaze/-/gaze-1.1.3.tgz",
"resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz",
"integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==",
"requires": {
"globule": "^1.0.0"
......@@ -5644,7 +5644,7 @@
},
"globule": {
"version": "1.3.3",
"resolved": "https://registry.npmmirror.com/globule/-/globule-1.3.3.tgz",
"resolved": "https://registry.npmjs.org/globule/-/globule-1.3.3.tgz",
"integrity": "sha512-mb1aYtDbIjTu4ShMB85m3UzjX9BVKe9WCzsnfMSZk+K5GpIbBOexgg4PPCt5eHDEG5/ZQAUX2Kct02zfiPLsKg==",
"requires": {
"glob": "~7.1.1",
......@@ -6415,7 +6415,7 @@
},
"in-publish": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/in-publish/-/in-publish-2.0.1.tgz",
"resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz",
"integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ=="
},
"indent-string": {
......@@ -6692,7 +6692,7 @@
},
"is-finite": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/is-finite/-/is-finite-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz",
"integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w=="
},
"is-fullwidth-code-point": {
......@@ -6911,7 +6911,7 @@
},
"js-base64": {
"version": "2.6.4",
"resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-2.6.4.tgz",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",
"integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ=="
},
"js-levenshtein": {
......@@ -7871,7 +7871,7 @@
},
"node-gyp": {
"version": "3.8.0",
"resolved": "https://registry.npmmirror.com/node-gyp/-/node-gyp-3.8.0.tgz",
"resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz",
"integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==",
"requires": {
"fstream": "^1.0.0",
......@@ -8111,7 +8111,7 @@
},
"npmlog": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/npmlog/-/npmlog-4.1.2.tgz",
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"requires": {
"are-we-there-yet": "~1.1.2",
......@@ -8444,7 +8444,7 @@
},
"osenv": {
"version": "0.1.5",
"resolved": "https://registry.npmmirror.com/osenv/-/osenv-0.1.5.tgz",
"resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"requires": {
"os-homedir": "^1.0.0",
......@@ -10710,7 +10710,7 @@
},
"sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"source-list-map": {
......@@ -10915,7 +10915,7 @@
},
"stdout-stream": {
"version": "1.4.1",
"resolved": "https://registry.npmmirror.com/stdout-stream/-/stdout-stream-1.4.1.tgz",
"resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz",
"integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==",
"requires": {
"readable-stream": "^2.0.1"
......@@ -11194,7 +11194,7 @@
},
"tar": {
"version": "2.2.2",
"resolved": "https://registry.npmmirror.com/tar/-/tar-2.2.2.tgz",
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz",
"integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==",
"requires": {
"block-stream": "*",
......@@ -11458,7 +11458,7 @@
},
"true-case-path": {
"version": "1.0.3",
"resolved": "https://registry.npmmirror.com/true-case-path/-/true-case-path-1.0.3.tgz",
"resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz",
"integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==",
"requires": {
"glob": "^7.1.2"
......@@ -12041,7 +12041,7 @@
},
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": {
"sortablejs": "1.10.2"
......@@ -12054,7 +12054,7 @@
},
"wangeditor": {
"version": "4.7.12",
"resolved": "https://registry.npmmirror.com/wangeditor/-/wangeditor-4.7.12.tgz",
"resolved": "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.12.tgz",
"integrity": "sha512-5KOIpQ0+idKvDTkjZOp7RHYXA97FyJ9mjwy+zQUdMUCqZItlEXzvVOYtOlHkJr/HcbwgIz/7f/trGFggZK5X4g==",
"requires": {
"@babel/runtime": "^7.11.2",
......@@ -12072,12 +12072,12 @@
},
"regenerator-runtime": {
"version": "0.13.9",
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz",
"integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA=="
},
"tslib": {
"version": "2.3.1",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.1.tgz",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
}
}
......@@ -12461,7 +12461,7 @@
},
"wide-align": {
"version": "1.1.5",
"resolved": "https://registry.npmmirror.com/wide-align/-/wide-align-1.1.5.tgz",
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
"integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
"requires": {
"string-width": "^1.0.2 || 2 || 3 || 4"
......
......@@ -107,6 +107,18 @@ const momentRemindUser = params => {
sign: true
})
}
//根据id提醒用户
const momentCancel = params => {
params.method = 'marketing.api.moment.created.cancel'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
momentDetail,
momentRemindUser,
......@@ -117,4 +129,5 @@ export default {
momentStaff,
momentStaffCustomers,
getListApi,
momentCancel
}
\ No newline at end of file
import { http } from '@/main'
const defaultPath = 'marketing.api.material.'
//获取素材组列表
const getMaterialList = params => {
params.method = `${defaultPath}group.list`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//删除素材组列表
const deleteMaterialList = params => {
params.method = `${defaultPath}group.delete`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//素材组详情
const materialGroupDetail = params => {
params.method = `${defaultPath}group.detail`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材组创建
const addMaterialGroup = params => {
params.method = `${defaultPath}group.insert`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材组编辑
const editMaterialGroup = params => {
params.method = `${defaultPath}group.update`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//素材删除
const materialDelete = params => {
params.method = `${defaultPath}delete`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
//素材详情
const materialDetail = params => {
params.method = `${defaultPath}detail`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材列表
const materialList = params => {
params.method = `${defaultPath}page`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材创建
const materialInsert = params => {
params.method = `${defaultPath}insert`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
//素材编辑
const materialEdit = params => {
params.method = `${defaultPath}update`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 素材详情阅读人员明细
const readDetailPage = params => {
params.method = `${defaultPath}customerReadDetailPage`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
// 素材详情数据概览
const dataOverview = params => {
params.method = `${defaultPath}dataOverview`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
// 素材详情阅读人员明细
const sendDetailPage = params => {
params.method = `${defaultPath}employeeSendDetailPage`
return http({
url: 'rop-scrm-marketing/router',
method: 'post',
data: params,
sign: true
})
}
const findAllDictData = params => {
params.method = 'merchants.api.menu.findAllDictData'
return http({
url: 'http://rop-merchant.dev.glsx.com.cn/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getMaterialList,
deleteMaterialList,
materialGroupDetail,
addMaterialGroup,
materialDelete,
materialDetail,
materialList,
materialEdit,
materialInsert,
editMaterialGroup,
readDetailPage,
dataOverview,
sendDetailPage,
findAllDictData
}
\ No newline at end of file
import { http } from '@/main'
// 标签获取客户列表
const getCustomerByTagListApi = params => {
params.method = 'entmicro.api.customer.getCustomerPageByTag'
params.source = 'scrm-home'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getSopInfoListApi = params => {
params.method = 'scrm.api.sop.sopInfo.listWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop基本信息
const getSopBaseInfoApi = params => {
params.method = 'scrm.api.sop.sopInfo.getBaseBySopId'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
//sop分析-触达率-筛选框
const getEventListApi = params => {
params.method = 'scrm.api.sop.sopEvent.listWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop分析-触达率列表
const getSopCustomerStatisticsListApi = params => {
params.method = 'scrm.api.sop.sopCustomer.listStatisticsWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop分析-员工完成率列表
const getSopStaffTaskListApi = params => {
params.method = 'scrm.api.sop.staffTaskStatistics.listWithPage'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// 校验当前商户的企微群发任务情况
const getTaskStatusApi = params => {
params.method = 'scrm.api.sop.task.merchantWWMsgTaskStatusCheck'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// sop营销事件次数分析
const parseEventCountApi = params => {
params.method = 'scrm.api.sop.sopEvent.parseEventCount'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// 删除sop事件
const deleteSopEventApi = params => {
params.method = 'scrm.api.sop.sopInfo.delete'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 结束sop事件
const endSopEventApi = params => {
params.method = 'scrm.api.sop.sopInfo.updateEndStatus'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 事件进行中,修改sop事件列表
// const insertOrUpdateSopEventApi = params => {
// params.method = 'scrm.api.sop.sopEvent.insertOrUpdate'
// return http({
// url: 'rop-scrm-sop/router',
// method: 'POST',
// data: params,
// sign: true,
// returnAll: true
// })
// }
// 事件进行中,批量编辑sop
const batchEditSopEventApi = params => {
params.method = 'scrm.api.sop.sopEvent.batchEdit'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 新增或者事件未开始,新增/修改sop
const insertOrUpdateSopApi = params => {
params.method = 'scrm.api.sop.sopInfo.insertOrUpdate'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
const getSopInfoDetailApi = params => {
params.method = 'scrm.api.sop.sopInfo.getDetailBySopId'
return http({
url: 'rop-scrm-sop/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材组列表
const getGroupListApi = params => {
params.method = 'marketing.api.material.group.list'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取素材列表
const getMaterialListApi = params => {
params.method = 'marketing.api.material.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
// 朋友圈模板
const getMomentListApi = params => {
params.method = 'marketing.api.moment.page'
return http({
url: 'rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi }
......@@ -99,6 +99,10 @@ html {
color: #eb4e4e;
}
.marketing .red-txt {
color: #eb4e4e;
}
.marketing .wechat-container {
width: 290px;
margin-left: 32px;
......@@ -199,6 +203,10 @@ html {
margin-bottom: 60px;
}
.marketing .m-r-10 {
margin-right: 10px;
}
.marketing .m-r-20 {
margin-right: 20px;
}
......@@ -229,6 +237,10 @@ html {
background-color: #999999;
}
.marketing .txt-blue {
color: #5850ff;
}
.marketing .txt-grey {
color: #999999;
}
......
......@@ -17,7 +17,7 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<el-input :placeholder="item.placeholder || '请输入' + item.label" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
......@@ -55,9 +55,9 @@
</div>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
......
......@@ -41,6 +41,5 @@ module.exports = {
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
}
\ No newline at end of file
......@@ -20,6 +20,7 @@ export const fetchConfig = function (isEnv = true) {
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
// return new Http().get('http://192.168.3.171:7300/mock/619c87331072f92988f05a29/marketing/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -267,7 +267,11 @@ const staticRoutes = Object.freeze([{
component: resolve => require([`@/views/material/materialDetail.vue`], resolve),
meta: {}
},
//朋友圈营销
{
name: 'addMaterial',
path: '/material/addMaterial',
component: resolve => require([`@/views/material/addMaterial.vue`], resolve),
},
{
name: 'friendGroup',
path: '/friendGroup/index',
......
......@@ -15,7 +15,7 @@ Vue.use(ElementUI)
Vue.use(GLTable)
Vue.use(GLFooter)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request2, sign, secret, sign_common, request_common } = await fetchConfig()
const { response, request, request2, sign, secret, sign_common, request_common } = await fetchConfig(false)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......
......@@ -195,7 +195,11 @@ export default {
})
},
merchantOpen() {
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId }).then(res => {
let channel = null
if (location.host == 'scrm.cgacar.com') {
channel = 2
}
this.$apis.customerTransform.merchantOpen({ merchantId: this.$globalState.session.merchantId, channel }).then(res => {
this.openFlag = res.openFlag
})
},
......
......@@ -38,7 +38,7 @@
<i :class="{ 'el-icon-refresh': true, 'wait-status': refreshStatus }"></i>
更新数据
</span>
<span class="info-time">更新于</span>
<span class="info-time">更新于:{{this.updatedTime}}</span>
</div>
<div class="statistics-info">
<div class="statistics-ul">
......@@ -98,6 +98,7 @@ export default {
},
data() {
return {
updatedTime: '',
refreshStatus: false,
STATUS_TYPE: STATUS,
SEX_TYPE: SEX,
......@@ -141,6 +142,7 @@ export default {
getCustomerDetail() {
const id = this.$route.query.id
this.$apis.friendGroup.momentDetail({ id }).then(res => {
this.updatedTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
this.basicInfo = res
// console.log(this.basicInfo, '123');
// this.basicInfo.sendTime = dayjs(this.basicInfo.sendTime).format('YYYY-MM-DD HH:mm:ss')
......
<template>
<div class="img-bg">
<div class="preview-content">
<div class="preview-info">
<div class="preview-info" v-show="previewList.length">
<img class="avatar" src="@/assets/guestCustom/default-customer.png" alt />
<div class="preview-box" v-for="item in previewList" :key="item.id">
<div class="preview-box-desc">
......@@ -38,7 +38,7 @@
<div class="preview-operation">赞 | 评论</div>
</div>
</div>
<el-dialog :visible.sync="videoShow" width="50%" :before-close="handleClose" class="video-dialog">
<el-dialog :visible.sync="videoShow" :before-close="handleClose" class="video-dialog">
<div slot="title" style="height: 18px"></div>
<video v-if="videoShow" width="100%" height="100%" autoplay controls :src="this.videoUrl"></video>
</el-dialog>
......@@ -84,7 +84,6 @@ export default {
})
val[0].attContent[0] = htm
}
console.log(val)
//图片合并
// const previewListFilter = val.map(item=>{
// return {
......@@ -104,17 +103,18 @@ export default {
},
created() {
this.eventBus.$on('update', val => {
this.previewList = val
setTimeout(() => {
this.previewList = val
}, 100)
})
},
mounted() {}
}
</script>
<style lang="scss" scope>
<style lang="scss" scoped>
.img-list {
margin-right: 3px;
margin-bottom: -10px;
}
.img-bg {
position: relative;
......@@ -165,7 +165,7 @@ export default {
color: #556993;
}
.video-panel {
width: 136px;
width: 100%;
height: 102px;
display: flex;
align-items: center;
......@@ -182,20 +182,23 @@ export default {
}
}
.preview-text {
font-size: 14px;
position: relative;
color: #333;
background-color: #fff;
border-radius: 4px;
word-break: break-all;
display: flex;
img {
line-height: 20px;
/deep/ img {
width: 20px;
height: 20px;
vertical-align: middle;
}
}
.text {
font-size: 12px;
padding: 8px 0px;
padding: 0px;
margin-bottom: 6px;
}
.preview-link {
padding: 6px 0px;
......@@ -269,12 +272,14 @@ export default {
}
}
.video-dialog {
.el-dialog__header {
border-bottom: 0px;
background-color: rgb(0, 0, 0);
}
.el-dialog__body {
padding: 0px;
/deep/ {
.el-dialog__header {
border-bottom: 0px;
background-color: rgb(0, 0, 0);
}
.el-dialog__body {
padding: 0px;
}
}
}
</style>
......@@ -175,6 +175,7 @@ export default {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isEntmicroCustomer = true
params.isFollowerStaff = isFollowerStaff
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
console.log(res)
......
......@@ -350,6 +350,7 @@ export default {
-webkit-user-select: none;
cursor: default;
pointer-events: none;
vertical-align: middle;
}
.active {
background: #dcdfe6;
......
......@@ -2,7 +2,7 @@
<div class="welcome-box">
<!-- <div class="required">入群欢迎语</div> -->
<div class="content">
<div class="content-bg">
<div class="content-bg" v-loading="loading">
<!-- <div id="nick" contenteditable="false" class="nickname">
@昵称
<i class="el-icon-error"></i>
......@@ -24,7 +24,7 @@
<div v-for="(itm, index) in previewList" :key="itm.id">
<div class="welcome-file" v-if="itm.attType != 1 && itm.attType != 2">
<template v-if="itm.attType == 3">
<img src="@/assets/guestCustom/icon-img.png" alt />
<img src="@/assets/guestCustom/icon-video.png" alt />
<span class="welcome-file-desc" :title="itm.attContent[0]">{{ itm.attContent[0] }}</span>
</template>
<template v-else-if="itm.attType == 7">
......@@ -57,7 +57,7 @@
<span v-if="item.id == 1" @click.stop="selectEmotion">{{ item.name }}</span>
<span v-else>{{ item.name }}</span>
<input v-if="item.type == 'img'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-img" :accept="item.accept || 'image/png, image/jpeg, image/jpg'" @change="e => handleImgChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<input v-else-if="item.type == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="welcome-input upload-video" :accept="item.accept || 'video/*'" @change="e => handleVideoChange(e, item)" />
<el-link v-else-if="item.type == 'nickname' || item.type == 'acivity'" style="opacity: 0" @click="handleFun(item.funName)">{{ item.name }}</el-link>
</div>
</div>
......@@ -196,7 +196,6 @@ export default {
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
this.loading = true
reader.readAsDataURL(file)
reader.onload = e => {
var image = new Image()
......@@ -210,8 +209,8 @@ export default {
return item.attType == ATT_TYPE.TEXT || item.attType == ATT_TYPE.IMAGE
})
const imgIndex = this.previewList.findIndex(imgItem => imgItem.attType == ATT_TYPE.IMAGE)
if(this.previewList[imgIndex].attContent.length == 9){
this.$message.error('最多上传9张图片')
if (imgIndex != -1 && this.previewList[imgIndex].attContent.length >= 9) {
this.$message.error('最多上传9张图片')
return
}
if (imgIndex == -1) {
......@@ -225,6 +224,7 @@ export default {
console.log(imgIndex)
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
let len = this.previewList.length - 1
if (res) {
......@@ -257,18 +257,24 @@ export default {
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.previewList = this.previewList.filter(item => {
return item.attType == ATT_TYPE.TEXT
})
this.eventBus.$emit('update', this.previewList)
this.loading = true
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.previewList = this.previewList.filter(item => {
return item.attType == ATT_TYPE.TEXT
})
this.previewList.push({
attType: ATT_TYPE.VEDIO,
attContent: [res]
})
this.eventBus.$emit('update', this.previewList)
this.$nextTick(() => {
this.eventBus.$emit('update', this.previewList)
})
}
this.loading = false
})
document.querySelector('.upload-video').value = ''
}
} catch (err) {
console.log(err)
......@@ -291,10 +297,16 @@ export default {
videoObj.load()
videoObj.onloadedmetadata = function (evt) {
URL.revokeObjectURL(videoUrl)
console.dir(videoObj)
if (videoObj.videoWidth > 1280 || videoObj.videoHeight > 720) {
_this.$message.error('上传视频不超过1280x720')
reject()
}
if (videoObj.duration > 30) {
_this.$message.error('上传视频不超过30s')
reject()
}
resolve(file)
}
})
......
......@@ -24,6 +24,15 @@
</el-tag>
</div>
</div>
<div class="filter-footer">
<!-- <span>将消息发送给客户符合条件的客户</span> -->
<div class="filter-number">
查看客户数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<!-- <span v-show="isUpdate" @click="viewMembers">查看</span> -->
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
</el-form-item>
</el-form>
<!-- 编辑入群欢迎语 -->
......@@ -60,8 +69,8 @@
</glsx-dialog>
</div>
<GLFooter>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">确定</el-button>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">通知成员发送</el-button>
</GLFooter>
</div>
</template>
......@@ -140,12 +149,12 @@ export default {
type: 'video',
funName: 'video'
},
{
id: 4,
name: '活动',
type: 'acivity',
funName: 'activity'
}
// {
// id: 4,
// name: '活动',
// type: 'acivity',
// funName: 'activity'
// }
],
basicForm: {
selectType: 1,
......@@ -230,6 +239,41 @@ export default {
this.$router.push('/friendGroup/index')
}
},
// 查看群发人数
viewMembers() {
if (!this.basicForm.userList) {
this.$message({
type: 'error',
message: '请选择发表成员'
})
return
}
this.viewLoading = true
const userList = this.basicForm.userList.map(item => {
return {
staffId: item.staffId,
staffName: item.staffName,
masterStatus: item.masterStatus,
follow: item.follow
}
})
let params = {
userList
}
this.$apis.friendGroup
.momentCount(params)
.then(res => {
// if (res) {
this.viewLoading = false
this.groupNumber = res
// }
this.isUpdate = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
})
},
// 成员弹窗
handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
......@@ -264,6 +308,13 @@ export default {
if (valid) {
this.attachmentShow = true
const previewList = this.$refs.welcome.previewList
if (previewList.length == 0) {
this.$message({
type: 'error',
message: '朋友圈内容不能为空'
})
return
}
if (previewList.length != 0) {
this.basicForm.attachmentList = previewList
}
......@@ -380,6 +431,7 @@ export default {
font-size: 14px;
color: #999999;
margin-left: 10px;
font-weight: 100;
}
}
.info-box {
......@@ -405,6 +457,7 @@ export default {
}
.filter-footer {
margin-top: 10px;
display: flex;
// padding: 14px 20px;
justify-content: space-between;
......
......@@ -33,11 +33,11 @@
Next">确定</el-button>-->
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
<el-dialog title="已送达客户" :visible.sync="dialogVisible" width="576px" :before-close="handleClose" class="user-dialog">
<el-dialog title="已送达客户" :visible.sync="dialogVisible" width="576px" :before-close="handleClose" class="user-dialog">
<div class="user-list">
<div class="user-item" v-for="(item, index) in userList" :key="index">
<div class="user-image">
<img src="https://www.wangbase.com/blogimg/asset/201903/bg2019032511.png" alt="" />
<img :src="item.avatar" alt="" />
</div>
<div class="user-desc">
<div class="user-name">{{ item.customerName }}</div>
......@@ -95,10 +95,10 @@ export default {
},
{
label: '发送时间',
prop: 'sendTime'
// formatter: cellValue => {
// return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
// }
prop: 'sendTime',
formatter: cellValue => {
return cellValue.sendTime? cellValue.sendTime:'--'
}
},
{
label: '已送达客户',
......@@ -203,6 +203,9 @@ export default {
/deep/ .el-dialog {
height: 405px;
}
/deep/ .el-dialog__footer {
text-align: center;
}
}
.customer-detail {
color: #5850ff;
......@@ -266,7 +269,7 @@ export default {
border-bottom: 1px solid #d8d8d8;
}
.detail-info {
padding: 0 20px;
padding: 0 20px 20px;
.detail-total {
padding: 20px 0 14px;
font-size: 14px;
......
......@@ -3,7 +3,7 @@
<div class="marketing pro-group p-t-20">
<div class="m-b-20 friend-title">
<!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建商品</el-button> -->
<el-button :size="size" type="primary" fn="发布朋友圈" @click="handleEdit(1)">发布朋友圈</el-button>
<GLButton :size="size" type="primary" fn="编辑朋友圈" @click="handleEdit(1)">发布朋友圈</GLButton>
<span>管理员可直接在后台为员工创建朋友圈,员工收到朋友圈新消息提醒后,可快捷将管理员创建的朋友圈发送到自己朋友圈中。</span>
</div>
<div class="container">
......@@ -28,22 +28,26 @@
<div class="image-num">{{ scope.scope.previewListImg.length }}</div>
<div class="image-panel"><img src="@/assets/imgNum.png" /></div>
</div>
<div class="attachmentList-image attachmentList-video" v-if="index == 0 && item.attType == 3 && scope.scope.materialType == 3"><i class="el-icon-video-play"></i></div>
<div class="attachmentList-image attachmentList-video" v-if="index == 0 && item.attType == 3 && scope.scope.materialType == 3"><img src="@/assets/guestCustom/video-list.png" /></div>
</div>
<div v-for="item in scope.scope.previewListText" :key="item.id">
<div class="attachmentList-text" v-if="item.attContent">{{ item.attContent[0] }}</div>
</div>
</div>
</div>
<div slot="sendType" slot-scope="scope">
<span style="color: #eb4e4e" v-if="scope.scope.sendType == 1">定时发送</span>
<span v-if="scope.scope.sendType == 2">立即发送</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" disabled v-if="scope.scope.status == 2">创建中</el-button>
<el-button type="text" disabled v-if="scope.scope.status == 1">开始创建</el-button>
<el-button type="text" disabled v-if="scope.scope.status == 2 || scope.scope.status == 1">创建中</el-button>
<el-button type="text" disabled v-if="scope.scope.status == -1">创建失败</el-button>
<el-button type="text" disabled v-if="scope.scope.status == 4">取消发送</el-button>
<el-button type="text" v-if="scope.scope.sendType == 2 && getTimeStatus(scope.scope.sendTime) && scope.scope.status != 4" @click="handleCancel(scope.scope)">取消发送</el-button>
<el-popover v-if="scope.scope.status == 0" placement="top" width="230" trigger="click" content="未到朋友圈发送时间,无法查看详情">
<el-button slot="reference" type="text" style="color: #999999">详情</el-button>
</el-popover>
<el-button type="text" v-if="scope.scope.status == 3" @click="handleDetail(scope.scope)">详情</el-button>
<GLButton type="text" fn="详情" v-if="scope.scope.status == 3" @click="handleDetail(scope.scope)">详情</GLButton>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -94,12 +98,6 @@ export default {
// 搜索
searchFormData: [
{
label: '创建人',
name: 'createdName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
......@@ -110,6 +108,7 @@ export default {
label: '类型',
name: 'type',
type: 'select',
placeholder: '请选择',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
......@@ -119,6 +118,7 @@ export default {
label: '发布方式',
name: 'sendType',
type: 'select',
placeholder: '请选择',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
......@@ -139,9 +139,7 @@ export default {
{
label: '发布方式',
name: 'sendType',
formatter: cellValue => {
return this.baseData.modeStatusList.find(item => item.confId == cellValue.sendType).confName
},
addHtml: 'sendType',
width: '120'
},
{
......@@ -311,6 +309,35 @@ export default {
query: params
})
},
getTimeStatus(val) {
const time = new Date().getTime()
let sendTime = new Date(val).getTime()
if (sendTime - time > 2 * 60 * 1000) {
return true
} else {
return false
}
},
handleCancel(row) {
const time = new Date().getTime()
const sendTime = new Date(row.sendTime).getTime()
if (sendTime - time < 2 * 60 * 1000) {
this.$message.error('当前数据已经超时了')
return
}
this.$apis.friendGroup
.momentCancel({
id: row.id
})
.then(res => {
this.getListData()
this.$message({
type: 'success',
message: '取消成功'
})
// this.$set(this.employeelist[index], 'remindStatus', true)
})
},
handleUpOrDown(row) {
if (row.goodsStatus) {
this.downForm.id = row.id
......@@ -368,22 +395,22 @@ export default {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
// if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
// const temp = {}
// temp[this[formName][index].optionId] = ''
// temp[this[formName][index].optionLabel] = '全部'
// this[formName][index].optionList.unshift(temp)
// }
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
// if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
// const temp = {}
// temp[this[formName][index].optionId] = ''
// temp[this[formName][index].optionLabel] = '全部'
// this[formName][index].optionList.unshift(temp)
// }
}
})
}
......@@ -409,7 +436,9 @@ export default {
.friend-title {
color: #666666;
span {
font-size: 14px;
margin-left: 10px;
font-weight: 100;
}
}
.attachmentList-box {
......@@ -450,12 +479,12 @@ export default {
&.attachmentList-video {
background: rgba($color: #000000, $alpha: 0.7);
position: relative;
i {
img {
position: absolute;
font-size: 24px;
top: 5px;
left: 5px;
color: #fff;
top: 6px;
left: 6px;
width: 24px;
height: 24px;
}
}
> img {
......
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="!dialogVisible">
<el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="120px" :rules="materialGroupAddRules">
<el-form-item label="分组名称:" prop="groupName">
<el-input v-model="materialGroupAddForm.groupName" maxlength="8" show-word-limit></el-input>
<el-dialog :title="title" :visible.sync="dialogVisible" width="720px" :before-close="!dialogVisible">
<el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="110px" :rules="materialGroupAddRules">
<el-form-item label="分组名称:" prop="materialGroupName">
<el-input v-model="materialGroupAddForm.materialGroupName" maxlength="8" show-word-limit :size="size" placeholder="请输入分组名称" style="width: 567px"></el-input>
</el-form-item>
<el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group v-model="materialGroupAddForm.businessType" @change="handleCheckChange">
<el-checkbox v-for="value in businessTypes" :key="value" :label="value">{{ value }}</el-checkbox>
<!-- <el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group class="checkbox-group" :max="3" v-model="materialGroupAddForm.businessType">
<el-checkbox v-for="item in businessTypes" :key="item.id" :label="item.dictLabel"></el-checkbox>
</el-checkbox-group>
</el-form-item>
<span class="tips">添加业务类型,该素材组里面的所有素材均会添加此业务类型</span> -->
</el-form>
<span>添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="submitForm">确定创建</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</span>
</el-dialog>
</div>
......@@ -23,17 +23,24 @@
<script>
export default {
name: 'addMaterialGroupDia',
props: {
eventBus: Object,
// businessTypes: {
// type: Array
// }
},
data() {
return {
title: '新增素材组',
title: '创建素材组',
dialogVisible: false,
materialGroupAddForm: {
groupName: '',
id: '',
materialGroupName: '',
businessType: []
},
businessTypes: ['整车/新车','保养','维修','车险','二手车','改装','汽车金融','零配件/精品','通用(节假日等关怀素材)'],
groupCounter: [],
materialGroupAddRules: {
groupName: [
materialGroupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
{ max: 16, message: '分组名称最长为8个字', trigger: 'blur' }
]
......@@ -41,36 +48,114 @@ export default {
}
},
methods: {
init(value) {
// console.log(value, '~~~~');
if (value == 1) {
this.materialGroupAddForm = {
groupName: '',
businessType: []
init(addOrEdit, value, group) {
// this.findAllDictData('business_type')
console.log(value, '123')
this.dialogVisible = true
this.materialGroupAddForm = {
materialGroupName: '',
// businessType: []
}
this.groupCounter = group
if (addOrEdit == 2) {
this.title = '编辑素材组'
if (!value) {
this.materialGroupAddForm.materialGroupName = '新车素材组'
return
}
var params = {}
params.id = value.id
this.$apis.material.materialGroupDetail(params).then(res => {
console.log(res, '---')
this.materialGroupAddForm = res
// if (res.businessType) {
// this.materialGroupAddForm.businessType = this.materialGroupAddForm.businessType.split(',')
// } else {
// this.materialGroupAddForm.businessType = []
// }
})
}
this.dialogVisible = true
// Object.assign(this.materialGroupAddForm, value)
},
// 获取所有业务类型
// findAllDictData(dictType) {
// var params = {
// dictType
// }
// this.$apis.material.findAllDictData(params).then(res => {
// if (res) {
// if (dictType == 'business_type') {
// this.businessTypes = res
// }
// }
// })
// },
getParams() {
var params = JSON.parse(JSON.stringify(this.materialGroupAddForm))
return params
},
// 创建
submitForm() {
this.$refs.materialGroupAddForm.validate((valid) => {
if (valid) {
this.$emit('addMaterialGroup', this.materialGroupAddForm)
console.log(this.materialGroupAddForm)
this.$refs.materialGroupAddForm.validate(valid => {
if (valid) {
var params = this.getParams()
params.orderFlag = true
// 判断是创建还是编辑
if (this.materialGroupAddForm.id) {
this.eventBus.$emit('editMaterialGroup', params)
this.dialogVisible = false
} else {
alert('请输入分组名称')
return false;
return
}
});
// 判断素材组名称是否重复
var groupName = []
this.groupCounter.forEach(item => {
groupName.push(item.materialGroupName)
})
var idx = groupName.indexOf(this.materialGroupAddForm.materialGroupName)
if (idx != -1) {
this.$message({
message: '素材组名称不能重复',
type: 'warning'
})
return
}
this.eventBus.$emit('addMaterialGroup', params)
this.dialogVisible = false
} else {
this.$message({
message: '请输入素材组名称',
type: 'warning'
})
return false
}
})
},
handleCheckChange(val) {
console.log(val);
this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm);
}
// handleCheckChange(val) {
// console.log(val)
// this.materialGroupAddForm.businessType = val
// // console.log(this.materialGroupAddForm);
// }
}
}
</script>
<style>
<style lang="scss" scope>
.checkbox-group {
width: 567px;
box-sizing: border-box;
background: #f5f5f5;
padding: 16px 0 0 16px;
.el-checkbox {
width: 140px;
margin: 0;
padding: 0;
}
}
.tips {
font-size: 12px;
color: #666666;
display: block;
margin: -10px 0 0 110px;
}
</style>
\ No newline at end of file
<template>
<div class="introduct">
<el-dialog title="功能介绍" :visible.sync="introductionDialog" width="1080px" :before-close="handleClose">
<p>营销素材——将业务资料、经典案例、活动等以链接、PDF形式上传在营销素材库中,企业成员可在企业微信聊天侧边栏或者嘀加企微管家工作台中,一键发给客户,支持雷达追踪,并将客户的阅读等关键行为记录到客户动态中,并给客户打上指定标签。</p>
<h3>我的优势</h3>
<p class="list">1、门店可以为不同的业务部门提供不同的营销素材,规范营销内容;</p>
<p class="list">2、员工能便捷的在企业微信聊天侧边栏及嘀加企微管家工作台上直接使用营销素材,避免自己设计素材的烦恼;</p>
<p class="list">3、捕获客户对素材的交互行为并主动通知员工,获取客户的兴趣点,为业务转化提供参考依据。</p>
<!-- <div class="img_div"> -->
<img class="img_div" src="@/assets/material/introduction.png" alt="">
<!-- </div> -->
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleClose">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'functionIntroduc',
props: {
introductionDialog: {
type: Boolean,
default: false
}
},
data() {
return {
dialogVisible: this.introductionDialog
}
},
methods: {
handleClose() {
this.$emit('closeIntroductDia', this.dialogVisible);
}
}
}
</script>
<style>
.img_div {
height: 334px;
/* margin: 0 20px; */
}
p {
margin: 0 0 20px 32px;
}
h3 {
font-size: 17px;
margin: 0 0 16px 32px;
}
.list {
margin: 0 0 20px 32px;
}
</style>
\ No newline at end of file
<template>
<div class="material-group">
<div class="all-group">
<div>全部素材组 ({{ groupCounter.length }})</div>
<div>
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">新建</el-button>
</div>
</div>
<ul>
<li v-for="(item, index) in groupCounter" :key="index" @click="handleGroup(item)">
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle">
<div class="group-name">{{ item.materialGroupName }}</div>
<el-popover placement="right" trigger="hover">
<div>
<ul>
<!-- <li @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</li> -->
<li>
<GLButton :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
</li>
<!-- <li @click="handleAddGroup(2,item)">修改</li> -->
<li>
<GLButton :size="size" type="text" fn="修改" @click="handleAddGroup(2,item)">修改</GLButton>
</li>
<!-- <li @click="handleDeleteGroup(item.id)" v-if="item.isDefault == -1">删除</li> -->
<li>
<GLButton :size="size" type="text" fn="删除" @click="handleAddGroup(2,item)">删除</GLButton>
</li>
</ul>
</div>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
</li>
</ul>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
export default {
name: 'materialGroup',
props: { eventBus: Object },
data() {
return {
// 素材组数量
groupCounter: [],
materialGroup: {
id: "",
materialGroupName: "",
orderValue: "",
isDefault: ""
}
}
},
mounted() {
this.eventBus.$on('addMaterialGroup', data => {
// data.businessType = data.businessType.toString()
this.$apis.material.addMaterialGroup(data).then(res => {
if (res) {
this.getMaterialList()
}
})
})
this.eventBus.$on('editMaterialGroup', data => {
data.businessType = data.businessType.toString()
this.$apis.material.editMaterialGroup(data).then(res => {
if (res) {
this.getMaterialList()
}
})
})
this.materialInsert()
this.getMaterialList()
},
methods: {
// 创建素材组
materialInsert() {
var params = {}
params.isDefault = 0
this.$apis.material.addMaterialGroup(params).then(res => {
if (res) {
this.getMaterialList()
}
})
},
// 获取全部素材组
getMaterialList() {
this.$apis.material.getMaterialList({}).then(res => {
console.log(res);
this.groupCounter = res
})
},
// 点击素材组获取素材
handleGroup(item) {
var params = {}
params.groupId = item.id
params.pageNum = 1
params.pageSize = 10
this.$emit('getList', params, item)
},
// 打开1-新增, 2-编辑 素材组弹框
handleAddGroup(addOrEdit, value) {
console.log(addOrEdit, value)
this.$emit('openAddDialog', addOrEdit, value, this.groupCounter)
},
// 素材组置顶
handleStick(row) {
console.log(row, 'orderFlagorderFlag');
var params = {}
params.id = row.id
// 置顶
if (!row.orderTime) {
var date = new Date()
var stickDate = dayjs(date).format('YYYY-MM-DD HH:mm:ss')
params.orderTime = stickDate
params.orderFlag = true
console.log(params);
this.secondConfirm('提示', '确定置顶该素材组吗?', 'material', 'editMaterialGroup', params)
return
}
// 取消置顶
params.orderFlag = false
this.secondConfirm('提示', '确定取消置顶该素材组吗?', 'material', 'editMaterialGroup', params)
},
// 素材组删除
handleDeleteGroup(rowId) {
this.secondConfirm('提示', '删除素材组,该素材组下的所有素材均会被删除,请谨慎操作', 'material', 'deleteMaterialList', { id: rowId })
},
// 二次确认
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.getMaterialList()
}
})
}
}
})
},
}
}
</script>
<style lang="scss">
.el-popover {
min-width: 80px;
&:hover {
cursor: pointer
}
}
.material-group {
.all-group {
font-size: 16px;
font-weight: 600;
padding: 24px 16px 0 16px;
display: flex;
justify-content: space-between;
.el-button {
margin-top: -13px;
}
}
ul {
li {
text-align: left;
padding: 18px 16px 16px 18px;
i {
font-size: 16px;
padding-top: 6px;
position: absolute;
right: 16px;
transform:rotate(90deg);
}
}
}
}
ul {
padding: 0;
text-align: center;
margin-block-start: 0;
margin-block-end: 0;
li {
list-style: none;
padding: 5px;
position: relative;
&:hover {
color: #5850FF;
}
}
}
.add_btn {
color: #5850FF;
}
.group-name {
display: inline-flex;
margin-left: 8px;
}
</style>
......@@ -2,11 +2,11 @@
<div>
<glsx-combi-form ref="readPerDetailFormRef" :formObj="searchForm" :formData="readPerDetailFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="readPerDetailTableData" :pageConf="pageConf" :tableTotal="tableTotal">
<GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
</GLTable>
</div>
</template>
......@@ -15,33 +15,50 @@
import url from "@/assets/empty.png"
export default {
name: 'readPerDetail',
props: ['materialId'],
data() {
return {
url,
searchForm: {
staffName: ''
customerName: '',
customerPhone: '',
staffName: '',
materialId: this.materialId,
},
getListApi: this.$apis.material.readDetailPage,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
readPerDetailFormData: [
{
label: '客户名称:',
name: 'cunstormName',
label: '名称:',
name: 'customerName',
maxlength: 10,
type: 'input',
placeholder: '请输入名称'
},{
label: '客户手机号:',
name: 'customerPhone',
placeholder: '请输入客户手机号',
type: 'input'
},
{
label: '发送人:',
name: 'staffName',
maxlength: 10,
placeholder: '请输入发送人',
type: 'input'
}
],
tableParams: {
listName: 'list',
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'cunstormName'
prop: 'customerName'
},
{
label: '电话号码',
prop: 'customerPhone'
},
{
label: '发送人',
......@@ -49,11 +66,11 @@ export default {
},
{
label: '所属企微成员',
prop: 'resdTimes'
prop: 'departName'
},
{
label: '阅读次数',
prop: 'readTimes'
prop: 'readNumber'
},
{
label: '首次阅读时间',
......@@ -66,6 +83,22 @@ export default {
]
}
}
},
methods: {
// 搜索
handleSearch() {
this.$refs.readPerDetailRef.refreshTable()
},
// 重置
handleReset() {
this.searchForm = {
customerName: '',
customerPhone: '',
staffName: '',
materialId: this.materialId
}
this.handleSearch()
},
}
}
</script>
......
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容" clearable @keydown.enter.native="handleSearch"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button size="small" @click="handleReset">重置</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }">
<div style="margin-bottom: 8px" class="checkbox-box" v-for="(item, index) in labelTreeRets" :key="index" @click="item.checked = !item.checked">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click="item.checked = !item.checked"></span>
{{ item.labelGroup.name }}
<el-tag :size="size">{{ item.labelType }}</el-tag>
<el-radio-group class="tag-group" v-model="item.tagChecked" v-show="item.checked">
<div v-for="(itm, idx) in item.labelList" :key="idx" class="radio-tag">
<el-tooltip effect="dark" placement="top" :disabled="itm.name.length < 8">
<el-radio class="radio-text" :label="itm">{{ itm.name }}</el-radio>
<div slot="content">{{ itm.name }}</div>
</el-tooltip>
</div>
</el-radio-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRets">
<el-tag :title="item.tagChecked.name" v-if="item.tagChecked" type="info" class="tag-selected-item" :key="item.tagChecked" closable :disable-transitions="false" @close="remove(item, idx)">
{{ item.tagChecked.name }}
</el-tag>
</template>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
<el-button size="small" type="primary" @click="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'activityModel',
data() {
return {
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRets: []
}
},
watch: {
labelTreeRets: {
handler() {
this.selectNum = 0
this.labelTreeRets.forEach(item => {
if (item.tagChecked) {
this.selectNum++
}
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
console.log(item, '23232');
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
console.log(selectItem, '-----')
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
console.log(res.labelTreeRets)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelId = item.labelList[0].id
let index = tag.labelList.findIndex(iem => iem.id == labelId)
console.log(index)
// tag.tagChecked = item.tagChecked
tag.tagChecked = tag.labelList[index]
}
})
})
console.log(this.labelTreeRets)
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelType: item.labelType,
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: null,
isIndeterminate: false,
checkAll: false
}
})
}
})
},
remove(item, idx) {
item.tagChecked = null
},
//选中
handleSelect() {
if (this.selectNum > 3) {
this.$message({
message: '最多选择三个标签',
type: 'warning'
})
return
}
this.dialogVisible = false
let labelTreeRets = this.labelTreeRets
.map(item => {
if (item.tagChecked) {
return {
labelGroup: item.labelGroup,
labelType: item.labelType,
labelList: [item.tagChecked]
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
handleReset() {
this.labelGroupName = ''
this.querylabeltree()
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 26px;
display: flex;
flex-wrap: wrap;
.radio-tag {
display: inline-block;
width: 50%;
.el-radio {
margin: 8px 0;
display: inline-flex;
align-items: center;
/deep/.el-radio__inner{
box-shadow: none !important;
}
/deep/.el-radio__label {
display: inline-block;
max-width: 120px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
}
}
}
.checkbox-group-box {
overflow: auto;
.checkbox-box {
cursor: pointer;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 20px;
/deep/ {
.el-tag {
color: #aaa5fa !important;
font-size: 12px;
border: none;
background: rgba($color: #5850ff, $alpha: 0.1);
}
}
}
}
.tag-selected-box {
min-height: 200px;
}
</style>
......@@ -2,53 +2,57 @@
<div>
<glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="default" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="staffSendTableData" :pageConf="pageConf" :tableTotal="tableTotal">
</GLTable>
<GLTable ref="staffSendDetailRef" :pageConf="pageConf" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams"></GLTable>
</div>
</template>
<script>
import url from "@/assets/empty.png"
import url from '@/assets/empty.png'
export default {
name: 'staffSendDetail',
props: ['materialId'],
data() {
return {
url,
searchForm: {
staffName: ''
materialId: this.$route.query.id,
employeeName: ''
},
staffSendFormData: [
{
label: '姓名:',
name: 'staffName',
type: 'input'
label: '',
name: 'employeeName',
type: 'input',
placeholder: '请输入姓名',
prefixIcon: 'el-icon-search'
}
],
getListApi: this.$apis.material.sendDetailPage,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'list',
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '姓名',
prop: 'staffName'
prop: 'employeeName'
},
{
label: '发送次数',
prop: 'sendTimes',
prop: 'sendNumber',
sortable: true
},
{
label: '阅读次数',
prop: 'resdTimes',
prop: 'readNumber',
sortable: true
},
{
label: '阅读人数',
prop: 'readPer'
prop: 'readPeopleNumber'
},
{
label: '打开率',
......@@ -57,10 +61,23 @@ export default {
]
}
}
},
methods: {
// 搜索
handleSearch() {
this.$refs.staffSendDetailRef.refreshTable()
},
// 重置
handleReset() {
this.searchForm = {
staffName: '',
materialId: this.$route.query.id,
}
this.handleSearch()
}
}
}
</script>
<style lang="" scoped>
</style>
......@@ -5,46 +5,89 @@
</template>
<script>
// import E from 'wangeditor'
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
content: '',
editorOption: {},
editor: '',
content: '',
editorOption: {}
}
},
mounted() {
// this.getEdit()
this.getEdit()
},
methods: {
// getEdit() {
// var editor = new E('#div-demo')
getEdit() {
const _this = this;
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.width = 500
this.editor.config.uploadVideoServer = '/api/upload-video'
this.editor.config.excludeMenus = ['code']
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
console.log(resultFiles)
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// editor.config.uploadImgShowBase64 = true
// editor.config.showMenuTooltips = true
// editor.config.menuTooltipPosition = 'down'
// editor.config.height = 400
// editor.config.uploadVideoServer = '/api/upload-video'
// editor.config.excludeMenus = [
// 'code'
// ]
// editor.create()
// }
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
margin-top: 40px;
margin: 16px 300px 0 0;
}
.el-form .editor{
margin-top: 20px;
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
</style>
\ No newline at end of file
......@@ -11,7 +11,7 @@
<div class="cardDetail" v-if="!isShowEditWrap">
<div class="flex-1">
<p>{{ ruleForm.cardName }}</p>
<GLButton @click="openEditWrap" fn="编辑" mode="div"><img src="@/assets/edit.png" class="editIcon" @click="openEditWrap" alt="" /></GLButton>
<GLButton @click="openEditWrap" fn="编辑" mode="div"><img src="@/assets/editBlue.png" class="editIcon" @click="openEditWrap" alt="" /></GLButton>
</div>
<!-- <img src="@/assets/edit.png" class="editIcon" @click="openEditWrap" alt="" /> -->
......@@ -32,6 +32,7 @@
<span class="membershipDays" v-if="ruleForm.tryAble==1">{{ ruleForm.tryNum }}天试用</span>
<span class="membershipDays" v-else>已关闭</span>
<span class="lookQR" @click="extensionQR" v-if="ruleForm.tryAble==1">查看小程序推广码</span>
<!-- <el-button class="lookQR" size="small" type="primary" @click="extensionQR" v-if="ruleForm.tryAble==1">生成小程序推广码</el-button> -->
</div>
<el-button class="seeEquity" size="small" type="primary" @click="openDialog">查看权益</el-button>
</div>
......@@ -395,7 +396,7 @@ export default {
str = ''
} //限制只能输入一个小数点
if(value !== '' && value==0){
return (str = 1)
return (str = 0.01)
}
if (Number(value) >= 99999) {
return (str = 99999)
......@@ -413,6 +414,7 @@ export default {
return str
},
getCardContentFun() {
if(this.merchantModel ==2 && this.accountLevel ==1) return
getCardContent({ merchantId: this.merchantId }).then(res => {
if (!res) {
return
......@@ -427,6 +429,7 @@ export default {
})
},
openEditWrap() {
if(!this.ruleForm.equityId) return
this.copyRuleForm = JSON.parse(JSON.stringify(this.ruleForm))
this.isShowEditWrap = true
},
......
<template>
<div>
<base-info v-show="activeName == 'baseInfo'" :routeInfo="routeInfo"></base-info>
<edit-event v-show="activeName == 'editEvent'"></edit-event>
<base-info v-show="activeName == 'baseInfo'" ref="baseInfoRef" :routeInfo="routeInfo" @handleTabChange="jumpEvent"></base-info>
<edit-event v-if="activeName == 'editEvent'" :eventObj="eventObj" :condLimitObj="condLimitObj" @handleTabChange="jumpBaseInfo" @handleInfoConfirm="handleInfoConfirm"></edit-event>
</div>
</template>
......@@ -14,10 +14,22 @@ export default {
data() {
return {
activeName: 'baseInfo',
// activeName: 'editEvent',
routeInfo: {
// add-新增;edit-编辑;look-查看
addOrEdit: 'add',
id: ''
},
// 编辑-标记idx
eventIndex: '',
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
},
eventObj: {
addOrEdit: 'add',
info: {}
}
}
},
......@@ -27,11 +39,32 @@ export default {
editEvent
},
mounted() {
created() {
this.routeInfo = this.$route.query
},
methods: {}
methods: {
jumpBaseInfo(obj) {
this.activeName = obj.activeName
},
handleInfoConfirm(info) {
// console.log(info)
// console.log(this.$refs.baseInfoRef.editForm.eventList)
this.eventObj.addOrEdit == 'add' ? this.$refs.baseInfoRef.editForm.eventList.push(info.baseInfo) : this.$set(this.$refs.baseInfoRef.editForm.eventList, this.eventIndex, info.baseInfo)
console.log(this.$refs.baseInfoRef.editForm)
this.$refs.baseInfoRef.dealSopTime()
this.jumpBaseInfo({ activeName: 'baseInfo' })
},
jumpEvent(obj) {
this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit)
this.$set(this.eventObj, 'info', obj.info)
this.eventIndex = obj.eventIndex
this.$set(this.condLimitObj, 'hasPhone', obj.condLimitObj.hasPhone)
this.$set(this.condLimitObj, 'hasQw', obj.condLimitObj.hasQw)
this.activeName = obj.activeName
}
}
}
</script>
......
<!-- 朋友圈模板弹窗 -->
<template>
<glsx-dialog title="选择朋友圈模板" :isVisible.sync="isNicknameVisible" width="1088px" @confirmDialog="handleNicknameConfirm" @closeDialog="handleNicknameClose" class="relateStore">
<div class="model-panel">
<div class="model-panel-tab">
<label>活动类型:</label>
<el-tabs v-model="activeName" @tab-click="handleClick" type="card">
<!-- 0-纯文字,1-单图+文,2-多图+文,3-视频+文,4-链接+文 -->
<el-tab-pane label="单图文" name="1"></el-tab-pane>
<el-tab-pane label="多图文" name="2"></el-tab-pane>
<el-tab-pane label="文字+视频" name="3"></el-tab-pane>
<el-tab-pane label="文字" name="0"></el-tab-pane>
<!-- <el-tab-pane label="文字+链接" name="4"></el-tab-pane> -->
</el-tabs>
</div>
<div class="model-item-panel" v-if="modelList.length > 0" v-loading="loading">
<div class="model-item" :class="{ checked: selectItem.id == item.id }" v-for="(item, index) in modelList" :key="index" @click="handleSelectItem(item)">
<div v-if="item.showVideoContent.length">
<video class="model-item-img" :src="item.showVideoContent[0].attContent" controls="controls"/>
</div>
<div v-if="!item.showVideoContent.length && item.showImgContent.length">
<img class="model-item-img" :src="item.showImgContent[0].attContent"/>
</div>
<div class="model-item-content" :title="item.showTxtContent">{{ item.showTxtContent }}</div>
</div>
</div>
<div class="model-item-empty" v-else v-loading="loading">
<img src="@/assets/empty.png" />
<div class="empty-item">暂无数据</div>
</div>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" :total="tableTotal" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'nicknameModel',
data() {
return {
// searchForm: {
// groupId: '',
// businessType: ''
// },
// searchFormData: [
// {
// label: '素材分组',
// name: 'groupId',
// type: 'select',
// optionList: [],
// optionId: 'id',
// optionLabel: 'NicknameGroupName',
// optionsName: 'groupList'
// },
// {
// label: '素材类型',
// name: 'businessType',
// type: 'select',
// optionList: [],
// optionId: 'confId',
// optionLabel: 'confName',
// optionsName: 'businessTypeList'
// }
// ],
// selectedData: [],
// selectingData: [],
// needTip: ['editProduct'],
activeName: '1',
modelList: [],
selectItem: {
id: ''
},
// 分页
pageNum: 1,
pageSize: 10,
tableTotal: 0
}
},
props: {
isNicknameVisible: {
type: Boolean,
default: false
}
// storeApi: {
// type: Function,
// default: () => {}
// },
// storeSelected: {
// type: Array,
// default: () => []
// }
// storeSearchForm: {
// type: Object,
// default: () => {}
// }
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components: {
glsxDialog
},
mounted() {
// this.selectedData = this.storeSelected
// this.selectedData.forEach(item => {
// item.merchantNo = item.merchantId ? (item.merchantId + '') : item.merchantNo
// })
// this.getSelectingList()
this.getModelList()
},
methods: {
handleClick() {
this.pageNum = 1
this.getModelList()
},
handleSelectItem(item) {
this.selectItem = item
},
getModelList() {
var params = {
materialType: this.activeName,
pageNum: this.pageNum,
pageSize: this.pageSize
}
this.$apis.sop.getMomentListApi(params).then(res => {
this.modelList = res.data
// attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// attContent 附件内容
this.modelList.forEach(item => {
// 文字
let txtObj = item.attachmentList.find(k => k.attType == 1)
item.showTxtContent = txtObj ? txtObj.attContent : ''
// 图片
let imgList = item.attachmentList.filter(k => k.attType == 2)
item.showImgContent = imgList || []
// 视频
let videoList = item.attachmentList.filter(k => k.attType == 3)
item.showVideoContent = videoList || []
})
this.tableTotal = res.count
})
},
handleSizeChange(val) {
this.pageSize = val
this.getModelList()
},
handleCurrentChange(val) {
this.pageNum = val
this.getModelList()
},
handleNicknameConfirm() {
console.log(this.selectItem)
// activeName 0-纯文字,1-单图+文,2-多图+文,3-视频+文,4-链接+文
var valToType = {
0: 4,
1: 1,
2: 2,
3: 3
}
// objectType 对象类型(1朋友圈模板-单图文,2朋友圈模板-多图文,3朋友圈模板-文字+视频,4朋友圈模板-文字,5优惠券-商城券,6活动-权益卡使用,7活动-权益套餐,8活动-秒杀活动)
this.$emit('handleNicknameConfirm', {
objectId: this.selectItem.id,
objectType: valToType[this.activeName],
objectName: '',
showTxtContent: this.selectItem.showTxtContent,
showImgContent: this.selectItem.showImgContent,
showVideoContent: this.selectItem.showVideoContent,
additionalType: 4
})
},
handleNicknameClose() {
this.$emit('handleNicknameClose')
}
}
}
</script>
<style lang="scss" scoped>
.model-panel {
.model-panel-tab {
display: flex;
align-items: center;
margin-bottom: 18px;
label {
font-size: 16px;
font-weight: 400;
color: #000000;
line-height: 24px;
}
/deep/ {
.el-checkbox:last-of-type {
margin-right: 8px;
}
.el-tabs__nav {
border: 0;
}
.el-tabs__header {
border: 0;
background-color: #f4f6fc;
margin: 0px;
}
.el-tabs__item {
border: none;
width: 180px;
height: 32px;
line-height: 32px;
margin: 2px;
text-align: center;
}
.el-tabs__item.is-active {
background-color: #fff;
border-radius: 4px;
font-weight: 600;
}
}
}
.model-item-empty {
> img {
display: block;
margin: 50px auto 0px;
width: 60px;
height: auto;
}
.empty-item {
text-align: center;
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 22px;
margin-bottom: 30px;
}
}
.model-item-panel {
// display: grid;
// grid-template-columns: repeat(4, 25%);
// grid-row-gap: 10px;
max-height: 38vh;
overflow: auto;
display: flex;
flex-wrap: wrap;
align-items: stretch;
flex-direction: row;
.model-item {
width: 180px;
margin-right: 33px;
margin-bottom: 24px;
// padding: 12px 16px;
position: relative;
height: 156px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e6e6e6;
// padding: 14px 24px;
box-sizing: border-box;
&:nth-child(5n) {
margin-right: 0px;
}
&.checked {
background: rgba(88, 80, 255, 0.1);
border: 1px solid #5850ff;
}
&-qrcode {
position: absolute;
right: 10px;
bottom: 10px;
width: 60px;
height: 60px;
border: 1px solid #979797;
}
&-title {
font-size: 18px;
font-weight: 600;
color: #333333;
line-height: 25px;
margin-bottom: 5px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
&-img {
width: 180px;
height: 100px;
}
&-content {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 16px;
height: 16px;
margin: 8px 16px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
&.model-item-weight {
line-height: 20px;
height: 20px;
}
span {
color: #5850ff;
font-size: 20px;
}
}
&-contents {
line-height: 22px;
height: 22px;
}
}
}
}
</style>
<template>
<div class="select-cutomer">
<div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div>
<div class="flex-default">
<div class="customer-list">
<div v-show="selectedLabelList.length != 0" class="tag-box">
<span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in selectedLabelList" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag>
</span>
</div>
</div>
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable>
</div>
<div class="selected-list">
<p class="list-title p-16">已选({{ selectedSum }})</p>
<div class="list-customers" :style="{ height: heightBox + 'px' }">
<el-tag v-for="(item, idx) in selectedCustomerList" :key="idx" :size="size" type="info" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ item.customerName }}
</el-tag>
</div>
</div>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectCustomer',
data() {
return {
url: url,
searchForm: {},
customerList: [],
selectedSum: 0,
heightBox: 200,
// 表格
getListApi: this.$apis.sop.getCustomerByTagListApi,
tableParams: {
listName: 'data',
// 行数据的key
mutiSelectUniqueKey: 'id',
checkSelectKey: 'id',
checkSelectVal: [],
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '客户名称',
prop: 'customerName',
line: 1,
width: '110px'
},
{
label: '客户手机号',
prop: 'customerPhone',
width: '110px',
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '性别',
prop: 'customerSex',
width: '60px',
formatter: cellValue => {
return this.baseData.sexList.find(item => item.confId == cellValue.customerSex).confName
}
},
{
label: '是否加企微',
prop: 'isJoin',
formatter: cellValue => {
return this.baseData.joinList.find(item => item.confId == cellValue.isJoin).confName
}
},
{
label: '添加客户时间',
prop: 'addTime',
width: '160px'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {
sexList: [
{
confId: 0,
confName: '未知'
},
{
confId: 1,
confName: '男'
},
{
confId: 2,
confName: '女'
}
],
joinList: [
{
confId: 0,
confName: '否'
},
{
confId: 1,
confName: '是'
}
]
}
}
},
props: {
selectedLabelList: {
type: Array,
default: () => []
},
selectedCustomerList: {
type: Array,
default: () => []
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
}
},
watch: {
selectedCustomerList: {
handler() {
this.selectedSum = this.selectedCustomerList.length
},
deep: true
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = {
// labelStandInfoList: []
tagLists: []
}
this.selectedLabelList.length &&
this.selectedLabelList.forEach(item => {
item.labelList.forEach(subItem => {
// this.searchForm.labelStandInfoList.push({
this.searchForm.tagLists.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
groupType: item.labelType,
labelId: subItem.id,
labelName: subItem.name
})
})
})
resolve()
})
},
setTableFinishFun() {
this.tableList = this.$refs.customerRef.data
this.recoverySelected()
//接收到的数据为空
this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun()
},
recoverySelected() {
this.selectedCustomerList.forEach(row => {
var idx = this.tableList.findIndex(k => k.id == row.id)
if (idx != -1) {
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], true)
}
})
// 找到不符合条件的,变为不可选
this.tableParams.checkSelectVal = []
if (this.selectedCustomerList.length) {
this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
}
})
}
},
dealCondLimit(val) {
this.condLimitObj.hasQw = val.isJoin
this.condLimitObj.hasPhone = val.customerPhone ? 1 : 0
},
handleSelectionTable(val) {
// 未选客户时,筛选客户条件
if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0])
}
this.selectedCustomerList = JSON.parse(JSON.stringify(val))
this.recoverySelected()
// console.log(this.selectedCustomerList)
}
}
}
</script>
<style lang="scss" scoped>
.select-cutomer {
.title {
margin-bottom: 12px;
}
.tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
.customer-list {
width: calc(100% - 280px);
border: 1px solid #eeeeee;
margin-right: 10px;
}
.p-16 {
padding: 16px;
}
.selected-list {
width: 280px;
border-radius: 2px;
border: 1px solid #eeeeee;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
.list-title {
font-size: 16px;
border-bottom: 1px solid #f1f1f1;
}
.list-customers {
// box-sizing: border-box;
// height: 61vh;
padding: 10px;
overflow-y: scroll;
}
.customer-box {
padding: 16px;
.customer-label {
color: #999999;
margin-bottom: 14px;
}
.customer-content {
border-bottom: 1px solid #e5e5e5;
.customer-item {
margin-bottom: 20px;
display: inline-flex;
align-items: center;
.muti-icon {
cursor: pointer;
}
.customer-coupon-name {
display: inline-block;
width: 109px;
margin: 0 5px 0 7px;
}
.customer-sum {
display: inline-block;
width: 82px;
text-align: right;
.el-input-number--mini .el-input__inner {
padding: 0 10px;
}
.sum-input {
display: inline-block;
width: 82px;
}
.el-input--mini .el-input__inner {
border: 0px;
}
.el-input-number--mini .el-input-number__decrease,
.el-input-number--mini .el-input-number__increase {
width: 20px !important;
border: 0px;
background-color: #fff;
}
}
.customer-tips {
display: inline-block;
font-size: 12px;
height: 18px;
line-height: 18px;
color: #999999;
background-color: #eeeded;
margin-right: 7px;
}
}
.customer-item:last-child {
margin-bottom: 0;
}
}
.customer-content:last-child {
border-bottom: 0px;
}
}
}
}
</style>
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
<div class="tag-panel">
<el-dialog :title="activeName == 'tag' ? '选择标签' : '选择客户'" :visible.sync="dialogVisible" width="1080px" :before-close="handleClose">
<div v-show="activeName == 'tag'" class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
......@@ -42,6 +42,7 @@
</div>
</div>
</div>
<select-customer v-if="activeName == 'cutomer'" ref="customerRef" :selectedLabelList="selectedLabelList" :condLimitObj.sync="condLimitObj" :selectedCustomerList.sync="selectedCustomerList"></select-customer>
<span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
......@@ -54,10 +55,12 @@
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
import selectCustomer from './selectCustomer.vue'
export default {
name: 'activityModel',
data() {
return {
activeName: 'tag',
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
......@@ -88,9 +91,14 @@ export default {
// isIndeterminate: false,
// checkAll: false
// }
]
],
selectedLabelList: [],
selectedCustomerList: []
}
},
components: {
selectCustomer
},
watch: {
labelTreeRets: {
handler() {
......@@ -112,7 +120,10 @@ export default {
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
this.activeName = 'tag'
this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : ''
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.querylabeltree(item.tagList)
},
handleSearch() {
this.searchStatus = true
......@@ -180,8 +191,7 @@ export default {
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRets
this.selectedLabelList = this.labelTreeRets
.map(item => {
if (item.tagChecked) {
return {
......@@ -192,8 +202,15 @@ export default {
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
console.log(this.selectedLabelList)
// 标签
if (this.activeName == 'tag') {
this.activeName = 'cutomer'
return false
}
// 客户
this.$emit('tagSelected', { selectedLabelList: this.selectedLabelList, selectedCustomerList: this.$refs.customerRef.selectedCustomerList, condLimitObj: this.$refs.customerRef.condLimitObj })
this.dialogVisible = false
},
handleReset() {
this.labelGroupName = ''
......@@ -297,7 +314,7 @@ export default {
margin: 8px 0;
display: inline-flex;
align-items: center;
/deep/.el-radio__inner{
/deep/.el-radio__inner {
box-shadow: none !important;
}
/deep/.el-radio__label {
......
......@@ -28,11 +28,11 @@
</div>
</div>
<div class="sop-box" :style="{ 'padding-bottom': sopList.length ? '2px' : '12px' }">
<div class="chart-box sop-flex">
<div class="chart-box sop-flex" v-show="sopList.length">
<div class="chart-item" v-for="item in sopList" :key="item.id">
<p>{{ item.sopName }}</p>
<div :id="'sopPie' + item.id" class="chart-pie"></div>
<p>2021.10.28-2022.10.28</p>
<p>{{ item.dateRange }}</p>
<div class="sop-btns">
<GLButton class="btn-item" :size="size" type="primary" fn="分析sop" @click="handleJump('sopAnalysisList', item)">sop分析</GLButton>
<GLButton class="btn-item" :size="size" type="primary" fn="编辑sop" @click="handleEdit('edit', item)">编辑</GLButton>
......@@ -40,6 +40,10 @@
</div>
</div>
</div>
<div v-show="!sopList.length" class="txt-center">
<img src="@/assets/empty.png" />
<p class="m-t-10">暂无数据</p>
</div>
</div>
</div>
</div>
......@@ -47,6 +51,7 @@
<script>
import * as echarts from 'echarts'
import * as moment from 'moment'
export default {
name: 'sopIndex',
data() {
......@@ -90,60 +95,12 @@ export default {
}
]
},
sopList: [
{
id: '1',
sopName: 'sop的名称1',
// 1-未开始;2-进行中;3-已结束
sopStatus: '2',
sopStatistics: {
finishEventCount: 10,
eventCount: 100
}
},
{
id: '2',
sopName: 'sop的名称2',
sopStatus: '2',
sopStatistics: {
finishEventCount: 22,
eventCount: 100
}
},
{
id: '3',
sopName: 'sop的名称3',
sopStatus: '2',
sopStatistics: {
finishEventCount: 100,
eventCount: 100
}
},
{
id: '4',
sopName: 'sop的名称4',
sopStatus: '2',
sopStatistics: {
finishEventCount: 59,
eventCount: 100
}
},
{
id: '5',
sopName: 'sop的名称5',
sopStatus: '2',
sopStatistics: {
finishEventCount: 13,
eventCount: 100
}
}
]
sopList: []
}
},
mounted() {
this.dealListData()
this.drawPie()
this.getList()
},
methods: {
......@@ -168,7 +125,7 @@ export default {
})
if (res.code == '0') {
fn && fn()
// this.handleSearch()
this.getList()
}
})
}
......@@ -176,14 +133,40 @@ export default {
})
},
getList() {
var params = {
sopStatus: 2,
pageNum: 1,
pageSize: 999999
}
this.$apis.sop.getSopInfoListApi(params).then(res => {
// console.log(res)
this.sopList = res.list
this.dealListData()
this.$nextTick(() => {
this.drawPie()
})
})
},
// 数据处理
dealListData() {
this.sopList.forEach(item => {
item.completedPercent = Math.round((item.sopStatistics.finishEventCount / item.sopStatistics.eventCount) * 100).toFixed(0)
item.dateRange =
moment(item.startDate)
.format('YYYY-MM-DD')
.replace(/-/g, '.') +
(item.endDate
? '-' +
moment(item.endDate)
.format('YYYY-MM-DD')
.replace(/-/g, '.')
: '')
})
},
drawPie() {
console.log(this.sopList)
this.sopList.forEach(item => {
let chartDom = document.getElementById('sopPie' + item.id)
let myChart = echarts.init(chartDom)
......@@ -199,7 +182,7 @@ export default {
},
{
value: item.sopStatistics.eventCount - item.sopStatistics.finishEventCount,
name: '总营销事件'
name: '未触发的营销事件'
}
]
......@@ -209,7 +192,7 @@ export default {
// 结束
handleEnd(row) {
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'zoneList', 'deleteZoneApi', { id: row.id })
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id })
},
// 1-新增;2-编辑
......
......@@ -4,29 +4,29 @@
<div class="container">
<div class="title m-b-20">
SOP名称:
<span>这是某次营销sop</span>
<span>{{ sopInfo.sopName }}</span>
</div>
<div class="analysis-box flex-default">
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
营销时间总数
营销事件总数
<img src="@/assets/sop/sop-event.png" />
</div>
<p class="analysis-num">20</p>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.eventCount : '-' }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
已完成事件数
<img src="@/assets/sop/completed-event.png" />
</div>
<p class="analysis-num">12</p>
<p class="analysis-num">{{ sopInfo.sopStatistics ? sopInfo.sopStatistics.finishEventCount : '-' }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
完成率
</div>
<p class="analysis-num">60%</p>
<p class="analysis-num">{{ sopInfo.completedPercent + '%' }}</p>
<div id="completePie" class="chart-pie"></div>
</div>
</div>
......@@ -34,7 +34,7 @@
<p class="m-b-10">日营销事件明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
<GLTable ref="completeListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
......@@ -44,7 +44,6 @@
import * as echarts from 'echarts'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
import { pieOption } from './pieOption'
export default {
name: 'completeList',
......@@ -52,83 +51,108 @@ export default {
return {
size: 'small',
url: url,
sopInfo: {
sopStatistics: {}
},
searchForm: {},
// 表格
getListApi: this.$apis.giftBag.getListApi,
getListApi: this.$apis.sop.getEventListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '营销事件',
prop: 'name'
prop: 'sopName',
formatter: cellValue => {
var repeatTxt = ''
var weekToTxt = {
1: '一',
2: '二',
3: '三',
4: '四',
5: '五',
6: '六',
7: '日'
}
switch(cellValue.repeatMode) {
case 1:
repeatTxt = ' 每天重复推送至'
break
case 2:
repeatTxt = ' 每周' + weekToTxt[cellValue.repeatTime] + '重复推送至'
break
case 3:
repeatTxt = ' 每月' + cellValue.repeatTime + '重复推送至'
break
}
return cellValue.eventStartDate + ' ' + cellValue.eventTime + (cellValue.repeatFlag == 'Y' ? repeatTxt : ' 单次')+ (cellValue.repeatFlag == 'Y' ? ' ' + cellValue.eventEndDate : '')
}
},
{
label: '营销渠道',
prop: 'remarkName',
width: '200'
prop: 'pushChannelType',
width: '140',
formatter: cellValue => {
var pushChannelTypeList = {
1: '企业微信',
2: '短信',
3: '微信朋友圈'
}
return pushChannelTypeList[cellValue.pushChannelType]
}
},
{
label: '营销事件总数',
prop: 'anticipatedCost',
prop: 'eventStatistics',
width: '140',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
return cellValue.eventStatistics ? cellValue.eventStatistics.eventCount : '-'
}
},
{
label: '已完成事件数',
prop: 'staffList',
prop: 'eventStatistics',
width: '140',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
return cellValue.eventStatistics ? cellValue.eventStatistics.finishEventCount : '-'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
props: {
sopId: {
type: String,
default: ''
}
},
mounted() {
this.drawPie()
this.getBaseInfo()
},
methods: {
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.sopId = this.sopId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
this.$refs.completeListRef.data.length ? (this.$refs.completeListRef.tableHeightValues = '') : this.$refs.completeListRef.setTableHeightFun()
},
getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
this.sopInfo = res
this.sopInfo.completedPercent = Math.round((this.sopInfo.sopStatistics.finishEventCount / this.sopInfo.sopStatistics.eventCount) * 100).toFixed(0)
this.drawPie()
})
},
drawPie() {
......@@ -139,23 +163,21 @@ export default {
// option.series[0].name = item.sopName
option.series[0].data = [
{
value: 60,
value: this.sopInfo.sopStatistics.finishEventCount,
name: '已触发的营销事件'
},
{
value: 40,
value: this.sopInfo.sopStatistics.eventCount - this.sopInfo.sopStatistics.finishEventCount,
name: '未触发的营销事件'
}
]
console.log(option)
option && myChart.setOption(option)
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
}
// handleSearch() {
// this.$refs.completeListRef.refreshTable()
// }
}
}
</script>
......
......@@ -4,7 +4,7 @@
<div class="container">
<div class="title m-b-20">
SOP名称:
<span>这是某次营销sop</span>
<span>{{ sopInfo.sopName }}</span>
</div>
<div class="analysis-box flex-default">
......@@ -13,20 +13,18 @@
已下发任务总数
<img src="@/assets/sop/task-total.png" />
</div>
<p class="analysis-num">20</p>
<p class="analysis-num">{{ sopInfo.sopStatistics.issuedTaskCount }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
已完成任务数
<img src="@/assets/sop/task.png" />
</div>
<p class="analysis-num">12</p>
<p class="analysis-num">{{ sopInfo.sopStatistics.finishTaskCount }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
总任务完成率
</div>
<p class="analysis-num">60%</p>
<div class="analysis-title-block m-b-20">总任务完成率</div>
<p class="analysis-num">{{ sopInfo.taskPercent + '%' }}</p>
<div id="completePie" class="chart-pie"></div>
</div>
</div>
......@@ -34,7 +32,7 @@
<p class="m-b-10">员工任务明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
<GLTable ref="staffListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
......@@ -44,63 +42,58 @@
import * as echarts from 'echarts'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
import { pieOption } from './pieOption'
export default {
name: 'completeList',
name: 'staffList',
data() {
return {
size: 'small',
url: url,
sopInfo: {
sopStatistics: {}
},
searchForm: {},
isCheckStatus: false,
// 表格
getListApi: this.$apis.giftBag.getListApi,
getListApi: this.$apis.sop.getSopStaffTaskListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '员工名称',
prop: 'name'
prop: 'userName'
},
{
label: '已完成任务数',
prop: 'remarkName',
width: '200'
prop: 'finishTaskCount'
},
{
label: '已下发任务数',
prop: 'anticipatedCost',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
}
prop: 'issuedTaskCount'
},
{
label: '个人完成率',
prop: 'staffList',
prop: 'percent',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
return cellValue.issuedTaskCount ? ((cellValue.finishTaskCount / cellValue.issuedTaskCount) * 100).toFixed(2) + '%' : '0%'
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
}
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
props: {
sopId: {
type: String,
default: ''
}
},
mounted() {
this.drawPie()
this.getTaskStatus()
this.getBaseInfo()
},
methods: {
......@@ -126,9 +119,31 @@ export default {
})
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm.sopId = this.sopId
this.isCheckStatus ? resolve() : reject()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
this.$refs.staffListRef.data.length ? (this.$refs.staffListRef.tableHeightValues = '') : this.$refs.staffListRef.setTableHeightFun()
},
getTaskStatus() {
this.$apis.sop.getTaskStatusApi({}).then(res => {
this.isCheckStatus = true
this.$refs.staffListRef.refreshTable()
})
},
getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
this.sopInfo = res
this.sopInfo.taskPercent = this.sopInfo.sopStatistics.issuedTaskCount ? Math.round((this.sopInfo.sopStatistics.finishTaskCount / this.sopInfo.sopStatistics.issuedTaskCount) * 100).toFixed(0) : 0
this.drawPie()
})
},
drawPie() {
......@@ -136,15 +151,14 @@ export default {
let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(pieOption))
// option.series[0].name = item.sopName
option.series[0].data = [
{
value: 60,
name: '已触发的营销事件'
value: this.sopInfo.sopStatistics.finishTaskCount,
name: '已完成的事件数'
},
{
value: 40,
name: '未触发的营销事件'
value: this.sopInfo.sopStatistics.issuedTaskCount - this.sopInfo.sopStatistics.finishTaskCount,
name: '未完成的事件数'
}
]
......@@ -154,7 +168,7 @@ export default {
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
this.$refs.staffListRef.refreshTable()
}
}
}
......
......@@ -4,7 +4,7 @@
<div class="container">
<div class="title m-b-20">
SOP名称:
<span>这是某次营销sop</span>
<span>{{ sopInfo.sopName }}</span>
</div>
<div>
......@@ -21,20 +21,20 @@
客户总数
<img src="@/assets/sop/customer-total.png" />
</div>
<p class="analysis-num">20</p>
<p class="analysis-num">{{ sopInfo.customerCount || '-'}}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
已触达客户数
<img src="@/assets/sop/touch-customer.png" />
</div>
<p class="analysis-num">12</p>
<p class="analysis-num">{{ selectedEventInfo.eventStatistics ? selectedEventInfo.eventStatistics.reachCustomerCount : '-' }}</p>
</div>
<div class="analysis-block">
<div class="analysis-title-block m-b-20">
触达率
</div>
<p class="analysis-num">60%</p>
<p class="analysis-num">{{ sopInfo.touchPercent + '%' }}</p>
<div id="completePie" class="chart-pie"></div>
</div>
</div>
......@@ -42,7 +42,7 @@
<p class="m-b-10">客户触达明细</p>
<!-- 表格区域 开始 -->
<GLTable ref="giftListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<GLTable ref="touchListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit('edit', scope.scope)">编辑</GLButton>
<GLButton type="text" fn="删除" @click="handleDelete(scope.scope)">删除</GLButton>
......@@ -57,94 +57,123 @@
import * as echarts from 'echarts'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { aToExport } from '@/common/constant'
import { pieOption } from './pieOption'
export default {
name: 'completeList',
name: 'touchList',
data() {
return {
size: 'small',
url: url,
searchForm: {
name: '',
staffName: '',
createDate: []
sopId: '',
eventId: ''
},
sopInfo: {},
selectedEventInfo: {
eventStatistics: {}
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '营销事件',
name: 'name',
name: 'eventId',
type: 'select',
width: '415px'
width: '415px',
optionList: [],
optionId: 'id',
optionLabel: 'confName',
optionsName: 'sopEventList',
changeAttr: (val, targetItem) => {
this.searchForm.eventId = val
this.selectedEventInfo = this.baseData.sopEventList.find(item => item.id == val)
this.getBaseInfo()
this.$refs.touchListRef.refreshTable()
}
}
],
// 表格
getListApi: this.$apis.giftBag.getListApi,
getListApi: this.$apis.sop.getSopCustomerStatisticsListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '客户名称',
prop: 'name'
prop: 'customerName'
},
{
label: '客户手机号',
prop: 'remarkName',
width: '200'
prop: 'customerPhone',
width: '110'
},
{
label: '初次查看事件',
prop: 'anticipatedCost',
prop: 'firstViewDate',
formatter: cellValue => {
return (cellValue.anticipatedCost / 100).toFixed(2)
return dayjs(cellValue.firstViewDate).format('YYYY-MM-DD HH:mm:ss') || '未查看'
}
},
{
label: '营销事件总数',
prop: 'staffList',
formatter: cellValue => {
return cellValue.staffList.map(item => item.staffName).join(',')
}
label: '查看次数',
prop: 'viewCount'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
commentStatusList: [
{
confId: '0',
confName: '未发布'
},
{
confId: '1',
confName: '已发布'
}
]
sopEventList: []
}
}
},
props: {
sopId: {
type: String,
default: ''
}
},
mounted() {
this.drawPie()
this.getOptionsList('searchFormData')
this.getBaseData()
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
this.sopInfo = res
this.sopInfo.touchPercent = Math.round((this.selectedEventInfo.eventStatistics.reachCustomerCount / this.sopInfo.customerCount) * 100).toFixed(0)
this.drawPie()
})
},
getBaseData() {
var params = {
sopId: this.sopId,
pageNum: 1,
pageSize: 999999
}
var pushChannelTypeList = {
1: '企业微信',
2: '短信',
3: '微信朋友圈'
}
delete params.createDate
return params
this.$apis.sop.getEventListApi(params).then(res => {
this.baseData.sopEventList = res.list
console.log(res)
this.baseData.sopEventList.forEach(item => {
item.confName = item.eventStartDate + (item.repeatFlag == 'Y' ? '-' + item.eventEndDate : '') + ' ' + item.eventTime + ' ' + pushChannelTypeList[item.pushChannelType]
})
this.getOptionsList('searchFormData', false)
this.searchForm.eventId = this.baseData.sopEventList[0].id
this.selectedEventInfo = this.baseData.sopEventList[0]
this.getBaseInfo()
this.$refs.touchListRef.refreshTable()
})
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
return new Promise((resolve, reject) => {
this.searchForm.sopId = this.sopId
this.baseData.sopEventList.length ? resolve() : reject()
})
},
......@@ -162,7 +191,7 @@ export default {
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
// this.handleSearch()
}
})
}
......@@ -170,13 +199,6 @@ export default {
})
},
handleExport() {
var params = this.getParams()
this.$apis.giftBag.giftExportApi(params).then(res => {
aToExport(res)
})
},
handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该礼包?', 'giftBag', 'deleteGiftApi', { id: row.id })
},
......@@ -231,7 +253,7 @@ export default {
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.giftListRef.data.length ? (this.$refs.giftListRef.tableHeightValues = '') : this.$refs.giftListRef.setTableHeightFun()
this.$refs.touchListRef.data.length ? (this.$refs.touchListRef.tableHeightValues = '') : this.$refs.touchListRef.setTableHeightFun()
},
drawPie() {
......@@ -239,15 +261,14 @@ export default {
let myChart = echarts.init(chartDom)
let option = JSON.parse(JSON.stringify(pieOption))
// option.series[0].name = item.sopName
option.series[0].data = [
{
value: 60,
name: '已触发的营销事件'
value: this.selectedEventInfo.eventStatistics.reachCustomerCount,
name: '已触达的客户数'
},
{
value: 40,
name: '未触发的营销事件'
value: this.sopInfo.customerCount - this.selectedEventInfo.eventStatistics.reachCustomerCount,
name: '未触达的客户数'
}
]
......@@ -256,9 +277,9 @@ export default {
option && myChart.setOption(option)
},
handleSearch() {
this.$refs.giftListRef.refreshTable()
}
// handleSearch() {
// this.$refs.touchListRef.refreshTable()
// }
}
}
</script>
......
......@@ -3,13 +3,13 @@
<div class="sop-analysis">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="完成率分析" name="compleList">
<complete-list v-if="activeName == 'compleList'"></complete-list>
<complete-list v-if="activeName == 'compleList'" :sopId="routeInfo.id"></complete-list>
</el-tab-pane>
<el-tab-pane label="触达率分析" name="touchList">
<touch-list v-if="activeName == 'touchList'"></touch-list>
<touch-list v-if="activeName == 'touchList'" :sopId="routeInfo.id"></touch-list>
</el-tab-pane>
<el-tab-pane label="员工完成率分析" name="staffList">
<staff-list v-if="activeName == 'staffList'"></staff-list>
<staff-list v-show="activeName == 'staffList'" :sopId="routeInfo.id"></staff-list>
</el-tab-pane>
</el-tabs>
<el-button :size="size" class="sop-back-btn" type="primary" @click="handleBack">返回</el-button>
......@@ -25,7 +25,10 @@ export default {
data() {
return {
activeName: 'compleList',
size: 'small'
size: 'small',
routeInfo: {
id: ''
}
}
},
......@@ -35,7 +38,9 @@ export default {
staffList
},
mounted() { },
created() {
this.routeInfo = this.$route.query
},
methods: {
handleTabClick() { },
......
......@@ -18,10 +18,10 @@
<!-- 表格区域 开始 -->
<GLTable ref="sopListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleJump('sopAnalysisList', scope.scope)">sop分析</el-button>
<el-button type="text" @click="handleEnd(scope.scope)">结束</el-button>
<el-button type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
<el-button v-if="scope.scope.sopStatus != 1" type="text" @click="handleJump('sopAnalysisList', scope.scope)">sop分析</el-button>
<el-button v-if="scope.scope.sopStatus == 2" type="text" @click="handleEnd(scope.scope)">结束</el-button>
<el-button v-if="scope.scope.sopStatus != 3" type="text" @click="handleEdit('edit', scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.sopStatus == 1" type="text" @click="handleDelete(scope.scope)">删除</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -39,53 +39,64 @@ export default {
size: 'small',
url: url,
searchForm: {
zoneName: '',
status: []
sopName: '',
sopStatus: ''
},
// tableSearchForm: {},
// 搜索
searchFormData: [
{
label: 'sop名称',
name: 'zoneName',
name: 'sopName',
type: 'input',
isClear: true,
maxlength: 20
},
{
label: '营销状态',
name: 'status',
type: 'select'
name: 'sopStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'sopStatusList'
}
],
// 表格
getListApi: this.$apis.proManage.getListApi,
getListApi: this.$apis.sop.getSopInfoListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: 'sop名称',
prop: 'goodsName'
prop: 'sopName'
},
{
label: '营销时间',
prop: 'createdDate',
width: '180',
prop: 'startDate',
width: '220',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
return dayjs(cellValue.startDate).format('YYYY-MM-DD') + (cellValue.endDate ? '-' + dayjs(cellValue.endDate).format('YYYY-MM-DD') : '')
}
},
{
label: '营销状态',
prop: 'goodsName'
prop: 'sopStatus',
formatter: cellValue => {
return this.baseData.sopStatusList.find(item => item.confId == cellValue.sopStatus).confName
}
},
{
label: '完成度',
prop: 'goodsName'
prop: 'sopStatistics',
formatter: cellValue => {
return cellValue.sopStatistics ? Math.round((cellValue.sopStatistics.finishEventCount / cellValue.sopStatistics.eventCount) * 100).toFixed(0) + '%' : '-'
}
},
{
label: '创建人',
prop: 'goodsName'
prop: 'createdBy'
},
{
label: '创建时间',
......@@ -97,16 +108,35 @@ export default {
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
sopStatusList: [
{
confId: 1,
confName: '未开始'
},
{
confId: 2,
confName: '进行中'
},
{
confId: 3,
confName: '已结束'
}
]
}
}
},
mounted() { },
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
handleJump(path) {
handleJump(path, row = {}) {
this.$router.push({
path: '/sop/' + path
path: '/sop/' + path,
query: row ? { id: row.id } : ''
})
},
// getParams() {
......@@ -163,11 +193,37 @@ export default {
// 结束
handleEnd(row) {
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'zoneList', 'deleteZoneApi', { id: row.id })
this.secondConfirm('结束', '结束sop后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id })
},
handleDelete(row) {
this.secondConfirm('删除', 'sop删除后,不可恢复。是否确定删除?', 'proManage', 'deleteZoneApi', { id: row.id })
this.secondConfirm('删除', 'sop删除后,不可恢复。是否确定删除?', 'sop', 'deleteSopEventApi', { sopId: row.id })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
......@@ -181,8 +237,8 @@ export default {
handleReset() {
this.searchForm = {
zoneName: '',
status: []
sopName: '',
sopStatus: ''
}
this.handleSearch()
}
......
......@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`]
}
module.exports = {
outputDir: `../dist/${packageName}`,
......@@ -33,7 +33,8 @@ module.exports = {
'vue-router': 'VueRouter',
vuex: 'Vuex',
axios: 'axios',
echarts: 'echarts'
echarts: 'echarts',
moment: 'moment'
}
},
devServer: {
......@@ -67,4 +68,4 @@ module.exports = {
})
.end()
}
}
\ No newline at end of file
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!