feedbackResults.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="center">
  3. <view class="feedback_info">
  4. <view class="flex row">
  5. <view class="left-text" v-if="type == '投诉结果'">反馈时间</view>
  6. <view class="left-text" v-else>举报时间</view>
  7. <view class="flex right-text">
  8. {{formData.createDate}}
  9. </view>
  10. </view>
  11. <view class="flex row">
  12. <view class="left-text" v-if="type == '投诉结果'">反馈对象</view>
  13. <view class="left-text" v-else>举报对象</view>
  14. <view class="flex right-text">
  15. {{formData.passive}}
  16. </view>
  17. </view>
  18. <view class="flex row">
  19. <view class="left-text" v-if="type == '投诉结果'">反馈内容</view>
  20. <view class="left-text" v-else>举报内容</view>
  21. <view class="flex right-text">
  22. {{formData.content}}
  23. </view>
  24. </view>
  25. <view class="flex row">
  26. <view class="left-text">处理结果</view>
  27. <view class="flex right-text">
  28. {{formData.processingResults}}
  29. </view>
  30. </view>
  31. <view class="row">
  32. <view class="">您对处理结果是否满意</view>
  33. <view class="flex score_css">
  34. <u-rate :count="count" v-model="scoreValue" @change="scoreChange">
  35. </u-rate>
  36. <span style="margin-left: 30rpx;">{{score}}</span>
  37. </view>
  38. </view>
  39. </view>
  40. <u-toast ref="uToast"></u-toast>
  41. <u-modal :show="showPips" :title="title" :content='content' showCancelButton @close="showPips = false"
  42. @cancel="showPips=false" @confirm="$u.throttle(confirmSubmit(), 1000)"></u-modal>
  43. <u-button type="primary" text="提交" @click="submit"></u-button>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. count: "5",
  51. scoreValue: "",
  52. id: "",
  53. type: "",
  54. formData: {},
  55. score: "非常满意",
  56. showPips: false,
  57. title: "",
  58. content: ""
  59. }
  60. },
  61. onShow() {
  62. this.getList()
  63. },
  64. onLoad(options) {
  65. this.id = options.id
  66. this.type = options.type
  67. if (this.type == '举报结果') {
  68. uni.setNavigationBarTitle({
  69. title: '举报处理结果'
  70. })
  71. }
  72. },
  73. methods: {
  74. submit() {
  75. if (this.formData.processingResultsSatisfaction == null) { //未提交过
  76. this.title = "确定提交反馈结果?"
  77. this.showPips = true
  78. this.formData.processingResultsSatisfaction = this.scoreValue
  79. this.formData.editFlag = 1
  80. } else { //提交过
  81. this.$refs.uToast.show({
  82. type: 'error',
  83. message: "您已提交过了哦!"
  84. })
  85. return
  86. }
  87. },
  88. confirmSubmit() {
  89. this.$request.baseRequest('post', '/feedbackReport/api/editInfo', this.formData).then(res => {
  90. if (res.code == 200) {
  91. this.showPips = false
  92. this.$refs.uToast.show({
  93. type: 'success',
  94. message: "提交成功!",
  95. complete() {
  96. uni.navigateBack({
  97. delta: 1
  98. })
  99. }
  100. })
  101. }
  102. })
  103. },
  104. scoreChange(e) {
  105. this.scoreValue = e
  106. if (this.scoreValue == 1) {
  107. this.score = "极不满意"
  108. } else if (this.scoreValue == 2) {
  109. this.score = "不满意"
  110. } else if (this.scoreValue == 3) {
  111. this.score = "一般"
  112. } else if (this.scoreValue == 4) {
  113. this.score = "满意"
  114. } else if (this.scoreValue == 5) {
  115. this.score = "非常满意"
  116. }
  117. },
  118. getList() {
  119. this.$request.baseRequest('get', '/feedbackReport/getInfo', {
  120. id: this.id
  121. }).then(res => {
  122. this.formData = res.data
  123. this.scoreValue = "5"
  124. })
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .center {
  131. padding: 20rpx;
  132. .feedback_info {
  133. .row {
  134. margin: 30rpx 0;
  135. }
  136. .left-text {
  137. // background: red;
  138. width: 40%;
  139. color: #333333;
  140. display: flex;
  141. align-items: center;
  142. }
  143. .right-text {
  144. width: 60%;
  145. justify-content: flex-end;
  146. }
  147. .date_css {
  148. text-align: right;
  149. }
  150. .score_css {
  151. margin-top: 15rpx;
  152. }
  153. }
  154. }
  155. </style>