rejectDialog.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <el-dialog custom-class="approve-reject-dialog"
  3. :title="$t('AprrovalDetailPage.rejection_title')"
  4. :visible.sync="isDetailDialogShow"
  5. :close-on-click-modal="false"
  6. :modal-append-to-body="false"
  7. @close="$emit('close')"
  8. width="692px"
  9. v-dialogDrag
  10. center
  11. >
  12. <div class="dialog-content-wrap">
  13. <el-input type="textarea" v-model="content" :disabled="!isEdit" :rows="10" :placeholder="isEdit?$t('AprrovalDetailPage.rejection_reason_ipt'):'无'"></el-input>
  14. </div>
  15. <div class="dialog-btn-wrap">
  16. <template v-if="isEdit">
  17. <el-button @click="$emit('close')">{{$t('Dialog.cancel_btn')}}</el-button>
  18. <el-button type="primary" @click="handleConfirm">{{$t('Dialog.confirm_btn')}}</el-button>
  19. </template>
  20. <el-button v-else @click="$emit('close')">{{$t('Dialog.known')}}</el-button>
  21. </div>
  22. </el-dialog>
  23. </template>
  24. <script>
  25. export default {
  26. props:{
  27. isDetailDialogShow:{
  28. type:Boolean,
  29. default:false
  30. },
  31. isEdit:{
  32. type:Boolean,
  33. default:true
  34. },
  35. data:{
  36. type:Object,
  37. default:()=>{return{}}
  38. }
  39. },
  40. watch:{
  41. isDetailDialogShow(val){
  42. if(val){
  43. this.content = this.data.ApproveRemark||''
  44. }
  45. }
  46. },
  47. data() {
  48. return {
  49. content:''
  50. };
  51. },
  52. methods: {
  53. handleConfirm(){
  54. if(this.content.length > 500){
  55. return this.$message.warning('内容不能超过500字')
  56. };
  57. this.$emit('edit',this.content)
  58. }
  59. },
  60. };
  61. </script>
  62. <style lang="scss">
  63. .approve-reject-dialog{
  64. .dialog-content-wrap{
  65. .el-textarea{
  66. textarea{
  67. resize: none !important;
  68. }
  69. }
  70. }
  71. .dialog-btn-wrap{
  72. text-align: center;
  73. margin-top: 20px;
  74. padding-bottom: 25px;
  75. }
  76. }
  77. </style>