src/views/productionManagement/productionReporting/index.vue
@@ -23,9 +23,9 @@
            </el-form-item>
            <el-form-item label="状态:">
               <el-select v-model="searchForm.status" placeholder="请选择状态" style="width: 140px" clearable>
                  <el-option label="待生产" :value="1"></el-option>
                  <el-option label="待报工" :value="1"></el-option>
                  <el-option label="已报工" :value="3"></el-option>
                  <el-option label="生产中" :value="2"></el-option>
                  <!-- <el-option label="生产中" :value="2"></el-option> -->
               </el-select>
            </el-form-item>
            <el-form-item>
@@ -139,7 +139,7 @@
</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";
@@ -180,7 +180,7 @@
         if (params == 3) {
            return "已报工";
         } else if (params == 1) {
            return "待生产";
            return "待报工";
         } else {
            return '生产中';
         }
@@ -272,7 +272,7 @@
      width: 100,
   },
   {
      label: "待生产数量",
      label: "待报工数量",
      prop: "pendingFinishNum",
      width: 100,
   },
@@ -400,16 +400,21 @@
};
// 打开弹框
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)
   })
};