| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {onMounted, ref} from "vue"; |
| | | import {onMounted, ref, reactive, toRefs, getCurrentInstance, nextTick} from "vue"; |
| | | import FormDia from "@/views/productionManagement/productionReporting/components/formDia.vue"; |
| | | import {staffJoinDel, staffJoinListPage} from "@/api/personnelManagement/onboarding.js"; |
| | | import {ElMessageBox} from "element-plus"; |
| | |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = (type, row) => { |
| | | if (selectedRows.value.length !== 1) { |
| | | proxy.$message.error("请选择一条数据"); |
| | | if (selectedRows.value.length === 0) { |
| | | proxy.$message.error("请至少选择一条数据"); |
| | | return; |
| | | } |
| | | if (selectedRows.value[0].pendingFinishNum == 0) { |
| | | proxy.$message.warning("无需再报工"); |
| | | // 过滤掉待报工数量为0的数据 |
| | | const validRows = selectedRows.value.filter(item => item.pendingFinishNum > 0); |
| | | if (validRows.length === 0) { |
| | | proxy.$message.warning("所选数据均无需再报工"); |
| | | return; |
| | | } |
| | | if (validRows.length < selectedRows.value.length) { |
| | | proxy.$message.warning(`已过滤 ${selectedRows.value.length - validRows.length} 条无需报工的数据`); |
| | | } |
| | | nextTick(() => { |
| | | const rowInfo = type === 'add' ? selectedRows.value[0] : row |
| | | const rowInfo = type === 'add' ? validRows : (row ? [row] : []) |
| | | formDia.value?.openDialog(type, rowInfo) |
| | | }) |
| | | }; |