没有人员信息,点击 报工是增加 没有人员信息不可报工的提示
| | |
| | | // 报工 |
| | | const showReportModal = ref(false) |
| | | function openReportModal() { |
| | | showReportModal.value = true |
| | | // 有人员才可以报工 |
| | | if (workers.value[0].workerId) { |
| | | showReportModal.value = true |
| | | } else { |
| | | ElMessage({ |
| | | message: '没有人员信息不允许手动报工!', |
| | | type: 'error', |
| | | duration: 3000 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if (!task?.value) { |
| | | return |
| | | } |
| | | apiReportWork({ |
| | | procedureId: task.value?.Procedure.ID, |
| | | reportAmount: amount, |
| | | workerID: workers.value[0].workerId |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | ElMessage({ |
| | | message: '报工成功', |
| | | type: 'success', |
| | | duration: 2000 |
| | | }) |
| | | showReportModal.value = false |
| | | } else { |
| | | ElMessage({ |
| | | message: '报工失败', |
| | | type: 'error', |
| | | duration: 3000 |
| | | }) |
| | | } |
| | | // 有人员才可以报工 |
| | | if (workers.value[0].workerId) { |
| | | apiReportWork({ |
| | | procedureId: task.value?.Procedure.ID, |
| | | reportAmount: amount, |
| | | workerID: workers.value[0].workerId |
| | | }) |
| | | .catch((err) => { |
| | | console.error(err) |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | ElMessage({ |
| | | message: '报工成功', |
| | | type: 'success', |
| | | duration: 2000 |
| | | }) |
| | | showReportModal.value = false |
| | | } else { |
| | | ElMessage({ |
| | | message: '报工失败', |
| | | type: 'error', |
| | | duration: 3000 |
| | | }) |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | console.error(err) |
| | | }) |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |