table.vue 7.6 KB

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