dengjunjie
3 天以前 b784d019c3848718eb95eb0d34dde34c6a262b06
´úÂë¹ÜÀí/WIDESEAWCS_Client/src/views/basicinfo/processInfo.vue
@@ -19,328 +19,445 @@
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",
      cnName: "加工信息",
      name: "processInfo",
      url: "/processInfo/",
      sortName: "createDate",
      url: "/processInfo/",
      sortName: "createDate",
      sortOrder: "desc", // åˆ›å»ºæ—¶é—´é»˜è®¤å€’序
    });
    // ç¼–辑表单字段 - ä¸¥æ ¼åŒ¹é…åŽç«¯Dt_ProcessInfo实体
    const editFormFields = ref({
      id: "",
      palletCode: "",
      id: 0, // ä¸»é”®é»˜è®¤å€¼æ”¹ä¸ºæ•°å­—0
      palletCode: "",
      productCode: "",
      productName: "",
      componentQty: "",
      torsioValue: "",
      torsioValueStandard: "",
      stiffnessValue: "",
      stiffnessValueStandard: "",
      testResult: "",
      pressHeight: "",
      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: 200,
          require: true
          width: 180,
          require: true,
          placeholder: "请输入工装板编号",
        },
        {
          title: "成品编号",
          field: "productCode",
          type: "input",
          width: 200,
          require: true
          width: 180,
          require: true,
          placeholder: "请输入成品编号",
        },
        {
          title: "成品名称",
          field: "productName",
          type: "input",
          width: 180,
          require: true,
          placeholder: "请输入成品名称",
        },
        {
          title: "流水号",
          field: "productSn",
          type: "input",
          width: 200,
          require: true
        }
          require: false,
          placeholder: "请输入产品流水号",
        },
      ],
      // åŠ å·¥çŠ¶æ€è¡Œ - ç§»é™¤ä¸å­˜åœ¨çš„checkUnfinished,新增产品状态
      [
        {
          title: "零件数量",
          field: "componentQty",
          type: "input",
          width: 200,
          require: true
          title: "压装拧紧_拧紧OK",
          field: "pressTightenOk",
          type: "select",
          width: 160,
          align: "center",
          defaultValue: 0,
          data: booleanOptions,
        },
        {
          title: "扭力值",
          field: "torsioValue",
          type: "input",
          width: 200,
          require: false
          title: "压装拧紧_本次加工未完成",
          field: "pressTightenUnfinished",
          type: "select",
          width: 180,
          align: "center",
          defaultValue: 0,
          data: booleanOptions,
        },
        {
          title: "扭力值标准",
          field: "torsioValueStandard",
          title: "产品状态",
          field: "productStatus",
          type: "select",
          width: 160,
          align: "center",
          defaultValue: 0,
          data: productStatusOptions,
        },
        {
          title: "压装位下压压力",
          field: "pressPressure",
          type: "input",
          width: 200,
          require: false
        }
          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: "stiffnessValue",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "刚度值标准",
          field: "stiffnessValueStandard",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "测试结果",
          field: "testResult",
          type: "input",
          width: 200,
          require: false
        }
      ],
      [
        {
          title: "压装位下压检测高度",
          field: "pressHeight",
          type: "input",
          width: 200,
          require: false
        },
        {
          title: "压装位拧紧检测扭力",
          field: "screwTorque",
          type: "input",
          width: 200,
          require: false
          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: "screwAngle",
          type: "input",
          width: 200,
          require: false
        }
          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: "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",
          field: "height1",
          type: "input",
          width: 200,
          require: false
          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: "拧紧位检测高度2",
          field: "height2",
          type: "input",
          width: 200,
          require: false
          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: "拧紧位检测高度3",
          field: "height3",
          type: "input",
          width: 200,
          require: false
        }
          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: "主键ID",
          field: "id",
          type: "input",
          width: 100,
          hidden: true,
          readonly: true
        }
      ]
    ]);
    // æœç´¢è¡¨å•字段 - åŒ¹é…åŽç«¯å®žä½“,移除无关字段
    const searchFormFields = ref({
      palletCode: "",
      productCode: "",
      productName: "",
      creater: "",
      productSn: "",
      productStatus: "", // æ–°å¢žï¼šäº§å“çŠ¶æ€æœç´¢
      createDate: "",
    });
    // æœç´¢è¡¨å•配置 - ä¼˜åŒ–布局,新增产品状态搜索
    const searchFormOptions = ref([
      [
        { title: "工装板编号", field: "palletCode", type: "like" },
        { title: "成品编号", field: "productCode", type: "like" },
        { title: "成品名称", field: "productName", type: "like" },
        { title: "工装板编号", field: "palletCode", type: "like", width: 180 },
        { title: "成品编号", field: "productCode", type: "like", width: 180 },
        { title: "成品名称", field: "productName", type: "like", width: 180 },
        { title: "流水号", field: "productSn", type: "like", width: 200 },
      ],
      [
        { title: "创建人", field: "creater", type: "like" },
        { title: "创建时间", field: "createDate", type: "datetime" },
        {
          title: "产品状态",
          field: "productStatus",
          type: "select",
          width: 180,
          data: productStatusOptions,
        },
        { title: "创建时间", field: "createDate", type: "datetime", width: 380 },
      ],
    ]);
    // è¡¨æ ¼åˆ—配置 - ä¿®æ­£å­—段匹配,新增产品状态列,优化标题
    const columns = ref([
      {
        field: "id",
        title: "序号",
        type: "int",
        width: 90,
        width: 80,
        hidden: true,
        readonly: true,
        require: true,
        align: "left",
        align: "center",
      },
      {
        field: "palletCode",
        title: "工装板编号",
        type: "string",
        width: 200,
        width: 140,
        align: "left",
      },
      {
        field: "productCode",
        title: "成品编号",
        type: "string",
        width: 200,
        width: 140,
        align: "left",
      },
      {
        field: "productName",
        title: "成品名称",
        type: "string",
        width: 200,
        width: 150,
        align: "left",
      },
      {
        field: "componentQty",
        title: "零件数量",
        type: "int",
        width: 200,
        field: "productSn",
        title: "流水号",
        type: "string",
        width: 180,
        align: "left",
        overflow: "ellipsis",
      },
      // çŠ¶æ€åˆ— - ç§»é™¤checkUnfinished,新增产品状态
      {
        field: "pressTightenOk",
        title: "拧紧OK",
        type: "select",
        width: 100,
        align: "center",
        bind: {
          key: "value",
          data: booleanOptions,
        },
      },
      {
        field: "torsioValue",
        title: "扭力值",
        type: "float",
        width: 200,
        align: "left",
        field: "pressTightenUnfinished",
        title: "拧紧未完成",
        type: "select",
        width: 120,
        align: "center",
        bind: {
          key: "value",
          data: booleanOptions,
        },
      },
      {
        field: "torsioValueStandard",
        title: "扭力值标准",
        type: "float",
        width: 200,
        align: "left",
        field: "productStatus",
        title: "产品状态",
        type: "select",
        width: 120,
        align: "center",
        bind: {
          key: "value",
          data: productStatusOptions,
        },
      },
      // åŽ‹è£…æ£€æµ‹å‚æ•°åˆ— - ä¼˜åŒ–标题,统一格式化
      {
        field: "stiffnessValue",
        title: "刚度值",
        type: "float",
        width: 200,
        align: "left",
      },
      {
        field: "stiffnessValueStandard",
        title: "刚度值标准",
        type: "float",
        width: 200,
        align: "left",
      },
      {
        field: "testResult",
        title: "测试结果",
        type: "int",
        width: 200,
        align: "left",
      },
      {
        field: "pressHeight",
        title: "压装位下压检测高度",
        type: "float",
        width: 200,
        align: "left",
        field: "pressPressure",
        title: "压装位下压压力",
        type: "decimal",
        width: 120,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.pressPressure),
      },
      {
        field: "screwTorque",
        title: "压装位拧紧检测扭力",
        type: "float",
        width: 200,
        align: "left",
        title: "拧紧检测扭力",
        type: "decimal",
        width: 120,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.screwTorque),
      },
      {
        field: "screwAngle",
        title: "压装位拧紧检测角度",
        type: "float",
        width: 200,
        align: "left",
        title: "拧紧检测角度",
        type: "decimal",
        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",
        type: "float",
        width: 200,
        align: "left",
        title: "高度1",
        type: "decimal",
        width: 100,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.height1),
      },
      {
        field: "height2",
        title: "拧紧位检测高度2",
        type: "float",
        width: 200,
        align: "left",
        title: "高度2",
        type: "decimal",
        width: 100,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.height2),
      },
      {
        field: "height3",
        title: "拧紧位检测高度3",
        type: "float",
        width: 200,
        align: "left",
        title: "高度3",
        type: "decimal",
        width: 100,
        align: "center",
        formatter: (row) => formatTwoDecimal(row.height3),
      },
      // å…¬å…±å­—段
      {
        field: "creater",
        title: "创建人",
        type: "string",
        width: 90,
        align: "left",
        width: 80,
        align: "center",
      },
      {
        field: "createDate",
        title: "创建时间",
        type: "datetime",
        width: 150,
        align: "left",
        width: 160,
        align: "center",
      },
      {
        field: "modifier",
        title: "修改人",
        type: "string",
        width: 100,
        align: "left",
        width: 80,
        align: "center",
      },
      {
        field: "modifyDate",
        title: "修改时间",
        type: "datetime",
        width: 160,
        align: "left",
        align: "center",
      },
    ]);
    // åŠ å·¥ä¿¡æ¯æ— æ˜Žç»†
    const detail = ref({
      cnName: "",
      table: "",
@@ -361,4 +478,4 @@
    };
  },
});
</script>
</script>