https://docs.qq.com/sheet/DSmtXa0dtV0Z4bUVY?tab=BB08J2&u=4df3c7d24730433cbcb7b414755f8f0a
updateRequireState(data){
// 需求状态:1:待处理、2:待评审、3:开发中、4:已发布、5:暂缓、6:已驳回、7:已提测、8:测试通过、9:评审通过、10:开发完成、11:无需测试
// 任务状态:1:待处理、3:处理中、4:已完成、5:已取消
let devTaskStateList = [], // 开发任务状态集合
testTaskStateList = []; // 测试任务状态集合
for(let i = 0; i < data.length; i++){
if(data[i].taskType == '3' || data[i].taskType == '4'){
devTaskStateList.push(data[i].status);
}else{
testTaskStateList.push(data[i].status);
}
}
// 去重
devTaskStateList = devTaskStateList.filter((item, index) => devTaskStateList.indexOf(item) === index);
testTaskStateList = testTaskStateList.filter((item, index) => testTaskStateList.indexOf(item) === index);
// 排序-升序
devTaskStateList.sort((a, b) => a - b);
testTaskStateList.sort((a, b) => a - b);
// 转字符串
devTaskStateList = devTaskStateList.toString();
testTaskStateList = testTaskStateList.toString();
// 测试通过
if(
['', '4', '5', '4,5'].indexOf(devTaskStateList) != -1
&&
['4', '4,5'].indexOf(testTaskStateList) != -1
&&
[11, 4, 6, 2, 5].indexOf(this.require.requireState) == -1
){
this.statuChange1(8, this.require);
}
// 开发完成
if(
['4', '4,5'].indexOf(devTaskStateList) != -1
&&
['', '1', '5', '1,4', '1,5', '1,4,5'].indexOf(testTaskStateList) != -1
&&
[7, 8, 11, 4, 6, 2, 5].indexOf(this.require.requireState) == -1
){
this.statuChange1(10, this.require)
}
// 开发中
if(
['3', '1,3', '3,4', '3,5', '1,3,4', '1,3,5', '3,4,5', '1,3,4,5'].indexOf(devTaskStateList) != -1
&&
['', '1', '4', '5', '1,4', '1,5', '4,5', '1,4,5'].indexOf(testTaskStateList) != -1
&&
[7, 8, 11, 4, 6, 2, 5].indexOf(this.require.requireState) == -1
){
this.statuChange1(3, this.require)
}
},
网友评论