DwSurveyAnswerQuCommon.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form" label-width="80px" label-position="left" >
  4. <div class="dw-qu-item">
  5. <div class="dw-qu-item-title">
  6. <span>{{ index + 1 }}、</span>
  7. <span v-html="question.quTitle" ></span>
  8. <span>【{{ question.quTypeName }}】</span>
  9. </div>
  10. <div class="dw-qu-item-body">
  11. <div v-if="question.quType === 'RADIO'">
  12. <div>
  13. <el-radio-group v-model="question.anRadio.quItemId" >
  14. <el-radio v-for="(item) in question.quRadios" :key="item.id" :label="item.id" >{{ item.optionName }}</el-radio>
  15. </el-radio-group>
  16. </div>
  17. <div><span>{{ question.anRadio.otherText }}</span></div>
  18. </div>
  19. <div v-if="question.quType === 'CHECKBOX'">
  20. <el-checkbox v-for="(item) in question.quCheckboxs" :key="item.id" :label="item.id" :checked="item.answer" >{{ item.optionName }}</el-checkbox>
  21. </div>
  22. <div v-if="question.quType === 'FILLBLANK'">
  23. <el-row><el-col :span="12"><el-input v-model="question.anFillblank.answer" readonly ></el-input></el-col></el-row>
  24. </div>
  25. <div v-if="question.quType === 'MULTIFILLBLANK'">
  26. <el-form-item v-for="(item,index) in question.quMultiFillblanks" :label="(index+1)+'、'+item.optionName" :key="item.id" >
  27. <el-input v-model="item.answer" style="width: 360px;" ></el-input>
  28. </el-form-item>
  29. </div>
  30. <div v-if="question.quType === 'SCORE'">
  31. <el-form-item v-for="(item,index) in question.quScores" :label="(index+1)+'、'+item.optionName" :key="item.id" >
  32. <el-rate v-model="item.answer" disabled show-score text-color="#ff9900" score-template="{value}"></el-rate>
  33. </el-form-item>
  34. </div>
  35. <div v-if="question.quType === 'ORDERQU'">
  36. <el-form-item v-for="(item,index) in question.quOrderbys" :label="(index+1)+'、'+item.optionName" :key="item.id" >
  37. <el-input v-model="item.answer" style="width: 360px;" ></el-input>
  38. </el-form-item>
  39. </div>
  40. </div>
  41. </div>
  42. </el-form>
  43. </div>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'DwSurveyAnswerInfo',
  48. props: {
  49. question: {
  50. type: Object,
  51. default: () => []
  52. },
  53. index: {
  54. type: Number,
  55. default: 0
  56. }
  57. },
  58. data () {
  59. return {
  60. tableData: [],
  61. pageSize: 10,
  62. currentPage: 1,
  63. total: 0,
  64. radio: 3,
  65. formSize: 'medium',
  66. rateValue: 3.7,
  67. form: {
  68. name: '',
  69. region: '',
  70. date1: '',
  71. date2: '',
  72. delivery: false,
  73. type: [],
  74. resource: '',
  75. desc: ''
  76. },
  77. options: [{
  78. value: '选项1',
  79. label: '黄金糕'
  80. }, {
  81. value: '选项2',
  82. label: '双皮奶'
  83. }, {
  84. value: '选项3',
  85. label: '蚵仔煎'
  86. }, {
  87. value: '选项4',
  88. label: '龙须面'
  89. }, {
  90. value: '选项5',
  91. label: '北京烤鸭'
  92. }],
  93. value: ''
  94. }
  95. },
  96. mounted () {
  97. },
  98. methods: {
  99. goBack () {
  100. this.$router.back()
  101. },
  102. handleInfo (index, row) {
  103. console.log(index, row)
  104. },
  105. handleDelete (index, row) {
  106. console.log(index, row)
  107. },
  108. handleCurrentChange: function (val) {
  109. this.queryList(val)
  110. }
  111. }
  112. }
  113. </script>
  114. <style scoped>
  115. .dw-page-header{
  116. padding: 20px;
  117. background-color: white;
  118. }
  119. .dw-answer-title{
  120. font-size: 16px;
  121. padding: 10px;
  122. }
  123. .dw-answer-content{
  124. padding: 20px;
  125. }
  126. .margin-top{
  127. margin-top: 20px;
  128. }
  129. .dw-qu-item{
  130. margin-top: 10px;
  131. }
  132. .dw-qu-item-title{
  133. padding: 20px 0px;
  134. color: grey;
  135. }
  136. .dw-qu-item-body{
  137. margin-left: 10px;
  138. }
  139. </style>