evaluate.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view class="">
  3. <uni-popup ref="popup" type="share" backgroundColor="#fff">
  4. <view class="select-container">
  5. <view class="title">
  6. <text class="btn cancel" @tap="close">取消</text>
  7. 评价 ★
  8. <text class="btn confirm" @tap="submit">确定</text>
  9. </view>
  10. <uni-forms :modelValue="formData" class="form" label-width='170rpx'>
  11. <uni-forms-item label="服务态度" name="attitudeRating">
  12. <uni-rate v-model="formData.attitudeRating" showText />
  13. </uni-forms-item>
  14. <uni-forms-item label="响应速度" name="responseSpeed">
  15. <uni-rate v-model="formData.responseSpeed" showText />
  16. </uni-forms-item>
  17. <uni-forms-item label="整体满意度" name="serviceRating">
  18. <uni-rate v-model="formData.serviceRating" showText />
  19. </uni-forms-item>
  20. <uni-forms-item label="评价" name="comment" class="pingjia">
  21. <textarea class="textarea" type="text" v-model="formData.comment" placeholder="验收意见" />
  22. </uni-forms-item>
  23. </uni-forms>
  24. </view>
  25. <u-toast ref="uToast"></u-toast>
  26. </uni-popup>
  27. </view>
  28. </template>
  29. <script>
  30. import uniRate from './RatingComponent.vue'
  31. import {
  32. evaluateSave
  33. } from '@/api/salesServiceManagement/workOrder/index.js'
  34. export default {
  35. components: {
  36. uniRate
  37. },
  38. data() {
  39. return {
  40. acceptShow: false,
  41. formData: {
  42. attitudeRating: '',
  43. responseSpeed: '',
  44. serviceRating: '',
  45. comment: '',
  46. workId: ''
  47. },
  48. contactInfoVOS: [],
  49. stateLiist: [{
  50. value: 1,
  51. text: '通过'
  52. },
  53. {
  54. value: 0,
  55. text: '不通过'
  56. }
  57. ],
  58. }
  59. },
  60. methods: {
  61. open(id) {
  62. this.acceptShow = true;
  63. this.$refs.popup.open()
  64. this.formData = {
  65. attitudeRating: '',
  66. responseSpeed: '',
  67. serviceRating: '',
  68. comment: '',
  69. workId: id,
  70. }
  71. console.log(this.formData, 'fffffm')
  72. },
  73. submit() {
  74. if (!this.formData.attitudeRating) {
  75. this.$refs.uToast.show({
  76. type: "warning",
  77. message: "请选择服务态度",
  78. })
  79. return;
  80. }
  81. if (!this.formData.responseSpeed) {
  82. this.$refs.uToast.show({
  83. type: "warning",
  84. message: "请选择响应速度",
  85. })
  86. return;
  87. }
  88. if (!this.formData.serviceRating) {
  89. this.$refs.uToast.show({
  90. type: "warning",
  91. message: "请选择整体满意度",
  92. })
  93. return;
  94. }
  95. uni.showLoading({
  96. title: '加载中'
  97. })
  98. evaluateSave(this.formData).then((res) => {
  99. this.$emit('getList');
  100. this.close();
  101. uni.hideLoading();
  102. }).then((err) => {
  103. uni.hideLoading();
  104. })
  105. },
  106. close() {
  107. this.$refs.popup.close()
  108. }
  109. }
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. .select-container {
  114. min-height: 50vh;
  115. .title {
  116. display: flex;
  117. justify-content: space-between;
  118. align-items: center;
  119. height: 100rpx;
  120. line-height: 100rpx;
  121. text-align: center;
  122. background-color: $j-primary-border-green;
  123. font-weight: bold;
  124. padding: 0 20rpx;
  125. position: relative;
  126. font-size: 32rpx;
  127. color: #fff;
  128. .btn {
  129. width: 80rpx;
  130. height: 32rpx;
  131. display: inline-block;
  132. font-size: 30rpx;
  133. border: 1px solid #fff;
  134. text-align: center;
  135. line-height: 30rpx;
  136. margin: 0;
  137. }
  138. }
  139. .form {
  140. padding: 20rpx 14rpx 0;
  141. /deep/ .uni-forms-item{
  142. display: flex;
  143. align-items: center;
  144. margin-bottom: 20rpx;
  145. }
  146. /deep/ .uni-forms-item__label {
  147. font-size: 28rpx;
  148. }
  149. .pingjia{
  150. align-items: flex-start;
  151. /deep/ .uni-forms-item__label{
  152. width: 130rpx !important;
  153. }
  154. }
  155. .textarea {
  156. border: 1px solid #ddd;
  157. }
  158. }
  159. }
  160. </style>