修改 bug

This commit is contained in:
zhaohengkun 2024-10-10 19:49:45 +08:00
parent 3bc9fcf7ae
commit 1926125bc2
2 changed files with 298 additions and 198 deletions

View File

@ -16,17 +16,16 @@
<!-- <el-form-item label="" style="width: 180px">-->
<!-- <el-input placeholder="请输入商品名称" v-model="queryParams.orderNo"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="" prop="payChannel" style="width: 180px">-->
<!-- <el-select-->
<!-- v-model="queryParams.payChannel"-->
<!-- clearable-->
<!-- placeholder="订单类型"-->
<!-- >-->
<!-- <el-option label="小程序" value="applet"/>-->
<!-- <el-option label="收银台" value="cashier"/>-->
<!-- <el-option label="POS端" value="POS"/>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="" prop="payChannel" style="width: 180px">
<el-select
v-model="queryParams.orderType"
clearable
placeholder="订单类型"
>
<el-option label="商城兑换" value="0"/>
<el-option label="收银台兑换" value="1"/>
</el-select>
</el-form-item>
<el-form-item label="" prop="payType" style="width: 180px">
<el-select
v-model="queryParams.paymentType"
@ -83,7 +82,7 @@
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column prop="storeName" align="center" label="机构名称"> </el-table-column>
<el-table-column prop="orderNumber" align="center" label="订单号" > </el-table-column>
<el-table-column prop="amount" align="center" label="订单金额(元)">
<el-table-column prop="amount" align="center" label="订单金额(元)">
<template slot-scope="scope">
<span v-if="scope.row.amount">{{scope.row.amount}}</span>
<span v-else>--</span>
@ -91,11 +90,8 @@
</el-table-column>
<el-table-column prop="payChannel" align="center" label="订单类型">
<template slot-scope="scope">
<span v-if="scope.row.payChannel=='cashier'">收银台</span>
<span v-else-if="scope.row.payChannel=='POS'">POS机</span>
<span v-else-if="scope.row.payChannel=='PC'">收银台</span>
<span v-else-if="scope.row.payChannel=='applet'">小程序</span>
<span v-else>其他</span>
<span v-if="scope.row.orderType=='1'">收银台兑换</span>
<span v-else-if="scope.row.orderType=='0'">商城兑换</span>
</template>
</el-table-column>
<el-table-column prop="paymentType" align="center" label="支付方式">
@ -238,7 +234,7 @@ import {getDuiZhangIntegralListApi} from "@/api/financialStatement/jiaoyiduizhan
this.total = response.data.total;
this.isSysDate = false
})
this.getOrderStatistics()
},
//

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<div class="card-change" >
<div class="card-change">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item label="" prop="name">
<el-input
@ -12,106 +12,111 @@
/>
</el-form-item>
<!-- <el-form-item style="float: right">-->
<!-- <el-form-item label="" prop="bannerName">-->
<!-- <el-select v-model="queryParams.systemPosition" placeholder="请选择系统位置">-->
<!-- <el-option-->
<!-- v-for="item in systemPositionList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item style="float: right">-->
<!-- <el-form-item label="" prop="bannerName">-->
<!-- <el-select v-model="queryParams.systemPosition" placeholder="请选择系统位置">-->
<!-- <el-option-->
<!-- v-for="item in systemPositionList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="" prop="bannerName">
<el-select v-model="queryParams.bannerStatus" placeholder="请选择banner图状态">
<el-option label="停用" value="0" ></el-option>
<el-option label="启用" value="1" ></el-option>
<!-- <el-option-->
<!-- v-for="item in systemPositionList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
</el-select>
</el-form-item>
<el-form-item label="" prop="bannerName">
<el-select v-model="queryParams.bannerStatus" placeholder="请选择banner图状态">
<el-option label="停用" value="0"></el-option>
<el-option label="启用" value="1"></el-option>
<!-- <el-option-->
<!-- v-for="item in systemPositionList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
</el-select>
</el-form-item>
<el-form-item style="float: right">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
v-hasPermi="['setting:banner:add']"
>新增banner图</el-button>
<el-form-item style="float: right">
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="handleAdd"
v-hasPermi="['setting:banner:add']"
>新增banner图
</el-button>
</el-form-item>
</el-form>
<!-- </el-card>-->
<!-- </el-card>-->
<!-- &lt;!&ndash; 列表信息&ndash;&gt;-->
<!-- <el-card style="margin-top: 20px" >-->
<!-- &lt;!&ndash; 列表信息&ndash;&gt;-->
<!-- <el-card style="margin-top: 20px" >-->
<div style="height: 70vh;overflow: auto">
<el-table :data="tableData" style="width: 100%;" border>
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="bannerName" label="banner名称"></el-table-column>
<el-table-column prop="productImage" label="图片">
<template slot-scope="scope">
<el-image
style="width: 50px; height: 50px"
:src="imagePath+scope.row.productImage"
:preview-src-list="[imagePath + scope.row.productImage]"
fit="cover">
</el-image>
</template>
</el-table-column>
<el-table-column prop="systemPosition" label="系统位置"></el-table-column>
<el-table-column prop="sortOrder" label="排序号"></el-table-column>
<el-table-column prop="bannerLink" label="banner图链接"></el-table-column>
<el-table-column prop="note" label="备注"></el-table-column>
<el-table-column prop="bannerStatus" label="banner图状态">
<template slot-scope="scope">
<el-switch
v-model="scope.row.bannerStatus"
active-color="#13ce66"
inactive-color="#ff4949"
@change="changeStatus(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column prop="createByName" label="创建人"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row)"
v-hasPermi="['setting:banner:edit']"
>编辑</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="del(scope.row)"
v-hasPermi="['setting:banner:delete']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="tableData" style="width: 100%;" border>
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="bannerName" label="banner名称"></el-table-column>
<el-table-column prop="productImage" label="图片">
<template slot-scope="scope">
<el-image
v-if="scope.row.productImage"
style="width: 50px; height: 50px"
:src="imagePath+scope.row.productImage"
:preview-src-list="[imagePath + scope.row.productImage]"
fit="cover"
>
</el-image>
</template>
</el-table-column>
<el-table-column prop="systemPosition" label="系统位置"></el-table-column>
<el-table-column prop="sortOrder" label="排序号"></el-table-column>
<el-table-column prop="bannerLink" label="banner图链接"></el-table-column>
<el-table-column prop="note" label="备注"></el-table-column>
<el-table-column prop="bannerStatus" label="banner图状态">
<template slot-scope="scope">
<el-switch
v-model="scope.row.bannerStatus"
active-color="#13ce66"
inactive-color="#ff4949"
@change="changeStatus(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column prop="createByName" label="创建人"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-view"
@click="edit(scope.row)"
v-hasPermi="['setting:banner:edit']"
>编辑
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="del(scope.row)"
v-hasPermi="['setting:banner:delete']"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
@ -122,23 +127,69 @@
<el-input v-model="deviceInfo.bannerName" style="width: 300px"></el-input>
</el-form-item>
<el-form-item label="图片" prop="uploadAction">
<el-upload
:action="uploadAction"
list-type="picture-card"
ref="uploadRef"
accept=".jpg, .jpeg, .png, .gif"
:class="{hide:hideUpload}"
:file-list="uploadFiles"
:auto-upload="true"
:show-file-list="false"
:headers="uploadHeader"
:on-success="handleUploadSuccessCover">
<img
v-if="this.deviceInfo.productImage"
:src="imagePath + this.deviceInfo.productImage"
class="list-img"
style="width: 750px; height: 100%"
/>
<i v-if="!this.deviceInfo.productImage" class="el-icon-plus"></i>
:action="uploadAction"
:on-success="handleSuccess"
:on-error="handleError"
:file-list="uploadFiles"
list-type="picture-card"
:disable-transition="true"
>
<i slot="default" class="el-icon-plus"></i>
<div slot="file" slot-scope="{file}">
<img
class="el-upload-list__item-thumbnail"
:src="file.url" alt=""
>
<!-- 按钮容器 -->
<span class="el-upload-list__item-actions">
<!-- 放大 -->
<span
class="el-upload-list__item-preview"
@click="handlePictureCardPreview(file)"
>
<i class="el-icon-zoom-in"></i>
</span>
<!-- 删除-->
<span
v-if="!disabled"
class="el-upload-list__item-delete"
@click="handleRemove(file)"
>
<i class="el-icon-delete"></i>
</span>
</span>
</div>
</el-upload>
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
<!-- <el-upload-->
<!-- :action="uploadAction"-->
<!-- list-type="picture-card"-->
<!-- :class="{hide:hideUpload}"-->
<!-- :file-list="uploadFiles"-->
<!-- :auto-upload="true"-->
<!-- :show-file-list="false"-->
<!-- :headers="uploadHeader"-->
<!-- :on-success="handleUploadSuccessCover">-->
<!-- <img-->
<!-- v-if="this.deviceInfo.productImage"-->
<!-- :src="imagePath + this.deviceInfo.productImage"-->
<!-- class="list-img"-->
<!-- style="width: 750px; height: 100%"-->
<!-- />-->
<!-- <i v-if="!this.deviceInfo.productImage" class="el-icon-plus"></i>-->
<!-- </el-upload>-->
</el-form-item>
<el-form-item label="系统位置" prop="systemPosition">
<el-select v-model="deviceInfo.systemPosition" placeholder="系统位置" style="width: 300px">
@ -146,7 +197,8 @@
v-for="item in systemPositionList"
:key="item.value"
:label="item.label"
:value="item.value">
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
@ -160,11 +212,12 @@
<el-switch
v-model="deviceInfo.bannerStatus"
active-color="#13ce66"
inactive-color="#ff4949">
inactive-color="#ff4949"
>
</el-switch>
</el-form-item>
<el-form-item label="备注" prop="note">
<el-input v-model="deviceInfo.note" style="width: 300px" ></el-input>
<el-input v-model="deviceInfo.note" style="width: 300px"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('deviceForm')">提交</el-button>
@ -178,14 +231,17 @@
<script>
import {deleteBannerApi, getBannerListApi, saveBannerApi, updateBannerApi} from "@/api/sys/banner";
import { deleteBannerApi, getBannerListApi, saveBannerApi, updateBannerApi } from '@/api/sys/banner'
import { getToken } from '@/utils/auth'
export default {
name: "printIndex",
name: 'printIndex',
data() {
return {
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
tableData: [],
deviceInfo: {
id: null, // id
@ -196,63 +252,92 @@ export default {
bannerLink: '', // Banner
bannerStatus: false, // Banner
note: '', //
createByName: '', //
createByName: '' //
},
systemPositionList:[ {
systemPositionList: [{
value: '系统首页',
label: '系统首页'
},],
}],
//
open: false,
title:"",
total:0,
title: '',
total: 0,
//
queryParams: {
page: 1,
pageSize: 10,
bannerName:'',
systemPosition:'系统首页',
bannerStatus:'',
bannerName: '',
systemPosition: '系统首页',
bannerStatus: ''
},
rules: {
bannerName:[
{required: true, message: '请填写banner名称', trigger: 'blur'},
bannerName: [
{ required: true, message: '请填写banner名称', trigger: 'blur' }
],
systemPosition:[
{required: true, message: '请填写系统位置', trigger: ''},
systemPosition: [
{ required: true, message: '请填写系统位置', trigger: '' }
],
sortOrder:[
{required: true, message: '请填写排序号', trigger: 'blur'},
sortOrder: [
{ required: true, message: '请填写排序号', trigger: 'blur' }
],
bannerLink:[
{required: true, message: '请填写链接', trigger: 'blur'},
],
note:[
{required: true, message: '请选择备注', trigger: 'blur'},
bannerLink: [
{ required: true, message: '请填写链接', trigger: 'blur' }
],
note: [
{ required: true, message: '请选择备注', trigger: 'blur' }
]
},
//
uploadAction: process.env.VUE_APP_BASE_API + 'backendApi/file/upload',
uploadHeader: { 'Access-Token' : getToken() }, //
uploadFiles: [
{name:"nihao",
url:'http://localhost:8008/static/uploadImages/20231103/ffbbe7d3ee1441fdaf706802fa0f176a.png'}
],
uploadHeader: { 'Access-Token': getToken() }, //
uploadFiles: [],
//
imagePath: process.env.VUE_APP_BASE_API,
//
hideUpload: false,
};
hideUpload: false
}
},
created() {
this.getList()
},
watch: {
//
uploadFiles(newValue) {
//
if (newValue.length >= 1) {
//
this.hideUpload = true
} else {
//
this.hideUpload = false
}
}
},
methods: {
getList(){
getBannerListApi(this.queryParams).then(res=>{
this.tableData = res.data.records;
handleRemove(file) {
console.log('删除文件', file)
console.log('删除文件', this.uploadFiles)
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.dialogVisible = true
},
handleSuccess(response, file, fileList) {
//Element UI el-upload fileList
console.log('上传成功', response, file)
this.uploadFiles = fileList
//
this.deviceInfo.productImage = response.data.title
},
handleError(error, file, fileList) {
console.error('上传失败', error, file, fileList)
},
getList() {
getBannerListApi(this.queryParams).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
@ -260,72 +345,80 @@ export default {
this.$refs[formName].validate(valid => {
if (valid) {
//
this.submitDeviceInfo();
this.submitDeviceInfo()
} else {
//
return false;
return false
}
});
})
},
submitDeviceInfo() {
//
console.log('提交设备信息数据:', this.deviceInfo);
console.log('提交设备信息数据:', this.deviceInfo)
if (this.deviceInfo.id) {
updateBannerApi(this.deviceInfo).then(res=>{
if(res.code === 200) {
updateBannerApi(this.deviceInfo).then(res => {
if (res.code === 200) {
this.getList()
this.open = false
}
})
}else {
saveBannerApi(this.deviceInfo).then(res=>{
if(res.code === 200) {
} else {
saveBannerApi(this.deviceInfo).then(res => {
if (res.code === 200) {
this.getList()
this.open = false
}
})
}
},
changeStatus(data){
updateBannerApi(data).then(res=>{
if(res.code === 200) {
changeStatus(data) {
updateBannerApi(data).then(res => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '修改状态成功!'
});
})
this.getList()
}
})
},
//
handleUploadSuccessCover(file) {
this.deviceInfo.productImage = file.data.fileName;
this.deviceInfo.productImage = file.data.fileName;
},
handleQuery(){
handleQuery() {
this.getList()
},
resetQuery(){
resetQuery() {
this.queryParams = {
page: 1,
pageSize: 10,
deviceName:'',
systemPosition:'系统首页',
deviceName: '',
systemPosition: '系统首页'
},
this.getList()
this.getList()
},
handleAdd(e) {
this.clean()
this.open = true;
this.title = "新增banner图"
this.open = true
this.title = '新增banner图'
},
edit(e) {
this.clean()
this.open = true;
this.title = "修改banner图"
this.deviceInfo = e
this.open = true
this.title = '修改banner图'
//
this.deviceInfo = JSON.parse(JSON.stringify(e));
console.log('编辑',e)
//
if (e.productImage && e.productImage != ''){
this.uploadFiles=[
{
url: this.imagePath + e.productImage,
name: e.productImage
}
]
console.log('图片回显',this.uploadFiles)
}
},
del(e) {
this.$confirm('此操作将永久删除该banner图, 是否继续?', '提示', {
@ -333,12 +426,12 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteBannerApi(e.id).then(res=>{
deleteBannerApi(e.id).then(res => {
if (res.code == 200) {
this.$message({
type: 'success',
message: '删除成功!'
});
})
this.getList()
}
})
@ -347,11 +440,11 @@ export default {
this.$message({
type: 'info',
message: '已取消删除'
});
});
})
})
},
clean() {
this.deviceInfo= {
this.deviceInfo = {
id: null, // id
bannerName: '', // Banner
productImage: '', //
@ -360,33 +453,44 @@ export default {
bannerLink: '', // Banner
bannerStatus: false, // Banner
note: '', //
createByName: '', //
createByName: '' //
}
},
this.uploadFiles = []
}
}
};
}
</script>
<style lang="scss" scoped>
.common-dialog >>> .el-upload--picture-card {
.common-dialog > > > .el-upload--picture-card {
width: 60px;
height: 50px;
line-height: 60px;
}
.d-dialog >>> .el-upload--picture-card {
::v-deep.hide .el-upload--picture-card {
display: none;
}
.d-dialog > > > .el-upload--picture-card {
width: 100px;
height: 100px;
line-height: 100px;
}
.d-dialog >>> .avatar-uploader .el-upload {
.d-dialog > > > .avatar-uploader .el-upload {
width: 100px;
height: 100px;
}
.d-dialog >>> .el-upload-list--picture-card .el-upload-list__item {
.d-dialog > > > .el-upload-list--picture-card .el-upload-list__item {
width: 100px;
height: 100px;
}
.list-img{
.list-img {
width: 98px;
height: 98px;
}