日志完成80%
parent
f9a402e991
commit
da50ed138f
|
@ -234,11 +234,11 @@ export const demandApi = {
|
||||||
data: data,
|
data: data,
|
||||||
}),
|
}),
|
||||||
delDemand: (data) => request({
|
delDemand: (data) => request({
|
||||||
url: `/demand//${data}`,
|
url: `/demand/${data}`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
}),
|
}),
|
||||||
delDemandBatch: (data) => request({
|
delDemandBatch: (data) => request({
|
||||||
url: `/demand/remove/batch?ids=${data}`,
|
url: `/demand/remove/batch/${data}`,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
class="tableBox"
|
class="tableBox"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column label="序号" width="70" prop="id" />
|
<el-table-column label="序号" width="70" type="index" />
|
||||||
<el-table-column label="版本号" prop="versionNumber" />
|
<el-table-column label="版本号" prop="versionNumber" />
|
||||||
<el-table-column label="标题" prop="title" />
|
<el-table-column label="标题" prop="title" />
|
||||||
<el-table-column label="需求状态">
|
<el-table-column label="需求状态">
|
||||||
|
@ -83,6 +83,7 @@
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
trigger="click"
|
trigger="click"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
|
:disabled="scope.row.demandStatus == 4"
|
||||||
@command="
|
@command="
|
||||||
(data) => {
|
(data) => {
|
||||||
changeRow(data, 'demandStatus', scope.row);
|
changeRow(data, 'demandStatus', scope.row);
|
||||||
|
@ -151,6 +152,7 @@
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
trigger="click"
|
trigger="click"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
|
:disabled="scope.row.demandStatus == 4"
|
||||||
@command="
|
@command="
|
||||||
(data) => {
|
(data) => {
|
||||||
changeRow(data, 'priority', scope.row);
|
changeRow(data, 'priority', scope.row);
|
||||||
|
@ -491,6 +493,13 @@ export default {
|
||||||
this.editData.projectName = this.projectName;
|
this.editData.projectName = this.projectName;
|
||||||
},
|
},
|
||||||
handleEdit(row) {
|
handleEdit(row) {
|
||||||
|
if (row.demandStatus == 4) {
|
||||||
|
this.$message({
|
||||||
|
type: "warning",
|
||||||
|
message: "需求已关闭,无法编辑!",
|
||||||
|
});
|
||||||
|
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;
|
||||||
|
@ -580,6 +589,13 @@ export default {
|
||||||
{ userId: this.filters.responsiblePersonId },
|
{ userId: this.filters.responsiblePersonId },
|
||||||
];
|
];
|
||||||
} else if (type == "change") {
|
} else if (type == "change") {
|
||||||
|
if (data.demandStatus == 4) {
|
||||||
|
this.$message({
|
||||||
|
type: "warning",
|
||||||
|
message: "需求关闭后无法编辑!",
|
||||||
|
});
|
||||||
|
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") {
|
||||||
|
@ -605,14 +621,44 @@ export default {
|
||||||
handleUserClose() {
|
handleUserClose() {
|
||||||
this.userSelectDialogVisible = false;
|
this.userSelectDialogVisible = false;
|
||||||
},
|
},
|
||||||
eidtDemandRow() {
|
eidtDemandRow(row, label, old) {
|
||||||
demandApi.eidtDemand(this.checkedRow).then((res) => {
|
if (this.checkedRow.demandStatus == 4) {
|
||||||
this.$message({
|
this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", {
|
||||||
message: "修改成功",
|
confirmButtonText: "确定",
|
||||||
type: "success",
|
cancelButtonText: "取消",
|
||||||
});
|
type: "warning",
|
||||||
this.getDemandList();
|
})
|
||||||
});
|
.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();
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
row[label] = old;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async getDictData() {
|
async getDictData() {
|
||||||
const res1 = await systemApi.getDictData("demand_status");
|
const res1 = await systemApi.getDictData("demand_status");
|
||||||
|
@ -624,7 +670,7 @@ export default {
|
||||||
this.$refs.ruleForm.validate((valid) => {
|
this.$refs.ruleForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (
|
if (
|
||||||
this.editData.estimatedWorkHours.replace("天", "") !=
|
(this.editData.estimatedWorkHours + "").replace("天", "") !=
|
||||||
parseFloat(this.editData.estimatedWorkHours)
|
parseFloat(this.editData.estimatedWorkHours)
|
||||||
) {
|
) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
@ -643,23 +689,48 @@ export default {
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (this.editData.demandStatus == 4) {
|
||||||
if (this.editData.id) {
|
this.$confirm("需求关闭后将无法操作和使用, 是否继续?", "提示", {
|
||||||
demandApi.eidtDemand(this.editData).then((res) => {
|
confirmButtonText: "确定",
|
||||||
this.$message({
|
cancelButtonText: "取消",
|
||||||
message: "操作成功",
|
type: "warning",
|
||||||
type: "success",
|
}).then(() => {
|
||||||
});
|
if (this.editData.id) {
|
||||||
this.resetList();
|
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 {
|
} else {
|
||||||
demandApi.addDemand(this.editData).then((res) => {
|
if (this.editData.id) {
|
||||||
this.$message({
|
demandApi.eidtDemand(this.editData).then((res) => {
|
||||||
message: "操作成功",
|
this.$message({
|
||||||
type: "success",
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.resetList();
|
||||||
});
|
});
|
||||||
this.resetList();
|
} else {
|
||||||
});
|
demandApi.addDemand(this.editData).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
message: "操作成功",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.resetList();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -677,16 +748,20 @@ export default {
|
||||||
this.dialogVisibleAdd = false;
|
this.dialogVisibleAdd = false;
|
||||||
},
|
},
|
||||||
changeRow(value, label, row) {
|
changeRow(value, label, row) {
|
||||||
|
if (value == row[label]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let old = row[label];
|
||||||
row[label] = value;
|
row[label] = value;
|
||||||
this.checkedRow = row;
|
this.checkedRow = row;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.eidtDemandRow(row);
|
this.eidtDemandRow(row, label, old);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
changeTime(val) {
|
changeTime(val) {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
let day = (this.editData.estimatedWorkHours + "").replace("天", "");
|
let day = (this.editData.estimatedWorkHours + "").replace("天", "");
|
||||||
if (day != parseFloat(day)&&day) {
|
if (day != parseFloat(day) && day) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: "预计工时为数字",
|
message: "预计工时为数字",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
|
@ -705,8 +780,6 @@ export default {
|
||||||
new Date(this.editData.createTime).getTime()
|
new Date(this.editData.createTime).getTime()
|
||||||
).format("YYYY-MM-DD 23:59:59");
|
).format("YYYY-MM-DD 23:59:59");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(this.editData.endTime);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -97,7 +97,7 @@
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<i class="el-icon-more" style="font-size: 20px;"></i>
|
<i class="el-icon-more" style="font-size: 20px"></i>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item command="add">新建需求</el-dropdown-item>
|
<el-dropdown-item command="add">新建需求</el-dropdown-item>
|
||||||
<el-dropdown-item command="edit">编辑</el-dropdown-item>
|
<el-dropdown-item command="edit">编辑</el-dropdown-item>
|
||||||
|
@ -179,7 +179,7 @@ export default {
|
||||||
});
|
});
|
||||||
if (defaultId && defaultId != "all") {
|
if (defaultId && defaultId != "all") {
|
||||||
if (defaultId == -1) {
|
if (defaultId == -1) {
|
||||||
this.defaultExpend = res.data[res.data.length - 1].nodeId;
|
this.defaultExpend = [res.data[res.data.length - 1].nodeId];
|
||||||
} else {
|
} else {
|
||||||
this.defaultExpend = [defaultId];
|
this.defaultExpend = [defaultId];
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ export default {
|
||||||
.el-tree-node__content {
|
.el-tree-node__content {
|
||||||
height: 42px;
|
height: 42px;
|
||||||
}
|
}
|
||||||
.el-tree-node__expand-icon{
|
:not(.is-leaf.el-tree-node__expand-icon ) {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,6 @@ export default {
|
||||||
this.$refs.treeRef.getVersionTree(defaultId);
|
this.$refs.treeRef.getVersionTree(defaultId);
|
||||||
},
|
},
|
||||||
addDemand() {
|
addDemand() {
|
||||||
console.log(566);
|
|
||||||
|
|
||||||
this.$refs.rightRef.handleAdd();
|
this.$refs.rightRef.handleAdd();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -24,7 +24,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-calendar v-model="selectedDate" />
|
<el-calendar v-model="selectedDate">
|
||||||
|
<template #dateCell="{ data }">
|
||||||
|
<div
|
||||||
|
:key="data.day"
|
||||||
|
:id="data.day"
|
||||||
|
@click="searchLog(data, isOverDay(data.day))"
|
||||||
|
:class="{
|
||||||
|
dayBox: true,
|
||||||
|
disabled: isOverDay(data.day),
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ data.day.split("-")[2] }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-calendar>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -36,6 +50,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedDate: this.moment(new Date()).format("YYYY-MM-DD"),
|
selectedDate: this.moment(new Date()).format("YYYY-MM-DD"),
|
||||||
|
nowDay: this.moment(new Date()).format("YYYY-MM-DD"),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -50,7 +65,24 @@ export default {
|
||||||
.add(1, "months")
|
.add(1, "months")
|
||||||
.format("YYYY-MM-DD");
|
.format("YYYY-MM-DD");
|
||||||
},
|
},
|
||||||
},
|
searchLog(data, overDay) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if (overDay) {
|
||||||
|
this.$message({
|
||||||
|
message: "不能超过当前时间",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
this.$emit("setDisableTable", true);
|
||||||
|
} else {
|
||||||
|
this.$emit("setDisableTable", false);
|
||||||
|
this.$emit("searchDay", data.day + " 00:00:00");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
isOverDay(data) {
|
||||||
|
return new Date(data).getTime() > new Date(this.nowDay).getTime();
|
||||||
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -81,11 +113,14 @@ export default {
|
||||||
td {
|
td {
|
||||||
border: none;
|
border: none;
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
.el-calendar-day {
|
.el-calendar-day {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-family: cursive !important;
|
font-family: cursive !important;
|
||||||
}
|
}
|
||||||
|
@ -103,7 +138,6 @@ export default {
|
||||||
height: 40px;
|
height: 40px;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
|
|
||||||
border-radius: 50% !important;
|
border-radius: 50% !important;
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #88bdfd;
|
background-color: #88bdfd;
|
||||||
|
@ -123,4 +157,11 @@ export default {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.leftBox ::v-deep .disabled {
|
||||||
|
background-color: #fff !important;
|
||||||
|
color: #c0c4cc;
|
||||||
|
cursor: not-allowed;
|
||||||
|
border-radius: 50% !important;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="topBox">
|
<div class="topBox" v-show="!disableTable">
|
||||||
<div>
|
<div>
|
||||||
<div class="topTitle">当日日志</div>
|
<div class="topTitle">当日日志</div>
|
||||||
<div class="topText">总计填报工时:<span>1</span>天</div>
|
<div class="topText">总计填报工时:<span>1</span>天</div>
|
||||||
|
@ -14,180 +14,165 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表格区域 -->
|
<!-- 表格区域 -->
|
||||||
<el-table
|
<el-table :data="tableData" style="width: 100%" class="tableBox">
|
||||||
:data="tableData"
|
<el-table-column label="序号" width="70" type="index" />
|
||||||
style="width: 100%"
|
<el-table-column label="项目名称" prop="projectName">
|
||||||
class="tableBox"
|
|
||||||
>
|
|
||||||
<el-table-column label="序号" width="70" prop="id" />
|
|
||||||
<el-table-column label="项目名称" prop="versionNumber">
|
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-dropdown
|
<div v-if="scope.row.edit">
|
||||||
trigger="click"
|
<el-select
|
||||||
placement="bottom"
|
v-model="scope.row.projectId"
|
||||||
@command="
|
placeholder="时间匹配的项目"
|
||||||
(data) => {
|
class="filter-select"
|
||||||
changeRow(data, 'demandStatus', scope.row);
|
@change="
|
||||||
}
|
(val) => {
|
||||||
"
|
getVersionList(val, scope.row);
|
||||||
>
|
}
|
||||||
<el-radio
|
"
|
||||||
v-model="scope.row.demandStatus"
|
|
||||||
:label="scope.row.demandStatus"
|
|
||||||
:class="['status-tag', getStatusClass(scope.row.demandStatus)]"
|
|
||||||
>
|
>
|
||||||
{{
|
<el-option
|
||||||
statusList[scope.row.demandStatus]
|
v-for="item in projectListFilter"
|
||||||
? statusList[scope.row.demandStatus].dictLabel
|
:key="item.projectId"
|
||||||
: ""
|
:label="item.projectName"
|
||||||
}}</el-radio
|
:value="item.projectId"
|
||||||
>
|
/>
|
||||||
<el-dropdown-menu slot="dropdown">
|
</el-select>
|
||||||
<el-dropdown-item
|
</div>
|
||||||
v-for="item in statusList"
|
<div v-show="!scope.row.edit">{{ scope.row.projectName }}</div>
|
||||||
:key="item.dictValue"
|
|
||||||
:command="item.dictValue"
|
|
||||||
:class="{
|
|
||||||
tableSelect1: true,
|
|
||||||
selectedItem1: item.dictValue == scope.row.demandStatus,
|
|
||||||
}"
|
|
||||||
><el-radio
|
|
||||||
v-model="scope.row.demandStatus"
|
|
||||||
:label="scope.row.demandStatus"
|
|
||||||
:class="['status-tag', getStatusClass(item.dictValue)]"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
statusList[item.dictValue]
|
|
||||||
? statusList[item.dictValue].dictLabel
|
|
||||||
: ""
|
|
||||||
}}</el-radio
|
|
||||||
></el-dropdown-item
|
|
||||||
>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="版本" prop="title">
|
<el-table-column label="版本" prop="versionNumber">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-dropdown
|
<div v-if="scope.row.edit">
|
||||||
trigger="click"
|
<el-select
|
||||||
placement="bottom"
|
v-model="scope.row.versionId"
|
||||||
@command="
|
placeholder="含有可选需求的版本"
|
||||||
(data) => {
|
class="filter-select"
|
||||||
changeRow(data, 'demandStatus', scope.row);
|
ref="versionSelectRef"
|
||||||
}
|
@change="
|
||||||
"
|
(val) => {
|
||||||
>
|
getDemandList(val, scope.row);
|
||||||
<el-radio
|
}
|
||||||
v-model="scope.row.demandStatus"
|
"
|
||||||
:label="scope.row.demandStatus"
|
|
||||||
:class="['status-tag', getStatusClass(scope.row.demandStatus)]"
|
|
||||||
>
|
>
|
||||||
{{
|
<el-option
|
||||||
statusList[scope.row.demandStatus]
|
v-for="item in versionList.filter((ele) => ele.type == 0)"
|
||||||
? statusList[scope.row.demandStatus].dictLabel
|
:key="item.id"
|
||||||
: ""
|
:label="item.title"
|
||||||
}}</el-radio
|
:value="item.id"
|
||||||
>
|
/>
|
||||||
<el-dropdown-menu slot="dropdown">
|
</el-select>
|
||||||
<el-dropdown-item
|
</div>
|
||||||
v-for="item in statusList"
|
<div v-show="!scope.row.edit">{{ scope.row.versionNumber }}</div>
|
||||||
:key="item.dictValue"
|
|
||||||
:command="item.dictValue"
|
|
||||||
:class="{
|
|
||||||
tableSelect1: true,
|
|
||||||
selectedItem1: item.dictValue == scope.row.demandStatus,
|
|
||||||
}"
|
|
||||||
><el-radio
|
|
||||||
v-model="scope.row.demandStatus"
|
|
||||||
:label="scope.row.demandStatus"
|
|
||||||
:class="['status-tag', getStatusClass(item.dictValue)]"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
statusList[item.dictValue]
|
|
||||||
? statusList[item.dictValue].dictLabel
|
|
||||||
: ""
|
|
||||||
}}</el-radio
|
|
||||||
></el-dropdown-item
|
|
||||||
>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="项目需求">
|
<el-table-column label="项目需求">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-dropdown
|
<div v-if="scope.row.edit">
|
||||||
trigger="click"
|
<el-select
|
||||||
placement="bottom"
|
v-model="scope.row.demandId"
|
||||||
@command="
|
placeholder="进行中且时间匹配的需求"
|
||||||
(data) => {
|
class="filter-select"
|
||||||
changeRow(data, 'demandStatus', scope.row);
|
@change="openContent"
|
||||||
}
|
ref="demandSelectRef"
|
||||||
"
|
|
||||||
>
|
|
||||||
<el-radio
|
|
||||||
v-model="scope.row.demandStatus"
|
|
||||||
:label="scope.row.demandStatus"
|
|
||||||
:class="['status-tag', getStatusClass(scope.row.demandStatus)]"
|
|
||||||
>
|
>
|
||||||
{{
|
<el-option
|
||||||
statusList[scope.row.demandStatus]
|
v-for="item in demandList"
|
||||||
? statusList[scope.row.demandStatus].dictLabel
|
:key="item.id"
|
||||||
: ""
|
:label="item.title"
|
||||||
}}</el-radio
|
:value="item.id"
|
||||||
>
|
/>
|
||||||
<el-dropdown-menu slot="dropdown">
|
</el-select>
|
||||||
<el-dropdown-item
|
</div>
|
||||||
v-for="item in statusList"
|
<div v-show="!scope.row.edit">{{ scope.row.title }}</div>
|
||||||
:key="item.dictValue"
|
|
||||||
:command="item.dictValue"
|
|
||||||
:class="{
|
|
||||||
tableSelect1: true,
|
|
||||||
selectedItem1: item.dictValue == scope.row.demandStatus,
|
|
||||||
}"
|
|
||||||
><el-radio
|
|
||||||
v-model="scope.row.demandStatus"
|
|
||||||
:label="scope.row.demandStatus"
|
|
||||||
:class="['status-tag', getStatusClass(item.dictValue)]"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
statusList[item.dictValue]
|
|
||||||
? statusList[item.dictValue].dictLabel
|
|
||||||
: ""
|
|
||||||
}}</el-radio
|
|
||||||
></el-dropdown-item
|
|
||||||
>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</el-dropdown>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="工作内容" prop="responsiblePersonName">
|
<el-table-column label="工作内容" prop="workContent">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div @click="openUser('change', scope.row)" style="cursor: pointer">
|
<div @click="openContent">
|
||||||
{{ scope.row.responsiblePersonName }}
|
<el-popover
|
||||||
|
v-if="scope.row.edit"
|
||||||
|
placement="bottom"
|
||||||
|
width="400"
|
||||||
|
trigger="click"
|
||||||
|
v-model="showContent"
|
||||||
|
:key="scope.row.loggerId"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
:rows="5"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
v-model="scope.row.workContent"
|
||||||
|
:disabled="!scope.row.edit"
|
||||||
|
>
|
||||||
|
</el-input>
|
||||||
|
<div slot="reference">
|
||||||
|
<div
|
||||||
|
style="cursor: pointer"
|
||||||
|
:class="{
|
||||||
|
contentText: true,
|
||||||
|
noneText: !scope.row.workContent,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ scope.row.workContent || "请输入" }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-show="!scope.row.edit"
|
||||||
|
style="cursor: pointer"
|
||||||
|
:class="{
|
||||||
|
contentText: true,
|
||||||
|
noneText: !scope.row.workContent,
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ scope.row.workContent || "请输入" }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="工时分配" prop="estimatedWorkHours" />
|
<el-table-column label="工时分配" prop="estimatedWorkHours">
|
||||||
|
<template #default="scope">
|
||||||
|
<div>
|
||||||
|
<div v-if="scope.row.edit">
|
||||||
|
<el-select
|
||||||
|
v-model="scope.row.workTime"
|
||||||
|
placeholder="请选择版本"
|
||||||
|
class="filter-select"
|
||||||
|
filterable
|
||||||
|
allow-create
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workTimeList"
|
||||||
|
:key="item"
|
||||||
|
:label="item"
|
||||||
|
:value="item"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<div v-show="!scope.row.edit">{{ scope.row.workTime }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="120">
|
<el-table-column label="操作" width="120">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="text" @click="handleEdit(scope.row)">
|
<el-button type="text" @click="handleEdit(scope.row)">
|
||||||
编辑
|
{{ scope.row.loggerId && !scope.row.edit ? "编辑" : "确认" }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row, scope.$index)"
|
||||||
style="color: #666"
|
style="color: #666"
|
||||||
>
|
>
|
||||||
删除
|
{{ scope.row.loggerId && !scope.row.edit ? "删除" : "取消" }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -197,13 +182,240 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { demandApi, workLogApi, projectApi } from "@/utils/api";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RightTable",
|
name: "RightTable",
|
||||||
|
props: {
|
||||||
|
selectDay: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
disableTable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
statusList: [],
|
statusList: [],
|
||||||
|
userId: this.$store.state.user.id,
|
||||||
|
projectId: "",
|
||||||
|
tableData: [],
|
||||||
|
projectList: [],
|
||||||
|
versionList: [],
|
||||||
|
demandList: [],
|
||||||
|
hasTimeLong: 0,
|
||||||
|
workTimeList: [],
|
||||||
|
showContent: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
if (this.$route.query.userId) {
|
||||||
|
this.userId = this.$route.query.userId;
|
||||||
|
this.userName = this.$route.query.nickName;
|
||||||
|
this.projectId = this.$route.porjectId;
|
||||||
|
}
|
||||||
|
//获取项目列表
|
||||||
|
},
|
||||||
|
getLogList() {
|
||||||
|
workLogApi
|
||||||
|
.getLogDataDetail({
|
||||||
|
createBy: this.userId,
|
||||||
|
loggerDate: this.selectDay,
|
||||||
|
projectId: this.projectId,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.tableData = res.data.map((ele) => {
|
||||||
|
ele.edit = false;
|
||||||
|
return ele;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDelete(row, index) {
|
||||||
|
if (row.loggerId && !row.edit) {
|
||||||
|
this.$confirm("此操作将永久删除该版本号, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
workLogApi.delLog(row.loggerId).then((res) => {
|
||||||
|
this.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "删除成功!",
|
||||||
|
});
|
||||||
|
this.getLogList();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else if (!row.loggerId) {
|
||||||
|
this.tableData = this.tableData.filter((ele, ind) => index != ind);
|
||||||
|
} else {
|
||||||
|
row.edit = false;
|
||||||
|
}
|
||||||
|
// 实现删除逻辑
|
||||||
|
},
|
||||||
|
handleAdd() {
|
||||||
|
if (this.tableData.filter((ele) => ele.edit).length) {
|
||||||
|
this.$message({
|
||||||
|
message: "请先保存未完成数据",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.versionList = [];
|
||||||
|
this.demandList = [];
|
||||||
|
this.getDayTime("add");
|
||||||
|
},
|
||||||
|
async handleEdit(row) {
|
||||||
|
if (this.tableData.filter((ele) => ele.edit).length) {
|
||||||
|
this.$message({
|
||||||
|
message: "请先保存未完成数据",
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (row.edit) {
|
||||||
|
if (row.workTime > this.workTimeList[this.workTimeList.length - 1]) {
|
||||||
|
this.$modal.msgWarning("工时超过最大值");
|
||||||
|
return;
|
||||||
|
} else if (!row.workContent) {
|
||||||
|
this.$modal.msgWarning("工作日志不能为空");
|
||||||
|
return;
|
||||||
|
} else if ((String(row.workTime).split(".")[1] || "").length > 1) {
|
||||||
|
this.$modal.msgWarning("工时只允许一位小数");
|
||||||
|
return;
|
||||||
|
} else if (row.workTime <= 0) {
|
||||||
|
this.$modal.msgWarning("工时不能小于等于0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let param = {
|
||||||
|
...row,
|
||||||
|
};
|
||||||
|
if (row.loggerId) {
|
||||||
|
await workLogApi.editLog(param);
|
||||||
|
} else {
|
||||||
|
await workLogApi.addLog(param);
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("操作成功");
|
||||||
|
row.edit = false;
|
||||||
|
this.getLogList();
|
||||||
|
} else {
|
||||||
|
row.edit = true;
|
||||||
|
this.getDayTime("edit", row);
|
||||||
|
this.getVersionList(row.projectId, row, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getAllProject() {
|
||||||
|
const response = await projectApi.listProject({
|
||||||
|
pageSize: 10000,
|
||||||
|
pageNum: 1,
|
||||||
|
});
|
||||||
|
this.projectList = response.rows;
|
||||||
|
},
|
||||||
|
// 获取剩余工时
|
||||||
|
async getDayTime(type, row) {
|
||||||
|
const res = await workLogApi.getDayTime({
|
||||||
|
loggerDate: this.selectDay,
|
||||||
|
});
|
||||||
|
this.hasTimeLong = Number(res.data);
|
||||||
|
if (type == "add") {
|
||||||
|
let now = new Date(
|
||||||
|
this.moment().format("YYYY-MM-DD 00:00:00")
|
||||||
|
).getTime();
|
||||||
|
let select = new Date(this.selectDay).getTime();
|
||||||
|
let row = {
|
||||||
|
loggerDate: this.selectDay,
|
||||||
|
projectId: "",
|
||||||
|
workTime: "",
|
||||||
|
workContent: "",
|
||||||
|
state: now == select ? 0 : 1,
|
||||||
|
userId: this.userId,
|
||||||
|
demandId: "",
|
||||||
|
edit: true,
|
||||||
|
};
|
||||||
|
this.computedTime(0);
|
||||||
|
this.tableData.push(row);
|
||||||
|
} else {
|
||||||
|
this.computedTime(row.workTime);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computedTime(time) {
|
||||||
|
let length = (this.hasTimeLong + (Number(time) || 0)).toFixed(1);
|
||||||
|
this.workTimeList = new Array((length * 10) / 1)
|
||||||
|
.fill(0)
|
||||||
|
.map((ele, index) => {
|
||||||
|
return (index + 1) / 10;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getVersionList(val, row, isOpen) {
|
||||||
|
if (!isOpen) row.versionId = "";
|
||||||
|
this.$nextTick(async () => {
|
||||||
|
const res = await demandApi.getVersionTree({
|
||||||
|
projectId: val,
|
||||||
|
userId: this.userId,
|
||||||
|
demandStatusList: [2],
|
||||||
|
queryDate: this.selectDay,
|
||||||
|
});
|
||||||
|
this.versionList = res.data.filter((ele) => ele.type == 0);
|
||||||
|
this.demandList = res.data.filter((ele) => ele.type == 1);
|
||||||
|
if (!isOpen) this.$refs.versionSelectRef.toggleMenu();
|
||||||
|
if (isOpen) this.getDemandList(row.versionId, row, true);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async getDemandList(val, row, isOpen) {
|
||||||
|
if (!isOpen) row.demandId = "";
|
||||||
|
console.log(222, this.versionList);
|
||||||
|
|
||||||
|
if (this.versionList.find((ele) => ele.id == val)) {
|
||||||
|
this.demandList = this.versionList.find(
|
||||||
|
(ele) => ele.id == val
|
||||||
|
).childrenList;
|
||||||
|
} else {
|
||||||
|
this.demandList = [];
|
||||||
|
}
|
||||||
|
if (!isOpen) this.$refs.demandSelectRef.toggleMenu();
|
||||||
|
},
|
||||||
|
openContent() {
|
||||||
|
console.log(123);
|
||||||
|
|
||||||
|
this.showContent = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
$route(to, from) {
|
||||||
|
if (!this.$route.query.userId) {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selectDay(newVal) {
|
||||||
|
this.getLogList();
|
||||||
|
},
|
||||||
|
disableTable(newVal) {
|
||||||
|
if (newVal) {
|
||||||
|
this.tableData = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
versionList(newVal) {},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
projectListFilter() {
|
||||||
|
let now = new Date(this.selectDay).getTime();
|
||||||
|
return this.projectList.filter(
|
||||||
|
(ele) =>
|
||||||
|
new Date(ele.startDate).getTime() <= now &&
|
||||||
|
new Date(ele.endDate).getTime() >= now &&
|
||||||
|
ele.projectState == 1
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
this.getAllProject();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -234,4 +446,12 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.contentText {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.noneText {
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,9 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<!-- 左侧树形菜单 -->
|
<!-- 左侧树形菜单 -->
|
||||||
<LeftMonth class="sidebar" ref="leftRef" />
|
<LeftMonth
|
||||||
|
class="sidebar"
|
||||||
|
ref="leftRef"
|
||||||
|
@searchDay="searchDay"
|
||||||
|
@setDisableTable="setDisableTable"
|
||||||
|
/>
|
||||||
<!-- 右侧表格和筛选 -->
|
<!-- 右侧表格和筛选 -->
|
||||||
<RightTable class="main-content" ref="rightRef" />
|
<RightTable
|
||||||
|
class="main-content"
|
||||||
|
ref="rightRef"
|
||||||
|
:selectDay="selectDay"
|
||||||
|
:disableTable="disableTable"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -19,10 +29,22 @@ export default {
|
||||||
RightTable,
|
RightTable,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
selectDay: "",
|
||||||
|
disableTable: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
searchDay(data) {
|
||||||
|
this.selectDay = data;
|
||||||
|
},
|
||||||
|
setDisableTable(data) {
|
||||||
|
this.disableTable = data;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.selectDay = this.moment().format("YYYY-MM-DD 00:00:00");
|
||||||
},
|
},
|
||||||
methods: {},
|
|
||||||
mounted() {},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue