Browse Source

Merge remote-tracking branch 'origin/master' into feature/lc_partyGroup

feature/syp_points
liuchuang 5 years ago
parent
commit
748230562d
  1. 24
      src/views/modules/heart/actbanner-add-or-update.vue
  2. 24
      src/views/modules/heart/actbanner.vue
  3. 42
      src/views/modules/heart/actinfo-add-or-update.vue
  4. 23
      src/views/modules/heart/actinfo-list.vue
  5. 154
      src/views/modules/heart/actinfo-pull.vue
  6. 47
      src/views/modules/heart/actuserclock-detail.vue
  7. 41
      src/views/modules/news/news-add-or-update.vue
  8. 39
      src/views/modules/news/news-publish.vue
  9. 2
      src/views/modules/news/news.vue

24
src/views/modules/heart/actbanner-add-or-update.vue

@ -23,6 +23,16 @@
class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</el-form-item>
<el-form-item label="banner类型" prop="bannerType">
<el-select v-model="dataForm.bannerType" placeholder="请选择类型">
<el-option
v-for="item in optionBannerType"
:key="item.dictValue"
:label="item.dictName"
:value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
</el-row>
<el-form-item label="排序" prop="sort">
<el-input-number v-model="dataForm.sort" :min="0" :max="4"></el-input-number>
@ -62,6 +72,7 @@ export default {
updatedTime: '',
sort: 0
},
optionBannerType: [],
//
loading: false,
uploadUrl: ''
@ -76,6 +87,9 @@ export default {
bannerImg: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
bannerType: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sort: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
@ -83,6 +97,7 @@ export default {
}
},
created () {
this.getListBannerTypeByHeartImgType()
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.dataForm.bannerImg = ''
},
@ -96,6 +111,15 @@ export default {
}
})
},
// banner
getListBannerTypeByHeartImgType () {
this.$http.get(`/heart/actbanner/getBannerType/volunteerBannerType`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.optionBannerType = res.data
}).catch(() => {})
},
//
getInfo () {
this.$http.get(`/heart/actbanner/${this.dataForm.id}`).then(({ data: res }) => {

24
src/views/modules/heart/actbanner.vue

@ -18,6 +18,7 @@
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column label="序号" type="index" show-overflow-tooltip align="center" width="50"></el-table-column>
<el-table-column prop="title" label="标题" header-align="center" align="center"></el-table-column>
<el-table-column align="center" label="Banner类型" :show-overflow-tooltip="true" prop="bannerType" :formatter="bannerTypeFormat"></el-table-column>
<el-table-column align="center" label="Banner图片" :show-overflow-tooltip="true" prop="bannerImg">
<template slot-scope="scope">
<el-popover placement="right"
@ -78,12 +79,16 @@ export default {
status: '',
startTime: '',
endTime: ''
}
},
optionBannerType: []
}
},
components: {
AddOrUpdate
},
created () {
this.getListBannerTypeByHeartImgType()
},
methods: {
changeGroundingText (status) {
let state = status
@ -101,7 +106,22 @@ export default {
return '下架'
}
},
// banner
getListBannerTypeByHeartImgType () {
this.$http.get(`/heart/actbanner/getBannerType/volunteerBannerType`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.optionBannerType = res.data
}).catch(() => {})
},
bannerTypeFormat (row, column) {
for (var property in this.optionBannerType) {
if (row.bannerType === this.optionBannerType[property].dictValue) {
return this.optionBannerType[property].dictName
}
}
},
changeGroundingHandle: debounce(function (row) {
this.$confirm(this.$t('prompt.info', { 'handle': this.changeGroundingText(row.status) }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),

42
src/views/modules/heart/actinfo-add-or-update.vue

@ -59,7 +59,6 @@
type="datetime"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
:picker-options="isSignupEndTime"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
@ -69,14 +68,14 @@
prop="actQuota">
<template>
<el-radio v-model="dataForm.actQuotaCategory"
label="1">固定名额</el-radio>&emsp;&emsp;
:label="1">固定名额</el-radio>&emsp;&emsp;
<el-input-number type="number"
:min="1"
v-model="dataForm.actQuota"
placeholder="固定名额"
style="width:150px"></el-input-number>&emsp; &emsp;&emsp;
<el-radio v-model="dataForm.actQuotaCategory"
label="0">不限名额</el-radio>
:label="0">不限名额</el-radio>
</template>
<div>
<font color="gray">报名未审核人员</font>
@ -290,7 +289,7 @@ export default {
headPic: '',
signupStartTime: '',
signupEndTime: '',
actQuotaCategory: '1',
actQuotaCategory: 1,
actStartTime: '',
actEndTime: '',
actAddress: '',
@ -315,11 +314,6 @@ export default {
reward: '',
actUserDefaultState: '1'
},
isSignupEndTime: {
disabledDate (time) {
return time < Date.now() - 8.64e7 // 8.64e7=1000*60*60*24
}
},
isImgRequired: true,
mapSelectVisible: false,
signInIsAble: true,
@ -369,6 +363,10 @@ export default {
}
}
},
mounted () {
this.dataForm.id = this.$route.query.id
this.init()
},
created () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
@ -592,22 +590,11 @@ export default {
...this.dataForm,
...res.data
}
this.quillEditor.root.innerHTML = this.dataForm.actContent
}).catch(() => { })
},
//
dataFormSubmitHandle: debounce(function () {
if (new Date() >= new Date(this.dataForm.signupEndTime)) {
return this.$message.error('报名截止时间必须大于当前时间')
}
if (this.dataForm.actStartTime >= this.dataForm.actEndTime) {
return this.$message.error('活动结束时间必须大于活动开始时间')
}
if (this.dataForm.actStartTime <= this.dataForm.signupEndTime) {
return this.$message.error('活动开始时间必须大于报名截止时间')
}
if (this.dataForm.actEndTime > this.dataForm.signinEndTime) {
return this.$message.error('打卡结束时间必须大于或等于活动结束时间')
}
if ((this.dataForm.actContent).length > 10000) {
return this.$message.error('您输入的的内容已超过字数')
}
@ -618,19 +605,6 @@ export default {
if (!valid) {
return false
}
var signUpEndTime = new Date(Date.parse(this.dataForm.signupEndTime))
var actStarTime = new Date(Date.parse(this.dataForm.actStartTime))
var actEndTime = new Date(Date.parse(this.dataForm.actEndTime))
var signinEndTime = new Date(Date.parse(this.dataForm.signinEndTime))
if (signUpEndTime > actStarTime) {
return this.$message.error('活动开始时间必须大于报名截止时间.')
}
if (actEndTime < actStarTime) {
return this.$message.error('活动结束时间必须大于活动开始时间.')
}
if (signinEndTime < actEndTime) {
return this.$message.error('签到结束时间必须大于活动结束时间.')
}
this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false

23
src/views/modules/heart/actinfo-list.vue

@ -58,7 +58,10 @@
<el-button v-if="$hasPermission('heart:actinfo:join')" type="text" size="small" @click="joinManage(scope.row.id)">报名管理</el-button>
<el-button v-if="$hasPermission('heart:actinfo:clock')" type="text" :disabled="scope.row.actStatus ==='0'? true :false" size="small" @click="clockManage(scope.row.id)">打卡积分</el-button>
</div>
<div>
<el-button type="text" size="small" @click="updateHandle(scope.row)">编辑活动</el-button>
<el-button type="text" size="small" @click="pullHandle(scope.row)">新闻发稿</el-button>
</div>
</template>
</el-table-column>
</el-table>
@ -77,7 +80,7 @@
<actuserrelation v-if="actUserRelationVisible" ref="actUserRelation" @refreshDataList="getDataList"></actuserrelation>
<actinfo-cancel v-if="actInfoCancelVisible" ref="actinfoCancel" @refreshDataList="getDataList"></actinfo-cancel>
<actuserclocklog v-if="actUserClockLogVisible" ref="actUserClockLog" @refreshDataList="getDataList"></actuserclocklog>
<actinfo-pull v-if="actinfoPullVisible" ref="actinfoPull" @refreshDataList="getDataList"></actinfo-pull>
</div>
</el-card>
</template>
@ -89,6 +92,7 @@ import ActinfoDetailView from './actinfo-detail-view'
import ActUserRelation from './actuserrelation'
import ActinfoCancel from './actinfo-cancel'
import ActUserClockLog from './actuserclocklog'
import ActinfoPull from './actinfo-pull'
export default {
mixins: [mixinViewModule],
name: 'ActInfoList',
@ -108,6 +112,7 @@ export default {
actUserRelationVisible: false,
actInfoCancelVisible: false,
actUserClockLogVisible: false,
actinfoPullVisible: false,
pickerBeginDateBefore: {
disabledDate: (time) => {
let beginDateVal = this.dataForm.startTime
@ -131,7 +136,8 @@ export default {
ActinfoDetailView,
ActUserRelation,
ActinfoCancel,
ActUserClockLog
ActUserClockLog,
ActinfoPull
},
created: function () {
this.getDataList()
@ -172,6 +178,17 @@ export default {
this.$refs.actinfoCancel.init()
})
}
},
pullHandle (row) {
this.actinfoPullVisible = true
this.$nextTick(() => {
this.$refs.actinfoPull.dataForm.id = row.id
this.$refs.actinfoPull.init()
})
},
updateHandle (row) {
this.$parent.selectComponent = 'ActInfoAdd'
this.$router.push({ path: '/heart-actinfo', query: { id: row.id } })
}
}
}

154
src/views/modules/heart/actinfo-pull.vue

@ -0,0 +1,154 @@
<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="120px">
<el-form-item prop="actNewsContent" label="活动新闻稿">
<!-- 富文本编辑器, 容器 -->
<div id="J_quillEditor"></div>
<!-- 自定义上传图片功能 (使用element upload组件) -->
<el-upload
:action="uploadUrl"
:show-file-list="false"
:before-upload="uploadBeforeUploadHandle"
:on-success="uploadSuccessHandle"
style="display: none;">
<el-button ref="uploadBtn" type="primary" size="small">{{ $t('upload.button') }}</el-button>
</el-upload>
</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 Cookies from 'js-cookie'
import debounce from 'lodash/debounce'
import 'quill/dist/quill.snow.css'
import Quill from 'quill'
export default {
data () {
return {
visible: false,
quillEditor: null,
quillEditorToolbarOptions: [
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block', 'image'],
[{ 'header': 1 }, { 'header': 2 }],
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
[{ 'script': 'sub' }, { 'script': 'super' }],
[{ 'indent': '-1' }, { 'indent': '+1' }],
[{ 'direction': 'rtl' }],
[{ 'size': ['small', false, 'large', 'huge'] }],
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }],
[{ 'font': [] }],
[{ 'align': [] }],
['clean']
],
uploadUrl: '',
dataForm: {
id: '',
actNewsContent: ''
}
}
},
computed: {
dataRule () {
var validateContent = (rule, value, callback) => {
if (this.quillEditor.getLength() <= 1) {
return callback(new Error(this.$t('validate.required')))
}
callback()
}
return {
actNewsContent: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ validator: validateContent, trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
if (this.quillEditor) {
this.quillEditor.deleteText(0, this.quillEditor.getLength())
} else {
this.quillEditorHandle()
}
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
quillEditorHandle () {
this.quillEditor = new Quill('#J_quillEditor', {
modules: {
toolbar: this.quillEditorToolbarOptions
},
theme: 'snow'
})
// (使element upload)
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/oss/file/upload?token=${Cookies.get('token')}`
this.quillEditor.getModule('toolbar').addHandler('image', () => {
this.$refs.uploadBtn.$el.click()
})
//
this.quillEditor.on('text-change', () => {
this.dataForm.actNewsContent = this.quillEditor.root.innerHTML
})
},
//
uploadBeforeUploadHandle (file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
return false
}
},
//
uploadSuccessHandle (res, file, fileList) {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url)
},
//
getInfo () {
this.$http.get(`/heart/actinfo/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = res.data
this.quillEditor.root.innerHTML = this.dataForm.actNewsContent
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', 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>

47
src/views/modules/heart/actuserclock-detail.vue

@ -104,6 +104,11 @@
></el-image>
</template>
</el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button :disabled="scope.row.shieldFlag == 1" type="text" @click="upShieldFlag(scope.row.id)">屏蔽</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
@ -145,14 +150,18 @@ export default {
latitude: '',
longitude: '',
radius: 200,
clockPic: []
clockPic: [],
shieldFlag: ''
},
previewImgList: [],
isAble: false
isAble: false,
isEdit: false,
actUseId: ''
}
},
mounted () {
this.dataForm.id = this.$route.query.id
this.actUseId = this.$route.query.id
this.dataForm.actId = this.$route.query.actId
this.init()
},
@ -282,12 +291,6 @@ export default {
...this.dataForm,
...res.data
}
// if (res.data.status != '5' && res.data.status != '6') {
// this.dataForm.status = '5';
// this.dataForm.failureReason = '';
// } else {
// this.isAble = true;
// }
this.setMap(res.data)
this.getDataList()
@ -357,7 +360,33 @@ export default {
},
1000,
{ leading: true, trailing: false }
)
),
//
upShieldFlag (id) {
this.$confirm('确定屏蔽打卡记录?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.dataForm.shieldFlag = 1
this.dataForm.id = id
this.$http['post']('/heart/actuserclocklog/updateShieldFlag', 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.dataForm.id = this.actUseId
this.getDataList()
}
})
}).catch(() => {})
}).catch(() => {
})
}
}
}
</script>

41
src/views/modules/news/news-add-or-update.vue

@ -11,43 +11,10 @@
<el-form-item label="所属机构">
<el-cascader v-model="dataForm.allDeptIdsShow"
:options="options"
:props="{ checkStrictly: true }"
clearable></el-cascader>
:props="{ multiple: true }"
clearable
collapse-tags></el-cascader>
</el-form-item>
<!--<el-form-item label="所属街道"
prop="streetId">
<el-select v-model="dataForm.streetId"
@change="changeStreet"
placeholder="所属街道">
<el-option v-for="item in streetList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属社区">
<el-select v-model="dataForm.communityId"
@change="changeCommunity"
placeholder="所属社区">
<el-option v-for="item in communityList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属网格">
<el-select v-model="dataForm.gridId"
@change="changeGrid"
placeholder="所属网格">
<el-option v-for="item in gridList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>-->
<el-form-item label="类别"
prop="newsCateroryId">
<el-select v-model="dataForm.newsCateroryId"
@ -188,7 +155,7 @@ export default {
},
created () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
.get(`/sys/user/deptOptions/getAllByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

39
src/views/modules/news/news-publish.vue

@ -15,40 +15,6 @@
clearable
collapse-tags></el-cascader>
</el-form-item>
<!--<el-form-item label="所属街道"
prop="streetId">
<el-select v-model="dataForm.streetId"
@change="changeStreet"
placeholder="所属街道">
<el-option v-for="item in streetList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属社区">
<el-select v-model="dataForm.communityId"
@change="changeCommunity"
placeholder="所属社区">
<el-option v-for="item in communityList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属网格">
<el-select v-model="dataForm.gridId"
@change="changeGrid"
placeholder="所属网格">
<el-option v-for="item in gridList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>-->
</el-row>
<el-row>
<el-form-item label="类别"
@ -198,11 +164,6 @@ export default {
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
this.getListCategory()
},
watch: {
'dataForm.allDeptIdsShow': function (val) {
console.log(this.dataForm.allDeptIdsShow);
}
},
created () {
this.$http
.get(`/sys/user/deptOptions/getAllByLoginUser`)

2
src/views/modules/news/news.vue

@ -214,7 +214,7 @@ export default {
},
created () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
.get(`/sys/user/deptOptions/getAllByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

Loading…
Cancel
Save