Commit 5c8f7385 by chenwq

众筹

1 parent 9db2d132
......@@ -35,6 +35,17 @@ const getBrowseListApi = params => {
})
}
// 分页浏览-导出
const exportBrowseApi = params => {
params.method = 'scrm.api.shopmall.customer.browse.records.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//创建/编辑活动
const addOrUpdateActivityApi = params => {
params.method = `${defaultPath}add.or.update`
......@@ -105,4 +116,15 @@ const getSharedApi = params => {
})
}
export default { getActivityPageApi, getCrowdfundListApi, getBrowseListApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi }
// 众筹-分享
const getCrowdSharedApi = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.get.shared'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi }
......@@ -79,9 +79,9 @@
<textBox v-else-if="item.type === 'textBox'" :ref="item.name + 'TextBox'" @change="e => handleTextBoxChange(e, item)" @forbid="forbidEdit"></textBox>
<!-- 地图 -->
<div v-else-if="item.type === 'map'" class="flex">
<Province ref="provinceForm" :subdistrict="subdistrict" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"></Province>
<el-input class="input-width" v-model="formObj[item.name]" placeholder="请选择商户地址" readonly="readonly"></el-input>
<el-button @click="handleSelectMap(item)" type="primary">选择地址</el-button>
<Province ref="provinceForm" :subdistrict="subdistrict" :isDisabled="item.isDisabled" @selectProvince="e => handleSelectProvince(e, item)" @selectCity="e => handleSelectCity(e, item)"></Province>
<el-input class="input-width" v-model="formObj[item.name]" placeholder="请选择商户地址" :disabled="item.isDisabled"></el-input>
<el-button v-show="!item.isDisabled" @click="handleSelectMap(item)" type="primary">选择地址</el-button>
</div>
</el-form-item>
</template>
......@@ -265,6 +265,10 @@ export default {
handleTextBoxChange(val, targetItem) {
this.formObj[targetItem.name] = val
},
// 禁用富文本
forbidEdit() {
this.$refs.textBox.forbidEdit()
},
// 地图
handleSelectMap(targetItem) {
this.targetItem = targetItem
......@@ -278,7 +282,6 @@ export default {
})
},
getAddress() {
console.log(this.$refs.mapForm)
let mapInfo = this.$refs.mapForm
if (!mapInfo.address) {
this.$message({
......
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province">
<el-select size="small" v-model="provinceForm.provinceName" clearable placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
......@@ -31,6 +31,10 @@ export default {
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
......
......@@ -49,6 +49,7 @@
<div class="choseItem" :class="{ active: currentIndex == index + 1 }" v-for="(item, index) in choseList" :key="index" @click="tabClick(index + 1)">
{{ item }}
</div>
<el-button :size="size" class="default-blue-btn m-l-20" type="default" @click="handleExport">导出</el-button>
</div>
<GLTable ref="memberOrderRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="orderType" slot-scope="scope" style="width: 200px">
......@@ -435,8 +436,8 @@ export default {
display: flex;
height: auto;
position: relative;
width: 285px;
left: calc(100% - 285px);
width: 367px;
left: calc(100% - 367px);
.choseItem {
display: inline-block;
cursor: pointer;
......
......@@ -7,6 +7,11 @@
<div class="p-20">
<GLCombiForm ref="showSearch" class="p-t-20" :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>
<!-- 表格区域 开始 -->
<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">
......@@ -36,6 +41,7 @@
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
......@@ -121,6 +127,15 @@ export default {
})
},
handleExport() {
var params = this.$common.utils.deepClone(this.searchForm)
params.pageNum = 1
params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params).then(res => {
exportFn(res)
})
},
handleJump(path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
......@@ -138,6 +153,7 @@ export default {
handleReset() {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
mobile: ''
}
......
......@@ -103,9 +103,7 @@ export default {
},
{
type: 'GLButton',
name: row => {
return row.activityStatus == '1' ? '编辑' : '查看'
},
name: '编辑',
attrs: {
type: 'text',
fn: '编辑众筹'
......@@ -115,12 +113,13 @@ export default {
},
listeners: {
click: row => {
var editOrDetail = {
1: 'edit',
2: 'detail',
3: 'detail'
}[row.activityStatus]
return this.handleEdit(editOrDetail, row)
// var editOrDetail = {
// 1: 'edit',
// 2: 'detail',
// 3: 'detail'
// }[row.activityStatus]
// return this.handleEdit(editOrDetail, row)
this.handleEdit('edit', row)
}
}
},
......@@ -354,7 +353,10 @@ export default {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动')
}
addOrEdit != 'add' && (params.id = row.id)
if (addOrEdit != 'add') {
params.id = row.id
params.activityStatus = row.activityStatus
}
this.$router.push({
path: '/seckillActivity/editCrowdFund',
query: params
......@@ -383,7 +385,7 @@ export default {
// },
handleShare(row) {
this.$apis.seckillActivity.getSharedApi({ id: row.id }).then(res => {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
......
......@@ -10,7 +10,7 @@
<el-date-picker style="width: 474px" 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" clearable></el-date-picker>
</template>
<div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="routeInfo.addOrEdit != 'detail'" @click="handleRelateProClose">选择商品</el-button>
<el-button type="default" class="default-blue-btn 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" />
......@@ -72,7 +72,7 @@
<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]" @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 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="serviceEditFormRef" :isEdit="true" :isBlock="false" :formRef="editChildRef" :formObj="editForm" :formData="serviceEditFormData" :formRules="editRule"></glsx-combi-form>
......@@ -81,13 +81,13 @@
<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" :disabled="isDisabled" placeholder="参团人数"></el-input>
<el-input v-model="editForm.fictitiousGroupQuantity" style="width: 90px" maxlength="50" placeholder="参团人数"></el-input>
</el-form-item>
<el-form-item label="阶梯人数:" prop="fictitiousLadderQuantity" labelWidth="90px">
<el-input v-model="editForm.fictitiousLadderQuantity" style="width: 90px" maxlength="50" :disabled="isDisabled" placeholder="阶梯人数"></el-input>
<el-input v-model="editForm.fictitiousLadderQuantity" style="width: 90px" maxlength="50" placeholder="阶梯人数"></el-input>
</el-form-item>
<el-form-item label="浏览:" prop="fictitiousViewQuantity" labelWidth="60px">
<el-input v-model="editForm.fictitiousViewQuantity" style="width: 90px" maxlength="50" :disabled="isDisabled" placeholder="浏览人数"></el-input>
<el-input v-model="editForm.fictitiousViewQuantity" style="width: 90px" maxlength="50" placeholder="浏览人数"></el-input>
</el-form-item>
</div>
</template>
......@@ -95,11 +95,9 @@
<div slot="activityVideos" class="edit-tips m-t-8">最多上传六个视频</div>
<div slot="posterImg" class="edit-tips m-t-8">建议尺寸640*1008</div>
<div class="form-describe flex-default" slot="formDescribe" v-for="(item, index) in formDescribeList" :key="index">
<el-input class="describe-input" v-model="item.value" placeholder="请输入" maxlength="20" clearable :disabled="isDisabled"></el-input>
<p v-if="!isDisabled">
<el-button class="describe-delete" v-show="index != formDescribeList.length - 1 || index == describeNum - 1" icon="el-icon-delete" type="text" @click="handleDescribeDelete(index)"></el-button>
<el-button v-show="index == formDescribeList.length - 1 && formDescribeList.length < describeNum" :size="size" type="default" class="default-blue-btn el-icon-plus" @click="handleDescribeAdd">新增</el-button>
</p>
<el-input class="describe-input" v-model="item.value" placeholder="请输入" maxlength="20" clearable></el-input>
<el-button class="describe-delete" v-show="index != formDescribeList.length - 1 || index == describeNum - 1" icon="el-icon-delete" type="text" @click="handleDescribeDelete(index)"></el-button>
<el-button v-show="index == formDescribeList.length - 1 && formDescribeList.length < describeNum" :size="size" type="default" class="default-blue-btn el-icon-plus" @click="handleDescribeAdd">新增</el-button>
</div>
</glsx-combi-form>
</div>
......@@ -141,7 +139,8 @@ export default {
// 1-新增;2-编辑;3-查看
// add-新增;edit-编辑;detail-详情
addOrEdit: 'add',
id: ''
id: '',
activityStatus: ''
},
editStatus: false,
/* eslint-disable */
......@@ -353,16 +352,14 @@ export default {
name: 'customerServiceName',
width: '200px',
type: 'input',
maxlength: 50,
isDisabled: false
maxlength: 50
},
{
label: '客服电话',
name: 'customerServicePhone',
width: '200px',
type: 'input',
maxlength: 11,
isDisabled: false
maxlength: 11
},
{
label: '客服二维码',
......@@ -371,7 +368,6 @@ export default {
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
isDisabled: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
......@@ -393,13 +389,11 @@ export default {
optionList: [
{
confId: 1,
confName: '同步在线客服',
isDisabled: false
confName: '同步在线客服'
},
{
confId: 2,
confName: '单独设置',
isDisabled: false
confName: '单独设置'
}
]
},
......@@ -409,8 +403,7 @@ export default {
width: '474px',
type: 'input',
maxlength: 100,
tips: '默认展示门店名称',
isDisabled: false
tips: '默认展示门店名称'
},
{
label: '活动地址',
......@@ -434,7 +427,6 @@ export default {
tips: '进入活动页的图片',
limitSize: 5,
maxPhotoNum: 1,
isDisabled: false,
suffixSlot: 'activityBigImg',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
......@@ -454,12 +446,11 @@ export default {
tips: '大图下可以展示视频,不上传则不显示',
limitSize: 20,
maxPhotoNum: 6,
isDisabled: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({ file: base64 }).then(res => {
this.editForm[targetItem.name] = res
this.editForm[targetItem.name].push(res)
})
}
},
......@@ -500,7 +491,6 @@ export default {
width: '320px',
limitSize: 10,
maxPhotoNum: 1,
isDisabled: false,
suffixSlot: 'posterImg',
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
......@@ -526,10 +516,19 @@ export default {
this.routeInfo = this.$route.query
this.routeInfo.addOrEdit != 'add' ? this.getInfo() : ''
var id = this.routeInfo.id
var detailDisableList = ['editFormData']
if (id) {
if (this.routeInfo.addOrEdit == 'detail') {
this.isDisabled = true
this.changeFormAttr('editFormData', 'isDisabled', ['活动名称', '活动宣传图', '活动宣传语'], true)
if (this.routeInfo.addOrEdit == 'edit' && this.routeInfo.activityStatus == 2) {
// this.$refs.configEditFormRef.$refs.activityDetailTextBox[0].forbidEdit()
this.isDisabled = this.routeInfo.addOrEdit != 'add'
detailDisableList.forEach(attr => {
this.changeFormAttr(
attr,
'isDisabled',
this[attr].map(item => item.label),
true
)
})
}
}
},
......@@ -752,6 +751,14 @@ export default {
this.editForm.activityPrice = (info.activityPrice / 100).toFixed(2)
this.editForm.goodsStock = info.goodsStock
}
// 地图
if (info.activityAddressProvinceName || info.activityAddressCityName) {
this.$refs.configEditFormRef.$refs.provinceForm[0].init(info.activityAddressProvinceName, info.activityAddressCityName)
}
// 活动视频
if (info.activityVideos && info.activityVideos.length) {
this.editForm.activityVideos = info.activityVideos.map(item => item.activityVideo)
}
// 活动详情
if (info.activityDetail) {
this.editForm.activityDetail = decodeURIComponent(info.activityDetail)
......@@ -764,6 +771,9 @@ export default {
this.formDescribeList.push({ value: this.editForm['formDescribe' + this.describeIdxToAttr[index]] })
}
})
if (!this.formDescribeList.length) {
this.formDescribeList = [{ value: '' }]
}
console.log(this.editForm)
this.$nextTick(() => {
this.editStatus = false
......@@ -817,9 +827,8 @@ export default {
param.activityDetail = encodeURIComponent(this.editForm.activityDetail)
}
// 表单设置
let idx = 0
this.formDescribeList.forEach(item => {
param['formDescribe' + this.describeIdxToAttr[idx++]] = item.value ? item.value : ''
Object.values(this.describeIdxToAttr).forEach((item, idx) => {
param['formDescribe' + item] = this.formDescribeList.length > idx ? this.formDescribeList[idx].value : ''
})
return param
......@@ -843,7 +852,7 @@ export default {
addOrUpdate() {
var params = this.getCouponInfoParams()
console.log(params)
// console.log(params)
this.$apis.seckillActivity.addOrUpdateActivityApi(params).then(res => {
this.$message({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!