2026-04-29 f945f2fe9dae35c3b5fd4beea2b182904df0e16e
src/views/productionManagement/workOrderEdit/index.vue
@@ -12,6 +12,15 @@
                    prefix-icon="Search" />
        </div>
        <div class="search-item">
          <span class="search_title">生产订单号:</span>
          <el-input v-model="searchForm.productOrderNpsNo"
                    style="width: 240px"
                    placeholder="请输入"
                    @change="handleQuery"
                    clearable
                    prefix-icon="Search" />
        </div>
        <div class="search-item">
          <el-button type="primary"
                     @click="handleQuery">搜索</el-button>
        </div>
@@ -31,8 +40,6 @@
        </template>
      </PIMTable>
    </div>
    <!-- 编辑时间弹窗 -->
    <el-dialog v-model="editDialogVisible"
               title="编辑计划时间"
               width="500px">
@@ -65,14 +72,13 @@
</template>
<script setup>
  import { onMounted, ref, nextTick } from "vue";
  import { getCurrentInstance, onMounted, reactive, ref, toRefs } from "vue";
  import { ElMessageBox } from "element-plus";
  import dayjs from "dayjs";
  import {
    productWorkOrderPage,
    updateProductWorkOrder,
  } from "@/api/productionManagement/workOrder.js";
  import { getCurrentInstance, reactive, toRefs } from "vue";
  const { proxy } = getCurrentInstance();
  const tableColumn = ref([
@@ -88,7 +94,7 @@
    },
    {
      label: "生产订单号",
      prop: "productOrderNpsNo",
      prop: "npsNo",
      width: "140",
    },
    {
@@ -106,7 +112,8 @@
    },
    {
      label: "工序名称",
      prop: "processName",
      prop: "operationName",
      width: "100",
    },
    {
      label: "需求数量",
@@ -161,11 +168,11 @@
      ],
    },
  ]);
  const tableData = ref([]);
  const tableLoading = ref(false);
  const editDialogVisible = ref(false);
  let editrow = ref(null);
  const editrow = ref(null);
  const page = reactive({
    current: 1,
    size: 100,
@@ -175,9 +182,11 @@
  const data = reactive({
    searchForm: {
      workOrderNo: "",
      productOrderNpsNo: "",
    },
  });
  const { searchForm } = toRefs(data);
  const toProgressPercentage = val => {
    const n = Number(val);
    if (!Number.isFinite(n)) return 0;
@@ -185,6 +194,7 @@
    if (n >= 100) return 100;
    return Math.round(n);
  };
  const progressColor = percentage => {
    const p = toProgressPercentage(percentage);
    if (p < 30) return "#f56c6c";
@@ -193,17 +203,17 @@
    return "#67c23a";
  };
  // 查询列表
  /** 搜索按钮操作 */
  const handleQuery = () => {
    page.current = 1;
    getList();
  };
  const pagination = obj => {
    page.current = obj.page;
    page.size = obj.limit;
    getList();
  };
  const getList = () => {
    tableLoading.value = true;
    const params = { ...searchForm.value, ...page };
@@ -225,7 +235,7 @@
  const handleUpdate = () => {
    updateProductWorkOrder(editrow.value)
      .then(res => {
      .then(() => {
        proxy.$modal.msgSuccess("提交成功");
        editDialogVisible.value = false;
        getList();
@@ -248,13 +258,15 @@
    align-items: center;
    gap: 12px;
  }
  .search-item {
    display: flex;
    align-items: center;
  }
  .search_title {
    margin-right: 8px;
    font-size: 14px;
    color: #606266;
  }
</style>
</style>