体育活动创建可以沿用,承办单位选填;导出出现重复人员修复;优化增加外援功能,也可以导出;报名界面的设置领导以及教练不能删除修复
This commit is contained in:
@@ -450,6 +450,8 @@ layout("/layouts/platform.html"){
|
||||
prop="mobile" header-align="center" align="center"
|
||||
label="电话">
|
||||
</el-table-column>
|
||||
<el-table-column prop="birthday" header-align="center" align="center"
|
||||
label="出生年月"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
align="center" header-align="center" label="年龄"
|
||||
@@ -641,6 +643,8 @@ layout("/layouts/platform.html"){
|
||||
prop="mobile" header-align="center" align="center"
|
||||
label="电话">
|
||||
</el-table-column>
|
||||
<el-table-column prop="birthday" header-align="center" align="center"
|
||||
label="出生年月"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
prop="sex" header-align="center" align="center"
|
||||
@@ -714,7 +718,7 @@ layout("/layouts/platform.html"){
|
||||
:visible.sync="dialogLeaderCoach"
|
||||
width="60%"
|
||||
>
|
||||
<el-form :model="headData" ref="form" :rules="formRules" label-width="100px">
|
||||
<el-form :model="headData" ref="leaderCoachForm" :rules="formRules" label-width="100px">
|
||||
<el-row gutter="20">
|
||||
<!-- <el-col :span="12">
|
||||
<vi-title title="填写团长信息"></vi-title>
|
||||
@@ -878,7 +882,7 @@ layout("/layouts/platform.html"){
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogLeaderCoach = false">取 消</el-button>
|
||||
<el-button type="primary" plain @click="doLeaderCoach">确 认</el-button>
|
||||
<el-button type="primary" plain :loading="formLoading" @click="doLeaderCoach">确 认</el-button>
|
||||
</span>
|
||||
|
||||
</el-dialog>
|
||||
@@ -902,25 +906,10 @@ layout("/layouts/platform.html"){
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="username" label="姓  名">
|
||||
<el-select
|
||||
:remote-method="querySearchAsync"
|
||||
@change="addUserChange"
|
||||
filterable
|
||||
placeholder="请输入工号或者下姓名查询"
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
v-model="formData.userId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.username+'-'+item.loginname"
|
||||
:value="item.id"
|
||||
v-for="item in lsUserList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input maxlength="50" placeholder="请填写外援姓名" v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="loginname" label="工  号">
|
||||
<el-input disabled maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
<el-input disabled maxlength="50" placeholder="正在生成工号" v-model="formData.loginname"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性  别" prop="sex">
|
||||
@@ -943,21 +932,13 @@ layout("/layouts/platform.html"){
|
||||
v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="unitId" label="所在单位">
|
||||
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%"
|
||||
disabled v-model="formData.unitId">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input disabled v-model="formData.unitname"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAddUser">确 定</el-button>
|
||||
<el-button type="primary" :loading="formLoading" @click="doAddUser(false)">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
@@ -966,35 +947,37 @@ layout("/layouts/platform.html"){
|
||||
:visible.sync="dialogVisible2"
|
||||
width="40%"
|
||||
>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-width="100px">
|
||||
<el-form :model="formData" ref="singleExternalForm" :rules="lsryRules" label-width="100px">
|
||||
<el-form-item prop="username" label="姓  名">
|
||||
<el-input maxlength="50" placeholder="请填写姓名" v-model="formData.username"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="loginname" label="工  号">
|
||||
<el-input maxlength="50" placeholder="请填写工号" v-model="formData.loginname"
|
||||
<el-input disabled maxlength="50" placeholder="正在生成工号" v-model="formData.loginname"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="性  别" prop="sex">
|
||||
<el-radio-group v-model="formData.sex">
|
||||
<el-radio :label="'男'" border>男</el-radio>
|
||||
<el-radio :label="'女'" border>女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="出生年月" prop="birthday">
|
||||
<el-date-picker placeholder="选择出生年月" style="width: 100%" type="date"
|
||||
v-model="formData.birthday" value-format="yyyy-MM-dd"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="mobile" label="电  话">
|
||||
<el-input maxlength="50" placeholder="请填写电话" v-model="formData.mobile"
|
||||
<el-input maxlength="11" placeholder="请填写电话" v-model="formData.mobile"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="unitId" label="所在单位">
|
||||
<el-select clearable filterable placeholder="请选择所在单位" style="width: 100%"
|
||||
v-model="formData.unitId">
|
||||
<el-option
|
||||
v-for="item in unitOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input disabled v-model="formData.unitname"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible2 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAddUser2">确 定</el-button>
|
||||
<el-button type="primary" :loading="formLoading" @click="doAddUser(true)">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
@@ -1109,13 +1092,14 @@ layout("/layouts/platform.html"){
|
||||
// userId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
lsryRules: {
|
||||
username: [{required: true, message: '请填写姓名', trigger: 'blur'}],
|
||||
loginname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
sex: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
birthday: [{required: true, message: '请选择出生年月', trigger: 'change'}],
|
||||
mobile: [
|
||||
{required: true, message: '手机号码', trigger: ['blur', 'change']},
|
||||
{pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码'}],
|
||||
unitId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
userId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
submitLoading: false,
|
||||
selection: [],
|
||||
@@ -1141,54 +1125,6 @@ layout("/layouts/platform.html"){
|
||||
'delete_info': httpVueLoader('/components/activity/school/DeleteInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
//查找今年临时人员
|
||||
async getGhLsRy() {
|
||||
const resp = await $.get(loc() + "/getGhLsRy")
|
||||
return resp.data
|
||||
},
|
||||
async addUserChange(val) {
|
||||
const user = this.lsUserList.find(l => l.id === val)
|
||||
let loginname = "GHLS" + moment().format('YYYY') + "001"
|
||||
//如果数据库找不到此人
|
||||
if (!user) {
|
||||
const lsryUser = await this.getGhLsRy()
|
||||
//如果有临时人员
|
||||
if (lsryUser) {
|
||||
let str = lsryUser.loginname;
|
||||
let prefix = "GHLS";
|
||||
// 找到"GHLS"在字符串中首次出现的位置
|
||||
let index = str.indexOf(prefix);
|
||||
// 如果"GHLS"确实存在于字符串中,并且不是在字符串开头
|
||||
if (index !== -1 && index + prefix.length < str.length) {
|
||||
loginname = prefix + (Number(str.slice(index + prefix.length)) + 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
this.$set(this.formData, 'userId', user ? user.id : val)
|
||||
this.$set(this.formData, 'loginname', user ? user.loginname : loginname)
|
||||
this.$set(this.formData, 'username', user ? user.username : val)
|
||||
this.$set(this.formData, 'unitId', user ? user.unitid : "${@shiro.getPrincipalProperty('unit').getId()}")
|
||||
this.$set(this.formData, 'sex', user ? user.sex : null)
|
||||
this.$set(this.formData, 'birthday', user ? user.birthday : null)
|
||||
this.$set(this.formData, 'mobile', user ? user.mobile : null)
|
||||
this.$set(this.formData, 'status', 2)
|
||||
},
|
||||
async querySearchAsync(queryString) {
|
||||
const applyDataIdList = this.applyData.map(m => m.id)
|
||||
const appliedDataUserIdList = this.appliedData.map(m => m.userId)
|
||||
const ids = applyDataIdList.concat(appliedDataUserIdList)
|
||||
const {code, data} = await $.get(loc() + "/getSysUser", {
|
||||
queryString: queryString,
|
||||
})
|
||||
if (code === 0) {
|
||||
this.lsUserList = data
|
||||
} else {
|
||||
this.lsUserList = []
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
setLeader2() {
|
||||
if (!this.selection.length) {
|
||||
this.$notify({
|
||||
@@ -1339,149 +1275,165 @@ layout("/layouts/platform.html"){
|
||||
handleSelectionChange(val) {
|
||||
this.selection = val;
|
||||
},
|
||||
async changeLeader() {
|
||||
const userData = await this.getUserData(this.LeaderData.userId);
|
||||
this.$set(this.LeaderData, 'userId', this.LeaderData.userId)
|
||||
this.$set(this.LeaderData, 'loginname', userData.loginname)
|
||||
this.$set(this.LeaderData, 'username', userData.username)
|
||||
this.$set(this.LeaderData, 'unitId', userData.unitid)
|
||||
this.$set(this.LeaderData, 'sex', userData.sex)
|
||||
this.$set(this.LeaderData, 'mobile', userData.mobile)
|
||||
this.$set(this.LeaderData, 'unionLeader', true)
|
||||
this.$set(this.LeaderData, 'unionId', userData.unionid)
|
||||
this.$set(this.LeaderData, 'identity', ['3'])
|
||||
this.$set(this.LeaderData, 'status', 2)
|
||||
this.$set(this.LeaderData, 'awardsMode', 2)
|
||||
this.$set(this.LeaderData, 'activityId', this.activityData2.id)
|
||||
this.$set(this.LeaderData, 'divisionLevelLeadership', false)
|
||||
this.$set(this.LeaderData, 'unionCoach', false)
|
||||
changeLeader(value) {
|
||||
if (!value) {
|
||||
this.LeaderData = {}
|
||||
return
|
||||
}
|
||||
this.getUserData(value).then((userData) => {
|
||||
if (this.LeaderData.userId !== value) return
|
||||
this.$set(this.LeaderData, 'userId', this.LeaderData.userId)
|
||||
this.$set(this.LeaderData, 'loginname', userData.loginname)
|
||||
this.$set(this.LeaderData, 'username', userData.username)
|
||||
this.$set(this.LeaderData, 'unitId', userData.unitid)
|
||||
this.$set(this.LeaderData, 'sex', userData.sex)
|
||||
this.$set(this.LeaderData, 'mobile', userData.mobile)
|
||||
this.$set(this.LeaderData, 'unionLeader', true)
|
||||
this.$set(this.LeaderData, 'unionId', userData.unionid)
|
||||
this.$set(this.LeaderData, 'identity', ['3'])
|
||||
this.$set(this.LeaderData, 'status', 2)
|
||||
this.$set(this.LeaderData, 'awardsMode', 2)
|
||||
this.$set(this.LeaderData, 'activityId', this.activityData2.id)
|
||||
this.$set(this.LeaderData, 'divisionLevelLeadership', false)
|
||||
this.$set(this.LeaderData, 'unionCoach', false)
|
||||
})
|
||||
},
|
||||
async changeCoach() {
|
||||
const userData = await this.getUserData(this.CoachData.userId);
|
||||
this.$set(this.CoachData, 'userId', this.CoachData.userId)
|
||||
this.$set(this.CoachData, 'loginname', userData.loginname)
|
||||
this.$set(this.CoachData, 'username', userData.username)
|
||||
this.$set(this.CoachData, 'unitId', userData.unitid)
|
||||
this.$set(this.CoachData, 'sex', userData.sex)
|
||||
this.$set(this.CoachData, 'mobile', userData.mobile)
|
||||
this.$set(this.CoachData, 'unionCoach', true)
|
||||
this.$set(this.CoachData, 'unionId', userData.unionid)
|
||||
this.$set(this.CoachData, 'identity', ['2'])
|
||||
this.$set(this.CoachData, 'status', 2)
|
||||
this.$set(this.CoachData, 'awardsMode', 2)
|
||||
this.$set(this.CoachData, 'activityId', this.activityData2.id)
|
||||
this.$set(this.CoachData, 'divisionLevelLeadership', false)
|
||||
this.$set(this.CoachData, 'unionLeader', false)
|
||||
changeCoach(value) {
|
||||
if (!value) {
|
||||
this.CoachData = {}
|
||||
return
|
||||
}
|
||||
this.getUserData(value).then((userData) => {
|
||||
if (this.CoachData.userId !== value) return
|
||||
this.$set(this.CoachData, 'userId', this.CoachData.userId)
|
||||
this.$set(this.CoachData, 'loginname', userData.loginname)
|
||||
this.$set(this.CoachData, 'username', userData.username)
|
||||
this.$set(this.CoachData, 'unitId', userData.unitid)
|
||||
this.$set(this.CoachData, 'sex', userData.sex)
|
||||
this.$set(this.CoachData, 'mobile', userData.mobile)
|
||||
this.$set(this.CoachData, 'unionCoach', true)
|
||||
this.$set(this.CoachData, 'unionId', userData.unionid)
|
||||
this.$set(this.CoachData, 'identity', ['2'])
|
||||
this.$set(this.CoachData, 'status', 2)
|
||||
this.$set(this.CoachData, 'awardsMode', 2)
|
||||
this.$set(this.CoachData, 'activityId', this.activityData2.id)
|
||||
this.$set(this.CoachData, 'divisionLevelLeadership', false)
|
||||
this.$set(this.CoachData, 'unionLeader', false)
|
||||
|
||||
})
|
||||
},
|
||||
async changeStaff() {
|
||||
const userData = await this.getUserData(this.staffData.userId);
|
||||
this.$set(this.staffData, 'userId', this.staffData.userId)
|
||||
this.$set(this.staffData, 'loginname', userData.loginname)
|
||||
this.$set(this.staffData, 'username', userData.username)
|
||||
this.$set(this.staffData, 'unitId', userData.unitid)
|
||||
this.$set(this.staffData, 'sex', userData.sex)
|
||||
this.$set(this.staffData, 'mobile', userData.mobile)
|
||||
this.$set(this.staffData, 'unionStaff', true)
|
||||
this.$set(this.staffData, 'identity', ['7'])
|
||||
this.$set(this.staffData, 'unionId', userData.unionid)
|
||||
this.$set(this.staffData, 'status', 2)
|
||||
this.$set(this.staffData, 'awardsMode', 2)
|
||||
this.$set(this.staffData, 'activityId', this.activityData2.id)
|
||||
changeStaff(value) {
|
||||
if (!value) {
|
||||
this.staffData = {}
|
||||
return
|
||||
}
|
||||
this.getUserData(value).then((userData) => {
|
||||
if (this.staffData.userId !== value) return
|
||||
this.$set(this.staffData, 'userId', this.staffData.userId)
|
||||
this.$set(this.staffData, 'loginname', userData.loginname)
|
||||
this.$set(this.staffData, 'username', userData.username)
|
||||
this.$set(this.staffData, 'unitId', userData.unitid)
|
||||
this.$set(this.staffData, 'sex', userData.sex)
|
||||
this.$set(this.staffData, 'mobile', userData.mobile)
|
||||
this.$set(this.staffData, 'unionStaff', true)
|
||||
this.$set(this.staffData, 'identity', ['7'])
|
||||
this.$set(this.staffData, 'unionId', userData.unionid)
|
||||
this.$set(this.staffData, 'status', 2)
|
||||
this.$set(this.staffData, 'awardsMode', 2)
|
||||
this.$set(this.staffData, 'activityId', this.activityData2.id)
|
||||
|
||||
})
|
||||
},
|
||||
async changeHead() {
|
||||
const userData = await this.getUserData(this.headData.userId);
|
||||
this.$set(this.headData, 'userId', this.headData.userId)
|
||||
this.$set(this.headData, 'loginname', userData.loginname)
|
||||
this.$set(this.headData, 'username', userData.username)
|
||||
this.$set(this.headData, 'unitId', userData.unitid)
|
||||
this.$set(this.headData, 'sex', userData.sex)
|
||||
this.$set(this.headData, 'mobile', userData.mobile)
|
||||
this.$set(this.headData, 'unionCoach', false)
|
||||
this.$set(this.headData, 'unionHead', true)
|
||||
this.$set(this.headData, 'unionId', userData.unionid)
|
||||
this.$set(this.headData, 'identity', ['6'])
|
||||
this.$set(this.headData, 'status', 2)
|
||||
this.$set(this.headData, 'awardsMode', 2)
|
||||
this.$set(this.headData, 'activityId', this.activityData2.id)
|
||||
this.$set(this.headData, 'divisionLevelLeadership', false)
|
||||
this.$set(this.headData, 'unionLeader', false)
|
||||
changeHead(value) {
|
||||
if (!value) {
|
||||
this.headData = {}
|
||||
return
|
||||
}
|
||||
this.getUserData(value).then((userData) => {
|
||||
if (this.headData.userId !== value) return
|
||||
this.$set(this.headData, 'userId', this.headData.userId)
|
||||
this.$set(this.headData, 'loginname', userData.loginname)
|
||||
this.$set(this.headData, 'username', userData.username)
|
||||
this.$set(this.headData, 'unitId', userData.unitid)
|
||||
this.$set(this.headData, 'sex', userData.sex)
|
||||
this.$set(this.headData, 'mobile', userData.mobile)
|
||||
this.$set(this.headData, 'unionCoach', false)
|
||||
this.$set(this.headData, 'unionHead', true)
|
||||
this.$set(this.headData, 'unionId', userData.unionid)
|
||||
this.$set(this.headData, 'identity', ['6'])
|
||||
this.$set(this.headData, 'status', 2)
|
||||
this.$set(this.headData, 'awardsMode', 2)
|
||||
this.$set(this.headData, 'activityId', this.activityData2.id)
|
||||
this.$set(this.headData, 'divisionLevelLeadership', false)
|
||||
this.$set(this.headData, 'unionLeader', false)
|
||||
|
||||
})
|
||||
},
|
||||
async doLeaderCoach() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
let loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
const resp = await $.post(loc() + "/doLeaderCoachHead",
|
||||
{
|
||||
LeaderData: JSON.stringify(this.LeaderData),
|
||||
CoachData: JSON.stringify(this.CoachData),
|
||||
headData: JSON.stringify(this.headData),
|
||||
staffData: JSON.stringify(this.staffData)
|
||||
}
|
||||
)
|
||||
closeLoadingFunc(loading, resp, async () => {
|
||||
this.activityData2.CoachCount = 1
|
||||
this.activityData2.LeaderCount = 1
|
||||
await this.getUnionCoachLeaderHead()
|
||||
this.dialogLeaderCoach = false;
|
||||
|
||||
|
||||
}, (data, msg) => {
|
||||
this.$message.error(msg);
|
||||
doLeaderCoach() {
|
||||
this.$refs["leaderCoachForm"].validate((valid) => {
|
||||
if (!valid) return
|
||||
this.formLoading = true
|
||||
$.post(loc() + "/doLeaderCoachHead", {
|
||||
activityId: this.activityData2.id,
|
||||
LeaderData: JSON.stringify(this.LeaderData),
|
||||
CoachData: JSON.stringify(this.CoachData),
|
||||
headData: JSON.stringify(this.headData),
|
||||
staffData: JSON.stringify(this.staffData)
|
||||
}).then((resp) => {
|
||||
if (resp.code !== 0) {
|
||||
this.$message.error(resp.msg)
|
||||
return
|
||||
}
|
||||
return this.getUnionCoachLeaderHead().then((data) => {
|
||||
if (!data) return
|
||||
this.$set(this.activityData2, 'CoachCount', data.unionCoach ? 1 : 0)
|
||||
this.$set(this.activityData2, 'LeaderCount', data.unionLeader ? 1 : 0)
|
||||
this.dialogLeaderCoach = false
|
||||
})
|
||||
}
|
||||
}).fail(() => {
|
||||
this.$message.error('保存失败')
|
||||
}).always(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
async getUnionCoachLeaderHead() {
|
||||
getUnionCoachLeaderHead() {
|
||||
this.LeaderData = {}
|
||||
this.CoachData = {}
|
||||
this.headData = {}
|
||||
this.staffData = {}
|
||||
const resp = await $.get(loc() + "/getUnionCoachLeaderHead", {activityId: this.activityData2.id})
|
||||
const {unionCoach, unionLeader, unionHead, unionStaff, userOptions} = resp.data
|
||||
if (unionCoach) {
|
||||
this.CoachData = unionCoach
|
||||
}
|
||||
if (unionLeader) {
|
||||
this.LeaderData = unionLeader
|
||||
}
|
||||
if (unionHead) {
|
||||
this.headData = unionHead
|
||||
}
|
||||
if (unionStaff) {
|
||||
this.staffData = unionStaff
|
||||
}
|
||||
|
||||
|
||||
this.userOptions = userOptions
|
||||
return $.post(loc() + "/getUnionCoachLeaderHead", {activityId: this.activityData2.id})
|
||||
.then((resp) => {
|
||||
if (resp.code !== 0) {
|
||||
this.$message.error(resp.msg)
|
||||
return null
|
||||
}
|
||||
const {unionCoach, unionLeader, unionHead, unionStaff, userOptions} = resp.data
|
||||
if (unionCoach) this.CoachData = unionCoach
|
||||
if (unionLeader) this.LeaderData = unionLeader
|
||||
if (unionHead) this.headData = unionHead
|
||||
if (unionStaff) this.staffData = unionStaff
|
||||
this.userOptions = userOptions
|
||||
return resp.data
|
||||
})
|
||||
},
|
||||
|
||||
async openLeaderCoach() {
|
||||
if (this.activityData2.CoachCount > 0 || this.activityData2.LeaderCount > 0) {
|
||||
await this.getUnionCoachLeaderHead()
|
||||
this.dialogLeaderCoach = true
|
||||
} else {
|
||||
this.LeaderData = {}
|
||||
this.CoachData = {}
|
||||
this.dialogLeaderCoach = true
|
||||
}
|
||||
|
||||
openLeaderCoach() {
|
||||
this.getUnionCoachLeaderHead().then((data) => {
|
||||
if (data) this.dialogLeaderCoach = true
|
||||
})
|
||||
},
|
||||
async userLeaderCoach(query) {
|
||||
if (query) {
|
||||
this.userLoading = true
|
||||
const resp = await $.get(loc() + "/getUserUnion", {query})
|
||||
this.userOptions = resp
|
||||
this.userLoading = false
|
||||
}
|
||||
|
||||
userLeaderCoach(query) {
|
||||
if (!query) return
|
||||
this.userLoading = true
|
||||
$.post(loc() + "/getUserUnion", {query})
|
||||
.then((resp) => {
|
||||
this.userOptions = resp
|
||||
}).always(() => {
|
||||
this.userLoading = false
|
||||
})
|
||||
},
|
||||
joinMemberFamily() {
|
||||
if (!this.selection.length) {
|
||||
@@ -1523,30 +1475,33 @@ layout("/layouts/platform.html"){
|
||||
this.openSingleApply(row)
|
||||
}*/
|
||||
},
|
||||
async openApply(item) {
|
||||
openApply(item) {
|
||||
this.$set(this.pageForm, "isMenWomen", 1)
|
||||
this.activityData2 = item
|
||||
this.pageForm.activityId = item.id
|
||||
if (item.applyType == 2) {
|
||||
await this.getUnionCoachLeaderHead()
|
||||
this.unionLeaderCoach = true
|
||||
this.getUnionCoachLeaderHead().then((data) => {
|
||||
if (!data) return
|
||||
this.unionLeaderCoach = true
|
||||
this.pageData()
|
||||
this.changeActivit()
|
||||
})
|
||||
} else {
|
||||
this.unionLeaderCoach = false
|
||||
this.pageData()
|
||||
this.changeActivit()
|
||||
}
|
||||
this.pageData()
|
||||
|
||||
await this.changeActivit()
|
||||
},
|
||||
|
||||
|
||||
async changeYear() {
|
||||
const resp = await $.post(loc() + "/getActivits", {year: this.pageForm.year})
|
||||
this.activitys = resp
|
||||
},
|
||||
async changeActivit() {
|
||||
const resp = await $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
|
||||
this.events = resp
|
||||
|
||||
changeActivit() {
|
||||
return $.post("/platform/activity/apply/getEvents", {activityId: this.pageForm.activityId})
|
||||
.then((resp) => {
|
||||
this.events = resp
|
||||
})
|
||||
},
|
||||
|
||||
handleTabClick(tab) {
|
||||
@@ -1678,9 +1633,8 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
|
||||
async getUserData(userId) {
|
||||
const {data} = await $.get(loc() + "/getUserData", {userId})
|
||||
return data
|
||||
getUserData(userId) {
|
||||
return $.post(loc() + "/getUserData", {userId}).then((res) => res.data)
|
||||
},
|
||||
|
||||
async userChange() {
|
||||
@@ -1732,74 +1686,89 @@ layout("/layouts/platform.html"){
|
||||
this.leaderOptions = [];
|
||||
}
|
||||
},
|
||||
doAddUser() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
doAddUser(single) {
|
||||
this.$refs[single ? 'singleExternalForm' : 'form'].validate((valid) => {
|
||||
if (valid) {
|
||||
|
||||
const data = {
|
||||
isAddUser: true,
|
||||
age: 0,
|
||||
eventId: this.eventData.eventId,
|
||||
activityId: this.activityData.id,
|
||||
team: this.teams.find(x => x.id === this.formData.teamId).name,
|
||||
unitname: this.unitOptions.find(x => x.id === this.formData.unitId).name,
|
||||
...this.formData
|
||||
}
|
||||
if (this.formData.birthday) {
|
||||
const birthDate = moment(this.formData.birthday);
|
||||
const age = moment().diff(birthDate, 'years');
|
||||
data.age = age
|
||||
}
|
||||
const unitId = "${@shiro.getPrincipalProperty('unit').getId()}"
|
||||
const newUser = this.applyUsers.find(a => a.unitid === unitId &&
|
||||
a.username === this.formData.username)
|
||||
if (newUser) {
|
||||
this.notifyWarning('该窗口只支持添加外援!')
|
||||
return
|
||||
}
|
||||
this.appliedData.push(data)
|
||||
this.sortApplyed()
|
||||
this.flushApplyed(this.appliedData)
|
||||
this.$notify.success({title: '成功', message: '已添加'});
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
})
|
||||
},
|
||||
doAddUser2() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const data = {
|
||||
eventId: this.eventData.eventId,
|
||||
activityId: this.activityData.id,
|
||||
unitname: this.unitOptions.find(x => x.id === this.formData.unitId).name,
|
||||
...this.formData
|
||||
}
|
||||
this.appliedData3.push(data)
|
||||
this.sortApplyed()
|
||||
this.flushApplyed(this.appliedData)
|
||||
this.$notify.success({title: '成功', message: '已添加'});
|
||||
this.dialogVisible2 = false
|
||||
this.formLoading = true
|
||||
$.post(loc() + "/addExternalUser", {
|
||||
username: this.formData.username,
|
||||
sex: this.formData.sex,
|
||||
birthday: this.formData.birthday,
|
||||
mobile: this.formData.mobile
|
||||
}).then((res) => {
|
||||
if (res.code !== 0) {
|
||||
this.notifyError(res.msg || '外援创建失败')
|
||||
return
|
||||
}
|
||||
const user = res.data
|
||||
const data = {
|
||||
...this.formData,
|
||||
userId: user.id,
|
||||
loginname: user.loginname,
|
||||
username: user.username,
|
||||
sex: user.sex,
|
||||
birthday: user.birthday,
|
||||
mobile: user.mobile,
|
||||
unitId: user.unitid,
|
||||
unitname: '外援',
|
||||
age: moment().diff(moment(user.birthday), 'years'),
|
||||
eventId: this.eventData.eventId,
|
||||
activityId: this.activityData.id,
|
||||
team: single ? null : this.teams.find(x => x.id === this.formData.teamId).name,
|
||||
isAddUser: true
|
||||
}
|
||||
if (single) {
|
||||
this.appliedData3.push(data)
|
||||
} else {
|
||||
this.appliedData.push(data)
|
||||
}
|
||||
this.sortApplyed()
|
||||
this.flushApplyed(this.appliedData)
|
||||
this.notifySuccess('已添加外援')
|
||||
this.dialogVisible = false
|
||||
this.dialogVisible2 = false
|
||||
}).fail(() => {
|
||||
this.notifyError('外援创建失败,请重试')
|
||||
}).always(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
} else {
|
||||
this.$notify.error({title: '错误', message: '存在未填写的的必填项'});
|
||||
}
|
||||
})
|
||||
},
|
||||
openAddUser() {
|
||||
this.formData = {teamId: this.team, identity: ['1']}
|
||||
this.dialogVisible = true
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
this.formData = {
|
||||
teamId: this.team,
|
||||
identity: ['1'],
|
||||
unitId: "${@shiro.getPrincipalProperty('unit').getId()}",
|
||||
unitname: '外援'
|
||||
}
|
||||
this.dialogVisible = true
|
||||
this.previewExternalNumber()
|
||||
},
|
||||
previewExternalNumber() {
|
||||
this.formLoading = true
|
||||
$.post(loc() + "/previewExternalLoginname", {}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$set(this.formData, 'loginname', res.data)
|
||||
} else {
|
||||
this.notifyError(res.msg || '工号生成失败')
|
||||
}
|
||||
}).fail(() => {
|
||||
this.notifyError('工号生成失败,请重试')
|
||||
}).always(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
},
|
||||
openAddUserD() {
|
||||
this.formData = {identity: ['1']}
|
||||
|
||||
this.dialogVisible2 = true
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
this.formData = {
|
||||
identity: ['1'],
|
||||
unitId: "${@shiro.getPrincipalProperty('unit').getId()}",
|
||||
unitname: '外援'
|
||||
}
|
||||
this.dialogVisible2 = true
|
||||
this.previewExternalNumber()
|
||||
},
|
||||
async doApplied(flag1) {
|
||||
|
||||
|
||||
@@ -591,6 +591,7 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'username', label: '姓名'},
|
||||
{prop: 'loginname', label: '教工号'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'birthday', label: '出生年月'},
|
||||
/* {prop: 'divisionLevelLeadership', label: '是否处级领导', sortable: true},*/
|
||||
{prop: 'unitname', label: '单位', sortable: true},
|
||||
{prop: 'mobile', label: '电话'},
|
||||
|
||||
@@ -110,6 +110,9 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'loginname', label: '申请人工号'},
|
||||
{prop: 'username', label: '申请人姓名'},
|
||||
{prop: 'mobile', label: '申请人电话'},
|
||||
{prop: 'sex', label: '性别'},
|
||||
{prop: 'birthday', label: '出生年月'},
|
||||
{prop: 'unitname', label: '单位'},
|
||||
{prop: 'identity', label: '申请角色'},
|
||||
{prop: 'allName', label: '活动项目'},
|
||||
{prop: 'startTime', label: '活动日期'},
|
||||
@@ -149,4 +152,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
Reference in New Issue
Block a user