zuozhengqing
2023-11-13 195ebd54302cf7884e23a3f1464ae2f27309327b
src/views/overview/AddOverviewDialog.vue
@@ -37,8 +37,10 @@
            :isValidateClick="isValidateClick"
            :isDelClick="isDelClick"
            :list="list"
            :showCancel="showCancel"
            @delClick="delClick"
            @validateClick="validateClick"
            @btnCancel="btnCancel"
          />
        </div>
        <div class="basic-info">
@@ -309,6 +311,7 @@
  addOperation,
  updateOperation,
  updateStatus,
  stateCancel,
  deleteOperation,
  getListTransfer,
  getLogisticCompanyList
@@ -361,7 +364,8 @@
        { label: "草稿", status: "todo", value: 1 },
        { label: "正在等待", status: "todo", value: 2 },
        { label: "就绪", status: "todo", value: 3 },
        { label: "完成", status: "todo", value: 4 }
        { label: "完成", status: "todo", value: 4 },
        { label: "已取消", status: "todo", value: 5 }
      ],
      showButton: true,
      activeName: "first",
@@ -388,7 +392,8 @@
        waybillNumber:'',
        weight:0,
        logisticWeight:0,
      }
      },
      showCancel:false, // 取消是否可以显示
    }
  },
  created() {
@@ -466,8 +471,12 @@
        this.showFooter = false
        if (this.editConfig.infomation.status === "完成") {
          this.isValidateClick = false
        } else {
        }else if(this.editConfig.infomation.status === 3){
          this.isValidateClick = true
          this.showCancel=true
        }else{
          this.isValidateClick = true
        }
      } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "完成") {
        this.showButton = true
@@ -486,6 +495,7 @@
        this.showEdit = true
        this.showFooter = false
        this.isValidateClick = true
        this.showCancel=true
      }
      if (this.editConfig.title === "新建") {
        this.list[0].status = "active"
@@ -752,6 +762,32 @@
          this.$parent.getData()
        }
      })
    },
    // 取消
    btnCancel(){
      this.$confirm('确定取消吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        stateCancel(this.editConfig.infomation.id).then((res) => {
          console.log(res)
          this.editConfig.visible = false
          if (res.code === 200) {
            this.$message.success("取消调拨")
            this.$parent.getData()
          }
        })
        this.list.map((item) => {
          if (item.label==="已取消") {
            item.status = "active"
          } else {
            item.status = "todo"
          }
        })
      }).catch(() => {
      });
    }
  }
}