zuozhengqing
2024-03-30 dd7fe1db0b9ca604664b59a906545fc1e13d55e2
src/views/overview/AddOverviewDialog.vue
@@ -765,7 +765,7 @@
      console.log(validArr, "xxx")
      Promise.all(validArr)
        .then((results) => {
          console.log(results, "执行成功")
          console.log(results, "执行成功", this.tableData)
          for (let i = 0; i < this.tableData.length; i++) {
            if (this.tableData[i].productName.length === 0) {
              this.isNoProduct = true
@@ -979,6 +979,7 @@
          return {
            ...item,
            productName: item.product.name,
            productId: item.product.id,
            unit: item.product.unit
          }
        })
@@ -991,7 +992,7 @@
      if (this.workType === 1) {
        tableColumnArr = [
          { label: "产品名称", prop: "productName", productName: true, isRequird: true },
          { label: "产品编码", prop: "id" },
          { label: "产品编码", prop: "productId" },
          { label: "计量单位", prop: "unit" },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
@@ -1000,22 +1001,22 @@
      } else if (this.workType === 2) {
        tableColumnArr = [
          { label: "产品名称", prop: "productName", productName: true, isRequird: true },
          { label: "产品编码", prop: "id" },
          { label: "产品编码", prop: "productId" },
          { label: "计量单位", prop: "unit" },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          // { label: "调出位置", prop: "fromLocationId", sonLocation: true, isRequird: true },
          { label: "调入位置", prop: "fromLocationId", sonLocation: true, isRequird: true },
          { label: "数量", prop: "amount", inputFloat: true }
        ]
      } else if (this.workType === 3) {
        tableColumnArr = [
          { label: "产品名称", prop: "productName", productName: true, isRequird: true },
          { label: "产品编码", prop: "id" },
          { label: "产品编码", prop: "productId" },
          { label: "计量单位", prop: "unit" },
          { label: "产品规格", prop: "specs" },
          { label: "产品型号", prop: "model" },
          { label: "调出位置", prop: "fromLocationId", sonLocation: true, isRequird: true },
          { label: "调入位置", prop: "toLocationId", toLocation: true, isRequird: true },
          { label: "调入位置", prop: "fromLocationId", sonLocation: true, isRequird: true },
          { label: "调出位置", prop: "toLocationId", toLocation: true, isRequird: true },
          { label: "数量", prop: "amount", inputFloat: true }
        ]
      }
@@ -1098,9 +1099,12 @@
      let list = this.tableData.map((res) => {
        return {
          ...res,
          productName: res.name
          amount: 1,
          productName: res.name,
          productId: res.id
        }
      })
      this.tableData = list
      this.productTableList.tableData = list
      // this.showSummary.show = true
    },
@@ -1115,10 +1119,9 @@
    },
    // 删除
    handleDelClick(scope, value) {
      console.log(scope)
      if (value === "操作") {
        this.tableData.splice(scope.$index, 1)
        this.productTableList.tableData.splice(scope.$index, 1)
        this.productTableList.tableData = this.tableData
        this.$message.success("删除成功!")
      } else {
        this.detailTableData.splice(scope.$index, 1)