fankuijilu.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div>
  3. <el-row>
  4. <el-col :span="24" class="first-row">
  5. <div id="first-left">
  6. <div id="logo"></div>
  7. <div class="tag">反馈记录</div>
  8. </div>
  9. </el-col>
  10. </el-row>
  11. <hr style="background-color: #CCCCCC;height: 1px;border: 0;margin-top: 32px;">
  12. <el-row>
  13. <el-col :span="24" class="second-row">
  14. <el-form :inline="true" class="demo-form-inline">
  15. <el-form-item label="关键字:" class="shuibiaoId">
  16. <el-input v-model="selectName" placeholder="请输入订单号或者姓名"></el-input>
  17. </el-form-item>
  18. <el-form-item>
  19. <el-button type="primary" @click="onSubmit">搜索</el-button>
  20. </el-form-item>
  21. </el-form>
  22. </el-col>
  23. </el-row>
  24. <el-row>
  25. <el-col :span="24" class="third-row">
  26. <!-- <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" highlight-current-row>
  27. <el-table-column prop="id" label="学号" width="260" align="center"></el-table-column>
  28. <el-table-column prop="stuName" label="姓名" width="200" align="center"></el-table-column>
  29. <el-table-column prop="tel" label="联系方式" width="270"></el-table-column>
  30. <el-table-column prop="time" label="时间" width="280" align="center"></el-table-column>
  31. <el-table-column label="内容" width="340" id="content" align="center" widshow-overflow-tooltip>
  32. <el-popover placement="top-start" width="200" trigger="hover" slot-scope="scope"
  33. :content="scope.row.content">
  34. <div slot="reference">{{ scope.row.content.substr(0,10) }}....</div>
  35. </el-popover>
  36. </el-table-column>
  37. <el-table-column label="操作" align="center" width="160" id="state">
  38. <div slot-scope="scope" @click="handleEdit(scope.$index, scope.row)">
  39. <el-tag :type="scope.row.state === '未处理' ? 'danger' : 'success'" disable-transitions>{{scope.row.state}}
  40. </el-tag>
  41. </div>
  42. </el-table-column>
  43. </el-table> -->
  44. <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%" :stripe='stripe' highlight-current-row>
  45. <el-table-column prop="id" label="学号" align="center"></el-table-column>
  46. <el-table-column prop="stuName" label="姓名" align="center"></el-table-column>
  47. <el-table-column prop="tel" label="联系方式"></el-table-column>
  48. <el-table-column prop="time" label="时间" width="200"></el-table-column>
  49. <el-table-column label="内容" id="content" align="center" widshow-overflow-tooltip>
  50. <el-popover placement="top-start" trigger="hover" slot-scope="scope"
  51. :content="scope.row.content">
  52. <div slot="reference">{{ scope.row.content.substr(0,10) }}....</div>
  53. </el-popover>
  54. </el-table-column>
  55. <el-table-column label="操作" align="center"id="state">
  56. <div slot-scope="scope" @click="handleEdit(scope.$index, scope.row)">
  57. <el-tag :type="scope.row.state === '未处理' ? 'danger' : 'success'" disable-transitions>{{scope.row.state}}
  58. </el-tag>
  59. </div>
  60. </el-table-column>
  61. </el-table>
  62. <div style="margin-top: 20px" class="table-footer">
  63. <div class="pages">
  64. <el-pagination layout="prev, pager, next" :page-size="pageSize" :total="totalCount"
  65. @current-change="handleCurrentChange"></el-pagination>
  66. </div>
  67. </div>
  68. </el-col>
  69. </el-row>
  70. <el-row>
  71. <el-col :span="24" class="forth-row">
  72. <!-- 编辑对话框 -->
  73. <el-dialog title="" :visible.sync="editdialogFormVisible" width="540px" height="387px" top="0vh"
  74. class="my-dialog">
  75. <div id="center">
  76. <div id="logo-center"></div>
  77. </div>
  78. <div id="item-txt">
  79. <span class="item-text">是否处理成功?</span>
  80. </div>
  81. <span slot="footer" class="dialog-footer">
  82. <el-button type="primary" @click="handleSelect">确 定</el-button>
  83. <el-button @click="cancelSelect">取 消</el-button>
  84. </span>
  85. </el-dialog>
  86. </el-col>
  87. </el-row>
  88. </div>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. return {
  94. editdialogFormVisible: false, //弹框
  95. selectName: '', //搜索内容
  96. tableData: [], //所有传入数据
  97. pageSize: 10, //每页数量
  98. totalCount: 0, //搜索总数
  99. index: 0,
  100. stripe: true
  101. }
  102. },
  103. created: function() {
  104. this.user_info = JSON.parse(sessionStorage.getItem('usr_info'))
  105. this.user_token = this.user_info.token
  106. this.getTableData(this.$Api.fankui, 1)
  107. },
  108. methods: {
  109. //分页
  110. handleCurrentChange(val) {
  111. this.currentPage = val;
  112. this.tableData = []
  113. this.getTableData(this.$Api.fankui, val)
  114. },
  115. //打开反馈操作页面
  116. handleEdit(index, row) {
  117. this.editdialogFormVisible = true
  118. this.index = index
  119. // console.log(index, row)
  120. },
  121. //确定处理反馈信息
  122. handleSelect() {
  123. this.editdialogFormVisible = false
  124. this.handleInfo(this.$Api.fankuiHandle + this.tableData[this.index].idNo)
  125. },
  126. //取消选择
  127. cancelSelect(){
  128. this.editdialogFormVisible = false
  129. this.$message.info("取消处理")
  130. },
  131. //搜索
  132. onSubmit() {
  133. // console.log(this.selectName)
  134. this.tableData = []
  135. this.getTableData(this.$Api.fankui, 1, this.selectName)
  136. },
  137. //获取反馈数据列表
  138. getTableData(url, index, keyword) {
  139. this.$axios.get(url + '?' + this.$qs.stringify({
  140. 'curPage': index,
  141. 'pageSize': this.pageSize,
  142. 'keyword': keyword
  143. }), {
  144. headers: {
  145. 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
  146. 'Author': 'codingliang',
  147. 'admin_token': this.user_token
  148. }
  149. }).then(res => {
  150. // console.log(res)
  151. this.totalCount = res.data.data.totalCount
  152. for (var i = 0; i < res.data.data.list.length; i++) {
  153. var list = {}
  154. list.idNo = res.data.data.list[i].id
  155. list.id = res.data.data.list[i].feedbackPersonIdentify
  156. list.stuName = res.data.data.list[i].feedbackPersonName
  157. list.tel = res.data.data.list[i].feedbackPersonPhone
  158. list.time = res.data.data.list[i].publishTime
  159. list.content = res.data.data.list[i].feedbackInfo
  160. if (res.data.data.list[i].statu == 2) {
  161. list.state = '已处理'
  162. } else {
  163. list.state = '未处理'
  164. }
  165. this.tableData.push(list)
  166. }
  167. console.log(this.tableData)
  168. }).catch(err => {
  169. console.log(err)
  170. })
  171. },
  172. //修改信息
  173. handleInfo(url) {
  174. this.$axios.defaults.headers.common['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
  175. this.$axios.defaults.headers.common['admin_token'] = this.user_token;
  176. this.$axios.put(url)
  177. .then(res => {
  178. console.log(this.index)
  179. if (res.data.message == '执行成功') {
  180. // console.log(this.tableData[this.index].state)
  181. this.$message.success("处理成功")
  182. this.tableData[this.index].state = '已处理'
  183. }
  184. }).catch(err => {
  185. console.log(err)
  186. })
  187. },
  188. handleOpen(key, keyPath) {
  189. console.log(key, keyPath)
  190. },
  191. handleClose(key, keyPath) {
  192. console.log(key, keyPath)
  193. },
  194. },
  195. }
  196. </script>
  197. <style scoped>
  198. @import url("fankuijilu.css");
  199. </style>