20230303
@@ -23,7 +23,7 @@ module.exports = {
|
||||
},
|
||||
|
||||
// Various Dev Server settings
|
||||
host: 'localhost', // can be overwritten by process.env.HOST
|
||||
host: '192.168.110.169', // can be overwritten by process.env.HOST
|
||||
port: 8001, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
|
||||
autoOpenBrowser: true,
|
||||
errorOverlay: true,
|
||||
|
||||
BIN
node_modules.rar
Normal file
24359
package-lock.json
generated
@@ -31,6 +31,7 @@
|
||||
"vue": "2.5.16",
|
||||
"vue-audio": "^0.0.12",
|
||||
"vue-cookie": "1.1.4",
|
||||
"vue-quill-editor": "^3.0.6",
|
||||
"vue-router": "3.0.1",
|
||||
"vuex": "3.0.1"
|
||||
},
|
||||
@@ -67,6 +68,8 @@
|
||||
"html-webpack-plugin": "2.30.1",
|
||||
"jest": "21.2.0",
|
||||
"jest-serializer-vue": "0.3.0",
|
||||
"less": "^4.1.3",
|
||||
"less-loader": "^5.0.0",
|
||||
"nightwatch": "0.9.12",
|
||||
"node-notifier": "5.1.2",
|
||||
"optimize-css-assets-webpack-plugin": "3.2.0",
|
||||
|
||||
BIN
peanut_book_vue.rar
Normal file
91
src/assets/css/time-line.less
Normal file
@@ -0,0 +1,91 @@
|
||||
|
||||
.scroll {
|
||||
height: 300px;
|
||||
overflow-y: scroll;
|
||||
display: block;
|
||||
background-color: #fcfcfc;
|
||||
border-top: 15px;
|
||||
border-bottom: 15px;
|
||||
}
|
||||
.el-icon-truck:before {
|
||||
content: "\e740";
|
||||
}
|
||||
|
||||
.el-timeline-item:first-child {
|
||||
.el-timeline-item__node {
|
||||
background-color: rgb(11, 189, 135);
|
||||
}
|
||||
}
|
||||
|
||||
.el-timeline-item {
|
||||
position: relative;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--large {
|
||||
left: -2px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node {
|
||||
position: absolute;
|
||||
background-color: #e4e7ed;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--normal {
|
||||
left: -1px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.el-timeline-item__wrapper {
|
||||
position: relative;
|
||||
padding-left: 28px;
|
||||
top: -3px;
|
||||
}
|
||||
|
||||
.el-timeline li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__tail {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
height: 100%;
|
||||
border-left: 2px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.el-timeline .el-timeline-item:last-child .el-timeline-item__tail {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__timestamp {
|
||||
color: #c3c3c3;
|
||||
font-size: 14px;
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/* 滚动条美化 */
|
||||
::-webkit-scrollbar-track {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
-webkit-appearance: none;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
cursor: pointer;
|
||||
border-radius: 5px;
|
||||
background: rgba(0, 0, 0, 0.15);
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
4
src/assets/js/eventBus.js
Normal file
@@ -0,0 +1,4 @@
|
||||
import Vue from 'vue'
|
||||
// export default new Vue()
|
||||
const Bus = new Vue()
|
||||
export default Bus
|
||||
@@ -75,9 +75,13 @@ import {
|
||||
Loading,
|
||||
MessageBox,
|
||||
Message,
|
||||
Notification
|
||||
Notification,
|
||||
Timeline,
|
||||
TimelineItem,
|
||||
} from 'element-ui'
|
||||
|
||||
Vue.use(Timeline)
|
||||
Vue.use(TimelineItem)
|
||||
Vue.use(Pagination)
|
||||
Vue.use(Dialog)
|
||||
Vue.use(Autocomplete)
|
||||
|
||||
1
src/icons/svg/icon-beizhu.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675911480144" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6594" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M341.333333 546.133333l-45.511111 170.666667c0 11.377778 0 22.755556 5.688889 28.444444 5.688889 5.688889 11.377778 5.688889 22.755556 5.688889h5.688889l164.977777-45.511111h5.688889l443.733334-449.422222c11.377778-11.377778 22.755556-34.133333 22.755555-51.2 0-22.755556-11.377778-45.511111-28.444444-62.577778l-39.822223-39.822222c-17.066667-17.066667-39.822222-28.444444-62.577777-28.444444-17.066667 0-39.822222 5.688889-51.2 22.755555L341.333333 546.133333z m557.511111-329.955555l-45.511111 45.511111-73.955555-73.955556 45.511111-45.511111c5.688889-5.688889 22.755556-5.688889 28.444444 0l39.822223 39.822222c5.688889 5.688889 5.688889 11.377778 5.688888 17.066667 5.688889 5.688889 5.688889 11.377778 0 17.066667zM420.977778 551.822222L739.555556 227.555556l73.955555 73.955555L494.933333 625.777778 420.977778 551.822222z m-62.577778 136.533334l22.755556-85.333334 62.577777 62.577778-85.333333 22.755556z m568.888889-295.822223c-17.066667 0-28.444444 11.377778-28.444445 28.444445V796.444444c0 56.888889-56.888889 85.333333-85.333333 85.333334H204.8c-39.822222 0-79.644444-39.822222-85.333333-108.088889V210.488889c0-91.022222 62.577778-85.333333 85.333333-85.333333h403.911111c17.066667 0 28.444444-11.377778 28.444445-28.444445s-11.377778-28.444444-28.444445-28.444444H199.111111c-51.2 0-142.222222 34.133333-142.222222 119.466666v597.333334c0 119.466667 73.955556 164.977778 142.222222 164.977777h620.088889c79.644444 0 142.222222-51.2 142.222222-142.222222V432.355556c0-28.444444-17.066667-39.822222-34.133333-39.822223z" fill="#999999" p-id="6595"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
1
src/icons/svg/icon-dianhua.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675761496878" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4005" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M446.272 573.44a509.653333 509.653333 0 0 1-81.92-100.650667c67.786667-30.474667 112.138667-93.461333 112.138667-169.792C476.48 194.592 388.96 106.666667 280.906667 106.666667 170.058667 106.666667 85.333333 188.746667 85.333333 302.997333c0 158.250667 82.56 328.554667 200.618667 439.658667 100.010667 94.122667 258.986667 161.738667 413.461333 174.570667 0.832 0.074667 1.674667 0.106667 2.517334 0.106666h41.162666a30.517333 30.517333 0 0 0 0-61.045333h-39.872c-140.672-11.978667-286.026667-73.930667-375.456-158.090667-106.410667-100.16-181.408-254.837333-181.408-395.2 0-80.106667 56.981333-135.285333 134.549334-135.285333 74.282667 0 134.549333 60.533333 134.549333 135.285333 0 60.309333-40.896 107.989333-103.008 123.349334a30.517333 30.517333 0 0 0-19.786667 43.658666c27.573333 53.312 66.037333 104.426667 111.573334 147.690667 51.264 48.693333 109.941333 86.112 172.053333 108.16a30.506667 30.506667 0 0 0 40.362667-24.064c10.453333-67.093333 61.621333-114.026667 126.442666-114.026667 74.272 0 134.549333 60.544 134.549334 135.285334 0 25.578667-7.04 50.026667-20.149334 71.253333a30.528 30.528 0 0 0 51.925334 32.074667A196.096 196.096 0 0 0 938.666667 723.050667c0-108.394667-87.530667-196.330667-195.573334-196.330667-83.072 0-151.210667 52.384-177.621333 128.864-42.368-19.552-82.773333-47.541333-119.2-82.144z" fill="#000000" p-id="4006"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
1
src/icons/svg/icon-kongbai.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1676519092223" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3659" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M573.44 389.12V245.76H358.4c-28.16 0-51.2 23.04-51.2 51.2v460.8c0 28.16 23.04 51.2 51.2 51.2h307.2c28.16 0 51.2-23.04 51.2-51.2V389.12h-143.36z m43.52 101.376L502.784 629.76l-21.504-20.48-21.504 20.992v-41.984l133.12-85.504-147.456 71.68-38.4-35.84v-4.608l209.92-48.128v4.608z" fill="#cdcdcd" opacity=".2" p-id="3660"></path><path d="M102.4 896a409.6 51.2 0 1 0 819.2 0 409.6 51.2 0 1 0-819.2 0Z" fill="#cdcdcd" opacity=".1" p-id="3661"></path><path d="M96.256 525.312c0 8.704 6.656 15.36 15.36 15.36s15.36-6.656 15.36-15.36-6.656-15.36-15.36-15.36c-8.192 0-15.36 7.168-15.36 15.36zM147.456 822.272c0 8.704 6.656 15.36 15.36 15.36s15.36-6.656 15.36-15.36-6.656-15.36-15.36-15.36c-8.192 0-15.36 7.168-15.36 15.36zM926.72 847.872c-15.36 4.096-18.944 7.168-23.04 23.04-4.096-15.36-7.168-18.944-23.04-23.04 15.36-4.096 18.944-7.68 23.04-23.04 4.096 15.36 7.168 18.944 23.04 23.04zM199.68 467.456c-31.232 8.192-37.888 14.848-46.08 46.08-8.192-31.232-14.848-37.888-46.08-46.08 31.232-8.192 37.888-14.848 46.08-46.08 8.192 31.232 14.848 37.888 46.08 46.08zM821.76 214.528c-15.36 4.096-18.432 7.168-22.528 22.528-4.096-15.36-7.168-18.432-22.528-22.528 15.36-4.096 18.432-7.168 22.528-22.528 3.584 15.36 7.168 18.432 22.528 22.528zM882.688 135.68c-39.936 10.24-48.128 18.944-58.88 58.88-10.24-39.936-18.944-48.128-58.88-58.88 39.936-10.24 48.128-18.944 58.88-58.88 10.24 39.424 18.944 48.128 58.88 58.88zM783.36 337.408c0-1.024 0-2.048-0.512-2.56v-0.512c0-0.512-0.512-1.536-0.512-2.048 0-0.512 0-0.512-0.512-1.024s-0.512-1.024-1.024-1.536l-0.512-0.512c-0.512-0.512-1.024-1.536-1.536-2.048l-143.36-143.36c-0.512-0.512-1.024-1.024-2.048-1.536l-0.512-0.512c-0.512-0.512-1.024-0.512-1.536-1.024-0.512 0-0.512 0-1.024-0.512s-1.536-0.512-2.048-0.512h-0.512c-1.024 0-2.048-0.512-2.56-0.512H358.4c-65.024 0-117.76 52.736-117.76 117.76v460.8c0 65.024 52.736 117.76 117.76 117.76h307.2c65.024 0 117.76-52.736 117.76-117.76V337.408c0 0.512 0 0.512 0 0z m-143.36-105.984L731.136 322.56H640V231.424z m25.6 613.376H358.4c-48.128 0-87.04-38.912-87.04-87.04V296.96c0-48.128 38.912-87.04 87.04-87.04h250.88v128c0 8.704 6.656 15.36 15.36 15.36h128v404.48c0 48.128-38.912 87.04-87.04 87.04z" fill="#cdcdcd" opacity=".5" p-id="3662"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
1
src/icons/svg/icon-miandan.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675923543304" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5917" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M826.29 396.16H195.08a35 35 0 0 1-35-35v-88.59a110.12 110.12 0 0 1 110-110h481.21a110.12 110.12 0 0 1 110 110v88.59a35 35 0 0 1-35 35z m-616.21-50h601.21v-73.59a60.07 60.07 0 0 0-60-60H270.08a60.07 60.07 0 0 0-60 60z m549.15 545.19H262.15c-56.28 0-102.07-49.35-102.07-110V465.86a25 25 0 0 1 50 0v315.49c0 33.08 23.36 60 52.07 60h497.08c28.7 0 52.06-26.92 52.06-60V465.86a25 25 0 0 1 50 0v315.49c0 60.65-45.79 110-102.06 110z m-77.88-296.52H340a20 20 0 0 1 0-40h341.35a20 20 0 0 1 0 40zM508.42 705.27H340a20 20 0 0 1 0-40h168.4a20 20 0 0 1 0 40z" p-id="5918"></path></svg>
|
||||
|
After Width: | Height: | Size: 904 B |
1
src/icons/svg/icon-qianbao.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675906886831" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4670" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M926.001035 285.545408 230.820016 112.174825c-11.351536-2.858094-25.650193-0.76134-34.096563 5.850242-8.858762 6.919597-17.10047 17.777899-17.10047 30.558993l0 133.456524-48.090275 0c-34.83539 0-67.543326 31.756261-67.543326 66.591651l0 505.398652c0 34.83539 32.707936 59.389622 67.543326 59.389622l768.626775 0c34.834366 0 59.222823-24.554232 59.222823-59.389622L959.382307 377.459794l0-28.826536 0-16.507976C959.382307 311.231417 947.012581 290.769386 926.001035 285.545408zM230.552933 154.334018l513.582031 127.706567L230.513024 282.040584 230.552933 154.334018zM917.426753 849.418846c0 10.105149-8.454556 22.046109-22.410406 22.046109L134.811382 871.464955c-13.95585 0-28.866445-11.94096-28.866445-22.046109L105.944937 338.498434c0-10.105149 14.910595-14.502295 28.866445-14.502295l760.204965 0c13.95585 0 22.410406 4.397147 22.410406 14.502295L917.426753 849.418846z" fill="#FF0000" p-id="4671"></path><path d="M226.295979 543.42778c-31.93227 0-57.909921 25.983791-57.909921 57.909921s25.978674 57.909921 57.909921 57.909921 57.909921-25.983791 57.909921-57.909921S258.227226 543.42778 226.295979 543.42778zM226.295979 627.660206c-14.513552 0-26.322505-11.803837-26.322505-26.322505 0-14.518668 11.808954-26.322505 26.322505-26.322505 14.513552 0 26.322505 11.803837 26.322505 26.322505C252.618485 615.856369 240.809531 627.660206 226.295979 627.660206z" fill="#FF0000" p-id="4672"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
1
src/icons/svg/icon-qianbi.svg
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
1
src/icons/svg/icon-ren.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675763732805" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4942" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M513.183454 532.442588c-62.243623 0-120.763434-24.225751-164.778904-68.215638-44.020586-43.992957-68.26271-102.486162-68.26271-164.703179 0-62.215994 24.242124-120.708176 68.26271-164.702156 44.01547-43.989887 102.535281-68.216661 164.778904-68.216661 62.243623 0 120.764458 24.226774 164.778904 68.216661 44.018539 43.992957 68.260663 102.485139 68.260663 164.702156 0 62.217017-24.242124 120.710222-68.260663 164.703179C633.947911 508.215814 575.4281 532.442588 513.183454 532.442588zM513.183454 117.828592c-100.254332 0-181.817975 81.507362-181.817975 181.694155 0 100.186793 81.563644 181.695179 181.817975 181.695179 100.254332 0 181.816952-81.508385 181.816952-181.695179C695.000406 199.336978 613.437785 117.828592 513.183454 117.828592z" p-id="4943"></path><path d="M879.044072 956.940698 146.070308 956.940698l-1.243317-24.303522c-0.317225-6.202259-0.477884-12.514012-0.477884-18.762319 0-49.262984 9.751085-97.06264 28.983101-142.071739 18.562774-43.444465 45.127803-82.45085 78.95626-115.937522 33.81106-33.468253 73.183789-59.745732 117.02632-78.100776 45.3867-19.002796 93.581352-28.637224 143.245472-28.637224 49.665143 0 97.861842 9.634428 143.247518 28.637224 43.842531 18.356067 83.21526 44.632523 117.02632 78.100776 33.828456 33.486672 60.393485 72.493058 78.955236 115.937522 19.230993 45.0091 28.982078 92.808756 28.982078 142.071739 0 6.246261-0.161682 12.56006-0.480954 18.768459L879.044072 956.940698zM195.678146 905.71706l633.765251 0c-4.380774-169.130002-144.846946-305.366849-316.883137-305.366849C340.525092 600.350211 200.05892 736.587058 195.678146 905.71706z" p-id="4944"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
1
src/icons/svg/icon-truck.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675755681673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2906" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M968 168c17.67 0 32 14.33 32 32v560c0 17.67-14.33 32-32 32h-76.6c-14.34 50.23-60.58 87-115.4 87s-101.07-36.77-115.4-87H363.69c-14 50.74-60.49 88-115.69 88s-101.68-37.26-115.69-88H32c-4.42 0-8-3.58-8-8V504.27c0-3.56 1.19-7.01 3.37-9.82l153.77-197.69a15.99 15.99 0 0 1 12.63-6.18h213.92V200c0-17.67 14.33-32 32-32H968zM248 704c-30.93 0-56 25.07-56 56s25.07 56 56 56 56-25.07 56-56-25.07-56-56-56z m528-1c-30.93 0-56 25.07-56 56s25.07 56 56 56 56-25.07 56-56-25.07-56-56-56z m160-471H471.69v100h0.31v396h188.04c13.67-51.25 60.4-89 115.96-89s102.29 37.75 115.96 89H936V232zM408 354.58H217.24L177.25 406H264c4.42 0 8 3.58 8 8v38c0 4.42-3.58 8-8 8H135.25L88 520.74V728h44.31c14-50.74 60.49-88 115.69-88s101.68 37.26 115.69 88H408V354.58z" p-id="2907"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
src/icons/svg/icon-weixin.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675906873370" class="icon" viewBox="0 0 1144 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3660" xmlns:xlink="http://www.w3.org/1999/xlink" width="223.4375" height="200"><path d="M436.314353 632.771765c-68.517647 36.321882-78.667294-20.389647-78.667294-20.389647l-85.835294-190.524236c-33.039059-90.533647 28.581647-40.839529 28.581647-40.839529s52.856471 38.038588 93.003294 61.229176c40.086588 23.190588 85.835294 6.806588 85.835294 6.806589l561.212235-246.362353C936.899765 80.112941 765.891765 0 572.235294 0 256.180706 0 0 213.232941 0 476.310588c0 151.311059 84.811294 285.967059 216.937412 373.248l-23.792941 130.288941s-11.625412 38.038588 28.611764 20.389647c27.437176-12.047059 97.370353-55.115294 138.992941-81.347764 65.445647 21.684706 136.734118 33.731765 211.486118 33.731764 316.024471 0 572.235294-213.232941 572.235294-476.310588 0-76.197647-21.594353-148.178824-59.843764-212.028235-178.808471 102.309647-594.733176 340.118588-648.312471 368.489412z" fill="#43C93E" p-id="3661"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
src/icons/svg/icon-zhifubao.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675906856282" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2692" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M1024.0512 701.0304V196.864A196.9664 196.9664 0 0 0 827.136 0H196.864A196.9664 196.9664 0 0 0 0 196.864v630.272A196.9152 196.9152 0 0 0 196.864 1024h630.272a197.12 197.12 0 0 0 193.8432-162.0992c-52.224-22.6304-278.528-120.32-396.4416-176.64-89.7024 108.6976-183.7056 173.9264-325.3248 173.9264s-236.1856-87.2448-224.8192-194.048c7.4752-70.0416 55.552-184.576 264.2944-164.9664 110.08 10.3424 160.4096 30.8736 250.1632 60.5184 23.1936-42.5984 42.496-89.4464 57.1392-139.264H248.064v-39.424h196.9152V311.1424H204.8V267.776h240.128V165.632s2.1504-15.9744 19.8144-15.9744h98.4576V267.776h256v43.4176h-256V381.952h208.8448a805.9904 805.9904 0 0 1-84.8384 212.6848c60.672 22.016 336.7936 106.3936 336.7936 106.3936zM283.5456 791.6032c-149.6576 0-173.312-94.464-165.376-133.9392 7.8336-39.3216 51.2-90.624 134.4-90.624 95.5904 0 181.248 24.4736 284.0576 74.5472-72.192 94.0032-160.9216 150.016-253.0816 150.016z" fill="#009FE8" p-id="2693"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
src/icons/svg/icon-zhuyi.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1675909124937" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5633" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 0C373.76 0 245.76 51.2 148.48 148.48 56.32 245.76 0 373.76 0 506.88 0 793.6 225.28 1024 506.88 1024c286.72 0 517.12-225.28 517.12-506.88C1024 230.4 798.72 0 512 0z m0 957.44c-250.88 0-450.56-199.68-445.44-450.56 0-245.76 199.68-445.44 445.44-440.32 245.76 0 445.44 199.68 445.44 445.44 0 250.88-194.56 445.44-445.44 445.44zM460.8 424.96v163.84c0 35.84 20.48 46.08 56.32 46.08 35.84 0 35.84-20.48 35.84-46.08 5.12-97.28 5.12-194.56 10.24-291.84 5.12-35.84 0-61.44-51.2-61.44S455.68 256 455.68 296.96L460.8 424.96z m117.76 337.92c-5.12 40.96-30.72 61.44-66.56 61.44-35.84 0-61.44-20.48-66.56-56.32-5.12-40.96 20.48-61.44 61.44-61.44 40.96-5.12 61.44 20.48 71.68 56.32z" fill="#FAB427" p-id="5634"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -7,6 +7,8 @@ import '@/element-ui' // api: https://github.com/ElemeFE
|
||||
import '@/icons' // api: http://www.iconfont.cn/
|
||||
import '@/element-ui-theme'
|
||||
import '@/assets/scss/index.scss'
|
||||
import '@/assets/css/time-line.less' // 引入时间线样式
|
||||
import Bus from '@/assets/js/eventBus.js'
|
||||
import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
|
||||
import { isAuth } from '@/utils'
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
@@ -22,6 +24,7 @@ if (process.env.NODE_ENV !== 'production') {
|
||||
// 挂载全局
|
||||
Vue.prototype.$http = httpRequest // ajax请求方法
|
||||
Vue.prototype.isAuth = isAuth // 权限方法
|
||||
Vue.prototype.$bus = Bus
|
||||
|
||||
// 保存整站vuex本地储存初始状态
|
||||
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
|
||||
|
||||
@@ -38,10 +38,13 @@ const mainRoutes = {
|
||||
{ path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } },
|
||||
{ path: '/demo-ueditor', component: _import('demo/ueditor'), name: 'demo-ueditor', meta: { title: 'demo-ueditor', isTab: true } },
|
||||
{ path: '/book-book', component: _import('modules/book/book'), name: 'book-book', meta: { title: '图书列表', isTab: true } },
|
||||
{ path: '/order-buyorderdetail', component: _import('modules/order/buyorderdetail'), name: 'order-buyorderdetail', meta: { title: '商品列表', isTab: true } },
|
||||
{ path: '/order-buyorderdetail', component: _import('modules/order/buyorderdetail'), name: 'order-buyorderdetail', meta: { title: '订单详情', isTab: true } },
|
||||
{ path: '/book-bookchapter', component: _import('modules/book/bookchapter'), name: 'book-chapter', meta: { title: '图书章节', isTab: true } },
|
||||
{ path: '/book-bookchaptercontent', component: _import('modules/book/bookchaptercontent'), name: 'book-content', meta: { title: '章节内容', isTab: true } },
|
||||
{ path: '/seckill-seckillprodrelation', component: _import('modules/seckill/seckillprodrelation'), name: 'seckill-seckillprodrelation', meta: { title: '秒杀商品', isTab: true } },
|
||||
{ path: '/buyorder-mergeorder', component: _import('modules/order/buyorder-mergeorder'), name: 'buyorder-mergeorder', meta: { title: '合并发货', isTab: true } },
|
||||
{ path: '/buyorder-print', component: _import('modules/order/buyorder-print'), name: 'buyorder-print', meta: { title: '打印面单', isTab: true } },
|
||||
{ path: '/activity-list', component: _import('modules/activity/activityList'), name: 'activity-list', meta: { title: '活动列表', isTab: true } },
|
||||
],
|
||||
beforeEnter (to, from, next) {
|
||||
let token = Vue.cookie.get('token')
|
||||
|
||||
3
src/utils/Bus.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
let Bus = new Vue();
|
||||
export default Bus;
|
||||
633
src/views/modules/activity/activity-add-or-update.vue
Normal file
@@ -0,0 +1,633 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible" width="900px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动名称" prop="activityName">
|
||||
<el-input v-model="dataForm.activityName" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动类型" prop="activityType">
|
||||
<!-- <el-input v-model="dataForm.type" placeholder="优惠卷类型"></el-input> -->
|
||||
<el-select v-model="dataForm.activityType" placeholder="请选择">
|
||||
<el-option v-for="item in activityTypeList" :key="item.dictType" :label="item.dictValue"
|
||||
:value="item.dictType">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="触发操作" prop="activityManner">
|
||||
<!-- <el-input v-model="dataForm.type" placeholder="优惠卷类型"></el-input> -->
|
||||
<el-select v-model="dataForm.activityManner" placeholder="请选择">
|
||||
<el-option v-for="item in activityOprateTypeList" :key="item.dictType" :label="item.dictValue"
|
||||
:value="item.dictType">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" v-if="dataForm.activityManner == 2">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动内容" prop="activedContent.activedetailCode" style="margin-bottom: 0;">
|
||||
<el-radio-group v-model="dataForm.activedContent.activedetailCode">
|
||||
<el-radio-button :label="0">购买商品</el-radio-button>
|
||||
<!-- <el-radio-button :label="1">满额</el-radio-button> -->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10" v-if="dataForm.activityManner == 3">
|
||||
<el-col :span="24" style="margin-bottom: 15px;">
|
||||
<el-form-item label="活动内容" prop="activedContent.chongzhiCode" style="margin-bottom: 0;">
|
||||
<el-radio-group v-model="dataForm.activedContent.chongzhiCode">
|
||||
<el-radio-button :label="0">阶梯满减</el-radio-button>
|
||||
<el-radio-button :label="1">满额赠</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24" v-if="dataForm.activityManner != 1 && dataForm.activityManner != 3">
|
||||
<el-form-item label="" prop="activedeProductsImgList">
|
||||
<div style=" padding: 10px; border: 1px dashed #eee; background-color: #f8f8f8;">
|
||||
<!-- <span style="font-size: 12px; color: #888;">活动主体</span> -->
|
||||
<span class="add" type="text" plain @click="selectProducts">选择商品</span>
|
||||
<div style="overflow-y: scroll; ">
|
||||
<el-upload class="pictureList" action="http://59.110.212.44:9100/pb/oss/fileoss" list-type="picture"
|
||||
:on-preview="handlePictureCardPreview1" :file-list="ProductsListFileList"
|
||||
:on-success="handlePicSuccess1" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove1">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.activedeProductsImgList" alt="">
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" v-if="dataForm.activityManner == 3">
|
||||
<el-form-item label="活动内容">
|
||||
<!-- 阶梯满减 -->
|
||||
<div v-if="dataForm.activedContent.chongzhiCode == 0">
|
||||
<el-table border :data="dataForm.activedContent.chongzhiMJList" style="width: 500px">
|
||||
<el-table-column
|
||||
prop="region"
|
||||
label="满额" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.region" placeholder="请输入满减额"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="value"
|
||||
label="积分数" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.value" placeholder="请输入积分数"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作" width="60px">
|
||||
<template slot-scope="scope"><el-button type="text" @click="deleteMJRow(scope.row)">删除</el-button></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: center; width: 500px; background-color:#fafafa;"><el-button type="text" size="mini" @click="addmanjian">添加一项</el-button></div>
|
||||
</div>
|
||||
<div v-if="dataForm.activedContent.chongzhiCode == 1">
|
||||
<!-- 满额赠送 -->
|
||||
<el-table border :data="dataForm.activedContent.chongZList" style="width: 500px">
|
||||
<el-table-column
|
||||
prop="region"
|
||||
label="满额" >
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.region" placeholder="请输入门槛"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="region"
|
||||
label="满额" >
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="dataForm.activedContent.chongZList[scope.$index].code" placeholder="请选择">
|
||||
<el-option v-for="item in zengsongCodeList" :key="item.dictType" :label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input v-model="scope.row.region" placeholder="请输入门槛"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="region"
|
||||
label="操作" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="dataForm.activityManner == 2 || dataForm.activityManner == 1">
|
||||
<el-form-item label="">
|
||||
<div style=" padding: 10px; border: 1px dashed #eee; background-color: #f8f8f8;">
|
||||
<!-- <span style="font-size: 12px; color: #888;">赠送专区</span> -->
|
||||
<el-form-item label="" prop="activedContent.zengsongCode" style="margin-bottom: 0;">
|
||||
<el-checkbox-group @change="zengpinTypeChange"
|
||||
v-model="dataForm.activedContent.zengsongCode">
|
||||
<el-checkbox v-for="item in zengsongCodeList" :label="item.label" :key="item.value">{{item.value}}</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<ul class="couponList" >
|
||||
<li v-for="(item, index) in dataForm.activedContent.couponList" :key="item.id">
|
||||
<span>¥{{ item.couponAmount }} 元 </span><i>有效期至:2023-03-01 22:00:00</i>
|
||||
<div class="delbtn" @click="deleteCoupon(index)">×</div>
|
||||
</li>
|
||||
<div style="clear: both;">
|
||||
<span class="add" v-if="this.couponButtonShow" type="text" plain
|
||||
@click="selectCoupon">选择优惠券</span>
|
||||
</div>
|
||||
</ul>
|
||||
<!-- 送积分 -->
|
||||
<div v-if="this.pointButtonShow" style="border-bottom: 1px solid #eee; padding: 10px 0;">
|
||||
<el-form-item label="获赠" prop="point" style="width: 250px;"
|
||||
label-width="40px">
|
||||
<el-input size="mini" v-model="dataForm.point" placeholder="积分分值">
|
||||
<template slot="append">积分</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- 送产品 -->
|
||||
<div v-if="dataForm.activedContent.zProductsList.length > 0" style="margin-top: 10px;">
|
||||
<el-table v-if="dataForm.activedContent.zProductsList" :data="dataForm.activedContent.zProductsList"
|
||||
stripe style="width: 100%">
|
||||
<el-table-column prop="productName" label="商品名">
|
||||
</el-table-column>
|
||||
<el-table-column label="商品图">
|
||||
<template slot-scope="scope">
|
||||
<img :src="scope.row.productImages" alt="" width="30px" height="30px">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="deleteSelectePro(scope.row)" size="mini">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<span class="add" v-if="this.proButtonShow" type="text" plain
|
||||
@click="selectZPro">选择商品</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动时间" prop="startTime">
|
||||
<el-date-picker style="width: 100%;" v-model="dataForm.startTime" type="datetimerange"
|
||||
value-format="timestamp" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['12:00:00']">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动封面图" prop="productImages">
|
||||
<el-upload :limit="1" class="el-uploadfeng" action="http://59.110.212.44:9100/pb/oss/fileoss"
|
||||
list-type="picture-card" :on-preview="handlePictureCardPreview" :file-list="fileList"
|
||||
:on-success="handlePicSuccess" accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.productImages" alt="">
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input type="textarea" v-model="dataForm.remark" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
startTimeradio: 0,
|
||||
dialogVisible: false,
|
||||
couponButtonShow:false, // 添加优惠券按钮
|
||||
proButtonShow:false, // 添加商品按钮
|
||||
pointButtonShow:false, // 添加积分
|
||||
fileList: [], // 封面图
|
||||
ProductsListFileList: [], // 活动的产品列表
|
||||
activityTypeList: [],
|
||||
activityOprateTypeList: [],
|
||||
zengsongCodeList:[
|
||||
{label:0 ,value:'送优惠券'},
|
||||
{label:1 ,value:'送积分'},
|
||||
{label:2 ,value:'送商品'},
|
||||
], // 产品类型
|
||||
amount: null, // 达标金额
|
||||
point: null, //积分
|
||||
dataForm: {
|
||||
// 新增属性
|
||||
activityType: '0',
|
||||
activityManner:'1',
|
||||
productImages: '', // 优惠券封面
|
||||
// fengImg: '', // 优惠券封面
|
||||
activedeProductsImgList: [], // 活动的产品图片列表
|
||||
activedContent: { // 活动
|
||||
activedetailCode: '0',
|
||||
zengsongCode: [],
|
||||
chongzhiCode:0, // 满减类型
|
||||
productCode: 0, // 购买产品类型
|
||||
ACProductsList: [], // 参加活动的产品列表
|
||||
couponList: [], // 优惠券列表
|
||||
zProductsList: [], // 赠送商品列表
|
||||
chongzhiMJList:[{ // 充值阶梯满减List
|
||||
region:null,
|
||||
value:null
|
||||
}],
|
||||
chongZList:[{
|
||||
region:null,
|
||||
gift:{ // 赠品
|
||||
code:0, // 赠品状态码
|
||||
list:[], // 赠品列表
|
||||
number:null , // 赠送的积分数 int
|
||||
}
|
||||
}],// 充值满额赠List
|
||||
},
|
||||
associatedId: null,
|
||||
id: 0,
|
||||
validity: '',
|
||||
activityName: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
remark: '',
|
||||
},
|
||||
dataRule: {
|
||||
// type: [
|
||||
// { required: true, message: '优惠卷类型;0->全场赠券;1->会员赠券;2->购物赠券;3->注册赠券不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// name: [
|
||||
// { required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// platform: [
|
||||
// { required: true, message: '使用平台:0->全部;1->移动;2->PC不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// count: [
|
||||
// { required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// amount: [
|
||||
// { required: true, message: '金额不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// perLimit: [
|
||||
// { required: true, message: '每人限领张数不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// minPoint: [
|
||||
// { required: true, message: '使用门槛;0表示无门槛不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// startTime: [
|
||||
// { required: true, message: '开始使用时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// endTime: [
|
||||
// { required: true, message: '结束使用时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// useType: [
|
||||
// { required: true, message: '使用类型:0->全场通用;1->指定分类;2->指定商品不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// note: [
|
||||
// { required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// publishCount: [
|
||||
// { required: true, message: '发行数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// useCount: [
|
||||
// { required: true, message: '已使用数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// receiveCount: [
|
||||
// { required: true, message: '领取数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// enableTime: [
|
||||
// { required: true, message: '可以领取的日期不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// code: [
|
||||
// { required: true, message: '优惠码不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// memberLevel: [
|
||||
// { required: true, message: '可领取的会员类型:0->无限制不能为空', trigger: 'blur' }
|
||||
// ]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/coupon/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.type = data.coupon.type
|
||||
this.dataForm.name = data.coupon.name
|
||||
this.dataForm.platform = data.coupon.platform
|
||||
this.dataForm.count = data.coupon.count
|
||||
this.dataForm.amount = data.coupon.amount
|
||||
this.dataForm.perLimit = data.coupon.perLimit
|
||||
this.dataForm.minPoint = data.coupon.minPoint
|
||||
this.dataForm.startTime = data.coupon.startTime
|
||||
this.dataForm.endTime = data.coupon.endTime
|
||||
this.dataForm.useType = data.coupon.useType
|
||||
this.dataForm.note = data.coupon.note
|
||||
this.dataForm.publishCount = data.coupon.publishCount
|
||||
this.dataForm.useCount = data.coupon.useCount
|
||||
this.dataForm.receiveCount = data.coupon.receiveCount
|
||||
this.dataForm.enableTime = data.coupon.enableTime
|
||||
this.dataForm.code = data.coupon.code
|
||||
this.dataForm.memberLevel = data.coupon.memberLevel
|
||||
this.startTime = [this.dataForm.startTime, this.dataForm.endTime]
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
this.getActivityType()
|
||||
this.getActivityOprateType()
|
||||
})
|
||||
},
|
||||
zengpinTypeChange(){
|
||||
console.log(this.dataForm.activedContent.zengsongCode)
|
||||
if(this.dataForm.activedContent.zengsongCode.includes(0)){ this.couponButtonShow = true}else{
|
||||
this.couponButtonShow = false
|
||||
}
|
||||
if(this.dataForm.activedContent.zengsongCode.includes(1)){this.pointButtonShow = true}else{
|
||||
this.pointButtonShow = false
|
||||
}
|
||||
if(this.dataForm.activedContent.zengsongCode.includes(2)){ this.proButtonShow = true}else{
|
||||
this.proButtonShow = false
|
||||
}
|
||||
},
|
||||
// 获取活动类型
|
||||
getActivityType() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/activity_type'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
console.log(data)
|
||||
this.activityTypeList = data.dataList
|
||||
})
|
||||
},
|
||||
// 获取出发类型
|
||||
getActivityOprateType() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/activity_oprate_type'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
this.activityOprateTypeList = data.dataList
|
||||
})
|
||||
},
|
||||
addmanjian(){
|
||||
this.dataForm.activedContent.chongzhiMJList.push({region:null, value:null})
|
||||
},
|
||||
deleteMJRow(row){ //删除满减
|
||||
var i = this.dataForm.activedContent.chongzhiMJList.findIndex(item => item.value === row.value)
|
||||
this.dataForm.activedContent.chongzhiMJList.splice(i, 1)
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.productImages = res;
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.dataForm.productImages = '';
|
||||
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dataForm.productImages = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
// 商品列表
|
||||
handlePicSuccess1(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.activedeProductsImgList = res;
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
selectProducts() {
|
||||
// this.ProListVisible = true
|
||||
this.$emit("showProlist", true);
|
||||
// this.$bus.$emit('selectTitle','shangpin')
|
||||
this.$bus.$emit('getListInMes', {
|
||||
selectTitle: 'shangpin',
|
||||
ProductList: this.dataForm.activedContent.ACProductsList
|
||||
})
|
||||
// this.ProListVisible = true
|
||||
},
|
||||
selectZPro() {
|
||||
this.$emit("showProlist", true);
|
||||
this.$bus.$emit('getListInMes', {
|
||||
selectTitle: 'zengshangpin',
|
||||
ProductList: this.dataForm.activedContent.zProductsList
|
||||
})
|
||||
},
|
||||
selectCoupon() {
|
||||
this.$emit("showCouponlist", true);
|
||||
this.$bus.$emit('getCouListInMes', {
|
||||
List: this.dataForm.activedContent.couponList
|
||||
})
|
||||
},
|
||||
handleRemove1(file, fileList) {
|
||||
var i = this.dataForm.activedContent.ACProductsList.findIndex(item => item.productImages === file.url)
|
||||
this.dataForm.activedContent.ACProductsList.splice(i, 1)
|
||||
},
|
||||
handlePictureCardPreview1(file) {
|
||||
this.dataForm.activedeProductsImgList = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
deleteCoupon(i){
|
||||
this.dataForm.activedContent.couponList.splice(i, 1)
|
||||
},
|
||||
datePicked() {
|
||||
console.log(this.dataForm.startTime)
|
||||
},
|
||||
deleteSelectePro(row){
|
||||
var i = this.dataForm.activedContent.zProductsList.findIndex(item => item.productId === row.productId)
|
||||
this.dataForm.activedContent.zProductsList.splice(i, 1)
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/activity/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'activityName': this.dataForm.activityName,
|
||||
'activityType': this.dataForm.activityType,
|
||||
'activityManner': this.dataForm.activityManner,
|
||||
'activityContent': this.dataForm.activityContent,
|
||||
'amount': this.dataForm.amount,
|
||||
'associatedId': this.dataForm.associatedId,
|
||||
'point': this.dataForm.point,
|
||||
'validity': this.dataForm.validity,
|
||||
'beginTime': this.dataForm.beginTime,
|
||||
'endTime': this.dataForm.enableTime,
|
||||
'remark': this.dataForm.remark,
|
||||
'activityUrl': this.dataForm.productImages
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getImgList() {
|
||||
var arr = []
|
||||
this.dataForm.activedContent.ACProductsList.forEach(item => {
|
||||
arr.push({ name: item.productName, url: item.productImages })
|
||||
})
|
||||
this.ProductsListFileList = arr
|
||||
console.log(this.ProductsListFileList)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// console.log(454545)
|
||||
this.$bus.$on("haveSelected", (data) => {
|
||||
if (data.title == "shangpin") { // 获得活动商品列表
|
||||
this.dataForm.activedContent.ACProductsList = data.list
|
||||
this.$nextTick(() => {
|
||||
this.getImgList()
|
||||
})
|
||||
}
|
||||
if (data.title == "zengshangpin") { // 获得赠品商品列表
|
||||
this.dataForm.activedContent.zProductsList = data.list
|
||||
console.log(this.dataForm.activedContent.zProductsList, 'zProductsList')
|
||||
}
|
||||
});
|
||||
this.$bus.$on("haveSelectedCoupon", (data) => {
|
||||
this.dataForm.activedContent.couponList = data
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.couponList {
|
||||
padding-left: 0;
|
||||
margin: 0; overflow: hidden; border-bottom: 1px solid #eee;
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
text-align: center;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
width: 150px;
|
||||
height: 79px;
|
||||
background: url(../../../../static/img/couponBg.jpg) no-repeat left top;
|
||||
|
||||
span {
|
||||
font-size: 26px;
|
||||
font-weight: bold;
|
||||
color: bisque;
|
||||
line-height: 20px;
|
||||
margin-top: 18px;
|
||||
display: block;
|
||||
}
|
||||
.delbtn{position: absolute; cursor: pointer; width: 15px; height: 15px; top: 10px; line-height: 11px; border-radius: 20px; right: 5px; color: #eee; border: 1px solid #eee; font-size: 12px; margin-top: 0;}
|
||||
|
||||
i {
|
||||
font-size: 12px;
|
||||
color: bisque;
|
||||
margin-top: -10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.pictureList {
|
||||
/deep/.el-upload--picture {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/deep/ .el-upload-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.el-upload-list__item {
|
||||
// width: 50%;
|
||||
padding: 5px 5px 5px 87px;
|
||||
height: 40px;
|
||||
|
||||
img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.el-upload-list__item-name {
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add {
|
||||
outline: none;
|
||||
color: #17B3A3;
|
||||
cursor: pointer;
|
||||
}</style>
|
||||
228
src/views/modules/activity/activityList.vue
Normal file
@@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-radio-group size="mini" v-model="couponActiveName" style="margin-bottom: 15px;" @tab-click="handleClick">
|
||||
<el-radio-button label="0">全部</el-radio-button>
|
||||
<el-radio-button label="1">生效中</el-radio-button>
|
||||
<el-radio-button label="2">已过期</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input size="mini" v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button size="mini" @click="getDataList()">查询</el-button>
|
||||
<el-button size="mini" v-if="isAuth('book:coupon:save')" type="primary" @click="addOrUpdateHandle()">新增活动</el-button>
|
||||
<!-- <el-button v-if="isAuth('book:coupon:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="序号" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="活动名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="封面图">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="开始时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="结束时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button> -->
|
||||
<el-button type="text" size="small" >活动详情</el-button>
|
||||
<!-- <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update @showProlist = "showProlist" @showCouponlist = "showCouponlist" v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<!-- 商品列表 -->
|
||||
<ProListCom ref="ProList" :visible="ProListVisible" @ProListClose = "ProListClose"></ProListCom>
|
||||
<CouponListCom ref="CouponList" :visible="CouponListVisible" @CouponListClose = "CouponListClose"></CouponListCom>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ProListCom from '../shop/pubilc-pro-list'
|
||||
import AddOrUpdate from './activity-add-or-update'
|
||||
import CouponListCom from '../coupon/pubilc-coupon-list'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
CouponListVisible:false,
|
||||
ProListVisible:false,
|
||||
couponActiveName:'0',
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
ProListCom,
|
||||
CouponListCom
|
||||
},
|
||||
activated () {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(){
|
||||
console.log(this.couponActiveName)
|
||||
// console.log(787878)
|
||||
},
|
||||
showProlist(){
|
||||
this.ProListVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ProList.getDataList()
|
||||
})
|
||||
|
||||
},
|
||||
showCouponlist(){
|
||||
this.CouponListVisible = true;
|
||||
console.log(45455)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.CouponList.getDataList()
|
||||
})
|
||||
},
|
||||
ProListClose(){
|
||||
this.ProListVisible = false;
|
||||
},
|
||||
CouponListClose(){
|
||||
this.CouponListVisible = false
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/activity/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key,
|
||||
'currentState':this.couponActiveName
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/activity/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},watch:{
|
||||
couponActiveName: {
|
||||
handler(val, oldVal) {
|
||||
this.getDataList()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="出版商名称" prop="publisherId">
|
||||
<el-input v-model="dataForm.publisherId" placeholder="出版商名称"></el-input>
|
||||
</el-form-item> -->
|
||||
@@ -154,7 +154,7 @@
|
||||
</el-form-item> -->
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="删除标记" prop="delFlag">
|
||||
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
|
||||
</el-form-item> -->
|
||||
|
||||
@@ -1,109 +1,109 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="优惠卷类型:" prop="type">
|
||||
<!-- <el-input v-model="dataForm.type" placeholder="优惠卷类型"></el-input> -->
|
||||
<el-select v-model="dataForm.type" placeholder="请选择" >
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠券名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用平台">
|
||||
<!-- <el-input v-model="dataForm.platform" placeholder="使用平台"></el-input> -->
|
||||
<el-select v-model="dataForm.platform" placeholder="请选择" >
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="总发行量" prop="publishCount">
|
||||
<el-input v-model="dataForm.publishCount" placeholder="发行数量"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="数量" prop="count">
|
||||
<el-input v-model="dataForm.count" placeholder="数量"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="面额:" prop="amount">
|
||||
<el-input v-model="dataForm.amount" placeholder="面额">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible" width="900px">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="优惠卷类型" prop="couponType">
|
||||
<!-- <el-input v-model="dataForm.type" placeholder="优惠卷类型"></el-input> -->
|
||||
<el-select v-model="dataForm.couponType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8"><el-form-item label="使用门槛" prop="useLevel">
|
||||
<el-input v-model="dataForm.useLevel" placeholder="" oninput="value=value.replace(/[^\d.]/g,'')">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
|
||||
</el-form-item></el-col>
|
||||
<el-col :span="8"><el-form-item label="商品类型" prop="couponProType">
|
||||
<!-- <el-input v-model="dataForm.type" placeholder="优惠卷类型"></el-input> -->
|
||||
<el-select v-model="dataForm.couponProType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item></el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="每人限领:" prop="perLimit">
|
||||
<el-input v-model="dataForm.perLimit" placeholder="">
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="优惠券名称" prop="couponName">
|
||||
<el-input v-model="dataForm.couponName" placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="面额:" prop="couponAmount">
|
||||
<el-input v-model="dataForm.couponAmount" placeholder="面额" oninput="value=value.replace(/[^\d.]/g,'')">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="每人限领:" prop="limitedCollar">
|
||||
<el-input v-model="dataForm.limitedCollar" oninput="value=value.replace(/[^\d.]/g,'')" placeholder="">
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row ::gutter="10">
|
||||
</el-row>
|
||||
<el-row ::gutter="10">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开始时间" prop="takeEffectType">
|
||||
<el-radio-group v-model="dataForm.takeEffectType">
|
||||
<el-radio :label="0">领取日</el-radio>
|
||||
<el-radio :label="1">设置日期</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="takeEffectDate" v-if="dataForm.takeEffectType == '1'">
|
||||
<el-date-picker
|
||||
v-model="dataForm.takeEffectDate" @change="datePicked"
|
||||
type="datetime" value-format="timestamp"
|
||||
placeholder="选择日期时间"
|
||||
default-time="12:00:00">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="时效" prop="validity">
|
||||
<el-input placeholder="" v-model="dataForm.validity" oninput="value=value.replace(/[^\d.]/g,'')">
|
||||
<template slot="append">天</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="总发行量" prop="totalCirculation">
|
||||
<el-input v-model="dataForm.totalCirculation" placeholder="发行数量" oninput="value=value.replace(/[^\d.]/g,'')">
|
||||
<template slot="append">张</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="封面图" prop="couponUrl">
|
||||
<el-upload :limit="1" class="el-uploadfeng"
|
||||
action="http://59.110.212.44:9100/pb/oss/fileoss" list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess"
|
||||
accept=".jpeg,.jpg,.gif,.png" :on-remove="handleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.couponUrl" alt="">
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="使用门槛" prop="minPoint">
|
||||
<el-input v-model="dataForm.minPoint" placeholder="">
|
||||
<template slot="prepend">满</template>
|
||||
<template slot="append">元可用</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="有效期" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="startTime"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="结束使用时间" prop="endTime">
|
||||
<el-input v-model="dataForm.endTime" placeholder="结束使用时间"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="使用类型" prop="useType">
|
||||
<!-- <el-input v-model="dataForm.useType" placeholder="使用类型"></el-input> -->
|
||||
<el-radio-group v-model="dataForm.useType">
|
||||
<el-radio-button label="0">全场通用</el-radio-button>
|
||||
<el-radio-button label="1">指定分类</el-radio-button>
|
||||
<el-radio-button label="2">指定商品</el-radio-button>
|
||||
<!-- <el-radio-button label="深圳"></el-radio-button> -->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="note">
|
||||
<el-input v-model="dataForm.note" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="已使用数量" prop="useCount">
|
||||
<el-input v-model="dataForm.useCount" placeholder="已使用数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="领取数量" prop="receiveCount">
|
||||
<el-input v-model="dataForm.receiveCount" placeholder="领取数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="可以领取的日期" prop="enableTime">
|
||||
<el-input v-model="dataForm.enableTime" placeholder="可以领取的日期"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠码" prop="code">
|
||||
<el-input v-model="dataForm.code" placeholder="优惠码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="可领取的会员类型" prop="memberLevel">
|
||||
<el-input v-model="dataForm.memberLevel" placeholder="可领取的会员类型"></el-input>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
@@ -113,192 +113,213 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '全场赠券'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '会员赠券'
|
||||
}, {
|
||||
value: 2,
|
||||
label: '购物赠券'
|
||||
}, {
|
||||
value: 3,
|
||||
label: '注册赠券'
|
||||
}],
|
||||
options1: [{
|
||||
value: 0,
|
||||
label: '全部'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '移动'
|
||||
}, {
|
||||
value: 2,
|
||||
label: 'PC'
|
||||
}],
|
||||
startTime:[],
|
||||
dataForm: {
|
||||
id: 0,
|
||||
type: '',
|
||||
name: '',
|
||||
platform: '',
|
||||
count: '',
|
||||
amount: '',
|
||||
perLimit: '',
|
||||
minPoint: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
useType: '',
|
||||
note: '',
|
||||
publishCount: '',
|
||||
useCount: '1',
|
||||
receiveCount: '',
|
||||
enableTime: '',
|
||||
code: '',
|
||||
memberLevel: ''
|
||||
},
|
||||
dataRule: {
|
||||
type: [
|
||||
{ required: true, message: '优惠卷类型;0->全场赠券;1->会员赠券;2->购物赠券;3->注册赠券不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
platform: [
|
||||
{ required: true, message: '使用平台:0->全部;1->移动;2->PC不能为空', trigger: 'blur' }
|
||||
],
|
||||
count: [
|
||||
{ required: true, message: '数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
amount: [
|
||||
{ required: true, message: '金额不能为空', trigger: 'blur' }
|
||||
],
|
||||
perLimit: [
|
||||
{ required: true, message: '每人限领张数不能为空', trigger: 'blur' }
|
||||
],
|
||||
minPoint: [
|
||||
{ required: true, message: '使用门槛;0表示无门槛不能为空', trigger: 'blur' }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: '开始使用时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: '结束使用时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
useType: [
|
||||
{ required: true, message: '使用类型:0->全场通用;1->指定分类;2->指定商品不能为空', trigger: 'blur' }
|
||||
],
|
||||
note: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
publishCount: [
|
||||
{ required: true, message: '发行数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
useCount: [
|
||||
{ required: true, message: '已使用数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
receiveCount: [
|
||||
{ required: true, message: '领取数量不能为空', trigger: 'blur' }
|
||||
],
|
||||
enableTime: [
|
||||
{ required: true, message: '可以领取的日期不能为空', trigger: 'blur' }
|
||||
],
|
||||
code: [
|
||||
{ required: true, message: '优惠码不能为空', trigger: 'blur' }
|
||||
],
|
||||
memberLevel: [
|
||||
{ required: true, message: '可领取的会员类型:0->无限制不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
options2: [{
|
||||
value: 0,
|
||||
label: '商品'
|
||||
},{
|
||||
value: 1,
|
||||
label: '电子书'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/coupon/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.type = data.coupon.type
|
||||
this.dataForm.name = data.coupon.name
|
||||
this.dataForm.platform = data.coupon.platform
|
||||
this.dataForm.count = data.coupon.count
|
||||
this.dataForm.amount = data.coupon.amount
|
||||
this.dataForm.perLimit = data.coupon.perLimit
|
||||
this.dataForm.minPoint = data.coupon.minPoint
|
||||
this.dataForm.startTime = data.coupon.startTime
|
||||
this.dataForm.endTime = data.coupon.endTime
|
||||
this.dataForm.useType = data.coupon.useType
|
||||
this.dataForm.note = data.coupon.note
|
||||
this.dataForm.publishCount = data.coupon.publishCount
|
||||
this.dataForm.useCount = data.coupon.useCount
|
||||
this.dataForm.receiveCount = data.coupon.receiveCount
|
||||
this.dataForm.enableTime = data.coupon.enableTime
|
||||
this.dataForm.code = data.coupon.code
|
||||
this.dataForm.memberLevel = data.coupon.memberLevel
|
||||
|
||||
this.startTime = [this.dataForm.startTime,this.dataForm.endTime]
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
],
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '现金券'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '折扣券'
|
||||
}],
|
||||
|
||||
dialogVisible:false,
|
||||
fileList: [], // 封面图
|
||||
dataForm: {
|
||||
couponType:null,
|
||||
couponProType:null, // 使用商品类型
|
||||
useLevel:null, // 使用门槛
|
||||
id: 0,
|
||||
couponName:'',
|
||||
couponAmount:null,
|
||||
couponUrl:'',
|
||||
limitedCollar:null,
|
||||
validity:'',
|
||||
takeEffectType: null, // 生效方式
|
||||
takeEffectDate:null,
|
||||
totalCirculation:null,
|
||||
remark:''
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/coupon/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'type': this.dataForm.type,
|
||||
'name': this.dataForm.name,
|
||||
'platform': this.dataForm.platform,
|
||||
'count': this.dataForm.count,
|
||||
'amount': this.dataForm.amount,
|
||||
'perLimit': this.dataForm.perLimit,
|
||||
'minPoint': this.dataForm.minPoint,
|
||||
'startTime': this.startTime[0],
|
||||
'endTime': this.startTime[1],
|
||||
'useType': this.dataForm.useType,
|
||||
'note': this.dataForm.note,
|
||||
'publishCount': this.dataForm.publishCount,
|
||||
'useCount': this.dataForm.useCount,
|
||||
'receiveCount': this.dataForm.receiveCount,
|
||||
'enableTime': this.dataForm.enableTime,
|
||||
'code': this.dataForm.code,
|
||||
'memberLevel': this.dataForm.memberLevel
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
dataRule: {
|
||||
couponType: [
|
||||
{ required: true, message: '请填写本项', trigger: 'blur' }
|
||||
],
|
||||
couponName: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
couponAmount: [
|
||||
{ required: true, message: '优惠券面额不能为空', trigger: 'blur' }
|
||||
],
|
||||
takeEffectType: [
|
||||
{ required: true, message: '生效方式不能为空', trigger: 'blur' }
|
||||
],
|
||||
validity: [
|
||||
{ required: true, message: '时效不能为空', trigger: 'blur' }
|
||||
],
|
||||
couponProType: [
|
||||
{ required: true, message: '商品类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
useLevel: [
|
||||
{ required: true, message: '使用门槛;0表示无门槛', trigger: 'blur' }
|
||||
],
|
||||
// startTime: [
|
||||
// { required: true, message: '开始使用时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// endTime: [
|
||||
// { required: true, message: '结束使用时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// useType: [
|
||||
// { required: true, message: '使用类型:0->全场通用;1->指定分类;2->指定商品不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// note: [
|
||||
// { required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// publishCount: [
|
||||
// { required: true, message: '发行数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// useCount: [
|
||||
// { required: true, message: '已使用数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// receiveCount: [
|
||||
// { required: true, message: '领取数量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// enableTime: [
|
||||
// { required: true, message: '可以领取的日期不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// code: [
|
||||
// { required: true, message: '优惠码不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// memberLevel: [
|
||||
// { required: true, message: '可领取的会员类型:0->无限制不能为空', trigger: 'blur' }
|
||||
// ]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/coupon/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.id = data.coupon.id
|
||||
this.dataForm.couponType = data.coupon.couponType
|
||||
this.dataForm.couponName = data.coupon.couponName
|
||||
this.dataForm.couponAmount = data.coupon.couponAmount
|
||||
this.dataForm.limitedCollar = data.coupon.limitedCollar
|
||||
this.dataForm.validity = data.coupon.validity
|
||||
this.dataForm.takeEffectType = data.coupon.takeEffectType
|
||||
this.dataForm.takeEffectDate = data.coupon.takeEffectDate
|
||||
this.dataForm.totalCirculation = data.coupon.totalCirculation
|
||||
this.dataForm.remark = data.coupon.remark
|
||||
this.dataForm.useLevel = data.coupon.useLevel,
|
||||
this.dataForm.couponProType = data.coupon.couponProType
|
||||
// this.dataForm.couponUrl = {name:'', url:}
|
||||
if (data.coupon.couponUrl != "") {
|
||||
var img = { name: '', url: data.coupon.couponUrl }
|
||||
var attr = []
|
||||
attr.push(img)
|
||||
this.fileList = attr
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.couponUrl = res.url;
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.dataForm.couponUrl = '';
|
||||
},
|
||||
handlePictureCardPreview(file) {
|
||||
this.dataForm.couponUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
datePicked(){
|
||||
console.log(this.dataForm.startTime)
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/coupon/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'couponType':this.dataForm.couponType,
|
||||
'couponName':this.dataForm.couponName,
|
||||
'couponAmount' :this.dataForm.couponAmount,
|
||||
'couponUrl': this.dataForm.couponUrl,
|
||||
'limitedCollar' :this.dataForm.limitedCollar,
|
||||
'validity' :this.dataForm.validity,
|
||||
'takeEffectType' :this.dataForm.takeEffectType,
|
||||
'takeEffectDate' :this.dataForm.takeEffectDate,
|
||||
'totalCirculation' :this.dataForm.totalCirculation,
|
||||
'remark':this.dataForm.remark ,
|
||||
'useLevel' : this.dataForm.useLevel,
|
||||
'couponProType' : this.dataForm.couponProType,
|
||||
'currentState' : '1',
|
||||
'delFlag':0
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
|
||||
}}
|
||||
</style>
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-radio-group size="mini" v-model="couponActiveName" style="margin-bottom: 15px;" @tab-click="handleClick">
|
||||
<el-radio-button label="0">全部</el-radio-button>
|
||||
<el-radio-button label="1">生效中</el-radio-button>
|
||||
<el-radio-button label="2">已过期</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-input size="mini" v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('book:coupon:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('book:coupon:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
<el-button size="mini" @click="getDataList()">查询</el-button>
|
||||
<el-button size="mini" v-if="isAuth('book:coupon:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<!-- <el-button v-if="isAuth('book:coupon:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
@@ -26,110 +31,54 @@
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="序号">
|
||||
label="序号" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
prop="couponName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="优惠券名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
prop="couponType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="优惠卷类型">
|
||||
</el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.couponProType == 0">商品用券</span>
|
||||
<span v-if="scope.row.couponProType == 1">电子书用券</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="platform"
|
||||
prop="couponAmount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="使用平台">
|
||||
</el-table-column>
|
||||
label="面值">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="count"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="amount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="金额">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="perLimit"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="每人限领张数">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="minPoint"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="使用门槛">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="startTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="开始使用时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="endTime"
|
||||
prop="expirationDate"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="结束使用时间">
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="useType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="使用类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="note"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="publishCount"
|
||||
prop="totalCirculation"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="发行数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
prop="useCount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="已使用数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column
|
||||
prop="receiveCount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="领取数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enableTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="可以领取的日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="优惠码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="memberLevel"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="可领取的会员类型">
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
@@ -138,7 +87,7 @@
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
<!-- <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -164,6 +113,7 @@
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
couponActiveName:'0',
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
@@ -180,6 +130,9 @@
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
handleClick(){
|
||||
console.log(this.couponActiveName)
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
@@ -189,7 +142,8 @@
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
'key': this.dataForm.key,
|
||||
'currentState': this.couponActiveName
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
@@ -254,6 +208,13 @@
|
||||
})
|
||||
})
|
||||
}
|
||||
},watch:{
|
||||
couponActiveName: {
|
||||
handler(val, oldVal) {
|
||||
this.getDataList()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
189
src/views/modules/coupon/pubilc-coupon-list.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<el-dialog title="选择优惠券" center :visible.sync="visible" :before-close="handleClose">
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="sedSelectCou">确 定</el-button>
|
||||
</span>
|
||||
<el-table ref="multipleTable"
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="couponName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="优惠券名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="couponAmount"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="面值">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column header-align="center" align="center" label="商品图">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="30" height="30" class="tableImg" />
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
deliverOrder: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataForm:{
|
||||
key:''
|
||||
},
|
||||
selectTitle:'',
|
||||
oldSelected:[],
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
}
|
||||
},
|
||||
create(){
|
||||
|
||||
},
|
||||
mounted(){
|
||||
// console.log(454545)
|
||||
this.$bus.$on("ProListVisible", (val) => {
|
||||
this.visible = true
|
||||
});
|
||||
this.$bus.$on("getCouListInMes", (data) => {
|
||||
this.oldSelected = data.List
|
||||
console.log(this.oldSelected, 'oldSelected')
|
||||
|
||||
});
|
||||
},methods:{
|
||||
// 判断初始选中的产品
|
||||
check(){
|
||||
// console.log(this.oldSelected,'check')
|
||||
if(this.oldSelected.length > 0){
|
||||
this.dataList.forEach((item) => {
|
||||
this.oldSelected.forEach((item2) => {
|
||||
if(item.id == item2.id){
|
||||
this.dataListSelections.push(item)
|
||||
this.$refs.multipleTable.toggleRowSelection(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(this.dataListSelections, 'dataListSelections')
|
||||
}
|
||||
},
|
||||
handleClose(){
|
||||
this.$emit("CouponListClose", false);
|
||||
},
|
||||
sedSelectCou(){
|
||||
// console.log(this.dataListSelections)
|
||||
this.$bus.$emit('haveSelectedCoupon', this.dataListSelections)
|
||||
this.handleClose()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/coupon/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key,
|
||||
'currentState': "0"
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
this.$nextTick(()=> {
|
||||
this.check() // 获取到已选中的数据
|
||||
|
||||
})
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
|
||||
}}
|
||||
.pictureList{
|
||||
/deep/.el-upload--picture{ display: none;}
|
||||
/deep/ .el-upload-list{ display: flex; justify-content:space-between; flex-wrap: wrap;
|
||||
.el-upload-list__item{
|
||||
width:30%; padding: 5px 5px 5px 87px; height: 66px;
|
||||
img{width: 54px; height: 54px;}
|
||||
.el-upload-list__item-name{line-height: 54px;}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
56
src/views/modules/order/anyDialog.vue
Normal file
@@ -0,0 +1,56 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog class="anyDialog" :title="`${title}`" :close-on-click-modal="false" :visible.sync="visible" width='500px'
|
||||
:before-close="beforeCloseDialog">
|
||||
<div class="textBody" v-html="content"></div>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="beforeCloseDialog">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'printOrderDialog',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
title:{
|
||||
type:String,
|
||||
value:''
|
||||
},
|
||||
content: {
|
||||
type: String,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDialog', false)
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.content {
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.el-step {
|
||||
font-size: 20px;
|
||||
vertical-align: middle;
|
||||
line-height: 0;
|
||||
}
|
||||
</style>
|
||||
1099
src/views/modules/order/buyorder copy-订单列表样式备份02-09.vue
Normal file
@@ -151,7 +151,7 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
init (id) {
|
||||
this.dataForm.orderId = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
|
||||
562
src/views/modules/order/buyorder-mergeorder.vue
Normal file
@@ -0,0 +1,562 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="ruleForm.list.length == 0"
|
||||
style="display: flex; height:300px; width: 100%; align-items: center; justify-content: center;">
|
||||
<div class="empty" style="text-align: center;">
|
||||
<icon-svg style="font-size: 130px;" name="kongbai"></icon-svg>
|
||||
<div style="color: #999;">当前暂无可合并发货的订单哦</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-form v-else ref="ruleForm" :model="ruleForm" label-width="80px" :rules="rules">
|
||||
<div class="order_list_ui">
|
||||
<div style="">
|
||||
<el-radio-group class="group3" v-model="radio3" size="mini" @change="radioChange">
|
||||
<el-radio-button label="allYse">全合并</el-radio-button>
|
||||
<el-radio-button label="allNo">全不合并</el-radio-button>
|
||||
<el-button type="primary" size="mini" @click="submit" :disabled="buttonDisable">批量合并发货</el-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<ul style="height: 500px; overflow-y:scroll;">
|
||||
<li class="flexbox " v-for="(de, index) in ruleForm.list" :key="index"
|
||||
style="border:1px solid #CFF3ED; margin-bottom: 5px;">
|
||||
<div class="flexbox" style="align-items: center; padding: 0 10px; width: 34px; border-right: 1px solid #CFF3ED;">
|
||||
<el-form-item label-width="0" :prop="`list.${index}.isMerge`" :rules="[
|
||||
{ required: true, message: '此项为必填项', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="de.isMerge" size="mini">
|
||||
<div>
|
||||
<el-radio label="true"><br/></el-radio>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<el-radio label="false">不合并</el-radio>
|
||||
</div> -->
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="buierInfo flexbox">
|
||||
<div style="width:180px; ">
|
||||
<div style="padding: 10px;" class="">
|
||||
<div><span class="infoTitle">用户名:</span><span>{{ de.userName }}</span></div>
|
||||
<div><span class="infoTitle">电话:</span><span>{{ de.tel }}</span></div>
|
||||
<div><span class="infoTitle">收货地址:</span><span>{{ de.address }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="productInfo" style="width:80%;">
|
||||
<div class="item" v-for="(item, orderindex) in de.orderList" :key="orderindex">
|
||||
<div class="item_head">
|
||||
<el-row>
|
||||
<el-col :span="24" style="display: flex; justify-content: space-between;">
|
||||
<span>订单编号: {{ item.orderSn }}</span>
|
||||
<el-button style="margin: 0; padding: 0;" type="text"
|
||||
@click="removeOrder(orderindex, index)">移除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="item_body">
|
||||
<div class="flexbox" style="justify-content: space-between;">
|
||||
<div class="td1 flexbox" style="width:100%; ">
|
||||
<div class="flexbox orderProducts" style="width:25%;"
|
||||
:class="{ nobottomBorder: item.products.length <= 4 }"
|
||||
v-for="(productitem, productindex) in item.products"
|
||||
:key="productindex">
|
||||
<div class="flexbox productItem" style="width:100%;">
|
||||
<!-- <el-checkbox :label="4545454545"></el-checkbox> -->
|
||||
<img :src="productitem.image" width="30px" height="30px">
|
||||
<div class="">
|
||||
<div class="bookName tabContent">{{ productitem.productName }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="num xcenter"><span>× {{ productitem.quantity }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style=" padding: 10px;" class="buttonBox flexbox">
|
||||
<div>
|
||||
<!-- <div style="margin-bottom: 10px;"><span style="color: #f56c6c;">*</span> 是否合并当前可合并项?
|
||||
</div> -->
|
||||
|
||||
<el-button type="warning" size="mini" plain
|
||||
@click="mergeOne(de.orderList, index)">合并发货</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="buttons">
|
||||
<el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
||||
:current-page="pageIndex" :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-form>
|
||||
<setDeliverDialog ref="setDeliverDialog" :visible="setDeliverVisible" :selectData="merOneList"
|
||||
@closeDeliverDialog='closeDeliverDialog'></setDeliverDialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import setDeliverDialog from './set-deliver-dialog'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
merOneList: [],
|
||||
buttonDisable:true,
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
// form: {
|
||||
// deliverLcd: ''
|
||||
// },
|
||||
setDeliverVisible: false,
|
||||
radio3: '',
|
||||
expressList: [],
|
||||
// dataRule: {
|
||||
// deliverLcd: [
|
||||
// { required: true, message: '请先选择物流公司', trigger: 'blur' }
|
||||
// ]
|
||||
// },
|
||||
ruleForm: {
|
||||
list: []
|
||||
},
|
||||
// 批量合并发货
|
||||
multMergeIdList:[],
|
||||
rules: {
|
||||
ruleForm: [
|
||||
{ required: true, message: '必填项', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getExpressList()
|
||||
this.getMergeOrders()
|
||||
},
|
||||
methods: {
|
||||
// 获取快递公司列表
|
||||
getExpressList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/express_name'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
// console.log(data, '快递列表')
|
||||
this.expressList = data.dataList
|
||||
})
|
||||
},
|
||||
// 获取可合并订单
|
||||
getMergeOrders() {
|
||||
let loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在查询,请稍后',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/checkOrder`),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
// console.log('订单发货前的检查')
|
||||
// this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
loading.close()
|
||||
this.ruleForm.list = data.page.records
|
||||
console.log(this.ruleForm.list)
|
||||
//this.mergeDliverVisible = true
|
||||
} else {
|
||||
this.ruleForm.list = []
|
||||
this.totalPage = 0
|
||||
loading.close()
|
||||
this.$message.error('请求失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
// 移除订单
|
||||
removeOrder(orderindex, listindex) {
|
||||
// order: 订单信息
|
||||
// orderindex: 订单下标
|
||||
// listindex:上级下标
|
||||
//addr.splice(i, 1)
|
||||
// 判断是否剩余订单数小于2 小于2 就整条都删除
|
||||
|
||||
if (this.ruleForm.list[listindex].orderList.length <= 2) {
|
||||
console.log(this.ruleForm.list)
|
||||
this.ruleForm.list.splice(listindex, 1)
|
||||
} else {
|
||||
console.log(this.ruleForm.list)
|
||||
this.ruleForm.list[listindex].orderList.splice(orderindex, 1)
|
||||
console.log()
|
||||
}
|
||||
},
|
||||
closeDeliverDialog(val) {
|
||||
this.setDeliverVisible = false
|
||||
this.getMergeOrders()
|
||||
},
|
||||
// 单个合并订单发货
|
||||
mergeOne(list, index) {
|
||||
// console.log(list)
|
||||
this.merOneList = list.map(item => {
|
||||
return item.orderId
|
||||
})
|
||||
console.log(this.merOneList)
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('正在进行合并发货, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.setDeliverVisible = true
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
return this.$message.error('请核对必填项')
|
||||
}
|
||||
})
|
||||
},
|
||||
radioChange(val){
|
||||
// console.log(this.ruleForm.list)
|
||||
if(val == 'allNo'){
|
||||
this.ruleForm.list.forEach(element => {
|
||||
element.isMerge = 'false'
|
||||
});
|
||||
this.buttonDisable = true
|
||||
console.log(this.ruleForm.list)
|
||||
}
|
||||
if(val == 'allYse'){
|
||||
// console.log('全选')
|
||||
this.buttonDisable = false
|
||||
this.ruleForm.list.forEach(element => {
|
||||
element.isMerge = 'true'
|
||||
});
|
||||
console.log(this.ruleForm.list)
|
||||
}
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getMergeOrders()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
this.getMergeOrders()
|
||||
},
|
||||
submit() {
|
||||
// 表单验证
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// console.log(4545)
|
||||
this.ruleForm.list.forEach((item, index) => {
|
||||
let list = []
|
||||
list = item.orderList.map((element) => {
|
||||
return element.orderId
|
||||
})
|
||||
this.multMergeIdList = this.multMergeIdList.concat(list)
|
||||
})
|
||||
console.log(this.multMergeIdList)
|
||||
this.merOneList = this.multMergeIdList
|
||||
this.setDeliverVisible = true
|
||||
// console.log(this.merOneList)
|
||||
} else {
|
||||
return this.$message.error('请核对必填项')
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
components:{
|
||||
setDeliverDialog
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.infoTitle {
|
||||
color: #777;
|
||||
display: inline-block;
|
||||
width: 62px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-radio-button {
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
/deep/ .el-dialog__footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.order_list_ui {
|
||||
margin-top: 15px;
|
||||
|
||||
* {
|
||||
font-size: 12px;
|
||||
//color: #777;
|
||||
}
|
||||
|
||||
ul {
|
||||
color: #515a6e;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
width: 100%;
|
||||
// margin-bottom: 10px;
|
||||
|
||||
.item_head {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
|
||||
// border-right: none !important;
|
||||
background-color: #edf9f8;
|
||||
|
||||
.el-checkbox__label {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tip {
|
||||
text-align: right;
|
||||
|
||||
.el-button {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.item_body {
|
||||
// border: 1px solid #ddf6f3;
|
||||
border-top: none;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.productInfo {
|
||||
border-left: 1px solid #CFF3ED;
|
||||
border-right: 1px solid #CFF3ED;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.orderProducts {
|
||||
padding: 4px;
|
||||
border-right: 1px solid #CFF3ED;
|
||||
border-bottom: 1px solid #CFF3ED;
|
||||
|
||||
.price {
|
||||
width: 40px;
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.num {
|
||||
width: 40px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.productItem {
|
||||
overflow: hidden;
|
||||
|
||||
.flexbox {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.el-checkbox__label {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.xcenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.borderright {
|
||||
padding-left: 10px;
|
||||
border-right: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.normal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hasDeliver {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-image: url(../../../../static/img/hasDeliver_icon.png);
|
||||
}
|
||||
|
||||
.td1 {
|
||||
|
||||
// width: 400px;
|
||||
.orderProducts {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
img {
|
||||
margin-right: 10px;
|
||||
padding: 2px;
|
||||
border: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.bookName {
|
||||
//margin-right: 10px;
|
||||
font-size: 12px;
|
||||
line-height: 22px;
|
||||
margin-left: -6px;
|
||||
-webkit-transform: scale(0.9);
|
||||
}
|
||||
|
||||
.author {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.td2 {
|
||||
width: 150px;
|
||||
line-height: 26px;
|
||||
padding: 5px;
|
||||
|
||||
em {
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
color: #48C9B0;
|
||||
}
|
||||
}
|
||||
|
||||
.tabName {
|
||||
color: #999;
|
||||
margin-bottom: -3px;
|
||||
}
|
||||
|
||||
.tabContent {
|
||||
line-height: 26px;
|
||||
-webkit-transform: scale(0.9);
|
||||
}
|
||||
|
||||
.td3 {
|
||||
padding: 5px;
|
||||
line-height: 24px;
|
||||
width: 200px;
|
||||
|
||||
.buier_tip {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.td4 {
|
||||
padding: 5px;
|
||||
width: 200px;
|
||||
line-height: 24px;
|
||||
|
||||
.time {
|
||||
color: #999
|
||||
}
|
||||
|
||||
.orderStatus {
|
||||
color: #ec6565;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.td5 {
|
||||
padding: 5px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.orderProducts:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.hasSplit {
|
||||
background-color: #fffae8;
|
||||
border: 1px solid #ffedd6;
|
||||
|
||||
.el-button {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.buttonGroup {
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.deliverName {
|
||||
margin-bottom: px;
|
||||
}
|
||||
|
||||
.paper_list_ui {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.buttonBox {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.fengbi {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.buierInfo {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.nobottomBorder {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
/deep/ .el-pagination {
|
||||
float: right;
|
||||
margin-top: 0;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-radio-button:last-child .el-radio-button__inner{border-radius: 0 4px 4px 0 !important;}
|
||||
</style>
|
||||
289
src/views/modules/order/buyorder-print.vue
Normal file
@@ -0,0 +1,289 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<!-- 订单详细更新 -->
|
||||
<div>
|
||||
<ul>
|
||||
<li class="line"></li>
|
||||
<div class="liName">订单信息</div>
|
||||
<li><span class="infoTitle">订单ID:</span><span>{{orderDetails.orderSn}}</span></li>
|
||||
|
||||
|
||||
<li class="line"></li>
|
||||
<br>
|
||||
<div class="liName">面单信息</div>
|
||||
<!-- <el-alert title="`该订单下共有 2 条物流信息`" type="info">
|
||||
</el-alert> -->
|
||||
<li class="flexbox deliverBox" style="width: 100%; padding-bottom: 50px;">
|
||||
<el-row :gutter="20" >
|
||||
<el-col :md="8" :lg="8" class="item" v-for="(item, index) in orderDetails.products">
|
||||
<div class="deliver_heade">
|
||||
<div><span class="infoTitle">物流公司:</span><span>{{item.shipperName}}</span></div>
|
||||
<div><span class="infoTitle">运单号:</span><span>{{item.shippingSn}}</span></div>
|
||||
<div class="deliver_info">
|
||||
<div v-html="item.fmsHtml" style="zoom: 70%;"></div>
|
||||
<div class="buttonceng flexbox" style="height:40px ;">
|
||||
<el-button size="mini" plain type="primary" @click="printHandle(item)">打印面单</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<div class="box" style="display: none;">
|
||||
<div>
|
||||
<ul id="">
|
||||
<li v-for="(item,index) of printArr" :key="index" v-html="item"
|
||||
:id="'printDiv' + index" style="page-break-after:always;">
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
query: {
|
||||
orderId: 0
|
||||
},
|
||||
|
||||
orderDetails:{},
|
||||
printArr:[]
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.getData()
|
||||
},
|
||||
activated() {
|
||||
this.query.orderId = this.$route.query.orderId;
|
||||
console.log(this.$route.query.orderId)
|
||||
this.getData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取订单详情
|
||||
getData() {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorder/appGetOrderInfo'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'orderId': this.query.orderId,
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.orderDetails = data.buyOrder
|
||||
} else {
|
||||
// this.dataList = []
|
||||
// this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 打印面单
|
||||
printHandle(item) {
|
||||
//console.log(item)
|
||||
//this.printDialogVisible = true
|
||||
this.$confirm(`是否确定打印所选面单?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
//console.log(item)
|
||||
this.printArr.push(item.fmsHtml)
|
||||
console.log(this.printArr)
|
||||
setTimeout(() => {
|
||||
this.handlePrint()
|
||||
}, 1000);
|
||||
setTimeout(() => {
|
||||
this.printArr = []
|
||||
}, 1000);
|
||||
|
||||
// 修改运单状态
|
||||
this.setPrint(item.shippingSn)
|
||||
|
||||
|
||||
}).catch()
|
||||
},
|
||||
setPrint(shippingCode){
|
||||
var shippingIds = [shippingCode]
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorderdetail/batchUpdateByShippingSns'),
|
||||
method: 'post',
|
||||
data: shippingIds
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
// console.log(data)
|
||||
return this.$message.success('已打印')
|
||||
} else {
|
||||
return this.$message.success('打印失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
handlePrint() {
|
||||
var newWin = window.open(""); //新打开一个空窗口
|
||||
for (var i = 0; i < this.printArr.length; i++) {
|
||||
var imageToPrint = document.getElementById("printDiv0"); //获取需要打印的内容
|
||||
newWin.document.write(imageToPrint.outerHTML); //将需要打印的内容添加进新的窗口
|
||||
}
|
||||
const styleSheet = `<style>li{list-style:none;}</style>`;
|
||||
newWin.document.head.innerHTML = styleSheet; //给打印的内容加上样式
|
||||
newWin.document.close(); //在IE浏览器中使用必须添加这一句
|
||||
newWin.focus(); //在IE浏览器中使用必须添加这一句
|
||||
setTimeout(function () {
|
||||
newWin.print(); //打印
|
||||
newWin.close(); //关闭窗口
|
||||
}, 100);
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
.deliver_info:hover::before{
|
||||
display:block !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
.noinfo {
|
||||
color: #ddd;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
.scroll{margin-top: 15px; height: auto;}
|
||||
.deliverBox{
|
||||
flex-wrap: wrap; justify-content: space-between;
|
||||
.item{padding-right: 15px; min-width: 300px;
|
||||
.deliver_heade{margin-top: 15px;}
|
||||
}
|
||||
}
|
||||
.el-timeline{
|
||||
li{
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
.deliver_info{position: relative; overflow: hidden; padding-top: 10px;}
|
||||
.deliver_info:hover{
|
||||
:before{display:block !important;}
|
||||
.buttonceng{visibility: visible;}
|
||||
}
|
||||
|
||||
.buttonceng{position: absolute; z-index: 3; top: calc(50% - 30px); left: calc(50% - 50px); visibility: hidden;}
|
||||
.deliver_info::before{display:none; position:absolute; left: 0; top: 0; width: 100%; height: 100%; content: '';
|
||||
background-color: rgba(255 , 255, 255, 0.9);z-index: 2;}
|
||||
.infoTitle {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
ul {
|
||||
overflow: hidden;
|
||||
color: #515a6e;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
width: 50%;
|
||||
line-height: 26px;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
|
||||
}
|
||||
|
||||
.hightLight {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.liName {
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text_button {
|
||||
padding: 0;
|
||||
}
|
||||
.el-icon-truck:before {
|
||||
content: "\e740";
|
||||
}
|
||||
|
||||
.el-timeline-item:first-child {
|
||||
.el-timeline-item__node {
|
||||
background-color: rgb(11, 189, 135);
|
||||
}
|
||||
}
|
||||
|
||||
.el-timeline-item {
|
||||
position: relative;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--large {
|
||||
left: -2px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node {
|
||||
position: absolute;
|
||||
background-color: #e4e7ed;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--normal {
|
||||
left: -1px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.el-timeline-item__wrapper {
|
||||
position: relative;
|
||||
padding-left: 28px;
|
||||
top: -3px;
|
||||
}
|
||||
|
||||
.el-timeline li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__tail {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
height: 100%;
|
||||
border-left: 2px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.el-timeline .el-timeline-item:last-child .el-timeline-item__tail {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__timestamp {
|
||||
color: #c3c3c3;
|
||||
font-size: 14px;
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,217 +1,334 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('book:buyorderdetail:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('book:buyorderdetail:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<!-- 订单详细更新 -->
|
||||
<div>
|
||||
<ul>
|
||||
<div class="liName">用户信息</div>
|
||||
<li><span class="infoTitle">用户名:</span><span>{{orderDetails.userName}}</span></li>
|
||||
<li><span class="infoTitle">用户ID:</span><span>{{orderDetails.userId}}</span></li>
|
||||
<li><span class="infoTitle">联系电话:</span><span>{{orderDetails.userPhone}}</span></li>
|
||||
<li><span class="infoTitle">收货地址:</span><span>{{orderDetails.province}}-{{orderDetails.city}}-{{orderDetails.district}}-{{orderDetails.address}}</span></li>
|
||||
<!-- <li><span class="infoTitle">电 话:</span><span>187898544875</span></li> -->
|
||||
<!-- <li><span class="infoTitle">地 址:</span><span>天津市天津市天津市天津市天津市天津市</span></li> -->
|
||||
<li class="line"></li>
|
||||
<div class="liName">订单信息</div>
|
||||
<li><span class="infoTitle">订单ID:</span><span>{{orderDetails.orderSn}}</span></li>
|
||||
<li><span class="infoTitle">订单状态:</span>
|
||||
<span v-if="orderDetails.orderStatus == 0" class="hightLight">待付款</span>
|
||||
<span v-if="orderDetails.orderStatus == 1" class="hightLight">待发货</span>
|
||||
<span v-if="orderDetails.orderStatus == 2" class="hightLight">已发货</span>
|
||||
<span v-if="orderDetails.orderStatus == 3" class="hightLight">已完成</span>
|
||||
<el-button v-if="orderDetails.orderStatus == 1" @click="godeliver" class="text_button" size="mini" type="text">去发货</el-button>
|
||||
</li>
|
||||
<!-- <li><span class="infoTitle">商品总数:</span><span>{{orderDetails.}}</span></li> -->
|
||||
<li><span class="infoTitle">订单总金额:</span><span>{{orderDetails.realMoney}}</span></li>
|
||||
<li><span class="infoTitle">交付邮费:</span><span>¥{{orderDetails.shippingMoney}}</span></li>
|
||||
<li><span class="infoTitle">优惠金额:</span><span>¥0.00</span></li>
|
||||
<li><span class="infoTitle">会员商品优惠:</span><span>¥0.00</span></li>
|
||||
<li><span class="infoTitle">积分抵扣:</span><span>¥0.00</span></li>
|
||||
<li><span class="infoTitle">实际支付金额:</span><span>¥112</span></li>
|
||||
<li><span class="infoTitle">创建时间:</span><span>{{orderDetails.createTime}}</span></li>
|
||||
<li><span class="infoTitle">支付时间:</span><span>{{orderDetails.paymentDate}}</span></li>
|
||||
<li style="width: 100%;"><span class="infoTitle">支付方式:</span>
|
||||
<span v-if="orderDetails.paymentMethod == 1"><icon-svg name="zhifubao"></icon-svg> <span>支付宝支付</span></span>
|
||||
<span v-if="orderDetails.paymentMethod == 2"><icon-svg name="weixin"></icon-svg> <span>微信支付</span></span>
|
||||
<span v-if="orderDetails.paymentMethod == 3">
|
||||
<!-- <icon-svg name="zhifubao"></icon-svg> -->
|
||||
<span>IOS内购</span>
|
||||
</span>
|
||||
</li>
|
||||
<li class="line"></li>
|
||||
<br>
|
||||
<div class="liName">物流信息</div>
|
||||
<!-- <el-alert title="`该订单下共有 2 条物流信息`" type="info">
|
||||
</el-alert> -->
|
||||
<li class="flexbox deliverBox" style="width: 100%;">
|
||||
<el-row :gutter="20" style="100%">
|
||||
|
||||
<el-col v-if="activities != []" :md="12" :lg="8" class="item" v-for="(item, index) in activities" :key="index">
|
||||
<div class="deliver_heade">
|
||||
|
||||
<div><span class="infoTitle">物流公司:</span><span>{{item.ShipperName}}</span></div>
|
||||
<div><span class="infoTitle">运单号:</span><span>{{item.LogisticCode}}</span></div>
|
||||
<div class="deliver_info">
|
||||
<div class="scroll" style="padding: 10px;" v-if="item.Traces != []">
|
||||
<el-timeline>
|
||||
<el-timeline-item :reverse="reverse" v-for="(activity, index2) in item.Traces" :key="index2" :icon="activity.icon"
|
||||
:type="activity.Action" :color="activity.color" :size="activity.size"
|
||||
:timestamp="activity.AcceptTime">
|
||||
{{ activity.AcceptStation }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
<div v-else class="noinfo">-暂无物流信息-</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</li>
|
||||
|
||||
<li class="line" style="margin:10px 0;"></li>
|
||||
<!-- 订单商品 -->
|
||||
<div class="liName">商品信息</div>
|
||||
<el-table :data="orderDetails.products"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
label="商品名"
|
||||
width="280">
|
||||
<template slot-scope="scope">
|
||||
<div class="flexbox">
|
||||
<img style="padding: 2px; border:1px solid #f1f1f1; margin-right: 5px;" :src="scope.row.image" width="30px" height="30px">
|
||||
<div class="proname">{{ scope.row.productName}}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="allOrderId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="订单详情id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="orderId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="订单表id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="userId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="用户id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品名称">
|
||||
prop="productPrice"
|
||||
label="价格"
|
||||
width="180">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="quantity"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productPrice"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品单价">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="weight"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品重量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品类型">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="creatTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="下单时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.allOrderId)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.allOrderId)">删除</el-button>
|
||||
</template>
|
||||
label="数量" width="80">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> -->
|
||||
<setDeliverDialog ref="setDeliverDialog" :visible="setDeliverVisible" :selectData="orderList"
|
||||
@closeDeliverDialog='closeDeliverDialog'></setDeliverDialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './buyorderdetail-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
query:{
|
||||
orderId:0
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
this.query.orderId = this.$route.query.orderId;
|
||||
console.log(this.$route.query.orderId)
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorderdetail/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'orderId': this.query.orderId,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
import AddOrUpdate from './buyorderdetail-add-or-update'
|
||||
import setDeliverDialog from './set-deliver-dialog'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderList:[],
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
reverse: false,
|
||||
activities: [ ],
|
||||
deliverData: [], // 物流信息
|
||||
|
||||
setDeliverVisible: false,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
// addOrUpdateVisible: false,
|
||||
query: {
|
||||
orderId: 0,
|
||||
ordertype:null
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.allOrderId
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorderdetail/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
orderDetails:{}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated() {
|
||||
this.query.orderId = this.$route.query.orderId;
|
||||
this.query.ordertype = this.$route.query.ordertype;
|
||||
console.log(this.$route.query.orderId)
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
// 获取 物流
|
||||
getdeliverDetails(){
|
||||
let loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在获取物流信息...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorder/queryFMS'),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
'orderId': this.query.orderId
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if(data && data.code === 0){
|
||||
if(data.rntStr != []){
|
||||
this.activities = data.rntStr
|
||||
// console.log(this.activities)
|
||||
}else{
|
||||
this.activities = []
|
||||
}
|
||||
loading.close()
|
||||
}else{
|
||||
loading.close()
|
||||
return this.$message.error('物流获取失败,请重试')
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
// 获取数据列表
|
||||
getData() {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/appGetOrderInfo/${this.query.ordertype}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'orderId': this.query.orderId,
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.orderDetails = data.buyOrder
|
||||
if(this.query.ordertype != 0){ // 不是待付款订单时
|
||||
this.getdeliverDetails()
|
||||
}
|
||||
} else {
|
||||
this.orderDetails = {}
|
||||
return this.$message.error('商品详情获取失败,请重试')
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
closeDeliverDialog(val) {
|
||||
this.setDeliverVisible = false
|
||||
this.getData()
|
||||
},
|
||||
// 去发货
|
||||
godeliver() {
|
||||
this.orderList[0] = this.query.orderId
|
||||
this.setDeliverVisible = true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
setDeliverDialog
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.noinfo {
|
||||
color: #ddd;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
.scroll{margin-top: 15px; height: 300px;}
|
||||
.deliverBox{
|
||||
flex-wrap: wrap; justify-content: space-between;
|
||||
.item{padding-right: 15px; min-width: 300px;
|
||||
.deliver_heade{margin-top: 15px;}
|
||||
}
|
||||
}
|
||||
.el-timeline{
|
||||
li{
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
.deliver_info{border-radius: 10px;}
|
||||
.infoTitle {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
ul {
|
||||
overflow: hidden;
|
||||
color: #515a6e;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
width: 50%;
|
||||
line-height: 26px;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
|
||||
}
|
||||
|
||||
.hightLight {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.liName {
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text_button {
|
||||
padding: 0;
|
||||
}
|
||||
.el-icon-truck:before {
|
||||
content: "\e740";
|
||||
}
|
||||
|
||||
.el-timeline-item:first-child {
|
||||
.el-timeline-item__node {
|
||||
background-color: rgb(11, 189, 135);
|
||||
}
|
||||
}
|
||||
|
||||
.el-timeline-item {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--large {
|
||||
left: -2px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node {
|
||||
position: absolute;
|
||||
background-color: #e4e7ed;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--normal {
|
||||
left: -1px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.el-timeline-item__wrapper {
|
||||
position: relative;
|
||||
padding-left: 28px;
|
||||
top: -3px;
|
||||
}
|
||||
|
||||
.el-timeline li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__tail {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
height: 100%;
|
||||
border-left: 2px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.el-timeline .el-timeline-item:last-child .el-timeline-item__tail {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__timestamp {
|
||||
color: #c3c3c3;
|
||||
font-size: 14px;
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
132
src/views/modules/order/deliver-detail.vue
Normal file
@@ -0,0 +1,132 @@
|
||||
<template>
|
||||
<el-dialog v-if="deliverOrder" title="物流详情" :close-on-click-modal="false" :visible.sync="visible"
|
||||
:before-close="beforeCloseDialog" width="80%">
|
||||
<!-- <div class="content" >
|
||||
<el-button type="primary" size="small" onclick="">确定</el-button>
|
||||
</div> -->
|
||||
|
||||
<div class="deliverInfo" style="width: 300px; margin: 10px auto;" v-if="activities != []">
|
||||
<!-- <div style="margin-bottom: 5px;"><i class="el-icon-location-outline"></i><span
|
||||
style=" margin-left:10px;">收货地址</span>:天津市河东区天津站</div> -->
|
||||
<div style=""><icon-svg name="ren"></icon-svg><span
|
||||
style=" margin-left:10px;">收货人</span>:{{ deliverOrder.userName }}</div>
|
||||
<div style="margin-bottom: 5px;"><icon-svg name="dianhua"></icon-svg><span style=" margin-left:10px;">电
|
||||
话</span>:{{ deliverOrder.userPhone }}</div>
|
||||
|
||||
</div>
|
||||
<el-row :gutter="10" class="flexbox">
|
||||
<div v-if="activities.length === 0" class="noinfo">-暂无物流信息-</div>
|
||||
<el-col v-else :lg="8" :md="12" :xs="24" v-for="(item, index) in activities"
|
||||
:class="item.length == 1 ? 'onlyOne' : 'notOone'">
|
||||
<div class="scroll">
|
||||
<div style="margin-bottom: 5px;"><icon-svg name="truck"></icon-svg><span
|
||||
style=" margin-left: 10px;">快递</span>:
|
||||
{{ activities[0].ShipperName }}{{ activities[0].LogisticCode }}</div>
|
||||
<el-timeline v-if="item.Traces != []">
|
||||
<el-timeline-item :reverse="reverse" v-for="(activity, index2) in item.Traces" :key="index2"
|
||||
:icon="activity.icon" :type="activity.Action" :color="activity.color" :size="activity.size"
|
||||
:timestamp="activity.AcceptTime">
|
||||
{{ activity.AcceptStation }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
|
||||
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'printOrderDialog',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
deliverOrder: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
reverse: true,
|
||||
DeliverList: [],
|
||||
activities: [
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 根据订单ID查询物流信息
|
||||
getDeliverList() {
|
||||
// this.DeliverList = data.list
|
||||
// console.log('根据订单ID查询物流信息')
|
||||
// console.log(this.deliverOrder)
|
||||
let loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在获取物流信息,请稍后...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
console.log(this.deliverOrder)
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorder/queryFMS'),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
'orderId': this.deliverOrder.orderId
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
console.log(data)
|
||||
if (data.rntStr != []) {
|
||||
this.activities = data.rntStr
|
||||
|
||||
} else {
|
||||
this.activities = []
|
||||
}
|
||||
loading.close()
|
||||
this.visible = true
|
||||
console.log(this.activities,4545)
|
||||
} else {
|
||||
loading.close()
|
||||
return this.$message.error('获取失败,请重新尝试')
|
||||
}
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDeliverDetailDialog', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
/* @import '../../../assets/css/time-line.css'; */
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
.noinfo {
|
||||
color: #ddd;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
}</style>
|
||||
116
src/views/modules/order/orderSheet-see.vue
Normal file
@@ -0,0 +1,116 @@
|
||||
<template>
|
||||
<el-dialog v-if="orderinfo ? mountSheetNum : false" lock-scroll title="电子面单预览" :visible.sync="visible" width="500px"
|
||||
:before-close="beforeCloseDialog" center>
|
||||
<div>
|
||||
<el-alert :title="`当前订单下共有 ${sheetLength} 个电子面单`" type="success"> </el-alert>
|
||||
<ul class="sheet_list_ui">
|
||||
<li v-for="(item, index) in orderinfo.products" style="border:1px solid #f1f1f1 ; overflow: hidden; padding: 10px 0;">
|
||||
<div v-html="item.fmsHtml"></div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="submit" plain>确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
orderitem: {
|
||||
type: Object,
|
||||
value: {}
|
||||
},
|
||||
radio3: 'null',
|
||||
orderinfo: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sheetLength: 0,
|
||||
sheetList: [
|
||||
|
||||
],
|
||||
checkedList: [],
|
||||
orderDetails: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.mountSheetNum()
|
||||
this.visible = false
|
||||
},
|
||||
methods: {
|
||||
// 关闭前
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDialog', false)
|
||||
},
|
||||
submit() {
|
||||
this.beforeCloseDialog()
|
||||
},
|
||||
//
|
||||
|
||||
// 获取面单
|
||||
// getSheetList(){
|
||||
// this.$http({
|
||||
// url: this.$http.adornUrl(`/book/buyorderdetail/info/${this.orderId}`),
|
||||
// method: 'get'
|
||||
// // params: this.$http.adornParams({
|
||||
// // 'orderId': this.orderId,
|
||||
// // })
|
||||
// }).then(({ data }) => {
|
||||
// if (data && data.code === 0) {
|
||||
// console.log(data,'电子面单')
|
||||
// } else {
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// 计算面单数量
|
||||
mountSheetNum() {
|
||||
this.orderinfo.products.forEach(element => {
|
||||
if (element.fmsHtml != '') {
|
||||
this.sheetLength += 1
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
orderinfo: {
|
||||
handler(val, oldVal) {
|
||||
//console.log(val)
|
||||
this.mountSheetNum()
|
||||
this.visible = true
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.ohh div{height: auto !important;}
|
||||
|
||||
</style>
|
||||
<style lang="less" scoped>
|
||||
|
||||
.sheet_list_ui {
|
||||
padding: 0;
|
||||
height: 400px;
|
||||
overflow-y: scroll;
|
||||
overflow: hidden-y;
|
||||
|
||||
li {
|
||||
margin-bottom: 10px;
|
||||
list-style: none;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
88
src/views/modules/order/orderbeizhu-add-or-update.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<el-dialog title="订单备注" :visible.sync="visible" width="30%" :before-close="beforeCloseDialog">
|
||||
<el-form :model="dataForm">
|
||||
<el-form-item label="备注内容">
|
||||
<el-input type="textarea" v-model="dataForm.remark"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="updateBeizhu">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import internal from 'events'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
orderId:{
|
||||
type: Number,
|
||||
value: null
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataForm:{
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 关闭前
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDialog', false)
|
||||
},
|
||||
init (id) {
|
||||
this.orderId = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
if (this.orderId) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/info/${this.orderId}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
console.log(data.buyOrder)
|
||||
this.dataForm.remark = data.buyOrder.remark
|
||||
// console.log(this.dataForm.remark)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
updateBeizhu(){
|
||||
// console.log(this.orderId)
|
||||
// console.log('执行更新备注操作')
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/update`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'orderId': this.orderId,
|
||||
'remark': this.dataForm.remark
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
this.beforeCloseDialog()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
428
src/views/modules/order/orderdeliver-merge.vue
Normal file
@@ -0,0 +1,428 @@
|
||||
<template>
|
||||
<el-dialog title="可合并订单" :visible.sync="visible" width="800px" :before-close="beforeCloseDialog" center>
|
||||
<el-form ref="ruleForm" :model="ruleForm" label-width="80px" :rules="rules">
|
||||
<div class="order_list_ui">
|
||||
<div style="text-align: right;">
|
||||
<el-radio-group v-model="radio3" size="mini">
|
||||
<el-radio-button label="allYse">全合并</el-radio-button>
|
||||
<el-radio-button label="allNo">全不合并</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<ul style="height: 500px; overflow-y:scroll;">
|
||||
<li class="flexbox " v-for="(de, index) in ruleForm.list" :key="index"
|
||||
style="border:1px solid #f1f1f1; margin-bottom: 5px;">
|
||||
<div class="buierInfo flexbox">
|
||||
<div style="width:180px; ">
|
||||
<div style="padding: 10px;" class="">
|
||||
<div><span class="infoTitle">用户名:</span><span>{{de.userName}}</span></div>
|
||||
<div><span class="infoTitle">电话:</span><span>{{de.tel}}</span></div>
|
||||
<div><span class="infoTitle">收货地址:</span><span>{{de.address}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="productInfo" style="width:430px;" >
|
||||
<div class="item" v-for="(item, orderindex) in de.orderList" :key="orderindex">
|
||||
<div class="item_head">
|
||||
<el-row>
|
||||
<el-col :span="24" style="display: flex; justify-content: space-between;">
|
||||
<span>订单编号: {{item.orderSn}}</span>
|
||||
<el-button style="margin: 0; padding: 0;" type="text" @click="removeOrder(item,orderindex, index)">移除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="item_body">
|
||||
<div class="flexbox" style="justify-content: space-between;">
|
||||
<div class="td1" style="width:100%;">
|
||||
<div class="flexbox orderProducts" style="width:100%;" v-for="(productitem, productindex) in item.products" :key="productindex">
|
||||
<div class="flexbox productItem" style="width:100%;">
|
||||
<!-- <el-checkbox :label="4545454545"></el-checkbox> -->
|
||||
<img src="../../../../static/img/flower.png" width="50px"
|
||||
height="50px">
|
||||
<div class="">
|
||||
<div class="bookName tabContent">{{productitem.productName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="num xcenter"><span>× {{productitem.quantity}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style=" padding: 10px;" class="buttonBox flexbox">
|
||||
<div>
|
||||
<div>是否合并当前可合并项?</div>
|
||||
<el-form-item label-width="0" :prop="`list.${index}.isMerge`" :rules=" [
|
||||
{ required: true, message: '必填项', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="de.isMerge" size="mini">
|
||||
<div>
|
||||
<el-radio :label="'true'">合并</el-radio>
|
||||
</div>
|
||||
<div>
|
||||
<el-radio :label="'false'">不合并</el-radio>
|
||||
</div>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="submit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
orderitem: {
|
||||
type: Object,
|
||||
value: {}
|
||||
},
|
||||
radio3: 'null',
|
||||
mergeList: { // 可合并订单操作数组
|
||||
type: Array,
|
||||
value: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkedList: [],
|
||||
form: {
|
||||
deliverLcd: ''
|
||||
},
|
||||
expressList: [],
|
||||
dataRule: {
|
||||
deliverLcd: [
|
||||
{ required: true, message: '请先选择物流公司', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
ruleForm: {
|
||||
list: []
|
||||
},
|
||||
rules:{
|
||||
ruleForm: [
|
||||
{ required: true, message: '必填项', trigger: 'blur' },
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getExpressList()
|
||||
},
|
||||
updated() {
|
||||
this.ruleForm.list = this.mergeList
|
||||
},
|
||||
methods: {
|
||||
// 获取快递公司列表
|
||||
getExpressList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/express_name'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
// console.log(data, '快递列表')
|
||||
this.expressList = data.dataList
|
||||
})
|
||||
},
|
||||
handleCheckedCitiesChange(val) {
|
||||
console.log(val)
|
||||
},
|
||||
// 关闭前
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDialog', {
|
||||
show: false,
|
||||
data: this.mergeList
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// console.log(this.allOrder)
|
||||
console.log('完成订单检查操作,去选择物流')
|
||||
// this.beforeCloseDialog()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 移除订单
|
||||
},
|
||||
watch:{
|
||||
|
||||
mergeList: {
|
||||
handler(val, oldVal) {
|
||||
//console.log(val)
|
||||
this.ruleForm.list = val
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.infoTitle {
|
||||
color: #777;
|
||||
display: inline-block;
|
||||
width: 62px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.dialog-footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-radio-button {
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
/deep/ .el-dialog__footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.order_list_ui {
|
||||
* {
|
||||
font-size: 12px;
|
||||
//color: #777;
|
||||
}
|
||||
|
||||
ul {
|
||||
color: #515a6e;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
width: 100%;
|
||||
// margin-bottom: 10px;
|
||||
|
||||
.item_head {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
|
||||
// border-right: none !important;
|
||||
background-color: #edf9f8;
|
||||
|
||||
.el-checkbox__label {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tip {
|
||||
text-align: right;
|
||||
|
||||
.el-button {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.item_body {
|
||||
// border: 1px solid #ddf6f3;
|
||||
border-top: none;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.productInfo {
|
||||
border-left: 1px solid #f1f1f1;
|
||||
border-right: 1px solid #f1f1f1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.orderProducts {
|
||||
padding: 10px;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
|
||||
.price {
|
||||
width: 40px;
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.num {
|
||||
width: 40px;
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.productItem {
|
||||
overflow: hidden;
|
||||
|
||||
.flexbox {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
line-height: 54px;
|
||||
}
|
||||
|
||||
.el-checkbox__label {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.xcenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.borderright {
|
||||
padding-left: 10px;
|
||||
border-right: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.normal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hasDeliver {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-image: url(../../../../static/img/hasDeliver_icon.png);
|
||||
}
|
||||
|
||||
.td1 {
|
||||
|
||||
// width: 400px;
|
||||
.orderProducts {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
img {
|
||||
margin-right: 10px;
|
||||
padding: 2px;
|
||||
border: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.bookName {
|
||||
//margin-right: 10px;
|
||||
font-size: 12px;
|
||||
line-height: 22px;
|
||||
margin-left: -6px;
|
||||
-webkit-transform: scale(0.9);
|
||||
}
|
||||
|
||||
.author {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.td2 {
|
||||
width: 150px;
|
||||
line-height: 26px;
|
||||
padding: 5px;
|
||||
|
||||
em {
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
color: #48C9B0;
|
||||
}
|
||||
}
|
||||
|
||||
.tabName {
|
||||
color: #999;
|
||||
margin-bottom: -3px;
|
||||
}
|
||||
|
||||
.tabContent {
|
||||
line-height: 26px;
|
||||
-webkit-transform: scale(0.9);
|
||||
}
|
||||
|
||||
.td3 {
|
||||
padding: 5px;
|
||||
line-height: 24px;
|
||||
width: 200px;
|
||||
|
||||
.buier_tip {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.td4 {
|
||||
padding: 5px;
|
||||
width: 200px;
|
||||
line-height: 24px;
|
||||
|
||||
.time {
|
||||
color: #999
|
||||
}
|
||||
|
||||
.orderStatus {
|
||||
color: #ec6565;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.td5 {
|
||||
padding: 5px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.orderProducts:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.hasSplit {
|
||||
background-color: #fffae8;
|
||||
border: 1px solid #ffedd6;
|
||||
|
||||
.el-button {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.buttonGroup {
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.deliverName {
|
||||
margin-bottom: px;
|
||||
}
|
||||
|
||||
.paper_list_ui {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.buttonBox {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.fengbi {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.buierInfo {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
599
src/views/modules/order/orderdeliver-split.vue
Normal file
@@ -0,0 +1,599 @@
|
||||
<template>
|
||||
<el-dialog title="订单发货" center :visible.sync="visible" width="700px" :before-close="beforeCloseDialog">
|
||||
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
||||
<el-form-item label="物流公司" prop="deliverLcd">
|
||||
<el-select size="mini" v-model="ruleForm.deliverLcd" placeholder="请选择物流公司" @change="selectChanged">
|
||||
<el-option v-for="(item, index) in expressList" :label="item.dictValue"
|
||||
:value="item.dictType"></el-option>
|
||||
</el-select>
|
||||
<el-radio-group v-model="radio3" size="mini" style="float: right;">
|
||||
<!-- 三种发货形态-general:普通发货,merge:合并发货,mix:混合发货 -->
|
||||
<el-radio-button label="general">普通发货</el-radio-button>
|
||||
<!-- <el-radio-button label="merge">合并发货</el-radio-button> -->
|
||||
<el-radio-button label="mix">混合发货</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="order_list_ui">
|
||||
<ul v-if="orderitem">
|
||||
<div v-if="radio3 == 'general'">
|
||||
<li>
|
||||
<div class="item_head">
|
||||
<el-row>
|
||||
<el-col :md="12" :lg="12">
|
||||
<span><span class="infoTitle">订单编号:</span>{{ orderitem.orderSn }} </span></el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="item_body">
|
||||
<div class="flexbox" style="justify-content: space-between;">
|
||||
<div class="td1 flexbox" style="align-items: flex-start;">
|
||||
<div class="flexbox orderProducts" v-for="products in productsCodeList">
|
||||
<div class="flexbox productItem" style="">
|
||||
<!-- <el-checkbox :label="products.allOrderId"></el-checkbox> -->
|
||||
<img :src="products.image" width="30px" height="30px">
|
||||
<div class="flexbox" style="align-items: center;">
|
||||
<div class="bookName">{{ products.productName }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flexbox">
|
||||
<div class="price xcenter">
|
||||
<!-- <div>{{ products.productPrice }}</div> -->
|
||||
<div>× {{ products.quantity }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<div v-if="radio3 == 'mix'">
|
||||
<div v-if="mixOrderList.length == 0"
|
||||
style="display: flex; height:300px; width: 100%; align-items: center; justify-content: center;">
|
||||
<div class="empty" style="text-align: center;">
|
||||
<icon-svg style="font-size: 130px;" name="kongbai"></icon-svg>
|
||||
<div style="color: #999;">暂无数据</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-checkbox-group v-model="checkedList" @change="handleCheckedCitiesChange">
|
||||
|
||||
<li class="flexbox mergeList" style="border:1px solid #ddf6f3" v-for="(item, index) in mixOrderList">
|
||||
<div class="buierInfo flexbox">
|
||||
<div style="display: flex;width:180px; align-items: center;">
|
||||
<div style="padding: 10px;" class="">
|
||||
<div><span class="infoTitle">用户名:</span><span>{{item.userName}}</span></div>
|
||||
<div><span class="infoTitle">电话:</span><span>{{item.tel}}</span></div>
|
||||
<div><span class="infoTitle">收货地址:</span><span>{{item.address}}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="productInfo" style="width:100%;">
|
||||
|
||||
<div class="item" v-for="(item2, index) in item.orderList">
|
||||
<div class="item_head no_right_border">
|
||||
<el-row>
|
||||
<el-col :span="24"
|
||||
style="display: flex; justify-content: space-between;">
|
||||
<span><span class="infoTitle">订单编号:</span>{{item2.orderSn}} </span>
|
||||
<!-- <el-button style="margin: 0; padding: 0;" type="text">移除</el-button> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="item_body no_right_border no_bottom_border">
|
||||
<div class="flexbox" style="justify-content: space-between;">
|
||||
<div class="td1 flexbox" style="width:100%; ">
|
||||
|
||||
<div class="flexbox orderProducts" style="width:100%;" v-for="(item3, index) in item2.products">
|
||||
<div class="flexbox productItem" style="width:100%;">
|
||||
<el-checkbox :label="item3.allOrderId" :disabled="item3.orderStatus == '1'"><br></el-checkbox>
|
||||
<img :src="item3.image" width="30px" style="margin-left: -15px;"
|
||||
height="30px">
|
||||
<div class="flexbox" style="align-items: center;">
|
||||
<div class="bookName">{{item3.productName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="num xcenter"><span>× {{item3.quantity}}</span></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-if="radio3 === 'mix' && mixOrderList.length != 0" type="primary" @click="submit">发 货</el-button>
|
||||
<el-button v-if="radio3 == 'general'" type="primary" @click="submit1">发 货</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
orderitem: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 普通发货list
|
||||
productsCodeList:[],
|
||||
productsIdsList:[],
|
||||
radio3: 'general',
|
||||
checkedList: [],
|
||||
ruleForm: {
|
||||
deliverLcd: '',
|
||||
dictValue:''
|
||||
},
|
||||
expressList: [],
|
||||
rules: {
|
||||
deliverLcd: [
|
||||
{ required: true, message: '请先选择物流公司', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
orderIds: [],
|
||||
// 混合发货数组
|
||||
mixOrderList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// this.visible = false
|
||||
this.getExpressList()
|
||||
},
|
||||
methods: {
|
||||
// 获取快递公司列表
|
||||
getExpressList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/express_name'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
// console.log(data, '快递列表')
|
||||
this.expressList = data.dataList
|
||||
})
|
||||
},
|
||||
selectChanged(val){
|
||||
console.log(val.dictValue)
|
||||
if(this.expressList && this.expressList.length > 0){
|
||||
this.expressList.forEach(element => {
|
||||
if(element.dictType == val){
|
||||
return this.ruleForm.dictValue = element.dictValue
|
||||
}
|
||||
});
|
||||
}
|
||||
// this.ruleForm.dictValue = val.dictValue
|
||||
//this.ruleForm.deliverLcd = val.dictType
|
||||
},
|
||||
handleCheckedCitiesChange(val) {
|
||||
console.log(val)
|
||||
},
|
||||
// 获取可合并订单
|
||||
getMixDeliverOrderList() {
|
||||
this.orderIds[0] = this.orderitem.orderId
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/checkMerge`),
|
||||
method: 'post',
|
||||
data: this.orderIds
|
||||
}).then(({ data }) => {
|
||||
|
||||
this.mixOrderList = data.list
|
||||
})
|
||||
},
|
||||
|
||||
// 关闭前
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDialog', false)
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
this.$refs['ruleForm'].clearValidate()
|
||||
this.checkedList = []
|
||||
},
|
||||
getNewProducts(){
|
||||
this.productsCodeList.forEach((item, index) => {
|
||||
if(item.orderStatus == '1'){
|
||||
this.productsCodeList.splice(index, 1)
|
||||
console.log(index)
|
||||
}
|
||||
this.productsIdsList = this.productsCodeList.map( item => item.allOrderId)
|
||||
})
|
||||
},
|
||||
//
|
||||
// getProductsCodeList
|
||||
// 普通发货
|
||||
submit1(){
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/blendSendFMS/${this.ruleForm.deliverLcd}`),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
"shipperName" : this.ruleForm.dictValue
|
||||
}),
|
||||
data: this.productsIdsList // 是个数组
|
||||
// 传orderid
|
||||
}).then(({ data }) => {
|
||||
if(data && data.code === 0 ){
|
||||
console.log(data)
|
||||
this.beforeCloseDialog()
|
||||
return this.$message.success('发货成功')
|
||||
}
|
||||
})
|
||||
}})
|
||||
},
|
||||
// 获取数据列表
|
||||
getData() {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/buyorder/appGetOrderInfo'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'orderId': this.orderId,
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.productsCodeList = data.buyOrder
|
||||
console.log(888)
|
||||
} else {
|
||||
// this.dataList = []
|
||||
// this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
//混合发货
|
||||
submit() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// console.log(this.allOrder)
|
||||
if (this.checkedList.length == 0 && this.radio3 == 'mix') {
|
||||
return this.$message.error('请至少选择一条商品')
|
||||
}
|
||||
console.log('执行更新发货操作')
|
||||
this.$confirm(`正在执行${this.deliverType} , 是否继续?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let loading = this.$loading({
|
||||
lock: true,
|
||||
text: '执行操作,请稍后',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/blendSendFMS/${this.ruleForm.deliverLcd}`),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
"shipperName" : this.ruleForm.dictValue
|
||||
}),
|
||||
data: this.checkedList,
|
||||
// 传orderid
|
||||
}).then(({ data }) => {
|
||||
if(data && data.code === 0){
|
||||
// console.log(data)
|
||||
loading.close()
|
||||
return this.$message.success('发货成功')
|
||||
this.beforeCloseDialog()
|
||||
}
|
||||
})
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '发货成功!'
|
||||
// });
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
});
|
||||
});
|
||||
//this.beforeCloseDialog()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
deliverType() {
|
||||
let type = ''
|
||||
if (this.radio3 == 'mix') {
|
||||
type = `[混合发货],当前操作${this.checkedList.length}个商品打包发货`
|
||||
} else if (this.radio3 == 'merge') {
|
||||
type = `[合并发货]`
|
||||
} else {
|
||||
// 混合发货
|
||||
type = '[普通发货]'
|
||||
}
|
||||
return type
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
orderitem: {
|
||||
handler(val, oldVal) {
|
||||
this.productsCodeList = val.products
|
||||
this.getNewProducts()
|
||||
this.getMixDeliverOrderList()
|
||||
// this.getData()
|
||||
// this.visible = true
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.no_right_border {
|
||||
border-right: 0 !important;
|
||||
}
|
||||
|
||||
.no_bottom_border {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
.mergeList {
|
||||
.item_head:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
// .infoTitle {
|
||||
// color: #777;
|
||||
// display: inline-block;
|
||||
// width: 62px;
|
||||
// text-align: right;
|
||||
// }
|
||||
|
||||
/deep/ .el-dialog__footer {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/deep/ .el-checkbox__label {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.order_list_ui {
|
||||
* {
|
||||
font-size: 12px;
|
||||
//color: #777;
|
||||
}
|
||||
|
||||
ul {
|
||||
color: #515a6e;
|
||||
padding: 0;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.item_head {
|
||||
width: 100%;
|
||||
padding: 6px;
|
||||
border: 1px solid #ddf6f3;
|
||||
// border-right: none;
|
||||
background-color: #edf9f8;
|
||||
|
||||
// .el-checkbox__label {
|
||||
// display: none !important;
|
||||
// }
|
||||
|
||||
.tip {
|
||||
text-align: right;
|
||||
|
||||
.el-button {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.item_body {
|
||||
border: 1px solid #ddf6f3;
|
||||
// border-bottom: none;
|
||||
// border-right: none;
|
||||
border-top: none;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.orderProducts {
|
||||
padding: 10px;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #f1f1f1;
|
||||
|
||||
.price {
|
||||
width: 40px;
|
||||
line-height:28px;
|
||||
}
|
||||
|
||||
.num {
|
||||
width: 40px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.productItem {
|
||||
overflow: hidden;
|
||||
|
||||
.flexbox {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-checkbox {
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.el-checkbox__label {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.xcenter {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.borderright {
|
||||
padding-left: 10px;
|
||||
border-right: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.normal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hasDeliver {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-image: url(../../../../static/img/hasDeliver_icon.png);
|
||||
}
|
||||
|
||||
.td1 {
|
||||
|
||||
width: 100%;
|
||||
|
||||
.orderProducts {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
img {
|
||||
margin-right: 10px;
|
||||
|
||||
padding: 2px;
|
||||
border: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
.bookName {
|
||||
//margin-right: 10px;
|
||||
font-size: 12px;
|
||||
line-height: 16px;
|
||||
margin-left: -6px;
|
||||
letter-spacing: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2; // 控制多行的行数
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-transform: scale(0.8);
|
||||
}
|
||||
|
||||
.author {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.td2 {
|
||||
width: 150px;
|
||||
line-height: 26px;
|
||||
padding: 5px;
|
||||
|
||||
em {
|
||||
font-size: 18px;
|
||||
font-style: normal;
|
||||
color: #48C9B0;
|
||||
}
|
||||
}
|
||||
|
||||
.tabName {
|
||||
color: #999;
|
||||
margin-bottom: -3px;
|
||||
}
|
||||
|
||||
.tabContent {
|
||||
line-height: 26px;
|
||||
-webkit-transform: scale(0.9);
|
||||
}
|
||||
|
||||
.td3 {
|
||||
padding: 5px;
|
||||
line-height: 24px;
|
||||
width: 200px;
|
||||
|
||||
.buier_tip {
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.td4 {
|
||||
padding: 5px;
|
||||
width: 200px;
|
||||
line-height: 24px;
|
||||
|
||||
.time {
|
||||
color: #999
|
||||
}
|
||||
|
||||
.orderStatus {
|
||||
color: #ec6565;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.td5 {
|
||||
padding: 5px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.orderProducts:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.hasSplit {
|
||||
background-color: #fffae8;
|
||||
border: 1px solid #ffedd6;
|
||||
|
||||
.el-button {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.buttonGroup {
|
||||
.el-checkbox {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.deliverName {
|
||||
margin-bottom: px;
|
||||
}
|
||||
|
||||
.paper_list_ui {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.fengbi {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
</style>
|
||||
154
src/views/modules/order/set-deliver-dialog.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog title="发货配置" :close-on-click-modal="false" :visible.sync="visible" width='500px'
|
||||
:before-close="beforeCloseDialog">
|
||||
<!-- <el-steps :active="stepsActive" simple style="margin-bottom: 20px;;">
|
||||
<el-step title="获取电子面单" icon="el-icon-tickets"></el-step>
|
||||
<el-step title="打印电子面单" icon="el-icon-printer"></el-step>
|
||||
</el-steps> -->
|
||||
<!-- <el-alert style="margin-bottom: 15px;" v-if="selectData.length > 0"
|
||||
:title="`您正在对 ${selectData.length} 条数据进行发货操作。`" :closable="false" type="success">
|
||||
</el-alert> -->
|
||||
<el-form v-if="ruleForm" :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px"
|
||||
class="demo-ruleForm">
|
||||
<el-form-item label="选择物流" prop="deliverLcd">
|
||||
<el-select size="mini" v-model="ruleForm.deliverLcd" placeholder="请选择物流" @change="selectChanged">
|
||||
<el-option v-for="(item, index) in expressList" :label="item.dictValue"
|
||||
:value="item.dictType"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="setDevliverHandle">立即发货</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- <ul class="print-ul" style="display: block;">
|
||||
<li v-for="(item, index) in printArr" :key="index" :id="'printDiv' + index"
|
||||
style="page-break-after:always;">
|
||||
<div v-html="item"></div>
|
||||
</li>
|
||||
</ul> -->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'printOrderDialog',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
selectData: {
|
||||
type: Array,
|
||||
value: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 快递列表
|
||||
expressList: [],
|
||||
fullscreenLoading: false,
|
||||
// 后台返回的面单的打印数组:
|
||||
printArr: [],
|
||||
stepsActive: 1, // 当前step激活索引值
|
||||
ruleForm: {
|
||||
deliverLcd: '',
|
||||
dictValue: ''
|
||||
},
|
||||
orderDetailIdList: [],
|
||||
rules: {
|
||||
deliverLcd: [
|
||||
{ required: true, message: '请先选择物流公司', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 获取物流列表
|
||||
this.getExpressList()
|
||||
},
|
||||
methods: {
|
||||
// 获取快递公司列表
|
||||
getExpressList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/express_name'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
console.log(data, '快递列表')
|
||||
this.expressList = data.dataList
|
||||
})
|
||||
},
|
||||
selectChanged(val) {
|
||||
console.log(val.dictValue)
|
||||
if (this.expressList && this.expressList.length > 0) {
|
||||
this.expressList.forEach(element => {
|
||||
if (element.dictType == val) {
|
||||
return this.ruleForm.dictValue = element.dictValue
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// 关闭页面
|
||||
beforeCloseDialog() {
|
||||
this.$emit('closeDeliverDialog', false)
|
||||
this.$refs['ruleForm'].resetFields()
|
||||
this.$refs['ruleForm'].clearValidate()
|
||||
this.selectData = []
|
||||
},
|
||||
// 发货操作
|
||||
setDevliverHandle() {
|
||||
this.$refs['ruleForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在处理,请稍后...',
|
||||
spinner: 'Loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
// 发送后台请求
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/buyorder/delivery/${this.ruleForm.deliverLcd}`),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
"shipperName": this.ruleForm.dictValue
|
||||
}),
|
||||
data: this.selectData,
|
||||
// 传orderid
|
||||
}).then(({ data }) => {
|
||||
// console.log(data)
|
||||
loading.close();
|
||||
if (data && data.code === 0) {
|
||||
console.log(data)
|
||||
this.beforeCloseDialog() // 关闭弹窗
|
||||
return this.$message.success('发货成功')
|
||||
} else {
|
||||
this.beforeCloseDialog() // 关闭弹窗
|
||||
return this.$message.error('发货失败')
|
||||
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.log(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.content {
|
||||
text-align: center;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.el-step {
|
||||
font-size: 20px;
|
||||
vertical-align: middle;
|
||||
line-height: 0;
|
||||
}
|
||||
</style>
|
||||
195
src/views/modules/shop/pubilc-pro-list.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<el-dialog title="选择商品" center :visible.sync="visible" :before-close="handleClose">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button type="primary" @click="sedSelectPro">确 定</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table ref="multipleTable"
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="price"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品价格">
|
||||
</el-table-column>
|
||||
<el-table-column header-align="center" align="center" label="商品图">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="30" height="30" class="tableImg" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
deliverOrder: {
|
||||
type: Object,
|
||||
value: {}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dataForm:{
|
||||
key:''
|
||||
},
|
||||
selectTitle:'',
|
||||
oldSelected:[],
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 20,
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
}
|
||||
},
|
||||
create(){
|
||||
|
||||
},
|
||||
mounted(){
|
||||
// console.log(454545)
|
||||
this.$bus.$on("ProListVisible", (val) => {
|
||||
this.visible = true
|
||||
});
|
||||
this.$bus.$on("getListInMes", (data) => {
|
||||
this.selectTitle = data.selectTitle
|
||||
this.oldSelected = data.ProductList
|
||||
|
||||
});
|
||||
},methods:{
|
||||
// 判断初始选中的产品
|
||||
check(){
|
||||
console.log(this.oldSelected,'check')
|
||||
if(this.oldSelected.length > 0){
|
||||
this.dataList.forEach((item) => {
|
||||
this.oldSelected.forEach((item2) => {
|
||||
if(item.productId == item2.productId){
|
||||
this.dataListSelections.push(item)
|
||||
this.$refs.multipleTable.toggleRowSelection(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(this.dataListSelections, 'dataListSelections')
|
||||
}
|
||||
},
|
||||
handleClose(){
|
||||
this.$emit("ProListClose", false);
|
||||
},
|
||||
sedSelectPro(){
|
||||
console.log(this.dataListSelections)
|
||||
this.$bus.$emit('haveSelected', {title:this.selectTitle,list:this.dataListSelections})
|
||||
this.handleClose()
|
||||
},
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/shopproduct/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
// console.log(data)
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
this.$nextTick(()=> {
|
||||
this.check() // 获取到已选中的数据
|
||||
|
||||
})
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
|
||||
}}
|
||||
.pictureList{
|
||||
/deep/.el-upload--picture{ display: none;}
|
||||
/deep/ .el-upload-list{ display: flex; justify-content:space-between; flex-wrap: wrap;
|
||||
.el-upload-list__item{
|
||||
width:30%; padding: 5px 5px 5px 87px; height: 66px;
|
||||
img{width: 54px; height: 54px;}
|
||||
.el-upload-list__item-name{line-height: 54px;}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,201 +1,344 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.productId ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
<el-dialog center :title="!dataForm.productId ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible"
|
||||
@close="handlereset">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="所属分类" prop="productPid">
|
||||
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" @change="handleChange" clearable></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品名称" prop="productName">
|
||||
<el-input v-model="dataForm.productName" placeholder="商品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品价格" prop="price">
|
||||
<el-input v-model="dataForm.price" placeholder="商品价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品重量" prop="weight">
|
||||
<el-input v-model="dataForm.weight" placeholder="商品重量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上架状态" prop="publishStatus">
|
||||
<el-input v-model="dataForm.publishStatus" placeholder="上架状态"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图" prop="productImages">
|
||||
<el-upload
|
||||
action="http://59.110.212.44:9100/pb/oss/fileoss"
|
||||
list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:file-list="fileList"
|
||||
:on-success="handlePicSuccess"
|
||||
:on-remove="handleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.productImages" alt="">
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新时间" prop="updateTime">
|
||||
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="删除标记" prop="delFlag">
|
||||
<el-input v-model="dataForm.delFlag" placeholder="删除标记"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item>
|
||||
<el-steps :active="steps" simple style="margin-bottom: 15px;">
|
||||
<el-step title="基本信息" icon="el-icon-edit"></el-step>
|
||||
<el-step title="商品详情" icon="el-icon-upload"></el-step>
|
||||
</el-steps>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px">
|
||||
<div class="steps1" v-if="steps == 1">
|
||||
|
||||
<el-form-item label="所属分类" prop="productPid">
|
||||
<el-cascader v-model="dataForm.poids" :options="categorys" :props="props" clearable></el-cascader>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="商品类型" prop="goodsType">
|
||||
<el-select v-model="dataForm.goodsType" placeholder="请选择">
|
||||
<el-option v-for="item in goodsTypeList" :key="item.dictType" :label="item.dictValue" :value="item.dictType">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="商品名称" prop="productName">
|
||||
<el-input v-model="dataForm.productName" placeholder="商品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品图" prop="productImages">
|
||||
<el-upload :limit="dataForm.limitCountImg" class="el-uploadfeng noneBtnImg"
|
||||
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
||||
action="http://59.110.212.44:9100/pb/oss/fileoss" list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview" :file-list="fileList" :on-success="handlePicSuccess"
|
||||
accept=".jpeg,.jpg,.gif,.png" :on-change="dealImgChange" :on-remove="handleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.productImages" alt="">
|
||||
</el-dialog>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品轮播图" prop="productImageList">
|
||||
<el-upload :limit="5" class="el-uploadfeng noneBtnImg"
|
||||
:class="{ uoloadSty: dataForm.showBtnDealImg, disUoloadSty: dataForm.noneBtnImg }"
|
||||
action="http://59.110.212.44:9100/pb/oss/fileoss" list-type="picture-card"
|
||||
:on-preview="handlePictureCardPreview" :file-list="swiperfileList" :on-success="bannerHandlePicSuccess"
|
||||
accept=".jpeg,.jpg,.gif,.png" :on-remove="bannerHandleRemove">
|
||||
<i class="el-icon-plus"></i>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" :append-to-body="true">
|
||||
<img width="100%" :src="dataForm.productImageList" alt="">
|
||||
</el-dialog>
|
||||
<span>图片尺寸:600*600px,支持图片类型:.jpeg,.jpg,.gif,.png, 最多上传5张图片</span>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-form-item label="商品价格" prop="price" style="width: 50%; float: left;">
|
||||
<el-input v-model="dataForm.price" placeholder="商品价格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品重量" prop="weight" style="width: 48%; float: right;">
|
||||
<el-input style="width: 80%;" v-model="dataForm.weight" placeholder="商品重量"></el-input><span
|
||||
style="display: inline-block; float: right; width: 10%;">克</span>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- <el-form-item label="上架状态" prop="publishStatus">
|
||||
<el-input v-model="dataForm.publishStatus" placeholder="上架状态"></el-input>
|
||||
</el-form-item> -->
|
||||
<div>
|
||||
<el-form-item label="出版社" prop="publisher" style="width: 50%; float: left;">
|
||||
<el-input placeholder="出版社" v-model="dataForm.publisher"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="作者" prop="author" style="width: 48%; float: right;">
|
||||
<el-input placeholder="作者" v-model="dataForm.author"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="出版时间" prop="pubDate" style="width: 50%; float: left;">
|
||||
<el-date-picker @change="changed" format="yyyy 年 MM 月 dd 日" v-model="dataForm.pubDate" type="date" placeholder="选择日期时间">
|
||||
</el-date-picker>
|
||||
<!-- <el-input placeholder="出版时间" v-model=""></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="页数" prop="pageNum" style="width: 48%; float: right;">
|
||||
<el-input placeholder="页数" v-model="dataForm.pageNum"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="内文用纸材质" prop="quality" style="width: 50%; float: left;">
|
||||
<el-input v-model="dataForm.quality" placeholder="内文用纸材质"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开本" prop="format" style="width: 48%; float: right;">
|
||||
<el-input v-model="dataForm.format" placeholder="16开或其他规格"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- <el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="dataForm.sort" placeholder="排序"></el-input>
|
||||
</el-form-item> -->
|
||||
</div>
|
||||
<div></div>
|
||||
<div class="steps2" v-if="steps == 2">
|
||||
<div style="margin-bottom: 15px;"><b>商品详情</b></div>
|
||||
<quill-editor v-model="dataForm.productDetails" ref="myQuillEditor" height:400px :options="editorOption"
|
||||
@blur="onEditorBlur($event)" @focus="onEditorFocus($event)" @change="onEditorChange($event)"
|
||||
@ready="onEditorReady($event)">
|
||||
</quill-editor>
|
||||
</div>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handlereset">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
<!-- <el-button @click="handlereset">取消</el-button> -->
|
||||
<el-button type="warning" @click="steps = 1" plain size="mini">添加基本信息</el-button>
|
||||
<el-button type="success" @click="steps = 2" plain size="mini">添加商品详情</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" plain size="mini">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
categorys:'',
|
||||
fileList:[],
|
||||
dialogVisible: false,
|
||||
props: {
|
||||
import { quillEditor } from 'vue-quill-editor'
|
||||
|
||||
import 'quill/dist/quill.core.css'
|
||||
import 'quill/dist/quill.snow.css'
|
||||
import 'quill/dist/quill.bubble.css'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goodsTypeList: [],
|
||||
steps: 1,
|
||||
visible: false,
|
||||
categorys: [],
|
||||
fileList: [], // 封面图
|
||||
swiperfileList: [],
|
||||
dialogVisible: false,
|
||||
props: {
|
||||
value: "catId",
|
||||
label: "name",
|
||||
children: "children",
|
||||
checkStrictly: true
|
||||
},
|
||||
dataForm: {
|
||||
productId: 0,
|
||||
productName: '',
|
||||
price: '',
|
||||
weight: '',
|
||||
publishStatus: '',
|
||||
productPid: '',
|
||||
productImages: '',
|
||||
createTime: '',
|
||||
updateTime: '',
|
||||
delFlag: '',
|
||||
sort: '',
|
||||
poids:[]
|
||||
dataForm: {
|
||||
productId: 0,
|
||||
limitCountImg: 1, // 图片数量
|
||||
productImageList: '', // 轮播图
|
||||
showBtnDealImg: true,
|
||||
noneBtnImg: false,
|
||||
productName: '',
|
||||
price: '',
|
||||
author: '',
|
||||
publisher: '',
|
||||
weight: '',
|
||||
pubDate: '',
|
||||
format: '', // 开本
|
||||
pageNum: null,
|
||||
quality: '', // 内文用纸
|
||||
sumSales: null, // 总销量
|
||||
publishStatus: '',
|
||||
productPid: '',
|
||||
productImages: '',
|
||||
createTime: '',
|
||||
updateTime: '',
|
||||
delFlag: '',
|
||||
sort: '',
|
||||
goodsType: '', // 商品类型
|
||||
poids: []
|
||||
},
|
||||
dataRule: {
|
||||
productName: [
|
||||
{ required: true, message: '商品名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
price: [
|
||||
{ required: true, message: '商品价格不能为空', trigger: 'blur' }
|
||||
],
|
||||
weight: [
|
||||
{ required: true, message: '商品重量不能为空', trigger: 'blur' }
|
||||
],
|
||||
goodsType: [
|
||||
{ required: true, message: '商品类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
productPid: [
|
||||
{ required: true, message: '商品父id不能为空', trigger: 'blur' }
|
||||
],
|
||||
productImages: [
|
||||
{ required: true, message: '商品图不能为空', trigger: 'blur' }
|
||||
],
|
||||
productDetails: [
|
||||
{ required: true, message: '商品详情不能为空', trigger: 'blur' }
|
||||
],
|
||||
// createTime: [
|
||||
// { required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// updateTime: [
|
||||
// { required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// delFlag: [
|
||||
// { required: true, message: '删除标记不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// sort: [
|
||||
// { required: true, message: '排序不能为空', trigger: 'blur' }
|
||||
// ]
|
||||
},
|
||||
// 富文本编辑器配置
|
||||
editorOption: {
|
||||
modules: {
|
||||
toolbar: [
|
||||
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
|
||||
['blockquote', 'code-block'], // 引用 代码块
|
||||
[{ header: 1 }, { header: 2 }], // 1、2 级标题
|
||||
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
|
||||
[{ script: 'sub' }, { script: 'super' }], // 上标/下标
|
||||
[{ indent: '-1' }, { indent: '+1' }], // 缩进
|
||||
[{ direction: 'rtl' }], // 文本方向
|
||||
[{ size: ['12', '14', '16', '18', '20', '22', '24', '28', '32', '36'] }], // 字体大小
|
||||
[{ header: [1, 2, 3, 4, 5, 6] }], // 标题
|
||||
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
|
||||
// [{ font: ['songti'] }], // 字体种类
|
||||
[{ align: [] }], // 对齐方式
|
||||
['clean'], // 清除文本格式
|
||||
['image', 'video'] // 链接、图片、视频
|
||||
]
|
||||
},
|
||||
dataRule: {
|
||||
// productName: [
|
||||
// { required: true, message: '商品名称不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// price: [
|
||||
// { required: true, message: '商品价格不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// weight: [
|
||||
// { required: true, message: '商品重量不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// publishStatus: [
|
||||
// { required: true, message: '上架状态不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// productPid: [
|
||||
// { required: true, message: '商品父id不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// productImages: [
|
||||
// { required: true, message: '商品图不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// level: [
|
||||
// { required: true, message: '层级不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// createTime: [
|
||||
// { required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// updateTime: [
|
||||
// { required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// delFlag: [
|
||||
// { required: true, message: '删除标记不能为空', trigger: 'blur' }
|
||||
// ],
|
||||
// sort: [
|
||||
// { required: true, message: '排序不能为空', trigger: 'blur' }
|
||||
// ]
|
||||
}
|
||||
}
|
||||
},
|
||||
created (){
|
||||
this.getTreeList()
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
this.dataForm.productId = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.productId) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/shopproduct/info/${this.dataForm.productId}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.productName = data.shopProduct.productName
|
||||
this.dataForm.price = data.shopProduct.price
|
||||
this.dataForm.weight = data.shopProduct.weight
|
||||
this.dataForm.publishStatus = data.shopProduct.publishStatus
|
||||
this.dataForm.productPid = data.shopProduct.productPid
|
||||
this.dataForm.productImages = data.shopProduct.productImages
|
||||
this.dataForm.createTime = data.shopProduct.createTime
|
||||
this.dataForm.updateTime = data.shopProduct.updateTime
|
||||
this.dataForm.delFlag = data.shopProduct.delFlag
|
||||
this.dataForm.sort = data.shopProduct.sort
|
||||
this.dataForm.poids = data.shopProduct.poids
|
||||
if (data.shopProduct.productImages != "") {
|
||||
placeholder: '请输入正文'
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getTreeList()
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.productId = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.productId) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/shopproduct/info/${this.dataForm.productId}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.productName = data.shopProduct.productName
|
||||
this.dataForm.price = data.shopProduct.price
|
||||
this.dataForm.goodsType = data.shopProduct.goodsType
|
||||
this.dataForm.weight = data.shopProduct.weight
|
||||
this.dataForm.publishStatus = data.shopProduct.publishStatus
|
||||
this.dataForm.productPid = data.shopProduct.productPid
|
||||
this.dataForm.productImages = data.shopProduct.productImages
|
||||
this.dataForm.createTime = data.shopProduct.createTime
|
||||
this.dataForm.updateTime = data.shopProduct.updateTime
|
||||
this.dataForm.delFlag = data.shopProduct.delFlag
|
||||
this.dataForm.sort = data.shopProduct.sort
|
||||
this.dataForm.pubDate = data.shopProduct.pubDate
|
||||
this.dataForm.productDetails = data.shopProduct.productDetails
|
||||
this.dataForm.poids = data.shopProduct.poids
|
||||
if (data.shopProduct.productImages != "") {
|
||||
var img = { name: '', url: data.shopProduct.productImages }
|
||||
var attr = []
|
||||
attr.push(img)
|
||||
this.fileList = attr
|
||||
}
|
||||
if (data.shopProduct.productImageList == null || data.shopProduct.productImageList[0] == '' || data.shopProduct.productImageList == "") {
|
||||
return this.swiperfileList = []
|
||||
}else{
|
||||
// 有轮播图
|
||||
console.log(data.shopProduct.productImageList)
|
||||
let arr = []
|
||||
let arr1 = []
|
||||
|
||||
arr = data.shopProduct.productImageList.split(',');
|
||||
console.log(arr)
|
||||
arr.forEach((item, index) => {
|
||||
arr1.push({ name: index, url: item })
|
||||
});
|
||||
this.swiperfileList = arr1
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取商品类型
|
||||
getGoodsTypeList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/sysdictdata/selectByType/goodsType'),
|
||||
method: 'get',
|
||||
}).then(({ data }) => {
|
||||
console.log(data.dataList)
|
||||
this.goodsTypeList = data.dataList
|
||||
})
|
||||
},
|
||||
dealImgChange(file, fileList) {
|
||||
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
this.dataForm.productImageList = this.getStringImgUrl()
|
||||
// console.log(this.dataForm.productImageList)
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/shopproduct/${!this.dataForm.productId ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'productId': this.dataForm.productId || undefined,
|
||||
'productName': this.dataForm.productName,
|
||||
'price': this.dataForm.price,
|
||||
'weight': this.dataForm.weight,
|
||||
'publishStatus': this.dataForm.publishStatus,
|
||||
'productPid': this.dataForm.poids[this.dataForm.poids.length - 1],
|
||||
'productImages': this.dataForm.productImages,
|
||||
'productImageList': this.dataForm.productImageList,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'delFlag': this.dataForm.delFlag,
|
||||
'sort': this.dataForm.sort,
|
||||
'goodsType': this.dataForm.goodsType,
|
||||
'productDetails': this.dataForm.productDetails,
|
||||
'author': this.dataForm.author,
|
||||
'publisher': this.dataForm.publisher,
|
||||
'pubDate': this.dataForm.pubDate,
|
||||
'format': this.dataForm.format, // 开本
|
||||
'pageNum': this.dataForm.pageNum,
|
||||
'quality': this.dataForm.quality, // 内文用纸
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/shopproduct/${!this.dataForm.productId ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'productId': this.dataForm.productId || undefined,
|
||||
'productName': this.dataForm.productName,
|
||||
'price': this.dataForm.price,
|
||||
'weight': this.dataForm.weight,
|
||||
'publishStatus': this.dataForm.publishStatus,
|
||||
'productPid': this.dataForm.poids[this.dataForm.poids.length-1],
|
||||
'productImages': this.dataForm.productImages,
|
||||
'createTime': this.dataForm.createTime,
|
||||
'updateTime': this.dataForm.updateTime,
|
||||
'delFlag': this.dataForm.delFlag,
|
||||
'sort': this.dataForm.sort
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
}).then(({data}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getTreeList() {
|
||||
} else {
|
||||
this.$message.error(data.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
changed(e){
|
||||
console.log(e)
|
||||
},
|
||||
getTreeList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/shopcategory/listTree`),
|
||||
method: 'get',
|
||||
@@ -208,21 +351,104 @@
|
||||
this.dataForm.productImages = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
bannerHandlePicSuccess(res, file) {
|
||||
// 轮播图上传成功
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.productImages = res.url;
|
||||
this.swiperfileList.push({ name: file.name, url: res.url })
|
||||
console.log(this.swiperfileList)
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
handleRemove(file) {
|
||||
// 字符串图片地址
|
||||
getStringImgUrl() {
|
||||
let arr = this.swiperfileList.map(item => item.url)
|
||||
if(arr.length <= 0){
|
||||
return null
|
||||
}else{
|
||||
return arr.toString()
|
||||
}
|
||||
},
|
||||
handlePicSuccess(res, file) {
|
||||
if (res.msg == "success") {
|
||||
this.dataForm.productImages = res;
|
||||
this.$message.success("上传成功");
|
||||
} else {
|
||||
this.$message.error("上传失败");
|
||||
}
|
||||
},
|
||||
bannerHandleRemove(file, fileList) {
|
||||
// 轮播图删除操作
|
||||
this.swiperfileList = fileList
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
this.dataForm.productImages = '';
|
||||
this.dataForm.noneBtnImg = fileList.length >= this.dataForm.limitCountImg;
|
||||
},
|
||||
handlereset(){
|
||||
handlereset() {
|
||||
this.fileList = [],
|
||||
this.visible = false
|
||||
this.visible = false
|
||||
},
|
||||
// 失去焦点事件
|
||||
onEditorBlur(quill) {
|
||||
console.log('editor blur!', quill)
|
||||
},
|
||||
// 获得焦点事件
|
||||
onEditorFocus(quill) {
|
||||
console.log('editor focus!', quill)
|
||||
},
|
||||
// 准备富文本编辑器
|
||||
onEditorReady(quill) {
|
||||
console.log('editor ready!', quill)
|
||||
},
|
||||
// 内容改变事件
|
||||
onEditorChange({ quill, html, text }) {
|
||||
console.log('editor change!', quill, html, text)
|
||||
this.content = html
|
||||
}
|
||||
},
|
||||
components: {
|
||||
quillEditor
|
||||
},
|
||||
watch: {
|
||||
visible: {
|
||||
handler(val, oldVal) {
|
||||
this.getGoodsTypeList()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.disUoloadSty {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
/* 上传按钮隐藏 */
|
||||
}
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
/deep/ .el-form-item__label {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-uploadfeng {
|
||||
/deep/ .el-upload-list__item {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
/deep/ .el-upload--picture-card {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 70px;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -26,15 +26,7 @@
|
||||
<template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="publishStatus" header-align="center" align="center" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-switch :active-value=1 :inactive-value=0 style="display: block" v-model="scope.row.publishStatus"
|
||||
@change="SwitchChange(scope.row)" active-color="#13ce66" inactive-color="#ff4949" active-text="上架"
|
||||
inactive-text="下架">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productName"
|
||||
header-align="center"
|
||||
@@ -46,54 +38,12 @@
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品价格">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="weight"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品重量">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="productPid"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="商品父id">
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column header-align="center" align="center" label="商品图">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.productImages != ''" :src="scope.row.productImages" width="70" height="100" class="tableImg" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="level"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="层级">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="delFlag"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="删除标记">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sort"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="排序">
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
|
||||
@@ -2,25 +2,19 @@
|
||||
<div class="mod-config">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||
<el-input v-model="dataForm.key" placeholder="参数名" clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">查询</el-button>
|
||||
<el-button v-if="isAuth('book:user:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
|
||||
<el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
<el-button v-if="isAuth('book:user:delete')" type="danger" @click="deleteHandle()"
|
||||
:disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection- change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="序号" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
@@ -33,47 +27,23 @@
|
||||
align="center"
|
||||
label="">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="姓名">
|
||||
<el-table-column prop="name" header-align="center" align="center" label="姓名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="age"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="年龄">
|
||||
<el-table-column prop="age" header-align="center" align="center" label="年龄">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="sex"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="性别">
|
||||
<el-table-column prop="sex" header-align="center" align="center" label="性别">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.sex == 0 ? '女':'男'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="avatar"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="头像">
|
||||
<el-table-column prop="avatar" header-align="center" align="center" label="头像">
|
||||
<template slot-scope="scope">
|
||||
<img v-if="scope.row.avatar != ''" :src="scope.row.avatar" width="50" height="50" class="tableImg" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="nickname"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="昵称">
|
||||
<el-table-column prop="nickname" header-align="center" align="center" label="昵称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="tel"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="电话">
|
||||
<el-table-column prop="tel" header-align="center" align="center" label="电话">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="password"
|
||||
@@ -81,11 +51,7 @@
|
||||
align="center"
|
||||
label="密码">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="vip"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="会员类型">
|
||||
<el-table-column prop="vip" header-align="center" align="center" label="会员类型">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="vipValidtime"
|
||||
@@ -93,11 +59,7 @@
|
||||
align="center"
|
||||
label="vip 有效期">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="peanutCoin"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="花生币">
|
||||
<el-table-column prop="peanutCoin" header-align="center" align="center" label="疯币">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="readTime"
|
||||
@@ -105,23 +67,11 @@
|
||||
align="center"
|
||||
label="阅读时间">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
prop="lastLoginTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="最后登录时间">
|
||||
<el-table-column prop="lastLoginTime" header-align="center" align="center" label="最后登录时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="创建时间">
|
||||
<el-table-column prop="createTime" header-align="center" align="center" label="创建时间">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="更新时间">
|
||||
<el-table-column prop="updateTime" header-align="center" align="center" label="更新时间">
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
prop="delFlag"
|
||||
@@ -129,73 +79,95 @@
|
||||
align="center"
|
||||
label="删除标记">
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="ck(scope.row.id)">充/扣花生币</el-button>
|
||||
<el-button type="text" size="small" @click="ck(scope.row)">充/扣疯币</el-button>
|
||||
<el-button type="text" size="small" @click="youhui(scope.row)">优惠券列表</el-button>
|
||||
<br>
|
||||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
<el-pagination @size-change="sizeChangeHandle" @current- change="currentChangeHandle" :current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
<el-dialog title="充/扣花生币" :close-on-click-modal="false" :visible.sync="adc" append-to-body width="30%">
|
||||
<el-form :model="pointForm">
|
||||
<el-form-item label="充值类型" label-width="15%">
|
||||
<!-- <el-input v-model="pointForm.pointType" placeholder="0-普通 1-vip"></el-input>
|
||||
|
||||
<el-dialog title="充/扣疯币" :close-on-click-modal="false" :visible.sync="adc" append-to-body width="30%">
|
||||
<el-form :model="pointForm" label-width="100px">
|
||||
<el-form-item label="用户">
|
||||
{{pointForm.tel}} <span v-if="pointForm.name!=''">({{pointForm.name}})</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="充值类型">
|
||||
<!-- <el-input v-model="pointForm.pointType" placeholder="0-普通 1-vip"></el-input>
|
||||
-->
|
||||
<el-select v-model="pointForm.pointType" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="金额" label-width="15%">
|
||||
<el-input-number v-model="pointForm.pointType" placeholder=""></el-input-number>
|
||||
</el-form-item>
|
||||
<el-select v-model="pointForm.pointType" placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="金额">
|
||||
<el-input-number v-model="pointForm.pointAmount" placeholder="">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="adc=false">取消</el-button>
|
||||
<el-button type="primary" >确定</el-button>
|
||||
</span>
|
||||
<el-button @click="adc=false">取消</el-button>
|
||||
<el-button type="primary" @click="huaSheng">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="优惠券列表" :close-on-click-modal="false" :visible.sync="youVisible" append-to-body width="600px">
|
||||
<el-form :model="youForm" label-width="100px">
|
||||
<el-form-item label="用户">
|
||||
{{youForm.tel}} <span v-if="youForm.name!=''">({{youForm.name}})</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="赠送优惠券">
|
||||
<el-select v-model="youForm.courType" placeholder="请选择">
|
||||
<el-option v-for="item in courperList" :key="item.id" :label="item.couponName" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" @click="surYou" :disabled="youForm.courType==undefined">赠送</el-button>
|
||||
</el-form-item>
|
||||
<el-table :data="courperHistList" border :key='Math.random()'>
|
||||
<el-table-column prop="couponName" label="已获得优惠券">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" header-align="center" align="center" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="courDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="youVisible=false">取消</el-button>
|
||||
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './user-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
},
|
||||
options: [{
|
||||
value: 0,
|
||||
label: '充花生币'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '扣花生币'
|
||||
}],
|
||||
adc:false,
|
||||
pointForm:{
|
||||
value: 0,
|
||||
label: '充疯币'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '扣疯币'
|
||||
}],
|
||||
adc: false,
|
||||
pointForm: {
|
||||
pointType: 0,
|
||||
},
|
||||
dataList: [],
|
||||
@@ -204,62 +176,86 @@
|
||||
totalPage: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false
|
||||
addOrUpdateVisible: false,
|
||||
youVisible: false,
|
||||
youForm: {},
|
||||
courperList: [],
|
||||
courperHistList: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
activated() {
|
||||
this.getDataList()
|
||||
this.getcourpeList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
getDataList() {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/user/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
'page': 1,
|
||||
'limit': 200,
|
||||
'key': ''
|
||||
})
|
||||
}).then(({data}) => {
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
} else {
|
||||
this.dataList = []
|
||||
this.totalPage = 0
|
||||
this.dataListLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取优惠券列表
|
||||
getcourpeList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/coupon/list'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key,
|
||||
'currentState': '1'
|
||||
})
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.courperList = data.page.list
|
||||
this.totalPage = data.page.totalCount
|
||||
}
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
deleteHandle(id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
@@ -272,7 +268,9 @@
|
||||
url: this.$http.adornUrl('/book/user/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@@ -288,8 +286,99 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
ck(){
|
||||
// 充值扣款疯币
|
||||
ck(e) {
|
||||
this.pointForm=e
|
||||
this.adc = true
|
||||
},
|
||||
huaSheng(){
|
||||
console.log(this.pointForm)
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/book/user/pointChange?pointType=${this.pointForm.pointType}&pointAmount=${this.pointForm.pointAmount}&id=${this.pointForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.getDataList()
|
||||
this.adc = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 个人优惠券
|
||||
youhui(e) {
|
||||
this.youForm = e
|
||||
this.youForm.memberId = e.id
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/couponhistory/list'),
|
||||
method: 'post',
|
||||
params: this.$http.adornParams({
|
||||
'userId': e.id
|
||||
})
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.courperHistList = data.page.list
|
||||
this.youVisible = true
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
surYou() {
|
||||
let arrList = {}
|
||||
arrList.memberId = this.youForm.memberId
|
||||
arrList.couponId = this.youForm.courType
|
||||
arrList.memberNickname = this.youForm.nickname
|
||||
arrList.useStatus = 0
|
||||
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/couponhistory/save'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(arrList, false)
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
this.youhui(this.youForm)
|
||||
this.getDataList()
|
||||
}else{
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除优惠券
|
||||
courDelete(e) {
|
||||
let arrList = []
|
||||
arrList.push(e.id)
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/book/couponhistory/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(arrList, false)
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
this.youhui(this.youForm)
|
||||
this.youVisible = true
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
window.SITE_CONFIG = {};
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://localhost:9100/pb';
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9100/pb';
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
|
||||
BIN
static/img/couponBg.jpg
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/img/flower.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
static/img/hasDeliver_icon.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |