优化cdn动态加载管理端,修复砍价金额bug,删除部分不规范代码
parent
84cfb26512
commit
71e4c49c3e
|
@ -12,42 +12,25 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@amap/amap-jsapi-loader": "0.0.7",
|
"@amap/amap-jsapi-loader": "0.0.7",
|
||||||
"@antv/g2": "^4.1.12",
|
"@antv/g2": "^4.1.12",
|
||||||
"apexcharts": "^3.26.0",
|
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"countup.js": "^2.0.4",
|
|
||||||
"date-fns": "^1.30.1",
|
|
||||||
"dplayer": "^1.26.0",
|
"dplayer": "^1.26.0",
|
||||||
"gitalk": "^1.6.2",
|
|
||||||
"html2canvas": "^1.0.0-rc.5",
|
|
||||||
"iview-area": "^1.6.0",
|
|
||||||
"js-cookie": "^2.2.1",
|
"js-cookie": "^2.2.1",
|
||||||
"node-sass": "^4.14.1",
|
"node-sass": "^4.14.1",
|
||||||
"pinyin": "^2.9.0",
|
|
||||||
"print-js": "^1.0.63",
|
|
||||||
"qrcodejs2": "0.0.2",
|
|
||||||
"sass-loader": "^8.0.2",
|
"sass-loader": "^8.0.2",
|
||||||
"sockjs-client": "^1.4.0",
|
"sockjs-client": "^1.4.0",
|
||||||
"stompjs": "^2.3.3",
|
|
||||||
"swiper": "^6.3.5",
|
"swiper": "^6.3.5",
|
||||||
"uuid": "^8.3.2",
|
"uuid": "^8.3.2",
|
||||||
"view-design": "^4.2.0",
|
"view-design": "^4.2.0",
|
||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
"vue-apexcharts": "^1.5.1",
|
|
||||||
"vue-awesome": "^4.0.2",
|
|
||||||
"vue-awesome-swiper": "^4.1.1",
|
"vue-awesome-swiper": "^4.1.1",
|
||||||
"vue-clipboard2": "^0.3.0",
|
|
||||||
"vue-cropper": "^0.4.9",
|
|
||||||
"vue-i18n": "^8.15.1",
|
"vue-i18n": "^8.15.1",
|
||||||
"vue-json-excel": "^0.3.0",
|
"vue-json-excel": "^0.3.0",
|
||||||
"vue-json-pretty": "^1.4.1",
|
|
||||||
"vue-lazyload": "^1.3.3",
|
|
||||||
"vue-qr": "^2.3.0",
|
"vue-qr": "^2.3.0",
|
||||||
"vue-router": "^3.1.3",
|
"vue-router": "^3.1.3",
|
||||||
"vuedraggable": "^2.23.2",
|
"vuedraggable": "^2.23.2",
|
||||||
"vuex": "^3.4.0",
|
"vuex": "^3.4.0",
|
||||||
"wangeditor": "^4.7.5",
|
"wangeditor": "^4.7.5",
|
||||||
"xlsx": "^0.16.2",
|
|
||||||
"xss": "^1.0.7"
|
"xss": "^1.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -61,6 +44,7 @@
|
||||||
"less-loader": "^6.2.0",
|
"less-loader": "^6.2.0",
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
"style-resources-loader": "^1.3.2",
|
"style-resources-loader": "^1.3.2",
|
||||||
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||||
"vue-template-compiler": "^2.6.10"
|
"vue-template-compiler": "^2.6.10"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,107 +1,86 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
<head>
|
<meta charset="utf-8" />
|
||||||
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
|
||||||
<!-- <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>
|
||||||
<title>lili admin</title>
|
<meta name="keywords" content="keywords" />
|
||||||
<meta name="keywords"
|
<meta name="description" content="description" />
|
||||||
content="keywords">
|
<% for(var css of htmlWebpackPlugin.options.cdn.css) { %>
|
||||||
<meta name="description"
|
<link rel="stylesheet" href="<%=css%>" />
|
||||||
content="description">
|
<% } %>
|
||||||
<!-- 部署CDN优化 -->
|
<style>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
|
.page-loading-wrap {
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js"></script>
|
padding: 120px;
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-i18n@8.15.1/dist/vue-i18n.min.js"></script>
|
display: flex;
|
||||||
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
|
justify-content: center;
|
||||||
<script src="https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js"></script>
|
align-items: center;
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css">
|
flex-direction: column;
|
||||||
<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>
|
|
||||||
<style>
|
|
||||||
.page-loading-wrap {
|
|
||||||
padding: 120px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.half-circle-spinner,
|
|
||||||
.half-circle-spinner * {
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.half-circle-spinner {
|
|
||||||
width: 35px;
|
|
||||||
height: 35px;
|
|
||||||
border-radius: 100%;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.half-circle-spinner .circle {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 100%;
|
|
||||||
border: calc(35px / 10) solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
.half-circle-spinner .circle.circle-1 {
|
|
||||||
border-top-color: #5cadff;
|
|
||||||
animation: half-circle-spinner-animation 1s infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
.half-circle-spinner .circle.circle-2 {
|
|
||||||
border-bottom-color: #5cadff;
|
|
||||||
animation: half-circle-spinner-animation 1s infinite alternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes half-circle-spinner-animation {
|
|
||||||
0% {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
.half-circle-spinner,
|
||||||
transform: rotate(360deg);
|
.half-circle-spinner * {
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
.half-circle-spinner {
|
||||||
<noscript>
|
width: 35px;
|
||||||
<strong>We're sorry but lili-admin doesn't work properly without JavaScript enabled. Please enable it to
|
height: 35px;
|
||||||
continue.</strong>
|
border-radius: 100%;
|
||||||
</noscript>
|
position: relative;
|
||||||
<div id="app">
|
}
|
||||||
<div class="page-loading-wrap">
|
|
||||||
<div class="half-circle-spinner">
|
.half-circle-spinner .circle {
|
||||||
<div class="circle circle-1"></div>
|
content: "";
|
||||||
<div class="circle circle-2"></div>
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 100%;
|
||||||
|
border: calc(35px / 10) solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.half-circle-spinner .circle.circle-1 {
|
||||||
|
border-top-color: #5cadff;
|
||||||
|
animation: half-circle-spinner-animation 1s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.half-circle-spinner .circle.circle-2 {
|
||||||
|
border-bottom-color: #5cadff;
|
||||||
|
animation: half-circle-spinner-animation 1s infinite alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes half-circle-spinner-animation {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</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
|
||||||
|
>
|
||||||
|
</noscript>
|
||||||
|
<div id="app">
|
||||||
|
<div class="page-loading-wrap">
|
||||||
|
<div class="half-circle-spinner">
|
||||||
|
<div class="circle circle-1"></div>
|
||||||
|
<div class="circle circle-2"></div>
|
||||||
|
</div>
|
||||||
|
<h4 style="margin-top:20px;">正在加载资源...</h4>
|
||||||
</div>
|
</div>
|
||||||
<h4 style="margin-top:20px;">正在加载资源...</h4>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</body>
|
||||||
<!-- built files will be auto injected -->
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
</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 { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios'
|
||||||
import { setStore, getStore, removeStore } from '@/libs/storage'
|
import { setStore, getStore, removeStore } from '@/libs/storage'
|
||||||
import util from '@/libs/util'
|
import util from '@/libs/util'
|
||||||
import VueLazyload from 'vue-lazyload'
|
|
||||||
|
|
||||||
import * as filters from '@/utils/filters' // global filter
|
import * as filters from '@/utils/filters' // global filter
|
||||||
import liliDialog from '@/views/lili-dialog'
|
import liliDialog from '@/views/lili-dialog'
|
||||||
|
@ -30,10 +29,7 @@ Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品
|
||||||
Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码
|
Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码
|
||||||
return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}`
|
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, {
|
Vue.use(ViewUI, {
|
||||||
i18n: (key, value) => i18n.t(key, value)
|
i18n: (key, value) => i18n.t(key, value)
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@ export const otherRouter = {
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "home",
|
path: "home",
|
||||||
title: { i18n: "home" },
|
title: '首页',
|
||||||
name: "home_index",
|
name: "home_index",
|
||||||
component: () => import("@/views/home/home.vue")
|
component: () => import("@/views/home/home.vue")
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
:data="data"
|
:data="data"
|
||||||
ref="table"
|
ref="table"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
@on-selection-change="changeSelect"
|
||||||
></Table>
|
></Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
|
<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="编号">
|
<FormItem label="编号">
|
||||||
<Input disabled v-model="form.sn" clearable style="width:100%"/>
|
<Input disabled v-model="form.sn" clearable style="width:100%"/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Card>
|
<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">
|
<Form-item label="商品名称" prop="goodsName">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.goodsName"
|
|
||||||
placeholder="请输入商品名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
<Row class="operation" style="margin:10px 0;">
|
<Row class="operation" style="margin:10px 0;">
|
||||||
<Button @click="delAll" type="primary">批量下架</Button>
|
<Button @click="delAll" type="primary">批量下架</Button>
|
||||||
</Row>
|
</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}">
|
<template slot="goodsName" slot-scope="{row}">
|
||||||
<div>
|
<div>
|
||||||
<div class="div-zoom">
|
<div class="div-zoom">
|
||||||
|
@ -24,7 +20,8 @@
|
||||||
</div>
|
</div>
|
||||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||||
<div slot="content">
|
<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>
|
</div>
|
||||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||||
</Poptip>
|
</Poptip>
|
||||||
|
@ -32,23 +29,27 @@
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<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>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { getDistributionGoods, delDistributionGoods } from "@/api/distribution";
|
||||||
getDistributionGoods,
|
import vueQr from "vue-qr";
|
||||||
delDistributionGoods
|
|
||||||
} from "@/api/distribution";
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
"vue-qr": vueQr,
|
||||||
|
},
|
||||||
name: "distributionGoods",
|
name: "distributionGoods",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: { // 搜索框初始化对象
|
searchForm: {
|
||||||
|
// 搜索框初始化对象
|
||||||
pageNumber: 1, // 当前页数
|
pageNumber: 1, // 当前页数
|
||||||
pageSize: 10, // 页面大小
|
pageSize: 10, // 页面大小
|
||||||
sort: "createTime", // 默认排序字段
|
sort: "createTime", // 默认排序字段
|
||||||
|
@ -70,35 +71,38 @@ export default {
|
||||||
key: "thumbnail",
|
key: "thumbnail",
|
||||||
width: 120,
|
width: 120,
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h("img", {
|
return h("img", {
|
||||||
attrs: {
|
attrs: {
|
||||||
src: params.row.thumbnail,
|
src: params.row.thumbnail,
|
||||||
alt: "加载图片失败"
|
alt: "加载图片失败",
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
width: "80px",
|
width: "80px",
|
||||||
height: "60px",
|
height: "60px",
|
||||||
margin: "10px 0",
|
margin: "10px 0",
|
||||||
"object-fit": "contain"
|
"object-fit": "contain",
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品名称",
|
title: "商品名称",
|
||||||
slot: "goodsName",
|
slot: "goodsName",
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
tooltip: true
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品价格",
|
title: "商品价格",
|
||||||
key: "price",
|
key: "price",
|
||||||
minWidth: 100,
|
minWidth: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h("div", this.$options.filters.unitPrice(params.row.price,'¥'));
|
return h(
|
||||||
}
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "库存",
|
title: "库存",
|
||||||
|
@ -107,21 +111,23 @@ export default {
|
||||||
{
|
{
|
||||||
title: "添加时间",
|
title: "添加时间",
|
||||||
key: "createTime",
|
key: "createTime",
|
||||||
width: 170
|
width: 170,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "店铺名称",
|
title: "店铺名称",
|
||||||
key: "storeName",
|
key: "storeName",
|
||||||
tooltip: true
|
tooltip: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "佣金金额",
|
title: "佣金金额",
|
||||||
key: "commission",
|
key: "commission",
|
||||||
sortable: false,
|
sortable: false,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h("div", this.$options.filters.unitPrice(params.row.commission,'¥'));
|
return h(
|
||||||
}
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.commission, "¥")
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
|
@ -136,22 +142,22 @@ export default {
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
type: "error",
|
type: "error",
|
||||||
size: "small"
|
size: "small",
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
click: () => {
|
click: () => {
|
||||||
this.remove(params.row);
|
this.remove(params.row);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
"下架"
|
"下架"
|
||||||
)
|
),
|
||||||
]);
|
]);
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
total: 0 // 表单数据总数
|
total: 0, // 表单数据总数
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -188,7 +194,7 @@ export default {
|
||||||
// 获取列表数据
|
// 获取列表数据
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getDistributionGoods(this.searchForm).then(res => {
|
getDistributionGoods(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.data = res.result.records;
|
this.data = res.result.records;
|
||||||
|
@ -206,14 +212,14 @@ export default {
|
||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
// 下架
|
// 下架
|
||||||
delDistributionGoods(v.id).then(res => {
|
delDistributionGoods(v.id).then((res) => {
|
||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("下架成功");
|
this.$Message.success("下架成功");
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 批量下架
|
// 批量下架
|
||||||
|
@ -227,12 +233,12 @@ export default {
|
||||||
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
let ids = []
|
let ids = [];
|
||||||
this.selectList.forEach(item => {
|
this.selectList.forEach((item) => {
|
||||||
ids.push(item.id)
|
ids.push(item.id);
|
||||||
});
|
});
|
||||||
// 批量下架
|
// 批量下架
|
||||||
delDistributionGoods(ids.toString()).then(res => {
|
delDistributionGoods(ids.toString()).then((res) => {
|
||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("下架成功");
|
this.$Message.success("下架成功");
|
||||||
|
@ -240,13 +246,13 @@ export default {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -69,10 +69,13 @@
|
||||||
} from "@/api/distribution";
|
} from "@/api/distribution";
|
||||||
import {orderStatusList} from './dataJson'
|
import {orderStatusList} from './dataJson'
|
||||||
import {getShopListData} from '@/api/shops'
|
import {getShopListData} from '@/api/shops'
|
||||||
|
import vueQr from 'vue-qr'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "distributionOrder",
|
name: "distributionOrder",
|
||||||
components: {},
|
components: {
|
||||||
|
"vue-qr":vueQr
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
timeRange: [], // 范围时间
|
timeRange: [], // 范围时间
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { setSetting, getSetting } from "@/api/index";
|
import { setSetting, getSetting } from "@/api/index";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "distributionSetting",
|
name: "distributionSetting",
|
||||||
data() {
|
data() {
|
||||||
|
@ -33,8 +32,8 @@ export default {
|
||||||
form: {
|
form: {
|
||||||
// 添加或编辑表单对象初始化数据
|
// 添加或编辑表单对象初始化数据
|
||||||
isOpen: "",
|
isOpen: "",
|
||||||
distributionDay: "", //分销关系绑定天数
|
distributionDay: 0, //分销关系绑定天数
|
||||||
cashDay: "", //分销结算天数
|
cashDay: 0, //分销结算天数
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
:data="data"
|
:data="data"
|
||||||
ref="table"
|
ref="table"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
@on-selection-change="changeSelect"
|
||||||
></Table>
|
></Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
|
|
@ -118,7 +118,11 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
|
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
|
||||||
|
import vueQr from 'vue-qr'
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
"vue-qr":vueQr
|
||||||
|
},
|
||||||
name: "goods",
|
name: "goods",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
</div>
|
</div>
|
||||||
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
|
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
|
||||||
<template slot="action" slot-scope="scope">
|
<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">
|
<Button size="small">
|
||||||
绑定
|
绑定
|
||||||
<Icon type="ios-arrow-down"></Icon>
|
<Icon type="ios-arrow-down"></Icon>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
||||||
|
|
||||||
<Dropdown transfer="true" trigger="click">
|
<Dropdown trigger="click">
|
||||||
<Button size="small">
|
<Button size="small">
|
||||||
操作
|
操作
|
||||||
<Icon type="ios-arrow-down"></Icon>
|
<Icon type="ios-arrow-down"></Icon>
|
||||||
|
@ -134,6 +134,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
submitLoading:false, //加载状态
|
||||||
categoryList: [], // 分类列表
|
categoryList: [], // 分类列表
|
||||||
loading: false, // 加载状态
|
loading: false, // 加载状态
|
||||||
brands: [], //品牌集合
|
brands: [], //品牌集合
|
||||||
|
@ -154,9 +155,9 @@ export default {
|
||||||
parentId: "",
|
parentId: "",
|
||||||
name: "",
|
name: "",
|
||||||
image: "",
|
image: "",
|
||||||
sortOrder: "",
|
sortOrder: 0,
|
||||||
deleteFlag: 0,
|
deleteFlag: 0,
|
||||||
commissionRate: "",
|
commissionRate: 0,
|
||||||
level: 0,
|
level: 0,
|
||||||
},
|
},
|
||||||
brandForm: {
|
brandForm: {
|
||||||
|
|
|
@ -142,7 +142,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="today-item">
|
<div class="today-item">
|
||||||
<div>今日交易额</div>
|
<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>
|
||||||
<div class="today-item">
|
<div class="today-item">
|
||||||
<div>今日新增店铺</div>
|
<div>今日新增店铺</div>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
</i-switch>
|
</i-switch>
|
||||||
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
|
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
|
||||||
<Button type="success" placement="right" @click="decorate(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>
|
<Button type="error" size="small">删除</Button>
|
||||||
</Poptip>
|
</Poptip>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
@on-ok="newTemplate"
|
@on-ok="newTemplate"
|
||||||
@on-cancel="showModal = false"
|
@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">
|
<FormItem label="模板名称" prop="name">
|
||||||
<Input v-model="formData.name" placeholder="请输入模板名称" />
|
<Input v-model="formData.name" placeholder="请输入模板名称" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
<script>
|
<script>
|
||||||
import * as API_Other from "@/api/other.js";
|
import * as API_Other from "@/api/other.js";
|
||||||
|
|
||||||
import QRCode from "qrcodejs2";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -66,7 +65,7 @@ export default {
|
||||||
// selected: false,
|
// selected: false,
|
||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
qrcode: "", // 二维码
|
|
||||||
submitWay: {
|
submitWay: {
|
||||||
// 表单信息
|
// 表单信息
|
||||||
pageShow: this.$route.query.type || false,
|
pageShow: this.$route.query.type || false,
|
||||||
|
@ -169,20 +168,6 @@ export default {
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.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>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="layout">
|
<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">
|
<CarouselItem v-for="(item, index) in res.list" :key="index">
|
||||||
<div>
|
<div>
|
||||||
<img class="image-mode" :src="item.img" />
|
<img class="image-mode" :src="item.img" />
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<span slot="close">关</span>
|
<span slot="close">关</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
<Button type="info" placement="right" @click="handleEdit(item)" size="small">修改</Button>
|
<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>
|
<Button type="error" size="small">删除</Button>
|
||||||
</Poptip>
|
</Poptip>
|
||||||
</div>
|
</div>
|
||||||
|
@ -79,7 +79,7 @@ export default {
|
||||||
pageType: "INDEX",
|
pageType: "INDEX",
|
||||||
pageClientType: "H5",
|
pageClientType: "H5",
|
||||||
},
|
},
|
||||||
total: "", // 页面数量
|
total: 0, // 页面数量
|
||||||
list: [], // 总数据
|
list: [], // 总数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
|
@ -49,8 +49,8 @@
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="支持电子面单">
|
<FormItem label="支持电子面单">
|
||||||
<i-switch v-model="form.standBy" size="large">
|
<i-switch v-model="form.standBy" size="large">
|
||||||
<span slot="open">开</span>
|
<span slot="OPEN">开</span>
|
||||||
<span slot="close">关</span>
|
<span slot="CLOSE">关</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="电子面单表单">
|
<FormItem label="电子面单表单">
|
||||||
|
@ -58,8 +58,8 @@
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="禁用状态" prop="disabled">
|
<FormItem label="禁用状态" prop="disabled">
|
||||||
<i-switch v-model="form.disabled" size="large">
|
<i-switch v-model="form.disabled" size="large">
|
||||||
<span slot="open">开启</span>
|
<span slot="OPEN">开启</span>
|
||||||
<span slot="close">禁用</span>
|
<span slot="CLOSE">禁用</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -100,6 +100,7 @@
|
||||||
form: {
|
form: {
|
||||||
// 添加或编辑表单对象初始化数据
|
// 添加或编辑表单对象初始化数据
|
||||||
name: "",
|
name: "",
|
||||||
|
disabled:"OPEN"
|
||||||
},
|
},
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
formValidate: {
|
formValidate: {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "footer",
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
year: new Date().getFullYear()
|
year: new Date().getFullYear()
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "header",
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,9 @@
|
||||||
|
|
||||||
<Table :loading="loading" border :columns="columns" class="mt_10" :data="data" ref="table"></Table>
|
<Table :loading="loading" border :columns="columns" class="mt_10" :data="data" ref="table"></Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<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"
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
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>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
@ -44,7 +45,7 @@
|
||||||
</Form>
|
</Form>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button @click="addFlag = false">取消</Button>
|
<Button @click="addFlag = false">取消</Button>
|
||||||
<Button type="primary" :loading="handleAddLoading" @click="addMemberSubmit">确定</Button>
|
<Button type="primary" @click="addMemberSubmit">确定</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
<!-- 修改模态框 -->
|
<!-- 修改模态框 -->
|
||||||
|
@ -108,11 +109,11 @@ import * as RegExp from "@/libs/RegExp.js";
|
||||||
export default {
|
export default {
|
||||||
name: "member",
|
name: "member",
|
||||||
components: {
|
components: {
|
||||||
region, ossManage
|
region,
|
||||||
|
ossManage,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedMember: false, //是否是其他组件调用
|
|
||||||
descTitle: "", // modal标题
|
descTitle: "", // modal标题
|
||||||
descFlag: false, //编辑查看框
|
descFlag: false, //编辑查看框
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
|
@ -210,7 +211,7 @@ export default {
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
size: "small",
|
size: "small",
|
||||||
type: params.row.___selected ? "primary" : "",
|
type: params.row.___selected ? "primary" : "default",
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
marginRight: "5px",
|
marginRight: "5px",
|
||||||
|
@ -302,7 +303,9 @@ export default {
|
||||||
// 已选择用户数据
|
// 已选择用户数据
|
||||||
selectedList: {
|
selectedList: {
|
||||||
type: null,
|
type: null,
|
||||||
default: [],
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -311,7 +314,6 @@ export default {
|
||||||
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
|
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
|
||||||
this.init(this.data);
|
this.init(this.data);
|
||||||
// 将父级数据与当前组件数据进行匹配
|
// 将父级数据与当前组件数据进行匹配
|
||||||
|
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
@ -381,7 +383,7 @@ export default {
|
||||||
},
|
},
|
||||||
addMember() {
|
addMember() {
|
||||||
this.addFlag = true;
|
this.addFlag = true;
|
||||||
this.$refs.addMemberForm.resetFields()
|
this.$refs.addMemberForm.resetFields();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 查询查看会员详情
|
* 查询查看会员详情
|
||||||
|
@ -416,7 +418,7 @@ export default {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
API_Member.addMember(this.addMemberForm).then((res) => {
|
API_Member.addMember(this.addMemberForm).then((res) => {
|
||||||
if (res.result) {
|
if (res.result) {
|
||||||
this.$refs.addMemberForm.resetFields()
|
this.$refs.addMemberForm.resetFields();
|
||||||
this.getData();
|
this.getData();
|
||||||
this.$Message.success("添加成功!");
|
this.$Message.success("添加成功!");
|
||||||
this.addFlag = false;
|
this.addFlag = false;
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card class="mt_10">
|
<Card class="mt_10">
|
||||||
<Tabs type="point" @on-click="memberInfoChange">
|
<Tabs value="point" @on-click="memberInfoChange">
|
||||||
<TabPane label="TA的积分" name="point">
|
<TabPane label="TA的积分" name="point">
|
||||||
<div class="pointsTitle" style="justify-content: flex-start; text-align: left;">
|
<div class="pointsTitle" style="justify-content: flex-start; text-align: left;">
|
||||||
<div style="width: 120px;">
|
<div style="width: 120px;">
|
||||||
|
@ -203,7 +203,6 @@
|
||||||
ref="table"
|
ref="table"
|
||||||
class="mt_10"
|
class="mt_10"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
@on-sort-change="addressChangeSort"
|
|
||||||
>
|
>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
|
@ -339,8 +338,8 @@
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="默认" prop="isDefault">
|
<FormItem label="默认" prop="isDefault">
|
||||||
<RadioGroup type="button" button-style="solid" v-model="addressForm.isDefault">
|
<RadioGroup type="button" button-style="solid" v-model="addressForm.isDefault">
|
||||||
<Radio :label=true>是</Radio>
|
<Radio label="1">是</Radio>
|
||||||
<Radio :label=false>否</Radio>
|
<Radio label="0">否</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -378,7 +377,7 @@
|
||||||
addressModalVisible: false, //会员地址操作弹出框
|
addressModalVisible: false, //会员地址操作弹出框
|
||||||
addressForm: {
|
addressForm: {
|
||||||
id: "",
|
id: "",
|
||||||
isDefault: false
|
isDefault: "0"
|
||||||
|
|
||||||
},//会员地址操作form
|
},//会员地址操作form
|
||||||
selectDate: null, // 选择时间段
|
selectDate: null, // 选择时间段
|
||||||
|
@ -665,7 +664,7 @@
|
||||||
key: "isDefault",
|
key: "isDefault",
|
||||||
width: 80,
|
width: 80,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.isDefault) {
|
if (params.row.isDefault == "1") {
|
||||||
return h('div', [
|
return h('div', [
|
||||||
h('span', {}, "是"),
|
h('span', {}, "是"),
|
||||||
]);
|
]);
|
||||||
|
@ -981,7 +980,7 @@
|
||||||
this.addressModalVisible = true
|
this.addressModalVisible = true
|
||||||
this.addressForm = {
|
this.addressForm = {
|
||||||
id: "",
|
id: "",
|
||||||
isDefault: false,
|
isDefault: "0",
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -998,9 +997,11 @@
|
||||||
this.$refs.addressForm.validate((valid) => {
|
this.$refs.addressForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.submitLoading = true;
|
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;
|
this.submitLoading = false;
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
this.$Message.success("修改成功");
|
this.$Message.success("修改成功");
|
||||||
|
@ -1010,7 +1011,7 @@
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//添加地址
|
//添加地址
|
||||||
API_Member.addMemberAddress(this.addressForm).then((res) => {
|
API_Member.addMemberAddress(submit).then((res) => {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
if (res && res.success) {
|
if (res && res.success) {
|
||||||
this.$Message.success("添加成功");
|
this.$Message.success("添加成功");
|
||||||
|
|
|
@ -3,100 +3,46 @@
|
||||||
<Row>
|
<Row>
|
||||||
<Card>
|
<Card>
|
||||||
<Row @keydown.enter.native="handleSearch">
|
<Row @keydown.enter.native="handleSearch">
|
||||||
<Form
|
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||||
ref="searchForm"
|
|
||||||
:model="searchForm"
|
|
||||||
inline
|
|
||||||
:label-width="70"
|
|
||||||
class="search-form"
|
|
||||||
>
|
|
||||||
<Form-item label="会员名称" prop="username">
|
<Form-item label="会员名称" prop="username">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.username" placeholder="请输入会员名称" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.username"
|
|
||||||
placeholder="请输入会员名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
|
||||||
<Form-item label="联系方式" prop="mobile">
|
<Form-item label="联系方式" prop="mobile">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.mobile" placeholder="请输入会员联系方式" clearable style="width: 200px" />
|
||||||
type="text"
|
|
||||||
v-model="searchForm.mobile"
|
|
||||||
placeholder="请输入会员联系方式"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button >
|
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" sortable="custom">
|
||||||
:loading="loading"
|
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
ref="table"
|
|
||||||
class="mt_10"
|
|
||||||
sortable="custom"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
>
|
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
<Page
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
:current="searchForm.pageNumber"
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||||
:total="total"
|
show-sizer></Page>
|
||||||
: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>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<!-- 修改模态框 -->
|
<!-- 修改模态框 -->
|
||||||
<Modal v-model="descFlag" :title="descTitle" @on-ok="handleSubmitModal" width="500">
|
<Modal v-model="descFlag" :title="descTitle" @on-ok="handleSubmitModal" width="500">
|
||||||
<Form
|
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
|
||||||
ref="formValidate"
|
|
||||||
:model="formValidate"
|
|
||||||
:rules="ruleValidate"
|
|
||||||
:label-width="80"
|
|
||||||
>
|
|
||||||
<FormItem label="头像">
|
<FormItem label="头像">
|
||||||
<img :src="formValidate.face" class="face"/>
|
<img :src="formValidate.face" class="face" />
|
||||||
<Button
|
<Button type="text" class="upload" @click="
|
||||||
type="text"
|
|
||||||
class="upload"
|
|
||||||
@click="
|
|
||||||
() => {
|
() => {
|
||||||
this.picModelFlag = true;
|
this.picModelFlag = true;
|
||||||
this.$refs.ossManage.selectImage = true;
|
this.$refs.ossManage.selectImage = true;
|
||||||
}
|
}
|
||||||
"
|
">修改
|
||||||
>修改
|
</Button>
|
||||||
</Button
|
<input type="file" style="display: none" id="file" />
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="file"
|
|
||||||
style="display: none"
|
|
||||||
id="file"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="会员名称" prop="name">
|
<FormItem label="会员名称" prop="name">
|
||||||
<Input
|
<Input v-model="formValidate.username" style="width: 200px" disabled />
|
||||||
v-model="formValidate.username"
|
|
||||||
style="width: 200px"
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="用户昵称" prop="name">
|
<FormItem label="用户昵称" prop="name">
|
||||||
<Input v-model="formValidate.nickName" style="width: 200px"/>
|
<Input v-model="formValidate.nickName" style="width: 200px" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="性别" prop="sex">
|
<FormItem label="性别" prop="sex">
|
||||||
<RadioGroup type="button" button-style="solid" v-model="formValidate.sex">
|
<RadioGroup type="button" button-style="solid" v-model="formValidate.sex">
|
||||||
|
@ -109,137 +55,123 @@
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="修改密码" prop="password">
|
<FormItem label="修改密码" prop="password">
|
||||||
<Input
|
<Input type="password" style="width: 220px" password v-model="formValidate.newPassword" />
|
||||||
type="password"
|
|
||||||
style="width: 220px"
|
|
||||||
password
|
|
||||||
v-model="formValidate.newPassword"
|
|
||||||
/>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="生日" prop="birthday">
|
<FormItem label="生日" prop="birthday">
|
||||||
<DatePicker
|
<DatePicker type="date" format="yyyy-MM-dd" v-model="formValidate.birthday" style="width: 220px"></DatePicker>
|
||||||
type="date"
|
|
||||||
format="yyyy-MM-dd"
|
|
||||||
v-model="formValidate.birthday"
|
|
||||||
style="width: 220px"
|
|
||||||
></DatePicker>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="所在地" prop="mail">
|
<FormItem label="所在地" prop="mail">
|
||||||
<div class="form-item" v-if="!updateRegion">
|
<div class="form-item" v-if="!updateRegion">
|
||||||
<Input disabled style="width: 250px" :value="formValidate.region"/>
|
<Input disabled style="width: 250px" :value="formValidate.region" />
|
||||||
<Button
|
<Button type="text" @click="
|
||||||
type="text"
|
|
||||||
@click="
|
|
||||||
() => {
|
() => {
|
||||||
this.updateRegion = !this.updateRegion;
|
this.updateRegion = !this.updateRegion;
|
||||||
}
|
}
|
||||||
"
|
">修改
|
||||||
>修改
|
</Button>
|
||||||
</Button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-item" v-else>
|
<div class="form-item" v-else>
|
||||||
<region style="width: 250px" @selected="selectedRegion"/>
|
<region style="width: 250px" @selected="selectedRegion" />
|
||||||
</div>
|
</div>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal width="1200px" v-model="picModelFlag">
|
<Modal width="1200px" v-model="picModelFlag">
|
||||||
<ossManage @callback="callbackSelected" ref="ossManage"/>
|
<ossManage @callback="callbackSelected" ref="ossManage" />
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import region from "@/views/lili-components/region";
|
import region from "@/views/lili-components/region";
|
||||||
import * as API_Member from "@/api/member.js";
|
import * as API_Member from "@/api/member.js";
|
||||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||||
|
|
||||||
|
export default {
|
||||||
export default {
|
name: "memberRecycle",
|
||||||
name: "memberRecycle",
|
components: {
|
||||||
components: {
|
region,
|
||||||
region,
|
ossManage,
|
||||||
ossManage,
|
},
|
||||||
},
|
data() {
|
||||||
data() {
|
return {
|
||||||
return {
|
selectedMember: false, //是否是其他组件调用
|
||||||
selectedMember: false, //是否是其他组件调用
|
descTitle: "", // modal标题
|
||||||
descTitle: "", // modal标题
|
descFlag: false, //编辑查看框
|
||||||
descFlag: false, //编辑查看框
|
openSearch: true, // 显示搜索
|
||||||
openSearch: true, // 显示搜索
|
loading: true, // 表单加载状态
|
||||||
loading: true, // 表单加载状态
|
updateRegion: false, // 显示所在地
|
||||||
updateRegion: false, // 显示所在地
|
searchForm: {
|
||||||
searchForm: { // 请求参数
|
// 请求参数
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
order: "desc",
|
order: "desc",
|
||||||
username: "",
|
username: "",
|
||||||
mobile: "",
|
mobile: "",
|
||||||
disabled: "CLOSE"
|
disabled: "CLOSE",
|
||||||
|
},
|
||||||
|
picModelFlag: false, // 选择图片
|
||||||
|
formValidate: {}, // 表单数据
|
||||||
|
ruleValidate: {}, //修改验证
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "会员名称",
|
||||||
|
align: "left",
|
||||||
|
key: "username",
|
||||||
|
tooltip: true,
|
||||||
},
|
},
|
||||||
picModelFlag: false, // 选择图片
|
{
|
||||||
formValidate: {}, // 表单数据
|
title: "昵称",
|
||||||
ruleValidate: {}, //修改验证
|
align: "left",
|
||||||
columns: [
|
key: "nickName",
|
||||||
{
|
tooltip: true,
|
||||||
title: "会员名称",
|
},
|
||||||
align: "left",
|
{
|
||||||
key: "username",
|
title: "联系方式",
|
||||||
tooltip: true
|
width: 130,
|
||||||
|
key: "mobile",
|
||||||
},
|
render: (h, params) => {
|
||||||
{
|
if (params.row.mobile == null) {
|
||||||
|
return h("div", [h("span", {}, "")]);
|
||||||
title: "昵称",
|
} else {
|
||||||
align: "left",
|
return h("div", [h("span", {}, params.row.mobile)]);
|
||||||
key: "nickName",
|
|
||||||
tooltip: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "联系方式",
|
|
||||||
width: 130,
|
|
||||||
key: "mobile",
|
|
||||||
render: (h, params) => {
|
|
||||||
if (params.row.mobile == null) {
|
|
||||||
return h('div', [h('span', {}, "")]);
|
|
||||||
} else {
|
|
||||||
return h('div', [h('span', {}, params.row.mobile)]);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "注册时间",
|
{
|
||||||
key: "createTime",
|
title: "注册时间",
|
||||||
width: 180
|
key: "createTime",
|
||||||
},
|
width: 180,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "积分数量",
|
title: "积分数量",
|
||||||
align: "left",
|
align: "left",
|
||||||
width: 120,
|
width: 120,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h(
|
return h(
|
||||||
"div",
|
"div",
|
||||||
{},
|
{},
|
||||||
params.row.point == void 0 ? "0" : params.row.point
|
params.row.point == void 0 ? "0" : params.row.point
|
||||||
);
|
);
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "操作",
|
{
|
||||||
key: "action",
|
title: "操作",
|
||||||
align: "center",
|
key: "action",
|
||||||
width: 200,
|
align: "center",
|
||||||
fixed: "right",
|
width: 200,
|
||||||
render: (h, params) => {
|
fixed: "right",
|
||||||
return h("div", {
|
render: (h, params) => {
|
||||||
|
return h(
|
||||||
|
"div",
|
||||||
|
{
|
||||||
style: {
|
style: {
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "center"
|
justifyContent: "center",
|
||||||
}
|
},
|
||||||
}, [
|
},
|
||||||
|
[
|
||||||
h(
|
h(
|
||||||
"Button",
|
"Button",
|
||||||
{
|
{
|
||||||
|
@ -282,7 +214,7 @@
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
size: "small",
|
size: "small",
|
||||||
type: "success"
|
type: "success",
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
marginRight: "5px",
|
marginRight: "5px",
|
||||||
|
@ -303,7 +235,7 @@
|
||||||
props: {
|
props: {
|
||||||
type: "info",
|
type: "info",
|
||||||
size: "small",
|
size: "small",
|
||||||
ghost:true
|
ghost: true,
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
marginRight: "5px",
|
marginRight: "5px",
|
||||||
|
@ -316,140 +248,141 @@
|
||||||
},
|
},
|
||||||
"编辑"
|
"编辑"
|
||||||
),
|
),
|
||||||
]);
|
]
|
||||||
},
|
);
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
data: [], // 表单数据
|
],
|
||||||
total: 0, // 表单数据总数
|
data: [], // 表单数据
|
||||||
};
|
total: 0, // 表单数据总数
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 回调给父级
|
||||||
|
callback(val) {
|
||||||
|
this.$emit("callback", val);
|
||||||
|
},
|
||||||
|
// 初始化数据
|
||||||
|
init() {
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
// 分页 修改页码
|
||||||
|
changePage(v) {
|
||||||
|
this.searchForm.pageNumber = v;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
// 分页 修改页数
|
||||||
|
changePageSize(v) {
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = v;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
// 搜索
|
||||||
|
handleSearch() {
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
|
this.searchForm.pageSize = 10;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
//查看详情修改
|
||||||
|
editPerm(val) {
|
||||||
|
this.descTitle = `查看用户 ${val.username}`;
|
||||||
|
this.descFlag = true;
|
||||||
|
this.updateRegion = false;
|
||||||
|
this.getMemberInfo(val.id);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 查询查看会员详情
|
||||||
|
*/
|
||||||
|
getMemberInfo(id) {
|
||||||
|
API_Member.getMemberInfoData(id).then((res) => {
|
||||||
|
if (res.result) {
|
||||||
|
this.$set(this, "formValidate", res.result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//查询会员列表
|
||||||
|
getData() {
|
||||||
|
API_Member.getMemberListData(this.searchForm).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.loading = false;
|
||||||
|
this.data = res.result.records;
|
||||||
|
this.total = res.result.total;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 选中的图片
|
||||||
|
callbackSelected(val) {
|
||||||
|
this.picModelFlag = false;
|
||||||
|
this.formValidate.face = val.url;
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
// 回调给父级
|
|
||||||
callback(val) {
|
|
||||||
this.$emit("callback", val);
|
|
||||||
},
|
|
||||||
// 初始化数据
|
|
||||||
init() {
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
// 分页 修改页码
|
|
||||||
changePage(v) {
|
|
||||||
this.searchForm.pageNumber = v;
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
// 分页 修改页数
|
|
||||||
changePageSize(v) {
|
|
||||||
this.searchForm.pageNumber = 1;
|
|
||||||
this.searchForm.pageSize = v;
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
// 搜索
|
|
||||||
handleSearch() {
|
|
||||||
this.searchForm.pageNumber = 1;
|
|
||||||
this.searchForm.pageSize = 10;
|
|
||||||
this.getData();
|
|
||||||
},
|
|
||||||
//查看详情修改
|
|
||||||
editPerm(val) {
|
|
||||||
this.descTitle = `查看用户 ${val.username}`;
|
|
||||||
this.descFlag = true;
|
|
||||||
this.updateRegion = false
|
|
||||||
this.getMemberInfo(val.id);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 查询查看会员详情
|
|
||||||
*/
|
|
||||||
getMemberInfo(id) {
|
|
||||||
API_Member.getMemberInfoData(id).then((res) => {
|
|
||||||
if (res.result) {
|
|
||||||
this.$set(this, "formValidate", res.result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//查询会员列表
|
|
||||||
getData() {
|
|
||||||
API_Member.getMemberListData(this.searchForm).then((res) => {
|
|
||||||
if (res.result.records) {
|
|
||||||
this.loading = false
|
|
||||||
this.data = res.result.records;
|
|
||||||
this.total = res.result.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 选中的图片
|
|
||||||
callbackSelected(val) {
|
|
||||||
this.picModelFlag = false;
|
|
||||||
this.formValidate.face = val.url;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 选中的地址
|
// 选中的地址
|
||||||
selectedRegion(val) {
|
selectedRegion(val) {
|
||||||
this.region = val[1];
|
this.region = val[1];
|
||||||
this.regionId = val[0];
|
this.regionId = val[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
//详细
|
//详细
|
||||||
detail(row){
|
detail(row) {
|
||||||
this.$router.push({ name: "member-detail", query: { id: row.id } });
|
this.$router.push({ name: "member-detail", query: { id: row.id } });
|
||||||
},
|
},
|
||||||
//启用会员
|
//启用会员
|
||||||
enable(v) {
|
enable(v) {
|
||||||
let params = {
|
let params = {
|
||||||
memberIds: [v.id],
|
memberIds: [v.id],
|
||||||
disabled: true
|
disabled: true,
|
||||||
}
|
};
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: '提示',
|
title: "提示",
|
||||||
content: '<p>启用用此会员?</p>',
|
content: "<p>启用用此会员?</p>",
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
API_Member.updateMemberStatus(params).then(res => {
|
API_Member.updateMemberStatus(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('禁用成功');
|
this.$Message.success("禁用成功");
|
||||||
this.getData()
|
this.getData();
|
||||||
} else {
|
} else {
|
||||||
// this.$Message.error(res.message);
|
// this.$Message.error(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提交修改数据
|
// 提交修改数据
|
||||||
handleSubmitModal() {
|
handleSubmitModal() {
|
||||||
const {nickName, sex, username, face, newPassword} = this.formValidate;
|
const { nickName, sex, username, face, newPassword } = this.formValidate;
|
||||||
let time = new Date(this.formValidate.birthday);
|
let time = new Date(this.formValidate.birthday);
|
||||||
let birthday =
|
let birthday =
|
||||||
time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
|
time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate();
|
||||||
let submit = {
|
let submit = {
|
||||||
regionId: this.regionId,
|
regionId: this.regionId,
|
||||||
region: this.region,
|
region: this.region,
|
||||||
nickName,
|
nickName,
|
||||||
username,
|
username,
|
||||||
sex,
|
sex,
|
||||||
birthday,
|
birthday,
|
||||||
face,
|
face,
|
||||||
};
|
};
|
||||||
if (newPassword) {
|
if (newPassword) {
|
||||||
submit.password = this.md5(newPassword);
|
submit.password = this.md5(newPassword);
|
||||||
|
}
|
||||||
|
API_Member.updateMember(submit).then((res) => {
|
||||||
|
if (res.result) {
|
||||||
|
this.$Message.success("修改成功!");
|
||||||
|
this.init();
|
||||||
}
|
}
|
||||||
API_Member.updateMember(submit).then((res) => {
|
});
|
||||||
if (res.result) {
|
|
||||||
this.$Message.success("修改成功!");
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
},
|
||||||
this.init();
|
mounted() {
|
||||||
},
|
this.init();
|
||||||
};
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.face {
|
.face {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
<Cascader
|
<Cascader
|
||||||
v-model="selectDep"
|
v-model="selectDep"
|
||||||
:data="department"
|
:data="department"
|
||||||
:load-data="loadData"
|
|
||||||
@on-change="handleChangeDep"
|
@on-change="handleChangeDep"
|
||||||
change-on-select
|
change-on-select
|
||||||
filterable
|
filterable
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||||
import { getRegion } from "@/api/common.js";
|
import { getRegion } from "@/api/common.js";
|
||||||
export default {
|
export default {
|
||||||
name: "map",
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showMap: false, // modal显隐
|
showMap: false, // modal显隐
|
||||||
|
|
|
@ -121,9 +121,12 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
|
import vueQr from 'vue-qr'
|
||||||
export default {
|
export default {
|
||||||
name: "orderList",
|
name: "orderList",
|
||||||
|
components: {
|
||||||
|
"vue-qr":vueQr
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
|
|
|
@ -72,12 +72,11 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
import vueQr from 'vue-qr'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "orderComplaint",
|
name: "orderComplaint",
|
||||||
components: {
|
components: {
|
||||||
uploadPicThumb
|
"vue-qr":vueQr
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -158,9 +158,9 @@ export default {
|
||||||
fixed: "right",
|
fixed: "right",
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.payStatus == "PAID") {
|
if (params.row.payStatus == "PAID") {
|
||||||
return h("div", [h("span", {}, "已付款")]);
|
return h("div", [h("Tag", {props:{color:'green'}}, "已付款")]);
|
||||||
} else {
|
} 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>
|
<Input v-model="addressForm.consigneeMobile" size="large" maxlength="11"></Input>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="地址信息" prop="consigneeAddressPath">
|
<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"
|
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary"
|
||||||
icon="ios-create-outline" style="margin-left: 8px">修改
|
icon="ios-create-outline" style="margin-left: 8px">修改
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -300,16 +300,18 @@
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
import * as RegExp from "@/libs/RegExp.js";
|
import * as RegExp from "@/libs/RegExp.js";
|
||||||
import region from "@/views/lili-components/region";
|
import region from "@/views/lili-components/region";
|
||||||
|
import vueQr from 'vue-qr'
|
||||||
export default {
|
export default {
|
||||||
name: "orderList",
|
name: "orderList",
|
||||||
components: {
|
components: {
|
||||||
region,
|
region,
|
||||||
|
"vue-qr":vueQr
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading:false, //加载表格
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
region: [], //地区
|
addr: "", //地区
|
||||||
regionId: [], //地区id
|
regionId: [], //地区id
|
||||||
showRegion: false, // 显示地区
|
showRegion: false, // 显示地区
|
||||||
orderLogInfo: [], //订单日志数据
|
orderLogInfo: [], //订单日志数据
|
||||||
|
@ -554,7 +556,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 选中的地址
|
// 选中的地址
|
||||||
selectedRegion(val) {
|
selectedRegion(val) {
|
||||||
this.region = val[1];
|
this.addr = val[1];
|
||||||
this.regionId = val[0];
|
this.regionId = val[0];
|
||||||
},
|
},
|
||||||
//订单取消
|
//订单取消
|
||||||
|
@ -587,7 +589,7 @@ export default {
|
||||||
editAddress() {
|
editAddress() {
|
||||||
this.addressModal = true;
|
this.addressModal = true;
|
||||||
this.showRegion = false;
|
this.showRegion = false;
|
||||||
this.region = this.orderInfo.order.consigneeAddressPath;
|
this.addr = this.orderInfo.order.consigneeAddressPath;
|
||||||
this.regionId = this.orderInfo.order.consigneeAddressIdPath;
|
this.regionId = this.orderInfo.order.consigneeAddressIdPath;
|
||||||
this.addressForm.consigneeName = this.orderInfo.order.consigneeName;
|
this.addressForm.consigneeName = this.orderInfo.order.consigneeName;
|
||||||
this.addressForm.consigneeMobile = this.orderInfo.order.consigneeMobile;
|
this.addressForm.consigneeMobile = this.orderInfo.order.consigneeMobile;
|
||||||
|
@ -603,7 +605,7 @@ export default {
|
||||||
this.$Message.error("请选择地址");
|
this.$Message.error("请选择地址");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.addressForm.consigneeAddressPath = this.region;
|
this.addressForm.consigneeAddressPath = this.addr;
|
||||||
this.addressForm.consigneeAddressIdPath = this.regionId;
|
this.addressForm.consigneeAddressIdPath = this.regionId;
|
||||||
this.$refs.addressForm.validate((valid) => {
|
this.$refs.addressForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
</download-excel>
|
</download-excel>
|
||||||
</div>
|
</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">
|
<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"
|
<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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
submitLoading:false,
|
||||||
loading: false, // 加载状态
|
loading: false, // 加载状态
|
||||||
expandLevel: 1, // 展开的层级
|
expandLevel: 1, // 展开的层级
|
||||||
modalType: 0, // 添加或编辑标识
|
modalType: 0, // 添加或编辑标识
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
<editor openXss v-model="form.content"></editor>
|
<editor openXss v-model="form.content"></editor>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="是否展示" prop="openStatus">
|
<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="open">展示</span>
|
||||||
<span slot="close">隐藏</span>
|
<span slot="close">隐藏</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
|
@ -169,7 +169,7 @@ export default {
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
size: "small",
|
size: "small",
|
||||||
type: this.selectedIndex == params.index ? "primary" : "",
|
type: this.selectedIndex == params.index ? "primary" : "default",
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
marginRight: "5px",
|
marginRight: "5px",
|
||||||
|
|
|
@ -19,18 +19,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</Card>
|
</Card>
|
||||||
<Modal
|
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||||
:title="modalTitle"
|
<Form ref="form" :model="form" :label-width="100" >
|
||||||
v-model="modalVisible"
|
|
||||||
:mask-closable="false"
|
|
||||||
:width="500"
|
|
||||||
>
|
|
||||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
|
||||||
<FormItem label="热词" prop="name">
|
<FormItem label="热词" prop="name">
|
||||||
<Input v-model="form.keywords" clearable style="width: 100%"/>
|
<Input v-model="form.keywords" clearable style="width: 100%" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="分数" prop="name">
|
<FormItem label="分数" prop="name">
|
||||||
<Input v-model="form.point" clearable style="width: 100%"/>
|
<Input v-model="form.point" clearable style="width: 100%" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
</Form>
|
</Form>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
|
@ -42,18 +37,17 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { getHotWords, setHotWords } from "@/api/index";
|
||||||
getHotWords,
|
|
||||||
setHotWords
|
|
||||||
} from "@/api/index";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "hotWords",
|
name: "hotWords",
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
submitLoading:false,
|
||||||
|
modalTitle: "",
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
modalVisible: false,//弹出框
|
modalVisible: false, //弹出框
|
||||||
form: {
|
form: {
|
||||||
keywords: "",
|
keywords: "",
|
||||||
point: 0,
|
point: 0,
|
||||||
|
@ -97,7 +91,7 @@ export default {
|
||||||
if (words) {
|
if (words) {
|
||||||
this.form.keywords = words;
|
this.form.keywords = words;
|
||||||
} else {
|
} else {
|
||||||
this.form.keywords = '';
|
this.form.keywords = "";
|
||||||
}
|
}
|
||||||
this.form.point = 1;
|
this.form.point = 1;
|
||||||
this.$refs.form.resetFields();
|
this.$refs.form.resetFields();
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
<Button v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" @click="remove(row)">下架
|
<Button v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" @click="remove(row)">下架
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
|
@ -201,6 +202,7 @@ export default {
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
total: 0, // 表单数据总数
|
total: 0, // 表单数据总数
|
||||||
refreshTable: true, // 修改选中状态后刷新表格
|
refreshTable: true, // 修改选中状态后刷新表格
|
||||||
|
selectDate:[], //选中的信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
|
@ -212,7 +214,9 @@ export default {
|
||||||
//已选择优惠券
|
//已选择优惠券
|
||||||
selectedList: {
|
selectedList: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: [],
|
default: ()=>{
|
||||||
|
return []
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="content-goods-publish">
|
<div class="content-goods-publish">
|
||||||
<Form ref="form" :model="form" :label-width="70">
|
<Form ref="form" :label-width="70">
|
||||||
<div class="base-info-item">
|
<div class="base-info-item">
|
||||||
<h4>优惠券活动详情</h4>
|
<h4>优惠券活动详情</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
|
@ -20,7 +20,6 @@
|
||||||
<span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
|
<span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="活动状态">
|
<FormItem label="活动状态">
|
||||||
|
|
||||||
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
|
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
|
||||||
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
|
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
|
||||||
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
|
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
|
||||||
|
|
|
@ -4,21 +4,11 @@
|
||||||
<Row>
|
<Row>
|
||||||
<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="promotionName">
|
<Form-item label="活动名称" prop="promotionName">
|
||||||
<Input
|
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable
|
||||||
type="text"
|
style="width: 200px" />
|
||||||
v-model="searchForm.promotionName"
|
|
||||||
placeholder="请输入活动名称"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
/>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动状态" prop="promotionStatus">
|
<Form-item label="活动状态" prop="promotionStatus">
|
||||||
<Select
|
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||||
v-model="searchForm.promotionStatus"
|
|
||||||
placeholder="请选择"
|
|
||||||
clearable
|
|
||||||
style="width: 200px"
|
|
||||||
>
|
|
||||||
<Option value="NEW">未开始</Option>
|
<Option value="NEW">未开始</Option>
|
||||||
<Option value="START">已开始/上架</Option>
|
<Option value="START">已开始/上架</Option>
|
||||||
<Option value="END">已结束/下架</Option>
|
<Option value="END">已结束/下架</Option>
|
||||||
|
@ -26,26 +16,13 @@
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动时间">
|
<Form-item label="活动时间">
|
||||||
<DatePicker
|
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||||
v-model="selectDate"
|
</DatePicker>
|
||||||
type="daterange"
|
|
||||||
clearable
|
|
||||||
placeholder="选择起始时间"
|
|
||||||
style="width: 200px"
|
|
||||||
></DatePicker>
|
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
<Table
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" sortable="custom">
|
||||||
:loading="loading"
|
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="data"
|
|
||||||
ref="table"
|
|
||||||
class="mt_10"
|
|
||||||
sortable="custom"
|
|
||||||
>
|
|
||||||
<template slot-scope="{ row }" slot="applyEndTime">
|
<template slot-scope="{ row }" slot="applyEndTime">
|
||||||
{{ unixDate(row.applyEndTime) }}
|
{{ unixDate(row.applyEndTime) }}
|
||||||
</template>
|
</template>
|
||||||
|
@ -58,36 +35,17 @@
|
||||||
<template slot-scope="{ row }" slot="action">
|
<template slot-scope="{ row }" slot="action">
|
||||||
<div>
|
<div>
|
||||||
<Button type="info" size="small" @click="view(row)">查看</Button>
|
<Button type="info" size="small" @click="view(row)">查看</Button>
|
||||||
<Button
|
<Button type="error" v-if="row.promotionStatus === 'START'" style="margin-left:5px" size="small"
|
||||||
type="error"
|
@click="openOrClose(row)">关闭</Button>
|
||||||
v-if="row.promotionStatus === 'START'"
|
<Button type="success" v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'"
|
||||||
style="margin-left:5px"
|
style="margin-left:5px" size="small" @click="openOrClose(row)">开启</Button>
|
||||||
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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<Row type="flex" justify="end" class="mt_10">
|
||||||
<Page
|
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||||
:current="searchForm.pageNumber"
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||||
:total="total"
|
show-sizer></Page>
|
||||||
: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>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -98,14 +56,18 @@ import { getFullDiscountList, updateFullDiscount } from "@/api/promotion.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectDate: [],
|
||||||
|
total: 0,
|
||||||
loading: false, // 表单加载状态
|
loading: false, // 表单加载状态
|
||||||
searchForm: { // 请求参数
|
searchForm: {
|
||||||
|
// 请求参数
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
sort: "startTime",
|
sort: "startTime",
|
||||||
order: "desc",
|
order: "desc",
|
||||||
},
|
},
|
||||||
columns: [ // 表头
|
columns: [
|
||||||
|
// 表头
|
||||||
{
|
{
|
||||||
title: "活动名称",
|
title: "活动名称",
|
||||||
key: "promotionName",
|
key: "promotionName",
|
||||||
|
@ -180,12 +142,12 @@ export default {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
// 开启或关闭活动
|
// 开启或关闭活动
|
||||||
openOrClose (row) {
|
openOrClose(row) {
|
||||||
let name = '开启'
|
let name = "开启";
|
||||||
let status = 'START'
|
let status = "START";
|
||||||
if (row.promotionStatus === 'START') {
|
if (row.promotionStatus === "START") {
|
||||||
name = '关闭'
|
name = "关闭";
|
||||||
status = 'CLOSE'
|
status = "CLOSE";
|
||||||
}
|
}
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
|
@ -243,7 +205,6 @@ export default {
|
||||||
// 查看
|
// 查看
|
||||||
this.$router.push({ name: "full-cut-detail", query: { id: row.id } });
|
this.$router.push({ name: "full-cut-detail", query: { id: row.id } });
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
|
|
@ -154,7 +154,6 @@
|
||||||
border
|
border
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="form.promotionGoodsList"
|
:data="form.promotionGoodsList"
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
>
|
>
|
||||||
<template slot-scope="{ row }" slot="goodsName">
|
<template slot-scope="{ row }" slot="goodsName">
|
||||||
<div>
|
<div>
|
||||||
|
@ -183,8 +182,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
||||||
import { getGoodsSkuData } from "@/api/goods";
|
import { getGoodsSkuData } from "@/api/goods";
|
||||||
|
import vueQr from 'vue-qr'
|
||||||
export default {
|
export default {
|
||||||
name: "addFullCut",
|
name: "addFullCut",
|
||||||
|
components: {
|
||||||
|
"vue-qr":vueQr
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: { // 表单
|
form: { // 表单
|
||||||
|
|
|
@ -8,69 +8,39 @@
|
||||||
|
|
||||||
<FormItem label="选择商品" prop="scopeType">
|
<FormItem label="选择商品" prop="scopeType">
|
||||||
<Button type="primary" @click="openSkuList">选择商品</Button>
|
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||||
<Button
|
<Button type="error" ghost style="margin-left: 10px" @click="delSelectGoods">批量删除
|
||||||
type="error"
|
</Button>
|
||||||
ghost
|
|
||||||
style="margin-left: 10px"
|
|
||||||
@click="delSelectGoods"
|
|
||||||
>批量删除
|
|
||||||
</Button
|
|
||||||
>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem astyle="width: 100%">
|
<FormItem astyle="width: 100%">
|
||||||
<Table
|
<Table border :columns="columns" :data="form.promotionGoodsList" @on-selection-change="changeSelect">
|
||||||
border
|
|
||||||
:columns="columns"
|
|
||||||
:data="form.promotionGoodsList"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
>
|
|
||||||
<template slot-scope="{ row }" slot="skuId">
|
<template slot-scope="{ row }" slot="skuId">
|
||||||
<div>{{ row.skuId }}</div>
|
<div>{{ row.skuId }}</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ index }" slot="settlementPrice">
|
<template slot-scope="{ index }" slot="settlementPrice">
|
||||||
<Input
|
<Input type="number" v-model="form.promotionGoodsList[index].settlementPrice" />
|
||||||
type="number"
|
|
||||||
v-model="form.promotionGoodsList[index].settlementPrice"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ index }" slot="lowestPrice">
|
<template slot-scope="{ index }" slot="lowestPrice">
|
||||||
<Input
|
<Input type="number" v-model="form.promotionGoodsList[index].lowestPrice" />
|
||||||
type="number"
|
|
||||||
v-model="form.promotionGoodsList[index].lowestPrice"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ index }" slot="highestPrice">
|
<template slot-scope="{ index }" slot="highestPrice">
|
||||||
<Input
|
<Input type="number" v-model="form.promotionGoodsList[index].highestPrice" />
|
||||||
type="number"
|
|
||||||
v-model="form.promotionGoodsList[index].highestPrice"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ index }" slot="purchasePrice">
|
<template slot-scope="{ index }" slot="purchasePrice">
|
||||||
<Input
|
<Input type="number" v-model="form.promotionGoodsList[index].purchasePrice" />
|
||||||
type="number"
|
|
||||||
v-model="form.promotionGoodsList[index].purchasePrice"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ index }" slot="stock">
|
<template slot-scope="{ index }" slot="stock">
|
||||||
<Input
|
<Input type="number" v-model="form.promotionGoodsList[index].stock" />
|
||||||
type="number"
|
|
||||||
v-model="form.promotionGoodsList[index].stock"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="活动时间" prop="rangeTime">
|
<FormItem label="活动时间" prop="rangeTime">
|
||||||
<DatePicker
|
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
|
||||||
type="datetimerange"
|
:options="options" style="width: 260px">
|
||||||
v-model="form.rangeTime"
|
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
placeholder="请选择"
|
|
||||||
:options="options"
|
|
||||||
style="width: 260px"
|
|
||||||
>
|
|
||||||
</DatePicker>
|
</DatePicker>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<div>
|
<div>
|
||||||
|
@ -81,335 +51,330 @@
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
<sku-select
|
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
|
||||||
ref="skuSelect"
|
|
||||||
@selectedGoodsData="selectedGoodsData"
|
|
||||||
></sku-select>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { saveKanJiaActivityGoods } from "@/api/promotion";
|
||||||
saveKanJiaActivityGoods,
|
import { regular } from "@/utils";
|
||||||
editKanJiaActivityGoods
|
import skuSelect from "@/views/lili-dialog";
|
||||||
} from "@/api/promotion";
|
|
||||||
import {regular} from "@/utils";
|
|
||||||
import skuSelect from "@/views/lili-dialog";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "addKanJiaActivityGoods",
|
name: "addKanJiaActivityGoods",
|
||||||
components: {
|
components: {
|
||||||
skuSelect,
|
skuSelect,
|
||||||
},
|
},
|
||||||
watch: {},
|
watch: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
modalType: 0, // 是否编辑
|
modalType: 0, // 是否编辑
|
||||||
form: {
|
form: {
|
||||||
promotionGoodsList: [], // 活动商品列表
|
|
||||||
},
|
|
||||||
id: this.$route.query.id, // 砍价活动id
|
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
|
||||||
selectedGoods: [], // 已选商品列表,便于删除
|
|
||||||
promotionGoodsList: [], // 活动商品列表
|
promotionGoodsList: [], // 活动商品列表
|
||||||
formRule: {
|
},
|
||||||
rangeTime: [{required: true, message: "请选择活动时间"}],
|
id: this.$route.query.id, // 砍价活动id
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
selectedGoods: [], // 已选商品列表,便于删除
|
||||||
|
promotionGoodsList: [], // 活动商品列表
|
||||||
|
formRule: {
|
||||||
|
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
type: "selection",
|
||||||
|
width: 60,
|
||||||
|
align: "center",
|
||||||
},
|
},
|
||||||
columns: [
|
{
|
||||||
{
|
title: "商品名称",
|
||||||
type: "selection",
|
key: "goodsName",
|
||||||
width: 60,
|
tooltip: true,
|
||||||
align: "center",
|
minWidth: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品名称",
|
title: "商品价格",
|
||||||
key: "goodsName",
|
key: "price",
|
||||||
tooltip: true,
|
width: 120,
|
||||||
minWidth: 100,
|
render: (h, params) => {
|
||||||
},
|
return h(
|
||||||
{
|
"div",
|
||||||
title: "商品价格",
|
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||||
key: "price",
|
);
|
||||||
width: 120,
|
|
||||||
render: (h, params) => {
|
|
||||||
return h(
|
|
||||||
"div",
|
|
||||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "库存",
|
|
||||||
key: "quantity",
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "结算价格",
|
|
||||||
slot: "settlementPrice",
|
|
||||||
width: 110,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "最低砍",
|
|
||||||
slot: "lowestPrice",
|
|
||||||
width: 110,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "最高砍",
|
|
||||||
slot: "highestPrice",
|
|
||||||
width: 110,
|
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "库存",
|
||||||
|
key: "quantity",
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "结算价格",
|
||||||
|
slot: "settlementPrice",
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "最低砍",
|
||||||
|
slot: "lowestPrice",
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "最高砍",
|
||||||
|
slot: "highestPrice",
|
||||||
|
width: 110,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "最低购买金额",
|
title: "最低购买金额",
|
||||||
slot: "purchasePrice",
|
slot: "purchasePrice",
|
||||||
width: 110,
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动库存",
|
title: "活动库存",
|
||||||
slot: "stock",
|
slot: "stock",
|
||||||
width: 110,
|
width: 110,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
key: "action",
|
key: "action",
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
return h(
|
return h(
|
||||||
"Button",
|
"Button",
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
size: "small",
|
size: "small",
|
||||||
type: "error",
|
type: "error",
|
||||||
ghost: true,
|
ghost: true,
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
click: () => {
|
click: () => {
|
||||||
this.delGoods(params.index);
|
this.delGoods(params.index);
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"删除"
|
},
|
||||||
);
|
"删除"
|
||||||
},
|
);
|
||||||
},
|
|
||||||
],
|
|
||||||
options: {
|
|
||||||
disabledDate(date) {
|
|
||||||
return date && date.valueOf() < Date.now() - 86400000;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
],
|
||||||
},
|
options: {
|
||||||
async mounted() {
|
disabledDate(date) {
|
||||||
// 如果id不为空则查询信息
|
return date && date.valueOf() < Date.now() - 86400000;
|
||||||
if (this.id) {
|
},
|
||||||
this.getCoupon();
|
|
||||||
this.modalType = 1;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
openSkuList() { // 显示商品选择器
|
|
||||||
this.$refs.skuSelect.open("goods");
|
|
||||||
let data = JSON.parse(JSON.stringify(this.promotionGoodsList))
|
|
||||||
data.forEach(e => {
|
|
||||||
e.id = e.skuId
|
|
||||||
})
|
|
||||||
this.$refs.skuSelect.goodsData = data;
|
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
// 如果id不为空则查询信息
|
||||||
|
if (this.id) {
|
||||||
|
this.getCoupon();
|
||||||
|
this.modalType = 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openSkuList() {
|
||||||
|
// 显示商品选择器
|
||||||
|
this.$refs.skuSelect.open("goods");
|
||||||
|
let data = JSON.parse(JSON.stringify(this.promotionGoodsList));
|
||||||
|
data.forEach((e) => {
|
||||||
|
e.id = e.skuId;
|
||||||
|
});
|
||||||
|
this.$refs.skuSelect.goodsData = data;
|
||||||
|
},
|
||||||
|
|
||||||
/** 保存砍价活动 */
|
/** 保存砍价活动 */
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const params = JSON.parse(JSON.stringify(this.form));
|
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("请选择活动时间");
|
this.$Message.error("请选择活动时间");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
params.startTime = this.$options.filters.unixToDate(
|
params.startTime = this.$options.filters.unixToDate(
|
||||||
this.form.rangeTime[0] / 1000
|
this.form.rangeTime[0] / 1000
|
||||||
);
|
);
|
||||||
params.endTime = this.$options.filters.unixToDate(
|
params.endTime = this.$options.filters.unixToDate(
|
||||||
this.form.rangeTime[1] / 1000
|
this.form.rangeTime[1] / 1000
|
||||||
);
|
);
|
||||||
delete params.rangeTime
|
delete params.rangeTime;
|
||||||
let checkResult = true
|
let checkResult = true;
|
||||||
//如果添加活动的时候选择了商品 则对选择的商品参数做一些校验
|
//如果添加活动的时候选择了商品 则对选择的商品参数做一些校验
|
||||||
if (this.form.promotionGoodsList.length > 0) {
|
if (this.form.promotionGoodsList.length > 0) {
|
||||||
this.form.promotionGoodsList.forEach((res) => {
|
this.form.promotionGoodsList.forEach((res) => {
|
||||||
//校验库存参数
|
//校验库存参数
|
||||||
if (res.stock <= 0 || res.stock > res.quantity) {
|
if (res.stock <= 0 || res.stock > res.quantity) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("活动库存不能为0且不能超过商品库存");
|
this.$Message.error("活动库存不能为0且不能超过商品库存");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
// 最低购买金额格式校验
|
// 最低购买金额格式校验
|
||||||
if (!regular.money.test(res.purchasePrice)) {
|
if (!regular.money.test(res.purchasePrice)) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("最低购买金额格式不正确");
|
this.$Message.error("最低购买金额格式不正确");
|
||||||
}
|
}
|
||||||
// 结算价格金额格式校验
|
// 结算价格金额格式校验
|
||||||
if (!regular.money.test(res.settlementPrice)) {
|
if (!regular.money.test(res.settlementPrice)) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("结算价格金额格式不正确");
|
this.$Message.error("结算价格金额格式不正确");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
// 结算价格金额格式校验
|
// 结算价格金额格式校验
|
||||||
if (res.settlementPrice < 0 || res.settlementPrice > res.price) {
|
if (res.settlementPrice < 0 || res.settlementPrice > res.price) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("结算价格金额不能为0且不能超过商品价格");
|
this.$Message.error("结算价格金额不能为0且不能超过商品价格");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
//最高砍价校验
|
//最高砍价校验
|
||||||
if (!regular.money.test(res.highestPrice)) {
|
if (!regular.money.test(res.highestPrice)) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("最高可砍金额格式错误");
|
this.$Message.error("最高可砍金额格式错误");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (res.highestPrice <= 0 || res.highestPrice > res.price) {
|
if (res.highestPrice <= 0 || res.highestPrice > res.price) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
|
this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
//最低砍价校验
|
//最低砍价校验
|
||||||
if (!regular.money.test(res.lowestPrice)) {
|
if (!regular.money.test(res.lowestPrice)) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("最低可砍金额格式错误");
|
this.$Message.error("最低可砍金额格式错误");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
if (res.lowestPrice <= 0 || res.lowestPrice > res.price) {
|
if (res.lowestPrice <= 0 || res.lowestPrice > res.price) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("最低可砍金额不能为0");
|
this.$Message.error("最低可砍金额不能为0");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
//校验最高最低砍价金额
|
//校验最高最低砍价金额
|
||||||
if (res.lowestPrice > res.highestPrice) {
|
if (parseInt(res.lowestPrice) > parseInt(res.highestPrice)) {
|
||||||
checkResult = false
|
checkResult = false;
|
||||||
this.$Message.error("最低砍价金额不能大于最高砍价金额");
|
this.$Message.error("最低砍价金额不能大于最高砍价金额");
|
||||||
return
|
return;
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (!checkResult) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.submitLoading = true;
|
|
||||||
saveKanJiaActivityGoods(params).then((res) => {
|
|
||||||
this.submitLoading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("砍价活动修改成功");
|
|
||||||
this.closeCurrentPage();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
},
|
if (!checkResult) {
|
||||||
// 关闭当前页面
|
return;
|
||||||
closeCurrentPage() {
|
}
|
||||||
this.$store.commit("removeTag", "add-kan-jia-goods");
|
this.submitLoading = true;
|
||||||
localStorage.pageOpenedList = JSON.stringify(
|
saveKanJiaActivityGoods(params).then((res) => {
|
||||||
this.$store.state.app.pageOpenedList
|
this.submitLoading = false;
|
||||||
);
|
if (res.success) {
|
||||||
this.$router.go(-1);
|
this.$Message.success("砍价活动修改成功");
|
||||||
},
|
this.closeCurrentPage();
|
||||||
openSkuList() {
|
}
|
||||||
// 显示商品选择器
|
|
||||||
this.$refs.skuSelect.open("goods");
|
|
||||||
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
|
|
||||||
data.forEach((e) => {
|
|
||||||
e.id = e.skuId;
|
|
||||||
});
|
|
||||||
this.$refs.skuSelect.goodsData = data;
|
|
||||||
},
|
|
||||||
changeSelect(e) {
|
|
||||||
// 已选商品批量选择
|
|
||||||
this.selectedGoods = e;
|
|
||||||
},
|
|
||||||
delSelectGoods() {
|
|
||||||
// 多选删除商品
|
|
||||||
if (this.selectedGoods.length <= 0) {
|
|
||||||
this.$Message.warning("您还未选择要删除的数据");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$Modal.confirm({
|
|
||||||
title: "确认删除",
|
|
||||||
content: "您确认要删除所选商品吗?",
|
|
||||||
onOk: () => {
|
|
||||||
let ids = [];
|
|
||||||
this.selectedGoods.forEach(function (e) {
|
|
||||||
ids.push(e.id);
|
|
||||||
});
|
|
||||||
this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
|
|
||||||
(item) => {
|
|
||||||
return !ids.includes(item.id);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
delGoods(index) {
|
|
||||||
// 删除商品
|
|
||||||
this.form.promotionGoodsList.splice(index, 1);
|
|
||||||
},
|
|
||||||
selectedGoodsData(item) {
|
|
||||||
// 回显已选商品
|
|
||||||
let list = [];
|
|
||||||
item.forEach((e) => {
|
|
||||||
list.push({
|
|
||||||
settlementPrice: e.settlementPrice || 0,
|
|
||||||
purchasePrice: e.purchasePrice || 0,
|
|
||||||
lowestPrice: e.lowestPrice || 0,
|
|
||||||
highestPrice: e.highestPrice || 0,
|
|
||||||
stock: e.stock || 0,
|
|
||||||
goodsName: e.goodsName,
|
|
||||||
price: e.price,
|
|
||||||
originalPrice: e.price,
|
|
||||||
quantity: e.quantity,
|
|
||||||
storeId: e.storeId,
|
|
||||||
storeName: e.storeName,
|
|
||||||
skuId: e.id,
|
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
console.warn(list)
|
});
|
||||||
this.form.promotionGoodsList = list;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
// 关闭当前页面
|
||||||
|
closeCurrentPage() {
|
||||||
|
this.$store.commit("removeTag", "add-kan-jia-goods");
|
||||||
|
localStorage.pageOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.pageOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
openSkuList() {
|
||||||
|
// 显示商品选择器
|
||||||
|
this.$refs.skuSelect.open("goods");
|
||||||
|
let data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
|
||||||
|
data.forEach((e) => {
|
||||||
|
e.id = e.skuId;
|
||||||
|
});
|
||||||
|
this.$refs.skuSelect.goodsData = data;
|
||||||
|
},
|
||||||
|
changeSelect(e) {
|
||||||
|
// 已选商品批量选择
|
||||||
|
this.selectedGoods = e;
|
||||||
|
},
|
||||||
|
delSelectGoods() {
|
||||||
|
// 多选删除商品
|
||||||
|
if (this.selectedGoods.length <= 0) {
|
||||||
|
this.$Message.warning("您还未选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
content: "您确认要删除所选商品吗?",
|
||||||
|
onOk: () => {
|
||||||
|
let ids = [];
|
||||||
|
this.selectedGoods.forEach(function (e) {
|
||||||
|
ids.push(e.id);
|
||||||
|
});
|
||||||
|
this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
|
||||||
|
(item) => {
|
||||||
|
return !ids.includes(item.id);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delGoods(index) {
|
||||||
|
// 删除商品
|
||||||
|
this.form.promotionGoodsList.splice(index, 1);
|
||||||
|
},
|
||||||
|
selectedGoodsData(item) {
|
||||||
|
// 回显已选商品
|
||||||
|
let list = [];
|
||||||
|
item.forEach((e) => {
|
||||||
|
list.push({
|
||||||
|
settlementPrice: e.settlementPrice || 0,
|
||||||
|
purchasePrice: e.purchasePrice || 0,
|
||||||
|
lowestPrice: e.lowestPrice || 0,
|
||||||
|
highestPrice: e.highestPrice || 0,
|
||||||
|
stock: e.stock || 0,
|
||||||
|
goodsName: e.goodsName,
|
||||||
|
price: e.price,
|
||||||
|
originalPrice: e.price,
|
||||||
|
quantity: e.quantity,
|
||||||
|
storeId: e.storeId,
|
||||||
|
storeName: e.storeName,
|
||||||
|
skuId: e.id,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.warn(list);
|
||||||
|
this.form.promotionGoodsList = list;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scpoed>
|
<style lang="scss" scpoed>
|
||||||
h4 {
|
h4 {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.describe {
|
.describe {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.effectiveDays {
|
.effectiveDays {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
||||||
> * {
|
> * {
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.tips {
|
.tips {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -86,10 +86,7 @@
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
<sku-select
|
|
||||||
ref="skuSelect"
|
|
||||||
@selectedGoodsData="selectedGoodsData"
|
|
||||||
></sku-select>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -99,13 +96,11 @@
|
||||||
editKanJiaActivityGoods,
|
editKanJiaActivityGoods,
|
||||||
} from "@/api/promotion";
|
} from "@/api/promotion";
|
||||||
import {regular} from "@/utils";
|
import {regular} from "@/utils";
|
||||||
import skuSelect from "@/views/lili-dialog";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "editKanjiaActivityGoods",
|
name: "editKanjiaActivityGoods",
|
||||||
components: {
|
|
||||||
skuSelect,
|
|
||||||
},
|
|
||||||
watch: {},
|
watch: {},
|
||||||
data() {
|
data() {
|
||||||
const checkSettlementPrice = (rule, value, callback) => {
|
const checkSettlementPrice = (rule, value, callback) => {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<Row>
|
<Row>
|
||||||
<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="goodsName">
|
<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>
|
</Form-item>
|
||||||
<Form-item label="活动状态" prop="promotionStatus">
|
<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">
|
||||||
|
@ -15,8 +15,8 @@
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动时间">
|
<Form-item label="活动时间">
|
||||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
|
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||||
style="width: 200px"></DatePicker>
|
</DatePicker>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
<Button @click="add" type="primary">添加砍价</Button>
|
<Button @click="add" type="primary">添加砍价</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||||
@on-sort-change="changeSort">
|
@on-sort-change="changeSort">
|
||||||
<template slot-scope="{ row }" slot="goodsName">
|
<template slot-scope="{ row }" slot="goodsName">
|
||||||
<div>
|
<div>
|
||||||
<a class="mr_10" @click="linkTo(row.goodsSku.goodsId,row.skuId)">{{row.goodsName}}</a>
|
<a class="mr_10" @click="linkTo(row.goodsSku.goodsId,row.skuId)">{{row.goodsName}}</a>
|
||||||
|
@ -33,10 +33,10 @@
|
||||||
<div slot="content">
|
<div slot="content">
|
||||||
|
|
||||||
<vue-qr :text="wapLinkTo(row.goodsSku.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
<vue-qr :text="wapLinkTo(row.goodsSku.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
||||||
:size="150"></vue-qr>
|
:size="150"></vue-qr>
|
||||||
</div>
|
</div>
|
||||||
<img src="../../../assets/qrcode.svg" style="vertical-align:middle;" class="hover-pointer" width="20"
|
<img src="../../../assets/qrcode.svg" style="vertical-align:middle;" class="hover-pointer" width="20"
|
||||||
height="20" alt="">
|
height="20" alt="">
|
||||||
</Poptip>
|
</Poptip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -48,279 +48,272 @@
|
||||||
<div>{{ row.goodsSku.quantity }}</div>
|
<div>{{ row.goodsSku.quantity }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ row,index }" slot="action">
|
<template slot-scope="{ row,index }" slot="action">
|
||||||
<Button v-if="row.promotionStatus === 'NEW'" type="info"
|
<Button v-if="row.promotionStatus === 'NEW'" type="info" size="small" style="margin-right: 10px"
|
||||||
size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
@click="edit(row)">编辑
|
||||||
</Button>
|
</Button>
|
||||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error"
|
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error" size="small"
|
||||||
size="small" style="margin-right: 10px" @click="delAll(row)">删除
|
style="margin-right: 10px" @click="delAll(row)">删除
|
||||||
</Button>
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="page">
|
<Row type="flex" justify="end" class="page">
|
||||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
<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"
|
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||||
show-total show-elevator show-sizer></Page>
|
show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { getKanJiaGoodsList, delKanJiaGoods } from "@/api/promotion";
|
||||||
getKanJiaGoodsList,
|
import vueQr from "vue-qr";
|
||||||
delKanJiaGoods,
|
|
||||||
} from "@/api/promotion";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "coupon",
|
name: "coupon",
|
||||||
components: {},
|
components: {
|
||||||
|
"vue-qr": vueQr,
|
||||||
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true, // 表单加载状态
|
selectDate: [], //选中的数据
|
||||||
modalType: 0, // 添加或编辑标识
|
loading: true, // 表单加载状态
|
||||||
modalVisible: false, // 添加或编辑显示
|
modalType: 0, // 添加或编辑标识
|
||||||
modalTitle: "", // 添加或编辑标题
|
modalVisible: false, // 添加或编辑显示
|
||||||
searchForm: {
|
modalTitle: "", // 添加或编辑标题
|
||||||
// 搜索框初始化对象
|
searchForm: {
|
||||||
pageNumber: 1, // 当前页数
|
// 搜索框初始化对象
|
||||||
pageSize: 10, // 页面大小
|
pageNumber: 1, // 当前页数
|
||||||
sort: "startTime", // 默认排序字段
|
pageSize: 10, // 页面大小
|
||||||
order: "desc", // 默认排序方式
|
sort: "startTime", // 默认排序字段
|
||||||
goodsName: ""
|
order: "desc", // 默认排序方式
|
||||||
|
goodsName: "",
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
},
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {},
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
selectList: [], // 多选数据
|
||||||
|
selectCount: 0, // 多选计数
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: "商品名称",
|
||||||
|
slot: "goodsName",
|
||||||
|
minWidth: 150,
|
||||||
|
tooltip: true,
|
||||||
},
|
},
|
||||||
form: {
|
{
|
||||||
// 添加或编辑表单对象初始化数据
|
title: "库存数量",
|
||||||
|
slot: "quantity",
|
||||||
|
width: 100,
|
||||||
},
|
},
|
||||||
// 表单验证规则
|
{
|
||||||
formValidate: {},
|
title: "剩余活动库存",
|
||||||
submitLoading: false, // 添加或编辑提交状态
|
key: "stock",
|
||||||
selectList: [], // 多选数据
|
width: 110,
|
||||||
selectCount: 0, // 多选计数
|
},
|
||||||
columns: [
|
{
|
||||||
{
|
title: "最低购买金额",
|
||||||
title: "商品名称",
|
key: "lowestPrice",
|
||||||
slot: "goodsName",
|
minWidth: 110,
|
||||||
minWidth: 150,
|
render: (h, params) => {
|
||||||
tooltip: true,
|
return h(
|
||||||
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.lowestPrice, "¥")
|
||||||
|
);
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "库存数量",
|
{
|
||||||
slot: "quantity",
|
title: "每人最低砍",
|
||||||
width: 100,
|
key: "lowestPrice",
|
||||||
|
minWidth: 100,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h(
|
||||||
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.lowestPrice, "¥")
|
||||||
|
);
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "剩余活动库存",
|
{
|
||||||
key: "stock",
|
title: "每人最高砍",
|
||||||
width: 110,
|
key: "highestPrice",
|
||||||
|
minWidth: 100,
|
||||||
|
tooltip: true,
|
||||||
|
render: (h, params) => {
|
||||||
|
return h(
|
||||||
|
"div",
|
||||||
|
this.$options.filters.unitPrice(params.row.highestPrice, "¥")
|
||||||
|
);
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "最低购买金额",
|
{
|
||||||
key: "lowestPrice",
|
title: "结算价格",
|
||||||
minWidth: 110,
|
key: "settlementPrice",
|
||||||
render: (h, params) => {
|
minWidth: 100,
|
||||||
return h(
|
render: (h, params) => {
|
||||||
"div",
|
return h(
|
||||||
this.$options.filters.unitPrice(params.row.lowestPrice, "¥")
|
"div",
|
||||||
);
|
this.$options.filters.unitPrice(params.row.settlementPrice, "¥")
|
||||||
},
|
);
|
||||||
},
|
},
|
||||||
{
|
},
|
||||||
title: "每人最低砍",
|
{
|
||||||
key: "lowestPrice",
|
title: "活动开始时间",
|
||||||
minWidth: 100,
|
slot: "startTime",
|
||||||
render: (h, params) => {
|
minWidth: 150,
|
||||||
return h(
|
},
|
||||||
"div",
|
{
|
||||||
this.$options.filters.unitPrice(params.row.lowestPrice, "¥")
|
title: "状态",
|
||||||
);
|
key: "promotionStatus",
|
||||||
},
|
render: (h, params) => {
|
||||||
},
|
let text = "未知",
|
||||||
{
|
color = "red";
|
||||||
title: "每人最高砍",
|
if (params.row.promotionStatus == "NEW") {
|
||||||
key: "highestPrice",
|
text = "未开始";
|
||||||
minWidth: 100,
|
color = "geekblue";
|
||||||
tooltip: true,
|
} else if (params.row.promotionStatus == "START") {
|
||||||
render: (h, params) => {
|
text = "已开始";
|
||||||
return h(
|
color = "green";
|
||||||
"div",
|
} else if (params.row.promotionStatus == "END") {
|
||||||
this.$options.filters.unitPrice(params.row.highestPrice, "¥")
|
text = "已结束";
|
||||||
);
|
color = "red";
|
||||||
},
|
} else if (params.row.promotionStatus == "CLOSE") {
|
||||||
},
|
text = "已关闭";
|
||||||
{
|
color = "red";
|
||||||
title: "结算价格",
|
}
|
||||||
key: "settlementPrice",
|
return h("div", [
|
||||||
minWidth: 100,
|
h(
|
||||||
render: (h, params) => {
|
"Tag",
|
||||||
return h(
|
{
|
||||||
"div",
|
props: {
|
||||||
this.$options.filters.unitPrice(params.row.settlementPrice, "¥")
|
color: color,
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "活动开始时间",
|
|
||||||
slot: "startTime",
|
|
||||||
minWidth: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "状态",
|
|
||||||
key: "promotionStatus",
|
|
||||||
render: (h, params) => {
|
|
||||||
let text = "未知",
|
|
||||||
color = "red";
|
|
||||||
if (params.row.promotionStatus == "NEW") {
|
|
||||||
text = "未开始";
|
|
||||||
color = "geekblue";
|
|
||||||
} else if (params.row.promotionStatus == "START") {
|
|
||||||
text = "已开始";
|
|
||||||
color = "green";
|
|
||||||
} else if (params.row.promotionStatus == "END") {
|
|
||||||
text = "已结束";
|
|
||||||
color = "red";
|
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
|
||||||
text = "已关闭";
|
|
||||||
color = "red";
|
|
||||||
}
|
|
||||||
return h("div", [
|
|
||||||
h(
|
|
||||||
"Tag",
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
color: color,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
text
|
},
|
||||||
),
|
text
|
||||||
]);
|
),
|
||||||
},
|
]);
|
||||||
width: 100,
|
|
||||||
},
|
},
|
||||||
{
|
width: 100,
|
||||||
title: "操作",
|
|
||||||
slot: "action",
|
|
||||||
align: "center",
|
|
||||||
fixed: "right",
|
|
||||||
width: 150,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
data: [], // 表单数据
|
|
||||||
total: 0, // 表单数据总数
|
|
||||||
selectCoupon: [], //本级选中的优惠券
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {},
|
|
||||||
watch: {
|
|
||||||
$route(to, from) {
|
|
||||||
if (to.fullPath == "/promotion/manager-coupon") {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 选中优惠券 父级传值
|
|
||||||
selectedList: {
|
|
||||||
handler(val) {
|
|
||||||
// 判断是否是父级回调给自己已选择优惠券
|
|
||||||
if (val.length != 0) {
|
|
||||||
this.selectCoupon = val;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
deep: true,
|
{
|
||||||
immediate: true,
|
title: "操作",
|
||||||
},
|
slot: "action",
|
||||||
check() {
|
align: "center",
|
||||||
// this.selectCoupon.push(this.selectList)
|
fixed: "right",
|
||||||
this.$emit("selected", this.selectCoupon);
|
width: 150,
|
||||||
},
|
},
|
||||||
init() {
|
],
|
||||||
this.getDataList();
|
data: [], // 表单数据
|
||||||
},
|
total: 0, // 表单数据总数
|
||||||
// 添加砍价活动跳转
|
selectCoupon: [], //本级选中的优惠券
|
||||||
add() {
|
};
|
||||||
this.$router.push({name: "add-kanJia-activity-goods"});
|
},
|
||||||
},
|
props: {},
|
||||||
|
watch: {
|
||||||
|
$route(to, from) {
|
||||||
|
if (to.fullPath == "/promotion/manager-coupon") {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
check() {
|
||||||
|
// this.selectCoupon.push(this.selectList)
|
||||||
|
this.$emit("selected", this.selectCoupon);
|
||||||
|
},
|
||||||
|
init() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
// 添加砍价活动跳转
|
||||||
|
add() {
|
||||||
|
this.$router.push({ name: "add-kanJia-activity-goods" });
|
||||||
|
},
|
||||||
|
|
||||||
info(v) {
|
info(v) {
|
||||||
this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
|
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
|
||||||
},
|
},
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
// this.clearSelectAll();
|
// this.clearSelectAll();
|
||||||
},
|
},
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
this.searchForm.pageSize = v;
|
this.searchForm.pageSize = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
this.searchForm.pageNumber = 0;
|
this.searchForm.pageNumber = 0;
|
||||||
this.searchForm.pageSize = 10;
|
this.searchForm.pageSize = 10;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
changeSort(e) {
|
changeSort(e) {
|
||||||
this.searchForm.sort = e.key;
|
this.searchForm.sort = e.key;
|
||||||
this.searchForm.order = e.order;
|
this.searchForm.order = e.order;
|
||||||
if (e.order === "normal") {
|
if (e.order === "normal") {
|
||||||
this.searchForm.order = "";
|
this.searchForm.order = "";
|
||||||
}
|
}
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
clearSelectAll() {
|
clearSelectAll() {
|
||||||
this.$refs.table.selectAll(false);
|
this.$refs.table.selectAll(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||||
this.searchForm.startTime = this.selectDate[0].getTime();
|
this.searchForm.startTime = this.selectDate[0].getTime();
|
||||||
this.searchForm.endTime = this.selectDate[1].getTime();
|
this.searchForm.endTime = this.selectDate[1].getTime();
|
||||||
} else {
|
} else {
|
||||||
this.searchForm.startTime = null;
|
this.searchForm.startTime = null;
|
||||||
this.searchForm.endTime = null;
|
this.searchForm.endTime = null;
|
||||||
}
|
}
|
||||||
// 带多条件搜索参数获取表单数据 请自行修改接口
|
// 带多条件搜索参数获取表单数据 请自行修改接口
|
||||||
getKanJiaGoodsList(this.searchForm).then((res) => {
|
getKanJiaGoodsList(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
|
||||||
if (res.success) {
|
|
||||||
this.data = res.result.records;
|
|
||||||
this.total = res.result.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.total = this.data.length;
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
if (res.success) {
|
||||||
edit(v) {
|
this.data = res.result.records;
|
||||||
this.$router.push({name: "edit-kanJia-activity-goods", query: {id: v.id}});
|
this.total = res.result.total;
|
||||||
},
|
}
|
||||||
delAll(row) {
|
});
|
||||||
this.$Modal.confirm({
|
this.total = this.data.length;
|
||||||
title: "确认删除",
|
this.loading = false;
|
||||||
content: "确认需要删除此砍价商品",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
let ids = [];
|
|
||||||
this.selectList.forEach(function (e) {
|
|
||||||
ids.push(e.id);
|
|
||||||
});
|
|
||||||
// 批量删除
|
|
||||||
delKanJiaGoods(row.id).then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("删除成功");
|
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
edit(v) {
|
||||||
this.init();
|
this.$router.push({
|
||||||
|
name: "edit-kanJia-activity-goods",
|
||||||
|
query: { id: v.id },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
delAll(row) {
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
content: "确认需要删除此砍价商品",
|
||||||
|
loading: true,
|
||||||
|
onOk: () => {
|
||||||
|
let ids = [];
|
||||||
|
this.selectList.forEach(function (e) {
|
||||||
|
ids.push(e.id);
|
||||||
|
});
|
||||||
|
// 批量删除
|
||||||
|
delKanJiaGoods(row.id).then((res) => {
|
||||||
|
this.$Modal.remove();
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("删除成功");
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/styles/table-common.scss";
|
@import "@/styles/table-common.scss";
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 查询数据的总数
|
// 查询数据的总数
|
||||||
total: "",
|
total: 0,
|
||||||
// 查询的form
|
// 查询的form
|
||||||
searchForm: {
|
searchForm: {
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
|
@ -95,6 +95,7 @@ export default {
|
||||||
name: "pintuan",
|
name: "pintuan",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectDate:[], //选中的数据
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
:data="goodsData"
|
:data="goodsData"
|
||||||
ref="table"
|
ref="table"
|
||||||
sortable="custom"
|
sortable="custom"
|
||||||
@on-sort-change="changeSort"
|
|
||||||
@on-selection-change="changeSelect"
|
|
||||||
>
|
>
|
||||||
<template slot-scope="{ row }" slot="goodsName">
|
<template slot-scope="{ row }" slot="goodsName">
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -72,8 +72,12 @@ import {
|
||||||
editPointsGoodsStatus,
|
editPointsGoodsStatus,
|
||||||
deletePointsGoodsStatus,
|
deletePointsGoodsStatus,
|
||||||
} from "@/api/promotion";
|
} from "@/api/promotion";
|
||||||
|
import vueQr from 'vue-qr'
|
||||||
export default {
|
export default {
|
||||||
name: "pointsGoods",
|
name: "pointsGoods",
|
||||||
|
components: {
|
||||||
|
"vue-qr":vueQr
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
|
|
|
@ -67,6 +67,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
submitLoading:false,
|
||||||
loading: false, // 加载状态
|
loading: false, // 加载状态
|
||||||
modalType: 0, // 添加或编辑标识
|
modalType: 0, // 添加或编辑标识
|
||||||
modalVisible: false, // 添加或编辑显示
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
<Row>
|
<Row>
|
||||||
<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="promotionName">
|
<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>
|
||||||
<Form-item label="活动状态" prop="promotionStatus">
|
<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">
|
||||||
|
@ -15,7 +16,8 @@
|
||||||
</Select>
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
<Form-item label="活动时间">
|
<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>
|
</Form-item>
|
||||||
|
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
|
@ -25,22 +27,26 @@
|
||||||
<TabPane label="秒杀活动列表" name="list">
|
<TabPane label="秒杀活动列表" name="list">
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
|
||||||
<template slot-scope="{ row }" slot="action">
|
<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="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="
|
<Button type="error" size="small" v-if="
|
||||||
row.promotionStatus == 'START' || row.promotionStatus == 'NEW'
|
row.promotionStatus == 'START' || row.promotionStatus == 'NEW'
|
||||||
" class="mr_5" @click="off(row)">下架</Button>
|
" 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>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
<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>
|
:page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</TabPane>
|
</TabPane>
|
||||||
|
@ -60,10 +66,11 @@ import setupSeckill from "@/views/promotion/seckill/setupSeckill";
|
||||||
export default {
|
export default {
|
||||||
name: "seckill",
|
name: "seckill",
|
||||||
components: {
|
components: {
|
||||||
setupSeckill
|
setupSeckill,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
selectDate: [],
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
|
@ -99,13 +106,13 @@ export default {
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.promotionStatus == "NEW") {
|
if (params.row.promotionStatus == "NEW") {
|
||||||
return h("Tag", {props: {color: "geekblue",},},"新建");
|
return h("Tag", { props: { color: "geekblue" } }, "新建");
|
||||||
} else if (params.row.promotionStatus == "START") {
|
} else if (params.row.promotionStatus == "START") {
|
||||||
return h("Tag", {props: {color: "green",},},"开始");
|
return h("Tag", { props: { color: "green" } }, "开始");
|
||||||
} else if (params.row.promotionStatus == "END") {
|
} else if (params.row.promotionStatus == "END") {
|
||||||
return h("Tag", {props: {color: "volcano",},},"结束");
|
return h("Tag", { props: { color: "volcano" } }, "结束");
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
} 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",
|
name: "bill-detail",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading:false,
|
||||||
columns: [ // 表头
|
columns: [ // 表头
|
||||||
{
|
{
|
||||||
title: "项目",
|
title: "项目",
|
||||||
|
|
|
@ -184,7 +184,7 @@
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card class="mt_10">
|
<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">
|
<TabPane label="TA的订单" name="order" style="min-height: 200px">
|
||||||
<Row>
|
<Row>
|
||||||
<Form ref="searchForm" :model="orderSearchForm" inline :label-width="70" class="search-form">
|
<Form ref="searchForm" :model="orderSearchForm" inline :label-width="70" class="search-form">
|
||||||
|
|
|
@ -178,7 +178,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
orderOrRefund: 1, // 订单还是单
|
orderOrRefund: 1, // 订单还是单
|
||||||
total: "0", // 总数
|
total: 0, // 总数
|
||||||
// 订单状态
|
// 订单状态
|
||||||
orderStatusList: {
|
orderStatusList: {
|
||||||
UNDELIVERED: "待发货",
|
UNDELIVERED: "待发货",
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<Button class="mt_10 mb_10" @click="addAppVersion" type="primary">添加</Button>
|
<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">
|
<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"
|
<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() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading:false,
|
||||||
customSms: false, //当选择自动发送对象 展示
|
customSms: false, //当选择自动发送对象 展示
|
||||||
alreadyCheck: [], //已经选中的数据
|
alreadyCheck: [], //已经选中的数据
|
||||||
alreadyCheckShow: [], //已经选择的值负责显示
|
alreadyCheckShow: [], //已经选择的值负责显示
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-show="showType == 'list'">
|
<div v-show="showType == 'list'">
|
||||||
<Row v-show="openTip">
|
<Row >
|
||||||
<Alert show-icon>
|
<Alert show-icon>
|
||||||
已选择
|
已选择
|
||||||
<span class="select-count">{{ selectCount }}</span> 项
|
<span class="select-count">{{ selectCount }}</span> 项
|
||||||
|
|
|
@ -47,32 +47,7 @@
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</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">
|
<Modal width="800" v-model="selectIsSuperModel" title="选择菜单权限" :loading="superModelLoading" @on-ok="saveRole">
|
||||||
|
@ -111,7 +86,6 @@ import {
|
||||||
saveRoleMenu,
|
saveRoleMenu,
|
||||||
} from "@/api/index";
|
} from "@/api/index";
|
||||||
import util from "@/libs/util.js";
|
import util from "@/libs/util.js";
|
||||||
import Cookies from "js-cookie";
|
|
||||||
export default {
|
export default {
|
||||||
name: "role-manage",
|
name: "role-manage",
|
||||||
data() {
|
data() {
|
||||||
|
@ -305,12 +279,12 @@ export default {
|
||||||
"Tag",
|
"Tag",
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
type:
|
color:
|
||||||
data.isSuper == true
|
data.isSuper == true
|
||||||
? "red"
|
? "red"
|
||||||
: data.isSuper == false
|
: data.isSuper == false
|
||||||
? "default"
|
? "default"
|
||||||
: "",
|
: "default",
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
"margin-left": "10px",
|
"margin-left": "10px",
|
||||||
|
|
|
@ -98,7 +98,6 @@
|
||||||
<Button type="primary" :loading="submitLoading" @click="submitUser">提交</Button>
|
<Button type="primary" :loading="submitLoading" @click="submitUser">提交</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
<check-password ref="checkPass" @on-success="resetPass"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,55 @@
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const CompressionPlugin = require("compression-webpack-plugin");
|
const CompressionPlugin = require("compression-webpack-plugin");
|
||||||
|
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
||||||
const resolve = dir => {
|
const resolve = dir => {
|
||||||
return path.join(__dirname, 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 = {
|
module.exports = {
|
||||||
css: {
|
css: {
|
||||||
loaderOptions: {
|
loaderOptions: {
|
||||||
|
@ -20,37 +65,13 @@ module.exports = {
|
||||||
port: 10003
|
port: 10003
|
||||||
},
|
},
|
||||||
|
|
||||||
chainWebpack: config => {
|
|
||||||
// @ 对应 src目录
|
|
||||||
config.resolve.alias.set("@", resolve("src"));
|
|
||||||
},
|
|
||||||
|
|
||||||
// 打包时不生成.map文件 避免看到源码
|
// 打包时不生成.map文件 避免看到源码
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
|
|
||||||
// 部署优化
|
// 部署优化
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
// 使用CDN
|
// 使用CDN
|
||||||
externals: {
|
externals: 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"
|
|
||||||
},
|
|
||||||
// GZIP压缩
|
// GZIP压缩
|
||||||
plugins: [
|
plugins: [
|
||||||
new CompressionPlugin({
|
new CompressionPlugin({
|
||||||
|
@ -58,8 +79,24 @@ module.exports = {
|
||||||
threshold: 10240 // 对超过10k文件压缩
|
threshold: 10240 // 对超过10k文件压缩
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
mode: "production",
|
||||||
optimization: {
|
optimization: {
|
||||||
runtimeChunk: "single",
|
runtimeChunk: "single",
|
||||||
|
minimizer: [
|
||||||
|
new UglifyJsPlugin({
|
||||||
|
uglifyOptions: {
|
||||||
|
// 删除注释
|
||||||
|
output: {
|
||||||
|
comments: false
|
||||||
|
},
|
||||||
|
compress: {
|
||||||
|
drop_console: true, // 删除所有调式带有console的
|
||||||
|
drop_debugger: true,
|
||||||
|
pure_funcs: ["console.log"] // 删除console.log
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
],
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
maxInitialRequests: Infinity,
|
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: {
|
pluginOptions: {
|
||||||
"style-resources-loader": {
|
"style-resources-loader": {
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
"less-loader": "^6.2.0",
|
"less-loader": "^6.2.0",
|
||||||
"style-loader": "^2.0.0",
|
"style-loader": "^2.0.0",
|
||||||
"style-resources-loader": "^1.3.2",
|
"style-resources-loader": "^1.3.2",
|
||||||
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||||
"view-design": "^4.6.1",
|
"view-design": "^4.6.1",
|
||||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||||
"vue-template-compiler": "^2.6.10"
|
"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 path = require("path");
|
||||||
const CompressionPlugin = require("compression-webpack-plugin");
|
const CompressionPlugin = require("compression-webpack-plugin");
|
||||||
|
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||||
const resolve = dir => {
|
const resolve = dir => {
|
||||||
return path.join(__dirname, dir);
|
return path.join(__dirname, dir);
|
||||||
};
|
};
|
||||||
|
@ -23,8 +23,7 @@ let externals = {
|
||||||
wangeditor: "wangEditor",
|
wangeditor: "wangEditor",
|
||||||
"sockjs-client": "SockJS",
|
"sockjs-client": "SockJS",
|
||||||
vuedraggable: "vuedraggable",
|
vuedraggable: "vuedraggable",
|
||||||
"@antv/g2": "G2",
|
"@antv/g2": "G2"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 使用CDN的内容
|
// 使用CDN的内容
|
||||||
|
@ -42,7 +41,7 @@ let cdn = {
|
||||||
"https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.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/sockjs-client@1/dist/sockjs.min.js",
|
||||||
"https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.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文件压缩
|
threshold: 10240 // 对超过10k文件压缩
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
mode: "production",
|
||||||
optimization: {
|
optimization: {
|
||||||
|
minimizer: [
|
||||||
|
new UglifyJsPlugin({
|
||||||
|
uglifyOptions: {
|
||||||
|
// 删除注释
|
||||||
|
output: {
|
||||||
|
comments: false
|
||||||
|
},
|
||||||
|
compress: {
|
||||||
|
drop_console: true, // 删除所有调式带有console的
|
||||||
|
drop_debugger: true,
|
||||||
|
pure_funcs: ["console.log"] // 删除console.log
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
],
|
||||||
runtimeChunk: "single",
|
runtimeChunk: "single",
|
||||||
splitChunks: {
|
splitChunks: {
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
|
|
Loading…
Reference in New Issue