table.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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="会员ID" prop="openid" width="220" fixed="left"></el-table-column>
  5. <el-table-column label="会员卡号" prop="card_no">
  6. <template #default="scope">
  7. {{ scope.row.card_no?scope.row.card_no:'-' }}
  8. </template>
  9. </el-table-column>
  10. <el-table-column label="订单编号" prop="order_sn">
  11. <template #default="scope">
  12. {{ scope.row.order_sn?scope.row.order_sn:'-' }}
  13. </template>
  14. </el-table-column>
  15. <el-table-column label="类型" prop="type">
  16. <template #default="scope">
  17. <el-tag type="error" v-if="scope.row.type == 1">支出</el-tag>
  18. <el-tag type="success" v-if="scope.row.type == 2">收入</el-tag>
  19. </template>
  20. </el-table-column>
  21. <el-table-column label="金额" prop="money">
  22. <template #default="scope">
  23. ¥{{ scope.row.money }}
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="余额" prop="money">
  27. <template #default="scope">
  28. {{ $TOOL.money(scope.row.balance) }}
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="其他" prop="order_sn" width="220">
  32. <template #default="scope">
  33. {{ scope.row.remark?scope.row.remark:'-' }}
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="时间" prop="create_at" width="180"></el-table-column>
  37. </scTable>
  38. </template>
  39. <script>
  40. export default {
  41. props: {
  42. type: { type: String, default: "1" }
  43. },
  44. data(){
  45. return {
  46. colorData:['','彩色','黑白'],
  47. duplexData:['','单面','双面'],
  48. list: {
  49. apiObj: this.$API.mUser.log
  50. },
  51. status: ['待支付','待打印', '打印失败', '已打印','申请退款','退款失败','已退款'],
  52. ostatus: ['-','店内打印', '远程自取', '商家配送'],
  53. payStatus:['-','微信','会员卡'],
  54. visible:false,
  55. dataSelect:[],
  56. dataSelectFull:[],
  57. searchKey:{}
  58. }
  59. },
  60. methods:{
  61. table_edit(data){
  62. this.$nextTick(() => {
  63. this.$refs.formMain.open("edit",this.type).setData(data)
  64. })
  65. },
  66. table_del(data){
  67. this.$confirm("确定要删除该数据吗?","删除确认",{type: 'warning'}).then(async ()=>{
  68. var resp = await this.$API.mPrice.del.post({"id":data.id,"type":""});
  69. if (resp.code == 0) {
  70. return this.$message.error(resp.msg)
  71. }
  72. this.$message.success(resp.msg)
  73. this.$refs.table.refresh()
  74. }).catch(()=>{});
  75. },
  76. refresh(){
  77. this.$refs.table.refresh()
  78. },
  79. upData(data){
  80. this.$refs.table.upData(data)
  81. },
  82. handleSuccess(){
  83. this.$refs.table.refresh()
  84. },
  85. }
  86. }
  87. </script>
  88. <style>
  89. .price{display: flex;align-items: center;}
  90. .del{text-decoration: line-through;margin-left: 5px;color: #f00;}
  91. </style>