| | |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="机台" prop="machineId"> |
| | | <el-form-item label="机台" prop="deviceId"> |
| | | <el-select |
| | | v-model="reportForm.machineId" |
| | | v-model="reportForm.deviceId" |
| | | placeholder="请选择机台" |
| | | filterable |
| | | clearable |
| | |
| | | |
| | | const handleDeviceChange = (val) => { |
| | | const device = deviceOptions.value.find(item => item.id === val) |
| | | reportForm.machineName = device?.deviceName || "" |
| | | reportForm.machineId = val || "" |
| | | reportForm.deviceName = device?.deviceName || "" |
| | | reportForm.deviceId = val || "" |
| | | } |
| | | |
| | | const normalizeArray = (val) => { |
| | |
| | | label: "工序名称", |
| | | prop: "processName", |
| | | }, |
| | | // { |
| | | // label: "机台名称", |
| | | // prop: "deviceName", |
| | | // }, |
| | | { |
| | | label: "机台名称", |
| | | prop: "deviceNames", |
| | | }, |
| | | { |
| | | label: "需求数量", |
| | | prop: "planQuantity", |
| | |
| | | prop: "completionStatus", |
| | | dataType: "slot", |
| | | slot: "completionStatus", |
| | | width: "140", |
| | | }, |
| | | { |
| | | label: "报工人", |
| | | prop: "userNames", |
| | | width: "140", |
| | | }, |
| | | { |
| | |
| | | clickFun: row => { |
| | | handleEdit(row); |
| | | }, |
| | | // 当需求数量等于完成数量的时候,按钮不可点击 |
| | | disabled: row => |
| | | Number(row?.planQuantity) === Number(row?.completeQuantity) || |
| | | !canOperateByReportWorker.value(row), |
| | | }, |
| | | { |
| | | name: "流转卡", |
| | |
| | | clickFun: row => { |
| | | showReportDialog(row); |
| | | }, |
| | | disabled: row => |
| | | Number(row?.planQuantity) <= Number(row?.completeQuantity) || |
| | | row.planQuantity <= 0 || |
| | | !canOperateByReportWorker.value(row), |
| | | }, |
| | | // { |
| | | // name:"审核", |
| | |
| | | userId: "", |
| | | productMainId: null, |
| | | teamList: [], |
| | | machineId: null, |
| | | deviceId: null, |
| | | }); |
| | | |
| | | // 本次生产数量验证规则 |
| | |
| | | endTime: [{required: true, message: "请选择结束时间", trigger: "change"}], |
| | | auditUserId: [{required: true, message: "请选择审核人", trigger: "change"}], |
| | | teamList: [{required: true, message: "请选择班组", trigger: "change"}], |
| | | machineId: [{required: true, message: "请选择设备", trigger: "change"}], |
| | | deviceId: [{required: true, message: "请选择设备", trigger: "change"}], |
| | | }; |
| | | |
| | | // 处理本次生产数量输入,限制必须大于等于1 |
| | |
| | | }; |
| | | |
| | | const handleEdit = row => { |
| | | if (!isCurrentUserReportWorker(row)) { |
| | | ElMessage.warning("当前用户不是该工单的报工人,无法编辑"); |
| | | return; |
| | | } |
| | | // if (!isCurrentUserReportWorker(row)) { |
| | | // ElMessage.warning("当前用户不是该工单的报工人,无法编辑"); |
| | | // return; |
| | | // } |
| | | editrow.value = JSON.parse(JSON.stringify(row)); |
| | | editDialogVisible.value = true; |
| | | }; |
| | |
| | | }; |
| | | |
| | | const showReportDialog = row => { |
| | | if (!isCurrentUserReportWorker(row)) { |
| | | ElMessage.warning("当前用户不是该工单的报工人,无法报工"); |
| | | return; |
| | | } |
| | | // if (!isCurrentUserReportWorker(row)) { |
| | | // ElMessage.warning("当前用户不是该工单的报工人,无法报工"); |
| | | // return; |
| | | // } |
| | | currentReportRowData.value = row; |
| | | reportForm.planQuantity = row.planQuantity - row.completeQuantity; |
| | | reportForm.quantity = |