bug修改
parent
cf743c0dd6
commit
659108a7ac
|
@ -27,6 +27,7 @@
|
|||
v-model="filters.demandStatus"
|
||||
placeholder="不限"
|
||||
class="filter-select"
|
||||
clearable
|
||||
>
|
||||
<template #prefix>需求状态</template>
|
||||
<el-option
|
||||
|
@ -41,6 +42,7 @@
|
|||
v-model="filters.priority"
|
||||
placeholder="不限"
|
||||
class="filter-select"
|
||||
clearable
|
||||
>
|
||||
<template #prefix>优先级</template>
|
||||
<el-option
|
||||
|
@ -83,7 +85,7 @@
|
|||
<el-dropdown
|
||||
trigger="click"
|
||||
placement="bottom"
|
||||
:disabled="scope.row.demandStatus == 4"
|
||||
:key="scope.row.id"
|
||||
@command="
|
||||
(data) => {
|
||||
changeRow(data, 'demandStatus', scope.row);
|
||||
|
@ -152,7 +154,7 @@
|
|||
<el-dropdown
|
||||
trigger="click"
|
||||
placement="bottom"
|
||||
:disabled="scope.row.demandStatus == 4"
|
||||
:key="scope.row.id"
|
||||
@command="
|
||||
(data) => {
|
||||
changeRow(data, 'priority', scope.row);
|
||||
|
@ -269,6 +271,7 @@
|
|||
<el-select
|
||||
v-model="editData.demandStatus"
|
||||
placeholder="请选择需求状态"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in statusList"
|
||||
|
@ -279,7 +282,11 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="editData.priority" placeholder="请选择优先级">
|
||||
<el-select
|
||||
v-model="editData.priority"
|
||||
placeholder="请选择优先级"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in priorityList"
|
||||
:key="item.dictValue"
|
||||
|
@ -296,6 +303,7 @@
|
|||
default-first-option
|
||||
placeholder="请输入预计工时"
|
||||
@change="changeTime"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
|
@ -314,6 +322,9 @@
|
|||
placeholder="选择日期"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd 00:00:00"
|
||||
:picker-options="{
|
||||
disabledDate: setDateRange,
|
||||
}"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
@ -323,6 +334,9 @@
|
|||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd 23:59:59"
|
||||
:picker-options="{
|
||||
disabledDate: setDateRange,
|
||||
}"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
@ -358,6 +372,14 @@ export default {
|
|||
type: Array,
|
||||
default: [],
|
||||
},
|
||||
minDate: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
maxDate: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -493,13 +515,13 @@ export default {
|
|||
this.editData.projectName = this.projectName;
|
||||
},
|
||||
handleEdit(row) {
|
||||
if (row.demandStatus == 4) {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "需求已关闭,无法编辑!",
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (row.demandStatus == 4) {
|
||||
// this.$message({
|
||||
// type: "warning",
|
||||
// message: "需求已关闭,无法编辑!",
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
this.editData = row;
|
||||
this.editData.projectId = this.projectId;
|
||||
this.editData.projectName = this.projectName;
|
||||
|
@ -508,7 +530,7 @@ export default {
|
|||
},
|
||||
handleDelete(row) {
|
||||
// 实现删除逻辑
|
||||
this.$confirm("此操作将永久删除该版本号, 是否继续?", "提示", {
|
||||
this.$confirm("此操作将永久删除该需求, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
|
@ -520,6 +542,7 @@ export default {
|
|||
message: "删除成功!",
|
||||
});
|
||||
this.getDemandList();
|
||||
this.resetList();
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
|
@ -533,7 +556,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
// 实现批量删除逻辑
|
||||
this.$confirm("此操作将永久删除该版本号, 是否继续?", "提示", {
|
||||
this.$confirm("此操作将永久删除该需求, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
|
@ -546,6 +569,7 @@ export default {
|
|||
message: "删除成功!",
|
||||
});
|
||||
this.getDemandList();
|
||||
this.resetList();
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -574,8 +598,19 @@ export default {
|
|||
};
|
||||
if (this.version.type == 0) {
|
||||
param.versionId = this.version.id;
|
||||
} else {
|
||||
} else if (this.version.type == 1) {
|
||||
param.id = this.version.id;
|
||||
} else if (this.version.type == 2) {
|
||||
param.projectId = this.version.id;
|
||||
this.filters = {
|
||||
title: "",
|
||||
responsiblePersonName: "",
|
||||
responsiblePersonId: "",
|
||||
demandStatus: "",
|
||||
priority: "",
|
||||
};
|
||||
this.currentPage = 1;
|
||||
this.pageSize = 10;
|
||||
}
|
||||
demandApi.getDemandList(param).then((res) => {
|
||||
this.tableData = res.rows;
|
||||
|
@ -589,13 +624,13 @@ export default {
|
|||
{ userId: this.filters.responsiblePersonId },
|
||||
];
|
||||
} else if (type == "change") {
|
||||
if (data.demandStatus == 4) {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "需求关闭后无法编辑!",
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (data.demandStatus == 4) {
|
||||
// this.$message({
|
||||
// type: "warning",
|
||||
// message: "需求关闭后无法编辑!",
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
this.checkedRow = data;
|
||||
this.currentSelectedUser = [{ userId: data.responsiblePerson }];
|
||||
} else if (type == "add") {
|
||||
|
@ -622,13 +657,30 @@ export default {
|
|||
this.userSelectDialogVisible = false;
|
||||
},
|
||||
eidtDemandRow(row, label, old) {
|
||||
if (this.checkedRow.demandStatus == 4) {
|
||||
this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
// if (this.checkedRow.demandStatus == 4) {
|
||||
// this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning",
|
||||
// })
|
||||
// .then(() => {
|
||||
// demandApi
|
||||
// .eidtDemand(this.checkedRow)
|
||||
// .then((res) => {
|
||||
// this.$message({
|
||||
// message: "修改成功",
|
||||
// type: "success",
|
||||
// });
|
||||
// this.getDemandList();
|
||||
// })
|
||||
// .catch((res) => {
|
||||
// row[label] = old;
|
||||
// });
|
||||
// })
|
||||
// .catch(() => {
|
||||
// row[label] = old;
|
||||
// });
|
||||
// } else {
|
||||
demandApi
|
||||
.eidtDemand(this.checkedRow)
|
||||
.then((res) => {
|
||||
|
@ -641,24 +693,7 @@ export default {
|
|||
.catch((res) => {
|
||||
row[label] = old;
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
row[label] = old;
|
||||
});
|
||||
} else {
|
||||
demandApi
|
||||
.eidtDemand(this.checkedRow)
|
||||
.then((res) => {
|
||||
this.$message({
|
||||
message: "修改成功",
|
||||
type: "success",
|
||||
});
|
||||
this.getDemandList();
|
||||
})
|
||||
.catch((res) => {
|
||||
row[label] = old;
|
||||
});
|
||||
}
|
||||
// }
|
||||
},
|
||||
async getDictData() {
|
||||
const res1 = await systemApi.getDictData("demand_status");
|
||||
|
@ -689,12 +724,31 @@ export default {
|
|||
});
|
||||
return;
|
||||
}
|
||||
if (this.editData.demandStatus == 4) {
|
||||
this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
// if (this.editData.demandStatus == 4) {
|
||||
// this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", {
|
||||
// confirmButtonText: "确定",
|
||||
// cancelButtonText: "取消",
|
||||
// type: "warning",
|
||||
// }).then(() => {
|
||||
// if (this.editData.id) {
|
||||
// demandApi.eidtDemand(this.editData).then((res) => {
|
||||
// this.$message({
|
||||
// message: "操作成功",
|
||||
// type: "success",
|
||||
// });
|
||||
// this.resetList();
|
||||
// });
|
||||
// } else {
|
||||
// demandApi.addDemand(this.editData).then((res) => {
|
||||
// this.$message({
|
||||
// message: "操作成功",
|
||||
// type: "success",
|
||||
// });
|
||||
// this.resetList();
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
if (this.editData.id) {
|
||||
demandApi.eidtDemand(this.editData).then((res) => {
|
||||
this.$message({
|
||||
|
@ -709,40 +763,21 @@ export default {
|
|||
message: "操作成功",
|
||||
type: "success",
|
||||
});
|
||||
this.resetList();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.editData.id) {
|
||||
demandApi.eidtDemand(this.editData).then((res) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
});
|
||||
this.resetList();
|
||||
});
|
||||
} else {
|
||||
demandApi.addDemand(this.editData).then((res) => {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
});
|
||||
this.resetList();
|
||||
this.resetList(res.data.id);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
});
|
||||
},
|
||||
resetList() {
|
||||
resetList(id) {
|
||||
let refreshId = "";
|
||||
if (this.editData.versionId) {
|
||||
refreshId = this.versionList.find(
|
||||
(ele) => this.editData.versionId == ele.id
|
||||
).nodeId;
|
||||
} else {
|
||||
refreshId = "-1";
|
||||
refreshId = id + "_1";
|
||||
}
|
||||
this.$emit("refreshTree", refreshId);
|
||||
this.dialogVisibleAdd = false;
|
||||
|
@ -783,6 +818,16 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
setDateRange(day) {
|
||||
let date = new Date(day).getTime();
|
||||
console.log(date, Number(this.minDate));
|
||||
|
||||
if (date < Number(this.minDate) || date > Number(this.maxDate)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getDictData();
|
||||
|
|
|
@ -55,18 +55,12 @@
|
|||
|
||||
<!-- 节点图标 -->
|
||||
<img
|
||||
v-if="
|
||||
(data.nodeId === selectedId ? 'selected' : '') && data.type == 0
|
||||
"
|
||||
v-if="data.type == 0 && data.nodeId === selectedId"
|
||||
src="@/assets/demand/treeIcon.png"
|
||||
class="nodeIcon"
|
||||
/>
|
||||
<img
|
||||
v-if="
|
||||
(data.nodeId !== selectedId ? 'selected' : '') &&
|
||||
data.id != 0 &&
|
||||
data.type == 0
|
||||
"
|
||||
v-if="data.type == 0 && data.nodeId !== selectedId"
|
||||
src="@/assets/demand/treeIcon1.png"
|
||||
class="nodeIcon"
|
||||
/>
|
||||
|
@ -174,18 +168,24 @@ export default {
|
|||
}
|
||||
res.data = res.data.map((ele) => {
|
||||
ele.nodeId = ele.id + "_" + ele.type;
|
||||
ele.childrenList.map((item) => {
|
||||
item.nodeId = item.id + "_" + item.type;
|
||||
});
|
||||
ele.hover = false;
|
||||
return ele;
|
||||
});
|
||||
if (defaultId && defaultId != "all") {
|
||||
if (defaultId == -1) {
|
||||
this.defaultExpend = [res.data[res.data.length - 1].nodeId];
|
||||
} else {
|
||||
let searchId = "";
|
||||
this.defaultExpend = [defaultId];
|
||||
}
|
||||
searchId = res.data.find((ele) => ele.nodeId == defaultId);
|
||||
this.changeVersion(searchId);
|
||||
this.selectedId = this.defaultExpend[0];
|
||||
this.changeVersion(res.data.find((ele) => ele.nodeId == defaultId));
|
||||
} else if (defaultId == "all") {
|
||||
this.selectedId = "";
|
||||
this.$emit("changeVersion", {
|
||||
id: this.projectId,
|
||||
type: 2,
|
||||
});
|
||||
} else {
|
||||
this.defaultExpend = [res.data[0].nodeId];
|
||||
this.selectedId = this.defaultExpend[0];
|
||||
|
@ -340,7 +340,7 @@ export default {
|
|||
color: #333;
|
||||
}
|
||||
|
||||
.selected {
|
||||
.nodeLabel.selected {
|
||||
color: #4096ff;
|
||||
}
|
||||
|
||||
|
@ -377,9 +377,9 @@ export default {
|
|||
.el-tree-node__content {
|
||||
height: 42px;
|
||||
}
|
||||
:not(.is-leaf.el-tree-node__expand-icon ) {
|
||||
:not(.is-leaf.el-tree-node__expand-icon) {
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
// color: #333;
|
||||
}
|
||||
}
|
||||
.topBox {
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
:projectName="projectName"
|
||||
@refreshTree="refreshTree"
|
||||
:versionList="versionList"
|
||||
:minDate="minDate"
|
||||
:maxDate="maxDate"
|
||||
ref="rightRef"
|
||||
/>
|
||||
</div>
|
||||
|
@ -39,6 +41,8 @@ export default {
|
|||
projectName: "",
|
||||
versionList: [],
|
||||
version: {},
|
||||
minDate: "",
|
||||
maxDate: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -54,10 +58,15 @@ export default {
|
|||
addDemand() {
|
||||
this.$refs.rightRef.handleAdd();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
init() {
|
||||
this.projectId = this.$route.query.id;
|
||||
this.projectName = this.$route.query.projectName;
|
||||
this.minDate = this.$route.query.startDate;
|
||||
this.maxDate = this.$route.query.endDate;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<div class="project-list">
|
||||
<div class="table-actions mb10" style="text-align: right;">
|
||||
<div class="table-actions mb10" style="text-align: right">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="addProject"
|
||||
v-hasPermi="['project:list:add']"
|
||||
style="height: 30px;"
|
||||
style="height: 30px"
|
||||
>+ 新建项目</el-button
|
||||
>
|
||||
</div>
|
||||
|
@ -44,13 +44,14 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item class="formBtn">
|
||||
<el-button type="primary" size="medium" @click="onSearch">查询</el-button>
|
||||
<el-button type="primary" size="medium" @click="onSearch"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button @click="onReset" size="medium">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="f1 df">
|
||||
<CustomTable
|
||||
:columns="columns"
|
||||
|
@ -84,7 +85,7 @@
|
|||
size="mini"
|
||||
@click="handleDelete(row)"
|
||||
v-hasPermi="['project:list:delete']"
|
||||
style="color: #666;"
|
||||
style="color: #666"
|
||||
>删除</el-button
|
||||
>
|
||||
</div>
|
||||
|
@ -141,9 +142,9 @@ export default {
|
|||
label: "项目状态",
|
||||
type: "status",
|
||||
callback: (value) => {
|
||||
let status = this.statusList.find(
|
||||
(ele) => ele.dictValue == value
|
||||
)?.dictLabel||'';
|
||||
let status =
|
||||
this.statusList.find((ele) => ele.dictValue == value)
|
||||
?.dictLabel || "";
|
||||
let color = "#333";
|
||||
switch (status) {
|
||||
case "待启动":
|
||||
|
@ -201,12 +202,16 @@ export default {
|
|||
path: "/project/detail",
|
||||
});
|
||||
},
|
||||
handleDemand(row){
|
||||
handleDemand(row) {
|
||||
this.$router.push({
|
||||
path: "/demandManage",
|
||||
query: { id: row.projectId,projectName:row.projectName },
|
||||
query: {
|
||||
id: row.projectId,
|
||||
projectName: row.projectName,
|
||||
startDate: new Date(row.startDate).getTime(),
|
||||
endDate: new Date(row.endDate).getTime(),
|
||||
},
|
||||
});
|
||||
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.$router.push({
|
||||
|
@ -297,11 +302,11 @@ export default {
|
|||
border: 1px solid #ccc;
|
||||
padding-left: 10px;
|
||||
border-radius: 4px;
|
||||
::v-deep .el-form-item__label{
|
||||
::v-deep .el-form-item__label {
|
||||
color: #999 !important;
|
||||
}
|
||||
}
|
||||
.formBtn{
|
||||
.formBtn {
|
||||
border: none !important;
|
||||
}
|
||||
.demo-form-inline .el-form-item:last-child {
|
||||
|
@ -319,15 +324,14 @@ export default {
|
|||
.form-item ::v-deep .el-input,
|
||||
.form-item ::v-deep .el-select {
|
||||
// width: 100%;
|
||||
input,select{
|
||||
input,
|
||||
select {
|
||||
border: none !important;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.search-buttons {
|
||||
white-space: nowrap;
|
||||
|
||||
}
|
||||
|
||||
::v-deep .operation-buttons .el-button {
|
||||
|
|
|
@ -177,7 +177,7 @@ export default {
|
|||
}
|
||||
tbody {
|
||||
.hasLog {
|
||||
background: #a2c6f2;
|
||||
background: #71afff;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,10 @@
|
|||
:disabled="!scope.row.edit"
|
||||
>
|
||||
</el-input>
|
||||
<div style="margin-top: 10px; text-align: right" v-show="!disableTable">
|
||||
<div
|
||||
style="margin-top: 10px; text-align: right"
|
||||
v-show="!disableTable"
|
||||
>
|
||||
<el-button type="primary" @click="saveContent(scope.row, 1)"
|
||||
>确认</el-button
|
||||
>
|
||||
|
@ -342,13 +345,18 @@ export default {
|
|||
edit: true,
|
||||
};
|
||||
this.computedTime(0);
|
||||
this.tableData.push(row);
|
||||
if (this.workTimeList.length) this.tableData.push(row);
|
||||
} else {
|
||||
this.computedTime(row.workTime);
|
||||
}
|
||||
},
|
||||
computedTime(time) {
|
||||
let length = (this.hasTimeLong + (Number(time) || 0)).toFixed(1);
|
||||
if (length <= 0) {
|
||||
this.$modal.msgWarning("当日剩余工时为0");
|
||||
this.workTimeList = [];
|
||||
return;
|
||||
}
|
||||
this.workTimeList = new Array((length * 10) / 1)
|
||||
.fill(0)
|
||||
.map((ele, index) => {
|
||||
|
@ -356,12 +364,15 @@ export default {
|
|||
});
|
||||
},
|
||||
getVersionList(val, row, isOpen) {
|
||||
if (!isOpen) row.versionId = "";
|
||||
if (!isOpen) {
|
||||
row.versionId = "";
|
||||
row.demandId = "";
|
||||
}
|
||||
this.$nextTick(async () => {
|
||||
const res = await demandApi.getVersionTree({
|
||||
projectId: val,
|
||||
userId: this.userId,
|
||||
demandStatusList: [2],
|
||||
demandStatusList: [0, 1, 2, 3],
|
||||
queryDate: this.selectDay,
|
||||
});
|
||||
this.versionList = res.data.filter((ele) => ele.type == 0);
|
||||
|
@ -398,8 +409,6 @@ export default {
|
|||
watch: {
|
||||
$route(to, from) {
|
||||
if (this.$route.query.userId) {
|
||||
console.log(1234444);
|
||||
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
|
@ -419,8 +428,7 @@ export default {
|
|||
return this.projectList.filter(
|
||||
(ele) =>
|
||||
new Date(ele.startDate).getTime() <= now &&
|
||||
new Date(ele.endDate).getTime() >= now &&
|
||||
ele.projectState == 1
|
||||
new Date(ele.endDate).getTime() >= now
|
||||
);
|
||||
},
|
||||
totalWorkTime() {
|
||||
|
|
Loading…
Reference in New Issue