leiqunqing
2026-03-05 891207469b41c23d22805876a4e179d75832572f
´úÂë¹ÜÀí/WIDESEAWCS_Client/src/views/basicinfo/processInfo.vue
@@ -19,6 +19,13 @@
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",
@@ -27,45 +34,51 @@
      name: "processInfo",
      url: "/processInfo/",
      sortName: "createDate",
      sortOrder: "desc", // æ–°å¢žï¼šåˆ›å»ºæ—¶é—´é»˜è®¤å€’序,符合常规使用
      sortOrder: "desc", // åˆ›å»ºæ—¶é—´é»˜è®¤å€’序
    });
    // ç¼–辑表单字段 - å®Œå…¨åŒ¹é…åŽç«¯Dt_ProcessInfo实体
    // æ–°å¢žï¼špressPressure(压装位下压压力),补全所有后端字段
    // ç¼–辑表单字段 - ä¸¥æ ¼åŒ¹é…åŽç«¯Dt_ProcessInfo实体
    const editFormFields = ref({
      id: "",
      id: 0, // ä¸»é”®é»˜è®¤å€¼æ”¹ä¸ºæ•°å­—0
      palletCode: "",
      productCode: "",
      productName: "",
      productSn: "", // æµæ°´å·
      pressTightenNg: "", // åŽ‹è£…æ‹§ç´§_拧紧NG
      pressTightenOk: "", // åŽ‹è£…æ‹§ç´§_拧紧OK
      pressTightenUnfinished: "", // åŽ‹è£…æ‹§ç´§_本次加工未完成
      checkUnfinished: "", // æ£€æµ‹_本次检测未完成
      //componentQty: "", // é›¶ä»¶æ•°é‡
      // torsioValue: "", // æ‰­åЛ值
      // torsioValueStandard: "", // æ‰­åŠ›å€¼æ ‡å‡†
      // stiffnessValue: "", // åˆšåº¦å€¼
      // stiffnessValueStandard: "", // åˆšåº¦å€¼æ ‡å‡†
      // testResult: "", // æµ‹è¯•结果
      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([
      // ç¬¬ä¸€è¡Œï¼š5个字段(基础标识+1个状态),宽度协调
      // åŸºç¡€ä¿¡æ¯è¡Œ
      [
        {
          title: "工装板编号",
          field: "palletCode",
          type: "input",
          width: 160,
          width: 180,
          require: true,
          placeholder: "请输入工装板编号",
        },
@@ -73,7 +86,7 @@
          title: "成品编号",
          field: "productCode",
          type: "input",
          width: 160,
          width: 180,
          require: true,
          placeholder: "请输入成品编号",
        },
@@ -81,7 +94,7 @@
          title: "成品名称",
          field: "productName",
          type: "input",
          width: 160,
          width: 180,
          require: true,
          placeholder: "请输入成品名称",
        },
@@ -89,220 +102,172 @@
          title: "流水号",
          field: "productSn",
          type: "input",
          width: 180,
          width: 200,
          require: false,
          placeholder: "请输入产品流水号",
        },
      ],
      // åŠ å·¥çŠ¶æ€è¡Œ - ç§»é™¤ä¸å­˜åœ¨çš„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,
          align: "center",
          defaultValue: "0",
          data: [
            { key: "0", value: "否" },
            { key: "1", value: "是" },
          ],
        },
        // {
        //   title: "零件数量",
        //   field: "componentQty",
        //   type: "input",
        //   inputType: "number",
        //   width: 140,
        //   require: false,
        //   attrs: { min: 0, step: 1 },
        //   placeholder: "请输入正整数",
        // },
        {
          title: "主键ID",
          field: "id",
          type: "input",
          width: 100,
          hidden: true,
          readonly: true,
        },
      ],
      // // ç¬¬ä¸‰è¡Œï¼š5个字段(扭力/刚度相关+测试结果),小数校验
      // [
      //   {
      //     title: "扭力值",
      //     field: "torsioValue",
      //     type: "input",
      //     inputType: "number",
      //     width: 140,
      //     require: false,
      //     attrs: { step: 0.01, min: 0 },
      //     placeholder: "保留2位小数",
      //   },
      //   {
      //     title: "扭力值标准",
      //     field: "torsioValueStandard",
      //     type: "input",
      //     inputType: "number",
      //     width: 160,
      //     require: false,
      //     attrs: { step: 0.01, min: 0 },
      //     placeholder: "保留2位小数",
      //   },
      //   {
      //     title: "刚度值",
      //     field: "stiffnessValue",
      //     type: "input",
      //     inputType: "number",
      //     width: 140,
      //     require: false,
      //     attrs: { step: 0.01, min: 0 },
      //     placeholder: "保留2位小数",
      //   },
      //   {
      //     title: "刚度值标准",
      //     field: "stiffnessValueStandard",
      //     type: "input",
      //     inputType: "number",
      //     width: 160,
      //     require: false,
      //     attrs: { step: 0.01, min: 0 },
      //     placeholder: "保留2位小数",
      //   },
      //   {
      //     title: "测试结果",
      //     field: "testResult",
      //     type: "input",
      //     inputType: "number",
      //     width: 140,
      //     require: false,
      //     placeholder: "请输入数字结果",
      //   },
      // ],
      // ç¬¬å››è¡Œï¼š4个字段(压装位全参数),小数校验,新增压装压力
      [
        {
          title: "压装高度",
          field: "pressHeight",
          type: "input",
          inputType: "number",
          width: 160,
          require: false,
          attrs: { step: 0.01, min: 0 },
          placeholder: "保留2位小数",
          align: "center",
          defaultValue: 0,
          data: productStatusOptions,
        },
        {
          title: "压装压力",
          title: "压装位下压压力",
          field: "pressPressure",
          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: "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);
          },
        },
      ],
      // ç¬¬äº”行:3个字段(拧紧位检测高度),小数校验,居中排布
      // æ‹§ç´§ä½æ£€æµ‹é«˜åº¦è¡Œ
      [
        {
          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 },
@@ -311,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",
@@ -355,159 +326,107 @@
        align: "left",
        overflow: "ellipsis",
      },
      // 4个状态列 - æ˜¯å¦æ ¼å¼åŒ–显示
      {
        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: "componentQty",
      //   title: "零件数量",
      //   type: "int",
      //   width: 90,
      //   align: "center",
      // },
      // // æ‰­åŠ›/刚度相关 - decimal类型(保留2位小数)
      // {
      //   field: "torsioValue",
      //   title: "扭力值",
      //   type: "decimal",
      //   width: 90,
      //   align: "center",
      // },
      // {
      //   field: "torsioValueStandard",
      //   title: "扭力标准",
      //   type: "decimal",
      //   width: 100,
      //   align: "center",
      // },
      // {
      //   field: "stiffnessValue",
      //   title: "刚度值",
      //   type: "decimal",
      //   width: 90,
      //   align: "center",
      // },
      // {
      //   field: "stiffnessValueStandard",
      //   title: "刚度标准",
      //   type: "decimal",
      //   width: 100,
      //   align: "center",
      // },
      // {
      //   field: "testResult",
      //   title: "测试结果",
      //   type: "int",
      //   width: 90,
      //   align: "center",
      // },
      // åŽ‹è£…ä½æ£€æµ‹å‚æ•° - ã€æ–°å¢žpressPressure列】decimal类型
      // åŽ‹è£…æ£€æµ‹å‚æ•°åˆ— - ä¼˜åŒ–标题,统一格式化
      {
        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: "创建人",
@@ -538,7 +457,7 @@
      },
    ]);
    // åŠ å·¥ä¿¡æ¯æ— æ˜Žç»†ï¼Œä¿æŒç©ºé…ç½®
    // åŠ å·¥ä¿¡æ¯æ— æ˜Žç»†
    const detail = ref({
      cnName: "",
      table: "",