update:
1. fix feat: 1. add merchantOrder module
This commit is contained in:
50
src/api/market/dailySummary.js
Normal file
50
src/api/market/dailySummary.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import request from '@/axios';
|
||||
|
||||
export const getList = (current, size, params) => {
|
||||
return request({
|
||||
url: '/market/daily-summary/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
current,
|
||||
size,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const getDetail = (id) => {
|
||||
return request({
|
||||
url: '/market/daily-summary/detail',
|
||||
method: 'get',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/market/daily-summary/remove',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const add = (row) => {
|
||||
return request({
|
||||
url: '/market/daily-summary/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
|
||||
export const update = (row) => {
|
||||
return request({
|
||||
url: '/market/daily-summary/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
|
||||
50
src/api/market/merchantOrder.js
Normal file
50
src/api/market/merchantOrder.js
Normal file
@@ -0,0 +1,50 @@
|
||||
import request from '@/axios';
|
||||
|
||||
export const getList = (current, size, params) => {
|
||||
return request({
|
||||
url: '/market/merchant-order/list',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
current,
|
||||
size,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const getDetail = (id) => {
|
||||
return request({
|
||||
url: '/market/merchant-order/detail',
|
||||
method: 'get',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/market/merchant-order/remove',
|
||||
method: 'post',
|
||||
params: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const add = (row) => {
|
||||
return request({
|
||||
url: '/market/merchant-order/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
|
||||
export const update = (row) => {
|
||||
return request({
|
||||
url: '/market/merchant-order/submit',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
}
|
||||
|
||||
226
src/option/market/dailySummary.js
Normal file
226
src/option/market/dailySummary.js
Normal file
@@ -0,0 +1,226 @@
|
||||
export default {
|
||||
height:'auto',
|
||||
calcHeight: 30,
|
||||
tip: false,
|
||||
searchShow: true,
|
||||
searchMenuSpan: 6,
|
||||
border: true,
|
||||
index: true,
|
||||
viewBtn: true,
|
||||
selection: true,
|
||||
dialogClickModal: false,
|
||||
column: [
|
||||
{
|
||||
label: "主键",
|
||||
prop: "id",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "用户ID",
|
||||
prop: "userId",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "用户账号",
|
||||
prop: "userAccount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "用户姓名",
|
||||
prop: "userName",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "统计日期,如 '2026-04-29'",
|
||||
prop: "statDate",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "直推人数(累计)",
|
||||
prop: "directReferralCount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日新增直推人数",
|
||||
prop: "newDirectReferralCount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "团队人数(累计)",
|
||||
prop: "teamTotalCount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日新增团队人数",
|
||||
prop: "newTeamCount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "总福利值",
|
||||
prop: "totalBenefitsValue",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日新增福利值",
|
||||
prop: "increaseBenefitsValue",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日持有福利包的直推人数",
|
||||
prop: "directWithBenefitPackageCount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日直推人新增的福利包明细(数组)",
|
||||
prop: "directNewBenefitPackages",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "直推人福利包面值总和",
|
||||
prop: "directBenefitPackageFaceTotal",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "直推人福利包可提供加速的值(排除后台划拨)",
|
||||
prop: "directAcceleratedValue",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日福利积分系统等级",
|
||||
prop: "benefitLevel",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日现金下单的直推人数",
|
||||
prop: "cashOrderDirectCount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日直推人现金下单金额",
|
||||
prop: "cashOrderDirectAmount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "直推人可提供的现金分红金额(排除线下支付)",
|
||||
prop: "cashDividendEligibleDirect",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日佣金分红系统等级",
|
||||
prop: "commissionLevel",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日自己新增福利包(明细数组)",
|
||||
prop: "selfNewBenefitPackages",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日自己新增福利包面值",
|
||||
prop: "selfNewBenefitFaceValue",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "自己新增福利包可提供加速的值",
|
||||
prop: "selfAcceleratedValue",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "福利包总剩余面值",
|
||||
prop: "totalRemainingBenefitFace",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "福利包加速了多少值(累计)",
|
||||
prop: "totalAcceleratedByPackages",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "现金分红了多少(即佣金)",
|
||||
prop: "cashCommissionPaid",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "当日现金消费金额(排除线下支付)",
|
||||
prop: "selfCashConsumptionAmount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "自己可提供分红的金额(排除线下支付)",
|
||||
prop: "selfCashDividendEligible",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
prop: "remark",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "创建人",
|
||||
prop: "createUser",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "创建部门",
|
||||
prop: "createDept",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createTime",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "修改人",
|
||||
prop: "updateUser",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "修改时间",
|
||||
prop: "updateTime",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "是否已删除",
|
||||
prop: "isDeleted",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -98,35 +98,6 @@ export default {
|
||||
url: 'link'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "规格",
|
||||
prop: "specs",
|
||||
type: "dynamic",
|
||||
span: 24,
|
||||
children:{
|
||||
rowAdd: (done)=>{
|
||||
done();
|
||||
},
|
||||
rowDel: (row, done) => {
|
||||
done();
|
||||
},
|
||||
column: [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "attr",
|
||||
},
|
||||
{
|
||||
label: "值",
|
||||
prop: "value",
|
||||
}
|
||||
],
|
||||
},
|
||||
formatter: (row, value, cellValue) => {
|
||||
if (!Array.isArray(value)) return '';
|
||||
return value.map(s => `${s.attr} : ${s.value}`).join('; ');
|
||||
},
|
||||
overHidden: true,
|
||||
},
|
||||
{
|
||||
label: "备注",
|
||||
prop: "remark",
|
||||
|
||||
221
src/option/market/merchantOrder.js
Normal file
221
src/option/market/merchantOrder.js
Normal file
@@ -0,0 +1,221 @@
|
||||
export default {
|
||||
height:'auto',
|
||||
calcHeight: 30,
|
||||
tip: false,
|
||||
searchShow: true,
|
||||
searchMenuSpan: 6,
|
||||
border: true,
|
||||
index: true,
|
||||
viewBtn: false,
|
||||
editBtn: false,
|
||||
addBtn: false,
|
||||
delBtn: false,
|
||||
selection: true,
|
||||
dialogClickModal: false,
|
||||
column: [
|
||||
{
|
||||
label: "订单号",
|
||||
prop: "id",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
overHidden:true,
|
||||
},
|
||||
{
|
||||
label: "下单用户ID",
|
||||
prop: "userId",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "商家ID",
|
||||
prop: "sellerId",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "商品名称",
|
||||
prop: "productName",
|
||||
type: "input",
|
||||
overHidden:true,
|
||||
},
|
||||
{
|
||||
label: "商品ID",
|
||||
prop: "productId",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "商品缩略图URL",
|
||||
prop: "thumbImageUrl",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "库存ID(或SKU ID)",
|
||||
prop: "inventoryId",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "店铺名称",
|
||||
prop: "storeName",
|
||||
type: "input",
|
||||
overHidden: true,
|
||||
},
|
||||
{
|
||||
label: "商品单价",
|
||||
prop: "unitPrice",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "赠品类型(1:福利积分, 2:现金券, 3:佣金)",
|
||||
prop: "giftType",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "赠品数量",
|
||||
prop: "unitGiftAmount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "购买数量",
|
||||
prop: "quantity",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "总金额",
|
||||
prop: "totalAmount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "赠品总数量",
|
||||
prop: "totalGiftAmount",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "上架收款账户ID",
|
||||
prop: "payoutAccountId",
|
||||
type: "input",
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "收款类型",
|
||||
prop: "accountType",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "收款账号",
|
||||
prop: "accountNumber",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "收款账户",
|
||||
prop: "accountUrl",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "收款人",
|
||||
prop: "accountHolderName",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "收货人手机",
|
||||
prop: "consigneePhone",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "收货人",
|
||||
prop: "consignee",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "收货地址",
|
||||
prop: "deliveryAddress",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "付款凭证",
|
||||
prop: "paymentVoucherUrl",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "快递单号",
|
||||
prop: "expressNo",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "订单备注",
|
||||
prop: "remark",
|
||||
type: "input",
|
||||
},
|
||||
{
|
||||
label: "创建人用户ID",
|
||||
prop: "createUser",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "创建部门ID",
|
||||
prop: "createDept",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "创建时间",
|
||||
prop: "createTime",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "更新人用户ID",
|
||||
prop: "updateUser",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "更新时间",
|
||||
prop: "updateTime",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: "订单状态",
|
||||
prop: "status",
|
||||
type: 'radio',
|
||||
dicUrl: '/blade-system/dict/dictionary?code=app_order_status',
|
||||
props: {
|
||||
label: 'dictValue',
|
||||
value: 'dictKey'
|
||||
},
|
||||
dataType: 'number',
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
label: "逻辑删除标志(0:未删除, 1:已删除)",
|
||||
prop: "isDeleted",
|
||||
type: "input",
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: false,
|
||||
hide: true,
|
||||
},
|
||||
]
|
||||
}
|
||||
225
src/views/market/dailySummary.vue
Normal file
225
src/views/market/dailySummary.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<basic-container>
|
||||
<avue-crud :option="option"
|
||||
v-model:search="search"
|
||||
v-model:page="page"
|
||||
v-model="form"
|
||||
:table-loading="loading"
|
||||
:data="data"
|
||||
:permission="permissionList"
|
||||
:before-open="beforeOpen"
|
||||
ref="crud"
|
||||
@row-update="rowUpdate"
|
||||
@row-save="rowSave"
|
||||
@row-del="rowDel"
|
||||
@search-change="searchChange"
|
||||
@search-reset="searchReset"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@refresh-change="refreshChange"
|
||||
@on-load="onLoad">
|
||||
<template #menu-left>
|
||||
<el-button type="danger"
|
||||
icon="el-icon-delete"
|
||||
plain
|
||||
v-if="permission.dailySummary_delete"
|
||||
@click="handleDelete">删 除
|
||||
</el-button>
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="handleExport">导 出
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getList, getDetail, add, update, remove} from "@/api/market/dailySummary";
|
||||
import option from "@/option/market/dailySummary";
|
||||
import {mapGetters} from "vuex";
|
||||
import {exportBlob} from "@/api/common";
|
||||
import {getToken} from 'utils/auth';
|
||||
import {downloadXls} from "utils/util";
|
||||
import {dateNow} from "utils/date";
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
query: {},
|
||||
search: {},
|
||||
loading: true,
|
||||
page: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
total: 0
|
||||
},
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["permission"]),
|
||||
permissionList() {
|
||||
return {
|
||||
addBtn: this.validData(this.permission.dailySummary_add, false),
|
||||
viewBtn: this.validData(this.permission.dailySummary_view, false),
|
||||
delBtn: this.validData(this.permission.dailySummary_delete, false),
|
||||
editBtn: this.validData(this.permission.dailySummary_edit, false)
|
||||
};
|
||||
},
|
||||
ids() {
|
||||
let ids = [];
|
||||
this.selectionList.forEach(ele => {
|
||||
ids.push(ele.id);
|
||||
});
|
||||
return ids.join(",");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rowSave(row, done, loading) {
|
||||
add(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
window.console.log(error);
|
||||
});
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
update(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
return remove(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
});
|
||||
},
|
||||
handleDelete() {
|
||||
if (this.selectionList.length === 0) {
|
||||
this.$message.warning("请选择至少一条数据");
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
return remove(this.ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
this.$refs.crud.toggleSelection();
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
let downloadUrl = `/blade-dailysummary/dailySummary/export-dailySummary?${this.website.tokenHeader}=${getToken()}`;
|
||||
const {
|
||||
} = this.query;
|
||||
let values = {
|
||||
};
|
||||
this.$confirm("是否导出数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(downloadUrl, values).then(res => {
|
||||
downloadXls(res.data, `用户日汇总表${dateNow()}.xlsx`);
|
||||
NProgress.done();
|
||||
})
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
if (["edit", "view"].includes(type)) {
|
||||
getDetail(this.form.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
});
|
||||
}
|
||||
done();
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, params);
|
||||
done();
|
||||
},
|
||||
selectionChange(list) {
|
||||
this.selectionList = list;
|
||||
},
|
||||
selectionClear() {
|
||||
this.selectionList = [];
|
||||
this.$refs.crud.toggleSelection();
|
||||
},
|
||||
currentChange(currentPage){
|
||||
this.page.currentPage = currentPage;
|
||||
},
|
||||
sizeChange(pageSize){
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
refreshChange() {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
|
||||
const {
|
||||
} = this.query;
|
||||
|
||||
let values = {
|
||||
};
|
||||
|
||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
||||
const data = res.data.data;
|
||||
this.page.total = data.total;
|
||||
this.data = data.records;
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
225
src/views/market/merchantOrder.vue
Normal file
225
src/views/market/merchantOrder.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<basic-container>
|
||||
<avue-crud :option="option"
|
||||
v-model:search="search"
|
||||
v-model:page="page"
|
||||
v-model="form"
|
||||
:table-loading="loading"
|
||||
:data="data"
|
||||
:permission="permissionList"
|
||||
:before-open="beforeOpen"
|
||||
ref="crud"
|
||||
@row-update="rowUpdate"
|
||||
@row-save="rowSave"
|
||||
@row-del="rowDel"
|
||||
@search-change="searchChange"
|
||||
@search-reset="searchReset"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@refresh-change="refreshChange"
|
||||
@on-load="onLoad">
|
||||
<template #menu-left>
|
||||
<!-- <el-button type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- plain-->
|
||||
<!-- v-if="permission.merchantOrder_delete"-->
|
||||
<!-- @click="handleDelete">删 除-->
|
||||
<!-- </el-button>-->
|
||||
<el-button type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
@click="handleExport">导 出
|
||||
</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getList, getDetail, add, update, remove} from "@/api/market/merchantOrder";
|
||||
import option from "@/option/market/merchantOrder";
|
||||
import {mapGetters} from "vuex";
|
||||
import {exportBlob} from "@/api/common";
|
||||
import {getToken} from 'utils/auth';
|
||||
import {downloadXls} from "utils/util";
|
||||
import {dateNow} from "utils/date";
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
query: {},
|
||||
search: {},
|
||||
loading: true,
|
||||
page: {
|
||||
pageSize: 10,
|
||||
currentPage: 1,
|
||||
total: 0
|
||||
},
|
||||
selectionList: [],
|
||||
option: option,
|
||||
data: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["permission"]),
|
||||
permissionList() {
|
||||
return {
|
||||
addBtn: this.validData(this.permission.merchantOrder_add, false),
|
||||
viewBtn: this.validData(this.permission.merchantOrder_view, false),
|
||||
delBtn: this.validData(this.permission.merchantOrder_delete, false),
|
||||
editBtn: this.validData(this.permission.merchantOrder_edit, false)
|
||||
};
|
||||
},
|
||||
ids() {
|
||||
let ids = [];
|
||||
this.selectionList.forEach(ele => {
|
||||
ids.push(ele.id);
|
||||
});
|
||||
return ids.join(",");
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rowSave(row, done, loading) {
|
||||
add(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
window.console.log(error);
|
||||
});
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
update(row).then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
done();
|
||||
}, error => {
|
||||
loading();
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
return remove(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
});
|
||||
},
|
||||
handleDelete() {
|
||||
if (this.selectionList.length === 0) {
|
||||
this.$message.warning("请选择至少一条数据");
|
||||
return;
|
||||
}
|
||||
this.$confirm("确定将选择数据删除?", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
return remove(this.ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.onLoad(this.page);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "操作成功!"
|
||||
});
|
||||
this.$refs.crud.toggleSelection();
|
||||
});
|
||||
},
|
||||
handleExport() {
|
||||
let downloadUrl = `/blade-merchantorder/merchantOrder/export-merchantOrder?${this.website.tokenHeader}=${getToken()}`;
|
||||
const {
|
||||
} = this.query;
|
||||
let values = {
|
||||
};
|
||||
this.$confirm("是否导出数据?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
NProgress.start();
|
||||
exportBlob(downloadUrl, values).then(res => {
|
||||
downloadXls(res.data, `自营商家订单${dateNow()}.xlsx`);
|
||||
NProgress.done();
|
||||
})
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
if (["edit", "view"].includes(type)) {
|
||||
getDetail(this.form.id).then(res => {
|
||||
this.form = res.data.data;
|
||||
});
|
||||
}
|
||||
done();
|
||||
},
|
||||
searchReset() {
|
||||
this.query = {};
|
||||
this.onLoad(this.page);
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = params;
|
||||
this.page.currentPage = 1;
|
||||
this.onLoad(this.page, params);
|
||||
done();
|
||||
},
|
||||
selectionChange(list) {
|
||||
this.selectionList = list;
|
||||
},
|
||||
selectionClear() {
|
||||
this.selectionList = [];
|
||||
this.$refs.crud.toggleSelection();
|
||||
},
|
||||
currentChange(currentPage){
|
||||
this.page.currentPage = currentPage;
|
||||
},
|
||||
sizeChange(pageSize){
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
refreshChange() {
|
||||
this.onLoad(this.page, this.query);
|
||||
},
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
|
||||
const {
|
||||
} = this.query;
|
||||
|
||||
let values = {
|
||||
};
|
||||
|
||||
getList(page.currentPage, page.pageSize, values).then(res => {
|
||||
const data = res.data.data;
|
||||
this.page.total = data.total;
|
||||
this.data = data.records;
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
Reference in New Issue
Block a user