Commit e528cc0f by 前端

Merge branch 'develop' into 'master'

v2.10.1上线后,Develop合并代码到master。

See merge request !357
2 parents 599dc5b0 c64dd432
......@@ -17,7 +17,6 @@
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3",
"vuedraggable": "^2.24.3",
"vuex": "^3.1.2",
......
......@@ -45,10 +45,34 @@ const getBrowseListApi = params => {
sign: true
})
}
//众筹活动访客明细
const getVisitorListApi = params => {
params.method = 'scrm.api.shopmall.customer.visitor.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 众筹活动分享明细
const getSharedListApi = params => {
params.method = 'scrm.api.shopmall.customer.shared.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 分页浏览-导出
const exportBrowseApi = params => {
params.method = 'scrm.api.shopmall.customer.browse.records.export'
const exportBrowseApi = (params, TYPE = 1) => {
//TYPE 1 浏览 2 访客 3 分享
params.method = {
1: 'scrm.api.shopmall.customer.browse.records.export',
2: 'scrm.api.shopmall.customer.visitor.records.export',
3: 'scrm.api.shopmall.customer.shared.records.export'
}[TYPE]
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
......@@ -137,5 +161,45 @@ const getCrowdSharedApi = params => {
sign: true
})
}
/**直播间下拉列表 */
const getLiveListApi = params => {
params.method = 'scrm.api.shopmall.livebroadcast.dropdown.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi }
/**数据看板员工排名 */
const getRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 数据看板员工-导出
const exportRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**数据看板 */
const getDataBoardApi = params => {
params.method = 'scrm.api.shopmall.activity.statdata'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
<!-- 搜索 -->
<template>
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<el-form
:ref="formRef"
:inline="true"
:model="formObj"
:rules="formRules"
size="small"
class="glsx-combi-form-block"
>
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<el-form-item
v-if="!item.isHide"
:key="index"
:id="item.name"
:labelWidth="isEdit ? '154px' : labelWidth"
:class="[{ 'no-label': !item.label, isBlock: isBlock },{'textBox':item.type=='textBox'}]"
:style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }"
:label="item.label"
:prop="item.name"
>
<span
v-if="!item.isHide && item.tips"
class="tips-block"
slot="label"
>
<span class="tips-label">{{ item.label }}</span>
<el-popover placement="top" width="200" trigger="hover" :content="item.tips">
<img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
<el-popover
placement="top"
width="200"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="./images/icon-tip.png"
/>
</el-popover>
:
</span>
<span v-else-if="!item.isHide && item.label && !item.tips" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth || labelWidth }">{{ item.label }}:</span>
<span
v-else-if="!item.isHide && item.label && !item.tips"
slot="label"
>
<span
class="combi-form-label"
:style="{ width: item.labelWidth || labelWidth }"
>{{ item.label }}:</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<slot
v-if="item.addHtml"
:name="item.addHtml"
:scope="item"
></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="suffix">{{ item.append }}</span>
<el-input
:placeholder="item.placeholder || '请输入' + item.label"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:prefix-icon="item.prefixIcon"
v-model.trim="formObj[item.name]"
:disabled="item.isDisabled"
:maxlength="item.maxlength"
:clearable="item.isClear || false"
:type="item.inputType || 'text'"
:rows="item.rows || 2"
:style="{ width: item.width || defaultWidth }"
:show-word-limit="item.showLimit || false"
:show-password="item.showPass || false"
@keydown.native="e => handleInputDown(e, item)"
>
<span
v-if="item.prepend"
slot="prepend"
>{{ item.prepend }}</span>
<span
v-if="item.append"
slot="suffix"
>{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
</div>
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
<el-select
:style="{ width: item.width || defaultWidth }"
v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:clearable="item.isClear || false"
:placeholder="item.placeholder || '请选择' + item.label"
:filterable="!item.noFilter"
:disabled="item.isDisabled"
:no-data-text="item.noDataText || '无数据'"
:multiple="item.multiple || false"
:collapse-tags="item.collapseTags || true"
@change="selectAddAttr($event, item)"
>
<el-option
v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:label="subItem[item.optionLabel]"
:value="subItem[item.optionId]"
:disabled="subItem.isDisabled || false"
></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
</div>
<!-- radio -->
<div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">
<el-radio-group
v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:disabled="item.isDisabled"
@change="item.handleRadioChange"
>
<el-radio
v-for="subItem in item.optionList"
:key="subItem[item.optionId]"
:disabled="subItem.isDisabled"
:label="subItem[item.optionId]"
>
{{ subItem[item.optionLabel] }}
<slot :name="subItem.suffixSonSlot" :scope="subItem"></slot>
<slot
:name="subItem.suffixSonSlot"
:scope="subItem"
></slot>
</el-radio>
</el-radio-group>
<slot :name="item.suffixSlot" :scope="item"></slot>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
</div>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<el-date-picker
v-else-if="item.type === 'datePicker'"
v-model="formObj[item.name]"
v-bind="item.attrs ? item.attrs : {}"
v-on="item.listeners ? item.listeners : {}"
:type="item.dateType || 'daterange'"
:disabled="item.isDisabled"
:value-format="item.valueFormat"
:style="{ width: item.width || defaultWidth }"
:clearable="item.isClear || false"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"
></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<div class="add" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''">+</div>
<slot
:name="item.prefixSlot"
:scope="item"
></slot>
<div
v-if="!item.isDisabled"
:style="{ width: item.width || defaultWidth }"
>
<div
v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<div
class="add"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('addStyle') ? item.uploadStyle.addStyle : ''"
>+</div>
<!-- <span v-if="item.maxPhotoNum > 1" class="number">{{ formObj[item.name].length }}/{{ item.maxPhotoNum }}</span> -->
<span class="number" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''">上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
<span
class="number"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('fontSize') ? item.uploadStyle.fontSize : ''"
>上传{{ item.uploadType == 'video' ? '视频' : '图片' }}</span>
<input
v-if="item.uploadType == 'video'"
type="file"
style="opacity: 0"
:id="item.name + 'file'"
ref="file"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
accept="video/mp4"
@change="e => handleUploadChange(e, item)"
/>
<input
v-else
type="file"
style="opacity: 0"
:id="item.name + 'file'"
ref="file"
class="activity-img img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
accept="image/png, image/jpeg, image/gif, image/jpg"
@change="e => handleUploadChange(e, item)"
/>
</div>
</div>
<template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span
v-for="(subItem, subIndex) in formObj[item.name]"
:key="subIndex"
class="muti-imgs img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<video
v-if="item.uploadType == 'video'"
class="img-w-h activity-img"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="typeof subItem == 'object' ? subItem.content : subItem"
></video>
<img
v-else
class="img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="typeof subItem == 'object' ? subItem.content : subItem"
/>
<span
class="img-btns"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
<i
v-show="!item.isDisabled"
class="el-icon-delete"
@click="handleImgDelete(item, subIndex)"
></i>
<i
class="el-icon-zoom-in"
@click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"
></i>
</span>
</span>
</span>
</span>
<span v-else class="muti-imgs">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''" :src="formObj[item.name]" />
<span class="img-btns" :style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''">
<span
v-else
class="muti-imgs"
>
<video
v-if="item.uploadType == 'video'"
class="img-w-h activity-img"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="formObj[item.name]"
></video>
<img
v-else
class="img-w-h"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
:src="formObj[item.name]"
/>
<span
class="img-btns"
:style="item.uploadStyle && item.uploadStyle.hasOwnProperty('imgWH') ? item.uploadStyle.imgWH : ''"
>
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
<i
v-show="!item.isDisabled"
class="el-icon-delete"
@click="handleImgDelete(item)"
></i>
<i
class="el-icon-zoom-in"
@click="handleImgLook(formObj[item.name], item)"
></i>
</span>
</span>
</span>
</div>
</template>
<slot :name="item.suffixSlot" :scope="item"></slot>
<slot
:name="item.suffixSlot"
:scope="item"
></slot>
</template>
<!-- 图文编辑器 -->
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" :excludeMenus="item.excludeMenus || ['code']" @change="e => handleTextBoxChange(e, item)" @focus="handleTextBoxFocus(item)"></textBox>
<textBox
v-else-if="item.type === 'textBox'"
:ref="item.name + 'TextBox'"
:excludeMenus="item.excludeMenus || ['code']"
@change="e => handleTextBoxChange(e, item)"
@focus="handleTextBoxFocus(item)"
:boxHeight="item.boxHeight"
></textBox>
<!-- 地图 -->
<div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"></Province>
<el-input style="flex: 1;" v-model="formObj[item.name]" placeholder="请选择商户地址" :readonly="item.isReadonly"></el-input>
<el-button class="m-l-10" v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
<div
v-else-if="item.type === 'map'"
class="flex"
>
<Province
ref="provinceForm"
:subdistrict="subdistrict"
:isDisabled="item.isDisabled"
@selectProvince="e => handleSelectProvince(e, item)"
@selectCity="e => handleSelectCity(e, item)"
></Province>
<el-input
style="flex: 1;"
v-model="formObj[item.name]"
placeholder="请选择商户地址"
:readonly="item.isReadonly"
></el-input>
<el-button
class="m-l-10"
v-show="!item.isDisabled"
@click="handleSelectMap(item)"
type="primary"
>选择地址</el-button>
</div>
</el-form-item>
</template>
<slot name="footer"></slot>
</el-form>
<GLDialog v-if="isImgVisible" bigTitle="查看" mode="big" :visible.sync="isImgVisible" :close-on-click-modal="false" @onOk="isImgVisible = false" @onCancel="isImgVisible = false">
<GLDialog
v-if="isImgVisible"
bigTitle="查看"
mode="big"
:visible.sync="isImgVisible"
:close-on-click-modal="false"
@onOk="isImgVisible = false"
@onCancel="isImgVisible = false"
>
<div class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
<video
v-if="dialogObj.uploadType == 'video'"
class="dialog-video"
controls
>
<source
:src="dialogObj.url"
type="video/mp4"
/>
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
<img
v-else
class="dialog-img"
width="100%"
:src="dialogObj.url"
alt=""
/>
</div>
</GLDialog>
<GLDialog bigTitle="选择地址" mode="big" :visible.sync="dialogMapVisible" @onOk="getAddress" @onCancel="dialogMapVisible = false">
<map-view ref="mapForm" :mapHeight="mapHeight"></map-view>
<GLDialog
bigTitle="选择地址"
mode="big"
:visible.sync="dialogMapVisible"
@onOk="getAddress"
@onCancel="dialogMapVisible = false"
>
<map-view
v-if="dialogMapVisible"
ref="mapForm"
></map-view>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="">取 消</el-button>
<el-button type="primary" @click="getAddress">确 定</el-button>
......@@ -117,14 +377,13 @@ import mapView from './mapView.vue'
import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
data () {
return {
pickerOption: {
beforeRangePickerOptions: beforeRangePickerOptions,
afterRangePickerOptions: afterRangePickerOptions
},
subdistrict: 2,
mapHeight: 450,
dialogMapVisible: false,
targetItem: {},
isImgVisible: false,
......@@ -190,30 +449,32 @@ export default {
mapView
},
mounted() { },
mounted () { },
methods: {
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
selectAddAttr (value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
handleInputDown(e, item) {
handleInputDown (e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
},
handleInputBlur(e, item) {
handleInputBlur (e, item) {
item.inputBlur && item.inputBlur(e, item)
},
// 图片
handleUploadChange(e, targetItem) {
handleUploadChange (e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img'
var uploadType = targetItem.uploadType || 'img',
IMGTYPE = ['image/jpeg', 'image/png', 'image/jpg']
if (targetItem.supportGif) IMGTYPE.push('image/gif')
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
const isType = uploadType == 'img' ? ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type) : ['video/mp4'].includes(file.type)
const isType = uploadType == 'img' ? IMGTYPE.includes(file.type) : ['video/mp4'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300
......@@ -253,13 +514,13 @@ export default {
document.getElementById(targetItem.name + 'file').value = ''
},
// 图片删除
handleImgDelete(targetItem, subIndex = -1) {
handleImgDelete (targetItem, subIndex = -1) {
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
targetItem.handleDelete && targetItem.handleDelete(subIndex)
// this.$emit('handleImgDelete', targetItem)
},
// 图片查看
handleImgLook(src, targetItem) {
handleImgLook (src, targetItem) {
this.isImgVisible = true
this.dialogObj = {
url: src,
......@@ -267,28 +528,29 @@ export default {
}
},
// 获取富文本框内容
handleTextBoxChange(val, targetItem) {
handleTextBoxChange (val, targetItem) {
this.formObj[targetItem.name] = val
},
handleTextBoxFocus(targetItem) {
handleTextBoxFocus (targetItem) {
this.$refs[targetItem.name + 'TextBox'][0].setEdit(this.formObj[targetItem.name])
},
// 禁用富文本
forbidEdit() {
forbidEdit () {
this.$refs.textBox.forbidEdit()
},
// 地图
handleSelectMap(targetItem) {
handleSelectMap (targetItem) {
this.targetItem = targetItem
this.dialogMapVisible = true
this.$nextTick(() => {
if (this.formObj[targetItem.attrObj.fullAddress] && !this.$refs.mapForm.address) {
this.$refs.mapForm.address = this.formObj[targetItem.attrObj.fullAddress]
this.$refs.mapForm.addMarker([this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]])
this.$refs.mapForm.lnglat = this.formObj[targetItem.attrObj.lng] ? [this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]] : []
// this.$refs.mapForm.addMarker([this.formObj[targetItem.attrObj.lng], this.formObj[targetItem.attrObj.lat]])
}
})
},
getAddress() {
getAddress () {
let mapInfo = this.$refs.mapForm
if (!mapInfo.address) {
this.$message({
......@@ -299,8 +561,8 @@ export default {
return
}
this.formObj[this.targetItem.attrObj.fullAddress] = mapInfo.address
this.formObj[this.targetItem.attrObj.lat] = mapInfo.lnglat.lat
this.formObj[this.targetItem.attrObj.lng] = mapInfo.lnglat.lng
this.formObj[this.targetItem.attrObj.lat] = mapInfo.lnglat[1]
this.formObj[this.targetItem.attrObj.lng] = mapInfo.lnglat[0]
// var fullAddress = mapInfo.geocoderAddress.addressComponent || this.formObj[this.targetItem.attrObj.fullAddress]
var fullAddress = mapInfo.geocoderAddress.addressComponent
var provincecode = mapInfo.geocoderAddress.adcode || this.formObj[this.targetItem.attrObj.provinceCode]
......@@ -338,14 +600,14 @@ export default {
this.$refs.provinceForm[0].init(province, city)
},
// 获取省
handleSelectProvince(val, targetItem) {
handleSelectProvince (val, targetItem) {
this.formObj[targetItem.attrObj.fullAddress] = ''
this.formObj[targetItem.attrObj.cityName] = ''
this.formObj[targetItem.attrObj.provinceName] = val.provinceName
this.formObj[targetItem.attrObj.provinceCode] = val.provinceCode
},
// 获取市
handleSelectCity(val, targetItem) {
handleSelectCity (val, targetItem) {
if (val.cityName) {
this.formObj[targetItem.attrObj.cityName] = val.cityName
this.formObj[targetItem.attrObj.cityCode] = val.cityCode
......@@ -535,4 +797,8 @@ export default {
.glsx-combi-form .el-tag.el-tag--info .el-tag__close:hover {
background-color: #e8e8ea;
}
.textBox .el-form-item__content {
width: 62%;
/* background: #096; */
}
</style>
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
......@@ -16,43 +18,90 @@ export default {
props: {
mapHeight: {
type: Number,
default: 300
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: '',
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(this.input, function (status, result) {
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
_this.adrList = result.poiList.pois
}
})
},
......@@ -63,63 +112,76 @@ export default {
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
map.setFitView()
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let lnglat
let position
if (e.type == 'click') {
lnglat = e.lnglat
position = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
......@@ -130,8 +192,18 @@ export default {
width: 280px;
}
.map-address {
position: absolute;
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
bottom: -30px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -15,14 +15,6 @@ import '@/components'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
import { setMinHeight } from '@/common/constant'
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: 'bd290dc27d0945959280753215ddda71', // 这里写你申请的高德地图的key
plugin: ['AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.Geolocation'],
v: '1.4.15'
})
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.size = 'small'
......
......@@ -350,6 +350,12 @@ const staticRoutes = Object.freeze([
path: '/seckillActivity/browseList',
component: resolve => require([`@/views/seckillActivity/browseList.vue`], resolve),
meta: {}
},
{
name: 'dataBoard',
path: '/seckillActivity/dataBoard',
component: resolve => require([`@/views/seckillActivity/dataBoard.vue`], resolve),
meta: {}
}
])
export default staticRoutes
......@@ -19,6 +19,10 @@ export default {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight:{
type: Number,
default: 240
}
},
mounted() {
......@@ -31,7 +35,7 @@ export default {
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
......@@ -112,7 +116,7 @@ export default {
<style lang="scss" scoped>
#div-demo {
margin: 16px 300px 0 0;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
......
<!-- 订单管理 -->
<template>
<div class="marketing order-manage">
<div class="list-tips m-b-10">
<img
class="tips-img"
src="@/assets/icon-info.png"
/>
<span class="table-tips">
已生成有效订单
<span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
项 累计订单总额:
<span class="txt-blue">{{ statisticsInfo.payPriceTotal || 0 }}&nbsp;</span>
元 累计退款总额:
<span class="txt-blue">{{ statisticsInfo.refundTotal || 0 }}&nbsp;</span>
元
</span>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex">
<div class="flex-default">
<el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="全部订单" name="allOrder"></el-tab-pane>
<el-tab-pane label="售后订单" name="afterOrder"></el-tab-pane>
</el-tabs>
<div class="sticky">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<span class="table-tips">
已生成有效订单
<span class="txt-blue">&nbsp;{{ statisticsInfo.orderCount || 0 }}&nbsp;</span>
项 累计订单总额:
<span class="txt-blue">{{ statisticsInfo.payPriceTotal || 0 }}&nbsp;</span>
元 累计退款总额:
<span class="txt-blue">{{ statisticsInfo.refundTotal || 0 }}&nbsp;</span>
元
</span>
<div class="flex">
<div class="flex-default tabs">
<el-tabs
v-model="searchForm.requestSource"
@tab-click="handleTabClick"
>
<el-tab-pane
label="全部订单"
name="0"
></el-tab-pane>
<el-tab-pane
label="已付款"
name="1"
></el-tab-pane>
<el-tab-pane
label="未付款"
name="2"
></el-tab-pane>
<el-tab-pane
label="已退款"
name="3"
></el-tab-pane>
<el-tab-pane
label="售后订单"
name="4"
></el-tab-pane>
</el-tabs>
</div>
<el-button
class="default-blue-btn"
:size="size"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<el-button class="default-blue-btn" :size="size" type="default" @click="handleExport">导出</el-button>
</div>
<!-- 表格区域 - 全部订单/售后订单 - 开始 -->
<GLTable ref="allOrderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="weChatName" class="flex-align" 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 v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span>
</div>
<template slot="vinNo" slot-scope="scope">
{{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }}
<el-popover popper-class="order-table-popover" placement="right-start" trigger="click">
<p v-for="(item, index) in scope.scope.vinNo" :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>
</template>
<div slot="orderStatus" slot-scope="scope">
<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>
</div>
<div slot="shareStaffName" class="table-image" slot-scope="scope">
<div>
<img v-if="scope.scope.shareStaffImageUrl" class="img-36 pointer img-circle" style="vertical-align: middle" slot="reference" :src="scope.scope.shareStaffImageUrl" />
<span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span>
<span class="txt-green" v-if="scope.scope.shareStaffType == 1">@微信</span>
<span class="txt-orange" v-if="scope.scope.shareStaffType == 2">@企微</span>
<span class="txt-blue" v-if="scope.scope.shareStaffType == 3">@小程序</span>
</span>
<div class="order-manage-table">
<GLTable
ref="allOrderRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="weChatName"
class="flex-align"
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 v-if="!scope.scope.shareAvatar && !scope.scope.weChatName">-</span>
</div>
<span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<template
slot="vinNo"
slot-scope="scope"
>
{{ Array.isArray(scope.scope.vinNo) ? scope.scope.vinNo[0] : scope.scope.vinNo }}
<el-popover
popper-class="order-table-popover"
placement="right-start"
trigger="click"
>
<p
v-for="(item, index) in scope.scope.vinNo"
: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>
</template>
<div
slot="orderStatus"
slot-scope="scope"
>
<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>
</div>
<div
slot="shareStaffName"
class="table-image"
slot-scope="scope"
>
<div>
<img
v-if="scope.scope.shareStaffImageUrl"
class="img-36 pointer img-circle"
style="vertical-align: middle"
slot="reference"
:src="scope.scope.shareStaffImageUrl"
/>
<span class="m-l-10">
<span>{{ scope.scope.shareStaffName }}</span>
<span
class="txt-green"
v-if="scope.scope.shareStaffType == 1"
>@微信</span>
<span
class="txt-orange"
v-if="scope.scope.shareStaffType == 2"
>@企微</span>
<span
class="txt-blue"
v-if="scope.scope.shareStaffType == 3"
>@小程序</span>
</span>
</div>
<span v-if="!scope.scope.shareStaffImageUrl && !scope.scope.shareStaffName">-</span>
</div>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div>
</GLTable>
</div>
<!-- 表格区域 - 全部订单/售后订单 - end -->
</div>
<!-- 快递信息 -->
<GLDialog v-if="isExpressVisible" title="输入快递信息" mode="mid" okText="确定" cancelText="取消" :visible.sync="isExpressVisible" @onOk="handleExpressConfirm" @onCancel="handleExpressClose">
<glsx-combi-form class="small-content m-t-20" ref="expressRef" :isBlock="true" defaultWidth="284px" :isEdit="isEdit" :formRef="editChildRef" :formObj="expressForm" :formData="expressFormData" :formRules="expressRules"></glsx-combi-form>
<GLDialog
v-if="isExpressVisible"
title="输入快递信息"
mode="mid"
okText="确定"
cancelText="取消"
:visible.sync="isExpressVisible"
@onOk="handleExpressConfirm"
@onCancel="handleExpressClose"
>
<glsx-combi-form
class="small-content m-t-20"
ref="expressRef"
:isBlock="true"
defaultWidth="284px"
:isEdit="isEdit"
:formRef="editChildRef"
:formObj="expressForm"
:formData="expressFormData"
:formRules="expressRules"
></glsx-combi-form>
</GLDialog>
<!-- 订单核销 -->
<GLDialog v-if="isWriteOffVisible" title="订单核销(请确保用户到店后核销,避免引起不必要问题)" mode="mid" okText="确定" cancelText="取消" :visible.sync="isWriteOffVisible" @onOk="handleWriteOffConfirm" @onCancel="handleWriteOffClose">
<glsx-combi-form class="small-content m-t-20" ref="writeOffRef" :isBlock="true" defaultWidth="284px" :formRef="editChildRef" :formObj="writeOffForm" :formData="writeOffFormData" :formRules="writeOffRules"></glsx-combi-form>
<GLDialog
v-if="isWriteOffVisible"
title="订单核销(请确保用户到店后核销,避免引起不必要问题)"
mode="mid"
okText="确定"
cancelText="取消"
:visible.sync="isWriteOffVisible"
@onOk="handleWriteOffConfirm"
@onCancel="handleWriteOffClose"
>
<glsx-combi-form
class="small-content m-t-20"
ref="writeOffRef"
:isBlock="true"
defaultWidth="284px"
:formRef="editChildRef"
:formObj="writeOffForm"
:formData="writeOffFormData"
:formRules="writeOffRules"
></glsx-combi-form>
</GLDialog>
<!-- 退款审核 -->
<GLDialog v-if="isExamineVisible" bigTitle="退款审核" mode="big" :visible.sync="isExamineVisible" @onOk="handleExamineConfirm" @onCancel="handleExamineClose">
<GLDialog
v-if="isExamineVisible"
bigTitle="退款审核"
mode="big"
:visible.sync="isExamineVisible"
@onOk="handleExamineConfirm"
@onCancel="handleExamineClose"
>
<el-form label-width="144px">
<el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span>
......@@ -84,8 +230,15 @@
<span>{{ orderInfo.remark || '-' }}</span>
</el-form-item>
<el-form-item v-if="orderInfo.imgUrls">
<span v-for="(item, index) in orderInfo.imgUrls" :key="index">
<el-image class="img-60" :src="item" :preview-src-list="[item]"></el-image>
<span
v-for="(item, index) in orderInfo.imgUrls"
:key="index"
>
<el-image
class="img-60"
:src="item"
:preview-src-list="[item]"
></el-image>
</span>
</el-form-item>
<el-form-item label="审核是否通过">
......@@ -95,12 +248,28 @@
</el-radio-group>
</el-form-item>
<template v-if="orderInfo.refundType == 1 && examineForm.isAllowed == '1'">
<glsx-combi-form ref="examineRef" :isEdit="isEdit" defaultWidth="284px" :isBlock="true" :formRef="editChildRef" :formObj="examineForm" :formData="examineFormData" :formRules="examineRules"></glsx-combi-form>
<glsx-combi-form
ref="examineRef"
:isEdit="isEdit"
defaultWidth="284px"
:isBlock="true"
:formRef="editChildRef"
:formObj="examineForm"
:formData="examineFormData"
:formRules="examineRules"
></glsx-combi-form>
</template>
</el-form>
</GLDialog>
<!-- 确认收货 -->
<GLDialog v-if="isReceivingVisible" bigTitle="确认收货" mode="big" :visible.sync="isReceivingVisible" @onOk="handleReceivingConfirm" @onCancel="handleReceivingClose">
<GLDialog
v-if="isReceivingVisible"
bigTitle="确认收货"
mode="big"
:visible.sync="isReceivingVisible"
@onOk="handleReceivingConfirm"
@onCancel="handleReceivingClose"
>
<el-form label-width="140px">
<el-form-item label="售后类型">
<span>{{ orderInfo.refundTypeName }}</span>
......@@ -131,11 +300,10 @@ import url from '@/assets/empty.png'
import { orderManageStatusList, afterSaleStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
export default {
name: 'orderManage',
data() {
data () {
return {
size: 'small',
url: url,
activeName: 'allOrder',
isEdit: true,
orderCode: '',
oldVal: {
......@@ -155,7 +323,8 @@ export default {
shareStaffName: '',
shareStaffType: '',
activityName: '',
goodsName: ''
goodsName: '',
requestSource: '0'
},
tableSearchForm: {},
statisticsInfo: {
......@@ -513,8 +682,7 @@ export default {
{
label: '客户名称',
prop: 'customerName',
line: 2,
width: 180,
width: 160,
formatter: cellValue => {
return cellValue.customerName || '-'
}
......@@ -522,21 +690,35 @@ export default {
{
label: '手机号',
prop: 'customerPhone',
width: 130,
width: 160,
formatter: cellValue => {
return cellValue.customerPhone || '-'
}
},
{
label: '其他信息',
label: '其他',
prop: 'otherInformation',
width: '280'
width: 210
},
{
label: '微信名称',
prop: 'weChatName',
addHtml: 'weChatName',
width: 300
width: 210
},
{
label: '推荐人',
prop: 'shareStaffName',
width: 210,
addHtml: 'shareStaffName'
},
{
label: '推荐人手机号',
prop: 'shareStaffPhone',
width: 160,
formatter: cellValue => {
return cellValue.shareStaffPhone || '-'
}
},
{
label: '订单时间',
......@@ -583,20 +765,6 @@ export default {
}
},
{
label: '推荐人',
prop: 'shareStaffName',
width: 360,
addHtml: 'shareStaffName'
},
{
label: '推荐人手机号',
prop: 'shareStaffPhone',
width: 130,
formatter: cellValue => {
return cellValue.shareStaffPhone || '-'
}
},
{
label: '支付总价/元',
prop: 'payPrice',
width: '120',
......@@ -676,27 +844,24 @@ export default {
}
},
mounted() {
mounted () {
// this.getCount()
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
getParams () {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.createdStartDateStr = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndDateStr = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
// 售后订单
if (this.activeName == 'afterOrder') {
params.orderStatusPart = 1
}
if (params.orderStatuses.includes('3') && params.requestSource == '0') delete params.requestSource
delete params.createDate
return params
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
......@@ -704,7 +869,7 @@ export default {
})
},
getOptionsList(formName, hasAll = true, refreshSigle) {
getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
......@@ -730,7 +895,7 @@ export default {
}
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -752,15 +917,16 @@ export default {
})
},
getCount() {
getCount () {
var params = this.getParams()
delete params.createDate
// if(params.orderStatuses.includes('3')) return
this.$apis.orderManage.getCountApi(params).then(res => {
this.statisticsInfo = res || { orderCount: '', payPriceTotal: '', refundTotal: '' }
})
},
handleDetail(row) {
handleDetail (row) {
this.$router.push({
path: '/orderManage/orderDetail',
query: {
......@@ -770,7 +936,7 @@ export default {
},
// 输入快递信息 - start
handleExpressClose() {
handleExpressClose () {
this.isExpressVisible = !this.isExpressVisible
this.orderCode = ''
this.expressForm = {
......@@ -779,7 +945,7 @@ export default {
}
},
handleExpressConfirm() {
handleExpressConfirm () {
this.$refs.expressRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.expressForm)
......@@ -799,14 +965,14 @@ export default {
})
},
handleExpressInfo(row) {
handleExpressInfo (row) {
this.isExpressVisible = !this.isExpressVisible
this.orderCode = row.orderCode
},
// 输入快递信息 - end
// 订单核销 - start
handleWriteOffClose() {
handleWriteOffClose () {
this.isWriteOffVisible = !this.isWriteOffVisible
this.orderCode = ''
this.writeOffForm = {
......@@ -814,7 +980,7 @@ export default {
}
},
handleWriteOffConfirm() {
handleWriteOffConfirm () {
this.$refs.writeOffRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.$common.utils.deepClone(this.writeOffForm)
......@@ -834,7 +1000,7 @@ export default {
})
},
handleWriteOff(row) {
handleWriteOff (row) {
if (row.orderSource == 4) {
this.secondConfirm('订单核销', '请确定是否核销此订单?', 'orderManage', 'crowdFundWriteOffApi', { orderCode: row.orderCode })
return true
......@@ -845,7 +1011,7 @@ export default {
// 订单核销 - end
// 退款审核 - start
handleExamineClose() {
handleExamineClose () {
this.isExamineVisible = !this.isExamineVisible
this.orderCode = ''
this.orderInfo = {}
......@@ -857,7 +1023,7 @@ export default {
}
},
submitExamine(params) {
submitExamine (params) {
this.$apis.orderManage.examineAllowApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
......@@ -871,7 +1037,7 @@ export default {
})
},
handleExamineConfirm() {
handleExamineConfirm () {
var params = {
id: this.orderInfo.id
}
......@@ -890,7 +1056,7 @@ export default {
}
},
handleExamine(row) {
handleExamine (row) {
this.orderCode = row.orderCode
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(res => {
this.orderInfo = res || {}
......@@ -902,13 +1068,13 @@ export default {
// 退款审核 - end
// 确认收货 - start
handleReceivingClose() {
handleReceivingClose () {
this.isReceivingVisible = !this.isReceivingVisible
this.orderCode = ''
this.orderInfo = {}
},
handleReceivingConfirm() {
handleReceivingConfirm () {
var params = {
id: this.orderInfo.id
}
......@@ -925,7 +1091,7 @@ export default {
})
},
handleReceiving(row) {
handleReceiving (row) {
this.$apis.orderManage.examineDetailApi({ orderCode: row.orderCode }).then(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 : '-'
......@@ -935,7 +1101,7 @@ export default {
},
// 确认收货 - end
setTableFinishFun() {
setTableFinishFun () {
this.$refs.allOrderRef.data.forEach(item => {
item.vinNo = item.vin ? (item.vin.split(',').length > 1 ? item.vin.split(',') : item.vin) : '-'
})
......@@ -944,37 +1110,23 @@ export default {
this.getCount()
},
handleSearch() {
handleSearch () {
this.$refs.allOrderRef.refreshTable()
},
handleTabClick() {
handleTabClick () {
this.handleSearch()
},
handleExport(row) {
handleExport (row) {
var params = this.getParams()
this.$apis.orderManage.orderExportApi(params).then(res => {
exportFn(res)
})
},
handleReset() {
this.searchForm = {
orderCode: '',
orderStatuses: [],
afterSaleStatuses: [],
merchantName: '',
customerName: '',
createDate: [],
orderSource: '',
deliveryType: '',
vin: '',
shareStaffName: '',
shareStaffType: '',
activityName: '',
goodsName: ''
}
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.handleSearch()
}
}
......@@ -987,12 +1139,12 @@ export default {
padding: 8px 12px !important;
}
.order-manage {
.container {
padding: 20px 14px;
}
.table-tips {
height: 48px;
line-height: 48px;
font-size: 14px;
color: #333333;
margin-left: 16px;
color: rgba(0, 0, 0, 0.65);
}
.car-no {
cursor: pointer;
......@@ -1003,7 +1155,31 @@ export default {
line-height: 25px;
}
.txt-blue {
color: #5092ff;
color: #5850ff;
}
.list-tips {
background: #e4e3ff;
border-radius: 4px;
border: none;
}
.order-manage-table {
padding: 20px;
border: 1px solid #e5e5e5;
border-radius: 0 4px 4px 4px;
}
.flex-default.tabs {
border-bottom: 1px solid #e5e5e5;
border-bottom: 0;
.el-tabs__item {
background: #fafafa;
border: 1px solid #e5e5e5 !important;
border-radius: 4px 4px 0 0;
border-bottom: 0;
}
.is-active {
border-bottom: 1px solid #fff !important;
font-weight: 500;
}
}
}
</style>
<!-- 浏览明细 -->
<!-- 明细 -->
<template>
<div class="edit-share marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ routeInfo.activityName }}</p>
<div class="p-20">
<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>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
<div class="table-title">
已累计<template v-if="routeInfo.type != 2">{{decodeURI(routeInfo.name)}}</template>
<span>{{routeInfo.count || 0}}</span>
{{routeInfo.type == 2?'位访客':'次'}}
</div>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.customerAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.customerAvatar" />
</el-popover>
<GLTable
ref="browserRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="customerName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.customerAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.customerAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.customerAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div slot="shareName" class="flex-align" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.shareAvatar" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" />
</el-popover>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone }}</span>
</div>
<div
slot="isBuy"
slot-scope="scope"
>
<span :class="['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ?'back-green': 'back-grey']"></span>
<span>{{{
'Y':'已付款',
'N':'未付款'
}[scope.scope.isBuy] || '--'}}</span>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleJump">返回</el-button>
<div
class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div>
</div>
</template>
......@@ -44,7 +122,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -72,15 +150,21 @@ export default {
name: 'mobile',
type: 'input',
maxlength: 11
},
{
label: '分享人',
name: 'shareName',
type: 'input',
maxlength: 50
}
],
// 表格
getListApi: this.$apis.seckillActivity.getBrowseListApi,
getListApi: null,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '微信名称',
label: '微信昵称',
prop: 'customerName',
addHtml: 'customerName'
},
......@@ -89,66 +173,133 @@ export default {
prop: 'mobile'
},
{
label: '来源',
label: '分享人',
prop: 'shareName',
addHtml: 'shareName'
},
{
label: '浏览次数',
prop: 'browseCount'
addHtml: 'shareName',
width: 230
},
{
label: '浏览时间',
prop: 'lastBrowseDate',
width: '180'
}
]
}
}
},
created() {
this.routeInfo = this.$route.query
created () {
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browserTime',
},
{
label: '进入页面时间',
prop: 'operationDate',
width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
}
], {
query
} = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享',
}[query.type],
[url] = window.location.href.split('%24title')
query.name = name
this.routeInfo = query
this.getListApi = this.$apis.seckillActivity[{
1: 'getBrowseListApi',
2: 'getVisitorListApi',
3: 'getSharedListApi'
}[query.type]]
history.replaceState(null, null, `${url}&$title=${name}明细`)
// listName:
//1 浏览 2 访客 3 分享
if (query.type != 2) {
this.searchFormData.push({
label: '订单状态',
name: 'isBuy',
type: 'select',
width: '215px',
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: 'Y',
confName: '已付款'
},
{
confId: 'N',
confName: '未付款'
}
],
optionId: 'confId',
optionLabel: 'confName',
})
if (query.type == 3) this.tableParams.tableColumns.push({
label: '分享时间',
prop: 'sharedTime',
})
this.tableParams.tableColumns = [...this.tableParams.tableColumns, ...lastTableColumns]
} else this.tableParams.tableColumns = [...this.tableParams.tableColumns, {
label: '浏览次数',
prop: 'browseCount',
}, {
label: '最后浏览时间',
prop: 'lastBrowseDate',
}]
},
mounted() {
mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1
params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params).then(res => {
this.$apis.seckillActivity.exportBrowseApi(params, type).then(res => {
exportFn(res)
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
handleSearch () {
this.$refs.browserRef.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
......@@ -160,4 +311,18 @@ export default {
}
</script>
<style scoped></style>
<style scoped lang="scss">
.edit-container {
.table-title {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
align-items: center;
span {
color: #5850ff;
}
}
}
</style>
......@@ -2,36 +2,103 @@
<template>
<div class="marketing">
<div class="m-b-20">
<GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹" mode="el-button">新建众筹</GLButton>
<el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button>
<GLButton
:size="size"
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
<el-button
:size="size"
type="default"
class="default-blue-btn"
@click="handleJump"
>订单管理</el-button>
</div>
<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>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="activityImg" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.activityImg" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" />
<GLTable
ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="activityImg"
class="table-image"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover>
</div>
<div slot="viewAmount" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.viewAmount || 0 }}</p>
<div
slot="linkText"
slot-scope="scope"
>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{scope.scope[scope.prop] || 0}}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
<share-dialog
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
></share-dialog>
</div>
</template>
......@@ -42,7 +109,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'crowdFundList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -69,7 +136,7 @@ export default {
maxlength: 20
},
{
label: '状态',
label: '活动状态',
name: 'activityStatus',
type: 'select',
width: '215px',
......@@ -162,6 +229,36 @@ export default {
listeners: {
click: this.handleShare
}
},
{
type: 'el-button',
name: '复制',
attrs: {
type: 'text'
},
listeners: {
click: row => {
this.handleEdit('copy', row)
}
}
},
{
type: 'GLButton',
name: '数据看板',
attrs: {
type: 'text',
fn: '数据看板'
},
listeners: {
click: row => {
this.$router.push({
path: '/seckillActivity/dataBoard',
query: {
activityId: row.id
}
})
}
}
}
],
// 表格
......@@ -183,7 +280,7 @@ export default {
{
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'viewAmount',
addHtml: 'linkText',
width: 140
},
{
......@@ -208,12 +305,14 @@ export default {
}
},
{
label: '粉丝',
prop: 'fansAmount'
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount'
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '销量',
......@@ -274,16 +373,16 @@ export default {
shareDialog
},
mounted() {
mounted () {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
getParams () {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
......@@ -291,13 +390,13 @@ export default {
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/orderManage/index'
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -320,16 +419,16 @@ export default {
},
//开始
start(item) {
start (item) {
this.startOrEndConfirm('开始', item)
},
//结束
end(item) {
end (item) {
this.startOrEndConfirm('结束', item)
},
startOrEndConfirm(txt, row) {
startOrEndConfirm (txt, row) {
var title = txt
var params = {}
params.id = row.id
......@@ -342,24 +441,29 @@ export default {
},
//置顶
topping(row) {
topping (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del(row) {
del (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
handleEdit (addOrEdit, row) {
var txtObj = {
add: '新建',
edit: '编辑',
copy: '复制'
}[addOrEdit]
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动')
$title: encodeURI(txtObj + '众筹活动')
}
if (addOrEdit != 'add') {
params.id = row.id
......@@ -370,37 +474,56 @@ export default {
query: params
})
},
test (option) {
console.log(JSON.parse(JSON.stringify(option)))
},
// 明细
handleDetail(row) {
handleDetail ({ prop, scope }) {
let data = {
viewAmount: {
type: 1,
count: scope.viewAmount
},
fansAmount: {
type: 2,
count: scope.fansAmount
},
shareAmount: {
type: 3,
count: scope.shareAmount
}
}[prop]
this.$router.push({
path: '/seckillActivity/browseList',
query: {
id: row.id,
activityName: row.activityName
id: scope.id,
activityName: scope.activityName,
type: data.type,
count: data.count,
}
})
},
handleExport() {
handleExport () {
var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res)
})
},
handleShare(row) {
handleShare (row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
handleShareClose () {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
......@@ -426,11 +549,11 @@ export default {
}
},
handleSearch() {
handleSearch () {
this.$refs.activity.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityName: '',
activityStatus: ''
......@@ -438,7 +561,7 @@ export default {
this.handleSearch()
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
}
......
<template>
<div class="marketing data-board">
<div class="data-board-box">
<p class="edit-title">数据看板</p>
<div class="p-20">
<GLCombiForm
ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
></GLCombiForm>
<div class="data-view">
<template v-for="(item,index) in dataList">
<div
:key="index"
class="item"
>
<div class="name">
{{item.name}}
<el-popover
class="tips"
placement="top"
width="260"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="@/components/glsx-combi-form/images/icon-tip.png"
/>
</el-popover>
</div>
<div class="value">{{dataBoard[item.key] || 0}}</div>
<template v-if="item.half">
<div class="half">
日环比:
<div :class="['icon',
{'up':dataBoard[item.half]>0},
{'down':dataBoard[item.half]<0}
]"></div>
<span class="num">{{Math.abs(dataBoard[item.half]).toFixed(2) || 0}}%</span>
</div>
</template>
</div>
</template>
</div>
</div>
</div>
<div class="data-board-box">
<p class="edit-title">员工排行榜</p>
<div class="p-20">
<GLCombiForm
ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<GLTable
ref="dataTableRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:hasNum="false"
>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone || '' }}</span>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import { exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
const dataList = [
{ name: '新增浏览量', key: 'browseCount', tips: '统计时间内,新增页面被浏览的次数(一人多次访问计为多次)', half: 'browseRingRatio' },
{ name: '新增访客数', key: 'fansCount', tips: '统计时间内访问页面的人数(一人多次访问计为一次)', half: 'fansRingRatio' },
{ name: '新增订单数', key: 'orderCount', tips: '统计时间内,新增订单数(只记录已付款的订单)', half: 'orderRingRatio' },
{ name: '累计浏览量', key: 'totalBrowseCount', tips: '页面被浏览的总次数(一人多次访问计为多次)' },
{ name: '累计访客数', key: 'totalFansCount', tips: '访问页面的总人数(一人多次访问计为一次)' },
{ name: '累计订单数', key: 'totalOrderCount', tips: '累计订单总数(只记录已付款的订单)' }
], optionList = [
{ confId: '1', confName: '转发次数' },
{ confId: '2', confName: '访客总数' },
{ confId: '3', confName: '浏览总数' },
{ confId: '4', confName: '成交单量' },
{ confId: '5', confName: '转化率' }
]
export default {
name: 'ScrmMicroMarketingDataBoard',
data () {
return {
url,
dataList,
searchForm: {
statDate: dayjs().format('YYYY-MM-DD')
},
searchFormData: [
{
label: '统计日期',
name: 'statDate',
type: 'datePicker',
dateType: 'date',
pickerOptions: 'beforeRangePickerOptions'
}
],
searchRankForm: {
statDimension: '1'
},
searchFormRankData: [
{
label: '统计维度',
name: 'statDimension',
type: 'select',
width: '215px',
optionList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
getListApi: this.$apis.seckillActivity.getRankListApi,
tableSearchForm: {},
tableParams: {
listName: 'list',
tableColumns: [
{
label: '排名',
prop: 'rankNumber',
},
{
label: '员工',
prop: 'shareName',
addHtml: 'shareName',
width: 220
},
{
label: '转发次数',
prop: 'shareCount',
},
{
label: '访客总数',
prop: 'fansCount',
width: 140
},
{
label: '浏览总数',
prop: 'browseCount',
},
{
label: '成交单量',
prop: 'orderCount',
},
{
label: '转化率',
prop: 'conversionRate',
formatter: cellValue => {
return `${cellValue.conversionRate.toFixed(2)}%`
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
dataBoard: {}
}
},
created () {
this.getDataBoardApi()
},
mounted () {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none'
if (rankResetBtn) rankResetBtn.style.display = 'none'
},
methods: {
getDataBoardApi () {
let { activityId } = this.$route.query,
{ statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
this.dataBoard = res || {}
})
},
getParams () {
let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm))
params.activityId = activityId
return params
},
handleSearch () {
this.getDataBoardApi()
},
handleSearchRank () {
this.$refs.dataTableRef.refreshTable()
},
handleExport () {
let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res)
})
},
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun()
}
},
};
</script>
<style lang="scss" scoped>
.data-board {
&-box {
background: #ffffff;
&:last-of-type {
margin-top: 16px;
}
.data-view {
max-width: 854px;
display: flex;
flex-wrap: wrap;
gap: 16px;
padding-bottom: 12px;
.item {
width: 274px;
height: 128px;
background: #f9fafc;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
.name {
font-size: 14px;
color: #333333;
display: flex;
align-items: center;
height: 21px;
.tips {
margin-left: 4px;
}
}
.value {
padding: 20px 0;
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: bold;
}
.half {
font-size: 14px;
color: #666666;
line-height: 21px;
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
background-image: url(../../assets/dataBoard/icon-half-default.png);
background-size: 16px 16px;
}
.up {
background-image: url(../../assets/dataBoard/icon-half-up.png);
}
.down {
background-image: url(../../assets/dataBoard/icon-half-down.png);
}
.num {
margin-left: 4px;
}
}
}
}
}
}
</style>
......@@ -9,7 +9,7 @@
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="apear != 'see'" @click="handleRelateProClose">选择商品</el-button>
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="!isDisabled" :disabled="apear == 'see'" @click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<p>
<img class="img-60" :src="selectedProInfo.goodsImage" />
......@@ -371,18 +371,22 @@ export default {
},
getGoodInfo(id) {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
if (!id) {
this.isDisabled = false
} else {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
}
},
// 规格值解构
......
<!-- 众筹活动 -->
<template>
<div v-loading="loading" class="edit-activity">
<div
v-loading="loading"
class="edit-activity"
>
<!-- 导航 -->
<el-tabs :tab-position="tabPosition" v-model="tabName" class="nav-tabs" @tab-click="whereToGo(tabName)">
<el-tab-pane label="基本信息" name="basic"></el-tab-pane>
<el-tab-pane label="活动配置" name="config"></el-tab-pane>
<el-tabs
:tab-position="tabPosition"
v-model="tabName"
class="nav-tabs"
@tab-click="whereToGo(tabName)"
>
<el-tab-pane
label="基本信息"
name="basic"
></el-tab-pane>
<el-tab-pane
label="活动配置"
name="config"
></el-tab-pane>
<el-tab-pane name="activityServices">
<span class="p-l-23" slot="label">服务说明</span>
<span
class="p-l-23"
slot="label"
>服务说明</span>
</el-tab-pane>
<el-tab-pane name="activityCommoditys">
<span class="p-l-23" slot="label">商品答疑</span>
<span
class="p-l-23"
slot="label"
>商品答疑</span>
</el-tab-pane>
<el-tab-pane name="activityExperienceDTOs">
<span class="p-l-23" slot="label">玩家心得</span>
<span
class="p-l-23"
slot="label"
>玩家心得</span>
</el-tab-pane>
<el-tab-pane name="live">
<span
class="p-l-23"
slot="label"
>直播配置</span>
</el-tab-pane>
</el-tabs>
<div class="marketing edit-box">
<!-- 基本信息 -->
<div class="container edit-container" style="min-height: 520px !important;">
<p class="edit-title" id="basic">基本信息</p>
<glsx-combi-form class="edit-form-container" ref="editFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="activityImg" class="edit-tips m-t-8">展示在首页的活动详情页</div>
<template slot="activityTimeHtml" slot-scope="scope">
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
<div
class="container edit-container"
style="min-height: 520px !important;"
>
<p
class="edit-title"
id="basic"
>基本信息</p>
<glsx-combi-form
class="edit-form-container"
ref="editFormRef"
:isEdit="true"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="editFormData"
:formRules="editRule"
>
<div
slot="activityImg"
class="edit-tips m-t-8"
>展示在首页的活动详情页</div>
<template
slot="activityTimeHtml"
slot-scope="scope"
>
<el-date-picker
v-model="editForm.activityTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']"
:disabled="isDisabled"
@change="e => handleTimeChange(e, scope.scope)"
></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button type="default" class="el-icon-plus" v-if="!isDisabled" @click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<el-button
type="default"
class="el-icon-plus"
v-if="!isDisabled"
@click="handleRelateProClose"
>选择商品</el-button>
<div
v-if="selectedProInfo.id && !specificationDetailList.length"
style="margin-top: 10px"
>
<p>
<img class="img-60" :src="selectedProInfo.goodsImage" />
<img
class="img-60"
:src="selectedProInfo.goodsImage"
/>
&nbsp;&nbsp;&nbsp; 零售价 {{ (selectedProInfo.retailPrice / 100).toFixed(2) }}元 &nbsp;&nbsp;&nbsp; 商品库存 {{ selectedProInfo.goodsStock }}件
</p>
<el-form-item label="设置秒杀价:" prop="activityPrice" id="activityPrice">
<el-input v-model="editForm.activityPrice" style="width: 150px" :disabled="isDisabled"><span slot="append">元</span></el-input>
<el-form-item
label="设置秒杀价:"
prop="activityPrice"
id="activityPrice"
>
<el-input
v-model="editForm.activityPrice"
style="width: 150px"
:disabled="isDisabled"
><span slot="append">元</span></el-input>
</el-form-item>
<el-form-item label="活动库存:" prop="goodsStock" id="goodsStock">
<el-input v-model="editForm.goodsStock" style="width: 150px" :disabled="isDisabled"><span slot="append">件</span></el-input>
<el-form-item
label="活动库存:"
prop="goodsStock"
id="goodsStock"
>
<el-input
v-model="editForm.goodsStock"
style="width: 150px"
:disabled="isDisabled"
><span slot="append">件</span></el-input>
</el-form-item>
</div>
</div>
<div slot="specificationsHtml" v-if="specificationDetailList.length" class="flex" style="min-width: 600px" id="specificationDetailList">
<div
slot="specificationsHtml"
v-if="specificationDetailList.length"
class="flex"
style="min-width: 600px"
id="specificationDetailList"
>
<div style="width: calc(100%)">
<table class="table-spesc" style="width: calc(100%)">
<table
class="table-spesc"
style="width: calc(100%)"
>
<tbody>
<tr>
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td
:style="{ width: specsWidth }"
v-for="(subItem, subIndex) in specificationDetailList"
:key="subIndex"
>{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存</td>
<td :style="{ width: specsWidth }">设置秒杀价</td>
......@@ -52,31 +152,73 @@
</tr>
</tbody>
</table>
<table class="table-spesc" style="max-height: 400px">
<table
class="table-spesc"
style="max-height: 400px"
>
<tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235)" v-for="(item, index) in nameToValSpecsList" :key="index">
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td>
<tr
style="border-bottom: 1px solid rgb(235, 235, 235)"
v-for="(item, index) in nameToValSpecsList"
:key="index"
>
<td
:style="{ width: specsWidth }"
v-for="(n, idx) in item.specsValueList"
:key="idx"
>{{ n }}</td>
<td :style="{ width: specsWidth }">{{ item.retailPrice }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="秒杀价" style="width: 90%" v-model="item.activityPrice" @input="item.activityPrice = activityPrice_input($event, item.retailPrice)"></el-input>
<el-input
:disabled="isDisabled"
placeholder="秒杀价"
style="width: 90%"
v-model="item.activityPrice"
@input="item.activityPrice = activityPrice_input($event, item.retailPrice)"
></el-input>
</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="活动库存" style="width: 90%" v-model="item.goodsStock" @input="item.goodsStock = goodsStock_input($event, item.stock)"></el-input>
<el-input
:disabled="isDisabled"
placeholder="活动库存"
style="width: 90%"
v-model="item.goodsStock"
@input="item.goodsStock = goodsStock_input($event, item.stock)"
></el-input>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<template slot="limitPurchaseFlag" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]" @change="handleIsLimit">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]" :disabled="isDisabled">{{ item[scope.scope.optionLabel] }}</el-radio>
<template
slot="limitPurchaseFlag"
slot-scope="scope"
>
<el-radio-group
v-model="editForm[scope.scope.name]"
@change="handleIsLimit"
>
<el-radio
v-for="(item, index) in scope.scope.optionList"
:key="index"
:label="item[scope.scope.optionId]"
:disabled="isDisabled"
>{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<p v-if="editForm[scope.scope.name] == 2" id="limitPurchaseNumber" style="color: #333333;">
<p
v-if="editForm[scope.scope.name] == 2"
id="limitPurchaseNumber"
style="color: #333333;"
>
每人限购
<el-form-item prop="limitPurchaseNumber">
<el-input v-model="editForm.limitPurchaseNumber" placeholder="请输入限购次数" :disabled="isDisabled"></el-input>
<el-input
v-model="editForm.limitPurchaseNumber"
placeholder="请输入限购次数"
:disabled="isDisabled"
></el-input>
</el-form-item>
件
</p>
......@@ -85,35 +227,105 @@
</div>
<!-- 活动配置 -->
<div class="container edit-container crowd-config">
<p class="edit-title" id="config">活动配置</p>
<glsx-combi-form class="edit-form-container" ref="configEditFormRef" :isEdit="true" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="configEditFormData" :formRules="editRule">
<template slot="customerServiceFlag" slot-scope="scope">
<p
class="edit-title"
id="config"
>活动配置</p>
<glsx-combi-form
class="edit-form-container"
ref="configEditFormRef"
:isEdit="true"
:isBlock="true"
:formRef="editChildRef"
:formObj="editForm"
:formData="configEditFormData"
:formRules="editRule"
>
<template
slot="customerServiceFlag"
slot-scope="scope"
>
<el-radio-group v-model="editForm[scope.scope.name]">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
<el-radio
v-for="(item, index) in scope.scope.optionList"
:key="index"
:label="item[scope.scope.optionId]"
>{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<div class="customer-service" v-if="editForm[scope.scope.name] == 2" id="customerServiceFlag">
<glsx-combi-form class="edit-form-container" ref="customerEditFormRef" :isEdit="true" :isBlock="false" :formRef="editChildRef" :formObj="editForm" :formData="customerEditFormData" :formRules="editRule"></glsx-combi-form>
<div
class="customer-service"
v-if="editForm[scope.scope.name] == 2"
id="customerServiceFlag"
>
<glsx-combi-form
class="edit-form-container"
ref="customerEditFormRef"
:isEdit="true"
:isBlock="false"
:formRef="editChildRef"
:formObj="editForm"
:formData="customerEditFormData"
:formRules="editRule"
></glsx-combi-form>
</div>
</template>
<template slot="activityMusic" slot-scope="scope">
<template
slot="activityMusic"
slot-scope="scope"
>
<div class="flex">
<div class="music-box flex-center" v-for="(item, index) in musicList" :key="index" @click="handleMusicChange(index)">
<div class="music-icon" @click.stop="handleMusic(item, index)">
<div
class="music-box flex-center"
v-for="(item, index) in musicList"
:key="index"
@click="handleMusicChange(index)"
>
<div
class="music-icon"
@click.stop="handleMusic(item, index)"
>
<div :class="[index != playObj.idx ? 'icon-start' : 'icon-stop']"></div>
<img src="@/assets/seckillActivity/icon-music-default.png" />
</div>
<div class="music-name">
<p class="ellipsis-1" style="max-width: 90%;">{{ item.name }}</p>
<p
class="ellipsis-1"
style="max-width: 90%;"
>{{ item.name }}</p>
.mp3
</div>
<img v-show="item.isCheck" :class="{ 'icon-check': item.isCheck }" src="@/assets/seckillActivity/icon-check.png" />
<img
v-show="item.isCheck"
:class="{ 'icon-check': item.isCheck }"
src="@/assets/seckillActivity/icon-check.png"
/>
</div>
</div>
<el-upload class="m-t-10" action="" accept="audio/mp3, audio/m4a" :show-file-list="false" :http-request="handleMusicUpload" :before-upload="e => handleMusicBeforeUpload(e, scope.scope)" :file-list="fileList">
<el-button class="el-icon-plus" size="small" type="default">背景音乐</el-button>
<el-upload
class="m-t-10"
action=""
accept="audio/mp3, audio/m4a"
:show-file-list="false"
:http-request="handleMusicUpload"
:before-upload="e => handleMusicBeforeUpload(e, scope.scope)"
:file-list="fileList"
>
<el-button
class="el-icon-plus"
size="small"
type="default"
>背景音乐</el-button>
</el-upload>
<audio v-if="playObj.src" style="display: none;" id="music-audio" controls>
<source type="audio/mpeg" :src="playObj.src" />
<audio
v-if="playObj.src"
style="display: none;"
id="music-audio"
controls
>
<source
type="audio/mpeg"
:src="playObj.src"
/>
</audio>
<!-- <div v-if="editForm[scope.scope.name]" class="flex">
<audio controls>
......@@ -123,123 +335,383 @@
</div> -->
</template>
<template slot="fictitious">
<div class="fictitious" id="fictitious">
<el-form-item label="参团:" prop="fictitiousGroupQuantity" labelWidth="60px">
<el-input v-model="editForm.fictitiousGroupQuantity" style="width: 90px" maxlength="50" placeholder="参团人数"></el-input>
<div
class="fictitious"
id="fictitious"
>
<el-form-item
label="参团:"
prop="fictitiousGroupQuantity"
labelWidth="60px"
>
<el-input
v-model="editForm.fictitiousGroupQuantity"
style="width: 90px"
maxlength="50"
placeholder="参团人数"
></el-input>
</el-form-item>
<el-form-item id="fictitiousLadderQuantity" label="阶梯人数:" prop="fictitiousLadderQuantity" labelWidth="90px">
<el-input v-model="editForm.fictitiousLadderQuantity" style="width: 90px" maxlength="50" placeholder="阶梯人数"></el-input>
<el-form-item
id="fictitiousLadderQuantity"
label="阶梯人数:"
prop="fictitiousLadderQuantity"
labelWidth="90px"
>
<el-input
v-model="editForm.fictitiousLadderQuantity"
style="width: 90px"
maxlength="50"
placeholder="阶梯人数"
></el-input>
</el-form-item>
<el-form-item id="fictitiousViewQuantity" label="浏览:" prop="fictitiousViewQuantity" labelWidth="60px">
<el-input v-model="editForm.fictitiousViewQuantity" style="width: 90px" maxlength="50" placeholder="浏览人数"></el-input>
<el-form-item
id="fictitiousViewQuantity"
label="浏览:"
prop="fictitiousViewQuantity"
labelWidth="60px"
>
<el-input
v-model="editForm.fictitiousViewQuantity"
style="width: 90px"
maxlength="50"
placeholder="浏览人数"
></el-input>
</el-form-item>
</div>
</template>
<div slot="activityBigImg" class="edit-tips m-t-8">建议尺寸750*1258</div>
<div slot="activityVideos" class="edit-tips m-t-8">最多上传6个视频</div>
<div slot="posterImg" class="edit-tips m-t-8">建议尺寸640*1008</div>
<div class="form-describe-box" slot="formDescribe">
<div
slot="activityBigImg"
class="edit-tips m-t-8"
>建议尺寸750*1258</div>
<div
slot="activityVideos"
class="edit-tips m-t-8"
>最多上传6个视频</div>
<div
slot="posterImg"
class="edit-tips m-t-8"
>建议尺寸640*1008</div>
<div
class="form-describe-box"
slot="formDescribe"
>
<el-checkbox-group v-model="editForm.formDescribeCheck">
<el-checkbox v-for="(item, index) in formDescribeCheckList" :label="item.value" :key="index">{{ item.label }}</el-checkbox>
<el-checkbox
v-for="(item, index) in formDescribeCheckList"
:label="item.value"
:key="index"
>{{ item.label }}</el-checkbox>
</el-checkbox-group>
<div v-for="(item, index) in formDescribeList" :key="index" class="form-describe flex-default">
<el-input class="describe-input" v-model="item.value" placeholder="请输入" maxlength="20"></el-input>
<div
v-for="(item, index) in formDescribeList"
:key="index"
class="form-describe flex-default"
>
<el-input
class="describe-input"
v-model="item.value"
placeholder="请输入"
maxlength="20"
></el-input>
<p class="describe-delete">
<img v-show="!(index == 0 && formDescribeList.length == 1)" @click="handleDescribeDelete(index)" src="@/assets/icon-delete.png" />
<img
v-show="!(index == 0 && formDescribeList.length == 1)"
@click="handleDescribeDelete(index)"
src="@/assets/icon-delete.png"
/>
</p>
</div>
<el-button class="btn-basic" v-show="formDescribeList.length < describeNum" :size="size" type="text" @click="handleDescribeAdd">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
<el-button
class="btn-basic"
v-show="formDescribeList.length < describeNum"
:size="size"
type="text"
@click="handleDescribeAdd"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
新增表单
</el-button>
</div>
<div slot="showAvatarNicknameFlag">
<el-radio-group v-model="editForm.showAvatarNicknameFlag">
<el-radio :label="1">隐藏</el-radio>
<el-radio :label="2">显示</el-radio>
</el-radio-group>
</div>
<!-- 服务说明 -->
<div slot="activityServices" id="activityServices" class="flex-default">
<span class="custom-label arrow" slot="label" @click="handleArrow('activityServices')" :style="{ width: defaultLabelWidth }">
<div
slot="activityServices"
id="activityServices"
class="flex-default"
>
<span
class="custom-label arrow"
slot="label"
@click="handleArrow('activityServices')"
:style="{ width: defaultLabelWidth }"
>
<i :class="[arrowFlagObj.activityServices == 'open' ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></i>
服务说明:
</span>
<div class="form-show-box">
<div :class="['btn-box', arrowFlagObj.activityServices == 'open' && editForm.activityServices.length ? 'line' : '']">
<el-button :class="[editForm.activityServices.length < 9 ? 'btn-basic' : 'btn-disable']" :size="size" type="text" @click="handleAddItem('services', 'activityServices', 9)">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
<el-button
:class="[editForm.activityServices.length < 9 ? 'btn-basic' : 'btn-disable']"
:size="size"
type="text"
@click="handleAddItem('services', 'activityServices', 9)"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
新增一项
</el-button>
</div>
<div :class="['form-show-block', arrowFlagObj.activityServices == 'close' ? 'form-close' : 'form-open']">
<div v-for="(item, index) in editForm.activityServices" :key="index" :class="['form-show-item', editForm.activityServices.length > index + 1 ? 'line' : '']">
<glsx-combi-form class="p-t-20" ref="serviceEditFormRef" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="item" :formData="serviceEditFormData" :formRules="serviceEditRule"></glsx-combi-form>
<el-button :class="['btn-basic', 'btn-delete', index == editForm.activityServices.length - 1 ? 'last-btn-delete' : '']" :size="size" type="text" @click="handleDeleteItem('services', 'activityServices', index)">
<img class="icon-add" src="@/assets/icon-delete.png" />
<div
v-for="(item, index) in editForm.activityServices"
:key="index"
:class="['form-show-item', editForm.activityServices.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class="p-t-20"
ref="serviceEditFormRef"
:formRef="editChildRef"
:isEdit="true"
:isBlock="true"
:formObj="item"
:formData="serviceEditFormData"
:formRules="serviceEditRule"
></glsx-combi-form>
<el-button
:class="['btn-basic', 'btn-delete', index == editForm.activityServices.length - 1 ? 'last-btn-delete' : '']"
:size="size"
type="text"
@click="handleDeleteItem('services', 'activityServices', index)"
>
<img
class="icon-add"
src="@/assets/icon-delete.png"
/>
</el-button>
</div>
</div>
</div>
</div>
<!-- 商品答疑 -->
<div slot="activityCommoditys" id="activityCommoditys" class="flex-default">
<span class="custom-label arrow" slot="label" @click="handleArrow('activityCommoditys')" :style="{ width: defaultLabelWidth }">
<div
slot="activityCommoditys"
id="activityCommoditys"
class="flex-default"
>
<span
class="custom-label arrow"
slot="label"
@click="handleArrow('activityCommoditys')"
:style="{ width: defaultLabelWidth }"
>
<i :class="[arrowFlagObj.activityCommoditys == 'open' ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></i>
商品答疑:
</span>
<div class="form-show-box">
<div :class="['btn-box', arrowFlagObj.activityCommoditys == 'open' && editForm.activityCommoditys.length ? 'line' : '']">
<el-button :class="[editForm.activityCommoditys.length < 9 ? 'btn-basic' : 'btn-disable']" :size="size" type="text" @click="handleAddItem('commoditys', 'activityCommoditys', 9)">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
<el-button
:class="[editForm.activityCommoditys.length < 9 ? 'btn-basic' : 'btn-disable']"
:size="size"
type="text"
@click="handleAddItem('commoditys', 'activityCommoditys', 9)"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
新增一项
</el-button>
</div>
<div :class="['form-show-block', arrowFlagObj.activityCommoditys == 'close' ? 'form-close' : 'form-open']">
<div v-for="(item, index) in editForm.activityCommoditys" :key="index" :class="['form-show-item', editForm.activityCommoditys.length > index + 1 ? 'line' : '']">
<glsx-combi-form class="p-t-20" ref="commoditysEditFormRef" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="item" :formData="commoditysEditFormData" :formRules="commoditysEditRule"></glsx-combi-form>
<el-button :class="['btn-basic', 'btn-delete', index == editForm.activityCommoditys.length - 1 ? 'last-btn-delete' : '']" :size="size" type="text" @click="handleDeleteItem('commoditys', 'activityCommoditys', index)">
<img class="icon-add" src="@/assets/icon-delete.png" />
<div
v-for="(item, index) in editForm.activityCommoditys"
:key="index"
:class="['form-show-item', editForm.activityCommoditys.length > index + 1 ? 'line' : '']"
>
<glsx-combi-form
class="p-t-20"
ref="commoditysEditFormRef"
:formRef="editChildRef"
:isEdit="true"
:isBlock="true"
:formObj="item"
:formData="commoditysEditFormData"
:formRules="commoditysEditRule"
></glsx-combi-form>
<el-button
:class="['btn-basic', 'btn-delete', index == editForm.activityCommoditys.length - 1 ? 'last-btn-delete' : '']"
:size="size"
type="text"
@click="handleDeleteItem('commoditys', 'activityCommoditys', index)"
>
<img
class="icon-add"
src="@/assets/icon-delete.png"
/>
</el-button>
</div>
</div>
</div>
</div>
<!-- 玩家心得 -->
<div slot="activityExperienceDTOs" id="activityExperienceDTOs" class="flex-default">
<span class="custom-label arrow" slot="label" @click="handleArrow('activityExperienceDTOs')" :style="{ width: defaultLabelWidth }">
<div
slot="activityExperienceDTOs"
id="activityExperienceDTOs"
class="flex-default"
>
<span
class="custom-label arrow"
slot="label"
@click="handleArrow('activityExperienceDTOs')"
:style="{ width: defaultLabelWidth }"
>
<i :class="[arrowFlagObj.activityExperienceDTOs == 'open' ? 'el-icon-caret-bottom' : 'el-icon-caret-right']"></i>
玩家心得:
</span>
<div class="form-show-box">
<div :class="['btn-box', arrowFlagObj.activityExperienceDTOs == 'open' && editForm.activityExperienceDTOs.length ? 'line' : '']">
<el-button :class="[editForm.activityExperienceDTOs.length < 9 ? 'btn-basic' : 'btn-disable']" :size="size" type="text" @click="handleAddItem('experiences', 'activityExperienceDTOs', 9)">
<img class="icon-add" src="@/assets/seckillActivity/icon-add.png" />
<el-button
:class="[editForm.activityExperienceDTOs.length < 9 ? 'btn-basic' : 'btn-disable']"
:size="size"
type="text"
@click="handleAddItem('experiences', 'activityExperienceDTOs', 9)"
>
<img
class="icon-add"
src="@/assets/seckillActivity/icon-add.png"
/>
新增一项
</el-button>
</div>
<div :class="['form-show-block', arrowFlagObj.activityExperienceDTOs == 'close' ? 'form-close' : 'form-open']">
<div v-for="(item, index) in editForm.activityExperienceDTOs" :key="index" :class="['form-show-item', editForm.activityExperienceDTOs.length > index + 1 ? 'line' : '']">
<div
v-for="(item, index) in editForm.activityExperienceDTOs"
:key="index"
:class="['form-show-item', editForm.activityExperienceDTOs.length > index + 1 ? 'line' : '']"
>
<div class="head-box">
<img class="icon-head" src="@/assets/seckillActivity/icon-default-head.png" />
<img
class="icon-head"
src="@/assets/seckillActivity/icon-default-head.png"
/>
<span>虚拟人物{{ index + 1 }}</span>
</div>
<glsx-combi-form class="p-t-20" :formRef="editChildRef" :isEdit="true" :isBlock="true" :formObj="item" :formData="experiencesEditFormData" :formRules="editRule">
<div slot="activityExperienceImgs" class="edit-tips m-t-8">建议尺寸:图片大小不超过5m,最多可添加9张图片</div>
<glsx-combi-form
class="p-t-20"
:formRef="editChildRef"
:isEdit="true"
:isBlock="true"
:formObj="item"
:formData="experiencesEditFormData"
:formRules="editRule"
>
<div
slot="activityExperienceImgs"
class="edit-tips m-t-8"
>建议尺寸:图片大小不超过5m,最多可添加9张图片</div>
</glsx-combi-form>
<el-button :class="['btn-basic', 'btn-delete', index == editForm.activityExperienceDTOs.length - 1 ? 'last-btn-delete' : '']" :size="size" type="text" @click="handleDeleteItem('experiences', 'activityExperienceDTOs', index)">
<img class="icon-add" src="@/assets/icon-delete.png" />
<el-button
:class="['btn-basic', 'btn-delete', index == editForm.activityExperienceDTOs.length - 1 ? 'last-btn-delete' : '']"
:size="size"
type="text"
@click="handleDeleteItem('experiences', 'activityExperienceDTOs', index)"
>
<img
class="icon-add"
src="@/assets/icon-delete.png"
/>
</el-button>
</div>
</div>
</div>
</div>
<!-- 直播配置 -->
<div slot="live">
<el-switch v-model="editForm.liveFlag"></el-switch>
<div
class="customer-service"
v-if="editForm.liveFlag"
id="liveFlag"
>
<glsx-combi-form
class="edit-form-container"
ref="liveEditFormRef"
:formRef="editChildRef"
:isEdit="true"
:isBlock="false"
:formObj="editForm"
:formData="liveEditFormData"
:formRules="liveEditRule"
>
<div
slot="groupQrCode"
class="edit-tips m-t-8"
>建议尺寸:284*284</div>
<div
v-if="!editForm.floatingMaskDiagram"
slot="defaultImg"
class="default-live-img"
>
<img :src="defaultFloatingMaskDiagram" />
</div>
<div
slot="floatingMaskDiagram"
class="edit-tips m-t-8"
>建议格式:GIF,尺寸228*346</div>
</glsx-combi-form>
</div>
</div>
</glsx-combi-form>
</div>
<GLFooter>
<el-button @click="handleCancel" size="medium">{{ routeInfo.addOrEdit != 'detail' ? '取消' : '返回' }}</el-button>
<el-button @click="handleWechat" size="medium">预览</el-button>
<el-button v-if="routeInfo.addOrEdit != 'detail'" type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
<el-button
@click="handleCancel"
size="medium"
>{{ routeInfo.addOrEdit != 'detail' ? '取消' : '返回' }}</el-button>
<el-button
@click="handleWechat"
size="medium"
>预览</el-button>
<el-button
v-if="routeInfo.addOrEdit != 'detail'"
type="primary"
@click="handleConfirm"
size="medium"
:loading="loading"
>提交</el-button>
</GLFooter>
<!-- 展示 -->
<GLDialog bigTitle="预览" mode="big" :visible.sync="wechatVisible" @onOk="handleWechat" @onCancel="handleWechat">
<crowdEditWechat ref="crowdEditWechat" :editForm="editForm" :countDownObj="countDownObj"></crowdEditWechat>
<GLDialog
bigTitle="预览"
mode="big"
:visible.sync="wechatVisible"
@onOk="handleWechat"
@onCancel="handleWechat"
>
<crowdEditWechat
ref="crowdEditWechat"
:editForm="editForm"
:countDownObj="countDownObj"
></crowdEditWechat>
</GLDialog>
<select-single-pro-dialog v-if="isSingleSelectVisible" :isSingleSelectVisible="isSingleSelectVisible" :selectedProInfo="selectedProInfo" @handleSingleSelectConfirm="handleSingleSelectConfirm" @handleSingleSelectClose="handleSingleSelectClose(true)"></select-single-pro-dialog>
<select-single-pro-dialog
v-if="isSingleSelectVisible"
:isSingleSelectVisible="isSingleSelectVisible"
:selectedProInfo="selectedProInfo"
@handleSingleSelectConfirm="handleSingleSelectConfirm"
@handleSingleSelectClose="handleSingleSelectClose(true)"
></select-single-pro-dialog>
</div>
</div>
</template>
......@@ -252,7 +724,7 @@ export default {
components: {
crowdEditWechat
},
data() {
data () {
var validatorPhone = function (rule, value, callback) {
if (value && !/^(0|86|17951)?(13[0-9]|15[0123456789]|17[678]|18[0-9]|14[57])[0-9]{8}$/.test(value)) {
callback(new Error('手机号格式错误'))
......@@ -273,7 +745,7 @@ export default {
// },
routeInfo: {
// 1-新增;2-编辑;3-查看
// add-新增;edit-编辑;detail-详情
// add-新增;edit-编辑;detail-详情;copy-复制
addOrEdit: 'add',
id: '',
activityStatus: ''
......@@ -341,13 +813,19 @@ export default {
// 1-否,2-是
selectCarNumberFlag: 2,
selectVehicleTypeFlag: 2,
formDescribeCheck: ['selectCarNumberFlag', 'selectVehicleTypeFlag'],
selectPhoneNumberFlag: 2,
formDescribeCheck: ['selectCarNumberFlag', 'selectVehicleTypeFlag', 'selectPhoneNumberFlag'],
activityServices: [],
activityCommoditys: [],
activityExperienceDTOs: []
activityExperienceDTOs: [],
// formDescribeFirst: '',
// formDescribeSecond: '',
// formDescribeThird: ''
// formDescribeThird: '',
showAvatarNicknameFlag: 1,
liveFlag: false,
liveBroadcastRoomId: '',
groupQrCode: '',
floatingMaskDiagram: ''
},
//商品列表
tableParams: {
......@@ -429,6 +907,10 @@ export default {
{
label: '品牌车型',
value: 'selectVehicleTypeFlag'
},
{
label: '手机号',
value: 'selectPhoneNumberFlag'
}
],
describeNum: 2,
......@@ -805,7 +1287,8 @@ export default {
name: 'activityDetail',
tips: '展示活动的详细内容',
type: 'textBox',
excludeMenus: ['video', 'code']
excludeMenus: ['video', 'code'],
boxHeight: 240
},
{
label: '音乐文件',
......@@ -862,6 +1345,11 @@ export default {
addHtml: 'formDescribe'
},
{
label: '头像昵称',
name: 'showAvatarNicknameFlag',
addHtml: 'showAvatarNicknameFlag'
},
{
label: '',
name: 'activityServices',
addHtml: 'activityServices',
......@@ -876,12 +1364,89 @@ export default {
label: '',
name: 'activityExperienceDTOs',
addHtml: 'activityExperienceDTOs'
},
{
label: '直播配置',
name: 'live',
addHtml: 'live'
}
]
],
//直播配置
liveEditFormData: [
{
label: '选择直播',
name: 'liveBroadcastRoomId',
type: 'select',
tips: '暂无直播,请到运营平台直播间管理创建新的直播',
maxlength: 30,
optionLabel: 'label',
optionId: 'value',
optionList: []
},
{
label: '加群二维码',
name: 'groupQrCode',
type: 'upload',
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
suffixSlot: 'groupQrCode',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common
.uploadImgApi({ file: base64, fileType: 'image' })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
}
},
{
label: '运营浮窗动图',
name: 'floatingMaskDiagram',
type: 'upload',
width: '320px',
limitSize: 5,
maxPhotoNum: 1,
supportGif: true,
prefixSlot: 'defaultImg',
suffixSlot: 'floatingMaskDiagram',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result,
target = file.type == 'image/gif' ? 'uploadVideoApi' : 'uploadImgApi'
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.loading = true
this.$apis.common[target]({ file: base64 })
.then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef.$refs[this.editChildRef].validateField(targetItem.name)
})
.finally(() => {
this.loading = false
})
}
}
],
liveEditRule: {
liveBroadcastRoomId: [{ required: true, message: '请选择直播', trigger: 'change' }],
groupQrCode: [{ required: true, message: '请选择加群二维码', trigger: 'change' }],
floatingMaskDiagram: [{
required: true, validator: (rule, value, callback) => {
callback()
}
}]
},
defaultFloatingMaskDiagram: 'https://wx.glsx.com.cn/upload/biz/ba63349f-8e9e-4e80-be3b-45cc38dcf13f.gif'
}
},
mounted() {
mounted () {
this.getLiveList()
this.setMinHeight('.crowd-config')
this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : this.getMerchantInfo()
......@@ -905,42 +1470,45 @@ export default {
watch: {
editForm: {
handler(val) {
handler (val) {
this.editStatus = true
},
deep: true
},
'editForm.activityPrice'(newValue, oldValue) {
'editForm.activityPrice' (newValue, oldValue) {
this.editForm.activityPrice = limitPrice(newValue, oldValue, 5, 2, 0)
},
'editForm.goodsStock'(newValue, oldValue) {
'editForm.goodsStock' (newValue, oldValue) {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 5, 0, 0)
},
'editForm.activityTime'(newValue) {
'editForm.activityTime' (newValue) {
newValue && newValue.length && this.countDown()
},
'editForm.predictVolume'(newValue, oldValue) {
'editForm.predictVolume' (newValue, oldValue) {
this.editForm.predictVolume = limitPrice(newValue, oldValue, 7, 2, 0, 1000000)
},
'editForm.fictitiousGroupQuantity'(newValue, oldValue) {
'editForm.fictitiousGroupQuantity' (newValue, oldValue) {
this.editForm.fictitiousGroupQuantity = limitPrice(newValue, oldValue, 3, 0, 0, 100)
},
'editForm.fictitiousLadderQuantity'(newValue, oldValue) {
'editForm.fictitiousLadderQuantity' (newValue, oldValue) {
this.editForm.fictitiousLadderQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
},
'editForm.fictitiousViewQuantity'(newValue, oldValue) {
'editForm.fictitiousViewQuantity' (newValue, oldValue) {
this.editForm.fictitiousViewQuantity = limitPrice(newValue, oldValue, 7, 0, 0)
},
'editForm.liveBroadcastRoomId' (newValue, oldValue) {
this.editForm.liveFlag = newValue ? true : false
}
},
methods: {
changeFormAttr(formName, attrName, labelList, attrValue) {
changeFormAttr (formName, attrName, labelList, attrValue) {
labelList.forEach(item => {
let idx = this[formName].findIndex(k => k.label == item)
this[formName][idx][attrName] = attrValue
})
},
limitPriceForInput(val, intergerDigit, pointDigit, minValue, maxValue, regRule) {
limitPriceForInput (val, intergerDigit, pointDigit, minValue, maxValue, regRule) {
var _regRule = regRule || 'priceReg'
if (val && this.reg[_regRule].test(val + '')) {
maxValue = typeof maxValue == 'string' ? parseFloat(maxValue) : maxValue
......@@ -964,12 +1532,12 @@ export default {
}
},
addZero(i) {
addZero (i) {
return i < 10 ? `0${i}` : `${i}`
},
findCountDownTime() {
findCountDownTime () {
let startTime = new Date(this.editForm.activityTime[0])
let endTime = new Date(this.editForm.activityTime[1])
let currentTime = new Date()
......@@ -982,7 +1550,7 @@ export default {
}
},
countDown() {
countDown () {
if (this.editForm.activityTime && this.editForm.activityTime.length) {
let { activityStatus, startTime, endTime } = this.findCountDownTime()
let lefttime = parseInt((endTime.getTime() - startTime.getTime()) / 1000)
......@@ -1021,25 +1589,25 @@ export default {
}
},
handleTimeChange(value, targetItem) {
handleTimeChange (value, targetItem) {
!value && (this.editForm[targetItem.name] = [])
},
handleIsLimit(val) {
handleIsLimit (val) {
this.editForm.limitPurchaseNumber = val == 1 ? '' : '1'
this.editRule.limitPurchaseNumber[0].required = val != 1
},
handleRelateProChange(val) {
handleRelateProChange (val) {
this.editRule.goodsId[0].required = val == 2
var idx = this.editFormData.findIndex(item => item.name == 'goodsId')
this.editFormData[idx].isHide = val != 2
},
handleRelateProClose(targetItem) {
handleRelateProClose (targetItem) {
this.selectedProInfo = this.editForm.goodsId ? { id: this.editForm.goodsId } : {}
this.handleSingleSelectClose()
},
handleSingleSelectConfirm(selectedProInfo) {
handleSingleSelectConfirm (selectedProInfo) {
this.editForm.activityPrice = ''
this.editForm.goodsStock = ''
this.handleSingleSelectClose()
......@@ -1048,15 +1616,16 @@ export default {
this.getGoodInfo(selectedProInfo.id)
}
},
handleSingleSelectClose(isCancel = false) {
handleSingleSelectClose (isCancel = false) {
if (isCancel) {
this.selectedProInfo.id && this.getGoodInfo(this.selectedProInfo.id)
}
this.isSingleSelectVisible = !this.isSingleSelectVisible
},
getGoodInfo(id) {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
getGoodInfo (id) {
if (!id) this.isDisabled = false
else this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
......@@ -1068,10 +1637,11 @@ export default {
this.specificationDetailList = []
}
})
},
// 规格值解构
changeSpecs(isRecovery) {
changeSpecs (isRecovery) {
this.specsWidth = 100 / (this.specificationDetailList.length + 4) + '%'
this.nameToValSpecsList = []
var markIdx = 0
......@@ -1140,7 +1710,7 @@ export default {
}
// console.log(this.nameToValSpecsList)
},
setLocaleCompare(params) {
setLocaleCompare (params) {
let keys = []
let obj = []
Object.keys(params).forEach(item => {
......@@ -1153,24 +1723,24 @@ export default {
return obj.join('&').replace(/,/g, '-')
},
// 恢复规格值
recoverySpec() {
recoverySpec () {
this.changeSpecs(true)
},
//规格-秒杀价输入控制
activityPrice_input(val, maxValue) {
activityPrice_input (val, maxValue) {
return this.limitPriceForInput(val, 5, 2, 0, maxValue)
},
//规格-活动库存输入控制
goodsStock_input(val, maxValue) {
goodsStock_input (val, maxValue) {
return this.limitPriceForInput(val, 5, 0, 0, maxValue)
},
// 音乐
handleMusicUpload() { },
handleMusicUpload () { },
musicUpload(e, targetItem) {
musicUpload (e, targetItem) {
var reader = new FileReader()
var file = e
// 默认1MB
......@@ -1209,7 +1779,7 @@ export default {
},
// 音乐
handleMusic(targetItem, idx) {
handleMusic (targetItem, idx) {
// stop-音频结束;play-音频播放
var playFlag = this.playObj.idx != -1 && this.playObj.idx == idx ? 'stop' : 'play'
var audioDom = document.getElementById('music-audio')
......@@ -1229,12 +1799,12 @@ export default {
})
},
stopMusic() {
stopMusic () {
this.playObj.idx = -1
this.playObj.src = ''
},
handleMusicChange(idx) {
handleMusicChange (idx) {
this.musicList.forEach((item, index) => {
if (index != idx) {
item.isCheck = false
......@@ -1244,23 +1814,23 @@ export default {
this.editForm.activityMusic = this.musicList[idx].isCheck ? this.musicList[idx].addr : ''
},
handleMusicBeforeUpload(file, targetItem) {
handleMusicBeforeUpload (file, targetItem) {
this.stopMusic()
this.musicUpload(file, targetItem)
},
handleMusicDelete(targetItem) {
handleMusicDelete (targetItem) {
this.$set(this.editForm, targetItem.name, '')
this.fileList = []
},
// 表单设置
handleDescribeAdd() {
handleDescribeAdd () {
this.formDescribeList.push({
value: ''
})
},
handleDescribeDelete(idx) {
handleDescribeDelete (idx) {
this.$messageBox.confirm('是否删除该表单设置?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -1273,13 +1843,13 @@ export default {
})
},
listAddIdx(list) {
listAddIdx (list) {
list.forEach((item, index) => {
item.idx = index
})
},
dealItem(attr, formAttr) {
dealItem (attr, formAttr) {
switch (attr) {
case 'services':
break
......@@ -1292,7 +1862,7 @@ export default {
},
// 服务说明,商品答疑,玩家心得
handleAddItem(attr, formAttr, limitNum) {
handleAddItem (attr, formAttr, limitNum) {
if (this.editForm[formAttr].length >= limitNum) {
return true
}
......@@ -1301,7 +1871,7 @@ export default {
this.dealItem(attr, formAttr)
},
handleDeleteItem(attr, formAttr, idx) {
handleDeleteItem (attr, formAttr, idx) {
this.$confirm('是否删除该项?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -1315,7 +1885,7 @@ export default {
})
},
getMerchantInfo() {
getMerchantInfo () {
this.loading = true
let merchantId = this.$globalState.session.merchantId
this.$apis.common
......@@ -1344,7 +1914,7 @@ export default {
})
},
getInfo() {
getInfo () {
this.loading = true
this.$apis.seckillActivity
.getActivityDetailApi({ id: this.routeInfo.id })
......@@ -1353,7 +1923,7 @@ export default {
this.editForm = this.$common.utils.deepClone(res)
this.activityInfo = info
this.$set(this.editForm, 'activityTime', [info.startTime, info.endTime])
this.getGoodInfo(info.goodsId)
this.routeInfo.addOrEdit == 'edit' && this.getGoodInfo(info.goodsId)
if (info.activityPrice != null && info.goodsStock != null) {
this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
this.editForm.goodsStock = info.goodsStock + ''
......@@ -1395,7 +1965,8 @@ export default {
this.editForm.formDescribeCheck = []
this.editForm.selectCarNumberFlag = this.editForm.selectCarNumberFlag || 1
this.editForm.selectVehicleTypeFlag = this.editForm.selectVehicleTypeFlag || 1
var checkList = ['selectCarNumberFlag', 'selectVehicleTypeFlag']
this.editForm.selectPhoneNumberFlag = this.editForm.selectPhoneNumberFlag || 1
var checkList = ['selectCarNumberFlag', 'selectVehicleTypeFlag', 'selectPhoneNumberFlag']
checkList.forEach(item => {
if (this.editForm[item] == 2) {
this.editForm.formDescribeCheck.push(item)
......@@ -1420,6 +1991,11 @@ export default {
item.activityExperienceImgs = item.activityExperienceImgs.map(item => item.imageUrl)
})
}
// 复制
if (this.routeInfo.addOrEdit == 'copy') {
let resetArr = [{ name: 'id' }, { name: 'activityTime', type: 'array' }, { name: 'liveBroadcastRoomId' }, { name: 'groupQrCode' }, { name: 'floatingMaskDiagram' }, { name: 'selectedProInfo', type: 'Object' }, { name: 'goodsId' }, { name: 'activityPrice' }, { name: 'goodsStock' }]
this.copyReset(resetArr)
}
this.$nextTick(() => {
this.editStatus = false
})
......@@ -1429,7 +2005,18 @@ export default {
})
},
validateRules() {
copyReset (arr) {
let val = {
array: [],
Object: {},
'': ''
}[arr.type || '']
arr.forEach(item => {
this.editForm[item.name] = val
})
},
validateRules () {
if (this.specificationDetailList.length) {
this.editRule.activityPrice[0].required = false
this.editRule.goodsStock[0].required = false
......@@ -1439,12 +2026,12 @@ export default {
}
},
getCouponInfoParams() {
getCouponInfoParams () {
var _this = this
var param = this.$common.utils.deepClone(this.editForm)
param.marketingType = 3
param.activityPrice = (param.activityPrice * 100).toFixed(0) //存的分,需乘100
if (this.routeInfo.id) {
if (this.routeInfo.id && this.routeInfo.addOrEdit != 'copy') {
param.id = this.routeInfo.id
}
const d = param.activityTime
......@@ -1484,29 +2071,38 @@ export default {
// 1-否,2-是
param.selectCarNumberFlag = param.formDescribeCheck.findIndex(item => item == 'selectCarNumberFlag') != -1 ? 2 : 1
param.selectVehicleTypeFlag = param.formDescribeCheck.findIndex(item => item == 'selectVehicleTypeFlag') != -1 ? 2 : 1
param.selectPhoneNumberFlag = param.formDescribeCheck.findIndex(item => item == 'selectPhoneNumberFlag') != -1 ? 2 : 1
delete param.formDescribeCheck
Object.values(this.describeIdxToAttr).forEach((item, idx) => {
param['formDescribe' + item] = this.formDescribeList.length > idx ? this.formDescribeList[idx].value : ''
})
//直播
if (param.liveFlag) {
if (!param.floatingMaskDiagram) param.floatingMaskDiagram = this.defaultFloatingMaskDiagram
} else {
param.liveBroadcastRoomId = ''
param.groupQrCode = ''
param.floatingMaskDiagram = ''
}
delete param.liveFlag
return param
},
// 服务说明
handleArrow(attr) {
handleArrow (attr) {
this.arrowFlagObj[attr] = this.arrowFlagObj[attr] == 'open' ? 'close' : 'open'
},
handleWechat() {
handleWechat () {
this.wechatVisible = !this.wechatVisible
},
// 跳转
whereToGo(id) {
whereToGo (id) {
document.getElementById(id).scrollIntoView()
},
checkValid(validList) {
checkValid (validList) {
for (let i = 0; i < validList.length; i++) {
let item = validList[i]
if (item.valid) {
......@@ -1517,10 +2113,9 @@ export default {
return true
},
addOrUpdate() {
addOrUpdate () {
this.loading = true
var params = this.getCouponInfoParams()
this.$apis.seckillActivity
.addOrUpdateActivityApi(params)
.then(res => {
......@@ -1538,7 +2133,7 @@ export default {
},
// 去掉list空值
delListAllEmpty(listName, attrParamsList) {
delListAllEmpty (listName, attrParamsList) {
if (!this.editForm[listName].length) {
return this.editForm[listName]
}
......@@ -1561,7 +2156,7 @@ export default {
return list
},
handleConfirm() {
handleConfirm () {
this.stopMusic()
this.editForm.activityServices = this.delListAllEmpty('activityServices', ['title', 'content'])
this.editForm.activityCommoditys = this.delListAllEmpty('activityCommoditys', ['question', 'answer'])
......@@ -1622,6 +2217,14 @@ export default {
})
})
}
if (this.$refs.liveEditFormRef) {
this.$refs.liveEditFormRef.$refs[this.editChildRef].validate((liveValid, liveErrorObj) => {
if (!liveValid) {
validFlag = false
this.whereToGo('liveFlag')
}
})
}
if (this.$refs.commoditysEditFormRef) {
this.$refs.commoditysEditFormRef.forEach(item => {
item.$refs[this.editChildRef].validate((commoditysValid, commoditysErrorObj) => {
......@@ -1643,12 +2246,12 @@ export default {
})
})
},
cancelJump() {
cancelJump () {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
handleCancel() {
handleCancel () {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
......@@ -1662,7 +2265,23 @@ export default {
} else {
this.cancelJump()
}
}
},
//获取跟进员工
getLiveList () {
this.$apis.seckillActivity.getLiveListApi({}).then(res => {
if (res.length == 0) return ''
const index = this.liveEditFormData.findIndex(item => {
return item.name == 'liveBroadcastRoomId'
})
const staff = res.map(item => {
return {
label: item.name + ' - ' + item.code,
value: item.id
}
})
this.liveEditFormData.find(item => item.name == 'liveBroadcastRoomId').optionList = staff
})
},
}
}
</script>
......@@ -1893,6 +2512,29 @@ export default {
width: auto !important;
}
}
.el-switch {
.el-switch__core {
width: 44px !important;
&::before {
content: '关';
right: 8px;
color: #999;
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 12px;
}
}
}
.el-switch.is-checked {
.el-switch__core {
&::before {
content: '开';
left: 8px;
color: #fff;
}
}
}
}
::-webkit-scrollbar {
......@@ -1906,4 +2548,46 @@ export default {
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
.default-live-img {
width: 80px;
height: 80px;
border: 1px solid #e5e5e5;
display: inline-block;
border-radius: 4px;
cursor: pointer;
margin-right: 8px;
position: relative;
&::after {
position: absolute;
right: 0;
left: 0;
width: 59px;
height: 22px;
line-height: 22px;
text-align: center;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0 4px 0;
font-size: 14px;
color: #ffffff;
content: '默认gif';
}
img {
width: 100%;
height: 100%;
vertical-align: top;
}
& ~ div {
position: absolute;
left: 88px;
top: 0;
.muti-imgs {
margin: 0;
}
}
& ~ .edit-tips {
display: block;
position: relative;
left: 0;
}
}
</style>
......@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`]
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`, 'https://webapi.amap.com/loader.js']
}
module.exports = {
outputDir: `../dist/${packageName}`,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!