This commit is contained in:
zxy 2026-01-14 10:51:00 +08:00
parent 73e6245496
commit 4253e4506d
6 changed files with 51 additions and 14 deletions

View File

@ -109,5 +109,8 @@ public class TaskReportRespVO {
@Schema(description = "报工状态")
private String reportProcess;
private String procedureStatus;
}

View File

@ -98,6 +98,9 @@ public class TaskReportDO extends BaseDO {
@TableField(exist = false)
private String procedureName;
@TableField(exist = false)
private String procedureStatus;
@TableField(exist = false)
private String updaterName;

View File

@ -38,7 +38,7 @@ public interface TaskReportMapper extends BaseMapperX<TaskReportDO> {
query.selectAll(TaskReportDO.class)
.select("d.code as projectCode", "d.project_name as projectName", "c.name as projectSubName")
.select("z.code as dispatchCode")
.select("x.report_process as reportProcess")
.select("x.report_process as reportProcess","x.procedure_status as procedureStatus")
.select("f.material_name as materialName", "f.spec", "f.unit")
.select("y.name as procedureName")
.select("u1.nickname as ownerName", "u2.nickname as updaterName")

View File

@ -59,7 +59,7 @@
<el-button type="primary" size="large" @click="userAddItem">新增</el-button>
</el-col>
<el-form ref="subFormRef" :model="formData.userList" label-width="0">
<el-table :data="formData.userList" class="hl-table">
<el-table :data="formData.userList" class="hl-table" :cell-class-name="cellClassName">
<el-table-column type="index" label="序号" align="center" min-width="60" fixed />
<el-table-column prop="description" min-width="200" label="业务人员" align="center">
<template #default="scope">
@ -234,6 +234,11 @@ const closeForm = async () => {
const handleUserSelection = (userId: number, currentRow: any, currentIndex: number) => {
if (!userId) return //
//
formData.value.userList.forEach(user => {
user.duplicate = false
})
//
const duplicateIndex = formData.value.userList.findIndex(
(user, index) =>
@ -243,10 +248,11 @@ const handleUserSelection = (userId: number, currentRow: any, currentIndex: numb
)
if (duplicateIndex !== -1) {
message.error("该用户已在相同岗位被选择,请选择其他用户或岗位")
currentRow.busyId = '' //
return
//
formData.value.userList[duplicateIndex].duplicate = true
}
//
formData.value.userList = [...formData.value.userList]
}
@ -254,6 +260,11 @@ const handleUserSelection = (userId: number, currentRow: any, currentIndex: numb
const handlePostSelection = (postId: number, currentRow: any, currentIndex: number) => {
if (!postId || !currentRow.busyId) return //
//
formData.value.userList.forEach(user => {
user.duplicate = false
})
//
const duplicateIndex = formData.value.userList.findIndex(
(user, index) =>
@ -263,10 +274,11 @@ const handlePostSelection = (postId: number, currentRow: any, currentIndex: numb
)
if (duplicateIndex !== -1) {
message.error("该用户已在相同岗位被选择,请选择其他岗位或用户")
currentRow.postId = '' //
return
//
formData.value.userList[duplicateIndex].duplicate = true
}
//
formData.value.userList = [...formData.value.userList]
}
@ -317,6 +329,13 @@ const submitForm = async () => {
}
}
const cellClassName = ({ row,column }) => {
//
if ((column.label === '业务人员') && row.duplicate) {
return 'warning-row1';
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
@ -339,3 +358,9 @@ watch(() => formData.value.postId, (newValue) => {
});
</script>
<style scoped>
:deep(.warning-row1) {
background-color: #b90d35 !important;
}
</style>

View File

@ -535,10 +535,12 @@ const floatMul = (a, b) => {
return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
}
const changeUnitPrice =(row:any)=>{
extracted(row);
row.estimatedPrices=parseFloat((row.unitPrice* row.purchaseAmounts).toFixed(1))
}
const changeEstimatedPrices =(row:any)=>{
extracted(row);
row.unitPrice=parseFloat((row.estimatedPrices/row.purchaseAmounts).toFixed(1))
}
const change1 =(row:any)=>{
@ -591,8 +593,7 @@ const updateCheckboxEnableState = (selectedRows) => {
};
//
//
const onSupplierChange = (row) => {
function extracted(row) {
//
if (!row.chkboxEnable) {
//
@ -600,6 +601,11 @@ const onSupplierChange = (row) => {
multipleTable.value.toggleRowSelection(row, true);
}
}
}
//
const onSupplierChange = (row) => {
// extracted(row);
// change
change(row);
};

View File

@ -111,9 +111,9 @@
<el-table-column label="报工进度" align="center" prop="reportProcess" width="160">
<template #default="scope">
<el-tag v-if="scope.row.reportProcess === '1'" type="warning">已报工</el-tag>
<el-tag v-else-if="scope.row.reportProcess === '2'" type="success">报工完成</el-tag>
<el-tag v-else>{{ scope.row.reportProcess }}</el-tag>
<el-tag v-if="scope.row.procedureStatus === '1'" type="warning">已报工</el-tag>
<el-tag v-else-if="scope.row.procedureStatus === '2'" type="success">报工完成</el-tag>
<el-tag v-else>未知</el-tag>
</template>
</el-table-column>
<!-- <el-table-column-->
@ -161,7 +161,7 @@
编辑
</el-button>
<el-button
v-if="scope.row.reportProcess == 2"
v-if="scope.row.procedureStatus == 2"
link
type="primary"
@click="rework('update', scope.row.id)"