yangfeng
2023-09-25 af954da9234a18abb087bb64c362e1955315615e
产品类别-产品列表
1个文件已修改
68 ■■■■ 已修改文件
src/views/productManage/productCategory/ProductList.vue 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/productCategory/ProductList.vue
@@ -56,11 +56,18 @@
        infomation: {}
      },
      isIconIndex: "1", // 1 图标 2 列表
      url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
      url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      keyWord: "",
      categoryId: null
    }
  },
  created() {
    this.setTable()
    let query = this.$route.query
    if (query) {
      this.categoryId = query.id ? Number(query.id) : null
      this.pagerOptions.currPage = 1
    }
    this.getData()
  },
  methods: {
@@ -85,81 +92,74 @@
      let tableColumn = [
        {
          label: "产品名称",
          prop: "id",
          prop: "name",
          isShowColumn: true,
          default: true
        },
        {
          label: "内部参考",
          prop: "deviceName",
          prop: "internalReference",
          isShowColumn: showcol.includes("内部参考"),
          default: false
        },
        {
          label: "负责人",
          prop: "id",
          prop: "principal",
          isShowColumn: true,
          default: true
        },
        {
          label: "产品标签",
          prop: "deviceId",
          prop: "productTagName",
          isShowColumn: showcol.includes("产品标签"),
          default: false
        },
        {
          label: "条码",
          prop: "shopName",
          prop: "barcode",
          isShowColumn: showcol.includes("条码"),
          default: false
        },
        {
          label: "公司",
          prop: "shopName",
          isShowColumn: showcol.includes("公司"),
          default: false
        },
        {
          label: "销售价格",
          prop: "faultLevel",
          prop: "salePrice",
          isShowColumn: showcol.includes("销售价格"),
          default: false
        },
        {
          label: "成本",
          prop: "status",
          prop: "cost",
          isShowColumn: showcol.includes("成本"),
          default: false,
          status: true
          default: false
        },
        {
          label: "产品类别",
          prop: "faultTime",
          prop: "categoryName",
          isShowColumn: showcol.includes("产品类别"),
          default: false
        },
        {
          label: "产品类型",
          prop: "shopName",
          prop: "model",
          isShowColumn: showcol.includes("产品类型"),
          default: false
        },
        {
          label: "在库数量",
          prop: "faultLevel",
          prop: "amount",
          isShowColumn: showcol.includes("在库数量"),
          default: false
        },
        {
          label: "预测数量",
          prop: "status",
          isShowColumn: showcol.includes("预测数量"),
          default: false,
          status: true
        },
        // {
        //   label: "预测数量",
        //   prop: "status",
        //   isShowColumn: showcol.includes("预测数量"),
        //   default: false,
        //   status: true
        // },
        {
          label: "计量单位",
          prop: "faultTime",
          prop: "unit",
          isShowColumn: showcol.includes("计量单位"),
          default: false
        }
@@ -171,21 +171,21 @@
      this.tableList.tableColumn = this.setTableColumn(val)
    },
    // 请求数据
    async getData(val, content) {
    async getData() {
      await getProductList({
        [val]: content,
        keyWord: this.keyWord,
        categoryId: this.categoryId ? this.categoryId : null,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize
      }).then((res) => {
        if (res.data.code === 200) {
          const list = res.data.data.list.map((item) => {
        if (res.code === 200) {
          const list = res.data.map((item) => {
            return {
              ...item,
              supplierNumber: item.supplier.number
              ...item
            }
          })
          this.tableList.tableInfomation = list || []
          this.pagerOptions.totalCount = res.data.data.total
          this.pagerOptions.totalCount = res.total
        }
      })
    },