const api = require('@/utils/api.js');
const Constants = require('@/utils/Constants.js');
const common = require('@/utils/common.js');
const chooseGoodsCommon = require('@/utils/chooseGoodsCommon.js')
const utils = require('@/utils/util');
const app = getApp()
Page({
  /**a
   * 页面的初始数据
   */
  data: {
    PricePromotionData: [],
    active: 0,
    categoryQuantity: 0,
    choosedGoodsList: [],

    followFlag: false,
    form: {
      "whId": 610,
      "whName": "武夷山1"
    },
    goodsList: [
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "iconThumPath": "https://hegii-hap.oss-cn-shenzhen.aliyuncs.com/haip/2022-08-31/3971ccd0fcc943baa41df194fe9c5de2.jpeg?Expires=1706601532&OSSAccessKeyId=LTAI5tDd2DXPjsSr4ta5fGp3&Signature=nYhJy56A5NBk88Vd0y0fy3T0tsU%3D",
        "iconThumPath_original": "https://oss-cn-shenzhen.aliyuncs.com/haip/2022-08-31/3971ccd0fcc943baa41df194fe9c5de2.jpeg",
        "id": 212,
        "ivtId": 212,
        "ivtQty": 266,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-11-10T14:17:22.134747000",
        "opCreateUserId": 643,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.675129000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 4,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE939E00200B01",
        "skuId": 9458350,
        "skuModel": "HE939E",
        "skuName": "智能盖板HE939E",
        "skuVolume": 0.06,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "spuId": 6630,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 262,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 380,
        "ivtId": 380,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.530876000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE111A00200B01",
        "skuId": 9498610,
        "skuName": "智能一体机盖板HE111A",
        "skuVolume": 0.083,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 385,
        "ivtId": 385,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.563238000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT968EN2100B01",
        "skuId": 9501290,
        "skuModel": "HC0968",
        "skuName": "【已淘汰】智能一体机陶瓷体HC0968\\地排305",
        "skuVolume": 0.21,
        "skuWeight": 35,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排305"
            ]
          }
        ],
        "spuId": 27535,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 379,
        "ivtId": 379,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.524894000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT970EN4100B01",
        "skuId": 9481900,
        "skuModel": "HC0970",
        "skuName": "智能一体机陶瓷体HC0970\\地排400",
        "skuVolume": 0.241,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排400"
            ]
          }
        ],
        "spuId": 27534,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 383,
        "ivtId": 383,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.549531000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE900A00200B01",
        "skuId": 9441730,
        "skuName": "智能一体机盖板HE900A",
        "skuVolume": 0.1,
        "skuWeight": 9.9,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 384,
        "ivtId": 384,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.556005000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT962EN2200B01",
        "skuId": 9553940,
        "skuModel": "HC0962",
        "skuName": "智能一体机陶瓷体HC0962\\地排305",
        "skuVolume": 0.209,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排305"
            ]
          }
        ],
        "spuId": 27537,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 381,
        "ivtId": 381,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.536870000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT962EN4200B01",
        "skuId": 9562910,
        "skuModel": "HC0962",
        "skuName": "智能一体机陶瓷体HC0962\\地排400",
        "skuVolume": 0.209,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排400"
            ]
          }
        ],
        "spuId": 27537,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 386,
        "ivtId": 386,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.570586000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE853A00100B01",
        "skuId": 9619570,
        "skuName": "智能一体机盖板HE853A",
        "skuVolume": 0.087,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 382,
        "ivtId": 382,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.542902000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE805A00200B01",
        "skuId": 9399760,
        "skuName": "智能一体机盖板HE805A",
        "skuVolume": 0.1,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 378,
        "ivtId": 378,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.518858000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT972EN4100B01",
        "skuId": 9548190,
        "skuModel": "HC0972",
        "skuName": "智能一体机陶瓷体HC0972\\地排400",
        "skuVolume": 0.19,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排400"
            ]
          }
        ],
        "spuId": 27536,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      }
    ],
    goodsSkuList: [],
    infoTypeFlag: false,
    infoTypeFlag1: false,
    list: [
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "iconThumPath": "https://hegii-hap.oss-cn-shenzhen.aliyuncs.com/haip/2022-08-31/3971ccd0fcc943baa41df194fe9c5de2.jpeg?Expires=1706601532&OSSAccessKeyId=LTAI5tDd2DXPjsSr4ta5fGp3&Signature=nYhJy56A5NBk88Vd0y0fy3T0tsU%3D",
        "iconThumPath_original": "https://oss-cn-shenzhen.aliyuncs.com/haip/2022-08-31/3971ccd0fcc943baa41df194fe9c5de2.jpeg",
        "id": 212,
        "ivtId": 212,
        "ivtQty": 266,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-11-10T14:17:22.134747000",
        "opCreateUserId": 643,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.675129000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 4,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE939E00200B01",
        "skuId": 9458350,
        "skuModel": "HE939E",
        "skuName": "智能盖板HE939E",
        "skuVolume": 0.06,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "spuId": 6630,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 262,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 380,
        "ivtId": 380,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.530876000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE111A00200B01",
        "skuId": 9498610,
        "skuName": "智能一体机盖板HE111A",
        "skuVolume": 0.083,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 385,
        "ivtId": 385,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.563238000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT968EN2100B01",
        "skuId": 9501290,
        "skuModel": "HC0968",
        "skuName": "【已淘汰】智能一体机陶瓷体HC0968\\地排305",
        "skuVolume": 0.21,
        "skuWeight": 35,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排305"
            ]
          }
        ],
        "spuId": 27535,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 379,
        "ivtId": 379,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.524894000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT970EN4100B01",
        "skuId": 9481900,
        "skuModel": "HC0970",
        "skuName": "智能一体机陶瓷体HC0970\\地排400",
        "skuVolume": 0.241,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排400"
            ]
          }
        ],
        "spuId": 27534,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 383,
        "ivtId": 383,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.549531000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE900A00200B01",
        "skuId": 9441730,
        "skuName": "智能一体机盖板HE900A",
        "skuVolume": 0.1,
        "skuWeight": 9.9,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 384,
        "ivtId": 384,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.556005000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT962EN2200B01",
        "skuId": 9553940,
        "skuModel": "HC0962",
        "skuName": "智能一体机陶瓷体HC0962\\地排305",
        "skuVolume": 0.209,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排305"
            ]
          }
        ],
        "spuId": 27537,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 381,
        "ivtId": 381,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.536870000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT962EN4200B01",
        "skuId": 9562910,
        "skuModel": "HC0962",
        "skuName": "智能一体机陶瓷体HC0962\\地排400",
        "skuVolume": 0.209,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排400"
            ]
          }
        ],
        "spuId": 27537,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 386,
        "ivtId": 386,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.570586000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE853A00100B01",
        "skuId": 9619570,
        "skuName": "智能一体机盖板HE853A",
        "skuVolume": 0.087,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 382,
        "ivtId": 382,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.542902000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "EE805A00200B01",
        "skuId": 9399760,
        "skuName": "智能一体机盖板HE805A",
        "skuVolume": 0.1,
        "skuWeight": 0,
        "specsList": [
          {
            "specsValues": []
          }
        ],
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      },
      {
        "ascpId": 29184,
        "brandName": "恒洁卫浴",
        "cpId": 20826,
        "cpName": "武夷山（自营无ERP）",
        "flgValid": true,
        "iconPathType": "2",
        "id": 378,
        "ivtId": 378,
        "ivtQty": 150,
        "nonStandardCode": "-",
        "nonStdCode": "-",
        "opApiId": "ebf22701-3e48-48b6-8bdd-703a58bc4e42",
        "opAppId": "5096ef17-ee97-47bc-ab99-1d6be28f4b66",
        "opCreateTime": "2023-12-14T09:54:38.720925000",
        "opCreateUserId": 998,
        "opDbUser": "{\"usesysid\":\"6376246\",\"usename\":\"hgscrm\",\"application_name\":\"PostgreSQL JDBC Driver\",\"client_addr\":\"124.71.26.125\"}",
        "opTimestamp": "2023-12-14T09:57:11.518858000",
        "opUpdateTime": "2023-12-14T09:57:11.503983000",
        "opUpdateUserId": 998,
        "outGoingQty": 0,
        "sale1Id": 20826,
        "sale2Id": 29184,
        "skuCode": "CT972EN4100B01",
        "skuId": 9548190,
        "skuModel": "HC0972",
        "skuName": "智能一体机陶瓷体HC0972\\地排400",
        "skuVolume": 0.19,
        "skuWeight": 0,
        "specsList": [
          {
            "specsName": "坑距",
            "specsValues": [
              "地排400"
            ]
          }
        ],
        "spuId": 27536,
        "titleTag": "HEGII",
        "unitName": "PCS",
        "usableQty": 150,
        "whId": 610,
        "whName": "武夷山1",
        "whTypeName": "可用仓"
      }
    ],
    loading: false,
    mainActiveIndex: 0,
    noMore: false,
    nonStandardListFlag: true,
    numNum: 0,
    orderBy: [
      {
        "text": "可售量升序",
        "value": 1
      },
      {
        "text": "可售量降序",
        "value": 2
      }
    ],
    pageInfo: {
      "currentPage": 1,
      "pageSize": 10
    },
    search: "",
    show: false,
    showAdd: false,
    showAllSpecs: false,
    showChoosed: false,
    showFlag: false,
    show_glassParameters: false,
    show_spec: false,
    sideKey: 0,
    skuData: [],
    skuSpecsData: [],
    skuSpecsList: [],
    skuloading: false,
    sourcePage: "outboundProcessing",
    specsActiv: -1,
    sumGoodsAmount: "0",
    sumQuantity: "0",
    tagList: [
      {
        "id": 1,
        "name": "原木柜"
      },
      {
        "id": 2,
        "name": "古典柜"
      },
      {
        "id": 3,
        "name": "金属柜"
      },
      {
        "id": 4,
        "name": "生态柜"
      },
      {
        "id": 0,
        "name": "更多"
      }
    ],
    typeList: [
      {
        "id": "",
        "name": "全部分类"
      },
      {
        "id": 51,
        "name": "智能马桶"
      },
      {
        "id": 52,
        "name": "智能盖板"
      },
      {
        "id": 53,
        "name": "智能一体机"
      },
      {
        "id": 84,
        "name": "电控坐便器"
      },
      {
        "id": 103,
        "name": "智能一体机陶瓷体"
      },
      {
        "id": 54,
        "name": "陶瓷类"
      },
      {
        "id": 55,
        "name": "坐便器"
      },
      {
        "id": 108,
        "name": "电控坐便器"
      },
      {
        "id": 56,
        "name": "蹲便器"
      },
      {
        "id": 57,
        "name": "小便器"
      },
      {
        "id": 58,
        "name": "洗面器"
      },
      {
        "id": 59,
        "name": "其它陶瓷"
      },
      {
        "id": 60,
        "name": "浴室柜"
      },
      {
        "id": 66,
        "name": "定制浴室柜"
      },
      {
        "id": 107,
        "name": "轻定制浴室柜"
      },
      {
        "id": 110,
        "name": "定制柜非标组件"
      },
      {
        "id": 63,
        "name": "金属柜"
      },
      {
        "id": 62,
        "name": "生态实木柜"
      },
      {
        "id": 61,
        "name": "实木柜"
      },
      {
        "id": 87,
        "name": "金属柜镜柜"
      },
      {
        "id": 119,
        "name": "铝镜柜和智能镜"
      },
      {
        "id": 65,
        "name": "浴室柜配套品"
      },
      {
        "id": 64,
        "name": "柜盆"
      },
      {
        "id": 97,
        "name": "金属柜主柜"
      },
      {
        "id": 102,
        "name": "金属柜其它部件"
      },
      {
        "id": 96,
        "name": "生态实木柜主柜"
      },
      {
        "id": 100,
        "name": "生态实木柜镜柜"
      },
      {
        "id": 101,
        "name": "生态实木柜其它部件"
      },
      {
        "id": 95,
        "name": "实木柜主柜"
      },
      {
        "id": 98,
        "name": "实木柜镜柜"
      },
      {
        "id": 99,
        "name": "实木柜其它部件"
      },
      {
        "id": 82,
        "name": "花洒"
      },
      {
        "id": 93,
        "name": "明装花洒类"
      },
      {
        "id": 123,
        "name": "明装花洒类"
      },
      {
        "id": 124,
        "name": "暗装花洒类"
      },
      {
        "id": 94,
        "name": "暗装花洒类"
      },
      {
        "id": 83,
        "name": "龙头类"
      },
      {
        "id": 67,
        "name": "小五金类"
      },
      {
        "id": 70,
        "name": "挂件"
      },
      {
        "id": 88,
        "name": "地漏"
      },
      {
        "id": 115,
        "name": "地漏"
      },
      {
        "id": 116,
        "name": "角阀"
      },
      {
        "id": 90,
        "name": "角阀"
      },
      {
        "id": 92,
        "name": "下水器"
      },
      {
        "id": 117,
        "name": "下水器"
      },
      {
        "id": 91,
        "name": "水槽"
      },
      {
        "id": 118,
        "name": "水槽"
      },
      {
        "id": 71,
        "name": "其它小五金"
      },
      {
        "id": 72,
        "name": "淋浴房"
      },
      {
        "id": 85,
        "name": "定制淋浴房"
      },
      {
        "id": 86,
        "name": "标准淋浴房"
      },
      {
        "id": 113,
        "name": "定制淋浴房"
      },
      {
        "id": 114,
        "name": "标准淋浴房"
      },
      {
        "id": 104,
        "name": "功能型淋浴房"
      },
      {
        "id": 105,
        "name": "淋浴房石基"
      },
      {
        "id": 73,
        "name": "浴缸"
      },
      {
        "id": 74,
        "name": "配件"
      },
      {
        "id": 75,
        "name": "智能类配件"
      },
      {
        "id": 76,
        "name": "陶瓷类配件"
      },
      {
        "id": 77,
        "name": "浴室柜配件"
      },
      {
        "id": 78,
        "name": "五金类配件"
      },
      {
        "id": 79,
        "name": "休闲类配件"
      },
      {
        "id": 80,
        "name": "周边物料"
      },
      {
        "id": 111,
        "name": "赠品物料"
      },
      {
        "id": -1,
        "name": "广宣大类"
      },
      {
        "id": -2,
        "name": "广宣类"
      },
      {
        "id": -3,
        "name": "广告物料"
      },
      {
        "id": -4,
        "name": "礼品赠品"
      },
      {
        "id": -5,
        "name": "费用大类"
      },
      {
        "id": -6,
        "name": "费用类"
      },
      {
        "id": -7,
        "name": "虚拟产品"
      }
    ],
    updateIndex: null,
    value: 2,
  },
  /**
   * @desc : 下拉多选事件
   * @author : 于继渤
   * @date : 2022/5/26 12:16
   */
  dropdowncommit(e) {
    this.setData({
      whFlag: true
    })
  },
  /**
   * @desc : 排序选择事件
   * @author : 常皓宁
   * @date : 2022/9/3 9:24
   */
  onSwitchChange(e) {
    this.setData({
      value: e.detail
    })
    this.doSearch()
  },
  /**
   * @desc : 下拉多选确定
   * @author : 王英杰
   * @date : 2023年9月8日
   */
  mutiSearch(e) {
    let id = e.target.id
    let form = this.data.form
    if (id === 'warehouse') {
      form.whId = e.detail.id
      form.whName = e.detail.name
      this.setData({
        whFlag: false,
        form: form
      })
      this.selectComponent("#statusItemWareHouse").toggle(false)
      this.doSearch()
    }
  },
  /**
   * @desc : 下拉多选关闭
   * @author : 于继渤
   * @date : 2022/5/26 12:16
   */
  muticlose(e) {
    let id = e.currentTarget.id
    if (id === 'warehouse') {
      this.setData({
        whFlag: false
      })
    }
    this.selectComponent("#statusItemWareHouse").toggle(false)
  },
  changeTag(e) {
    this.setData({
      active: e.detail.index
    })
  },

  closeChoosedItemInfo_spec() {
    this.setData({
      show_spec: false
    })
  },

  /**
   * 允许从相机和相册扫码
   * @param {*} e 
   */
  scanQRCode(e) {
    // 允许从相机和相册扫码
    wx.scanCode({
      success(res) {
        let scancode = res.result
        // 调转商品选品
        wx.navigateTo({
          url: '../choose-goods/choose-goods?searchText=' + scancode.length > 14 ? scancode.substring(0, 14) : scancode,
        })
      }
    })
  },

  /**
   * @desc : 改变标识
   * @author : 周兴
   * @date : 2022/8/6 17:16
   */
  changeAllReadyCheckBox(e) {
    chooseGoodsCommon.changeAllReadyCheckBoxCommon(e, this)
  },

  /**
   * @desc : 分类切换
   * @author : 于继渤
   * @date : 2022/5/26 20:16
   */
  changeSidebar(e) {
    let id = this.data.typeList[e.detail].id
    if (id == "" && typeof (id) != 'number') {
      this.setData({
        sideKey: null,
        specsId: null
      })
    } else {
      this.setData({
        sideKey: e.detail,
        specsId: id
      })
    }
    this.setData({
      searchText: ''
    })
    // 查询
    this.doSearch()
  },

  /**
   * @desc : 打开商品
   * @author : 周兴
   * @date : 2022/7/2 20:16
   */
  openAddItemInfo(e) {
    chooseGoodsCommon.openAddItemInfoCommon(e, this, 'otherOutbound')
  },
  /**
   * 关闭产品
   * @param {*} e 
   */
  closeAddItemInfo() {
    chooseGoodsCommon.closeAddItemInfoCommon(this)
  },
  /**
   * @desc : 打开选择明细
   * @author : 周兴
   * @date : 2022/7/4 20:16
   */
  openChoosedItemInfo(e) {
    chooseGoodsCommon.openChoosedItemInfoCommon(e, this)
  },
  /**
   * @desc : 删除选中的数据
   * @author : 周兴
   * @date : 2022/7/4 20:16
   */
  delChoosedGoodsItem(e) {
    chooseGoodsCommon.delChoosedGoodsItemCommon(e, this, true)
  },
  /**
   * @desc : 确定
   * @date : 2022/7/5 16:49
   * @author : 周兴
   */
  submit() {

    let choosedGoodsList = this.data.choosedGoodsList
    if (this.data.sourcePage == 'inventory-adjustment') {
      wx.navigateBack({
        delta: 1
      })

    } else if (this.data.sourcePage == 'inventory-adjustment111') {
      wx.navigateBack({
        delta: 1
      })

    }
    else if (this.data.sourcePage == 'inventory-adjustment3') {
      wx.navigateBack({
        delta: 1
      })

    }
    else {
      wx.navigateTo({
        url: '../../other-outbound/other-outbound?goodsList=' + encodeURIComponent(JSON.stringify(choosedGoodsList)),
      })

    }

  },

  /**
   * @desc : 查询
   * @date : 2022/5/12 16:49
   * @author : 于继渤
   */
  doSearch() {
    let pageInfo = this.data.pageInfo;
    pageInfo.pageSize = 10;
    pageInfo.currentPage = 1;
    this.setData({
      show: false,
      noMore: false,
      pageInfo: pageInfo,
      list: [],
      goodsList: []
    })
    this.getData()
  },

  onSearchText(e) {
    this.setData({
      searchText: e.detail,
      sideKey: 0,
      specsId: null
    })
  },
  /**
   * @desc : 获取商品数据
   * @date : 2022/5/13 16:49
   * @author : 于继渤
   */
  getData(e) {
    // this.setData({
    //   loading: true
    // })
    // 设置参数
    let param = chooseGoodsCommon.setParam(this);
    if (this.data.salesOutboundFlag) {
      param.skuCode = this.data.skuCode
    } else {
    }
    param.sortOrder = this.data.value
    param.whId = this.data.form.whId
    param.orgId = app.globalData.user.sale2OrgId
    param.customerId = app.globalData.user.sale2CustomerId
    // param.customerId = 2296

    this.setData({
      list: tList,
      goodsList: tList
    })
    api.request(Constants.ORDER_WX_INCENTORY_API + 'list_by', 'POST', param).then(res => {
      this.setData({
        loading: false
      })
      if (res.data.code === 200) {
        let tList = this.data.list;
        let list = res.data.data.list; //后台返回数据
        if (!list || list.length == 0) {
          // 如果不是翻页，需要清空
          if (e != 'more') {
            this.setData({
              list: [],
              noMore: false
            })
          } else {
            this.setData({
              noMore: true
            })
          }
          return
        }
        if (list.length < this.data.pageInfo.pageSize) {
          this.setData({
            noMore: false
          })
        }
        list.forEach(function (item, index) {
          item.id = item.ivtId
        });
        tList = tList.concat(list)
        // 设置图标绝对路径
        common.setSkuIcon(tList);
        this.setData({
          list: tList,
          goodsList: tList
        })
      }
    })
  },
  /**
   * 数量的变化事件
   * @param {*} 
   */
  changeAllreadyChooseQuantityPop(e) {
    let currentChoosedItem = this.data.currentChoosedItem
    currentChoosedItem.itemQuantity = e.detail
    if (currentChoosedItem.nonStandardArea) {
      currentChoosedItem.itemAmount = Number(currentChoosedItem.priceSale * currentChoosedItem.itemQuantity * currentChoosedItem.nonStandardArea).toFixed(2)
      currentChoosedItem.itemAmount = isNaN(currentChoosedItem.itemAmount) ? 0 : currentChoosedItem.itemAmount
    } else {
      currentChoosedItem.itemAmount = Number(currentChoosedItem.priceSale * currentChoosedItem.itemQuantity).toFixed(2)
      currentChoosedItem.itemAmount = isNaN(currentChoosedItem.itemAmount) ? 0 : currentChoosedItem.itemAmount
    }
    this.setData({
      currentChoosedItem: currentChoosedItem
    })
  },
  /**
   * @desc : 生命周期函数--监听页面加载
   * @date : 2022/5/13 16:49
   * @author : 于继渤
   */
  onLoad: function (options) {
    // this.getWhName()
    if (options.sourcePage) { //哪个页面进来的 默认是采购价格
      this.setData({
        sourcePage: options.sourcePage
      })
    }


    let _this = this;
    wx.getSystemInfo({
      success: function (res) {
        _this.setData({
          windowHeight: res.windowHeight,
          windowWidth: res.windowWidth
        })
      }
    })
    if (options.sourcePage == "sales-outbound-detail") { //新建销售出库
      var decodedData = JSON.parse(decodeURIComponent(options.item));
      this.setData({
        ascpId: options.ascpId,
        salesOutboundFlag: true,
        skuCode: decodedData.skuCode
      })
    }

  },
  //获取库区数据源
  getWhName() {
    let that = this
    let param = {}
    param.dataSourceCode = "warehouse"
    // param.orgId = app.globalData.user.orgId
    // param.ascpId = app.globalData.user.ascpId
    // param.cpId = app.globalData.user.cpId
    param.sale2OpeMode = app.globalData.user.sale2OpeMode
    api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
      if (res.data.code === 200) {
        let list = res.data.data || []
        if (list.length > 0) {
          let form = this.data.form
          if (app.globalData.user.sale2OpeMode == "分销模式-代送") {
            form.whId = list[0].id
            form.whName = list[0].name
          } else {
            form.whId = app.globalData.user.whId
            form.whName = app.globalData.user.whName
          }
          this.setData({
            form
          })
          that.doSearch()
          that.getGoodsClassification()
        }
      }
    })
  },
  /**
   * @desc : 加载商品分类
   * @date : 2022/5/15 16:49
   * @author : 于继渤
   */
  getGoodsClassification() {
    let param = {
      dataSourceCode: 'hgSpuCategory',
      // cpId: app.globalData.user.cpId,
    }
    let typeList = []
    this.setData({
      typeList: typeList
    })

    // api.request(Constants.BASIC_COMMON_API + 'get_wx_init_data', 'POST', param).then(res => {
    //   if (res.data.code === 200) {

    //     let typeList = this.data.typeList
    //     let list = res.data.data
    //     list.forEach(item2 => {
    //       let item = {
    //         id: item2.categoryId,
    //         name: item2.categoryName,
    //       }
    //       typeList.push(item)
    //     })
    //     this.setData({
    //       typeList: typeList
    //     })
    //   }
    // })
  },
  /**
   * @desc : 选择数据
   * @date : 2022/7/4 16:49
   * @author : 周兴
   */
  chooseSkuInfo() {
    if (this.data.sourcePage == "sales-outbound-detail") { //新建或编辑销售出库进来的
      if (this.data.choosedGoodsList.length > 1) {
        util.showToast('只能选择一个商品');
        return
      }
    }
    let currentChoosedItem = this.data.currentChoosedItem
    if (currentChoosedItem.usableQty < currentChoosedItem.itemQuantity) {
      util.showToast('当前商品库存可售量不足，无法出库');
      return
    }
    let currentChoosedItemTemp = {
      ...this.data.currentChoosedItem
    }
    let choosedGoodsList = this.data.choosedGoodsList
    choosedGoodsList.push(currentChoosedItemTemp)
    this.setData({
      choosedGoodsList,
      showAdd: false
    })



  },
  /**
   * @desc : 清空default
   * @date : 2022/7/4 16:49
   * @author : 周兴
   */
  clearDefault() {
    chooseGoodsCommon.clearDefaultCommon(this);
  },
  /**
   * @desc : 已选商品更改数量计算合计
   * @date : 2022/7/4 16:49
   * @author : 周兴
   */
  changeAllreadyChooseQuantity(e) {
    let choosedGoodsList = this.data.choosedGoodsList
    let index = e.currentTarget.dataset.index
    choosedGoodsList[index].itemQuantity = e.detail
    choosedGoodsList[index].itemAmount = Number(choosedGoodsList[index].priceSale * choosedGoodsList[index].itemQuantity)
    this.setData({
      choosedGoodsList: choosedGoodsList,
    })
    // 计算合计金额
    chooseGoodsCommon.getSumAmount(this);
  },

  /**
   * @desc : 标价折扣输入事件
   * @author : 于继渤
   * @date : 2022/5/31 17:16
   */
  changeDiscountStandardField(e) {
    let currentChoosedItem = this.data.currentChoosedItem
    currentChoosedItem.discountStandard = e.detail
    this.setData({
      currentChoosedItem: currentChoosedItem
    })
  },
  /**
   * @desc : 销售价格编辑
   * @author : 常皓宁
   * @date : 2022/5/31 14:45
   */
  changeSalesPriceField(e) {
    let priceSale = e.detail.value;
    //优惠卷（标价负数）
    if (this.data.currentChoosedItem.priceSale < 0) {
      priceSale = Number(0 - e.detail.value)
    }

    chooseGoodsCommon.changeSalesPriceCommon(priceSale, this, false)
  },
  /**
   * @desc : 修改销售价格
   * @author : 周兴
   * @date : 2022/7/6 14:45
   */
  changeSalesPrice(priceSale) {
    chooseGoodsCommon.changeSalesPriceCommon(priceSale, this, true)
  },
  /**
   * @desc : 修改销售金额
   * @author : 周兴
   * @date : 2022/7/4 14:45
   */
  changeItemAmountField(e) {
    chooseGoodsCommon.changeItemAmountFieldCommon(e, this)
  },

  /**
   * @desc : 切换sku商品规格
   * @author : 周兴
   * @date : 2022/6/1 10:16
   */
  changeSkuSpecs(e) {
    chooseGoodsCommon.changeSkuSpecsCommon(e, this);
  },

  //主柜规格单选
  clickZGGG(e) {
    chooseGoodsCommon.clickZGGGCommon(e, this)
  },

  //定制品单选
  clickDZP(e) {
    chooseGoodsCommon.clickDZPCommon(e, this)
  },
  /**
   * @desc : 切换组合促销明细
   * @date : 2022/7/5 16:49
   * @author : 周兴
   */
  changeCombinedItem(e) {
    chooseGoodsCommon.changeCombinedItemCommon(e, this)
  },

  //单品促销单选
  clickDP(e) {
    chooseGoodsCommon.clickDPCommon(e, this)
  },
  /**
   * @desc : 使用位置相关事件
   * @author : 于继渤
   * @date : 2022/5/26 12:16
   */
  changeUseLocation(e) {
    let currentChoosedItem = this.data.currentChoosedItem
    currentChoosedItem.usedLocation = e.detail
    this.setData({
      currentChoosedItem: currentChoosedItem
    })
  },
  /**
   * @desc : 点击全部分类
   * @date : 2022/7/8 16:49
   * @author : 周兴
   */
  clickAllSpecs() {
    // 让其他分类的标识置为-1
    this.setData({
      specsActive: -1,
      specsId: null
    })
    // 查询数据
    this.doSearch()
  },
  /**
   * @desc : 点击全部单个分类
   * @date : 2022/7/8 16:49
   * @author : 周兴
   */
  changeSpecsTabs(e) {
    let index = e.detail.index;
    this.setData({
      specsActive: index,
    })
    let id = this.data.typeList[index].id
    this.setData({
      specsId: id
    })
    // 查询数据
    this.doSearch()
  },
  /**
   * @desc : 是否显示商品分类页面
   * @date : 2022/7/9 16:49
   * @author : 周兴
   */
  displayAllSpecs() {
    this.setData({
      showAllSpecs: true
    })
  },
  /**
   * @desc : 页面上拉触底事件的处理函数
   * @author : 周兴
   * @date : 2022/8/1 12:16
   */
  scrollToLower() {
    if (this.data.loading || this.data.noMore) {
      return;
    }
    this.setData({
      pageInfo: {
        pageSize: this.data.pageInfo.pageSize,
        currentPage: this.data.pageInfo.currentPage + 1
      }
    })
    this.getData('more')
  },
  /**
   * @desc : 页面上拉触底事件的处理函数
   * @author : 于继渤
   * @date : 2022/5/24 12:16
   */
  onReachBottom: function () {

    if (this.data.loading || this.data.noMore || this.data.active == 1) {
      return;
    }
    this.setData({
      pageInfo: {
        pageSize: this.data.pageInfo.pageSize,
        currentPage: this.data.pageInfo.currentPage + 1
      }
    })
    this.getData('more')
  },

  onCloseDel(event) {
    const {
      position,
      instance
    } = event.detail;
    let indexdata = event.currentTarget.dataset.index
    let form = this.data.form
    let arr = this.data.goodsList

    Dialog.confirm({
      message: '确定删除吗？',
    }).then(() => {
      if (arr[indexdata].itemId) {
        let orderItemDeleteVOListIds = []
        //包含所有明细id
        orderItemDeleteVOListIds.push(arr[indexdata].itemId)
        if (arr[indexdata].goodsSkuList && arr[indexdata].goodsSkuList.length > 0) {
          arr[indexdata].goodsSkuList.forEach(it => {
            orderItemDeleteVOListIds.push(it.itemId)
          })
        }
        form.orderItemDeleteVOList = form.orderItemDeleteVOList.concat(orderItemDeleteVOListIds)
      }

      arr.splice(indexdata, 1)
      this.setData({
        goodsList: arr,
        form: form
      })
      //计算
      this.calculation()
    })
  },
  onShow: function () {



  },
  /**
   * @desc : 选择非标参数事件
   * @author : 于继渤
   * @date : 2022/8/24 13:16
   */
  nonStandardTap(e) {
    chooseGoodsCommon.nonStandardTap(e, this)
  },
  /**
   * @desc : 设置非标匹配参数
   * @author : 于继渤
   * @date : 2022/8/24 13:16
   */
  setNonStandardMatchingParameters() {
    chooseGoodsCommon.setNonStandardMatchingParameters(e, this)
  },
  /**
   * @desc : 非标商品选择事件
   * @author : 于继渤
   * @date : 2022/8/24 13:16
   */
  nonGlassSpuItemsTap(e) {
    chooseGoodsCommon.nonGlassSpuItemsTap(e, this)
  },

  /**
   * @desc : 非标商品非标参数输入事件
   * @author : 于继渤
   * @date : 2022/8/24 13:16
   */
  bindInputIsScopeOne(e) {
    chooseGoodsCommon.bindInputIsScopeOne(e, this)
  },
  bindBlurIsScopeOne(e) {
    chooseGoodsCommon.bindBlurIsScopeOne(e, this)
  },
  changeFlgAllowSpecsUndefine(e) {

    let currentChoosedItem = this.data.currentChoosedItem
    currentChoosedItem.flgSpecsUndefine = e.detail
    this.setData({
      currentChoosedItem: currentChoosedItem
    })
  },

  bindInputNonStantardArea(e) {

    chooseGoodsCommon.bindInputNonStantardArea(e, this)
  },
  //面积离焦
  bindBlurNonStantardArea(e) {

    chooseGoodsCommon.bindBlurNonStantardArea(e, this)
  },

  /**
   * @desc : 计算折扣反算销售价格
   * @author : 于继渤
   * @date : 2022/7/4 14:45
   */
  changeDiscountField(e) {
    chooseGoodsCommon.changeDiscountFieldCommon(e, this)
  }
})