merge master
|
@ -21,7 +21,7 @@ module.exports = {
|
|||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: '0.0.0.0', // can be overwritten by process.env.HOST
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
port: 10000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: false,
|
||||
errorOverlay: true,
|
||||
|
|
|
@ -49,27 +49,27 @@
|
|||
class="goods-show-info"
|
||||
v-for="(item, index) in goodsList"
|
||||
:key="index"
|
||||
@click="goGoodsDetail(item.id, item.goodsId)"
|
||||
@click="goGoodsDetail(item.id, item.content.goodsId)"
|
||||
>
|
||||
<div class="goods-show-img">
|
||||
<img width="220" height="220" :src="item.thumbnail" />
|
||||
<img width="220" height="220" :src="item.content.thumbnail" />
|
||||
</div>
|
||||
<div class="goods-show-price">
|
||||
<span>
|
||||
<span class="seckill-price text-danger">{{
|
||||
item.price | unitPrice("¥")
|
||||
item.content.price | unitPrice("¥")
|
||||
}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="goods-show-detail">
|
||||
<span>{{ item.goodsName }}</span>
|
||||
<span>{{ item.content.goodsName }}</span>
|
||||
</div>
|
||||
<div class="goods-show-num">
|
||||
已有<span>{{ item.commentNum || 0 }}</span
|
||||
已有<span>{{ item.content.commentNum || 0 }}</span
|
||||
>人评价
|
||||
</div>
|
||||
<div class="goods-show-seller">
|
||||
<Tag v-if="item.selfOperated" style="padding:0 4px;" size="default" color="error">自营</Tag><span>{{ item.storeName }}</span>
|
||||
<Tag v-if="item.content.selfOperated" style="padding:0 4px;" size="default" color="error">自营</Tag><span>{{ item.content.storeName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
/*
|
||||
* @Author: LMR
|
||||
* @Date: 2020-08-11 10:53:53
|
||||
* @Last Modified by: LMR
|
||||
* @Last Modified time: 2020-08-11 11:26:19
|
||||
*/
|
||||
|
||||
// 关闭eslint
|
||||
module.exports = {
|
||||
|
|
|
@ -12,42 +12,25 @@
|
|||
"dependencies": {
|
||||
"@amap/amap-jsapi-loader": "0.0.7",
|
||||
"@antv/g2": "^4.1.12",
|
||||
"apexcharts": "^3.26.0",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"countup.js": "^2.0.4",
|
||||
"date-fns": "^1.30.1",
|
||||
"dplayer": "^1.26.0",
|
||||
"gitalk": "^1.6.2",
|
||||
"html2canvas": "^1.0.0-rc.5",
|
||||
"iview-area": "^1.6.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"node-sass": "^4.14.1",
|
||||
"pinyin": "^2.9.0",
|
||||
"print-js": "^1.0.63",
|
||||
"qrcodejs2": "0.0.2",
|
||||
"sass-loader": "^8.0.2",
|
||||
"sockjs-client": "^1.4.0",
|
||||
"stompjs": "^2.3.3",
|
||||
"swiper": "^6.3.5",
|
||||
"uuid": "^8.3.2",
|
||||
"view-design": "^4.2.0",
|
||||
"vue": "^2.6.10",
|
||||
"vue-apexcharts": "^1.5.1",
|
||||
"vue-awesome": "^4.0.2",
|
||||
"vue-awesome-swiper": "^4.1.1",
|
||||
"vue-clipboard2": "^0.3.0",
|
||||
"vue-cropper": "^0.4.9",
|
||||
"vue-i18n": "^8.15.1",
|
||||
"vue-json-excel": "^0.3.0",
|
||||
"vue-json-pretty": "^1.4.1",
|
||||
"vue-lazyload": "^1.3.3",
|
||||
"vue-qr": "^2.3.0",
|
||||
"vue-router": "^3.1.3",
|
||||
"vuedraggable": "^2.23.2",
|
||||
"vuex": "^3.4.0",
|
||||
"wangeditor": "^4.7.5",
|
||||
"xlsx": "^0.16.2",
|
||||
"xss": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -61,6 +44,7 @@
|
|||
"less-loader": "^6.2.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-resources-loader": "^1.3.2",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
}
|
||||
|
|
|
@ -1,39 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<!-- <meta name="viewport" content="width=device-width,initial-scale=1.0"> -->
|
||||
<link rel="icon" href="./logo.ico" type="image/x-icon">
|
||||
<link rel="icon" href="./logo.ico" type="image/x-icon" />
|
||||
<title>lili admin</title>
|
||||
<meta name="keywords"
|
||||
content="keywords">
|
||||
<meta name="description"
|
||||
content="description">
|
||||
<!-- 部署CDN优化 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-i18n@8.15.1/dist/vue-i18n.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/iview.min.js"></script>
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/iview-area@1.6.0/dist/iview-area.min.js"></script> -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-lazyload@1.3.3/vue-lazyload.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-apexcharts@1.5.1/dist/vue-apexcharts.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/xlsx@0.15.3/dist/xlsx.full.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/dplayer@1.25.0/dist/DPlayer.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/print-js@1.0.63/dist/print.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue-json-pretty@1.6.2/vue-json-pretty.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/gitalk@1.5.0/dist/gitalk.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/wangeditor@3.1.1/release/wangEditor.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/stomp.js/2.3.3/stomp.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.8.4/Sortable.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js"></script>
|
||||
<script src="https://v.vaptcha.com/v3.js"></script>
|
||||
<meta name="keywords" content="keywords" />
|
||||
<meta name="description" content="description" />
|
||||
<% for(var css of htmlWebpackPlugin.options.cdn.css) { %>
|
||||
<link rel="stylesheet" href="<%=css%>" />
|
||||
<% } %>
|
||||
<style>
|
||||
.page-loading-wrap {
|
||||
padding: 120px;
|
||||
|
@ -77,7 +54,6 @@
|
|||
@keyframes half-circle-spinner-animation {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
|
||||
}
|
||||
|
||||
100% {
|
||||
|
@ -88,9 +64,14 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<% for(var js of htmlWebpackPlugin.options.cdn.js) { %>
|
||||
<script src="<%=js%>"></script>
|
||||
<% } %>
|
||||
<noscript>
|
||||
<strong>We're sorry but lili-admin doesn't work properly without JavaScript enabled. Please enable it to
|
||||
continue.</strong>
|
||||
<strong
|
||||
>We're sorry but lili-admin doesn't work properly without JavaScript
|
||||
enabled. Please enable it to continue.</strong
|
||||
>
|
||||
</noscript>
|
||||
<div id="app">
|
||||
<div class="page-loading-wrap">
|
||||
|
@ -101,7 +82,5 @@
|
|||
<h4 style="margin-top:20px;">正在加载资源...</h4>
|
||||
</div>
|
||||
</div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 78 KiB |
|
@ -1,69 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="1361px" height="609px" viewBox="0 0 1361 609" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Group 21</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Ant-Design-Pro-3.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="账户密码登录-校验" transform="translate(-79.000000, -82.000000)">
|
||||
<g id="Group-21" transform="translate(77.000000, 73.000000)">
|
||||
<g id="Group-18" opacity="0.8" transform="translate(74.901416, 569.699158) rotate(-7.000000) translate(-74.901416, -569.699158) translate(4.901416, 525.199158)">
|
||||
<ellipse id="Oval-11" fill="#CFDAE6" opacity="0.25" cx="63.5748792" cy="32.468367" rx="21.7830479" ry="21.766008"></ellipse>
|
||||
<ellipse id="Oval-3" fill="#CFDAE6" opacity="0.599999964" cx="5.98746479" cy="13.8668601" rx="5.2173913" ry="5.21330997"></ellipse>
|
||||
<path d="M38.1354514,88.3520215 C43.8984227,88.3520215 48.570234,83.6838647 48.570234,77.9254015 C48.570234,72.1669383 43.8984227,67.4987816 38.1354514,67.4987816 C32.3724801,67.4987816 27.7006688,72.1669383 27.7006688,77.9254015 C27.7006688,83.6838647 32.3724801,88.3520215 38.1354514,88.3520215 Z" id="Oval-3-Copy" fill="#CFDAE6" opacity="0.45"></path>
|
||||
<path d="M64.2775582,33.1704963 L119.185836,16.5654915" id="Path-12" stroke="#CFDAE6" stroke-width="1.73913043" stroke-linecap="round" stroke-linejoin="round"></path>
|
||||
<path d="M42.1431708,26.5002681 L7.71190162,14.5640702" id="Path-16" stroke="#E0B4B7" stroke-width="0.702678964" opacity="0.7" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="1.405357899873153,2.108036953469981"></path>
|
||||
<path d="M63.9262187,33.521561 L43.6721326,69.3250951" id="Path-15" stroke="#BACAD9" stroke-width="0.702678964" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="1.405357899873153,2.108036953469981"></path>
|
||||
<g id="Group-17" transform="translate(126.850922, 13.543654) rotate(30.000000) translate(-126.850922, -13.543654) translate(117.285705, 4.381889)" fill="#CFDAE6">
|
||||
<ellipse id="Oval-4" opacity="0.45" cx="9.13482653" cy="9.12768076" rx="9.13482653" ry="9.12768076"></ellipse>
|
||||
<path d="M18.2696531,18.2553615 C18.2696531,13.2142826 14.1798519,9.12768076 9.13482653,9.12768076 C4.08980114,9.12768076 0,13.2142826 0,18.2553615 L18.2696531,18.2553615 Z" id="Oval-4" transform="translate(9.134827, 13.691521) scale(-1, -1) translate(-9.134827, -13.691521) "></path>
|
||||
</g>
|
||||
</g>
|
||||
<g id="Group-14" transform="translate(216.294700, 123.725600) rotate(-5.000000) translate(-216.294700, -123.725600) translate(106.294700, 35.225600)">
|
||||
<ellipse id="Oval-2" fill="#CFDAE6" opacity="0.25" cx="29.1176471" cy="29.1402439" rx="29.1176471" ry="29.1402439"></ellipse>
|
||||
<ellipse id="Oval-2" fill="#CFDAE6" opacity="0.3" cx="29.1176471" cy="29.1402439" rx="21.5686275" ry="21.5853659"></ellipse>
|
||||
<ellipse id="Oval-2-Copy" stroke="#CFDAE6" opacity="0.4" cx="179.019608" cy="138.146341" rx="23.7254902" ry="23.7439024"></ellipse>
|
||||
<ellipse id="Oval-2" fill="#BACAD9" opacity="0.5" cx="29.1176471" cy="29.1402439" rx="10.7843137" ry="10.7926829"></ellipse>
|
||||
<path d="M29.1176471,39.9329268 L29.1176471,18.347561 C23.1616351,18.347561 18.3333333,23.1796097 18.3333333,29.1402439 C18.3333333,35.1008781 23.1616351,39.9329268 29.1176471,39.9329268 Z" id="Oval-2" fill="#BACAD9"></path>
|
||||
<g id="Group-9" opacity="0.45" transform="translate(172.000000, 131.000000)" fill="#E6A1A6">
|
||||
<ellipse id="Oval-2-Copy-2" cx="7.01960784" cy="7.14634146" rx="6.47058824" ry="6.47560976"></ellipse>
|
||||
<path d="M0.549019608,13.6219512 C4.12262681,13.6219512 7.01960784,10.722722 7.01960784,7.14634146 C7.01960784,3.56996095 4.12262681,0.670731707 0.549019608,0.670731707 L0.549019608,13.6219512 Z" id="Oval-2-Copy-2" transform="translate(3.784314, 7.146341) scale(-1, 1) translate(-3.784314, -7.146341) "></path>
|
||||
</g>
|
||||
<ellipse id="Oval-10" fill="#CFDAE6" cx="218.382353" cy="138.685976" rx="1.61764706" ry="1.61890244"></ellipse>
|
||||
<ellipse id="Oval-10-Copy-2" fill="#E0B4B7" opacity="0.35" cx="179.558824" cy="175.381098" rx="1.61764706" ry="1.61890244"></ellipse>
|
||||
<ellipse id="Oval-10-Copy" fill="#E0B4B7" opacity="0.35" cx="180.098039" cy="102.530488" rx="2.15686275" ry="2.15853659"></ellipse>
|
||||
<path d="M28.9985381,29.9671598 L171.151018,132.876024" id="Path-11" stroke="#CFDAE6" opacity="0.8"></path>
|
||||
</g>
|
||||
<g id="Group-10" opacity="0.799999952" transform="translate(1054.100635, 36.659317) rotate(-11.000000) translate(-1054.100635, -36.659317) translate(1026.600635, 4.659317)">
|
||||
<ellipse id="Oval-7" stroke="#CFDAE6" stroke-width="0.941176471" cx="43.8135593" cy="32" rx="11.1864407" ry="11.2941176"></ellipse>
|
||||
<g id="Group-12" transform="translate(34.596774, 23.111111)" fill="#BACAD9">
|
||||
<ellipse id="Oval-7" opacity="0.45" cx="9.18534718" cy="8.88888889" rx="8.47457627" ry="8.55614973"></ellipse>
|
||||
<path d="M9.18534718,17.4450386 C13.8657264,17.4450386 17.6599235,13.6143199 17.6599235,8.88888889 C17.6599235,4.16345787 13.8657264,0.332739156 9.18534718,0.332739156 L9.18534718,17.4450386 Z" id="Oval-7"></path>
|
||||
</g>
|
||||
<path d="M34.6597385,24.809694 L5.71666084,4.76878945" id="Path-2" stroke="#CFDAE6" stroke-width="0.941176471"></path>
|
||||
<ellipse id="Oval" stroke="#CFDAE6" stroke-width="0.941176471" cx="3.26271186" cy="3.29411765" rx="3.26271186" ry="3.29411765"></ellipse>
|
||||
<ellipse id="Oval-Copy" fill="#F7E1AD" cx="2.79661017" cy="61.1764706" rx="2.79661017" ry="2.82352941"></ellipse>
|
||||
<path d="M34.6312443,39.2922712 L5.06366663,59.785082" id="Path-10" stroke="#CFDAE6" stroke-width="0.941176471"></path>
|
||||
</g>
|
||||
<g id="Group-19" opacity="0.33" transform="translate(1282.537219, 446.502867) rotate(-10.000000) translate(-1282.537219, -446.502867) translate(1142.537219, 327.502867)">
|
||||
<g id="Group-17" transform="translate(141.333539, 104.502742) rotate(275.000000) translate(-141.333539, -104.502742) translate(129.333539, 92.502742)" fill="#BACAD9">
|
||||
<circle id="Oval-4" opacity="0.45" cx="11.6666667" cy="11.6666667" r="11.6666667"></circle>
|
||||
<path d="M23.3333333,23.3333333 C23.3333333,16.8900113 18.1099887,11.6666667 11.6666667,11.6666667 C5.22334459,11.6666667 0,16.8900113 0,23.3333333 L23.3333333,23.3333333 Z" id="Oval-4" transform="translate(11.666667, 17.500000) scale(-1, -1) translate(-11.666667, -17.500000) "></path>
|
||||
</g>
|
||||
<circle id="Oval-5-Copy-6" fill="#CFDAE6" cx="201.833333" cy="87.5" r="5.83333333"></circle>
|
||||
<path d="M143.5,88.8126685 L155.070501,17.6038544" id="Path-17" stroke="#BACAD9" stroke-width="1.16666667"></path>
|
||||
<path d="M17.5,37.3333333 L127.466252,97.6449735" id="Path-18" stroke="#BACAD9" stroke-width="1.16666667"></path>
|
||||
<polyline id="Path-19" stroke="#CFDAE6" stroke-width="1.16666667" points="143.902597 120.302281 174.935455 231.571342 38.5 147.510847 126.366941 110.833333"></polyline>
|
||||
<path d="M159.833333,99.7453842 L195.416667,89.25" id="Path-20" stroke="#E0B4B7" stroke-width="1.16666667" opacity="0.6"></path>
|
||||
<path d="M205.333333,82.1372105 L238.719406,36.1666667" id="Path-24" stroke="#BACAD9" stroke-width="1.16666667"></path>
|
||||
<path d="M266.723424,132.231988 L207.083333,90.4166667" id="Path-25" stroke="#CFDAE6" stroke-width="1.16666667"></path>
|
||||
<circle id="Oval-5" fill="#C1D1E0" cx="156.916667" cy="8.75" r="8.75"></circle>
|
||||
<circle id="Oval-5-Copy-3" fill="#C1D1E0" cx="39.0833333" cy="148.75" r="5.25"></circle>
|
||||
<circle id="Oval-5-Copy-2" fill-opacity="0.6" fill="#D1DEED" cx="8.75" cy="33.25" r="8.75"></circle>
|
||||
<circle id="Oval-5-Copy-4" fill-opacity="0.6" fill="#D1DEED" cx="243.833333" cy="30.3333333" r="5.83333333"></circle>
|
||||
<circle id="Oval-5-Copy-5" fill="#E0B4B7" cx="175.583333" cy="232.75" r="5.25"></circle>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 662 B |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 676 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 70 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 390 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 138 KiB |
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 123 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 7.3 KiB |
|
@ -1,102 +0,0 @@
|
|||
import XLSX from 'xlsx';
|
||||
|
||||
function auto_width(ws, data){
|
||||
/*set worksheet max width per col*/
|
||||
const colWidth = data.map(row => row.map(val => {
|
||||
/*if null/undefined*/
|
||||
if (val == null) {
|
||||
return {'wch': 10};
|
||||
}
|
||||
/*if chinese*/
|
||||
else if (val.toString().charCodeAt(0) > 255) {
|
||||
return {'wch': val.toString().length * 2};
|
||||
} else {
|
||||
return {'wch': val.toString().length};
|
||||
}
|
||||
}))
|
||||
/*start in the first row*/
|
||||
let result = colWidth[0];
|
||||
for (let i = 1; i < colWidth.length; i++) {
|
||||
for (let j = 0; j < colWidth[i].length; j++) {
|
||||
if (result[j]['wch'] < colWidth[i][j]['wch']) {
|
||||
result[j]['wch'] = colWidth[i][j]['wch'];
|
||||
}
|
||||
}
|
||||
}
|
||||
ws['!cols'] = result;
|
||||
}
|
||||
|
||||
function json_to_array(key, jsonData){
|
||||
return jsonData.map(v => key.map(j => { return v[j] }));
|
||||
}
|
||||
|
||||
// fix data,return string
|
||||
function fixdata(data) {
|
||||
let o = ''
|
||||
let l = 0
|
||||
const w = 10240
|
||||
for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
|
||||
o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
|
||||
return o
|
||||
}
|
||||
|
||||
// get head from excel file,return array
|
||||
function get_header_row(sheet) {
|
||||
const headers = []
|
||||
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||
let C
|
||||
const R = range.s.r /* start in the first row */
|
||||
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||
var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })] /* find the cell in the first row */
|
||||
var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||
headers.push(hdr)
|
||||
}
|
||||
return headers
|
||||
}
|
||||
|
||||
export const export_table_to_excel= (id, filename) => {
|
||||
const table = document.getElementById(id);
|
||||
const wb = XLSX.utils.table_to_book(table);
|
||||
XLSX.writeFile(wb, filename);
|
||||
}
|
||||
|
||||
export const export_json_to_excel = ({data, key, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
data.unshift(title);
|
||||
const ws = XLSX.utils.json_to_sheet(data, {header: key, skipHeader: true});
|
||||
if(autoWidth){
|
||||
const arr = json_to_array(key, data);
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const export_array_to_excel = ({key, data, title, filename, autoWidth}) => {
|
||||
const wb = XLSX.utils.book_new();
|
||||
const arr = json_to_array(key, data);
|
||||
arr.unshift(title);
|
||||
const ws = XLSX.utils.aoa_to_sheet(arr);
|
||||
if(autoWidth){
|
||||
auto_width(ws, arr);
|
||||
}
|
||||
XLSX.utils.book_append_sheet(wb, ws, filename);
|
||||
XLSX.writeFile(wb, filename + '.xlsx');
|
||||
}
|
||||
|
||||
export const read = (data, type) => {
|
||||
const workbook = XLSX.read(data, { type: type });
|
||||
const firstSheetName = workbook.SheetNames[0];
|
||||
const worksheet = workbook.Sheets[firstSheetName];
|
||||
const header = get_header_row(worksheet);
|
||||
const results = XLSX.utils.sheet_to_json(worksheet);
|
||||
return {header, results};
|
||||
}
|
||||
|
||||
export default {
|
||||
export_table_to_excel,
|
||||
export_array_to_excel,
|
||||
export_json_to_excel,
|
||||
read
|
||||
}
|
|
@ -15,7 +15,6 @@ import vueQr from 'vue-qr'
|
|||
import { getRequest, postRequest, putRequest, deleteRequest, importRequest, uploadFileRequest } from '@/libs/axios'
|
||||
import { setStore, getStore, removeStore } from '@/libs/storage'
|
||||
import util from '@/libs/util'
|
||||
import VueLazyload from 'vue-lazyload'
|
||||
|
||||
import * as filters from '@/utils/filters' // global filter
|
||||
import liliDialog from '@/views/lili-dialog'
|
||||
|
@ -30,10 +29,7 @@ Vue.prototype.linkTo = function (goodsId, skuId) { // 跳转买家端商品
|
|||
Vue.prototype.wapLinkTo = function (goodsId, skuId) { // app端二维码
|
||||
return `${buyerUrlWap}/pages/product/goods?id=${skuId}&goodsId=${goodsId}`
|
||||
};
|
||||
Vue.use(VueLazyload, {
|
||||
error: require('./assets/img-error.png'),
|
||||
loading: require('./assets/loading2.gif')
|
||||
})
|
||||
|
||||
Vue.use(ViewUI, {
|
||||
i18n: (key, value) => i18n.t(key, value)
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ export const otherRouter = {
|
|||
children: [
|
||||
{
|
||||
path: "home",
|
||||
title: { i18n: "home" },
|
||||
title: '首页',
|
||||
name: "home_index",
|
||||
component: () => import("@/views/home/home.vue")
|
||||
},
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
</Row>
|
||||
</Card>
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate" >
|
||||
<Form ref="form" :model="form" :label-width="100" >
|
||||
<FormItem label="编号">
|
||||
<Input disabled v-model="form.sn" clearable style="width:100%"/>
|
||||
</FormItem>
|
||||
|
|
|
@ -1,22 +1,18 @@
|
|||
<template>
|
||||
<div>
|
||||
<Card>
|
||||
<Form @keydown.enter.native="handleSearch" ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form @keydown.enter.native="handleSearch" ref="searchForm" :model="searchForm" inline :label-width="70"
|
||||
class="search-form">
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.goodsName"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
<Row class="operation" style="margin:10px 0;">
|
||||
<Button @click="delAll" type="primary">批量下架</Button>
|
||||
</Row>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||
@on-selection-change="changeSelect">
|
||||
<template slot="goodsName" slot-scope="{row}">
|
||||
<div>
|
||||
<div class="div-zoom">
|
||||
|
@ -24,7 +20,8 @@
|
|||
</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<div slot="content">
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150"></vue-qr>
|
||||
<vue-qr :text="wapLinkTo(row.goodsId,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
|
||||
:size="150"></vue-qr>
|
||||
</div>
|
||||
<img src="../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||
</Poptip>
|
||||
|
@ -32,23 +29,27 @@
|
|||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getDistributionGoods,
|
||||
delDistributionGoods
|
||||
} from "@/api/distribution";
|
||||
import { getDistributionGoods, delDistributionGoods } from "@/api/distribution";
|
||||
import vueQr from "vue-qr";
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
},
|
||||
name: "distributionGoods",
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: { // 搜索框初始化对象
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "createTime", // 默认排序字段
|
||||
|
@ -74,31 +75,34 @@ export default {
|
|||
return h("img", {
|
||||
attrs: {
|
||||
src: params.row.thumbnail,
|
||||
alt: "加载图片失败"
|
||||
alt: "加载图片失败",
|
||||
},
|
||||
style: {
|
||||
cursor: "pointer",
|
||||
width: "80px",
|
||||
height: "60px",
|
||||
margin: "10px 0",
|
||||
"object-fit": "contain"
|
||||
}
|
||||
"object-fit": "contain",
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
slot: "goodsName",
|
||||
minWidth: 200,
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "商品价格",
|
||||
key: "price",
|
||||
minWidth: 100,
|
||||
render: (h, params) => {
|
||||
return h("div", this.$options.filters.unitPrice(params.row.price,'¥'));
|
||||
}
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "库存",
|
||||
|
@ -107,21 +111,23 @@ export default {
|
|||
{
|
||||
title: "添加时间",
|
||||
key: "createTime",
|
||||
width: 170
|
||||
width: 170,
|
||||
},
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "佣金金额",
|
||||
key: "commission",
|
||||
sortable: false,
|
||||
render: (h, params) => {
|
||||
return h("div", this.$options.filters.unitPrice(params.row.commission,'¥'));
|
||||
}
|
||||
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.commission, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
@ -136,22 +142,22 @@ export default {
|
|||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small"
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.remove(params.row);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
"下架"
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0 // 表单数据总数
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -188,7 +194,7 @@ export default {
|
|||
// 获取列表数据
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
getDistributionGoods(this.searchForm).then(res => {
|
||||
getDistributionGoods(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
|
@ -206,14 +212,14 @@ export default {
|
|||
loading: true,
|
||||
onOk: () => {
|
||||
// 下架
|
||||
delDistributionGoods(v.id).then(res => {
|
||||
delDistributionGoods(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
// 批量下架
|
||||
|
@ -227,12 +233,12 @@ export default {
|
|||
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
let ids = []
|
||||
this.selectList.forEach(item => {
|
||||
ids.push(item.id)
|
||||
let ids = [];
|
||||
this.selectList.forEach((item) => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
// 批量下架
|
||||
delDistributionGoods(ids.toString()).then(res => {
|
||||
delDistributionGoods(ids.toString()).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
|
@ -240,13 +246,13 @@ export default {
|
|||
this.getDataList();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -69,10 +69,13 @@
|
|||
} from "@/api/distribution";
|
||||
import {orderStatusList} from './dataJson'
|
||||
import {getShopListData} from '@/api/shops'
|
||||
import vueQr from 'vue-qr'
|
||||
|
||||
export default {
|
||||
name: "distributionOrder",
|
||||
components: {},
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
timeRange: [], // 范围时间
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
<script>
|
||||
import { setSetting, getSetting } from "@/api/index";
|
||||
|
||||
export default {
|
||||
name: "distributionSetting",
|
||||
data() {
|
||||
|
@ -33,8 +32,8 @@ export default {
|
|||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
isOpen: "",
|
||||
distributionDay: "", //分销关系绑定天数
|
||||
cashDay: "", //分销结算天数
|
||||
distributionDay: 0, //分销关系绑定天数
|
||||
cashDay: 0, //分销结算天数
|
||||
}
|
||||
};
|
||||
},
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
:data="data"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
|
|
@ -118,7 +118,11 @@
|
|||
|
||||
<script>
|
||||
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
name: "goods",
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
|
||||
<template slot="action" slot-scope="scope">
|
||||
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
|
||||
<Dropdown v-show="scope.row.level == 2" trigger="click">
|
||||
<Button size="small">
|
||||
绑定
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
|
@ -19,7 +19,7 @@
|
|||
</Dropdown>
|
||||
|
||||
|
||||
<Dropdown transfer="true" trigger="click">
|
||||
<Dropdown trigger="click">
|
||||
<Button size="small">
|
||||
操作
|
||||
<Icon type="ios-arrow-down"></Icon>
|
||||
|
@ -134,6 +134,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false, //加载状态
|
||||
categoryList: [], // 分类列表
|
||||
loading: false, // 加载状态
|
||||
brands: [], //品牌集合
|
||||
|
@ -154,9 +155,9 @@ export default {
|
|||
parentId: "",
|
||||
name: "",
|
||||
image: "",
|
||||
sortOrder: "",
|
||||
sortOrder: 0,
|
||||
deleteFlag: 0,
|
||||
commissionRate: "",
|
||||
commissionRate: 0,
|
||||
level: 0,
|
||||
},
|
||||
brandForm: {
|
||||
|
|
|
@ -79,6 +79,9 @@
|
|||
<Checkbox label=1 v-model="paramForm.required">必填</Checkbox>
|
||||
<Checkbox label=1 v-model="paramForm.isIndex">可索引</Checkbox>
|
||||
</FormItem>
|
||||
<FormItem label="排序" prop="specName3">
|
||||
<Input type="number" v-model="paramForm.sort" style="width: 100%" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
<div slot="footer">
|
||||
|
@ -170,6 +173,7 @@ export default {
|
|||
options: "",
|
||||
required: false,
|
||||
isIndex: false,
|
||||
sort: 0,
|
||||
groupId: group.groupId,
|
||||
categoryId: this.categoryId,
|
||||
};
|
||||
|
@ -186,9 +190,9 @@ export default {
|
|||
isIndex: param.isIndex==1?true:false,
|
||||
groupId: group.groupId,
|
||||
categoryId: this.categoryId,
|
||||
sort: param.sort,
|
||||
id: param.id,
|
||||
};
|
||||
console.warn(this.paramForm.options)
|
||||
this.ops = this.paramForm.options
|
||||
this.modalType = 1;
|
||||
this.modalTitle = "修改参数";
|
||||
|
|
|
@ -142,7 +142,8 @@
|
|||
</div>
|
||||
<div class="today-item">
|
||||
<div>今日交易额</div>
|
||||
<span>¥{{homeData.todayOrderPrice ? (homeData.todayOrderPrice | unitPrice) : 0}}</span>
|
||||
<span v-if="homeData.todayOrderPrice">¥{{homeData.todayOrderPrice | unitPrice}}</span>
|
||||
<span v-else>¥0.00</span>
|
||||
</div>
|
||||
<div class="today-item">
|
||||
<div>今日新增店铺</div>
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="breadcrumb">
|
||||
<span @click="clickBreadcrumb(item,index)" :class="{'active':item.selected}" v-for="(item,index) in dateList" :key="index"> {{item.title}}</span>
|
||||
<span @click="clickBreadcrumb(item,index)" :class="{'active':item.selected}" v-for="(item,index) in dateList"
|
||||
:key="index"> {{item.title}}</span>
|
||||
<div class="date-picker">
|
||||
<Select @on-change="changeSelect(selectedWay)" v-model="month" placeholder="年月查询" style="width:200px;margin-left:10px;">
|
||||
<Option v-for="(item,index) in dates" :value="item.year+'-'+item.month" :key="index">{{ item.year+'年'+item.month+'月' }}</Option>
|
||||
<Select @on-change="changeSelect(selectedWay)" v-model="month" placeholder="年月查询"
|
||||
style="width:200px;margin-left:10px;">
|
||||
<Option v-for="(item,index) in dates" :value="item.year+'-'+item.month" :key="index">
|
||||
{{ item.year+'年'+item.month+'月' }}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div class="shop-list" v-if="!closeShop">
|
||||
<Select clearable @on-change="changeshop(selectedWay)" v-model="storeId" placeholder="店铺查询" style="width:200px;margin-left:10px;">
|
||||
<Select clearable @on-change="changeshop(selectedWay)" v-model="storeId" placeholder="店铺查询"
|
||||
style="width:200px;margin-left:10px;">
|
||||
<Scroll :on-reach-bottom="handleReachBottom">
|
||||
<Option v-for="(item,index) in shopsData" :value="item.id" :key="index">{{ item.storeName }}</Option>
|
||||
</Scroll>
|
||||
|
@ -25,19 +29,22 @@ export default {
|
|||
return {
|
||||
month: "", // 月份
|
||||
|
||||
selectedWay: { // 可选时间项
|
||||
selectedWay: {
|
||||
// 可选时间项
|
||||
title: "最近7天",
|
||||
selected: true,
|
||||
searchType: "LAST_SEVEN",
|
||||
},
|
||||
storeId: "", // 店铺id
|
||||
dates: [], // 日期列表
|
||||
params: { // 请求参数
|
||||
params: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
storeName: "",
|
||||
},
|
||||
dateList: [ // 筛选条件
|
||||
dateList: [
|
||||
// 筛选条件
|
||||
{
|
||||
title: "今天",
|
||||
selected: false,
|
||||
|
@ -71,7 +78,6 @@ export default {
|
|||
methods: {
|
||||
// 页面触底
|
||||
handleReachBottom() {
|
||||
|
||||
setTimeout(() => {
|
||||
if (this.params.pageNumber * this.params.pageSize <= this.shopTotal) {
|
||||
this.params.pageNumber++;
|
||||
|
@ -144,8 +150,16 @@ export default {
|
|||
this.month = "";
|
||||
|
||||
if (item.searchType == "") {
|
||||
if (
|
||||
dateList.some((date) => {
|
||||
return date.title == item.title;
|
||||
})
|
||||
) {
|
||||
item.searchType = date.searchType;
|
||||
} else {
|
||||
item.searchType = "LAST_SEVEN";
|
||||
}
|
||||
}
|
||||
|
||||
this.selectedWay = item;
|
||||
this.selectedWay.year = new Date().getFullYear();
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</i-switch>
|
||||
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
|
||||
<Button type="success" placement="right" @click="decorate(item)" size="small">装修</Button>
|
||||
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)" @on-cancel="cancel">
|
||||
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)">
|
||||
<Button type="error" size="small">删除</Button>
|
||||
</Poptip>
|
||||
</div>
|
||||
|
@ -46,7 +46,7 @@
|
|||
@on-ok="newTemplate"
|
||||
@on-cancel="showModal = false"
|
||||
>
|
||||
<Form ref="form" :model="formData" :rules="rules" :label-width="80">
|
||||
<Form ref="form" :model="formData" :label-width="80">
|
||||
<FormItem label="模板名称" prop="name">
|
||||
<Input v-model="formData.name" placeholder="请输入模板名称" />
|
||||
</FormItem>
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
<script>
|
||||
import * as API_Other from "@/api/other.js";
|
||||
|
||||
import QRCode from "qrcodejs2";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -66,7 +65,7 @@ export default {
|
|||
// selected: false,
|
||||
// },
|
||||
],
|
||||
qrcode: "", // 二维码
|
||||
|
||||
submitWay: {
|
||||
// 表单信息
|
||||
pageShow: this.$route.query.type || false,
|
||||
|
@ -169,20 +168,6 @@ export default {
|
|||
})
|
||||
.catch((error) => {});
|
||||
},
|
||||
|
||||
creatQrCode() {
|
||||
if (this.qrcode) {
|
||||
return false;
|
||||
}
|
||||
// this.qrcode = new QRCode(this.$refs.qrCodeUrl, {
|
||||
// text: "https://www.baidu.com", // 需要转换为二维码的内容
|
||||
// width: 100,
|
||||
// height: 100,
|
||||
// colorDark: "#000000",
|
||||
// colorLight: "#ffffff",
|
||||
// correctLevel: QRCode.CorrectLevel.H,
|
||||
// });
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="layout">
|
||||
<Carousel class="carousel" v-if="res" autoplay autoplay-speed="5000">
|
||||
<Carousel class="carousel" v-if="res" autoplay :autoplay-speed="5000">
|
||||
<CarouselItem v-for="(item, index) in res.list" :key="index">
|
||||
<div>
|
||||
<img class="image-mode" :src="item.img" />
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<span slot="close">关</span>
|
||||
</i-switch>
|
||||
<Button type="info" placement="right" @click="handleEdit(item)" size="small">修改</Button>
|
||||
<Poptip confirm title="删除此模板?" @on-ok="handleDel(item)" @on-cancel="cancel">
|
||||
<Poptip confirm title="删除此模板?" @on-ok="handleDel(item)" >
|
||||
<Button type="error" size="small">删除</Button>
|
||||
</Poptip>
|
||||
</div>
|
||||
|
@ -79,7 +79,7 @@ export default {
|
|||
pageType: "INDEX",
|
||||
pageClientType: "H5",
|
||||
},
|
||||
total: "", // 页面数量
|
||||
total: 0, // 页面数量
|
||||
list: [], // 总数据
|
||||
};
|
||||
},
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
</FormItem>
|
||||
<FormItem label="支持电子面单">
|
||||
<i-switch v-model="form.standBy" size="large">
|
||||
<span slot="open">开</span>
|
||||
<span slot="close">关</span>
|
||||
<span slot="OPEN">开</span>
|
||||
<span slot="CLOSE">关</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
<FormItem label="电子面单表单">
|
||||
|
@ -58,8 +58,8 @@
|
|||
</FormItem>
|
||||
<FormItem label="禁用状态" prop="disabled">
|
||||
<i-switch v-model="form.disabled" size="large">
|
||||
<span slot="open">开启</span>
|
||||
<span slot="close">禁用</span>
|
||||
<span slot="OPEN">开启</span>
|
||||
<span slot="CLOSE">禁用</span>
|
||||
</i-switch>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
@ -100,6 +100,7 @@
|
|||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
name: "",
|
||||
disabled:"OPEN"
|
||||
},
|
||||
// 表单验证规则
|
||||
formValidate: {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: "footer",
|
||||
|
||||
data() {
|
||||
return {
|
||||
year: new Date().getFullYear()
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<script>
|
||||
export default {
|
||||
name: "header",
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
|
||||
<Table :loading="loading" border :columns="columns" class="mt_10" :data="data" ref="table"></Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
show-total show-elevator show-sizer></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
|
@ -44,7 +45,7 @@
|
|||
</Form>
|
||||
<div slot="footer">
|
||||
<Button @click="addFlag = false">取消</Button>
|
||||
<Button type="primary" :loading="handleAddLoading" @click="addMemberSubmit">确定</Button>
|
||||
<Button type="primary" @click="addMemberSubmit">确定</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<!-- 修改模态框 -->
|
||||
|
@ -108,11 +109,11 @@ import * as RegExp from "@/libs/RegExp.js";
|
|||
export default {
|
||||
name: "member",
|
||||
components: {
|
||||
region, ossManage
|
||||
region,
|
||||
ossManage,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectedMember: false, //是否是其他组件调用
|
||||
descTitle: "", // modal标题
|
||||
descFlag: false, //编辑查看框
|
||||
loading: true, // 表单加载状态
|
||||
|
@ -210,7 +211,7 @@ export default {
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: params.row.___selected ? "primary" : "",
|
||||
type: params.row.___selected ? "primary" : "default",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -302,7 +303,9 @@ export default {
|
|||
// 已选择用户数据
|
||||
selectedList: {
|
||||
type: null,
|
||||
default: [],
|
||||
default: () => {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
@ -311,7 +314,6 @@ export default {
|
|||
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
|
||||
this.init(this.data);
|
||||
// 将父级数据与当前组件数据进行匹配
|
||||
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
|
@ -381,7 +383,7 @@ export default {
|
|||
},
|
||||
addMember() {
|
||||
this.addFlag = true;
|
||||
this.$refs.addMemberForm.resetFields()
|
||||
this.$refs.addMemberForm.resetFields();
|
||||
},
|
||||
/**
|
||||
* 查询查看会员详情
|
||||
|
@ -416,7 +418,7 @@ export default {
|
|||
if (valid) {
|
||||
API_Member.addMember(this.addMemberForm).then((res) => {
|
||||
if (res.result) {
|
||||
this.$refs.addMemberForm.resetFields()
|
||||
this.$refs.addMemberForm.resetFields();
|
||||
this.getData();
|
||||
this.$Message.success("添加成功!");
|
||||
this.addFlag = false;
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</Card>
|
||||
|
||||
<Card class="mt_10">
|
||||
<Tabs type="point" @on-click="memberInfoChange">
|
||||
<Tabs value="point" @on-click="memberInfoChange">
|
||||
<TabPane label="TA的积分" name="point">
|
||||
<div class="pointsTitle" style="justify-content: flex-start; text-align: left;">
|
||||
<div style="width: 120px;">
|
||||
|
@ -203,7 +203,6 @@
|
|||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-sort-change="addressChangeSort"
|
||||
>
|
||||
</Table>
|
||||
|
||||
|
@ -339,8 +338,8 @@
|
|||
</FormItem>
|
||||
<FormItem label="默认" prop="isDefault">
|
||||
<RadioGroup type="button" button-style="solid" v-model="addressForm.isDefault">
|
||||
<Radio :label=true>是</Radio>
|
||||
<Radio :label=false>否</Radio>
|
||||
<Radio label="1">是</Radio>
|
||||
<Radio label="0">否</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
@ -378,7 +377,7 @@
|
|||
addressModalVisible: false, //会员地址操作弹出框
|
||||
addressForm: {
|
||||
id: "",
|
||||
isDefault: false
|
||||
isDefault: "0"
|
||||
|
||||
},//会员地址操作form
|
||||
selectDate: null, // 选择时间段
|
||||
|
@ -665,7 +664,7 @@
|
|||
key: "isDefault",
|
||||
width: 80,
|
||||
render: (h, params) => {
|
||||
if (params.row.isDefault) {
|
||||
if (params.row.isDefault == "1") {
|
||||
return h('div', [
|
||||
h('span', {}, "是"),
|
||||
]);
|
||||
|
@ -981,7 +980,7 @@
|
|||
this.addressModalVisible = true
|
||||
this.addressForm = {
|
||||
id: "",
|
||||
isDefault: false,
|
||||
isDefault: "0",
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -998,9 +997,11 @@
|
|||
this.$refs.addressForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.addressForm.id != "") {
|
||||
let submit = JSON.parse(JSON.stringify(this.addressForm))
|
||||
submit.isDefault == "1" ? submit.isDefault = true : submit.isDefault = false
|
||||
if (submit.id != "") {
|
||||
//修改地址
|
||||
API_Member.editMemberAddress(this.addressForm).then((res) => {
|
||||
API_Member.editMemberAddress(submit).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res && res.success) {
|
||||
this.$Message.success("修改成功");
|
||||
|
@ -1010,7 +1011,7 @@
|
|||
});
|
||||
} else {
|
||||
//添加地址
|
||||
API_Member.addMemberAddress(this.addressForm).then((res) => {
|
||||
API_Member.addMemberAddress(submit).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res && res.success) {
|
||||
this.$Message.success("添加成功");
|
||||
|
|
|
@ -3,97 +3,43 @@
|
|||
<Row>
|
||||
<Card>
|
||||
<Row @keydown.enter.native="handleSearch">
|
||||
<Form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="会员名称" prop="username">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.username"
|
||||
placeholder="请输入会员名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.username" placeholder="请输入会员名称" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
|
||||
<Form-item label="联系方式" prop="mobile">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.mobile"
|
||||
placeholder="请输入会员联系方式"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.mobile" placeholder="请输入会员联系方式" clearable style="width: 200px" />
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" sortable="custom">
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</Row>
|
||||
|
||||
<!-- 修改模态框 -->
|
||||
<Modal v-model="descFlag" :title="descTitle" @on-ok="handleSubmitModal" width="500">
|
||||
<Form
|
||||
ref="formValidate"
|
||||
:model="formValidate"
|
||||
:rules="ruleValidate"
|
||||
:label-width="80"
|
||||
>
|
||||
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="80">
|
||||
<FormItem label="头像">
|
||||
<img :src="formValidate.face" class="face" />
|
||||
<Button
|
||||
type="text"
|
||||
class="upload"
|
||||
@click="
|
||||
<Button type="text" class="upload" @click="
|
||||
() => {
|
||||
this.picModelFlag = true;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
"
|
||||
>修改
|
||||
</Button
|
||||
>
|
||||
<input
|
||||
type="file"
|
||||
style="display: none"
|
||||
id="file"
|
||||
/>
|
||||
">修改
|
||||
</Button>
|
||||
<input type="file" style="display: none" id="file" />
|
||||
</FormItem>
|
||||
<FormItem label="会员名称" prop="name">
|
||||
<Input
|
||||
v-model="formValidate.username"
|
||||
style="width: 200px"
|
||||
disabled
|
||||
/>
|
||||
<Input v-model="formValidate.username" style="width: 200px" disabled />
|
||||
</FormItem>
|
||||
<FormItem label="用户昵称" prop="name">
|
||||
<Input v-model="formValidate.nickName" style="width: 200px" />
|
||||
|
@ -109,34 +55,20 @@
|
|||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem label="修改密码" prop="password">
|
||||
<Input
|
||||
type="password"
|
||||
style="width: 220px"
|
||||
password
|
||||
v-model="formValidate.newPassword"
|
||||
/>
|
||||
<Input type="password" style="width: 220px" password v-model="formValidate.newPassword" />
|
||||
</FormItem>
|
||||
<FormItem label="生日" prop="birthday">
|
||||
<DatePicker
|
||||
type="date"
|
||||
format="yyyy-MM-dd"
|
||||
v-model="formValidate.birthday"
|
||||
style="width: 220px"
|
||||
></DatePicker>
|
||||
<DatePicker type="date" format="yyyy-MM-dd" v-model="formValidate.birthday" style="width: 220px"></DatePicker>
|
||||
</FormItem>
|
||||
<FormItem label="所在地" prop="mail">
|
||||
<div class="form-item" v-if="!updateRegion">
|
||||
<Input disabled style="width: 250px" :value="formValidate.region" />
|
||||
<Button
|
||||
type="text"
|
||||
@click="
|
||||
<Button type="text" @click="
|
||||
() => {
|
||||
this.updateRegion = !this.updateRegion;
|
||||
}
|
||||
"
|
||||
>修改
|
||||
</Button
|
||||
>
|
||||
">修改
|
||||
</Button>
|
||||
</div>
|
||||
<div class="form-item" v-else>
|
||||
<region style="width: 250px" @selected="selectedRegion" />
|
||||
|
@ -155,7 +87,6 @@
|
|||
import * as API_Member from "@/api/member.js";
|
||||
import ossManage from "@/views/sys/oss-manage/ossManage";
|
||||
|
||||
|
||||
export default {
|
||||
name: "memberRecycle",
|
||||
components: {
|
||||
|
@ -170,13 +101,14 @@
|
|||
openSearch: true, // 显示搜索
|
||||
loading: true, // 表单加载状态
|
||||
updateRegion: false, // 显示所在地
|
||||
searchForm: { // 请求参数
|
||||
searchForm: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
order: "desc",
|
||||
username: "",
|
||||
mobile: "",
|
||||
disabled: "CLOSE"
|
||||
disabled: "CLOSE",
|
||||
},
|
||||
picModelFlag: false, // 选择图片
|
||||
formValidate: {}, // 表单数据
|
||||
|
@ -186,15 +118,13 @@
|
|||
title: "会员名称",
|
||||
align: "left",
|
||||
key: "username",
|
||||
tooltip: true
|
||||
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
|
||||
title: "昵称",
|
||||
align: "left",
|
||||
key: "nickName",
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "联系方式",
|
||||
|
@ -202,17 +132,16 @@
|
|||
key: "mobile",
|
||||
render: (h, params) => {
|
||||
if (params.row.mobile == null) {
|
||||
return h('div', [h('span', {}, "")]);
|
||||
return h("div", [h("span", {}, "")]);
|
||||
} else {
|
||||
return h('div', [h('span', {}, params.row.mobile)]);
|
||||
}
|
||||
|
||||
return h("div", [h("span", {}, params.row.mobile)]);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "注册时间",
|
||||
key: "createTime",
|
||||
width: 180
|
||||
width: 180,
|
||||
},
|
||||
|
||||
{
|
||||
|
@ -234,12 +163,15 @@
|
|||
width: 200,
|
||||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
return h("div", {
|
||||
return h(
|
||||
"div",
|
||||
{
|
||||
style: {
|
||||
display: "flex",
|
||||
justifyContent: "center"
|
||||
}
|
||||
}, [
|
||||
justifyContent: "center",
|
||||
},
|
||||
},
|
||||
[
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
|
@ -282,7 +214,7 @@
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: "success"
|
||||
type: "success",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -303,7 +235,7 @@
|
|||
props: {
|
||||
type: "info",
|
||||
size: "small",
|
||||
ghost:true
|
||||
ghost: true,
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
@ -316,7 +248,8 @@
|
|||
},
|
||||
"编辑"
|
||||
),
|
||||
]);
|
||||
]
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -354,7 +287,7 @@
|
|||
editPerm(val) {
|
||||
this.descTitle = `查看用户 ${val.username}`;
|
||||
this.descFlag = true;
|
||||
this.updateRegion = false
|
||||
this.updateRegion = false;
|
||||
this.getMemberInfo(val.id);
|
||||
},
|
||||
/**
|
||||
|
@ -370,8 +303,8 @@
|
|||
//查询会员列表
|
||||
getData() {
|
||||
API_Member.getMemberListData(this.searchForm).then((res) => {
|
||||
if (res.result.records) {
|
||||
this.loading = false
|
||||
if (res.success) {
|
||||
this.loading = false;
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
|
@ -397,21 +330,21 @@
|
|||
enable(v) {
|
||||
let params = {
|
||||
memberIds: [v.id],
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
};
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
content: '<p>启用用此会员?</p>',
|
||||
title: "提示",
|
||||
content: "<p>启用用此会员?</p>",
|
||||
onOk: () => {
|
||||
API_Member.updateMemberStatus(params).then(res => {
|
||||
API_Member.updateMemberStatus(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('禁用成功');
|
||||
this.getData()
|
||||
this.$Message.success("禁用成功");
|
||||
this.getData();
|
||||
} else {
|
||||
// this.$Message.error(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<Cascader
|
||||
v-model="selectDep"
|
||||
:data="department"
|
||||
:load-data="loadData"
|
||||
@on-change="handleChangeDep"
|
||||
change-on-select
|
||||
filterable
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { getRegion } from "@/api/common.js";
|
||||
export default {
|
||||
name: "map",
|
||||
data() {
|
||||
return {
|
||||
showMap: false, // modal显隐
|
||||
|
|
|
@ -121,9 +121,12 @@
|
|||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "orderList",
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
|
|
@ -72,12 +72,11 @@
|
|||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
|
||||
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "orderComplaint",
|
||||
components: {
|
||||
uploadPicThumb
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -158,9 +158,9 @@ export default {
|
|||
fixed: "right",
|
||||
render: (h, params) => {
|
||||
if (params.row.payStatus == "PAID") {
|
||||
return h("div", [h("span", {}, "已付款")]);
|
||||
return h("div", [h("Tag", {props:{color:'green'}}, "已付款")]);
|
||||
} else {
|
||||
return h("div", [h("span", {}, "未付款")]);
|
||||
return h("div", [h("Tag", {props:{color:'red'}}, "未付款")]);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -263,7 +263,7 @@
|
|||
<Input v-model="addressForm.consigneeMobile" size="large" maxlength="11"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="地址信息" prop="consigneeAddressPath">
|
||||
<Input v-model="region" disabled style="width: 305px" v-if="showRegion == false"/>
|
||||
<Input v-model="addr" disabled style="width: 305px" v-if="showRegion == false"/>
|
||||
<Button v-if="showRegion == false" @click="regionClick" :loading="submitLoading" type="primary"
|
||||
icon="ios-create-outline" style="margin-left: 8px">修改
|
||||
</Button>
|
||||
|
@ -300,16 +300,18 @@
|
|||
import * as API_Order from "@/api/order";
|
||||
import * as RegExp from "@/libs/RegExp.js";
|
||||
import region from "@/views/lili-components/region";
|
||||
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "orderList",
|
||||
components: {
|
||||
region,
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading:false, //加载表格
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
region: [], //地区
|
||||
addr: "", //地区
|
||||
regionId: [], //地区id
|
||||
showRegion: false, // 显示地区
|
||||
orderLogInfo: [], //订单日志数据
|
||||
|
@ -554,7 +556,7 @@ export default {
|
|||
},
|
||||
// 选中的地址
|
||||
selectedRegion(val) {
|
||||
this.region = val[1];
|
||||
this.addr = val[1];
|
||||
this.regionId = val[0];
|
||||
},
|
||||
//订单取消
|
||||
|
@ -587,7 +589,7 @@ export default {
|
|||
editAddress() {
|
||||
this.addressModal = true;
|
||||
this.showRegion = false;
|
||||
this.region = this.orderInfo.order.consigneeAddressPath;
|
||||
this.addr = this.orderInfo.order.consigneeAddressPath;
|
||||
this.regionId = this.orderInfo.order.consigneeAddressIdPath;
|
||||
this.addressForm.consigneeName = this.orderInfo.order.consigneeName;
|
||||
this.addressForm.consigneeMobile = this.orderInfo.order.consigneeMobile;
|
||||
|
@ -603,7 +605,7 @@ export default {
|
|||
this.$Message.error("请选择地址");
|
||||
return;
|
||||
}
|
||||
this.addressForm.consigneeAddressPath = this.region;
|
||||
this.addressForm.consigneeAddressPath = this.addr;
|
||||
this.addressForm.consigneeAddressIdPath = this.regionId;
|
||||
this.$refs.addressForm.validate((valid) => {
|
||||
if (valid) {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</download-excel>
|
||||
</div>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" ></Table>
|
||||
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
|
|
|
@ -103,6 +103,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false,
|
||||
loading: false, // 加载状态
|
||||
expandLevel: 1, // 展开的层级
|
||||
modalType: 0, // 添加或编辑标识
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<editor openXss v-model="form.content"></editor>
|
||||
</FormItem>
|
||||
<FormItem label="是否展示" prop="openStatus">
|
||||
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
|
||||
<i-switch size="large" v-model="form.openStatus" >
|
||||
<span slot="open">展示</span>
|
||||
<span slot="close">隐藏</span>
|
||||
</i-switch>
|
||||
|
@ -169,7 +169,7 @@ export default {
|
|||
{
|
||||
props: {
|
||||
size: "small",
|
||||
type: this.selectedIndex == params.index ? "primary" : "",
|
||||
type: this.selectedIndex == params.index ? "primary" : "default",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
|
|
|
@ -19,13 +19,8 @@
|
|||
</div>
|
||||
|
||||
</Card>
|
||||
<Modal
|
||||
:title="modalTitle"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||
<Form ref="form" :model="form" :label-width="100" >
|
||||
<FormItem label="热词" prop="name">
|
||||
<Input v-model="form.keywords" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
|
@ -42,16 +37,15 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getHotWords,
|
||||
setHotWords
|
||||
} from "@/api/index";
|
||||
import { getHotWords, setHotWords } from "@/api/index";
|
||||
|
||||
export default {
|
||||
name: "hotWords",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false,
|
||||
modalTitle: "",
|
||||
loading: true, // 表单加载状态
|
||||
modalVisible: false, //弹出框
|
||||
form: {
|
||||
|
@ -97,7 +91,7 @@ export default {
|
|||
if (words) {
|
||||
this.form.keywords = words;
|
||||
} else {
|
||||
this.form.keywords = '';
|
||||
this.form.keywords = "";
|
||||
}
|
||||
this.form.point = 1;
|
||||
this.$refs.form.resetFields();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
</Button>
|
||||
<Button v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" @click="remove(row)">下架
|
||||
</Button>
|
||||
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
@ -201,6 +202,7 @@ export default {
|
|||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
refreshTable: true, // 修改选中状态后刷新表格
|
||||
selectDate:[], //选中的信息
|
||||
};
|
||||
},
|
||||
props: {
|
||||
|
@ -212,7 +214,9 @@ export default {
|
|||
//已选择优惠券
|
||||
selectedList: {
|
||||
type: Array,
|
||||
default: [],
|
||||
default: ()=>{
|
||||
return []
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -78,7 +78,7 @@ export default {
|
|||
},
|
||||
},
|
||||
{
|
||||
title: "优惠券类型",
|
||||
title: "活动范围",
|
||||
key: "activityScope",
|
||||
minWidth: 120,
|
||||
render: (h, params) => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="content-goods-publish">
|
||||
<Form ref="form" :model="form" :label-width="70">
|
||||
<Form ref="form" :label-width="70">
|
||||
<div class="base-info-item">
|
||||
<h4>优惠券活动详情</h4>
|
||||
<div class="form-item-view">
|
||||
|
@ -20,7 +20,6 @@
|
|||
<span>{{ couponActivity.startTime }}~{{ couponActivity.endTime }}</span>
|
||||
</FormItem>
|
||||
<FormItem label="活动状态">
|
||||
|
||||
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
|
||||
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
|
||||
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
|
||||
|
|
|
@ -4,21 +4,11 @@
|
|||
<Row>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="活动名称" prop="promotionName">
|
||||
<Input
|
||||
type="text"
|
||||
v-model="searchForm.promotionName"
|
||||
placeholder="请输入活动名称"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
/>
|
||||
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable
|
||||
style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="活动状态" prop="promotionStatus">
|
||||
<Select
|
||||
v-model="searchForm.promotionStatus"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
<Option value="NEW">未开始</Option>
|
||||
<Option value="START">已开始/上架</Option>
|
||||
<Option value="END">已结束/下架</Option>
|
||||
|
@ -26,26 +16,13 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker
|
||||
v-model="selectDate"
|
||||
type="daterange"
|
||||
clearable
|
||||
placeholder="选择起始时间"
|
||||
style="width: 200px"
|
||||
></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||
</DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" class="search-btn" icon="ios-search">搜索</Button>
|
||||
</Form>
|
||||
</Row>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
ref="table"
|
||||
class="mt_10"
|
||||
sortable="custom"
|
||||
>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10" sortable="custom">
|
||||
<template slot-scope="{ row }" slot="applyEndTime">
|
||||
{{ unixDate(row.applyEndTime) }}
|
||||
</template>
|
||||
|
@ -58,36 +35,17 @@
|
|||
<template slot-scope="{ row }" slot="action">
|
||||
<div>
|
||||
<Button type="info" size="small" @click="view(row)">查看</Button>
|
||||
<Button
|
||||
type="error"
|
||||
v-if="row.promotionStatus === 'START'"
|
||||
style="margin-left:5px"
|
||||
size="small"
|
||||
@click="openOrClose(row)"
|
||||
>关闭</Button>
|
||||
<Button
|
||||
type="success"
|
||||
v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'"
|
||||
style="margin-left:5px"
|
||||
size="small"
|
||||
@click="openOrClose(row)"
|
||||
>开启</Button>
|
||||
<Button type="error" v-if="row.promotionStatus === 'START'" style="margin-left:5px" size="small"
|
||||
@click="openOrClose(row)">关闭</Button>
|
||||
<Button type="success" v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'"
|
||||
style="margin-left:5px" size="small" @click="openOrClose(row)">开启</Button>
|
||||
</div>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page
|
||||
:current="searchForm.pageNumber"
|
||||
:total="total"
|
||||
:page-size="searchForm.pageSize"
|
||||
@on-change="changePage"
|
||||
@on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]"
|
||||
size="small"
|
||||
show-total
|
||||
show-elevator
|
||||
show-sizer
|
||||
></Page>
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
|
@ -98,14 +56,18 @@ import { getFullDiscountList, updateFullDiscount } from "@/api/promotion.js";
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectDate: [],
|
||||
total: 0,
|
||||
loading: false, // 表单加载状态
|
||||
searchForm: { // 请求参数
|
||||
searchForm: {
|
||||
// 请求参数
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
sort: "startTime",
|
||||
order: "desc",
|
||||
},
|
||||
columns: [ // 表头
|
||||
columns: [
|
||||
// 表头
|
||||
{
|
||||
title: "活动名称",
|
||||
key: "promotionName",
|
||||
|
@ -181,11 +143,11 @@ export default {
|
|||
},
|
||||
// 开启或关闭活动
|
||||
openOrClose(row) {
|
||||
let name = '开启'
|
||||
let status = 'START'
|
||||
if (row.promotionStatus === 'START') {
|
||||
name = '关闭'
|
||||
status = 'CLOSE'
|
||||
let name = "开启";
|
||||
let status = "START";
|
||||
if (row.promotionStatus === "START") {
|
||||
name = "关闭";
|
||||
status = "CLOSE";
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
|
@ -243,7 +205,6 @@ export default {
|
|||
// 查看
|
||||
this.$router.push({ name: "full-cut-detail", query: { id: row.id } });
|
||||
},
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
|
|
@ -154,7 +154,6 @@
|
|||
border
|
||||
:columns="columns"
|
||||
:data="form.promotionGoodsList"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="goodsName">
|
||||
<div>
|
||||
|
@ -183,8 +182,12 @@
|
|||
<script>
|
||||
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
||||
import { getGoodsSkuData } from "@/api/goods";
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "addFullCut",
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: { // 表单
|
||||
|
|
|
@ -8,69 +8,39 @@
|
|||
|
||||
<FormItem label="选择商品" prop="scopeType">
|
||||
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||
<Button
|
||||
type="error"
|
||||
ghost
|
||||
style="margin-left: 10px"
|
||||
@click="delSelectGoods"
|
||||
>批量删除
|
||||
</Button
|
||||
>
|
||||
<Button type="error" ghost style="margin-left: 10px" @click="delSelectGoods">批量删除
|
||||
</Button>
|
||||
</FormItem>
|
||||
|
||||
<FormItem astyle="width: 100%">
|
||||
<Table
|
||||
border
|
||||
:columns="columns"
|
||||
:data="form.promotionGoodsList"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<Table border :columns="columns" :data="form.promotionGoodsList" @on-selection-change="changeSelect">
|
||||
<template slot-scope="{ row }" slot="skuId">
|
||||
<div>{{ row.skuId }}</div>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ index }" slot="settlementPrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].settlementPrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].settlementPrice" />
|
||||
</template>
|
||||
<template slot-scope="{ index }" slot="lowestPrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].lowestPrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].lowestPrice" />
|
||||
|
||||
</template>
|
||||
<template slot-scope="{ index }" slot="highestPrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].highestPrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].highestPrice" />
|
||||
|
||||
</template>
|
||||
<template slot-scope="{ index }" slot="purchasePrice">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].purchasePrice"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].purchasePrice" />
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ index }" slot="stock">
|
||||
<Input
|
||||
type="number"
|
||||
v-model="form.promotionGoodsList[index].stock"
|
||||
/>
|
||||
<Input type="number" v-model="form.promotionGoodsList[index].stock" />
|
||||
</template>
|
||||
</Table>
|
||||
</FormItem>
|
||||
<FormItem label="活动时间" prop="rangeTime">
|
||||
<DatePicker
|
||||
type="datetimerange"
|
||||
v-model="form.rangeTime"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择"
|
||||
:options="options"
|
||||
style="width: 260px"
|
||||
>
|
||||
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
|
||||
:options="options" style="width: 260px">
|
||||
</DatePicker>
|
||||
</FormItem>
|
||||
<div>
|
||||
|
@ -81,18 +51,12 @@
|
|||
</div>
|
||||
</Form>
|
||||
</Card>
|
||||
<sku-select
|
||||
ref="skuSelect"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></sku-select>
|
||||
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
saveKanJiaActivityGoods,
|
||||
editKanJiaActivityGoods
|
||||
} from "@/api/promotion";
|
||||
import { saveKanJiaActivityGoods } from "@/api/promotion";
|
||||
import { regular } from "@/utils";
|
||||
import skuSelect from "@/views/lili-dialog";
|
||||
|
||||
|
@ -209,13 +173,13 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
openSkuList() { // 显示商品选择器
|
||||
openSkuList() {
|
||||
// 显示商品选择器
|
||||
this.$refs.skuSelect.open("goods");
|
||||
let data = JSON.parse(JSON.stringify(this.promotionGoodsList))
|
||||
data.forEach(e => {
|
||||
e.id = e.skuId
|
||||
})
|
||||
let data = JSON.parse(JSON.stringify(this.promotionGoodsList));
|
||||
data.forEach((e) => {
|
||||
e.id = e.skuId;
|
||||
});
|
||||
this.$refs.skuSelect.goodsData = data;
|
||||
},
|
||||
|
||||
|
@ -224,9 +188,9 @@
|
|||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
if (this.form.rangeTime[0] === '' || this.form.rangeTime[0] === '') {
|
||||
if (this.form.rangeTime[0] === "" || this.form.rangeTime[0] === "") {
|
||||
this.$Message.error("请选择活动时间");
|
||||
return
|
||||
return;
|
||||
}
|
||||
params.startTime = this.$options.filters.unixToDate(
|
||||
this.form.rangeTime[0] / 1000
|
||||
|
@ -234,64 +198,65 @@
|
|||
params.endTime = this.$options.filters.unixToDate(
|
||||
this.form.rangeTime[1] / 1000
|
||||
);
|
||||
delete params.rangeTime
|
||||
let checkResult = true
|
||||
delete params.rangeTime;
|
||||
let checkResult = true;
|
||||
//如果添加活动的时候选择了商品 则对选择的商品参数做一些校验
|
||||
if (this.form.promotionGoodsList.length > 0) {
|
||||
this.form.promotionGoodsList.forEach((res) => {
|
||||
//校验库存参数
|
||||
if (res.stock <= 0 || res.stock > res.quantity) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("活动库存不能为0且不能超过商品库存");
|
||||
return
|
||||
return;
|
||||
}
|
||||
// 最低购买金额格式校验
|
||||
if (!regular.money.test(res.purchasePrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最低购买金额格式不正确");
|
||||
}
|
||||
// 结算价格金额格式校验
|
||||
if (!regular.money.test(res.settlementPrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("结算价格金额格式不正确");
|
||||
return
|
||||
return;
|
||||
}
|
||||
// 结算价格金额格式校验
|
||||
if (res.settlementPrice < 0 || res.settlementPrice > res.price) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("结算价格金额不能为0且不能超过商品价格");
|
||||
return
|
||||
return;
|
||||
}
|
||||
//最高砍价校验
|
||||
if (!regular.money.test(res.highestPrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最高可砍金额格式错误");
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (res.highestPrice <= 0 || res.highestPrice > res.price) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
|
||||
return
|
||||
return;
|
||||
}
|
||||
//最低砍价校验
|
||||
if (!regular.money.test(res.lowestPrice)) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最低可砍金额格式错误");
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (res.lowestPrice <= 0 || res.lowestPrice > res.price) {
|
||||
checkResult = false
|
||||
checkResult = false;
|
||||
this.$Message.error("最低可砍金额不能为0");
|
||||
return
|
||||
return;
|
||||
}
|
||||
//校验最高最低砍价金额
|
||||
if (res.lowestPrice > res.highestPrice) {
|
||||
checkResult = false
|
||||
if (parseInt(res.lowestPrice) > parseInt(res.highestPrice)) {
|
||||
checkResult = false;
|
||||
this.$Message.error("最低砍价金额不能大于最高砍价金额");
|
||||
return
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!checkResult) {
|
||||
return;
|
||||
}
|
||||
|
@ -372,7 +337,7 @@
|
|||
skuId: e.id,
|
||||
});
|
||||
});
|
||||
console.warn(list)
|
||||
console.warn(list);
|
||||
this.form.promotionGoodsList = list;
|
||||
},
|
||||
},
|
||||
|
|
|
@ -86,10 +86,7 @@
|
|||
</div>
|
||||
</Form>
|
||||
</Card>
|
||||
<sku-select
|
||||
ref="skuSelect"
|
||||
@selectedGoodsData="selectedGoodsData"
|
||||
></sku-select>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -99,13 +96,11 @@
|
|||
editKanJiaActivityGoods,
|
||||
} from "@/api/promotion";
|
||||
import {regular} from "@/utils";
|
||||
import skuSelect from "@/views/lili-dialog";
|
||||
|
||||
|
||||
export default {
|
||||
name: "editKanjiaActivityGoods",
|
||||
components: {
|
||||
skuSelect,
|
||||
},
|
||||
|
||||
watch: {},
|
||||
data() {
|
||||
const checkSettlementPrice = (rule, value, callback) => {
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
|
||||
style="width: 200px"></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||
</DatePicker>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
</Form>
|
||||
|
@ -48,35 +48,36 @@
|
|||
<div>{{ row.goodsSku.quantity }}</div>
|
||||
</template>
|
||||
<template slot-scope="{ row,index }" slot="action">
|
||||
<Button v-if="row.promotionStatus === 'NEW'" type="info"
|
||||
size="small" style="margin-right: 10px" @click="edit(row)">编辑
|
||||
<Button v-if="row.promotionStatus === 'NEW'" type="info" size="small" style="margin-right: 10px"
|
||||
@click="edit(row)">编辑
|
||||
</Button>
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error"
|
||||
size="small" style="margin-right: 10px" @click="delAll(row)">删除
|
||||
<Button v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'END'" type="error" size="small"
|
||||
style="margin-right: 10px" @click="delAll(row)">删除
|
||||
</Button>
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="page">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
show-total show-elevator show-sizer></Page>
|
||||
@on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" show-total show-elevator
|
||||
show-sizer></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getKanJiaGoodsList,
|
||||
delKanJiaGoods,
|
||||
} from "@/api/promotion";
|
||||
import { getKanJiaGoodsList, delKanJiaGoods } from "@/api/promotion";
|
||||
import vueQr from "vue-qr";
|
||||
|
||||
export default {
|
||||
name: "coupon",
|
||||
components: {},
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
selectDate: [], //选中的数据
|
||||
loading: true, // 表单加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
|
@ -87,7 +88,7 @@
|
|||
pageSize: 10, // 页面大小
|
||||
sort: "startTime", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
goodsName: ""
|
||||
goodsName: "",
|
||||
},
|
||||
form: {
|
||||
// 添加或编辑表单对象初始化数据
|
||||
|
@ -219,17 +220,6 @@
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
// 选中优惠券 父级传值
|
||||
selectedList: {
|
||||
handler(val) {
|
||||
// 判断是否是父级回调给自己已选择优惠券
|
||||
if (val.length != 0) {
|
||||
this.selectCoupon = val;
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
check() {
|
||||
// this.selectCoupon.push(this.selectList)
|
||||
this.$emit("selected", this.selectCoupon);
|
||||
|
@ -292,7 +282,10 @@
|
|||
this.loading = false;
|
||||
},
|
||||
edit(v) {
|
||||
this.$router.push({name: "edit-kanJia-activity-goods", query: {id: v.id}});
|
||||
this.$router.push({
|
||||
name: "edit-kanJia-activity-goods",
|
||||
query: { id: v.id },
|
||||
});
|
||||
},
|
||||
delAll(row) {
|
||||
this.$Modal.confirm({
|
||||
|
|
|
@ -23,7 +23,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
// 查询数据的总数
|
||||
total: "",
|
||||
total: 0,
|
||||
// 查询的form
|
||||
searchForm: {
|
||||
pageSize: 10,
|
||||
|
|
|
@ -95,6 +95,7 @@ export default {
|
|||
name: "pintuan",
|
||||
data() {
|
||||
return {
|
||||
selectDate:[], //选中的数据
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
:data="goodsData"
|
||||
ref="table"
|
||||
sortable="custom"
|
||||
@on-sort-change="changeSort"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="goodsName">
|
||||
<div>
|
||||
|
|
|
@ -72,8 +72,12 @@ import {
|
|||
editPointsGoodsStatus,
|
||||
deletePointsGoodsStatus,
|
||||
} from "@/api/promotion";
|
||||
import vueQr from 'vue-qr'
|
||||
export default {
|
||||
name: "pointsGoods",
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true, // 表单加载状态
|
||||
|
|
|
@ -67,6 +67,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading:false,
|
||||
loading: false, // 加载状态
|
||||
modalType: 0, // 添加或编辑标识
|
||||
modalVisible: false, // 添加或编辑显示
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<Row>
|
||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
||||
<Form-item label="活动名称" prop="promotionName">
|
||||
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable style="width: 200px" />
|
||||
<Input type="text" v-model="searchForm.promotionName" placeholder="请输入活动名称" clearable
|
||||
style="width: 200px" />
|
||||
</Form-item>
|
||||
<Form-item label="活动状态" prop="promotionStatus">
|
||||
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
|
||||
|
@ -15,7 +16,8 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="活动时间">
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
|
||||
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px">
|
||||
</DatePicker>
|
||||
</Form-item>
|
||||
|
||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||
|
@ -25,22 +27,26 @@
|
|||
<TabPane label="秒杀活动列表" name="list">
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
|
||||
<template slot-scope="{ row }" slot="action">
|
||||
<Button type="info" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="edit(row)">编辑</Button>
|
||||
<Button type="info" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'"
|
||||
@click="edit(row)">编辑</Button>
|
||||
|
||||
<Button type="info" size="small" class="mr_5" v-else @click="manage(row)">查看</Button>
|
||||
|
||||
<Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'" @click="manage(row)">管理</Button>
|
||||
<Button type="success" size="small" class="mr_5" v-if="row.promotionStatus == 'NEW'"
|
||||
@click="manage(row)">管理</Button>
|
||||
|
||||
<Button type="error" size="small" v-if="
|
||||
row.promotionStatus == 'START' || row.promotionStatus == 'NEW'
|
||||
" class="mr_5" @click="off(row)">下架</Button>
|
||||
|
||||
<Button type="error" size="small" v-if="row.promotionStatus == 'CLOSE'" ghost @click="expire(row)">删除</Button>
|
||||
<Button type="error" size="small" v-if="row.promotionStatus == 'CLOSE'" ghost
|
||||
@click="expire(row)">删除</Button>
|
||||
</template>
|
||||
</Table>
|
||||
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page style="margin: 20px 0;" :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize"
|
||||
<Page style="margin: 20px 0;" :current="searchForm.pageNumber" :total="total"
|
||||
:page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize"
|
||||
:page-size-opts="[10, 20, 50]" size="small" show-total show-elevator show-sizer></Page>
|
||||
</Row>
|
||||
</TabPane>
|
||||
|
@ -60,10 +66,11 @@ import setupSeckill from "@/views/promotion/seckill/setupSeckill";
|
|||
export default {
|
||||
name: "seckill",
|
||||
components: {
|
||||
setupSeckill
|
||||
setupSeckill,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selectDate: [],
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
|
@ -99,13 +106,13 @@ export default {
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.promotionStatus == "NEW") {
|
||||
return h("Tag", {props: {color: "geekblue",},},"新建");
|
||||
return h("Tag", { props: { color: "geekblue" } }, "新建");
|
||||
} else if (params.row.promotionStatus == "START") {
|
||||
return h("Tag", {props: {color: "green",},},"开始");
|
||||
return h("Tag", { props: { color: "green" } }, "开始");
|
||||
} else if (params.row.promotionStatus == "END") {
|
||||
return h("Tag", {props: {color: "volcano",},},"结束");
|
||||
return h("Tag", { props: { color: "volcano" } }, "结束");
|
||||
} else if (params.row.promotionStatus == "CLOSE") {
|
||||
return h("Tag", {props: {color: "red",},},"结束");
|
||||
return h("Tag", { props: { color: "red" } }, "结束");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
@ -132,6 +132,7 @@ export default {
|
|||
name: "bill-detail",
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
columns: [ // 表头
|
||||
{
|
||||
title: "项目",
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
</Card>
|
||||
|
||||
<Card class="mt_10">
|
||||
<Tabs type="order" @on-click="storeInfoChange">
|
||||
<Tabs value="order" @on-click="storeInfoChange">
|
||||
<TabPane label="TA的订单" name="order" style="min-height: 200px">
|
||||
<Row>
|
||||
<Form ref="searchForm" :model="orderSearchForm" inline :label-width="70" class="search-form">
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
<div class="block">
|
||||
<div class="box">
|
||||
<span>付款笔数</span>
|
||||
<span>{{overViewList.paymentsNum || 0 }}</span>
|
||||
<span>{{overViewList.paymentOrderNum || 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -178,7 +178,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
orderOrRefund: 1, // 订单还是单
|
||||
total: "0", // 总数
|
||||
total: 0, // 总数
|
||||
// 订单状态
|
||||
orderStatusList: {
|
||||
UNDELIVERED: "待发货",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<Button class="mt_10 mb_10" @click="addAppVersion" type="primary">添加</Button>
|
||||
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
|
||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" ></Table>
|
||||
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
|
||||
|
|
|
@ -160,6 +160,7 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
customSms: false, //当选择自动发送对象 展示
|
||||
alreadyCheck: [], //已经选中的数据
|
||||
alreadyCheckShow: [], //已经选择的值负责显示
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
</div>
|
||||
|
||||
<div v-show="showType == 'list'">
|
||||
<Row v-show="openTip">
|
||||
<Row >
|
||||
<Alert show-icon>
|
||||
已选择
|
||||
<span class="select-count">{{ selectCount }}</span> 项
|
||||
|
|
|
@ -47,32 +47,7 @@
|
|||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<!-- 数据权限 -->
|
||||
<Modal :title="modalTitle" v-model="depModalVisible" :mask-closable="false" :width="500" class="depModal">
|
||||
<Alert show-icon>默认可查看全部数据,自定义数据范围时请勾选下方数据
|
||||
</Alert>
|
||||
<Form :label-width="85">
|
||||
<FormItem label="数据范围">
|
||||
<Select v-model="dataType" transfer>
|
||||
<Option :value="0">全部数据权限</Option>
|
||||
<Option :value="1">自定义数据权限</Option>
|
||||
<Option :value="2">本部门及以下数据权限</Option>
|
||||
<Option :value="3">本部门数据权限</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div v-show="dataType == 1" style="margin-top: 15px">
|
||||
<div style="position: relative">
|
||||
<Tree ref="depTree" :data="depData" :load-data="loadData" @on-toggle-expand="expandCheckDep" multiple style="margin-top: 15px"></Tree>
|
||||
<Spin size="large" fix v-if="depTreeLoading"></Spin>
|
||||
</div>
|
||||
</div>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="depModalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitDepLoading" @click="submitDepEdit">提交
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
|
||||
<!-- 保存权限弹出选择权限 -->
|
||||
<Modal width="800" v-model="selectIsSuperModel" title="选择菜单权限" :loading="superModelLoading" @on-ok="saveRole">
|
||||
|
@ -111,7 +86,6 @@ import {
|
|||
saveRoleMenu,
|
||||
} from "@/api/index";
|
||||
import util from "@/libs/util.js";
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
name: "role-manage",
|
||||
data() {
|
||||
|
@ -305,12 +279,12 @@ export default {
|
|||
"Tag",
|
||||
{
|
||||
props: {
|
||||
type:
|
||||
color:
|
||||
data.isSuper == true
|
||||
? "red"
|
||||
: data.isSuper == false
|
||||
? "default"
|
||||
: "",
|
||||
: "default",
|
||||
},
|
||||
style: {
|
||||
"margin-left": "10px",
|
||||
|
|
|
@ -98,7 +98,6 @@
|
|||
<Button type="primary" :loading="submitLoading" @click="submitUser">提交</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
<check-password ref="checkPass" @on-success="resetPass"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -1,10 +1,73 @@
|
|||
const path = require("path");
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
|
||||
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
|
||||
const resolve = dir => {
|
||||
return path.join(__dirname, dir);
|
||||
};
|
||||
/**
|
||||
* 在项目开发的时候将生产环境以及开发环境进行判断
|
||||
* 将生产环境中的路径用cdn来进行优化处理
|
||||
* 将开发环境中替换为本地的内容,方便处理bug以及开启vueDev
|
||||
* 我们可以根据环境变量进行相应的处理,只有在产品的时候,才让插件去自动注入相应的资源文件到html页面
|
||||
*/
|
||||
const enableProduction = process.env.NODE_ENV === "production"; // 是否生产环境
|
||||
|
||||
let externals = {
|
||||
vue: "Vue",
|
||||
axios: "axios",
|
||||
"vue-router": "VueRouter",
|
||||
vuex: "Vuex",
|
||||
"view-design": "iview",
|
||||
"vue-lazyload": "VueLazyload",
|
||||
"js-cookie": "Cookies",
|
||||
wangeditor: "wangEditor",
|
||||
"sockjs-client": "SockJS",
|
||||
vuedraggable: "vuedraggable",
|
||||
"@antv/g2": "G2",
|
||||
dplayer: "DPlayer"
|
||||
};
|
||||
|
||||
// 使用CDN的内容
|
||||
let cdn = {
|
||||
css: ["https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/styles/iview.css"],
|
||||
js: [
|
||||
// vue must at first!
|
||||
"https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/view-design@4.1.1/dist/iview.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vue-lazyload@1.3.3/vue-lazyload.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/js-cookie@2.2.1/src/js.cookie.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/dplayer@1.25.0/dist/DPlayer.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/wangeditor@latest/dist/wangEditor.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js",
|
||||
"https://cdn.jsdelivr.net/npm/vuedraggable@2.23.2/dist/vuedraggable.umd.min.js",
|
||||
"https://gw.alipayobjects.com/os/lib/antv/g2/4.1.24/dist/g2.min.js"
|
||||
]
|
||||
};
|
||||
|
||||
// 删除注释
|
||||
let jsPlugin = [
|
||||
new UglifyJsPlugin({
|
||||
uglifyOptions: {
|
||||
// 删除注释
|
||||
output: {
|
||||
comments: false
|
||||
},
|
||||
compress: {
|
||||
drop_console: true, // 删除所有调式带有console的
|
||||
drop_debugger: true,
|
||||
pure_funcs: ["console.log"] // 删除console.log
|
||||
}
|
||||
}
|
||||
})
|
||||
];
|
||||
|
||||
// 判断是否需要加载CDN,线上删除注释
|
||||
cdn = enableProduction ? cdn : { css: [], js: [] };
|
||||
externals = enableProduction ? externals : {};
|
||||
jsPlugin = enableProduction ? jsPlugin : [];
|
||||
module.exports = {
|
||||
css: {
|
||||
loaderOptions: {
|
||||
|
@ -20,37 +83,13 @@ module.exports = {
|
|||
port: 10003
|
||||
},
|
||||
|
||||
chainWebpack: config => {
|
||||
// @ 对应 src目录
|
||||
config.resolve.alias.set("@", resolve("src"));
|
||||
},
|
||||
|
||||
// 打包时不生成.map文件 避免看到源码
|
||||
productionSourceMap: false,
|
||||
|
||||
// 部署优化
|
||||
configureWebpack: {
|
||||
// 使用CDN
|
||||
externals: {
|
||||
vue: "Vue",
|
||||
"vue-i18n": "VueI18n",
|
||||
axios: "axios",
|
||||
"vue-router": "VueRouter",
|
||||
vuex: "Vuex",
|
||||
"view-design": "iview",
|
||||
xlsx: "XLSX",
|
||||
dplayer: "DPlayer",
|
||||
"print-js": "printJS",
|
||||
html2canvas: "html2canvas",
|
||||
"vue-json-pretty": "VueJsonPretty",
|
||||
"vue-lazyload": "VueLazyload",
|
||||
gitalk: "Gitalk",
|
||||
"js-cookie": "Cookies",
|
||||
wangEditor: "wangEditor",
|
||||
stompjs: "Stomp",
|
||||
"sockjs-client": "SockJS",
|
||||
vuedraggable: "vuedraggable"
|
||||
},
|
||||
externals: externals,
|
||||
// GZIP压缩
|
||||
plugins: [
|
||||
new CompressionPlugin({
|
||||
|
@ -60,6 +99,7 @@ module.exports = {
|
|||
],
|
||||
optimization: {
|
||||
runtimeChunk: "single",
|
||||
minimizer: jsPlugin,
|
||||
splitChunks: {
|
||||
chunks: "all",
|
||||
maxInitialRequests: Infinity,
|
||||
|
@ -81,6 +121,15 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
},
|
||||
// 将cdn的资源挂载到插件上
|
||||
chainWebpack(config) {
|
||||
// @ 对应 src目录
|
||||
config.resolve.alias.set("@", resolve("src"));
|
||||
config.plugin("html").tap(args => {
|
||||
args[0].cdn = cdn;
|
||||
return args;
|
||||
});
|
||||
},
|
||||
|
||||
pluginOptions: {
|
||||
"style-resources-loader": {
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"less-loader": "^6.2.0",
|
||||
"style-loader": "^2.0.0",
|
||||
"style-resources-loader": "^1.3.2",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"view-design": "^4.6.1",
|
||||
"vue-cli-plugin-style-resources-loader": "^0.1.4",
|
||||
"vue-template-compiler": "^2.6.10"
|
||||
|
|
|
@ -2,7 +2,8 @@ export default {
|
|||
/**
|
||||
* @description 配置显示在浏览器标签的title
|
||||
*/
|
||||
title: "Lili电商",
|
||||
title: "lilishop",
|
||||
|
||||
/**
|
||||
* @description token在Cookie中存储的天数,默认1天
|
||||
*/
|
||||
|
@ -14,6 +15,8 @@ export default {
|
|||
*/
|
||||
useI18n: true,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description api请求基础路径
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
}
|
|
@ -2,12 +2,13 @@ import lazyLoading from './lazyLoading.js';
|
|||
import Cookies from "js-cookie";
|
||||
import { result } from './routerJson.js';
|
||||
|
||||
import config from '@/config/index'
|
||||
let util = {
|
||||
|
||||
};
|
||||
|
||||
util.title = function (title) {
|
||||
title = title || 'lili 商家后台';
|
||||
title = title || `${config.title} 商家后台`;
|
||||
window.document.title = title;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
// The Vue build version to load with the `import` command
|
||||
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
||||
import Vue from "vue";
|
||||
import ViewUI from "view-design";
|
||||
import "./styles/theme.less";
|
||||
|
||||
import "core-js/stable";
|
||||
// import "regenerator-runtime/runtime";
|
||||
import vueQr from "vue-qr";
|
||||
|
||||
import App from "./App";
|
||||
|
|