优化cdn动态加载管理端,修复砍价金额bug,删除部分不规范代码
parent
84cfb26512
commit
71e4c49c3e
|
@ -12,42 +12,25 @@
|
|||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "0.0.7",
|
||||
"@antv/g2": "^4.1.12",
|
||||
"apexcharts": "^3.26.0",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"countup.js": "^2.0.4",
|
||||
"date-fns": "^1.30.1",
|
||||
"dplayer": "^1.26.0",
|
||||
"gitalk": "^1.6.2",
|
||||
"html2canvas": "^1.0.0-rc.5",
|
||||
"iview-area": "^1.6.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"pinyin": "^2.9.0",
|
||||
"print-js": "^1.0.63",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"sass-loader": "^8.0.2",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"swiper": "^6.3.5",
|
||||
"uuid": "^8.3.2",
|
||||
"view-design": "^4.2.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-apexcharts": "^1.5.1",
|
||||
"vue-awesome": "^4.0.2",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-clipboard2": "^0.3.0",
|
||||
"vue-cropper": "^0.4.9",
|
||||
"vue-i18n": "^8.15.1",
|
||||
"vue-json-excel": "^0.3.0",
|
||||
"vue-json-pretty": "^1.4.1",
|
||||
"vue-lazyload": "^1.3.3",
|
||||
"vue-qr": "^2.3.0",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuex": "^3.4.0",
|
||||
"wangeditor": "^4.7.5",
|
||||
"xlsx": "^0.16.2",
|
||||
"xss": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -61,6 +44,7 @@
|
|||
"less-loader": "^6.2.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-resources-loader": "^1.3.2",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
}
|
||||
|
|
|
@ -1,39 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
|
||||
<link rel="icon" href="./logo.ico" type="image/x-icon">
|
||||
<link rel="icon" href="./logo.ico" type="image/x-icon" />
|
||||
<title>lili admin</title>
|
||||
<meta name="keywords"
|
||||
content="keywords">
|
||||
<meta name="description"
|
||||
content="description">
|
||||
<!-- 部署CDN优化 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-i18n@8.15.1/dist/vue-i18n.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/iview.min.js"></script>
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/iview-area@1.6.0/dist/iview-area.min.js"></script> -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-lazyload@1.3.3/vue-lazyload.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-apexcharts@1.5.1/dist/vue-apexcharts.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.15.3/dist/xlsx.full.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/dplayer@1.25.0/dist/DPlayer.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/print-js@1.0.63/dist/print.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-json-pretty@1.6.2/vue-json-pretty.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.5.0/dist/gitalk.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/wangeditor@3.1.1/release/wangEditor.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js"></script>
|
||||
<script src="https://v.vaptcha.com/v3.js"></script>
|
||||
<meta name="keywords" content="keywords" />
|
||||
<meta name="description" content="description" />
|
||||
<% for(var css of htmlWebpackPlugin.options.cdn.css) { %>
|
||||
<link rel="stylesheet" href="<%=css%>" />
|
||||
<% } %>
|
||||
<style>
|
||||
.page-loading-wrap {
|
||||
padding: 120px;
|
||||
|
@ -77,7 +54,6 @@
|
|||
@keyframes half-circle-spinner-animation {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
|
||||
}
|
||||
|
||||
100% {
|
||||
|
@ -88,9 +64,14 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<% for(var js of htmlWebpackPlugin.options.cdn.js) { %>
|
||||
<script src="<%=js%>"></script>
|
||||
<% } %>
|
||||
<noscript>
|
||||
<strong>We're sorry but lili-admin doesn't work properly without JavaScript enabled. Please enable it to
|
||||
continue.</strong>
|
||||
<strong
|
||||
>We're sorry but lili-admin doesn't work properly without JavaScript
|
||||
enabled. Please enable it to continue.</strong
|
||||
>
|
||||
</noscript>
|
||||
<div id="app">
|
||||
<div class="page-loading-wrap">
|
||||
|
@ -101,7 +82,5 @@
|
|||
<h4 style="margin-top:20px;">正在加载资源...</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
import XLSX from 'xlsx';
|
||||
|
||||
function auto_width(ws, data){
|
||||
/*set worksheet max width per col*/
|
||||
const colWidth = data.map(row => row.map(val => {
|
||||
/*if null/undefined*/
|
||||
if (val == null) {
|
||||
return {'wch': 10};
|
||||
}
|
||||
/*if chinese*/
|
||||
else if (val.toString().charCodeAt(0) > 255) {
|
||||
return {'wch': val.toString().length * 2};
|
||||
} else {
|
||||
return {'wch': val.toString().length};
|
||||
}
|
||||
}))
|
||||
/*start in the first row*/
|
||||
let result = colWidth[0];
|
||||
for (let i = 1; i < colWidth.length; i++) {
|
||||
for (let j = 0; j < colWidth[i].length; j++) {
|
||||
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
function json_to_array(key, jsonData){
|
||||
return jsonData.map(v => key.map(j => { return v[j] }));
|
||||
}
|
||||
|
||||
// fix data,return string
|
||||
function fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
|
||||
// get head from excel file,return array
|
||||
function get_header_row(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r /* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */
|
||||
var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
||||
export const export_table_to_excel= (id, filename) => {
|
||||
const table = document.getElementById(id);
|
||||
const wb = XLSX.utils.table_to_book(table);
|
||||
XLSX.writeFile(wb, filename);
|
||||
}
|
||||
|
||||
export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
data.unshift(title);
|
||||
const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true});
|
||||
if(autoWidth){
|
||||
const arr = json_to_array(key, data);
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const arr = json_to_array(key, data);
|
||||
arr.unshift(title);
|
||||
const ws = XLSX.utils.aoa_to_sheet(arr);
|
||||
if(autoWidth){
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const read = (data, type) => {
|
||||
const workbook = XLSX.read(data, { type: type });
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[firstSheetName];
|
||||
const header = get_header_row(worksheet);
|
||||
const results = XLSX.utils.sheet_to_json(worksheet);
|
||||
return {header, results};
|
||||
}
|
||||
|
||||
export default {
|
||||
export_table_to_excel,
|
||||
export_array_to_excel,
|
||||
export_json_to_excel,
|
||||
read
|
||||
}
|
|
@ -15,7 +15,6 @@ import vueQr from 'vue-qr'
|
|||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios'
|
||||
import { setStore, getStore, removeStore } from '@/libs/storage'
|
||||
import util from '@/libs/util'
|
||||
import VueLazyload from 'vue-lazyload'
|
||||
|
||||
import * as filters from '@/utils/filters' // global filter
|
||||
import liliDialog from '@/views/lili-dialog'
|
||||
|
@ -30,10 +29,7 @@ Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品
|
|||
Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码
|
||||
return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}`
|
||||
};
|
||||
Vue.use(VueLazyload, {
|
||||
error: require('./assets/img-error.png'),
|
||||
loading: require('./assets/loading2.gif')
|
||||
})
|
||||
|
||||
Vue.use(ViewUI, {
|
||||
i18n: (key, value) => i18n.t(key, value)
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ export const otherRouter = {
|
|||
children: [
|
||||
{
|
||||
path: "home",
|
||||
title: { i18n: "home" },
|
||||
title: '首页',
|
||||
name: "home_index",
|
||||
component: () => import("@/views/home/home.vue")
|
||||
},
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</Row>
|
||||
</Card>
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate" >
|
||||
<Form ref="form" :model="form" :label-width="100" >
|
||||
<FormItem label="编号">
|
||||
<Input disabled v-model="form.sn" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
|
|
|
@ -1,22 +1,18 @@
|
|||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Form @keydown.enter.native="handleSearch" ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form @keydown.enter.native="handleSearch" ref="searchForm" :model="searchForm" inline :label-width="70"
|
||||
class="search-form">
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.goodsName"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
<Row class="operation" style="margin:10px 0;">
|
||||
<Button @click="delAll" type="primary">批量下架</Button>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||
@on-selection-change="changeSelect">
|
||||
<template slot="goodsName" slot-scope="{row}">
|
||||
<div>
|
||||
<div class="div-zoom">
|
||||
|
@ -24,7 +20,8 @@
|
|||
</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<div slot="content">
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150"></vue-qr>
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
||||
:size="150"></vue-qr>
|
||||
</div>
|
||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||
</Poptip>
|
||||
|
@ -32,23 +29,27 @@
|
|||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDistributionGoods,
|
||||
delDistributionGoods
|
||||
} from "@/api/distribution";
|
||||
import { getDistributionGoods, delDistributionGoods } from "@/api/distribution";
|
||||
import vueQr from "vue-qr";
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
},
|
||||
name: "distributionGoods",
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: { // 搜索框初始化对象
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
|
@ -74,31 +75,34 @@ export default {
|
|||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.thumbnail,
|
||||
alt: "加载图片失败"
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain"
|
||||
}
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
slot: "goodsName",
|
||||
minWidth: 200,
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "商品价格",
|
||||
key: "price",
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
return h("div", this.$options.filters.unitPrice(params.row.price,'¥'));
|
||||
}
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "库存",
|
||||
|
@ -107,21 +111,23 @@ export default {
|
|||
{
|
||||
title: "添加时间",
|
||||
key: "createTime",
|
||||
width: 170
|
||||
width: 170,
|
||||
},
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "佣金金额",
|
||||
key: "commission",
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("div", this.$options.filters.unitPrice(params.row.commission,'¥'));
|
||||
}
|
||||
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.commission, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
@ -136,22 +142,22 @@ export default {
|
|||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small"
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
"下架"
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -188,7 +194,7 @@ export default {
|
|||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getDistributionGoods(this.searchForm).then(res => {
|
||||
getDistributionGoods(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
|
@ -206,14 +212,14 @@ export default {
|
|||
loading: true,
|
||||
onOk: () => {
|
||||
// 下架
|
||||
delDistributionGoods(v.id).then(res => {
|
||||
delDistributionGoods(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
// 批量下架
|
||||
|
@ -227,12 +233,12 @@ export default {
|
|||
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = []
|
||||
this.selectList.forEach(item => {
|
||||
ids.push(item.id)
|
||||
let ids = [];
|
||||
this.selectList.forEach((item) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// 批量下架
|
||||
delDistributionGoods(ids.toString()).then(res => {
|
||||
delDistributionGoods(ids.toString()).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
|
@ -240,13 +246,13 @@ export default {
|
|||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -69,10 +69,13 @@
|
|||
} from "@/api/distribution";
|
||||
import {orderStatusList} from './dataJson'
|
||||
import {getShopListData} from '@/api/shops'
|
||||
import vueQr from 'vue-qr'
|
||||
|
||||
export default {
|
||||
name: "distributionOrder",
|
||||
components: {},
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeRange: [], // 范围时间
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
<script>
|
||||
import { setSetting, getSetting } from "@/api/index";
|
||||
|
||||
export default {
|
||||
name: "distributionSetting",
|
||||
data() {
|
||||
|
@ -33,8 +32,8 @@ export default {
|
|||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
isOpen: "",
|
||||
distributionDay: "", //分销关系绑定天数
|
||||
cashDay: "", //分销结算天数
|
||||
distributionDay: 0, //分销关系绑定天数
|
||||
cashDay: 0, //分销结算天数
|
||||
}
|
||||
};
|
||||
},
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
|
|
@ -118,7 +118,11 @@
|
|||
|
||||
<script>
|
||||
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
name: "goods",
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
|
||||
<template slot="action" slot-scope="scope">
|
||||
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
|
||||
<Dropdown v-show="scope.row.level == 2" trigger="click">
|
||||
<Button size="small">
|
||||
绑定
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
|
@ -19,7 +19,7 @@
|
|||
</Dropdown>
|
||||
|
||||
|
||||
<Dropdown transfer="true" trigger="click">
|
||||
<Dropdown trigger="click">
|
||||
<Button size="small">
|
||||
操作
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
|
@ -134,6 +134,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false, //加载状态
|
||||
categoryList: [], // 分类列表
|
||||
loading: false, // 加载状态
|
||||
brands: [], //品牌集合
|
||||
|
@ -154,9 +155,9 @@ export default {
|
|||
parentId: "",
|
||||
name: "",
|
||||
image: "",
|
||||
sortOrder: "",
|
||||
sortOrder: 0,
|
||||
deleteFlag: 0,
|
||||
commissionRate: "",
|
||||
commissionRate: 0,
|
||||
level: 0,
|
||||
},
|
||||
brandForm: {
|
||||
|
|
|
@ -142,7 +142,8 @@
|
|||
</div>
|
||||
<div class="today-item">
|
||||
<div>今日交易额</div>
|
||||
<span>¥{{homeData.todayOrderPrice ? (homeData.todayOrderPrice | unitPrice) : 0}}</span>
|
||||
<span v-if="homeData.todayOrderPrice">¥{{homeData.todayOrderPrice | unitPrice}}</span>
|
||||
<span v-else>¥0.00</span>
|
||||
</div>
|
||||
<div class="today-item">
|
||||
<div>今日新增店铺</div>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</i-switch>
|
||||
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
|
||||
<Button type="success" placement="right" @click="decorate(item)" size="small">装修</Button>
|
||||
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)" @on-cancel="cancel">
|
||||
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)">
|
||||
<Button type="error" size="small">删除</Button>
|
||||
</Poptip>
|
||||
</div>
|
||||
|
@ -46,7 +46,7 @@
|
|||
@on-ok="newTemplate"
|
||||
@on-cancel="showModal = false"
|
||||
>
|
||||
<Form ref="form" :model="formData" :rules="rules" :label-width="80">
|
||||
<Form ref="form" :model="formData" :label-width="80">
|
||||
<FormItem label="模板名称" prop="name">
|
||||
<Input v-model="formData.name" placeholder="请输入模板名称" />
|
||||
</FormItem>
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
<script>
|
||||
import * as API_Other from "@/api/other.js";
|
||||
|
||||
import QRCode from "qrcodejs2";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -66,7 +65,7 @@ export default {
|
|||
// selected: false,
|
||||
// },
|
||||
],
|
||||
qrcode: "", // 二维码
|
||||
|
||||
submitWay: {
|
||||
// 表单信息
|
||||
pageShow: this.$route.query.type || false,
|
||||
|
@ -169,20 +168,6 @@ export default {
|
|||
})
|
||||
.catch((error) => {});
|
||||
},
|
||||
|
||||
creatQrCode() {
|
||||
if (this.qrcode) {
|
||||
return false;
|
||||
}
|
||||
// this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
|
||||
// text: "https://www.baidu.com", // 需要转换为二维码的内容
|
||||
// width: 100,
|
||||
// height: 100,
|
||||
// colorDark: "#000000",
|
||||
// colorLight: "#ffffff",
|
||||
// correctLevel: QRCode.CorrectLevel.H,
|
||||
// });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="layout">
|
||||
<Carousel class="carousel" v-if="res" autoplay autoplay-speed="5000">
|
||||
<Carousel class="carousel" v-if="res" autoplay :autoplay-speed="5000">
|
||||
<CarouselItem v-for="(item, index) in res.list" :key="index">
|
||||
<div>
|
||||
<img class="image-mode" :src="item.img" />
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<span slot="close">关</span>
|
||||
</i-switch>
|
||||
<Button type="info" placement="right" @click="handleEdit(item)" size="small">修改</Button>
|
||||
<Poptip confirm title="删除此模板?" @on-ok="handleDel(item)" @on-cancel="cancel">
|
||||
<Poptip confirm title="删除此模板?" @on-ok="handleDel(item)" >
|
||||
<Button type="error" size="small">删除</Button>
|
||||
</Poptip>
|
||||
</div>
|
||||
|
@ -79,7 +79,7 @@ export default {
|
|||
pageType: "INDEX",
|
||||
pageClientType: "H5",
|
||||
},
|
||||
total: "", // 页面数量
|
||||
total: 0, // 页面数量
|
||||
list: [], // 总数据
|
||||
};
|
||||
},
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
</FormItem>
|
||||
<FormItem label="支持电子面单">
|
||||
<i-switch v-model="form.standBy" size="large">
|
||||
<span slot="open">开</span>
|
||||
<span slot="close">关</span>
|
||||
<span slot="OPEN">开</span>
|
||||
<span slot="CLOSE">关</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
<FormItem label="电子面单表单">
|
||||
|
@ -58,8 +58,8 @@
|
|||
</FormItem>
|
||||
<FormItem label="禁用状态" prop="disabled">
|
||||
<i-switch v-model="form.disabled" size="large">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">禁用</span>
|
||||
<span slot="OPEN">开启</span>
|
||||
<span slot="CLOSE">禁用</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
@ -100,6 +100,7 @@
|
|||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
disabled:"OPEN"
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: "footer",
|
||||
|
||||
data() {
|
||||
return {
|
||||
year: new Date().getFullYear()
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: "header",
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
|
||||
<Table :loading="loading" border :columns="columns" class="mt_10" :data="data" ref="table"></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
show-total show-elevator show-sizer></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
|
@ -44,7 +45,7 @@
|
|||
</Form>
|
||||
<div slot="footer">
|
||||
<Button @click="addFlag = false">取消</Button>
|
||||
<Button type="primary" :loading="handleAddLoading" @click="addMemberSubmit">确定</Button>
|
||||
<Button type="primary" @click="addMemberSubmit">确定</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<!-- 修改模态框 -->
|
||||
|
@ -108,11 +109,11 @@ import * as RegExp from "@/libs/RegExp.js";
|
|||
export default {
|
||||
name: "member",
|
||||
components: {
|
||||
region, ossManage
|
||||
region,
|
||||
ossManage,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectedMember: false, //是否是其他组件调用
|
||||
descTitle: "", // modal标题
|
||||
descFlag: false, //编辑查看框
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -210,7 +211,7 @@ export default {
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: params.row.___selected ? "primary" : "",
|
||||
type: params.row.___selected ? "primary" : "default",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -302,7 +303,9 @@ export default {
|
|||
// 已选择用户数据
|
||||
selectedList: {
|
||||
type: null,
|
||||
default: [],
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
@ -311,7 +314,6 @@ export default {
|
|||
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
|
||||
this.init(this.data);
|
||||
// 将父级数据与当前组件数据进行匹配
|
||||
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
|
@ -381,7 +383,7 @@ export default {
|
|||
},
|
||||
addMember() {
|
||||
this.addFlag = true;
|
||||
this.$refs.addMemberForm.resetFields()
|
||||
this.$refs.addMemberForm.resetFields();
|
||||
},
|
||||
/**
|
||||
* 查询查看会员详情
|
||||
|
@ -416,7 +418,7 @@ export default {
|
|||
if (valid) {
|
||||
API_Member.addMember(this.addMemberForm).then((res) => {
|
||||
if (res.result) {
|
||||
this.$refs.addMemberForm.resetFields()
|
||||
this.$refs.addMemberForm.resetFields();
|
||||
this.getData();
|
||||
this.$Message.success("添加成功!");
|
||||
this.addFlag = false;
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</Card>
|
||||
|
||||
<Card class="mt_10">
|
||||
<Tabs type="point" @on-click="memberInfoChange">
|
||||
<Tabs value="point" @on-click="memberInfoChange">
|
||||
<TabPane label="TA的积分" name="point">
|
||||
<div class="pointsTitle" style="justify-content: flex-start; text-align: left;">
|
||||
<div style="width: 120px;">
|
||||
|
@ -203,7 +203,6 @@
|
|||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="addressChangeSort"
|
||||
>
|
||||
</Table>
|
||||
|
||||
|
@ -339,8 +338,8 @@
|
|||
</FormItem>
|
||||
<FormItem label="默认" prop="isDefault">
|
||||
<RadioGroup type="button" button-style="solid" v-model="addressForm.isDefault">
|
||||
<Radio :label=true>是</Radio>
|
||||
<Radio :label=false>否</Radio>
|
||||
<Radio label="1">是</Radio>
|
||||
<Radio label="0">否</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
@ -378,7 +377,7 @@
|
|||
addressModalVisible: false, //会员地址操作弹出框
|
||||
addressForm: {
|
||||
id: "",
|
||||
isDefault: false
|
||||
isDefault: "0"
|
||||
|
||||
},//会员地址操作form
|
||||
selectDate: null, // 选择时间段
|
||||
|
@ -665,7 +664,7 @@
|
|||
key: "isDefault",
|
||||
width: 80,
|
||||
render: (h, params) => {
|
||||
if (params.row.isDefault) {
|
||||
if (params.row.isDefault == "1") {
|
||||
return h('div', [
|
||||
h('span', {}, "是"),
|
||||
]);
|
||||
|
@ -981,7 +980,7 @@
|
|||
this.addressModalVisible = true
|
||||
this.addressForm = {
|
||||
id: "",
|
||||
isDefault: false,
|
||||
isDefault: "0",
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -998,9 +997,11 @@
|
|||
this.$refs.addressForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.addressForm.id != "") {
|
||||
let submit = JSON.parse(JSON.stringify(this.addressForm))
|
||||
submit.isDefault == "1" ? submit.isDefault = true : submit.isDefault = false
|
||||
if (submit.id != "") {
|
||||
//修改地址
|
||||
API_Member.editMemberAddress(this.addressForm).then((res) => {
|
||||
API_Member.editMemberAddress(submit).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res && res.success) {
|
||||
this.$Message.success("修改成功");
|
||||
|
@ -1010,7 +1011,7 @@
|
|||
});
|
||||
} else {
|
||||
//添加地址
|
||||
API_Member.addMemberAddress(this.addressForm).then((res) => {
|
||||
API_Member.addMemberAddress(submit).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res && res.success) {
|
||||
this.$Message.success("添加成功");
|
||||
|
|
|
@ -3,97 +3,43 @@
|
|||
<Row>
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="会员名称" prop="username">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.username"
|
||||
placeholder="请输入会员名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.username" placeholder="请输入会员名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
|
||||
<Form-item label="联系方式" prop="mobile">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.mobile"
|
||||
placeholder="请输入会员联系方式"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.mobile" placeholder="请输入会员联系方式" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" sortable="custom">
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</Row>
|
||||
|
||||
<!-- 修改模态框 -->
|
||||
<Modal v-model="descFlag" :title="descTitle" @on-ok="handleSubmitModal" width="500">
|
||||
<Form
|
||||
ref="formValidate"
|
||||
:model="formValidate"
|
||||
:rules="ruleValidate"
|
||||
:label-width="80"
|
||||
>
|
||||
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
|
||||
<FormItem label="头像">
|
||||
<img :src="formValidate.face" class="face" />
|
||||
<Button
|
||||
type="text"
|
||||
class="upload"
|
||||
@click="
|
||||
<Button type="text" class="upload" @click="
|
||||
() => {
|
||||
this.picModelFlag = true;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
"
|
||||
>修改
|
||||
</Button
|
||||
>
|
||||
<input
|
||||
type="file"
|
||||
style="display: none"
|
||||
id="file"
|
||||
/>
|
||||
">修改
|
||||
</Button>
|
||||
<input type="file" style="display: none" id="file" />
|
||||
</FormItem>
|
||||
<FormItem label="会员名称" prop="name">
|
||||
<Input
|
||||
v-model="formValidate.username"
|
||||
style="width: 200px"
|
||||
disabled
|
||||
/>
|
||||
<Input v-model="formValidate.username" style="width: 200px" disabled />
|
||||
</FormItem>
|
||||
<FormItem label="用户昵称" prop="name">
|
||||
<Input v-model="formValidate.nickName" style="width: 200px" />
|
||||
|
@ -109,34 +55,20 @@
|
|||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="修改密码" prop="password">
|
||||
<Input
|
||||
type="password"
|
||||
style="width: 220px"
|
||||
password
|
||||
v-model="formValidate.newPassword"
|
||||
/>
|
||||
<Input type="password" style="width: 220px" password v-model="formValidate.newPassword" />
|
||||
</FormItem>
|
||||
<FormItem label="生日" prop="birthday">
|
||||
<DatePicker
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
v-model="formValidate.birthday"
|
||||
style="width: 220px"
|
||||
></DatePicker>
|
||||
<DatePicker type="date" format="yyyy-MM-dd" v-model="formValidate.birthday" style="width: 220px"></DatePicker>
|
||||
</FormItem>
|
||||
<FormItem label="所在地" prop="mail">
|
||||
<div class="form-item" v-if="!updateRegion">
|
||||
<Input disabled style="width: 250px" :value="formValidate.region" />
|
||||
<Button
|
||||
type="text"
|
||||
@click="
|
||||
<Button type="text" @click="
|
||||
() => {
|
||||
this.updateRegion = !this.updateRegion;
|
||||
}
|
||||
"
|
||||
>修改
|
||||
</Button
|
||||
>
|
||||
">修改
|
||||
</Button>
|
||||
</div>
|
||||
<div class="form-item" v-else>
|
||||
<region style="width: 250px" @selected="selectedRegion" />
|
||||
|
@ -155,7 +87,6 @@
|
|||
import * as API_Member from "@/api/member.js";
|
||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||
|
||||
|
||||
export default {
|
||||
name: "memberRecycle",
|
||||
components: {
|
||||
|
@ -170,13 +101,14 @@
|
|||
openSearch: true, // 显示搜索
|
||||
loading: true, // 表单加载状态
|
||||
updateRegion: false, // 显示所在地
|
||||
searchForm: { // 请求参数
|
||||
searchForm: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
order: "desc",
|
||||
username: "",
|
||||
mobile: "",
|
||||
disabled: "CLOSE"
|
||||
disabled: "CLOSE",
|
||||
},
|
||||
picModelFlag: false, // 选择图片
|
||||
formValidate: {}, // 表单数据
|
||||
|
@ -186,15 +118,13 @@
|
|||
title: "会员名称",
|
||||
align: "left",
|
||||
key: "username",
|
||||
tooltip: true
|
||||
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
|
||||
title: "昵称",
|
||||
align: "left",
|
||||
key: "nickName",
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "联系方式",
|
||||
|
@ -202,17 +132,16 @@
|
|||
key: "mobile",
|
||||
render: (h, params) => {
|
||||
if (params.row.mobile == null) {
|
||||
return h('div', [h('span', {}, "")]);
|
||||
return h("div", [h("span", {}, "")]);
|
||||
} else {
|
||||
return h('div', [h('span', {}, params.row.mobile)]);
|
||||
}
|
||||
|
||||
return h("div", [h("span", {}, params.row.mobile)]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "注册时间",
|
||||
key: "createTime",
|
||||
width: 180
|
||||
width: 180,
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -234,12 +163,15 @@
|
|||
width: 200,
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h("div", {
|
||||
return h(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
display: "flex",
|
||||
justifyContent: "center"
|
||||
}
|
||||
}, [
|
||||
justifyContent: "center",
|
||||
},
|
||||
},
|
||||
[
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
|
@ -282,7 +214,7 @@
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: "success"
|
||||
type: "success",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -303,7 +235,7 @@
|
|||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
ghost:true
|
||||
ghost: true,
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -316,7 +248,8 @@
|
|||
},
|
||||
"编辑"
|
||||
),
|
||||
]);
|
||||
]
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -354,7 +287,7 @@
|
|||
editPerm(val) {
|
||||
this.descTitle = `查看用户 ${val.username}`;
|
||||
this.descFlag = true;
|
||||
this.updateRegion = false
|
||||
this.updateRegion = false;
|
||||
this.getMemberInfo(val.id);
|
||||
},
|
||||
/**
|
||||
|
@ -370,8 +303,8 @@
|
|||
//查询会员列表
|
||||
getData() {
|
||||
API_Member.getMemberListData(this.searchForm).then((res) => {
|
||||
if (res.result.records) {
|
||||
this.loading = false
|
||||
if (res.success) {
|
||||
this.loading = false;
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
|
@ -397,21 +330,21 @@
|
|||
enable(v) {
|
||||
let params = {
|
||||
memberIds: [v.id],
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
};
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
content: '<p>启用用此会员?</p>',
|
||||
title: "提示",
|
||||
content: "<p>启用用此会员?</p>",
|
||||
onOk: () => {
|
||||
API_Member.updateMemberStatus(params).then(res => {
|
||||
API_Member.updateMemberStatus(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('禁用成功');
|
||||
this.getData()
|
||||
this.$Message.success("禁用成功");
|
||||
this.getData();
|
||||
} else {
|
||||
// this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<Cascader
|
||||
v-model="selectDep"
|
||||
:data="department"
|
||||
:load-data="loadData"
|
||||
@on-change="handleChangeDep"
|
||||
change-on-select
|
||||
filterable
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { getRegion } from "@/api/common.js";
|
||||
export default {
|
||||
name: "map",
|
||||
data() {
|
||||
return {
|
||||
showMap: false, // modal显隐
|
||||
|
|
|
@ -121,9 +121,12 @@
|
|||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "orderList",
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
|
|
@ -72,12 +72,11 @@
|
|||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
||||
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "orderComplaint",
|
||||
components: {
|
||||
uploadPicThumb
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -158,9 +158,9 @@ export default {
|
|||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
if (params.row.payStatus == "PAID") {
|
||||
return h("div", [h("span", {}, "已付款")]);
|
||||
return h("div", [h("Tag", {props:{color:'green'}}, "已付款")]);
|
||||
} else {
|
||||
return h("div", [h("span", {}, "未付款")]);
|
||||
return h("div", [h("Tag", {props:{color:'red'}}, "未付款")]);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -263,7 +263,7 @@
|
|||
<Input v-model="addressForm.consigneeMobile" size="large" maxlength="11"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="地址信息" prop="consigneeAddressPath">
|
||||
<Input v-model="region" disabled style="width: 305px" v-if="showRegion == false"/>
|
||||
<Input v-model="addr" disabled style="width: 305px" v-if="showRegion == false"/>
|
||||
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary"
|
||||
icon="ios-create-outline" style="margin-left: 8px">修改
|
||||
</Button>
|
||||
|
@ -300,16 +300,18 @@
|
|||
import * as API_Order from "@/api/order";
|
||||
import * as RegExp from "@/libs/RegExp.js";
|
||||
import region from "@/views/lili-components/region";
|
||||
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "orderList",
|
||||
components: {
|
||||
region,
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false, //加载表格
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
region: [], //地区
|
||||
addr: "", //地区
|
||||
regionId: [], //地区id
|
||||
showRegion: false, // 显示地区
|
||||
orderLogInfo: [], //订单日志数据
|
||||
|
@ -554,7 +556,7 @@ export default {
|
|||
},
|
||||
// 选中的地址
|
||||
selectedRegion(val) {
|
||||
this.region = val[1];
|
||||
this.addr = val[1];
|
||||
this.regionId = val[0];
|
||||
},
|
||||
//订单取消
|
||||
|
@ -587,7 +589,7 @@ export default {
|
|||
editAddress() {
|
||||
this.addressModal = true;
|
||||
this.showRegion = false;
|
||||
this.region = this.orderInfo.order.consigneeAddressPath;
|
||||
this.addr = this.orderInfo.order.consigneeAddressPath;
|
||||
this.regionId = this.orderInfo.order.consigneeAddressIdPath;
|
||||
this.addressForm.consigneeName = this.orderInfo.order.consigneeName;
|
||||
this.addressForm.consigneeMobile = this.orderInfo.order.consigneeMobile;
|
||||
|
@ -603,7 +605,7 @@ export default {
|
|||
this.$Message.error("请选择地址");
|
||||
return;
|
||||
}
|
||||
this.addressForm.consigneeAddressPath = this.region;
|
||||
this.addressForm.consigneeAddressPath = this.addr;
|
||||
this.addressForm.consigneeAddressIdPath = this.regionId;
|
||||
this.$refs.addressForm.validate((valid) => {
|
||||
if (valid) {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</download-excel>
|
||||
</div>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" ></Table>
|
||||
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
|
|
|
@ -103,6 +103,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false,
|
||||
loading: false, // 加载状态
|
||||
expandLevel: 1, // 展开的层级
|
||||
modalType: 0, // 添加或编辑标识
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<editor openXss v-model="form.content"></editor>
|
||||
</FormItem>
|
||||
<FormItem label="是否展示" prop="openStatus">
|
||||
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
|
||||
<i-switch size="large" v-model="form.openStatus" >
|
||||
<span slot="open">展示</span>
|
||||
<span slot="close">隐藏</span>
|
||||
</i-switch>
|
||||
|
@ -169,7 +169,7 @@ export default {
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: this.selectedIndex == params.index ? "primary" : "",
|
||||
type: this.selectedIndex == params.index ? "primary" : "default",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
|
|
@ -19,13 +19,8 @@
|
|||
</div>
|
||||
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" >
|
||||
<FormItem label="热词" prop="name">
|
||||
<Input v-model="form.keywords" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
|
@ -42,16 +37,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getHotWords,
|
||||
setHotWords
|
||||
} from "@/api/index";
|
||||
import { getHotWords, setHotWords } from "@/api/index";
|
||||
|
||||
export default {
|
||||
name: "hotWords",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false,
|
||||
modalTitle: "",
|
||||
loading: true, // 表单加载状态
|
||||
modalVisible: false, //弹出框
|
||||
form: {
|
||||
|
@ -97,7 +91,7 @@ export default {
|
|||
if (words) {
|
||||
this.form.keywords = words;
|
||||
} else {
|
||||
this.form.keywords = '';
|
||||
this.form.keywords = "";
|
||||
}
|
||||
this.form.point = 1;
|
||||
this.$refs.form.resetFields();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
</Button>
|
||||
<Button v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" @click="remove(row)">下架
|
||||
</Button>
|
||||
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
@ -201,6 +202,7 @@ export default {
|
|||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
refreshTable: true, // 修改选中状态后刷新表格
|
||||
selectDate:[], //选中的信息
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -212,7 +214,9 @@ export default {
|
|||
//已选择优惠券
|
||||
selectedList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: ()=>{
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="content-goods-publish">
|
||||
<Form ref="form" :model="form" :label-width="70">
|
||||
<Form ref="form" :label-width="70">
|
||||
<div class="base-info-item">
|
||||
<h4>优惠券活动详情</h4>
|
||||
<div class="form-item-view">
|
||||
|
@ -20,7 +20,6 @@
|
|||
<span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动状态">
|
||||
|
||||
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
|
||||
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
|
||||
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
|
||||
|
|
|
@ -4,21 +4,11 @@
|
|||
<Row>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="活动名称" prop="promotionName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.promotionName"
|
||||
placeholder="请输入活动名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable
|
||||
style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="活动状态" prop="promotionStatus">
|
||||
<Select
|
||||
v-model="searchForm.promotionStatus"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
<Option value="NEW">未开始</Option>
|
||||
<Option value="START">已开始/上架</Option>
|
||||
<Option value="END">已结束/下架</Option>
|
||||
|
@ -26,26 +16,13 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker
|
||||
v-model="selectDate"
|
||||
type="daterange"
|
||||
clearable
|
||||
placeholder="选择起始时间"
|
||||
style="width: 200px"
|
||||
></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||
</DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" sortable="custom">
|
||||
<template slot-scope="{ row }" slot="applyEndTime">
|
||||
{{ unixDate(row.applyEndTime) }}
|
||||
</template>
|
||||
|
@ -58,36 +35,17 @@
|
|||
<template slot-scope="{ row }" slot="action">
|
||||
<div>
|
||||
<Button type="info" size="small" @click="view(row)">查看</Button>
|
||||
<Button
|
||||
type="error"
|
||||
v-if="row.promotionStatus === 'START'"
|
||||
style="margin-left:5px"
|
||||
size="small"
|
||||
@click="openOrClose(row)"
|
||||
>关闭</Button>
|
||||
<Button
|
||||
type="success"
|
||||
v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'"
|
||||
style="margin-left:5px"
|
||||
size="small"
|
||||
@click="openOrClose(row)"
|
||||
>开启</Button>
|
||||
<Button type="error" v-if="row.promotionStatus === 'START'" style="margin-left:5px" size="small"
|
||||
@click="openOrClose(row)">关闭</Button>
|
||||
<Button type="success" v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'"
|
||||
style="margin-left:5px" size="small" @click="openOrClose(row)">开启</Button>
|
||||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
|
@ -98,14 +56,18 @@ import { getFullDiscountList, updateFullDiscount } from "@/api/promotion.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectDate: [],
|
||||
total: 0,
|
||||
loading: false, // 表单加载状态
|
||||
searchForm: { // 请求参数
|
||||
searchForm: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
sort: "startTime",
|
||||
order: "desc",
|
||||
},
|
||||
columns: [ // 表头
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
title: "活动名称",
|
||||
key: "promotionName",
|
||||
|
@ -181,11 +143,11 @@ export default {
|
|||
},
|
||||
// 开启或关闭活动
|
||||
openOrClose(row) {
|
||||
let name = '开启'
|
||||
let status = 'START'
|
||||
if (row.promotionStatus === 'START') {
|
||||
name = '关闭'
|
||||
status = 'CLOSE'
|
||||
let name = "开启";
|
||||
let status = "START";
|
||||
if (row.promotionStatus === "START") {
|
||||
name = "关闭";
|
||||
status = "CLOSE";
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
|
@ -243,7 +205,6 @@ export default {
|
|||
// 查看
|
||||
this.$router.push({ name: "full-cut-detail", query: { id: row.id } });
|
||||
},
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
|
|
@ -154,7 +154,6 @@
|
|||
border
|
||||
:columns="columns"
|
||||
:data="form.promotionGoodsList"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="goodsName">
|
||||
<div>
|
||||
|
@ -183,8 +182,12 @@
|
|||
<script>
|
||||
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
||||
import { getGoodsSkuData } from "@/api/goods";
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "addFullCut",
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: { // 表单
|
||||
|
|
|
@ -8,69 +8,39 @@
|
|||
|
||||
<FormItem label="选择商品" prop="scopeType">
|
||||
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||
<Button
|
||||
type="error"
|
||||
ghost
|
||||
style="margin-left: 10px"
|
||||
@click="delSelectGoods"
|
||||
>批量删除
|
||||
</Button
|
||||
>
|
||||
<Button type="error" ghost style="margin-left: 10px" @click="delSelectGoods">批量删除
|
||||
</Button>
|
||||
</FormItem>
|
||||
|
||||
<FormItem astyle="width: 100%">
|
||||
<Table
|
||||
border
|
||||
:columns="columns"
|
||||
:data="form.promotionGoodsList"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<Table border :columns="columns" :data="form.promotionGoodsList" @on-selection-change="changeSelect">
|
||||
<template slot-scope="{ row }" slot="skuId">
|
||||
<div>{{ row.skuId }}</div>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ index }" slot="settlementPrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].settlementPrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].settlementPrice" />
|
||||
</template>
|
||||
<template slot-scope="{ index }" slot="lowestPrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].lowestPrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].lowestPrice" />
|
||||
|
||||
</template>
|
||||
<template slot-scope="{ index }" slot="highestPrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].highestPrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].highestPrice" />
|
||||
|
||||
</template>
|
||||
<template slot-scope="{ index }" slot="purchasePrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].purchasePrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].purchasePrice" />
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ index }" slot="stock">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].stock"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].stock" />
|
||||
</template>
|
||||
</Table>
|
||||
</FormItem>
|
||||
<FormItem label="活动时间" prop="rangeTime">
|
||||
<DatePicker
|
||||
type="datetimerange"
|
||||
v-model="form.rangeTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择"
|
||||
:options="options"
|
||||
style="width: 260px"
|
||||
>
|
||||
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
|
||||
:options="options" style="width: 260px">
|
||||
</DatePicker>
|
||||
</FormItem>
|
||||
<div>
|
||||
|
@ -81,18 +51,12 @@
|
|||
</div>
|
||||
</Form>
|
||||
</Card>
|
||||
<sku-select
|
||||
ref="skuSelect"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></sku-select>
|
||||
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
saveKanJiaActivityGoods,
|
||||
editKanJiaActivityGoods
|
||||
} from "@/api/promotion";
|
||||
import { saveKanJiaActivityGoods } from "@/api/promotion";
|
||||
import { regular } from "@/utils";
|
||||
import skuSelect from "@/views/lili-dialog";
|
||||
|
||||
|
@ -209,13 +173,13 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
openSkuList() { // 显示商品选择器
|
||||
openSkuList() {
|
||||
// 显示商品选择器
|
||||
this.$refs.skuSelect.open("goods");
|
||||
let data = JSON.parse(JSON.stringify(this.promotionGoodsList))
|
||||
data.forEach(e => {
|
||||
e.id = e.skuId
|
||||
})
|
||||
let data = JSON.parse(JSON.stringify(this.promotionGoodsList));
|
||||
data.forEach((e) => {
|
||||
e.id = e.skuId;
|
||||
});
|
||||
this.$refs.skuSelect.goodsData = data;
|
||||
},
|
||||
|
||||
|
@ -224,9 +188,9 @@
|
|||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
if (this.form.rangeTime[0] === '' || this.form.rangeTime[0] === '') {
|
||||
if (this.form.rangeTime[0] === "" || this.form.rangeTime[0] === "") {
|
||||
this.$Message.error("请选择活动时间");
|
||||
return
|
||||
return;
|
||||
}
|
||||
params.startTime = this.$options.filters.unixToDate(
|
||||
this.form.rangeTime[0] / 1000
|
||||
|
@ -234,64 +198,65 @@
|
|||
params.endTime = this.$options.filters.unixToDate(
|
||||
this.form.rangeTime[1] / 1000
|
||||
);
|
||||
delete params.rangeTime
|
||||
let checkResult = true
|
||||
delete params.rangeTime;
|
||||
let checkResult = true;
|
||||
//如果添加活动的时候选择了商品 则对选择的商品参数做一些校验
|
||||
if (this.form.promotionGoodsList.length > 0) {
|
||||
this.form.promotionGoodsList.forEach((res) => {
|
||||
//校验库存参数
|
||||
if (res.stock <= 0 || res.stock > res.quantity) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("活动库存不能为0且不能超过商品库存");
|
||||
return
|
||||
return;
|
||||
}
|
||||
// 最低购买金额格式校验
|
||||
if (!regular.money.test(res.purchasePrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最低购买金额格式不正确");
|
||||
}
|
||||
// 结算价格金额格式校验
|
||||
if (!regular.money.test(res.settlementPrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("结算价格金额格式不正确");
|
||||
return
|
||||
return;
|
||||
}
|
||||
// 结算价格金额格式校验
|
||||
if (res.settlementPrice < 0 || res.settlementPrice > res.price) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("结算价格金额不能为0且不能超过商品价格");
|
||||
return
|
||||
return;
|
||||
}
|
||||
//最高砍价校验
|
||||
if (!regular.money.test(res.highestPrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最高可砍金额格式错误");
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (res.highestPrice <= 0 || res.highestPrice > res.price) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
|
||||
return
|
||||
return;
|
||||
}
|
||||
//最低砍价校验
|
||||
if (!regular.money.test(res.lowestPrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最低可砍金额格式错误");
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (res.lowestPrice <= 0 || res.lowestPrice > res.price) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最低可砍金额不能为0");
|
||||
return
|
||||
return;
|
||||
}
|
||||
//校验最高最低砍价金额
|
||||
if (res.lowestPrice > res.highestPrice) {
|
||||
checkResult = false
|
||||
if (parseInt(res.lowestPrice) > parseInt(res.highestPrice)) {
|
||||
checkResult = false;
|
||||
this.$Message.error("最低砍价金额不能大于最高砍价金额");
|
||||
return
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!checkResult) {
|
||||
return;
|
||||
}
|
||||
|
@ -372,7 +337,7 @@
|
|||
skuId: e.id,
|
||||
});
|
||||
});
|
||||
console.warn(list)
|
||||
console.warn(list);
|
||||
this.form.promotionGoodsList = list;
|
||||
},
|
||||
},
|
||||
|
|
|
@ -86,10 +86,7 @@
|
|||
</div>
|
||||
</Form>
|
||||
</Card>
|
||||
<sku-select
|
||||
ref="skuSelect"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></sku-select>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -99,13 +96,11 @@
|
|||
editKanJiaActivityGoods,
|
||||
} from "@/api/promotion";
|
||||
import {regular} from "@/utils";
|
||||
import skuSelect from "@/views/lili-dialog";
|
||||
|
||||
|
||||
export default {
|
||||
name: "editKanjiaActivityGoods",
|
||||
components: {
|
||||
skuSelect,
|
||||
},
|
||||
|
||||
watch: {},
|
||||
data() {
|
||||
const checkSettlementPrice = (rule, value, callback) => {
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
|
||||
style="width: 200px"></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||
</DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
|
@ -48,35 +48,36 @@
|
|||
<div>{{ row.goodsSku.quantity }}</div>
|
||||
</template>
|
||||
<template slot-scope="{ row,index }" slot="action">
|
||||
<Button v-if="row.promotionStatus === 'NEW'" type="info"
|
||||
size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
||||
<Button v-if="row.promotionStatus === 'NEW'" type="info" size="small" style="margin-right: 10px"
|
||||
@click="edit(row)">编辑
|
||||
</Button>
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error"
|
||||
size="small" style="margin-right: 10px" @click="delAll(row)">删除
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error" size="small"
|
||||
style="margin-right: 10px" @click="delAll(row)">删除
|
||||
</Button>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
show-total show-elevator show-sizer></Page>
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getKanJiaGoodsList,
|
||||
delKanJiaGoods,
|
||||
} from "@/api/promotion";
|
||||
import { getKanJiaGoodsList, delKanJiaGoods } from "@/api/promotion";
|
||||
import vueQr from "vue-qr";
|
||||
|
||||
export default {
|
||||
name: "coupon",
|
||||
components: {},
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
selectDate: [], //选中的数据
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
|
@ -87,7 +88,7 @@
|
|||
pageSize: 10, // 页面大小
|
||||
sort: "startTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
goodsName: ""
|
||||
goodsName: "",
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
|
@ -219,17 +220,6 @@
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
// 选中优惠券 父级传值
|
||||
selectedList: {
|
||||
handler(val) {
|
||||
// 判断是否是父级回调给自己已选择优惠券
|
||||
if (val.length != 0) {
|
||||
this.selectCoupon = val;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
check() {
|
||||
// this.selectCoupon.push(this.selectList)
|
||||
this.$emit("selected", this.selectCoupon);
|
||||
|
@ -292,7 +282,10 @@
|
|||
this.loading = false;
|
||||
},
|
||||
edit(v) {
|
||||
this.$router.push({name: "edit-kanJia-activity-goods", query: {id: v.id}});
|
||||
this.$router.push({
|
||||
name: "edit-kanJia-activity-goods",
|
||||
query: { id: v.id },
|
||||
});
|
||||
},
|
||||
delAll(row) {
|
||||
this.$Modal.confirm({
|
||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
// 查询数据的总数
|
||||
total: "",
|
||||
total: 0,
|
||||
// 查询的form
|
||||
searchForm: {
|
||||
pageSize: 10,
|
||||
|
|
|
@ -95,6 +95,7 @@ export default {
|
|||
name: "pintuan",
|
||||
data() {
|
||||
return {
|
||||
selectDate:[], //选中的数据
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
:data="goodsData"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="goodsName">
|
||||
<div>
|
||||
|
|
|
@ -72,8 +72,12 @@ import {
|
|||
editPointsGoodsStatus,
|
||||
deletePointsGoodsStatus,
|
||||
} from "@/api/promotion";
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "pointsGoods",
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
|
|
@ -67,6 +67,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false,
|
||||
loading: false, // 加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<Row>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="活动名称" prop="promotionName">
|
||||
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable style="width: 200px" />
|
||||
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable
|
||||
style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="活动状态" prop="promotionStatus">
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
|
@ -15,7 +16,8 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||
</DatePicker>
|
||||
</Form-item>
|
||||
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
|
@ -25,22 +27,26 @@
|
|||
<TabPane label="秒杀活动列表" name="list">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button type="info" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="edit(row)">编辑</Button>
|
||||
<Button type="info" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'"
|
||||
@click="edit(row)">编辑</Button>
|
||||
|
||||
<Button type="info" size="small" class="mr_5" v-else @click="manage(row)">查看</Button>
|
||||
|
||||
<Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="manage(row)">管理</Button>
|
||||
<Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'"
|
||||
@click="manage(row)">管理</Button>
|
||||
|
||||
<Button type="error" size="small" v-if="
|
||||
row.promotionStatus == 'START' || row.promotionStatus == 'NEW'
|
||||
" class="mr_5" @click="off(row)">下架</Button>
|
||||
|
||||
<Button type="error" size="small" v-if="row.promotionStatus == 'CLOSE'" ghost @click="expire(row)">删除</Button>
|
||||
<Button type="error" size="small" v-if="row.promotionStatus == 'CLOSE'" ghost
|
||||
@click="expire(row)">删除</Button>
|
||||
</template>
|
||||
</Table>
|
||||
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page style="margin: 20px 0;" :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize"
|
||||
<Page style="margin: 20px 0;" :current="searchForm.pageNumber" :total="total"
|
||||
:page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</TabPane>
|
||||
|
@ -60,10 +66,11 @@ import setupSeckill from "@/views/promotion/seckill/setupSeckill";
|
|||
export default {
|
||||
name: "seckill",
|
||||
components: {
|
||||
setupSeckill
|
||||
setupSeckill,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectDate: [],
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
@ -99,13 +106,13 @@ export default {
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
return h("Tag", {props: {color: "geekblue",},},"新建");
|
||||
return h("Tag", { props: { color: "geekblue" } }, "新建");
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
return h("Tag", {props: {color: "green",},},"开始");
|
||||
return h("Tag", { props: { color: "green" } }, "开始");
|
||||
} else if (params.row.promotionStatus == "END") {
|
||||
return h("Tag", {props: {color: "volcano",},},"结束");
|
||||
return h("Tag", { props: { color: "volcano" } }, "结束");
|
||||
} else if (params.row.promotionStatus == "CLOSE") {
|
||||
return h("Tag", {props: {color: "red",},},"结束");
|
||||
return h("Tag", { props: { color: "red" } }, "结束");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -132,6 +132,7 @@ export default {
|
|||
name: "bill-detail",
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
columns: [ // 表头
|
||||
{
|
||||
title: "项目",
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
</Card>
|
||||
|
||||
<Card class="mt_10">
|
||||
<Tabs type="order" @on-click="storeInfoChange">
|
||||
<Tabs value="order" @on-click="storeInfoChange">
|
||||
<TabPane label="TA的订单" name="order" style="min-height: 200px">
|
||||
<Row>
|
||||
<Form ref="searchForm" :model="orderSearchForm" inline :label-width="70" class="search-form">
|
||||
|
|
|
@ -178,7 +178,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
orderOrRefund: 1, // 订单还是单
|
||||
total: "0", // 总数
|
||||
total: 0, // 总数
|
||||
// 订单状态
|
||||
orderStatusList: {
|
||||
UNDELIVERED: "待发货",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<Button class="mt_10 mb_10" @click="addAppVersion" type="primary">添加</Button>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" ></Table>
|
||||
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
|
|
|
@ -160,6 +160,7 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
customSms: false, //当选择自动发送对象 展示
|
||||
alreadyCheck: [], //已经选中的数据
|
||||
alreadyCheckShow: [], //已经选择的值负责显示
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
</div>
|
||||
|
||||
<div v-show="showType == 'list'">
|
||||
<Row v-show="openTip">
|
||||
<Row >
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{ selectCount }}</span> 项
|
||||
|
|
|
@ -47,32 +47,7 @@
|
|||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<!-- 数据权限 -->
|
||||
<Modal :title="modalTitle" v-model="depModalVisible" :mask-closable="false" :width="500" class="depModal">
|
||||
<Alert show-icon>默认可查看全部数据,自定义数据范围时请勾选下方数据
|
||||
</Alert>
|
||||
<Form :label-width="85">
|
||||
<FormItem label="数据范围">
|
||||
<Select v-model="dataType" transfer>
|
||||
<Option :value="0">全部数据权限</Option>
|
||||
<Option :value="1">自定义数据权限</Option>
|
||||
<Option :value="2">本部门及以下数据权限</Option>
|
||||
<Option :value="3">本部门数据权限</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div v-show="dataType == 1" style="margin-top: 15px">
|
||||
<div style="position: relative">
|
||||
<Tree ref="depTree" :data="depData" :load-data="loadData" @on-toggle-expand="expandCheckDep" multiple style="margin-top: 15px"></Tree>
|
||||
<Spin size="large" fix v-if="depTreeLoading"></Spin>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="depModalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitDepLoading" @click="submitDepEdit">提交
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
|
||||
<!-- 保存权限弹出选择权限 -->
|
||||
<Modal width="800" v-model="selectIsSuperModel" title="选择菜单权限" :loading="superModelLoading" @on-ok="saveRole">
|
||||
|
@ -111,7 +86,6 @@ import {
|
|||
saveRoleMenu,
|
||||
} from "@/api/index";
|
||||
import util from "@/libs/util.js";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "role-manage",
|
||||
data() {
|
||||
|
@ -305,12 +279,12 @@ export default {
|
|||
"Tag",
|
||||
{
|
||||
props: {
|
||||
type:
|
||||
color:
|
||||
data.isSuper == true
|
||||
? "red"
|
||||
: data.isSuper == false
|
||||
? "default"
|
||||
: "",
|
||||
: "default",
|
||||
},
|
||||
style: {
|
||||
"margin-left": "10px",
|
||||
|
|
|
@ -98,7 +98,6 @@
|
|||
<Button type="primary" :loading="submitLoading" @click="submitUser">提交</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<check-password ref="checkPass" @on-success="resetPass"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,10 +1,55 @@
|
|||
const path = require("path");
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
|
||||
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||
const resolve = dir => {
|
||||
return path.join(__dirname, dir);
|
||||
};
|
||||
/**
|
||||
* 在项目开发的时候将生产环境以及开发环境进行判断
|
||||
* 将生产环境中的路径用cdn来进行优化处理
|
||||
* 将开发环境中替换为本地的内容,方便处理bug以及开启vueDev
|
||||
* 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面
|
||||
*/
|
||||
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||
|
||||
let externals = {
|
||||
vue: "Vue",
|
||||
axios: "axios",
|
||||
"vue-router": "VueRouter",
|
||||
vuex: "Vuex",
|
||||
"view-design": "iview",
|
||||
"vue-lazyload": "VueLazyload",
|
||||
"js-cookie": "Cookies",
|
||||
wangeditor: "wangEditor",
|
||||
"sockjs-client": "SockJS",
|
||||
vuedraggable: "vuedraggable",
|
||||
"@antv/g2": "G2",
|
||||
dplayer: "DPlayer"
|
||||
};
|
||||
|
||||
// 使用CDN的内容
|
||||
let cdn = {
|
||||
css: ["https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css"],
|
||||
js: [
|
||||
// vue must at first!
|
||||
"https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/iview.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vue-lazyload@1.3.3/vue-lazyload.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/dplayer@1.25.0/dist/DPlayer.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js",
|
||||
"https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js"
|
||||
]
|
||||
};
|
||||
|
||||
// 判断是否需要加载CDN
|
||||
cdn = enableProduction ? cdn : { css: [], js: [] };
|
||||
externals = enableProduction ? externals : {};
|
||||
module.exports = {
|
||||
css: {
|
||||
loaderOptions: {
|
||||
|
@ -20,37 +65,13 @@ module.exports = {
|
|||
port: 10003
|
||||
},
|
||||
|
||||
chainWebpack: config => {
|
||||
// @ 对应 src目录
|
||||
config.resolve.alias.set("@", resolve("src"));
|
||||
},
|
||||
|
||||
// 打包时不生成.map文件 避免看到源码
|
||||
productionSourceMap: false,
|
||||
|
||||
// 部署优化
|
||||
configureWebpack: {
|
||||
// 使用CDN
|
||||
externals: {
|
||||
vue: "Vue",
|
||||
"vue-i18n": "VueI18n",
|
||||
axios: "axios",
|
||||
"vue-router": "VueRouter",
|
||||
vuex: "Vuex",
|
||||
"view-design": "iview",
|
||||
xlsx: "XLSX",
|
||||
dplayer: "DPlayer",
|
||||
"print-js": "printJS",
|
||||
html2canvas: "html2canvas",
|
||||
"vue-json-pretty": "VueJsonPretty",
|
||||
"vue-lazyload": "VueLazyload",
|
||||
gitalk: "Gitalk",
|
||||
"js-cookie": "Cookies",
|
||||
wangEditor: "wangEditor",
|
||||
stompjs: "Stomp",
|
||||
"sockjs-client": "SockJS",
|
||||
vuedraggable: "vuedraggable"
|
||||
},
|
||||
externals: externals,
|
||||
// GZIP压缩
|
||||
plugins: [
|
||||
new CompressionPlugin({
|
||||
|
@ -58,8 +79,24 @@ module.exports = {
|
|||
threshold: 10240 // 对超过10k文件压缩
|
||||
})
|
||||
],
|
||||
mode: "production",
|
||||
optimization: {
|
||||
runtimeChunk: "single",
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
// 删除注释
|
||||
output: {
|
||||
comments: false
|
||||
},
|
||||
compress: {
|
||||
drop_console: true, // 删除所有调式带有console的
|
||||
drop_debugger: true,
|
||||
pure_funcs: ["console.log"] // 删除console.log
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
splitChunks: {
|
||||
chunks: "all",
|
||||
maxInitialRequests: Infinity,
|
||||
|
@ -81,6 +118,15 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
},
|
||||
// 将cdn的资源挂载到插件上
|
||||
chainWebpack(config) {
|
||||
// @ 对应 src目录
|
||||
config.resolve.alias.set("@", resolve("src"));
|
||||
config.plugin("html").tap(args => {
|
||||
args[0].cdn = cdn;
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
pluginOptions: {
|
||||
"style-resources-loader": {
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"less-loader": "^6.2.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-resources-loader": "^1.3.2",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"view-design": "^4.6.1",
|
||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
import XLSX from 'xlsx';
|
||||
|
||||
function auto_width(ws, data){
|
||||
/*set worksheet max width per col*/
|
||||
const colWidth = data.map(row => row.map(val => {
|
||||
/*if null/undefined*/
|
||||
if (val == null) {
|
||||
return {'wch': 10};
|
||||
}
|
||||
/*if chinese*/
|
||||
else if (val.toString().charCodeAt(0) > 255) {
|
||||
return {'wch': val.toString().length * 2};
|
||||
} else {
|
||||
return {'wch': val.toString().length};
|
||||
}
|
||||
}))
|
||||
/*start in the first row*/
|
||||
let result = colWidth[0];
|
||||
for (let i = 1; i < colWidth.length; i++) {
|
||||
for (let j = 0; j < colWidth[i].length; j++) {
|
||||
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
function json_to_array(key, jsonData){
|
||||
return jsonData.map(v => key.map(j => { return v[j] }));
|
||||
}
|
||||
|
||||
// fix data,return string
|
||||
function fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
|
||||
// get head from excel file,return array
|
||||
function get_header_row(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r /* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */
|
||||
var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
||||
export const export_table_to_excel= (id, filename) => {
|
||||
const table = document.getElementById(id);
|
||||
const wb = XLSX.utils.table_to_book(table);
|
||||
XLSX.writeFile(wb, filename);
|
||||
}
|
||||
|
||||
export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
data.unshift(title);
|
||||
const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true});
|
||||
if(autoWidth){
|
||||
const arr = json_to_array(key, data);
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const arr = json_to_array(key, data);
|
||||
arr.unshift(title);
|
||||
const ws = XLSX.utils.aoa_to_sheet(arr);
|
||||
if(autoWidth){
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const read = (data, type) => {
|
||||
const workbook = XLSX.read(data, { type: type });
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[firstSheetName];
|
||||
const header = get_header_row(worksheet);
|
||||
const results = XLSX.utils.sheet_to_json(worksheet);
|
||||
return {header, results};
|
||||
}
|
||||
|
||||
export default {
|
||||
export_table_to_excel,
|
||||
export_array_to_excel,
|
||||
export_json_to_excel,
|
||||
read
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
const path = require("path");
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
|
||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||
const resolve = dir => {
|
||||
return path.join(__dirname, dir);
|
||||
};
|
||||
|
@ -23,8 +23,7 @@ let externals = {
|
|||
wangeditor: "wangEditor",
|
||||
"sockjs-client": "SockJS",
|
||||
vuedraggable: "vuedraggable",
|
||||
"@antv/g2": "G2",
|
||||
|
||||
"@antv/g2": "G2"
|
||||
};
|
||||
|
||||
// 使用CDN的内容
|
||||
|
@ -42,7 +41,7 @@ let cdn = {
|
|||
"https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js",
|
||||
"https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js",
|
||||
"https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js"
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -79,7 +78,23 @@ module.exports = {
|
|||
threshold: 10240 // 对超过10k文件压缩
|
||||
})
|
||||
],
|
||||
mode: "production",
|
||||
optimization: {
|
||||
minimizer: [
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
// 删除注释
|
||||
output: {
|
||||
comments: false
|
||||
},
|
||||
compress: {
|
||||
drop_console: true, // 删除所有调式带有console的
|
||||
drop_debugger: true,
|
||||
pure_funcs: ["console.log"] // 删除console.log
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
runtimeChunk: "single",
|
||||
splitChunks: {
|
||||
chunks: "all",
|
||||
|
|
Loading…
Reference in New Issue