提交 67180a2f authored 作者: 黄志强's avatar 黄志强

修改

上级 92bd2aba
......@@ -59,7 +59,7 @@
watch: {},
//方法集合
methods: {
getFeedback() {
getFeedback() { // 获取数据
this.$axios.getFeedback().then((res) => {
console.log(res);
if (res.status === 200) {
......@@ -67,10 +67,10 @@
}
})
},
addFeedBack() {
addFeedBack() { // 显示添加弹框
this.showFeedback = true;
},
closeFeedBackDialog() {
closeFeedBackDialog() { // 关闭弹框并重新请求数据
this.showFeedback = false;
this.getFeedback();
},
......
<!-- 头部和主 -->
<!-- 头部和主 -->
<template>
<div class='indexPage'>
<el-container style="height: 100%;" direction="vertical">
......
......@@ -77,7 +77,7 @@
watch: {},
//方法集合
methods: {
postAllAddress() {
postAllAddress() { // 获取列表数据
let obj = {
"currentPage": this.currentPage,
"pageSize": this.pageSize
......
......@@ -112,7 +112,7 @@
//这里存放数据
return {
paramsData: '',
userForm:{
userForm:{ // 表单
username: '',
phone1: '',
phone2: '',
......@@ -125,7 +125,7 @@
email: '',
entryTime: '',
},
rules:{
rules:{ // 表单验证
name: [
{ required: true, message: '请输入姓名', trigger: 'blur' },
],
......@@ -176,7 +176,7 @@
watch: {},
//方法集合
methods: {
postDepartmentList() {
postDepartmentList() { // 获取数据
this.$axios.getAllDepartment().then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -203,7 +203,7 @@
console.log(name);
return name;
},
submitForm(formName) {
submitForm(formName) { // 提交
console.log(this.userForm)
this.$refs[formName].validate((valid) => {
if (valid) {
......
......@@ -75,7 +75,7 @@
//这里存放数据
return {
paramsData: '',
userForm:{
userForm:{ // 表单
username: '',
phone1: '',
phone2: '',
......@@ -99,7 +99,7 @@
watch: {},
//方法集合
methods: {
postDepartmentList() {
postDepartmentList() { // 部门数据
this.$axios.getAllDepartment().then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -107,7 +107,7 @@
}
})
},
nameDepartment(val) {
nameDepartment(val) { // 名称
console.log(val)
let name = '';
console.log(this.deOptions)
......
......@@ -236,22 +236,22 @@
this.department = result[0].id;
this.getPersonList()
},
treeSearch(val) {
treeSearch(val) { // 部门选择
console.log(val)
this.department = val;
this.getPersonList();
},
statusSelectDo(val) {
statusSelectDo(val) { // 状态选择
this.statusValue = val;
console.log(val)
this.getPersonList();
},
timeSelectDo(val) {
timeSelectDo(val) { // 时间选择
console.log(val)
this.timeSelect = val;
this.getPersonList();
},
getPersonList() {
getPersonList() { // 获取人员数据
let st;
let et;
if (this.timeSelect !== '' && this.timeSelect !== null) {
......
......@@ -87,7 +87,7 @@
watch: {},
//方法集合
methods: {
getAuthority() {
getAuthority() { // 获取列表数据
this.$axios.putAuthority().then((res) => {
console.log(res);
if (res.request.status === 200) {
......@@ -95,14 +95,14 @@
}
})
},
addAuthority() {
addAuthority() { // 新增弹框
this.dialogName = '新增权限';
this.dialogAuthorityVisible = true;
this.authorityForm.name = '';
this.authorityForm.description = '';
this.authorityForm.id = null;
},
editAuthority(val) {
editAuthority(val) { // 修改弹框
this.dialogName = '修改权限';
this.dialogAuthorityVisible = true;
console.log(val)
......@@ -114,7 +114,7 @@
this.dialogAuthorityVisible = false;
this.getAuthority();
},
submitAuthorityDialog(val) {
submitAuthorityDialog(val) { // 新增修改确认
this.$refs[val].validate((valid) => {
if (valid) {
if (this.dialogName === '新增权限') {
......@@ -147,7 +147,7 @@
}
});
},
deleteAuthority(val) {
deleteAuthority(val) { // 删除确认
console.log(val)
this.$axios.deleteAuthority(val.id).then((res) => {
console.log(res)
......
......@@ -108,14 +108,14 @@
watch: {},
//方法集合
methods: {
getUser() {
getUser() { // 获取列表数据
this.$axios.getUser().then((res) => {
console.log(res)
this.loading = false;
this.personList = res.data;
})
},
postExportAddress() {
postExportAddress() { // 下载
this.$axios.postExportAddress().then((res) => {
let url = window.URL.createObjectURL(new Blob([res.data])); // 表示一个指定Blob对象
let link = document.createElement('a');
......@@ -127,9 +127,9 @@
document.body.removeChild(link);
window.URL.revokeObjectURL(url); // 下载完成进行释放
})
},
postDownloadAddress() {
postDownloadAddress() { // 下载
this.$axios.postDownloadAddress().then((res) => {
let url = window.URL.createObjectURL(new Blob([res.data])); // 表示一个指定Blob对象
let link = document.createElement('a');
......@@ -150,7 +150,7 @@
clickBtn(){
this.$refs.fileTrain.dispatchEvent(new MouseEvent('click'))
},
getFileType() {
getFileType() { // 上传文件
// const inputFile = this.$refs.fileTrain.files;
console.log('file11231231231----------', this.$refs.fileTrain.files[0])
let formData = new FormData();
......@@ -161,7 +161,7 @@
openSearch() {
console.log(this.searchHuman)
},
deleteUSer(val) {
deleteUSer(val) { // 删除用户
console.log(val)
this.$axios.deleteUsers(val.id).then((res) => {
console.log(res);
......@@ -188,18 +188,18 @@
// console.error(err.message);
// })
},
consumerDetail(item) {
consumerDetail(item) { // 跳转详情
console.log(item)
console.log(this.$Base64.encode(JSON.stringify(item)));
localStorage.setItem('adminUser', this.$Base64.encode(JSON.stringify(item)));
this.$router.push({name: 'consumerDetails'});
},
addUser() {
addUser() { // 新增用户弹框
this.doName = '新增用户';
this.showConsumerDialog = true;
// this.$router.push({name: 'createConsumer'})
},
closeConsumerDialog(val) {
closeConsumerDialog(val) { // 关闭弹框
if (val === '修改用户') {
this.getUser();
} else if (val === '新增用户') {
......@@ -207,7 +207,7 @@
}
this.showConsumerDialog = false;
},
openDetails(val) {
openDetails(val) { // 修改用户弹框
console.log(val)
this.doName = '修改用户';
let data = JSON.parse(JSON.stringify(val));
......@@ -216,7 +216,7 @@
// localStorage.setItem('adminUser', this.$Base64.encode(JSON.stringify(val)));
// this.$router.push({name: 'consumerDetails'});
},
findDeparts(val) {
findDeparts(val) { // 部门名称
// console.log(val)
// console.log(this.departList)
let name = '';
......@@ -235,7 +235,7 @@
// })
// console.log(ret1)
},
getAllDepartmentList() {
getAllDepartmentList() { // 部门列表
this.$axios.getAllDepartment().then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -244,7 +244,7 @@
}
})
},
getRoles() {
getRoles() { // 获取角色
this.$axios.getRole().then((res) => {
console.log(res.data)
if (res.request.status === 200) {
......
......@@ -156,11 +156,11 @@
},
//方法集合
methods: {
openDialog() {
openDialog() { // 打开弹框
this.showDepartmentDialog = true;
this.currentDepartment = JSON.parse(JSON.stringify(this.companyData))
},
closeDialog() {
closeDialog() { // 关闭弹框
this.showDepartmentDialog = false;
this.postDepartment();
},
......@@ -168,7 +168,7 @@
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
postDepartment() {
postDepartment() { // 获取部门
this.$axios.postDepartmentList().then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -185,7 +185,7 @@
}
})
},
handleNodeClick(data) {
handleNodeClick(data) { // tree点击
console.log(data);
this.$refs['departmentForm'].resetFields();
this.showDetail = true;
......@@ -205,7 +205,7 @@
}
this.departmentForm = obj;
},
submitForm(formName) {
submitForm(formName) { // 新增部门
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.departmentForm)
......@@ -229,7 +229,7 @@
}
});
},
editSubmitForm(formName) {
editSubmitForm(formName) { // 修改部门
this.$refs[formName].validate((valid) => {
if (valid) {
console.log(this.departmentForm)
......@@ -250,7 +250,7 @@
}
});
},
deleteDepartment(val) {
deleteDepartment(val) { // 删除
this.$axios.deleteDepartmentList(val.id).then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -262,7 +262,7 @@
}
})
},
append(val) {
append(val) { // 添加
console.log(val);
this.currentDepartment = val;
this.showDepartmentDialog = true;
......
......@@ -78,7 +78,7 @@
watch: {},
//方法集合
methods: {
getLog() {
getLog() { // 获取数据
let start = '';
let end = '';
if (this.time[0] !== undefined) {
......
......@@ -287,7 +287,7 @@
return 1394;
}
},
getParams() {
getParams() { // 获取数据
this.$axios.getAddConfig().then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -297,7 +297,7 @@
}
})
},
getHoliday(val) {
getHoliday(val) { // 获取日历
this.$axios.getHoliday(val).then((res) => {
console.log(res)
if (res.data.length !== 0) {
......@@ -311,7 +311,7 @@
}
})
},
submitForm(formName) {
submitForm(formName) { // 保存配置
console.log(this.baseForm)
this.$refs[formName].validate((valid) => {
if (valid) {
......@@ -334,7 +334,7 @@
resetForm(formName) {
this.$refs[formName].resetFields();
},
clickCurrentDay(val, val2) {
clickCurrentDay(val, val2) { // 切换月份获取数据
console.log(val2)
let index = val2.day.substring(val2.day.length - 2, val2.day.length);
console.log(index)
......@@ -436,7 +436,7 @@
}
})
},
baseScore(val) {
baseScore(val) { // 基础分计算
console.log(val)
this.baseForm.thingHalfOfDay = (0.5 * parseInt(val)) + '';
this.baseForm.paidHalfOfDayLeave = (0.5 * parseInt(val)) + ''
......
......@@ -119,7 +119,7 @@
watch: {},
//方法集合
methods: {
companyClick() {
companyClick() { // 获取部门
let data = JSON.parse(JSON.stringify(this.companyData));
this.compantClick = '#5059d5';
this.$axios.postDepartmentList().then((res) => {
......
......@@ -191,7 +191,7 @@
//import引入的组件需要注入到对象中才能使用
components: { EditorBar },
data () {
let stateTimeVal = (rule, value, callback) => {
let stateTimeVal = (rule, value, callback) => { // 时间验证
if (!value) {
return callback(new Error('任务开始时间不能为空'));
}
......@@ -210,7 +210,7 @@
callback();
}
};
let completeVal = (rule, value, callback) => {
let completeVal = (rule, value, callback) => { // 时间验证
console.log(rule, value, callback)
console.log(this.saveStoreTaskDetailValue)
if (!value) {
......@@ -231,7 +231,7 @@
callback();
}
};
let workloadVal = (rule, value, callback) => {
let workloadVal = (rule, value, callback) => { // 工作量验证
if (!value) {
return callback(new Error('任务量不能为空'));
} else {
......@@ -252,7 +252,7 @@
};
//这里存放数据
return {
taskForm: {
taskForm: { // 新增表单
title: '',
publisher: '',
stateTime: '',
......@@ -267,8 +267,8 @@
workloadCount: 1,
audit: '',
},
announcer: '',
rules: {
announcer: '', //
rules: { // 表单验证规则
title: [
{ required: true, message: '请输入任务名称', trigger: 'blur' },
{ max: 30, message: '长度在 30 个字符之内', trigger: 'blur' }
......@@ -307,8 +307,8 @@
isClear: false,
fileList: [], // 文件列表
attachmentsArr: [], // 存储多个附件对象
userLoginData: '',
contentTip: false,
userLoginData: '', // 登录人信息
contentTip: false, // 任务内容填写验证提示
saveStoreTaskDetailValue: '', // 存储任务详情传来的值
showAuditName: false,
pickerOptionsComplete: {
......@@ -323,7 +323,7 @@
},
//监控data中的数据变化
watch: {
'taskForm.completeTime': function(val) {
'taskForm.completeTime': function(val) { // 监听完成时间并根据开始时间及组员计算工作量
console.log(val)
let count;
if (val !== '' && val !== null) {
......@@ -350,7 +350,7 @@
this.taskForm.workload = count;
}
},
'taskForm.stateTime': function(val) {
'taskForm.stateTime': function(val) { // 监听开始时间,并根据结束时间及组员计算工作量
console.log(val)
let count;
if (val !== '' && val !== null && this.taskForm.completeTime !== '' && this.taskForm.stateTime !== null) {
......@@ -377,7 +377,7 @@
this.taskForm.workload = count;
}
},
'taskForm.crewList': function(val) {
'taskForm.crewList': function(val) { // 监听组员及根据开始和完成时间计算工作量
console.log(val)
if (this.taskForm.completeTime !== '' && this.taskForm.completeTime !== null) {
// let count = JSON.parse(JSON.stringify(this.taskForm.workload));
......@@ -404,7 +404,7 @@
this.taskForm.workload = count;
}
},
content: function (val) {
content: function (val) { // 任务内容提示
if (val === '') {
this.contentTip = true;
} else {
......@@ -414,11 +414,11 @@
},
//方法集合
methods: {
findTimes(val) {
findTimes(val) { // 时间限定
// console.log(val)
return Date.parse(val) < Date.parse(this.taskForm.stateTime) - 8.64e7;
},
getPublisherUsers() {
getPublisherUsers() { // 获取审核者数据
this.$axios.getPublisherUser().then((res) => {
console.log(res)
if (res.status === 200) {
......
......@@ -28,12 +28,12 @@
data () {
//这里存放数据
return {
defaultProps: {
defaultProps: { // element tree 默认参数
children: 'workMppings',
label: 'title'
},
data: [],
divHeight: 0,
data: [], // tree数据
divHeight: 0, // 高度
taskListData: [],
currentTask: '',
colorList: [
......@@ -57,7 +57,7 @@
localStorage.setItem('taskDetail', this.$Base64.encode(JSON.stringify(val)));
this.$router.push({name: 'taskDetails'});
},
getDeaprtmentTask(val) {
getDeaprtmentTask(val) { // 获取数据
this.$axios.getTaskFindById(val).then((res) => {
console.log(res)
if (res.status === 200) {
......@@ -66,7 +66,7 @@
}
})
},
handleNodeClick(data) {
handleNodeClick(data) { // 点击tree跳转任务详情
console.log(data);
localStorage.setItem('taskDetail', this.$Base64.encode(JSON.stringify(data)));
this.$router.push({name: 'taskDetails'});
......
......@@ -476,7 +476,7 @@
//import引入的组件需要注入到对象中才能使用
components: { History },
data () {
let checkScore1 = (rule, value, callback) => {
let checkScore1 = (rule, value, callback) => { // 自我评分验证
if (this.isExecutor === false) {
callback();
} else if (!value) {
......@@ -495,7 +495,7 @@
callback();
}
};
let checkGroup = (rule, value, callback) => {
let checkGroup = (rule, value, callback) => { // 组长评分验证
console.log(rule)
console.log(value)
if (this.isAudit === false) {
......@@ -535,7 +535,7 @@
// }
};
let checkDiretor = (rule, value, callback) => {
let checkDiretor = (rule, value, callback) => { // 总监评分验证
if (this.taskForm.majordomos !== undefined && this.taskForm.majordomos.length > 0 && this.taskForm.majordomos.findIndex(item => item.id === this.userDetail.id) === -1) {
if (this.evaStatus === '1' || this.evaStatus === '2' || this.evaStatus === '4' || this.evaStatus === '5' || this.evaStatus === '6') {
callback();
......@@ -569,7 +569,7 @@
callback();
}
};
let checkVice = (rule, value, callback) => {
let checkVice = (rule, value, callback) => { // 副总经理评分验证
console.log(rule, value)
if ((this.taskForm.assistantManagers !== undefined && this.taskForm.assistantManagers.length > 0 && this.taskForm.assistantManagers.findIndex(item => item.id === this.userDetail.id) === -1) || this.evaStatus === '1' || this.evaStatus === '2' || this.evaStatus === '3' || this.evaStatus === '5' || this.evaStatus === '6') {
callback();
......@@ -618,7 +618,7 @@
callback();
}
};
let checkJust = (rule, value, callback) => {
let checkJust = (rule, value, callback) => { // 总经理评分验证
if ((this.taskForm.generalManagers !== undefined && this.taskForm.generalManagers.length > 0 && this.taskForm.generalManagers.findIndex(item => item.id === this.userDetail.id) === -1) || this.evaStatus === '1' || this.evaStatus === '2' || this.evaStatus === '3' || this.evaStatus === '4') {
callback();
} else if (!value) {
......@@ -666,17 +666,17 @@
callback();
}
};
let workScore = (rule, value, callback) => {
let workScore = (rule, value, callback) => { // 考评分数验证
if (!value) {
return callback(new Error('考评数不能为空'));
return callback(new Error('考评数不能为空'));
}
if (value < 50) {
callback(new Error('考评数不能低于50'));
callback(new Error('考评数不能低于50'));
} else {
callback();
}
};
let workLoadScore = (rule, value, callback) => {
let workLoadScore = (rule, value, callback) => { // 任务量验证
if (!value) {
return callback(new Error('任务量不能为空'));
} else if(value.toString().length > 4) {
......@@ -851,7 +851,7 @@
fileDownload(res.data, val.name);
})
},
goList() {
goList() { // 判断修改信息是否保存
// console.log(JSON.stringify(this.saveHistoryDetail));
// console.log(JSON.stringify(this.taskForm));
if (this.isPublisher === true) {
......@@ -894,7 +894,7 @@
this.$router.push({name: 'viewTask'});
}
},
getUserById(val) {
getUserById(val) { // 获取组长组员数据
this.$axios.getUserById(val).then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -903,13 +903,13 @@
}
})
},
getDetailsTask(val) {
getDetailsTask(val) { // 获取任务数据
this.$axios.getWorkDetails(val).then((res) => {
console.log(res)
if (res.request.status === 200) {
this.saveDetailTask = JSON.parse(JSON.stringify(res.data));
let postData = JSON.parse(JSON.stringify(res.data));
if ((postData.workCoefficient.toString()).indexOf(".") > -1) {
if ((postData.workCoefficient.toString()).indexOf(".") > -1) { // 根据后台返回的任务系数,计算任务分
postData.workCoefficient = (Math.round(postData.workCoefficient*100)/100) * 100;
} else {
if ((postData.workCoefficient.toString()).length < 2) {
......@@ -922,7 +922,7 @@
this.workScores = JSON.parse(JSON.stringify(postData.workCoefficient));
this.taskForm = postData;
let arr = [];
if (res.data.publisher.id === this.userDetail.id) {
if (res.data.publisher.id === this.userDetail.id) { // 判断是否是发布者
this.isPublisher = true;
if (postData.status === 'ongoing' || postData.status === 'unpublished') {
if (postData.crewList !== null && postData.crewList.length > 0) {
......@@ -960,7 +960,7 @@
} else {
this.isPublisher = false;
}
if (res.data.executor.id === this.userDetail.id) {
if (res.data.executor.id === this.userDetail.id) { // 是否是执行者
this.isExecutor = true;
} else {
this.isExecutor = false;
......@@ -986,14 +986,14 @@
}
console.log('audit-----' + this.isAudit);
}
this.$axios.putCanSubmitTask(res.data.id).then((res) => {
this.$axios.putCanSubmitTask(res.data.id).then((res) => { // 判断是否能提交
console.log(res)
if (res.status === 200) {
console.log(res.data.isNotCommit === '1')
this.isCanSubmit = res.data.isNotCommit === '1' ? true : false;
}
})
this.$axios.getScore(res.data.id).then((res) => {
this.$axios.getScore(res.data.id).then((res) => { // 考评分数
console.log(res);
if (res.status === 200) {
if (res.data !== null && res.data.score1 !== '') {
......@@ -1026,14 +1026,14 @@
// this.timeLineIndex();
})
},
getBacks() {
getBacks() { // 任务时间线
this.$axios.getTaskBack(this.taskForm.id).then((res) => {
console.log(res.data)
this.isTimeLineReturn = res.data.back;
this.timeLineIndex();
})
},
timeLineIndex() {
timeLineIndex() { // 任务时间线
let timeList = [];
if (this.taskForm.status === 'ongoing') {
this.timelines = 1;
......@@ -1278,7 +1278,7 @@
}
console.log(timeList)
},
getRelatedWorkIdTask(val) {
getRelatedWorkIdTask(val) { // 相关任务
this.relatedTableData = [];
this.$axios.getRelatedWorkId(val).then((res) => {
console.log(res)
......@@ -1288,7 +1288,7 @@
}
})
},
getWorkLoadNum() {
getWorkLoadNum() { // 剩余工作量
this.$axios.putFindWorkload(this.taskForm.id).then((res) => {
console.log(res);
if (res.status === 200) {
......@@ -1310,13 +1310,13 @@
}
})
},
closeTaskMainDialog() {
closeTaskMainDialog() { // 相关任务弹框
this.dialogTaskMainVisible = false;
},
showTaskMain() {
this.dialogTaskMainVisible = true;
},
openHistory() {
openHistory() { // 历史操作弹框
this.$axios.getTaskHistory(this.taskForm.id).then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -1325,14 +1325,14 @@
})
this.showHistoryDialog = true;
},
closeHistory() {
closeHistory() { // 关闭历史操作弹框
this.showHistoryDialog = false;
},
closeChangeTaskDialog() {
this.dialogTaskChangeVisible = false;
this.changeTaskTextarea = '';
},
openChangeTaskDialog(val) {
openChangeTaskDialog(val) { // 修改弹框
this.$refs[val].validate((valid) => {
if (valid) {
this.dialogTaskChangeVisible = true;
......@@ -1718,7 +1718,7 @@
openDeleteTaskDialog() {
this.dialogDeleteTaskVisible = true;
},
changeTaskSubmit() {
changeTaskSubmit() { // 修改任务弹框
// 修改任务确定
console.log(this.taskForm)
if (this.taskForm.status === 'ongoing') {
......@@ -1774,7 +1774,7 @@
'showDialog': false
});
},
statusTaskSubmit(val, tip) {
statusTaskSubmit(val, tip) { // 提交撤回任务弹框
let msg = '';
let re = '';
if (tip === '撤回') {
......@@ -1840,7 +1840,7 @@
})
}
},
submitDeleteDialog() {
submitDeleteDialog() { // 删除任务弹框
console.log(this.deleteCheck)
let pw = this.deleteCheck.includes('个人工作量') ? 1 : 0;
let wc =this.deleteCheck.includes('任务工作量') ? 1 : 0;
......@@ -1917,7 +1917,7 @@
}
});
},
breakDownTask() {
breakDownTask() { // 分解任务
console.log(this.taskForm)
console.log(this.leaderOptions)
let arr = [];
......@@ -1967,24 +1967,17 @@
}
}
},
addGroupChange(val) {
console.log(val)
addGroupChange(val) { // 计算任务量
let count;
let a1 = Date.parse(this.taskForm.stateTime);
let a2 = Date.parse(this.taskForm.completeTime);
console.log(a1, a2)
console.log(a2-a1);
count = Math.ceil((a2-a1)/ (1000 * 60 * 60 * 24)) + 1;//核心:时间戳相减,然后除以天数
console.log(count)
let crew = [...val];
let index = crew.indexOf(this.taskForm.executor.id);
console.log(index)
if (index > -1) {
crew.splice(index, 1);
}
console.log(crew.length)
count = (1 + crew.length) * count;
console.log(count)
this.taskForm.workload = count;
},
// 完成任务附件添加
......
......@@ -137,7 +137,7 @@
//import引入的组件需要注入到对象中才能使用
components: { EditorBar },
data () {
let stateTimeVal = (rule, value, callback) => {
let stateTimeVal = (rule, value, callback) => { // 时间验证
if (!value) {
return callback(new Error('任务开始时间不能为空'));
}
......@@ -156,7 +156,7 @@
callback();
}
};
let completeVal = (rule, value, callback) => {
let completeVal = (rule, value, callback) => { // 时间验证
console.log(rule, value, callback)
if (!value) {
return callback(new Error('预计完成时间为空'));
......@@ -176,7 +176,7 @@
callback();
}
};
let workloadVal = (rule, value, callback) => {
let workloadVal = (rule, value, callback) => { // 时间验证
if (!value) {
return callback(new Error('任务量不能为空'));
} else {
......@@ -195,7 +195,7 @@
};
//这里存放数据
return {
taskForm: {
taskForm: { // 表单
title: '',
publisher: '',
stateTime: '',
......@@ -238,7 +238,7 @@
// }
// }
},
rules: {
rules: { // 表单验证
title: [
{ required: true, message: '请输入任务名称', trigger: 'blur' },
],
......@@ -286,7 +286,7 @@
computed: {},
//监控data中的数据变化
watch: {
'taskForm.completeTime': function(val) {
'taskForm.completeTime': function(val) { // 监听时间
console.log(val)
let count;
if (val !== '' && val !== null) {
......@@ -313,7 +313,7 @@
this.taskForm.workload = count;
}
},
'taskForm.crewList': function(val) {
'taskForm.crewList': function(val) { // 监听组员
console.log(val)
if (this.taskForm.completeTime !== '' && this.taskForm.completeTime !== null) {
let count = JSON.parse(JSON.stringify(this.taskForm.workload));
......@@ -340,7 +340,7 @@
// console.log(val)
return Date.parse(val) < Date.parse(this.taskForm.stateTime) - 8.64e7;
},
getUserById(val) {
getUserById(val) { // 获取人
this.$axios.getUserById(val).then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -357,7 +357,7 @@
}
})
},
getDetailsTask(val) {
getDetailsTask(val) { // 任务详情
this.$axios.getWorkDetails(val).then((res) => {
console.log(res)
if (res.request.status === 200) {
......@@ -400,7 +400,7 @@
}
});
},
submitForm(formName) {
submitForm(formName) { // 提交
// alert(this.content);
this.$refs[formName].validate((valid) => {
if (valid) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论