commit
This commit is contained in:
@@ -1,470 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<h3 style="color: #1867b0">{{isEdit?'修改登记':'荣誉登记'}}</h3>
|
||||
</template>
|
||||
<el-form :model="formData" label-width="120px">
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="荣誉类型" prop="honorType">
|
||||
<el-select v-model="formData.honorType" @change="honorTypeChange">
|
||||
<el-option v-for="o in honorTypeList"
|
||||
:key="o.id"
|
||||
:label="o.name"
|
||||
:value="o.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-collapse v-model="collapse">
|
||||
<el-collapse-item title="" name="basic">
|
||||
<template slot="title">
|
||||
<div class="text-primary" style="width: 100%">
|
||||
基础信息
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="formData.honorType===HonorApi.honor_single_id">
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12" prop="userId">
|
||||
<el-form-item label="姓名" v-if="isEdit" prop="userName">
|
||||
<el-input v-model="formData.userName" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-else prop="userId" label="姓名">
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="formData.userId"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
reserve-keyword
|
||||
placeholder="请输入姓名或工号查找"
|
||||
:remote-method="userRemoteMethod"
|
||||
:loading="userLoading"
|
||||
@change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="userSex">
|
||||
<el-radio-group v-model="formData.userSex">
|
||||
<el-radio-button label="男"></el-radio-button>
|
||||
<el-radio-button label="女"></el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属单位" prop="unitId">
|
||||
<el-select placeholder="所属单位" v-model="formData.unitId" clearable
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in units"
|
||||
:label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属工会" prop="unionId">
|
||||
<el-select placeholder="所属工会" v-model="formData.unionId" clearable
|
||||
style="width: 100%;"
|
||||
clearable="true"
|
||||
filterable="true">
|
||||
<el-option v-for="item in unions"
|
||||
:label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生日" prop="birthday">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.birthday"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="政治面貌" prop="political">
|
||||
<el-input v-model="formData.political"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="在职状态" prop="jobStatus">
|
||||
<el-input v-model="formData.jobStatus"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="职称" prop="title">
|
||||
<el-input v-model="formData.title"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="加入工会时间" prop="joinTime">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.joinTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="担任工会职务" prop="post">
|
||||
<el-input v-model="formData.post"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-row type="flex">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申报院级工会" prop="unionId">
|
||||
<el-select placeholder="请选择申报院级工会" v-model="formData.unionId"
|
||||
style="width: 100%;"
|
||||
disabled
|
||||
clearable="true"
|
||||
filterable
|
||||
@change="searchUnionInfo(formData.unionId)">
|
||||
<el-option v-for="item in unions"
|
||||
:label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工会主席" prop="unionLeader">
|
||||
<el-input v-model="formData.unionLeader"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row type="flex">
|
||||
<!--<el-col :span="8">
|
||||
<el-form-item label="单位负责人" prop="unitLeader">
|
||||
<el-input v-model="formData.unitLeader"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="单位人数" prop="unitPeopleNum">
|
||||
<el-input-number v-model="formData.unitPeopleNum" :min="0"
|
||||
:max="2000" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="女职工人员" prop="unitFemalePeopleNum">
|
||||
<el-input-number
|
||||
v-model.number="formData.unitFemalePeopleNum" :min="0"
|
||||
:max="2000" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="会员人数" prop="memberNumber">
|
||||
<el-input-number v-model="formData.memberNumber" :min="0"
|
||||
:max="2000" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工会小组数" prop="unionGroupNumber">
|
||||
<el-input-number v-model="formData.unionGroupNumber" :min="0"
|
||||
:max="2000" style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="获奖信息" name="prize">
|
||||
<template slot="title">
|
||||
<div class="text-primary" style="width: 100%">
|
||||
获奖信息
|
||||
</div>
|
||||
</template>
|
||||
<template>
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="奖项" prop="prize">
|
||||
<el-select v-model="formData.prize">
|
||||
<el-option v-for="o in honorPrizeList"
|
||||
:key="o.id"
|
||||
:label="o.name"
|
||||
:value="o.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="获奖材料" prop="awardMaterials">
|
||||
<el-select v-model="formData.awardMaterials" multiple>
|
||||
<el-option v-for="o in honorAwardList"
|
||||
:key="o.id"
|
||||
:label="o.name"
|
||||
:value="o.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--<el-col :span="12">
|
||||
<el-form-item label="奖项说明" prop="prizeDesc">
|
||||
<el-input v-model="formData.prizeDesc" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="授予单位" prop="grantUnit">
|
||||
<el-input v-model="formData.grantUnit"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="授予时间">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="formData.grantDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
<el-col :span="12" v-if="formData.honorType==HonorApi.honor_list_id">
|
||||
<el-form-item label="参加比赛名称" prop="gameName">
|
||||
<el-input v-model="formData.gameName" maxlength="100"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="级别">
|
||||
<el-select v-model="formData.honorLevel" placeholder="">
|
||||
<el-option v-for="o in honorLevelList"
|
||||
:key="o.id"
|
||||
:label="o.name"
|
||||
:value="o.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-row type="flex" :gutter="20">
|
||||
<!--<el-col :span="12">
|
||||
<el-form-item label="存档情况" prop="archiveStatus">
|
||||
<el-input v-model="formData.archiveStatus"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
</el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="附件" prop="files">
|
||||
<file-upload card :files.sync="formData.files" :max-size="50 * 1024 * 1024"></file-upload>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
</el-form>
|
||||
<el-row class="m20 text-right">
|
||||
<el-button v-if="GetQueryString('id') !== ''" @click="doBack">返回</el-button>
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var vue = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
units: [],
|
||||
unions: [],
|
||||
honorTypeList: [],
|
||||
honorLevelList: [],
|
||||
honorAwardList: [],
|
||||
honorPrizeList: [],
|
||||
collapse: ['basic', 'prize'],
|
||||
formData: {},
|
||||
userLoading: false,
|
||||
userOptions: [],
|
||||
isEdit: GetQueryString("id") && GetQueryString("id") !== '',
|
||||
firstInPage: true,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
},
|
||||
methods: {
|
||||
doBack() {
|
||||
if (GetQueryString("id") !== '') {
|
||||
sublime.jumpPagePjax('/platform/honor/manage')
|
||||
}
|
||||
},
|
||||
async userChange() {
|
||||
const user = await queryUserById(this.formData.userId)
|
||||
this.setFormData(user)
|
||||
},
|
||||
setFormData(user) {
|
||||
this.$set(this.formData, "userSex", user[0].sex)
|
||||
this.$set(this.formData, "userName", user[0].username)
|
||||
this.$set(this.formData, "unitId", user[0].unitid)
|
||||
this.$set(this.formData, "unionId", user[0].unionid)
|
||||
this.$set(this.formData, "birthday", user[0].birthday)
|
||||
this.$set(this.formData, "title", user[0].jobTitle)
|
||||
//this.$set(this.formData, "post", user[0].position)
|
||||
this.$set(this.formData, "unionName", user[0].unionname)
|
||||
this.$set(this.formData, "unitName", user[0].unitname)
|
||||
this.$set(this.formData, "jobStatus", user[0].userState)
|
||||
this.$set(this.formData, "political", user[0].political)
|
||||
},
|
||||
async userRemoteMethod(query) {
|
||||
if (query) {
|
||||
this.userLoading = true
|
||||
const arr = await searchUser(query)
|
||||
this.userOptions = arr
|
||||
this.userLoading = false
|
||||
}
|
||||
},
|
||||
async initData() {
|
||||
this.honorTypeList = await HonorApi.getHonorType()
|
||||
if (this.honorTypeList) {
|
||||
this.formData = {
|
||||
honorType: this.honorTypeList[0].id
|
||||
}
|
||||
this.honorPrizeList = await HonorApi.getHonorPrize(this.formData.honorType)
|
||||
}
|
||||
this.honorLevelList = await HonorApi.getHonorLevel()
|
||||
this.honorAwardList = await HonorApi.getHonorAwardType()
|
||||
this.units = await getUnits(null)
|
||||
this.unions = await getUnions(null)
|
||||
this.$set(this.formData, 'unionId', "${@shiro.getPrincipalProperty('union').getId()}")
|
||||
await this.searchUnionInfo(this.formData.unionId)
|
||||
},
|
||||
async searchUnionInfo(id){
|
||||
const resp = await $.get('/platform/projectfunding/declare/getUnionInfo',{id:id})
|
||||
if (resp.code === 0){
|
||||
this.formData.memberNumber = resp.data.memberNumber;
|
||||
this.formData.unionLeader = resp.data.username;
|
||||
}
|
||||
const data = await unionGroupsByUnionId(id)
|
||||
this.formData.unionGroupNumber = data.length
|
||||
},
|
||||
async honorTypeChange(val) {
|
||||
this.$set(this.formData, "prize", null)
|
||||
this.honorPrizeList = await HonorApi.getHonorPrize(val)
|
||||
},
|
||||
async doSubmit() {
|
||||
this.formData.awardMaterials = JSON.stringify(this.formData.awardMaterials)
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post(loc() + '/doSubmit', this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: resp.msg,
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
sublime.jumpPagePjax('/platform/honor/manage')
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async findData(id) {
|
||||
const resp = await $.post(loc() + '/findData', {id: id})
|
||||
const data1 = clone(resp.data.data)
|
||||
this.honorPrizeList = await HonorApi.getHonorPrize(resp.data.data.honorType)
|
||||
this.formData = resp.data.data
|
||||
if (this.formData.userId && this.formData.userId !== '') {
|
||||
const user = await queryUserById(this.formData.userId)
|
||||
this.setFormData(user)
|
||||
} else {
|
||||
this.$set(this.formData, 'userName', this.formData.userName)
|
||||
}
|
||||
this.$set(this.formData, "prize", data1.prize)
|
||||
this.$set(this.formData, "honorLevel", data1.honorLevel)
|
||||
this.$set(this.formData, "political", data1.political)
|
||||
this.$set(this.formData, "post", data1.post)
|
||||
this.$set(this.formData, "title", data1.title)
|
||||
this.$set(this.formData, "unionId", data1.unionId)
|
||||
this.$set(this.formData, "unionLeader", data1.unionLeader)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
"formData.prize"(newVal) {
|
||||
if (this.firstInPage === false && newVal) {
|
||||
this.$set(this.formData, "honorLevel", this.honorPrizeList.find(v => v.id === newVal).level)
|
||||
this.firstInPage = false
|
||||
}
|
||||
},
|
||||
"formData.unitName"(newVal) {
|
||||
const isExist = this.units.some(v => v.name == newVal)
|
||||
if(this.formData.honorType === HonorApi.honor_single_id) {
|
||||
if (isExist) {
|
||||
const unionId = this.units.find(v => v.name == newVal).unionid
|
||||
this.$set(this.formData, "unionId", unionId ? unionId : "")
|
||||
} else {
|
||||
this.$set(this.formData, "unionId", "")
|
||||
}
|
||||
}
|
||||
},
|
||||
"formData.unionId"(newVal) {
|
||||
if(this.formData.honorType === HonorApi.honor_list_id) {
|
||||
if(this.firstInPage === false) {
|
||||
const un = this.unions.find(o => o.id === newVal)
|
||||
this.formData.unionLeader = un ? un.leadername : ''
|
||||
this.formData.unionName = un ? un.unionname : ''
|
||||
} else {
|
||||
this.firstInPage = false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.initData()
|
||||
if (GetQueryString("id") !== '') {
|
||||
await this.findData(GetQueryString("id"))
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user