submitCheck.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div >
  3. <el-button @click="submit" size="mini" slot="reference" type="primary" :disabled="data.status == '已过期'" v-if="data.status=='新建' && tool.checkAuth($route.name,'submit') && !disabled && data.status">提 交</el-button>
  4. <el-button @click="submit" size="mini" slot="reference" type="primary" v-if="data.status=='已提交' && tool.checkAuth($route.name,'check') && data.status">审 核</el-button>
  5. <adjust v-show="false" ref="adjustRef" @adjustSuccess="onCheck"></adjust>
  6. </div>
  7. </template>
  8. <script>
  9. import adjust from '../components/priceDifference/index'
  10. export default {
  11. props:['data','disabled'],
  12. name: '',
  13. components:{adjust},
  14. data() {
  15. return {
  16. checkVisible:false,
  17. refresh:true,
  18. siteid:JSON.parse(sessionStorage.getItem('active_account')).siteid
  19. };
  20. },
  21. computed:{
  22. },
  23. watch:{
  24. },
  25. created() {
  26. },
  27. methods: {
  28. submit () {
  29. if (this.data.status == '新建') {
  30. this.$confirm('确定进行提交操作吗?','提示',{
  31. confirmButtonText:'确定',
  32. cancelButtonText:'取消'
  33. }).then(async () => {
  34. let res = await this.$api.requested({
  35. "id": 20221121202802,
  36. "content": {
  37. "sa_contractids": [this.data.sa_contractid]
  38. },
  39. })
  40. this.tool.showMessage(res,() => {
  41. this.$emit('onSuccess')
  42. })
  43. })
  44. } else {
  45. if (new Date() > new Date(this.data.enddate)){
  46. this.$confirm('当前合同有效期已过期,是否确定继续审核?','提示',{
  47. confirmButtonText:'确定',
  48. cancelButtonText:'取消'
  49. }).then( () => {
  50. if (this.siteid == 'HY' && this.$route.query.type == '居间'){
  51. this.$refs.adjustRef.$refs.priceDiff.dialogTableVisible = true
  52. this.$refs.adjustRef.$refs.priceDiff.onAdjust(this.data)
  53. }else {
  54. this.onCheck()
  55. }
  56. })
  57. }else {
  58. this.$confirm('确定进行审核操作吗?','提示',{
  59. confirmButtonText:'确定',
  60. cancelButtonText:'取消'
  61. }).then( () => {
  62. if (this.siteid == 'HY' && this.$route.query.type == '居间'){
  63. this.$refs.adjustRef.$refs.priceDiff.dialogTableVisible = true
  64. this.$refs.adjustRef.$refs.priceDiff.onAdjust(this.data)
  65. }else {
  66. this.onCheck()
  67. }
  68. })
  69. }
  70. }
  71. },
  72. async onCheck(){
  73. let res = await this.$api.requested({
  74. "id": 20221121203102,
  75. "content": {
  76. "type":1,//0:不通过,1:通过
  77. "sa_contractid": this.data.sa_contractid
  78. },
  79. })
  80. this.tool.showMessage(res,() => {
  81. this.$emit('onSuccess')
  82. })
  83. }
  84. },
  85. };
  86. </script>
  87. <style scoped>
  88. .box p {
  89. line-height: 40px;
  90. text-align: center;
  91. }
  92. .box p:hover {
  93. background: #EBF1FE;
  94. color: #6191F8;
  95. cursor: pointer;
  96. }
  97. </style>