|
|
@ -19,13 +19,12 @@ |
|
|
|
<el-card class="box-card"> |
|
|
|
<el-card class="box-card"> |
|
|
|
<div slot="header"> |
|
|
|
<div slot="header"> |
|
|
|
<span class="item-title-font"><i class="el-icon-minus icon-minus-rotated"></i>判分设置</span> |
|
|
|
<span class="item-title-font"><i class="el-icon-minus icon-minus-rotated"></i>判分设置</span> |
|
|
|
<!--<span style="float: right;vertical-align: middle;line-height: 29px;">合计:{{dataForm.totalScore}} 分</span>--> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="target-set"> |
|
|
|
<div class="target-set"> |
|
|
|
<el-row :gutter="20" type="flex"> |
|
|
|
<el-row :gutter="20" type="flex"> |
|
|
|
<el-col :span="1" style="text-align:center;padding-top: 182px;width: 88px;" class="item-required">量化指标</el-col> |
|
|
|
<el-col :span="1" style="text-align:center;padding-top: 182px;width: 88px;" class="item-required">量化指标</el-col> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-col :span="7"> |
|
|
|
<el-table ref="leftTable" :data="leftListData.filter(data => !searchName || data.name.toLowerCase().includes(searchName.toLowerCase()))" |
|
|
|
<el-table ref="leftTable" :data="leftDictTargetList.filter(data => !searchName || data.name.toLowerCase().includes(searchName.toLowerCase()))" |
|
|
|
height="400" border highlight-current-row tooltip-effect="dark" @selection-change="handleSelectionChange"> |
|
|
|
height="400" border highlight-current-row tooltip-effect="dark" @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
<el-table-column header-align="right" label="未选择 10/10"> |
|
|
|
<el-table-column header-align="right" label="未选择 10/10"> |
|
|
@ -42,7 +41,7 @@ |
|
|
|
<el-button @click="removeStaff" size="mini" type="primary" icon="el-icon-arrow-left" circle style="margin:10px 0 0 0;"></el-button> |
|
|
|
<el-button @click="removeStaff" size="mini" type="primary" icon="el-icon-arrow-left" circle style="margin:10px 0 0 0;"></el-button> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14" class="rightTable"> |
|
|
|
<el-col :span="14" class="rightTable"> |
|
|
|
<el-table ref="rightTable" :data="tableData" height="400" border highlight-current-row tooltip-effect="dark" @selection-change="handleSelectionChange"> |
|
|
|
<el-table ref="rightTable" :data="tableData" height="400" border highlight-current-row tooltip-effect="dark" :summary-method="getScoreSummaries" show-summary @selection-change="handleSelectionChange"> |
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
|
<el-table-column header-align="right" label="已选择 0/10,剩余可配置分数 90 分"> |
|
|
|
<el-table-column header-align="right" label="已选择 0/10,剩余可配置分数 90 分"> |
|
|
|
<el-table-column prop="name" label="名称"></el-table-column> |
|
|
|
<el-table-column prop="name" label="名称"></el-table-column> |
|
|
@ -51,7 +50,8 @@ |
|
|
|
<el-form-item :prop="'tradeList.'+scope.$index+'.score'" :rules="dataRule.score" class="score-input" > |
|
|
|
<el-form-item :prop="'tradeList.'+scope.$index+'.score'" :rules="dataRule.score" class="score-input" > |
|
|
|
<el-select size="small" style="width: 100px;"> |
|
|
|
<el-select size="small" style="width: 100px;"> |
|
|
|
<el-option label="大于" value="1"></el-option> |
|
|
|
<el-option label="大于" value="1"></el-option> |
|
|
|
<el-option label="小于" value="2"></el-option> |
|
|
|
<el-option label="等于" value="2"></el-option> |
|
|
|
|
|
|
|
<el-option label="小于" value="3"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<el-input size="small" v-model.trim="scope.row.score" :disabled="formAction == 2" style="width: 100px;"> |
|
|
|
<el-input size="small" v-model.trim="scope.row.score" :disabled="formAction == 2" style="width: 100px;"> |
|
|
|
<i slot="suffix">%</i> |
|
|
|
<i slot="suffix">%</i> |
|
|
@ -69,7 +69,6 @@ |
|
|
|
<el-table-column fixed="right" label="操作" width="50"> |
|
|
|
<el-table-column fixed="right" label="操作" width="50"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small">移除</el-button> |
|
|
|
<el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small">移除</el-button> |
|
|
|
<!--<el-button type="danger" size="mini" icon="el-icon-delete" circle @click.native.prevent="deleteRow(scope.$index, tableData)"></el-button>--> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
@ -80,7 +79,7 @@ |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
|
<div class="form-btn" style="text-align: center;"> |
|
|
|
<div class="form-btn" style="text-align: center;"> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="doAddCaseData()">确定</el-button> |
|
|
|
<el-button type="primary" @click="submitForm()">确定</el-button> |
|
|
|
<el-button @click="goBackList">取消</el-button> |
|
|
|
<el-button @click="goBackList">取消</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -114,7 +113,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
return { |
|
|
|
return { |
|
|
|
leftListData: [], |
|
|
|
leftDictTargetList: [], |
|
|
|
tableData: [{ |
|
|
|
tableData: [{ |
|
|
|
name: '王小虎', |
|
|
|
name: '王小虎', |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -138,66 +137,51 @@ |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
name: '王小虎', |
|
|
|
name: '王小虎', |
|
|
|
}], |
|
|
|
}], |
|
|
|
isShowData: false, |
|
|
|
|
|
|
|
tradeDialogVisible: false, |
|
|
|
|
|
|
|
isShowTradeDelBtn: false, |
|
|
|
|
|
|
|
formAction: 0, // 0:add,1:edit,2:view |
|
|
|
formAction: 0, // 0:add,1:edit,2:view |
|
|
|
dataForm: { |
|
|
|
dataForm: { |
|
|
|
id: '', |
|
|
|
id: '', |
|
|
|
type: '', |
|
|
|
type: '', |
|
|
|
name: '', |
|
|
|
name: '', |
|
|
|
content: '', |
|
|
|
taskList: [], |
|
|
|
totalScore: 0, |
|
|
|
|
|
|
|
caseDataList: [], |
|
|
|
|
|
|
|
tradeList: [], |
|
|
|
|
|
|
|
isAdmin: 1, // 默认 管理员内置 |
|
|
|
isAdmin: 1, // 默认 管理员内置 |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
totalScore: 0,//总分 |
|
|
|
dataRule: { |
|
|
|
dataRule: { |
|
|
|
name: [ |
|
|
|
name: [ |
|
|
|
{ required: true, message: '请输入项目名称', trigger: 'blur' }, |
|
|
|
{ required: true, message: '请输入实训名称', trigger: 'blur' }, |
|
|
|
{ min: 1, max: 30, message: '长度在 1 到 30 个字符', trigger: 'blur' } |
|
|
|
{ min: 1, max: 30, message: '长度在 1 到 30 个字符', trigger: 'blur' } |
|
|
|
], |
|
|
|
], |
|
|
|
type: [ |
|
|
|
type: [ |
|
|
|
{ required: true, message: '请选择项目权限', trigger: 'change' } |
|
|
|
{ required: true, message: '请选择实训用途', trigger: 'change' } |
|
|
|
], |
|
|
|
|
|
|
|
content: [ |
|
|
|
|
|
|
|
{validator: validateContent, trigger: 'blur'} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
score: [ |
|
|
|
|
|
|
|
{validator: validateScore, trigger: 'blur'} |
|
|
|
|
|
|
|
], |
|
|
|
], |
|
|
|
|
|
|
|
// content: [ |
|
|
|
|
|
|
|
// {validator: validateContent, trigger: 'blur'} |
|
|
|
|
|
|
|
// ], |
|
|
|
|
|
|
|
// score: [ |
|
|
|
|
|
|
|
// {validator: validateScore, trigger: 'blur'} |
|
|
|
|
|
|
|
// ], |
|
|
|
}, |
|
|
|
}, |
|
|
|
dictCaseDataList: [], |
|
|
|
|
|
|
|
selectedItemRows: [], |
|
|
|
selectedItemRows: [], |
|
|
|
selectedTradeItems: [], |
|
|
|
selectedTradeItems: [], |
|
|
|
delTradeItems: [], |
|
|
|
|
|
|
|
tradeNotInIds: [], |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
if (this.$route.query.id) { |
|
|
|
if (this.$route.query.id) { |
|
|
|
this.dataForm.id = this.$route.query.id; |
|
|
|
this.dataForm.id = this.$route.query.id; |
|
|
|
this.$http.get('/authapi/bs_projectManage/getDetail?id=' + this.dataForm.id).then(response => { |
|
|
|
Train.getCaseDetail({id: this.dataForm.id}).then((res) => { |
|
|
|
this.dataForm = response; |
|
|
|
this.dataForm = res.data; |
|
|
|
// 下拉框标签回显问题 |
|
|
|
// 下拉框标签回显问题 |
|
|
|
this.dataForm.type = String(response.type); |
|
|
|
this.dataForm.type = String(res.type); |
|
|
|
// 回显案例数据 |
|
|
|
|
|
|
|
this.selectedItemRows = this.dataForm.caseDataList; |
|
|
|
|
|
|
|
// 计分交易赋值 |
|
|
|
|
|
|
|
this.selectedTradeItems = this.dataForm.tradeList; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.$route.query.isEdit === 1) { |
|
|
|
if (this.$route.query.isEdit === 1) { |
|
|
|
// 编辑 |
|
|
|
// 编辑 |
|
|
|
this.formAction = 1; |
|
|
|
this.formAction = 1; |
|
|
|
if (this.selectedTradeItems && this.selectedTradeItems.length > 0) { |
|
|
|
|
|
|
|
this.isShowTradeDelBtn = true;// 显示删除按钮 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 查看 |
|
|
|
// 查看 |
|
|
|
this.formAction = 2; |
|
|
|
this.formAction = 2; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//获取左侧指标字典数据 |
|
|
|
this.initTargetList(); |
|
|
|
this.initTargetList(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
@ -208,148 +192,12 @@ |
|
|
|
initTargetList(searchObj) { |
|
|
|
initTargetList(searchObj) { |
|
|
|
Train.getTargetList(searchObj).then(res => { |
|
|
|
Train.getTargetList(searchObj).then(res => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (res.code == 200) { |
|
|
|
this.leftListData = res.data; |
|
|
|
this.leftDictTargetList = res.data; |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
|
console.info(error) |
|
|
|
console.info(error) |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
goBackAdd() { |
|
|
|
|
|
|
|
this.isShowData = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
toAddCaseData() { |
|
|
|
|
|
|
|
// 页面滚动条回到顶部 |
|
|
|
|
|
|
|
window.scrollTo(0, 0); |
|
|
|
|
|
|
|
this.isShowData = true; |
|
|
|
|
|
|
|
this.getCaseData(null); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getCaseData(condition) { |
|
|
|
|
|
|
|
this.$http.get('/authapi/bs_projectManage/getDictCaseDataList', {params: condition}).then(response => { |
|
|
|
|
|
|
|
this.dictCaseDataList = response; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 对于已经确定勾选的,在此打开选择界面,需回显已勾选的数据 |
|
|
|
|
|
|
|
if (this.selectedItemRows && this.selectedItemRows.length > 0) { |
|
|
|
|
|
|
|
let selectedItemIds = this.selectedItemRows.map(function (row) { |
|
|
|
|
|
|
|
return row.id; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.dictCaseDataList.forEach(p => { |
|
|
|
|
|
|
|
if (selectedItemIds.indexOf(p.id) > -1) { |
|
|
|
|
|
|
|
p.checked = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleItemSelectionChange(val) { |
|
|
|
|
|
|
|
this.selectedItemRows = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
doAddCaseData() { |
|
|
|
|
|
|
|
if (!this.selectedItemRows || this.selectedItemRows.length === 0) { |
|
|
|
|
|
|
|
this.$notify.warning({ |
|
|
|
|
|
|
|
title: '系统提示', |
|
|
|
|
|
|
|
message: '您没选择任何数据,请先选择!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.isShowData = false; |
|
|
|
|
|
|
|
this.dataForm.caseDataList = this.selectedItemRows; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
cancelAddCaseData() { |
|
|
|
|
|
|
|
this.isShowData = false; |
|
|
|
|
|
|
|
this.selectedItemRows = this.dataForm.caseDataList; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getFileUrl(file) { |
|
|
|
|
|
|
|
return window.SITE_CONFIG['serverUrl'] + file.imgUrl; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
toAddTrade() { // 打开添加计分点弹窗 |
|
|
|
|
|
|
|
this.tradeDialogVisible = true; |
|
|
|
|
|
|
|
// 获取已添加的交易id集合 |
|
|
|
|
|
|
|
this.tradeNotInIds = this.selectedTradeItems.map(item => { |
|
|
|
|
|
|
|
return item.id; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
doAddSelectTrade(val) {// 添加已选中的计分点到新增界面 |
|
|
|
|
|
|
|
if (this.selectedTradeItems && this.selectedTradeItems.length > 0) { |
|
|
|
|
|
|
|
// 追加val数组的所有元素 |
|
|
|
|
|
|
|
this.selectedTradeItems.push.apply(this.selectedTradeItems, val); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.selectedTradeItems = val; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.dataForm.tradeList = this.selectedTradeItems; |
|
|
|
|
|
|
|
this.dataForm.tradeList.forEach(item => { |
|
|
|
|
|
|
|
this.$set(item, 'score', ''); |
|
|
|
|
|
|
|
// this.$set(item, 'tradeId', item.id); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.isShowTradeDelBtn = true;// 显示删除按钮 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
closeTradeDialog() { // 关闭计分点弹窗 |
|
|
|
|
|
|
|
this.tradeDialogVisible = false; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleTradeSelectionChange(val) { |
|
|
|
|
|
|
|
this.delTradeItems = val; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
checkboxIsEnabled() { // 复选框是否可用 |
|
|
|
|
|
|
|
if (this.formAction === 2) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
removeTradeItemBatch() { // 批量移除选中项 |
|
|
|
|
|
|
|
if (!this.delTradeItems || this.delTradeItems.length === 0) { |
|
|
|
|
|
|
|
this.$notify.warning({ |
|
|
|
|
|
|
|
title: '系统提示', |
|
|
|
|
|
|
|
message: '您没选择任何数据,请先选择!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 遍历当前选中项 |
|
|
|
|
|
|
|
this.delTradeItems.forEach(item => { |
|
|
|
|
|
|
|
if (this.selectedTradeItems.indexOf(item) > -1) { |
|
|
|
|
|
|
|
// 移除当前项 |
|
|
|
|
|
|
|
this.selectedTradeItems.splice(this.selectedTradeItems.indexOf(item), 1); |
|
|
|
|
|
|
|
// this.dataForm.tradeList.splice(this.dataForm.tradeList.indexOf(item), 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (this.selectedTradeItems.length === 0) { |
|
|
|
|
|
|
|
this.isShowTradeDelBtn = false; // 隐藏删除按钮 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
removeTradeItem(row) { // 移除当前行 |
|
|
|
|
|
|
|
let index = this.selectedTradeItems.findIndex(item => { |
|
|
|
|
|
|
|
return item.id == row.id; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (index > -1) { |
|
|
|
|
|
|
|
this.selectedTradeItems.splice(this.selectedTradeItems.indexOf(row), 1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
moveUpTradeItem(index,row) { // 向上移动 |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
// console.log('上移', index, row); |
|
|
|
|
|
|
|
// console.log(that.dataForm.tradeList[index]); |
|
|
|
|
|
|
|
if (index > 0) { |
|
|
|
|
|
|
|
let upDate = that.dataForm.tradeList[index - 1]; |
|
|
|
|
|
|
|
that.dataForm.tradeList.splice(index - 1, 1); |
|
|
|
|
|
|
|
that.dataForm.tradeList.splice(index, 0, upDate); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
alert('已经是第一条,不可上移'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
moveDownTradeItem(index,row) { // 向下移动 |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
// console.log('下移', index, row); |
|
|
|
|
|
|
|
if ((index + 1) === that.dataForm.tradeList.length) { |
|
|
|
|
|
|
|
alert('已经是最后一条,不可下移'); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// console.log(index); |
|
|
|
|
|
|
|
let downDate = that.dataForm.tradeList[index + 1]; |
|
|
|
|
|
|
|
that.dataForm.tradeList.splice(index + 1, 1); |
|
|
|
|
|
|
|
that.dataForm.tradeList.splice(index, 0, downDate); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getScoreSummaries(param) { // 计算总分 |
|
|
|
getScoreSummaries(param) { // 计算总分 |
|
|
|
const { columns, data } = param; |
|
|
|
const { columns, data } = param; |
|
|
|
const sums = []; |
|
|
|
const sums = []; |
|
|
@ -360,7 +208,7 @@ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (index === 6) { // 分数栏 |
|
|
|
if (index === 3) { // 分数栏 |
|
|
|
values = data.map(item => Number(item['score'])); |
|
|
|
values = data.map(item => Number(item['score'])); |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
sums[index] = values.reduce((prev, curr) => { |
|
|
|
const value = Number(curr); |
|
|
|
const value = Number(curr); |
|
|
@ -380,60 +228,39 @@ |
|
|
|
|
|
|
|
|
|
|
|
return sums; |
|
|
|
return sums; |
|
|
|
}, |
|
|
|
}, |
|
|
|
submitForm(formName) { |
|
|
|
submitForm() { |
|
|
|
let self = this; |
|
|
|
let self = this; |
|
|
|
self.$refs[formName].validate((valid) => { |
|
|
|
self.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
let totalScore = self.dataForm.totalScore; |
|
|
|
let totalScore = self.totalScore; |
|
|
|
if (totalScore === 0) { |
|
|
|
if (totalScore === 0) { |
|
|
|
self.$notify.error({ |
|
|
|
self.$message.error("判分设置模块没有添加计分点!"); |
|
|
|
title: '错误提示', |
|
|
|
|
|
|
|
message: '判分设置模块没有添加计分点!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (totalScore > 100) { |
|
|
|
} else if (totalScore > 100) { |
|
|
|
self.$notify.error({ |
|
|
|
self.$message.error("判分设置模块总分超过100分!"); |
|
|
|
title: '错误提示', |
|
|
|
|
|
|
|
message: '判分设置模块总分超过100分!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} else if (totalScore < 100) { |
|
|
|
} else if (totalScore < 100) { |
|
|
|
self.$notify.error({ |
|
|
|
self.$message.error("判分设置模块总分不足100分!"); |
|
|
|
title: '错误提示', |
|
|
|
|
|
|
|
message: '判分设置模块总分不足100分!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
// userType 0学生 1教师 2管理员 |
|
|
|
// userType 0学生 1教师 2管理员 |
|
|
|
if (self.formAction == 0 && self.$store.state.app.user.userType) { |
|
|
|
// if (self.formAction == 0 && self.$store.state.app.user.userType) { |
|
|
|
self.dataForm.isAdmin = self.$store.state.app.user.userType == 1 ? 0 : 1; |
|
|
|
// self.dataForm.isAdmin = self.$store.state.app.user.userType == 1 ? 0 : 1; |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
Train.insertCase(self.dataForm).then(res => { |
|
|
|
self.$http.post('/authapi/bs_projectManage/addOrUpdateProject', self.dataForm).then(response => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(response.status==1) { |
|
|
|
// self.dataForm = Object.assign({}, self.dataForm, response.id); |
|
|
|
self.dataForm = Object.assign({}, self.dataForm, response.id); |
|
|
|
|
|
|
|
self.formAction = 1; |
|
|
|
self.formAction = 1; |
|
|
|
self.$notify.success({ |
|
|
|
self.$message.success("操作成功!"); |
|
|
|
title: '操作成功!', |
|
|
|
|
|
|
|
message: '新增项目成功!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
self.goBackList(); |
|
|
|
self.goBackList(); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
self.$message.error(response.msg); |
|
|
|
self.$message.error(res.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
}).catch(error => { |
|
|
|
self.$message.error(error); |
|
|
|
self.$message.error(error); |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self.$notify.error({ |
|
|
|
|
|
|
|
title: '错误提示', |
|
|
|
|
|
|
|
message: '系统输入验证失败!', |
|
|
|
|
|
|
|
duration: 2000, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
self.$message.error('系统输入验证失败!'); |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|