first commit
This commit is contained in:
@@ -0,0 +1,579 @@
|
||||
<!--#
|
||||
layout("/mobile/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.van-form {
|
||||
/*max-height: calc(100vh - 200px);*/
|
||||
/*overflow-y: scroll;*/
|
||||
padding-bottom: 100px;
|
||||
}
|
||||
|
||||
.van-cell-houseType {
|
||||
border-bottom: 1px solid #ebedf0;
|
||||
}
|
||||
|
||||
.form-houseType-notice-bar {
|
||||
background-color: #FFF;
|
||||
}
|
||||
|
||||
.van-cell-label-wrap {
|
||||
position: relative;
|
||||
padding-left: 120px;
|
||||
}
|
||||
|
||||
.van-cell-label-wrap > .van-cell-label-img {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
display: flex;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.van-cell-label-desc {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 120px;
|
||||
max-height: 120px;
|
||||
padding: 0 0 0 15px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.van-cell-label-desc > div {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.form-submit-button {
|
||||
/*position: fixed;*/
|
||||
/*bottom: 55px;*/
|
||||
/*left: 50%;*/
|
||||
/*height: 44px;*/
|
||||
/*width: 90%;*/
|
||||
/*transform: translateX(-50%);*/
|
||||
/*background-color: #FFF;*/
|
||||
}
|
||||
|
||||
.van-doc-card {
|
||||
margin: 14px;
|
||||
padding: 20px 24px 10px 24px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
box-shadow: 0 8px 12px #ebedf0;
|
||||
line-height: 20px;
|
||||
font-size: 14px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.van-doc-card > div:first-child {
|
||||
border: 2px #50e644 solid;
|
||||
width: 26px;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 26px;
|
||||
}
|
||||
|
||||
.van-doc-card .title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.van-doc-card .title > div:first-child {
|
||||
width: 80%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.van-doc-card .title > div:last-child {
|
||||
font-weight: normal;
|
||||
color: #1867b0;
|
||||
}
|
||||
|
||||
.van-doc-card .room {
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.room_text {
|
||||
margin-left: 36px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.room_text span {
|
||||
color: grey;
|
||||
}
|
||||
|
||||
.room_more {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
color: #1867b0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app">
|
||||
<van-sticky>
|
||||
<van-nav-bar :title="actInfo.actName" @click-left="history.back()" fixed left-arrow placeholder></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<template v-if="tabbarActive===0">
|
||||
<van-notice-bar class="form-houseType-notice-bar" color="#1989fa" left-icon="info-o">
|
||||
填写时间: {{actInfo.startTime + ' 至 ' + actInfo.endTime}}
|
||||
</van-notice-bar>
|
||||
|
||||
<van-form @submit="onSubmit">
|
||||
<van-field
|
||||
readonly
|
||||
:rules="[{ required: true, message: '请填写您的工号' }]"
|
||||
label="工号"
|
||||
name="loginName"
|
||||
placeholder="工号"
|
||||
v-model="formData.loginName"
|
||||
></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
:rules="[{ required: true, message: '请填写您的姓名' }]"
|
||||
label="姓名"
|
||||
name="userName"
|
||||
placeholder="姓名"
|
||||
v-model="formData.userName"
|
||||
></van-field>
|
||||
<van-field
|
||||
readonly
|
||||
:rules="[{ required: true, message: '请填写您的单位' }]"
|
||||
label="单位"
|
||||
name="unitName"
|
||||
placeholder="单位"
|
||||
v-model="formData.unitName"
|
||||
></van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请选择您的出生日期' }]"
|
||||
:value="formData.birthday"
|
||||
@click="showDatePicker('birthday')"
|
||||
clickable
|
||||
label="出生日期"
|
||||
name="birthday"
|
||||
placeholder="点击选择出生日期"
|
||||
readonly
|
||||
></van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请选择您的工作时间' }]"
|
||||
:value="formData.joinWorkTime"
|
||||
@click="showDatePicker('joinWorkTime')"
|
||||
clickable
|
||||
label="工作时间"
|
||||
name="joinWorkTime"
|
||||
placeholder="点击选择工作时间"
|
||||
readonly
|
||||
></van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请选择您的进校时间' }]"
|
||||
:value="formData.schoolTime"
|
||||
@click="showDatePicker('schoolTime')"
|
||||
clickable
|
||||
label="进校时间"
|
||||
name="schoolTime"
|
||||
placeholder="点击选择进校时间"
|
||||
readonly
|
||||
></van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请填写您的职称职务(以最高职称职务为准)' }]"
|
||||
label="职称职务"
|
||||
maxlength="20"
|
||||
name="titlePosition"
|
||||
placeholder="以最高职称职务为准"
|
||||
v-model="formData.titlePosition"
|
||||
></van-field>
|
||||
<van-field
|
||||
:rules="[{ required: true, message: '请选择您的职称职务评定时间' }]"
|
||||
:value="formData.titleAsAssessmentTime"
|
||||
@click="showDatePicker('titleAsAssessmentTime')"
|
||||
clickable
|
||||
label="职称职务评定时间"
|
||||
name="titleAsAssessmentTime"
|
||||
placeholder="职称职务评定时间"
|
||||
readonly
|
||||
>
|
||||
<template #label>
|
||||
<div>
|
||||
<div>职称职务</div>
|
||||
<div>评定时间</div>
|
||||
</div>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field :rules="[{ validator: validatorBoolean, message: '请选择' }]" label="是否双职工" name="isDoubleStaff">
|
||||
<template #input>
|
||||
<van-radio-group direction="horizontal" v-model="formData.isDoubleStaff">
|
||||
<van-radio :name="true" shape="square">是</van-radio>
|
||||
<van-radio :name="false" shape="square">否</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field :rules="[{ validator: validatorBoolean, message: '请选择' }]" label="是否服从调配"
|
||||
name="whetherToAllocate">
|
||||
<template #input>
|
||||
<van-radio-group direction="horizontal" v-model="formData.whetherToAllocate">
|
||||
<van-radio :name="true" shape="square">是</van-radio>
|
||||
<van-radio :name="false" shape="square">否</van-radio>
|
||||
</van-radio-group>
|
||||
</template>
|
||||
</van-field>
|
||||
|
||||
<van-notice-bar class="form-houseType-notice-bar" color="#1989fa" left-icon="info-o">
|
||||
拟认购户型(可选三种)
|
||||
</van-notice-bar>
|
||||
|
||||
<van-checkbox-group style="margin-bottom: 10px" v-model="formData.selectHouseIdList">
|
||||
<van-cell-group>
|
||||
<van-cell
|
||||
:key="item.id"
|
||||
:title="'户型'+(index+1)"
|
||||
@click="houseTypeToggle(item.id)"
|
||||
class="van-cell-houseType"
|
||||
clickable
|
||||
v-for="(item, index) in houseTypeList">
|
||||
<template #label>
|
||||
<div class="van-cell-label-wrap">
|
||||
<div class="van-cell-label-img">
|
||||
<van-image
|
||||
:src="APP_DOMAIN+'/file_server/fileStreamPreview?id='+item.imgFiles[0].id"
|
||||
@click.stop="vant.ImagePreview([APP_DOMAIN+'/file_server/fileStreamPreview?id='+item.imgFiles[0].id])"
|
||||
height="120"
|
||||
width="120"
|
||||
></van-image>
|
||||
</div>
|
||||
<div class="van-cell-label-desc">
|
||||
<div>户型面积:{{item.area + 'm²'}}</div>
|
||||
<div>总共套数:{{item.number}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template #right-icon>
|
||||
<van-checkbox :name="item.id" @click="houseTypeToggle(item.id)"
|
||||
ref="checkboxes"></van-checkbox>
|
||||
</template>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</van-checkbox-group>
|
||||
|
||||
<div class="form-submit-button">
|
||||
<van-button :color="themeColor"
|
||||
:disabled="moment().unix() >= moment(actInfo.endTime).unix()
|
||||
|| moment().unix() <= moment(actInfo.startTime).unix()
|
||||
|| !this.hasPermission"
|
||||
block native-type="submit">
|
||||
{{submitText}}
|
||||
</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
|
||||
<van-popup position="bottom" v-model="datePickerVisible">
|
||||
<van-datetime-picker
|
||||
:max-date="maxDate"
|
||||
:min-date="minDate"
|
||||
@cancel="datePickerVisible = false"
|
||||
@confirm="confirmDate"
|
||||
type="date"
|
||||
v-model="datePickerTempVal"
|
||||
></van-datetime-picker>
|
||||
</van-popup>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<van-list :finished="finished" :finished-text="tableData.length>0?'没有更多了':''"
|
||||
@load="pageData"
|
||||
v-if="tableData && tableData.length>0"
|
||||
v-model="loading">
|
||||
<div class="van-doc-card" v-for="o in tableData">
|
||||
<div></div>
|
||||
<div class="title">
|
||||
<div>
|
||||
{{o.tempActHouse.actName}}
|
||||
</div>
|
||||
<div @click="goEdit(o)">去修改 ></div>
|
||||
</div>
|
||||
<div :style="'height: ' + o.divHeight + '; overflow: hidden'">
|
||||
<div class="room" v-for="item in o.selectHouseIdList">
|
||||
<van-image v-for="pic in houseTypeList.find(x => x.id === item.houseTypeId).imgFiles"
|
||||
width="5rem"
|
||||
height="5rem"
|
||||
fit="contain"
|
||||
:src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + pic.id"
|
||||
@click.stop="vant.ImagePreview([APP_DOMAIN + '/file_server/fileStreamPreview?id=' + pic.id])">
|
||||
</van-image>
|
||||
<div class="room_text">
|
||||
<div style="margin: 6px 0px 10px 0px;">
|
||||
<label style="font-weight: bold">
|
||||
{{houseTypeList.find(x => x.id === item.houseTypeId).area}}m²
|
||||
</label>
|
||||
户型
|
||||
</div>
|
||||
<div>
|
||||
<span>户型面积:</span>
|
||||
{{houseTypeList.find(x => x.id === item.houseTypeId).area}}m²
|
||||
</div>
|
||||
<div>
|
||||
<span>总共套数:</span>
|
||||
{{houseTypeList.find(x => x.id === item.houseTypeId).number}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="room_more"
|
||||
@click="() => {o.expandMore = !o.expandMore; o.divHeight = !o.expandMore ? '120px' : '100%'}">
|
||||
{{!o.expandMore ? '查看更多' : '收起'}}
|
||||
</div>
|
||||
</div>
|
||||
</van-list>
|
||||
<van-empty description="暂无数据" v-else></van-empty>
|
||||
</template>
|
||||
|
||||
<van-tabbar @change="tabbarChange" v-model="tabbarActive">
|
||||
<van-tabbar-item icon="edit">填写</van-tabbar-item>
|
||||
<van-tabbar-item icon="friends-o">我的</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [mobileMixins],
|
||||
computed: {
|
||||
submitText() {
|
||||
if (!this.hasPermission) {
|
||||
return '无权限提交'
|
||||
}
|
||||
|
||||
if (moment().unix() > moment(this.actInfo.endTime).unix()) {
|
||||
return '已结束'
|
||||
} else if (moment().unix() < moment(this.actInfo.startTime).unix()) {
|
||||
return '未开始'
|
||||
} else {
|
||||
if (this.formData.id) {
|
||||
return '重新提交'
|
||||
} else {
|
||||
return '提交'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actId: GetQueryString("actId"),
|
||||
actInfo: {},
|
||||
formData: {
|
||||
loginName: null,
|
||||
selectHouseIdList: []
|
||||
},
|
||||
datePickerVisible: false,
|
||||
minDate: new Date(1960, 1, 1),
|
||||
maxDate: new Date(),
|
||||
datePickerTempVal: null,
|
||||
clickFormDateField: null,
|
||||
houseTypeList: [],
|
||||
tabbarActive: 0,
|
||||
validatorBoolean(value) {
|
||||
return value != null
|
||||
},
|
||||
hasPermission: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getHouseTypeList() {
|
||||
const resp = await $.post('/platform/tempActivity/house/getHouseTypeList/' + this.actId)
|
||||
if (resp.code === 0) {
|
||||
this.houseTypeList = resp.data
|
||||
}
|
||||
},
|
||||
showDatePicker(field) {
|
||||
this.clickFormDateField = field
|
||||
if (this.formData[field]) {
|
||||
this.datePickerTempVal = new Date(this.formData[field])
|
||||
} else {
|
||||
this.datePickerTempVal = this.minDate
|
||||
}
|
||||
this.datePickerVisible = true
|
||||
},
|
||||
confirmDate(time) {
|
||||
this.$set(this.formData, this.clickFormDateField, moment(time).format('YYYY-MM-DD'))
|
||||
this.datePickerVisible = false
|
||||
},
|
||||
async onSubmit(values) {
|
||||
if (!this.hasPermission) {
|
||||
return
|
||||
}
|
||||
|
||||
const methodName = this.formData.id ? "/doEdit" : "/doAdd"
|
||||
if (methodName === '/doAdd' && this.tableData.length > 0) {
|
||||
vant.Toast('您已经提交过了,请到我的页面查看')
|
||||
return
|
||||
}
|
||||
|
||||
if (this.formData.selectHouseIdList.length === 0) {
|
||||
vant.Toast('请至少选择一种房型')
|
||||
return
|
||||
}
|
||||
|
||||
const fd = clone(this.formData)
|
||||
fd.selectHouseIdList = fd.selectHouseIdList.map(v => {
|
||||
return {houseTypeId: v}
|
||||
})
|
||||
fd.actId = this.actId
|
||||
const toast = vant.Toast.loading({
|
||||
duration: 0,
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
message: '提交中',
|
||||
})
|
||||
const resp = await $.post('/platform/tempActivity/house/mobileForm' + methodName, {
|
||||
tempActHouseUserSel: JSON.stringify(fd)
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
if (resp.code === 0) {
|
||||
toast.message = '提交成功'
|
||||
toast.type = 'success'
|
||||
} else {
|
||||
toast.message = '提交失败'
|
||||
toast.type = 'fail'
|
||||
}
|
||||
setTimeout(() => {
|
||||
toast.clear()
|
||||
}, 500)
|
||||
}, 1500)
|
||||
|
||||
this.tableData = []
|
||||
this.pageForm.pageNumber = 1
|
||||
this.pageForm.pageSize = 5
|
||||
await this.getApplyData()
|
||||
|
||||
},
|
||||
|
||||
houseTypeToggle(id) {
|
||||
const selectHouseIdList = this.formData.selectHouseIdList
|
||||
const index = selectHouseIdList.findIndex(v => v === id)
|
||||
if (index > -1) {
|
||||
this.$refs.checkboxes.find(v => v.name === id).toggle()
|
||||
} else {
|
||||
if (selectHouseIdList.length < 3) {
|
||||
this.$refs.checkboxes.find(v => v.name === id).toggle()
|
||||
} else {
|
||||
vant.Toast('最多只能选择三项')
|
||||
}
|
||||
}
|
||||
},
|
||||
checkIsEdit() {
|
||||
const id = GetQueryString("id")
|
||||
if (id) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
async getActInfo() {
|
||||
const resp = await $.post('/platform/tempActivity/house/getActInfo/' + this.actId)
|
||||
if (resp.code === 0) {
|
||||
this.actInfo = resp.data
|
||||
}
|
||||
},
|
||||
tabbarChange(val) {
|
||||
|
||||
},
|
||||
//获取申请记录
|
||||
async getApplyData() {
|
||||
const params = clone(this.pageForm)
|
||||
params.actId = this.actId
|
||||
const resp = await $.post('/platform/tempActivity/house/getApplyData', params)
|
||||
if (resp.code === 0) {
|
||||
|
||||
resp.data.list.forEach(v => {
|
||||
v.birthday = moment(v.birthday).format('YYYY-MM-DD')
|
||||
v.joinWorkTime = moment(v.joinWorkTime).format('YYYY-MM-DD')
|
||||
v.schoolTime = moment(v.schoolTime).format('YYYY-MM-DD')
|
||||
v.titleAsAssessmentTime = moment(v.titleAsAssessmentTime).format('YYYY-MM-DD')
|
||||
v.expandMore = false
|
||||
v.divHeight = '120px'
|
||||
})
|
||||
|
||||
if (resp.data.list.length === 0) {
|
||||
this.tableData = []
|
||||
this.loading = false
|
||||
this.finished = true
|
||||
} else {
|
||||
this.tableData = this.tableData.concat(resp.data.list)
|
||||
}
|
||||
if (this.tableData.length === resp.data.totalCount) {
|
||||
this.finished = true
|
||||
} else {
|
||||
this.pageForm.pageNumber++
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
this.mLoading = false
|
||||
},
|
||||
goEdit(o) {
|
||||
const co = clone(o)
|
||||
co.selectHouseIdList = co.selectHouseIdList.map(v => v.houseTypeId)
|
||||
this.formData = co
|
||||
this.tabbarActive = 0
|
||||
},
|
||||
initUserInfo() {
|
||||
this.$set(this.formData, 'loginName', "${@shiro.getPrincipalProperty('loginname')}")
|
||||
this.$set(this.formData, 'userName', "${@shiro.getPrincipalProperty('username')}")
|
||||
this.$set(this.formData, 'unitName', "${@shiro.getPrincipalProperty('unit').getName()}")
|
||||
this.$set(this.formData, 'birthday', "${@shiro.getPrincipalProperty('birthday')}")
|
||||
this.$set(this.formData, 'joinWorkTime', null)
|
||||
this.$set(this.formData, 'schoolTime', "${@shiro.getPrincipalProperty('schoolTime')}")
|
||||
this.$set(this.formData, 'titlePosition', null)
|
||||
this.$set(this.formData, 'titleAsAssessmentTime', null)
|
||||
this.$set(this.formData, 'isDoubleStaff', null)
|
||||
this.$set(this.formData, 'whetherToAllocate', null)
|
||||
this.$set(this.formData, 'selectHouseIdList', [])
|
||||
},
|
||||
async checkInWhiteList() {
|
||||
const actId = this.actId
|
||||
const loginName = "${@shiro.getPrincipalProperty('loginname')}"
|
||||
const resp = await $.post('/platform/tempActivity/house/checkInWhiteList/' + actId + '/' + loginName)
|
||||
return resp
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
if (!this.actId) {
|
||||
vant.Toast('参数不合法')
|
||||
return
|
||||
}
|
||||
const isWhiteUserResp = await this.checkInWhiteList()
|
||||
if (isWhiteUserResp.code !== 0) {
|
||||
this.hasPermission = false
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: isWhiteUserResp.msg,
|
||||
}).then(() => {
|
||||
const agent = window.navigator.userAgent.toLowerCase()
|
||||
if (agent.match(/MicroMessenger/i)) {
|
||||
WeixinJSBridge.call('closeWindow')
|
||||
} else {
|
||||
window.close()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.hasPermission = true
|
||||
}
|
||||
this.getActInfo()
|
||||
this.getHouseTypeList()
|
||||
this.getApplyData()
|
||||
this.checkIsEdit()
|
||||
this.initUserInfo()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,362 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.imgFileClass .el-upload {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card class="mt20" shadow="never">
|
||||
<table-tool :app="this" label="住宅预申购调查">
|
||||
<template #func>
|
||||
<el-button @click="openAdd" size="small" type="primary">添加活动</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder" header-align="center">
|
||||
<el-table-column align="center" header-align="center" label="序号" type="index" width="80">
|
||||
<template scope="scope">
|
||||
<span>{{ scope.$index + (pageForm.pageNumber - 1) * pageForm.pageSize + 1 }} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template scope="{row}" v-if="column.prop=='houseTypeList'">
|
||||
<el-link @click="openView(row)" type="primary">查看户型</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column header-align="center" label="操作" width="400px">
|
||||
<template scope="scope">
|
||||
<el-button @click="generateQrCode(scope.row.id)" size="mini" type="primary">活动二维码</el-button>
|
||||
<el-button @click="openViewHasSelUsers(scope.row)" size="mini" type="primary">查看填写情况</el-button>
|
||||
<el-button @click="openEdit(scope.row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="doDelete(scope.row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" :rules="rules" label-width="120px" ref="form">
|
||||
<vi-title title="基本信息"></vi-title>
|
||||
<el-form-item label="活动名称" prop="actName">
|
||||
<el-input clearable maxlength="30" v-model="formData.actName"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker clearable
|
||||
style="width: 100%"
|
||||
type="datetime"
|
||||
v-model="formData.startTime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :xs="24">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker clearable
|
||||
style="width: 100%"
|
||||
type="datetime"
|
||||
v-model="formData.endTime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<vi-title2 title="房型信息">
|
||||
<template #func>
|
||||
<el-button @click="addHouseType" size="small" type="primary">添加房型</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="formData.houseTypeList" header-align="center">
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column header-align="center" label="面积(㎡)" prop="area">
|
||||
<template scope="scope">
|
||||
<el-form-item :prop="'houseTypeList.'+scope.$index+'.area'"
|
||||
:rules="rules.area"
|
||||
label-width="0">
|
||||
<el-input-number :max="1000" :min="1" :precision="0"
|
||||
:step="1"
|
||||
v-model="scope.row.area"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column header-align="center" label="数量" prop="number">
|
||||
<template scope="scope">
|
||||
<el-form-item :prop="'houseTypeList.'+scope.$index+'.number'"
|
||||
:rules="rules.number"
|
||||
label-width="0">
|
||||
<el-input-number :max="1000" :min="1" :precision="0"
|
||||
:step="1"
|
||||
v-model="scope.row.number"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column header-align="center" label="预览图" prop="number">
|
||||
<template scope="scope">
|
||||
<el-form-item :prop="'houseTypeList.'+scope.$index+'.imgFiles'"
|
||||
:rules="rules.imgFiles"
|
||||
label-width="0">
|
||||
<file-upload :files.sync="scope.row.imgFiles"
|
||||
:max="1"
|
||||
:type="['jpg', 'jpeg', 'png']"
|
||||
class="imgFileClass"></file-upload>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button @click="$refs.guava.index()">取消</el-button>
|
||||
<el-button @click="doSubmit" type="primary">提交</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<vi-title2 title="已选择人员">
|
||||
<template #func>
|
||||
<el-button @click="doExportHasSelUsers" size="small" type="primary">导出</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="hasSelectedUser">
|
||||
<el-table-column label="序号" type="index"></el-table-column>
|
||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginName"></el-table-column>
|
||||
<el-table-column label="所在单位" prop="unitName"></el-table-column>
|
||||
<el-table-column label="出生年月" prop="birthday"></el-table-column>
|
||||
<el-table-column label="参加工作时间" prop="joinWorkTime"></el-table-column>
|
||||
<el-table-column label="进校时间" prop="schoolTime"></el-table-column>
|
||||
<el-table-column label="职称职务" prop="titlePosition"></el-table-column>
|
||||
<el-table-column label="职称职务评定时间" prop="titleAsAssessmentTime"></el-table-column>
|
||||
<el-table-column label="是否双职工" prop="isDoubleStaff">
|
||||
<template scope="scope">
|
||||
{{scope.row.isDoubleStaff ? '√':'×'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否服从调配" prop="whetherToAllocate">
|
||||
<template scope="scope">
|
||||
{{scope.row.whetherToAllocate ? '√':'×'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="选择的户型">
|
||||
<el-table-column :label="item.label" v-for="item in viewActHouseTypeList">
|
||||
<template scope="scope">
|
||||
|
||||
{{scope.row.selectHouseIdList.map(v=>v.houseTypeId).includes(item.prop) ? '√' :''}}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="viewDialogVisible" title="查看" width="60%">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item :span="2" label="名称">
|
||||
{{viewData.actName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间">
|
||||
{{viewData.startTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="结束时间">
|
||||
{{viewData.endTime}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<el-carousel class="mt20" height="500px">
|
||||
<el-carousel-item :key="item" v-for="item in viewData.houseTypeList">
|
||||
<div style="position:relative;">
|
||||
<h4 style="color: #0e78c5">
|
||||
面积:{{item.area + 'm²'}}
|
||||
数量:{{item.number + '套'}}
|
||||
</h4>
|
||||
<el-image :src="APP_DOMAIN+'/file_server/fileStreamPreview?id='+item.imgFiles[0].id"
|
||||
@click="preview(item.imgFiles[0].filename,item.imgFiles[0].id)"></el-image>
|
||||
</div>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :visible.sync="qrCodeDialog" title="查看" width="500px">
|
||||
<div style="text-align: center">
|
||||
<qrcode :value="qrCodeUrl" :options="{ width: 400 }"></qrcode>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'table-upload': httpVueLoader('/components/plugins/TableUpload.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
houseTypeList: [
|
||||
{
|
||||
area: null,
|
||||
number: 1,
|
||||
imgFiles: null
|
||||
}
|
||||
],
|
||||
startTime: null,
|
||||
endTime: null
|
||||
},
|
||||
rules: {
|
||||
actName: [{required: true, message: '请输入名称', trigger: ['change', 'blur']}],
|
||||
startTime: [{required: true, message: '请选择开始时间', trigger: ['change', 'blur']}],
|
||||
endTime: [{required: true, message: '请选择结束时间', trigger: ['change', 'blur']}],
|
||||
area: [{required: true, message: '请输入面积', trigger: ['change', 'blur']}],
|
||||
number: [{required: true, message: '请输入数量', trigger: ['change', 'blur']}],
|
||||
imgFiles: [{required: true, message: '请上传户型图', trigger: ['change', 'blur']}],
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'actName', label: '名称',},
|
||||
{prop: 'startTime', label: '开始时间'},
|
||||
{prop: 'endTime', label: '结束时间'},
|
||||
{prop: 'houseTypeList', label: '户型'},
|
||||
],
|
||||
viewData: {
|
||||
houseTypeList: []
|
||||
},
|
||||
viewDialogVisible: false,
|
||||
hasSelectedUser: [],
|
||||
|
||||
viewActHouseTypeList: [],
|
||||
tableSelectRowId: null,
|
||||
qrCodeDialog: false,
|
||||
qrCodeUrl: 'https://www.baidu.com'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openAdd() {
|
||||
this.formData = {
|
||||
houseTypeList: [
|
||||
{
|
||||
area: null,
|
||||
number: 1,
|
||||
imgFiles: []
|
||||
}
|
||||
],
|
||||
startTime: null,
|
||||
endTime: null
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
addHouseType() {
|
||||
this.formData.houseTypeList.push({
|
||||
area: null,
|
||||
number: 1,
|
||||
imgFiles: []
|
||||
})
|
||||
},
|
||||
async doSubmit() {
|
||||
const valid = await this.$refs['form'].validate()
|
||||
if (!valid) return
|
||||
const reqMethod = this.formData.id ? '/doEdit' : '/doAdd'
|
||||
const resp = await $.post('/platform/tempActivity/house/actSetUp' + reqMethod, {
|
||||
tempActHouse: JSON.stringify(this.formData)
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.notifySuccess(resp.msg)
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
sublime.showLoadingbar()
|
||||
const resp = await $.post('/platform/tempActivity/house/actSetUp/pageData', this.pageForm)
|
||||
sublime.closeLoadingbar()
|
||||
if (resp.code === 0) {
|
||||
this.pageForm.totalCount = resp.data.totalCount
|
||||
this.tableData = resp.data.list
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
this.viewData = clone(row)
|
||||
this.viewDialogVisible = true
|
||||
},
|
||||
async openViewHasSelUsers(row) {
|
||||
this.tableSelectRowId = row.id
|
||||
const resp = await $.post('/platform/tempActivity/house/queryHasSelUser/' + row.id)
|
||||
if (resp.code === 0) {
|
||||
this.$refs.guava.view()
|
||||
resp.data.forEach(v => {
|
||||
v.birthday = moment(v.birthday).format('YYYY-MM-DD')
|
||||
v.joinWorkTime = moment(v.joinWorkTime).format('YYYY-MM-DD')
|
||||
v.schoolTime = moment(v.schoolTime).format('YYYY-MM-DD')
|
||||
v.titleAsAssessmentTime = moment(v.titleAsAssessmentTime).format('YYYY-MM-DD')
|
||||
})
|
||||
this.hasSelectedUser = resp.data
|
||||
}
|
||||
|
||||
this.viewActHouseTypeList = row.houseTypeList.map(v => {
|
||||
return {
|
||||
prop: v.id,
|
||||
label: v.area + 'm²',
|
||||
area: v.area
|
||||
}
|
||||
})
|
||||
this.viewActHouseTypeList.sort((a, b) => {
|
||||
return a['area'] - b['area']
|
||||
})
|
||||
|
||||
},
|
||||
openEdit(row) {
|
||||
this.formData = row
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
async doDelete(id) {
|
||||
const confirm = await this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if ('confirm' !== confirm) return
|
||||
const resp = await $.post('/platform/tempActivity/house/actSetUp/doDelete/' + id)
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
}
|
||||
},
|
||||
doExportHasSelUsers() {
|
||||
window.open('/platform/tempActivity/house/tableSelectRowId/' + this.tableSelectRowId)
|
||||
},
|
||||
generateQrCode(id) {
|
||||
this.qrCodeDialog = true
|
||||
this.qrCodeUrl = APP_DOMAIN + '/platform/tempActivity/house/mobileForm?actId=' + id
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user