|
|
@ -12,30 +12,13 @@ |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-form-model-item label="任务层级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="level"> |
|
|
|
<a-form-model-item label="任务层级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="level"> |
|
|
|
<!-- <j-dict-select-tag v-model="model.level" placeholder="请选择任务层级"--> |
|
|
|
|
|
|
|
<!-- dict-code="task_type_level" style="width: 100%">--> |
|
|
|
|
|
|
|
<!-- </j-dict-select-tag>--> |
|
|
|
|
|
|
|
<j-dict-select-tag v-model="model.level" type="radio" style="width: 100%" dictCode="task_type_level"/> |
|
|
|
<j-dict-select-tag v-model="model.level" type="radio" style="width: 100%" dictCode="task_type_level"/> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-form-model-item label="任务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeId"> |
|
|
|
<a-form-model-item label="任务类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="typeId"> |
|
|
|
<!-- <j-dict-select-tag v-model="model.typeId" placeholder="请选择任务类型"--> |
|
|
|
|
|
|
|
<!-- dict-code="task_type,type_name,id" :disabled="model.level==null">--> |
|
|
|
|
|
|
|
<!-- </j-dict-select-tag>--> |
|
|
|
|
|
|
|
<j-dict-select-tag v-model="model.typeId" type="radio" style="width: 100%" |
|
|
|
<j-dict-select-tag v-model="model.typeId" type="radio" style="width: 100%" |
|
|
|
dict-code="task_type,type_name,id"/> |
|
|
|
dict-code="task_type,type_name,id"/> |
|
|
|
<!----> |
|
|
|
|
|
|
|
<!-- <el-tree--> |
|
|
|
|
|
|
|
<!-- :props="typeId"--> |
|
|
|
|
|
|
|
<!-- ref="treeList"--> |
|
|
|
|
|
|
|
<!-- :load="this.loadData2"--> |
|
|
|
|
|
|
|
<!-- check-strictly--> |
|
|
|
|
|
|
|
<!-- show-checkbox--> |
|
|
|
|
|
|
|
<!-- node-key='id'--> |
|
|
|
|
|
|
|
<!-- @check ='changetree'--> |
|
|
|
|
|
|
|
<!-- @check-change="handleCheckChange">--> |
|
|
|
|
|
|
|
<!-- </el-tree>--> |
|
|
|
|
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
@ -48,10 +31,15 @@ |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskName"> |
|
|
|
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskName"> |
|
|
|
<a-input v-model="model.taskName" placeholder="请输入中文名称" |
|
|
|
<!-- <a-input v-model="model.taskName" placeholder="请输入中文名称"--> |
|
|
|
autocomplete="on" |
|
|
|
<!-- autocomplete="on" --> |
|
|
|
:disabled="model.typeId==null"> |
|
|
|
<!-- :disabled="model.typeId==null">--> |
|
|
|
</a-input> |
|
|
|
<!-- </a-input>--> |
|
|
|
|
|
|
|
<a-textarea v-model="model.taskName" |
|
|
|
|
|
|
|
placeholder="请输入中文名称" |
|
|
|
|
|
|
|
autocomplete="on" |
|
|
|
|
|
|
|
:disabled="model.typeId==null" |
|
|
|
|
|
|
|
auto-size /> |
|
|
|
</a-form-model-item> |
|
|
|
</a-form-model-item> |
|
|
|
</a-col> |
|
|
|
</a-col> |
|
|
|
<a-col :span="24"> |
|
|
|
<a-col :span="24"> |
|
|
@ -259,11 +247,13 @@ export default { |
|
|
|
this.currentNodeData.id = data.id |
|
|
|
this.currentNodeData.id = data.id |
|
|
|
this.$refs.treeList.setCheckedNodes([data.id]) |
|
|
|
this.$refs.treeList.setCheckedNodes([data.id]) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
, |
|
|
|
changetree(data, lst) { |
|
|
|
changetree(data, lst) { |
|
|
|
if (lst, checkedKeys.lenght == 0) |
|
|
|
if (lst, checkedKeys.lenght == 0) |
|
|
|
this.$refs.treeList.setCheckedNodes([data.id]) |
|
|
|
this.$refs.treeList.setCheckedNodes([data.id]) |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
, |
|
|
|
fillTaskName() { |
|
|
|
fillTaskName() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
let fillTaskName = ""; |
|
|
|
let fillTaskName = ""; |
|
|
@ -278,13 +268,18 @@ export default { |
|
|
|
fillTaskName = res.result; |
|
|
|
fillTaskName = res.result; |
|
|
|
let projectNum = this.getProjectNum() + Math.floor(Math.random() * 10000) // 如果是6位或者8位随机数,相应的 *1000000或者 *100000000就行了 |
|
|
|
let projectNum = this.getProjectNum() + Math.floor(Math.random() * 10000) // 如果是6位或者8位随机数,相应的 *1000000或者 *100000000就行了 |
|
|
|
// console.log("------------projectNum,", projectNum) |
|
|
|
// console.log("------------projectNum,", projectNum) |
|
|
|
Object.assign(that.model, {'taskName': fillTaskName + "-" + projectNum}); |
|
|
|
// Object.assign(that.model, {'taskName': fillTaskName + "-" + projectNum}); |
|
|
|
Object.assign(that.model, {'managerUsers': userInfo.id}); |
|
|
|
// Object.assign(that.model, {'managerUsers': userInfo.id}); |
|
|
|
this.$forceUpdate(); |
|
|
|
// this.$forceUpdate(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//填充后可编辑 |
|
|
|
|
|
|
|
this.$set(that.model, 'taskName', fillTaskName + "-" + projectNum); |
|
|
|
|
|
|
|
this.$set(that.model, 'managerUsers', userInfo.id); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
, |
|
|
|
|
|
|
|
|
|
|
|
// 获取当前日期的方法 |
|
|
|
// 获取当前日期的方法 |
|
|
|
getProjectNum() { |
|
|
|
getProjectNum() { |
|
|
@ -304,7 +299,8 @@ export default { |
|
|
|
CurrentDate += '0' + Day |
|
|
|
CurrentDate += '0' + Day |
|
|
|
} |
|
|
|
} |
|
|
|
return CurrentDate |
|
|
|
return CurrentDate |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
, |
|
|
|
|
|
|
|
|
|
|
|
add() { |
|
|
|
add() { |
|
|
|
this.edit(this.modelDefault); |
|
|
|
this.edit(this.modelDefault); |
|
|
@ -312,6 +308,13 @@ export default { |
|
|
|
, |
|
|
|
, |
|
|
|
edit(record) { |
|
|
|
edit(record) { |
|
|
|
this.model = Object.assign({}, record); |
|
|
|
this.model = Object.assign({}, record); |
|
|
|
|
|
|
|
if (this.model.fuzhi) { |
|
|
|
|
|
|
|
this.model.upperId = this.model.id; |
|
|
|
|
|
|
|
this.model.id = ''; |
|
|
|
|
|
|
|
this.model.taskName = this.fillTaskName(); |
|
|
|
|
|
|
|
this.model.createTime = new Date(+new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); |
|
|
|
|
|
|
|
this.model.updateTime = new Date(+new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''); |
|
|
|
|
|
|
|
} |
|
|
|
console.log('this.model-------', this.model) |
|
|
|
console.log('this.model-------', this.model) |
|
|
|
this.visible = true; |
|
|
|
this.visible = true; |
|
|
|
} |
|
|
|
} |
|
|
@ -342,73 +345,9 @@ export default { |
|
|
|
that.confirmLoading = false; |
|
|
|
that.confirmLoading = false; |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
// currentTime() { |
|
|
|
, |
|
|
|
// var date = new Date(); |
|
|
|
|
|
|
|
// var year = date.getFullYear(); //月份从0~11,所以加一 |
|
|
|
|
|
|
|
// let month = date.getMonth(); |
|
|
|
|
|
|
|
// // console.log("month",month); |
|
|
|
|
|
|
|
// var dateArr = [ |
|
|
|
|
|
|
|
// date.getMonth() + 1, |
|
|
|
|
|
|
|
// date.getDate(), |
|
|
|
|
|
|
|
// date.getHours(), |
|
|
|
|
|
|
|
// date.getMinutes(), |
|
|
|
|
|
|
|
// date.getSeconds(), |
|
|
|
|
|
|
|
// ]; |
|
|
|
|
|
|
|
// //如果格式是MM则需要此步骤,如果是M格式则此循环注释掉 |
|
|
|
|
|
|
|
// for (var i = 0; i < dateArr.length; i++) { |
|
|
|
|
|
|
|
// if (dateArr[i] >= 1 && dateArr[i] <= 9) { |
|
|
|
|
|
|
|
// dateArr[i] = "0" + dateArr[i]; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// var strDate = |
|
|
|
|
|
|
|
// year + |
|
|
|
|
|
|
|
// "-" + |
|
|
|
|
|
|
|
// dateArr[0] + |
|
|
|
|
|
|
|
// "-" + |
|
|
|
|
|
|
|
// dateArr[1] + |
|
|
|
|
|
|
|
// " " + |
|
|
|
|
|
|
|
// dateArr[2] + |
|
|
|
|
|
|
|
// ":" + |
|
|
|
|
|
|
|
// dateArr[3] + |
|
|
|
|
|
|
|
// ":" + |
|
|
|
|
|
|
|
// dateArr[4]; |
|
|
|
|
|
|
|
// //此处可以拿外部的变量接收 strDate:2022-05-01 13:25:30 |
|
|
|
|
|
|
|
// this.model.startTime = strDate; |
|
|
|
|
|
|
|
// this.model.expectedEndTime = strDate; |
|
|
|
|
|
|
|
// console.log("strDate", strDate); |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
loadData2() { |
|
|
|
|
|
|
|
// if (!this.url.list) { |
|
|
|
|
|
|
|
// this.$message.error("请设置url.list属性!"); |
|
|
|
|
|
|
|
// return |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// //加载数据 若传入参数1则加载第一页的内容 |
|
|
|
|
|
|
|
// if (arg === 1) { |
|
|
|
|
|
|
|
// this.ipagination.current = 1; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// this.loadParameter(); |
|
|
|
|
|
|
|
// var params = this.getQueryParams();//查询条件 |
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
getAction(this.url.list, params).then((res) => { |
|
|
|
|
|
|
|
if (res.success) { |
|
|
|
|
|
|
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
|
|
|
|
|
|
|
this.dataSource = res.result.records || res.result; |
|
|
|
|
|
|
|
if (res.result.total) { |
|
|
|
|
|
|
|
this.ipagination.total = res.result.total; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.ipagination.total = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------ |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.warning(res.message) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
|
|
this.loading = false |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |