菜品菜谱导入

This commit is contained in:
zzyuan 2025-05-07 17:37:22 +08:00
parent 1a32000211
commit c660e84b8a
10 changed files with 347 additions and 148 deletions

Binary file not shown.

View File

@ -131,7 +131,17 @@ export function removeMenuDishesApi(data) {
}
// 菜品列表-导入
export function importMenuDishesApi(data) {
return request({
url: '/smart-canteen/menu_dishes/import/dishes',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -140,9 +140,17 @@ export function getMenuRecipeTemplateDetailApi(data) {
}
export function menuUpLoadApi(param){
const formData = new FormData()
formData.append('file', param.file)
formData.append('recipeId', param.recipeId)
return request({
url: '/smart-canteen/menu_recipe/recipe/import/dishes',
method: 'post',
data: formData,
header:'multipart/form-data'
})
}

View File

@ -29,7 +29,7 @@
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData1" height="550" ref="multipleTable1" :row-key="(row)=>{return row.tradeId}" @selection-change="handleSelectionChange1">
<el-table v-loading="loading" :data="tableListData1" height="550">
<!-- <el-table-column type="selection" width="50" align="center" :reserve-selection="true" /> -->
<el-table-column label="序号" align="center" width="100" type="index" >
<template scope="scope">
@ -179,14 +179,9 @@
"endDateTime":this.formatDate(this.dateRange[1])
}
param.type=1
this.tableListData1 = []
this.total1 = 0
accCardHistoryListApi(param).then(response => {
this.tableListData1 = response.rows;
this.total1 = Number(response.total);
// if(this.tableListData1.length>0){
// this.tableListData1.push(response.data.sumVO)
// }
this.loading = false;
}).catch(() => {
this.loading = false;

View File

@ -989,6 +989,79 @@
</div>
</el-dialog>
<!-- 批量导入预览 -->
<el-dialog title="批量导入预览" :visible.sync="openResult" width="1200px" append-to-body>
<div style="font-weight: 600;" v-if="resultData.successList&&resultData.errorList">导入的表格分析结果: (总笔数: {{ resultData.successList.length+resultData.errorList.length }} 无效的笔数{{resultData.errorList.length}})</div>
<div style="font-weight: 600;color: #42d885;">导入成功</div>
<el-table :data="resultData.successList" height="300">
<el-table-column label="序号" type="index" width="60" :show-overflow-tooltip="true"/>
<el-table-column label="菜品名称" align="center" prop="dishesName" :show-overflow-tooltip="true"/>
<el-table-column label="菜品价格" align="center" key="price" prop="price" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="菜品类型" align="center" prop="dishesTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="原材料" align="center" prop="menuMaterialNames" :show-overflow-tooltip="true"/>
<el-table-column label="销售方式" align="center" prop="salesMode" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
<span v-if="scope.row.salesMode==2">称重</span>
</template>
</el-table-column>
<el-table-column label="称重单位" align="center" prop="unitPrice" :show-overflow-tooltip="true"/>
<el-table-column label="规格类型" align="center" prop="sizeType" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.sizeType==1">标准</span>
<span v-if="scope.row.sizeType==2">大小份</span>
</template>
</el-table-column>
<el-table-column label="标准份量" align="center" prop="weight" :show-overflow-tooltip="true"/>
<el-table-column label="大份单价" align="center" prop="largePrice" :show-overflow-tooltip="true"/>
<el-table-column label="大份份量" align="center" prop="largeWeight" :show-overflow-tooltip="true"/>
<el-table-column label="小份单价" align="center" prop="littlePrice" :show-overflow-tooltip="true"/>
<el-table-column label="小份份量" align="center" prop="littleWeight" :show-overflow-tooltip="true"/>
<el-table-column label="区域名称" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true"/>
<el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true"/>
<el-table-column label="灶类" align="center" prop="cookName" :show-overflow-tooltip="true"/>
</el-table>
<div style="font-weight: 600;color: red;">导入错误</div>
<el-table :data="resultData.errorList" height="300">
<el-table-column label="序号" type="index" width="60" :show-overflow-tooltip="true"/>
<el-table-column label="失败原因" align="center" prop="failReason" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="菜品名称" align="center" prop="dishesName" :show-overflow-tooltip="true"/>
<el-table-column label="菜品价格" align="center" key="price" prop="price" :show-overflow-tooltip="true"/>
<el-table-column label="菜品类型" align="center" prop="dishesTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="原材料" align="center" prop="menuMaterialNames" :show-overflow-tooltip="true"/>
<el-table-column label="销售方式" align="center" prop="salesMode" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.salesMode==1">按份</span>
<span v-if="scope.row.salesMode==2">称重</span>
</template>
</el-table-column>
<el-table-column label="称重单位" align="center" prop="unitPrice" :show-overflow-tooltip="true"/>
<el-table-column label="规格类型" align="center" prop="sizeType" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="scope.row.sizeType==1">标准</span>
<span v-if="scope.row.sizeType==2">大小份</span>
</template>
</el-table-column>
<el-table-column label="标准份量" align="center" prop="weight" :show-overflow-tooltip="true"/>
<el-table-column label="大份单价" align="center" prop="largePrice" :show-overflow-tooltip="true"/>
<el-table-column label="大份份量" align="center" prop="largeWeight" :show-overflow-tooltip="true"/>
<el-table-column label="小份单价" align="center" prop="littlePrice" :show-overflow-tooltip="true"/>
<el-table-column label="小份份量" align="center" prop="littleWeight" :show-overflow-tooltip="true"/>
<el-table-column label="区域名称" align="center" prop="areaName" :show-overflow-tooltip="true"/>
<el-table-column label="所属食堂" align="center" prop="canteenName" :show-overflow-tooltip="true"/>
<el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true"/>
<el-table-column label="灶类" align="center" prop="cookName" :show-overflow-tooltip="true"/>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmUpdateList" v-if="resultData.successList&&resultData.successList.length>0">确认导入数据</el-button>
<!-- <el-button type="primary" @click="confirmBatchEdit" v-else> </el-button> -->
<el-button @click="openResult=false"> </el-button>
</div>
</el-dialog>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
@ -1000,7 +1073,7 @@
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { menuDishesTypeAllListApi,addMenuDishesTypeApi, editMenuDishesTypeApi, removeMenuDishesTypeApi} from "@/api/dish/dish";//
import { getMenuDishesListApi,addMenuDishesApi, editMenuDishesApi,menuDishesDetailApi,removeMenuDishesApi } from "@/api/dish/dish";
import { getMenuDishesListApi,addMenuDishesApi, editMenuDishesApi,menuDishesDetailApi,removeMenuDishesApi,importMenuDishesApi } from "@/api/dish/dish";
import { getDishesTypeListApi } from "@/api/dish/dish";
import { getMaterialListApi } from "@/api/dish/material";
import { imgUpLoadTwo } from '@/api/system/upload'
@ -1157,6 +1230,8 @@
},
materialList:[],
materialOptions:[],
openResult:false,
resultData:{}
};
},
created() {
@ -1675,10 +1750,26 @@
console.log(response)
this.upload.isUploading = false
this.$refs.upload.clearFiles()
this.$modal.msgSuccess("后台导入中,请稍后刷新列表!");
this.getList()
if(response.code==200){
this.resultData=response.data
this.openResult=true
}else{
this.$modal.msgError("导入校验失败,请重新选择文件!");
}
},
confirmUpdateList(){
console.log(this.resultData)
importMenuDishesApi(this.resultData.successList).then(response => {
if(response.code==200){
this.openResult=false
this.$modal.msgSuccess("导入完成");
this.getList()
}else{
this.$modal.msgError(response.msg);
}
}).catch(() => {});
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/glweb/template/批量新增菜品模板.xlsx';

View File

@ -114,7 +114,7 @@
<!-- 选择菜品 -->
<el-dialog title="选择菜品" :visible.sync="openDishes" width="90%" append-to-body >
<div style="width: 100%;height:620px;display: flex;align-items: center;color: #000;">
<div style="width: 100%;height:640px;display: flex;align-items: center;color: #000;">
<div class="dialog-left">
<div>已选菜品数量{{dishesList.length}}</div>
<div>
@ -138,19 +138,18 @@
<div style="font-weight: bold;margin: 10px 0;">菜品名称</div>
<el-input v-model="queryDish.dishesName" placeholder="请输入菜品名称" maxlength="30" clearable @input="getDishesPage"/>
</div>
<div style="margin-top: 20px;">
<el-card style="width: 100%;height: 360px;">
<div style="padding-top: 20px;">
<el-card style="width: 100%;height: 380px;">
<div slot="header">
<span>菜品</span>
</div>
<div style="width: 100%;height: 350px;overflow-y: auto;">
<div style="width: 100%;height: 320px;overflow-y: auto;">
<div v-for="item in dishesPageList" :key="item.dishesId" class="dish-name" @click="chosenDishes(item)">
<span v-if="item.sizeType==1">标准</span>
<span v-if="item.sizeType==2">大小份</span>
<span>{{ item.dishesName }}</span>
<i class="el-icon-check" v-if="item.isChecked"></i>
</div>
</div>
</el-card>
</div>
@ -163,7 +162,7 @@
</div>
</div>
<div class="dialog-right">
<el-table :data="dishesTableList" height="450">
<el-table :data="dishesTableList" height="620">
<el-table-column label="菜品编号" align="center" prop="dishesNum" />
<el-table-column label="菜品名称" align="center" prop="dishesName" />
<el-table-column label="所属食堂" align="center" prop="canteenName" />
@ -860,7 +859,7 @@ export default {
getDishesByTypePageApi(param).then((response) => {
// console.log(response)
this.dishesPageList = response.rows;
for(let i =0 ;i < this.dishesList.length ;i++){
for(let i =0 ;i < this.dishesList.length;i++){
this.dishesPageList.forEach(item=>{
if(item.dishesId==this.dishesList[i].dishesId){
item.isChecked=true

View File

@ -139,11 +139,11 @@
<el-input v-model="queryDish.dishesName" placeholder="请输入菜品名称" maxlength="30" clearable @input="getDishesPage"/>
</div>
<div style="margin-top: 20px;">
<el-card style="width: 100%;height: 360px;">
<el-card style="width: 100%;height: 380px;">
<div slot="header">
<span>菜品</span>
</div>
<div style="width: 100%;height: 350px;overflow-y: auto;">
<div style="width: 100%;height: 320px;overflow-y: auto;">
<div v-for="item in dishesPageList" :key="item.dishesId" class="dish-name" @click="chosenDishes(item)">
<span v-if="item.sizeType==1">标准</span>
<span v-if="item.sizeType==2">大小份</span>
@ -163,7 +163,7 @@
</div>
</div>
<div class="dialog-right">
<el-table :data="dishesTableList" height="450">
<el-table :data="dishesTableList" height="620">
<el-table-column label="菜品编号" align="center" prop="dishesNum" />
<el-table-column label="菜品名称" align="center" prop="dishesName" />
<el-table-column label="所属食堂" align="center" prop="canteenName" />

View File

@ -78,10 +78,10 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="区域名称" align="center" prop="areaName" fixed="left" width="150"/>
<el-table-column label="食堂名称" align="center" prop="canteenName" fixed="left" width="150"/>
<el-table-column label="档口名称" align="center" prop="stallName" fixed="left" width="150"/>
<el-table-column label="菜谱名称" align="center" prop="recipeName" width="200">
<el-table-column label="区域名称" align="center" prop="areaName" :show-overflow-tooltip="true" fixed="left" width="120"/>
<el-table-column label="食堂名称" align="center" prop="canteenName" :show-overflow-tooltip="true" fixed="left" width="120"/>
<el-table-column label="档口名称" align="center" prop="stallName" :show-overflow-tooltip="true" fixed="left" width="150"/>
<el-table-column label="菜谱名称" align="center" prop="recipeName" :show-overflow-tooltip="true" width="200">
<template slot-scope="scope">
<div style="display: flex;align-items: center;justify-content: center;" v-if="activeName=='currentRecipe'">
<span v-if="scope.row.recipeId">{{scope.row.recipeName}}</span>
@ -100,21 +100,38 @@
</template>
</el-table-column>
<el-table-column v-for="item in mealTimeList" :key="item.mealtimeType" :label="item.mealtimeName" align="center" v-if="activeName=='currentRecipe'" width="200">
<el-table-column v-for="item in mealTimeList" :key="item.mealtimeType" :label="item.mealtimeName" :show-overflow-tooltip="true" align="center" v-if="activeName=='currentRecipe'" width="140">
<template slot-scope="scope">
<div v-if="scope.row.detail">
<div v-for="subItem in scope.row.detail.details" :key="subItem.detailId">
<div v-if="subItem.mealtimeType==item.mealtimeType">
<div v-for="(lastItem,index) in subItem.dishesList" :key="lastItem.dishesId">
<div v-if="index<4">{{ lastItem.dishesName }}</div>
<div v-if="index==4">...</div>
<el-tooltip placement="top">
<div slot="content">
<div v-if="scope.row.detail">
<div v-for="subItem in scope.row.detail.details" :key="subItem.detailId">
<div v-if="subItem.mealtimeType==item.mealtimeType" style="display: flex;max-width: 320px;flex-wrap: wrap;">
<div v-for="(lastItem) in subItem.dishesList" :key="lastItem.dishesId">
<div>{{ lastItem.dishesName }}; </div>
</div>
</div>
</div>
</div>
<div v-else>
<span>无菜品</span>
</div>
</div>
<div v-if="scope.row.detail">
<div v-for="subItem in scope.row.detail.details" :key="subItem.detailId">
<div v-if="subItem.mealtimeType==item.mealtimeType">
<div v-for="(lastItem,index) in subItem.dishesList" :key="lastItem.dishesId">
<div v-if="index<4">{{ lastItem.dishesName }}</div>
<div v-if="index==4">...</div>
</div>
</div>
</div>
</div>
</div>
<div v-else>
<span>无菜品</span>
</div>
<div v-else>
<span>无菜品</span>
</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column label="菜谱更新时间" align="center" prop="uptime" width="150" v-if="activeName=='currentRecipe'"/>
@ -145,17 +162,18 @@
</el-table-column>
<el-table-column label="用户范围" align="center" prop="effName" v-if="activeName=='pageRecipe'"/>
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right" v-if="activeName=='currentRecipe'&&queryParams.key=='2'" >
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" v-if="activeName=='currentRecipe'" >
<template slot-scope="scope">
<el-button
size="mini"
type="text"
type="text" v-if="queryParams.key=='2'"
@click="handleDevice(scope.row)"
>设备详情</el-button>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width" fixed="right" v-if="activeName=='pageRecipe'">
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right" v-if="activeName=='pageRecipe'">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@ -168,6 +186,11 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button
size="mini"
type="text" v-if="scope.row.recipeType==1"
@click="handleImport(scope.row)"
>导入</el-button>
</template>
</el-table-column>
</el-table>
@ -205,7 +228,38 @@
</div>
</el-dialog>
<el-dialog title="批量导入" :visible.sync="openUpload" width="500px" append-to-body>
<div style="font-weight: 600;margin-bottom: 10px;">说明请按下载的模板填写数据并导入</div>
<div style="width: 80%;display: flex;align-items: center;justify-content: space-between;">
<span>1下载模板按规范填写信息</span>
<el-button
size="mini" type="text"
@click="importTemplate"
style="margin-left: 40px;"
>模板下载
</el-button>
</div>
<div style="width: 80%;display: flex;align-items: center;justify-content: space-between;">
<span>2上传文件</span>
<el-upload
ref="upload"
:http-request="fileUpLoad"
action="#"
:limit="1"
accept=".xlsx, .xls"
:show-file-list="false"
>
<el-button
type="text"
size="mini"
>上传导入
</el-button>
</el-upload>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="openUpload=false"> </el-button>
</div>
</el-dialog>
</div>
@ -214,7 +268,9 @@
<script>
import { systemAreaTreeApi,getCanteenByAreaApi,getStallByCanteenApi } from "@/api/base/stall";
import { mealTimeListApi,menuTypeListApi } from "@/api/dish/menu";
import { getCurrentRecipeListApi, getPageRecipeListApi,removeMenuRecipeApi,unbindMenuRecipeApi } from "@/api/dish/menu";
import { getCurrentRecipeListApi, getPageRecipeListApi,removeMenuRecipeApi,unbindMenuRecipeApi,menuUpLoadApi } from "@/api/dish/menu";
import { getToken } from '@/utils/auth'
import { downloadFileByUrl } from '@/utils/download'
export default {
name: "",
dicts: [],
@ -275,6 +331,17 @@
{ required: true, message: "菜谱名称不能为空", trigger: "change" }
]
},
//
upload: {
//
isUploading: false,
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/smart-canteen/menu_recipe/recipe/import/dishes',
},
uploadRow:{},
openUpload:false
};
},
created() {
@ -584,6 +651,32 @@
});
},
/** 修改按钮操作 */
handleImport(row) {
this.uploadRow = row
this.openUpload = true
},
fileUpLoad(param){
param.recipeId = this.uploadRow.recipeId
menuUpLoadApi(param).then((res) => {
if (res.code == 200) {
this.$modal.msgSuccess("操作成功");
this.openUpload = false;
this.getList()
} else {
this.$modal.msgError(res.msg);
}
}).catch((error) => {
this.$modal.msgError(error)
})
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/glweb/template/导入菜谱模板.xlsx';
downloadFileByUrl(url)
},
}
};
</script>

View File

@ -44,74 +44,38 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="组织全称" align="center" prop="deptFullName" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="组织全称" align="center" prop="deptFullName" :show-overflow-tooltip="true"/>
<el-table-column label="上期余额" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<el-table-column label="上期余额" align="center" prop="lastWalletBal" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
<span>{{ (scope.row.lastWalletBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="账户总收入" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="其他总收入" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="账户总支出" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="其他总支出" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="账户余额" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="收入" align="center" prop="income" :show-overflow-tooltip="true" width="100">
<el-table-column label="账户总收入" align="center" prop="income" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.income/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="支出" align="center" prop="outcome" :show-overflow-tooltip="true" width="100">
<el-table-column label="其他总收入" align="center" prop="otherIncome" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.otherIncome/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="账户总支出" align="center" prop="outcome" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.outcome/100).toFixed(2) }}</span>
</template>
</el-table-column> -->
<!-- <el-table-column label="交易时间" align="center" prop="tradeTime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="交易类型" align="center" prop="tradeType" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.tradeType==10">充值</span>
<span v-if="scope.row.tradeType==20">补贴</span>
<span v-if="scope.row.tradeType==30">提现</span>
<span v-if="scope.row.tradeType==100">清空</span>
<span v-if="scope.row.tradeType==110">消费</span>
<span v-if="scope.row.tradeType==130">消费退款</span>
</template>
</el-table-column>
<el-table-column label="支付方式" align="center" prop="payType" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.payType==1">账户支付</span>
<span v-if="scope.row.payType==2">现金支付</span>
<span v-if="scope.row.payType==3">餐券支付</span>
<span v-if="scope.row.payType==4">设备现金支付</span>
<span v-if="scope.row.payType==5">补贴支付</span>
<span v-if="scope.row.payType==6">红包支付</span>
</template>
<el-table-column label="其他总支出" align="center" prop="otherOutcome" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.otherOutcome/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="账户余额" align="center" prop="walletBal" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.walletBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="设备编号" align="center" prop="machineSn" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作员" align="center" prop="createBy" :show-overflow-tooltip="true" width="100"/> -->
<!-- <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">

View File

@ -47,56 +47,39 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="用户编号" align="center" prop="userId" :show-overflow-tooltip="true" width="120" fixed="left"/>
<el-table-column label="用户姓名" align="center" prop="userName" :show-overflow-tooltip="true" width="120" fixed="left"/>
<el-table-column label="用户手机号" align="center" prop="phonenumber" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="组织全称" align="center" prop="deptFullName" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="用户类别" align="center" prop="userType" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_user_type" :value="scope.row.userType"/>
</template>
<el-table-column label="用户编号" align="center" prop="userId" :show-overflow-tooltip="true" width="120" />
<el-table-column label="用户姓名" align="center" prop="nickName" :show-overflow-tooltip="true" width="120" />
<el-table-column label="用户手机号" align="center" prop="phonenumber" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="上期余额" align="center" prop="lastWalletBal" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.lastWalletBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="收入" align="center" prop="income" :show-overflow-tooltip="true" width="100">
<el-table-column label="本期余额" align="center" prop="walletBalNow" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ (scope.row.walletBalNow/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="总收入" align="center" prop="income" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.income/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="支出" align="center" prop="outcome" :show-overflow-tooltip="true" width="100">
<el-table-column label="总支出" align="center" prop="outcome" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.outcome/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="账户余额" align="center" prop="accAllBal" :show-overflow-tooltip="true" width="100">
<el-table-column label="账户余额" align="center" prop="walletBal" :show-overflow-tooltip="true" >
<template slot-scope="scope">
<span>{{ (scope.row.accAllBal/100).toFixed(2) }}</span>
<span>{{ (scope.row.walletBal/100).toFixed(2) }}</span>
</template>
</el-table-column>
<el-table-column label="交易时间" align="center" prop="tradeTime" :show-overflow-tooltip="true" width="160"/>
<el-table-column label="交易类型" align="center" prop="tradeType" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.tradeType==10">充值</span>
<span v-if="scope.row.tradeType==20">补贴</span>
<span v-if="scope.row.tradeType==30">提现</span>
<span v-if="scope.row.tradeType==100">清空</span>
<span v-if="scope.row.tradeType==110">消费</span>
<span v-if="scope.row.tradeType==130">消费退款</span>
</template>
</el-table-column>
<el-table-column label="支付方式" align="center" prop="payType" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.payType==1">账户支付</span>
<span v-if="scope.row.payType==2">现金支付</span>
<span v-if="scope.row.payType==3">餐券支付</span>
<span v-if="scope.row.payType==4">设备现金支付</span>
<span v-if="scope.row.payType==5">补贴支付</span>
<span v-if="scope.row.payType==6">红包支付</span>
</template>
</el-table-column>
<el-table-column label="设备编号" align="center" prop="machineSn" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作员" align="center" prop="createBy" :show-overflow-tooltip="true" width="100"/>
<!-- <el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -104,7 +87,7 @@
@click="handleView(scope.row)"
>详情</el-button>
</template>
</el-table-column> -->
</el-table-column>
</el-table>
<pagination
@ -114,12 +97,60 @@
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog title="查看" :visible.sync="openView" width="800px" append-to-body>
<div style="width: 100%;height: 300px;overflow-y: auto;">
<el-descriptions class="margin-top" title="" :column="2" size="small" border>
<el-descriptions-item>
<template slot="label">组织全称</template>
{{ rowData.deptFullName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户姓名</template>
{{ rowData.nickName }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户编号</template>
{{rowData.userId}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">用户手机号</template>
{{ rowData.phonenumber }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">上期余额</template>
{{ (rowData.lastWalletBal/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">本期余额</template>
{{ (rowData.walletBalNow/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">总收入</template>
{{ (rowData.income/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">总支出</template>
{{ (rowData.outcome/100).toFixed(2) }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">账户余额</template>
{{ (rowData.walletBal/100).toFixed(2) }}
</el-descriptions-item>
</el-descriptions>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="openView=false"> </el-button>
<el-button @click="openView=false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { deptTreeSelect } from '@/api/system/user'
import { reportTradFlowListApi } from "@/api/reportCenter/index";
import { reportUserIncomeListApi } from "@/api/reportCenter/index";
export default {//
name: "",
dicts: ['sys_user_type'],
@ -181,6 +212,8 @@ export default {//交易流水
deptIdList:[],
searchValue:null
},
rowData:{},
openView:false,
};
},
created() {
@ -231,12 +264,18 @@ export default {//交易流水
"startDateTime":this.formatDate(this.dateRange[0]),
"endDateTime":this.formatDate(this.dateRange[1])
}
reportTradFlowListApi(param).then(response => {
reportUserIncomeListApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
handleView(row){
this.rowData = row;
this.openView = true
},
defaultDateRange() {
const end = new Date(new Date().toLocaleDateString());
end.setTime(end.getTime() + 24 * 60 * 60 * 1000 - 1);