Browse Source

✨ feat: 优化次数详情功能

Pchen0 1 month ago
parent
commit
0cc21fd2d0

+ 41 - 6
src/pages/admin/lepaoCountLedger/index.vue

@@ -30,6 +30,16 @@
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :span="6">
+                <a-form-item field="operator_uuid" label="操作员UUID">
+                  <a-input v-model="queryData.operator_uuid" allow-clear />
+                </a-form-item>
+              </a-col>
+              <a-col :span="6">
+                <a-form-item field="remark" label="备注搜索">
+                  <a-input v-model="queryData.remark" allow-clear />
+                </a-form-item>
+              </a-col>
               <a-col :span="6">
                 <a-form-item field="queryTime" label="变动时间">
                   <a-range-picker v-model="queryData.queryTime" show-time format="YY-MM-DD HH:mm" value-format="x" />
@@ -72,8 +82,18 @@
           <a-table-column title="时间" :width="170">
             <template #cell="{ record }">{{ stramptoTime(record.created_at) }}</template>
           </a-table-column>
-          <a-table-column title="用户" :width="180">
-            <template #cell="{ record }">{{ record.username || '-' }} ({{ record.student_num || '-' }})</template>
+          <a-table-column title="用户" :width="220">
+            <template #cell="{ record }">
+              <a-space>
+                <a-avatar :size="28">
+                  <img
+                    :src="record.user_avatar || 'https://lepao-cloud.xxoo365.top/view.php/25aa126dc406974ff3579a99a2c6501a.png'"
+                    :alt="record.username || 'user-avatar'"
+                  />
+                </a-avatar>
+                <span>{{ record.username || '-' }} ({{ record.student_num || '-' }})</span>
+              </a-space>
+            </template>
           </a-table-column>
           <a-table-column title="类型" :width="160">
             <template #cell="{ record }">{{ typeLabel(record.biz_type) }}</template>
@@ -87,13 +107,22 @@
           </a-table-column>
           <a-table-column title="变动前" data-index="balance_before" :width="100" />
           <a-table-column title="变动后" data-index="balance_after" :width="100" />
-          <a-table-column title="操作人" :width="180">
+          <a-table-column title="操作人" :width="150">
             <template #cell="{ record }">
-              {{ record.operator_name || '-' }}
-              <span v-if="record.operator_uuid">({{ record.operator_uuid }})</span>
+              <a-space>
+                <a-avatar :size="28">
+                  <img
+                    :src="record.operator_avatar || 'https://lepao-cloud.xxoo365.top/view.php/25aa126dc406974ff3579a99a2c6501a.png'"
+                    :alt="record.operator_name || 'operator-avatar'"
+                  />
+                </a-avatar>
+                <span>
+                  {{ record.operator_name || '-' }}
+                </span>
+              </a-space>
             </template>
           </a-table-column>
-          <a-table-column title="业务单号" data-index="biz_id" :width="220" ellipsis tooltip />
+          <!-- <a-table-column title="业务单号" data-index="biz_id" :width="220" ellipsis tooltip /> -->
           <a-table-column title="备注" data-index="remark" :width="220" ellipsis tooltip />
         </template>
       </a-table>
@@ -118,6 +147,8 @@ const queryData = reactive({
   user_uuid: '',
   username: '',
   student_num: '',
+  operator_uuid: '',
+  remark: '',
   biz_type: '',
   queryTime: []
 })
