table.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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="订单编号" prop="order_id" width="220" fixed="left">
  5. <template #default="scope">
  6. <span v-if="scope.row.order_id">{{ scope.row.order_id }}</span>
  7. <span class="status-danger" v-else>未设置</span>
  8. </template>
  9. </el-table-column>
  10. <el-table-column label="所属代理" prop="status" width="160">
  11. <template #default="scope">
  12. <span>{{ scope.row.agent?scope.row.agent.name:'-' }}</span>
  13. </template>
  14. </el-table-column>
  15. <el-table-column label="所属店铺" prop="status" width="160">
  16. <template #default="scope">
  17. <span>{{ scope.row.store?scope.row.store.store_name:'-' }}</span>
  18. </template>
  19. </el-table-column>
  20. <el-table-column label="用户ID" prop="open_id" width="320">
  21. <template #default="scope">
  22. <span v-if="scope.row.open_id">{{ scope.row.open_id }}</span>
  23. <span class="status-danger" v-else>未设置</span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="商品ID" prop="out_id" width="150">
  27. <template #default="scope">
  28. <span v-if="scope.row.out_id">{{ scope.row.out_id }}</span>
  29. <span class="status-danger" v-else>未设置</span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="券ID" prop="certificate_id" width="150">
  33. <template #default="scope">
  34. <span v-if="scope.row.certificate_id">{{ scope.row.certificate_id }}</span>
  35. <span class="status-danger" v-else>未设置</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="商品名称" prop="product_name" width="220">
  39. <template #default="scope">
  40. <span v-if="scope.row.product_name">{{ scope.row.product_name }}</span>
  41. <span class="status-danger" v-else>未设置</span>
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="手机号码" prop="mobile" width="120">
  45. <template #default="scope">
  46. <span v-if="scope.row.mobile">{{ scope.row.mobile }}</span>
  47. <span class="status-danger" v-else>未同步</span>
  48. </template>
  49. </el-table-column>
  50. <el-table-column label="数量" prop="count" width="100">
  51. <template #default="scope">
  52. <span>{{ scope.row.count }}件</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="订单金额" prop="order_amount" width="150">
  56. <template #default="scope">
  57. <span v-if="scope.row.order_amount">¥{{ scope.row.order_amount }}</span>
  58. <span class="status-danger" v-else>未设置</span>
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="支付金额" prop="pay_amount" width="150">
  62. <template #default="scope">
  63. <span v-if="scope.row.pay_amount">¥{{ scope.row.pay_amount }}</span>
  64. <span class="status-danger" v-else>未设置</span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="状态" prop="status" width="180">
  68. <template #default="scope">
  69. <div class="status-danger" v-if="scope.row.status==0"><sc-status-indicator type="danger"></sc-status-indicator> 待支付</div>
  70. <div class="status-success" v-if="scope.row.status==1"><sc-status-indicator type="success"></sc-status-indicator> 已支付</div>
  71. <div class="status-danger" v-if="scope.row.status==2"><sc-status-indicator type="danger"></sc-status-indicator> 待核销</div>
  72. <div class="status-info" v-if="scope.row.status==3"><sc-status-indicator type="info"></sc-status-indicator> 已核销</div>
  73. <div class="status-info" v-if="scope.row.status==4"><sc-status-indicator type="info"></sc-status-indicator> 已取消</div>
  74. <div class="status-info" v-if="scope.row.status==5"><sc-status-indicator type="info"></sc-status-indicator> 退款审核</div>
  75. <div class="status-info" v-if="scope.row.status==6"><sc-status-indicator type="info"></sc-status-indicator> 拒绝退款</div>
  76. <div v-if="scope.row.status==2 && scope.row.remark">{{ scope.row.remark }}</div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="支付时间" prop="pay_at" width="180">
  80. <template #default="scope">
  81. <span v-if="scope.row.pay_at">{{ scope.row.pay_at }}</span>
  82. <span class="status-danger" v-else>-</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="退款时间" prop="refund_at" width="180">
  86. <template #default="scope">
  87. <span v-if="scope.row.refund_at">{{ scope.row.refund_at }}</span>
  88. <span class="status-danger" v-else>-</span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column label="创建时间" prop="create_at" width="180"></el-table-column>
  92. </scTable>
  93. <formMain ref="formMain" @success="handleSuccess"></formMain>
  94. <addMain ref="addMain" @success="handleSuccess"></addMain>
  95. </template>
  96. <script>
  97. import formMain from './form';
  98. import addMain from "@/views/manage/components/send";
  99. export default {
  100. components: {
  101. formMain,addMain
  102. },
  103. data(){
  104. return {
  105. list: {
  106. apiObj: this.$API.orderlife.list
  107. },
  108. dataSelect:[],
  109. dataSelectFull:[],
  110. searchKey:{}
  111. }
  112. },
  113. methods: {
  114. table_express(data){
  115. this.$confirm(`手动录入核销订单后,开启自动呼叫快递订单将转移至【待核销】列表中,未开启则转移至【待发货】中`, '提示', {
  116. type: 'warning'
  117. }).then(() => {
  118. this.$nextTick(() => {
  119. this.$refs.addMain.open("edit").setData(data)
  120. })
  121. }).catch(() => {
  122. })
  123. },
  124. async table_send(data){
  125. var resp = await this.$API.orderlife.del.post({"id":data.id});
  126. if (resp.code == 0) {
  127. return this.$message.error(resp.msg)
  128. }
  129. this.$message.success(resp.msg)
  130. this.$refs.table.refresh()
  131. },
  132. table_view(data){
  133. this.$nextTick(() => {
  134. this.$refs.detailMain.open().setData(data)
  135. })
  136. },
  137. refresh(){
  138. this.$refs.table.refresh()
  139. },
  140. upData(data){
  141. this.$refs.table.upData(data)
  142. },
  143. handleSuccess(){
  144. this.$refs.table.refresh()
  145. },
  146. sortChange(event){
  147. if (event.order) {
  148. var data = {
  149. "field":event.prop,
  150. "order":event.order
  151. }
  152. this.$refs.table.upData(data)
  153. } else {
  154. this.$refs.table.reload(this.searchKey)
  155. }
  156. return ;
  157. },
  158. selectionChange(event){
  159. this.dataSelect = [];
  160. var arr = [];
  161. var arrCompany = [];
  162. event.forEach(function(val,index){
  163. arr[index] = val.id;
  164. arrCompany[index] = val;
  165. });
  166. this.dataSelectFull = arrCompany;
  167. this.dataSelect = arr;
  168. this.$emit("success",this.dataSelect);
  169. this.$emit("successFull",this.dataSelectFull);
  170. },
  171. table_passwd(row){
  172. this.$nextTick(() => {
  173. this.$refs.formMain.open("edit").setData(row)
  174. })
  175. },
  176. }
  177. }
  178. </script>