table.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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="220" 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="id" width="260">
  12. <template #default="scope">
  13. <div class="goods-img">
  14. <div class="name" v-if="scope.row.poi">
  15. <span>{{ scope.row.poi.poi_name }}</span>
  16. <span class="dec">{{ scope.row.poi.poi_address }}</span>
  17. </div>
  18. <div v-else>-</div>
  19. </div>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="核销状态" prop="enable" width="120" align="center">
  23. <template #default="scope">
  24. <div class="status-success" v-if="scope.row.status==0"><sc-status-indicator type="success"></sc-status-indicator> 已核销</div>
  25. <div class="status-danger" v-if="scope.row.status==1"><sc-status-indicator type="danger"></sc-status-indicator> 已退款</div>
  26. </template>
  27. </el-table-column>
  28. <el-table-column label="核销时间" prop="create_at" width="180"></el-table-column>
  29. <el-table-column label="商品名称" prop="id" width="210">
  30. <template #default="scope">
  31. <div class="goods-img">
  32. <div class="name" v-if="scope.row.orders">
  33. <span>{{ scope.row.orders.product.product_name }}</span>
  34. </div>
  35. <div v-else>-</div>
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="商品类型" prop="id" width="140">
  40. <template #default="scope">
  41. <div class="goods-img">
  42. <div class="name" v-if="scope.row.orders">
  43. <span>{{ scope.row.orders.product.types }}</span>
  44. </div>
  45. <div v-else>-</div>
  46. </div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="订单实收(元)" prop="id" width="140">
  50. <template #default="scope">
  51. <span>{{ scope.row.money?$TOOL.money(scope.row.money):'-' }}</span>
  52. </template>
  53. </el-table-column>
  54. <el-table-column label="券码" prop="id" width="260">
  55. <template #default="scope">
  56. <span>{{ scope.row.verify_id }}</span>
  57. </template>
  58. </el-table-column>
  59. </scTable>
  60. </template>
  61. <script>
  62. export default {
  63. data(){
  64. return {
  65. list: {
  66. apiObj: this.$API.verify.list
  67. },
  68. dataSelect:[],
  69. dataSelectFull:[],
  70. searchKey:{}
  71. }
  72. },
  73. methods: {
  74. table_rate(data){
  75. this.$nextTick(() => {
  76. this.$refs.editForm.open("goods").setData(data)
  77. })
  78. },
  79. table_star(data){
  80. this.$nextTick(() => {
  81. this.$refs.editForm.open("star").setData(data)
  82. })
  83. },
  84. table_auth(data){
  85. this.$nextTick(() => {
  86. this.$refs.comboMain.open("edit").setData(data)
  87. })
  88. },
  89. table_update(data){
  90. this.$confirm(`更新后可能数据没有变化,确定更新该达人的基础数据吗?`, '提示', {
  91. type: 'warning'
  92. }).then(async ()=>{
  93. var resp = await this.$API.merStar.update.post({"id":data.id});
  94. if (resp.code == 0) {
  95. return this.$message.error(resp.msg);
  96. }
  97. this.$message.success(resp.msg);
  98. this.$refs.table.refresh()
  99. }).catch(()=>{})
  100. },
  101. table_del(data){
  102. this.$confirm(`删除后,所有该计划对应的数据将一并被删除`, '提示', {
  103. type: 'warning'
  104. }).then(async ()=>{
  105. var loading = this.$loading()
  106. var resp = await this.$API.merPlan.merPlan.post({"id":data.id});
  107. loading.close();
  108. if (resp.code == 0) {
  109. return this.$message.error(resp.msg);
  110. }
  111. this.$message.success(resp.msg);
  112. this.$refs.table.refresh()
  113. }).catch(()=>{})
  114. },
  115. table_close(data){
  116. this.$confirm(`关闭该定向计划后,达人无法勾选对应商品进行直播`, '提示', {
  117. type: 'warning'
  118. }).then(async ()=>{
  119. var loading = this.$loading()
  120. var resp = await this.$API.merPlan.close.post({"id":data.id});
  121. loading.close();
  122. if (resp.code == 0) {
  123. return this.$message.error(resp.msg);
  124. }
  125. this.$message.success(resp.msg);
  126. this.$emit("success");
  127. }).catch(()=>{})
  128. },
  129. refresh(){
  130. this.$refs.table.refresh()
  131. },
  132. upData(data){
  133. this.$refs.table.upData(data)
  134. },
  135. handleSuccess(){
  136. this.$refs.table.refresh()
  137. },
  138. sortChange(event){
  139. if (event.order) {
  140. var data = {
  141. "field":event.prop,
  142. "order":event.order
  143. }
  144. this.$refs.table.upData(data)
  145. } else {
  146. this.$refs.table.reload(this.searchKey)
  147. }
  148. return ;
  149. },
  150. selectionChange(event){
  151. this.dataSelect = [];
  152. var arr = [];
  153. var arrCompany = [];
  154. event.forEach(function(val,index){
  155. arr[index] = val.id;
  156. arrCompany[index] = val;
  157. });
  158. this.dataSelectFull = arrCompany;
  159. this.dataSelect = arr;
  160. this.$emit("success",this.dataSelect);
  161. this.$emit("successFull",this.dataSelectFull);
  162. },
  163. table_passwd(row){
  164. this.$nextTick(() => {
  165. this.$refs.userPasswd.open("edit").setData(row)
  166. })
  167. }
  168. }
  169. }
  170. </script>
  171. <style>
  172. .goods-img{display: flex;gap: 5px;}
  173. .goods-img .name span{display: block;}
  174. .goods-img .name span.dec{color: #999;font-size: 12px;}
  175. .goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
  176. .goods-price .del{text-decoration: line-through;}
  177. .goods-price span{background-color: #fff !important;
  178. border: 1px solid #d3d9e0 !important;
  179. border-radius: 4px;
  180. box-sizing: border-box;
  181. color: #6c737a !important;
  182. display: inline-flex;
  183. flex: none;
  184. font-size: 12px;
  185. line-height: 18px !important;
  186. padding: 1px 6px !important;text-decoration: none;}
  187. .flex{display: flex;align-items: center;gap: 5px;}
  188. </style>