店铺设置>>通知中心>>下载图片

This commit is contained in:
魏啾 2024-09-27 11:18:06 +08:00
parent fe6e6c2553
commit bac738d80c
4 changed files with 141 additions and 34 deletions

View File

@ -40,3 +40,12 @@ export function delmsg(ids) {
data: ids
})
}
//获取订阅二维码
export function subQrCode(params) {
return request({
url: '/api/msg/subQrCode',
method: 'get',
params
})
}

View File

@ -32,10 +32,26 @@
<!-- <el-table-column label="创建时间" prop="createTime"></el-table-column> -->
<el-table-column label="所属商品" width="320" align="center">
<template v-slot="scope">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId"
type="text">{{ item.productName }}</el-button>
<div class="goodslang">
<div class="goods-list">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item.productId)" :key="item.productId"
type="text">{{
item.productName }}</el-button>
</div>
<el-dropdown trigger="click" v-if="scope.row.product.length > 1" @command="toGoods">
<span class="el-dropdown-link" style="color: blue;">
<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item class="clearfix" v-for="(item) in scope.row.product" :key="item.productId"
:command="item.productId">
{{ item.productName }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template v-slot="scope">
@ -53,10 +69,10 @@
<el-pagination :total="clickseetableData.total" :current-page="clickseetableData.page + 1"
:page-size="clickseetableData.size" layout="total, sizes, prev, pager, next, jumper"
@current-change="paginationChangetype" @size-change="e => {
clickseetableData.size = e;
clickseetableData.page = 0;
getTableData();
}
clickseetableData.size = e;
clickseetableData.page = 0;
getTableData();
}
" />
</div>
@ -90,11 +106,11 @@ export default {
this.getTableData();
},
methods: {
toGoods(data) {
toGoods(productId) {
this.$router.push({
path: '/product/product',
query: {
productId: data.productId
productId: productId
}
})
},
@ -134,7 +150,7 @@ export default {
size: this.clickseetableData.size,
...this.query,
shopId: localStorage.getItem("shopId"),
sort:'createTime,desc'
sort: 'createTime,desc'
});
this.clickseetableData.loading = false;
this.clickseetableData.data = res.content.map(v => {
@ -162,6 +178,26 @@ export default {
};
</script>
<style lang="scss" scoped>
.goodslang {
display: flex;
justify-content: flex-start;
align-items: center;
.goods-list {
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
::v-deep .goods-list .el-button--text span {
display: block;
text-align: left;
}
::v-deep .goods-list .el-button--text {
white-space: break-spaces;
}
}
.green {
color: #13ce66;
font-weight: bold;

View File

@ -49,8 +49,8 @@
</div>
<div class="row">
<el-select clearable v-model="query.sort" @change="getTableData" placeholder="排序">
<el-option label="创建时间" value="balance,desc" />
<el-option label="数量由低到高" value="createTime,desc" />
<el-option label="创建时间" value="createTime,desc" />
<el-option label="数量由低到高" value="balance,desc" />
</el-select>
</div>
</div>
@ -63,8 +63,7 @@
<div class="boxitem_ses">
<div class="es">
<div class="e">耗材种数</div>
<div
class="s" style="color: #333333;">{{ tableData.total }}</div>
<div class="s" style="color: #333333;">{{ tableData.total }}</div>
</div>
</div>
</div>
@ -223,11 +222,24 @@
</el-table-column> -->
<el-table-column label="所属商品">
<template v-slot="scope">
<div class="goods-list">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item)" :key="item.productId" type="text">{{
item.productName }}</el-button>
<div class="goodslang">
<div class="goods-list">
<el-button v-for="(item) in scope.row.product" @click="toGoods(item.productId)" :key="item.productId"
type="text">{{
item.productName }}</el-button>
</div>
<el-dropdown trigger="click" v-if="scope.row.product.length > 1" @command="toGoods">
<span class="el-dropdown-link" style="color: blue;">
<i class="el-icon-caret-bottom el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item class="clearfix" v-for="(item) in scope.row.product" :key="item.productId"
:command="item.productId">
{{ item.productName }}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
<el-table-column label="库存数量" prop="stockNumber">
@ -694,12 +706,12 @@ export default {
this.$message({ type: "error", message: "至少保留一种耗材" });
}
},
toGoods(data) {
toGoods(productId) {
this.$router.push({
path: '/product/product',
query: {
productId: data.productId
productId: productId
}
})
},
@ -1089,9 +1101,10 @@ export default {
const res = await gettbConsInfoFlow({
page: this.clickseetableData.page,
size: this.clickseetableData.size,
consId: this.consRecordItem.consId,
conName: this.consRecordItem.conName,
shopId: localStorage.getItem("shopId")
// consId: this.consRecordItem.consId,
// conName: this.consRecordItem.conName,
shopId: localStorage.getItem("shopId"),
sort:'createTime,desc'
});
this.clickseetableData.loading = false;
this.clickseetableData.data = res.content;
@ -1105,13 +1118,25 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .goods-list .el-button--text span {
display: block;
text-align: left;
}
.goodslang {
display: flex;
justify-content: flex-start;
align-items: center;
::v-deep .goods-list .el-button--text {
white-space: break-spaces;
.goods-list {
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
::v-deep .goods-list .el-button--text span {
display: block;
text-align: left;
}
::v-deep .goods-list .el-button--text {
white-space: break-spaces;
}
}
.color-success {
@ -1177,7 +1202,7 @@ export default {
display: flex;
justify-content: center;
align-items: center;
padding: 10px 24px;
padding: 20px 24px;
background: rgba(244, 249, 255, 0.5);
border-radius: 10px;

View File

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<div class="head-container">
<!-- <div class="head-container">
<el-row :gutter="20">
<el-col :span="3">
店铺推送 <el-switch v-model="alldata.allState" :active-value="1" :inactive-value="0"
@ -19,7 +19,21 @@
@change="changeEvent(alldata.stockState, 0)"></el-switch>
</el-col>
</el-row>
</div>
</div> -->
<!-- 查看图片 -->
<el-button v-if="url" type="primary" @click="dialogVisible = true" style="margin-bottom: 28px;">查看图片</el-button>
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
<div style="width: 100%;text-align: center;">
<el-image style="width: 200px; height: 200px;" :src="url"></el-image>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="downloadUrl">下载</el-button>
</span>
</el-dialog>
<div class="head-container" id="table_drag">
<el-table ref="table" :data="tableData.data" v-loading="tableData.loading" row-key="id">
<el-table-column label="头像">
@ -70,7 +84,7 @@
</template>
<script>
import { msgall, msginfo, shopState, state, delmsg } from '@/api/notifications'
import { msgall, msginfo, shopState, state, delmsg, subQrCode } from '@/api/notifications'
export default {
data() {
return {
@ -87,14 +101,37 @@ export default {
conState: 0,
opeState: 0,
stockState: 0,
}
},
url: '',
dialogVisible: false
}
},
mounted() {
this.getTableData()
this.getlist()
this.getsubQrCode()
},
methods: {
downloadUrl() {
let link = document.createElement("a");
//a
link.style.display = "none";
//a
link.href = this.url;
document.body.appendChild(link);
//abody
link.click();
//a
this.dialogVisible = false
},
//
async getsubQrCode() {
let res = await subQrCode({
shopId: localStorage.getItem('shopId')
})
this.url = res
},
async getlist() {
let res = await state({
shopId: localStorage.getItem('shopId'),