{"remainingRequest":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/limited/limitedGoodsListDialog.vue?vue&type=script&lang=js","dependencies":[{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/src/components/limited/limitedGoodsListDialog.vue","mtime":1701742078547},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/babel-loader/lib/index.js","mtime":456789000000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/mer.ws.baibaodun.com.cn/node_modules/vue-loader/lib/index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport { productLstApi, categoryApi } from '@/api/product';\n\nexport default {\n  name: 'limitedGoodsListDialog',\n  props: ['showLimitedGoodsListDialog'],\n\n  data() {\n    return {\n      listLoading: false,\n      formInfo: {\n        title: '',\n        category: null,\n      },\n      platformCategoryList: [],\n      goodsList: [],\n      limit: 20,\n      page: 1,\n      totalPage: null,\n      total: 0,\n      checkedList: [],\n      keywords: '',\n      status: null, // 1、上架 2、下架\n      categoryId: null, // 平台分类id\n      props1: {\n        children: 'childList',\n        label: 'name',\n        value: 'id',\n        multiple: false,\n        emitPath: false,\n      }, // 级联选择器数据格式配置选项\n    };\n  },\n\n  mounted() {\n    this.getPlatformCategory();\n    this.getGoodsList();\n  },\n\n  methods: {\n    getPlatformCategory() {\n      categoryApi().then(res => {\n        this.platformCategoryList = this.changeNodes(res);\n      });\n    },\n\n    /** tree去除 childList=[] 的结构**/\n    changeNodes (data) {\n      if (data.length > 0) {\n        for (var i = 0; i < data.length; i++) {\n          if (!data[i].isShow) {\n            data[i].disabled = true;\n          }\n          if (!data[i].childList || data[i].childList.length < 1) {\n            data[i].childList = undefined;\n          } else {\n            this.changeNodes(data[i].childList);\n          }\n        }\n      }\n\n      return data;\n    },\n\n    getGoodsList() {\n      let params = {\n        type: 1,\n        page: this.page,\n        limit: this.limit\n      };\n\n      this.keywords ? params.keywords = this.keywords : null;\n      this.status ? params.type = this.status : null;\n      this.categoryId ? params.categoryId = this.categoryId : null;\n\n      productLstApi(params).then(res => {\n        let { page, totalPage, list, limit, total } = res;\n\n        list.forEach(el => {\n          el.productId = el.id;\n          delete el.id;\n        })\n        this.goodsList = list;\n        this.page = page;\n        this.totalPage = totalPage;\n        this.total = total;\n        this.limit = limit;\n        console.info('list', res);\n      }).catch(err => {\n        console.info(err)\n      });\n    },\n\n    onClose() {\n      this.$emit('closeLimitedGoodsListDialog');\n    },\n\n    searchByKeywords() {\n      this.page = 1;\n      this.getGoodsList();\n    },\n\n    searchByCategoryId() {\n      this.page = 1;\n      this.getGoodsList();\n    },\n\n    searchByType() {\n      this.page = 1;\n      this.getGoodsList();\n    },\n\n    handleSelectionChange(selection) {\n      this.checkedList = selection;\n    },\n\n    onConfirm() {\n      this.$emit('addChooseGoodsList', this.checkedList);\n      this.onClose();\n      this.$refs.multipleTable.clearSelection();\n    },\n\n    changePageSize(val) {\n      this.limit = val;\n      this.getGoodsList();\n    },\n\n    changePage(page) {\n      this.page = page;\n      this.getGoodsList()\n    }\n  }\n}\n",null]}