Преглед на файлове

管理后台优化修改

zuypeng преди 1 година
родител
ревизия
e4fef243b8

+ 3 - 0
admin-web/src/components/form/ExtQueryForm.vue

@@ -94,6 +94,9 @@
                 :query="field.conf?.query"
                 :multiple="field.conf?.multiple"
                 :placeholder="field.placeholder"
+                :label-key="field.conf?.labelKey"
+                :value-key="field.conf?.valueKey"
+                :data-key="field.conf?.dataKey"
                 style="width: 100%"
                 @on-change="onQueryChange">
             </ext-select>

+ 20 - 29
admin-web/src/views/admin/finance/splitRecord.vue

@@ -33,8 +33,8 @@
           ref="queryRef"
           size="default" label-width="0px" class="mt5 mb5">
         <ext-select
-            v-model="state.formQuery.fromStationId"
-            placeholder="入账站点"
+            v-model="state.formQuery.stationId"
+            placeholder="选择站点"
             url="washStation/list"
             url-method="post"
             label-key="stationName"
@@ -44,17 +44,6 @@
             class="wd200 ml10">
         </ext-select>
 
-        <ext-select
-            v-model="state.formQuery.toStationId"
-            placeholder="出账站点"
-            url="washStation/list"
-            url-method="post"
-            label-key="stationName"
-            value-key="stationId"
-            data-key="list"
-            clearable
-            class="wd200 ml10">
-        </ext-select>
 
         <el-input
             v-model="state.formQuery.tradeNo"
@@ -130,21 +119,25 @@
               {{ u.fmt.fmtDateTime(row[field.prop]) }}
             </template>
             <template v-else-if="'toStationId'===field.prop">
-              <div>
-                {{ row.toStationId }}
-              </div>
-              <hr/>
-              <div>
-                {{ row.toStationName }}
+              <div class="flex-align-items-center text-align-center">
+                <div>
+                  {{ row.toStationId }}
+                </div>
+                <hr/>
+                <div>
+                  {{ row.toStationName }}
+                </div>
               </div>
             </template>
             <template v-else-if="'fromStationId'===field.prop">
-              <div>
-                {{ row.fromStationId }}
-              </div>
-              <hr/>
-              <div>
-                {{ row.fromStationName }}
+              <div class="flex-align-items-center text-align-center">
+                <div>
+                  {{ row.fromStationId }}
+                </div>
+                <hr/>
+                <div>
+                  {{ row.fromStationName }}
+                </div>
               </div>
             </template>
             <template v-else>
@@ -152,7 +145,6 @@
             </template>
 
 
-
           </template>
         </el-table-column>
       </el-table>
@@ -183,7 +175,6 @@ import ExtDSelect from "/@/components/form/ExtDSelect.vue";
 import ExtDLabel from "/@/components/form/ExtDLabel.vue";
 
 
-
 //定义引用
 const queryRef = ref();
 