@@ -146,6 +177,8 @@ const fetchData = async () => {
       user_uuid: queryData.user_uuid,
       username: queryData.username,
       student_num: queryData.student_num,
+      operator_uuid: queryData.operator_uuid,
+      remark: queryData.remark,
       biz_type: queryData.biz_type,
       start_time: start,
       end_time: end
@@ -177,6 +210,8 @@ const reset = () => {
   queryData.user_uuid = ''
   queryData.username = ''
   queryData.student_num = ''
+  queryData.operator_uuid = ''
+  queryData.remark = ''
   queryData.biz_type = ''
   queryData.queryTime = getSemesterTimestamps()
   pagination.current = 1

+ 7 - 1
src/pages/admin/user/userList.vue

@@ -88,6 +88,10 @@
             <a-form-item field="lepao_count" label="乐跑次数">
                 <a-input-number v-model="change_lepao_count.lepao_count" :step="1" />
             </a-form-item>
+            <a-form-item field="remark" label="备注">
+                <a-textarea v-model="change_lepao_count.remark" placeholder="可选,不填默认系统调整次数" :max-length="{ length: 255 }"
+                    show-word-limit allow-clear />
+            </a-form-item>
         </a-form>
     </a-modal>
 </template>
@@ -101,7 +105,8 @@ const visible = ref(false)
 const ok_loading = ref(false)
 const change_lepao_count = reactive({
     userid: '',
-    lepao_count: 0
+    lepao_count: 0,
+    remark: ''
 })
 
 const queryData = reactive({
@@ -196,6 +201,7 @@ const changeCount = (item) => {
     if (item) {
         change_lepao_count.userid = item.uuid
         change_lepao_count.lepao_count = item.lepao_count
+        change_lepao_count.remark = ''
     }
     else return
     visible.value = true

+ 13 - 3
src/pages/lepao/countLedger/index.vue

@@ -9,17 +9,22 @@
         <a-col :flex="1">
           <a-form :model="queryData" :label-col-props="{ span: 6 }" :wrapper-col-props="{ span: 18 }" label-align="left">
             <a-row :gutter="16">
-              <a-col :span="8">
+              <a-col :span="12">
                 <a-form-item field="biz_type" label="变动类型">
-                  <a-select v-model="queryData.biz_type" allow-clear placeholder="全部类型">
+                  <a-select v-model="queryData.biz_type" allow-clear placeholder="全部类型" style="width: 100%">
                     <a-option value="">全部</a-option>
                     <a-option v-for="item in typeOptions" :key="item.value" :value="item.value">{{ item.label }}</a-option>
                   </a-select>
                 </a-form-item>
               </a-col>
+              <a-col :span="12">
+                <a-form-item field="remark" label="备注搜索">
+                  <a-input v-model="queryData.remark" allow-clear placeholder="请输入备注关键词" style="width: 100%" />
+                </a-form-item>
+              </a-col>
               <a-col :span="12">
                 <a-form-item field="queryTime" label="变动时间">
-                  <a-range-picker v-model="queryData.queryTime" show-time format="YY-MM-DD HH:mm" value-format="x" />
+                  <a-range-picker v-model="queryData.queryTime" show-time format="YY-MM-DD HH:mm" value-format="x" style="width: 100%" />
                 </a-form-item>
               </a-col>
             </a-row>
@@ -86,8 +91,10 @@ import { reactive, ref, onMounted } from 'vue'
 import { Notification } from '@arco-design/web-vue'
 import { getMyCountLedger } from '@/api/lepao'
 import userCard from '@/components/userCard/userCard.vue'
+import { useRoute } from 'vue-router'
 import { getNotice, getSemesterTimestamps } from '@/utils/util'
 
+
 const loading = ref(false)
 const data = ref([])
 const summary = ref({
@@ -100,6 +107,7 @@ const pagination = reactive({
 })
 const queryData = reactive({
   biz_type: '',
+  remark: '',
   queryTime: []
 })
 const notice = ref('')
@@ -126,6 +134,7 @@ const fetchData = async () => {
       current: pagination.current,
       pagesize: pagination.pagesize,
       biz_type: queryData.biz_type,
+      remark: queryData.remark,
       start_time: start,
       end_time: end
     })
@@ -155,6 +164,7 @@ const search = () => {
 
 const reset = () => {
   queryData.biz_type = ''
+  queryData.remark = ''
   queryData.queryTime = getSemesterTimestamps()
   pagination.current = 1
   fetchData()