Merge remote-tracking branch 'gitee/master'
# Conflicts: # src/router/index.js # src/view/Home.vue # yarn.lock
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@ node_modules
|
|||||||
/dist
|
/dist
|
||||||
/artifacts
|
/artifacts
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
/node_modules
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
|
|||||||
62364
node_modules/vue-plugin-hiprint/dist/vue-plugin-hiprint.js
generated
vendored
Normal file
62364
node_modules/vue-plugin-hiprint/dist/vue-plugin-hiprint.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -8,14 +8,17 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/g2plot": "^2.4.25",
|
"@antv/g2plot": "^2.4.25",
|
||||||
|
"@babel/standalone": "^7.25.8",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"bi-vue-mindmap": "^0.6.12",
|
"bi-vue-mindmap": "^0.6.12",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"crypto-js": "^4.0.0",
|
"crypto-js": "^4.0.0",
|
||||||
"dayjs": "^1.11.9",
|
"dayjs": "^1.11.9",
|
||||||
"element-ui": "^2.15.13",
|
"element-ui": "^2.15.13",
|
||||||
|
"eval5": "^1.4.8",
|
||||||
"file-saver": "^2.0.5",
|
"file-saver": "^2.0.5",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
|
"jsbarcode": "^3.11.6",
|
||||||
"query-string": "^9.0.0",
|
"query-string": "^9.0.0",
|
||||||
"spark-md5": "^3.0.2",
|
"spark-md5": "^3.0.2",
|
||||||
"v-viewer": "^1.6.4",
|
"v-viewer": "^1.6.4",
|
||||||
|
|||||||
@@ -347,3 +347,37 @@ table.hiprint-printElement-tableTarget {
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.temuBarCode {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 10pt 10pt;
|
||||||
|
border: 2pt solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-code {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-code svg {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-top,
|
||||||
|
.temuBarCode-bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 94%;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-middle {
|
||||||
|
width: 88%;
|
||||||
|
height: 60%;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,57 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="">
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
<head>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<link rel="stylesheet" type="text/css" media="print" href="<%= BASE_URL %>css/print-lock.css">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title>TEMU助手</title>
|
<link rel="stylesheet" type="text/css" media="print" href="<%= BASE_URL %>css/print-lock.css">
|
||||||
</head>
|
<title>TEMU助手</title>
|
||||||
<body>
|
<style>
|
||||||
<noscript>
|
.temuBarCode {
|
||||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
display: flex;
|
||||||
</noscript>
|
flex-direction: column;
|
||||||
<div id="app"></div>
|
justify-content: space-between;
|
||||||
<!-- built files will be auto injected -->
|
align-items: center;
|
||||||
</body>
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 10pt 10pt;
|
||||||
|
border: 2pt solid #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-code {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-code svg {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-top,
|
||||||
|
.temuBarCode-bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 94%;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.temuBarCode-middle {
|
||||||
|
width: 88%;
|
||||||
|
height: 60%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
|
||||||
|
Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -123,8 +123,8 @@ function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let models3 = document.querySelectorAll('div[class^="modal-content_content"]')
|
let models3 = document.querySelectorAll('div[class^="modal-content_content"]')
|
||||||
for (let i = 0; i < models2.length; i++) {
|
for (let i = 0; i < models3.length; i++) {
|
||||||
let tipsObj = models2[i].parentElement.querySelector('div[class^="modal-content_content"]')
|
let tipsObj = models3[i].parentElement.querySelector('div[class^="modal-content_content"]')
|
||||||
let spanObj = tipsObj.querySelector('div span:last-child')
|
let spanObj = tipsObj.querySelector('div span:last-child')
|
||||||
if (spanObj) {
|
if (spanObj) {
|
||||||
const popup = document.createElement("div")
|
const popup = document.createElement("div")
|
||||||
@@ -143,7 +143,7 @@ function init() {
|
|||||||
spanObj.appendChild(popup)
|
spanObj.appendChild(popup)
|
||||||
|
|
||||||
popup.addEventListener('click', async () => {
|
popup.addEventListener('click', async () => {
|
||||||
let tbodyObj = models2[i].parentElement.querySelector('tbody')
|
let tbodyObj = models3[i].parentElement.querySelector('tbody')
|
||||||
let trList = tbodyObj.querySelectorAll('tr')
|
let trList = tbodyObj.querySelectorAll('tr')
|
||||||
for (let i = 0; i < trList.length; i++) {
|
for (let i = 0; i < trList.length; i++) {
|
||||||
let tdObj = trList[i].querySelector('td:last-child')
|
let tdObj = trList[i].querySelector('td:last-child')
|
||||||
|
|||||||
24
public/rules_12.json
Normal file
24
public/rules_12.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": 23,
|
||||||
|
"priority": 1,
|
||||||
|
"action": {
|
||||||
|
"type": "modifyHeaders",
|
||||||
|
"requestHeaders": [
|
||||||
|
{
|
||||||
|
"header": "Origin",
|
||||||
|
"operation": "set",
|
||||||
|
"value": "http://xc.rqlis.com:888"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"header": "Host",
|
||||||
|
"operation": "set",
|
||||||
|
"value": "xc.rqlis.com:888"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"condition": {
|
||||||
|
"urlFilter": "||xc.rqlis.com"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import {genAnti} from "@/api/genAnti";
|
import { genAnti } from "@/api/genAnti";
|
||||||
|
import { Message } from 'element-ui'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向Chrome发送消息
|
* 向Chrome发送消息
|
||||||
@@ -20,9 +21,16 @@ export async function sendChromeAPIMessage(message) {
|
|||||||
if (message.anti) {
|
if (message.anti) {
|
||||||
message.anti = await genAnti.a()
|
message.anti = await genAnti.a()
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
chrome.runtime.sendMessage(message, resolve)
|
// chrome.runtime.sendMessage(message, resolve)
|
||||||
|
chrome.runtime.sendMessage(message, res => {
|
||||||
|
if (res.error_code === 40001) {
|
||||||
|
Message.error('请先登录拼多多跨境卖家中心')
|
||||||
|
}
|
||||||
|
resolve(res)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,3 +160,16 @@ export function sendGoodcangAPIMessage(message) {
|
|||||||
chrome.runtime.sendMessage(message, resolve)
|
chrome.runtime.sendMessage(message, resolve)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向Chrome发送消息
|
||||||
|
* @param message 消息
|
||||||
|
*/
|
||||||
|
export async function sendXcAPIMessage(message) {
|
||||||
|
message.type = 'xcApi'
|
||||||
|
message.url = "http://xc.rqlis.com:888/" + message.url;
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
// @ts-ignore
|
||||||
|
chrome.runtime.sendMessage(message, resolve)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import store from '@/store'
|
|||||||
|
|
||||||
|
|
||||||
var instance = axios.create({
|
var instance = axios.create({
|
||||||
baseURL: process.env.NODE_ENV === 'production' ? 'http://124.71.2.127:8888' : 'http://124.71.2.127:8888',
|
baseURL: process.env.NODE_ENV === 'production' ? 'http://temu.jjcp52.com' : 'http://124.71.2.127:10248',
|
||||||
timeout: 50000,
|
timeout: 50000,
|
||||||
validateStatus: function (status) {
|
validateStatus: function (status) {
|
||||||
return status < 500
|
return status < 500
|
||||||
|
|||||||
BIN
src/assets/code.png
Normal file
BIN
src/assets/code.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -1,21 +1,22 @@
|
|||||||
@import "./styles.scss";
|
@import "./styles.scss";
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'iconfont'; /* project id 1995974 */
|
font-family: 'iconfont';
|
||||||
|
/* project id 1995974 */
|
||||||
src: url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.eot');
|
src: url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.eot');
|
||||||
src: url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.eot?#iefix') format('embedded-opentype'),
|
src: url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.eot?#iefix') format('embedded-opentype'),
|
||||||
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.woff2') format('woff2'),
|
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.woff2') format('woff2'),
|
||||||
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.woff') format('woff'),
|
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.woff') format('woff'),
|
||||||
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.ttf') format('truetype'),
|
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.ttf') format('truetype'),
|
||||||
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.svg#iconfont') format('svg');
|
url('https://at.alicdn.com/t/font_1995974_ihzpmuv4lpk.svg#iconfont') format('svg');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: "iconfont";
|
font-family: "iconfont";
|
||||||
src: url('https://at.alicdn.com/t/c/font_4680344_rxl7gevvsys.woff2?t=1725970465332') format('woff2'),
|
src: url('https://at.alicdn.com/t/c/font_4680344_rxl7gevvsys.woff2?t=1725970465332') format('woff2'),
|
||||||
url('https://at.alicdn.com/t/c/font_4680344_rxl7gevvsys.woff?t=1725970465332') format('woff'),
|
url('https://at.alicdn.com/t/c/font_4680344_rxl7gevvsys.woff?t=1725970465332') format('woff'),
|
||||||
url('https://at.alicdn.com/t/c/font_4680344_rxl7gevvsys.ttf?t=1725970465332') format('truetype');
|
url('https://at.alicdn.com/t/c/font_4680344_rxl7gevvsys.ttf?t=1725970465332') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
@@ -28,12 +29,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
line-height: 1; /* 1 */
|
line-height: 1;
|
||||||
-webkit-text-size-adjust: 100%; /* 2 */
|
/* 1 */
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@@ -43,14 +47,19 @@ h1 {
|
|||||||
|
|
||||||
hr {
|
hr {
|
||||||
-webkit-box-sizing: content-box;
|
-webkit-box-sizing: content-box;
|
||||||
box-sizing: content-box; /* 1 */
|
box-sizing: content-box;
|
||||||
height: 0; /* 1 */
|
/* 1 */
|
||||||
overflow: visible; /* 2 */
|
height: 0;
|
||||||
|
/* 1 */
|
||||||
|
overflow: visible;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
font-family: monospace, monospace; /* 1 */
|
font-family: monospace, monospace;
|
||||||
font-size: 1em; /* 2 */
|
/* 1 */
|
||||||
|
font-size: 1em;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@@ -58,10 +67,13 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
abbr[title] {
|
abbr[title] {
|
||||||
border-bottom: none; /* 1 */
|
border-bottom: none;
|
||||||
text-decoration: underline; /* 2 */
|
/* 1 */
|
||||||
|
text-decoration: underline;
|
||||||
|
/* 2 */
|
||||||
-webkit-text-decoration: underline dotted;
|
-webkit-text-decoration: underline dotted;
|
||||||
text-decoration: underline dotted; /* 2 */
|
text-decoration: underline dotted;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
b,
|
b,
|
||||||
@@ -72,8 +84,10 @@ strong {
|
|||||||
code,
|
code,
|
||||||
kbd,
|
kbd,
|
||||||
samp {
|
samp {
|
||||||
font-family: monospace, monospace; /* 1 */
|
font-family: monospace, monospace;
|
||||||
font-size: 1em; /* 2 */
|
/* 1 */
|
||||||
|
font-size: 1em;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
small {
|
small {
|
||||||
@@ -105,14 +119,19 @@ input,
|
|||||||
optgroup,
|
optgroup,
|
||||||
select,
|
select,
|
||||||
textarea {
|
textarea {
|
||||||
font-family: inherit; /* 1 */
|
font-family: inherit;
|
||||||
font-size: 100%; /* 1 */
|
/* 1 */
|
||||||
line-height: 1.15; /* 1 */
|
font-size: 100%;
|
||||||
margin: 0; /* 2 */
|
/* 1 */
|
||||||
|
line-height: 1.15;
|
||||||
|
/* 1 */
|
||||||
|
margin: 0;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
button,
|
button,
|
||||||
input { /* 1 */
|
input {
|
||||||
|
/* 1 */
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
font-family: SJsuqian;
|
font-family: SJsuqian;
|
||||||
}
|
}
|
||||||
@@ -124,7 +143,8 @@ input::placeholder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
button,
|
button,
|
||||||
select { /* 1 */
|
select {
|
||||||
|
/* 1 */
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,12 +176,18 @@ fieldset {
|
|||||||
|
|
||||||
legend {
|
legend {
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
box-sizing: border-box; /* 1 */
|
box-sizing: border-box;
|
||||||
color: inherit; /* 2 */
|
/* 1 */
|
||||||
display: table; /* 1 */
|
color: inherit;
|
||||||
max-width: 100%; /* 1 */
|
/* 2 */
|
||||||
padding: 0; /* 3 */
|
display: table;
|
||||||
white-space: normal; /* 1 */
|
/* 1 */
|
||||||
|
max-width: 100%;
|
||||||
|
/* 1 */
|
||||||
|
padding: 0;
|
||||||
|
/* 3 */
|
||||||
|
white-space: normal;
|
||||||
|
/* 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
progress {
|
progress {
|
||||||
@@ -175,8 +201,10 @@ textarea {
|
|||||||
[type="checkbox"],
|
[type="checkbox"],
|
||||||
[type="radio"] {
|
[type="radio"] {
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
box-sizing: border-box; /* 1 */
|
box-sizing: border-box;
|
||||||
padding: 0; /* 2 */
|
/* 1 */
|
||||||
|
padding: 0;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
[type="number"]::-webkit-inner-spin-button,
|
[type="number"]::-webkit-inner-spin-button,
|
||||||
@@ -185,8 +213,10 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[type="search"] {
|
[type="search"] {
|
||||||
-webkit-appearance: textfield; /* 1 */
|
-webkit-appearance: textfield;
|
||||||
outline-offset: -2px; /* 2 */
|
/* 1 */
|
||||||
|
outline-offset: -2px;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
[type="search"]::-webkit-search-decoration {
|
[type="search"]::-webkit-search-decoration {
|
||||||
@@ -194,8 +224,10 @@ textarea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-file-upload-button {
|
::-webkit-file-upload-button {
|
||||||
-webkit-appearance: button; /* 1 */
|
-webkit-appearance: button;
|
||||||
font: inherit; /* 2 */
|
/* 1 */
|
||||||
|
font: inherit;
|
||||||
|
/* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
details {
|
details {
|
||||||
@@ -214,7 +246,10 @@ template {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4 {
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4 {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -232,7 +267,8 @@ a {
|
|||||||
transition: all .3s ease;
|
transition: all .3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul, li {
|
ul,
|
||||||
|
li {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -246,7 +282,8 @@ img {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
html, body {
|
html,
|
||||||
|
body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
@@ -276,7 +313,8 @@ img {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex-align, .flex-center {
|
.flex-align,
|
||||||
|
.flex-center {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
@@ -312,11 +350,13 @@ img {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fade-enter-active, .fade-leave-active {
|
.fade-enter-active,
|
||||||
transition: opacity .3s ease-in-out;
|
.fade-leave-active {
|
||||||
|
transition: opacity .2s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fade-enter, .fade-leave-to {
|
.fade-enter,
|
||||||
|
.fade-leave-to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +427,8 @@ img {
|
|||||||
line-height: 17px;
|
line-height: 17px;
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: SJsuqian;;
|
font-family: SJsuqian;
|
||||||
|
;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
@@ -437,7 +478,8 @@ img {
|
|||||||
background-color: #1FBAD6;
|
background-color: #1FBAD6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-button--danger:focus, .el-button.el-button--danger.is-link:not(.is-disabled):hover {
|
.el-button--danger:focus,
|
||||||
|
.el-button.el-button--danger.is-link:not(.is-disabled):hover {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
border-color: #FA5555;
|
border-color: #FA5555;
|
||||||
background-color: #FA5555;
|
background-color: #FA5555;
|
||||||
@@ -478,17 +520,17 @@ img {
|
|||||||
.search-item {
|
.search-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin: 0 16px 12px;
|
margin: 0 25px 10px 0;
|
||||||
|
|
||||||
label {
|
&>label {
|
||||||
|
width: 80px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #666;
|
color: #666;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
width: 100px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
width: 240px;
|
// width: 240px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -504,3 +546,34 @@ img {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.print-images {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 420px;
|
||||||
|
max-height: 400px;
|
||||||
|
padding: 0 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 180px;
|
||||||
|
height: 80px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
width: 100%;
|
||||||
|
line-height: 1.3;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
BIN
src/assets/images/avatar.png
Normal file
BIN
src/assets/images/avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 964 B |
BIN
src/assets/images/triman1.png
Normal file
BIN
src/assets/images/triman1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 185 KiB |
BIN
src/assets/tab_middle.png
Normal file
BIN
src/assets/tab_middle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<section class="ai-dialog__wrapper">
|
<section class="ai-dialog__wrapper">
|
||||||
<el-dialog custom-class="ai-dialog" v-on="$listeners" v-bind="$attrs" :visible.sync="dialog">
|
<el-dialog custom-class="ai-dialog" v-on="$listeners" v-bind="$attrs" :visible.sync="dialog" :close-on-click-modal="false">
|
||||||
<div class="ai-dialog__header fill" slot="title" v-text="title"/>
|
<div class="ai-dialog__header fill" slot="title" v-text="title"/>
|
||||||
<div class="ai-dialog__content">
|
<div class="ai-dialog__content">
|
||||||
<div class="ai-dialog__content--wrapper">
|
<div class="ai-dialog__content--wrapper">
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
<h2>{{ title }}</h2>
|
<h2>{{ title }}</h2>
|
||||||
<p>{{ tips }}</p>
|
<p>{{ tips }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="ailist-title__middle">
|
||||||
|
<slot name="center"/>
|
||||||
|
</div>
|
||||||
<div class="ailist-title__right">
|
<div class="ailist-title__right">
|
||||||
<div class="aititle-right__btns">
|
<div class="aititle-right__btns">
|
||||||
<slot name="rightBtn"/>
|
<slot name="rightBtn"/>
|
||||||
@@ -75,6 +78,11 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 48px;
|
height: 48px;
|
||||||
|
|
||||||
|
.ailist-title__middle {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.ailist-title__left {
|
.ailist-title__left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
511
src/components/LablesMember.vue
Normal file
511
src/components/LablesMember.vue
Normal file
@@ -0,0 +1,511 @@
|
|||||||
|
<template>
|
||||||
|
<transition name="fade">
|
||||||
|
<div class="LablesMember" v-if="isShow">
|
||||||
|
<div class="mask"></div>
|
||||||
|
<div class="LablesMember-wrapper">
|
||||||
|
<i class="el-icon-close" @click="hide"></i>
|
||||||
|
<div class="top">
|
||||||
|
<img src="../assets/images/avatar.png" />
|
||||||
|
<div class="top-right">
|
||||||
|
<div class="top-user">
|
||||||
|
<h2>用户:{{ $store.state.userInfo.name }}</h2>
|
||||||
|
<span></span>
|
||||||
|
</div>
|
||||||
|
<p>会员中心</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="middle">
|
||||||
|
<div class="middle-top">
|
||||||
|
<div class="tab">
|
||||||
|
<div @click="tabIndex = 0, currIndex = 0, getPriceList(1)" :class="[tabIndex === 0 ? 'active' : '']">
|
||||||
|
<span>金币充值</span>
|
||||||
|
</div>
|
||||||
|
<div @click="tabIndex = 1, currIndex = 0, getPriceList(0)" :class="[tabIndex === 1 ? 'active' : '']">
|
||||||
|
<span>年度会员</span>
|
||||||
|
</div>
|
||||||
|
<div @click="tabIndex = 2, currIndex = 0, getPriceList(2)" :class="[tabIndex === 2 ? 'active' : '']">
|
||||||
|
<span>高级功能</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content" v-if="tabIndex === 0">
|
||||||
|
<div class="title">金币充值</div>
|
||||||
|
<div class="tab-content__item--wrapper">
|
||||||
|
<div
|
||||||
|
class="tab-content__item"
|
||||||
|
:class="[currIndex === i ? 'active' : '']"
|
||||||
|
v-for="(price, i) in priceList"
|
||||||
|
:key="i"
|
||||||
|
@click="currIndex = i, getQrcode(price)">
|
||||||
|
<h3>{{ price.remark }}</h3>
|
||||||
|
<div class="price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.price }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="original-price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.originPrice }}</span>
|
||||||
|
</div>
|
||||||
|
<p>{{ price.coin }}条/每年</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content" v-if="tabIndex === 1">
|
||||||
|
<div class="title">年度会员</div>
|
||||||
|
<div class="tab-content__item--wrapper">
|
||||||
|
<div
|
||||||
|
class="tab-content__item"
|
||||||
|
:class="[currIndex === i ? 'active' : '']"
|
||||||
|
v-for="(price, i) in priceList"
|
||||||
|
:key="i"
|
||||||
|
@click="currIndex = i, getQrcode(price)">
|
||||||
|
<h3>{{ price.title }}</h3>
|
||||||
|
<div class="price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.price }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="original-price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.originPrice }}</span>
|
||||||
|
</div>
|
||||||
|
<!-- <p>{{ price.coin }}条/每年</p> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content" v-if="tabIndex === 2">
|
||||||
|
<div class="title">标签合成</div>
|
||||||
|
<div class="tab-content__item--wrapper">
|
||||||
|
<div
|
||||||
|
class="tab-content__item"
|
||||||
|
:class="[currIndex === i ? 'active' : (Number(labelInfo.level) >= Number(price.type) ? 'disabled' : '')]"
|
||||||
|
:data-level="price.type"
|
||||||
|
:data-index="labelInfo.level"
|
||||||
|
v-for="(price, i) in priceList"
|
||||||
|
:key="i"
|
||||||
|
@click="getQrcode(price, i)">
|
||||||
|
<h3>{{ price.remark }}</h3>
|
||||||
|
<div class="price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.price }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="original-price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span>{{ price.originPrice }}</span>
|
||||||
|
</div>
|
||||||
|
<p>{{ price.coin }}条/每年</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="title">支付方式</div>
|
||||||
|
<div class="bottom">
|
||||||
|
<div class="bottom-left">
|
||||||
|
<div class="code">
|
||||||
|
<vue-qr v-if="qrcode" :text="qrcode" :size="110" :margin="0" :logoSrc="wechatLogo"/>
|
||||||
|
</div>
|
||||||
|
<div class="paytype">
|
||||||
|
<svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M12.11 0H.89A.89.89 0 0 0 0 .89v11.22c0 .491.399.89.89.89h11.22a.89.89 0 0 0 .89-.89V.89a.89.89 0 0 0-.89-.89zM6.5 10.65a5.592 5.592 0 0 1-1.848-.311c-.364.241-.975.639-1.215.75-.352.162-.25-.188-.25-.188L3.395 9.7C2.24 8.895 1.499 7.654 1.499 6.26c0-2.426 2.239-4.392 5-4.392 1.693 0 3.188.74 4.093 1.869l-4.905 2.27s-.4.152-.75-.062c-.35-.213-.813-.564-.813-.564s-.538-.458-.25.376l.751 1.756s.089.524.687.189c.468-.262 4.103-2.454 5.666-3.397a3.94 3.94 0 0 1 .523 1.954c0 2.425-2.239 4.391-5.001 4.391z" fill="#09BB07" fill-rule="nonzero"></path>
|
||||||
|
</svg>
|
||||||
|
<span>微信支付</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bottom-right">
|
||||||
|
<div class="right-price">
|
||||||
|
<i>¥</i>
|
||||||
|
<span class="price">{{ currGoods.price || '' }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="pay-btn">
|
||||||
|
<el-button round size="mini" style="margin-right: 10px;" @click="isShow = false">取消支付</el-button>
|
||||||
|
<el-button round size="mini" type="warning" @click="$store.dispatch('getUserInfo'), isShow = false">我已支付</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import VueQr from 'vue-qr'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
VueQr
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
mallId: this.$store.state.mallId,
|
||||||
|
mallName: this.$store.state.mallName,
|
||||||
|
code: ''
|
||||||
|
},
|
||||||
|
isShow: false,
|
||||||
|
tabIndex: 0,
|
||||||
|
currIndex: 0,
|
||||||
|
qrcode: '',
|
||||||
|
priceList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
wechatLogo: () => require(`../assets/wechat_logo.png`),
|
||||||
|
|
||||||
|
...mapState(['labelInfo']),
|
||||||
|
|
||||||
|
currGoods () {
|
||||||
|
if (!this.priceList.length) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.priceList[this.currIndex]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.getPriceList(1)
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
getPriceList(type) {
|
||||||
|
this.$http.post(`/api/priceConfig/page?module=${type}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.priceList = res.data.records
|
||||||
|
if (res.data.records.length) {
|
||||||
|
if (this.tabIndex !== 2) {
|
||||||
|
this.getQrcode(res.data.records[0])
|
||||||
|
} else {
|
||||||
|
for (let i = 0; i < res.data.records.length; i++) {
|
||||||
|
if (res.data.records[i].type > this.labelInfo.level) {
|
||||||
|
this.getQrcode(res.data.records[i], i)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getQrcode(item, index) {
|
||||||
|
if (this.tabIndex === 2 && item.type <= this.labelInfo.level) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.tabIndex === 2) {
|
||||||
|
this.currIndex = index
|
||||||
|
}
|
||||||
|
this.$http.post(`/api/order/createOrder`, null, {
|
||||||
|
params: {
|
||||||
|
priceConfigId: item.id
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res?.data?.id) {
|
||||||
|
return res.data.id
|
||||||
|
}
|
||||||
|
}).then(id => this.$http.post(`/api/order/createPrepayOrder?id=${id}`)).then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.qrcode = res.data.codeUrl
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
show(i) {
|
||||||
|
this.currIndex = 0
|
||||||
|
this.tabIndex = {
|
||||||
|
'0': 1,
|
||||||
|
'1': 0,
|
||||||
|
'2': 2
|
||||||
|
}[i]
|
||||||
|
this.getPriceList(i)
|
||||||
|
this.isShow = true
|
||||||
|
},
|
||||||
|
|
||||||
|
hide () {
|
||||||
|
this.isShow = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.LablesMember {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1111;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin: 20px 0 10px 40px;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: left;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #2a2b2e;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mask {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: rgba($color: #000000, $alpha: 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.LablesMember-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
z-index: 11;
|
||||||
|
min-width: 916px;
|
||||||
|
// height: 620px;
|
||||||
|
padding: 40px 40px;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
border-radius: 12px;
|
||||||
|
overflow: hidden;
|
||||||
|
background: linear-gradient(41deg, #ffebd3, #fff8e3 61%, #fae2c4 99%);
|
||||||
|
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #632e2e;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-user {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-right: 6px;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-close {
|
||||||
|
position: absolute;
|
||||||
|
top: 12px;
|
||||||
|
right: 12px;
|
||||||
|
z-index: 11;
|
||||||
|
font-size: 32px;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
transform-origin: center center;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.6;
|
||||||
|
// transform: translate(50%, -50%) rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.middle {
|
||||||
|
padding-bottom: 20px;
|
||||||
|
border-radius: 20px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 20px 0 hsla(0, 39%, 56%, .1), 0 0 16px 0 rgba(0, 0, 0, .08);
|
||||||
|
|
||||||
|
.middle-top {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 0;
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 50px;
|
||||||
|
background: #fff3ee;
|
||||||
|
|
||||||
|
div {
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
height: 50px;
|
||||||
|
line-height: 50px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #b69593;
|
||||||
|
|
||||||
|
span {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: #6f3333;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background: url(../assets/tab_middle.png) no-repeat center;
|
||||||
|
background-size: contain;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 0 40px;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item--wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 140px;
|
||||||
|
height: 170px;
|
||||||
|
margin-right: 14px;
|
||||||
|
padding-top: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid rgba(0, 0, 0, .08);
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
border: 1px solid #ff7548;
|
||||||
|
background: linear-gradient(33deg, #ffd1c5 -10%, #ffd1c5 21%, #ffe8e5 85%);
|
||||||
|
}
|
||||||
|
|
||||||
|
&.disabled {
|
||||||
|
cursor: no-drop;
|
||||||
|
background: #f4f4f4;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-top: 10px;
|
||||||
|
color: #d9451e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.original-price {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #888;
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
.price {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
color: #f13d3d;
|
||||||
|
font-size: 16px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 0 40px;
|
||||||
|
|
||||||
|
.bottom-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-left {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.paytype {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 6px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-left: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.pay-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-price {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
color: #f13d3d;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
span {
|
||||||
|
margin-left: 4px;
|
||||||
|
font-size: 30px;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
width: 110px;
|
||||||
|
height: 110px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="print">
|
<div class="print">
|
||||||
<div class="print-wrapper">
|
<div class="print-wrapper" v-if="!isPrint">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div class="left-wrapper">
|
<div class="left-wrapper">
|
||||||
<div class="title">基础元素</div>
|
<div class="title">基础元素</div>
|
||||||
@@ -9,10 +9,6 @@
|
|||||||
<i class="iconfont"></i>
|
<i class="iconfont"></i>
|
||||||
<span>文本</span>
|
<span>文本</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="false" class="ep-draggable-item item" tid="defaultModule.image">
|
|
||||||
<i class="iconfont"></i>
|
|
||||||
<span>图片</span>
|
|
||||||
</div>
|
|
||||||
<div class="ep-draggable-item item" tid="defaultModule.longText">
|
<div class="ep-draggable-item item" tid="defaultModule.longText">
|
||||||
<i class="iconfont"></i>
|
<i class="iconfont"></i>
|
||||||
<span>长文</span>
|
<span>长文</span>
|
||||||
@@ -21,10 +17,6 @@
|
|||||||
<i class="iconfont"></i>
|
<i class="iconfont"></i>
|
||||||
<span>表格</span>
|
<span>表格</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="ep-draggable-item item" tid="defaultModule.html">
|
|
||||||
<i class="iconfont"></i>
|
|
||||||
<span>html</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="title">辅助元素</div>
|
<div class="title">辅助元素</div>
|
||||||
<div class="left-item__wrapper">
|
<div class="left-item__wrapper">
|
||||||
@@ -47,21 +39,37 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="title">常用元素</div>
|
<div class="title">常用元素</div>
|
||||||
<div class="left-item__wrapper" id="custom-provider">
|
<div class="left-item__wrapper" id="custom-provider">
|
||||||
<div class="ep-draggable-item item" tid="defaultModule.hline">
|
</div>
|
||||||
<i class="iconfont"></i>
|
<div class="title">
|
||||||
<span>横线</span>
|
<span>素材</span>
|
||||||
|
</div>
|
||||||
|
<div class="left-item__wrapper">
|
||||||
|
<div
|
||||||
|
class="item"
|
||||||
|
style="cursor: pointer;"
|
||||||
|
@click="search.type = 1, search.current = 1, isShowImage = true, getConfig()">
|
||||||
|
<div>图片素材</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ep-draggable-item item" tid="defaultModule.vline">
|
<div
|
||||||
<i class="iconfont"></i>
|
class="item"
|
||||||
<span>竖线</span>
|
style="cursor: pointer;"
|
||||||
|
@click="search.type = 0, search.current = 1, isShowImage = true, getConfig()">
|
||||||
|
<div>文字素材</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ep-draggable-item item" tid="defaultModule.rect">
|
</div>
|
||||||
<i class="iconfont"></i>
|
<div class="title">
|
||||||
<span>矩形</span>
|
<span>动态数据(如日期)</span>
|
||||||
</div>
|
<el-button type="primary" size="mini" @click="addField">添加</el-button>
|
||||||
<div class="ep-draggable-item item" tid="defaultModule.oval">
|
</div>
|
||||||
<i class="iconfont"></i>
|
<div class="left-item__wrapper">
|
||||||
<span>圆形</span>
|
<div
|
||||||
|
class="item"
|
||||||
|
v-for="(item, index) in dynamicFromList"
|
||||||
|
:key="index"
|
||||||
|
style="cursor: pointer;"
|
||||||
|
@click="addItemToCanvas(item.fieldName)">
|
||||||
|
<div>{{ item.fieldName }}</div>
|
||||||
|
<span class="el-icon-error" @click.stop="removeField(index)"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,15 +95,7 @@
|
|||||||
<el-button slot="reference" size="small" :type="'other' == curPaperType ? 'primary' : ''">自定义纸张</el-button>
|
<el-button slot="reference" size="small" :type="'other' == curPaperType ? 'primary' : ''">自定义纸张</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
<!-- <div class="scale">
|
<el-button @click="isShowTemplate = true" type="warning" size="small" style="margin-left: 10px;">模板库</el-button>
|
||||||
<el-button @click="changeScale(false)" size="small">
|
|
||||||
<el-icon size="18"><ZoomOut /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
<div style="margin: 0 4px; width: 40px">{{ (scaleValue * 100).toFixed(0) }}%</div>
|
|
||||||
<el-button @click="changeScale(true)" size="small">
|
|
||||||
<el-icon size="18"><ZoomIn /></el-icon>
|
|
||||||
</el-button>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="center-wrapper">
|
<div class="center-wrapper">
|
||||||
@@ -112,14 +112,129 @@
|
|||||||
<el-button @click="isShowPreview = false">取消</el-button>
|
<el-button @click="isShowPreview = false">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
|
<ai-dialog :visible.sync="isShowImage" title="图片/文字素材" width="960" customFooter>
|
||||||
|
<el-select v-model="search.type" placeholder="请选择图片/文字素材" size="small" @change="search.current = 1, getConfig()">
|
||||||
|
<el-option label="图片素材" :value="1"></el-option>
|
||||||
|
<el-option label="文字素材" :value="0"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<ai-table
|
||||||
|
v-if="search.type === 1"
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
style="margin-top: 8px;"
|
||||||
|
height="400"
|
||||||
|
@getList="getConfig">
|
||||||
|
<el-table-column slot="image" label="图片" align="left">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-image
|
||||||
|
v-if="search.type === 1"
|
||||||
|
style="width: 80px; height: 80px"
|
||||||
|
:src="row.imgUrl"
|
||||||
|
:preview-src-list="[row.imgUrl]">
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" label="操作" align="center">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="row.type === '1' ? addImage(row.imgUrl) : addText(row.contents), isShowImage = false">添加</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<ai-table
|
||||||
|
v-if="search.type === 0"
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
:current.sync="search.current"
|
||||||
|
:size.sync="search.size"
|
||||||
|
style="margin-top: 8px;"
|
||||||
|
height="400"
|
||||||
|
@getList="getConfig">
|
||||||
|
<el-table-column slot="options" label="操作" align="center">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="row.type === '1' ? addImage(row.imgUrl) : addText(row.contents), isShowImage = false">添加</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<div class="dialog-footer" slot="footer">
|
||||||
|
<el-button @click="isShowImage = false">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-dialog>
|
||||||
|
<ai-dialog
|
||||||
|
:visible.sync="isShowDynamicForm"
|
||||||
|
title="动态数据"
|
||||||
|
width="590px"
|
||||||
|
@confirm="onConfirm">
|
||||||
|
<el-form :model="dynamicFrom" ref="form" label-width="100px">
|
||||||
|
<el-form-item
|
||||||
|
label="数据名称:"
|
||||||
|
:prop="`field_${dynamicFromList.length > 9 ? dynamicFromList.length + 1 : '0' + (dynamicFromList.length + 1)}`"
|
||||||
|
:rules="[{ required: true, message: '请输入数据名称', trigger: 'blur' }]">
|
||||||
|
<el-input placeholder="请输入数据名称" type="text" v-model="dynamicFrom[`field_${dynamicFromList.length > 9 ? dynamicFromList.length + 1 : '0' + (dynamicFromList.length + 1)}`]"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
|
<ai-dialog :visible.sync="isShowTemplate" title="模板库" width="1060px" customFooter>
|
||||||
|
<div class="templateList-wrapper" v-infinite-scroll="getTemplateList" :infinite-scroll-distance="20">
|
||||||
|
<div class="templateList">
|
||||||
|
<div class="templateList-item" v-for="(item, index) in templateList" :key="index">
|
||||||
|
<!-- <img :src="item.previewUrl" /> -->
|
||||||
|
<el-image
|
||||||
|
style="height: 180px;"
|
||||||
|
fit="contain"
|
||||||
|
:src="item.previewUrl"
|
||||||
|
:preview-src-list="[item.previewUrl]">
|
||||||
|
</el-image>
|
||||||
|
<h2>{{ item.name }}</h2>
|
||||||
|
<el-button type="warning" size="mini" @click="updateTempate(item)">使用模板</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <ai-table
|
||||||
|
:tableData="templateList"
|
||||||
|
:col-configs="templateColConfigs"
|
||||||
|
:total="templateTotal"
|
||||||
|
:current.sync="searchTemplate.current"
|
||||||
|
:size.sync="searchTemplate.size"
|
||||||
|
height="480"
|
||||||
|
@getList="getTemplateList"
|
||||||
|
v-loading="templateLoading">
|
||||||
|
<el-table-column slot="img" label="预览图" align="center">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-image
|
||||||
|
style="width: 200px; height: 200px"
|
||||||
|
fit="contain"
|
||||||
|
:src="row.previewUrl"
|
||||||
|
:preview-src-list="[row.previewUrl]">
|
||||||
|
</el-image>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" label="操作" align="center" width="200">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="showTemplate(row)">模板预览</el-button>
|
||||||
|
<el-button type="text" @click="updateTempate(row)">使用</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table> -->
|
||||||
|
<div class="dialog-footer" slot="footer">
|
||||||
|
<el-button @click="isShowTemplate = false">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</ai-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { hiprint, defaultElementTypeProvider, disAutoConnect } from 'vue-plugin-hiprint'
|
import { hiprint, defaultElementTypeProvider, disAutoConnect } from 'vue-plugin-hiprint'
|
||||||
import { newHiprintPrintTemplate } from '@/utils/template-helper'
|
import { newHiprintPrintTemplate } from '@/utils/template-helper'
|
||||||
import template from './template'
|
|
||||||
import printData from './printData'
|
|
||||||
import { customProvider } from './customProvider'
|
import { customProvider } from './customProvider'
|
||||||
|
|
||||||
disAutoConnect()
|
disAutoConnect()
|
||||||
@@ -131,6 +246,45 @@
|
|||||||
default: () => {
|
default: () => {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
params: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
printData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
template: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {
|
||||||
|
"panels": [{
|
||||||
|
"index": 0,
|
||||||
|
"name": 1,
|
||||||
|
"height": 200,
|
||||||
|
"width": 200,
|
||||||
|
"printElements": [],
|
||||||
|
"paperNumberDisabled": true,
|
||||||
|
"paperNumberContinue": true,
|
||||||
|
"fontFamily": "Microsoft YaHei",
|
||||||
|
"watermarkOptions": {}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
isPrint: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -139,40 +293,79 @@
|
|||||||
html: '',
|
html: '',
|
||||||
isShowPreview: false,
|
isShowPreview: false,
|
||||||
hiprintTemplate: null,
|
hiprintTemplate: null,
|
||||||
|
isShowTemplate: false,
|
||||||
|
templateList: [],
|
||||||
curPaper: {
|
curPaper: {
|
||||||
type: 'other',
|
type: 'other',
|
||||||
width: 200,
|
width: 200,
|
||||||
height: 200
|
height: 200
|
||||||
},
|
},
|
||||||
paperTypes: {
|
paperTypes: {
|
||||||
'A3': {
|
'100 * 100': {
|
||||||
width: 420,
|
width: 200,
|
||||||
height: 296.6
|
height: 200
|
||||||
},
|
},
|
||||||
'A4': {
|
'100 * 80': {
|
||||||
width: 210,
|
width: 200,
|
||||||
height: 296.6
|
height: 160
|
||||||
},
|
},
|
||||||
'A5': {
|
'80 * 60': {
|
||||||
width: 210,
|
width: 160,
|
||||||
height: 147.6
|
height: 120
|
||||||
},
|
},
|
||||||
'B3': {
|
'60 * 40': {
|
||||||
width: 500,
|
width: 120,
|
||||||
height: 352.6
|
height: 80
|
||||||
},
|
|
||||||
'B4': {
|
|
||||||
width: 250,
|
|
||||||
height: 352.6
|
|
||||||
},
|
|
||||||
'B5': {
|
|
||||||
width: 250,
|
|
||||||
height: 175.6
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
paperPopVisible: false,
|
paperPopVisible: false,
|
||||||
paperWidth: '80',
|
paperWidth: 200,
|
||||||
paperHeight: '60'
|
paperHeight: 200,
|
||||||
|
isShowDynamicForm: false,
|
||||||
|
dynamicFrom: {
|
||||||
|
},
|
||||||
|
dynamicFromList: [],
|
||||||
|
panel: null,
|
||||||
|
contents: [],
|
||||||
|
images: [],
|
||||||
|
search: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
type: 1
|
||||||
|
},
|
||||||
|
searchTemplate: {
|
||||||
|
current: 1,
|
||||||
|
size: 8,
|
||||||
|
type: 1
|
||||||
|
},
|
||||||
|
templateTotal: 0,
|
||||||
|
isShowImage: false,
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
templateColConfigs: [
|
||||||
|
{ prop: 'name', label: '模板名称', align: 'left' },
|
||||||
|
{ slot: 'img'}
|
||||||
|
],
|
||||||
|
templateLoading: false,
|
||||||
|
hasMore: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
watch: {
|
||||||
|
template: {
|
||||||
|
handler(value) {
|
||||||
|
if (value && this.hiprintTemplate && !this.isPrint) {
|
||||||
|
const config = value.panels[0]
|
||||||
|
this.hiprintTemplate.update(value)
|
||||||
|
this.curPaper = {type: 'other', width: config.width, height: config.height}
|
||||||
|
this.hiprintTemplate.setPaper(config.width, config.height)
|
||||||
|
|
||||||
|
if (this.params) {
|
||||||
|
this.dynamicFromList = this.params
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -188,30 +381,187 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return type
|
return type
|
||||||
|
},
|
||||||
|
|
||||||
|
colConfigs () {
|
||||||
|
if (this.search.type === 1) {
|
||||||
|
return [
|
||||||
|
{ slot: 'image' },
|
||||||
|
{ prop: 'remark', label: '描述', align: 'center' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
{ prop: 'contents', label: '文本', align: 'center' },
|
||||||
|
{ prop: 'remark', label: '描述', align: 'center' }
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
hiprint.init({
|
if (this.isPrint) {
|
||||||
providers: [defaultElementTypeProvider(), customProvider({})]
|
this.hiprintTemplate = newHiprintPrintTemplate('temulables')
|
||||||
})
|
} else {
|
||||||
|
hiprint.init({
|
||||||
|
providers: [defaultElementTypeProvider(), customProvider({})]
|
||||||
|
})
|
||||||
|
this.buildLeftElement()
|
||||||
|
this.buildDesigner()
|
||||||
|
this.getConfig()
|
||||||
|
|
||||||
this.buildLeftElement()
|
this.getTemplateList()
|
||||||
this.buildDesigner()
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
addField() {
|
||||||
|
const num = this.dynamicFromList.length > 9 ? this.dynamicFromList.length + 1 : `0${this.dynamicFromList.length + 1}`
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-empty
|
||||||
|
if (this.dynamicFromList.length && !this.dynamicFromList.at(-1)[`field_${num}`]) {
|
||||||
|
} else {
|
||||||
|
this.$set(this.dynamicFrom, `field_${num}`, '')
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isShowDynamicForm = true
|
||||||
|
},
|
||||||
|
|
||||||
|
removeField(index) {
|
||||||
|
this.dynamicFromList.splice(index, 1)
|
||||||
|
},
|
||||||
|
|
||||||
|
updateTempate(row) {
|
||||||
|
this.templateLoading = true
|
||||||
|
this.$http.post(`/api/templateRecommend/detail?id=${row.id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const config = JSON.parse(res.data.content)
|
||||||
|
this.hiprintTemplate.update(config)
|
||||||
|
this.hiprintTemplate.setPaper(config.panels[0].width, config.panels[0].height)
|
||||||
|
|
||||||
|
this.dynamicFromList = JSON.parse(res.data.params)
|
||||||
|
this.isShowTemplate = false
|
||||||
|
}
|
||||||
|
|
||||||
|
this.templateLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getTemplateList() {
|
||||||
|
if (!this.hasMore) return
|
||||||
|
if (this.templateLoading) return
|
||||||
|
this.templateLoading = true
|
||||||
|
this.$http.post(`/api/templateRecommend/getRecommendPage`, null, {
|
||||||
|
params: this.searchTemplate
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.templateList = [...this.templateList, ...res.data.records]
|
||||||
|
this.templateTotal = res.data.total
|
||||||
|
|
||||||
|
if (res.data.records.length < this.searchTemplate.size) {
|
||||||
|
this.hasMore = false
|
||||||
|
} else {
|
||||||
|
this.searchTemplate.current = this.searchTemplate.current + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
this.templateLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
showTemplate (row) {
|
||||||
|
this.templateLoading = true
|
||||||
|
this.$http.post(`/api/templateRecommend/detail?id=${row.id}`).then(res => {
|
||||||
|
this.templateLoading = false
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.html = res.data.codes
|
||||||
|
this.isShowPreview = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getConfig() {
|
||||||
|
this.$http.post(`/api/material/getPage?current=${this.search.current}&size=${this.search.size}&type=${this.search.type}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.tableData = res.data.records
|
||||||
|
this.total = res.data.total
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
addImage(src) {
|
||||||
|
this.panel.addPrintImage({
|
||||||
|
options: {
|
||||||
|
title: '',
|
||||||
|
left: 70.5,
|
||||||
|
top: 58.5,
|
||||||
|
src: src,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
fit: 'contain'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const el = this.hiprintTemplate.printPanels[0].printElements.at(-1)
|
||||||
|
const designPaper = this.hiprintTemplate.printPanels[0].designPaper
|
||||||
|
this.hiprintTemplate.printPanels[0].appendDesignPrintElement(designPaper, el, true)
|
||||||
|
el.design(void 0, designPaper)
|
||||||
|
},
|
||||||
|
|
||||||
|
addText(text, isSetField = false) {
|
||||||
|
this.panel.addPrintText({
|
||||||
|
options: {
|
||||||
|
field: isSetField ? text : '',
|
||||||
|
testData: isSetField ? text : '',
|
||||||
|
title: isSetField ? '' : text,
|
||||||
|
left: 70.5,
|
||||||
|
top: 58.5,
|
||||||
|
width: 140,
|
||||||
|
height: 20,
|
||||||
|
coordinateSync: true,
|
||||||
|
contentPaddingLeft: 5.25,
|
||||||
|
textContentVerticalAlign: 'middle',
|
||||||
|
widthHeightSync: true,
|
||||||
|
hideTitle: true,
|
||||||
|
fontFamily: 'Microsoft YaHei',
|
||||||
|
fontWeight: '700'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const el = this.hiprintTemplate.printPanels[0].printElements.at(-1)
|
||||||
|
const designPaper = this.hiprintTemplate.printPanels[0].designPaper
|
||||||
|
this.hiprintTemplate.printPanels[0].appendDesignPrintElement(designPaper, el, true)
|
||||||
|
el.design(void 0, designPaper)
|
||||||
|
},
|
||||||
|
|
||||||
|
addItemToCanvas(name) {
|
||||||
|
this.addText(name, true)
|
||||||
|
},
|
||||||
|
|
||||||
|
onConfirm() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const num = this.dynamicFromList.length > 9 ? this.dynamicFromList.length + 1 : `0${this.dynamicFromList.length + 1}`
|
||||||
|
this.dynamicFromList.push({
|
||||||
|
fieldValue: `field_${num}`,
|
||||||
|
fieldName: this.dynamicFrom[`field_${num}`]
|
||||||
|
})
|
||||||
|
this.isShowDynamicForm = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
buildLeftElement() {
|
buildLeftElement() {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
|
hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
$('#custom-provider').empty()
|
$('#custom-provider').empty()
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
hiprint.PrintElementTypeManager.build($('#custom-provider'), 'customProvider')
|
hiprint.PrintElementTypeManager.build($('#custom-provider'), 'customProvider')
|
||||||
},
|
},
|
||||||
|
|
||||||
buildDesigner() {
|
buildDesigner() {
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
$('#hiprint-printTemplate').empty()
|
$('#hiprint-printTemplate').empty()
|
||||||
console.log(template)
|
|
||||||
this.hiprintTemplate = newHiprintPrintTemplate('temulables', {
|
this.hiprintTemplate = newHiprintPrintTemplate('temulables', {
|
||||||
template: template,
|
template: this.template,
|
||||||
settingContainer: '#PrintElementOptionSetting',
|
settingContainer: '#PrintElementOptionSetting',
|
||||||
onImageChooseClick: (target) => {
|
onImageChooseClick: (target) => {
|
||||||
let input = document.createElement('input')
|
let input = document.createElement('input')
|
||||||
@@ -219,7 +569,6 @@
|
|||||||
input.click()
|
input.click()
|
||||||
input.onchange = function () {
|
input.onchange = function () {
|
||||||
var file = this.files[0]
|
var file = this.files[0]
|
||||||
var reader = new FileReader()
|
|
||||||
if (file) {
|
if (file) {
|
||||||
var reader = new FileReader()
|
var reader = new FileReader()
|
||||||
reader.readAsDataURL(file)
|
reader.readAsDataURL(file)
|
||||||
@@ -232,10 +581,13 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.hiprintTemplate.design('#hiprint-printTemplate', {
|
this.hiprintTemplate.design('#hiprint-printTemplate', {
|
||||||
grid: true
|
grid: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.panel = this.hiprintTemplate.printPanels[0]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -262,42 +614,60 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
print() {
|
print() {
|
||||||
let options = { leftOffset: 0, topOffset: 0 }
|
this.hiprintTemplate.print(this.printData)
|
||||||
let ext = {
|
},
|
||||||
callback: () => {
|
|
||||||
console.log('浏览器打印窗口已打开')
|
|
||||||
},
|
|
||||||
|
|
||||||
styleHandler: () => {
|
// js打印(不显示设计界面)
|
||||||
return '<style></style>'
|
toPrint (template, printData) {
|
||||||
}
|
this.hiprintTemplate = newHiprintPrintTemplate('temulables')
|
||||||
}
|
|
||||||
|
|
||||||
const list = this.labels
|
setTimeout(() => {
|
||||||
this.hiprintTemplate.print(list)
|
this.hiprintTemplate.update(template)
|
||||||
|
this.hiprintTemplate.print(printData)
|
||||||
|
}, 100)
|
||||||
},
|
},
|
||||||
|
|
||||||
elementToString(el) {
|
elementToString(el) {
|
||||||
const node = document.createElement('div')
|
const node = document.createElement('div')
|
||||||
node.appendChild(el)
|
node.innerHTML = el.html()
|
||||||
|
|
||||||
return node.innerHTML
|
document.querySelector('body').appendChild(node)
|
||||||
|
const html = node.innerHTML
|
||||||
|
|
||||||
|
document.querySelector('body').removeChild(node)
|
||||||
|
return html
|
||||||
},
|
},
|
||||||
|
|
||||||
savePdf() {
|
savePdf() {
|
||||||
const list = this.labels
|
this.hiprintTemplate.toPdf(this.printData, '测试导出pdf',{scale:2 }).then(v => {
|
||||||
this.hiprintTemplate.toPdf(printData, '测试导出pdf')
|
console.log(v)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getHtml() {
|
save() {
|
||||||
const list = this.labels
|
const html = this.elementToString(this.hiprintTemplate.getHtml(this.printData))
|
||||||
this.html = this.elementToString(this.hiprintTemplate.getHtml(list)[0])
|
const json = this.hiprintTemplate.getJson()
|
||||||
|
|
||||||
console.log(this.html)
|
return {
|
||||||
|
html,
|
||||||
|
json,
|
||||||
|
params: JSON.stringify(this.dynamicFromList)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
preview() {
|
||||||
|
this.html = this.elementToString(this.hiprintTemplate.getHtml(this.printData))
|
||||||
this.isShowPreview = true
|
this.isShowPreview = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getHtml(template, printData) {
|
||||||
|
this.hiprintTemplate = newHiprintPrintTemplate('temulables')
|
||||||
|
|
||||||
|
this.hiprintTemplate.update(template)
|
||||||
|
const html = this.elementToString(this.hiprintTemplate.getHtml(printData))
|
||||||
|
return html
|
||||||
|
},
|
||||||
|
|
||||||
clearPaper() {
|
clearPaper() {
|
||||||
this.hiprintTemplate.clear()
|
this.hiprintTemplate.clear()
|
||||||
},
|
},
|
||||||
@@ -308,10 +678,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.print {
|
.print {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
.temuBarCode {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 1pt 3pt;
|
||||||
|
}
|
||||||
|
|
||||||
.print-wrapper {
|
.print-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: calc(100vh - 180px);
|
height: calc(100vh - 180px);
|
||||||
@@ -338,8 +715,9 @@
|
|||||||
::v-deep(.hiprint-printPanel) {
|
::v-deep(.hiprint-printPanel) {
|
||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
& > div {
|
.dynamicField {
|
||||||
// margin: 0 auto !important;
|
background-color: #bfc2e9;
|
||||||
|
border-color: #bfc2e9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,6 +758,10 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 320px;
|
||||||
margin: 14px 0;
|
margin: 14px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,9 +772,12 @@
|
|||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
position: relative;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
left: 0!important;
|
||||||
|
top: 0!important;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
@@ -404,8 +789,17 @@
|
|||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
i {
|
||||||
margin-top: 10px;
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-error {
|
||||||
|
position: absolute;
|
||||||
|
top: -6px;
|
||||||
|
right: -6px;
|
||||||
|
color: red;
|
||||||
|
font-size: 18px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,5 +888,49 @@
|
|||||||
.print-viewer {
|
.print-viewer {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.templateList-wrapper {
|
||||||
|
padding-right: 10px;
|
||||||
|
|
||||||
|
.templateList {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.templateList-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
width: 24%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
margin-right: 1.333%;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
|
||||||
|
.el-button {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin-top: 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-of-type(4n) {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,66 +1,132 @@
|
|||||||
|
/* eslint-disable no-undef */
|
||||||
import { hiprint } from 'vue-plugin-hiprint'
|
import { hiprint } from 'vue-plugin-hiprint'
|
||||||
export const customProvider = function (options) {
|
|
||||||
var addElementTypes = function (context) {
|
export const customProvider = function () {
|
||||||
|
const addElementTypes = function (context) {
|
||||||
context.removePrintElementTypes('customProvider')
|
context.removePrintElementTypes('customProvider')
|
||||||
context.addPrintElementTypes('customProvider', [
|
context.addPrintElementTypes('customProvider', [
|
||||||
new hiprint.PrintElementTypeGroup('', [
|
new hiprint.PrintElementTypeGroup('', [
|
||||||
{
|
{
|
||||||
tid: 'providerModule1.date',
|
tid: 'providerModule1.html',
|
||||||
title: '业务日期',
|
title: 'TEMU条码',
|
||||||
data: '2020-01-01',
|
|
||||||
type: 'text',
|
|
||||||
options: {
|
|
||||||
field: 'date',
|
|
||||||
testData: '2020-01-01',
|
|
||||||
height: 16,
|
|
||||||
fontSize: 6.75,
|
|
||||||
fontWeight: '700',
|
|
||||||
textAlign: 'left',
|
|
||||||
textContentVerticalAlign: 'middle',
|
|
||||||
hideTitle: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tid: 'providerModule1.barcode',
|
|
||||||
title: '条形码',
|
|
||||||
data: 'XS888888888',
|
data: 'XS888888888',
|
||||||
type: 'text',
|
type: 'html',
|
||||||
|
formatter: function (data, options, sukData) {
|
||||||
|
const elId = options.elId || 'barCode-' + new Date().getTime()
|
||||||
|
const codeWidth = parseInt((options.width - 22) * 0.85)
|
||||||
|
let printData = {
|
||||||
|
labelCode: 123456789,
|
||||||
|
productSkuId: `XXXXXXXXXXXXXX`,
|
||||||
|
skuExtCode: 'XXXXXXXXXXXXXX',
|
||||||
|
skuSpecName: 'XXXXX'
|
||||||
|
}
|
||||||
|
|
||||||
|
options.elId = `${elId}`
|
||||||
|
if (sukData) {
|
||||||
|
printData = sukData
|
||||||
|
}
|
||||||
|
|
||||||
|
$('body').append(`<div id="codewrapper-${elId}" style="width: ${codeWidth}pt">
|
||||||
|
<svg id="${elId}" width="100%" display="block" height="100%" class="hibarcode_imgcode" preserveAspectRatio="none slice"></svg>
|
||||||
|
</div>`)
|
||||||
|
JsBarcode('#' + elId, printData.labelCode, {
|
||||||
|
format: 'CODE128B',
|
||||||
|
width: 2,
|
||||||
|
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
|
||||||
|
margin: 0,
|
||||||
|
displayValue: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const codeHtml = $(`#codewrapper-${elId}`).html()
|
||||||
|
$(`body>#codewrapper-${elId}`).remove()
|
||||||
|
|
||||||
|
const resizeObserver = new ResizeObserver(() => {
|
||||||
|
JsBarcode('#' + elId, printData.labelCode, {
|
||||||
|
format: "CODE128B",
|
||||||
|
width: 2,
|
||||||
|
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
|
||||||
|
margin: 0,
|
||||||
|
displayValue: false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const node = document.getElementById(`temuBarCode-${elId}`)
|
||||||
|
if (node) {
|
||||||
|
resizeObserver.observe(node)
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
var html = `
|
||||||
|
<div class="temuBarCode" id="temuBarCode-${elId}">
|
||||||
|
<div class="temuBarCode-top">
|
||||||
|
<div class="hiprint-printElement-text-content hiprint-printElement-content">${printData.skuExtCode || printData.productSkcId}</div>
|
||||||
|
<div class="hiprint-printElement-text-content hiprint-printElement-content">${printData.skuSpecName}</div>
|
||||||
|
</div>
|
||||||
|
<div class="temuBarCode-middle">
|
||||||
|
<div class="hiprint-printElement-text-content hiprint-printElement-content temuBarCode-code" style="width: 100%">
|
||||||
|
${codeHtml}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="temuBarCode-bottom">
|
||||||
|
<div class="hiprint-printElement-text-content hiprint-printElement-content">${printData.productSkuId}</div>
|
||||||
|
<div class="hiprint-printElement-text-content hiprint-printElement-content">Made in China</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
return html
|
||||||
|
},
|
||||||
options: {
|
options: {
|
||||||
field: 'barcode',
|
width: 316,
|
||||||
testData: 'XS888888888',
|
height: 120,
|
||||||
height: 32,
|
elId: ''
|
||||||
fontSize: 12,
|
},
|
||||||
lineHeight: 18,
|
printElementType: {
|
||||||
textAlign: 'left',
|
|
||||||
textType: 'barcode',
|
|
||||||
hideTitle: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
tid: 'providerModule1.qrcode',
|
|
||||||
title: '二维码',
|
|
||||||
data: 'XS888888888',
|
|
||||||
type: 'text',
|
|
||||||
options: {
|
|
||||||
field: '',
|
|
||||||
testData: '',
|
|
||||||
height: 32,
|
|
||||||
fontSize: 12,
|
|
||||||
lineHeight: 18,
|
|
||||||
textType: 'qrcode',
|
|
||||||
hideTitle: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// tid: 'providerModule1.barcode',
|
||||||
|
// title: '条形码',
|
||||||
|
// data: 'XS888888888',
|
||||||
|
// type: 'text',
|
||||||
|
// options: {
|
||||||
|
// field: 'barcode',
|
||||||
|
// testData: 'XS888888888',
|
||||||
|
// height: 32,
|
||||||
|
// fontSize: 12,
|
||||||
|
// lineHeight: 18,
|
||||||
|
// textAlign: 'left',
|
||||||
|
// textType: 'barcode',
|
||||||
|
// hideTitle: false
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// tid: 'providerModule1.qrcode',
|
||||||
|
// title: '二维码',
|
||||||
|
// data: 'XS888888888',
|
||||||
|
// type: 'text',
|
||||||
|
// options: {
|
||||||
|
// field: '',
|
||||||
|
// testData: '',
|
||||||
|
// height: 32,
|
||||||
|
// fontSize: 12,
|
||||||
|
// lineHeight: 18,
|
||||||
|
// textType: 'qrcode',
|
||||||
|
// hideTitle: false
|
||||||
|
// }
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
tid: 'providerModule1.image',
|
tid: 'providerModule1.image',
|
||||||
title: 'Logo',
|
title: '图片',
|
||||||
data: 'https://foruda.gitee.com/avatar/1677050350324030848/5400665_ccsimple_1591166830.png!avatar200',
|
type: 'image',
|
||||||
type: 'image'
|
options: {
|
||||||
|
contain: 'contain',
|
||||||
|
src: 'http://lyshunong.oss-cn-beijing.aliyuncs.com/image/material/a6e14259412606502e49f1abd866039.png',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
addElementTypes: addElementTypes
|
addElementTypes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
62364
src/components/print/vue-plugin-hiprint.js
Normal file
62364
src/components/print/vue-plugin-hiprint.js
Normal file
File diff suppressed because one or more lines are too long
@@ -197,6 +197,38 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
|||||||
resolve({success: false, errorCode: -1})
|
resolve({success: false, errorCode: -1})
|
||||||
});
|
});
|
||||||
}).then(sendResponse);
|
}).then(sendResponse);
|
||||||
|
} else if (request.type == 'xcApi') {
|
||||||
|
new Promise(async (resolve) => {
|
||||||
|
let headers = {}, data;
|
||||||
|
headers.cookie = await getXcCookie();
|
||||||
|
console.log(headers)
|
||||||
|
if (!request.isFormData) {
|
||||||
|
headers['Content-Type'] = 'application/json';
|
||||||
|
data = JSON.stringify(request.data)
|
||||||
|
} else {
|
||||||
|
const formData = new FormData();
|
||||||
|
Object.keys(request.data).forEach(key => {
|
||||||
|
const value = request.data[key]
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value.forEach((subValue, i) => {
|
||||||
|
formData.append(key + `[${i}]`, subValue)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (key == "image") {
|
||||||
|
//跳过image的处理
|
||||||
|
} else formData.append(key, request.data[key])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
data = formData
|
||||||
|
}
|
||||||
|
Promise.resolve().then(() => fetch(request.url, {
|
||||||
|
'headers': headers, 'method': request.method, 'referrerPolicy': 'strict-origin-when-cross-origin', 'credentials': 'include', 'body': data, 'mode': 'cors'
|
||||||
|
})).then((res) => {
|
||||||
|
resolve(res.json());
|
||||||
|
}).catch(() => {
|
||||||
|
resolve({success: false, errorCode: -1})
|
||||||
|
});
|
||||||
|
}).then(sendResponse);
|
||||||
} else if (request.type == 'notify') {
|
} else if (request.type == 'notify') {
|
||||||
chrome.notifications.create("" + Math.random(), {
|
chrome.notifications.create("" + Math.random(), {
|
||||||
type: "basic", title: "TEMU助手", message: "您店铺【" + request.mallName + "】的商品【" + request.productName + "】成功加入发货台,请尽快处理", iconUrl: "./icons/48.png"
|
type: "basic", title: "TEMU助手", message: "您店铺【" + request.mallName + "】的商品【" + request.productName + "】成功加入发货台,请尽快处理", iconUrl: "./icons/48.png"
|
||||||
@@ -285,6 +317,18 @@ function getAliexpressCookie(link = "https://csp.aliexpress.com/") {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getXcCookie(link = "http://xc.rqlis.com:888/") {
|
||||||
|
let cStr = '';
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
chrome.cookies.getAll({url: link}, (cookie) => {
|
||||||
|
cookie.map((c) => {
|
||||||
|
cStr += c.name + '=' + c.value + ';';
|
||||||
|
});
|
||||||
|
resolve(cStr);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function formatParams(data) {
|
function formatParams(data) {
|
||||||
const arr = []
|
const arr = []
|
||||||
for (let name in data) {
|
for (let name in data) {
|
||||||
|
|||||||
@@ -21,6 +21,24 @@ Vue.prototype.$base = "https://seller.kuajingmaihuo.com"
|
|||||||
Object.keys(utils).forEach(v => Vue.prototype[`$${v}`] = utils[v])
|
Object.keys(utils).forEach(v => Vue.prototype[`$${v}`] = utils[v])
|
||||||
|
|
||||||
Vue.prototype.$http = instance
|
Vue.prototype.$http = instance
|
||||||
|
utils.initWindow()
|
||||||
|
Vue.directive('throttle', {
|
||||||
|
bind: function (el, obj) {
|
||||||
|
let timerId = null
|
||||||
|
let flag = true
|
||||||
|
|
||||||
|
el.addEventListener('input', function () {
|
||||||
|
if (!flag) return
|
||||||
|
|
||||||
|
flag = false
|
||||||
|
timerId && clearTimeout(timerId)
|
||||||
|
timerId = setTimeout(function () {
|
||||||
|
flag = true
|
||||||
|
obj.value()
|
||||||
|
}, 800)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
new Vue({
|
new Vue({
|
||||||
store,
|
store,
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
"*://*.shein.com/",
|
"*://*.shein.com/",
|
||||||
"*://*.geiwohuo.com/",
|
"*://*.geiwohuo.com/",
|
||||||
"*://*.ltwebstatic.com/",
|
"*://*.ltwebstatic.com/",
|
||||||
"*://*.goodcang.com/"
|
"*://*.goodcang.com/",
|
||||||
|
"*://*.rqlis.com/"
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"cookies",
|
"cookies",
|
||||||
@@ -82,6 +83,11 @@
|
|||||||
"id": "11",
|
"id": "11",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"path": "rules_11.json"
|
"path": "rules_11.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "12",
|
||||||
|
"enabled": true,
|
||||||
|
"path": "rules_12.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "TEMU助手",
|
"name": "TEMU助手",
|
||||||
"description": "TEMU助手 - 自动化提高生产效率",
|
"description": "TEMU助手 - 自动化提高生产效率",
|
||||||
"version": "3.3.1",
|
"version": "3.4.0",
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "/background.js"
|
"service_worker": "/background.js"
|
||||||
},
|
},
|
||||||
@@ -21,7 +21,8 @@
|
|||||||
"*://*.amazon.com/",
|
"*://*.amazon.com/",
|
||||||
"*://*.shein.com/",
|
"*://*.shein.com/",
|
||||||
"*://*.geiwohuo.com/",
|
"*://*.geiwohuo.com/",
|
||||||
"*://*.ltwebstatic.com/"
|
"*://*.ltwebstatic.com/",
|
||||||
|
"*://*.rqlis.com/"
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"cookies",
|
"cookies",
|
||||||
@@ -81,6 +82,11 @@
|
|||||||
"id": "11",
|
"id": "11",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"path": "rules_11.json"
|
"path": "rules_11.json"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "12",
|
||||||
|
"enabled": true,
|
||||||
|
"path": "rules_12.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -111,6 +111,11 @@ const router = new VueRouter({
|
|||||||
name: 'copyProductAliExpress',
|
name: 'copyProductAliExpress',
|
||||||
component: () => import('../view/product/CopyProductAliExpress.vue')
|
component: () => import('../view/product/CopyProductAliExpress.vue')
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'priceDown',
|
||||||
|
name: 'priceDown',
|
||||||
|
component: () => import('../view/product/PriceDown.vue')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'batchUpload',
|
path: 'batchUpload',
|
||||||
name: 'batchUpload',
|
name: 'batchUpload',
|
||||||
@@ -289,6 +294,12 @@ const router = new VueRouter({
|
|||||||
component: () => import('../view/data/SyncDataTemu.vue')
|
component: () => import('../view/data/SyncDataTemu.vue')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'sendGoods_xc',
|
||||||
|
name: 'sendGoods_xc',
|
||||||
|
component: () => import('../view/semi/SemiSendGoods_XC.vue')
|
||||||
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// path: 'statistics',
|
// path: 'statistics',
|
||||||
// name: 'statistics',
|
// name: 'statistics',
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ export default new Vuex.Store({
|
|||||||
activeDlgShow: false,
|
activeDlgShow: false,
|
||||||
showSheinAlert: false,
|
showSheinAlert: false,
|
||||||
showTemuAlert: false,
|
showTemuAlert: false,
|
||||||
userInfo: {}
|
userInfo: {},
|
||||||
|
labelInfo: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
mutations: {
|
mutations: {
|
||||||
@@ -54,6 +55,9 @@ export default new Vuex.Store({
|
|||||||
},
|
},
|
||||||
setTemuAlertShow(state, flag) {
|
setTemuAlertShow(state, flag) {
|
||||||
state.showTemuAlert = flag
|
state.showTemuAlert = flag
|
||||||
|
},
|
||||||
|
setLabelInfo(state, info) {
|
||||||
|
state.labelInfo = info
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -66,8 +70,25 @@ export default new Vuex.Store({
|
|||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
store.dispatch('getLabelInfo')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getLabelInfo(store) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
request.post('/api/userExtend/getLabelDetail').then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const isExpires = new Date().getTime() > new Date(res.data.expireTime).getTime() || res.data.skuUsed > res.data.skuTotal
|
||||||
|
store.commit('setLabelInfo', {
|
||||||
|
...res.data,
|
||||||
|
isExpires
|
||||||
|
})
|
||||||
|
resolve(res.data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
SignOut(store, isClear) {
|
SignOut(store, isClear) {
|
||||||
if (isClear) {
|
if (isClear) {
|
||||||
store.commit('logout')
|
store.commit('logout')
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import request from '../api'
|
import request from '../api'
|
||||||
import store from '../store'
|
import store from '../store'
|
||||||
import { Message } from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
|
import JsBarcode from 'jsbarcode'
|
||||||
|
import { Interpreter } from 'eval5'
|
||||||
|
import { transform } from "@babel/standalone"
|
||||||
|
|
||||||
const dict = {
|
const dict = {
|
||||||
url: "/api/dictionary/queryValsByCodeList",
|
url: "/api/dictionary/queryValsByCodeList",
|
||||||
@@ -118,11 +121,30 @@ const sleepSync = (milliseconds) => {
|
|||||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const initWindow = () => {
|
||||||
|
const transformCode = (codeStr) => {
|
||||||
|
return transform(codeStr, { presets: ['env'] }).code
|
||||||
|
}
|
||||||
|
|
||||||
|
window.JsBarcode = JsBarcode
|
||||||
|
window.eval = (code, context) => {
|
||||||
|
const interpreter = new Interpreter(context || window, {
|
||||||
|
timeout: 1000,
|
||||||
|
})
|
||||||
|
try {
|
||||||
|
interpreter.evaluate(transformCode(code))
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dict,
|
dict,
|
||||||
dateUtil,
|
dateUtil,
|
||||||
sleepSync,
|
sleepSync,
|
||||||
userCheck
|
userCheck,
|
||||||
|
initWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -108,15 +108,19 @@ export function transform(leftData) {
|
|||||||
"valueExtendInfo": ""
|
"valueExtendInfo": ""
|
||||||
});
|
});
|
||||||
rightSkuItem.productSkuId = 0;
|
rightSkuItem.productSkuId = 0;
|
||||||
rightSkuItem.productSkuWhExtAttrReq = {
|
if (!leftSkuItem.productSkuWhExtAttr) {
|
||||||
"productSkuVolumeReq": leftSkuItem.productSkuWhExtAttr.productSkuVolume,
|
rightSkuItem.productSkuWhExtAttrReq = null
|
||||||
"productSkuWeightReq": leftSkuItem.productSkuWhExtAttr.productSkuWeight,
|
} else {
|
||||||
"productSkuBarCodeReqs": leftSkuItem.productSkuWhExtAttr.productSkuBarCodes,
|
rightSkuItem.productSkuWhExtAttrReq = {
|
||||||
"productSkuSensitiveAttrReq": {
|
"productSkuVolumeReq": leftSkuItem.productSkuWhExtAttr?.productSkuVolume,
|
||||||
"isSensitive": leftSkuItem.productSkuWhExtAttr.productSkuSensitiveAttr.isSensitive,
|
"productSkuWeightReq": leftSkuItem.productSkuWhExtAttr?.productSkuWeight,
|
||||||
"sensitiveList": leftSkuItem.productSkuWhExtAttr.productSkuSensitiveAttr.sensitiveList},
|
"productSkuBarCodeReqs": leftSkuItem.productSkuWhExtAttr?.productSkuBarCodes,
|
||||||
"productSkuSensitiveLimitReq": leftSkuItem.productSkuWhExtAttr.productSkuSensitiveLimit,
|
"productSkuSensitiveAttrReq": {
|
||||||
};
|
"isSensitive": leftSkuItem.productSkuWhExtAttr?.productSkuSensitiveAttr.isSensitive,
|
||||||
|
"sensitiveList": leftSkuItem.productSkuWhExtAttr?.productSkuSensitiveAttr.sensitiveList},
|
||||||
|
"productSkuSensitiveLimitReq": leftSkuItem.productSkuWhExtAttr?.productSkuSensitiveLimit,
|
||||||
|
};
|
||||||
|
}
|
||||||
rightSkuItem.currencyType = leftSkuItem.currencyType;
|
rightSkuItem.currencyType = leftSkuItem.currencyType;
|
||||||
|
|
||||||
rightSkcItem.productSkuReqs.push(rightSkuItem);
|
rightSkcItem.productSkuReqs.push(rightSkuItem);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="admin-right">
|
<div class="admin-right">
|
||||||
<el-tooltip class="item" effect="dark" content="金币信息" placement="top">
|
<el-tooltip class="item" effect="dark" content="金币信息" placement="top">
|
||||||
<div class="left" @click="toActive">
|
<div class="left" @click="openMember(1)">
|
||||||
<div :style="{marginLeft: '0px'}">{{ $store.state.userInfo.coin }}</div>
|
<div :style="{marginLeft: '0px'}">{{ $store.state.userInfo.coin }}</div>
|
||||||
<span style="margin-right: 10px;"><img src="../assets/coin.png" width="30"/></span>
|
<span style="margin-right: 10px;"><img src="../assets/coin.png" width="30"/></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<el-button type="button" :class="'el-button el-button--primary'" @click="sign">签到</el-button>
|
<el-button type="button" :class="'el-button el-button--primary'" @click="sign">签到</el-button>
|
||||||
<!--<el-button type="button" :class="'el-button el-button--primary'" @click="openFolder">打开文件夹</el-button>-->
|
<!--<el-button type="button" :class="'el-button el-button--primary'" @click="openFolder">打开文件夹</el-button>-->
|
||||||
<el-tooltip class="item" effect="dark" content="用户激活" placement="top">
|
<el-tooltip class="item" effect="dark" content="用户激活" placement="top">
|
||||||
<div class="left" @click="toActive">
|
<div class="left" @click="openMember(0)">
|
||||||
<span>会员信息:</span>
|
<span>会员信息:</span>
|
||||||
<div :style="{marginLeft: '10px', color: $store.state.userInfo.flag == 1? 'green': 'red'}">{{ getStateInfo }}</div>
|
<div :style="{marginLeft: '10px', color: $store.state.userInfo.flag == 1? 'green': 'red'}">{{ getStateInfo }}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,13 +38,13 @@
|
|||||||
<div class="admin-main">
|
<div class="admin-main">
|
||||||
<el-scrollbar class="left">
|
<el-scrollbar class="left">
|
||||||
<el-menu
|
<el-menu
|
||||||
:default-active="activePath"
|
:default-active="activePath"
|
||||||
:collapse-transition="true"
|
:collapse-transition="true"
|
||||||
unique-opened
|
unique-opened
|
||||||
background-color="#545c64"
|
background-color="#545c64"
|
||||||
router
|
router
|
||||||
text-color="#fff"
|
text-color="#fff"
|
||||||
:collapse="isCollapse">
|
:collapse="isCollapse">
|
||||||
<el-menu-item index="/welcome">
|
<el-menu-item index="/welcome">
|
||||||
<i class="el-icon-monitor"></i>
|
<i class="el-icon-monitor"></i>
|
||||||
<span slot="title">工作台</span>
|
<span slot="title">工作台</span>
|
||||||
@@ -81,6 +81,7 @@
|
|||||||
<el-menu-item index="/productList">商品列表</el-menu-item>
|
<el-menu-item index="/productList">商品列表</el-menu-item>
|
||||||
<el-menu-item index="/copyProduct">商品复制</el-menu-item>
|
<el-menu-item index="/copyProduct">商品复制</el-menu-item>
|
||||||
<el-menu-item index="/findSeller">查找买手</el-menu-item>
|
<el-menu-item index="/findSeller">查找买手</el-menu-item>
|
||||||
|
<el-menu-item index="/priceDown">拒绝调价</el-menu-item>
|
||||||
<!--<el-menu-item index="/batchUpload">批量上品</el-menu-item>-->
|
<!--<el-menu-item index="/batchUpload">批量上品</el-menu-item>-->
|
||||||
<el-menu-item v-if="$store.state.userInfo.phone == '18610967550' || isAdmin" index="/draft">
|
<el-menu-item v-if="$store.state.userInfo.phone == '18610967550' || isAdmin" index="/draft">
|
||||||
草稿箱管理
|
草稿箱管理
|
||||||
@@ -177,6 +178,13 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-menu-item index="/syncDataTemu">数据同步(TEMU)</el-menu-item>
|
<el-menu-item index="/syncDataTemu">数据同步(TEMU)</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
|
<el-submenu index="/semi" v-if="$store.state.userInfo.phone == '18571466720'">
|
||||||
|
<template slot="title">
|
||||||
|
<i class="el-icon-s-data"></i>
|
||||||
|
<span slot="title">半托管</span>
|
||||||
|
</template>
|
||||||
|
<el-menu-item index="/sendGoods_xc">发货(芯仓)</el-menu-item>
|
||||||
|
</el-submenu>
|
||||||
<el-menu-item index="/info">
|
<el-menu-item index="/info">
|
||||||
<i class="el-icon-info"></i>
|
<i class="el-icon-info"></i>
|
||||||
<span slot="title">弹窗消息</span>
|
<span slot="title">弹窗消息</span>
|
||||||
@@ -193,13 +201,23 @@
|
|||||||
<i class="el-icon-s-data"></i>
|
<i class="el-icon-s-data"></i>
|
||||||
<span slot="title">数据统计</span>
|
<span slot="title">数据统计</span>
|
||||||
</el-menu-item> -->
|
</el-menu-item> -->
|
||||||
<el-submenu index="/labelsTemplate">
|
<el-submenu index="labels">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<i class="el-icon-s-goods"></i>
|
<i class="el-icon-s-goods"></i>
|
||||||
<span slot="title">标签管理</span>
|
<div slot="title" style="display: inline-block;">
|
||||||
|
<span>高级功能</span>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item index="/labelsTemplate">模板管理</el-menu-item>
|
<el-submenu index="/labelsTemplate" style="padding-left: 15px;">
|
||||||
<el-menu-item index="/labelsPrint">标签打印</el-menu-item>
|
<template slot="title">
|
||||||
|
<div slot="title" style="display: inline-block; ">
|
||||||
|
<span>标签管理</span>
|
||||||
|
<el-button type="text" style="margin-left: 57px; padding: 0;" @click.stop="openMember(2)">开通</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-menu-item index="/labelsTemplate">模板管理</el-menu-item>
|
||||||
|
<el-menu-item index="/labelsPrint">标签打印</el-menu-item>
|
||||||
|
</el-submenu>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
|
|
||||||
</el-menu>
|
</el-menu>
|
||||||
@@ -213,18 +231,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="激活充值"
|
title="激活充值"
|
||||||
:visible="$store.state.activeDlgShow"
|
:visible="$store.state.activeDlgShow"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
width="1200"
|
width="1200"
|
||||||
:before-close="handleClose">
|
:before-close="handleClose">
|
||||||
<ai-payment/>
|
<ai-payment/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="温馨提示"
|
title="温馨提示"
|
||||||
:visible="$store.state.showSheinAlert"
|
:visible="$store.state.showSheinAlert"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
width="1200">
|
width="1200">
|
||||||
<span style="font-size: large">1、检查“SHEIN商家后台”是否登录,如没登录,请先登录,之后再刷新助手<br></span>
|
<span style="font-size: large">1、检查“SHEIN商家后台”是否登录,如没登录,请先登录,之后再刷新助手<br></span>
|
||||||
<span style="font-size: large">2、如果SHEIN商家后台已经登录,仍然弹出当前窗口,则需要SHEIN进行二次授权,二次授权可在菜单“商品管理->商品列表”,任意选择一个商品,在“库存”一栏,点击修改,在新打开的页面中可看到“正在鉴权”的字样,即可完成二次授权</span>
|
<span style="font-size: large">2、如果SHEIN商家后台已经登录,仍然弹出当前窗口,则需要SHEIN进行二次授权,二次授权可在菜单“商品管理->商品列表”,任意选择一个商品,在“库存”一栏,点击修改,在新打开的页面中可看到“正在鉴权”的字样,即可完成二次授权</span>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
@@ -232,141 +250,145 @@
|
|||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
title="温馨提示"
|
title="温馨提示"
|
||||||
:visible="$store.state.showTemuAlert"
|
:visible="$store.state.showTemuAlert"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
width="1200">
|
width="1200">
|
||||||
<span style="font-size: large">请先打开卖家中心“结算数据->售后管理”页面进行二次授权,<a target="_blank" style="text-decoration: underline" href="https://seller.kuajingmaihuo.com/main/aftersales/information">去打开</a><br></span>
|
<span style="font-size: large">请先打开卖家中心“结算数据->售后管理”页面进行二次授权,<a target="_blank" style="text-decoration: underline" href="https://seller.kuajingmaihuo.com/main/aftersales/information">去打开</a><br></span>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="closeTemuAlert">关 闭</el-button>
|
<el-button @click="closeTemuAlert">关 闭</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<div id="kefu" @click="gotoKefu">
|
<div id="kefu" @click="gotoKefu">
|
||||||
<label slot="reference" class="topBtn" title="联系客服"></label>
|
<label slot="reference" class="topBtn" title="联系客服"></label>
|
||||||
</div>
|
</div>
|
||||||
|
<LablesMember ref="LablesMember"></LablesMember>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapMutations, mapState} from 'vuex'
|
import {mapMutations, mapState} from 'vuex'
|
||||||
import AiPayment from "@/components/AiPayment.vue";
|
import AiPayment from "@/components/AiPayment.vue";
|
||||||
import {sendAliexpressAPIMessage, sendTemuSellerAgentMessage, sendGoodcangAPIMessage} from "@/api/chromeApi";
|
import LablesMember from '@/components/LablesMember'
|
||||||
|
import {sendAliexpressAPIMessage, sendGoodcangAPIMessage} from "@/api/chromeApi";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {AiPayment},
|
components: {AiPayment, LablesMember},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isCollapse: false,
|
isCollapse: false,
|
||||||
activePath: '/home',
|
activePath: '/home',
|
||||||
form: {
|
form: {
|
||||||
mallId: this.$store.state.mallId,
|
mallId: this.$store.state.mallId,
|
||||||
mallName: this.$store.state.mallName,
|
mallName: this.$store.state.mallName,
|
||||||
code: ''
|
code: ''
|
||||||
},
|
},
|
||||||
version: '',
|
version: '',
|
||||||
vipType: ["体验会员", "月会员", "半年会员", "年会员", "多店通用年会员"]
|
vipType: ["体验会员", "月会员", "半年会员", "年会员", "多店通用年会员"]
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
freeLogo: () => require("../assets/free.png"),
|
|
||||||
getStateInfo() {
|
|
||||||
if (this.$store.state.userInfo.flag == 0) {
|
|
||||||
return '未激活';
|
|
||||||
} else if (this.$store.state.userInfo.flag == 1) {
|
|
||||||
if (this.$store.state.userInfo.type != 4) {
|
|
||||||
return `(${this.$store.state.userInfo.mallName})` + this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')';
|
|
||||||
} else {
|
|
||||||
return this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')'
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return '已过期';
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
freeLogo: () => require("../assets/free.png"),
|
||||||
|
getStateInfo() {
|
||||||
|
if (this.$store.state.userInfo.flag == 0) {
|
||||||
|
return '未激活';
|
||||||
|
} else if (this.$store.state.userInfo.flag == 1) {
|
||||||
|
if (this.$store.state.userInfo.type != 4) {
|
||||||
|
return `(${this.$store.state.userInfo.mallName})` + this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')';
|
||||||
|
} else {
|
||||||
|
return this.vipType[this.$store.state.userInfo.type] + '(' + this.$store.state.userInfo.expireTime.substring(0, 10) + ')'
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return '已过期';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
...mapState(['mallName', 'mallList', 'userInfo']),
|
...mapState(['mallName', 'mallList', 'userInfo']),
|
||||||
isAdmin: v => ['18571466720'].includes(v.userInfo.phone),
|
isAdmin: v => ['18571466720'].includes(v.userInfo.phone),
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
$route(v) {
|
$route(v) {
|
||||||
if (v.meta && v.meta.activeMenu) {
|
if (v.meta && v.meta.activeMenu) {
|
||||||
this.activePath = v.meta.activeMenu
|
this.activePath = v.meta.activeMenu
|
||||||
|
} else {
|
||||||
|
this.activePath = v.fullPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
const devVersion = require('../manifest.development.json').version
|
||||||
|
const prodVersion = require('../manifest.production.json').version
|
||||||
|
this.version = process.env.NODE_ENV === 'production' ? prodVersion : devVersion
|
||||||
|
if (this.$route.meta && this.$route.meta.activeMenu) {
|
||||||
|
this.activePath = this.$route.meta.activeMenu
|
||||||
} else {
|
} else {
|
||||||
this.activePath = v.fullPath
|
this.activePath = this.$route.fullPath
|
||||||
}
|
}
|
||||||
}
|
// this.testGoodcang()
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
methods: {
|
||||||
window.eval = () => {
|
...mapMutations(['setActiveDlgShow']),
|
||||||
}
|
handleClick(e) {
|
||||||
const devVersion = require('../manifest.development.json').version
|
if (e === 'logout') {
|
||||||
const prodVersion = require('../manifest.production.json').version
|
this.$store.dispatch('SignOut', false)
|
||||||
this.version = process.env.NODE_ENV === 'production' ? prodVersion : devVersion
|
} else if (e === 'pwd') {
|
||||||
if (this.$route.meta && this.$route.meta.activeMenu) {
|
this.$router.push('changePwd')
|
||||||
this.activePath = this.$route.meta.activeMenu
|
} else if (e === 'message') {
|
||||||
} else {
|
this.$router.push('message')
|
||||||
this.activePath = this.$route.fullPath
|
} else if (e === 'coin') {
|
||||||
}
|
this.$router.push('coinFlow')
|
||||||
// this.testGoodcang()
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
openMember(index) {
|
||||||
...mapMutations(['setActiveDlgShow']),
|
this.$refs.LablesMember.show(index)
|
||||||
handleClick(e) {
|
},
|
||||||
if (e === 'logout') {
|
|
||||||
this.$store.dispatch('SignOut', false)
|
handleClose() {
|
||||||
} else if (e === 'pwd') {
|
this.form.mallId = "";
|
||||||
this.$router.push('changePwd')
|
this.form.mallName = "";
|
||||||
} else if (e === 'message') {
|
this.form.code = "";
|
||||||
this.$router.push('message')
|
this.setActiveDlgShow(false)
|
||||||
} else if (e === 'coin') {
|
},
|
||||||
this.$router.push('coinFlow')
|
toActive() {
|
||||||
}
|
this.setActiveDlgShow(true)
|
||||||
},
|
},
|
||||||
handleClose() {
|
getMessage(type) {
|
||||||
this.form.mallId = "";
|
return `你使用的是“${this.vipType[type]}”兑换券,确定兑换?`;
|
||||||
this.form.mallName = "";
|
},
|
||||||
this.form.code = "";
|
active() {
|
||||||
this.setActiveDlgShow(false)
|
this.$refs.form.validate((valid) => {
|
||||||
},
|
if (valid) {
|
||||||
toActive() {
|
this.$http.post(`/api/coupon/getDetail`, null, {
|
||||||
this.setActiveDlgShow(true)
|
params: {
|
||||||
},
|
code: this.form.code
|
||||||
getMessage(type) {
|
}
|
||||||
return `你使用的是“${this.vipType[type]}”兑换券,确定兑换?`;
|
}).then(res => {
|
||||||
},
|
if (res.code == 0) {
|
||||||
active() {
|
let msg = this.getMessage(res.data.type);
|
||||||
this.$refs.form.validate((valid) => {
|
this.$confirm(msg, '温馨提示', {
|
||||||
if (valid) {
|
confirmButtonText: '确定',
|
||||||
this.$http.post(`/api/coupon/getDetail`, null, {
|
cancelButtonText: '取消',
|
||||||
params: {
|
type: 'info'
|
||||||
code: this.form.code
|
}).then(() => {
|
||||||
}
|
this.$http.post(`/api/order/upgradeByCode`, null, {
|
||||||
}).then(res => {
|
params: {
|
||||||
if (res.code == 0) {
|
...this.form
|
||||||
let msg = this.getMessage(res.data.type);
|
}
|
||||||
this.$confirm(msg, '温馨提示', {
|
}).then(res => {
|
||||||
confirmButtonText: '确定',
|
if (res.code == 0) {
|
||||||
cancelButtonText: '取消',
|
this.$message.success('激活成功')
|
||||||
type: 'info'
|
this.$store.dispatch('getUserInfo')
|
||||||
}).then(() => {
|
this.setActiveDlgShow(false)
|
||||||
this.$http.post(`/api/order/upgradeByCode`, null, {
|
}
|
||||||
params: {
|
})
|
||||||
...this.form
|
|
||||||
}
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message.success('激活成功')
|
|
||||||
this.$store.dispatch('getUserInfo')
|
|
||||||
this.setActiveDlgShow(false)
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -187,9 +187,9 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
},
|
},
|
||||||
async syncProduct(mallId, mallName) {
|
async syncProduct(mallId, mallName) {
|
||||||
let res = await sendChromeAPIMessage({url: 'bg-visage-mms/product/skc/pageQuery',
|
let res = await sendChromeAPIMessage({url: 'bg-visage-mms/product/skc/pageQuery',
|
||||||
anti:true,
|
anti:true,
|
||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: mallId,
|
mallId: mallId,
|
||||||
data: {
|
data: {
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
@@ -250,9 +250,9 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
let start = now.getTime()
|
let start = now.getTime()
|
||||||
let end = start + 86400*1000 - 1000
|
let end = start + 86400*1000 - 1000
|
||||||
|
|
||||||
let res = await sendChromeAPIMessage({url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryBatch',
|
let res = await sendChromeAPIMessage({url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryBatch',
|
||||||
anti:true,
|
anti:true,
|
||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: mallId,
|
mallId: mallId,
|
||||||
data: {
|
data: {
|
||||||
pageNo: this.pageNo,
|
pageNo: this.pageNo,
|
||||||
@@ -280,7 +280,9 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
productName: item1.subPurchaseOrderBasicVO.productName,
|
productName: item1.subPurchaseOrderBasicVO.productName,
|
||||||
skc: item1.productSkcId,
|
skc: item1.productSkcId,
|
||||||
skcCode: item1.skcExtCode,
|
skcCode: item1.skcExtCode,
|
||||||
isFirst: item1.subPurchaseOrderBasicVO.isFirst ? 1: 0
|
isFirst: item1.subPurchaseOrderBasicVO.isFirst ? 1: 0,
|
||||||
|
subPurchaseOrderSn: item1.subPurchaseOrderSn,
|
||||||
|
createTime: timestampToTime(item1.deliverTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
item1.packageDetailList.map(item2 => {
|
item1.packageDetailList.map(item2 => {
|
||||||
@@ -288,12 +290,12 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
...temp,
|
...temp,
|
||||||
sku: item2.productSkuId,
|
sku: item2.productSkuId,
|
||||||
num: item2.skuNum
|
num: item2.skuNum
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.deliveryOrderList.push(temp)
|
this.deliveryOrderList.push(temp)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
if (res.result.list.length == this.pageSize) {
|
if (res.result.list.length == this.pageSize) {
|
||||||
this.pageNo ++
|
this.pageNo ++
|
||||||
await this.syncDeliveryOrder(mallId, mallName)
|
await this.syncDeliveryOrder(mallId, mallName)
|
||||||
@@ -355,5 +357,5 @@ import {timestampToTime} from '@/utils/date'
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,21 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<AiDetail class="add-label">
|
<AiDetail class="add-label">
|
||||||
<template #title>
|
<template #title>
|
||||||
<ai-title title="添加标签" isShowBack :isShowBottomBorder="true" @onBackClick="cancel">
|
<ai-title title="添加模板" isShowBack :isShowBottomBorder="true" @onBackClick="cancel">
|
||||||
|
<template #center>
|
||||||
|
<label>模板名称:</label>
|
||||||
|
<el-input placeholder="请输入模板名称" size="small" v-model="name" style="width: 200px;"></el-input>
|
||||||
|
</template>
|
||||||
<template #rightBtn>
|
<template #rightBtn>
|
||||||
<el-button @click="preview" size="small" type="danger">预览</el-button>
|
<el-button @click="preview" size="small" type="danger">预览</el-button>
|
||||||
<el-button @click="savePdf" size="small" type="primary">下载pdf</el-button>
|
<!-- <el-button @click="savePdf" size="small" type="primary">下载pdf</el-button> -->
|
||||||
<el-button @click="saveTemplate" size="small" type="primary">保存</el-button>
|
|
||||||
<el-button @click="print" size="small">打印</el-button>
|
<el-button @click="print" size="small">打印</el-button>
|
||||||
<el-button @click="clearPaper" size="small" type="danger">清空纸张</el-button>
|
<el-button @click="clearPaper" size="small" type="danger">清空纸张</el-button>
|
||||||
|
<el-button @click="saveTemplate" size="small" type="primary" :loading="isLoading">保存</el-button>
|
||||||
</template>
|
</template>
|
||||||
</ai-title>
|
</ai-title>
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<ai-card title="标签模板" class="card" :hideTitle="true">
|
<ai-card title="标签模板" class="card" :hideTitle="true" v-loading="isLoading">
|
||||||
<template #content>
|
<template #content>
|
||||||
<div class="add-label__wrapper">
|
<div class="add-label__wrapper">
|
||||||
<Print ref="printRef" :labels="labels"></Print>
|
<Print
|
||||||
|
ref="printRef"
|
||||||
|
:template="template"
|
||||||
|
:printData="printData"
|
||||||
|
:isPrint="false"
|
||||||
|
:params="params">
|
||||||
|
</Print>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</ai-card>
|
</ai-card>
|
||||||
@@ -33,7 +43,45 @@
|
|||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
labels: []
|
name: '',
|
||||||
|
template: {
|
||||||
|
"panels": [{
|
||||||
|
"index": 0,
|
||||||
|
"name": 1,
|
||||||
|
"height": 200,
|
||||||
|
"width": 200,
|
||||||
|
"paperHeader": 0,
|
||||||
|
"paperFooter": 547,
|
||||||
|
"printElements": [],
|
||||||
|
"paperNumberLeft": 500,
|
||||||
|
"paperNumberTop": 530,
|
||||||
|
"paperNumberDisabled": true,
|
||||||
|
"paperNumberContinue": true,
|
||||||
|
"fontFamily": "Microsoft YaHei",
|
||||||
|
"scale": 1,
|
||||||
|
"watermarkOptions": {}
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
printData: {},
|
||||||
|
id: '',
|
||||||
|
info: {},
|
||||||
|
params: [],
|
||||||
|
isLoading: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.printData = {
|
||||||
|
labelCode: 123456789,
|
||||||
|
productSkuId: `XXXXXXXXXXXXXX`,
|
||||||
|
skuExtCode: 'XXXXXXXXXXXXXX',
|
||||||
|
skuSpecName: 'XXXXX'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.$route.query.id) {
|
||||||
|
this.id = this.$route.query.id
|
||||||
|
|
||||||
|
this.getInfo()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -42,8 +90,25 @@
|
|||||||
this.$router.go(-1)
|
this.$router.go(-1)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getInfo() {
|
||||||
|
this.isLoading = true
|
||||||
|
this.$http.post(`/api/template/detail?id=${this.$route.query.id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.info = res.data
|
||||||
|
this.name = res.data.name
|
||||||
|
this.params = JSON.parse(res.data.params)
|
||||||
|
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.template = JSON.parse(res.data.content)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
preview () {
|
preview () {
|
||||||
this.$refs.printRef.getHtml()
|
this.$refs.printRef.preview()
|
||||||
},
|
},
|
||||||
|
|
||||||
savePdf () {
|
savePdf () {
|
||||||
@@ -55,11 +120,32 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
saveTemplate () {
|
saveTemplate () {
|
||||||
const json = this.$refs.printRef.exportJson()
|
if (!this.name) {
|
||||||
console.log(json)
|
return this.$message.error('模板名称不能为空')
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = this.$refs.printRef.save()
|
||||||
|
this.isLoading = true
|
||||||
|
|
||||||
|
const url = this.id ? `/api/template/modify` : `/api/template/addTemplate`
|
||||||
|
this.$http.post(url, {
|
||||||
|
name: this.name,
|
||||||
|
codes: data.html,
|
||||||
|
content: JSON.stringify(data.json),
|
||||||
|
params: data.params,
|
||||||
|
id: this.id || ''
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.isLoading = false
|
||||||
|
this.$message.success('模板创建成功')
|
||||||
|
this.cancel()
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
print () {
|
print() {
|
||||||
this.$refs.printRef.print()
|
this.$refs.printRef.print()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,135 +1,343 @@
|
|||||||
<template>
|
<template>
|
||||||
<ai-list class="Learning">
|
<ai-list class="Print-page">
|
||||||
<ai-title
|
<ai-title
|
||||||
slot="title"
|
slot="title"
|
||||||
title="新手园地"
|
title="标签打印"
|
||||||
isShowBottomBorder>
|
isShowBottomBorder>
|
||||||
</ai-title>
|
</ai-title>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar>
|
<div class="search-item__wrapper">
|
||||||
<template #left>
|
<div class="left">
|
||||||
<el-radio-group v-model="search.categoryId" @change="onChange">
|
<div class="search-item">
|
||||||
<el-radio-button label="">全部</el-radio-button>
|
<el-radio-group v-model="addType" @click="lableList = [], search.productSkuId = '', search.productSkcId = ''">
|
||||||
<el-radio-button label="isFavorite">我的收藏</el-radio-button>
|
<el-radio-button label="1">按发货单打印</el-radio-button>
|
||||||
<el-radio-button :label="item.id" :key="item.id" v-for="item in cateList">{{ item.name }}</el-radio-button>
|
<el-radio-button label="2">按SKC打印</el-radio-button>
|
||||||
</el-radio-group>
|
<el-radio-button label="3">按SKU打印</el-radio-button>
|
||||||
</template>
|
</el-radio-group>
|
||||||
<template #right>
|
</div>
|
||||||
</template>
|
</div>
|
||||||
</ai-search-bar>
|
<div class="right"></div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item__wrapper">
|
||||||
|
<div class="left">
|
||||||
|
<div class="search-item" v-show="addType === '1'">
|
||||||
|
<label>发货单:</label>
|
||||||
|
<el-select v-model="search.mallId" placeholder="请选择店铺" size="small">
|
||||||
|
<el-option
|
||||||
|
v-for="item in $store.state.mallList"
|
||||||
|
:key="item.mallId"
|
||||||
|
:label="item.mallName"
|
||||||
|
:value="item.mallId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-button style="margin-left: 10px;" size="small" :disabled="!search.mallId" :loading="isLoading" @click="searchSkuList">查询</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="search-item" v-show="addType === '2' || addType === '3'">
|
||||||
|
<label>{{ addType === '2' ? 'SKC:' : 'SKU:' }}</label>
|
||||||
|
<el-input
|
||||||
|
v-if="addType === '3'"
|
||||||
|
v-model="search.productSkuId"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="多个查询请用户逗号分割"
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
<el-input
|
||||||
|
v-else
|
||||||
|
v-model="search.productSkcId"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
placeholder="多个查询请用户逗号分割"
|
||||||
|
clearable
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
<el-button style="margin-left: 10px;" @click="getList" size="small" :loading="isLoading">查询</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<ai-table
|
<ai-table
|
||||||
:tableData="tableData"
|
:tableData="lableList"
|
||||||
:col-configs="colConfigs"
|
:col-configs="colConfigs"
|
||||||
:total="total"
|
:isShowPagination="false"
|
||||||
:current.sync="search.current"
|
:height="height"
|
||||||
:size.sync="search.size"
|
@getList="() => {}"
|
||||||
style="margin-top: 8px;"
|
:loading="isLoading">
|
||||||
@getList="getList">
|
<el-table-column slot="options" label="操作" align="center" fixed="right" width="120px">
|
||||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="140px">
|
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="collection(row.id, row.isFavorite)">{{ row.isFavorite === '0' ? '收藏' : '取消收藏' }}</el-button>
|
<el-button type="text" @click="toPrint(row)">打印</el-button>
|
||||||
<el-button type="text" @click="toDetail(row.url)">详情</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
|
<Print ref="printRef" :isPrint="true"></Print>
|
||||||
|
<ai-dialog
|
||||||
|
:visible.sync="isShow"
|
||||||
|
title="打印数量"
|
||||||
|
width="890px"
|
||||||
|
@confirm="onConfirm">
|
||||||
|
<el-form class="ai-form" :model="form" ref="form" label-width="100px">
|
||||||
|
<el-form-item label="打印数量" style="width: 100%;" prop="count" :rules="[{ required: true, message: '请输入打印数量', trigger: 'change' }]">
|
||||||
|
<el-input-number v-model="form.count" :min="1" :max="500" label="请输入打印数量"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ai-dialog>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Print from '@/components/print/Print'
|
||||||
|
import template from '@/components/print/template'
|
||||||
|
import { sendChromeAPIMessage } from '@/api/chromeApi'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Learning',
|
name: 'PrintPage',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Print
|
||||||
|
},
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{ prop: 'title', label: '标题', align: 'left' },
|
{ prop: 'mallName', label: '店铺名称', align: 'left' },
|
||||||
{ prop: 'createTime', label: '发布时间', align: 'center' },
|
{ prop: 'labelCode', label: '条码编码', align: 'center' },
|
||||||
|
{ prop: 'productSkcId', label: 'SKC', align: 'center' },
|
||||||
|
{ prop: 'productSkuId', label: 'SKU', align: 'center' },
|
||||||
|
{ prop: 'skuExtCode', label: 'SKU货号', align: 'center' },
|
||||||
|
{ prop: 'skuSpecName', label: '次销售属性', align: 'center' },
|
||||||
|
{ prop: 'deliveryNum', label: '发货数', align: 'center' }
|
||||||
],
|
],
|
||||||
tableData: [],
|
|
||||||
total: 0,
|
|
||||||
search: {
|
search: {
|
||||||
current: 1,
|
mallId: '',
|
||||||
size: 10,
|
productSkuId: '',
|
||||||
categoryId: ''
|
productSkcId: '',
|
||||||
|
page: 1,
|
||||||
|
size: -1,
|
||||||
|
templateId: ''
|
||||||
},
|
},
|
||||||
cateList: [],
|
addType: '1',
|
||||||
isFavorite: 0
|
isLoading: false,
|
||||||
|
lableList: [],
|
||||||
|
height: 600,
|
||||||
|
skuChoosedList: [],
|
||||||
|
isShow: false,
|
||||||
|
form: {
|
||||||
|
count: 1
|
||||||
|
},
|
||||||
|
printData: [],
|
||||||
|
templateList: [],
|
||||||
|
page: 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
computed: {
|
||||||
this.$store.dispatch('getUserInfo').then(e => {
|
currMall () {
|
||||||
console.log(e)
|
if (!this.$store.state.mallList.length) {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.$store.state.mallList.filter(v => v.mallId === this.search.mallId)[0]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.height = document.querySelector('.ai-list__content--right').clientHeight - 140
|
||||||
})
|
})
|
||||||
this.getCateList()
|
|
||||||
this.getList()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toDetail (url) {
|
toPrint(row) {
|
||||||
window.open(url)
|
this.isLoading = true
|
||||||
},
|
if (this.addType === '1') {
|
||||||
|
this.$http.post(`/api/template/myTemplate?productSkuId=${row.productSkuId}`).then(res => {
|
||||||
onChange (e) {
|
if (!res.data.records.length) {
|
||||||
if (e === 'isFavorite') {
|
this.isLoading = false
|
||||||
this.$http.post('/api/learning/favoritePage', null, {
|
return this.$message.error('该SKU未配置模板')
|
||||||
params: {
|
|
||||||
...this.search
|
|
||||||
}
|
}
|
||||||
}).then(res => {
|
|
||||||
|
this.$http.post(`/api/template/detail?id=${res.data.records[0].id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const params = JSON.parse(res.data.params)
|
||||||
|
const getValue = v => params.filter(e => e.fieldValue === v)[0].fieldName
|
||||||
|
Object.keys(row).forEach(key => {
|
||||||
|
if (params.findIndex(v => v.fieldValue === key) > -1) {
|
||||||
|
row[getValue(key)] = row[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.isLoading = false
|
||||||
|
this.$refs.printRef.toPrint(JSON.parse(res.data.content), new Array(row.deliveryNum).fill(row))
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$http.post(`/api/template/detail?id=${row.templateId}`).then(res => {
|
||||||
|
this.isLoading = false
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.tableData = res.data.records
|
if (!res.data) {
|
||||||
this.total = res.data.total
|
this.isLoading = false
|
||||||
|
return this.$message.error('该SKU未配置模板')
|
||||||
|
}
|
||||||
|
const params = JSON.parse(res.data.params)
|
||||||
|
const getValue = v => params.filter(e => e.fieldValue === v)[0].fieldName
|
||||||
|
Object.keys(row).forEach(key => {
|
||||||
|
if (params.findIndex(v => v.fieldValue === key) > -1) {
|
||||||
|
row[getValue(key)] = row[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.printData = {
|
||||||
|
template: JSON.parse(res.data.content),
|
||||||
|
data: row
|
||||||
|
}
|
||||||
|
this.isShow = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.search.current = 1
|
|
||||||
this.getList()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
collection (id, isFavorite) {
|
onConfirm () {
|
||||||
this.$confirm(isFavorite === '0' ? '确定收藏该文章?' : '确定取消收藏?', '温馨提示', {
|
this.$refs.form.validate((valid) => {
|
||||||
confirmButtonText: '确定',
|
if (valid) {
|
||||||
callback: action => {
|
this.isShow = false
|
||||||
if (action === 'confirm') {
|
this.$refs.printRef.toPrint(this.printData.template, new Array(this.form.count).fill(this.printData.data))
|
||||||
this.$http.post(isFavorite === '0' ? `/api/learning/addFavorite?id=${id}` : `/api/learning/delFavorite?id=${id}`).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.$message.success(isFavorite === '0' ? '收藏成功' : '取消成功')
|
|
||||||
this.getList()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
getCateList () {
|
printAll() {
|
||||||
this.$http.post('/api/learningCategory/page?size=50').then(res => {
|
this.$refs.printRef.toPrint(template, this.skuChoosedList)
|
||||||
if (res.code === 0) {
|
},
|
||||||
this.cateList = res.data.records
|
|
||||||
}
|
getSkuList () {
|
||||||
})
|
if (!this.search.mallId) {
|
||||||
|
return this.$message.error('请选择店铺')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getList () {
|
getList () {
|
||||||
this.$http.post('/api/learning/pluginPage', null, {
|
this.$http.post('/api/templateSku/getMySkuPage', null, {
|
||||||
params: {
|
params: this.search
|
||||||
...this.search
|
|
||||||
}
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.tableData = res.data.records
|
this.lableList = res.data.records
|
||||||
this.total = res.data.total
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getDeliveryOrderSn (page) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
sendChromeAPIMessage({
|
||||||
|
url: 'bgSongbird-api/supplier/deliverGoods/management/pageQueryDeliveryBatch',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: this.search.mallId,
|
||||||
|
anti: true,
|
||||||
|
data: {
|
||||||
|
pageNo: page,
|
||||||
|
status: 1,
|
||||||
|
onlyTaxWarehouseWaitApply: false,
|
||||||
|
productLabelCodeStyle: 0,
|
||||||
|
pageSize: 200
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.errorCode == 1000000) {
|
||||||
|
resolve({
|
||||||
|
list: [].concat(res.result.list.map(v => v.deliveryOrderList.map(e => e.deliveryOrderSn)).flat()),
|
||||||
|
isHasNext: res.result.total && res.result.list.length && (res.result.list.length < 200 && res.result.total > 200)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve({ list: [], isHasNext: false })
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
resolve({ list: [], isHasNext: false })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getLabels (deliveryOrderSnList) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
sendChromeAPIMessage({
|
||||||
|
url: 'bgSongbird-api/supplier/deliverGoods/management/printProductSkuLabel',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: this.search.mallId,
|
||||||
|
anti: true,
|
||||||
|
data: {
|
||||||
|
deliveryOrderSnList: deliveryOrderSnList
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.errorCode == 1000000) {
|
||||||
|
resolve(res.result.map(v => {
|
||||||
|
return {
|
||||||
|
mallName: this.$store.state.mallList.filter(v => v.mallId === this.search.mallId)[0].mallName,
|
||||||
|
productName: v.productName,
|
||||||
|
productSkcId: v.productSkcId,
|
||||||
|
productSkuId: v.productSkuId,
|
||||||
|
labelCode: v.labelCode,
|
||||||
|
skuExtCode: v.skuExtCode,
|
||||||
|
deliveryNum: v.deliveryNum,
|
||||||
|
skuSpecName: v.secondarySpecVOList.map(item => {
|
||||||
|
return item.specName
|
||||||
|
}).join(',')
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
resolve([])
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
resolve([])
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async searchSkuList () {
|
||||||
|
let page = 1
|
||||||
|
let isHasNext = true
|
||||||
|
let list = []
|
||||||
|
let deliveryOrderSnList = []
|
||||||
|
this.isLoading = true
|
||||||
|
while (isHasNext) {
|
||||||
|
const result = await this.getDeliveryOrderSn(page)
|
||||||
|
page = page + 1
|
||||||
|
isHasNext = result.isHasNext ? true : false
|
||||||
|
deliveryOrderSnList.push(...result.list)
|
||||||
|
|
||||||
|
await this.$sleepSync(1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const len = Math.ceil(deliveryOrderSnList.length / 100)
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
this.page = 1
|
||||||
|
const ids = [...new Set(deliveryOrderSnList)].slice(i * 100, i * 100 + 100)
|
||||||
|
const res = await this.getLabels(ids)
|
||||||
|
list.push(...res)
|
||||||
|
await this.$sleepSync(500)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isLoading = false
|
||||||
|
|
||||||
|
this.lableList = list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.Print-page {
|
||||||
|
.search-item__wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
&>div {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,32 +10,82 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="primary" size="small" @click="isShow = true">添加</el-button>
|
<el-button type="primary" size="small" @click="chooseSkuList = [], isShow = true">添加</el-button>
|
||||||
|
<el-upload
|
||||||
|
action
|
||||||
|
:limit="1"
|
||||||
|
:show-file-list="false"
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:auto-upload="false"
|
||||||
|
:file-list="fileList"
|
||||||
|
:on-change="onExcelChange">
|
||||||
|
<el-button size="small" type="danger" :disabled="!skuList.length">Excel导入</el-button>
|
||||||
|
</el-upload>
|
||||||
|
<json-excel
|
||||||
|
:data="skuList"
|
||||||
|
:fields="jsonFields"
|
||||||
|
name="SKU列表.xls"
|
||||||
|
worksheet="SKU列表">
|
||||||
|
<el-button size="small" type="warning" :disabled="!skuList.length">Excel导出</el-button>
|
||||||
|
</json-excel>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<div class="search-item" style="margin-bottom: 0;">
|
||||||
|
<label>SKU:</label>
|
||||||
|
<el-input
|
||||||
|
v-model="search.productSkuId"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入SKU"
|
||||||
|
suffix-icon="iconfont iconSearch"
|
||||||
|
@clear="getList">
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="search-item" style="margin-bottom: 0;">
|
||||||
|
<label>SKC:</label>
|
||||||
|
<el-input
|
||||||
|
v-model="search.productSkcId"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入SKC"
|
||||||
|
clearable
|
||||||
|
suffix-icon="iconfont iconSearch"
|
||||||
|
@clear="getList">
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="search-item" style="margin-bottom: 0;">
|
||||||
|
<label style="width: 100px;">仅显示未填写:</label>
|
||||||
|
<el-select v-model="search.isShowWhite" placeholder="请选择" clearable size="small">
|
||||||
|
<el-option label="是" value="1"></el-option>
|
||||||
|
<el-option label="否" value="0"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
<el-button style="margin-left: 10px;" @click="getList" size="small" :loading="pageShow">查询</el-button>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table
|
<ai-table
|
||||||
:tableData="tableData"
|
:tableData="list"
|
||||||
:col-configs="colConfigs"
|
:col-configs="colConfigs"
|
||||||
:total="total"
|
|
||||||
:current.sync="search.current"
|
|
||||||
:size.sync="search.size"
|
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
@getList="getList">
|
@getList="getList"
|
||||||
<el-table-column slot="productName" width="300px" :show-overflow-tooltip='true' label="商品名称" fixed="left">
|
@selection-change="handleSelectionChange"
|
||||||
<template slot-scope="scope">
|
v-loading="pageShow"
|
||||||
<div>
|
:isShowPagination="false">
|
||||||
<el-image :src="scope.row.mainImageUrl" style="width: 40px; height: 40px" class="image" :preview-src-list="[scope.row.mainImageUrl]" />
|
<el-table-column
|
||||||
{{ scope.row.productName }}
|
v-for="(item, index) in relationList"
|
||||||
</div>
|
:key="index"
|
||||||
</template>
|
:prop="item.field"
|
||||||
|
:show-overflow-tooltip="true"
|
||||||
|
:label="item.name"
|
||||||
|
align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="140px">
|
<el-table-column slot="options" label="操作" align="center" fixed="right" width="120px">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="toAdd(row.url)">编辑</el-button>
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
<el-button type="text" @click="toDetail(row.url)">删除</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -44,32 +94,90 @@
|
|||||||
:visible.sync="isShow"
|
:visible.sync="isShow"
|
||||||
title="添加SKU"
|
title="添加SKU"
|
||||||
width="1400px"
|
width="1400px"
|
||||||
|
customFooter
|
||||||
@confirm="onConfirm">
|
@confirm="onConfirm">
|
||||||
<ai-search-bar>
|
<div class="search-item__wrapper">
|
||||||
<template #left>
|
<div class="left">
|
||||||
<el-select v-model="skuSearch.mallId" placeholder="请选择店铺" size="small" @change="onMallChange">
|
<div class="search-item">
|
||||||
<el-option
|
<label>添加方式:</label>
|
||||||
v-for="item in $store.state.mallList"
|
<el-radio-group v-model="addType" size="small" @change="onSearchRest">
|
||||||
:key="item.mallId"
|
<el-radio-button label="1">按类目添加</el-radio-button>
|
||||||
:label="item.mallName"
|
<el-radio-button label="2">按SKC添加</el-radio-button>
|
||||||
:value="item.mallId">
|
<el-radio-button label="3">按SKU添加</el-radio-button>
|
||||||
</el-option>
|
</el-radio-group>
|
||||||
</el-select>
|
</div>
|
||||||
</template>
|
<div class="search-item">
|
||||||
<template #right>
|
<label>店铺:</label>
|
||||||
</template>
|
<el-select v-model="lableSearch.mallId" placeholder="请选择店铺" size="small">
|
||||||
</ai-search-bar>
|
<el-option
|
||||||
|
v-for="item in $store.state.mallList"
|
||||||
|
:key="item.mallId"
|
||||||
|
:label="item.mallName"
|
||||||
|
:value="item.mallId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="right"></div>
|
||||||
|
</div>
|
||||||
|
<div class="search-item__wrapper">
|
||||||
|
<div class="left">
|
||||||
|
<div class="search-item" v-show="addType === '1'">
|
||||||
|
<label>商品分类:</label>
|
||||||
|
<el-cascader
|
||||||
|
style="width: 280px;"
|
||||||
|
v-model="targetCatId"
|
||||||
|
:props="props"
|
||||||
|
size="small"
|
||||||
|
filterable
|
||||||
|
:show-all-levels="false"
|
||||||
|
collapse-tags
|
||||||
|
clearable>
|
||||||
|
</el-cascader>
|
||||||
|
<el-button style="margin-left: 10px;" @click="onCateChange" size="small" :disabled="!lableSearch.mallId" :loading="isLoading">查询</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="search-item" v-show="addType === '2'">
|
||||||
|
<label>SKC:</label>
|
||||||
|
<el-input
|
||||||
|
v-model="skuReqParams.SKC"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
placeholder="多个查询请用户逗号分割"
|
||||||
|
clearable
|
||||||
|
@clear="getSkuList()"
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
<el-button style="margin-left: 10px;" @click="getSkuList" size="small" :disabled="!lableSearch.mallId" :loading="isLoading">查询</el-button>
|
||||||
|
</div>
|
||||||
|
<div class="search-item" v-show="addType === '3'">
|
||||||
|
<label>SKU:</label>
|
||||||
|
<el-input
|
||||||
|
v-if="addType === '3'"
|
||||||
|
v-model="skuReqParams.SKU"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
placeholder="多个查询请用户逗号分割"
|
||||||
|
clearable
|
||||||
|
@clear="getSkuList()"
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
<el-button style="margin-left: 10px;" @click="getSkuList" size="small" :disabled="!lableSearch.mallId" :loading="isLoading">查询</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<ai-table
|
<ai-table
|
||||||
height="400"
|
height="370"
|
||||||
:tableData="skuList"
|
:tableData="lableList"
|
||||||
:col-configs="colConfigs"
|
:col-configs="colConfigs"
|
||||||
:total="skuTotal"
|
:total="lableTotal"
|
||||||
:current.sync="skuSearch.current"
|
:current.sync="lableSearch.current"
|
||||||
:size.sync="skuSearch.size"
|
:size.sync="lableSearch.size"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
@getList="getSkuList"
|
|
||||||
:pageSizes="[10, 20, 50, 100, 500, 1000]"
|
:pageSizes="[10, 20, 50, 100, 500, 1000]"
|
||||||
v-loading="isLoading">
|
v-loading="isLoading"
|
||||||
|
:isShowPagination="false"
|
||||||
|
@getList="() => {}"
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
<el-table-column slot="productName" width="300px" :show-overflow-tooltip="true" label="商品名称" fixed="left">
|
<el-table-column slot="productName" width="300px" :show-overflow-tooltip="true" label="商品名称" fixed="left">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>
|
||||||
@@ -79,6 +187,10 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="isShow = false">取消</el-button>
|
||||||
|
<el-button @click="onConfirm" type="primary" :loading="btnLoading">确认</el-button>
|
||||||
|
</template>
|
||||||
</ai-dialog>
|
</ai-dialog>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
@@ -86,55 +198,136 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { sendChromeAPIMessage } from '@/api/chromeApi'
|
import { sendChromeAPIMessage } from '@/api/chromeApi'
|
||||||
|
import * as XLSX from 'xlsx'
|
||||||
|
import JsonExcel from 'vue-json-excel'
|
||||||
export default {
|
export default {
|
||||||
name: 'Template',
|
name: 'SkuManage',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
JsonExcel
|
||||||
|
},
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
colConfigs: [
|
|
||||||
// { slot: 'productName', label: '商品名称', width: '300px', align: 'left', fixed: 'left' },
|
|
||||||
// { prop: 'category', label: '分类', width: '140px', align: 'left', fixed: 'left' },
|
|
||||||
{ prop: 'mallName', label: '店铺名称', align: 'left' },
|
|
||||||
{ prop: 'labelCode', label: '条码编码', align: 'center' },
|
|
||||||
// { prop: 'productSkcId', label: 'SKC', align: 'left' },
|
|
||||||
{ prop: 'productSkuId', label: 'SKU', align: 'center' },
|
|
||||||
// { prop: 'extCode', label: 'SKC货号', align: 'left' },
|
|
||||||
{ prop: 'skuExtCode', label: 'SKU货号', align: 'center' },
|
|
||||||
{ prop: 'skuSpecName', label: '次销售属性', align: 'center' }
|
|
||||||
],
|
|
||||||
tableData: [],
|
|
||||||
total: 0,
|
total: 0,
|
||||||
search: {
|
search: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100
|
size: -1,
|
||||||
|
productSkuId: '',
|
||||||
|
productSkcId: '',
|
||||||
|
isShowWhite: ''
|
||||||
},
|
},
|
||||||
skuSearch: {
|
lableSearch: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 100,
|
size: 100,
|
||||||
mallId: ''
|
mallId: ''
|
||||||
},
|
},
|
||||||
skuTotal: 0,
|
lableTotal: 0,
|
||||||
skuList: [],
|
lableList: [],
|
||||||
isShow: false,
|
isShow: false,
|
||||||
skuReqParams: {
|
skuReqParams: {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 100
|
pageSize: 100,
|
||||||
|
SKC: '',
|
||||||
|
SKU: ''
|
||||||
},
|
},
|
||||||
isLoading: false
|
isLoading: false,
|
||||||
|
addType: '1',
|
||||||
|
props: {
|
||||||
|
value: 'catId',
|
||||||
|
label: 'catName',
|
||||||
|
multiple: true,
|
||||||
|
checkStrictly: true,
|
||||||
|
lazy: true,
|
||||||
|
lazyLoad (value, resolve) {
|
||||||
|
sendChromeAPIMessage({
|
||||||
|
url: 'bg-anniston-mms/category/children/list',
|
||||||
|
needMallId: true,
|
||||||
|
data: {
|
||||||
|
parentCatId: value.level === 0 ? '' : value.value
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.errorCode === 1000000) {
|
||||||
|
resolve(res.result.categoryNodeVOS.map(v => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
leaf: v.isLeaf
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
targetCatId: [],
|
||||||
|
skuList: [],
|
||||||
|
chooseSkuList: [],
|
||||||
|
id: '',
|
||||||
|
fileList: [],
|
||||||
|
pageShow: false,
|
||||||
|
relationList: [],
|
||||||
|
btnLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
list () {
|
||||||
|
if (!this.skuList.length) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.search.isShowWhite !== '1') {
|
||||||
|
return this.skuList
|
||||||
|
}
|
||||||
|
|
||||||
|
const keys = this.relationList.map(v => v.field)
|
||||||
|
return this.skuList.filter(v => keys.some(e => !v[e]))
|
||||||
|
},
|
||||||
|
|
||||||
currMall () {
|
currMall () {
|
||||||
if (!this.$store.state.mallList.length) {
|
if (!this.$store.state.mallList.length) {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.$store.state.mallList.filter(v => v.mallId === this.skuSearch.mallId)[0]
|
return this.$store.state.mallList.filter(v => v.mallId === this.lableSearch.mallId)[0]
|
||||||
|
},
|
||||||
|
|
||||||
|
colConfigs () {
|
||||||
|
const fields = this.isShow ? [] : this.relationList.map(v => {
|
||||||
|
return {
|
||||||
|
prop: v.field,
|
||||||
|
label: v.name,
|
||||||
|
align: 'center'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return [
|
||||||
|
{ type: 'selection' },
|
||||||
|
{ prop: 'mallName', label: '店铺名称', align: 'left' },
|
||||||
|
{ prop: 'productName', label: '商品名称', align: 'center' },
|
||||||
|
{ prop: 'labelCode', label: '条码编码', align: 'center' },
|
||||||
|
{ prop: 'productSkcId', label: 'SKC', align: 'center' },
|
||||||
|
{ prop: 'productSkuId', label: 'SKU', align: 'center' },
|
||||||
|
{ prop: 'skuExtCode', label: 'SKU货号', align: 'center' },
|
||||||
|
{ prop: 'skuSpecName', label: '次销售属性', align: 'center' },
|
||||||
|
...fields
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
jsonFields () {
|
||||||
|
const obj = {}
|
||||||
|
this.colConfigs.filter(v => !!v.prop).forEach(v => {
|
||||||
|
obj[v.label] = v.prop
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
...obj
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
|
this.id = this.$route.query.id || ''
|
||||||
|
this.getRelation()
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -143,22 +336,135 @@
|
|||||||
this.$router.push('/addLabelsTemplate')
|
this.$router.push('/addLabelsTemplate')
|
||||||
},
|
},
|
||||||
|
|
||||||
requestSKUList () {
|
getRelation () {
|
||||||
sendChromeAPIMessage({
|
this.$http.post(`/api/templateRelation/getRelation?templateId=${this.$route.query.id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.relationList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
readXLSX(file) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
const reader = new FileReader()
|
||||||
|
reader.readAsBinaryString(file)
|
||||||
|
reader.onload = evt => {
|
||||||
|
const data = evt.target.result
|
||||||
|
const workbook = XLSX.read(data, { type: 'binary' })
|
||||||
|
const ws = workbook.Sheets[workbook.SheetNames[0]]
|
||||||
|
const jsonData = XLSX.utils.sheet_to_json(ws)
|
||||||
|
resolve(jsonData)
|
||||||
|
|
||||||
|
this.fileList = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onExcelChange (file) {
|
||||||
|
this.pageShow = true
|
||||||
|
this.readXLSX(file.raw).then(res => {
|
||||||
|
this.$http.post(`/api/templateSku/updateBatchSku`, res.map(v => {
|
||||||
|
const result = {
|
||||||
|
templateId: this.id
|
||||||
|
}
|
||||||
|
Object.keys(this.jsonFields).forEach(item => {
|
||||||
|
result[this.jsonFields[item]] = v[item]
|
||||||
|
})
|
||||||
|
|
||||||
|
return result
|
||||||
|
})).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success('导入成功')
|
||||||
|
this.isShow = false
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
this.pageShow = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
onSearchRest() {
|
||||||
|
this.skuReqParams.SKC = ''
|
||||||
|
this.skuReqParams.SKU = ''
|
||||||
|
},
|
||||||
|
|
||||||
|
handleSelectionChange(e) {
|
||||||
|
this.chooseSkuList = e
|
||||||
|
},
|
||||||
|
|
||||||
|
getSKCList(catIds, page) {
|
||||||
|
return new Promise(resolve => {
|
||||||
|
sendChromeAPIMessage({
|
||||||
|
url: 'bg-visage-mms/product/skc/pageQuery',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: this.lableSearch.mallId,
|
||||||
|
anti: true,
|
||||||
|
data: {
|
||||||
|
page,
|
||||||
|
pageSize: 200,
|
||||||
|
catIds: catIds
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
if (res.errorCode == 1000000) {
|
||||||
|
resolve({
|
||||||
|
list: res.result.pageItems.map(v => v.productSkcId),
|
||||||
|
isHasNext: res.result.total && res.result.pageItems.length && (res.result.pageItems.length < 200 && res.result.total > 200)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
resolve({ list: [], isHasNext: false })
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
resolve({ list: [], isHasNext: false })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
async onCateChange() {
|
||||||
|
let page = 1
|
||||||
|
let list = []
|
||||||
|
let isHasNext = true
|
||||||
|
this.lableList = []
|
||||||
|
this.isLoading = true
|
||||||
|
while (isHasNext) {
|
||||||
|
const result = await this.getSKCList([].concat(this.targetCatId.flat()), page)
|
||||||
|
page = page + 1
|
||||||
|
isHasNext = result.isHasNext ? true : false
|
||||||
|
list.push(...result.list)
|
||||||
|
|
||||||
|
await this.$sleepSync(1000)
|
||||||
|
}
|
||||||
|
|
||||||
|
const skcList = [...new Set(list)]
|
||||||
|
const len = Math.ceil(skcList.length / 100)
|
||||||
|
for (let i = 0; i < len; i++) {
|
||||||
|
this.skuReqParams.page = 1
|
||||||
|
this.skuReqParams.SKC = [...new Set(list)].slice(i * 100, i * 100 + 100).join(',')
|
||||||
|
await this.requestSKUList(true)
|
||||||
|
await this.$sleepSync(500)
|
||||||
|
}
|
||||||
|
this.isLoading = false
|
||||||
|
},
|
||||||
|
|
||||||
|
requestSKUList(flag) {
|
||||||
|
return sendChromeAPIMessage({
|
||||||
url: 'bg-visage-mms/labelcode/pageQuery',
|
url: 'bg-visage-mms/labelcode/pageQuery',
|
||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: this.skuSearch.mallId,
|
mallId: this.lableSearch.mallId,
|
||||||
anti: true,
|
anti: true,
|
||||||
data: {
|
data: {
|
||||||
page: this.skuSearch.size > 100 ? this.skuReqParams.page : this.skuSearch.current,
|
page: this.skuReqParams.page,
|
||||||
pageSize: this.skuSearch.size > 100 ? 100 : this.skuSearch.size
|
pageSize: 200,
|
||||||
|
productSkcIdList: (['2', '1'].includes(this.addType)) ? this.skuReqParams.SKC.split(',') : [],
|
||||||
|
productSkuIdList: this.addType === '3' ? this.skuReqParams.SKU.split(',') : []
|
||||||
}
|
}
|
||||||
}).then(async (res) => {
|
}).then(async (res) => {
|
||||||
if (res.errorCode == 1000000) {
|
if (res.errorCode == 1000000) {
|
||||||
const list = res.result.pageItems.map(v => {
|
const list = res.result.pageItems.map(v => {
|
||||||
return {
|
return {
|
||||||
|
mallId: this.lableSearch.mallId,
|
||||||
mallName: this.currMall.mallName,
|
mallName: this.currMall.mallName,
|
||||||
productName: v.productName,
|
productName: v.productName,
|
||||||
|
productSkcId: v.labelCodeVO.productSkcId,
|
||||||
productSkuId: v.labelCodeVO.productSkuId,
|
productSkuId: v.labelCodeVO.productSkuId,
|
||||||
labelCode: v.labelCodeVO.labelCode,
|
labelCode: v.labelCodeVO.labelCode,
|
||||||
skuExtCode: v.labelCodeVO.skuExtCode,
|
skuExtCode: v.labelCodeVO.skuExtCode,
|
||||||
@@ -167,72 +473,101 @@
|
|||||||
}).join(',')
|
}).join(',')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.skuTotal = res.result.total
|
this.lableTotal = res.result.total
|
||||||
this.skuList.push(...list)
|
this.lableList.push(...list)
|
||||||
|
|
||||||
if (this.skuSearch.size > 100 && (res.result.total > this.skuList.length)) {
|
if (res.result.total > this.lableList.length) {
|
||||||
this.skuReqParams.page++
|
this.skuReqParams.page++
|
||||||
await this.$sleepSync(5000)
|
await this.$sleepSync(500)
|
||||||
this.requestSKUList()
|
await this.requestSKUList()
|
||||||
} else {
|
} else {
|
||||||
this.isLoading = false
|
!flag && (this.isLoading = false)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onMallChange (e) {
|
|
||||||
if (!e) {
|
|
||||||
this.skuList = []
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$userCheck(this.skuSearch.mallId).then(() => {
|
|
||||||
this.skuList = []
|
|
||||||
this.skuReqParams.page = 1
|
|
||||||
this.isLoading = true
|
|
||||||
this.requestSKUList()
|
|
||||||
}).catch(() => {
|
|
||||||
this.skuSearch.mallId = ''
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
getSkuList () {
|
getSkuList () {
|
||||||
if (!this.skuSearch.mallId) {
|
if (!this.lableSearch.mallId) {
|
||||||
return this.$message.error('请选择店铺')
|
return this.$message.error('请选择店铺')
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$userCheck(this.skuSearch.mallId).then(() => {
|
this.lableList = []
|
||||||
this.skuList = []
|
this.skuReqParams.page = 1
|
||||||
this.skuReqParams.page = 1
|
this.isLoading = true
|
||||||
this.isLoading = true
|
this.requestSKUList()
|
||||||
|
|
||||||
this.requestSKUList()
|
|
||||||
}).catch(() => {
|
|
||||||
this.skuSearch.mallId = ''
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getList () {
|
getList () {
|
||||||
this.$http.post('/api/learning/pluginPage', null, {
|
this.pageShow = true
|
||||||
|
this.$http.post(`/api/templateSku/getMySkuPage`, null, {
|
||||||
params: {
|
params: {
|
||||||
...this.search
|
...this.search,
|
||||||
|
templateId: this.id
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.tableData = res.data.records
|
this.skuList = res.data.records
|
||||||
this.total = res.data.total
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.pageShow = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onConfirm () {
|
onConfirm () {
|
||||||
|
if (!this.chooseSkuList.length) {
|
||||||
|
return this.$message.error('请选择SKU')
|
||||||
|
}
|
||||||
|
|
||||||
}
|
this.btnLoading = true
|
||||||
|
this.$http.post(`/api/templateSku/addBatchSku`, this.chooseSkuList.map(v => {
|
||||||
|
return {
|
||||||
|
...v,
|
||||||
|
templateId: this.id
|
||||||
|
}
|
||||||
|
})).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.$message.success('添加成功')
|
||||||
|
this.isShow = false
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.btnLoading = false
|
||||||
|
}).catch(() => {
|
||||||
|
this.btnLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remove (id) {
|
||||||
|
this.$confirm('确定删除该数据?', '温馨提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$http.post(`/api/templateSku/removeById?id=${id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.Template {
|
||||||
|
.search-item__wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
&>div {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,13 +4,55 @@
|
|||||||
slot="title"
|
slot="title"
|
||||||
title="模板管理"
|
title="模板管理"
|
||||||
isShowBottomBorder>
|
isShowBottomBorder>
|
||||||
|
<template #rightBtn>
|
||||||
|
<div class="tips" slot="rightBtn" :class="[$store.state.labelInfo.isExpires ? 'active' : '']">
|
||||||
|
<p>有效期:{{ $store.state.labelInfo.expireTime }}</p>
|
||||||
|
<p>已使用SKU数:{{ $store.state.labelInfo.skuUsed }}/{{ $store.state.labelInfo.skuTotal }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</ai-title>
|
</ai-title>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="primary" size="small" @click="toAdd">添加</el-button>
|
<div class="search-item">
|
||||||
|
<label>SKU:</label>
|
||||||
|
<el-input
|
||||||
|
v-model="search.productSkuId"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入SKU"
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<label>SKC:</label>
|
||||||
|
<el-input
|
||||||
|
v-model="search.productSkcId"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入SKC"
|
||||||
|
clearable
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="search-item">
|
||||||
|
<label>模板名称:</label>
|
||||||
|
<el-input
|
||||||
|
v-model="search.name"
|
||||||
|
style="width: 250px"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入模板名称"
|
||||||
|
clearable
|
||||||
|
suffix-icon="iconfont iconSearch">
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<el-button type="primary" @click="getList" size="small" :loading="isLoading">查询</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
</ai-search-bar>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-button type="button" class="el-button el-button--primary" @click="toAdd('')">添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</ai-search-bar>
|
</ai-search-bar>
|
||||||
<ai-table
|
<ai-table
|
||||||
@@ -20,70 +62,111 @@
|
|||||||
:current.sync="search.current"
|
:current.sync="search.current"
|
||||||
:size.sync="search.size"
|
:size.sync="search.size"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
@getList="getList">
|
@getList="getList"
|
||||||
<el-table-column slot="options" label="操作" align="center" fixed="right" width="220px">
|
:loading="isLoading">
|
||||||
|
<el-table-column slot="options" label="操作" align="center" fixed="right" width="240px">
|
||||||
<template v-slot="{ row }">
|
<template v-slot="{ row }">
|
||||||
<div class="table-options">
|
<div class="table-options">
|
||||||
<el-button type="text" @click="toAddSku(row.url)">添加SKU</el-button>
|
<el-button type="text" @click="toAddSku(row.id)">管理SKU</el-button>
|
||||||
<el-button type="text" @click="toAdd(row.url)">编辑</el-button>
|
<!-- <el-button type="text" @click="savePDF(row.id)">保存PDF</el-button> -->
|
||||||
<el-button type="text" @click="toDetail(row.url)">删除</el-button>
|
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
|
||||||
|
<el-button type="text" @click="remove(row.id)">删除</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</ai-table>
|
</ai-table>
|
||||||
|
<Print ref="printRef" :isPrint="true"></Print>
|
||||||
</template>
|
</template>
|
||||||
</ai-list>
|
</ai-list>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import Print from '@/components/print/Print'
|
||||||
export default {
|
export default {
|
||||||
name: 'Template',
|
name: 'PringTemplate',
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Print
|
||||||
|
},
|
||||||
|
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
{ prop: 'name', label: '模板名称', align: 'left' },
|
{ prop: 'name', label: '模板名称', align: 'left' },
|
||||||
{ prop: 'count', label: '绑定SKU数量', align: 'center' },
|
{ prop: 'skuTotal', label: '绑定SKU数量', align: 'center' },
|
||||||
{ prop: 'createTime', label: '创建时间', align: 'center' },
|
{ prop: 'createTime', label: '创建时间', align: 'center' }
|
||||||
],
|
|
||||||
tableData: [
|
|
||||||
{
|
|
||||||
name: '电池',
|
|
||||||
count: 2
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
isLoading: false,
|
||||||
|
tableData: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
search: {
|
search: {
|
||||||
current: 1,
|
current: 1,
|
||||||
size: 10
|
size: 10,
|
||||||
|
name: '',
|
||||||
|
productSkuId: '',
|
||||||
|
productSkcId: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created () {
|
created () {
|
||||||
// this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
toAdd () {
|
toAdd (id = '') {
|
||||||
this.$router.push('/addLabelsTemplate')
|
this.$router.push(`/addLabelsTemplate?id=${id}`)
|
||||||
},
|
},
|
||||||
|
|
||||||
toAddSku () {
|
savePDF (id) {
|
||||||
this.$router.push('/skuManage')
|
this.isLoading = true
|
||||||
|
|
||||||
|
this.$http.post(`/api/template/detail?id=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const template = JSON.parse(res.data.content)
|
||||||
|
|
||||||
|
this.$http.post(`/api/templateSku/getMySkuPage?size=-1&templateId=${id}`).then(res => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
const html = this.$refs.printRef.toPrint(template, res.data.records)
|
||||||
|
console.log(html)
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
toAddSku (id) {
|
||||||
|
this.$router.push(`/skuManage?id=${id}`)
|
||||||
},
|
},
|
||||||
|
|
||||||
getList () {
|
getList () {
|
||||||
console.log(this.tableData)
|
this.isLoading = true
|
||||||
this.$http.post('/api/learning/pluginPage', null, {
|
this.$http.post('/api/template/myTemplate', null, {
|
||||||
params: {
|
params: {
|
||||||
...this.search
|
...this.search
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
// this.tableData = res.data.records
|
this.tableData = res.data.records
|
||||||
// this.total = res.data.total
|
this.total = res.data.total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.isLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
remove (id) {
|
||||||
|
this.$confirm('确定删除该模板?', '温馨提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$http.post(`/api/template/removeById?id=${id}`).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功')
|
||||||
|
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -95,4 +178,28 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.Template {
|
||||||
|
.search-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: green;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<span @click="getCode" :loading="btnLoading">{{ isStart ? time + ' S' : '发送验证码' }}</span>
|
<span @click="getCode" :loading="btnLoading">{{ isStart ? time + ' S' : '发送验证码' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="primary" style="width: 100%" @click="login" :loading="btnLoading">重置设置</el-button>
|
<el-button type="primary" style="width: 100%" @click="login" :loading="btnLoading">设置</el-button>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="login-footer">
|
<div class="login-footer">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
@@ -78,7 +78,7 @@ import CryptoJS from 'crypto-js'
|
|||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (this.form.password != this.form.repassword) {
|
if (this.form.password != this.form.repassword) {
|
||||||
this.$message.success('两次密码输入不一致');
|
this.$message.error('两次密码输入不一致');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.btnLoading = true
|
this.btnLoading = true
|
||||||
|
|||||||
269
src/view/product/PriceDown.vue
Normal file
269
src/view/product/PriceDown.vue
Normal file
@@ -0,0 +1,269 @@
|
|||||||
|
<template>
|
||||||
|
<ai-list class="list" v-loading="isLoading" :element-loading-text="loadingText" element-loading-spinner="el-icon-loading">
|
||||||
|
<ai-title
|
||||||
|
slot="title"
|
||||||
|
title="拒绝调价"
|
||||||
|
isShowBottomBorder>
|
||||||
|
</ai-title>
|
||||||
|
<template slot="content">
|
||||||
|
<div class="content">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #right>
|
||||||
|
<el-button type="primary" @click="toLoad">加载</el-button>
|
||||||
|
<el-button type="primary" @click="beforeRejct">拒绝调价</el-button>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
<ai-card title="数据明细" style="padding-bottom: 40px;">
|
||||||
|
<ai-table
|
||||||
|
:isShowPagination="false"
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="tableData.length"
|
||||||
|
height="700"
|
||||||
|
style="margin-top: 8px;"
|
||||||
|
@getList="() => {}">
|
||||||
|
|
||||||
|
<el-table-column slot="productName" width="250px" :show-overflow-tooltip='true' label="商品名称" fixed="left">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div>
|
||||||
|
<el-image :src="scope.row.image" style="width: 40px; height: 40px" class="image" :preview-src-list="[scope.row.image]" />
|
||||||
|
{{ scope.row.productName }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-card>
|
||||||
|
</div>
|
||||||
|
<AiDialog
|
||||||
|
title="拒绝原因"
|
||||||
|
:visible.sync="rejectShow"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
customFooter
|
||||||
|
height="500px"
|
||||||
|
width="500px">
|
||||||
|
<el-form :model="rejectForm" ref="rejectForm" class="form">
|
||||||
|
<el-form-item
|
||||||
|
prop="reason"
|
||||||
|
label="拒绝原因:"
|
||||||
|
:rules="[{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]">
|
||||||
|
<el-input :rows="3" placeholder="请输入拒绝原因" type="textarea" v-model="rejectForm.reason"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="rejectShow = false">关 闭</el-button>
|
||||||
|
<el-button type="primary" @click="toReject">拒绝</el-button>
|
||||||
|
</span>
|
||||||
|
</AiDialog>
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { Message } from 'element-ui'
|
||||||
|
import {sendChromeAPIMessage} from '@/api/chromeApi'
|
||||||
|
import {timestampToTime} from '@/utils/date'
|
||||||
|
import JsonExcel from 'vue-json-excel'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'PriceDown',
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
reqData: {
|
||||||
|
pageInfo: {
|
||||||
|
pageSize: 100,
|
||||||
|
pageNo: 1
|
||||||
|
},
|
||||||
|
status: 1
|
||||||
|
},
|
||||||
|
colConfigs: [
|
||||||
|
{ slot: 'productName', label: '商品名称', width: '250px', align: 'left', fixed: 'left' },
|
||||||
|
{ prop: 'mallName', label: '店铺来源', width: '250px', align: 'left', fixed: 'left' },
|
||||||
|
{ prop: 'priceOrderSn', label: '调价单号', width: '140px', align: 'left', fixed: 'left' },
|
||||||
|
{ prop: 'skcId', label: 'SKC ID', width: '120px', align: 'left' },
|
||||||
|
{ prop: 'skcExtCode', label: 'SKC货号', width: '100px', align: 'left' },
|
||||||
|
{ prop: 'priceBeforeExchange', label: '原申报价格', width: '100px', align: 'left' },
|
||||||
|
{ prop: 'newSupplyPrice', label: '调整后申报价格', width: '100px', align: 'left' },
|
||||||
|
{ prop: 'source', label: '申请来源', width: '120px', align: 'left' },
|
||||||
|
{ prop: 'adjustReason', label: '调价原因', align: 'left' }
|
||||||
|
],
|
||||||
|
loadingText: '',
|
||||||
|
isLoading: false,
|
||||||
|
tableData: [],
|
||||||
|
currentIndex: 0,
|
||||||
|
rejectForm: {
|
||||||
|
reason: ''
|
||||||
|
},
|
||||||
|
rejectShow: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
JsonExcel
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
beforeGetList() {
|
||||||
|
this.$userCheck().then(() => {
|
||||||
|
this.toLoad()
|
||||||
|
}).catch((err) => {
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async toLoad() {
|
||||||
|
if (this.$store.state.mallList.length == 0) {
|
||||||
|
Message.error("请登录卖家中心,如已登录,请刷新助手")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.reqData.pageInfo.pageNo = this.startPage
|
||||||
|
this.tableData = []
|
||||||
|
this.currentIndex = 0
|
||||||
|
this.isLoading = true
|
||||||
|
for (let i = 0; i < this.$store.state.mallList.length; i++) {
|
||||||
|
this.reqData.pageInfo.pageNo = 1
|
||||||
|
this.loadingText = `正在加载店铺【${this.$store.state.mallList[i].mallName}】的调价信息`
|
||||||
|
await this.load(this.$store.state.mallList[i])
|
||||||
|
}
|
||||||
|
this.isLoading = false
|
||||||
|
},
|
||||||
|
async load(mallObj) {
|
||||||
|
let res = await sendChromeAPIMessage({
|
||||||
|
url: 'marvel-mms/cn/api/kiana/magneto/price-adjust/page-query',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: mallObj.mallId,
|
||||||
|
anti: true,
|
||||||
|
data: this.reqData})
|
||||||
|
if (res.errorCode == 1000000 && res.result.total > 0) {
|
||||||
|
for(let i = 0;i < res.result.list.length; i++) {
|
||||||
|
let item = res.result.list[i];
|
||||||
|
let data = {};
|
||||||
|
data.id = item.id
|
||||||
|
data.productName = item.productName
|
||||||
|
data.image = item.image
|
||||||
|
data.priceOrderSn = item.priceOrderSn
|
||||||
|
data.skcId = item.skcId
|
||||||
|
data.skcExtCode = item.skcExtCode
|
||||||
|
data.source = item.source
|
||||||
|
data.mallName = mallObj.mallName
|
||||||
|
data.mallId = mallObj.mallId
|
||||||
|
data.adjustReason = item.adjustReason
|
||||||
|
data.newSupplyPrice = item.newSupplyPrice / 100
|
||||||
|
data.num = item.skuInfoItemList.length
|
||||||
|
let skus = []
|
||||||
|
item.skuInfoItemList.map(item => {
|
||||||
|
skus.push(item.productSkuId)
|
||||||
|
})
|
||||||
|
data.skus = skus.join(',')
|
||||||
|
/*for(let k = 0; k < item.skuInfoItemList.length; k++) {
|
||||||
|
data = {...data,
|
||||||
|
productSkuId: item.skuInfoItemList[k].productSkuId,
|
||||||
|
priceBeforeExchange: item.skuInfoItemList[k].priceBeforeExchange / 100,
|
||||||
|
skuExtCode: item.skuInfoItemList[k].skuExtCode,
|
||||||
|
spec: item.skuInfoItemList[k].spec
|
||||||
|
}
|
||||||
|
|
||||||
|
this.tableData.push(data)
|
||||||
|
}*/
|
||||||
|
this.tableData.push(data)
|
||||||
|
|
||||||
|
}
|
||||||
|
if (res.result.list.length == this.reqData.pageInfo.pageSize) {
|
||||||
|
this.reqData.pageInfo.pageNo ++
|
||||||
|
await this.load(mallObj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeRejct() {
|
||||||
|
if (this.tableData.length <= 0) {
|
||||||
|
Message.error('请先加载待拒绝调价');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.rejectShow = true
|
||||||
|
},
|
||||||
|
async toReject() {
|
||||||
|
this.$refs.rejectForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.loadingText = '正在拼命处理中~'
|
||||||
|
this.isLoading = true
|
||||||
|
this.rejectShow = false
|
||||||
|
await this.reject()
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async reject() {
|
||||||
|
let rejectIds = []
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
rejectIds.push(this.tableData[i].id)
|
||||||
|
}
|
||||||
|
for (let j = 0; j < rejectIds.length; j++) {
|
||||||
|
let obj = this.tableData.filter(item => {
|
||||||
|
return item.id == rejectIds[j]
|
||||||
|
})
|
||||||
|
if (obj.length == 0) continue
|
||||||
|
obj = this.tableData.filter(item => {
|
||||||
|
return item.skus == obj[0].skus
|
||||||
|
})
|
||||||
|
let params = {}
|
||||||
|
if (obj.length > 1) {
|
||||||
|
params.adjustId = obj[0].id
|
||||||
|
params.adjustResultMap = {}
|
||||||
|
for (let k = 0; k < obj.length; k++) {
|
||||||
|
params.adjustResultMap[obj[k].id] = 2
|
||||||
|
}
|
||||||
|
params.result = 2
|
||||||
|
} else {
|
||||||
|
params = {
|
||||||
|
adjustId: obj[0].id,
|
||||||
|
reason: this.rejectForm.reason,
|
||||||
|
result: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log(obj[0].mallName, params)
|
||||||
|
let res = await sendChromeAPIMessage({
|
||||||
|
url: 'gmp/bg/magneto/api/price/purchase-adjust/review',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: obj[0].mallId,
|
||||||
|
anti: true,
|
||||||
|
data: params})
|
||||||
|
if (res.success) {
|
||||||
|
this.removeByRejectId(obj)
|
||||||
|
// this.remove(skuIds[j])
|
||||||
|
}
|
||||||
|
await this.$sleepSync(300)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
removeByRejectId(objArr) {
|
||||||
|
for (let j = 0; j < objArr.length; j++) {
|
||||||
|
for (let i = 0; i < this.tableData.length; i++) {
|
||||||
|
if (this.tableData[i].id == objArr[j].id) {
|
||||||
|
this.tableData.splice(i, 1)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.list {
|
||||||
|
.title-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep.ai-list {
|
||||||
|
.ai-list__content--right-wrapper {
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
padding: 0!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -548,6 +548,7 @@ import { DualAxes } from '@antv/g2plot'
|
|||||||
if (item.productSkcId == this.skcList[i].productSkcId) {
|
if (item.productSkcId == this.skcList[i].productSkcId) {
|
||||||
this.skcList[i].saleAmount = this.skcList[i].saleAmount + item.saleAmount
|
this.skcList[i].saleAmount = this.skcList[i].saleAmount + item.saleAmount
|
||||||
this.skcList[i].costAmount = this.skcList[i].costAmount + item.costAmount
|
this.skcList[i].costAmount = this.skcList[i].costAmount + item.costAmount
|
||||||
|
this.skcList[i].saleCount = this.skcList[i].saleCount + item.saleCount
|
||||||
this.skcList[i].profitAmount = this.skcList[i].profitAmount + item.profitAmount
|
this.skcList[i].profitAmount = this.skcList[i].profitAmount + item.profitAmount
|
||||||
flag = true
|
flag = true
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<ai-title
|
<ai-title
|
||||||
slot="title"
|
slot="title"
|
||||||
title="物流统计"
|
title="物流统计"
|
||||||
tips="数据来源于“履约服务账单->明细->缴费记录"
|
tips="数据来源于“履约服务账单->明细->缴费记录”"
|
||||||
isShowBottomBorder>
|
isShowBottomBorder>
|
||||||
</ai-title>
|
</ai-title>
|
||||||
<template slot="content">
|
<template slot="content">
|
||||||
@@ -184,7 +184,7 @@ import {sendChromeAPIMessage } from '@/api/chromeApi'
|
|||||||
let item = res.result.list[i]
|
let item = res.result.list[i]
|
||||||
this.totalLogisticFee += item.amount
|
this.totalLogisticFee += item.amount
|
||||||
|
|
||||||
this.transList.push(item.ptransId)
|
this.transList.push({ptransId: item.ptransId, chargeType: item.chargeType} )
|
||||||
}
|
}
|
||||||
if ((this.reqData.pageSize * this.reqData.pageNum) < res.result.total) {
|
if ((this.reqData.pageSize * this.reqData.pageNum) < res.result.total) {
|
||||||
this.reqData.pageNum ++
|
this.reqData.pageNum ++
|
||||||
@@ -203,10 +203,10 @@ import {sendChromeAPIMessage } from '@/api/chromeApi'
|
|||||||
needMallId: true,
|
needMallId: true,
|
||||||
mallId: this.$store.state.mallList[0].mallId,
|
mallId: this.$store.state.mallList[0].mallId,
|
||||||
data: {
|
data: {
|
||||||
chargeType: 0,
|
chargeType: this.transList[i].chargeType,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
ptransId: this.transList[i]
|
ptransId: this.transList[i].ptransId
|
||||||
}})
|
}})
|
||||||
if (res.errorCode == 1000000) {
|
if (res.errorCode == 1000000) {
|
||||||
for (let k = 0; k < res.result.list.length; k++) {
|
for (let k = 0; k < res.result.list.length; k++) {
|
||||||
|
|||||||
829
src/view/semi/SemiSendGoods_XC.vue
Normal file
829
src/view/semi/SemiSendGoods_XC.vue
Normal file
@@ -0,0 +1,829 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
||||||
|
<ai-title
|
||||||
|
slot="title"
|
||||||
|
title="发货(芯仓)"
|
||||||
|
tips="请先在当前浏览器登录“拼多多跨境卖家中心”,期间保持登录状态"
|
||||||
|
isShowBottomBorder>
|
||||||
|
</ai-title>
|
||||||
|
<template slot="content">
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #left>
|
||||||
|
<el-radio-group v-model="type">
|
||||||
|
<el-radio-button label="0">数据同步</el-radio-button>
|
||||||
|
<el-radio-button label="1">发货</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
|
||||||
|
<ai-card :key="0" v-if="type == '0'" title="数据明细" style="padding-bottom: 40px;">
|
||||||
|
<template #right>
|
||||||
|
<el-dropdown @command="handleClick">
|
||||||
|
<el-button type="primary" :disabled="isBegin">添加待发货订单</el-button>
|
||||||
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="byStore">按店铺添加</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="loadAll">一键添加所有</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
<!--<el-button type="primary" :disabled="isBegin" @click="isShow = true">添加备货单</el-button>
|
||||||
|
<el-button type="primary" :disabled="isBegin" @click="loadAll">一键加载全部</el-button>-->
|
||||||
|
</el-dropdown>
|
||||||
|
<el-button type="button" :class="'el-button el-button--primary'" @click="beginCreate">订单同步</el-button>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<ai-table
|
||||||
|
:tableData="choosedList"
|
||||||
|
:col-configs="robColConfigs"
|
||||||
|
:total="total"
|
||||||
|
height="500"
|
||||||
|
:isShowPagination="false"
|
||||||
|
style="margin-top: 8px;">
|
||||||
|
<el-table-column slot="productName" width="480px" label="订单信息" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="product">
|
||||||
|
<img :src="scope.row.productSkcPicture">
|
||||||
|
<div class="right">
|
||||||
|
<div>{{ scope.row.parentOrderMap.parentOrderSn }}</div>
|
||||||
|
<div>站点名: {{ scope.row.parentOrderMap.siteName }}</div>
|
||||||
|
<div>国家/地区: {{ scope.row.parentOrderMap.regionName1 }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="purchaseTime" width="180px" label="订单创建时间" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.parentOrderMap.parentOrderTimeStr }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column slot="className" label="子订单信息" width="440px" show-overflow-tooltip align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="order-manage_skuInfo__FW-Nd" v-for="(item, index) in scope.row.orderList" :key="index">
|
||||||
|
<div>
|
||||||
|
<div data-testid="beast-core-box" class="outerWrapper-1-3-1 outerWrapper-d18-1-3-20 index-module__image-preview___2fiZX">
|
||||||
|
<div class="index-module__img___p3B1N" :style="getStyle(item.thumbUrl)"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="order-manage_contentInfo__1Cjd6">
|
||||||
|
<div>子订单号:{{ item.orderSn}}</div>
|
||||||
|
<div>SKU ID:{{ item.productInfoList[0].productSkuId }}</div>
|
||||||
|
<div>SKC ID:{{ item.productInfoList[0].productSkcId }}</div>
|
||||||
|
<div>SKU 货号: {{ item.extCodeList[0] }}</div>
|
||||||
|
<div>属性: {{ item.spec }}</div>
|
||||||
|
<div>库存扣减仓库: {{ item.warehouseName }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="options" label="操作" width="80px" v-if="!isBegin" show-overflow-tooltip align="center" fixed="right">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" @click="remove(row.parentOrderMap.parentOrderSn)">移除</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-card>
|
||||||
|
<ai-card :key="1" v-if="type == '1'" title="待发货列表" style="padding-bottom: 40px;">
|
||||||
|
<template #title>
|
||||||
|
<el-button type="button" v-if="form.status == '0'" :class="'el-button el-button--primary'" @click="sendGoods">发货</el-button>
|
||||||
|
<el-button type="button" v-if="form.status == '1'" :class="'el-button el-button--primary'" @click="getLogisticInfo">取号</el-button>
|
||||||
|
<el-button type="button" v-if="form.status == '1'" :class="'el-button el-button--primary'" @click="writeBack">回传</el-button>
|
||||||
|
</template>
|
||||||
|
<template #right>
|
||||||
|
<ai-search-bar>
|
||||||
|
<template #right>
|
||||||
|
<div>
|
||||||
|
<div class="search-item" style="margin-top: 20px" >
|
||||||
|
<ai-select clearable :selectList="$dict.getDict('order_info_status')" v-model="form.status" @change="getOrderList"></ai-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ai-search-bar>
|
||||||
|
</template>
|
||||||
|
<ai-table
|
||||||
|
:tableData="orderDataList"
|
||||||
|
:col-configs="orderColConfig"
|
||||||
|
height="700"
|
||||||
|
:size="100"
|
||||||
|
:current.sync="form.current"
|
||||||
|
:size.sync="form.size"
|
||||||
|
:total="orderTotal"
|
||||||
|
@getList="getOrderList"
|
||||||
|
style="margin-top: 8px;">
|
||||||
|
<el-table-column slot="options" label="操作" align="center" fixed="right" width="140px">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<div class="table-options">
|
||||||
|
<el-button type="text" v-if="form.status == '1'" @click="toSend(row)">重新发货</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
</ai-card>
|
||||||
|
<AiDialog
|
||||||
|
title="添加待发货订单"
|
||||||
|
:visible.sync="isShow"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
customFooter
|
||||||
|
@confirm="onConfirm"
|
||||||
|
width="1290px">
|
||||||
|
<label style="width:90px">店铺:</label>
|
||||||
|
<el-select v-model="mallId" placeholder="请选择" @change="mallChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in mallList"
|
||||||
|
:key="item.mallId"
|
||||||
|
:label="item.mallName"
|
||||||
|
:value="item.mallId">
|
||||||
|
{{ item.mallName }}
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<ai-table
|
||||||
|
:tableData="tableData"
|
||||||
|
:col-configs="colConfigs"
|
||||||
|
:total="total"
|
||||||
|
:isShowPagination="false"
|
||||||
|
style="margin-top: 8px;"
|
||||||
|
v-loading="isDlgLoading"
|
||||||
|
@selection-change="onChooseChange">
|
||||||
|
<el-table-column slot="productName" width="320px" label="订单信息" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="product">
|
||||||
|
<img :src="scope.row.productSkcPicture">
|
||||||
|
<div class="right">
|
||||||
|
<div>{{ scope.row.parentOrderMap.parentOrderSn }}</div>
|
||||||
|
<div>站点名: {{ scope.row.parentOrderMap.siteName }}</div>
|
||||||
|
<div>国家/地区: {{ scope.row.parentOrderMap.regionName1 }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column slot="purchaseTime" width="180px" label="订单创建时间" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.parentOrderMap.parentOrderTimeStr }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column slot="className" label="子订单信息" width="440px" show-overflow-tooltip align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="order-manage_skuInfo__FW-Nd" v-for="(item, index) in scope.row.orderList" :key="index">
|
||||||
|
<div>
|
||||||
|
<div data-testid="beast-core-box" class="outerWrapper-1-3-1 outerWrapper-d18-1-3-20 index-module__image-preview___2fiZX">
|
||||||
|
<div class="index-module__img___p3B1N" :style="getStyle(item.thumbUrl)"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="order-manage_contentInfo__1Cjd6">
|
||||||
|
<div>子订单号:{{ item.orderSn}}</div>
|
||||||
|
<div>SKU ID:{{ item.productInfoList[0].productSkuId }}</div>
|
||||||
|
<div>SKC ID:{{ item.productInfoList[0].productSkcId }}</div>
|
||||||
|
<div>SKU 货号: {{ item.extCodeList[0] }}</div>
|
||||||
|
<div>属性: {{ item.spec }}</div>
|
||||||
|
<div>库存扣减仓库: {{ item.warehouseName }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</ai-table>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="isShow = false">关 闭</el-button>
|
||||||
|
<el-button type="primary" @click="onConfirm">添加</el-button>
|
||||||
|
</span>
|
||||||
|
</AiDialog>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</ai-list>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
import {sendChromeAPIMessage, sendTemuSellerAgentMessage, sendXcAPIMessage} from '@/api/chromeApi'
|
||||||
|
import { Message } from 'element-ui'
|
||||||
|
import {timestampToTime} from '@/utils/date'
|
||||||
|
export default {
|
||||||
|
name: 'SemiSendGoods_XC',
|
||||||
|
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
isShow: false,
|
||||||
|
orderDataList: [],
|
||||||
|
orderTotal: 0,
|
||||||
|
colConfigs: [
|
||||||
|
{ type: "selection", width: '70px', align: 'left' },
|
||||||
|
{ slot: 'productName' },
|
||||||
|
{ slot: 'subWarehouseName'},
|
||||||
|
{ prop: 'mallName', label: '店铺来源', align: 'center' },
|
||||||
|
{ slot: 'className'},
|
||||||
|
{ slot: 'purchaseTime'}
|
||||||
|
],
|
||||||
|
robColConfigs: [
|
||||||
|
{ slot: 'productName' },
|
||||||
|
{ slot: 'subWarehouseName'},
|
||||||
|
{ prop: 'mallName', label: '店铺来源', align: 'center' },
|
||||||
|
{ slot: 'className'},
|
||||||
|
{ slot: 'purchaseTime'}
|
||||||
|
],
|
||||||
|
orderColConfig: [
|
||||||
|
{ prop: 'mallName', label: '店铺名称', align: 'center' },
|
||||||
|
{ prop: 'orderId', label: '订单号', width: '220px'},
|
||||||
|
{ prop: 'receiveName', label: '收货人'},
|
||||||
|
{ prop: 'receivePhone', label: '收货人手机号', width: '160px'},
|
||||||
|
{ prop: 'logisticId', label: '物流单号', width: '160px'},
|
||||||
|
{ prop: 'expressCompany', label: '物流方式', width: '120px'},
|
||||||
|
{ prop: 'expressId', label: '物流公司', width: '100px'},
|
||||||
|
{ prop: 'status', label: '状态', format: v => this.$dict.getLabel('order_info_status', v)},
|
||||||
|
{ prop: 'createTime', label: '下单时间'}
|
||||||
|
],
|
||||||
|
form: {
|
||||||
|
warehouseId: 'XinCang',
|
||||||
|
status: '',
|
||||||
|
current: 1,
|
||||||
|
size: 100
|
||||||
|
},
|
||||||
|
mallId: '',
|
||||||
|
mallName: '',
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
isBegin: false,
|
||||||
|
choosedList: [],
|
||||||
|
choosedSnMallList: [],
|
||||||
|
arr: [],
|
||||||
|
createTotal: 0,
|
||||||
|
pageSize: 100,
|
||||||
|
currentPage: 1,
|
||||||
|
|
||||||
|
type: 0,
|
||||||
|
|
||||||
|
loadMallIndex: 0,
|
||||||
|
loadMode: 0, // 加载模式,0表示单个店铺加载,1表示一键加载
|
||||||
|
|
||||||
|
// 加载数据
|
||||||
|
isLoading: false,
|
||||||
|
isDlgLoading: false,
|
||||||
|
|
||||||
|
addressList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapState(['mallList'])
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.$dict.load('order_info_status');
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
onChooseChange (e) {
|
||||||
|
this.arr = e
|
||||||
|
},
|
||||||
|
mallChange() {
|
||||||
|
this.$userCheck(this.mallId).then(() => {
|
||||||
|
let mallInfo = this.mallList.filter(item => {
|
||||||
|
return item.mallId == this.mallId
|
||||||
|
})
|
||||||
|
this.mallName = mallInfo[0].mallName
|
||||||
|
|
||||||
|
// 下载数据
|
||||||
|
this.loadMode = 0
|
||||||
|
this.tableData = []
|
||||||
|
this.currentPage = 1
|
||||||
|
this.isDlgLoading = true
|
||||||
|
this.getList(this.tableData, this.mallId, this.mallName, 1)
|
||||||
|
}).catch((err) => {
|
||||||
|
this.mallId = ''
|
||||||
|
console.log(err)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onConfirm () {
|
||||||
|
if (this.arr.length == 0) {
|
||||||
|
Message.error("请选择待创建备货单")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.arr.map(item => {
|
||||||
|
let temp = this.choosedList.filter(i => {
|
||||||
|
return i.parentOrderMap.parentOrderSn == item.parentOrderMap.parentOrderSn
|
||||||
|
})
|
||||||
|
if (temp.length == 0) {
|
||||||
|
this.choosedList.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
Message.success("添加成功,可继续添加")
|
||||||
|
},
|
||||||
|
loadAll() {
|
||||||
|
this.$userCheck().then(() => {
|
||||||
|
this.choosedList = []
|
||||||
|
this.currentPage = 1
|
||||||
|
this.isLoading = true
|
||||||
|
if (this.$store.state.userInfo.type == 3) {
|
||||||
|
this.loadMode = 0
|
||||||
|
this.getList(this.choosedList, this.$store.state.mallId, this.$store.state.mallName, 1)
|
||||||
|
} else {
|
||||||
|
this.loadMallIndex = 0
|
||||||
|
this.loadMode = 1
|
||||||
|
this.getList(this.choosedList, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getOrderList() {
|
||||||
|
this.orderDataList = []
|
||||||
|
let res = this.$http.post('/api/semi/semiOrder/pageWaitSend',null,{
|
||||||
|
params: {
|
||||||
|
...this.form
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
this.orderDataList = res.data.records
|
||||||
|
this.orderTotal = res.data.total
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClick (e) {
|
||||||
|
if (e === 'byStore') {
|
||||||
|
this.isShow = true
|
||||||
|
} else if (e === 'loadAll') {
|
||||||
|
this.loadAll()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeBegin() {
|
||||||
|
if (this.choosedList.length <= 0) {
|
||||||
|
Message.error('请先添加待发货订单');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.beginCreate()
|
||||||
|
},
|
||||||
|
async getList (data, mallId, mallName, currentPage) {
|
||||||
|
let res = await sendTemuSellerAgentMessage({
|
||||||
|
url: 'kirogi/bg/mms/recentOrderList',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: mallId,
|
||||||
|
data: {
|
||||||
|
fulfillmentMode: 0,
|
||||||
|
pageNumber: this.currentPage,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
queryType: 2,
|
||||||
|
sortType: 1,
|
||||||
|
timeZone: "UTC+8",
|
||||||
|
parentAfterSalesTag: 0,
|
||||||
|
needBuySignService: 0,
|
||||||
|
sellerNoteLabelList: []
|
||||||
|
}})
|
||||||
|
if (res.errorCode == 0) {
|
||||||
|
res.result.pageItems.map((item) => {
|
||||||
|
data.push({...item, mallId: mallId, mallName: mallName})
|
||||||
|
})
|
||||||
|
|
||||||
|
if (this.pageSize == res.result.pageItems.length) {
|
||||||
|
currentPage ++
|
||||||
|
await this.getList(data, mallId, mallName, currentPage)
|
||||||
|
} else {
|
||||||
|
if (this.loadMode == 1) {
|
||||||
|
this.loadMallIndex ++
|
||||||
|
if (this.loadMallIndex < this.mallList.length) {
|
||||||
|
await this.$sleepSync(500)
|
||||||
|
await this.getList(data, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
this.isDlgLoading = false
|
||||||
|
Message.success("所有店铺待发货订单已加载完成")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
this.isDlgLoading = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await this.getList(data, mallId, mallName, currentPage)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
remove(parentOrderSn) {
|
||||||
|
for (let i = 0; i < this.choosedList.length; i++) {
|
||||||
|
if (this.choosedList[i].parentOrderMap.parentOrderSn == parentOrderSn) {
|
||||||
|
this.choosedList.splice(i, 1)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getStyle(url) {
|
||||||
|
return "background-image: url(" + url + "); width: 72px; height: 72px; cursor: pointer; border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.14);";
|
||||||
|
},
|
||||||
|
async beginCreate() {
|
||||||
|
let waitCreateList = []
|
||||||
|
|
||||||
|
this.choosedList.map(item => {
|
||||||
|
waitCreateList.push(item.parentOrderMap.parentOrderSn)
|
||||||
|
})
|
||||||
|
for (let j = 0; j < waitCreateList.length; j++) {
|
||||||
|
let obj = this.choosedList.filter(item => {
|
||||||
|
return item.parentOrderMap.parentOrderSn == waitCreateList[j]
|
||||||
|
})
|
||||||
|
let res = await sendTemuSellerAgentMessage({
|
||||||
|
url: 'mms/orchid/address/snapshot/order_shipping_address_query',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: obj[0].mallId,
|
||||||
|
data: {
|
||||||
|
parent_order_sn: obj[0].parentOrderMap.parentOrderSn
|
||||||
|
}})
|
||||||
|
|
||||||
|
if (res.error_code == 1000000 && res.success) {
|
||||||
|
let data = {
|
||||||
|
source: 0,
|
||||||
|
receiveName: res.result.receipt_name,
|
||||||
|
receiveAddress1: res.result.address_line1,
|
||||||
|
receiveAddress2: res.result.address_line2,
|
||||||
|
receivePhone: res.result.mobile,
|
||||||
|
receiveEmail: res.result.mail,
|
||||||
|
receiveCity: res.result.region_name3,
|
||||||
|
receiveProvince: res.result.region_name2,
|
||||||
|
receiveZipcode: res.result.post_code,
|
||||||
|
mallId: obj[0].mallId,
|
||||||
|
mallName: obj[0].mallName,
|
||||||
|
orderId: obj[0].parentOrderMap.parentOrderSn,
|
||||||
|
status: 0,
|
||||||
|
type: 1,
|
||||||
|
details: [],
|
||||||
|
createTime: obj[0].parentOrderMap.parentOrderTimeStr
|
||||||
|
}
|
||||||
|
for (let k = 0; k < obj[0].orderList.length; k++) {
|
||||||
|
data.details.push({
|
||||||
|
temuWarehouseId: obj[0].orderList[k].warehouseId,
|
||||||
|
sku: obj[0].orderList[k].productInfoList[0].productSkuId,
|
||||||
|
num: obj[0].orderList[k].quantity,
|
||||||
|
createTime: obj[0].parentOrderMap.parentOrderTimeStr
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let res1 = await this.$http.post(`/api/semi/semiOrder/addXc`, data)
|
||||||
|
if (res1.code == 0) {
|
||||||
|
this.remove(obj[0].parentOrderMap.parentOrderSn)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
async sendGoods() {
|
||||||
|
for (let i = 0; i < this.orderDataList.length; i++) {
|
||||||
|
await this.toSend(this.orderDataList[i])
|
||||||
|
await this.$sleepSync(200)
|
||||||
|
}
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
|
async toSend(obj) {
|
||||||
|
let params = {
|
||||||
|
warehouse_code: obj.details[0].warehouseCode,
|
||||||
|
name: obj.receiveName,
|
||||||
|
company: '',
|
||||||
|
address1: obj.receiveAddress1,
|
||||||
|
email: obj.receiveEmail,
|
||||||
|
address2: obj.receiveAddress2,
|
||||||
|
phone: obj.receivePhone,
|
||||||
|
address3: '',
|
||||||
|
consignee_phone_extension: '',
|
||||||
|
city: obj.receiveCity,
|
||||||
|
phone2: '',
|
||||||
|
province: obj.receiveProvince,
|
||||||
|
doorplate: '',
|
||||||
|
district: '',
|
||||||
|
license: '',
|
||||||
|
zipcode: obj.receiveZipcode,
|
||||||
|
country: 'US',
|
||||||
|
consignee_tax_type: '',
|
||||||
|
consignee_eori: '',
|
||||||
|
platform: '',
|
||||||
|
order_cod_price: '',
|
||||||
|
order_cod_currency: '',
|
||||||
|
shop: '',
|
||||||
|
refrence_no: obj.orderId,
|
||||||
|
courier: 'USPS-GALA',
|
||||||
|
calculation: 1,
|
||||||
|
is_discount: 1,
|
||||||
|
ignore_address: 0,
|
||||||
|
default_insurance_type: 1,
|
||||||
|
filter_sta_shipping: 1,
|
||||||
|
shipping_method_no: '',
|
||||||
|
is_insurance: '',
|
||||||
|
insurance_value: '',
|
||||||
|
insurance_value_currency: 'USD',
|
||||||
|
order_sale_amount: '',
|
||||||
|
order_sale_currency: '',
|
||||||
|
channel_code: '',
|
||||||
|
lifting_cabinet: '',
|
||||||
|
order_battery_type: '',
|
||||||
|
vat_tax_code: '',
|
||||||
|
is_platform_ebay: 0,
|
||||||
|
ebay_item_id: '',
|
||||||
|
ebay_transaction_id: '',
|
||||||
|
distribution_information: '',
|
||||||
|
IOSS: '',
|
||||||
|
insurance_type: '',
|
||||||
|
multiple_tracking_number: '',
|
||||||
|
is_allow_open: 0,
|
||||||
|
insurance_type_goods_value: '',
|
||||||
|
refrence_no_warehouse: '',
|
||||||
|
is_prime: '',
|
||||||
|
order_desc: '',
|
||||||
|
del_order_attached_ids: '',
|
||||||
|
order_type: 'sale',
|
||||||
|
order_business_type: 'b2c'
|
||||||
|
}
|
||||||
|
params['invoice[product_sku][]'] = ''
|
||||||
|
params['invoice[product_title_en][]'] = ''
|
||||||
|
params['invoice[product_title][]'] = ''
|
||||||
|
params['invoice[product_quantity][]'] = ''
|
||||||
|
params['invoice[unit_code][]'] = ''
|
||||||
|
params['invoice[product_declared_value][]'] = ''
|
||||||
|
params['invoice[product_weight][]'] = ''
|
||||||
|
|
||||||
|
if (obj.details[0].warehouseCode == 'UAXC002') {
|
||||||
|
params.courier = 'USPS'
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < obj.details.length; i++) {
|
||||||
|
params[`platform_barcode[${obj.details[i].productId}]`] = ''
|
||||||
|
params[`product_title_en[${obj.details[i].productId}]`] = obj.details[i].productTitleEn
|
||||||
|
params[`product_title[${obj.details[i].productId}]`] = obj.details[i].productTitle
|
||||||
|
params[`declared_value[${obj.details[i].productId}]`] = obj.details[i].declaredValue
|
||||||
|
params[`op_quantity[${obj.details[i].productId}]`] = obj.details[i].num
|
||||||
|
}
|
||||||
|
let res = await sendXcAPIMessage({
|
||||||
|
url: 'order/order/create/operation/0',
|
||||||
|
isFormData: true,
|
||||||
|
method: 'POST',
|
||||||
|
data: params})
|
||||||
|
if (res.ask == 1) {
|
||||||
|
let res1 = await this.$http.post(`/api/semi/semiOrder/updateStatus`, null, {params: {
|
||||||
|
id: obj.id,
|
||||||
|
status: 1
|
||||||
|
}})
|
||||||
|
if (res1.code != 0) {
|
||||||
|
Message.error(res1.msg)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Message.error(res.message)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getLogisticInfo () {
|
||||||
|
|
||||||
|
for (let i = 0; i < this.orderDataList.length; i++) {
|
||||||
|
let params = {
|
||||||
|
warehouse_note: '',
|
||||||
|
is_vip: '',
|
||||||
|
allot_logistics_for_lg: '',
|
||||||
|
order_attachment: '',
|
||||||
|
is_cut_off: '',
|
||||||
|
large_order: '',
|
||||||
|
is_temu_warehouse: '',
|
||||||
|
'time-type': 'date_create',
|
||||||
|
'order-type': 'DESC',
|
||||||
|
ORDER_TRIAL_FEE_SHOW: 1,
|
||||||
|
type: 1,
|
||||||
|
code: this.orderDataList[i].orderId,
|
||||||
|
SKU: '',
|
||||||
|
channel_code: '',
|
||||||
|
platform_shop: '',
|
||||||
|
account_name: '',
|
||||||
|
deliveryFeeFor: '',
|
||||||
|
deliveryFeeTo: '',
|
||||||
|
serial_number: '',
|
||||||
|
create_type: '',
|
||||||
|
remark: '',
|
||||||
|
is_one_piece: '',
|
||||||
|
platform: '',
|
||||||
|
seller: '',
|
||||||
|
is_shared: '',
|
||||||
|
is_ques: '',
|
||||||
|
country: '',
|
||||||
|
warehouse_id: '',
|
||||||
|
shipping_method: '',
|
||||||
|
is_oda: '',
|
||||||
|
is_cod: '',
|
||||||
|
is_prime: '',
|
||||||
|
process_again: '',
|
||||||
|
ot_id: '',
|
||||||
|
abnormal_type: '',
|
||||||
|
sub_status: 0,
|
||||||
|
picking_status: '',
|
||||||
|
order_type: '',
|
||||||
|
longest_aging: '',
|
||||||
|
recipient_type: 'buyer_name',
|
||||||
|
recipient_info: '',
|
||||||
|
buyer_type: 'buyer_id',
|
||||||
|
buyer_info: '',
|
||||||
|
reference_no: '',
|
||||||
|
is_repeat: '',
|
||||||
|
is_return: '',
|
||||||
|
timeType: 'create',
|
||||||
|
DateFrom: '',
|
||||||
|
DateEnd: '',
|
||||||
|
E35: '',
|
||||||
|
insurance_status: '',
|
||||||
|
have_tracking_no: '',
|
||||||
|
keyword: '',
|
||||||
|
status: 3,
|
||||||
|
is_more: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = await sendXcAPIMessage({
|
||||||
|
url: 'order/order-list/list/a/a/page/1/pageSize/50',
|
||||||
|
isFormData: true,
|
||||||
|
method: 'POST',
|
||||||
|
data: params})
|
||||||
|
if (res.state == 1) {
|
||||||
|
let res1 = await this.$http.post(`/api/semi/semiOrder/updateLogistic`, null, {params: {
|
||||||
|
orderId: this.orderDataList[i].orderId,
|
||||||
|
logisticId: res.data[0].shipping_method_no,
|
||||||
|
expressCompany: res.data[0].shipping_method,
|
||||||
|
expressId: res.data[0].carrier_name
|
||||||
|
}})
|
||||||
|
if (res1.code != 0) {
|
||||||
|
Message.error(`【${this.orderDataList[i].orderId}】订单取号失败`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await this.$sleepSync(200)
|
||||||
|
}
|
||||||
|
this.getOrderList()
|
||||||
|
},
|
||||||
|
async writeBack() {
|
||||||
|
for (let i = 0; i < this.orderDataList.length; i++) {
|
||||||
|
let res = await sendTemuSellerAgentMessage({
|
||||||
|
url: 'mms/orchid/address/snapshot/order_shipping_address_query',
|
||||||
|
needMallId: true,
|
||||||
|
mallId: obj[0].mallId,
|
||||||
|
data: {
|
||||||
|
fulfillmentMode: 0,
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
queryType: 2,
|
||||||
|
sortType: 1,
|
||||||
|
parentOrderSnList: [
|
||||||
|
this.orderDataList[i].orderId
|
||||||
|
],
|
||||||
|
timeZone: "UTC+8",
|
||||||
|
parentAfterSalesTag: 0,
|
||||||
|
needBuySignService: 0,
|
||||||
|
sellerNoteLabelList: []
|
||||||
|
}})
|
||||||
|
if (res.errorCode == 0) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
.list {
|
||||||
|
.title-right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
& > div:first-child {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
::v-deep.ai-list {
|
||||||
|
.ai-list__content--right-wrapper {
|
||||||
|
background: transparent;
|
||||||
|
box-shadow: none;
|
||||||
|
padding: 0!important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.product {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.right {
|
||||||
|
flex: 1;
|
||||||
|
text-align: left;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 60px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
position: relative;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: rgba(243, 8, 8, .4);
|
||||||
|
|
||||||
|
@keyframes warn {
|
||||||
|
0% {
|
||||||
|
transform: translate(-50%, -50%) scale(0);
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translate(-50%, -50%) scale(1.1);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
z-index: 11;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: warn 0.9s ease-out;
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
box-shadow: 1px 1px 30px #EF2D02;
|
||||||
|
transform: translate(-50%, -50%) scale(0.2);
|
||||||
|
transition: all ease-in-out 0.6s;
|
||||||
|
background: rgba(243, 8, 8, .6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-manage_productInfo__1pD83>img {
|
||||||
|
|
||||||
|
width: 60px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.order-manage_productInfo__1pD83 {
|
||||||
|
min-height: 60px;
|
||||||
|
padding-left: 70px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-manage_productInfo__1pD83>div:nth-child(2) {
|
||||||
|
color: rgba(0,0,0,.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.outerWrapper {
|
||||||
|
margin: 4px 4px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot-module__dot___M-RuH .dot-module__circle___2l2UV {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot-module__dot___M-RuH {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.index-module__image-preview___2fiZX .index-module__img___p3B1N {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
margin-right: 10px;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
font-size: 12px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--bc-Table-emptyTextColor);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.textoverflow {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-manage_skuInfo__FW-Nd {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-manage_contentInfo__1Cjd6 {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: left;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 240px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.order-manage_skuInfo__FW-Nd .order-manage_contentInfo__1Cjd6 .order-manage_title__1VTO5 {
|
||||||
|
-webkit-flex-wrap: wrap;
|
||||||
|
-ms-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
color: rgba(0,0,0,.8);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -289,7 +289,7 @@
|
|||||||
data.push({...item, mallId: mallId, mallName: mallName})
|
data.push({...item, mallId: mallId, mallName: mallName})
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.pageSize == length) {
|
if (this.pageSize == res.result.subOrderForSupplierList.length) {
|
||||||
currentPage ++
|
currentPage ++
|
||||||
this.getList(data, mallId, mallName, currentPage)
|
this.getList(data, mallId, mallName, currentPage)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user