Commit ed5d49d7 by 前端

Merge branch 'xuyl_dev_v3.3.0' into 'master'

合并3.3.0代码到主干

See merge request !396
2 parents aec657b2 38cf76c6
...@@ -2083,17 +2083,6 @@ ...@@ -2083,17 +2083,6 @@
"color-convert": "^2.0.1" "color-convert": "^2.0.1"
} }
}, },
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cliui": { "cliui": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz", "resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
...@@ -2135,13 +2124,6 @@ ...@@ -2135,13 +2124,6 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
"dev": true "dev": true
}, },
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
...@@ -2183,28 +2165,6 @@ ...@@ -2183,28 +2165,6 @@
"ansi-regex": "^5.0.1" "ansi-regex": "^5.0.1"
} }
}, },
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
},
"wrap-ansi": { "wrap-ansi": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz", "resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
...@@ -2556,6 +2516,11 @@ ...@@ -2556,6 +2516,11 @@
"@xtuc/long": "4.2.2" "@xtuc/long": "4.2.2"
} }
}, },
"@xmldom/xmldom": {
"version": "0.8.6",
"resolved": "https://registry.npmmirror.com/@xmldom/xmldom/-/xmldom-0.8.6.tgz",
"integrity": "sha512-uRjjusqpoqfmRkTaNuLJ2VohVr67Q5YwDATW3VU7PfzTj6IRaihGrYI7zckGZjxQPBIp63nfvJbM+Yu5ICh0Bg=="
},
"@xtuc/ieee754": { "@xtuc/ieee754": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmmirror.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz", "resolved": "https://registry.npmmirror.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz",
...@@ -4417,6 +4382,14 @@ ...@@ -4417,6 +4382,14 @@
"resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz", "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
}, },
"cos-js-sdk-v5": {
"version": "1.4.14",
"resolved": "https://registry.npmmirror.com/cos-js-sdk-v5/-/cos-js-sdk-v5-1.4.14.tgz",
"integrity": "sha512-nw4kQijqyXSzRElL9HAKGWA96SQk6Sfx/SvJrGra2cXo2L4ipL3Y0wNnH+Wga1f7iigun85+nIk9BrL5+iBJOg==",
"requires": {
"@xmldom/xmldom": "^0.8.6"
}
},
"cosmiconfig": { "cosmiconfig": {
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz", "resolved": "https://registry.npmmirror.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
...@@ -5897,8 +5870,7 @@ ...@@ -5897,8 +5870,7 @@
"eventemitter3": { "eventemitter3": {
"version": "4.0.7", "version": "4.0.7",
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz", "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="
"dev": true
}, },
"events": { "events": {
"version": "3.3.0", "version": "3.3.0",
...@@ -7935,6 +7907,11 @@ ...@@ -7935,6 +7907,11 @@
"integrity": "sha512-efJLHhLjIyKRewNS9EGZ4UpI8NguuL6fKkhRxVuMmrGV2xN/0APGdQYwLFky5w9naebSZ0OwAGp0G6/2Cg90rA==", "integrity": "sha512-efJLHhLjIyKRewNS9EGZ4UpI8NguuL6fKkhRxVuMmrGV2xN/0APGdQYwLFky5w9naebSZ0OwAGp0G6/2Cg90rA==",
"dev": true "dev": true
}, },
"js-sha1": {
"version": "0.6.0",
"resolved": "https://registry.npmmirror.com/js-sha1/-/js-sha1-0.6.0.tgz",
"integrity": "sha512-01gwBFreYydzmU9BmZxpVk6svJJHrVxEN3IOiGl6VO93bVKYETJ0sIth6DASI6mIFdt7NmfX9UiByRzsYHGU9w=="
},
"js-tokens": { "js-tokens": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz",
...@@ -12701,6 +12678,18 @@ ...@@ -12701,6 +12678,18 @@
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
"dev": true "dev": true
}, },
"vod-js-sdk-v6": {
"version": "1.5.0",
"resolved": "https://registry.npmmirror.com/vod-js-sdk-v6/-/vod-js-sdk-v6-1.5.0.tgz",
"integrity": "sha512-WkMtV9MDxO//6SDQgw+QsbO3dskJwE8nmch2Wn3e4Oub5/eav6DMedFAHRjar+tt9WDLveO0YLxa3yVBQ2DHbQ==",
"requires": {
"axios": "^0.21.1",
"cos-js-sdk-v5": "^1.3.7",
"eventemitter3": "^4.0.7",
"js-sha1": "^0.6.0",
"uuid": "^3.3.2"
}
},
"vue": { "vue": {
"version": "2.6.14", "version": "2.6.14",
"resolved": "https://registry.npmmirror.com/vue/-/vue-2.6.14.tgz", "resolved": "https://registry.npmmirror.com/vue/-/vue-2.6.14.tgz",
...@@ -12809,6 +12798,75 @@ ...@@ -12809,6 +12798,75 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": { "vue-router": {
"version": "3.5.4", "version": "3.5.4",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.5.4.tgz", "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.5.4.tgz",
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
"glsx-components": "^1.5.3", "glsx-components": "^1.5.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"node-sass": "^4.0.0", "node-sass": "^4.0.0",
"vod-js-sdk-v6": "^1.5.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
......
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-28 10:12:36
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-28 10:25:09
* @FilePath: \live\src\components\big-view\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="view-panel">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</div>
</template>
<script>
export default {
name: 'view',
data() {
return {
dialogVisibleImg: true
}
},
props: {
dialogType: String,
dialogSrc: String
},
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
/*
* @Author: yangming yangming@didihu.com.cn
* @Date: 2022-11-24 14:42:00
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2022-11-24 17:18:31
* @FilePath: \live\src\mixins\upload.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
export default {
data() {
return {}
},
methods: {
getImgUrl(url, multiple = 3) {
return new Promise((resolve, reject) => {
var canvas = document.createElement('canvas') // 获取 canvas 对象
const ctx = canvas.getContext('2d') // 绘制2d
let video = document.getElementById('video')
video.src = url
video.crossOrigin = 'anonymous' // 解决跨域问题,也就是提示污染资源无法转换视频
video.currentTime = 1 // 第一帧
video.oncanplay = async () => {
canvas.width = video.clientWidth * multiple // 获取视频宽度
canvas.height = video.clientHeight * multiple // 获取视频高度
// 利用canvas对象方法绘图
ctx.drawImage(video, 0, 0, video.clientWidth * multiple, video.clientHeight * multiple)
console.log(canvas, 'canvas')
// 转换成base64形式
var oGrayImg = canvas.toDataURL('image/png') // 截取后的视频封面
const file = this.dataURLtoFile(oGrayImg)
const imgUrl = await this.uploadImg(file)
resolve(imgUrl)
}
})
},
//将base64转换为文件
dataURLtoFile(dataurl, filename = 'file.png') {
var arr = dataurl.split(','),
mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]),
n = bstr.length,
u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
return new File([u8arr], filename, { type: mime })
},
// // 图片上传
uploadImg(fileInfo) {
return new Promise((resolve, reject) => {
var reader = new FileReader()
reader.readAsDataURL(fileInfo)
reader.onload = e => {
const imgFile = e.target.result
const base64 = fileInfo.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
resolve(res)
})
}
})
}
}
}
<template> <template>
<div class="container marketing"> <div class="container marketing" v-loading="loading">
<el-form ref="materialAddForm" :model="materialAddForm" :label-width="defaultLabelWidth" :rules="materialAddFormRules"> <el-form ref="materialAddForm" :model="materialAddForm" :label-width="defaultLabelWidth"
:rules="materialAddFormRules">
<div class="creat-material"> <div class="creat-material">
<h4>{{ title }}</h4> <h4>{{ title }}</h4>
<el-divider></el-divider> <el-divider></el-divider>
<div class="m-l-20"> <div class="m-l-20">
<el-form-item v-if="routeInfo.addOrEdit == 1" label="选择素材组:" prop="groupId"> <el-form-item v-if="!notDisplayProperties" label="选择素材组:" prop="groupId">
<el-select v-model="materialAddForm.groupId" placeholder="全部" :size="size"> <el-select v-model="materialAddForm.groupId" placeholder="全部" :size="size">
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option> <el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName"
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item v-else label="选择素材组:" prop="selectMaterialGroupName"> <el-form-item v-else label="选择素材组:" prop="selectMaterialGroupName">
<el-select v-model="materialAddForm.groupName" placeholder="全部" :size="size" disabled> <el-select v-model="materialAddForm.groupName" placeholder="全部" :size="size" disabled>
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option> <el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName"
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="素材名称:" prop="materialName"> <el-form-item label="素材名称:" prop="materialName">
<el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入素材名称" maxlength="30"></el-input> <el-input v-model="materialAddForm.materialName" :size="size" placeholder="请输入素材名称"
maxlength="30" :disabled="notDisplayProperties"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="素材类型:" prop="materialType"> <el-form-item label="素材类型:" prop="materialType" class="materialType">
<el-radio-group v-model="materialAddForm.materialType" @change="radioChange" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1"> <el-radio-group v-model="materialAddForm.materialType" @change="radioChange"
:disabled="routeInfo.addOrEdit != 1">
<el-radio :label="1">PDF文件</el-radio> <el-radio :label="1">PDF文件</el-radio>
<!-- <el-radio :label="2">自定义链接</el-radio> --> <!-- <el-radio :label="2">自定义链接</el-radio> -->
<el-radio :label="3">图文</el-radio> <el-radio :label="3">图文</el-radio>
...@@ -27,8 +32,11 @@ ...@@ -27,8 +32,11 @@
<!-- 选择PDF --> <!-- 选择PDF -->
<div v-show="materialAddForm.materialType == 1"> <div v-show="materialAddForm.materialType == 1">
<div class="pdf-show"> <div class="pdf-show">
<input type="file" style="opacity: 0" accept=".pdf" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1" @change="e => handlePdfChange(e)" /> <input type="file" style="opacity: 0" accept=".pdf"
<el-button icon="el-icon-plus" :size="size" :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1">选择文件</el-button> :disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1" @change="e => handlePdfChange(e)"/>
<el-button icon="el-icon-plus" :size="size"
:disabled="routeInfo.addOrEdit == 2 && routeInfo.status != 1">选择文件
</el-button>
</div> </div>
<!-- <div v-if="pdfUrl">{{ pdfUrl }}</div> --> <!-- <div v-if="pdfUrl">{{ pdfUrl }}</div> -->
<ul v-if="pdfName || materialAddForm.materialUrl"> <ul v-if="pdfName || materialAddForm.materialUrl">
...@@ -49,6 +57,59 @@ ...@@ -49,6 +57,59 @@
<!-- 选择图文 --> <!-- 选择图文 -->
<div v-show="materialAddForm.materialType == 3"> <div v-show="materialAddForm.materialType == 3">
<textBox @change="writeChange" ref="textBox" @forbid="forbidEdit"></textBox> <textBox @change="writeChange" ref="textBox" @forbid="forbidEdit"></textBox>
<el-form-item label="图片:" class="photoWrap">
<div class="img-div">
<div class="put-img" v-for="(item,index) in materialAddForm.imageUrlList" :key="item"
v-show="materialAddForm.imageUrlList[index]">
<img :src="item" alt=""/>
<div class="mask" v-if="item">
<h3>
<el-popover placement="top" trigger="click">
<div>
<img class="img-plus" :src="item" alt=""/>
</div>
<img slot="reference" src="@/assets/material/view.png" alt=""/>
</el-popover>
<img v-if="!notDisplayProperties" class="del-img" src="@/assets/material/dele.png" alt=""
@click="deleteImg('imageUrlList',item)"/>
</h3>
</div>
</div>
<div class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div>
<input :class="{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties" type="file" style="opacity: 0" accept=".jpg, .jpeg, .png"
@change="e => handleImgChange(e,'imageUrlList')"/>
</div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div>
</el-form-item>
<el-form-item label="视频:" class="photoWrap">
<div class="img-div">
<div class="put-img" v-if="materialAddForm.videoUrl">
<video :src="materialAddForm.videoUrl" id="video" width="100%" height="100%" preload loop muted>
<!-- <source :src="materialAddForm.videoUrl" type="video/mp4"/>-->
</video>
<div class="mask">
<h3>
<img slot="reference" src="@/assets/material/view.png" alt="" @click="viewVideo"/>
<img v-if="!notDisplayProperties" class="del-img"
src="@/assets/material/dele.png" alt="" @click="deleteImg('videoUrl')"/>
</h3>
</div>
</div>
<div class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传视频</div>
<input :class="{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties" type="file" style="opacity: 0"
accept="video/*"
@change="e =>handleVideoChange(e,'videoUrl')"/>
</div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div>
</el-form-item>
</div> </div>
<div class="space"></div> <div class="space"></div>
</el-form-item> </el-form-item>
...@@ -62,35 +123,43 @@ ...@@ -62,35 +123,43 @@
<span slot="label"> <span slot="label">
<span class="label-word"> <span class="label-word">
业务类型 业务类型
<el-popover placement="top-start" width="200" trigger="hover" content="给素材添加业务类型,客户可根据业务类型筛选,也可在客户浏览了该素材时能及时提醒跟进员工,以提高客户成单率。"> <el-popover placement="top-start" width="200" trigger="hover"
<img slot="reference" src="@/assets/question.png" alt="" /> content="给素材添加业务类型,客户可根据业务类型筛选,也可在客户浏览了该素材时能及时提醒跟进员工,以提高客户成单率。">
<img slot="reference" src="@/assets/question.png" alt=""/>
</el-popover> </el-popover>
: :
</span> </span>
</span> </span>
<el-checkbox-group v-model="materialAddForm.businessType"> <el-checkbox-group v-model="materialAddForm.businessType"
<el-checkbox v-for="value in businessTypes" :key="value.businessName" :label="value.id">{{ value.businessName }}</el-checkbox> :disabled="notDisplayProperties">
<el-checkbox v-for="value in businessTypes" :key="value.businessName" :label="value.id">
{{ value.businessName }}
</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item prop="isNotifySender"> <el-form-item prop="isNotifySender">
<span slot="label"> <span slot="label">
<span class="label-word"> <span class="label-word">
动态通知 动态通知
<el-popover placement="top-start" width="200" trigger="hover" content="有效浏览:指客户在页面的停留时间超过15秒并且有交互行为,非完全静止"> <el-popover placement="top-start" width="200" trigger="hover"
<img slot="reference" src="@/assets/question.png" alt="" /> content="有效浏览:指客户在页面的停留时间超过15秒并且有交互行为,非完全静止">
<img slot="reference" src="@/assets/question.png" alt=""/>
</el-popover> </el-popover>
: :
</span> </span>
</span> </span>
<el-checkbox :value="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox> <el-checkbox :disabled="notDisplayProperties" :value="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">
客户打开素材链接时通知发送人
</el-checkbox>
<span class="track-tips track-info">(客户不包括本商户的员工)</span> <span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item> </el-form-item>
<el-form-item prop="tagJson"> <el-form-item prop="tagJson">
<span slot="label"> <span slot="label">
<span class="label-word"> <span class="label-word">
行为标签 行为标签
<el-popover placement="top-start" width="200" trigger="hover" content="标签失效后在客户信息中看不到此标签,但是在素材效果统计的记录仍然存在"> <el-popover placement="top-start" width="200" trigger="hover"
<img slot="reference" src="@/assets/question.png" alt="" /> content="标签失效后在客户信息中看不到此标签,但是在素材效果统计的记录仍然存在">
<img slot="reference" src="@/assets/question.png" alt=""/>
</el-popover> </el-popover>
: :
</span> </span>
...@@ -101,10 +170,11 @@ ...@@ -101,10 +170,11 @@
<div class="tag-show"> <div class="tag-show">
<div v-show="tagging.length != 0" :key="key" class="input-tag-wrapper"> <div v-show="tagging.length != 0" :key="key" class="input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx"> <span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag> <el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable
:disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span> </span>
</div> </div>
<el-button :size="size" @click="openLabel"> <el-button :size="size" @click="openLabel" :disabled="notDisplayProperties">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
选择标签 选择标签
</el-button> </el-button>
...@@ -134,31 +204,39 @@ ...@@ -134,31 +204,39 @@
<div class="share-desc" v-show="descVisible"> <div class="share-desc" v-show="descVisible">
<div class="share-desc-left m-l-20"> <div class="share-desc-left m-l-20">
<el-form-item label="分享标题:"> <el-form-item label="分享标题:">
<el-input v-model="materialAddForm.materialTitle" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义标题"></el-input> <el-input v-model="materialAddForm.materialTitle" :size="size" maxlength="30" show-word-limit
placeholder="请输入自定义标题"
:disabled="notDisplayProperties"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述:"> <el-form-item label="描述:">
<el-input type="textarea" v-model="materialAddForm.description" :size="size" maxlength="30" show-word-limit placeholder="请输入自定义描述"></el-input> <el-input type="textarea" v-model="materialAddForm.description" :size="size" maxlength="30"
show-word-limit placeholder="请输入自定义描述"
:disabled="notDisplayProperties"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="封面:"> <el-form-item label="封面:">
<div class="img-div"> <div class="img-div">
<div class="put-img" v-show="materialAddForm.titleUrl"> <div class="put-img" v-show="materialAddForm.titleUrl">
<img :src="materialAddForm.titleUrl" alt="" /> <img :src="materialAddForm.titleUrl" alt=""/>
<div class="mask" v-if="materialAddForm.titleUrl"> <div class="mask" v-if="materialAddForm.titleUrl">
<h3> <h3>
<el-popover placement="top" trigger="click"> <el-popover placement="top" trigger="click">
<div> <div>
<img class="img-plus" :src="materialAddForm.titleUrl" alt="" /> <img class="img-plus" :src="materialAddForm.titleUrl" alt=""/>
</div> </div>
<img slot="reference" src="@/assets/material/view.png" alt="" /> <img slot="reference" src="@/assets/material/view.png" alt=""/>
</el-popover> </el-popover>
<img class="del-img" src="@/assets/material/dele.png" alt="" @click="deleteImg" /> <img v-if="!notDisplayProperties" class="del-img"
src="@/assets/material/dele.png" alt="" @click="deleteImg('titleUrl')"/>
</h3> </h3>
</div> </div>
</div> </div>
<div class="avatar-uploader-desc"> <div class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i> <i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div> <div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" /> <input type="file" style="opacity: 0" accept=".jpg, .jpeg, .png"
:class="{disableUpload:notDisplayProperties}"
:disabled="notDisplayProperties"
@change="e => handleImgChange(e,'titleUrl')"/>
</div> </div>
<!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> --> <!-- <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> -->
</div> </div>
...@@ -166,14 +244,14 @@ ...@@ -166,14 +244,14 @@
</div> </div>
<div class="share-desc-right"> <div class="share-desc-right">
<div class="share-desc-right-box"> <div class="share-desc-right-box">
<img class="share-desc-right-box-phone" src="@/assets/material/phone.png" alt="" /> <img class="share-desc-right-box-phone" src="@/assets/material/phone.png" alt=""/>
<div class="content-show"> <div class="content-show">
<div> <div>
<div class="content-title">{{ materialAddForm.materialTitle }}</div> <div class="content-title">{{ materialAddForm.materialTitle }}</div>
<div class="content-word">{{ materialAddForm.description }}</div> <div class="content-word">{{ materialAddForm.description }}</div>
</div> </div>
<div class="content-show-img" v-show="materialAddForm.titleUrl"> <div class="content-show-img" v-show="materialAddForm.titleUrl">
<img :src="materialAddForm.titleUrl" alt="" /> <img :src="materialAddForm.titleUrl" alt=""/>
</div> </div>
</div> </div>
</div> </div>
...@@ -186,20 +264,28 @@ ...@@ -186,20 +264,28 @@
<GLFooter class="gl-footer"> <GLFooter class="gl-footer">
<el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button> <el-button @click="onSave" v-if="this.routeInfo.addOrEdit == 1">存草稿</el-button>
<el-button @click="handleCancel" class="btn-cancle">取消</el-button> <el-button @click="handleCancel" class="btn-cancle">取消</el-button>
<el-button @click="handleSubmit" type="primary">确定</el-button> <el-button @click="handleSubmit" v-if="this.routeInfo.addOrEdit !== 3" type="primary">确定</el-button>
</GLFooter> </GLFooter>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="30%">
<big-view ref="viewForm" v-if="dialogVisibleImg" :dialogSrc="dialogSrc" :dialogType="dialogType"></big-view>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import textBox from '@/views/material/components/textBox' import textBox from '@/views/material/components/textBox'
import SelectLabel from '@/views/material/components/selectLable' import SelectLabel from '@/views/material/components/selectLable'
import bigView from '@/components/big-view'
// import upload from '@/api/uploadApi'
import uploadMixin from '@/mixins/upload'
// import pdfReviewDia from './components/pdfReviewDia.vue' // import pdfReviewDia from './components/pdfReviewDia.vue'
export default { export default {
name: 'addMaterialForm', name: 'addMaterialForm',
mixins: [uploadMixin],
components: { components: {
textBox, textBox,
SelectLabel SelectLabel,
bigView
// pdfReviewDia // pdfReviewDia
}, },
data() { data() {
...@@ -209,6 +295,11 @@ export default { ...@@ -209,6 +295,11 @@ export default {
1: '创建营销素材', 1: '创建营销素材',
2: '编辑营销素材' 2: '编辑营销素材'
}, },
notDisplayProperties:'',
loading: false,
dialogVisibleImg: false,
dialogSrc: '',
dialogType: '',
routeInfo: {}, routeInfo: {},
dialogVisible: false, dialogVisible: false,
tagging: [], tagging: [],
...@@ -228,7 +319,9 @@ export default { ...@@ -228,7 +319,9 @@ export default {
tagJson: [], // 行为标签 tagJson: [], // 行为标签
materialTitle: '', // 分享标题 materialTitle: '', // 分享标题
description: '', // 描述 description: '', // 描述
titleUrl: '' // 封面 titleUrl: '',// 封面
imageUrlList: [],
videoUrl: ''
}, },
groupCounter: [], groupCounter: [],
// 分享设置显示 // 分享设置显示
...@@ -237,18 +330,18 @@ export default { ...@@ -237,18 +330,18 @@ export default {
// phoneVisible: false, // phoneVisible: false,
businessTypes: [], businessTypes: [],
materialAddFormRules: { materialAddFormRules: {
groupId: [{ required: true, message: '请选择素材组', trigger: 'change' }], groupId: [{required: true, message: '请选择素材组', trigger: 'change'}],
materialName: [ materialName: [
{ required: true, message: '请输入素材名称', trigger: 'change' }, {required: true, message: '请输入素材名称', trigger: 'change'},
{ max: 30, message: '素材名称长度不能超过30', trigger: 'blur' } {max: 30, message: '素材名称长度不能超过30', trigger: 'blur'}
], ],
materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }], materialType: [{required: true, message: '请选择素材类型', trigger: 'change'}],
businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }] businessType: [{required: true, message: '请选择业务类型', trigger: 'change'}]
}, },
linkRules: { linkRules: {
link: [ link: [
{ required: true, message: '请输入链接地址', trigger: 'change' }, {required: true, message: '请输入链接地址', trigger: 'change'},
{ max: 150, message: '链接地址长度不能超过30', trigger: 'blur' } {max: 150, message: '链接地址长度不能超过30', trigger: 'blur'}
] ]
} }
} }
...@@ -256,16 +349,46 @@ export default { ...@@ -256,16 +349,46 @@ export default {
mounted() { mounted() {
this.routeInfo = this.$route.query this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : '' this.routeInfo.addOrEdit != 1 ? this.getMaterialInfo() : ''
this.routeInfo.addOrEdit != 1 ? (this.routeInfo.status != 1 ? this.forbidEdit() : '') : '' this.routeInfo.addOrEdit == 3 ? this.forbidEdit() : ''
this.title = this.titleObj[this.routeInfo.addOrEdit] this.title = this.titleObj[this.routeInfo.addOrEdit]
// this.notDisplayProperties = this.routeInfo.addOrEdit == 3 && this.routeInfo.status != 1
this.notDisplayProperties = this.routeInfo.addOrEdit == 3
console.log(this.routeInfo.status)
console.log(this.routeInfo.addOrEdit)
console.log(this.notDisplayProperties)
this.materialInsert() this.materialInsert()
this.getMaterialList() this.getMaterialList()
// this.findAllDictData('business_type') // this.findAllDictData('business_type')
this.getListEntBusinessType() this.getListEntBusinessType()
}, },
methods: { methods: {
viewVideo() {
this.dialogVisibleImg = true
this.dialogSrc = this.materialAddForm.videoUrl
},
handleVideoChange(e) {
let file = e.srcElement.files[0]
let reader = new FileReader()
// // 默认1MB
const limitSize = 20
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('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({file: base64}).then(res => {
if (res) {
this.materialAddForm.videoUrl = res
}
})
}
},
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.materialAddForm)) let params = JSON.parse(JSON.stringify(this.materialAddForm))
let tagging = this.tagging.map(item => { let tagging = this.tagging.map(item => {
let tagIds = item.labelList.map(tag => { let tagIds = item.labelList.map(tag => {
return tag.id return tag.id
...@@ -306,6 +429,8 @@ export default { ...@@ -306,6 +429,8 @@ export default {
if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4 if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4
if (!imgHtml && !videoHtml) params.materialType = 5 if (!imgHtml && !videoHtml) params.materialType = 5
if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6 if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6
if (this.materialAddForm.vedioUrl && !this.materialAddForm.imageUrlList.length) params.materialType = 4
if (this.materialAddForm.imageUrlList.length) params.materialType = 3
this.textBoxContent = encodeURIComponent(this.textBoxContent) this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent params.materialUrl = this.textBoxContent
} }
...@@ -313,14 +438,15 @@ export default { ...@@ -313,14 +438,15 @@ export default {
}, },
// 获取素材详情 // 获取素材详情
getMaterialInfo() { getMaterialInfo() {
var params = {} let params = {}
params.id = this.routeInfo.id params.id = this.routeInfo.id
if (this.routeInfo.status == -1) { params.flag = 0
params.flag = 0 // if (this.routeInfo.status == -1) {
} // params.flag = 0
// }
this.$apis.material.materialDetail(params).then(res => { this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res this.materialAddForm = res
if (res.businessType) { if (res && res.businessType) {
const businessTypeArr = this.materialAddForm.businessType.split(',') const businessTypeArr = this.materialAddForm.businessType.split(',')
this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item)) this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item))
} else { } else {
...@@ -422,7 +548,7 @@ export default { ...@@ -422,7 +548,7 @@ export default {
const imgFile = e.target.result const imgFile = e.target.result
// const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] // const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.slice(-3) + '@' + imgFile.split(',')[1] const base64 = file.name.slice(-3) + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({file: base64}).then(res => {
if (res) { if (res) {
this.pdfUrl = res this.pdfUrl = res
this.pdfName = file.name this.pdfName = file.name
...@@ -436,7 +562,7 @@ export default { ...@@ -436,7 +562,7 @@ export default {
} }
}, },
// 上传图片 // 上传图片
handleImgChange(e) { handleImgChange(e, params) {
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
...@@ -450,10 +576,23 @@ export default { ...@@ -450,10 +576,23 @@ export default {
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({file: base64}).then(res => {
if (res) { if (res) {
// console.log(res) if (Array.isArray(this.materialAddForm[params]) || this.materialAddForm[params] == null) {
this.materialAddForm.titleUrl = res if (this.materialAddForm[params] && this.materialAddForm[params].length > 8) {
this.$message.error('图片最多可上传9张')
return
} else {
if (!this.materialAddForm[params]) {
this.materialAddForm[params] = []
this.materialAddForm[params][0] = res
} else {
this.materialAddForm[params].push(res)
}
}
} else {
this.materialAddForm[params] = res
}
} }
}) })
} }
...@@ -508,6 +647,7 @@ export default { ...@@ -508,6 +647,7 @@ export default {
} }
// status 状态 0 启用 -1 禁用 1 存草稿 // status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0 params.status = 0
params.createdType = 2
let material let material
if (params.id) { if (params.id) {
material = 'materialEdit' material = 'materialEdit'
...@@ -590,8 +730,12 @@ export default { ...@@ -590,8 +730,12 @@ export default {
this.isUpdate = true this.isUpdate = true
}, },
// 删除上传图片 // 删除上传图片
deleteImg() { deleteImg(params, content) {
this.materialAddForm.titleUrl = '' if (Array.isArray(this.materialAddForm[params])) {
this.materialAddForm[params] = this.materialAddForm[params].filter((item) => item !== content);
} else {
this.materialAddForm[params] = ''
}
}, },
// 删除pdf // 删除pdf
delPdf() { delPdf() {
...@@ -607,6 +751,16 @@ export default { ...@@ -607,6 +751,16 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.materialType{
/deep/.el-form-item__content{
max-width: 85%;
}
}
.disableUpload {
cursor: not-allowed;
cursor: no-drop;
}
.input-tag-wrapper { .input-tag-wrapper {
max-height: 75px; max-height: 75px;
overflow: auto; overflow: auto;
...@@ -621,18 +775,21 @@ export default { ...@@ -621,18 +775,21 @@ export default {
align-items: center; align-items: center;
margin-top: 6px; margin-top: 6px;
font-size: 14px; font-size: 14px;
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
font-size: 14px; font-size: 14px;
} }
} }
.el-tag { .el-tag {
margin-right: 4px; margin-right: 4px;
height: 26px; height: 26px;
line-height: 24px; line-height: 24px;
margin-bottom: 5px; margin-bottom: 5px;
} }
.tag-input { .tag-input {
background: transparent; background: transparent;
border: none !important; border: none !important;
...@@ -642,6 +799,7 @@ export default { ...@@ -642,6 +799,7 @@ export default {
padding-left: 0; padding-left: 0;
width: 100px; width: 100px;
} }
.creat-material, .creat-material,
.track, .track,
.share, .share,
...@@ -652,6 +810,81 @@ export default { ...@@ -652,6 +810,81 @@ export default {
.creat-material, .creat-material,
.track { .track {
margin-bottom: -10px; margin-bottom: -10px;
.dis-in-block {
margin-left: -154px;
.activity-img {
width: 104px;
height: 104px;
background: rgba(0, 0, 0, 0.04);
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
cursor: pointer;
position: relative;
input {
cursor: pointer;
font-size: 0;
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
}
.add-border {
text-align: center;
color: rgba(0, 0, 0, 0.45);
.add-icon {
margin-top: 20px;
height: 20px;
font-size: 17px;
}
.add-text {
height: 30px;
font-size: 12px;
}
}
}
.img-btns,
img {
width: 100%;
height: 100%;
}
.video-panel {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
video {
position: absolute;
object-fit: fill;
}
.el-icon-video-play {
z-index: 10;
font-size: 20px;
color: #fff;
cursor: pointer;
}
.el-icon-close {
position: absolute;
top: 0px;
right: 0px;
background: #000000;
color: #fff;
}
}
}
} }
.container { .container {
...@@ -661,12 +894,19 @@ export default { ...@@ -661,12 +894,19 @@ export default {
font-weight: 600; font-weight: 600;
color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);
margin: 17px 0 17px 20px; margin: 17px 0 17px 20px;
&:first-child { &:first-child {
padding-top: 17px; padding-top: 17px;
margin-top: 0; margin-top: 0;
} }
} }
} }
.photoWrap {
margin-top: 20px;
margin-left: -154px;
}
.space { .space {
margin-bottom: 32px; margin-bottom: 32px;
} }
...@@ -676,9 +916,11 @@ export default { ...@@ -676,9 +916,11 @@ export default {
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
} }
&-info { &-info {
margin-left: 8px; margin-left: 8px;
} }
&-behavior { &-behavior {
color: #606266; color: #606266;
} }
...@@ -686,9 +928,11 @@ export default { ...@@ -686,9 +928,11 @@ export default {
.share { .share {
margin-bottom: 20px; margin-bottom: 20px;
&-container { &-container {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.share-unfold { .share-unfold {
span { span {
font-size: 12px; font-size: 12px;
...@@ -697,6 +941,7 @@ export default { ...@@ -697,6 +941,7 @@ export default {
} }
} }
} }
&-tips { &-tips {
color: #999999; color: #999999;
font-size: 14px; font-size: 14px;
...@@ -707,10 +952,12 @@ export default { ...@@ -707,10 +952,12 @@ export default {
.material-bottom { .material-bottom {
height: 78px; height: 78px;
position: relative; position: relative;
.el-form-item { .el-form-item {
position: absolute; position: absolute;
top: 25%; top: 25%;
left: 40%; left: 40%;
.el-form-item__content { .el-form-item__content {
margin-left: 0; margin-left: 0;
} }
...@@ -722,31 +969,37 @@ export default { ...@@ -722,31 +969,37 @@ export default {
.el-select--small { .el-select--small {
width: 432px; width: 432px;
} }
.btn-cancle { .btn-cancle {
border-color: #5850ff; border-color: #5850ff;
color: #5850ff; color: #5850ff;
} }
.put-img, .put-img,
.avatar-uploader-desc, .avatar-uploader-desc,
.view-phone { .view-phone {
float: left; float: left;
margin-right: 8px; margin-right: 8px;
.task { .task {
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 10px; border-radius: 10px;
} }
} }
.put-img { .put-img {
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 10px; border-radius: 10px;
display: inline-block; display: inline-block;
position: relative; position: relative;
img { img {
width: 104px; width: 104px;
height: 104px; height: 104px;
} }
.mask { .mask {
position: absolute; position: absolute;
background: rgba(101, 101, 101, 0.6); background: rgba(101, 101, 101, 0.6);
...@@ -757,34 +1010,42 @@ export default { ...@@ -757,34 +1010,42 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 10px; border-radius: 10px;
h3 { h3 {
text-align: center; text-align: center;
margin-top: 40%; margin-top: 40%;
img { img {
width: 16px; width: 16px;
height: 16px; height: 16px;
} }
.del-img { .del-img {
padding-left: 12px; padding-left: 12px;
} }
} }
} }
} }
.tag-show { .tag-show {
margin-right: 8px; margin-right: 8px;
margin-top: 20px; margin-top: 20px;
.el-button { .el-button {
display: inline-flex; display: inline-flex;
color: #5850ff; color: #5850ff;
} }
} }
.put-img:hover .mask { .put-img:hover .mask {
opacity: 1; opacity: 1;
} }
.pdf-show { .pdf-show {
display: inline-flex; display: inline-flex;
position: relative; position: relative;
height: 32px; height: 32px;
input { input {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -793,12 +1054,14 @@ export default { ...@@ -793,12 +1054,14 @@ export default {
height: 100%; height: 100%;
} }
} }
.avatar-uploader-desc { .avatar-uploader-desc {
width: 104px; width: 104px;
height: 104px; height: 104px;
border-radius: 4px; border-radius: 4px;
border: 1px dashed rgba(0, 0, 0, 0.15); border: 1px dashed rgba(0, 0, 0, 0.15);
position: relative; position: relative;
&-icon { &-icon {
width: 16px; width: 16px;
height: 16px; height: 16px;
...@@ -806,12 +1069,14 @@ export default { ...@@ -806,12 +1069,14 @@ export default {
top: 28px; top: 28px;
left: 44px; left: 44px;
} }
&-word { &-word {
position: absolute; position: absolute;
top: 58px; top: 58px;
left: 24px; left: 24px;
color: #666666; color: #666666;
} }
input { input {
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -820,28 +1085,34 @@ export default { ...@@ -820,28 +1085,34 @@ export default {
height: 100%; height: 100%;
} }
} }
.view-phone { .view-phone {
margin-top: 85px; margin-top: 85px;
color: #5850ff; color: #5850ff;
} }
.avatar { .avatar {
width: 178px; width: 178px;
height: 178px; height: 178px;
display: block; display: block;
} }
.share-desc { .share-desc {
padding-bottom: 30px; padding-bottom: 30px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
&-right-box { &-right-box {
margin-right: 50px; margin-right: 50px;
width: 290px; width: 290px;
height: 566px; height: 566px;
position: relative; position: relative;
&-phone { &-phone {
width: 290px; width: 290px;
height: 566px; height: 566px;
} }
.content-show { .content-show {
background-color: #fff; background-color: #fff;
width: 160px; width: 160px;
...@@ -853,14 +1124,17 @@ export default { ...@@ -853,14 +1124,17 @@ export default {
left: 71px; left: 71px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
&-img { &-img {
width: 30px; width: 30px;
height: 30px; height: 30px;
img { img {
width: 30px; width: 30px;
height: 30px; height: 30px;
} }
} }
.content-title { .content-title {
color: #333333; color: #333333;
max-width: 100px; max-width: 100px;
...@@ -870,6 +1144,7 @@ export default { ...@@ -870,6 +1144,7 @@ export default {
font-size: 13px; font-size: 13px;
margin-bottom: 4px; margin-bottom: 4px;
} }
.content-word { .content-word {
color: #999999; color: #999999;
line-height: 14px; line-height: 14px;
...@@ -885,49 +1160,63 @@ export default { ...@@ -885,49 +1160,63 @@ export default {
} }
} }
} }
.img-plus { .img-plus {
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
.gl-footer { .gl-footer {
z-index: 999; z-index: 999;
} }
.form-item-container { .form-item-container {
margin-top: 32px !important; margin-top: 32px !important;
} }
.el-form-item { .el-form-item {
margin-bottom: 20px !important; margin-bottom: 20px !important;
} }
/deep/ .el-form-item__label { /deep/ .el-form-item__label {
line-height: 25px; line-height: 25px;
} }
/deep/ .el-form-item__content { /deep/ .el-form-item__content {
line-height: 25px; line-height: 25px;
} }
.label-word { .label-word {
display: inline-block; display: inline-block;
img { img {
vertical-align: middle; vertical-align: middle;
} }
} }
ul { ul {
margin-top: 5px; margin-top: 5px;
.pdf-show { .pdf-show {
// width: 200px; // width: 200px;
list-style: none; list-style: none;
align-items: center; align-items: center;
position: relative; position: relative;
padding: 0 8px; padding: 0 8px;
.pdf-name { .pdf-name {
margin-right: 20px; margin-right: 20px;
&:hover { &:hover {
color: #5850ff; color: #5850ff;
} }
} }
&:hover { &:hover {
cursor: pointer; cursor: pointer;
background-color: rgba(88, 80, 255, 0.2) !important; background-color: rgba(88, 80, 255, 0.2) !important;
} }
i { i {
position: absolute; position: absolute;
right: 5px; right: 5px;
...@@ -935,4 +1224,40 @@ ul { ...@@ -935,4 +1224,40 @@ ul {
} }
} }
} }
.video-dsialog {
z-index: 2001;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
background: rgba($color: #000000, $alpha: 0.5);
&-panel {
background: #000000;
position: absolute;
top: 100px;
left: 50%;
transform: translateX(-50%);
height: calc(100% - 200px);
width: auto;
box-sizing: border-box;
padding: 10px 20px 20px;
overflow: hidden;
.video-close {
display: flex;
justify-content: flex-end;
height: 40px;
i {
cursor: pointer;
font-size: 25px;
color: #5850ff;
}
}
}
}
</style> </style>
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button> <el-button class="add_btn" icon="el-icon-plus" :size="size" @click="handleAddGroup(1)">素材组</el-button>
<div class="all-group"> <div class="all-group">
<div @click="getList"> <div @click="getList">
<img src="@/assets/material/groupIcon.png" alt="" /> <img src="@/assets/material/groupIcon.png" alt=""/>
全部素材组 ({{ groupCounter.length }}) 全部素材组 ({{ groupCounter.length }})
</div> </div>
<div @click="groupVisible = !groupVisible"> <div @click="groupVisible = !groupVisible">
...@@ -12,9 +12,10 @@ ...@@ -12,9 +12,10 @@
</div> </div>
</div> </div>
<ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }"> <ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }">
<li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)"> <li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''"
:key="index" @click="handleGroup(item, index)">
<div> <div>
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px" /> <img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px"/>
<div class="group-name">{{ item.materialGroupName }}</div> <div class="group-name">{{ item.materialGroupName }}</div>
</div> </div>
<div> <div>
...@@ -23,12 +24,17 @@ ...@@ -23,12 +24,17 @@
<!-- <GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton> <!-- <GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton> <GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton> --> <GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton> -->
<el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</el-button> <el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</el-button> {{ item.orderTime ? '取消置顶' : '置顶' }}
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</el-button> </el-button>
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改
</el-button>
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1"
@click="handleDeleteGroup(item.id)">删除
</el-button>
</div> </div>
<div slot="reference"> <div slot="reference">
<img class="more-icon" src="@/assets/material/more.png" alt="" /> <img class="more-icon" src="@/assets/material/more.png" alt=""/>
</div> </div>
</el-popover> </el-popover>
</div> </div>
...@@ -39,9 +45,10 @@ ...@@ -39,9 +45,10 @@
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
name: 'materialGroup', name: 'materialGroup',
props: { eventBus: Object, groupHeight: Number }, props: {eventBus: Object, groupHeight: Number},
data() { data() {
return { return {
// 素材组数量 // 素材组数量
...@@ -102,6 +109,7 @@ export default { ...@@ -102,6 +109,7 @@ export default {
params.groupId = item.id params.groupId = item.id
params.pageNum = 1 params.pageNum = 1
params.pageSize = 1000 params.pageSize = 1000
params.createdType = 2
this.$emit('getList', params, item) this.$emit('getList', params, item)
}, },
// 打开1-新增, 2-编辑 素材组弹框 // 打开1-新增, 2-编辑 素材组弹框
...@@ -133,7 +141,7 @@ export default { ...@@ -133,7 +141,7 @@ export default {
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$apis.material.deleteMaterialList({ id: rowId }).then(res => { this.$apis.material.deleteMaterialList({id: rowId}).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : '操作失败', message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
...@@ -181,13 +189,16 @@ export default { ...@@ -181,13 +189,16 @@ export default {
.status-words { .status-words {
margin-left: 5px; margin-left: 5px;
} }
.material-group { .material-group {
/deep/.el-popover { /deep/ .el-popover {
min-width: 50px; min-width: 50px;
&:hover { &:hover {
cursor: pointer; cursor: pointer;
} }
} }
.all-group { .all-group {
font-size: 16px; font-size: 16px;
height: 44px; height: 44px;
...@@ -196,17 +207,21 @@ export default { ...@@ -196,17 +207,21 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
cursor: pointer; cursor: pointer;
img { img {
width: 24px; width: 24px;
height: 24px; height: 24px;
vertical-align: middle; vertical-align: middle;
} }
i { i {
color: #999999; color: #999999;
} }
} }
ul { ul {
overflow: auto; overflow: auto;
.group-list { .group-list {
cursor: pointer; cursor: pointer;
text-align: left; text-align: left;
...@@ -214,38 +229,46 @@ export default { ...@@ -214,38 +229,46 @@ export default {
margin: 0 10px; margin: 0 10px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
&.active { &.active {
background-color: #ebeaff; background-color: #ebeaff;
} }
.more-icon { .more-icon {
vertical-align: middle; vertical-align: middle;
padding-top: 3px; padding-top: 3px;
} }
&:hover { &:hover {
background-color: #ebeaff; background-color: #ebeaff;
} }
} }
} }
} }
.add_btn { .add_btn {
color: #5850ff; color: #5850ff;
border-color: #5850ff; border-color: #5850ff;
margin: 20px 0 12px 16px; margin: 20px 0 12px 16px;
} }
.group-name { .group-name {
display: inline-flex; display: inline-flex;
margin-left: 8px; margin-left: 8px;
} }
.group-btn { .group-btn {
color: #333333; color: #333333;
display: block; display: block;
padding: 8px 0px; padding: 8px 0px;
text-align: left; text-align: left;
width: 100%; width: 100%;
&:hover { &:hover {
background-color: #ebeaff; background-color: #ebeaff;
} }
} }
.el-button + .el-button { .el-button + .el-button {
margin-left: 0; margin-left: 0;
} }
......
...@@ -18,7 +18,7 @@ export default { ...@@ -18,7 +18,7 @@ export default {
props: { props: {
excludeMenus: { excludeMenus: {
type: Array, type: Array,
default: () => ['code'] default: () => ['code','video']
}, },
boxHeight:{ boxHeight:{
type: Number, type: Number,
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
创建营销素材 创建营销素材
</el-button> --> </el-button> -->
<GLButton :size="size" type="primary" fn="新增营销素材" class="el-icon-plus" @click="addMaterial(1)">创建营销素材</GLButton> <GLButton :size="size" type="primary" fn="新增营销素材" class="el-icon-plus" @click="addMaterial(1)">
创建营销素材
</GLButton>
</div> </div>
<span @click="showIntroductionDialog" class="introduc-word"> <span @click="showIntroductionDialog" class="introduc-word">
功能介绍 功能介绍
...@@ -13,58 +15,64 @@ ...@@ -13,58 +15,64 @@
</span> </span>
<div class="container"> <div class="container">
<div class="search-form"> <div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData"
@handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div> </div>
<div class="tabelList"> <div class="tabelList">
<el-row> <el-row>
<el-col :span="5"> <el-col :span="5">
<div class="left"> <div class="left">
<MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight" :eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup> <MaterialGroup ref="materialGroup" @openAddDialog="addDialogShow" :groupHeight="boxHeight"
:eventBus="eventBus" @getList="getList" @getListApi="getListApi"></MaterialGroup>
</div> </div>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="19">
<div class="right" :style="{ height: boxHeight + 'px' }"> <div class="right" :style="{ height: boxHeight + 'px' }">
<div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div> <div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div>
<GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList"> <GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout"
:searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData"
:pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true"
:customHeadShowList="customHeadShowList">
<!-- 素材内容 --> <!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope" style="text-align: center"> <div slot="materialContentRpcResponse" slot-scope="scope">
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
<!-- 素材为PDF --> <!-- 素材为PDF -->
<span v-if="scope.scope.materialType == 1" class="material-content"> <!-- <span v-if="scope.scope.materialType == 1" class="material-content">-->
<img src="@/assets/material/pdf.png" style="margin-right:8px" alt="" /> <!-- <img src="@/assets/material/pdf.png" style="margin-right:8px" alt="" />-->
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 12"> <!-- <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 12">-->
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span> <!-- <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>-->
</el-tooltip> <!-- </el-tooltip>-->
</span> <!-- </span>-->
<!-- 素材为自定义链接 --> <!-- 素材为自定义链接 -->
<span v-if="scope.scope.materialType == 2"></span> <!-- <span v-if="scope.scope.materialType == 2"></span>-->
<!-- 素材为图文 --> <!-- 素材为图文 -->
<span v-if="scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6" class="material-content"> <!-- <span v-if="scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6" class="material-content">-->
<!-- 图片 --> <!-- 图片 -->
<el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'"> <!-- <el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'">-->
<div> <!-- <div>-->
<img class="img-plus" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" /> <!-- <img class="img-plus" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />-->
</div> <!-- </div>-->
<div slot="reference" class="urlContent"> <!-- <div slot="reference" class="urlContent">-->
<img style="margin-right:8px" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" /> <!-- <img style="margin-right:8px" :src="scope.scope.materialContentRpcResponse.materialUrl" alt="" />-->
<div class="videoMask" v-if="scope.scope.imgCount > 1"> <!-- <div class="videoMask" v-if="scope.scope.imgCount > 1">-->
<img src="@/assets/material/multi.png" alt="" /> <!-- <img src="@/assets/material/multi.png" alt="" />-->
<span>{{ scope.scope.imgCount }}</span> <!-- <span>{{ scope.scope.imgCount }}</span>-->
</div> <!-- </div>-->
</div> <!-- </div>-->
</el-popover> <!-- </el-popover>-->
<!-- 视频 --> <!-- 视频 -->
<div class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)"> <!-- <div class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)">-->
<video preload loop muted width="36" height="36"> <!-- <video preload loop muted width="36" height="36">-->
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" /> <!-- <source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />-->
</video> <!-- </video>-->
<div class="videoMask"> <!-- <div class="videoMask">-->
<img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" /> <!-- <img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />-->
</div> <!-- </div>-->
</div> <!-- </div>-->
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14"> <!-- <el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14">-->
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span> <!-- <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>-->
</el-tooltip> <!-- </el-tooltip>-->
</span> <!-- </span>-->
</div> </div>
<!-- 状态 --> <!-- 状态 -->
<div slot="status" class="dot" slot-scope="scope"> <div slot="status" class="dot" slot-scope="scope">
...@@ -91,8 +99,10 @@ ...@@ -91,8 +99,10 @@
</el-row> </el-row>
</div> </div>
</div> </div>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia> <AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog"
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc> :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog"
@closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia> <VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div> </div>
</template> </template>
...@@ -110,6 +120,7 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia ...@@ -110,6 +120,7 @@ import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia
import MaterialGroup from '@/views/material/components/materialGroup' import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc' import FunctionIntroduc from '@/views/material/components/functionIntroduc'
import VideoShowDia from './components/videoDia.vue' import VideoShowDia from './components/videoDia.vue'
export default { export default {
name: 'materialList', name: 'materialList',
components: { components: {
...@@ -129,9 +140,10 @@ export default { ...@@ -129,9 +140,10 @@ export default {
materialType: '', // 素材类型 materialType: '', // 素材类型
businessType: '', // 业务类型 businessType: '', // 业务类型
status: '', // 状态 status: '', // 状态
materialName: '' // 素材名称 materialName: '', // 素材名称
createdType:'2'
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
// 表格数据 // 表格数据
materialTableData: [], materialTableData: [],
...@@ -146,6 +158,7 @@ export default { ...@@ -146,6 +158,7 @@ export default {
businessTypes: [], businessTypes: [],
// 素材组名称 // 素材组名称
materialGroupName: '', materialGroupName: '',
changeName: '编辑',
materialFormData: [ materialFormData: [
{ {
label: '业务类型', label: '业务类型',
...@@ -245,13 +258,15 @@ export default { ...@@ -245,13 +258,15 @@ export default {
}, },
{ {
type: 'GLButton', type: 'GLButton',
name: '编辑', name: row => {
return row.createdType == 1 ? '查看' : '编辑'
},
attrs: { attrs: {
type: 'text', type: 'text',
fn: '编辑' fn: '编辑'
}, },
listeners: { listeners: {
click: row => this.addMaterial(2, row) click: row => row.createdType == 1 ? this.addMaterial(3, row) : this.addMaterial(2, row)
} }
}, },
{ {
...@@ -284,7 +299,7 @@ export default { ...@@ -284,7 +299,7 @@ export default {
tableOption: true, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '素材内容', label: '素材名称',
prop: 'materialContentRpcResponse', prop: 'materialContentRpcResponse',
addHtml: 'materialContentRpcResponse', addHtml: 'materialContentRpcResponse',
width: 270 width: 270
...@@ -309,43 +324,43 @@ export default { ...@@ -309,43 +324,43 @@ export default {
formatter: cellVal => { formatter: cellVal => {
return cellVal.sendNum return cellVal.sendNum
}, },
renderHeader: (h, { column, $index }) => { renderHeader: (h, {column, $index}) => {
return h( return h(
'div', 'div',
{ {
style: { style: {
display: 'inline-flex', display: 'inline-flex',
'align-items': 'center', 'align-items': 'center',
padding: 0 padding: 0
} }
}, },
[ [
'发送次数', '发送次数',
h( h(
'el-popover', 'el-popover',
{ {
attrs: { attrs: {
placement: 'top-start', placement: 'top-start',
width: '240', width: '240',
trigger: 'hover', trigger: 'hover',
content: '统计该素材的发送次数(不包含在系统外部的转发次数)' content: '统计该素材的发送次数(不包含在系统外部的转发次数)'
} }
},
[
h('img', {
style: {
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
src: iconUrl
}, },
slot: 'reference' [
}) h('img', {
] style: {
) width: '17px',
] height: '17px',
'vertical-align': 'middle'
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
) )
} }
}, },
...@@ -357,43 +372,43 @@ export default { ...@@ -357,43 +372,43 @@ export default {
formatter: cellVal => { formatter: cellVal => {
return cellVal.readNum return cellVal.readNum
}, },
renderHeader: (h, { column, $index }) => { renderHeader: (h, {column, $index}) => {
return h( return h(
'div', 'div',
{ {
style: { style: {
display: 'inline-flex', display: 'inline-flex',
'align-items': 'center', 'align-items': 'center',
padding: 0 padding: 0
} }
}, },
[ [
'阅读人数', '阅读人数',
h( h(
'el-popover', 'el-popover',
{ {
attrs: { attrs: {
placement: 'top-start', placement: 'top-start',
width: '240', width: '240',
trigger: 'hover', trigger: 'hover',
content: '阅读该素材的人数,内部员工除外。' content: '阅读该素材的人数,内部员工除外。'
} }
},
[
h('img', {
style: {
width: '17px',
height: '17px',
'vertical-align': 'middle'
}, },
attrs: { [
src: iconUrl h('img', {
}, style: {
slot: 'reference' width: '17px',
}) height: '17px',
] 'vertical-align': 'middle'
) },
] attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
) )
} }
}, },
...@@ -446,7 +461,8 @@ export default { ...@@ -446,7 +461,8 @@ export default {
materialType: '', materialType: '',
businessType: '', businessType: '',
status: '', status: '',
materialName: '' materialName: '',
createdType:'2'
} }
this.getListApi() this.getListApi()
this.$refs.materialGroup.currentIndex = null this.$refs.materialGroup.currentIndex = null
...@@ -512,13 +528,13 @@ export default { ...@@ -512,13 +528,13 @@ export default {
}, },
// 素材删除 // 素材删除
handleDelete(scope) { handleDelete(scope) {
this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', { id: scope.id }) this.secondConfirm('提示', '删除素材,该素材将不再可以使用,是否继续删除?', 'material', 'materialDelete', {id: scope.id})
}, },
// 1-新增素材,2-编辑素材 // 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) { addMaterial(addOrEdit, scope) {
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 1 ? '创建营销素材' : '编辑营销素材') $title: encodeURI(addOrEdit == 1 ? '创建营销素材' : addOrEdit == 2 ? '编辑营销素材' : '查看营销素材')
} }
addOrEdit != 1 && (params.id = scope.id) addOrEdit != 1 && (params.id = scope.id)
addOrEdit != 1 && (params.status = scope.status) addOrEdit != 1 && (params.status = scope.status)
...@@ -622,35 +638,43 @@ export default { ...@@ -622,35 +638,43 @@ export default {
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
img { img {
position: relative; position: relative;
align-self: center; align-self: center;
margin: auto; margin: auto;
} }
span { span {
position: absolute; position: absolute;
top: 12px; top: 12px;
right: 15px; right: 15px;
} }
} }
.urlContent { .urlContent {
margin-right: 8px; margin-right: 8px;
position: relative; position: relative;
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.search-form, .search-form,
.left, .left,
.right { .right {
background-color: #fff; background-color: #fff;
} }
.el-popover { .el-popover {
min-width: 100px; min-width: 100px;
} }
.main-container { .main-container {
height: 100%; height: 100%;
.top { .top {
display: inline-flex; display: inline-flex;
span { span {
margin-left: 16px; margin-left: 16px;
font-size: 16px; font-size: 16px;
...@@ -658,44 +682,55 @@ export default { ...@@ -658,44 +682,55 @@ export default {
} }
} }
} }
ul { ul {
text-align: center; text-align: center;
li { li {
list-style: none; list-style: none;
&:first-child { &:first-child {
padding-bottom: 10px; padding-bottom: 10px;
} }
} }
} }
.container { .container {
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
.search-form { .search-form {
padding: 20px 0 0 20px; padding: 20px 0 0 20px;
} }
.tabelList { .tabelList {
margin-top: 10px; margin-top: 10px;
height: 100%; height: 100%;
.left { .left {
height: 100%; height: 100%;
position: relative; position: relative;
border-right: 1px solid #e8e8ea; border-right: 1px solid #e8e8ea;
} }
.right { .right {
// overflow: auto; // overflow: auto;
.groupTitle { .groupTitle {
padding: 20px 0 16px 19px; padding: 20px 0 16px 19px;
font-weight: 600; font-weight: 600;
} }
.glsx-table { .glsx-table {
margin: 0 20px; margin: 0 20px;
} }
} }
} }
} }
.btn-more { .btn-more {
margin-left: 10px; margin-left: 10px;
} }
.material-content { .material-content {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -709,39 +744,49 @@ ul { ...@@ -709,39 +744,49 @@ ul {
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
} }
img { img {
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
} }
.img-plus { .img-plus {
width: 200px; width: 200px;
height: 200px; height: 200px;
} }
.introduc-word { .introduc-word {
font-size: 14px; font-size: 14px;
margin-left: 16px; margin-left: 16px;
color: #5850ff; color: #5850ff;
} }
.pdf-title { .pdf-title {
text-align: right !important; text-align: right !important;
} }
/deep/ .el-table .ascending .sort-caret.ascending { /deep/ .el-table .ascending .sort-caret.ascending {
border-bottom-color: #5850ff; border-bottom-color: #5850ff;
} }
/deep/ .el-table .descending .sort-caret.descending { /deep/ .el-table .descending .sort-caret.descending {
border-top-color: #5850ff; border-top-color: #5850ff;
} }
.select-pro { .select-pro {
display: inline-block; display: inline-block;
padding-bottom: 20px; padding-bottom: 20px;
} }
/deep/ .el-switch__core { /deep/ .el-switch__core {
width: 32px !important; width: 32px !important;
} }
/deep/ .el-table::before { /deep/ .el-table::before {
background-color: transparent; background-color: transparent;
} }
/deep/ .el-table__fixed-right::before { /deep/ .el-table__fixed-right::before {
background-color: transparent; background-color: transparent;
} }
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
<template> <template>
<div class="marketing order-manage"> <div class="marketing order-manage">
<div class="list-tips m-b-10"> <div class="list-tips m-b-10">
<img class="tips-img" <img
src="@/assets/icon-info.png" /> class="tips-img"
src="@/assets/icon-info.png"
/>
<span class="table-tips"> <span class="table-tips">
已生成有效订单 已生成有效订单
<span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span> <span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
...@@ -16,113 +18,160 @@ ...@@ -16,113 +18,160 @@
</div> </div>
<div class="container"> <div class="container">
<div class="sticky"> <div class="sticky">
<GLCombiForm ref="showSearch" <GLCombiForm
:rowNumber="1" ref="showSearch"
:formObj="searchForm" :rowNumber="1"
:formData="searchFormData" :formObj="searchForm"
@handleOk="handleSearch" :formData="searchFormData"
@handleRest="handleReset"></GLCombiForm> @handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex"> <div class="flex">
<div class="flex-default tabs"> <div class="flex-default tabs">
<el-tabs v-model="searchForm.requestSource" <el-tabs
@tab-click="handleTabClick"> v-model="searchForm.requestSource"
<el-tab-pane label="全部订单" @tab-click="handleTabClick"
name="0"></el-tab-pane> >
<el-tab-pane v-if="!isSpecialMerchat" <el-tab-pane
label="已付款" label="全部订单"
name="1"></el-tab-pane> name="0"
<el-tab-pane v-if="!isSpecialMerchat" ></el-tab-pane>
label="未付款" <el-tab-pane
name="2"></el-tab-pane> v-if="!isSpecialMerchat"
<el-tab-pane v-if="!isSpecialMerchat" label="已付款"
label="已退款" name="1"
name="3"></el-tab-pane> ></el-tab-pane>
<el-tab-pane v-if="!isSpecialMerchat" <el-tab-pane
label="售后订单" v-if="!isSpecialMerchat"
name="4"></el-tab-pane> label="未付款"
name="2"
></el-tab-pane>
<el-tab-pane
v-if="!isSpecialMerchat"
label="已退款"
name="3"
></el-tab-pane>
<el-tab-pane
v-if="!isSpecialMerchat"
label="售后订单"
name="4"
></el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<el-button class="default-blue-btn" <el-button
:size="size" class="default-blue-btn"
type="default" :size="size"
@click="handleExport">导出</el-button> type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
</div> </div>
<!-- 表格区域 - 全部订单/售后订单 - 开始 --> <!-- 表格区域 - 全部订单/售后订单 - 开始 -->
<div class="order-manage-table"> <div class="order-manage-table">
<GLTable ref="allOrderRef" <GLTable
:getListApi="getListApi" ref="allOrderRef"
:noDataImg="url" :getListApi="getListApi"
:searchForm="tableSearchForm" :noDataImg="url"
:tableParams="tableParams" :searchForm="tableSearchForm"
:pageConf="pageConf" :tableParams="tableParams"
:beforeSearchFn="beforeSearchFn" :pageConf="pageConf"
@setTableFinishFun="setTableFinishFun"> :beforeSearchFn="beforeSearchFn"
<div slot="weChatName" @setTableFinishFun="setTableFinishFun"
class="flex-align" >
slot-scope="scope"> <div
<img v-if="scope.scope.weChatImageUrl" slot="weChatName"
class="img-36 pointer img-circle" class="flex-align"
:src="scope.scope.weChatImageUrl" /> slot-scope="scope"
>
<img
v-if="scope.scope.weChatImageUrl"
class="img-36 pointer img-circle"
:src="scope.scope.weChatImageUrl"
/>
<span class="m-l-10">{{ scope.scope.weChatName }}</span> <span class="m-l-10">{{ scope.scope.weChatName }}</span>
<span v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span> <span v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span>
</div> </div>
<template slot="vinNo" <template
slot-scope="scope"> slot="vinNo"
slot-scope="scope"
>
{{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }} {{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }}
<el-popover popper-class="order-table-popover" <el-popover
placement="right-start" popper-class="order-table-popover"
trigger="click"> placement="right-start"
<p v-for="(item, index) in scope.scope.vinNo" trigger="click"
:key="index">{{ item }}</p> >
<span class="car-no" <p
slot="reference" v-for="(item, index) in scope.scope.vinNo"
v-show="Array.isArray(scope.scope.vinNo)">...({{ scope.scope.vinNo.length - 1 }})</span> :key="index"
>{{ item }}</p>
<span
class="car-no"
slot="reference"
v-show="Array.isArray(scope.scope.vinNo)"
>...({{ scope.scope.vinNo.length - 1 }})</span>
</el-popover> </el-popover>
</template> </template>
<div slot="orderStatus" <div
slot-scope="scope"> slot="orderStatus"
<span slot-scope="scope"
:class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span> >
<span :class="['table-circle', 'm-r-8', [2, 10, 22].includes(scope.scope.orderStatus) ? 'back-green' : [9].includes(scope.scope.orderStatus) ? 'back-blue' : [1, 21, 6].includes(scope.scope.orderStatus) ? 'back-orange' : 'back-grey']"></span>
<span>{{ baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ? baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-' }}</span> <span>{{ baseData.orderStatusList.map(item => item.confId).includes(scope.scope.orderStatus + '') ? baseData.orderStatusList.find(item => item.confId == scope.scope.orderStatus).confName : '-' }}</span>
</div> </div>
<div slot="shareStaffName" <div
class="table-image" slot="shareStaffName"
slot-scope="scope"> class="table-image"
slot-scope="scope"
>
<div> <div>
<img v-if="scope.scope.shareStaffImageUrl" <img
class="img-36 pointer img-circle" v-if="scope.scope.shareStaffImageUrl"
style="vertical-align: middle" class="img-36 pointer img-circle"
slot="reference" style="vertical-align: middle"
:src="scope.scope.shareStaffImageUrl" /> slot="reference"
:src="scope.scope.shareStaffImageUrl"
/>
<span class="m-l-10"> <span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span> <span>{{ scope.scope.shareStaffName }}</span>
<span class="txt-green" <span
v-if="scope.scope.shareStaffSource == 1">@微信</span> class="txt-green"
<span class="txt-orange" v-if="scope.scope.shareStaffSource == 1"
v-if="scope.scope.shareStaffSource == 2">@企微</span> >@微信</span>
<span class="txt-blue" <span
v-if="scope.scope.shareStaffSource == 3">@员工</span> class="txt-orange"
v-if="scope.scope.shareStaffSource == 2"
>@企微</span>
<span
class="txt-blue"
v-if="scope.scope.shareStaffSource == 3"
>@员工</span>
</span> </span>
</div> </div>
<span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span> <span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span>
</div> </div>
<div slot="assignName" <div
slot-scope="scope"> slot="assignName"
slot-scope="scope"
>
<div> <div>
<template v-if="scope.scope.assignStaffName"> <template v-if="scope.scope.assignStaffName">
<img class="img-36 pointer img-circle" <img
v-if="scope.scope.assignStaffImageUrl" class="img-36 pointer img-circle"
:src="scope.scope.assignStaffImageUrl" /> v-if="scope.scope.assignStaffImageUrl"
:src="scope.scope.assignStaffImageUrl"
/>
<span class="m-l-10"> <span class="m-l-10">
<span>{{ scope.scope.assignStaffName }}</span> <span>{{ scope.scope.assignStaffName }}</span>
</span> </span>
</template> </template>
<template v-else-if="scope.scope.shareStaffName"> <template v-else-if="scope.scope.shareStaffName">
<img class="img-36 pointer img-circle" <img
v-if="scope.scope.shareStaffImageUrl" class="img-36 pointer img-circle"
:src="scope.scope.shareStaffImageUrl" /> v-if="scope.scope.shareStaffImageUrl"
:src="scope.scope.shareStaffImageUrl"
/>
<span class="m-l-10"> <span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span> <span>{{ scope.scope.shareStaffName }}</span>
</span> </span>
...@@ -134,61 +183,75 @@ ...@@ -134,61 +183,75 @@
class="assignLabel">指派</span> --> class="assignLabel">指派</span> -->
</div> </div>
</div> </div>
<div class="table-btns" <div
slot="auth-button" class="table-btns"
slot-scope="scope"> slot="auth-button"
<GLTableButton :buttonList="tableButtonList" slot-scope="scope"
:buttonItem="scope.scope" >
:buttonNum="3"></GLTableButton> <GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</GLTable> </GLTable>
</div> </div>
<!-- 表格区域 - 全部订单/售后订单 - end --> <!-- 表格区域 - 全部订单/售后订单 - end -->
</div> </div>
<!-- 快递信息 --> <!-- 快递信息 -->
<GLDialog v-if="isExpressVisible" <GLDialog
title="输入快递信息" v-if="isExpressVisible"
mode="mid" title="输入快递信息"
okText="确定" mode="mid"
cancelText="取消" okText="确定"
:visible.sync="isExpressVisible" cancelText="取消"
@onOk="handleExpressConfirm" :visible.sync="isExpressVisible"
@onCancel="handleExpressClose"> @onOk="handleExpressConfirm"
<glsx-combi-form class="small-content m-t-20" @onCancel="handleExpressClose"
ref="expressRef" >
:isBlock="true" <glsx-combi-form
defaultWidth="284px" class="small-content m-t-20"
:isEdit="isEdit" ref="expressRef"
:formRef="editChildRef" :isBlock="true"
:formObj="expressForm" defaultWidth="284px"
:formData="expressFormData" :isEdit="isEdit"
:formRules="expressRules"></glsx-combi-form> :formRef="editChildRef"
:formObj="expressForm"
:formData="expressFormData"
:formRules="expressRules"
></glsx-combi-form>
</GLDialog> </GLDialog>
<!-- 订单核销 --> <!-- 订单核销 -->
<GLDialog v-if="isWriteOffVisible" <GLDialog
title="订单核销(请确保用户到店后核销,避免引起不必要问题)" v-if="isWriteOffVisible"
mode="mid" title="订单核销(请确保用户到店后核销,避免引起不必要问题)"
okText="确定" mode="mid"
cancelText="取消" okText="确定"
:visible.sync="isWriteOffVisible" cancelText="取消"
@onOk="handleWriteOffConfirm" :visible.sync="isWriteOffVisible"
@onCancel="handleWriteOffClose"> @onOk="handleWriteOffConfirm"
<glsx-combi-form class="small-content m-t-20" @onCancel="handleWriteOffClose"
ref="writeOffRef" >
:isBlock="true" <glsx-combi-form
defaultWidth="284px" class="small-content m-t-20"
:formRef="editChildRef" ref="writeOffRef"
:formObj="writeOffForm" :isBlock="true"
:formData="writeOffFormData" defaultWidth="284px"
:formRules="writeOffRules"></glsx-combi-form> :formRef="editChildRef"
:formObj="writeOffForm"
:formData="writeOffFormData"
:formRules="writeOffRules"
></glsx-combi-form>
</GLDialog> </GLDialog>
<!-- 退款审核 --> <!-- 退款审核 -->
<GLDialog v-if="isExamineVisible" <GLDialog
bigTitle="退款审核" v-if="isExamineVisible"
mode="big" bigTitle="退款审核"
:visible.sync="isExamineVisible" mode="big"
@onOk="handleExamineConfirm" :visible.sync="isExamineVisible"
@onCancel="handleExamineClose"> @onOk="handleExamineConfirm"
@onCancel="handleExamineClose"
>
<el-form label-width="144px"> <el-form label-width="144px">
<el-form-item label="售后类型"> <el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span> <span>{{ orderInfo.refundTypeName }}</span>
...@@ -203,11 +266,15 @@ ...@@ -203,11 +266,15 @@
<span>{{ orderInfo.remark || '-' }}</span> <span>{{ orderInfo.remark || '-' }}</span>
</el-form-item> </el-form-item>
<el-form-item v-if="orderInfo.imgUrls"> <el-form-item v-if="orderInfo.imgUrls">
<span v-for="(item, index) in orderInfo.imgUrls" <span
:key="index"> v-for="(item, index) in orderInfo.imgUrls"
<el-image class="img-60" :key="index"
:src="item" >
:preview-src-list="[item]"></el-image> <el-image
class="img-60"
:src="item"
:preview-src-list="[item]"
></el-image>
</span> </span>
</el-form-item> </el-form-item>
<el-form-item label="审核是否通过"> <el-form-item label="审核是否通过">
...@@ -217,24 +284,28 @@ ...@@ -217,24 +284,28 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<template v-if="orderInfo.refundType == 1 && examineForm.isAllowed == '1'"> <template v-if="orderInfo.refundType == 1 && examineForm.isAllowed == '1'">
<glsx-combi-form ref="examineRef" <glsx-combi-form
:isEdit="isEdit" ref="examineRef"
defaultWidth="284px" :isEdit="isEdit"
:isBlock="true" defaultWidth="284px"
:formRef="editChildRef" :isBlock="true"
:formObj="examineForm" :formRef="editChildRef"
:formData="examineFormData" :formObj="examineForm"
:formRules="examineRules"></glsx-combi-form> :formData="examineFormData"
:formRules="examineRules"
></glsx-combi-form>
</template> </template>
</el-form> </el-form>
</GLDialog> </GLDialog>
<!-- 确认收货 --> <!-- 确认收货 -->
<GLDialog v-if="isReceivingVisible" <GLDialog
bigTitle="确认收货" v-if="isReceivingVisible"
mode="big" bigTitle="确认收货"
:visible.sync="isReceivingVisible" mode="big"
@onOk="handleReceivingConfirm" :visible.sync="isReceivingVisible"
@onCancel="handleReceivingClose"> @onOk="handleReceivingConfirm"
@onCancel="handleReceivingClose"
>
<el-form label-width="140px"> <el-form label-width="140px">
<el-form-item label="售后类型"> <el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span> <span>{{ orderInfo.refundTypeName }}</span>
...@@ -266,7 +337,7 @@ import { utils } from 'glsx-common' ...@@ -266,7 +337,7 @@ import { utils } from 'glsx-common'
import { businessType, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant' import { businessType, orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
export default { export default {
name: 'orderManage', name: 'orderManage',
data() { data () {
return { return {
size: 'small', size: 'small',
isSpecialMerchat: true, isSpecialMerchat: true,
...@@ -477,6 +548,14 @@ export default { ...@@ -477,6 +548,14 @@ export default {
optionsName: 'testSheetTypeList' optionsName: 'testSheetTypeList'
}, },
{ {
label: '退款类型',
prop: 'afterSaleType',
width: 100,
formatter: cellValue => {
return { 1: '退订单', 2: '退定金' }[cellValue.afterSaleType] || '-'
}
},
{
label: '业务场景', label: '业务场景',
name: 'businessType', name: 'businessType',
type: 'select', type: 'select',
...@@ -593,7 +672,7 @@ export default { ...@@ -593,7 +672,7 @@ export default {
fn: '退款' fn: '退款'
}, },
condition: row => { condition: row => {
return !this.isSpecialMerchat && row.orderSource == 4 && [2, 6, 21].includes(+row.orderStatus) return row.orderSource == 4 && [2, 6, 21].includes(+row.orderStatus) && row.isOffline != 0
}, },
listeners: { listeners: {
click: row => { click: row => {
...@@ -859,21 +938,53 @@ export default { ...@@ -859,21 +938,53 @@ export default {
{ confId: '0', confName: '否' }, { confId: '0', confName: '否' },
{ confId: '1', confName: '是' } { confId: '1', confName: '是' }
], ],
isOffSheetTypeList: [
{ confId: '0', confName: '是' },
{ confId: '1', confName: '否' }
],
businessTypeList: utils.deepClone(businessType) businessTypeList: utils.deepClone(businessType)
} }
} }
}, },
created() { created () {
this.checkMerchant() this.checkMerchant()
if (window.__POWERED_BY_QIANKUN__) {
this.merchantModel = this.$globalState.session.merchantModel
this.accountLevel = this.$globalState.session.accountLevel
if (this.merchantModel == 2 && this.accountLevel == 4) {
this.initParams()
}
}
}, },
mounted() { mounted () {
// this.getCount() // this.getCount()
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams() { initParams () {
const cell = {
label: '线下订单',
prop: 'isOffline',
width: 120,
formatter: cellValue => {
return cellValue.isOffline == 1 ? '否' : cellValue.isOffline == 0 ? '是' : '-'
}
}
const searchCell = {
label: '线下订单',
name: 'isOffline',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'isOffSheetTypeList'
}
this.tableParams.tableColumns.splice(12, 0, cell)
this.searchFormData.splice(17, 0, searchCell)
},
getParams () {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) { if (this.searchForm.createDate.length) {
params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
...@@ -884,7 +995,7 @@ export default { ...@@ -884,7 +995,7 @@ export default {
return params return params
}, },
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate delete this.tableSearchForm.createDate
...@@ -892,7 +1003,7 @@ export default { ...@@ -892,7 +1003,7 @@ export default {
}) })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -918,12 +1029,12 @@ export default { ...@@ -918,12 +1029,12 @@ export default {
} }
}, },
showOrHideAttr(formName, label, isHide) { showOrHideAttr (formName, label, isHide) {
let idx = this[formName].findIndex(item => item.label == label) let idx = this[formName].findIndex(item => item.label == label)
this[formName][idx].isHide = isHide this[formName][idx].isHide = isHide
}, },
deleteAttr(labelList) { deleteAttr (labelList) {
labelList.forEach(i => { labelList.forEach(i => {
console.log(i) console.log(i)
let idx = this.tableParams.tableColumns.findIndex(item => item.label == i) let idx = this.tableParams.tableColumns.findIndex(item => item.label == i)
...@@ -931,7 +1042,7 @@ export default { ...@@ -931,7 +1042,7 @@ export default {
}) })
}, },
checkMerchant() { checkMerchant () {
this.$apis.orderManage.checkMerchartApi({}).then(res => { this.$apis.orderManage.checkMerchartApi({}).then(res => {
this.isSpecialMerchat = res this.isSpecialMerchat = res
var hideList = ['售后状态', '订单类型', '结算方式', '商户订单号', '车架号', '推荐人', '推荐人类型', '手机号', '推荐人手机号'] var hideList = ['售后状态', '订单类型', '结算方式', '商户订单号', '车架号', '推荐人', '推荐人类型', '手机号', '推荐人手机号']
...@@ -944,7 +1055,7 @@ export default { ...@@ -944,7 +1055,7 @@ export default {
}) })
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn, isResetPage = true) { secondConfirm (title, txt, apiModule, apiName, apiParams, fn, isResetPage = true) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -966,7 +1077,7 @@ export default { ...@@ -966,7 +1077,7 @@ export default {
}) })
}, },
getCount() { getCount () {
var params = this.getParams() var params = this.getParams()
delete params.createDate delete params.createDate
// if(params.orderStatuses.includes('3')) return // if(params.orderStatuses.includes('3')) return
...@@ -975,7 +1086,7 @@ export default { ...@@ -975,7 +1086,7 @@ export default {
}) })
}, },
handleDetail(row) { handleDetail (row) {
this.$router.push({ this.$router.push({
path: '/orderManage/orderDetail', path: '/orderManage/orderDetail',
query: { query: {
...@@ -985,7 +1096,7 @@ export default { ...@@ -985,7 +1096,7 @@ export default {
}, },
// 输入快递信息 - start // 输入快递信息 - start
handleExpressClose() { handleExpressClose () {
this.isExpressVisible = !this.isExpressVisible this.isExpressVisible = !this.isExpressVisible
this.orderCode = '' this.orderCode = ''
this.expressForm = { this.expressForm = {
...@@ -994,7 +1105,7 @@ export default { ...@@ -994,7 +1105,7 @@ export default {
} }
}, },
handleExpressConfirm() { handleExpressConfirm () {
this.$refs.expressRef.$refs[this.editChildRef].validate(valid => { this.$refs.expressRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = this.$common.utils.deepClone(this.expressForm) var params = this.$common.utils.deepClone(this.expressForm)
...@@ -1014,14 +1125,14 @@ export default { ...@@ -1014,14 +1125,14 @@ export default {
}) })
}, },
handleExpressInfo(row) { handleExpressInfo (row) {
this.isExpressVisible = !this.isExpressVisible this.isExpressVisible = !this.isExpressVisible
this.orderCode = row.orderCode this.orderCode = row.orderCode
}, },
// 输入快递信息 - end // 输入快递信息 - end
// 订单核销 - start // 订单核销 - start
handleWriteOffClose() { handleWriteOffClose () {
this.isWriteOffVisible = !this.isWriteOffVisible this.isWriteOffVisible = !this.isWriteOffVisible
this.orderCode = '' this.orderCode = ''
this.writeOffForm = { this.writeOffForm = {
...@@ -1029,7 +1140,7 @@ export default { ...@@ -1029,7 +1140,7 @@ export default {
} }
}, },
handleWriteOffConfirm() { handleWriteOffConfirm () {
this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => { this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = this.$common.utils.deepClone(this.writeOffForm) var params = this.$common.utils.deepClone(this.writeOffForm)
...@@ -1049,7 +1160,7 @@ export default { ...@@ -1049,7 +1160,7 @@ export default {
}) })
}, },
handleWriteOff(row) { handleWriteOff (row) {
if (row.orderSource == 4) { if (row.orderSource == 4) {
this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode }, () => { }, this.searchForm.requestSource != 0) this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode }, () => { }, this.searchForm.requestSource != 0)
return true return true
...@@ -1060,7 +1171,7 @@ export default { ...@@ -1060,7 +1171,7 @@ export default {
// 订单核销 - end // 订单核销 - end
// 退款审核 - start // 退款审核 - start
handleExamineClose() { handleExamineClose () {
this.isExamineVisible = !this.isExamineVisible this.isExamineVisible = !this.isExamineVisible
this.orderCode = '' this.orderCode = ''
this.orderInfo = {} this.orderInfo = {}
...@@ -1072,7 +1183,7 @@ export default { ...@@ -1072,7 +1183,7 @@ export default {
} }
}, },
submitExamine(params) { submitExamine (params) {
this.$apis.orderManage.examineAllowApi(params).then(res => { this.$apis.orderManage.examineAllowApi(params).then(res => {
this.$message({ this.$message({
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
...@@ -1086,7 +1197,7 @@ export default { ...@@ -1086,7 +1197,7 @@ export default {
}) })
}, },
handleExamineConfirm() { handleExamineConfirm () {
var params = { var params = {
id: this.orderInfo.id id: this.orderInfo.id
} }
...@@ -1105,7 +1216,7 @@ export default { ...@@ -1105,7 +1216,7 @@ export default {
} }
}, },
handleExamine(row) { handleExamine (row) {
this.orderCode = row.orderCode this.orderCode = row.orderCode
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => { this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {} this.orderInfo = res || {}
...@@ -1117,13 +1228,13 @@ export default { ...@@ -1117,13 +1228,13 @@ export default {
// 退款审核 - end // 退款审核 - end
// 确认收货 - start // 确认收货 - start
handleReceivingClose() { handleReceivingClose () {
this.isReceivingVisible = !this.isReceivingVisible this.isReceivingVisible = !this.isReceivingVisible
this.orderCode = '' this.orderCode = ''
this.orderInfo = {} this.orderInfo = {}
}, },
handleReceivingConfirm() { handleReceivingConfirm () {
var params = { var params = {
id: this.orderInfo.id id: this.orderInfo.id
} }
...@@ -1140,7 +1251,7 @@ export default { ...@@ -1140,7 +1251,7 @@ export default {
}) })
}, },
handleReceiving(row) { handleReceiving (row) {
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => { this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {} this.orderInfo = res || {}
this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-' this.orderInfo.refundTypeName = [1, 2, 3].includes(this.orderInfo.refundType) ? this.baseData.refundTypeList.find(item => item.confId == this.orderInfo.refundType + '').confName : '-'
...@@ -1150,7 +1261,7 @@ export default { ...@@ -1150,7 +1261,7 @@ export default {
}, },
// 确认收货 - end // 确认收货 - end
setTableFinishFun() { setTableFinishFun () {
this.$refs.allOrderRef.data.forEach(item => { this.$refs.allOrderRef.data.forEach(item => {
item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-' item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-'
}) })
...@@ -1159,25 +1270,25 @@ export default { ...@@ -1159,25 +1270,25 @@ export default {
this.getCount() this.getCount()
}, },
handleSearch() { handleSearch () {
this.$refs.allOrderRef.refreshTable() this.$refs.allOrderRef.refreshTable()
}, },
handleTabClick() { handleTabClick () {
if (this.isSpecialMerchat) { if (this.isSpecialMerchat) {
return true return true
} }
this.handleSearch() this.handleSearch()
}, },
handleExport(row) { handleExport (row) {
var params = this.getParams() var params = this.getParams()
this.$apis.orderManage.orderExportApi(params).then(res => { this.$apis.orderManage.orderExportApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleReset() { handleReset () {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch() this.handleSearch()
} }
......
<template>
<div class="glsx-table">
<el-table id="initTable"
class="hightline"
:key="componentKey"
:ref="tableParams.mutiSelectName + 'MutiTable' || 'MutiTable'"
:data="getListApi ? data : tableData"
:row-class-name="tableParams.rowClassName"
:row-style="tableParams.rowStyle"
:row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading"
:height="tableHeightValues"
:border="border"
:tableId="tableId"
@sort-change="sortChange"
@selection-change="handleSelect"
:size="size"
:header-cell-style="headerStyle"
:show-summary="tableParams.showSummary"
:summary-method="tableParams.summaryMethod"
v-bind="$attrs"
v-on="$listeners">
<!-- //实现高亮竖线 -->
<el-table-column fixed="left"
width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
class-name="select-column"
type="selection"
width="48"
:selectable="checkSelectable"
:reserve-selection="true"></el-table-column>
<el-table-column v-if="hasNum"
:fixed="numHasFixed"
align="left"
width="74"
label="序号"
class-name="select-index"
type="index"
:index="index => index + (page[this.pageConf.pageNum] - 1) * page[this.pageConf.pageSize] + 1">
</el-table-column>
<el-table-column v-for="(item, index) in tableColumns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:fixed="item.fixed"
:align="item.align || 'left'"
:sortable="item.sortable"
:render-header="item.renderHeader"
v-bind="item.columnattrs ? item.columnattrs : {}"
v-on="item.columnlisteners ? item.columnlisteners : {}">
<template slot-scope="scope">
<slot v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:width="item.width"></slot>
<template v-else-if="item.formatter">
<el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line"
placement="top"
popper-class="base-popper"
trigger="hover"
:content="item.formatter(scope.row)">
<span slot="reference"
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ item.formatter(scope.row) | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ item.formatter(scope.row) || '--' }} -->
{{ item.formatter(scope.row) | tableCellFormat }}
</span>
</template>
<template v-else-if="getListApi">
<el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line"
placement="top"
popper-class="base-popper"
trigger="hover"
:content="scope.row[item.prop]">
<span slot="reference"
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ scope.row[item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ scope.row[item.prop] || '--' }} -->
{{ scope.row[item.prop] | tableCellFormat }}
</span>
</template>
<template v-else>
<!-- 大于10或 20个字节长度 宽度160px -->
<el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line"
placement="top"
popper-class="base-popper"
trigger="hover"
:content="tableData[scope.$index][item.prop]">
<span slot="reference"
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ tableData[scope.$index][item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else
class="line-ellipsis"
:style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ tableData[scope.$index][item.prop] || '--' }} -->
{{ tableData[scope.$index][item.prop] | tableCellFormat }}
</span>
</template>
<template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span>
</template>
</template>
<!-- 递归 -->
<sub-el-table-column v-if="item.children"
:data="item.children"
:tableData="tableData"
:getListApi="getListApi"></sub-el-table-column>
</el-table-column>
<el-table-column class-name="gl-btns"
v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align || 'left'"
:width="tableParams.tableOption.width || '200'"
fixed="right">
<template slot-scope="scope">
<slot name="auth-button"
:scope="scope.row"></slot>
</template>
</el-table-column>
<template slot="empty">
<div class="emptyBg">
<img class="noDataImg"
:src="noDataImg"
v-if="noDataImg"
alt="" />
<div class="noDataText">{{ noDataText }}</div>
<slot name="additionalContent"></slot>
</div>
</template>
</el-table>
<!-- hasPageComputed -->
<el-pagination v-if="hasPageComputed"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page[this.pageConf.pageNum]"
:page-sizes="pageSizes"
:page-size="page[this.pageConf.pageSize]"
:total="getListApi ? total : tableTotal"
:layout="layout"
v-bind="paginationattrs"
v-on="paginationlisteners"></el-pagination>
</div>
</template>
<script>
import noDataImgUrl from '@/assets/empty.png'
import SubElTableColumn from './sub-el-table-column.vue'
// import GlSubTableColumn from '../../GlSubTableColumn'
// import GlSubTable from '../../GlSubTable'
export default {
name: 'GLTable',
components: {
SubElTableColumn
// GlSubTableColumn,
// GlSubTable
},
props: {
// `medium` / `small` / `mini`
size: {
type: String,
default: 'medium'
},
// height: {
// type: String,
// default: ''
// },
// maxHeight:{
// type:String,
// default:'3000'
// },
noDataImg: {
type: String,
default: noDataImgUrl
},
noDataText: {
type: String,
default: '暂无数据'
},
border: {
type: Boolean,
default: false
},
headerStyle: {
type: Object,
default: () => { }
},
//表格需要多传入一个id的情况
tableId: {
type: String,
default: ''
},
// 搜索条件
searchForm: {
type: Object,
default: () => { }
},
// 是否定制表头
isCustomHead: {
type: Boolean,
default: false
},
// 表头展示
customHeadShowList: {
type: Array,
default: () => []
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
tableTotal: {
type: Number,
default: 0
},
// 获取列表接口
getListApi: {
type: Function,
default: null
},
// 搜索前操作
beforeSearchFn: {
type: Function,
// 默认值是:Function
default: () => {
return new Promise((resolve, reject) => {
resolve()
})
}
},
pageSizes: {
type: Array,
default: () => [10, 20, 30, 40]
},
// 分页,默认有
hasPage: {
type: Boolean,
default: true
},
pageConf: {
type: Object,
default: () => ({
pageSize: 'pageSize',
pageNum: 'pageNum',
totalCount: 'totalCount'
})
},
// 分页组件配置
layout: {
type: String,
default: 'total,sizes,prev,pager,next,jumper'
},
// 序号,默认有
hasNum: {
type: Boolean,
default: true
},
// table的配置项参数
tableParams: {
type: Object,
default: () => {
return {
// 多选-判断来自哪个页面
// mutiSelectName: {
// type: String,
// default: ''
// },
// 多选-唯一标识-行数据的key
// mutiSelectUniqueKey: {
// type: String,
// default: ''
// },
// 设置禁止选中的行数据
checkSelectKey: {
type: String,
default: ''
},
// 设置禁止选中的值
checkSelectVal: {
type: Array,
default: () => []
},
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 表格操作,默认没有
// tableOption: {
// type: Object,
// default: null
// },
// 表格栏
tableColumns: {
type: Array,
default: () => []
},
// 表格项属性穿透
columnattrs: {
type: Object,
default: () => ({})
},
// 表格项事件穿透
columnlisteners: {
type: Object,
default: () => ({})
}
}
}
},
// el分页组件属性透传
paginationattrs: {
type: Object,
default: () => ({})
},
// el分页组件事件透传
paginationlisteners: {
type: Object,
default: () => ({})
}
},
data() {
return {
loading: false,
data: [],
// 页码
page: {},
total: 10,
// 多选数组
mutiSelectArr: {},
tableColumns: [],
showClass: false,
tableHeightValues: null,
bAntiShike: false, //防抖
componentKey: Date.now(), //用于更新组件
hightCell: ''
}
},
watch: {
customHeadShowList(val) {
this.isCustomHead && this.findShowHeadCol()
},
'tableParams.tableColumns'(newVal, oldVal) {
// console.log('newVal',newVal)
this.tableColumns = newVal
}
// data: {
// immediate: true,
// handler(val) {
// this.showClass = val.length > 0 ? true : false
// },
// deep: true
// }
},
computed: {
// 分页计算属性
hasPageComputed() {
if (!this.hasPage) {
return false
}
// 没有数据的时候隐藏分页 api
if (this.getListApi) {
if (this.data.length == 0) {
return false
}
} else {
// 直接传数据的情况
if (this.tableData.length == 0) {
return false
}
}
// //直接传数据的情况
// if (this.tableTotal && this.tableTotal > this.page[this.pageConf.pageSize]) {
// return true
// }
// //传list api的情况 总数 一页多少条
// if(this.total <= this.page[this.pageConf.pageSize]){
// return false
// }
// if (this.page[this.pageConf.pageNum] <= 1) {
// return false
// }
return true
},
numHasFixed() {
return this.tableParams.tableColumns.some(item => {
return item.fixed == 'left'
})
}
},
methods: {
findShowHeadCol() {
// findShowHeadCol事件
this.tableColumns = []
this.tableParams.tableColumns.forEach(item => {
let isCustomCol = item.hasOwnProperty('isCustomCol')
if (!isCustomCol || (isCustomCol && this.customHeadShowList.includes(item.label))) {
this.tableColumns.push(item)
}
})
},
// @vuese
// 设置表格禁用
// @arg row 每一行表格内容
checkSelectable(row) {
// 设置禁止选中的行数据
if (this.tableParams.checkSelectKey && this.tableParams.checkSelectVal.length > 0) {
return this.tableParams.checkSelectVal.indexOf(row[this.tableParams.checkSelectKey]) == -1
} else {
return true
}
},
sortChange({ column, prop, order }) {
// 排序
// @arg column \ prop \ order
this.$emit('sortChange', { column, prop, order })
},
handleSelect(val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
// 多选
this.$emit('selectionTable', val)
},
clearMutiSelect() {
// 清空多选
this.mutiSelectArr[this.tableParams.mutiSelectName] = []
this.$refs[this.tableParams.mutiSelectName + 'MutiTable']?.clearSelection()
},
// @vuese
// 设置表格高度
// @arg 1.navHeight,这个减值,2.addHeight是增值, 默认都为0
setTableHeightFun(navHeight = 0, addHeight = 0) {
// 设置表格高度
//navHeight 传值底部高度
var baseNavEle = document.querySelector('.scrm-base-nav')
var baseSubNavEle = document.querySelector('.scrm-base-sub-nav')
var baseNavEleHeight = baseNavEle ? baseNavEle.clientHeight : 0
var baseSubNavEleHeight = baseSubNavEle ? baseSubNavEle.clientHeight : 0
let paginationHeight
if (document.querySelector('.el-pagination')) {
paginationHeight = document.querySelector('.el-pagination').clientHeight + 20
} else {
paginationHeight = 0
}
let offsettop = document.getElementById('initTable').offsetTop
let clientHeight = document.documentElement.clientHeight
// document.getElementById('initTable').style.height = clientHeight - offsettop - paginationHeight - navHeight + 'px'
// document.querySelector('.el-table__empty-block').style.height=(clientHeight - offsettop - paginationHeight - navHeight)+'px';
// let tableHeight = clientHeight - offsettop - paginationHeight - baseNavEleHeight - baseSubNavEleHeight - 10 - 30 - 20
let tableHeight = clientHeight - offsettop - paginationHeight - baseNavEleHeight - baseSubNavEleHeight - navHeight + 10 + addHeight
// console.log('tableHeight: ', tableHeight, clientHeight, offsettop, paginationHeight, baseNavEleHeight, baseSubNavEleHeight, navHeight)
if (tableHeight < 240) {
tableHeight = 240
}
this.tableHeightValues = tableHeight
},
refreshTable(isResetPageNum = true, isClearMuti = true) {
// 刷新table
this.beforeSearchFn().then(res => {
// 清空多选
isClearMuti && this.clearMutiSelect()
this.loading = true
isResetPageNum && (this.page[this.pageConf.pageNum] = 1)
var params = {
...this.page,
...this.searchForm
}
if (this.tableId) {
params.id = this.tableId
}
this.getListApi(params)
.then(res => {
this.data = this.findVal(res, this.tableParams.listName)
this.total = this.findVal(res, this.pageConf.totalCount)
this.loading = false
this.$nextTick(() => {
this.$refs[this.tableParams.mutiSelectName + 'MutiTable']?.doLayout()
})
// 表格请求到数据
// console.log('表格请求到数据this.data',this.data)
this.$emit('setTableFinishFun', this.data)
})
.catch(() => {
this.loading = false
})
})
},
findVal(res, rankStr) {
// 找返回值
var rankList = rankStr.split('.')
if (!rankStr) {
return res
}
return this.findVal(res[rankList[0]], rankList.splice(1).join('.'))
},
handleSizeChange(value) {
// 每页条数
let offsettop = document.getElementById('initTable').offsetTop
this.page[this.pageConf.pageSize] = value
// 刷新表格
this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
},
handleCurrentChange(value) {
// 页码
this.page[this.pageConf.pageNum] = value
this.getListApi ? this.refreshTable(false, false) : this.$emit('refreshTable', this.page)
},
//原table mounted要做的要做的事情
tableInit() {
this.isCustomHead ? this.findShowHeadCol() : (this.tableColumns = this.tableParams.tableColumns)
this.page = {}
this.page[this.pageConf.pageSize] = this.pageSizes[0]
this.page[this.pageConf.pageNum] = 1
this.getListApi && this.refreshTable()
setTimeout(() => {
// console.log('123456doLayout')
this.$refs[this.tableParams.mutiSelectName + 'MutiTable']?.doLayout()
}, 100)
}
},
mounted() {
this.tableInit()
// 注册事件 -- 防抖
window.onresize = () => {
if (!this.bAntiShike) {
this.bAntiShike = true
setTimeout(() => {
// console.log('组件跟新时间')
this.bAntiShike = false
this.componentKey = Date.now()
}, 300)
}
}
},
beforeDestroy() {
// 事件注销
window.onresize = null
}
}
</script>
<style lang="scss">
// @import '@/theme/global.scss';
.a-click {
cursor: pointer;
}
.el-table .cell {
line-height: 1.2;
}
.gl-btns .el-button + .el-button {
margin-left: 10px;
}
.glsx-table p {
margin: 10px 0;
}
// .glsx-table .line-ellipsis {
// display: -webkit-box;
// width: 100%;
// overflow: hidden;
// text-overflow: ellipsis;
// -webkit-line-clamp: 2;
// -webkit-box-orient: vertical;
// }
.el-table-column--selection .cell {
padding-left: 14px !important;
padding-right: 14px !important;
}
.glsx-table {
// .select-column{
// .cell{
// }
// }
// .select-index{
// .cell{
// }
// }
.el-table__empty-text {
line-height: 1;
}
.emptyBg {
padding-top: 4px;
padding-bottom: 4px;
.noDataImg {
margin-bottom: 12px;
width: 64px;
height: 40px;
}
}
// .emptyBg {
// display: flex;
// flex-direction: column;
// justify-content: center;
// align-items: center;
// height: 100%;
// }
}
.el-table__body-wrapper::-webkit-scrollbar {
width: 8px;
height: 8px;
/* display: none; */
}
/*正常情况下滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 8px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在该类指向的控件上时滑块的样式*/
.el-table__body-wrapper::-webkit-scrollbar-thumb {
/* background-color: rgba(0, 0, 0, 0.2); */
background: rgba(144, 147, 153, 0.3);
border-radius: 8px;
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
}
/*鼠标悬浮在滑块上时滑块的样式*/
/* &::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.1);
} */
/*正常时候的主干部分*/
.el-table__body-wrapper::-webkit-scrollbar-track {
border-radius: 8px;
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}
/*鼠标悬浮在滚动条上的主干部分*/
/* .el-table__body-wrapper::-webkit-scrollbar-track:hover {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.4);
background-color: rgba(0, 0, 0, 0.01);
} */
/* .hasTableContent .el-table__body{
height: 100%;
} */
/* .hasTableContent .el-table__body-wrapper{
height: 100%;
} */
/* 样式新增光亮tr */
/* .el-table */
//处理闪的问题
.el-table--enable-row-transition .el-table__body td.el-table__cell {
transition: background-color 0s ease !important;
}
.el-table--enable-row-transition .el-table__body td {
transition: background-color 0s ease !important;
}
.el-table .el-table__body tr.hover-row {
transform: translate3d(0, 0, 0);
box-shadow: 0px 3px 10px rgba(114, 112, 151, 0.25);
}
.el-table__body tr.hover-row > td {
background-color: #f4f4fc !important;
// box-shadow: 0px 3px 10px rgba(114, 112, 151, 0.25);
}
.el-table .el-table__body tr.hover-row > td.el-table__cell {
background-color: #f4f4fc !important;
// box-shadow: 0px 3px 10px rgba(114, 112, 151, 0.25);
}
.el-table tbody tr:hover {
transform: translate3d(0, 0, 0);
box-shadow: 0px 3px 10px rgba(114, 112, 151, 0.25);
}
// 去掉滚动条的上边框
.el-table tbody tr:last-child td {
border-bottom: 1px solid #fff;
}
//添加高亮行的竖线
.el-table.hightline .el-table__body tr.hover-row {
// background-color: #f4f4fc !important;
td:first-child {
position: relative;
// // background-color: #5850ff !important;
// background-color: #f4f4fc !important;
&:after {
position: absolute;
top: 0;
left: 0;
display: block;
content: '';
width: 5px;
height: 100%;
// background-color: $color-primary;
background-color: #5850ff;
}
}
}
.el-table.hightline tbody tr:hover {
// background-color: #f4f4fc !important;
td:first-child {
position: relative;
// // background-color: #5850ff !important;
// background-color: #f4f4fc !important;
&:after {
position: absolute;
top: 0;
left: 0;
display: block;
content: '';
width: 5px;
height: 100%;
// background-color: $color-primary;
background-color: #5850ff;
}
}
}
//除去左边fixed的阴影,添加竖线的时候
.el-table.hightline .el-table__fixed {
box-shadow: none !important;
}
//切换table后 el_table 固定列下方多了一条线
.glsx-table {
/deep/ .el-table__fixed,
/deep/ .el-table__fixed-right {
height: 100% !important; //设置高优先,以覆盖内联样式
}
// 滚动条上边头部栏的背景色
.el-table__fixed-right-patch {
background: #f4f6fc;
border-bottom: 1px solid #ebeef5;
}
}
/* 样式新增光亮tr */
/* 多级表头的样式调整 */
.el-table.hightline .el-table__fixed .el-table__row td:first-child {
border-right: none;
}
.el-table.hightline .el-table__fixed th.is-leaf:first-child {
border: none;
}
</style>
<template>
<div class="sub-el-table-column">
<el-table-column v-for="(item, index) in reverseData" :key="index + 'child'" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable" :render-header="item.renderHeader" v-bind="item.columnattrs ? item.columnattrs : {}" v-on="item.columnlisteners ? item.columnlisteners : {}">
<template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter">
<el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="item.formatter(scope.row)">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ item.formatter(scope.row) | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ item.formatter(scope.row) || '--' }} -->
{{ item.formatter(scope.row) | tableCellFormat }}
</span>
</template>
<template v-else-if="getListApi">
<el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="scope.row[item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ scope.row[item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ scope.row[item.prop] || '--' }} -->
{{ scope.row[item.prop] | tableCellFormat }}
</span>
</template>
<template v-else>
<!-- 大于10或 20个字节长度 -->
<el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line" placement="top" width="200" trigger="hover" :content="tableData[scope.$index][item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ tableData[scope.$index][item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<!-- <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> -->
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ tableData[scope.$index][item.prop] || '--' }} -->
{{ tableData[scope.$index][item.prop] | tableCellFormat }}
</span>
</template>
<template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span>
</template>
</template>
<!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column>
</el-table-column>
</div>
</template>
<script>
// import GlSubTableColumn from '../../GlSubTableColumn'
export default {
name: 'sub-el-table-column',
props: {
data: {
type: Array,
default: () => []
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
// 获取列表接口
getListApi: {
type: Function,
default: null
}
},
computed: {
reverseData() {
let arr = [...this.data]
let temp = arr.pop()
arr.unshift(temp)
return arr
}
},
// components: {
// GlSubTableColumn
// }
// created(){
// // console.log('data',this.data)
// }
}
</script>
<style lang="scss">
// .sub-el-table-column {
// }
</style>
...@@ -10,102 +10,81 @@ ...@@ -10,102 +10,81 @@
fn="新增众筹" fn="新增众筹"
mode="el-button" mode="el-button"
>新建众筹</GLButton> --> >新建众筹</GLButton> -->
<el-button <el-button :size="size"
:size="size" type="default"
type="default" class="default-blue-btn"
class="default-blue-btn" @click="handleJump">订单管理</el-button>
@click="handleJump"
>订单管理</el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm <GLCombiForm ref="showSearch"
ref="showSearch" :rowNumber="1"
:rowNumber="1" :formObj="searchForm"
:formObj="searchForm" :formData="searchFormData"
:formData="searchFormData" @handleOk="handleSearch"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button <el-button :size="size"
:size="size" class="default-blue-btn"
class="default-blue-btn" type="default"
type="default" @click="handleExport">导出</el-button>
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable <single-gltable ref="activity"
ref="activity" :getListApi="getListApi"
:getListApi="getListApi" :noDataImg="url"
:noDataImg="url" :searchForm="tableSearchForm"
:searchForm="tableSearchForm" :tableParams="tableParams"
:tableParams="tableParams" :pageConf="pageConf"
:pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
:beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
@setTableFinishFun="setTableFinishFun" <div slot="activityImg"
> class="table-image"
<div slot-scope="scope">
slot="activityImg" <el-popover placement="top"
class="table-image" width="160"
slot-scope="scope" trigger="hover"
> popper-class="table-popover-block">
<el-popover <img class="table-popover-img"
placement="top" :src="scope.scope.activityImg" />
width="160" <img class="img-60 pointer"
trigger="hover" slot="reference"
popper-class="table-popover-block" :src="scope.scope.activityImg" />
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover> </el-popover>
</div> </div>
<div <div slot="linkText"
slot="linkText" slot-scope="scope">
slot-scope="scope" <p class="cursor-pointer"
> @click="handleDetail(scope)">{{ scope.scope[scope.prop] || 0 }}</p>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{scope.scope[scope.prop] || 0}}</p>
</div> </div>
<div <div class="table-btns"
class="table-btns" slot="auth-button"
slot="auth-button" slot-scope="scope">
slot-scope="scope" <GLTableButton :buttonList="tableButtonList"
> :buttonItem="scope.scope"
<GLTableButton :buttonNum="3"></GLTableButton>
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</GLTable> </single-gltable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 众筹分享 --> <!-- 众筹分享 -->
<crowdFundingShare :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></crowdFundingShare> <crowdFundingShare :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"></crowdFundingShare>
</div> </div>
</template> </template>
<script> <script>
import crowdFundingShare from '../productGroup/components/crowdFundingShareDialog.vue' import crowdFundingShare from '../productGroup/components/crowdFundingShareDialog.vue'
import GLTable from './components/table/index'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'crowdFundList', name: 'crowdFundList',
data () { data() {
return { return {
size: 'small', size: 'small',
url: url, url: url,
...@@ -273,7 +252,14 @@ export default { ...@@ -273,7 +252,14 @@ export default {
{ {
label: '活动名称', label: '活动名称',
prop: 'activityName', prop: 'activityName',
width: 220 width: 220,
fixed: 'left'
},
{
label: '门店',
prop: 'merchantName',
width: 220,
fixed: 'left'
}, },
{ {
label: '缩略图', label: '缩略图',
...@@ -281,6 +267,20 @@ export default { ...@@ -281,6 +267,20 @@ export default {
addHtml: 'activityImg' addHtml: 'activityImg'
}, },
{ {
label: '收款模式',
prop: 'payMentModel',
width: 220,
formatter: cellValue => {
const model = {
1: '广联收定金和尾款',
2: '广联收定金门店收尾款',
3: '广联收定金门店收全款退定金',
4: '门店收定金和尾款'
}
return model[cellValue.paymentModel] || '--'
}
},
{
label: '浏览量(次)', label: '浏览量(次)',
prop: 'viewAmount', prop: 'viewAmount',
addHtml: 'linkText', addHtml: 'linkText',
...@@ -373,19 +373,20 @@ export default { ...@@ -373,19 +373,20 @@ export default {
}, },
components: { components: {
crowdFundingShare crowdFundingShare,
singleGltable: GLTable
}, },
mounted () { mounted() {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams () { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
return params return params
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate // delete this.tableSearchForm.createDate
...@@ -393,13 +394,13 @@ export default { ...@@ -393,13 +394,13 @@ export default {
}) })
}, },
handleJump (path, row = {}) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
path: '/orderManage/index' path: '/orderManage/index'
}) })
}, },
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -425,16 +426,16 @@ export default { ...@@ -425,16 +426,16 @@ export default {
}, },
//开始 //开始
start (item) { start(item) {
this.startOrEndConfirm('开始', item) this.startOrEndConfirm('开始', item)
}, },
//结束 //结束
end (item) { end(item) {
this.startOrEndConfirm('结束', item) this.startOrEndConfirm('结束', item)
}, },
startOrEndConfirm (txt, row) { startOrEndConfirm(txt, row) {
var title = txt var title = txt
var params = {} var params = {}
params.id = row.id params.id = row.id
...@@ -447,25 +448,26 @@ export default { ...@@ -447,25 +448,26 @@ export default {
}, },
//置顶 //置顶
topping (row) { topping(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params) this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
}, },
//删除 //删除
del (row) { del(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit (addOrEdit, row) { handleEdit(addOrEdit, row) {
var txtObj = { var txtObj = {
add: '新建', add: '新建',
edit: '编辑', edit: '编辑',
copy: '复制' copy: '复制',
detail: '编辑'
}[addOrEdit] }[addOrEdit]
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
...@@ -484,7 +486,7 @@ export default { ...@@ -484,7 +486,7 @@ export default {
// console.log(JSON.parse(JSON.stringify(option))) // console.log(JSON.parse(JSON.stringify(option)))
// }, // },
// 明细 // 明细
handleDetail ({ prop, scope }) { handleDetail({ prop, scope }) {
let data = { let data = {
viewAmount: { viewAmount: {
type: 1, type: 1,
...@@ -505,30 +507,30 @@ export default { ...@@ -505,30 +507,30 @@ export default {
id: scope.id, id: scope.id,
activityName: scope.activityName, activityName: scope.activityName,
type: data.type, type: data.type,
count: data.count, count: data.count
} }
}) })
}, },
handleExport () { handleExport() {
var params = this.getParams() var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => { this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleShare (row) { handleShare(row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => { this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res this.shareForm = res
this.handleShareClose() this.handleShareClose()
}) })
}, },
handleShareClose () { handleShareClose() {
this.isShareVisible = !this.isShareVisible this.isShareVisible = !this.isShareVisible
}, },
getOptionsList (formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -554,11 +556,11 @@ export default { ...@@ -554,11 +556,11 @@ export default {
} }
}, },
handleSearch () { handleSearch() {
this.$refs.activity.refreshTable() this.$refs.activity.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
activityName: '', activityName: '',
activityStatus: '' activityStatus: ''
...@@ -566,7 +568,7 @@ export default { ...@@ -566,7 +568,7 @@ export default {
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun() this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
} }
......
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
:rowNumber="1" :rowNumber="1"
:formObj="searchRankForm" :formObj="searchRankForm"
:formData="searchFormRankData" :formData="searchFormRankData"
@handleOk="handleSearchRank"></GLCombiForm> @handleOk="handleSearchRank"
@handleRest="handleReset"></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button :size="size" <el-button :size="size"
...@@ -358,10 +359,10 @@ export default { ...@@ -358,10 +359,10 @@ export default {
this.getLiveData() this.getLiveData()
}, },
mounted() { mounted() {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'), let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default')
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default') // [rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none' if (dataResetBtn) dataResetBtn.style.display = 'none'
if (rankResetBtn) rankResetBtn.style.display = 'none' // if (rankResetBtn) rankResetBtn.style.display = 'none'
}, },
methods: { methods: {
...@@ -386,6 +387,11 @@ export default { ...@@ -386,6 +387,11 @@ export default {
// 直播间数据统计 // 直播间数据统计
// this.getLiveBroadcastRoomDataStatistics() // this.getLiveBroadcastRoomDataStatistics()
}, },
handleReset() {
this.searchRankForm = this.$options.data.call(this).searchRankForm
// this.$refs.rankRef.refreshTable()
// this.handleSearch()
},
getDailyOrderQuantityStatistics() { getDailyOrderQuantityStatistics() {
this.$apis.seckillActivity this.$apis.seckillActivity
.getDailyOrderQuantityStatistics({ id: this.activityId }) .getDailyOrderQuantityStatistics({ id: this.activityId })
......
...@@ -4,21 +4,29 @@ ...@@ -4,21 +4,29 @@
<div class="sop-base-info"> <div class="sop-base-info">
<div class="container m-b-20"> <div class="container m-b-20">
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData"
:formRules="editRule">
<div slot="startDate"> <div slot="startDate">
<el-input class="w432" :placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')" disabled></el-input> <el-input class="w432"
:placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')"
disabled></el-input>
</div> </div>
<div slot="customerInfoList" slot-scope="scope"> <div slot="customerInfoList" slot-scope="scope">
<div v-if="!scope.scope.isDisabled"> <div v-if="!scope.scope.isDisabled">
<!-- <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button> <!-- <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button>
<el-button v-show="editForm.customerInfoList.length" :size="size" @click="handleResetCustomer">重置客户</el-button> --> <el-button v-show="editForm.customerInfoList.length" :size="size" @click="handleResetCustomer">重置客户</el-button> -->
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleCustTypeChange"> <el-radio-group v-model="editForm[scope.scope.name]" @change="handleCustTypeChange">
<el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">{{ item.confName }}</el-radio> <el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">
{{ item.confName }}
</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-for="(item, pIdx) in customerDataList" :key="pIdx"> <div v-for="(item, pIdx) in customerDataList" :key="pIdx">
<div v-show="item.confId == editForm[scope.scope.name]"> <div v-show="item.confId == editForm[scope.scope.name]">
<el-button v-show="item.list.length == 0" class="default-blue-btn el-icon-plus" :size="size" @click="handleSelectCustomer(pIdx)">去选择</el-button> <el-button v-show="item.list.length == 0" class="default-blue-btn el-icon-plus" :size="size"
@click="handleSelectCustomer(pIdx)">去选择
</el-button>
<!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> --> <!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> -->
<div v-show="item.list.length != 0"> <div v-show="item.list.length != 0">
<div class="customer-box m-t-10"> <div class="customer-box m-t-10">
...@@ -26,13 +34,17 @@ ...@@ -26,13 +34,17 @@
<div :key="key" class="el-input-tag input-tag-wrapper"> <div :key="key" class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签'"> <template v-if="item.confName == '标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx"> <div v-for="(subItem, subIdx) in item.list" :key="subIdx">
<el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(n, subIdx, item.confName)"> <el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size"
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false"
@close="handleDeleteCustomer(n, subIdx, item.confName)">
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span> <span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
</el-tag> </el-tag>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(subIdx)"> <el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size"
type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false"
@close="handleDeleteCustomer(subIdx)">
<!-- <i class="el-icon-user-solid"></i> --> <!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem[item.listConf.confName] || subItem[item.listConf.otherConfName] }}</span> <span>{{ subItem[item.listConf.confName] || subItem[item.listConf.otherConfName] }}</span>
</el-tag> </el-tag>
...@@ -50,14 +62,17 @@ ...@@ -50,14 +62,17 @@
<div class="container edit-container"> <div class="container edit-container">
<div class="edit-title flex" style="align-items: center"> <div class="edit-title flex" style="align-items: center">
<p>营销事件设置</p> <p>营销事件设置</p>
<el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark" content="请先完善sop名称和营销对象" placement="top"> <el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark"
content="请先完善sop名称和营销对象" placement="top">
<div> <div>
<el-button class="m-r-20" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size" type="primary" @click="handleEventEdit('add')">添加事件</el-button> <el-button class="m-r-20" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size"
type="primary" @click="handleEventEdit('add')">添加事件
</el-button>
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
<div v-show="!editForm.eventList.length" class="event-empty"> <div v-show="!editForm.eventList.length" class="event-empty">
<img class="empty-img" :src="url" /> <img class="empty-img" :src="url"/>
<p class="empty-txt">暂无营销事件</p> <p class="empty-txt">暂无营销事件</p>
</div> </div>
<div v-show="editForm.eventList.length" class="event-box"> <div v-show="editForm.eventList.length" class="event-box">
...@@ -66,27 +81,39 @@ ...@@ -66,27 +81,39 @@
<p class="m-r-10">{{ item.eventStartDate }}</p> <p class="m-r-10">{{ item.eventStartDate }}</p>
<p class="m-r-20">{{ item.eventTime }}</p> <p class="m-r-20">{{ item.eventTime }}</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p> <p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{ item.repeatTime }}重复循环至</p> <p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{ item.repeatTime }}重复循环至</p> item.repeatTime
}}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{
item.repeatTime
}}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p> <p class="m-r-20" v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p>
<p class="m-r-20 txt-blue">{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p> <p class="m-r-20 txt-blue">
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p>
</div> </div>
<div class="event-content">{{ item.eventContent }}</div> <div class="event-content">{{ item.eventContent }}</div>
<div class="event-link" v-if="item.object"> <div class="event-link" v-if="item.object">
<img class="m-r-10" v-if="item.object.additionalType && item.object.additionalType != 4" :src="require(`@/assets/sop/icon-${imgIcon[item.object.additionalType]}.png`)" alt /> <img class="m-r-10" v-if="item.object.additionalType && item.object.additionalType != 4"
:src="require(`@/assets/sop/icon-${imgIcon[item.object.additionalType]}.png`)" alt/>
<div v-if="item.object.additionalType == 4"> <div v-if="item.object.additionalType == 4">
<div v-if="item.object.showVideoContent.length"> <div v-if="item.object.showVideoContent.length">
<video class="model-item-img" :src="item.object.showVideoContent[0].attContent" controls="controls" /> <video class="model-item-img" :src="item.object.showVideoContent[0].attContent" controls="controls"/>
</div> </div>
<div v-if="!item.object.showVideoContent.length && item.object.showImgContent.length"> <div v-if="!item.object.showVideoContent.length && item.object.showImgContent.length">
<img class="model-item-img" :src="item.object.showImgContent[0].attContent" /> <img class="model-item-img" :src="item.object.showImgContent[0].attContent"/>
</div> </div>
</div> </div>
<span v-else>{{ item.object.objectName }}</span> <span v-else>{{ item.object.objectName }}</span>
</div> </div>
<div v-if="new Date(item.eventStartDate) > new Date()" class="event-btns"> <div v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit =='copy'" class="event-btns">
<el-button class="default" :size="size" @click="handleEventDelete(index)">删除</el-button> <el-button class="default newBtnSty" :size="size" @click="handleEventDelete(index)">删除</el-button>
<el-button class="default-blue-btn" :size="size" @click="handleEventEdit('edit', item, index)">编辑</el-button> <el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark"
content="请先完善sop名称和营销对象" placement="top">
<div>
<el-button class="default-blue-btn" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size" @click="handleEventEdit('edit', item, index)">编辑
</el-button>
</div>
</el-tooltip>
</div> </div>
</div> </div>
</div> </div>
...@@ -97,9 +124,15 @@ ...@@ -97,9 +124,15 @@
<el-button @click="handleCancel" size="medium">取消</el-button> <el-button @click="handleCancel" size="medium">取消</el-button>
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button> <el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter> </GLFooter>
<select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCrowdList="JSON.parse(JSON.stringify(customerDataList[0].list))" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd> <select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible"
:selectedCrowdList="JSON.parse(JSON.stringify(customerDataList[0].list))"
@handleCrowdCustClose="handleCrowdCustClose"
@handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
<select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag> <select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag>
<select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" :parentSelectedCustomerList="customerDataList[2].list" @handleAppointCustClose="handleAppointCustClose" @handleAppointCustConfirm="handleDialogConfirm"></select-customer> <select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible"
:parentSelectedCustomerList="customerDataList[2].list"
@handleAppointCustClose="handleAppointCustClose"
@handleAppointCustConfirm="handleDialogConfirm"></select-customer>
</div> </div>
</template> </template>
...@@ -107,6 +140,7 @@ ...@@ -107,6 +140,7 @@
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import selectCustomer from './components/selectCustomer' import selectCustomer from './components/selectCustomer'
import selectCrowd from './components/selectCrowd' import selectCrowd from './components/selectCrowd'
export default { export default {
name: 'baseInfo', name: 'baseInfo',
data() { data() {
...@@ -188,10 +222,10 @@ export default { ...@@ -188,10 +222,10 @@ export default {
eventList: [] eventList: []
}, },
editRule: { editRule: {
sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }], sopName: [{required: true, message: '请输入SOP名称', trigger: 'change'}],
customerOptUpdate: [{ required: true, message: '请选择更新人群', trigger: 'change' }], customerOptUpdate: [{required: true, message: '请选择更新人群', trigger: 'change'}],
customerOptType: [{ required: true, message: '请选择有效对象', trigger: 'change' }], customerOptType: [{required: true, message: '请选择有效对象', trigger: 'change'}],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }] customerInfoList: [{required: true, message: '请选择营销对象', trigger: 'change'}]
}, },
isEdit: true, isEdit: true,
editFormData: [ editFormData: [
...@@ -297,7 +331,8 @@ export default { ...@@ -297,7 +331,8 @@ export default {
mounted() { mounted() {
this.setMinHeight('.sop-base-info') this.setMinHeight('.sop-base-info')
if (this.routeInfo.addOrEdit == 'edit') { // this.routeInfo.addOrEdit == 'edit'
if (['edit', 'copy'].includes(this.routeInfo.addOrEdit)) {
this.getInfo() this.getInfo()
} else if (this.routeInfo.info) { } else if (this.routeInfo.info) {
this.setCustomer() this.setCustomer()
...@@ -407,43 +442,75 @@ export default { ...@@ -407,43 +442,75 @@ export default {
}, },
getInfo() { getInfo() {
this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => { this.$apis.sop.getSopInfoDetailApi({sopId: this.routeInfo.id}).then(res => {
this.editForm = res if (this.routeInfo.addOrEdit == 'copy') {
this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType) this.copyForm = res
this.recoverCustomerList() this.copyForm.eventList.forEach(item => {
this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + '' item.eventStartDate = ''
// this.editForm.customerInfoList = this.editForm.customerInfoList || [] item.eventTime = ''
// this.editForm.customerInfoList.forEach(item => { if (item.object) {
// item.id = item.customerId item.object.objectId = item.objectId
// }) item.object.objectType = item.objectType
// this.editForm.customerInfoList.length && this.recoveryCondLimit() item.object.objectName = item.objectName
this.editForm.eventList.forEach(item => { item.object.additionalType = item.additionalType
if (item.object) { }
item.object.objectId = item.objectId if (item.additionalType == 4) {
item.object.objectType = item.objectType // attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// item.object.objectName = item.object.packageName // attContent 附件内容
item.object.objectName = item.objectName // 文字
item.object.additionalType = item.additionalType let txtObj = item.object.attachmentList.find(k => k.attType == 1)
} item.object.showTxtContent = txtObj ? txtObj.attContent : ''
if (item.additionalType == 4) { // 图片
// attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动) let imgList = item.object.attachmentList.filter(k => k.attType == 2)
// attContent 附件内容 item.object.showImgContent = imgList || []
// 文字 // 视频
let txtObj = item.object.attachmentList.find(k => k.attType == 1) let videoList = item.object.attachmentList.filter(k => k.attType == 3)
item.object.showTxtContent = txtObj ? txtObj.attContent : '' item.object.showVideoContent = videoList || []
// 图片 }
let imgList = item.object.attachmentList.filter(k => k.attType == 2) })
item.object.showImgContent = imgList || [] console.log(this.copyForm.eventList)
// 视频 this.editForm.eventList = this.copyForm.eventList
let videoList = item.object.attachmentList.filter(k => k.attType == 3) this.$nextTick(() => {
item.object.showVideoContent = videoList || [] this.editStatus = false
} })
}) } else {
this.editDisabled = new Date(this.editForm.startDate) < new Date() this.editForm = res
this.editDisabled && this.judgeDisable() this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
this.$nextTick(() => { this.recoverCustomerList()
this.editStatus = false this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + ''
}) // this.editForm.customerInfoList = this.editForm.customerInfoList || []
// this.editForm.customerInfoList.forEach(item => {
// item.id = item.customerId
// })
// this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.editForm.eventList.forEach(item => {
if (item.object) {
item.object.objectId = item.objectId
item.object.objectType = item.objectType
// item.object.objectName = item.object.packageName
item.object.objectName = item.objectName
item.object.additionalType = item.additionalType
}
if (item.additionalType == 4) {
// attType (1文本,2图片,3视频,4链接,5小程序,6附件,7活动)
// attContent 附件内容
// 文字
let txtObj = item.object.attachmentList.find(k => k.attType == 1)
item.object.showTxtContent = txtObj ? txtObj.attContent : ''
// 图片
let imgList = item.object.attachmentList.filter(k => k.attType == 2)
item.object.showImgContent = imgList || []
// 视频
let videoList = item.object.attachmentList.filter(k => k.attType == 3)
item.object.showVideoContent = videoList || []
}
})
this.editDisabled = new Date(this.editForm.startDate) < new Date()
this.editDisabled && this.judgeDisable()
this.$nextTick(() => {
this.editStatus = false
})
}
}) })
}, },
...@@ -466,18 +533,18 @@ export default { ...@@ -466,18 +533,18 @@ export default {
tagLists: [] tagLists: []
} }
this.customerDataList[this.currentCustomerIdx].list && this.customerDataList[this.currentCustomerIdx].list &&
this.customerDataList[this.currentCustomerIdx].list.forEach(item => { this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
item.labelList.length && item.labelList.length &&
item.labelList.forEach(subItem => { item.labelList.forEach(subItem => {
params.tagLists.push({ params.tagLists.push({
groupId: item.labelGroup.id, groupId: item.labelGroup.id,
groupName: item.labelGroup.name, groupName: item.labelGroup.name,
groupType: item.labelType, groupType: item.labelType,
labelId: subItem.id, labelId: subItem.id,
labelName: subItem.name labelName: subItem.name
}) })
})
}) })
})
this.$apis.sop.getCustomerByTagListApi(params).then(res => { this.$apis.sop.getCustomerByTagListApi(params).then(res => {
this.customerDataList[this.currentCustomerIdx].customerCount = res.count this.customerDataList[this.currentCustomerIdx].customerCount = res.count
}) })
...@@ -648,7 +715,13 @@ export default { ...@@ -648,7 +715,13 @@ export default {
item.isJoin == 1 && this.parentCustomerObj.parentPredictObj.qiwei++ item.isJoin == 1 && this.parentCustomerObj.parentPredictObj.qiwei++
}) })
} }
this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, parentCustomerObj: this.parentCustomerObj, info: { ...row, sopName: this.editForm.sopName } }) this.$emit('handleTabChange', {
activeName: 'editEvent',
addOrEdit: addOrEdit,
eventIndex: addOrEdit == 'add' ? '-1' : idx,
parentCustomerObj: this.parentCustomerObj,
info: {...row, sopName: this.editForm.sopName}
})
}, },
reqCrowdAttrs() { reqCrowdAttrs() {
...@@ -760,6 +833,7 @@ export default { ...@@ -760,6 +833,7 @@ export default {
} }
}) })
} else { } else {
console.log('1111111')
params.eventList = [] params.eventList = []
this.editForm.eventList.forEach((item, index) => { this.editForm.eventList.forEach((item, index) => {
params.eventList.push(JSON.parse(JSON.stringify(item))) params.eventList.push(JSON.parse(JSON.stringify(item)))
...@@ -784,7 +858,7 @@ export default { ...@@ -784,7 +858,7 @@ export default {
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.$tracker.track(Object.assign({},{pageName:'营销SOP',name:'编辑sop事件',params})) this.$tracker.track(Object.assign({}, {pageName: '营销SOP', name: '编辑sop事件', params}))
if (res.code == '0') { if (res.code == '0') {
this.cancelJump() this.cancelJump()
} }
...@@ -797,7 +871,7 @@ export default { ...@@ -797,7 +871,7 @@ export default {
message: res.code == '0' ? '操作成功' : res.message, message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error' type: res.code == '0' ? 'success' : 'error'
}) })
this.$tracker.track(Object.assign({},{pageName:'营销SOP',name:'创建sop事件',params})) this.$tracker.track(Object.assign({}, {pageName: '营销SOP', name: '创建sop事件', params}))
if (res.code == '0') { if (res.code == '0') {
this.cancelJump() this.cancelJump()
} }
...@@ -819,10 +893,11 @@ export default { ...@@ -819,10 +893,11 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {
})
} else { } else {
this.cancelJump() this.cancelJump()
} }
...@@ -838,6 +913,7 @@ export default { ...@@ -838,6 +913,7 @@ export default {
background-image: none; background-image: none;
border-radius: 4px; border-radius: 4px;
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
.customer-title { .customer-title {
box-sizing: border-box; box-sizing: border-box;
height: 39px; height: 39px;
...@@ -845,6 +921,7 @@ export default { ...@@ -845,6 +921,7 @@ export default {
padding: 0 10px; padding: 0 10px;
// border-bottom: 1px solid #dcdfe6; // border-bottom: 1px solid #dcdfe6;
} }
.input-tag-wrapper { .input-tag-wrapper {
max-height: 227px; max-height: 227px;
overflow: auto; overflow: auto;
...@@ -860,13 +937,16 @@ export default { ...@@ -860,13 +937,16 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
.el-tag.el-tag--info .el-tag__close { .el-tag.el-tag--info .el-tag__close {
color: #909399 !important; color: #909399 !important;
background: transparent !important; background: transparent !important;
} }
.customer-tag { .customer-tag {
margin: 4px; margin: 4px;
} }
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
...@@ -874,50 +954,65 @@ export default { ...@@ -874,50 +954,65 @@ export default {
} }
} }
} }
.event-empty { .event-empty {
height: 234px; height: 234px;
text-align: center; text-align: center;
.empty-img { .empty-img {
margin: 80px 0 12px; margin: 80px 0 12px;
} }
.empty-txt { .empty-txt {
color: #000000; color: #000000;
font-size: 14px; font-size: 14px;
opacity: 0.65; opacity: 0.65;
} }
} }
.event-box { .event-box {
padding: 32px 20px; padding: 32px 20px;
.event-item { .event-item {
position: relative; position: relative;
padding: 16px; padding: 16px;
background: #f7f7f7; background: #f7f7f7;
border: 1px solid rgba(220, 223, 230, 1); border: 1px solid rgba(220, 223, 230, 1);
margin-bottom: 20px; margin-bottom: 20px;
.event-title { .event-title {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin-bottom: 12px; margin-bottom: 12px;
} }
.model-item-img { .model-item-img {
width: 90px; width: 90px;
height: 78px; height: 78px;
margin-right: 5px; margin-right: 5px;
} }
.event-link { .event-link {
margin-top: 12px; margin-top: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
} }
.event-content { .event-content {
line-height: 24px; line-height: 24px;
} }
.event-btns { .event-btns {
position: absolute; position: absolute;
top: 16px; top: 16px;
right: 16px; right: 16px;
display: flex;
.newBtnSty{
margin-right: 8px;
}
} }
} }
.event-item:last-child { .event-item:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
......
...@@ -105,7 +105,6 @@ ...@@ -105,7 +105,6 @@
<nickname-model v-if="isNicknameVisible" :isNicknameVisible.sync="isNicknameVisible" @handleNicknameConfirm="handleNicknameConfirm" @handleNicknameClose="handleNicknameClose"></nickname-model> <nickname-model v-if="isNicknameVisible" :isNicknameVisible.sync="isNicknameVisible" @handleNicknameConfirm="handleNicknameConfirm" @handleNicknameClose="handleNicknameClose"></nickname-model>
</div> </div>
</template> </template>
<script> <script>
import { limitPrice } from '@/common/constant' import { limitPrice } from '@/common/constant'
import ActivityModel from './components/activityModel' import ActivityModel from './components/activityModel'
...@@ -391,7 +390,6 @@ export default { ...@@ -391,7 +390,6 @@ export default {
} }
} }
}, },
props: { props: {
eventObj: { eventObj: {
type: Object, type: Object,
...@@ -419,13 +417,11 @@ export default { ...@@ -419,13 +417,11 @@ export default {
} }
} }
}, },
components: { components: {
ActivityModel, ActivityModel,
materialModel, materialModel,
nicknameModel nicknameModel
}, },
watch: { watch: {
editForm: { editForm: {
handler(val) { handler(val) {
...@@ -443,14 +439,12 @@ export default { ...@@ -443,14 +439,12 @@ export default {
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val) this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
} }
}, },
created() { created() {
this.getDay('weekList', 7) this.getDay('weekList', 7)
this.getDay('monthList', 31) this.getDay('monthList', 31)
this.predictCountObj = JSON.parse(JSON.stringify(this.parentCustomerObj.parentPredictObj)) this.predictCountObj = JSON.parse(JSON.stringify(this.parentCustomerObj.parentPredictObj))
// this.limitQwPhone() // this.limitQwPhone()
}, },
mounted() { mounted() {
Object.assign(this.editForm, this.eventObj.info) Object.assign(this.editForm, this.eventObj.info)
this.getStaffTypeList() this.getStaffTypeList()
...@@ -459,7 +453,6 @@ export default { ...@@ -459,7 +453,6 @@ export default {
}) })
this.eventObj.addOrEdit != 'add' ? this.getInfo() : '' this.eventObj.addOrEdit != 'add' ? this.getInfo() : ''
}, },
methods: { methods: {
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
...@@ -486,18 +479,15 @@ export default { ...@@ -486,18 +479,15 @@ export default {
}) })
} }
}, },
handleResetMaxSet() { handleResetMaxSet() {
this.maxReachesTypeSet = '' this.maxReachesTypeSet = ''
}, },
getStaffTypeList() { getStaffTypeList() {
this.$apis.common.getStaffFollowerListApi({}).then(res => { this.$apis.common.getStaffFollowerListApi({}).then(res => {
this.baseData.staffTypeList = res this.baseData.staffTypeList = res
this.getOptionsList('editFormDataChannel', false, 'followerTypeId') this.getOptionsList('editFormDataChannel', false, 'followerTypeId')
}) })
}, },
getDay(attrName, day) { getDay(attrName, day) {
let weekNameList = ['一', '二', '三', '四', '五', '六', '日'] let weekNameList = ['一', '二', '三', '四', '五', '六', '日']
for (var i = 0; i < day; i++) { for (var i = 0; i < day; i++) {
...@@ -507,7 +497,6 @@ export default { ...@@ -507,7 +497,6 @@ export default {
}) })
} }
}, },
recoveryRepeat() { recoveryRepeat() {
var idx = this.editFormDataRepeat.findIndex(item => item.name == 'repeatMode') var idx = this.editFormDataRepeat.findIndex(item => item.name == 'repeatMode')
this.editFormDataRepeat[idx].isHide = this.editForm.repeatFlag == 'N' this.editFormDataRepeat[idx].isHide = this.editForm.repeatFlag == 'N'
...@@ -522,7 +511,6 @@ export default { ...@@ -522,7 +511,6 @@ export default {
this.editForm.reachesTypeSet = 1 this.editForm.reachesTypeSet = 1
} }
}, },
recoveryEndTime() { recoveryEndTime() {
var idx = this.editFormDataTime.findIndex(item => item.name == 'eventEndDate') var idx = this.editFormDataTime.findIndex(item => item.name == 'eventEndDate')
var startTime = new Date(this.editForm.eventStartDate) var startTime = new Date(this.editForm.eventStartDate)
...@@ -536,7 +524,6 @@ export default { ...@@ -536,7 +524,6 @@ export default {
} }
} }
}, },
getInfo() { getInfo() {
this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD') this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD')
this.editForm.eventEndDate = this.editForm.eventEndDate ? moment(this.editForm.eventEndDate).format('YYYY-MM-DD') : '' this.editForm.eventEndDate = this.editForm.eventEndDate ? moment(this.editForm.eventEndDate).format('YYYY-MM-DD') : ''
...@@ -545,11 +532,9 @@ export default { ...@@ -545,11 +532,9 @@ export default {
this.recoveryEndTime() this.recoveryEndTime()
this.getCustomerNum() this.getCustomerNum()
}, },
handleReachesType(val) { handleReachesType(val) {
this.editForm.reachesTypeSet = val == 1 ? 1 : '' this.editForm.reachesTypeSet = val == 1 ? 1 : ''
}, },
// 素材 // 素材
handleMaterialConfirm(val) { handleMaterialConfirm(val) {
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) // additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
...@@ -565,11 +550,9 @@ export default { ...@@ -565,11 +550,9 @@ export default {
] ]
this.handleMaterialClose() this.handleMaterialClose()
}, },
handleMaterialClose() { handleMaterialClose() {
this.isMaterialVisible = !this.isMaterialVisible this.isMaterialVisible = !this.isMaterialVisible
}, },
// 朋友圈模板 // 朋友圈模板
handleNicknameConfirm(val) { handleNicknameConfirm(val) {
// additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板) // additionalType 附加对象类型(1素材,2活动,3优惠券,4朋友券模板)
...@@ -588,11 +571,9 @@ export default { ...@@ -588,11 +571,9 @@ export default {
] ]
this.handleNicknameClose() this.handleNicknameClose()
}, },
handleNicknameClose() { handleNicknameClose() {
this.isNicknameVisible = !this.isNicknameVisible this.isNicknameVisible = !this.isNicknameVisible
}, },
// 营销内容 // 营销内容
handleFun(name) { handleFun(name) {
if (name == 'material') { if (name == 'material') {
...@@ -605,7 +586,6 @@ export default { ...@@ -605,7 +586,6 @@ export default {
this.handleNicknameClose() this.handleNicknameClose()
} }
}, },
close(index) { close(index) {
this.previewList.splice(index, 1) this.previewList.splice(index, 1)
if (this.editForm.object.additionalType == 4) { if (this.editForm.object.additionalType == 4) {
...@@ -614,7 +594,6 @@ export default { ...@@ -614,7 +594,6 @@ export default {
} }
this.editForm.object = {} this.editForm.object = {}
}, },
selectActivity(val) { selectActivity(val) {
this.editForm.object = JSON.parse(JSON.stringify(val)) this.editForm.object = JSON.parse(JSON.stringify(val))
this.editRule.eventContent[0].required = true this.editRule.eventContent[0].required = true
...@@ -627,7 +606,6 @@ export default { ...@@ -627,7 +606,6 @@ export default {
] ]
}, },
// 营销内容 // 营销内容
getCustomerNum() { getCustomerNum() {
switch (this.parentCustomerObj.currentCustomerTypeName) { switch (this.parentCustomerObj.currentCustomerTypeName) {
case '人群': case '人群':
...@@ -640,7 +618,6 @@ export default { ...@@ -640,7 +618,6 @@ export default {
break break
} }
}, },
getCustomerByCrowdList() { getCustomerByCrowdList() {
var params = { var params = {
pageSize: 1, pageSize: 1,
...@@ -653,7 +630,6 @@ export default { ...@@ -653,7 +630,6 @@ export default {
this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei'] = res.count this.predictCountObj[this.editForm.pushChannelType == 2 ? 'phone' : 'qiwei'] = res.count
}) })
}, },
getCustomerByTagList() { getCustomerByTagList() {
var params = { var params = {
combineType: 2, combineType: 2,
...@@ -662,18 +638,18 @@ export default { ...@@ -662,18 +638,18 @@ export default {
tagLists: [] tagLists: []
} }
this.parentCustomerObj.list && this.parentCustomerObj.list &&
this.parentCustomerObj.list.forEach(item => { this.parentCustomerObj.list.forEach(item => {
item.labelList.length && item.labelList.length &&
item.labelList.forEach(subItem => { item.labelList.forEach(subItem => {
params.tagLists.push({ params.tagLists.push({
groupId: item.labelGroup.id, groupId: item.labelGroup.id,
groupName: item.labelGroup.name, groupName: item.labelGroup.name,
groupType: item.labelType, groupType: item.labelType,
labelId: subItem.id, labelId: subItem.id,
labelName: subItem.name labelName: subItem.name
}) })
})
}) })
})
// 1-企业微信;2-短信;3-微信朋友圈 // 1-企业微信;2-短信;3-微信朋友圈
this.editForm.pushChannelType == 2 ? (params.customerPhone = '1') : (params.isJoin = 1) this.editForm.pushChannelType == 2 ? (params.customerPhone = '1') : (params.isJoin = 1)
this.$apis.sop.getCustomerByTagListApi(params).then(res => { this.$apis.sop.getCustomerByTagListApi(params).then(res => {
...@@ -684,7 +660,6 @@ export default { ...@@ -684,7 +660,6 @@ export default {
whereToGo(id) { whereToGo(id) {
document.getElementById(id).scrollIntoView() document.getElementById(id).scrollIntoView()
}, },
handleConfirm() { handleConfirm() {
var countParams = { var countParams = {
eventStartDate: this.editForm.eventStartDate, eventStartDate: this.editForm.eventStartDate,
...@@ -746,10 +721,10 @@ export default { ...@@ -746,10 +721,10 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}) })
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => { })
} else { } else {
this.cancelJump() this.cancelJump()
} }
...@@ -849,4 +824,4 @@ export default { ...@@ -849,4 +824,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="sopListRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <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"> <div class="table-btns" slot="auth-button" slot-scope="scope">
...@@ -18,7 +17,6 @@ ...@@ -18,7 +17,6 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
...@@ -173,11 +171,9 @@ export default { ...@@ -173,11 +171,9 @@ export default {
} }
} }
}, },
mounted() { mounted() {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
handleJump(path, row = {}) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
...@@ -185,7 +181,6 @@ export default { ...@@ -185,7 +181,6 @@ export default {
query: row ? { id: row.id, fromPage: '/marketing/sop/sopList' } : '' query: row ? { id: row.id, fromPage: '/marketing/sop/sopList' } : ''
}) })
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -220,16 +215,13 @@ export default { ...@@ -220,16 +215,13 @@ export default {
query: params query: params
}) })
}, },
// 结束 // 结束
handleEnd(row) { handleEnd(row) {
this.secondConfirm('结束', '结束SOP后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id }) this.secondConfirm('结束', '结束SOP后,将不再进行营销任务自动推送,且不可恢复。是否确定结束?', 'sop', 'endSopEventApi', { sopId: row.id })
}, },
handleDelete(row) { handleDelete(row) {
this.secondConfirm('删除', 'SOP删除后,不可恢复。是否确定删除?', 'sop', 'deleteSopEventApi', { sopId: row.id }) this.secondConfirm('删除', 'SOP删除后,不可恢复。是否确定删除?', 'sop', 'deleteSopEventApi', { sopId: row.id })
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
...@@ -255,22 +247,18 @@ export default { ...@@ -255,22 +247,18 @@ export default {
}) })
} }
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.sopListRef.data.length ? (this.$refs.sopListRef.tableHeightValues = '') : this.$refs.sopListRef.setTableHeightFun() this.$refs.sopListRef.data.length ? (this.$refs.sopListRef.tableHeightValues = '') : this.$refs.sopListRef.setTableHeightFun()
}, },
handleBack() { handleBack() {
this.$router.push({ this.$router.push({
path: '/sop/index' path: '/sop/index'
}) })
}, },
handleSearch() { handleSearch() {
this.$refs.sopListRef.refreshTable() this.$refs.sopListRef.refreshTable()
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
sopName: '', sopName: '',
...@@ -281,7 +269,6 @@ export default { ...@@ -281,7 +269,6 @@ export default {
} }
} }
</script> </script>
<style scoped> <style scoped>
.sop-list .sop-back-btn { .sop-list .sop-back-btn {
position: absolute; position: absolute;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!