Prechádzať zdrojové kódy

管理后台-财务中心:流水

panyong 3 rokov pred
rodič
commit
226c1ec1ec

+ 42 - 17
htmldev/manage/src/views/fms/check/index.vue

@@ -1,35 +1,56 @@
 <template>
   <div class="padding-20">
     <div class="search-box">
-      <el-form ref="form" :inline="true" :model="searchForm" clearable label-width="100px" class="mt-10">
-        <el-form-item label="创建时间:">
+      <el-form
+        ref="form"
+        :inline="true"
+        :model="searchForm"
+        clearable
+        class="mt-10">
+        <el-form-item label="订单编号:">
+          <el-input v-model="searchForm.order_number" placeholder="请输入订单编号" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="用户ID:">
+          <el-input v-model="searchForm.user_id" placeholder="请输入用户ID" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="订单创建时间:">
           <el-date-picker
             :editable="false"
             v-model="time"
-            @change="timearr => {timearr ? (searchForm.start_time = timearr[0] + ' 00:00:00', searchForm.end_time = timearr[1] + ' 23:59:59') : searchForm.start_time = searchForm.end_time = undefined}"
+            @change="timearr => {timearr ? (searchForm.start_created_at = timearr[0] + ' 00:00:00', searchForm.end_created_at = timearr[1] + ' 23:59:59') : searchForm.start_created_at = searchForm.end_created_at = undefined}"
             type="daterange"
             value-format="yyyy-MM-dd"
             start-placeholder="开始时间"
             end-placeholder="结束时间"
           ></el-date-picker>
         </el-form-item>
-        <el-form-item label="部门名称:">
-          <el-input v-model="searchForm.department_name" placeholder="请输入部门名称" clearable></el-input>
-        </el-form-item>
         <el-form-item class="ml-10">
           <el-button icon="el-icon-search" type="primary" @click="searchSubmit">查询</el-button>
         </el-form-item>
       </el-form>
     </div>
-    <el-table :data="tableData" stripe v-loading="tableLoading" fit class="marginT-10 order-table" border
-              :max-height="vheight">
-      <el-table-column label="流水号" prop="id"></el-table-column>
-      <el-table-column label="收入/支出" prop="bar_name" sortable></el-table-column>
-      <el-table-column label="金额" prop="song_name" sortable></el-table-column>
-      <el-table-column label="生日" prop="song_user_name"></el-table-column>
-      <el-table-column label="订单类型" prop="created_at"></el-table-column>
-      <el-table-column label="流水时间" prop="user_name"></el-table-column>
-      <el-table-column label="订单编号" prop="order_remark"></el-table-column>
+    <el-table
+      :data="tableData"
+      stripe
+      v-loading="tableLoading"
+      class="marginT-10 order-table"
+      border
+      :max-height="vheight">
+      <el-table-column label="流水号" prop="record_number"></el-table-column>
+      <el-table-column label="收入/支出" prop="record_type" sortable>
+        <template slot-scope="scope">
+          <p>{{ ['', '支出', '退款', '收入'][scope.row.record_type]}}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="金额" prop="record_price" sortable>
+        <template slot-scope="scope">
+          <p>{{ scope.row.record_type === 1 ? '-' : '+'}} {{ scope.row.record_price | fen2Yuan }}</p>
+        </template>
+      </el-table-column>
+      <el-table-column label="订单类型" prop="order_type"></el-table-column>
+      <el-table-column label="流水时间" prop="created_at"></el-table-column>
+      <el-table-column label="订单编号" prop="order_number"></el-table-column>
+      <el-table-column label="用户名称" prop="user_name"></el-table-column>
     </el-table>
     <el-pagination
       class="marginT-20"
@@ -55,12 +76,16 @@ export default {
       time: [],
       searchForm: {},
       tableData: [],
-      tableUrl: '/v1/user/song/order/list'
+      tableUrl: '/v1/user/record/price/List'
     }
   },
   mounted () {
+    const userId = this.$route.query.user_id
+    if (userId) {
+      this.$set(this.searchForm, 'user_id', userId)
+    }
     this.init()
-  },
+  }
 }
 </script>
 

+ 3 - 3
htmldev/manage/src/views/ums/customer/index.vue

@@ -48,9 +48,9 @@
       <el-table-column label="注册时间" prop="created_at"></el-table-column>
       <el-table-column label="最近一次登录时间" prop="user_login_at"></el-table-column>
       <el-table-column label="操作">
-        <template>
-          <!--TODO 直接跳转财务中心的流水-->
-          <el-button type="text">消费记录</el-button>
+        <template slot-scope="scope">
+          <el-button type="text" @click="$router.push({name: 'FmsCheck', query: {user_id: scope.row.id }})">消费记录
+          </el-button>
         </template>
       </el-table-column>
     </el-table>