|
@@ -10,7 +10,6 @@ Page({
|
|
|
id: '',
|
|
|
form: {},
|
|
|
// 状态
|
|
|
- statusList: [],
|
|
|
userList: [],
|
|
|
red_disabled: false,
|
|
|
blue_disabled: false
|
|
@@ -25,23 +24,6 @@ Page({
|
|
|
if (data) return data.name
|
|
|
else return '暂无'
|
|
|
}
|
|
|
- } else {
|
|
|
- if (value) {
|
|
|
- let list = that.data[model + 'List']
|
|
|
- let data = list.find(i => i.value == value);
|
|
|
- if (data) return data.label
|
|
|
- else return '暂无'
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- // 选择状态
|
|
|
- statusChange(e) {
|
|
|
- const that = this;
|
|
|
- const index = e.detail.value;
|
|
|
- let data = that.data.statusList[index];
|
|
|
- if (data) {
|
|
|
- that.setData({ 'form.status': data.value })
|
|
|
- that.setData({ 'form.status_name': data.label })
|
|
|
}
|
|
|
},
|
|
|
// 提交保存
|
|
@@ -81,17 +63,14 @@ Page({
|
|
|
wx.hideLoading()
|
|
|
},
|
|
|
initValidate() {
|
|
|
- const rules = { red_score: { required: true }, blue_score: { required: true }, status: { required: true } }
|
|
|
- const messages = { red_score: { required: '请输入红方比分' }, blue_score: { required: '请输入蓝方比分' }, status: { required: '请选择状态' } };
|
|
|
+ const rules = { red_score: { required: true }, blue_score: { required: true } }
|
|
|
+ const messages = { red_score: { required: '请输入红方比分' }, blue_score: { required: '请输入蓝方比分' } };
|
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
|
},
|
|
|
// 查询其他信息
|
|
|
async searchOther() {
|
|
|
const that = this;
|
|
|
let res;
|
|
|
- // 状态
|
|
|
- res = await app.$api('dictData', 'GET', { type: 'course_status', is_use: '0' })
|
|
|
- if (res.errcode == '0') that.setData({ statusList: res.data })
|
|
|
// 团队
|
|
|
res = await app.$api('team', 'GET', { status: '1' })
|
|
|
if (res.errcode == '0') that.setData({ userList: res.data })
|
|
@@ -108,8 +87,6 @@ Page({
|
|
|
if (form && form._id) {
|
|
|
if (form.red_team_id == that.data.team_id) that.setData({ blue_disabled: true })
|
|
|
else if (form.blue_team_id == that.data.team_id) that.setData({ red_disabled: true })
|
|
|
- // 状态
|
|
|
- if (form.status) form.status_name = that.getDict(form.status, 'status')
|
|
|
}
|
|
|
} else {
|
|
|
wx.showToast({ title: `${aee.errmsg}`, icon: 'error' });
|