gaoluyang
2026-09-10 80ef3a1fb42f37cde2e9753317e118c50379b095
src/views/productionManagement/workOrder/index.vue
@@ -209,6 +209,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>
      <template #footer>
        <span class="dialog-footer">
@@ -233,6 +245,7 @@
    downProductWorkOrder,
  } from "@/api/productionManagement/workOrder.js";
  import { getUserProfile, userListNoPageByTenantId } from "@/api/system/user.js";
  import { getDeviceLedger } from "@/api/equipmentManagement/ledger.js";
  import QRCode from "qrcode";
  import { getCurrentInstance, reactive, toRefs } from "vue";
  import FilesDia from "./components/filesDia.vue";
@@ -356,6 +369,7 @@
  const workOrderFilesRef = ref(null);
  const reportFormRef = ref(null);
  const userOptions = ref([]);
  const deviceOptions = ref([]);
  const reportForm = reactive({
    planQuantity: 0,
    quantity: null,
@@ -365,6 +379,7 @@
    reportWork: "",
    productProcessRouteItemId: "",
    userId: "",
    deviceId: "",
    productMainId: null,
  });
@@ -596,6 +611,7 @@
  const showReportDialog = row => {
    currentReportRowData.value = row;
    reportForm.deviceId = "";
    reportForm.planQuantity = row.planQuantity - row.completeQuantity;
    reportForm.quantity =
      row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
@@ -729,9 +745,22 @@
    }
  };
  // 获取设备下拉
  const getDeviceOptions = () => {
    getDeviceLedger()
      .then(res => {
        deviceOptions.value = res.data || [];
      })
      .catch(err => {
        console.error("获取设备列表失败", err);
        deviceOptions.value = [];
      });
  };
  onMounted(() => {
    getList();
    getUserList();
    getDeviceOptions();
  });
</script>