adjustment.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <div v-if="data.status === '已下达' && checkDate()" class="inline-16">
  3. <el-button size="mini" type="primary" @click="adjustmentRow">调 整</el-button>
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. props:['data'],
  9. methods:{
  10. async adjustmentRow () {
  11. this.$confirm('是否确认调整人员目标,仅可调整当前年度剩余月份目标', '提示', {
  12. confirmButtonText: '确定',
  13. cancelButtonText: '取消',
  14. type: 'warning'
  15. }).then(async () => {
  16. const res = await this.$api.requested({
  17. "id": 20220901110102,
  18. "content": {
  19. "sa_salestargetbillid": this.data.sa_salestargetbillid
  20. },
  21. })
  22. this.tool.showMessage(res,()=>{
  23. this.$emit('onSuccess')
  24. })
  25. })
  26. },
  27. checkDate () {
  28. let date = new Date()
  29. let year = date.getFullYear()
  30. let month = date.getMonth() + 1
  31. if (year <= this.data.year)
  32. return true
  33. }
  34. },
  35. mounted () {
  36. // console.log(this.checkDate())
  37. }
  38. }
  39. </script>
  40. <style>
  41. </style>