@@ -204,8 +195,8 @@ const state = reactive({
   exportConfig: {},
   columns: [
     // {type: 'selection', width: 60, align: 'center', fixed: 'left'},
-    {label: '入账站点ID/名称', prop: 'toStationId', width: 200,align:'center', resizable: true, fixed: 'left'},
-    {label: '出账站点ID/名称', prop: 'fromStationId', width: 200,align:'center', resizable: true, fixed: 'left'},
+    {label: '入账站点ID/名称', prop: 'toStationId', width: 200, align: 'center', resizable: true, fixed: 'left'},
+    {label: '出账站点ID/名称', prop: 'fromStationId', width: 200, align: 'center', resizable: true, fixed: 'left'},
     // {label: '状态', prop: 'status', sortable: 'custom', align: 'center', query: true, width: 120, conf: {dict: 'SplitRecord.status'}},
     {label: '分账交易金额(元)', width: 180, prop: 'amount', query: true, type: '', resizable: true},
     {label: '分账交易流水号', width: 280, prop: 'tradeNo', query: true, type: 'text', resizable: true},

+ 12 - 1
admin-web/src/views/admin/ordering/index.vue

@@ -98,6 +98,17 @@
                 </el-table>
               </div>
             </template>
+            <template v-else-if="'stationId'===field.prop">
+              <div class="flex-align-items-center text-align-center">
+                <div>
+                  {{ row.stationId }}
+                </div>
+                <hr/>
+                <div>
+                  {{ row.stationName }}
+                </div>
+              </div>
+            </template>
             <template v-else-if="field.prop==='discountType'">
               <ext-d-label type="Activity.discountType" :model-value="row[field.prop]"></ext-d-label>
             </template>
@@ -187,9 +198,9 @@ const state = reactive({
   exportConfig: {},
   columns: [
     {type: 'expand', width: 60, align: 'center', fixed: 'left'},
+    {label: '站点', prop: 'stationId', width: 140,query: true, type: 'select', resizable: true,conf:{url:'washStation/list',labelKey:'stationName',valueKey:'stationId',dataKey:'list'}},
     {width: 220, label: '订单号', prop: 'orderId', query: true, type: 'text', resizable: true, fixed: 'left'},
     {width: 120, label: '用户手机号', prop: 'mobilePhone', query: true, type: 'text', fixed: 'left'},
-    {width: 140, label: '站点名称', prop: 'stationName', query: false, type: 'text', resizable: true},
     {width: 100, label: '设备编号', prop: 'shortId', query: false, type: 'text', resizable: true},
     {width: 160, label: '开始时间', prop: 'startTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDate(val)}},
     {width: 160, label: '结束时间', prop: 'endTime', query: false, sortable: 'custom', type: 'datetime', resizable: true, conf: {format: (val: any) => u.fmt.fmtDateTime(val)}},

+ 40 - 7
admin-web/src/views/admin/station/device/index.vue

@@ -35,10 +35,11 @@
           @on-change="loadData(true)"
           @imported="loadData(true)">
         <template #extQuery>
-          <el-button  v-auth="'washDevice.add'"   size="default" plain  type="success" class="ml10" @click="handleRowClick('add',null)">
+          <el-button v-auth="'washDevice.add'" size="default" plain type="success" class="ml10" @click="handleRowClick('add',null)">
             <SvgIcon name="ele-FolderAdd"/>
             新增
-          </el-button></template>
+          </el-button>
+        </template>
         <!--  <template #extraQuery></template>
           <template #extraLeft></template>
           <template #extraRight></template>-->
@@ -56,7 +57,7 @@
       <ext-page class="page-pager" v-model:value="state.pageQuery" @change="loadData(false)"/>
     </el-card>
   </div>
-    <DeviceDialog ref="device_dialog_ref" @refresh="loadData(true)"/>
+  <DeviceDialog ref="device_dialog_ref" @refresh="loadData(true)"/>
 </template>
 
 <script setup lang="ts" name="adminStationDevice">
@@ -100,18 +101,41 @@ const state = reactive({
   exportConfig: {},
   columns: [
     // {type: 'selection', width: 60, align: 'center', fixed: 'left'},
-    {label: '站点ID', prop: 'stationId', width: 80,query: true, type: 'text', resizable: true},
-    {label: '站点名称', prop: 'stationName', width: 150,query: true, type: 'text', resizable: true},
+
+    {
+      label: '站点',
+      prop: 'stationId',
+      width: 80,
+      query: true,
+      type: 'select',
+      hide: true,
+      resizable: true,
+      conf: {url: 'washStation/list', labelKey: 'stationName', valueKey: 'stationId', dataKey: 'list'}
+    },
     {label: '设备编号', prop: 'shortId', width: 100, query: true, type: 'text', resizable: true, fixed: 'left'},
+    {
+      label: '站点名称', prop: 'stationName', width: 180, query: false, type: 'render', resizable: true,
+      render: (h: any, row: any, rowData: any) => {
+        return (
+            h('div', {
+              class: 'flex-align-items-center text-align-center'
+            }, [
+              h("div", {}, rowData.stationId),
+              h("hr"),
+              h("div", {}, rowData.stationName)
+            ])
+        )
+      }
+    },
     // {label: '设备名称', prop: 'deviceName', width: 180, query: true, type: 'text', resizable: true, fixed: 'left'},
     // {label: '产品key', prop: 'productKey', width: 180, query: true, type: 'text', resizable: true},
-    {label: '状态', prop: 'state', width: 90,query: true, type: 'dict', conf: {dict: 'WashDevice.status'}, resizable: true},
+    {label: '状态', prop: 'state', width: 90, query: true, type: 'dict', conf: {dict: 'WashDevice.status'}, resizable: true},
     // {label: '设备状态', prop: 'fsmState', width: 90, query: true, type: 'text', resizable: true},
     {
       label: '运行时长', prop: 'uptimeMs', width: 100, query: false, type: 'render', resizable: true,
       render: (h: any, row: any) => {
         return (
-            h('div', null,u.fmt.fmtDuration(row))
+            h('div', null, u.fmt.fmtDuration(row))
         )
       }
     },
@@ -135,6 +159,15 @@ const state = reactive({
                       handleRowClick('edit', row)
                     }
                   }, () => '编辑') : '',
+              proxy.$auth('washDevice.modify') ?
+                  h(ElButton, {
+                    type: 'primary',
+                    text: true,
+                    size: 'small',
+                    onClick: () => {
+                      // handleRowClick('edit', row)
+                    }
+                  }, () => '结算') : '',
               proxy.$auth('washDevice.remove') ?
                   h(ElButton, {
                     type: 'danger',

+ 9 - 2
car-wash-service/src/main/java/com/kym/service/impl/WashOrderServiceImpl.java

@@ -3,6 +3,7 @@ package com.kym.service.impl;
 import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
 import com.github.yulichang.toolkit.JoinWrappers;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
 import com.kym.common.exception.BusinessException;
@@ -156,12 +157,18 @@ public class WashOrderServiceImpl extends MyBaseServiceImpl<WashOrderMapper, Was
                 .eq(WashOrder::getUserId, StpUtil.getLoginIdAsLong())
                 .orderByDesc(WashOrder::getId)
                 .list();
-        var voList = res.stream().map(order -> {
+        PageInfo<WashOrder> pages =new PageInfo<>(res);
+        var voList = pages.getList().stream().map(order -> {
             var vo = new WashOrderVo();
             BeanUtils.copyProperties(order, vo);
             return vo;
         }).toList();
-        return new PageBean<>(voList);
+        PageBean<WashOrderVo> bean= new PageBean<>(voList);
+        bean.setPages(pages.getPages());
+        bean.setPageNum(pages.getPageNum());
+        bean.setPageSize(pages.getPageSize());
+        bean.setTotal(pages.getTotal());
+        return bean;
     }