Parcourir la source

字典异常修复及充值记录菜单跳转

zuy il y a 2 ans
Parent
commit
c043172fa0

+ 19 - 8
admin-web/src/components/form/ExtDLabel.vue

@@ -95,7 +95,7 @@
   <span class="status-label" :style="state.style">{{ state.text }}</span>
 </template>
 <script setup lang="ts" name="ExtDLabel">
-import {onMounted, reactive} from 'vue';
+import {onMounted, reactive,watch} from 'vue';
 import {Session} from "/@/utils/storage";
 import u from "/@/utils/u";
 
@@ -136,7 +136,15 @@ const setupColorStyle = (hex: string = "#000000") => {
   }
 }
 
+watch(()=>props.modelValue,(oldVal,newVal)=>{
+  setupLabel();
+})
+
 onMounted(() => {
+  setupLabel()
+});
+
+const setupLabel = ()=>{
   if (!u.isEmptyOrNull(props.dataRange)) {
     let data = props.dataRange?.find(k => k.value == props.modelValue);
     if (data) {
@@ -158,14 +166,17 @@ onMounted(() => {
         return "-";
       }
     }
-    // console.log(props.modelValue)
-    let dict = (<Dicts>dicts).find(k => k.value == props.modelValue);
+    if(props.modelValue){
+      let dict = (<Dicts>dicts).find(k => k.value == props.modelValue);
 
-    if (dict) {
-      state.text = dict.name||dict.label;
-      state.style = setupColorStyle(state.colorList[dict.value%8]);
+      if (dict) {
+        state.text = dict.name||dict.label;
+        state.style = setupColorStyle(state.colorList[dict.value%8]);
+      }
+    }else{
+      return "-"
     }
-  }
 
-});
+  }
+}
 </script>

+ 4 - 4
admin-web/src/router/route.ts

@@ -208,20 +208,20 @@ export const adminRoutes: Array<RouteRecordRaw> = [
                     icon: 'ele-User',
                 }
             },
