Commit 5c8f7385 by chenwq

众筹

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