bug修改

v1.2.0
rdpnr_hemingxia 2025-03-28 17:51:53 +08:00
parent cf743c0dd6
commit 659108a7ac
6 changed files with 207 additions and 141 deletions

View File

@ -27,6 +27,7 @@
v-model="filters.demandStatus" v-model="filters.demandStatus"
placeholder="不限" placeholder="不限"
class="filter-select" class="filter-select"
clearable
> >
<template #prefix>需求状态</template> <template #prefix>需求状态</template>
<el-option <el-option
@ -41,6 +42,7 @@
v-model="filters.priority" v-model="filters.priority"
placeholder="不限" placeholder="不限"
class="filter-select" class="filter-select"
clearable
> >
<template #prefix>优先级</template> <template #prefix>优先级</template>
<el-option <el-option
@ -83,7 +85,7 @@
<el-dropdown <el-dropdown
trigger="click" trigger="click"
placement="bottom" placement="bottom"
:disabled="scope.row.demandStatus == 4" :key="scope.row.id"
@command=" @command="
(data) => { (data) => {
changeRow(data, 'demandStatus', scope.row); changeRow(data, 'demandStatus', scope.row);
@ -152,7 +154,7 @@
<el-dropdown <el-dropdown
trigger="click" trigger="click"
placement="bottom" placement="bottom"
:disabled="scope.row.demandStatus == 4" :key="scope.row.id"
@command=" @command="
(data) => { (data) => {
changeRow(data, 'priority', scope.row); changeRow(data, 'priority', scope.row);
@ -269,6 +271,7 @@
<el-select <el-select
v-model="editData.demandStatus" v-model="editData.demandStatus"
placeholder="请选择需求状态" placeholder="请选择需求状态"
clearable
> >
<el-option <el-option
v-for="item in statusList" v-for="item in statusList"
@ -279,7 +282,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="editData.priority" placeholder="请选择优先级"> <el-select
v-model="editData.priority"
placeholder="请选择优先级"
clearable
>
<el-option <el-option
v-for="item in priorityList" v-for="item in priorityList"
:key="item.dictValue" :key="item.dictValue"
@ -296,6 +303,7 @@
default-first-option default-first-option
placeholder="请输入预计工时" placeholder="请输入预计工时"
@change="changeTime" @change="changeTime"
clearable
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -314,6 +322,9 @@
placeholder="选择日期" placeholder="选择日期"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd 00:00:00" value-format="yyyy-MM-dd 00:00:00"
:picker-options="{
disabledDate: setDateRange,
}"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -323,6 +334,9 @@
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd 23:59:59" value-format="yyyy-MM-dd 23:59:59"
:picker-options="{
disabledDate: setDateRange,
}"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -358,6 +372,14 @@ export default {
type: Array, type: Array,
default: [], default: [],
}, },
minDate: {
type: String,
default: "",
},
maxDate: {
type: String,
default: "",
},
}, },
data() { data() {
return { return {
@ -493,13 +515,13 @@ export default {
this.editData.projectName = this.projectName; this.editData.projectName = this.projectName;
}, },
handleEdit(row) { handleEdit(row) {
if (row.demandStatus == 4) { // if (row.demandStatus == 4) {
this.$message({ // this.$message({
type: "warning", // type: "warning",
message: "需求已关闭,无法编辑!", // message: "!",
}); // });
return; // return;
} // }
this.editData = row; this.editData = row;
this.editData.projectId = this.projectId; this.editData.projectId = this.projectId;
this.editData.projectName = this.projectName; this.editData.projectName = this.projectName;
@ -508,7 +530,7 @@ export default {
}, },
handleDelete(row) { handleDelete(row) {
// //
this.$confirm("此操作将永久删除该版本号, 是否继续?", "提示", { this.$confirm("此操作将永久删除该需求, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
@ -520,6 +542,7 @@ export default {
message: "删除成功!", message: "删除成功!",
}); });
this.getDemandList(); this.getDemandList();
this.resetList();
}); });
}) })
.catch(() => {}); .catch(() => {});
@ -533,7 +556,7 @@ export default {
return; return;
} }
// //
this.$confirm("此操作将永久删除该版本号, 是否继续?", "提示", { this.$confirm("此操作将永久删除该需求, 是否继续?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
@ -546,6 +569,7 @@ export default {
message: "删除成功!", message: "删除成功!",
}); });
this.getDemandList(); this.getDemandList();
this.resetList();
}); });
}); });
}, },
@ -574,8 +598,19 @@ export default {
}; };
if (this.version.type == 0) { if (this.version.type == 0) {
param.versionId = this.version.id; param.versionId = this.version.id;
} else { } else if (this.version.type == 1) {
param.id = this.version.id; 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) => { demandApi.getDemandList(param).then((res) => {
this.tableData = res.rows; this.tableData = res.rows;
@ -589,13 +624,13 @@ export default {
{ userId: this.filters.responsiblePersonId }, { userId: this.filters.responsiblePersonId },
]; ];
} else if (type == "change") { } else if (type == "change") {
if (data.demandStatus == 4) { // if (data.demandStatus == 4) {
this.$message({ // this.$message({
type: "warning", // type: "warning",
message: "需求关闭后无法编辑!", // message: "!",
}); // });
return; // return;
} // }
this.checkedRow = data; this.checkedRow = data;
this.currentSelectedUser = [{ userId: data.responsiblePerson }]; this.currentSelectedUser = [{ userId: data.responsiblePerson }];
} else if (type == "add") { } else if (type == "add") {
@ -622,43 +657,43 @@ export default {
this.userSelectDialogVisible = false; this.userSelectDialogVisible = false;
}, },
eidtDemandRow(row, label, old) { eidtDemandRow(row, label, old) {
if (this.checkedRow.demandStatus == 4) { // if (this.checkedRow.demandStatus == 4) {
this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", { // this.$confirm("使, ?", "", {
confirmButtonText: "确定", // confirmButtonText: "",
cancelButtonText: "取消", // cancelButtonText: "",
type: "warning", // 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) => {
this.$message({
message: "修改成功",
type: "success",
});
this.getDemandList();
}) })
.then(() => { .catch((res) => {
demandApi row[label] = old;
.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) => {
this.$message({
message: "修改成功",
type: "success",
});
this.getDemandList();
})
.catch((res) => {
row[label] = old;
});
}
}, },
async getDictData() { async getDictData() {
const res1 = await systemApi.getDictData("demand_status"); const res1 = await systemApi.getDictData("demand_status");
@ -689,60 +724,60 @@ export default {
}); });
return; return;
} }
if (this.editData.demandStatus == 4) { // if (this.editData.demandStatus == 4) {
this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", { // this.$confirm("使, ?", "", {
confirmButtonText: "确定", // confirmButtonText: "",
cancelButtonText: "取消", // cancelButtonText: "",
type: "warning", // type: "warning",
}).then(() => { // }).then(() => {
if (this.editData.id) { // if (this.editData.id) {
demandApi.eidtDemand(this.editData).then((res) => { // demandApi.eidtDemand(this.editData).then((res) => {
this.$message({ // this.$message({
message: "操作成功", // message: "",
type: "success", // type: "success",
}); // });
this.resetList(); // this.resetList();
}); // });
} else { // } else {
demandApi.addDemand(this.editData).then((res) => { // demandApi.addDemand(this.editData).then((res) => {
this.$message({ // this.$message({
message: "操作成功", // message: "",
type: "success", // type: "success",
}); // });
this.resetList(); // this.resetList();
}); // });
} // }
// });
// } else {
if (this.editData.id) {
demandApi.eidtDemand(this.editData).then((res) => {
this.$message({
message: "操作成功",
type: "success",
});
this.resetList();
}); });
} else { } else {
if (this.editData.id) { demandApi.addDemand(this.editData).then((res) => {
demandApi.eidtDemand(this.editData).then((res) => { this.$message({
this.$message({ message: "操作成功",
message: "操作成功", type: "success",
type: "success",
});
this.resetList();
}); });
} else { this.resetList(res.data.id);
demandApi.addDemand(this.editData).then((res) => { });
this.$message({
message: "操作成功",
type: "success",
});
this.resetList();
});
}
} }
} }
// }
}); });
}, },
resetList() { resetList(id) {
let refreshId = ""; let refreshId = "";
if (this.editData.versionId) { if (this.editData.versionId) {
refreshId = this.versionList.find( refreshId = this.versionList.find(
(ele) => this.editData.versionId == ele.id (ele) => this.editData.versionId == ele.id
).nodeId; ).nodeId;
} else { } else {
refreshId = "-1"; refreshId = id + "_1";
} }
this.$emit("refreshTree", refreshId); this.$emit("refreshTree", refreshId);
this.dialogVisibleAdd = false; 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() { created() {
this.getDictData(); this.getDictData();

View File

@ -55,18 +55,12 @@
<!-- 节点图标 --> <!-- 节点图标 -->
<img <img
v-if=" v-if="data.type == 0 && data.nodeId === selectedId"
(data.nodeId === selectedId ? 'selected' : '') && data.type == 0
"
src="@/assets/demand/treeIcon.png" src="@/assets/demand/treeIcon.png"
class="nodeIcon" class="nodeIcon"
/> />
<img <img
v-if=" v-if="data.type == 0 && data.nodeId !== selectedId"
(data.nodeId !== selectedId ? 'selected' : '') &&
data.id != 0 &&
data.type == 0
"
src="@/assets/demand/treeIcon1.png" src="@/assets/demand/treeIcon1.png"
class="nodeIcon" class="nodeIcon"
/> />
@ -174,18 +168,24 @@ export default {
} }
res.data = res.data.map((ele) => { res.data = res.data.map((ele) => {
ele.nodeId = ele.id + "_" + ele.type; ele.nodeId = ele.id + "_" + ele.type;
ele.childrenList.map((item) => {
item.nodeId = item.id + "_" + item.type;
});
ele.hover = false; ele.hover = false;
return ele; return ele;
}); });
if (defaultId && defaultId != "all") { if (defaultId && defaultId != "all") {
if (defaultId == -1) { let searchId = "";
this.defaultExpend = [res.data[res.data.length - 1].nodeId]; this.defaultExpend = [defaultId];
} else { searchId = res.data.find((ele) => ele.nodeId == defaultId);
this.defaultExpend = [defaultId]; this.changeVersion(searchId);
}
this.selectedId = this.defaultExpend[0]; this.selectedId = this.defaultExpend[0];
this.changeVersion(res.data.find((ele) => ele.nodeId == defaultId));
} else if (defaultId == "all") { } else if (defaultId == "all") {
this.selectedId = "";
this.$emit("changeVersion", {
id: this.projectId,
type: 2,
});
} else { } else {
this.defaultExpend = [res.data[0].nodeId]; this.defaultExpend = [res.data[0].nodeId];
this.selectedId = this.defaultExpend[0]; this.selectedId = this.defaultExpend[0];
@ -340,7 +340,7 @@ export default {
color: #333; color: #333;
} }
.selected { .nodeLabel.selected {
color: #4096ff; color: #4096ff;
} }
@ -377,9 +377,9 @@ export default {
.el-tree-node__content { .el-tree-node__content {
height: 42px; height: 42px;
} }
:not(.is-leaf.el-tree-node__expand-icon ) { :not(.is-leaf.el-tree-node__expand-icon) {
font-size: 16px; font-size: 16px;
color: #333; // color: #333;
} }
} }
.topBox { .topBox {

View File

@ -17,6 +17,8 @@
:projectName="projectName" :projectName="projectName"
@refreshTree="refreshTree" @refreshTree="refreshTree"
:versionList="versionList" :versionList="versionList"
:minDate="minDate"
:maxDate="maxDate"
ref="rightRef" ref="rightRef"
/> />
</div> </div>
@ -39,6 +41,8 @@ export default {
projectName: "", projectName: "",
versionList: [], versionList: [],
version: {}, version: {},
minDate: "",
maxDate: "",
}; };
}, },
methods: { methods: {
@ -54,10 +58,15 @@ export default {
addDemand() { addDemand() {
this.$refs.rightRef.handleAdd(); this.$refs.rightRef.handleAdd();
}, },
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() { mounted() {
this.projectId = this.$route.query.id; this.init();
this.projectName = this.$route.query.projectName;
}, },
}; };
</script> </script>

View File

@ -1,12 +1,12 @@
<template> <template>
<div class="project-list"> <div class="project-list">
<div class="table-actions mb10" style="text-align: right;"> <div class="table-actions mb10" style="text-align: right">
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="addProject" @click="addProject"
v-hasPermi="['project:list:add']" v-hasPermi="['project:list:add']"
style="height: 30px;" style="height: 30px"
>+ 新建项目</el-button >+ 新建项目</el-button
> >
</div> </div>
@ -44,13 +44,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="formBtn"> <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-button @click="onReset" size="medium">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div class="f1 df"> <div class="f1 df">
<CustomTable <CustomTable
:columns="columns" :columns="columns"
@ -84,7 +85,7 @@
size="mini" size="mini"
@click="handleDelete(row)" @click="handleDelete(row)"
v-hasPermi="['project:list:delete']" v-hasPermi="['project:list:delete']"
style="color: #666;" style="color: #666"
>删除</el-button >删除</el-button
> >
</div> </div>
@ -141,9 +142,9 @@ export default {
label: "项目状态", label: "项目状态",
type: "status", type: "status",
callback: (value) => { callback: (value) => {
let status = this.statusList.find( let status =
(ele) => ele.dictValue == value this.statusList.find((ele) => ele.dictValue == value)
)?.dictLabel||''; ?.dictLabel || "";
let color = "#333"; let color = "#333";
switch (status) { switch (status) {
case "待启动": case "待启动":
@ -201,12 +202,16 @@ export default {
path: "/project/detail", path: "/project/detail",
}); });
}, },
handleDemand(row){ handleDemand(row) {
this.$router.push({ this.$router.push({
path: "/demandManage", 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) { handleEdit(row) {
this.$router.push({ this.$router.push({
@ -297,11 +302,11 @@ export default {
border: 1px solid #ccc; border: 1px solid #ccc;
padding-left: 10px; padding-left: 10px;
border-radius: 4px; border-radius: 4px;
::v-deep .el-form-item__label{ ::v-deep .el-form-item__label {
color: #999 !important; color: #999 !important;
} }
} }
.formBtn{ .formBtn {
border: none !important; border: none !important;
} }
.demo-form-inline .el-form-item:last-child { .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-input,
.form-item ::v-deep .el-select { .form-item ::v-deep .el-select {
// width: 100%; // width: 100%;
input,select{ input,
select {
border: none !important; border: none !important;
} }
} }
.search-buttons { .search-buttons {
white-space: nowrap; white-space: nowrap;
} }
::v-deep .operation-buttons .el-button { ::v-deep .operation-buttons .el-button {

View File

@ -177,7 +177,7 @@ export default {
} }
tbody { tbody {
.hasLog { .hasLog {
background: #a2c6f2; background: #71afff;
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
} }

View File

@ -112,7 +112,10 @@
:disabled="!scope.row.edit" :disabled="!scope.row.edit"
> >
</el-input> </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 type="primary" @click="saveContent(scope.row, 1)"
>确认</el-button >确认</el-button
> >
@ -342,13 +345,18 @@ export default {
edit: true, edit: true,
}; };
this.computedTime(0); this.computedTime(0);
this.tableData.push(row); if (this.workTimeList.length) this.tableData.push(row);
} else { } else {
this.computedTime(row.workTime); this.computedTime(row.workTime);
} }
}, },
computedTime(time) { computedTime(time) {
let length = (this.hasTimeLong + (Number(time) || 0)).toFixed(1); 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) this.workTimeList = new Array((length * 10) / 1)
.fill(0) .fill(0)
.map((ele, index) => { .map((ele, index) => {
@ -356,12 +364,15 @@ export default {
}); });
}, },
getVersionList(val, row, isOpen) { getVersionList(val, row, isOpen) {
if (!isOpen) row.versionId = ""; if (!isOpen) {
row.versionId = "";
row.demandId = "";
}
this.$nextTick(async () => { this.$nextTick(async () => {
const res = await demandApi.getVersionTree({ const res = await demandApi.getVersionTree({
projectId: val, projectId: val,
userId: this.userId, userId: this.userId,
demandStatusList: [2], demandStatusList: [0, 1, 2, 3],
queryDate: this.selectDay, queryDate: this.selectDay,
}); });
this.versionList = res.data.filter((ele) => ele.type == 0); this.versionList = res.data.filter((ele) => ele.type == 0);
@ -398,8 +409,6 @@ export default {
watch: { watch: {
$route(to, from) { $route(to, from) {
if (this.$route.query.userId) { if (this.$route.query.userId) {
console.log(1234444);
this.init(); this.init();
} }
}, },
@ -419,8 +428,7 @@ export default {
return this.projectList.filter( return this.projectList.filter(
(ele) => (ele) =>
new Date(ele.startDate).getTime() <= now && new Date(ele.startDate).getTime() <= now &&
new Date(ele.endDate).getTime() >= now && new Date(ele.endDate).getTime() >= now
ele.projectState == 1
); );
}, },
totalWorkTime() { totalWorkTime() {