Commit 238a477c authored by mengmeng's avatar mengmeng

0717 增加比赛人员信息页面

parent d2fa5e47
......@@ -9,7 +9,7 @@
window.SITE_CONFIG = {};
window.SITE_CONFIG['version'] = 'v1.0.0';
window.SITE_CONFIG['nodeEnv'] = '<%= process.env.VUE_APP_NODE_ENV %>';
window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/hmit-admin'; // api请求地址
window.SITE_CONFIG['apiURL'] = 'http://localhost:8080/hmit-admin'; // 'http://119.3.50.187:8080/hmit-admin'; 部署环境 // api请求地址
window.SITE_CONFIG['storeState'] = {}; // vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window.SITE_CONFIG['contentTabDefault'] = { // 内容标签页默认属性对象
'name': '', // 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
......
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="姓名" prop="name">
<el-input v-model="dataForm.name" placeholder="姓名"></el-input>
</el-form-item>
<el-form-item label="工作单位" prop="employer">
<el-input v-model="dataForm.employer" placeholder="工作单位"></el-input>
</el-form-item>
<el-form-item label="职称" prop="job">
<el-input v-model="dataForm.job" placeholder="职称"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="dataForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="会员" prop="member">
<el-input v-model="dataForm.member" placeholder="会员"></el-input>
</el-form-item>
<el-form-item label="关系会员名称" prop="withMember">
<el-input v-model="dataForm.withMember" placeholder="关系会员名称"></el-input>
</el-form-item>
<el-form-item label="与会员关系" prop="withRelationship">
<el-input v-model="dataForm.withRelationship" placeholder="与会员关系"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="dataForm.phone" placeholder="手机号"></el-input>
</el-form-item>
<el-form-item label="身高" prop="height">
<el-input v-model="dataForm.height" placeholder="身高"></el-input>
</el-form-item>
<el-form-item label="体重" prop="weight">
<el-input v-model="dataForm.weight" placeholder="体重"></el-input>
</el-form-item>
<el-form-item label="衣服型号" prop="ctModel">
<el-input v-model="dataForm.ctModel" placeholder="衣服型号"></el-input>
</el-form-item>
<el-form-item label="就餐" prop="dinner">
<el-input v-model="dataForm.dinner" placeholder="就餐"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="修改时间" prop="updateTime">
<el-input v-model="dataForm.updateTime" placeholder="修改时间"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
name: '',
employer: '',
job: '',
email: '',
member: '',
withMember: '',
withRelationship: '',
phone: '',
height: '',
weight: '',
ctModel: '',
dinner: '',
createTime: '',
updateTime: ''
}
}
},
computed: {
dataRule () {
return {
name: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
employer: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
job: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
email: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
member: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
withMember: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
withRelationship: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
phone: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
height: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
weight: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
ctModel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
dinner: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updateTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
// 获取信息
getInfo () {
this.$http.get(`/competition/wluploadinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
// 表单提交
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/competition/wluploadinfo/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-competition__wluploadinfo}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('competition:wluploadinfo:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('competition:wluploadinfo:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="id" label="" header-align="center" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" header-align="center" align="center"></el-table-column>
<el-table-column prop="employer" label="工作单位" header-align="center" align="center"></el-table-column>
<el-table-column prop="job" label="职称" header-align="center" align="center"></el-table-column>
<el-table-column prop="email" label="邮箱" header-align="center" align="center"></el-table-column>
<el-table-column prop="member" label="会员" header-align="center" align="center"></el-table-column>
<el-table-column prop="withMember" label="关系会员名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="withRelationship" label="与会员关系" header-align="center" align="center"></el-table-column>
<el-table-column prop="phone" label="手机号" header-align="center" align="center"></el-table-column>
<el-table-column prop="height" label="身高" header-align="center" align="center"></el-table-column>
<el-table-column prop="weight" label="体重" header-align="center" align="center"></el-table-column>
<el-table-column prop="ctModel" label="衣服型号" header-align="center" align="center"></el-table-column>
<el-table-column prop="dinner" label="就餐" header-align="center" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="updateTime" label="修改时间" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('competition:wluploadinfo:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('competition:wluploadinfo:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './wluploadinfo-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/competition/wluploadinfo/page',
getDataListIsPage: true,
exportURL: '/competition/wluploadinfo/export',
deleteURL: '/competition/wluploadinfo',
deleteIsBatch: true
},
dataForm: {
id: ''
}
}
},
components: {
AddOrUpdate
}
}
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment