1、商城相关菜单迁移

This commit is contained in:
cuiyouliang 2025-06-03 16:55:58 +08:00
parent f36d4a8599
commit 45fedadd03
11 changed files with 491 additions and 587 deletions

View File

@ -1,5 +1,5 @@
# 页面标题
VITE_APP_TITLE = RuoYi-Vue-Plus多租户管理系统
VITE_APP_TITLE = 无终街管理系统
# 开发环境配置
VITE_APP_ENV = 'development'

View File

@ -1,5 +1,5 @@
# 页面标题
VITE_APP_TITLE = RuoYi-Vue-Plus多租户管理系统
VITE_APP_TITLE = 无终街管理系统
# 生产环境配置
VITE_APP_ENV = 'production'

View File

@ -1,4 +1,4 @@
import request from '@/utils/request'
import request from '@/utils/request';
// 查询订单售后列表
export function listOmsAftersale(query, pageReq) {
@ -7,7 +7,7 @@ export function listOmsAftersale(query, pageReq) {
method: 'post',
data: query,
params: pageReq
})
});
}
// 查询订单售后详细
@ -15,7 +15,7 @@ export function getOmsAftersale(id) {
return request({
url: '/oms/aftersale/' + id,
method: 'get'
})
});
}
// 新增订单售后
@ -24,7 +24,7 @@ export function addOmsAftersale(data) {
url: '/oms/aftersale',
method: 'post',
data: data
})
});
}
// 修改订单售后
@ -33,7 +33,7 @@ export function updateOmsAftersale(data) {
url: '/oms/aftersale',
method: 'put',
data: data
})
});
}
// 删除订单售后
@ -41,7 +41,7 @@ export function delOmsAftersale(id) {
return request({
url: '/oms/aftersale/' + id,
method: 'delete'
})
});
}
// 导出订单售后
@ -50,7 +50,7 @@ export function exportOmsAftersale(query) {
url: '/oms/aftersale/export',
method: 'get',
params: query
})
});
}
// 售后订单操作
@ -59,12 +59,12 @@ export function dealWithAftersale(data){
url: '/oms/aftersale/dealWith',
method: 'post',
data: data
})
});
}
export function viewLog(orderId) {
return request({
url: `/oms/aftersale/log/` + orderId,
method: 'get'
})
});
}

View File

@ -96,6 +96,48 @@ export const constantRoutes: RouteRecordRaw[] = [
},
// 新迁移的菜单,开发阶段暂时放在固定菜单内,后续迁移到权限菜单里
// 内容中心
{
path: '/content-center',
component: Layout,
// hidden: true,
// permissions: ['system:role:edit'],
children: [
// 视频管理
{
path: 'video-manage',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Video',
meta: { title: '视频管理', icon: '', noCache: true }
},
// 评论和点赞
{
path: 'comments',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Comments',
meta: { title: '评论与点赞', icon: '', noCache: true }
},
// 粉丝与关注
{
path: 'fans',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Fans',
meta: { title: '粉丝与关注', icon: '', noCache: true }
},
// 云点播
{
path: 'cloud',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Cloud',
meta: { title: '云点播', icon: '', noCache: true }
}
]
}
];
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes: RouteRecordRaw[] = [
{
path: '/system/user-auth',
component: Layout,
@ -208,49 +250,9 @@ export const constantRoutes: RouteRecordRaw[] = [
meta: { title: '售后订单详情' }
}
]
},
// 内容中心
{
path: '/content-center',
component: Layout,
// hidden: true,
// permissions: ['system:role:edit'],
children: [
// 视频管理
{
path: 'video-manage',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Video',
meta: { title: '视频管理', icon: '', noCache: true }
},
// 评论和点赞
{
path: 'comments',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Comments',
meta: { title: '评论与点赞', icon: '', noCache: true }
},
// 粉丝与关注
{
path: 'fans',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Fans',
meta: { title: '粉丝与关注', icon: '', noCache: true }
},
// 云点播
{
path: 'cloud',
component: () => import('@/views/contentManage/video/index.vue'),
name: 'Cloud',
meta: { title: '云点播', icon: '', noCache: true }
}
]
}
];
// 动态路由,基于用户权限动态去加载
export const dynamicRoutes: RouteRecordRaw[] = [];
/**
*
*/

View File

@ -1,5 +1,5 @@
// 用于检测用户是否 star 了仓库,如果没有 star将弹窗提示用户 star 。
import { Message, MessageBox } from 'element-ui'
/*import { Message, MessageBox } from 'element-ui'*/
// 使用axios代替$.ajax
import axios from 'axios'
// 应用参数
@ -19,7 +19,7 @@ const allowDisparity = 1000 * 60 * 60 * 24 * 7
* @param productLink 开源链接
*/
export function isStarRepo(owner, repo, userId, redirectUrl,productName,productLink) {
const judge = process.env.VUE_APP_JUDGE_STAR
const judge = 0
if (!judge || judge == 0) {
return true;
}
@ -75,7 +75,7 @@ function confirmStar(redirectUrl,productName,productLink) {
</div>
`
// 弹窗提示
MessageBox.alert(tipStr, '温馨提示', {
ElMessageBox.alert(tipStr, '温馨提示', {
// if you want to disable its autofocus
// autofocus: false,
confirmButtonText: '同意授权检测',
@ -100,7 +100,7 @@ function toStar(redirectUrl,productName,productLink,accessToken,owner,repo,key,c
<p><b>本页面将在 star 后正常开放展示</b></p>
</div>
`
MessageBox.confirm(tipStr, '温馨提示', {
ElMessageBox.confirm(tipStr, '温馨提示', {
// if you want to disable its autofocus
// autofocus: false,
closeOnClickModal: false,

View File

@ -3,30 +3,47 @@
<div v-show="show">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
<el-form-item label="申请状态" prop="status">
<DictRadio v-model="queryParams.status" :radioData="dict?.type.oms_aftersale_status" size="small" :show-all="'all'" @change="handleQuery"></DictRadio>
<DictRadio
v-model="queryParams.status"
:radioData="dict?.type.oms_aftersale_status"
size="small"
:show-all="'all'"
@change="handleQuery"
></DictRadio>
</el-form-item>
<el-form-item label="售后类型" prop="type">
<DictRadio v-model="queryParams.type" :radioData="dict?.type.oms_aftersale_type" size="small" :show-all="'all'" @change="handleQuery"></DictRadio>
<DictRadio
v-model="queryParams.type"
:radioData="dict?.type.oms_aftersale_type"
size="small"
:show-all="'all'"
@change="handleQuery"
></DictRadio>
</el-form-item>
<el-form-item label="订单号" prop="orderSn">
<el-input v-model.trim="queryParams.orderSn" placeholder="请输入订单号" clearable size="small"
@keyup.enter.native="handleQuery" />
<el-input v-model.trim="queryParams.orderSn" placeholder="请输入订单号" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="售后单号" prop="id">
<el-input v-model.trim="queryParams.id" placeholder="请输入售后单号" clearable size="small"
@keyup.enter.native="handleQuery" />
<el-input v-model.trim="queryParams.id" placeholder="请输入售后单号" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="会员手机号" prop="userPhone">
<el-input v-model.trim="queryParams.userPhone" placeholder="请输入会员手机号" clearable size="small"
@keyup.enter.native="handleQuery" />
<el-input v-model.trim="queryParams.userPhone" placeholder="请输入会员手机号" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="创建时间" prop="Time">
<el-date-picker v-model="queryParams.Time" type="datetimerange" :picker-options="pickerOptions"
range-separator="至" size="small" format="yyyy-MM-dd HH:mm:ss"
<el-date-picker
v-model="queryParams.Time"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
size="small"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
align="right"
@change="handleChange">
@change="handleChange"
>
</el-date-picker>
</el-form-item>
<el-form-item class="flex_one tr">
@ -39,10 +56,7 @@
<el-table-column label="售后单号" prop="id" width="160" />
<el-table-column label="申请状态" prop="aftersaleStatus" width="80">
<template v-slot="scope">
<el-tag effect="plain" size="medium" :type="getAftersaleStatusTag(scope.row)">{{
getAftersaleStatusText(scope.row)
}}
</el-tag>
<el-tag effect="plain" size="medium" :type="getAftersaleStatusTag(scope.row)">{{ getAftersaleStatusText(scope.row) }} </el-tag>
</template>
</el-table-column>
<el-table-column label="用户信息" prop="nickName" width="120">
@ -55,19 +69,16 @@
<el-table-column label="退款金额" prop="applyReturnAmount" width="120" />
<el-table-column label="售后类型" prop="applyRefundType" width="80">
<template v-slot="scope">
<el-tag effect="plain" size="medium" :type="getAftersaleTypeTag(scope.row)">{{
getAftersaleTypeText(scope.row)
}}
</el-tag>
<el-tag effect="plain" size="medium" :type="getAftersaleTypeTag(scope.row)">{{ getAftersaleTypeText(scope.row) }} </el-tag>
</template>
</el-table-column>
<el-table-column label="申请时间" prop="applyRefundTime" width="180">
<template slot-scope="scope">
<template v-slot="scope">
<span>{{ parseTime(scope.row.applyRefundTime, '') }}</span>
</template>
</el-table-column>
<el-table-column label="处理时间" prop="handleTime" width="180">
<template slot-scope="scope">
<template v-slot="scope">
<span>{{ parseTime(scope.row.handleTime, '') }}</span>
</template>
</el-table-column>
@ -75,63 +86,70 @@
<el-table-column label="处理备注" prop="note" width="150" />
<el-table-column label="处理人员" prop="handleMan" width="100" />
<el-table-column label="订单编号/操作" class-name="small-padding fixed-width" width="220" fixed="right">
<template slot-scope="scope">
<template v-slot="scope">
<div>
{{ scope.row.orderSn }}
<el-link @click="copy(scope.row.orderSn)" :underline="false"><i
class="el-icon-document-copy el-icon--right"></i></el-link>
<el-link @click="copy(scope.row.orderSn)" :underline="false"><i class="el-icon-document-copy el-icon--right"></i></el-link>
</div>
<el-button size="mini" type="text" @click="handleDetail(scope.row.orderId)"
v-hasPermi="['oms:aftersale:query']">详情
<el-button size="mini" type="text" @click="handleDetail(scope.row.orderId)" v-hasPermi="['oms:aftersale:query']">详情 </el-button>
<el-button size="mini" type="text" @click="showLog(scope.row.orderId)" v-hasPermi="['oms:aftersale:log']">日志 </el-button>
<el-button
size="mini"
type="text"
@click="approve(scope.row, 1)"
v-if="scope.row.aftersaleStatus == 0"
v-hasPermi="['manager:oms:aftersale:update']"
>同意
</el-button>
<el-button size="mini" type="text" @click="showLog(scope.row.orderId)"
v-hasPermi="['oms:aftersale:log']">日志
<el-button
size="mini"
type="text"
@click="handleOpen(scope.row, 2)"
class="red"
v-if="scope.row.aftersaleStatus == 0"
v-hasPermi="['manager:oms:aftersale:update']"
>拒绝
</el-button>
<el-button size="mini" type="text" @click="approve(scope.row, 1)"
v-if="scope.row.aftersaleStatus == 0" v-hasPermi="['manager:oms:aftersale:update']">同意
</el-button>
<el-button size="mini" type="text" @click="handleOpen(scope.row, 2)" class="red"
v-if="scope.row.aftersaleStatus == 0" v-hasPermi="['manager:oms:aftersale:update']">拒绝
</el-button>
<el-button size="mini" type="text" @click="confirmReceive(scope.row, 3)"
<el-button
size="mini"
type="text"
@click="confirmReceive(scope.row, 3)"
v-if="scope.row.aftersaleStatus == 1 && scope.row.applyRefundType == 2"
v-hasPermi="['manager:oms:aftersale:update']">确认收货
v-hasPermi="['manager:oms:aftersale:update']"
>确认收货
</el-button>
</template>
</el-table-column>
</el-table>
<InBody v-show="total > 0">
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</InBody>
</div>
<!-- <SeeAdsComponent ref="seeAdsComponentRef" v-if="!show" @confirmOk="confirmOk"/>-->
<!-- 拒绝对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-dialog :title="title" v-model:visible="open" width="500px" append-to-body>
<el-form ref="updateForm" :model="updateOrderForm" label-width="100px" :rules="rules">
<el-form-item label="拒绝理由" prop="remark">
<el-input v-model="updateOrderForm.remark" placeholder="请输入拒绝理由" controls-position="right" :min="0" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitUpdate('updateForm')">确定</el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
<!-- 日志 -->
<el-dialog :title="logObj.title" :visible.sync="logObj.open" width="500px" append-to-body>
<el-dialog :title="logObj.title" v-model:visible="logObj.open" width="500px" append-to-body>
<el-timeline>
<el-timeline-item v-for="item in logObj.logList" placement="top" :timestamp="parseTime(item.createTime, '')">
<el-card>
<h4>{{ getLogEvent(item.orderStatus) }}</h4>
<br>
<br />
<h4>操作人{{ item.operateMan }}</h4>
<br v-if="item.note">
<br v-if="item.note" />
<h4 v-if="item.note">备注{{ item.note }}</h4>
</el-card>
</el-timeline-item>
@ -150,14 +168,14 @@ import {
listOmsAftersale,
updateOmsAftersale,
viewLog
} from "@/api/oms/aftersale";
} from '@/api/oms/aftersale';
import dateUtil from '@/utils/DateUtil';
import SeeAdsComponent from "@/components/SeeAdsComponent.vue";
import SeeAdsComponent from '@/components/SeeAdsComponent.vue';
export default {
name: "OmsAftersale",
name: 'OmsAftersale',
components: { SeeAdsComponent },
dicts: ["oms_aftersale_type", "oms_aftersale_status"],
dicts: ['oms_aftersale_type', 'oms_aftersale_status'],
data() {
return {
show: true,
@ -181,7 +199,7 @@ export default {
//
omsAftersaleList: [],
//
title: "拒绝售后",
title: '拒绝售后',
//
open: false,
//
@ -203,12 +221,10 @@ export default {
orderId: null,
optType: null,
remark: null,
id: null,
id: null
},
rules: {
remark: [
{required: true, message: '请输入拒绝理由', trigger: 'blur'}
]
remark: [{ required: true, message: '请输入拒绝理由', trigger: 'blur' }]
},
logObj: {
title: '日志',
@ -219,42 +235,42 @@ export default {
};
},
created() {
const { status } = this.$route.query
const { status } = this.$route.query;
if (status) {
this.queryParams.status = status
this.queryParams.status = status;
}
this.getList();
},
methods: {
confirmOk(success) {
if (success) {
this.show = true
this.show = true;
this.getList();
}
},
copy(data) {
let url = data;
let oInput = document.createElement('input');
const url = data;
const oInput = document.createElement('input');
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // ;
console.log(oInput.value)
document.execCommand("Copy"); //
console.log(oInput.value);
document.execCommand('Copy'); //
this.$modal.msgSuccess('复制成功');
oInput.remove()
oInput.remove();
},
/** 查询订单售后列表 */
getList() {
if (this.queryParams.Time) {
this.queryParams.startTime = this.queryParams.Time[0]
this.queryParams.endTime = this.queryParams.Time[1]
this.queryParams.startTime = this.queryParams.Time[0];
this.queryParams.endTime = this.queryParams.Time[1];
}
this.loading = true;
const { pageNum, pageSize } = this.queryParams;
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
const pageReq = { page: pageNum - 1, size: pageSize };
listOmsAftersale(query, pageReq).then(response => {
const { content, totalElements } = response
listOmsAftersale(query, pageReq).then((response) => {
const { content, totalElements } = response;
this.omsAftersaleList = content;
this.total = totalElements;
this.loading = false;
@ -281,7 +297,7 @@ export default {
updateBy: null,
updateTime: null
};
this.resetForm("form");
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
@ -290,44 +306,44 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.resetForm('queryForm');
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加订单售后";
this.title = '添加订单售后';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getOmsAftersale(id).then(response => {
const id = row.id || this.ids;
getOmsAftersale(id).then((response) => {
this.form = response;
this.open = true;
this.title = "修改订单售后";
this.title = '修改订单售后';
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateOmsAftersale(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
updateOmsAftersale(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
} else {
addOmsAftersale(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
addOmsAftersale(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
@ -338,104 +354,109 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除订单售后编号为"' + ids + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除订单售后编号为"' + ids + '"的数据项?')
.then(function () {
return delOmsAftersale(ids);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$modal.confirm('是否确认导出所有订单售后数据项?').then(() => {
this.$modal
.confirm('是否确认导出所有订单售后数据项?')
.then(() => {
this.exportLoading = true;
return exportOmsAftersale(queryParams);
}).then(response => {
})
.then((response) => {
this.$download.download(response);
this.exportLoading = false;
}).catch(() => {});
})
.catch(() => {});
},
/** 售后详情 */
handleDetail(orderId) {
const id = orderId
this.$router.push({ path: '/aftersale/detail', query: { id } })
const id = orderId;
this.$router.push({ path: '/aftersale/detail', query: { id } });
},
/** 同意售后 */
approve(order, type) {
this.$confirm(`您确定要同意售后单号为【${order.id}】的售后申请吗?`, '温馨提示', {type: 'warning'}).then(
() => {
this.updateOrderForm.orderId = order.orderId
this.updateOrderForm.optType = type
this.$confirm(`您确定要同意售后单号为【${order.id}】的售后申请吗?`, '温馨提示', { type: 'warning' }).then(() => {
this.updateOrderForm.orderId = order.orderId;
this.updateOrderForm.optType = type;
dealWithAftersale(this.updateOrderForm).then((response) => {
this.cancel()
this.$message.success('操作成功')
this.getList()
})
}
)
this.cancel();
this.$message.success('操作成功');
this.getList();
});
});
},
/** 拒绝 */
handleOpen(order, type) {
this.updateOrderForm.orderId = order.orderId
this.updateOrderForm.optType = type
this.updateOrderForm.id = order.id
this.open = true
this.updateOrderForm.orderId = order.orderId;
this.updateOrderForm.optType = type;
this.updateOrderForm.id = order.id;
this.open = true;
},
confirmReceive(orderId, type) {
this.$confirm(`您确认收到售后单号为【${order.id}】的货物了吗?`, '温馨提示', {type: 'warning'}).then(
() => {
this.updateOrderForm.orderId = orderId
this.updateOrderForm.optType = type
this.$confirm(`您确认收到售后单号为【${order.id}】的货物了吗?`, '温馨提示', { type: 'warning' }).then(() => {
this.updateOrderForm.orderId = orderId;
this.updateOrderForm.optType = type;
dealWithAftersale(this.updateOrderForm).then((response) => {
this.cancel()
this.$message.success('操作成功')
this.getList()
})
})
this.cancel();
this.$message.success('操作成功');
this.getList();
});
});
},
getAftersaleStatusTag(row) {
switch (row.aftersaleStatus) {
case 0:
return 'info'
return 'info';
case 1:
return 'primary'
return 'primary';
case 2:
return 'success'
return 'success';
case 3:
return 'danger'
return 'danger';
case 4:
return 'warning'
return 'warning';
}
},
getAftersaleStatusText(row) {
switch (row.aftersaleStatus) {
case 0:
return '待处理'
return '待处理';
case 1:
return '退货中'
return '退货中';
case 2:
return '已完成'
return '已完成';
case 3:
return '已拒绝'
return '已拒绝';
case 4:
return '已关闭'
return '已关闭';
}
},
getAftersaleTypeTag(row) {
switch (row.applyRefundType) {
case 1:
return 'primary'
return 'primary';
case 2:
return 'warning'
return 'warning';
}
},
getAftersaleTypeText(row) {
switch (row.applyRefundType) {
case 1:
return '退款'
return '退款';
case 2:
return '退货退款'
return '退货退款';
}
},
cancel() {
@ -444,22 +465,21 @@ export default {
orderId: null,
optType: null,
remark: null,
id: null,
}
id: null
};
},
submitUpdate(formName) {
this.$refs[formName].validate(valid => {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$confirm(`您确定要拒绝售后单号为【${this.updateOrderForm.id}】的售后申请了吗?`, '温馨提示', {type: 'warning'}).then(
() => {
this.$confirm(`您确定要拒绝售后单号为【${this.updateOrderForm.id}】的售后申请了吗?`, '温馨提示', { type: 'warning' }).then(() => {
dealWithAftersale(this.updateOrderForm).then((response) => {
this.cancel()
this.$message.success('操作成功')
this.getList()
})
})
this.cancel();
this.$message.success('操作成功');
this.getList();
});
});
}
})
});
},
handleChange(value) {
if (!value) {
@ -468,12 +488,12 @@ export default {
}
},
showLog(orderId) {
this.logObj.loading = true
this.logObj.loading = true;
viewLog(orderId).then((response) => {
this.logObj.logList = response
this.logObj.open = true
this.logObj.loading = false
})
this.logObj.logList = response;
this.logObj.open = true;
this.logObj.loading = false;
});
},
getLogEvent(status) {
switch (status) {
@ -486,7 +506,7 @@ export default {
case 14:
return '平台拒绝售后';
}
},
}
}
};
</script>

View File

@ -2,17 +2,10 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
<el-form-item label="状态" prop="showStatus">
<DictRadio v-model="queryParams.showStatus" @change="handleQuery" size="small"
:radioData="dict?.type.sys_normal_disable" :showAll="'all'"/>
<DictRadio v-model="queryParams.showStatus" @change="handleQuery" size="small" :radioData="dict?.type.sys_normal_disable" :showAll="'all'" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.nameLike"
placeholder="名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.nameLike" placeholder="名称" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item class="flex_one tr">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -22,64 +15,41 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="pmsBrandList" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="品牌logo" prop="logo">
<template slot-scope="{ row }">
<template v-slot="{ row }">
<el-image v-if="row.logo" :src="row.logo" :preview-src-list="[row.logo]" class="small-img circle-img" />
</template>
</el-table-column>
<el-table-column label="名称" prop="name" />
<el-table-column label="排序" prop="sort" />
<el-table-column label="状态" prop="showStatus">
<template slot-scope="{ row }">
<template v-slot="{ row }">
<dict-tag :value="row.showStatus" prop-name="sys_normal_disable" />
</template>
</el-table-column>
<el-table-column label="操作" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改 </el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<InBody v-show="total > 0">
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</InBody>
<!-- 添加或修改品牌管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-one">
<el-form-item label="状态">
<DictRadio v-model="form.showStatus" size="small"
:radioData="dict?.type.sys_normal_disable"/>
<DictRadio v-model="form.showStatus" size="small" :radioData="dict?.type.sys_normal_disable" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="名称" />
@ -91,19 +61,21 @@
<oss-image-upload v-model="form.logo" :limit="1" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
import {addPmsBrand, delPmsBrand, exportPmsBrand, getPmsBrand, listPmsBrand, updatePmsBrand} from "@/api/pms/brand";
import { addPmsBrand, delPmsBrand, exportPmsBrand, getPmsBrand, listPmsBrand, updatePmsBrand } from '@/api/pms/brand';
export default {
name: "PmsBrand",
name: 'PmsBrand',
dicts: ['sys_normal_disable'],
data() {
return {
@ -124,7 +96,7 @@ export default {
//
pmsBrandList: [],
//
title: "",
title: '',
//
open: false,
//
@ -133,13 +105,12 @@ export default {
pageSize: 10,
nameLike: null,
sort: null,
showStatus: null,
showStatus: null
},
//
form: {},
//
rules: {
},
rules: {}
};
},
created() {
@ -152,8 +123,8 @@ export default {
const { pageNum, pageSize } = this.queryParams;
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
const pageReq = { page: pageNum - 1, size: pageSize };
listPmsBrand(query, pageReq).then(response => {
const { content, totalElements } = response
listPmsBrand(query, pageReq).then((response) => {
const { content, totalElements } = response;
this.pmsBrandList = content;
this.total = totalElements;
this.loading = false;
@ -177,7 +148,7 @@ export default {
updateBy: null,
updateTime: null
};
this.resetForm("form");
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
@ -186,44 +157,44 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.resetForm('queryForm');
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加品牌管理";
this.title = '添加品牌管理';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPmsBrand(id).then(response => {
const id = row.id || this.ids;
getPmsBrand(id).then((response) => {
this.form = response;
this.open = true;
this.title = "修改品牌管理";
this.title = '修改品牌管理';
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updatePmsBrand(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
updatePmsBrand(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
} else {
addPmsBrand(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
addPmsBrand(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
@ -234,23 +205,31 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除品牌管理编号为"' + ids + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除品牌管理编号为"' + ids + '"的数据项?')
.then(function () {
return delPmsBrand(ids);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$modal.confirm('是否确认导出所有品牌管理数据项?').then(() => {
this.$modal
.confirm('是否确认导出所有品牌管理数据项?')
.then(() => {
this.exportLoading = true;
return exportPmsBrand(queryParams);
}).then(response => {
})
.then((response) => {
this.$download.download(response);
this.exportLoading = false;
}).catch(() => {});
})
.catch(() => {});
}
}
};

View File

@ -1,13 +1,8 @@
<template>
<el-dialog :title="chooseSkuObj.title" :visible.sync="chooseSkuObj.open" :width="chooseSkuObj.width" append-to-body>
<el-dialog :title="chooseSkuObj.title" v-model:visible="chooseSkuObj.open" :width="chooseSkuObj.width" append-to-body>
<el-form ref="auditForm" inline :model="chooseSkuObj.queryParams" label-width="80px">
<el-form-item label="菜品名称" prop="nameLike">
<el-input
size="small"
placeholder="请输入菜品名称"
v-model="chooseSkuObj.queryParams.nameLike"
clearable
/>
<el-input size="small" placeholder="请输入菜品名称" v-model="chooseSkuObj.queryParams.nameLike" clearable />
</el-form-item>
<el-form-item label="菜品分类" prop="productCategoryName">
<product-category-select v-model="chooseSkuObj.queryParams.categoryId"></product-category-select>
@ -16,8 +11,16 @@
<el-button type="primary" icon="el-icon-search" size="mini" @click="getSkuList">搜索</el-button>
</el-form-item>
</el-form>
<el-table class="mt20" :data="chooseSkuObj.list" ref="table" v-loading="chooseSkuObj.loading" max-height="500" border
row-key="id" @selection-change="handleSelectionChange">
<el-table
class="mt20"
:data="chooseSkuObj.list"
ref="table"
v-loading="chooseSkuObj.loading"
max-height="500"
border
row-key="id"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column label="菜品名称" prop="name">
<template v-slot="{ row }">
@ -33,19 +36,21 @@
<pagination
v-show="chooseSkuObj.total > 0"
:total="chooseSkuObj.total"
:page.sync="chooseSkuObj.queryParams.pageNum"
:limit.sync="chooseSkuObj.queryParams.pageSize"
v-model:page="chooseSkuObj.queryParams.pageNum"
v-model:limit="chooseSkuObj.queryParams.pageSize"
@pagination="getSkuList"
/>
<div slot="footer" class="dialog-footer">
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="chooseSkuObj.open = false"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script>
import {listPmsProduct} from "@/api/pms/product";
import ProductCategorySelect from "@/views/components/ProductCategorySelect.vue";
import { listPmsProduct } from '@/api/pms/product';
import ProductCategorySelect from '@/views/components/ProductCategorySelect.vue';
export default {
components: { ProductCategorySelect },
@ -56,7 +61,7 @@ export default {
chooseSkuObj: {
loading: false,
open: false,
title: "选择菜品",
title: '选择菜品',
list: [],
width: '60%',
queryParams: {
@ -69,53 +74,53 @@ export default {
},
total: 0
}
}
};
},
methods: {
submitForm() {
this.$emit('onComplete', this.selectProducts)
this.chooseSkuObj.open = false
this.$emit('onComplete', this.selectProducts);
this.chooseSkuObj.open = false;
},
async init(chooseProductId) {
this.chooseSkuObj.queryParams.excludeProductIds = chooseProductId;
this.chooseSkuObj.queryParams.pageNum = 1;
await this.getSkuList();
this.chooseSkuObj.open = true
this.chooseSkuObj.open = true;
this.$nextTick(() => {
this.$refs.table.clearSelection()
})
this.$refs.table.clearSelection();
});
},
judge() {
this.$nextTick(() => {
this.chooseSkuObj.list.forEach(ele => {
if (this.selectProducts.some(item => item.id === ele.id)) {
this.$refs.table.toggleRowSelection(ele, true)
this.chooseSkuObj.list.forEach((ele) => {
if (this.selectProducts.some((item) => item.id === ele.id)) {
this.$refs.table.toggleRowSelection(ele, true);
} else {
this.$refs.table.toggleRowSelection(ele, false)
this.$refs.table.toggleRowSelection(ele, false);
}
});
})
});
},
handleSelectionChange(selection) {
this.selectProducts = selection
this.selectProducts = selection;
},
async getSkuList() {
this.chooseSkuObj.loading = true;
const query = { ...this.chooseSkuObj.queryParams, pageNum: undefined, pageSize: undefined };
if (query.categoryId && Array.isArray(query.categoryId)) {
query.categoryId = query.categoryId.pop()
query.categoryId = query.categoryId.pop();
}
const { pageNum, pageSize } = this.chooseSkuObj.queryParams;
const pageReq = { page: pageNum - 1, size: pageSize };
await listPmsProduct(query, pageReq).then(response => {
const {content, totalElements} = response
await listPmsProduct(query, pageReq).then((response) => {
const { content, totalElements } = response;
this.chooseSkuObj.list = [...content];
this.chooseSkuObj.total = totalElements;
this.chooseSkuObj.loading = false;
});
},
}
}
};
</script>
<style lang="stylus">

View File

@ -1,57 +1,22 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="100px"
size="medium"
class="ry_form"
>
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
<el-form-item label="状态" prop="showStatus">
<DictRadio
v-model="queryParams.showStatus"
@change="handleQuery"
size="small"
:radioData="dict?.type.sys_show_status"
:showAll="'all'"
/>
<DictRadio v-model="queryParams.showStatus" @change="handleQuery" size="small" :radioData="dict?.type.sys_show_status" :showAll="'all'" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.nameLike"
placeholder="名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.nameLike" placeholder="名称" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item class="flex_one tr">
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增 </el-button>
</el-col>
</el-row>
@ -65,49 +30,26 @@
>
<el-table-column label="名称" prop="name" />
<el-table-column label="图片" prop="icon">
<template slot-scope="{ row }">
<el-image
v-if="row.icon"
:src="row.icon"
:preview-src-list="[row.icon]"
class="small-img circle-img"
/>
<template v-slot="{ row }">
<el-image v-if="row.icon" :src="row.icon" :preview-src-list="[row.icon]" class="small-img circle-img" />
</template>
</el-table-column>
<el-table-column label="排序" prop="sort" />
<el-table-column label="状态" prop="showStatus">
<template v-slot="{ row }">
<dict-tag
:value="row.showStatus"
prop-name="sys_show_status"
></dict-tag>
<dict-tag :value="row.showStatus" prop-name="sys_show_status"></dict-tag>
</template>
</el-table-column>
<el-table-column
label="操作"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除
</el-button>
<el-table-column label="操作" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改 </el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除 </el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改商品分类对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px">
<el-dialog :title="title" v-model:visible="open" width="500px">
<el-form ref="form" :model="form" :rules="rules" label-width="108px">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="名称" />
@ -116,11 +58,7 @@
<oss-image-upload v-model="form.icon" :limit="1" />
</el-form-item>
<el-form-item label="状态">
<DictRadio
v-model="form.showStatus"
size="small"
:radioData="dict?.type.sys_show_status"
/>
<DictRadio v-model="form.showStatus" size="small" :radioData="dict?.type.sys_show_status" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="排序" />
@ -132,10 +70,12 @@
<product-category-select class="w200" v-model="form.parentId" :props="{ checkStrictly: true }"/>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@ -147,13 +87,13 @@ import {
delPmsProductCategory,
addPmsProductCategory,
updatePmsProductCategory,
exportPmsProductCategory,
} from "@/api/pms/productCategory";
import ProductCategorySelect from "@/views/components/ProductCategorySelect";
exportPmsProductCategory
} from '@/api/pms/productCategory';
import ProductCategorySelect from '@/views/components/ProductCategorySelect';
export default {
name: "PmsProductCategory",
dicts: ["sys_show_status"],
name: 'PmsProductCategory',
dicts: ['sys_show_status'],
components: { ProductCategorySelect },
data() {
return {
@ -172,7 +112,7 @@ export default {
//
pmsProductCategoryList: [],
//
title: "",
title: '',
//
open: false,
//
@ -181,12 +121,12 @@ export default {
nameLike: null,
level: null,
showStatus: null,
sort: null,
sort: null
},
//
form: {},
//
rules: {},
rules: {}
};
},
created() {
@ -220,9 +160,9 @@ export default {
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
updateTime: null
};
this.resetForm("form");
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
@ -230,7 +170,7 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.resetForm('queryForm');
this.handleQuery();
},
//
@ -243,7 +183,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "添加商品分类";
this.title = '添加商品分类';
},
/** 修改按钮操作 */
handleUpdate(row) {
@ -252,12 +192,12 @@ export default {
getPmsProductCategory(id).then((response) => {
this.form = response;
this.open = true;
this.title = "修改商品分类";
this.title = '修改商品分类';
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
this.$refs['form'].validate((valid) => {
if (valid) {
let p;
if (this.form.parentId) {
@ -265,19 +205,19 @@ export default {
}
if (this.form.id != null) {
p = updatePmsProductCategory(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
} else {
p = addPmsProductCategory(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
}
p.then(() => {
this.$store.dispatch("mall/loadProductCategories", true);
this.$store.dispatch('mall/loadProductCategories', true);
});
}
});
@ -285,7 +225,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
if (row.children && row.children.length > 0) {
this.$message.error("请先删除子目录");
this.$message.error('请先删除子目录');
return;
}
const ids = row.id;
@ -296,7 +236,7 @@ export default {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
@ -304,7 +244,7 @@ export default {
handleExport() {
const queryParams = this.queryParams;
this.$modal
.confirm("是否确认导出所有商品分类数据项?")
.confirm('是否确认导出所有商品分类数据项?')
.then(() => {
this.exportLoading = true;
return exportPmsProductCategory(queryParams);
@ -314,7 +254,7 @@ export default {
this.exportLoading = false;
})
.catch(() => {});
},
},
}
}
};
</script>

View File

@ -2,40 +2,16 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px" size="medium" class="ry_form">
<el-form-item label="PRODUCT_ID" prop="productId">
<el-input
v-model="queryParams.productId"
placeholder="请输入PRODUCT_ID"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.productId" placeholder="请输入PRODUCT_ID" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="sku编码" prop="outSkuId">
<el-input
v-model="queryParams.outSkuId"
placeholder="请输入sku编码"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.outSkuId" placeholder="请输入sku编码" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="PRICE" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入PRICE"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.price" placeholder="请输入PRICE" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="展示图片" prop="pic">
<el-input
v-model="queryParams.pic"
placeholder="请输入展示图片"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.pic" placeholder="请输入展示图片" clearable size="small" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item class="flex_one tr">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@ -45,15 +21,7 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['pms:sku:add']"
>新增</el-button>
</el-col>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['pms:sku:add']">新增</el-button>
</el-col>
</el-row>
@ -65,35 +33,17 @@
<el-table-column label="展示图片" align="center" prop="pic" />
<el-table-column label="商品销售属性json格式" align="center" prop="spData" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['pms:sku:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pms:sku:remove']"
>删除</el-button>
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['pms:sku:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['pms:sku:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改sku信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-dialog :title="title" v-model:visible="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
<el-form-item label="PRODUCT_ID" prop="productId">
<el-input v-model="form.productId" placeholder="请输入PRODUCT_ID" />
@ -111,19 +61,21 @@
<el-input v-model="form.spData" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<template v-slot:footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
import { listPmsSku, getPmsSku, delPmsSku, addPmsSku, updatePmsSku, exportPmsSku } from "@/api/pms/sku";
import { listPmsSku, getPmsSku, delPmsSku, addPmsSku, updatePmsSku, exportPmsSku } from '@/api/pms/sku';
export default {
name: "PmsSku",
name: 'PmsSku',
data() {
return {
//
@ -143,7 +95,7 @@ export default {
// sku
pmsSkuList: [],
//
title: "",
title: '',
//
open: false,
//
@ -154,16 +106,14 @@ export default {
outSkuId: null,
price: null,
pic: null,
spData: null,
spData: null
},
//
form: {},
//
rules: {
outSkuId: [
{ required: true, message: "sku编码不能为空", trigger: "blur" }
],
},
outSkuId: [{ required: true, message: 'sku编码不能为空', trigger: 'blur' }]
}
};
},
created() {
@ -176,8 +126,8 @@ export default {
const { pageNum, pageSize } = this.queryParams;
const query = { ...this.queryParams, pageNum: undefined, pageSize: undefined };
const pageReq = { page: pageNum - 1, size: pageSize };
listPmsSku(query, pageReq).then(response => {
const { content, totalElements } = response
listPmsSku(query, pageReq).then((response) => {
const { content, totalElements } = response;
this.pmsSkuList = content;
this.total = totalElements;
this.loading = false;
@ -202,7 +152,7 @@ export default {
updateBy: null,
updateTime: null
};
this.resetForm("form");
this.resetForm('form');
},
/** 搜索按钮操作 */
handleQuery() {
@ -211,44 +161,44 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.resetForm('queryForm');
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加sku信息";
this.title = '添加sku信息';
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPmsSku(id).then(response => {
const id = row.id || this.ids;
getPmsSku(id).then((response) => {
this.form = response;
this.open = true;
this.title = "修改sku信息";
this.title = '修改sku信息';
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updatePmsSku(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
updatePmsSku(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
});
} else {
addPmsSku(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
addPmsSku(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();
});
@ -259,23 +209,31 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除sku信息编号为"' + ids + '"的数据项?').then(function() {
this.$modal
.confirm('是否确认删除sku信息编号为"' + ids + '"的数据项?')
.then(function () {
return delPmsSku(ids);
}).then(() => {
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
this.$modal.msgSuccess('删除成功');
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$modal.confirm('是否确认导出所有sku信息数据项').then(() => {
this.$modal
.confirm('是否确认导出所有sku信息数据项')
.then(() => {
this.exportLoading = true;
return exportPmsSku(queryParams);
}).then(response => {
})
.then((response) => {
this.$download.download(response);
this.exportLoading = false;
}).catch(() => {});
})
.catch(() => {});
}
}
};

View File

@ -25,7 +25,7 @@ export default defineConfig(({ mode, command }) => {
proxy: {
[env.VITE_APP_BASE_API]: {
// target: 'http://192.168.1.250:8080',
target: 'http://192.168.1.13:8080',
target: 'http://111.62.22.190:8080',
changeOrigin: true,
ws: true,
rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), ''),