张园活动报名&核销
parent
72c696bc9d
commit
ebda1c7669
|
|
@ -3,8 +3,8 @@ VUE_APP_SYSTEM_NAME=standard
|
||||||
VUE_APP_PRODUCT_MODEL=standard
|
VUE_APP_PRODUCT_MODEL=standard
|
||||||
# VUE_APP_BASE_API=https://ecshopx-shop.ex-sandbox.com/api
|
# VUE_APP_BASE_API=https://ecshopx-shop.ex-sandbox.com/api
|
||||||
VUE_APP_BASE_API=/api
|
VUE_APP_BASE_API=/api
|
||||||
# VUE_APP_PROXY_API=http://47.103.169.154:8080/api
|
VUE_APP_PROXY_API=http://47.103.169.154:8080/api
|
||||||
VUE_APP_PROXY_API=https://slb.birkenstock.net.cn/api
|
# VUE_APP_PROXY_API=https://slb.birkenstock.net.cn/api
|
||||||
# VUE_APP_PUBLIC_PATH=https://ecshopx-vshop.oss-cn-hangzhou.aliyuncs.com/ecshopx-admin
|
# VUE_APP_PUBLIC_PATH=https://ecshopx-vshop.oss-cn-hangzhou.aliyuncs.com/ecshopx-admin
|
||||||
VUE_APP_PUBLIC_PATH=/
|
VUE_APP_PUBLIC_PATH=/
|
||||||
VUE_APP_WXIMG_URL=
|
VUE_APP_WXIMG_URL=
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
NODE_ENV=production
|
NODE_ENV=production
|
||||||
VUE_APP_SLB_MODE=true
|
VUE_APP_SLB_MODE=false
|
||||||
VUE_APP_IS_SAAS=false
|
VUE_APP_IS_SAAS=false
|
||||||
VUE_APP_SYSTEM_NAME=platform
|
VUE_APP_SYSTEM_NAME=standard
|
||||||
VUE_APP_PRODUCT_MODEL=platform
|
VUE_APP_PRODUCT_MODEL=standard
|
||||||
# VUE_APP_BASE_API=https://ecshopx-shop.ex-sandbox.com/api
|
# VUE_APP_BASE_API=https://ecshopx-shop.ex-sandbox.com/api
|
||||||
VUE_APP_BASE_API=https://test.birkenstock.net.cn/api
|
VUE_APP_BASE_API=https://test.birkenstock.net.cn/api
|
||||||
# VUE_APP_PROXY_API=http://47.103.169.154:8080/api
|
# VUE_APP_PROXY_API=http://47.103.169.154:8080/api
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -9,7 +9,7 @@
|
||||||
"version": "3.13.10",
|
"version": "3.13.10",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@riophae/vue-treeselect": "0.0.38",
|
"@riophae/vue-treeselect": "0.0.38",
|
||||||
"@shopex/finder": "^1.0.54",
|
"@shopex/finder": "^1.0.56",
|
||||||
"ali-oss": "^6.5.1",
|
"ali-oss": "^6.5.1",
|
||||||
"aws-sdk": "^2.824.0",
|
"aws-sdk": "^2.824.0",
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
|
|
@ -2423,9 +2423,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@shopex/finder": {
|
"node_modules/@shopex/finder": {
|
||||||
"version": "1.0.54",
|
"version": "1.0.56",
|
||||||
"resolved": "http://registry.npm.ishopex.cn/@shopex%2ffinder/-/finder-1.0.54.tgz",
|
"resolved": "http://registry.npm.ishopex.cn/@shopex%2ffinder/-/finder-1.0.56.tgz",
|
||||||
"integrity": "sha512-45suOmYWdAAp4tQjxdA7kj5eU+Ul562TipvnqzCf3igaSuQfHdHb6k5rQfF32VZJI5kvXE8CeYTvDfFbU4SE1Q==",
|
"integrity": "sha512-tETrVezTLbbm7GU8Vr1XVSbzDHX551o7Kls8CMgfUb6D6dt9dw2jDSdwqKuXj0n79wybEtJBm2e+75CObgGl2A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"element-ui": "^2.14.1",
|
"element-ui": "^2.14.1",
|
||||||
|
|
@ -29122,9 +29122,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@shopex/finder": {
|
"@shopex/finder": {
|
||||||
"version": "1.0.54",
|
"version": "1.0.56",
|
||||||
"resolved": "http://registry.npm.ishopex.cn/@shopex%2ffinder/-/finder-1.0.54.tgz",
|
"resolved": "http://registry.npm.ishopex.cn/@shopex%2ffinder/-/finder-1.0.56.tgz",
|
||||||
"integrity": "sha512-45suOmYWdAAp4tQjxdA7kj5eU+Ul562TipvnqzCf3igaSuQfHdHb6k5rQfF32VZJI5kvXE8CeYTvDfFbU4SE1Q==",
|
"integrity": "sha512-tETrVezTLbbm7GU8Vr1XVSbzDHX551o7Kls8CMgfUb6D6dt9dw2jDSdwqKuXj0n79wybEtJBm2e+75CObgGl2A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"element-ui": "^2.14.1",
|
"element-ui": "^2.14.1",
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@riophae/vue-treeselect": "0.0.38",
|
"@riophae/vue-treeselect": "0.0.38",
|
||||||
"@shopex/finder": "^1.0.54",
|
"@shopex/finder": "^1.0.56",
|
||||||
"ali-oss": "^6.5.1",
|
"ali-oss": "^6.5.1",
|
||||||
"aws-sdk": "^2.824.0",
|
"aws-sdk": "^2.824.0",
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,39 @@ export function regActivityList (query) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 活动场次
|
||||||
|
export function registrationActivitySessionList (query) {
|
||||||
|
return fetch({
|
||||||
|
url: '/selfhelp/registrationActivitySession/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 活动场次删除
|
||||||
|
export function registrationActivitySessionDel (query) {
|
||||||
|
return fetch({
|
||||||
|
url: '/selfhelp/registrationActivitySession/del',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 场次新增
|
||||||
|
export function registrationActivitySessionAdd (query) {
|
||||||
|
return fetch({
|
||||||
|
url: '/selfhelp/registrationActivitySession/add',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 场次修改
|
||||||
|
export function registrationActivitySessionUpdate (query) {
|
||||||
|
return fetch({
|
||||||
|
url: '/selfhelp/registrationActivitySession/update',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function regActivityEasylist (query) {
|
export function regActivityEasylist (query) {
|
||||||
return fetch({
|
return fetch({
|
||||||
url: '/selfhelp/registrationActivity/easylist',
|
url: '/selfhelp/registrationActivity/easylist',
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
|
this.$refs['form'] && this.$refs['form'].resetForm()
|
||||||
this.$emit('input', false)
|
this.$emit('input', false)
|
||||||
},
|
},
|
||||||
onFormSubmit() {
|
onFormSubmit() {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ export default {
|
||||||
form: {
|
form: {
|
||||||
order_id: '',
|
order_id: '',
|
||||||
aftersales_type: 'ONLY_REFUND',
|
aftersales_type: 'ONLY_REFUND',
|
||||||
reason: '1',
|
reason: '',
|
||||||
goods_returned: false,
|
goods_returned: false,
|
||||||
items: [],
|
items: [],
|
||||||
refund_point: '0',
|
refund_point: '0',
|
||||||
|
|
@ -113,6 +113,7 @@ export default {
|
||||||
{
|
{
|
||||||
label: '退款原因',
|
label: '退款原因',
|
||||||
key: 'reason',
|
key: 'reason',
|
||||||
|
required: true,
|
||||||
placeholder: '请选择退款原因',
|
placeholder: '请选择退款原因',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
options: REASONS
|
options: REASONS
|
||||||
|
|
@ -232,6 +233,9 @@ export default {
|
||||||
this.orderInfo = orderInfo
|
this.orderInfo = orderInfo
|
||||||
},
|
},
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
|
if (!this.form.reason) {
|
||||||
|
return this.$message.info('请选择退款原因')
|
||||||
|
}
|
||||||
await this.$confirm('请确认申请售后', '提示', {
|
await this.$confirm('请确认申请售后', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消'
|
cancelButtonText: '取消'
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,61 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<sideBar width="50" :visible.sync="showSideBar" :title="'活动场次'">
|
||||||
|
<div class="action-container">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="iconfont icon-xinzengcaozuo-01"
|
||||||
|
@click="
|
||||||
|
sessDialog = true
|
||||||
|
sessForm = {}
|
||||||
|
selRow = {}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
添加场次
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:header-cell-style="{ height: '40px', padding: '8px' }"
|
||||||
|
empty-text="暂无场次"
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%"
|
||||||
|
stripe
|
||||||
|
>
|
||||||
|
<el-table-column align="center" type="index" width="50"> </el-table-column>
|
||||||
|
<el-table-column align="center" prop="start_time" label="开始时间" width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="end_time" label="结束时间" width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="join_limit" label="可报名人数"> </el-table-column>
|
||||||
|
<el-table-column align="center" width="160" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button style="margin-right: 20px" size="mini" @click="handleEdit(scope.row)"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-popconfirm
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
title="确定删除该场次吗?"
|
||||||
|
confirm-button-type="danger"
|
||||||
|
>
|
||||||
|
<el-button slot="reference" size="mini" type="danger">删除</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</sideBar>
|
||||||
|
|
||||||
|
<SpDialog
|
||||||
|
ref="sessDialogRef"
|
||||||
|
v-model="sessDialog"
|
||||||
|
:title="sessForm.registration_session_id > 0 ? '编辑场次' : '添加场次'"
|
||||||
|
:modal="false"
|
||||||
|
:form="sessForm"
|
||||||
|
:form-list="sessFormList"
|
||||||
|
@onSubmit="onSessFormSubmit"
|
||||||
|
@input="sessForm = {}"
|
||||||
|
/>
|
||||||
|
|
||||||
<el-dialog :visible.sync="dialogVisible" title="活动详情">
|
<el-dialog :visible.sync="dialogVisible" title="活动详情">
|
||||||
<el-descriptions :column="1">
|
<el-descriptions :column="1">
|
||||||
<el-descriptions-item label="活动名称">{{ dataInfo.activity_name }}</el-descriptions-item>
|
<el-descriptions-item label="活动名称">{{ dataInfo.activity_name }}</el-descriptions-item>
|
||||||
|
|
@ -180,14 +235,27 @@
|
||||||
</SpRouterView>
|
</SpRouterView>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { regActivityDel, regActivityInvalid, getTemplateList } from '@/api/selfhelpform'
|
import sideBar from '@/components/element/sideBar'
|
||||||
|
import {
|
||||||
|
regActivityDel,
|
||||||
|
regActivityInvalid,
|
||||||
|
getTemplateList,
|
||||||
|
registrationActivitySessionList,
|
||||||
|
registrationActivitySessionUpdate,
|
||||||
|
registrationActivitySessionDel,
|
||||||
|
registrationActivitySessionAdd
|
||||||
|
} from '@/api/selfhelpform'
|
||||||
import mixin, { pageMixin } from '@/mixins'
|
import mixin, { pageMixin } from '@/mixins'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
export default {
|
export default {
|
||||||
filters: {
|
filters: {
|
||||||
formatterLable(value, options) {
|
formatterLable(value, options) {
|
||||||
return options.find((item) => item.value == value)?.label
|
return options.find((item) => item.value == value)?.label
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
components: {
|
||||||
|
sideBar
|
||||||
|
},
|
||||||
mixins: [mixin, pageMixin],
|
mixins: [mixin, pageMixin],
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -205,6 +273,85 @@ export default {
|
||||||
params: {
|
params: {
|
||||||
...initialParams
|
...initialParams
|
||||||
},
|
},
|
||||||
|
showSideBar: false,
|
||||||
|
tableData: [],
|
||||||
|
sessDialog: false,
|
||||||
|
sessForm: {
|
||||||
|
start_time: '',
|
||||||
|
end_time: '',
|
||||||
|
join_limit: null
|
||||||
|
},
|
||||||
|
sessFormList: [
|
||||||
|
{
|
||||||
|
label: '日期',
|
||||||
|
key: 'day',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
component: ({ key }, value) => (
|
||||||
|
<el-date-picker
|
||||||
|
v-model={value[key]}
|
||||||
|
type='date'
|
||||||
|
placeholder='选择日期'
|
||||||
|
value-format='yyyy-MM-dd'
|
||||||
|
style={{ width: '260px' }}
|
||||||
|
disabledDate={(time) => time < Date.now()}
|
||||||
|
></el-date-picker>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '开始时间',
|
||||||
|
key: 'start_time',
|
||||||
|
type: 'input',
|
||||||
|
placeholder: '请输入开始时间',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
component: ({ key }, value) => (
|
||||||
|
<el-time-select
|
||||||
|
placeholder='开始时间'
|
||||||
|
v-model={value[key]}
|
||||||
|
picker-options={{
|
||||||
|
start: '05:00',
|
||||||
|
step: '00:10',
|
||||||
|
end: '23:45'
|
||||||
|
}}
|
||||||
|
// onBlur={() => {
|
||||||
|
// value['end_time'] = ''
|
||||||
|
// }}
|
||||||
|
value-format='HH:mm:ss'
|
||||||
|
style={{ width: '260px' }}
|
||||||
|
></el-time-select>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '结束时间',
|
||||||
|
key: 'end_time',
|
||||||
|
type: 'input',
|
||||||
|
placeholder: '请输入结束时间',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
component: ({ key }, value) => (
|
||||||
|
<el-time-select
|
||||||
|
placeholder='结束时间'
|
||||||
|
v-model={value[key]}
|
||||||
|
picker-options={{
|
||||||
|
start: '05:00',
|
||||||
|
step: '00:10',
|
||||||
|
end: '23:45',
|
||||||
|
minTime: value['start_time']
|
||||||
|
}}
|
||||||
|
value-format='HH:mm:ss'
|
||||||
|
style={{ width: '260px' }}
|
||||||
|
></el-time-select>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '可报名人数',
|
||||||
|
key: 'join_limit',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
templateParams: {
|
templateParams: {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -236,7 +383,9 @@ export default {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
activity_id: null,
|
||||||
|
selRow: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -251,6 +400,64 @@ export default {
|
||||||
this.fetchList()
|
this.fetchList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
fetchTableList() {
|
||||||
|
registrationActivitySessionList({
|
||||||
|
activity_id: this.activity_id,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 100
|
||||||
|
}).then((res) => {
|
||||||
|
this.tableData = res.data?.data?.list || []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSessFormSubmit() {
|
||||||
|
console.log(this.sessForm)
|
||||||
|
const { sessForm, activity_id, selRow } = this
|
||||||
|
const req = { ...sessForm }
|
||||||
|
req.activity_id = activity_id
|
||||||
|
const { start_time, end_time, day } = sessForm
|
||||||
|
req.start_time = `${day} ${start_time}:00`
|
||||||
|
req.end_time = `${day} ${end_time}:00`
|
||||||
|
!selRow?.registration_session_id
|
||||||
|
? registrationActivitySessionAdd(req).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: '添加成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
: registrationActivitySessionUpdate(req).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: '更新成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.sessDialog = false
|
||||||
|
setTimeout(() => {
|
||||||
|
this.fetchTableList()
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
|
handleEdit(row) {
|
||||||
|
this.selRow = row
|
||||||
|
const { start_time, end_time, join_limit } = row
|
||||||
|
this.sessForm = {
|
||||||
|
day: dayjs(start_time).format('YYYY-MM-DD'),
|
||||||
|
start_time: dayjs(start_time).format('HH:mm'),
|
||||||
|
end_time: dayjs(end_time).format('HH:mm'),
|
||||||
|
registration_session_id: row.registration_session_id,
|
||||||
|
join_limit
|
||||||
|
}
|
||||||
|
this.sessDialog = true
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
this.selRow = row
|
||||||
|
const { registration_session_id } = row
|
||||||
|
registrationActivitySessionDel({ registration_session_id }).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
this.fetchTableList()
|
||||||
|
})
|
||||||
|
},
|
||||||
getTemplateList() {
|
getTemplateList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
getTemplateList(this.templateParams).then((response) => {
|
getTemplateList(this.templateParams).then((response) => {
|
||||||
|
|
@ -313,7 +520,11 @@ export default {
|
||||||
},
|
},
|
||||||
preview(index, row) {
|
preview(index, row) {
|
||||||
// 预览弹框
|
// 预览弹框
|
||||||
this.dialogVisible = true
|
this.showSideBar = true
|
||||||
|
this.activity_id = row.activity_id
|
||||||
|
this.fetchTableList()
|
||||||
|
// this.dialogVisible = true
|
||||||
|
this.selRow = row
|
||||||
this.dataInfo = row
|
this.dataInfo = row
|
||||||
},
|
},
|
||||||
onSearch() {
|
onSearch() {
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<!-- <el-form-item
|
||||||
label="提交报名次数"
|
label="提交报名次数"
|
||||||
prop="join_limit"
|
prop="join_limit"
|
||||||
:rules="[{ required: true, message: '请输入报名次数', trigger: 'blur' }]"
|
:rules="[{ required: true, message: '请输入报名次数', trigger: 'blur' }]"
|
||||||
|
|
@ -92,7 +92,53 @@
|
||||||
@change="fieldItemChange"
|
@change="fieldItemChange"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
|
<template v-if="false">
|
||||||
|
<!-- :default-sort = "{prop: 'start_time', order: 'descending'}" -->
|
||||||
|
<el-form-item label="活动场次" prop="join_limit" :rules="[{ required: true }]">
|
||||||
|
<el-col :span="20">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="iconfont icon-xinzengcaozuo-01"
|
||||||
|
@click="
|
||||||
|
sessDialog = true
|
||||||
|
sessForm = {}
|
||||||
|
"
|
||||||
|
>
|
||||||
|
添加场次
|
||||||
|
</el-button>
|
||||||
|
<el-table
|
||||||
|
:header-cell-style="{ height: '40px', padding: '8px' }"
|
||||||
|
empty-text="暂无场次"
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%"
|
||||||
|
stripe
|
||||||
|
>
|
||||||
|
<el-table-column align="center" type="index" width="50"> </el-table-column>
|
||||||
|
<el-table-column align="center" prop="start_time" label="开始时间" width="220">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="end_time" label="结束时间" width="220">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="join_limit" label="可报名人数">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button style="margin-right: 20px" size="mini" @click="handleEdit(scope.row)"
|
||||||
|
>编辑</el-button
|
||||||
|
>
|
||||||
|
<el-popconfirm
|
||||||
|
@confirm="handleDelete(scope.row)"
|
||||||
|
title="确定删除该场次吗?"
|
||||||
|
confirm-button-type="danger"
|
||||||
|
>
|
||||||
|
<el-button slot="reference" size="mini" type="danger">删除</el-button>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-col>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label="活动介绍"
|
label="活动介绍"
|
||||||
prop="activity_name"
|
prop="activity_name"
|
||||||
|
|
@ -143,6 +189,16 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
<SpDialog
|
||||||
|
ref="sessDialogRef"
|
||||||
|
v-model="sessDialog"
|
||||||
|
:title="sessForm.registration_session_id > 0 ? '编辑场次' : '添加场次'"
|
||||||
|
:modal="false"
|
||||||
|
:form="sessForm"
|
||||||
|
:form-list="sessFormList"
|
||||||
|
@onSubmit="onSessFormSubmit"
|
||||||
|
@input="sessForm = {}"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -152,10 +208,16 @@ import {
|
||||||
regActivityAdd,
|
regActivityAdd,
|
||||||
regActivityGet,
|
regActivityGet,
|
||||||
regActivityUpdate,
|
regActivityUpdate,
|
||||||
getTemplateList
|
getTemplateList,
|
||||||
|
registrationActivitySessionList,
|
||||||
|
registrationActivitySessionUpdate,
|
||||||
|
registrationActivitySessionDel,
|
||||||
|
registrationActivitySessionAdd
|
||||||
} from '../../../api/selfhelpform'
|
} from '../../../api/selfhelpform'
|
||||||
import imgPicker from '@/components/imageselect'
|
import imgPicker from '@/components/imageselect'
|
||||||
import imgBox from '@/components/element/imgBox'
|
import imgBox from '@/components/element/imgBox'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
// import page from '../../../components/sp-picker/mixins/page'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
inject: ['refresh'],
|
inject: ['refresh'],
|
||||||
|
|
@ -165,14 +227,93 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
sessDialog: false,
|
||||||
pickerOptions: {},
|
pickerOptions: {},
|
||||||
activity_date: [],
|
activity_date: [],
|
||||||
|
selRow: {},
|
||||||
|
tableData: [],
|
||||||
|
sessForm: {
|
||||||
|
start_time: '',
|
||||||
|
end_time: '',
|
||||||
|
join_limit: null
|
||||||
|
},
|
||||||
|
sessFormList: [
|
||||||
|
{
|
||||||
|
label: '日期',
|
||||||
|
key: 'day',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
component: ({ key }, value) => (
|
||||||
|
<el-date-picker
|
||||||
|
v-model={value[key]}
|
||||||
|
type='date'
|
||||||
|
placeholder='选择日期'
|
||||||
|
value-format='yyyy-MM-dd'
|
||||||
|
style={{ width: '260px' }}
|
||||||
|
disabledDate={(time) => time < Date.now()}
|
||||||
|
></el-date-picker>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '开始时间',
|
||||||
|
key: 'start_time',
|
||||||
|
type: 'input',
|
||||||
|
placeholder: '请输入开始时间',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
component: ({ key }, value) => (
|
||||||
|
<el-time-select
|
||||||
|
placeholder='开始时间'
|
||||||
|
v-model={value[key]}
|
||||||
|
picker-options={{
|
||||||
|
start: '05:00',
|
||||||
|
step: '00:10',
|
||||||
|
end: '23:45'
|
||||||
|
}}
|
||||||
|
// onBlur={() => {
|
||||||
|
// value['end_time'] = ''
|
||||||
|
// }}
|
||||||
|
value-format='HH:mm:ss'
|
||||||
|
style={{ width: '260px' }}
|
||||||
|
></el-time-select>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '结束时间',
|
||||||
|
key: 'end_time',
|
||||||
|
type: 'input',
|
||||||
|
placeholder: '请输入结束时间',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
component: ({ key }, value) => (
|
||||||
|
<el-time-select
|
||||||
|
placeholder='结束时间'
|
||||||
|
v-model={value[key]}
|
||||||
|
picker-options={{
|
||||||
|
start: '05:00',
|
||||||
|
step: '00:10',
|
||||||
|
end: '23:45',
|
||||||
|
minTime: value['start_time']
|
||||||
|
}}
|
||||||
|
value-format='HH:mm:ss'
|
||||||
|
style={{ width: '260px' }}
|
||||||
|
></el-time-select>
|
||||||
|
)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '可报名人数',
|
||||||
|
key: 'join_limit',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
message: '不能为空'
|
||||||
|
}
|
||||||
|
],
|
||||||
form: {
|
form: {
|
||||||
activity_name: '',
|
activity_name: '',
|
||||||
activity_time: '',
|
activity_time: '',
|
||||||
start_time: '',
|
start_time: '',
|
||||||
end_time: '',
|
end_time: '',
|
||||||
join_limit: '',
|
join_limit: '1',
|
||||||
address: '',
|
address: '',
|
||||||
pics: [],
|
pics: [],
|
||||||
intro: ''
|
intro: ''
|
||||||
|
|
@ -194,20 +335,85 @@ export default {
|
||||||
formName: '',
|
formName: '',
|
||||||
imgDialog: false,
|
imgDialog: false,
|
||||||
isGetImage: false,
|
isGetImage: false,
|
||||||
imgIndex: 0
|
imgIndex: 0,
|
||||||
|
activity_id: null,
|
||||||
|
editForm: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getTemplateList()
|
this.getTemplateList()
|
||||||
if (this.$route.query.id) {
|
if (this.$route.query.id) {
|
||||||
|
this.activity_id = this.$route.query.id
|
||||||
let filter = { activity_id: this.$route.query.id }
|
let filter = { activity_id: this.$route.query.id }
|
||||||
regActivityGet(filter).then((res) => {
|
regActivityGet(filter).then((res) => {
|
||||||
this.form = res.data.data
|
this.form = res.data.data
|
||||||
this.activity_date = [this.form.start_time * 1000, this.form.end_time * 1000]
|
this.activity_date = [this.form.start_time * 1000, this.form.end_time * 1000]
|
||||||
})
|
})
|
||||||
|
this.fetchList()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
fetchList() {
|
||||||
|
registrationActivitySessionList({
|
||||||
|
activity_id: this.activity_id,
|
||||||
|
page: 1,
|
||||||
|
pageSize: 100
|
||||||
|
}).then((res) => {
|
||||||
|
this.tableData = res.data?.data?.list || []
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onSessFormSubmit() {
|
||||||
|
console.log(this.sessForm)
|
||||||
|
const { sessForm, activity_id, selRow } = this
|
||||||
|
const req = { ...sessForm }
|
||||||
|
req.activity_id = activity_id
|
||||||
|
const { start_time, end_time, day } = sessForm
|
||||||
|
req.start_time = `${day} ${start_time}:00`
|
||||||
|
req.end_time = `${day} ${end_time}:00`
|
||||||
|
!selRow?.registration_session_id
|
||||||
|
? registrationActivitySessionAdd(req).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: '添加成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 3 * 1000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
: registrationActivitySessionUpdate(req).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: '更新成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 3 * 1000
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.sessDialog = false
|
||||||
|
setTimeout(() => {
|
||||||
|
this.fetchList()
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
|
handleEdit(row) {
|
||||||
|
this.selRow = row
|
||||||
|
const { start_time, end_time, join_limit } = row
|
||||||
|
this.sessForm = {
|
||||||
|
day: dayjs(start_time).format('YYYY-MM-DD'),
|
||||||
|
start_time: dayjs(start_time).format('HH:mm'),
|
||||||
|
end_time: dayjs(end_time).format('HH:mm'),
|
||||||
|
registration_session_id: row.registration_session_id,
|
||||||
|
join_limit
|
||||||
|
}
|
||||||
|
this.sessDialog = true
|
||||||
|
},
|
||||||
|
handleDelete(row) {
|
||||||
|
this.selRow = row
|
||||||
|
const { registration_session_id } = row
|
||||||
|
registrationActivitySessionDel({ registration_session_id }).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: '删除成功',
|
||||||
|
type: 'success',
|
||||||
|
duration: 3 * 1000
|
||||||
|
})
|
||||||
|
this.fetchList()
|
||||||
|
})
|
||||||
|
},
|
||||||
dateStrToTimeStamp(str) {
|
dateStrToTimeStamp(str) {
|
||||||
return Date.parse(new Date(str)) / 1000
|
return Date.parse(new Date(str)) / 1000
|
||||||
},
|
},
|
||||||
|
|
@ -219,6 +425,10 @@ export default {
|
||||||
this.form.start_time = that.activity_date[0] / 1000
|
this.form.start_time = that.activity_date[0] / 1000
|
||||||
this.form.end_time = that.activity_date[1] / 1000
|
this.form.end_time = that.activity_date[1] / 1000
|
||||||
}
|
}
|
||||||
|
this.form.join_limit = 1
|
||||||
|
// if (!this.tableData.length) {
|
||||||
|
// return this.$message.info('请先添加场次')
|
||||||
|
// }
|
||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.activity_id) {
|
if (this.form.activity_id) {
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,9 @@ export default {
|
||||||
if (this.$route.query.id) {
|
if (this.$route.query.id) {
|
||||||
let filter = { record_id: this.$route.query.id }
|
let filter = { record_id: this.$route.query.id }
|
||||||
regActivityRecordinfo(filter).then((res) => {
|
regActivityRecordinfo(filter).then((res) => {
|
||||||
|
const { content } = res.data.data
|
||||||
this.recorddata = res.data.data
|
this.recorddata = res.data.data
|
||||||
|
this.recorddata.content = [{ formdata: content[0].formdata.sort((a, b) => a.id - b.id) }]
|
||||||
this.form.record_id = this.recorddata.record_id
|
this.form.record_id = this.recorddata.record_id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue