table.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  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="200" prop="id" fixed="left">
  5. <template #default="scope">
  6. {{ scope.row.order_no?scope.row.order_no:'-' }}
  7. </template>
  8. </el-table-column>
  9. <el-table-column label="上游订单号" width="200" prop="id">
  10. <template #default="scope">
  11. {{ scope.row.thri_no?scope.row.thri_no:'-' }}
  12. </template>
  13. </el-table-column>
  14. <el-table-column label="订单信息" prop="category_id" width="300">
  15. <template #default="scope">
  16. <div class="goods-img">
  17. <div class="name">
  18. <span>{{ scope.row.account?scope.row.account.advertiser_name:'-' }}</span>
  19. <span class="dec">{{ scope.row.account?scope.row.account.advertiser_id:'-' }}</span>
  20. </div>
  21. </div>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="归属账户" prop="category_id" width="300">
  25. <template #default="scope">
  26. <div class="goods-img">
  27. <div class="name">
  28. <span>{{ scope.row.account?scope.row.account.advertiser_name:'-' }}</span>
  29. <span class="dec">{{ scope.row.account?scope.row.account.advertiser_id:'-' }}</span>
  30. </div>
  31. </div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column label="归属产品" prop="category_id" width="300">
  35. <template #default="scope">
  36. {{ scope.row.product?scope.row.product.name:'-' }}
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="归属落地页" prop="category_id" width="180">
  40. <template #default="scope">
  41. {{ scope.row.pages?scope.row.pages.title:'-' }}
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="上游状态" prop="enable" width="120" align="center">
  45. <template #default="scope">
  46. {{ scope.row.status_str?scope.row.status_str:'-' }}
  47. </template>
  48. </el-table-column>
  49. <el-table-column label="回传状态" prop="enable" width="120" align="center">
  50. <template #default="scope">
  51. <div class="status-success" v-if="scope.row.is_callback==1"><sc-status-indicator type="success"></sc-status-indicator> 已回传</div>
  52. <div class="status-danger" v-else><sc-status-indicator type="danger"></sc-status-indicator> 未回传</div>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="回传时间" prop="enable" width="180" align="center">
  56. <template #default="scope">
  57. {{ scope.row.callback_at?scope.row.callback_at:'-' }}
  58. </template>
  59. </el-table-column>
  60. <el-table-column label="回传方式" prop="enable" width="120" align="center">
  61. <template #default="scope">
  62. <div class="status-success" v-if="scope.row.is_auto==1"><sc-status-indicator type="success"></sc-status-indicator> 自动</div>
  63. <div class="status-danger" v-if="scope.row.is_auto==2"><sc-status-indicator type="danger"></sc-status-indicator> 手动</div>
  64. <div class="status-info" v-if="scope.row.is_auto==0"><sc-status-indicator type="info"></sc-status-indicator> 未回传</div>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
  68. <el-table-column label="操作" width="120" align="left" fixed="right">
  69. <template #default="scope">
  70. <el-button-group>
  71. <el-button type="danger" text size="small" @click="table_close(scope.row)">手动回传</el-button>
  72. </el-button-group>
  73. </template>
  74. </el-table-column>
  75. </scTable>
  76. </template>
  77. <script>
  78. export default {
  79. data(){
  80. return {
  81. list: {
  82. apiObj: this.$API.order.list
  83. },
  84. dataSelect:[],
  85. dataSelectFull:[],
  86. searchKey:{}
  87. }
  88. },
  89. methods: {
  90. table_close(data){
  91. this.$confirm(`手动回传后不影响自动回传的规则逻辑`, '提示', {
  92. type: 'warning'
  93. }).then(async ()=>{
  94. var loading = this.$loading()
  95. var resp = await this.$API.account.sync.post({"id":data.account_id});
  96. loading.close();
  97. if (resp.code == 0) {
  98. return this.$message.error(resp.msg);
  99. }
  100. this.$message.success(resp.msg);
  101. this.$emit("success");
  102. }).catch(()=>{})
  103. },
  104. refresh(){
  105. this.$refs.table.refresh()
  106. },
  107. upData(data){
  108. this.$refs.table.upData(data)
  109. },
  110. handleSuccess(){
  111. this.$refs.table.refresh()
  112. },
  113. sortChange(event){
  114. if (event.order) {
  115. var data = {
  116. "field":event.prop,
  117. "order":event.order
  118. }
  119. this.$refs.table.upData(data)
  120. } else {
  121. this.$refs.table.reload(this.searchKey)
  122. }
  123. return ;
  124. },
  125. selectionChange(event){
  126. this.dataSelect = [];
  127. var arr = [];
  128. var arrCompany = [];
  129. event.forEach(function(val,index){
  130. arr[index] = val.id;
  131. arrCompany[index] = val;
  132. });
  133. this.dataSelectFull = arrCompany;
  134. this.dataSelect = arr;
  135. this.$emit("success",this.dataSelect);
  136. this.$emit("successFull",this.dataSelectFull);
  137. },
  138. table_passwd(row){
  139. this.$nextTick(() => {
  140. this.$refs.userPasswd.open("edit").setData(row)
  141. })
  142. }
  143. }
  144. }
  145. </script>
  146. <style>
  147. .goods-img{display: flex;gap: 5px;}
  148. .goods-img .name span{display: block;}
  149. .goods-img .name span.dec{color: #999;font-size: 12px;}
  150. .goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
  151. .goods-price .del{text-decoration: line-through;}
  152. .goods-price span{background-color: #fff !important;
  153. border: 1px solid #d3d9e0 !important;
  154. border-radius: 4px;
  155. box-sizing: border-box;
  156. color: #6c737a !important;
  157. display: inline-flex;
  158. flex: none;
  159. font-size: 12px;
  160. line-height: 18px !important;
  161. padding: 1px 6px !important;text-decoration: none;}
  162. .flex{display: flex;align-items: center;gap: 5px;}
  163. </style>