功能优化:任务单人员配置,供应商选择后,如果复选框没有选择,自动选择
This commit is contained in:
parent
1acef9b999
commit
73e6245496
@ -128,6 +128,7 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode TASK_DISPATCH_TASK_IS_OVER = new ErrorCode(1_009_007, "报工数量已完成");
|
ErrorCode TASK_DISPATCH_TASK_IS_OVER = new ErrorCode(1_009_007, "报工数量已完成");
|
||||||
ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工");
|
ErrorCode TASK_DISPATCH_TASK_REPORT_AMOUNT_EXCESS = new ErrorCode(1_009_006, "无法超额报工");
|
||||||
ErrorCode TASK_REPORT_OTHER_PERSON_NO_SUBMIT = new ErrorCode(1_009_020, "其他人员尚未报工,无法结束生产");
|
ErrorCode TASK_REPORT_OTHER_PERSON_NO_SUBMIT = new ErrorCode(1_009_020, "其他人员尚未报工,无法结束生产");
|
||||||
|
ErrorCode THE_REPORT_APPLICATION_NOT_ENDED = new ErrorCode(1_009_021, "该报工没有结束,请刷新界面");
|
||||||
//1_009_021已被使用
|
//1_009_021已被使用
|
||||||
/*************质量管理***********/
|
/*************质量管理***********/
|
||||||
ErrorCode UNQUALIFIED_NOTIFICATION_NOT_EXISTS = new ErrorCode(1_010_001, "品质异常通知单审核不存在");
|
ErrorCode UNQUALIFIED_NOTIFICATION_NOT_EXISTS = new ErrorCode(1_010_001, "品质异常通知单审核不存在");
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
|||||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import com.chanko.yunxi.mes.module.heli.controller.admin.taskinreport.vo.TaskReworkReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportPageReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportPageReqVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportRespVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportRespVO;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportSaveReqVO;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.taskreport.vo.TaskReportSaveReqVO;
|
||||||
@ -52,6 +53,15 @@ public class TaskReportController {
|
|||||||
return taskReportService.updateTaskReport(updateReqVO);
|
return taskReportService.updateTaskReport(updateReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/rework")
|
||||||
|
@Operation(summary = "返工")
|
||||||
|
@PreAuthorize("@ss.hasPermission('heli:task-in-report:update')")
|
||||||
|
public CommonResult<Boolean> rework(@Valid @RequestBody TaskReworkReqVO reworkReqVO) {
|
||||||
|
taskReportService.rework(reworkReqVO.getId(), reworkReqVO.getRemark());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除任务报工")
|
@Operation(summary = "删除任务报工")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
|||||||
@ -106,4 +106,8 @@ public class TaskReportRespVO {
|
|||||||
@Schema(description = "单位")
|
@Schema(description = "单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "报工状态")
|
||||||
|
private String reportProcess;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,4 +103,7 @@ public class TaskReportDO extends BaseDO {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String reportProcess;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,7 +241,8 @@ public interface StorageInventoryMapper extends BaseMapperX<StorageInventoryDO>
|
|||||||
query.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getMatSpec()),MaterialDO::getSpec, pageReqVO.getMatSpec())
|
query.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getMatSpec()),MaterialDO::getSpec, pageReqVO.getMatSpec())
|
||||||
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getMatName()), MaterialDO::getName, pageReqVO.getMatName())
|
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getMatName()), MaterialDO::getName, pageReqVO.getMatName())
|
||||||
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getMatCode()), MaterialDO::getCode, pageReqVO.getMatCode())
|
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getMatCode()), MaterialDO::getCode, pageReqVO.getMatCode())
|
||||||
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getShortName()), MaterialDO::getShortName, pageReqVO.getShortName())
|
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getShortName()), StorageInventoryDO::getShortName, pageReqVO.getShortName())
|
||||||
|
.like(!com.alibaba.druid.util.StringUtils.isEmpty(pageReqVO.getBoomSpec()), StorageInventoryDO::getBoomSpec, pageReqVO.getBoomSpec())
|
||||||
.eq(ObjectUtil.isNotEmpty(pageReqVO.getMatType()),MaterialDO::getMaterialType, pageReqVO.getMatType())
|
.eq(ObjectUtil.isNotEmpty(pageReqVO.getMatType()),MaterialDO::getMaterialType, pageReqVO.getMatType())
|
||||||
.eq(ObjectUtil.isNotEmpty(pageReqVO.getLotNo()),StorageInventoryDO::getLotNo, pageReqVO.getLotNo())
|
.eq(ObjectUtil.isNotEmpty(pageReqVO.getLotNo()),StorageInventoryDO::getLotNo, pageReqVO.getLotNo())
|
||||||
.eq(true,MaterialDO::getVirtualPart, YesOrNoEnum.N.name())
|
.eq(true,MaterialDO::getVirtualPart, YesOrNoEnum.N.name())
|
||||||
|
|||||||
@ -38,6 +38,7 @@ public interface TaskReportMapper extends BaseMapperX<TaskReportDO> {
|
|||||||
query.selectAll(TaskReportDO.class)
|
query.selectAll(TaskReportDO.class)
|
||||||
.select("d.code as projectCode", "d.project_name as projectName", "c.name as projectSubName")
|
.select("d.code as projectCode", "d.project_name as projectName", "c.name as projectSubName")
|
||||||
.select("z.code as dispatchCode")
|
.select("z.code as dispatchCode")
|
||||||
|
.select("x.report_process as reportProcess")
|
||||||
.select("f.material_name as materialName", "f.spec", "f.unit")
|
.select("f.material_name as materialName", "f.spec", "f.unit")
|
||||||
.select("y.name as procedureName")
|
.select("y.name as procedureName")
|
||||||
.select("u1.nickname as ownerName", "u2.nickname as updaterName")
|
.select("u1.nickname as ownerName", "u2.nickname as updaterName")
|
||||||
|
|||||||
@ -54,4 +54,10 @@ public interface TaskReportService {
|
|||||||
*/
|
*/
|
||||||
PageResult<TaskReportDO> getTaskReportPage(TaskReportPageReqVO pageReqVO);
|
PageResult<TaskReportDO> getTaskReportPage(TaskReportPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返工
|
||||||
|
* @param id
|
||||||
|
* @param remark
|
||||||
|
*/
|
||||||
|
void rework(Long id, String remark);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,6 +15,8 @@ import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
|||||||
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.taskreport.TaskReportMapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
@ -86,6 +88,21 @@ public class TaskReportServiceImpl implements TaskReportService {
|
|||||||
return taskReportMapper.selectPage(pageReqVO);
|
return taskReportMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void rework(Long id, String remark) {
|
||||||
|
TaskReportDO taskReportDO = taskReportMapper.selectById(id);
|
||||||
|
if (taskReportDO == null) {
|
||||||
|
throw exception(TASK_REPORT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
TaskDispatchDetailDO taskDispatchDetailDO = taskDispatchDetailMapper.selectById(taskReportDO.getDispatchDetailId());
|
||||||
|
if (taskDispatchDetailDO != null) {
|
||||||
|
if (taskDispatchDetailDO.getReportProcess() != 2) {
|
||||||
|
throw exception(THE_REPORT_APPLICATION_NOT_ENDED);
|
||||||
|
} else {
|
||||||
|
taskDispatchDetailDO.setReportProcess(1);
|
||||||
|
taskDispatchDetailDO.setReturnRemark(remark);
|
||||||
|
taskDispatchDetailMapper.updateById(taskDispatchDetailDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,11 @@ export const updateTaskReport = async (data: TaskReportVO) => {
|
|||||||
return await request.put({ url: `/heli/task-report/update`, data })
|
return await request.put({ url: `/heli/task-report/update`, data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 返工
|
||||||
|
export const rework = async (data: TaskReportVO) => {
|
||||||
|
return await request.post({url: `/heli/task-report/rework`, data})
|
||||||
|
}
|
||||||
|
|
||||||
// 删除任务报工
|
// 删除任务报工
|
||||||
export const deleteTaskReport = async (id: number) => {
|
export const deleteTaskReport = async (id: number) => {
|
||||||
return await request.delete({ url: `/heli/task-report/delete?id=` + id })
|
return await request.delete({ url: `/heli/task-report/delete?id=` + id })
|
||||||
|
|||||||
@ -63,18 +63,39 @@
|
|||||||
<el-table-column type="index" label="序号" align="center" min-width="60" fixed />
|
<el-table-column type="index" label="序号" align="center" min-width="60" fixed />
|
||||||
<el-table-column prop="description" min-width="200" label="业务人员" align="center">
|
<el-table-column prop="description" min-width="200" label="业务人员" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.busyId" filterable element-loading-background="rgb(255, 255, 255)" placeholder="请选择" >
|
<el-select
|
||||||
<el-option v-for="item in userSelectList" :key="item.id" :label="item.username + ' ' + item.nickname" :value="item.id" />
|
v-model="scope.row.busyId"
|
||||||
|
filterable
|
||||||
|
element-loading-background="rgb(255, 255, 255)"
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="(val) => handleUserSelection(val, scope.row, scope.$index)">
|
||||||
|
<el-option
|
||||||
|
v-for="item in userSelectList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.username + ' ' + item.nickname"
|
||||||
|
:value="item.id"
|
||||||
|
:disabled="isUserSelected(item.id)"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="postId" min-width="120" label="岗位" align="center">
|
<el-table-column prop="postId" min-width="120" label="岗位" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.postId" element-loading-background="rgb(255, 255, 255)" placeholder="请选择" >
|
<el-select
|
||||||
<el-option v-for="dict in getStrDictOptions(DICT_TYPE.HELI_POST)" :key="dict.value" :label="dict.label" :value="dict.value" />
|
v-model="scope.row.postId"
|
||||||
|
element-loading-background="rgb(255, 255, 255)"
|
||||||
|
placeholder="请选择"
|
||||||
|
@change="(val) => handlePostSelection(val, scope.row, scope.$index)">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.HELI_POST)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="procedureId" min-width="600" label="工序" align="center" >
|
<el-table-column prop="procedureId" min-width="600" label="工序" align="center" >
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-select v-model="scope.row.procCd" multiple clearable element-loading-background="rgb(255, 255, 255)" filterable placeholder="请选择" style="width: 100%;">
|
<el-select v-model="scope.row.procCd" multiple clearable element-loading-background="rgb(255, 255, 255)" filterable placeholder="请选择" style="width: 100%;">
|
||||||
@ -143,8 +164,6 @@ const formData = ref({
|
|||||||
remark: undefined,
|
remark: undefined,
|
||||||
userList: [],
|
userList: [],
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
|
||||||
})
|
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 99,
|
pageSize: 99,
|
||||||
@ -210,6 +229,59 @@ const closeForm = async () => {
|
|||||||
router.push({ path: '/base/fpuserdetail' })
|
router.push({ path: '/base/fpuserdetail' })
|
||||||
tagsViewStore.delVisitedView(router.currentRoute.value)
|
tagsViewStore.delVisitedView(router.currentRoute.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理用户选择变更
|
||||||
|
const handleUserSelection = (userId: number, currentRow: any, currentIndex: number) => {
|
||||||
|
if (!userId) return // 如果清空选择,则无需验证
|
||||||
|
|
||||||
|
// 检查同一用户是否已在相同岗位被选择
|
||||||
|
const duplicateIndex = formData.value.userList.findIndex(
|
||||||
|
(user, index) =>
|
||||||
|
user.busyId === userId &&
|
||||||
|
user.postId === currentRow.postId &&
|
||||||
|
index !== currentIndex
|
||||||
|
)
|
||||||
|
|
||||||
|
if (duplicateIndex !== -1) {
|
||||||
|
message.error("该用户已在相同岗位被选择,请选择其他用户或岗位")
|
||||||
|
currentRow.busyId = '' // 恢复选择
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 处理岗位选择变更
|
||||||
|
const handlePostSelection = (postId: number, currentRow: any, currentIndex: number) => {
|
||||||
|
if (!postId || !currentRow.busyId) return // 如果没有选择岗位或用户,则无需验证
|
||||||
|
|
||||||
|
// 检查同一用户是否已在相同岗位被选择
|
||||||
|
const duplicateIndex = formData.value.userList.findIndex(
|
||||||
|
(user, index) =>
|
||||||
|
user.busyId === currentRow.busyId &&
|
||||||
|
user.postId === postId &&
|
||||||
|
index !== currentIndex
|
||||||
|
)
|
||||||
|
|
||||||
|
if (duplicateIndex !== -1) {
|
||||||
|
message.error("该用户已在相同岗位被选择,请选择其他岗位或用户")
|
||||||
|
currentRow.postId = '' // 恢复选择
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 检查用户是否已在其他岗位被选择
|
||||||
|
// 检查用户在特定岗位是否已被选择
|
||||||
|
const isUserSelected = (userId: number, currentPostId: number | null = null) => {
|
||||||
|
// 检查当前用户是否在相同岗位下已被选择
|
||||||
|
return formData.value.userList.some(
|
||||||
|
user => user.busyId === userId && user.postId === currentPostId
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
|
|||||||
@ -281,7 +281,7 @@ const handleDelete = async (id: number) => {
|
|||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
const getSummaries = (param: SummaryMethodProps) => {
|
const getSummaries = (param: SummaryMethodProps) => {
|
||||||
const summaryField = ["cgYishou","remainingYishou","amount","remainingAmount"];
|
const summaryField = ["cgYs","cgYishou","remainingYishou","amount","remainingAmount"];
|
||||||
const { columns, data } = param;
|
const { columns, data } = param;
|
||||||
const sums = [];
|
const sums = [];
|
||||||
columns.forEach((column, index) => {
|
columns.forEach((column, index) => {
|
||||||
|
|||||||
@ -82,8 +82,9 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col>
|
<el-col>
|
||||||
<el-card class="hl-incard">
|
<el-card class="hl-incard">
|
||||||
<el-form ref="multipleTable" :model="list" v-loading="formLoading" label-width="0" >
|
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true"
|
||||||
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true" class="hl-table" @selection-change="handleSelectionChange" show-summary :summary-method="getSummaries" :row-class-name="tableRowClassName">
|
ref="multipleTable" class="hl-table" @selection-change="handleSelectionChange"
|
||||||
|
show-summary :summary-method="getSummaries" :row-class-name="tableRowClassName">
|
||||||
<el-table-column type="selection" width="70" />
|
<el-table-column type="selection" width="70" />
|
||||||
<el-table-column fixed label="序号" align="center" type="index" width="60" />
|
<el-table-column fixed label="序号" align="center" type="index" width="60" />
|
||||||
|
|
||||||
@ -143,7 +144,7 @@
|
|||||||
size="large"
|
size="large"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="change(scope.row)"
|
@change="onSupplierChange(scope.row)"
|
||||||
style="width: 165px"
|
style="width: 165px"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -243,7 +244,6 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
<Pagination :total="total" v-model:page="queryParams.pageNo" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
</el-form>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -555,48 +555,55 @@ const change1 =(row:any)=>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const tableRowClassName = ({ row }) => {
|
const tableRowClassName = ({ row }) => {
|
||||||
return row.isSelected ? 'selected-row' : '';
|
return row.isSelected ? 'selected-row' : '';
|
||||||
}
|
}
|
||||||
const handleSelectionChange = (val) => {
|
const handleSelectionChange = (val) => {
|
||||||
// multipleTable.value.clearSelection()
|
// 重置所有行的 isSelected 和 chkboxEnable 状态
|
||||||
// 第一步:重置所有行的 isSelected 为 false
|
|
||||||
list.value.forEach(row => {
|
list.value.forEach(row => {
|
||||||
row.isSelected = false;
|
row.isSelected = false;
|
||||||
|
row.chkboxEnable = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 第二步:将当前选中行的 isSelected 设为 true
|
// 设置选中行的状态
|
||||||
val.forEach(selectedRow => {
|
val.forEach(selectedRow => {
|
||||||
// 找到对应行并更新状态(通过唯一标识符匹配更准确)
|
|
||||||
const targetRow = list.value.find(row => row.id === selectedRow.id);
|
const targetRow = list.value.find(row => row.id === selectedRow.id);
|
||||||
if (targetRow) {
|
if (targetRow) {
|
||||||
targetRow.isSelected = true;
|
targetRow.isSelected = true;
|
||||||
|
targetRow.chkboxEnable = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
multipleTable.value=val
|
|
||||||
multipleTable.value=val
|
// 不需要再次设置表格选中状态,因为这是 selection-change 事件触发的
|
||||||
var bomDetails = list.value;
|
updateCheckboxEnableState(val);
|
||||||
if (val.length==0) {
|
};
|
||||||
for (let i = 0; i < bomDetails.length; i++) {
|
// 提取勾选状态更新逻辑
|
||||||
bomDetails[i].chkboxEnable=false
|
const updateCheckboxEnableState = (selectedRows) => {
|
||||||
}
|
const allSelected = selectedRows.length === list.value.length;
|
||||||
}else if (val.length== bomDetails.length) {
|
const noneSelected = selectedRows.length === 0;
|
||||||
for (let i = 0; i < bomDetails.length; i++) {
|
|
||||||
bomDetails[i].chkboxEnable=true
|
list.value.forEach(row => {
|
||||||
}
|
row.chkboxEnable = noneSelected ? false :
|
||||||
}else {
|
allSelected ? true :
|
||||||
for (let i = 0; i < bomDetails.length; i++) {
|
selectedRows.some(selected => selected.id === row.id);
|
||||||
for (let j = 0; j < val.length; j++) {
|
});
|
||||||
if (val[j].id==bomDetails[i].id){
|
};
|
||||||
bomDetails[i].chkboxEnable=true
|
|
||||||
break
|
// 供应商选择时自动勾选当前行
|
||||||
}else {
|
// 供应商选择时自动勾选当前行
|
||||||
bomDetails[i].chkboxEnable=false
|
const onSupplierChange = (row) => {
|
||||||
}
|
// 如果当前行未被选中,则自动选中它
|
||||||
}
|
if (!row.chkboxEnable) {
|
||||||
}
|
// 获取表格实例并确保其存在后再执行选择操作
|
||||||
|
if (multipleTable.value) {
|
||||||
|
multipleTable.value.toggleRowSelection(row, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 触发原有的 change 逻辑
|
||||||
|
change(row);
|
||||||
|
};
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
queryParams.pageNo = 1
|
queryParams.pageNo = 1
|
||||||
|
|||||||
@ -16,6 +16,16 @@ v-model="queryParams.matCode" placeholder="物料编码" clearable @keyup.enter=
|
|||||||
v-model="queryParams.matName" placeholder="物料名称" clearable @keyup.enter="handleQuery"
|
v-model="queryParams.matName" placeholder="物料名称" clearable @keyup.enter="handleQuery"
|
||||||
class="!w-240px" />
|
class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="物料简称" prop="shortName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.shortName" placeholder="物料简称" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="规格型号" prop="boomSpec">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.boomSpec" placeholder="规格型号" clearable @keyup.enter="handleQuery"
|
||||||
|
class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="物料类型" prop="matType">
|
<el-form-item label="物料类型" prop="matType">
|
||||||
<el-select v-model="queryParams.matType" placeholder="下拉选择" clearable class="!w-240px">
|
<el-select v-model="queryParams.matType" placeholder="下拉选择" clearable class="!w-240px">
|
||||||
<el-option
|
<el-option
|
||||||
@ -80,7 +90,7 @@ v-for="dict in pnCurrentList" :key="dict.id" :label="dict.pn_name"
|
|||||||
<el-table-column label="物料名称" align="center" prop="matName" fixed min-width="120"/>
|
<el-table-column label="物料名称" align="center" prop="matName" fixed min-width="120"/>
|
||||||
<el-table-column label="物料类型" align="center" prop="matType" min-width="120"/>
|
<el-table-column label="物料类型" align="center" prop="matType" min-width="120"/>
|
||||||
<el-table-column label="物料简称" align="center" prop="shortName" min-width="120"/>
|
<el-table-column label="物料简称" align="center" prop="shortName" min-width="120"/>
|
||||||
<el-table-column label="规格/型号" align="center" prop="matSpec" min-width="120"/>
|
<el-table-column label="规格/型号" align="center" prop="boomSpec" min-width="120"/>
|
||||||
<el-table-column label="品牌" align="center" prop="matBrand" min-width="120"/>
|
<el-table-column label="品牌" align="center" prop="matBrand" min-width="120"/>
|
||||||
<el-table-column label="仓库" align="center" prop="whName" min-width="120"/>
|
<el-table-column label="仓库" align="center" prop="whName" min-width="120"/>
|
||||||
<el-table-column label="库区" align="center" prop="rgName" min-width="120"/>
|
<el-table-column label="库区" align="center" prop="rgName" min-width="120"/>
|
||||||
@ -151,6 +161,8 @@ const queryParams = reactive({
|
|||||||
rgId:undefined,
|
rgId:undefined,
|
||||||
pnId: undefined,
|
pnId: undefined,
|
||||||
headerNo: undefined,
|
headerNo: undefined,
|
||||||
|
shortName: undefined,
|
||||||
|
boomSpec: undefined,
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
|
|||||||
@ -108,6 +108,14 @@
|
|||||||
<el-table-column label="报工工序" align="center" prop="procedureName" width="160" />
|
<el-table-column label="报工工序" align="center" prop="procedureName" width="160" />
|
||||||
<el-table-column label="报工工时" align="center" prop="workTime" width="160" />
|
<el-table-column label="报工工时" align="center" prop="workTime" width="160" />
|
||||||
<el-table-column label="报工数量" align="center" prop="amount" width="120" />
|
<el-table-column label="报工数量" align="center" prop="amount" width="120" />
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<!-- <el-table-column-->
|
<!-- <el-table-column-->
|
||||||
<!-- label="生产起止时间"-->
|
<!-- label="生产起止时间"-->
|
||||||
<!-- align="center"-->
|
<!-- align="center"-->
|
||||||
@ -142,7 +150,7 @@
|
|||||||
<!-- </el-tooltip>-->
|
<!-- </el-tooltip>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<el-table-column fixed="right" label="操作" align="center" width="140">
|
<el-table-column fixed="right" label="操作" align="center" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
@ -152,6 +160,14 @@
|
|||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.reportProcess == 2"
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="rework('update', scope.row.id)"
|
||||||
|
>
|
||||||
|
返工
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@ -159,6 +175,7 @@
|
|||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -174,6 +191,8 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<TaskReportForm ref="formRef" @success="getList" />
|
<TaskReportForm ref="formRef" @success="getList" />
|
||||||
|
<reworkForm ref="reworkRef" @success="getList"/>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -182,6 +201,8 @@ import {dateFormatter, formatDate} from '@/utils/formatTime'
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
import * as TaskReportApi from '@/api/heli/taskreport'
|
import * as TaskReportApi from '@/api/heli/taskreport'
|
||||||
import TaskReportForm from './TaskReportForm.vue'
|
import TaskReportForm from './TaskReportForm.vue'
|
||||||
|
import reworkForm from './reworkForm.vue'
|
||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {Setting} from "@element-plus/icons-vue";
|
import {Setting} from "@element-plus/icons-vue";
|
||||||
import ElTooltip from "element-plus/es/components/tooltip";
|
import ElTooltip from "element-plus/es/components/tooltip";
|
||||||
@ -288,6 +309,12 @@ onMounted(() => {
|
|||||||
setDefaultDate()
|
setDefaultDate()
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const reworkRef = ref()
|
||||||
|
const rework = (type: string, id?: number) => {
|
||||||
|
reworkRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* 固定搜索栏样式 */
|
/* 固定搜索栏样式 */
|
||||||
|
|||||||
@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px" @close="emits">
|
||||||
|
<el-form
|
||||||
|
ref="reworkRef"
|
||||||
|
:model="formData"
|
||||||
|
label-width="100px"
|
||||||
|
v-loading="formLoading"
|
||||||
|
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="返工原因" prop="remark">
|
||||||
|
<el-input type="textarea" :rows="3" placeholder="请输入返工原因"
|
||||||
|
v-model="formData.remark"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||||
|
<el-button @click="emits">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as TaskReportApi from '@/api/heli/taskreport'
|
||||||
|
|
||||||
|
const {t} = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
import {formatAmount} from '@/utils/formatter'
|
||||||
|
import {ifError} from "assert";
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
})
|
||||||
|
|
||||||
|
const emits = async () => {
|
||||||
|
dialogVisible.value = false
|
||||||
|
emit('success')
|
||||||
|
}
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
|
||||||
|
const reworkRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formData.value.id= id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({open}) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
|
||||||
|
const submitForm = async () => {
|
||||||
|
try {
|
||||||
|
// 构建更新数据
|
||||||
|
const data = formData.value as unknown as TaskReportApi.TaskReportVO
|
||||||
|
|
||||||
|
// 执行更新
|
||||||
|
await TaskReportApi.rework(data);
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} catch (error) {
|
||||||
|
dialogVisible.value = false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user