zuozhengqing
2023-11-13 195ebd54302cf7884e23a3f1464ae2f27309327b
就绪状态可以取消调拨
3个文件已修改
71 ■■■■■ 已修改文件
src/api/overview/overview.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/StatusCommonView.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/overview/AddOverviewDialog.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/overview/overview.js
@@ -81,7 +81,14 @@
    id
  })
}
// 取消-状态
export function stateCancel(id) {
  return request({
    url: `/api-wms/v1/operation/cancel/${id}`,
    method: "put",
    id
  })
}
// 获取位置列表
export function getLocationList(data) {
  return request({
@@ -99,3 +106,12 @@
    data
  })
}
// 获取物流公司信息
export const getLogisticCompanyList = (data) => {
  return request({
    url: "/api-wms/v1/operation/getLogisticCompanyList",
    method: "get",
    params: data
  })
}
src/components/makepager/StatusCommonView.vue
@@ -3,6 +3,7 @@
    <div v-if="showButton" style="margin-left: 30px">
      <el-button v-if="isValidateClick" plain size="mini" @click="validateClick">验证</el-button>
      <el-button v-if="showOther" plain size="mini" @click="delClick" :disabled="isDelClick">删除</el-button>
      <el-button v-if="showCancel" plain size="mini" @click="btnCancel">取消</el-button>
      <el-button v-if="showOther" plain size="mini" disabled>打印</el-button>
    </div>
    <div class="arrowsBox">
@@ -66,7 +67,11 @@
    showOther: {
      type: Boolean,
      default: true
    }
    },
    showCancel: {
      type: Boolean,
      default:false
    },
  },
  data() {
    return {}
@@ -79,6 +84,10 @@
    // 删除
    delClick() {
      this.$emit("delClick")
    },
    // 取消
    btnCancel(){
      this.$emit("btnCancel")
    }
  }
}
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(() => {
      });
    }
  }
}