a8809c3d35b66f4becc87ac8ac67503aa83c7359..3b55fed0ba65d887969acbe118c1a868bc3b3ad0
2026-01-07 zhangwencui
生产报工加删除按钮
3b55fe 对比 | 目录
2026-01-07 zhangwencui
报工接口调整
b52d22 对比 | 目录
已修改3个文件
83 ■■■■■ 文件已修改
src/api/productionManagement/productionReporting.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/productionManagement/productionReporting.js
@@ -32,4 +32,12 @@
    method: "post",
    data: query,
  });
}
}
// 生产报工-删除
export function productionReportDelete(query) {
  return request({
    url: "/productionProductMain/delete",
    method: "delete",
    data: query,
  });
}
src/views/productionManagement/productionReporting/index.vue
@@ -152,6 +152,7 @@
  import {
    productionReportUpdate,
    workListPageById,
    productionReportDelete,
  } from "@/api/productionManagement/productionReporting.js";
  import { productionProductMainListPage } from "@/api/productionManagement/productionProductMain.js";
  import { userListNoPageByTenantId } from "@/api/system/user.js";
@@ -262,6 +263,13 @@
            showOutput(row);
          },
        },
        {
          name: "删除",
          type: "danger",
          clickFun: row => {
            deleteReport(row);
          },
        },
      ],
    },
  ]);
@@ -293,6 +301,24 @@
    }
    handleQuery();
  };
  const deleteReport = row => {
    ElMessageBox.confirm("确定删除该报工吗?", "提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    }).then(() => {
      productionReportDelete({ id: row.id }).then(res => {
        if (res.code === 200) {
          proxy.$modal.msgSuccess("删除成功");
          getList();
        } else {
          ElMessageBox.alert(res.msg || "删除失败", "提示", {
            confirmButtonText: "确定",
          });
        }
      });
    });
  };
  const pagination = obj => {
    page.current = obj.page;
    page.size = obj.limit;
src/views/productionManagement/workOrder/index.vue
@@ -25,19 +25,6 @@
                :tableLoading="tableLoading"
                @pagination="pagination"></PIMTable>
    </div>
    <el-dialog v-model="qrDialogVisible"
               title="二维码"
               width="300px">
      <div style="text-align:center;">
        <img :src="qrCodeUrl"
             alt="二维码"
             style="width:200px;height:200px;" />
        <div style="margin:10px 0;">
          <el-button type="primary"
                     @click="downloadQRCode">下载二维码图片</el-button>
        </div>
      </div>
    </el-dialog>
    <el-dialog v-model="editDialogVisible"
               title="编辑时间"
               width="500px">
@@ -262,6 +249,7 @@
      width: "200",
      align: "center",
      dataType: "action",
      fixed: "right",
      operation: [
        {
          name: "编辑",
@@ -286,7 +274,6 @@
  ]);
  const tableData = ref([]);
  const tableLoading = ref(false);
  const qrDialogVisible = ref(false);
  const qrCodeUrl = ref("");
  const qrRowData = ref(null);
  const editDialogVisible = ref(false);
@@ -299,6 +286,11 @@
    remainingQuantity: 0,
    quantity: 0,
    userName: "",
    workOrderId: "",
    reportWork: "",
    productProcessRouteItemId: "",
    userId: "",
    productMainId: null,
  });
  const currentReportRowData = ref(null);
  const page = reactive({
@@ -340,25 +332,12 @@
      });
  };
  const showQRCode = async row => {
    // 直接使用URL,不要用JSON.stringify包装
    const qrContent = proxy.javaApi + "/device-info?deviceId=" + row.id;
    qrCodeUrl.value = await QRCode.toDataURL(qrContent);
    qrRowData.value = row;
    qrDialogVisible.value = true;
  };
  const downloadQRCode = () => {
    const link = document.createElement("a");
    link.href = qrCodeUrl.value;
    link.download = `二维码_${qrRowData.value.id}.png`;
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
  };
  const showTransferCard = async row => {
    transferCardRowData.value = row;
    const qrContent = proxy.javaApi + "/work-order?orderId=" + row.id;
    const qrContent =
      proxy.javaApi + "/work-order?orderRow=" + JSON.stringify(row);
    console.log(qrContent, "qrContent");
    transferCardQrUrl.value = await QRCode.toDataURL(qrContent);
    transferCardVisible.value = true;
  };
@@ -389,8 +368,11 @@
  const showReportDialog = row => {
    currentReportRowData.value = row;
    reportForm.remainingQuantity = 1;
    reportForm.quantity = 0;
    reportForm.quantity = row.quantity;
    reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
    reportForm.workOrderId = row.id;
    reportForm.reportWork = row.reportWork;
    reportForm.productMainId = row.productMainId;
    // 获取当前登录用户信息
    reportDialogVisible.value = true;
@@ -409,6 +391,7 @@
      });
      return;
    }
    // console.log(reportForm);
    addProductMain(reportForm).then(res => {
      if (res.code === 200) {
        proxy.$modal.msgSuccess("报工成功");