体育活动
This commit is contained in:
@@ -350,15 +350,15 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
userList: [],
|
userList: [],
|
||||||
|
|
||||||
addUserDialogVisible: false,
|
addUserDialogVisible: false,
|
||||||
lsUserList:[],
|
lsUserList: [],
|
||||||
unitOptions:[]
|
unitOptions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doAddUser(){
|
doAddUser() {
|
||||||
this.$refs["lsryform"].validate(async (valid) => {
|
this.$refs["lsryform"].validate(async (valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const birthDate = moment(this.formData.birthday);
|
const birthDate = this.$moment(this.formData.birthday);
|
||||||
const age = this.$moment().diff(birthDate, 'years');
|
const age = this.$moment().diff(birthDate, 'years');
|
||||||
const data = {
|
const data = {
|
||||||
isAddUser: true,
|
isAddUser: true,
|
||||||
@@ -366,14 +366,10 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
unitname: this.unitOptions.find(x => x.id === this.formData.unitId).name,
|
unitname: this.unitOptions.find(x => x.id === this.formData.unitId).name,
|
||||||
...this.formData
|
...this.formData
|
||||||
}
|
}
|
||||||
//如果添加的人不在数据库
|
const newUser = this.userList.find(a => a.id === this.formData.userId)
|
||||||
const user = this.lsUserList.find(l => l.id === this.formData.userId)
|
if (newUser) {
|
||||||
if (!user) {
|
this.notifyWarning('该用户已存在左侧选择框内,请从左侧选择框内选择!')
|
||||||
const newUser = this.leftApplyUserList.find(a => a.id === this.formData.userId)
|
return
|
||||||
if (newUser) {
|
|
||||||
this.notifyWarning('该用户已存在左侧选择框内,请从左侧选择框内选择!')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.applyUserList.push(data)
|
this.applyUserList.push(data)
|
||||||
this.flushApplyUser(this.applyUserList)
|
this.flushApplyUser(this.applyUserList)
|
||||||
@@ -388,23 +384,6 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
},
|
},
|
||||||
async addUserChange(val) {
|
async addUserChange(val) {
|
||||||
const user = this.lsUserList.find(l => l.id === 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, 'eventId', this.eventData.eventId)
|
this.$set(this.formData, 'eventId', this.eventData.eventId)
|
||||||
this.$set(this.formData, 'activityId', this.activityTableData.activityId)
|
this.$set(this.formData, 'activityId', this.activityTableData.activityId)
|
||||||
this.$set(this.formData, 'team', this.applyFromData.teamName)
|
this.$set(this.formData, 'team', this.applyFromData.teamName)
|
||||||
@@ -421,9 +400,11 @@ var ACTIVITY_SPORTS_APPLY_USER = {
|
|||||||
this.$set(this.formData, 'status', 2)
|
this.$set(this.formData, 'status', 2)
|
||||||
},
|
},
|
||||||
async querySearchAsync(queryString) {
|
async querySearchAsync(queryString) {
|
||||||
const leftApplyUserList = this.leftApplyUserList.map(m => m.loginname)
|
/* const leftApplyUserList = this.leftApplyUserList.map(m => m.loginname)
|
||||||
const rightApplyUserList = this.rightApplyUserList.map(m => m.loginname)
|
const rightApplyUserList = this.rightApplyUserList.map(m => m.loginname)
|
||||||
const loginnames = leftApplyUserList.concat(rightApplyUserList)
|
const loginnames = leftApplyUserList.concat(rightApplyUserList)*/
|
||||||
|
|
||||||
|
const loginnames = this.applyUserTableData.map(m => m.loginname)
|
||||||
const {code, data} = await $.get("/platform/activity/apply/getSysUser", {
|
const {code, data} = await $.get("/platform/activity/apply/getSysUser", {
|
||||||
loginnames: JSON.stringify(loginnames),
|
loginnames: JSON.stringify(loginnames),
|
||||||
queryString: queryString
|
queryString: queryString
|
||||||
|
|||||||
Reference in New Issue
Block a user