table.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
  3. <el-table-column type="selection" width="50" fixed="left"></el-table-column>
  4. <el-table-column label="订单编号" width="260" fixed="left" prop="goods_id">
  5. <template #default="scope">
  6. <div class="order-name">
  7. <span>{{ scope.row.order_sn }}</span>
  8. </div>
  9. </template>
  10. </el-table-column>
  11. <el-table-column label="投诉事项" prop="types" width="220">
  12. <template #default="scope">
  13. {{ scope.row.question?scope.row.question:'-' }}
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="联系方式" prop="types" width="100">
  17. <template #default="scope">
  18. {{ scope.row.mobile?scope.row.mobile:'-' }}
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="商品编码" width="340" prop="name">
  22. <template #default="scope">
  23. <div class="goods-img">
  24. <div class="name">
  25. <span>{{ scope.row.orders?scope.row.orders.product_id:'-' }}</span>
  26. </div>
  27. </div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="状态" prop="types" width="160" align="left">
  31. <template #default="scope">
  32. <div class="order-name" v-if="scope.row.status == 0">
  33. <span>待处理</span>
  34. </div>
  35. <div class="order-name" v-if="scope.row.status == 1">
  36. <span>已完成</span>
  37. </div>
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="发起时间" prop="create_at" width="160"></el-table-column>
  41. <el-table-column label="处理时间" prop="last_at" width="160">
  42. <template #default="scope">
  43. {{ scope.row.last_at?scope.row.last_at:'-' }}
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="操作" width="140" align="left" fixed="right">
  47. <template #default="scope">
  48. <el-button-group>
  49. <el-button size="small" text @click="table_view(scope.row)">详情</el-button>
  50. <el-button type="danger" v-if="scope.row.status==0" text size="small" @click="table_del(scope.row)">回复</el-button>
  51. </el-button-group>
  52. </template>
  53. </el-table-column>
  54. </scTable>
  55. <orderDetail ref="orderDetail" @success="orderSuccess"></orderDetail>
  56. <formMain ref="formMain" @success="orderSuccess"></formMain>
  57. </template>
  58. <script>
  59. import orderDetail from "./detail";
  60. import formMain from "./form";
  61. export default {
  62. components:{
  63. orderDetail,formMain
  64. },
  65. data(){
  66. return {
  67. list: {
  68. apiObj: this.$API.merComplaint.list
  69. },
  70. dataSelect:[],
  71. dataSelectFull:[],
  72. searchKey:{}
  73. }
  74. },
  75. methods: {
  76. orderSuccess(){
  77. this.$refs.table.refresh()
  78. },
  79. table_view(data){
  80. this.$nextTick(() => {
  81. this.$refs.orderDetail.open("edit").setData(data)
  82. })
  83. },
  84. table_del(data){
  85. this.$nextTick(() => {
  86. this.$refs.formMain.open("edit").setData(data)
  87. })
  88. },
  89. refresh(){
  90. this.$refs.table.refresh()
  91. },
  92. upData(data){
  93. this.$refs.table.upData(data)
  94. },
  95. handleSuccess(){
  96. this.$refs.table.refresh()
  97. },
  98. sortChange(event){
  99. if (event.order) {
  100. var data = {
  101. "field":event.prop,
  102. "order":event.order
  103. }
  104. this.$refs.table.upData(data)
  105. } else {
  106. this.$refs.table.reload(this.searchKey)
  107. }
  108. return ;
  109. },
  110. selectionChange(event){
  111. this.dataSelect = [];
  112. var arr = [];
  113. var arrCompany = [];
  114. event.forEach(function(val,index){
  115. arr[index] = val.id;
  116. arrCompany[index] = val;
  117. });
  118. this.dataSelectFull = arrCompany;
  119. this.dataSelect = arr;
  120. this.$emit("success",this.dataSelect);
  121. this.$emit("successFull",this.dataSelectFull);
  122. },
  123. }
  124. }
  125. </script>
  126. <style>
  127. .order-name span{display: block;}
  128. .order-name span.dec{color: #999;font-size: 12px;}
  129. .goods-img{display: flex;gap: 5px;}
  130. .goods-img .name span{display: block;}
  131. .goods-img .name span.dec{color: #999;font-size: 12px;}
  132. .goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
  133. .goods-price .del{text-decoration: line-through;}
  134. .goods-price span{background-color: #fff !important;
  135. border: 1px solid #d3d9e0 !important;
  136. border-radius: 4px;
  137. box-sizing: border-box;
  138. color: #6c737a !important;
  139. display: inline-flex;
  140. flex: none;
  141. font-size: 12px;
  142. line-height: 18px !important;
  143. padding: 1px 6px !important;text-decoration: none;}
  144. </style>