gaoluyang
2026-09-10 80ef3a1fb42f37cde2e9753317e118c50379b095
src/views/productionManagement/workOrderManagement/index.vue
@@ -168,6 +168,18 @@
                       :value="user.userId" />
          </el-select>
        </el-form-item>
        <el-form-item label="使用设备">
          <el-select v-model="reportForm.deviceId"
                     style="width: 300px"
                     placeholder="请选择使用设备"
                     clearable
                     filterable>
            <el-option v-for="item in deviceOptions"
                       :key="item.id"
                       :label="item.deviceName"
                       :value="item.id" />
          </el-select>
        </el-form-item>
        <!-- 工时 -->
        <el-form-item label="工时"
                      v-if="currentReportRowData?.type == 0"
@@ -280,6 +292,7 @@
  import { listMaterialPickingDetail } from "@/api/productionManagement/productionOrder.js";
  import { findProcessParamListOrder } from "@/api/productionManagement/productProcessRoute.js";
  import { getUserProfile, userListNoPageByTenantId } from "@/api/system/user.js";
  import { getDeviceLedger } from "@/api/equipmentManagement/ledger.js";
  import { getDicts } from "@/api/system/dict/data";
  import QRCode from "qrcode";
  import { getCurrentInstance, reactive, toRefs } from "vue";
@@ -426,6 +439,7 @@
  const currentWorkOrderId = ref(null);
  const reportFormRef = ref(null);
  const userOptions = ref([]);
  const deviceOptions = ref([]);
  const reportForm = reactive({
    planQuantity: 0,
    quantity: null,
@@ -435,6 +449,7 @@
    reportWork: "",
    productProcessRouteItemId: "",
    userId: "",
    deviceId: "",
    productMainId: null,
    productionOrderRoutingOperationId: "",
    productionOrderId: "",
@@ -694,6 +709,7 @@
      toQuantity(planQuantity - completeQuantity)
    );
    reportForm.planQuantity = remainingQuantity;
    reportForm.deviceId = "";
    reportForm.quantity = remainingQuantity;
    reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
    reportForm.workOrderId = row.id;
@@ -801,6 +817,7 @@
        scrapQty: isNaN(scrapQty) ? 0 : scrapQty,
        userId: reportForm.userId,
        userName: reportForm.userName,
        deviceId: reportForm.deviceId || undefined,
        productionOperationTaskId: reportForm.workOrderId,
        productProcessRouteItemId: reportForm.productProcessRouteItemId,
        reportWork: reportForm.reportWork,
@@ -958,6 +975,15 @@
        userOptions.value = res.data;
      }
    });
    // 获取设备列表
    getDeviceLedger()
      .then(res => {
        deviceOptions.value = res.data || [];
      })
      .catch(err => {
        console.error("获取设备列表失败", err);
        deviceOptions.value = [];
      });
  });
</script>