leiqunqing
2026-03-05 891207469b41c23d22805876a4e179d75832572f
´úÂë¹ÜÀí/WIDESEAWCS_Client/src/views/basicinfo/processInfoDetail.vue
@@ -19,7 +19,14 @@
export default defineComponent({
  setup() {
    // è¡¨æ ¼åŸºç¡€é…ç½® - æ–°å¢žé»˜è®¤å€’序、统一规范
    // å·¥å…·å‡½æ•°ï¼šæ ¼å¼åŒ–数字为两位小数
    const formatTwoDecimal = (value) => {
      if (value === "" || value === null || value === undefined) return "";
      const num = parseFloat(value);
      return isNaN(num) ? "" : num.toFixed(2);
    };
    // è¡¨æ ¼åŸºç¡€é…ç½®
    const table = ref({
      key: "id",
      footer: "Foots",
@@ -27,38 +34,51 @@
      name: "processInfoDetail",
      url: "/processInfoDetail/",
      sortName: "createDate",
      sortOrder: "desc", // æ–°å¢žï¼šåˆ›å»ºæ—¶é—´é»˜è®¤å€’序,和主页面保持一致
      sortOrder: "desc", // åˆ›å»ºæ—¶é—´é»˜è®¤å€’序
    });
    // ç¼–辑表单字段 - åŒæ­¥ä¸»é¡µé¢ï¼Œæ–°å¢žpressPressure(压装压力),匹配后端实体
    // ç¼–辑表单字段 - ä¸¥æ ¼åŒ¹é…åŽç«¯Dt_ProcessInfo实体
    const editFormFields = ref({
      id: "",
      id: 0, // ä¸»é”®é»˜è®¤å€¼æ”¹ä¸ºæ•°å­—0
      palletCode: "",
      productCode: "",
      productName: "",
      productSn: "", // æµæ°´å·
      pressTightenNg: "", // åŽ‹è£…æ‹§ç´§_拧紧NG
      pressTightenOk: "", // åŽ‹è£…æ‹§ç´§_拧紧OK
      pressTightenUnfinished: "", // åŽ‹è£…æ‹§ç´§_本次加工未完成
      checkUnfinished: "", // æ£€æµ‹_本次检测未完成
      pressHeight: "", // åŽ‹è£…ä½ä¸‹åŽ‹é«˜åº¦
      screwTorque: "", // åŽ‹è£…ä½æ‹§ç´§æ‰­åŠ›
      screwAngle: "", // åŽ‹è£…ä½æ‹§ç´§è§’åº¦
      pressPressure: "", // ã€æ–°å¢žã€‘压装位下压压力(匹配后端实体)
      height1: "", // æ‹§ç´§ä½æ£€æµ‹é«˜åº¦1
      height2: "", // æ‹§ç´§ä½æ£€æµ‹é«˜åº¦2
      height3: "", // æ‹§ç´§ä½æ£€æµ‹é«˜åº¦3
      productSn: "",
      pressTightenOk: 0, // æ”¹ä¸ºæ•°å­—默认值
      pressTightenUnfinished: 0, // æ”¹ä¸ºæ•°å­—默认值
      productStatus: 0, // æ–°å¢žï¼šäº§å“çŠ¶æ€å­—æ®µ
      screwTorque: "",
      screwAngle: "",
      pressPressure: "",
      productCheckHeight: "",
      threadPositionHeight: "",
      height1: "",
      height2: "",
      height3: "",
    });
    // ç¼–辑表单配置 - å–消冗余分类、均匀排布,新增压装压力项,补全默认值/校验,统一宽度
    // äº§å“çŠ¶æ€ä¸‹æ‹‰é€‰é¡¹ï¼ˆåŒ¹é…åŽç«¯æ³¨é‡Šï¼‰
    const productStatusOptions = [
      { key: "0", value: "不合格" },
      { key: "1", value: "合格" },
      { key: "2", value: "人工确认合格" },
    ];
    // å¸ƒå°”型下拉选项(通用)
    const booleanOptions = [
      { key: "0", value: "否" },
      { key: "1", value: "是" },
    ];
    // ç¼–辑表单配置 - ä¿®æ­£å­—段匹配,优化布局和命名
    const editFormOptions = ref([
      // ç¬¬ä¸€è¡Œï¼šåŸºç¡€æ ‡è¯†ï¼Œå®½åº¦åè°ƒï¼Œå’Œä¸»é¡µé¢å¸ƒå±€ä¸€è‡´
      // åŸºç¡€ä¿¡æ¯è¡Œ
      [
        {
          title: "工装板编号",
          field: "palletCode",
          type: "input",
          width: 160,
          width: 180,
          require: true,
          placeholder: "请输入工装板编号",
        },
@@ -66,7 +86,7 @@
          title: "成品编号",
          field: "productCode",
          type: "input",
          width: 160,
          width: 180,
          require: true,
          placeholder: "请输入成品编号",
        },
@@ -74,7 +94,7 @@
          title: "成品名称",
          field: "productName",
          type: "input",
          width: 160,
          width: 180,
          require: true,
          placeholder: "请输入成品名称",
        },
@@ -82,158 +102,172 @@
          title: "流水号",
          field: "productSn",
          type: "input",
          width: 180,
          width: 200,
          require: false,
          placeholder: "请输入产品流水号",
        },
      ],
      // ç¬¬äºŒè¡Œï¼š4个状态列+主键,补全默认值0(否),统一宽度/对齐,隐藏主键
      // åŠ å·¥çŠ¶æ€è¡Œ - ç§»é™¤ä¸å­˜åœ¨çš„checkUnfinished,新增产品状态
      [
        {
          title: "拧紧NG",
          field: "pressTightenNg",
          type: "select",
          width: 150,
          align: "center",
          defaultValue: "0", // æ–°å¢žé»˜è®¤å€¼ï¼Œå’Œä¸»é¡µé¢ä¸€è‡´
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
        },
        {
          title: "拧紧OK",
          title: "压装拧紧_拧紧OK",
          field: "pressTightenOk",
          type: "select",
          width: 150,
          width: 160,
          align: "center",
          defaultValue: "0", // æ–°å¢žé»˜è®¤å€¼
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
          defaultValue: 0,
          data: booleanOptions,
        },
        {
          title: "拧紧未完成",
          title: "压装拧紧_本次加工未完成",
          field: "pressTightenUnfinished",
          type: "select",
          width: 170,
          width: 180,
          align: "center",
          defaultValue: "0",
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
          defaultValue: 0,
          data: booleanOptions,
        },
        {
          title: "检测未完成",
          field: "checkUnfinished",
          title: "产品状态",
          field: "productStatus",
          type: "select",
          width: 150,
          width: 160,
          align: "center",
          defaultValue: "0", // æ–°å¢žé»˜è®¤å€¼ï¼Œç»Ÿä¸€è§„范
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
          defaultValue: 0,
          data: productStatusOptions,
        },
        {
          title: "主键ID",
          field: "id",
          title: "压装位下压压力",
          field: "pressPressure",
          type: "input",
          width: 100,
          hidden: true,
          readonly: true,
          inputType: "number",
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
      ],
      // åŽ‹è£…æ£€æµ‹å‚æ•°è¡Œ - ä¼˜åŒ–标题,匹配后端注释
      [
        {
          title: "压装高度",
          field: "pressHeight",
          type: "input",
          inputType: "number",
          width: 160,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
        },
        {
          title: "压装压力",
          field: "pressPressure", // æ–°å¢žåŽ‹è£…åŽ‹åŠ›é¡¹
          type: "input",
          inputType: "number",
          width: 160,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
        },
        {
          title: "压装扭力",
          title: "压装位拧紧检测扭力",
          field: "screwTorque",
          type: "input",
          inputType: "number",
          width: 160,
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
        {
          title: "拧紧角度",
          title: "压装位拧紧检测角度",
          field: "screwAngle",
          type: "input",
          inputType: "number",
          width: 160,
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
        {
          title: "产品检测高度",
          field: "productCheckHeight",
          type: "input",
          inputType: "number",
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
        {
          title: "螺纹位置高度",
          field: "threadPositionHeight",
          type: "input",
          inputType: "number",
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
      ],
      // ç¬¬äº”行:拧紧位检测高度,小数校验,居中排布,统一宽度
      // æ‹§ç´§ä½æ£€æµ‹é«˜åº¦è¡Œ
      [
        {
          title: "检测高度1",
          title: "拧紧位检测高度1",
          field: "height1",
          type: "input",
          inputType: "number",
          width: 200,
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
        {
          title: "检测高度2",
          title: "拧紧位检测高度2",
          field: "height2",
          type: "input",
          inputType: "number",
          width: 200,
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
        {
          title: "检测高度3",
          title: "拧紧位检测高度3",
          field: "height3",
          type: "input",
          inputType: "number",
          width: 200,
          width: 180,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          formatter: formatTwoDecimal,
          onBlur: (e) => {
            e.target.value = formatTwoDecimal(e.target.value);
          },
        },
      ],
    ]);
    // æœç´¢è¡¨å•字段 - ä¿æŒå’Œä¸»é¡µé¢ã€åŽŸæœ‰ä»£ç ä¸€è‡´ï¼Œæ ¸å¿ƒæœç´¢é¡¹æ— è°ƒæ•´
    // æœç´¢è¡¨å•字段 - åŒ¹é…åŽç«¯å®žä½“,移除无关字段
    const searchFormFields = ref({
      palletCode: "",
      productCode: "",
      productName: "",
      productSn: "", // æµæ°´å·æœç´¢
      creater: "",
      productSn: "",
      productStatus: "", // æ–°å¢žï¼šäº§å“çŠ¶æ€æœç´¢
      createDate: "",
    });
    // æœç´¢è¡¨å•配置 - ä¼˜åŒ–宽度匹配布局,和主页面完全一致
    // æœç´¢è¡¨å•配置 - ä¼˜åŒ–布局,新增产品状态搜索
    const searchFormOptions = ref([
      [
        { title: "工装板编号", field: "palletCode", type: "like", width: 180 },
@@ -242,12 +276,18 @@
        { title: "流水号", field: "productSn", type: "like", width: 200 },
      ],
      [
        { title: "创建人", field: "creater", type: "like", width: 200 },
        {
          title: "产品状态",
          field: "productStatus",
          type: "select",
          width: 180,
          data: productStatusOptions,
        },
        { title: "创建时间", field: "createDate", type: "datetime", width: 380 },
      ],
    ]);
    // è¡¨æ ¼åˆ—配置 - ã€æ–°å¢žpressPressure列】,统一列名/宽度/类型,修复首字母大写问题,优化对齐
    // è¡¨æ ¼åˆ—配置 - ä¿®æ­£å­—段匹配,新增产品状态列,优化标题
    const columns = ref([
      {
        field: "id",
@@ -286,115 +326,107 @@
        align: "left",
        overflow: "ellipsis",
      },
      // 4个状态列 - ä¿®å¤åŽŸæœ‰PressTightenNg首字母大写问题,统一规范
      {
        field: "pressTightenNg",
        title: "拧紧NG",
        type: "select",
        width: 120,
        align: "center",
        bind: {
          key: "value",
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
        },
      },
      // çŠ¶æ€åˆ— - ç§»é™¤checkUnfinished,新增产品状态
      {
        field: "pressTightenOk",
        title: "拧紧OK",
        type: "select",
        width: 120,
        width: 100,
        align: "center",
        bind: {
          key: "value",
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
          data: booleanOptions,
        },
      },
      {
        field: "pressTightenUnfinished",
        title: "拧紧未完成",
        type: "select",
        width: 140,
        width: 120,
        align: "center",
        bind: {
          key: "value",
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
          data: booleanOptions,
        },
      },
      {
        field: "checkUnfinished",
        title: "检测未完成",
        field: "productStatus",
        title: "产品状态",
        type: "select",
        width: 120,
        align: "center",
        bind: {
          key: "value",
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
          data: productStatusOptions,
        },
      },
      // åŽ‹è£…æ£€æµ‹å‚æ•°åˆ— - ä¼˜åŒ–标题,统一格式化
      {
        field: "pressHeight",
        title: "压装高度",
        field: "pressPressure",
        title: "压装位下压压力",
        type: "decimal",
        width: 100,
        width: 120,
        align: "center",
      },
      {
        field: "pressPressure", // æ–°å¢žåŽ‹è£…åŽ‹åŠ›åˆ—
        title: "压装压力",
        type: "decimal",
        width: 100,
        align: "center",
        columnDescription: "压装位下压压力",
        formatter: (row) => formatTwoDecimal(row.pressPressure),
      },
      {
        field: "screwTorque",
        title: "压装扭力",
        title: "拧紧检测扭力",
        type: "decimal",
        width: 100,
        width: 120,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.screwTorque),
      },
      {
        field: "screwAngle",
        title: "拧紧角度",
        title: "拧紧检测角度",
        type: "decimal",
        width: 100,
        width: 120,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.screwAngle),
      },
      // æ‹§ç´§ä½æ£€æµ‹é«˜åº¦
      // äº§å“æ£€æµ‹é«˜åº¦åˆ—
      {
        field: "productCheckHeight",
        title: "产品检测高度",
        type: "decimal",
        width: 120,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.productCheckHeight),
      },
      {
        field: "threadPositionHeight",
        title: "螺纹位置高度",
        type: "decimal",
        width: 120,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.threadPositionHeight),
      },
      {
        field: "height1",
        title: "检测高度1",
        title: "高度1",
        type: "decimal",
        width: 100,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.height1),
      },
      {
        field: "height2",
        title: "检测高度2",
        title: "高度2",
        type: "decimal",
        width: 100,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.height2),
      },
      {
        field: "height3",
        title: "检测高度3",
        title: "高度3",
        type: "decimal",
        width: 100,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.height3),
      },
      // å…¬å…±å­—段 - åˆ›å»º/修改信息,和主页面一致
      // å…¬å…±å­—段
      {
        field: "creater",
        title: "创建人",
@@ -425,7 +457,7 @@
      },
    ]);
    // æ— äºŒçº§æ˜Žç»†ï¼Œä¿æŒç©ºé…ç½®ä¸å˜
    // åŠ å·¥ä¿¡æ¯æ— æ˜Žç»†
    const detail = ref({
      cnName: "",
      table: "",