任务管理 问题修改 6.25

master
zhc077 1 year ago
parent e699f1f995
commit 5efcdf6681
  1. 7
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 4
      ant-design-vue-jeecg/src/views/projectx/ProjectxList.vue
  3. 54
      ant-design-vue-jeecg/src/views/projectx/modules/ProjectxForm.vue
  4. 54
      ant-design-vue-jeecg/src/views/task/TaskList.vue
  5. 127
      ant-design-vue-jeecg/src/views/task/modules/TaskForm.vue
  6. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/controller/TaskController.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/task/entity/Task.java

@ -296,6 +296,13 @@ export const JeecgListMixin = {
this.$refs.modalForm.title = "复制";
this.$refs.modalForm.disableSubmit = false;
},
// 任务管理-任务-分解
fengjieRenwu: function (record) {
record.fuzhi = true;
this.$refs.modalForm.edit(record);
this.$refs.modalForm.title = "分解";
this.$refs.modalForm.disableSubmit = false;
},
handleAdd: function () {
this.$refs.modalForm.add();
this.$refs.modalForm.title = "新增";

@ -151,13 +151,13 @@ export default {
title: '项目中文名称',
align: "center",
dataIndex: 'projectName',
customRender: (t) => ellipsis(t)
// customRender: (t) => ellipsis(t)
},
{
title: '项目英文名称',
align: "center",
dataIndex: 'projectEnName',
customRender: (t) => ellipsis(t)
// customRender: (t) => ellipsis(t)
},
{
title: '项目编码',

@ -18,17 +18,17 @@
<a-input v-model="model.projectCode" placeholder="请输入项目编码"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="项目描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pmDescribe">
<a-input v-model="model.pmDescribe" placeholder="请输入项目描述"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="项目图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectPic">
<!-- <a-input v-model="model.projectPic" placeholder="请输入项目图片" ></a-input>-->
<j-image-upload isMultiple v-model="model.projectPic"></j-image-upload>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="项目描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pmDescribe">-->
<!-- <a-input v-model="model.pmDescribe" placeholder="请输入项目描述"></a-input>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="项目图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectPic">-->
<!-- &lt;!&ndash; <a-input v-model="model.projectPic" placeholder="请输入项目图片" ></a-input>&ndash;&gt;-->
<!-- <j-image-upload isMultiple v-model="model.projectPic"></j-image-upload>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="项目网址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectUrl">
<a-input v-model="model.projectUrl" placeholder="请输入项目网址"></a-input>
@ -70,22 +70,20 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="项目状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectStatus">
<!-- <a-radio-group v-model="model.projectStatus" placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode">-->
<!-- <a-radio-group v-model="model.projectStatus" placeholder="请选择性别" >-->
<!-- <a-radio value="1">-->
<!-- -->
<!-- </a-radio>-->
<!-- <a-radio value="2">-->
<!-- -->
<!-- </a-radio>-->
<!-- </a-radio-group>-->
<j-dict-select-tag type="radio" v-model="model.projectStatus" placeholder="请输入项目状态"
dict-code="project_status"/>
<!-- <a-input-number :min="0" v-model="model.projectStatus" placeholder="请输入项目状态" style="width: 100%" />-->
<j-dict-select-tag type="radio" v-model="model.projectStatus" style="width: 100%" dict-code="project_status"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="项目图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectPic">
<!-- <a-input v-model="model.projectPic" placeholder="请输入项目图片" ></a-input>-->
<j-image-upload isMultiple v-model="model.projectPic"></j-image-upload>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col >
<a-form-model-item label="项目描述" prop="pmDescribe">
<a-input type="textarea" v-model="model.pmDescribe" :rows="2"/>
</a-form-model-item>
</a-col>
</a-row>
@ -163,7 +161,7 @@ export default {
},
edit(record) {
this.model = Object.assign({}, record);
if (this.model.fuzhi){
if (this.model.fuzhi) {
this.model.sourceProjectId = this.model.id;
this.model.id = null;
this.model.projectName = this.model.projectName + '+1';

@ -69,30 +69,31 @@
<template slot="action" slot-scope="text, record, index">
<div class="editable-row-operations">
<span v-if="curryUserName=='admin'">
<a :disabled="record.workStatus!=3" @click="updateWorkStatus(record,'9')">退回</a><a-divider type="vertical"/>
<a :disabled="record.workStatus!=3" @click="updateWorkStatus(record,'4')">审核</a><a-divider type="vertical"/>
<a :disabled="record.workStatus!=3" @click="updateWorkStatus(record,'9')">退回</a><a-divider
type="vertical"/>
<a :disabled="record.workStatus!=3" @click="updateWorkStatus(record,'4')">审核</a><a-divider
type="vertical"/>
<a @click="handleEdit(record)">编辑</a><a-divider type="vertical"/>
<a @click="fengjieRenwu(record)">分解</a><a-divider type="vertical"/>
<a @click="handleDetail(record)">详情</a><a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
<span v-else>
<a :disabled="record.workStatus==3" @click="updateWorkStatus(record,'3')">提交</a><a-divider type="vertical"/>
<span v-else>
<a :disabled="record.workStatus==3" @click="updateWorkStatus(record,'3')">提交</a><a-divider
type="vertical"/>
<a @click="handleEdit(record)">编辑</a><a-divider type="vertical"/>
<a @click="fengjieRenwu(record)">分解</a><a-divider type="vertical"/>
<a @click="handleDetail(record)">详情</a><a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</div>
</template>
</a-table>
</div>
<task-modal ref="modalForm" @ok="modalFormOk"></task-modal>
</a-card>
</template>
@ -105,8 +106,7 @@ import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import TaskModal from './modules/TaskModal'
// import {colAuthFilter} from "@/utils/authFilter"
import {getAction} from "@api/manage";
import {putAction} from "@api/manage";
import {putAction, postAction} from "@api/manage";
export default {
@ -133,7 +133,12 @@ export default {
{
title: '中文名称',
align: "center",
dataIndex: 'taskName'
dataIndex: 'taskName',
},
{
title: '上级任务',
align: "center",
dataIndex: 'upperTaskName',
},
{
title: '任务层级',
@ -252,11 +257,14 @@ export default {
delete: "/task/task/delete",
deleteBatch: "/task/task/deleteBatch",
updateWorkStatus: "/task/task/updateWorkStatus",
fengjie: "/task/task/fengjie",
exportXlsUrl: "/task/task/exportXls",
},
dictOptions: {},
superFieldList: [],
curryUserName: '',
mdl: {},
}
},
created() {
@ -288,6 +296,30 @@ export default {
}
})
},
fengjie (record) {
this.mdl = Object.assign({}, record)
this.mdl.permissions.forEach(permission => {
permission.actionsOptions = permission.actionEntitySet.map(action => {
return { label: action.describe, value: action.action, defaultCheck: action.defaultCheck }
})
})
console.log(this.mdl)
this.visible = true
},
// fengjie(record) {
// let params = {
// id: record.id,
// }
// postAction(this.url.fengjie, params).then((res) => {
// if (res.success) {
// this.$message.success(res.result);
// this.loadData();
// } else {
// this.$message.warning(res.message);
// }
// })
// },
}
}
</script>

@ -12,30 +12,13 @@
</a-col>
<a-col :span="24">
<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"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<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%"
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-col>
<a-col :span="24">
@ -48,10 +31,15 @@
</a-col>
<a-col :span="24">
<a-form-model-item label="中文名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="taskName">
<a-input v-model="model.taskName" placeholder="请输入中文名称"
autocomplete="on"
:disabled="model.typeId==null">
</a-input>
<!-- <a-input v-model="model.taskName" placeholder="请输入中文名称"-->
<!-- autocomplete="on" -->
<!-- :disabled="model.typeId==null">-->
<!-- </a-input>-->
<a-textarea v-model="model.taskName"
placeholder="请输入中文名称"
autocomplete="on"
:disabled="model.typeId==null"
auto-size />
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -259,11 +247,13 @@ export default {
this.currentNodeData.id = data.id
this.$refs.treeList.setCheckedNodes([data.id])
}
},
}
,
changetree(data, lst) {
if (lst, checkedKeys.lenght == 0)
this.$refs.treeList.setCheckedNodes([data.id])
},
}
,
fillTaskName() {
let that = this;
let fillTaskName = "";
@ -278,13 +268,18 @@ export default {
fillTaskName = res.result;
let projectNum = this.getProjectNum() + Math.floor(Math.random() * 10000) // 68 *1000000 *100000000
// console.log("------------projectNum,", projectNum)
Object.assign(that.model, {'taskName': fillTaskName + "-" + projectNum});
Object.assign(that.model, {'managerUsers': userInfo.id});
this.$forceUpdate();
// Object.assign(that.model, {'taskName': fillTaskName + "-" + projectNum});
// Object.assign(that.model, {'managerUsers': userInfo.id});
// this.$forceUpdate();
//
this.$set(that.model, 'taskName', fillTaskName + "-" + projectNum);
this.$set(that.model, 'managerUsers', userInfo.id);
}
});
}
},
}
,
//
getProjectNum() {
@ -304,7 +299,8 @@ export default {
CurrentDate += '0' + Day
}
return CurrentDate
},
}
,
add() {
this.edit(this.modelDefault);
@ -312,6 +308,13 @@ export default {
,
edit(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)
this.visible = true;
}
@ -342,73 +345,9 @@ export default {
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(),
// ];
// //MMM
// 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>

@ -8,10 +8,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
@ -26,6 +28,7 @@ import org.jeecg.modules.projectx.entity.Projectx;
import org.jeecg.modules.projectx.service.IProjectxService;
import org.jeecg.modules.task.entity.Task;
import org.jeecg.modules.task.service.ITaskService;
import org.jeecg.modules.taskType.entity.TaskType;
import org.jeecg.modules.taskType.service.ITaskTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -37,6 +40,7 @@ import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Optional;
/**
* @Description: 任务管理
@ -93,6 +97,7 @@ public class TaskController extends JeecgController<Task, ITaskService> {
if (!StringUtils.equals(ADMIN, user.getUsername())) {
queryWrapper.like("manager_users", user.getId());
}
queryWrapper.orderByDesc("create_time");
IPage<Task> pageList = taskService.page(page, queryWrapper);
pageList.getRecords().stream().forEach(e -> {
String startDate = DateUtils.date2Str(e.getStartTime(), new SimpleDateFormat(FORMAT));
@ -113,6 +118,12 @@ public class TaskController extends JeecgController<Task, ITaskService> {
Rulex rulex = iRulexService.getById(e.getRuleId());
e.setUnion(e.getUnion() + "-" + rulex.getRuleCode());
}
if (StringUtils.isNotBlank(e.getUpperId())) {
Task taskUpper = taskService.getById(e.getUpperId());
if (ObjectUtils.isNotEmpty(taskUpper)) {
e.setUpperTaskName(taskUpper.getTaskName());
}
}
});
return Result.OK(pageList);
}
@ -167,6 +178,12 @@ public class TaskController extends JeecgController<Task, ITaskService> {
@ApiOperation(value = "任务管理-通过id删除", notes = "任务管理-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
Task task = taskService.getById(id);
Optional.ofNullable(task).orElseThrow(() -> new JeecgBootException(id + ":任务不存在"));
int count = taskService.count(new LambdaQueryWrapper<Task>().eq(Task::getUpperId, task.getId()));
if (count > 0) {
throw new JeecgBootException("存在子任务暂不可删除");
}
taskService.removeById(id);
return Result.OK("删除成功!");
}

@ -72,6 +72,10 @@ public class Task implements Serializable {
@Excel(name = "中文名称", width = 15)
@ApiModelProperty(value = "中文名称")
private java.lang.String taskName;
@TableField(exist = false)
@ApiModelProperty(value = "上级任务名称")
private java.lang.String upperTaskName;
/**
* 任务层级
*/

Loading…
Cancel
Save