src/views/purchaseManage/purchase/index.vue
@@ -9,7 +9,7 @@
          :show-download="false"
          :amount-view="false"
          :show-action-btn="false"
          :placeholder="'请输入供应商名称/物料名称/采购单名称'"
          :placeholder="'请输入供应商名称/物料名称/采购单名称/采购单号等..'"
          @searchClick="onFilterSearch"
        />
      </div>
@@ -175,12 +175,12 @@
  data() {
    // 产品信息
    const productColumn = [
      { label: "产品编号", prop: "productId", default: true },
      { label: "产品名称", prop: "productName" },
      { label: "规格", prop: "specs" },
      { label: "产品编号", prop: "number", default: true },
      { label: "产品名称", prop: "name" },
      { label: "规格", prop: "specifications" },
      { label: "型号", prop: "modelNumber" },
      { label: "采购数量", prop: "amount" },
      { label: "已发货数量", prop: "sendAmount" },
      { label: "已收货数量", prop: "sendAmount" },
      { label: "已入库数量", prop: "overAmount" },
      { label: "单位", prop: "unit" },
      { label: "采购单价", prop: "purchasePrice", price: true },
@@ -203,7 +203,7 @@
      { label: "收货仓库", prop: "warehouseName" },
      { label: "产品名称", prop: "name" },
      { label: "产品编码", prop: "number" },
      { label: "数量", prop: "amount" },
      { label: "数量", prop: "overAmount" },
      { label: "入库时间", prop: "overTime" },
      { label: "收货人", prop: "principal" },
      { label: "状态", prop: "status", isCallMethod: true, getCallMethod: this.getWarehouseStatus }
@@ -246,6 +246,7 @@
      tableColumn: [
        { label: "单据类型", prop: "orderType", min: 130 },
        { label: "采购单号", prop: "number", min: 150, isCommonClick: true, default: true },
        { label: "销售明细单", prop: "sourceOrder", min: 130 },
        { label: "采购单名称", prop: "name", min: 130, isCommonClick: true },
        { label: "供应商名称", prop: "supplierName", min: 130 },
        { label: "采购数量", prop: "quantity", min: 130 },
@@ -253,7 +254,7 @@
        { label: "经办人", prop: "handledBy", min: 130 },
        { label: "制单人", prop: "creator", min: 130 }
      ],
      showCol: ["采购单号", "采购单名称", "单据类型", "供应商名称", "采购数量", "收货仓库", "经办人", "制单人"],
      showCol: ["采购单号","销售明细单", "采购单名称", "单据类型", "供应商名称", "采购数量", "收货仓库", "经办人", "制单人"],
      tableBottomColumn: [],
      showBottomCol: [],
      TabsIndex: 0,
@@ -266,7 +267,7 @@
        "规格",
        "型号",
        "采购数量",
        "已发货数量",
        "已收货数量",
        "已入库数量",
        "单位",
        "采购单价",
@@ -481,7 +482,10 @@
          if (!row.supplierName) {
            this.btnEdit(row)
          } else {
            newSubmitPurchase(row.id).then((response) => {
            newSubmitPurchase({
              id: Number(row.id),
              status: 4
            }).then((response) => {
              if (response.code === 200) {
                this.$message.success("提交成功")
                this.getData()
@@ -504,7 +508,10 @@
        type: "warning"
      }).then(
        () => {
          newSubmitPurchase(Number(row.id)).then((response) => {
          newSubmitPurchase({
            id: Number(row.id),
            status: 5
          }).then((response) => {
            if (response.code === 200) {
              this.$message.success("已取消")
              this.getData()
@@ -599,10 +606,10 @@
    // top 行点击
    tableRowClick(row) {
      this.selectRow = row
      if (row.status == 1 && this.TabsIndex == 0) {
        getPurchaseInfo({ id: row.id }).then((res) => {
      if (this.TabsIndex == 0) {
        getOperationInfo({ id: row.id }).then((res) => {
          if (res.code == 200) {
            this.productTableList.tableInfomation = res.data.productList
            this.productTableList.tableInfomation = res.data.productInfos
          } else {
            this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
          }
@@ -623,10 +630,14 @@
            this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
          }
        })
      } else if (this.TabsIndex == 2) {
      } else if (
        (this.TabsIndex == 2 && row.status == 8) ||
        (this.TabsIndex == 2 && row.status == 2) ||
        (this.TabsIndex == 2 && row.status == 3)
      ) {
        getOperationInfo({ id: row.id }).then((res) => {
          if (res.code == 200) {
            this.productTableList.tableInfomation = res.data
            this.productTableList.tableInfomation = res.data.inWarehouseInfos
          } else {
            this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
          }
@@ -676,6 +687,7 @@
        this.setBottomList()
        this.getProductInventoryInfo(this.selectRow)
      } else if (this.TabsIndex == 2) {
        console.log("入库")
        // 入库信息列表
        this.tableBottomColumn = this.inLibraryColumn
        this.showBottomCol = this.inLibraryCol
@@ -705,15 +717,16 @@
    },
    // 获取产品/收货信息
    async getProductInventoryInfo(row) {
      if (this.TabsIndex == 0 && row.status == 1) {
        getPurchaseInfo({ id: row.id }).then((res) => {
          if (res.code == 200) {
            this.productTableList.tableInfomation = res.data.productList
          } else {
            this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
          }
        })
      } else if (this.TabsIndex == 1 && row.status == 1) {
      // if (this.TabsIndex == 0) {
      //   getPurchaseInfo({ id: row.id }).then((res) => {
      //     if (res.code == 200) {
      //       this.productTableList.tableInfomation = res.data.productList
      //     } else {
      //       this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
      //     }
      //   })
      // } else
      if (this.TabsIndex == 1 && row.status == 1) {
        this.productTableList.tableInfomation = []
      } else if (
        (this.TabsIndex == 1 && row.status == 7) ||
@@ -730,10 +743,19 @@
            this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
          }
        })
      } else if (this.TabsIndex == 2) {
      } else if (
        this.TabsIndex == 0 ||
        (this.TabsIndex == 2 && row.status == 8) ||
        (this.TabsIndex == 2 && row.status == 2) ||
        (this.TabsIndex == 2 && row.status == 3)
      ) {
        getOperationInfo({ id: row.id }).then((res) => {
          if (res.code == 200) {
            this.productTableList.tableInfomation = res.data
            if(this.TabsIndex == 0){
              this.productTableList.tableInfomation = res.data.productInfos
            }else if(this.TabsIndex == 2){
              this.productTableList.tableInfomation = res.data.inWarehouseInfos
            }
          } else {
            this.$message.error(res.msg ? res.msg + "," : "" + "获取信息失败!")
          }