1
This commit is contained in:
50
src/api/market/marketInfo.js
Normal file
50
src/api/market/marketInfo.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import request from '@/axios';
|
||||||
|
|
||||||
|
export const getList = (current, size, params) => {
|
||||||
|
return request({
|
||||||
|
url: '/market-info/list',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
...params,
|
||||||
|
current,
|
||||||
|
size,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getDetail = (id) => {
|
||||||
|
return request({
|
||||||
|
url: '/market-info/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const remove = (ids) => {
|
||||||
|
return request({
|
||||||
|
url: '/market-info/remove',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
ids,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const add = (row) => {
|
||||||
|
return request({
|
||||||
|
url: '/market-info/submit',
|
||||||
|
method: 'post',
|
||||||
|
data: row
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export const update = (row) => {
|
||||||
|
return request({
|
||||||
|
url: '/market-info/submit',
|
||||||
|
method: 'post',
|
||||||
|
data: row
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
@@ -20,33 +20,56 @@ export default {
|
|||||||
hide: true,
|
hide: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "商品编码",
|
label: "编码",
|
||||||
prop: "spuSn",
|
prop: "serialNumber",
|
||||||
|
type: "input",
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "名称",
|
||||||
|
prop: "productName",
|
||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "商品名称",
|
label: "缩略图",
|
||||||
prop: "spuName",
|
prop: "thumbImageUrl",
|
||||||
type: "input",
|
type: "upload",
|
||||||
|
listType: 'picture-img',
|
||||||
|
dataType: 'string',
|
||||||
|
action: '/blade-resource/oss/endpoint/put-file',
|
||||||
|
propsHttp: {
|
||||||
|
res: 'data',
|
||||||
|
url: 'link'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "主图",
|
label: "主图",
|
||||||
prop: "mainImg",
|
prop: "mainImageUrls",
|
||||||
type: "input",
|
type: "upload",
|
||||||
|
listType: 'picture-card',
|
||||||
|
multiple: true,
|
||||||
|
action: '/blade-resource/oss/endpoint/put-file',
|
||||||
|
propsHttp: {
|
||||||
|
res: 'data',
|
||||||
|
url: 'link'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "详情图(多图,逗号分割)",
|
label: "详情图",
|
||||||
prop: "detailImg",
|
prop: "detailImageUrls",
|
||||||
type: "input",
|
type: "upload",
|
||||||
|
listType: 'picture-card',
|
||||||
|
multiple: true,
|
||||||
|
action: '/blade-resource/oss/endpoint/put-file',
|
||||||
|
propsHttp: {
|
||||||
|
res: 'data',
|
||||||
|
url: 'link'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "顶图(多图,逗号分割)",
|
label: "规格",
|
||||||
prop: "topImg",
|
prop: "specs",
|
||||||
type: "input",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "规格详情",
|
|
||||||
prop: "attribute",
|
|
||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -55,19 +78,15 @@ export default {
|
|||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "cate_id分类",
|
label: "分类",
|
||||||
prop: "categoryId",
|
prop: "categoryId",
|
||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "cate_id分类",
|
label: "分类路径",
|
||||||
prop: "categoryIds",
|
prop: "categoryPath",
|
||||||
type: "input",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "成本价",
|
|
||||||
prop: "costPrice",
|
|
||||||
type: "input",
|
type: "input",
|
||||||
|
hide: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "原价",
|
label: "原价",
|
||||||
@@ -79,11 +98,6 @@ export default {
|
|||||||
prop: "retailPrice",
|
prop: "retailPrice",
|
||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: "利润",
|
|
||||||
prop: "profit",
|
|
||||||
type: "input",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "销量",
|
label: "销量",
|
||||||
prop: "sales",
|
prop: "sales",
|
||||||
@@ -91,11 +105,11 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "库存",
|
label: "库存",
|
||||||
prop: "spuQty",
|
prop: "stock",
|
||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "标签(多标签,逗号分割 )",
|
label: "标签",
|
||||||
prop: "tags",
|
prop: "tags",
|
||||||
type: "input",
|
type: "input",
|
||||||
},
|
},
|
||||||
|
|||||||
131
src/option/market/marketInfo.js
Normal file
131
src/option/market/marketInfo.js
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
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: "邀请人",
|
||||||
|
prop: "pid",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "是否同步族谱 0-否 1-是",
|
||||||
|
prop: "synchronized",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "是否成为服务商 0-否 1-是",
|
||||||
|
prop: "vendor",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "是否签署法大大协议 0-否 1-是",
|
||||||
|
prop: "eSigned",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "电子合同地址",
|
||||||
|
prop: "eSignedUrl",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "是否实名用户 0-否 1-是",
|
||||||
|
prop: "verified",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "实名时间",
|
||||||
|
prop: "verifiedDate",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "实名姓名",
|
||||||
|
prop: "realName",
|
||||||
|
type: "input",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "实名身份证",
|
||||||
|
prop: "idCard",
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
225
src/views/market/marketInfo.vue
Normal file
225
src/views/market/marketInfo.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.marketInfo_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/marketInfo";
|
||||||
|
import option from "@/option/market/marketInfo";
|
||||||
|
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.marketInfo_add, false),
|
||||||
|
viewBtn: this.validData(this.permission.marketInfo_view, false),
|
||||||
|
delBtn: this.validData(this.permission.marketInfo_delete, false),
|
||||||
|
editBtn: this.validData(this.permission.marketInfo_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-marketinfo/marketInfo/export-marketInfo?${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