liulijun
2026-03-20 1c631b345aae30bb6aa7e9dc8d856a0f40d5f1e3
ÏîÄ¿´úÂë/WMS/WMSClient/src/views/outbound/outSGOrder.vue
@@ -93,9 +93,16 @@
      },
      {
        field: "orderId",
        title: "上游生产单号",
        title: "排程号",
        type: "string",
        width: 160,
        align: "left",
      },
      {
        field: "number",
        title: "用纸序号",
        type: "string",
        width: 90,
        align: "left",
      },
      {
@@ -108,10 +115,21 @@
      {
        field: "outSGOrderStatus",
        title: "出库单状态",
        type: "string",
        type: "tag",
        width: 110,
        align: "left",
        bind: { key: "outboundStatusEnum", data: [] },
        getColor: (row) => {
          const status = row.outSGOrderStatus;
          if (status === 3) { // ç¼ºæ–™
            return 'danger'; // çº¢è‰²
          } else if (status === 0) { // æœªå¼€å§‹
            return 'success'; // ç»¿è‰²
          } else if (status === 1) { // å‡ºåº“中
            return 'primary'; // è“è‰²
          }
          return ''; // é»˜è®¤æ— é¢œè‰²
        }
      },
      {
        field: "createDate",
@@ -121,11 +139,83 @@
        align: "left",
      },
      {
        field: "materialNoWidth",
        title: "物料编号(幅宽)",
        field: "materialNos",
        title: "物料编号",
        type: "string",
        width: 160,
        align: "left",
        formatter: (row) => {
          const materialNos = row.materialNos;
          if (!materialNos) return materialNos;
          // å¤„理物料编号,根据每个物料的实际状态显示颜色
          const materialList = materialNos.split('/');
          let formattedMaterials = [];
          // å¦‚果有物料缺料状态字符串,根据每个物料的状态显示颜色
          if (row.materialLackStatus) {
            // è§£æžç‰©æ–™ç¼ºæ–™çŠ¶æ€å­—ç¬¦ä¸²ï¼šç‰©æ–™ç¼–å·:状态,物料编号:状态
            const statusPairs = row.materialLackStatus.split(',');
            // èŽ·å–æ‰€æœ‰ç‰©æ–™çš„ç¼ºæ–™çŠ¶æ€åˆ—è¡¨ï¼Œä¿æŒåŽŸå§‹é¡ºåº
            const lackStatusList = statusPairs.map(pair => {
              const [, isLack] = pair.split(':');
              return isLack.trim() === 'true';
            });
            // ä¸ºæ¯ä¸ªç‰©æ–™ç¼–号设置颜色,保持原始顺序
            formattedMaterials = materialList.map((materialNo, index) => {
              const trimmedMaterialNo = materialNo.trim();
              const isLack = lackStatusList[index] || false;
              if (isLack) {
                return `<span style="color: red;">${trimmedMaterialNo}</span>`;
              }
              return trimmedMaterialNo;
            });
          } else {
            // å¦‚果没有物料缺料状态信息,使用订单级别的缺料状态
            const isLack = Boolean(row.isLackMaterial);
            if (isLack) {
              return `<span style="color: red;">${materialNos}</span>`;
            }
            formattedMaterials = materialList;
          }
          return formattedMaterials.join('/');
        }
      },
      {
        field: "materialWides",
        title: "幅宽",
        type: "string",
        width: 100,
        align: "left",
        formatter: (row) => {
          const value = row.materialWides;
          if (value && typeof value === 'string') {
            return value.replace(/\.\d+$/, '');
          }
          return value;
        }
      },
      {
        field: "boardFluteNos",
        title: "楞别",
        type: "string",
        width: 100,
        align: "left"
      },
      {
        field: "isLackMaterial",
        title: "是否缺料",
        type: "string",
        width: 100,
        align: "center",
        formatter: (row) => {
          const isLack = Boolean(row.isLackMaterial);
          const text = isLack ? "是" : "否";
          const bgColor = isLack ? '#ff4d4f' : '#52c41a';
          return `<div style="background-color: ${bgColor}; color: #ffffff; text-align: center; font-weight: bold; width: 100%; height: 100%; padding: 10px 0; display: flex; justify-content: center; align-items: center;">${text}</div>`;
        }
      },
    ]);
    const detail = ref({
@@ -206,6 +296,7 @@
          align: "left",
          edit: { type: "string" },
          required: true,
        },
        {
          field: "xqLen",
@@ -247,12 +338,23 @@
          align: "left",
        },
        {
          field: "outBSTOrderDetailStatus",
          field: "outSGOrderDetailStatus",
          title: "订单明细状态",
          type: "string",
          type: "tag",
          width: 180,
          align: "left",
          bind: { key: "outboundStatusEnum", data: [] },
          getColor: (row) => {
            const status = row.outSGOrderDetailStatus;
            if (status === 3) { // ç¼ºæ–™
              return 'danger'; // çº¢è‰²
            } else if (status === 0) { // æœªå¼€å§‹
              return 'success'; // ç»¿è‰²
            } else if (status === 1) { // å‡ºåº“中
              return 'primary'; // è“è‰²
            }
            return ''; // é»˜è®¤æ— é¢œè‰²
          }
        },
        {
          field: "createDate",