-        /*    {
+            {
                 path: '/finance',
                 name: 'adminFinance',
                 component: () => import('/@/views/admin/finance/index.vue'),
                 meta: {
-                    title: '财务管理',
+                    title: '充值记录',
                     isLink: '',
                     isHide: false,
                     isKeepAlive: true,
                     isAffix: false,
                     isIframe: false,
                     icon: 'ele-Wallet',
-                }
-            },*/
+                },
+            },
             {
                 path: '/org',
                 name: 'adminOrg',

+ 10 - 3
admin-web/src/views/admin/account/index.vue

@@ -94,6 +94,9 @@
             <template v-else-if="'status'===field.prop">
              <ext-d-label type="User.status" v-model="row[field.prop]"/>
             </template>
+            <template v-else-if="'rechargeTimes'===field.prop">
+              <el-button link type="primary" @click="handleGotoRecharge(row)">{{row[field.prop]}} </el-button>
+            </template>
             <template v-else>
               <div>{{ row[field.prop] }}</div>
             </template>
@@ -114,7 +117,8 @@ import {$body, $get} from "/@/utils/request";
 import {Msg} from "/@/utils/message";
 import u from "/@/utils/u"
 
-
+import {useRouter} from "vue-router";
+const router = useRouter();
 import ExtPage from '/@/components/form/ExtPage.vue'
 
 import mittBus from '/@/utils/mitt';
@@ -176,7 +180,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 
   mittBus.on("adminUser.refresh", () => {
@@ -197,7 +201,6 @@ const loadData = (refresh: boolean = false) => {
   }
   state.tableData.loading = true;
   $get(`/custom/listUser`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
-    console.log(res)
     let {list, total} = res;
     state.tableData.data = list;
     state.pageQuery.total = total;
@@ -208,6 +211,10 @@ const loadData = (refresh: boolean = false) => {
   })
 };
 
+const handleGotoRecharge=(row:any)=>{
+  router.push(`/finance?mobilePhone=${row.mobilePhone}`)
+}
+
 // 打开修改用户弹窗
 const onRowClick = (type: string, row: any) => {
   adminUserDialogRef.value.open(type, row);

+ 1 - 1
admin-web/src/views/admin/config/dict/index.vue

@@ -164,7 +164,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 });
 </script>

+ 1 - 1
admin-web/src/views/admin/config/list/index.vue

@@ -152,7 +152,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 
   mittBus.on("config.refresh", () => {

+ 246 - 6
admin-web/src/views/admin/finance/index.vue

@@ -1,13 +1,253 @@
+<style scoped lang="scss">
+.system-container {
+
+  :deep(.el-card__body) {
+    display: flex;
+    flex-direction: column;
+    justify-content: space-between;
+    flex: 1;
+    overflow: auto;
+
+    .el-table {
+      flex: 1;
+    }
+
+  }
+}
+
+.page-content {
+  margin-bottom: 20px;
+}
+
+.page-pager {
+  background-color: #fff;
+  height: 24px;
+}
+</style>
 <template>
+  <div class="system-container layout-padding">
+    <el-card shadow="hover" class="layout-padding-auto">
+
+
+      <el-form
+          :model="state.formQuery"
+          ref="queryRef"
+          size="default" label-width="0px" class="mt5 mb5">
+        <el-input
+            v-model="state.formQuery.mobilePhone"
+            placeholder="用户手机号"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.outTradeNo"
+            placeholder="商户订单号"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+        <el-input
+            v-model="state.formQuery.transactionId"
+            placeholder="微信订单号"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>
+<!--        <el-input
+            v-model="state.formQuery.tradeType"
+            placeholder="交易类型,枚举值:JSAPI:公众号支付 NATIVE:扫码支付 APP:APP支付 MICROPAY:付款码支付 MWEB:H5支付 FACEPAY:刷脸支付"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>-->
+<!--        <el-input
+            v-model="state.formQuery.tradeState"
+            placeholder="交易状态,枚举值:SUCCESS:支付成功REFUND:转入退款NOTPAY:未支付CLOSED:已关闭REVOKED:已撤销(付款码支付)USERPAYING:用户支付中(付款码支付)PAYERROR:支付失败(其他原因,如银行返回失败)"
+            clearable
+            @blur="loadData(true)"
+            class="wd150 mr10">
+        </el-input>-->
 
+
+        <el-button class="ml10"  plain size="default" type="success" @click="loadData(true)">
+          <SvgIcon name="ele-Search"/>
+          查询
+        </el-button>
+      </el-form>
+
+      <el-table
+          border
+          stripe="stripe"
+          :height="state.tableData.height"
+          highlight-current-row
+          current-row-key="id"
+          row-key="id"
+          :data="state.tableData.data"
+          v-loading="state.tableData.loading"
+          @selection-change="handleTableSelectionChange"
+          @sort-change="handleTableSortChange">
+        <template #empty>
+          <el-empty></el-empty>
+        </template>
+        <el-table-column
+            v-for="field in state.tableData.columns"
+            :key="field.prop"
+            :label="field.label"
+            :column-key="field.prop"
+            :width="field.width"
+            :min-width="field.minWidth"
+            :fixed="field.fixed"
+            :sortable="field.sortable"
+            :show-overflow-tooltip="!field.fixed&&field.width>150"
+        >
+          <template #default="{row}">
+            <template v-if="field.prop==='expand'">
+              <p style="padding-left: 2em;" v-html="row[field.prop]"></p>
+            </template>
+            <template v-else>
+              <div>{{row[field.prop]}}</div>
+            </template>
+
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
+    </el-card>
+  </div>
 </template>
 
-<script>
-export default {
-  name: "index"
+<script setup lang="ts" name="PayLogList">
+import {defineAsyncComponent, reactive, onMounted, onBeforeMount, ref, getCurrentInstance, nextTick, onBeforeUnmount} from 'vue';
+import {$body,$get} from "/@/utils/request";
+import {Msg} from "/@/utils/message";
+
+import {useRoute} from "vue-router";
+
+const route = useRoute();
+import ExtPage from '/@/components/form/ExtPage.vue'
+
+import mittBus from '/@/utils/mitt';
+
+
+//定义引用
+const queryRef = ref();
+const payLogDialogRef = ref();
+
+//定义变量
+const state = reactive({
+  formQuery: {},
+  pageQuery: {
+    pageNum: 1,
+    pageSize: 10,
+    total: 0
+  },
+  tableData: {
+    height: 500,
+    data: [] as Array < any >,
+    loading: false,
+    columns: [
+      {label: '用户手机号', prop: 'mobilePhone',width:150, resizable: true,fixed:'left'},
+      {label: '商户订单号', prop: 'outTradeNo', width:250,resizable: true},
+      {label: '微信订单号', prop: 'transactionId', width:250,resizable: true},
+      {label: '交易类型', prop: 'tradeType', width:150,resizable: true},
+      // {label: '交易状态', prop: 'tradeState', resizable: true},
+      {label: '订单总金额', prop: 'rechargeAmount', resizable: true,width:130},
+      {label: '用户支付币种', prop: 'currency', width:150,resizable: true},
+      {label: '支付完成时间', prop: 'transactionTime', sortable: 'custom', resizable: true,width:200,fixed:'right'},
+    ],
+  },
+})
+
+
+// 监听双向绑定 modelValue 的变化
+// watch(
+//         () => state.pageIndex,
+//         () => {
+//
+//         }
+// );
+
+//生命周期钩子
+onBeforeMount(() => {
+})
+
+onMounted(() => {
+  var query = route.query;
+  console.log(route.params, route.query)
+  if(query.mobilePhone){
+    state.formQuery.mobilePhone = query.mobilePhone;
+  }
+
+  loadData();
+
+  nextTick(() => {
+    let bodyHeight = document.body.clientHeight;
+    let queryHeight = queryRef.value.$el.clientHeight;
+    state.tableData.height = bodyHeight - queryHeight - 320
+  })
+
+  mittBus.on("payLog.refresh", () => {
+    loadData();
+  })
+});
+
+onBeforeUnmount(() => {
+  mittBus.off("payLog.refresh")
+})
+
+
+//region 方法区
+// 初始化表格数据
+const loadData = (refresh: boolean = false) => {
+  if (refresh) {
+    state.pageQuery.pageNum = 1;
+  }
+  state.tableData.loading = true;
+  $get(`/custom/listRecharge`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
+    let {list, total} = res;
+    state.tableData.data = list;
+    state.pageQuery.total = total;
+    state.tableData.loading = false;
+  }).catch(e => {
+    console.error(e)
+    state.tableData.loading = false;
+  })
+};
+
+// 打开修改用户弹窗
+const onRowClick = (type: string, row: any) => {
+  payLogDialogRef.value.open(type, row);
+};
+
+// 删除用户
+const onRowDel = (row: any) => {
+  Msg.confirm(`此操作将永久删除:『${row.name}』,是否继续?`).then(() => {
+    $get(`/payLog/delete/${row.id}`).then(() => {
+      Msg.message("删除成功", 'success')
+    }).catch(() => {
+      Msg.message("删除失败", 'error')
+    })
+  });
+};
+
+const handleTableSelectionChange = (selection: any) => {
+  console.log("handleTableSelectionChange>>", selection)
+  // emit("on-check-change", selection)
 }
-</script>
 
-<style scoped>
+const handleTableSortChange = (column, prop, order) => {
+  console.log("handleTableSortChange>>", column, prop, order)
+  // emit("on-sort-change", column)
+}
+
+
+//endregion
+
 
-</style>
+// 暴露变量
+// defineExpose({
+//     loadData,
+// });
+</script>

+ 14 - 15
admin-web/src/views/admin/ordering/index.vue

@@ -68,19 +68,18 @@
         <el-date-picker
             v-model="state.formQuery.startDate"
             placeholder="充电开始时间"
-            clearable
-            type="date"
-            value-format="YYYY-MM-DD"
-            @blur="loadData(true)"
+            type="datetime"
+            value-format="YYYY-MM-DD HH:mm:ss"
+            @on-change="loadData(true)"
             class="wd150 mr10">
         </el-date-picker>
         <ext-date-picker
             v-model="state.formQuery.endDate"
             placeholder="充电结束时间"
             clearable
-            type="date"
-            value-format="YYYY-MM-DD"
-            @blur="loadData(true)"
+            type="datetime"
+            value-format="YYYY-MM-DD HH:mm:ss"
+            @on-change="loadData(true)"
             class="wd150 mr10">
         </ext-date-picker>
         <ext-d-select
@@ -88,7 +87,7 @@
             type="ChargeOrder.orderStatus"
             placeholder="订单状态"
             clearable
-            @blur="loadData(true)"
+            @on-change="loadData(true)"
             class="wd150 mr10">
         </ext-d-select>
         <ext-d-select
@@ -96,7 +95,7 @@
             placeholder="充电状态"
             clearable
             type="ChargeOrder.chargeStatus"
-            @blur="loadData(true)"
+            @on-change="loadData(true)"
             class="wd150 mr10">
         </ext-d-select>
 <!--        <ext-d-select-->
@@ -112,7 +111,7 @@
             placeholder="发票状态"
             clearable
             type="ChargeOrder.invoiceStatus"
-            @blur="loadData(true)"
+            @on-change="loadData(true)"
             class="wd150 mr10">
         </ext-d-select>
 
@@ -258,9 +257,9 @@ const state = reactive({
       {label: '发票状态', prop: 'invoiceStatus', width:120, resizable: true},
       // {label: '创建时间', prop: 'createTime', sortable: 'custom', width:150, resizable: true},
       // {label: '更新时间', prop: 'updateTime', sortable: 'custom',width:150,  resizable: true},
-      {
-        label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
-      }
+      // {
+      //   label: '操作', prop: 'action', width: 180, align: 'center', fixed: 'right',
+      // }
     ],
 
   },
@@ -298,7 +297,8 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
+    // state.tableData.height =300
   })
 
   mittBus.on("chargeOrder.refresh", () => {
@@ -320,7 +320,6 @@ const loadData = (refresh: boolean = false) => {
   state.tableData.loading = true;
   $get(`/custom/listChargeOrders`, {...state.formQuery, ...state.pageQuery}).then((res: any) => {
     let {list, total,extraData} = res;
-    console.log(list)
     state.extraData = extraData;
     state.tableData.data = list;
     state.pageQuery.total = total;

+ 1 - 1
admin-web/src/views/admin/role/index.vue

@@ -152,7 +152,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 
   mittBus.on("role.refresh", () => {

+ 3 - 3
admin-web/src/views/admin/station/endpoint/index.vue

@@ -179,9 +179,9 @@ const state = reactive({
       // {label: '设备生产商名称', prop: 'manufacturerName', width: 160, resizable: true},
       {label: '设备生产日期', prop: 'productionDate', width: 160, resizable: true},
       {label: '更新时间', prop: 'updateTime', sortable: 'custom', resizable: true, width: 180},
-      {
+      /*{
         label: '操作', prop: 'action', width: 1, align: 'center', fixed: 'right',
-      }
+      }*/
     ],
   },
 })
@@ -211,7 +211,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 
   mittBus.on("equipmentInfo.refresh", () => {

+ 3 - 3
admin-web/src/views/admin/station/list/index.vue

@@ -48,7 +48,7 @@
         </el-button>
       </el-form>
 
-      <el-card class="w100">
+<!--      <el-card class="w100">
         <div class="order-summary">
           <span class="ml5">电量:</span>
           <el-tag type="success">{{state.extraData.totalPower}}Kwh</el-tag>
@@ -56,7 +56,7 @@
           <el-tag type="success">{{u.fmt.fmtMoney(state.extraData.serviceMoney)}}元</el-tag>
         </div>
 
-      </el-card>
+      </el-card>-->
 
       <el-table
           border
@@ -200,7 +200,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 
   mittBus.on("station.refresh", () => {

+ 1 - 1
admin-web/src/views/admin/user/index.vue

@@ -187,7 +187,7 @@ onMounted(() => {
   nextTick(() => {
     let bodyHeight = document.body.clientHeight;
     let queryHeight = queryRef.value.$el.clientHeight;
-    state.tableData.height = bodyHeight - queryHeight - 220
+    state.tableData.height = bodyHeight - queryHeight - 320
   })
 
   mittBus.on("adminUser.refresh", () => {

+ 2 - 0
admin-web/src/views/login/index.vue

@@ -78,6 +78,8 @@ onMounted(() => {
   text-align: right;
 	//background: var(--el-color-white);
   background-image: url("/@/assets/login-bg.png");
+  background-position: center;
+  background-size: cover;
 	.login-left {
     position: relative;
 		background-color: rgba(211, 239, 255, 1);

+ 8 - 0
entity/src/main/java/com/kym/entity/admin/queryParams/CommonQueryParam.java

@@ -29,4 +29,12 @@ public class CommonQueryParam extends PageParams {
      * 状态
      */
     private Object status;
+    /**
+     * 商户订单号
+     */
+    private String outTradeNo;
+    /**
+     * 微信订单号
+     */
+    private String transactionId;
 }

+ 4 - 3
entity/src/main/java/com/kym/entity/admin/queryParams/CustomChargeOrdersQueryParam.java

@@ -2,7 +2,8 @@ package com.kym.entity.admin.queryParams;
 
 import lombok.Data;
 
-import java.time.LocalDate;
+import java.time.LocalDateTime;
+
 
 /**
  * @author skyline
@@ -50,11 +51,11 @@ public class CustomChargeOrdersQueryParam extends PageParams {
     /**
      * 查询开始日期
      */
-    private LocalDate startDate;
+    private LocalDateTime startDate;
     /**
      * 查询结束日期
      */
-    private LocalDate endDate;
+    private LocalDateTime endDate;
 
 
 }

+ 7 - 1
mapper/src/main/resources/mappers/miniapp/PayLogMapper.xml

@@ -53,9 +53,15 @@
         t_pay_log t1
         LEFT JOIN t_user t2
         ON t1.`user_id` = t2.`id`
-        <if test="params.mobilePhone != null">
+        <if test="params.mobilePhone != null and params.mobilePhone!=''">
             where t2.mobile_phone = ${params.mobilePhone}
         </if>
+        <if test="params.transactionId != null and params.transactionId!=''">
+            where t1.transaction_id = ${params.transactionId}
+        </if>
+        <if test="params.outTradeNo != null and params.outTradeNo!=''">
+            where t1.out_trade_no = ${params.outTradeNo}
+        </if>
     </select>
 
 </mapper>