Commit 990e6c8c authored by zhangdy's avatar zhangdy

first

parents
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
}],
"stage-2"
],
"plugins": ["transform-runtime"],
"comments": false,
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["istanbul"]
}
}
}
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.idea
{
"search.followSymlinks": false
}
\ No newline at end of file
MIT License
Copyright (c) 2016-present taylorchen709
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
require('./check-versions')()
process.env.NODE_ENV = 'production'
var ora = require('ora')
var rm = require('rimraf')
var path = require('path')
var chalk = require('chalk')
var webpack = require('webpack')
var config = require('../config')
var webpackConfig = require('./webpack.prod.conf')
var spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, function (err, stats) {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')
console.log(chalk.cyan(' Build complete.\n'))
console.log(chalk.yellow(
' Tip: built files are meant to be served over an HTTP server.\n' +
' Opening index.html over file:// won\'t work.\n'
))
})
})
var chalk = require('chalk')
var semver = require('semver')
var packageConfig = require('../package.json')
var shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
var versionRequirements = [
{
name: 'node',
currentVersion: semver.clean(process.version),
versionRequirement: packageConfig.engines.node
},
]
if (shell.which('npm')) {
versionRequirements.push({
name: 'npm',
currentVersion: exec('npm --version'),
versionRequirement: packageConfig.engines.npm
})
}
module.exports = function () {
var warnings = []
for (var i = 0; i < versionRequirements.length; i++) {
var mod = versionRequirements[i]
if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
warnings.push(mod.name + ': ' +
chalk.red(mod.currentVersion) + ' should be ' +
chalk.green(mod.versionRequirement)
)
}
}
if (warnings.length) {
console.log('')
console.log(chalk.yellow('To use this template, you must update following to modules:'))
console.log()
for (var i = 0; i < warnings.length; i++) {
var warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
/* eslint-disable */
require('eventsource-polyfill')
var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
hotClient.subscribe(function (event) {
if (event.action === 'reload') {
window.location.reload()
}
})
require('./check-versions')()
var config = require('../config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
}
var opn = require('opn')
var path = require('path')
var express = require('express')
var webpack = require('webpack')
var proxyMiddleware = require('http-proxy-middleware')
var webpackConfig = require('./webpack.dev.conf')
// default port where dev server listens for incoming traffic
var port = process.env.PORT || config.dev.port
// automatically open browser, if not set will be false
var autoOpenBrowser = !!config.dev.autoOpenBrowser
// Define HTTP proxies to your custom API backend
// https://github.com/chimurai/http-proxy-middleware
var proxyTable = config.dev.proxyTable
var app = express()
var compiler = webpack(webpackConfig)
var devMiddleware = require('webpack-dev-middleware')(compiler, {
publicPath: webpackConfig.output.publicPath,
quiet: true
})
var hotMiddleware = require('webpack-hot-middleware')(compiler, {
log: () => {}
})
// force page reload when html-webpack-plugin template changes
compiler.plugin('compilation', function (compilation) {
compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
hotMiddleware.publish({ action: 'reload' })
cb()
})
})
// proxy api requests
Object.keys(proxyTable).forEach(function (context) {
var options = proxyTable[context]
if (typeof options === 'string') {
options = { target: options }
}
app.use(proxyMiddleware(options.filter || context, options))
})
// handle fallback for HTML5 history API
app.use(require('connect-history-api-fallback')())
// serve webpack bundle output
app.use(devMiddleware)
// enable hot-reload and state-preserving
// compilation error display
app.use(hotMiddleware)
// serve pure static assets
var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
app.use(staticPath, express.static('./static'))
var uri = 'http://localhost:' + port
var _resolve
var readyPromise = new Promise(resolve => {
_resolve = resolve
})
console.log('> Starting dev server...')
devMiddleware.waitUntilValid(() => {
console.log('> Listening at ' + uri + '\n')
// when env is testing, don't need open it
if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
// opn(uri)
}
_resolve()
})
var server = app.listen(port)
module.exports = {
ready: readyPromise,
close: () => {
server.close()
}
}
var path = require('path')
var config = require('../config')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
exports.assetsPath = function (_path) {
var assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
var cssLoader = {
loader: 'css-loader',
options: {
minimize: process.env.NODE_ENV === 'production',
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
var loaders = [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
}
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
}
// https://vue-loader.vuejs.org/en/configurations/extract-css.html
return {
css: generateLoaders(),
postcss: generateLoaders(),
less: generateLoaders('less'),
sass: generateLoaders('sass', { indentedSyntax: true }),
scss: generateLoaders('sass'),
stylus: generateLoaders('stylus'),
styl: generateLoaders('stylus')
}
}
// Generate loaders for standalone style files (outside of .vue)
exports.styleLoaders = function (options) {
var output = []
var loaders = exports.cssLoaders(options)
for (var extension in loaders) {
var loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
var utils = require('./utils')
var config = require('../config')
var isProduction = process.env.NODE_ENV === 'production'
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
})
}
var path = require('path')
var utils = require('./utils')
var config = require('../config')
var vueLoaderConfig = require('./vue-loader.conf')
function resolve(dir) {
return path.join(__dirname, '..', dir)
}
module.exports = {
entry: {
app: './src/main.js'
},
externals: {
'vue': 'Vue',
'vue-router': 'VueRouter',
'element-ui': 'ELEMENT',
'vuex': 'Vuex',
'axios': 'axios',
'echarts': 'echarts'
// 'CKEditor':'CKEditor',
// 'DecoupledEditor':'DecoupledEditor'
},
output: {
path: config.build.assetsRoot,
filename: '[name].js',
publicPath: process.env.NODE_ENV === 'production'
? config.build.assetsPublicPath
: config.dev.assetsPublicPath
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': resolve('src'),
'assets': resolve('src/assets'),
'scss_vars': '@/styles/vars.scss'
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [resolve('src'), resolve('test')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
use:[
{
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
loader: 'image-webpack-loader',// 压缩图片
options: {
disable: true
}
}
]
},
// {
// test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
// loader: 'url-loader',
// options: {
// limit: 10000,
// name: utils.assetsPath('img/[name].[hash:7].[ext]')
// }
// },
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
}
}
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
},
// cheap-module-eval-source-map is faster for development
devtool: '#cheap-module-eval-source-map',
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
new FriendlyErrorsPlugin()
]
})
var path = require('path')
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var CopyWebpackPlugin = require('copy-webpack-plugin')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var ExtractTextPlugin = require('extract-text-webpack-plugin')
var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
// var env = config.build.env
var env = require('../config/prod.env')
var webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true
})
},
devtool: config.build.productionSourceMap ? '#source-map' : false,
output: {
path: config.build.assetsRoot,
filename: utils.assetsPath('js/[name].[chunkhash].js'),
chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
},
plugins: [
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new webpack.DefinePlugin({
'process.env': env
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
},
sourceMap: false,
// exclude: /\/node_modules\/@ckeditor/
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
}
}),
// generate dist index.html with correct asset hash for caching.
// you can customize output by editing /index.html
// see https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: config.build.index,
template: 'index.html',
inject: true,
minify: {
removeComments: true,
collapseWhitespace: true,
removeAttributeQuotes: true
// more options:
// https://github.com/kangax/html-minifier#options-quick-reference
},
// necessary to consistently work with multiple chunks via CommonsChunkPlugin
chunksSortMode: 'dependency'
}),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: function (module, count) {
// any required modules inside node_modules are extracted to vendor
return (
module.resource &&
/\.js$/.test(module.resource) &&
module.resource.indexOf(
path.join(__dirname, '../node_modules')
) === 0
)
}
}),
// extract webpack runtime and module manifest to its own file in order to
// prevent vendor hash from being updated whenever app bundle is updated
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest',
chunks: ['vendor']
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
var CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
var merge = require('webpack-merge')
var prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"'
})
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
var argv = require('minimist')(process.argv.slice(2));
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: false,
productionGzip: false,
productionGzipExtensions: ['js', 'css'],
bundleAnalyzerReport: process.env.npm_config_report
},
dev: {
env: require('./dev.env'),
host: 'jieziman.com',
port: 8088,
autoOpenBrowser: true,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {//转发:本地请求资源的时候:localhost转发到这个路径下请求资源 防止跨域
// '/api': {
// target: 'http://devijzm.yl9158.com/',
// changeOrigin: true,
// pathRewrite: {
// '^/api': ''
// }
// }
},
cssSourceMap: false
}
}
'use strict'
let argv = require('minimist')(process.argv.slice(2));
let env = '"'+argv.env+'"';
module.exports = {
NODE_ENV: '"production"',
env: env
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" name="viewport" content="width=device-width,initial-scale=1.0">
<title>智链互联跨境电商ERP</title>
<link rel="icon" type="image/x-icon" href="/static/logo.ico">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://jzm-oss.oss-cn-hangzhou.aliyuncs.com/static/element-ui.css">
<!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->
<!-- <link rel="stylesheet" href="/static/element-ui/element-ui.css"></link> -->
</head>
<body>
<div id="app">
</div>
<script src="https://cdn.staticfile.org/vue/2.5.16/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-router/3.0.1/vue-router.min.js"></script>
<script src="https://cdn.staticfile.org/vuex/3.0.1/vuex.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
<!-- <script src="/static/ckeditor.js"></script>
<script src="https://cdn.ckeditor.com/ckeditor5/17.0.0/decoupled-document/ckeditor.js"></script> -->
<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-6.5.0.min.js"></script>
<!-- <script src="https://unpkg.com/wangeditor/release/wangEditor.min.js" async></script> -->
<script src="https://cdn.bootcdn.net/ajax/libs/wangEditor/3.1.1/wangEditor.min.js" async></script>
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script> -->
<!-- <script src="/static/element-ui/element-ui.js"></script> -->
<script src="https://jzm-oss.oss-cn-hangzhou.aliyuncs.com/static/element-ui.js"></script>
<script src="https://cdn.staticfile.org/echarts/4.0.3/echarts.min.js"></script>
<script type="text/javascript" src="//www.17track.net/externalcall.js"></script>
<!-- <script src="/static/threed-real-sdk-1.1.0.js"></script> -->
<script src="https://3drealoss.oss-cn-beijing.aliyuncs.com/threed-real-sdk-1.2.1.js"></script>
<script src="http://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
</body>
</html>
<!-- <style>
html {font-size:625%;}
</style> -->
<script>
window.onload = function(){
let jieziman=true
if(window.location.host.indexOf('printwe.net')>0){
jieziman=false
}else{
jieziman=true
}
document.getElementsByTagName("title")[0].innerText = jieziman?'智链互联跨境电商ERP':'红茄跨境电商ERP'
}
</script>
\ No newline at end of file
{
"name": "vueadmin",
"version": "1.0.1",
"description": "vue+element",
"author": "zdy",
"license": "MIT",
"scripts": {
"dev": "node build/dev-server.js --env=dev",
"start": "node build/dev-server.js",
"build": "node build/build.js --env=www",
"buildUat": "node build/build.js --env=uat",
"buildSit": "node build/build.js --env=sit",
"buildDev": "node build/build.js --env=dev"
},
"dependencies": {
"@ckeditor/ckeditor5-build-decoupled-document": "^17.0.0",
"@ckeditor/ckeditor5-vue": "^1.0.1",
"ali-oss": "^6.5.1",
"axios": "0.18.0",
"crypto-js": "^3.1.9-1",
"echarts": "^4.0.3",
"element-ui": "^2.10.0",
"font-awesome": "^4.7.0",
"nprogress": "^0.2.0",
"qs": "6.5.2",
"vue": "^2.2.2",
"vue-quill-editor": "^3.0.6",
"vue-router": "^2.3.0",
"vuex": "^2.0.0-rc.6"
},
"devDependencies": {
"autoprefixer": "^6.7.2",
"axios-mock-adapter": "^1.7.1",
"babel-core": "^6.22.1",
"babel-loader": "^6.2.10",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-polyfill": "^6.16.0",
"babel-preset-env": "^1.2.1",
"babel-preset-es2015": "^6.0.0",
"babel-preset-stage-2": "^6.22.0",
"babel-register": "^6.22.0",
"chalk": "^1.1.3",
"connect-history-api-fallback": "^1.3.0",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.26.1",
"eventsource-polyfill": "^0.9.6",
"express": "^4.14.1",
"extract-text-webpack-plugin": "^2.0.0",
"file-loader": "^0.10.0",
"friendly-errors-webpack-plugin": "^1.1.3",
"function-bind": "^1.0.2",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"image-webpack-loader": "^6.0.0",
"json-loader": "^0.5.4",
"less": "3.8.0",
"less-loader": "4.1.0",
"minimist": "1.2.0",
"mockjs": "^1.0.1-beta3",
"node-sass": "^4.11.0",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.0.0",
"rimraf": "^2.6.0",
"sass-loader": "^7.0.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"url-loader": "^0.5.8",
"vue-loader": "^11.1.4",
"vue-style-loader": "^2.0.0",
"vue-template-compiler": "^2.2.4",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^2.6.1"
},
"engines": {
"node": ">= 4.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
<template>
<div id="app">
<transition name="fade"
mode="out-in">
<router-view></router-view>
</transition>
</div>
</template>
<script>
export default {
name: 'app',
components: {
}
}
</script>
<style lang="scss">
body {
margin: 0px;
padding: 0px;
// min-width: 1280px;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, SimSun, sans-serif;
font-size: 14px;
-webkit-font-smoothing: antialiased;
}
*{
box-sizing: border-box;
}
#app {
position: absolute;
top: 0px;
bottom: 0px;
width: 100%;
}
.el-submenu [class^=fa] {
vertical-align: baseline;
margin-right: 10px;
}
.el-menu-item [class^=fa] {
vertical-align: baseline;
margin-right: 10px;
}
.toolbar {
background: #f2f2f2;
padding: 10px;
//border:1px solid #dfe6ec;
margin: 10px 0px;
.el-form-item {
margin-bottom: 10px;
}
}
.fade-enter-active,
.fade-leave-active {
transition: all .2s ease;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
.el-form-item__label{
font-size: 12px!important;
}
.el-form--inline .el-form-item{
margin-bottom: -5px!important;
}
.el-table{
font-size: 13px!important;
color: #333;
}
.el-table thead{
color:#434649;
}
.el-input.is-disabled .el-input__inner {
background-color: #FFF!important;
}
.el-radio__input.is-disabled+span.el-radio__label{
color: #606266!important
}
.el-checkbox__input.is-disabled+span.el-checkbox__label{
color: #606266!important
}
</style>
\ No newline at end of file
@font-face {
font-family: 'webfont';
font-display: swap;
src: url('//at.alicdn.com/t/webfont_haalegwist.eot'); /* IE9*/
src: url('//at.alicdn.com/t/webfont_haalegwist.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('//at.alicdn.com/t/webfont_haalegwist.woff2') format('woff2'),
url('//at.alicdn.com/t/webfont_haalegwist.woff') format('woff'), /* chrome、firefox */
url('//at.alicdn.com/t/webfont_haalegwist.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('//at.alicdn.com/t/webfont_haalegwist.svg#站酷高端黑') format('svg'); /* iOS 4.1- */
}
body{
font-family:"webfont" !important;
font-size:14px;font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
\ No newline at end of file
/* ---------------------global CSS----------------------- */
/* display */
.dn{ display: none; }
.di{ display: inline; }
.db{ display: block; }
.dib{ display: inline-block; }
/* if the element is block level(eg. div, li), using 'inline_any' instead */
.df{ display: flex; }
.dif{ display: inline-flex; }
/* height */
.h14{ height: 14px; }
.h16{ height: 16px; }
.h18{ height: 18px; }
.h20{ height: 20px; }
.h22{ height: 22px; }
.h24{ height: 24px; }
/* line-height */
.lh14{ line-height: 14px; }
.lh16{ line-height: 16px; }
.lh18{ line-height: 18px; }
.lh20{ line-height: 20px; }
.lh22{ line-height: 22px; }
.lh24{ line-height: 24px; }
.lh30{ line-height: 30px; }
.lh40{ line-height: 40px; }
/* width (fixed width value)*/
.w20{ width: 20px; }
.w50{ width: 50px; }
.w70{ width: 70px; }
.w100{ width: 100px; }
.w150{ width: 150px; }
.w192{ width:192px }
.w200{ width: 200px; }
.w210{ width: 210px; }
/* percent width value */
.pct25{ width: 25%; }
.pct30{ width: 30%; }
.pct33{ width: 33.3%; }
.pct45{ width: 45%; }
.pct50{ width: 50%; }
.pct70{ width: 70%; }
.wpt100{ width: 100%; }
/* margin */
.m0{ margin: 0; }
.m10{margin: 10px;}
.ml5{ margin-left: 5px; }
.ml10{ margin-left: 10px; }
.ml15{ margin-left: 15px; }
.ml20{ margin-left: 20px; }
.ml30{ margin-left: 30px; }
.ml40{ margin-left: 40px!important; }
.mr5{ margin-right: 5px; }
.mr10{ margin-right: 10px; }
.mr15{ margin-right: 15px; }
.mr20{ margin-right: 20px; }
.mr30{ margin-right: 30px; }
.mr27{ margin-right: 27px;}
.mt5{ margin-top: 5px; }
.mt10{ margin-top: 10px; }
.mt15{ margin-top: 15px; }
.mt20{ margin-top: 20px; }
.mt40{ margin-top: 40px; }
.mt50{ margin-top: 50px; }
.mb5{ margin-bottom: 5px; }
.mb10{ margin-bottom: 10px; }
.mb15{ margin-bottom: 15px; }
.mb20{ margin-bottom: 20px; }
.mb40{ margin-bottom: 40px; }
/* padding */
.p0{ padding: 0; }
.pl5{ padding-left: 5px; }
.p5{ padding: 5px; }
.pt5{ padding-top: 5px; }
.pr5{ padding-right: 5px; }
.pb5{ padding-bottom: 5px; }
.p10{ padding: 10px; }
.pl10{ padding-left: 10px; }
.pt10{ padding-top: 10px; }
.pr10{ padding-right: 10px; }
.pb10{ padding-bottom: 10px; }
.p15{ padding: 15px; }
.pl15{ padding-left: 15px; }
.pt15{ padding-top: 15px; }
.pr15{ padding-right: 15px; }
.pb15{ padding-bottom: 15px; }
.p20{ padding: 20px; }
.pl20{ padding-left: 20px; }
.pt20{ padding-top: 20px; }
.pr20{ padding-right: 20px; }
.pb20{ padding-bottom: 20px; }
.pt30{padding-top: 30px; }
.pl30{padding-left: 30px; }
.pbr0{padding-right: 30px; }
.pb30{padding-bottom: 30px; }
/* border-color name rule: border(b)-position(l/r/t/b/d)-width(null/2)-style(null/sh)-color(first one letter/first two letter) |-> All colors are safe color*/
.bd{ border: 1px solid rgba(0,0,0,.12); }
.bl{ border-left: 1px solid rgba(0,0,0,.12); }
.br{ border-right: 1px solid rgba(0,0,0,.12); }
.bt{ border-top: 1px solid rgba(0,0,0,.12); }
.bb{ border-bottom: 1px solid rgba(0,0,0,.12); }
/* background-color name rule: bg - (key word/Hex color) |-> All colors are safe color */
.bgwh{ background-color: #fff; }
.bg-default{ background-color: #eee; }
.bg-blue{ background: #367EE2;}
/* safe color */
.g0{ color: #000; }
.g3{ color: #333; }
.gc{ color: #ccc};
.wh{ color: #ffffff; }
.gf5{color: #f56c6c}
.g19{color: #19AA8D}
.txt-blue{ color: #547DF9;}
.icon-color{color: #367EE2;}
.gray-nine{
color:#999
}
.f-red {
color: #ec4339;
}
.f-yellow{
color:#f96
}
.f-blue{
color: #367EE2
}
/* font-size */
.f12{ font-size: 12px; }
.f13{ font-size: 13px; }
.f14{ font-size: 14px; }
.f16{ font-size: 16px; }
.f18{ font-size: 18px; }
.f20{ font-size: 20px; }
.f24{ font-size: 24px; }
/* font-style */
.n{ font-weight: normal;font-style: normal; }
.b{ font-weight: bold; }
.i{ font-style: italic; }
/* text-align */
.tc{ text-align: center; }
.tr{ text-align: right; }
.tl{ text-align: left; }
.tj{ text-align: justify; }
/*flex align*/
.jsb{ justify-content: space-between; }
.jsa{ justify-content: space-around; }
.jsc{ justify-content: center; }
.ac{ align-items: center; }
.fw{ flex-wrap: wrap }
.fc{ flex-direction: column; }
.fr{flex-direction: row-reverse}
/* text-decoration */
.tdl{ text-decoration: underline; }
.tdn,.tdn:hover,.tdn a:hover,a.tdl:hover{ text-decoration: none; }
/* letter-spacing */
.lt-1{ letter-spacing: -1px; }
.lt0{ letter-spacing: 0; }
.lt1{ letter-spacing: 1px; }
/* white-space */
.nowrap{ white-space: nowrap; }
/* word-wrap */
.bk{ word-wrap: break-word; }
/* float */
.l{ float: left; }
.r{ float: right; }
/* clear */
.cl{ clear: both; }
/* position */
.rel{ position: relative; }
.abs{ position: absolute; }
.fixd{ position: fixed; }
/*z-index*/
.zx1{ z-index: 1; }
.zx2{ z-index: 2; }
/* cursor */
.poi{ cursor: pointer; }
.def{ cursor: default; }
/* overflow */
.ovh{ overflow: hidden; }
.ova{ overflow: auto; }
/* visibility */
.vh{ visibility: hidden; }
.vv{ visibility: visible; }
/* zoom */
.z{*zoom:1;}
/* ------------------- multiply CSS ------------------ */
/* 块状元素水平居中 */
.auto{ margin-right: auto;margin-left: auto; }
/* 清除浮 动*/
.fix{*zoom:1;}
.fix:after{ display: table;clear: both;content: ''; }
/* 基于display:table-cell的自适应布局 */
.cell{display:table-cell; *display:inline-block; width:2000px; *width:auto;}
/* 双栏自适应cell部分连续英文字符换行 */
.cell_bk{ display: table;width: 100%;table-layout: fixed;word-wrap: break-word; }
/* 单行文字溢出虚点显 示*/
.ell{ overflow: hidden;white-space: nowrap;text-overflow: ellipsis; }
/* css3过渡动画效果 */
.trans{ -webkit-transition: all .3s;transition: all .3s; }
/* 无框文本框文本域 */
.bd_none{ border: 0;outline: none; }
/* 绝对定位隐藏 */
.abs_out{ position: absolute;top: -999em;left: -999em; }
.abs_clip{ position: absolute;clip: rect(0 0 0 0); }
/* 按钮禁用 */
.disabled{ cursor: default !important;pointer-events: none;color: #acacac !important;border-color: #acacac !important;outline: 0 !important;text-shadow: 1px 1px #fff !important; }
.disabled:hover{ text-decoration: none !important; }
/*inline-block与float等宽列表*/
.inline_box{ font-family: Arial;font-size: 1em;letter-spacing: -.25em; }
.inline_two,.inline_three,.inline_four,.inline_five,.inline_six,.inline_any{ display: inline-block;vertical-align: top;letter-spacing: 0; }
.float_two,.float_three,.float_four,.float_five,.float_six{ float: left; }
.inline_two,.float_two{ width: 49.9%; }
.inline_three,.float_three{ width: 33.3%; }
.inline_four,.float_four{ width: 24.9%; }
.inline_five,.float_five{ width: 19.9%; }
.inline_six,.float_six{ width: 16.6%; }
.inline_fix{ display: inline-block;overflow: hidden;width: 100%;height: 0; }
.dis-flex{
display:flex
}
.content-height{
// background: #F5F5F5;
min-width: 1280px;
min-height: 359px;
overflow:hidden;
padding: 0 20px;
box-sizing: border-box;
margin-top: 58px;
button {
display: inline-block;
margin-bottom: 0;
// border: 1px solid transparent;
border-radius: 2px;
padding: 0 12px;
font-weight: 400;
line-height: 32px;
text-align: center;
vertical-align: middle;
white-space: nowrap;
cursor: pointer;
user-select: none;
touch-action: manipulation;
border-radius: 4px;
border:none
}
a{cursor:pointer;text-decoration: none;}
}
.myorder-content{
min-width: 1280px;
margin: 20px 0px 40px;
overflow:hidden;
display: flex;
}
.content-right{
width: 87%
}
.contain-page{
width: 1100px;
margin: 0 auto;
}
.el-pagination.is-background .el-pager li:not(.disabled).active{
background-color: #F5222D!important;
}
li{
list-style:none;
}
.font-color{
color:#666666
}
.el-dialog__header{
background:#eee;
padding: 8px 20px 8px;
}
.el-dialog__headerbtn{
top: 5px;
right: 10px;
}
.el-table thead tr th {
background-color: #eee!important;
}
.el-table--border th{
border-right: 1px solid #ddd!important;
border-bottom: 1px solid #ddd;
}
.el-table--border td{
border-right: 1px solid #ddd!important
}
.el-table td{
border-bottom: 1px solid #ddd;
}
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
border-bottom:1px solid #dddddd;
}
.el-tree-node__content{
height: 36px;
}
.el-input-number .el-input__inner {
text-align: left!important
}
.btn {
display: inline-block;
vertical-align: middle;
height: 34px;
min-width: 80px;
margin-right: 10px;
font-size: 13px;
}
.btn-primary {
color: #fff;
background-color: #367EE2;
border-color: #367EE2;
}
.item-collection-white{
border: 1px solid #ccc;
border-bottom:none;
min-width: 100px;
height: 39px;
border-radius: 4px 4px 0 0;
padding: 8px 2px;
box-sizing:border-box;
float: left;
margin-left: 10px;
text-align: center;
cursor:pointer;
}
.item-collection{
background-color: #367EE2;
border: 1px solid #367EE2;
color: #fff;
min-width: 100px;
height: 39px;
border-radius: 4px 4px 0 0;
padding: 8px 2px;
box-sizing:border-box;
float: left;
margin-left: 10px;
text-align: center
}
.el-dropdown-link {
cursor: pointer;
color: #367EE2;
font-size: 13px;
}
.el-table th{
padding: 5px 0;
}
.el-table .cell{
padding-right: 2px!important;
padding-left: 2px!important;
}
.el-table td{
padding: 2px 0;
}
.break-two{
display: -webkit-box;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
/*! autoprefixer: on */
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
-webkit-line-clamp: 2;
}
.el-button{
font-size: 13px;
}
.btn-myj-orange {
background-color: #f96!important;
border: 1px solid #f96;
color: #fff;
}
.clean::after {
content: '';
position: absolute;
left: 0;
width: 43px;
height: 41px;
background: url(../img/otherIcon.png?v=31) no-repeat -1130px -90px;
}
.vc{
vertical-align: middle;
}
.el-table .discard-row {
color: #999;
}
@color-primary: #333333;;
\ No newline at end of file
import { router } from '../router'
import qs from 'qs';
import {rootUrl} from '@/config'
let apiPrefix = process.env.NODE_ENV === 'production' ? '/' : '/api';
let AxiosIns = axios.create({
baseURL: rootUrl,
timeout: 50000,
transformRequest: [data => {
if(data instanceof FormData){
return data
}else{
return qs.stringify(data)
}
}],
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8' },
withCredentials: true
})
let timer = [];
let delay = 300;
let loading = null;
let options = {
// lock: true,
text: '拼命加载中',
background: 'rgba(0, 0, 0, 0.2)',
// target: "#app",
}
let isLoginOut=false
AxiosIns.interceptors.request.use((config) => {
if (loading == null) {
loading = ELEMENT.Loading.service(options);
}
// loading = ELEMENT.Loading.service(options);
timer.push(setTimeout(() => {
}, delay))
return config;
})
AxiosIns.interceptors.response.use((response) => {
for (let t of timer) {
clearTimeout(t);
}
if (loading != null) {
loading.close();
loading = null;
}
// loading.close()
try {
if (response.data && response.data.success !== true) {
let msg = Array.isArray(response.data.errorMsg) ? response.data.errorMsg[0] : (response.data.errorMsg?response.data.errorMsg:response.data.errMsg);
if ((msg == "LOGIN_CHECK_ERROR"||msg=="LOGIN_TIME_OUT") && (!isLoginOut)) {
isLoginOut=true
ELEMENT.Message({
message: '登录信息过期,请重新登录',
type: 'warning',
showClose: true,
});
setTimeout(() => {
isLoginOut=false
window.localStorage.removeItem("user")
router.push({path: '/login'})
}, 1000)
loading.close();
loading = null;
}
if(!isLoginOut){
ELEMENT.Message({
message: msg || '接口调用失败',
type: 'warning',
showClose: true,
})
loading.close();
loading = null;
}
}
} catch (e) {
}
return response.data;
}, (error) => {
for (let t of timer) {
clearTimeout(t);
}
// loading.close();
try {
if (error.response.data.status!= 404&&error.response.data.status!= 400) {
loading.close();
loading = null;
ELEMENT.Message({
message:'接口调用失败',
type: 'warning',
showClose: true,
});
}else{
loading.close();
loading = null;
ELEMENT.Message({
message:'接口调用失败',
type: 'warning',
showClose: true,
});
}
} catch (e) {
loading.close();
loading = null;
ELEMENT.Message({
message:'接口调用失败',
type: 'warning',
showClose: true,
});
}
return Promise.reject(error);
})
Vue.prototype.axios = AxiosIns;
const CryptoJS = require('crypto-js'); //引用AES源码js
const key = CryptoJS.enc.Utf8.parse('0388039203920300'); //十六位十六进制数作为密钥
const iv = CryptoJS.enc.Utf8.parse('smkldospdorenyla'); //十六位十六进制数作为密钥偏移量
//解密方法
function Decrypt(word) {
let encryptedHexStr = CryptoJS.enc.Hex.parse(word);
let srcs = CryptoJS.enc.Base64.stringify(encryptedHexStr);
let decrypt = CryptoJS.AES.decrypt(srcs, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
let decryptedStr = decrypt.toString(CryptoJS.enc.Utf8);
return decryptedStr.toString();
}
//加密方法
function Encrypt(word) {
// console.log(currentKey)
// let key=CryptoJS.enc.Utf8.parse(currentKey)
let srcs = CryptoJS.enc.Utf8.parse(word);
let encrypted = CryptoJS.AES.encrypt(srcs, key, {iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 });
return encrypted.toString();
}
function md5(str, times = 1) {
for (let i = 0; i < times; i++) {
str = CryptoJS.MD5(str).toString();
}
return str;
}
export default {
Decrypt ,
Encrypt,
md5
}
// import OSS from 'ali-oss'
var SIGN_REGEXP = /([yMdhsm])(\1*)/g;
var DEFAULT_PATTERN = 'yyyy-MM-dd';
function padding(s, len) {
var len = len - (s + '').length;
for (var i = 0; i < len; i++) { s = '0' + s; }
return s;
};
export default {
getQueryStringByName: function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
var context = "";
if (r != null)
context = r[2];
reg = null;
r = null;
return context == null || context == "" || context == "undefined" ? "" : context;
},
formatDate: {
format: function (date, pattern) {
pattern = pattern || DEFAULT_PATTERN;
return pattern.replace(SIGN_REGEXP, function ($0) {
switch ($0.charAt(0)) {
case 'y': return padding(date.getFullYear(), $0.length);
case 'M': return padding(date.getMonth() + 1, $0.length);
case 'd': return padding(date.getDate(), $0.length);
case 'w': return date.getDay() + 1;
case 'h': return padding(date.getHours(), $0.length);
case 'm': return padding(date.getMinutes(), $0.length);
case 's': return padding(date.getSeconds(), $0.length);
}
});
},
parse: function (dateString, pattern) {
var matchs1 = pattern.match(SIGN_REGEXP);
var matchs2 = dateString.match(/(\d)+/g);
if (matchs1.length == matchs2.length) {
var _date = new Date(1970, 0, 1);
for (var i = 0; i < matchs1.length; i++) {
var _int = parseInt(matchs2[i]);
var sign = matchs1[i];
switch (sign.charAt(0)) {
case 'y': _date.setFullYear(_int); break;
case 'M': _date.setMonth(_int - 1); break;
case 'd': _date.setDate(_int); break;
case 'h': _date.setHours(_int); break;
case 'm': _date.setMinutes(_int); break;
case 's': _date.setSeconds(_int); break;
}
}
return _date;
}
return null;
}
},
client(data) {
return new OSS({
region: data.region,
accessKeyId: data.accessKeyId,
accessKeySecret: data.accessKeySecret,
bucket: data.bucket
})
},
copyUrl(data){
let url = data;
let oInput = document.createElement('input');
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 选择对象;
document.execCommand("Copy");
ELEMENT.Message({
message: '复制成功',
type: 'success',
showClose: true,
});
oInput.remove()
},
};
<template>
<el-dialog
title="Sku选择"
:visible.sync="dialogVisibleChooseSku"
width="65%"
@close="close()">
<div class="dis-flex dis-just">
<div style="width:48%">
<div class="contain-template">
<div class="contain-title b ">系统产品</div>
<div class="mt10 ml10">
<el-select v-model="listParamsSys.valueSys" placeholder="搜索类型" size="small" class="w150">
<el-option
v-for="item in optionsSys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsSys.inputSys">
</el-input>
<el-button type="primary" @click="searchSysForBinding">搜 索</el-button>
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataChoose"
:data="tableDataChoose"
tooltip-effect="dark"
highlight-current-row
@current-change="sysProductRowChange"
style="width: 100%"
border
>
<el-table-column
align="center"
width="60px"
label="主图">
<template slot-scope="scope">
<img style="width: 50px;height: 50px" :src="scope.row.mainImageUrl+'?x-oss-process=image/resize,m_fixed,h_50,w_50'" class="img-size"/>
</template>
</el-table-column>
<el-table-column
align="center"
label="系统SKU名称">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">{{scope.row.skuName}}</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="系统SKU编码">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">{{scope.row.skuCode}}</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="可用库存">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">{{scope.row.stockInfo}}</div>
</template>
</el-table-column>
<el-table-column
align="center"
>
<template slot-scope="scope" slot="header">
操作
<el-tooltip placement="top" effect="light">
<div slot="content">选择方法:<br/>1.点击”选择“按钮选择<br/>2.鼠标双击选择</div>
<i class="el-icon-question"/>
</el-tooltip>
</template>
<template slot-scope="scope">
<div class="el-dropdown-link" @click="bindPlatformClick(scope.row)">选择</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handleSysSizeChange"
@current-change="handleSysCurrentChange"
:current-page="listParamsSys.currentPage"
:page-sizes="[5, 10, 20, 50]"
:page-size="listParamsSys.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsSys.total"
style="float:right;display:inline-block;max-width: 90%"
></el-pagination>
</div>
</div>
</div>
<div style="width:60%">
<div class="contain-template">
<div class="contain-title b ">已选sku</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataPlatformProduct"
:data="tableDataPlatformProduct"
tooltip-effect="dark"
highlight-current-row
@current-change="platformProductRowChange"
style="width: 100%"
border
>
<el-table-column
align="center"
width="60px"
label="主图">
<template slot-scope="scope">
<img style="width: 50px;height: 50px" :src="scope.row.unitImageUrl+'?x-oss-process=image/resize,m_fixed,h_50,w_50'" class="img-size"/>
</template>
</el-table-column>
<el-table-column
align="center"
prop="skuName"
label="产品SKU">
</el-table-column>
<el-table-column
prop="skuCode"
align="center"
label="产品SKU编码">
</el-table-column>
<el-table-column
label="操作"
align="center"
width="80"
>
<template slot-scope="scope">
<div class="el-dropdown-link" @click="delChooseSku(scope.$index, scope.row)">删除</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
<span slot="footer" class="tc">
<el-button type="primary" @click="add(tableDataPlatformProduct)" size="small">确 定</el-button>
<el-button type="primary" @click="close()" size="small">关 闭</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
dialogVisibleChooseSku: {
type: Boolean,
default: true,
},
},
name:"productBindingDialog",
data() {
return {
listParamsSys:{
currentPage: 1,
pageSize: 5,
total: 0,
valueSys: 'skuName',
inputSys:'',
isEnabled:1
},
parentData:{},
listParamsPlatformProduct:{
currentPage: 1,
pageSize: 5,
total: 0,
valuePlatform: '',
inputPlatform:''
},
sysRowForBinding:{},
platformRowForBinding:{},
tableDataChoose:[],
tableDataPlatformProduct: [],
optionsPlatform: [{
value: '',
label: '搜索类型'
}, {
value: 'platformSku',
label: '平台SKU'
}, {
value: 'platformSpu',
label: '平台SPU名'
}, {
value: 'platformProductId',
label: '平台产品ID'
}],
optionsSys: [{
value: '',
label: '搜索类型'
}, {
value: 'skuName',
label: '系统SKU名'
}, {
value: 'skuCode',
label: '系统SKU编码'
}, {
value: 'spuName',
label: '系统SPU名'
}],
}
},
mounted() {
},
methods: {
delChooseSku(index,row) {
this.tableDataPlatformProduct.splice(index, 1)
},
add(value){
this.listParamsSys.inputSys = ''
this.tableDataChoose = []
this.tableDataPlatformProduct = []
this.$emit('addProduct',value)
},
close(){
this.listParamsSys.inputSys = ''
this.tableDataChoose = []
this.tableDataPlatformProduct = []
this.$emit('changeParent',false)
},
bindPlatformClick(sysRow){
this.$refs.multipleTable_tableDataChoose.setCurrentRow(sysRow);
this.sysRowForBinding = sysRow;
this.doBindingWork();
},
bindSysClick(platformRow){
this.platformRowForBinding = platformRow;
this.$refs.multipleTable_tableDataPlatformProduct.setCurrentRow(platformRow);
},
doBindingWork(){
if (!this.sysRowForBinding.id) {
this.$message({
message:'请先选中系统产品',
type:'info'
});
return;
}
let isExits = false;
this.tableDataPlatformProduct.forEach(res => {
if (res.skuCode === this.sysRowForBinding.skuCode) {
isExits = true;
}
})
if (isExits) {
this.$message({
message:'该sku已存在!',
type:'error'
});
return;
}
let data = {
productUnitId: this.sysRowForBinding.id,
unitImageUrl: this.sysRowForBinding.mainImageUrl||"",
skuName: this.sysRowForBinding.skuName,
skuCode: this.sysRowForBinding.skuCode
};
this.tableDataPlatformProduct.push(data);
/*this.axios({
url: '/assistant/product/bindSku',
data,
method: "post",
}).then(res => {
if(res.success){
this.$message({
message:'绑定成功',
type:'success'
});
this.$set(this.platformRowForBinding,"bindSkuName",data.skuName);
}
})*/
},
handlePlatformCurrentChange(val) {
this.listParamsPlatformProduct.currentPage = val;
this.searchPlatformForBinding();
},
handlePlatformSizeChange(val) {
this.listParamsPlatformProduct.pageSize = val;
this.searchPlatformForBinding();
},
handleSysSizeChange(val) {
this.listParamsSys.pageSize = val;
this.searchSysForBinding();
},
handleSysCurrentChange(val) {
this.listParamsSys.currentPage = val;
this.searchSysForBinding();
},
platformProductRowChange(val){
this.platformRowForBinding = val;
},
sysProductRowChange(val){
this.sysRowForBinding = val;
},
searchSysForBinding() {
let data = Object.assign({}, this.listParamsSys);
data[data.valueSys] = data.inputSys;
data.isQuerySaleInfo = 0;
this.axios({
url: 'assistant/systemProductUnitGroup/queryUnitPage',
data,
method: "post"
}).then(res => {
if (res.success) {
this.tableDataChoose = res.module.result;
this.listParamsSys.total = res.module.total;
}
});
},
searchPlatformForBinding(){
let data = Object.assign({}, this.listParamsPlatformProduct);
data[data.valuePlatform] = data.inputPlatform;
data["isQueryBindSysSku"] = true;
this.axios({
url: 'assistant/product/online/queryOnlineProductUnit',
data,
method: "post"
}).then(res => {
if (res.success) {
if (res.module) {
let tableData = res.module.result;
if (this.parentData) {
let parentData = this.parentData;
this.parentData = null;
if (parentData.platformProductSkuIdList && parentData.platformProductSkuIdList.length) {
tableData.forEach(x=>{
let find = parentData.platformProductSkuIdList.find(d => d == x.platformProductSkuId);
if (find) {
this.bindSysClick(x);
}
});
}
}
this.tableDataPlatformProduct = tableData;
this.listParamsPlatformProduct.total = res.module.total;
}else{
this.tableDataPlatformProduct = [];
this.listParamsPlatformProduct.total = 0;
}
}
});
},
onshow(data){
this.parentData = Object.assign({}, data);
console.log('3', data,this.$parent.productBindingDialogData);
this.listParamsPlatformProduct.inputPlatform = data.inputPlatform;
this.listParamsPlatformProduct.valuePlatform = data.valuePlatform;
this.sysRowForBinding = {};
this.tableDataPlatformProduct = [];
this.tableDataChoose = [];
this.searchPlatformForBinding();
this.searchSysForBinding();
},
},
}
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<template>
<el-dialog
title="选择模板"
:visible.sync="dialogVisibleTemplate"
width="50%"
:show-close="false">
<div>
<el-select v-model="tempalteValue" placeholder="请选择" size="small" class="w100">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
placeholder="支持精确搜索和模糊搜索"
size="small"
class="pct50"
v-model="searchMsg">
</el-input>
<button class="btn btn-primary" @click="getMessageTemplateList">搜索</button>
<el-table
ref="multipleTable"
:data="tableDataTemplate"
tooltip-effect="dark"
border
max-height="300"
style="width: 100%"
class="mt20"
>
<el-table-column
label="序号"
align="center"
width="80"
>
<template slot-scope="scope">
{{scope.$index+1}}
</template>
</el-table-column>
<el-table-column
label="名称"
align="center"
prop="templateName"
>
</el-table-column>
<el-table-column
label="模板内容"
align="center"
width="300"
>
<template slot-scope="scope">
<el-tooltip effect="light" :content="scope.row.templateDescription" placement="top">
<div class="break-two" style="width:290px">{{scope.row.templateDescription}}</div>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
label="操作"
width="80">
<template slot-scope="scope">
<div class="el-dropdown-link" @click="chooseTemplate(scope.row)">{{choosedId==scope.row.id?'取消关联':'选择'}}</div>
</template>
</el-table-column>
</el-table>
<div class="pull-right">
<el-pagination
@size-change="sizeChangeTemplate"
@current-change="currentChangeTemplate"
:current-page="listParamsTemplate.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsTemplate.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsTemplate.total"
style="float:right;display:inline-block"
></el-pagination>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="chooseTemplate({templateName:'',id:''})" type="primary">关 闭</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
dialogVisibleTemplate:{
type:Boolean,
default: false,
},
choosedId:{
type:String,
default: '',
}
},
data() {
return {
tableDataTemplate:[],
listParamsTemplate:{
currentPage: 1,
pageSize: 50,
total: 0,
templateName:'',
templateDescription:''
},
searchMsg:'',
options: [{
value: '1',
label: '模板名称'
}, {
value: '2',
label: '模板内容'
}],
tempalteValue: '1'
}
},
mounted(){
this.getMessageTemplateList()
},
methods:{
chooseTemplate(val){
this.$emit('chooseTemplate',val)
},
getMessageTemplateList(){
let{listParamsTemplate,tempalteValue,choosedId}=this
if(tempalteValue==1){
this.listParamsTemplate.templateName=this.searchMsg
this.listParamsTemplate.templateDescription=''
}else{
this.listParamsTemplate.templateDescription=this.searchMsg
this.listParamsTemplate.templateName=''
}
this.axios({
url:'assistant/activity/pageWishCampaignTemplateQuery',
params:listParamsTemplate,
method: "get"
}).then(res => {
if(res.success){
let data=res.module
this.tableDataTemplate=data.result
this.listParamsTemplate.total=data.total
}
})
},
currentChangeTemplate(val) {
this.listParamsTemplate.currentPage = val;
this.getMessageTemplateList();
},
sizeChangeTemplate(val){
this.listParamsTemplate.pageSize = val;
this.getMessageTemplateList();
},
},
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<div class="productInfoModule" style="position: absolute;right: 120px;margin-bottom:0;border:none;z-index:1;" v-if="activeAnchor">
<div class="location-href-box">
<div class="locationHref location-href fixed-box">
<div class="maodian">
<ul>
<li class="locationHrefUP"></li>
<li class="locationHrefIn" v-for="(item,index) in stepsArr" :key="index" @click="jump(index)"><a>{{item.title}}</a>
</li>
<li class="locationHrefDown"></li>
</ul>
</div>
<div class="scroll-top" @click="backTopClick">
<i class="el-icon-arrow-up"/>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
stepsArr: {
type: Array,
default:[],
}
},
data() {
return {
screenWidth: document.body.clientWidth,
activeAnchor:true,
}
},
mounted() {
this.$nextTick(function() {
window.addEventListener('scroll', this.onScroll)
if(this.screenWidth<1300){
this.activeAnchor=false
}
})
window.onresize = () => {
return (() => {
this.screenWidth = document.body.clientWidth
if(this.screenWidth<1300){
this.activeAnchor=false
}else{
this.activeAnchor=true
}
})()
}
},
methods: {
backTopClick(){
document.documentElement.scrollTop = document.body.scrollTop = 0;
},
onScroll() {
var jump = document.querySelectorAll('.product-info-module')
var distance =
document.documentElement.scrollTop ||
window.pageYOffset ||
document.body.scrollTop
jump.forEach((item, index) => {
if (distance >= item.offsetTop) {
this.activeStep = index
}
})
},
// 锚点点击
jump(index) {
console.log(index)
this.activeStep = index
// 用 class=".step-jump" 添加锚点,此时的类名要放在tr上,放在td上不对,
// 以后做的时候要注意这点,不是表格的时候,如何放置锚点
let jump = document.querySelectorAll('.product-info-module')
// 通过 offsetTop 获取对象到窗体顶部的距离,然后赋值给 scrollTop,就能实现锚点的功能
let total = jump[index].offsetTop
console.log(total)
// scrollTop滚动条距离页面的距离
let distance =
document.documentElement.scrollTop ||
window.pageYOffset ||
document.body.scrollTop
// console.log(distance)
// 平滑滚动,时长500ms,每10ms一跳,共50跳
let step = total / 50
if (total > distance) {
smoothDown()
} else {
let newTotal = distance - total
step = newTotal / 50
smoothUp()
}
function smoothDown() {
if (distance < total) {
distance += step
document.body.scrollTop = distance
document.documentElement.scrollTop = distance
window.pageYOffset = distance
setTimeout(smoothDown, 10)
} else {
document.body.scrollTop = total
document.documentElement.scrollTop = total
window.pageYOffset = total
}
}
function smoothUp() {
if (distance > total) {
distance -= step
document.body.scrollTop = distance
document.documentElement.scrollTop = distance
window.pageYOffset = distance
setTimeout(smoothUp, 10)
} else {
document.body.scrollTop = total
document.documentElement.scrollTop = total
window.pageYOffset = total
}
}
}
},
}
</script>
<style lang="less" scoped>
.productInfoModule {
border-radius: 4px;
margin: 0 auto 30px;
}
.location-href-box {
position: absolute;
margin-top: -80px;
}
.location-href.fixed-box {
position: fixed;
right: auto;
margin-top: 80px;
z-index: 10;
.scroll-top{
height:30px;
width:30px;
background:#999;
border-radius: 2px;
color: #fff;
cursor: pointer;
line-height: 30px;
text-align: center;
font-size: 20px;
}
}
.location-href{
.maodian {
border-left: 1px solid #ddd;
margin-left: 5px;
margin-bottom: 10px;
}
ul {
list-style-type: none;
padding: 0;
width: 100px;
position: relative;
left: -7px;
margin: 0;
li {
display: block;
box-sizing: border-box;
}
.locationHrefUP{
padding: 8px;
padding-left: 10px;
background: url(../../assets/img/rightNavIcon.png) no-repeat 1px -6px;
}
.locationHrefDown {
padding: 8px;
padding-left: 10px;
background: url(../../assets/img/rightNavIcon.png) no-repeat 1px -1px;
}
}
.locationHrefIn a {
color: #999;
line-height: 26px;
padding-left: 20px;
display: block;
box-sizing: border-box;
background: url(../../assets/img/rightNavIcon.png) no-repeat 1px -18px;
}
}
</style>
\ No newline at end of file
<template>
<el-table :data="tableData" border style="width: 100%" ref="multipleTable" @selection-change="handleSelectionChange" v-if="tableShow">
<el-table-column type="selection" width="40" align="center">
</el-table-column>
<template v-for="item in tableHeader">
<table-column v-if="item.children && item.children.length" :key="item.id" :coloumn-header="item"></table-column>
<el-table-column v-else :key="item.id" :label="item.label" :prop="item.prop" align="center"></el-table-column>
</template>
</el-table>
</template>
<script>
import tableColumn from './tableColumn'
export default {
props: {
// 表格的数据
tableData: {
type: Array,
required: true
},
// 多级表头的数据
tableHeader: {
type: Array,
required: true
},
sizeCode:{
type:Array,
required:true,
},
tableShow:{
type:Boolean,
required:true,
}
},
components: {
tableColumn
},
updated(){
if(this.tableShow){
this.tableCheckInit()
}
},
mounted(){
this.tableCheckInit()
},
methods:{
tableCheckInit(){
this.$nextTick(()=>{
this.tableData.forEach(row => {
if(this.sizeCode.indexOf(row.Type) >= 0){
this.$refs.multipleTable.toggleRowSelection(row,true);
}
})
})
},
handleSelectionChange(val) {
this.$emit('getCurrentSize',val)
},
tableCheckChange() {
this.$nextTick(()=>{
for (let row of this.tableData) {
let flag = false;
for (let size of this.sizeCode) {
if (row.Type === size.Type) {
flag = true;
}
}
if (flag) {
this.$refs.multipleTable.toggleRowSelection(row, true);
} else {
this.$refs.multipleTable.toggleRowSelection(row, false);
}
}
});
}
},
// watch:{
// sizeCode(newName, oldName){
// this.tableCheckInit()
// }
// }
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-dialog
title="主图图搜"
:visible.sync="dialogVisibleImg"
width="55%"
@close="cancelClick">
<div class="container-o-box default mt10">
<div class="com-block m-bottom10 p10">
<div>系统有以下相似产品:</div>
<div class="product-same" >
<div class="produce-img" v-for="(item,index) in tableData" :key="index">
<img :src="item.mainImageUrl"/>
<div class="tc">spu编码:{{item.spuCode}}</div>
<div class="tc">spu名:{{item.spuName}}</div>
<div class="tc">标题:{{item.name}}</div>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="cancelClick">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
dialogVisibleImg:{
type: Boolean,
default: false,
},
},
data() {
return {
tableData:[
],
}
},
methods:{
cancelClick(){
this.$emit('cancelClick')
},
startCollect(fileURL){
console.log('fileURL --> ', fileURL);
let that = this;
this.axios({
url:'assistant/systemProductSeries/imageQueryPage',
data:{
mainImageUrl:fileURL,
isSpu:true
},
method: "post"
}).then(res => {
if(res.success){
that.tableData = res.module.result;
}
})
},
}
}
</script>
<style lang="less" scoped>
.container-o-box{
clear:both;
.default{
margin: 0;
width: 100%;
}
.com-block {
width: 100%;
background-color: #fff;
box-shadow: 0 0 0 0;
}
.product-same{
display:flex;
flex-wrap: wrap;
justify-content: flex-start;
.produce-img{
border:1px solid #ccc;
width:200px;
height:250px;
margin:10px 16px;
img{
width:100%;
height:180px;
vertical-align: bottom;
}
div{
border-top:1px solid #ccc
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="dis-flex dis-just">
<div style="width: 60%">
<div class="contain-template">
<div class="contain-title b">平台产品</div>
<div class="mt10 ml10">
<el-select @change="searchPlatformForBinding()" :value="listParamsPlatformProduct.platformProductId" placeholder="请选择Spu" size="mini" >
<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in productIdSpudicts"></el-option>
</el-select>
<!-- <el-select
v-model="listParamsPlatformProduct.valuePlatform"
placeholder="搜索类型"
size="small"
class="w150"
>
<el-option
v-for="item in optionsPlatform"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> -->
<!-- <el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsPlatformProduct.inputPlatform"
>
</el-input>
<el-button type="primary" @click="searchPlatformForBinding"
>搜 索</el-button
> -->
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataPlatformProduct"
:data="tableDataPlatformProduct"
tooltip-effect="dark"
highlight-current-row
@current-change="platformProductRowChange"
style="width: 100%"
max-height="400"
border
>
<!-- <el-table-column
align="center"
prop="index"
width="50"
label="序号">
</el-table-column> -->
<el-table-column align="center" width="60px" label="主图">
<template slot-scope="scope">
<img
style="width: 50px; height: 50px"
:src="
scope.row.mainImageUrl +
'?x-oss-process=image/resize,m_fixed,h_50,w_50'
"
class="img-size"
/>
</template>
</el-table-column>
<el-table-column prop="agentCode" align="center" label="平台名">
</el-table-column>
<el-table-column prop="authCode" align="center" label="店铺名">
</el-table-column>
<el-table-column align="center" prop="sku" label="产品SKU">
</el-table-column>
<el-table-column align="center" label="颜色/尺寸">
<template slot-scope="scope">
<div>{{ scope.row.colorCode }}/{{ scope.row.sizeCode }}</div>
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="scope" slot="header">
系统产品
<el-tooltip placement="top" effect="light">
<div slot="content">
1.未绑定的点击绑定<br />2.已绑定的点击商品链接去修改
</div>
<i class="el-icon-question" />
</el-tooltip>
</template>
<template slot-scope="scope">
<div
v-if="scope.row.bindSkuName"
class="el-dropdown-link"
@click="bindSysClick(scope.row)"
>
{{ scope.row.bindSkuName }}
</div>
<div
v-else
class="el-dropdown-link"
@click="bindSysClick(scope.row)"
>
点击绑定
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handlePlatformSizeChange"
@current-change="handlePlatformCurrentChange"
:current-page="listParamsPlatformProduct.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsPlatformProduct.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsPlatformProduct.total"
style="float: right; display: inline-block"
></el-pagination>
</div>
</div>
</div>
<div style="width: 38%">
<div class="contain-template">
<div class="contain-title b">系统产品</div>
<div class="mt10 ml10">
<el-select
v-model="listParamsSys.valueSys"
placeholder="搜索类型"
size="small"
class="w150"
>
<el-option
v-for="item in optionsSys"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsSys.inputSys"
>
</el-input>
<el-button type="primary" @click="handleSysForBinding"
>搜 索</el-button
>
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataChoose"
:data="tableDataChoose"
tooltip-effect="dark"
highlight-current-row
@current-change="sysProductRowChange"
style="width: 100%"
max-height="400"
border
>
<el-table-column align="center" width="60px" label="主图">
<template slot-scope="scope">
<img
style="width: 50px; height: 50px"
:src="
scope.row.mainImageUrl +
'?x-oss-process=image/resize,m_fixed,h_50,w_50'
"
class="img-size"
/>
</template>
</el-table-column>
<el-table-column align="center" label="系统SKU名称">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">
{{ scope.row.skuName }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="系统SKU编码">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">
{{ scope.row.skuCode }}
</div>
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="scope" slot="header">
操作
<el-tooltip placement="top" effect="light">
<div slot="content">
绑定方法:<br />1.点击”建立绑定“按钮绑定<br />2.鼠标双击绑定
</div>
<i class="el-icon-question" />
</el-tooltip>
</template>
<template slot-scope="scope">
<div
class="el-dropdown-link"
@click="bindPlatformClick(scope.row)"
>
建立绑定
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handleSysSizeChange"
@current-change="handleSysCurrentChange"
:current-page="listParamsSys.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsSys.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsSys.total"
style="float: right; display: inline-block; max-width: 90%"
></el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {},
name: "productBindingDialog",
data() {
return {
listParamsSys: {
currentPage: 1,
pageSize: 50,
total: 0,
valueSys: "skuName",
inputSys: "",
isEnabled:1
},
parentData: {},
productIdSpudicts: [],
listParamsPlatformProduct: {
platformProductId:'',
platformProductIdList:[],
currentPage: 1,
pageSize: 50,
total: 0,
valuePlatform: "",
inputPlatform: "",
},
sysRowForBinding: {},
platformRowForBinding: {},
tableDataChoose: [],
tableDataPlatformProduct: [],
optionsPlatform: [
{
value: "",
label: "搜索类型",
},
{
value: "platformSku",
label: "产品SKU",
},
{
value: "platformProductId",
label: "平台产品ID",
},
],
optionsSys: [
// {
// value: "",
// label: "搜索类型",
// },
{
value: "skuName",
label: "系统SKU名",
},
{
value: "skuCode",
label: "系统SKU编码",
},
{
value: "spuName",
label: "系统SPU名",
},
],
};
},
mounted() {},
methods: {
handleSysForBinding(){
this.listParamsSys.currentPage = 1;
this.searchSysForBinding()
},
bindSysClick(platformRow) {
console.log("platformRow", platformRow);
this.platformRowForBinding = platformRow;
this.$refs.multipleTable_tableDataPlatformProduct.setCurrentRow(
platformRow
);
},
bindPlatformClick(sysRow) {
console.log("sysRow", sysRow);
this.$refs.multipleTable_tableDataChoose.setCurrentRow(sysRow);
this.sysRowForBinding = sysRow;
this.doBindingWork();
},
doBindingWork() {
if (!this.platformRowForBinding.id) {
this.$message({
message: "请先选中平台产品",
type: "info",
});
return;
}
if (!this.sysRowForBinding.id) {
this.$message({
message: "请先选中系统产品",
type: "info",
});
return;
}
let data = {
productUnitId: this.platformRowForBinding.id,
unitImageUrl: this.sysRowForBinding.mainImageUrl || "",
skuName: this.sysRowForBinding.skuName,
skuCode: this.sysRowForBinding.skuCode,
};
this.axios({
url: "/assistant/product/bindSku",
data,
method: "post",
}).then((res) => {
if (res.success) {
this.$message({
message: "绑定成功",
type: "success",
});
this.$set(this.platformRowForBinding, "bindSkuName", data.skuName);
}
});
},
handlePlatformCurrentChange(val) {
this.listParamsPlatformProduct.currentPage = val;
this.searchPlatformForBinding();
},
handlePlatformSizeChange(val) {
this.listParamsPlatformProduct.pageSize = val;
this.searchPlatformForBinding();
},
handleSysSizeChange(val) {
this.listParamsSys.pageSize = val;
this.searchSysForBinding();
},
handleSysCurrentChange(val) {
this.listParamsSys.currentPage = val;
this.searchSysForBinding();
},
platformProductRowChange(val) {
this.platformRowForBinding = val;
},
sysProductRowChange(val) {
this.sysRowForBinding = val;
},
searchSysForBinding() {
let data = Object.assign({}, this.listParamsSys);
data[data.valueSys] = data.inputSys;
data.isQuerySaleInfo = 0;
this.axios({
url: "assistant/systemProductUnitGroup/queryUnitPage",
data,
method: "post",
}).then((res) => {
if (res.success) {
this.tableDataChoose = res.module.result;
this.listParamsSys.total = res.module.total;
}
});
},
searchPlatformForBinding() {
let data = Object.assign({}, this.listParamsPlatformProduct)
if(data.platformProductId!=""){
data.platformProductIdList =[];
}
data[data.valuePlatform] = data.inputPlatform;
data["isQueryBindSysSku"] = true;
this.axios({
url: "assistant/product/online/queryOnlineProductUnit",
data,
method: "post",
}).then((res) => {
if (res.success) {
if (res.module) {
let tableData = res.module.result;
if (this.parentData) {
let parentData = this.parentData;
this.parentData = null;
if (
parentData.platformProductSkuIdList &&
parentData.platformProductSkuIdList.length
) {
tableData.forEach((x) => {
let find = parentData.platformProductSkuIdList.find(
(d) => d == x.platformProductSkuId
);
if (find) {
this.bindSysClick(x);
}
});
}
}
this.tableDataPlatformProduct = tableData;
this.listParamsPlatformProduct.total = res.module.total;
} else {
this.tableDataPlatformProduct = [];
this.listParamsPlatformProduct.total = 0;
}
}
});
},
listonshow(data){
this.parentData = Object.assign({}, data);
this.listParamsPlatformProduct.platformProductIdList = [data.platformProductId];
this.listParamsPlatformProduct.platformProductId = data.platformProductId;
this.listParamsPlatformProduct.valuePlatform = data.valuePlatform;
this.productIdSpudicts = data.productIdSpudicts;
this.sysRowForBinding = {};
this.tableDataPlatformProduct = [];
this.tableDataChoose = [];
this.searchPlatformForBinding();
this.searchSysForBinding();
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<template>
<div class="dis-flex dis-just">
<div style="width: 60%">
<div class="contain-template">
<div class="contain-title b">平台产品</div>
<div class="mt10 ml10">
<el-select
v-model="listParamsPlatformProduct.valuePlatform"
placeholder="搜索类型"
size="small"
class="w150"
>
<el-option
v-for="item in optionsPlatform"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsPlatformProduct.inputPlatform"
>
</el-input>
<el-button type="primary" @click="searchPlatformForBinding"
>搜 索</el-button
>
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataPlatformProduct"
:data="tableDataPlatformProduct"
tooltip-effect="dark"
highlight-current-row
@current-change="platformProductRowChange"
style="width: 100%"
max-height="400"
border
>
<!-- <el-table-column
align="center"
prop="index"
width="50"
label="序号">
</el-table-column> -->
<el-table-column align="center" width="60px" label="主图">
<template slot-scope="scope">
<img
style="width: 50px; height: 50px"
:src="
scope.row.mainImageUrl +
'?x-oss-process=image/resize,m_fixed,h_50,w_50'
"
class="img-size"
/>
</template>
</el-table-column>
<el-table-column prop="agentCode" align="center" label="平台名">
</el-table-column>
<el-table-column prop="authCode" align="center" label="店铺名">
</el-table-column>
<el-table-column align="center" prop="sku" label="产品SKU">
</el-table-column>
<el-table-column align="center" label="颜色/尺寸">
<template slot-scope="scope">
<div>{{ scope.row.colorCode }}/{{ scope.row.sizeCode }}</div>
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="scope" slot="header">
系统产品
<el-tooltip placement="top" effect="light">
<div slot="content">
1.未绑定的点击绑定<br />2.已绑定的点击商品链接去修改
</div>
<i class="el-icon-question" />
</el-tooltip>
</template>
<template slot-scope="scope">
<div
v-if="scope.row.bindSkuName"
class="el-dropdown-link"
@click="bindSysClick(scope.row)"
>
{{ scope.row.bindSkuName }}
</div>
<div
v-else
class="el-dropdown-link"
@click="bindSysClick(scope.row)"
>
点击绑定
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handlePlatformSizeChange"
@current-change="handlePlatformCurrentChange"
:current-page="listParamsPlatformProduct.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsPlatformProduct.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsPlatformProduct.total"
style="float: right; display: inline-block"
></el-pagination>
</div>
</div>
</div>
<div style="width: 38%">
<div class="contain-template">
<div class="contain-title b">系统产品</div>
<div class="mt10 ml10">
<el-select
v-model="listParamsSys.valueSys"
placeholder="搜索类型"
size="small"
class="w150"
>
<el-option
v-for="item in optionsSys"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsSys.inputSys"
>
</el-input>
<el-button type="primary" @click="searchSysForBinding"
>搜 索</el-button
>
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataChoose"
:data="tableDataChoose"
tooltip-effect="dark"
highlight-current-row
@current-change="sysProductRowChange"
style="width: 100%"
max-height="400"
border
>
<el-table-column align="center" width="60px" label="主图">
<template slot-scope="scope">
<img
style="width: 50px; height: 50px"
:src="
scope.row.mainImageUrl +
'?x-oss-process=image/resize,m_fixed,h_50,w_50'
"
class="img-size"
/>
</template>
</el-table-column>
<el-table-column align="center" label="系统SKU名称">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">
{{ scope.row.skuName }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="系统SKU编码">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">
{{ scope.row.skuCode }}
</div>
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="scope" slot="header">
操作
<el-tooltip placement="top" effect="light">
<div slot="content">
绑定方法:<br />1.点击”建立绑定“按钮绑定<br />2.鼠标双击绑定
</div>
<i class="el-icon-question" />
</el-tooltip>
</template>
<template slot-scope="scope">
<div
class="el-dropdown-link"
@click="bindPlatformClick(scope.row)"
>
建立绑定
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handleSysSizeChange"
@current-change="handleSysCurrentChange"
:current-page="listParamsSys.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsSys.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsSys.total"
style="float: right; display: inline-block; max-width: 90%"
></el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {},
name: "productBindingDialog",
data() {
return {
listParamsSys: {
currentPage: 1,
pageSize: 50,
total: 0,
valueSys: "skuName",
inputSys: "",
isEnabled:1
},
parentData: {},
listParamsPlatformProduct: {
currentPage: 1,
pageSize: 50,
total: 0,
valuePlatform: "",
inputPlatform: "",
},
sysRowForBinding: {},
platformRowForBinding: {},
tableDataChoose: [],
tableDataPlatformProduct: [],
optionsPlatform: [
{
value: "",
label: "搜索类型",
},
{
value: "platformSku",
label: "平台SKU",
},
{
value: "platformSpu",
label: "平台SPU名",
},
{
value: "platformProductId",
label: "平台产品ID",
},
],
optionsSys: [
{
value: "",
label: "搜索类型",
},
{
value: "skuName",
label: "系统SKU名",
},
{
value: "skuCode",
label: "系统SKU编码",
},
{
value: "spuName",
label: "系统SPU名",
},
],
};
},
mounted() {},
methods: {
bindSysClick(platformRow) {
console.log("platformRow", platformRow);
this.platformRowForBinding = platformRow;
this.$refs.multipleTable_tableDataPlatformProduct.setCurrentRow(
platformRow
);
},
bindPlatformClick(sysRow) {
console.log("sysRow", sysRow);
this.$refs.multipleTable_tableDataChoose.setCurrentRow(sysRow);
this.sysRowForBinding = sysRow;
this.doBindingWork();
},
doBindingWork() {
if (!this.platformRowForBinding.id) {
this.$message({
message: "请先选中平台产品",
type: "info",
});
return;
}
if (!this.sysRowForBinding.id) {
this.$message({
message: "请先选中系统产品",
type: "info",
});
return;
}
let data = {
productUnitId: this.platformRowForBinding.id,
unitImageUrl: this.sysRowForBinding.mainImageUrl || "",
skuName: this.sysRowForBinding.skuName,
skuCode: this.sysRowForBinding.skuCode,
};
this.axios({
url: "/assistant/product/bindSku",
data,
method: "post",
}).then((res) => {
if (res.success) {
this.$message({
message: "绑定成功",
type: "success",
});
this.$set(this.platformRowForBinding, "bindSkuName", data.skuName);
}
});
},
handlePlatformCurrentChange(val) {
this.listParamsPlatformProduct.currentPage = val;
this.searchPlatformForBinding();
},
handlePlatformSizeChange(val) {
this.listParamsPlatformProduct.pageSize = val;
this.searchPlatformForBinding();
},
handleSysSizeChange(val) {
this.listParamsSys.pageSize = val;
this.searchSysForBinding();
},
handleSysCurrentChange(val) {
this.listParamsSys.currentPage = val;
this.searchSysForBinding();
},
platformProductRowChange(val) {
this.platformRowForBinding = val;
},
sysProductRowChange(val) {
this.sysRowForBinding = val;
},
searchSysForBinding() {
let data = Object.assign({}, this.listParamsSys);
data[data.valueSys] = data.inputSys;
data.isQuerySaleInfo = 0;
this.axios({
url: "assistant/systemProductUnitGroup/queryUnitPage",
data,
method: "post",
}).then((res) => {
if (res.success) {
this.tableDataChoose = res.module.result;
this.listParamsSys.total = res.module.total;
}
});
},
searchPlatformForBinding() {
let data = Object.assign({}, this.listParamsPlatformProduct);
console.log("5",data)
data[data.valuePlatform] = data.inputPlatform;
data["isQueryBindSysSku"] = true;
this.axios({
url: "assistant/product/online/queryOnlineProductUnit",
data,
method: "post",
}).then((res) => {
if (res.success) {
if (res.module) {
let tableData = res.module.result;
if (this.parentData) {
let parentData = this.parentData;
this.parentData = null;
if (
parentData.platformProductSkuIdList &&
parentData.platformProductSkuIdList.length
) {
tableData.forEach((x) => {
let find = parentData.platformProductSkuIdList.find(
(d) => d == x.platformProductSkuId
);
if (find) {
this.bindSysClick(x);
}
});
}
}
this.tableDataPlatformProduct = tableData;
this.listParamsPlatformProduct.total = res.module.total;
} else {
this.tableDataPlatformProduct = [];
this.listParamsPlatformProduct.total = 0;
}
}
});
},
onshow(data) {
this.parentData = Object.assign({}, data);
this.listParamsPlatformProduct.inputPlatform = data.inputPlatform;
this.listParamsPlatformProduct.valuePlatform = data.valuePlatform;
this.sysRowForBinding = {};
this.tableDataPlatformProduct = [];
this.tableDataChoose = [];
this.searchPlatformForBinding();
this.searchSysForBinding();
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<template>
<div class="dis-flex dis-just">
<div style="width: 60%">
<div class="contain-template">
<div class="contain-title b">平台产品</div>
<div class="mt10 ml10">
<el-select @change="searchPlatformForBinding()" v-model="listParamsPlatformProduct.platformProductId" placeholder="请选择Spu" size="mini" >
<el-option :key="item" :label="index" :value="item" v-for="(index,item) in this.$parent.$parent.productBindingDialogData.productIdSpudicts"></el-option>
</el-select>
<!-- <el-select
v-model="listParamsPlatformProduct.valuePlatform"
placeholder="搜索类型"
size="small"
class="w150"
>
<el-option
v-for="item in optionsPlatform"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> -->
<!-- <el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsPlatformProduct.inputPlatform"
>
</el-input>
<el-button type="primary" @click="searchPlatformForBinding"
>搜 索</el-button
> -->
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataPlatformProduct"
:data="tableDataPlatformProduct"
tooltip-effect="dark"
highlight-current-row
@current-change="platformProductRowChange"
style="width: 100%"
max-height="400"
border
>
<!-- <el-table-column
align="center"
prop="index"
width="50"
label="序号">
</el-table-column> -->
<el-table-column align="center" width="60px" label="主图">
<template slot-scope="scope">
<img
style="width: 50px; height: 50px"
:src="
scope.row.mainImageUrl +
'?x-oss-process=image/resize,m_fixed,h_50,w_50'
"
class="img-size"
/>
</template>
</el-table-column>
<el-table-column prop="agentCode" align="center" label="平台名">
</el-table-column>
<el-table-column prop="authCode" align="center" label="店铺名">
</el-table-column>
<el-table-column align="center" prop="sku" label="产品SKU">
</el-table-column>
<el-table-column align="center" label="颜色/尺寸">
<template slot-scope="scope">
<div>{{ scope.row.colorCode }}/{{ scope.row.sizeCode }}</div>
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="scope" slot="header">
系统产品
<el-tooltip placement="top" effect="light">
<div slot="content">
1.未绑定的点击绑定<br />2.已绑定的点击商品链接去修改
</div>
<i class="el-icon-question" />
</el-tooltip>
</template>
<template slot-scope="scope">
<div
v-if="scope.row.bindSkuName"
class="el-dropdown-link"
@click="bindSysClick(scope.row)"
>
{{ scope.row.bindSkuName }}
</div>
<div
v-else
class="el-dropdown-link"
@click="bindSysClick(scope.row)"
>
点击绑定
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handlePlatformSizeChange"
@current-change="handlePlatformCurrentChange"
:current-page="listParamsPlatformProduct.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsPlatformProduct.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsPlatformProduct.total"
style="float: right; display: inline-block"
></el-pagination>
</div>
</div>
</div>
<div style="width: 38%">
<div class="contain-template">
<div class="contain-title b">系统产品</div>
<div class="mt10 ml10">
<el-select
v-model="listParamsSys.valueSys"
placeholder="搜索类型"
size="small"
class="w150"
>
<el-option
v-for="item in optionsSys"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-input
class="w200 ml10"
size="small"
placeholder="请输入"
clearable
v-model="listParamsSys.inputSys"
>
</el-input>
<el-button type="primary" @click="handleSysForBinding"
>搜 索</el-button
>
</div>
<div class="p10">
<el-table
ref="multipleTable_tableDataChoose"
:data="tableDataChoose"
tooltip-effect="dark"
highlight-current-row
@current-change="sysProductRowChange"
style="width: 100%"
max-height="400"
border
>
<el-table-column align="center" width="60px" label="主图">
<template slot-scope="scope">
<img
style="width: 50px; height: 50px"
:src="
scope.row.mainImageUrl +
'?x-oss-process=image/resize,m_fixed,h_50,w_50'
"
class="img-size"
/>
</template>
</el-table-column>
<el-table-column align="center" label="系统SKU名称">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">
{{ scope.row.skuName }}
</div>
</template>
</el-table-column>
<el-table-column align="center" label="系统SKU编码">
<template slot-scope="scope">
<div @dblclick="bindPlatformClick(scope.row)">
{{ scope.row.skuCode }}
</div>
</template>
</el-table-column>
<el-table-column align="center">
<template slot-scope="scope" slot="header">
操作
<el-tooltip placement="top" effect="light">
<div slot="content">
绑定方法:<br />1.点击”建立绑定“按钮绑定<br />2.鼠标双击绑定
</div>
<i class="el-icon-question" />
</el-tooltip>
</template>
<template slot-scope="scope">
<div
class="el-dropdown-link"
@click="bindPlatformClick(scope.row)"
>
建立绑定
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="ovh">
<el-pagination
@size-change="handleSysSizeChange"
@current-change="handleSysCurrentChange"
:current-page="listParamsSys.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParamsSys.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParamsSys.total"
style="float: right; display: inline-block; max-width: 90%"
></el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {},
name: "productBindingDialog",
data() {
return {
listParamsSys: {
currentPage: 1,
pageSize: 50,
total: 0,
valueSys: "skuName",
inputSys: "",
isEnabled:1
},
parentData: {},
listParamsPlatformProduct: {
platformProductId:"",
platformProductIdList:[],
currentPage: 1,
pageSize: 50,
total: 0,
valuePlatform: "",
inputPlatform: "",
},
sysRowForBinding: {},
platformRowForBinding: {},
tableDataChoose: [],
tableDataPlatformProduct: [],
optionsPlatform: [
{
value: "",
label: "搜索类型",
},
{
value: "platformSku",
label: "产品SKU",
},
{
value: "platformProductId",
label: "平台产品ID",
},
],
optionsSys: [
// {
// value: "",
// label: "搜索类型",
// },
{
value: "skuName",
label: "系统SKU名",
},
{
value: "skuCode",
label: "系统SKU编码",
},
{
value: "spuName",
label: "系统SPU名",
},
],
};
},
mounted() {},
methods: {
handleSysForBinding(){
this.listParamsSys.currentPage = 1;
this.searchSysForBinding()
},
bindSysClick(platformRow) {
console.log("platformRow", platformRow);
this.platformRowForBinding = platformRow;
this.$refs.multipleTable_tableDataPlatformProduct.setCurrentRow(
platformRow
);
},
bindPlatformClick(sysRow) {
console.log("sysRow", sysRow);
this.$refs.multipleTable_tableDataChoose.setCurrentRow(sysRow);
this.sysRowForBinding = sysRow;
this.doBindingWork();
},
doBindingWork() {
if (!this.platformRowForBinding.id) {
this.$message({
message: "请先选中平台产品",
type: "info",
});
return;
}
if (!this.sysRowForBinding.id) {
this.$message({
message: "请先选中系统产品",
type: "info",
});
return;
}
let data = {
productUnitId: this.platformRowForBinding.id,
unitImageUrl: this.sysRowForBinding.mainImageUrl || "",
skuName: this.sysRowForBinding.skuName,
skuCode: this.sysRowForBinding.skuCode,
};
this.axios({
url: "/assistant/product/bindSku",
data,
method: "post",
}).then((res) => {
if (res.success) {
this.$message({
message: "绑定成功",
type: "success",
});
this.$set(this.platformRowForBinding, "bindSkuName", data.skuName);
}
});
},
handlePlatformCurrentChange(val) {
this.listParamsPlatformProduct.currentPage = val;
this.searchPlatformForBinding();
},
handlePlatformSizeChange(val) {
this.listParamsPlatformProduct.pageSize = val;
this.searchPlatformForBinding();
},
handleSysSizeChange(val) {
this.listParamsSys.pageSize = val;
this.searchSysForBinding();
},
handleSysCurrentChange(val) {
this.listParamsSys.currentPage = val;
this.searchSysForBinding();
},
platformProductRowChange(val) {
this.platformRowForBinding = val;
},
sysProductRowChange(val) {
this.sysRowForBinding = val;
},
searchSysForBinding() {
let data = Object.assign({}, this.listParamsSys);
data[data.valueSys] = data.inputSys;
data.isQuerySaleInfo = 0;
this.axios({
url: "assistant/systemProductUnitGroup/queryUnitPage",
data,
method: "post",
}).then((res) => {
if (res.success) {
this.tableDataChoose = res.module.result;
this.listParamsSys.total = res.module.total;
}
});
},
searchPlatformForBinding() {
let data = Object.assign({}, this.listParamsPlatformProduct);
if(data.platformProductId!=""){
data.platformProductIdList =[];
}
data[data.valuePlatform] = data.inputPlatform;
data["isQueryBindSysSku"] = true;
this.axios({
url: "assistant/product/online/queryOnlineProductUnit",
data,
method: "post",
}).then((res) => {
if (res.success) {
if (res.module) {
let tableData = res.module.result;
if (this.parentData) {
let parentData = this.parentData;
this.parentData = null;
if (
parentData.platformProductSkuIdList &&
parentData.platformProductSkuIdList.length
) {
tableData.forEach((x) => {
let find = parentData.platformProductSkuIdList.find(
(d) => d == x.platformProductSkuId
);
if (find) {
this.bindSysClick(x);
}
});
}
}
this.tableDataPlatformProduct = tableData;
this.listParamsPlatformProduct.total = res.module.total;
} else {
this.tableDataPlatformProduct = [];
this.listParamsPlatformProduct.total = 0;
}
}
});
},
listonshow(data){
this.parentData = Object.assign({}, data);
this.listParamsPlatformProduct.platformProductIdList = data.inputPlatformList.map(x=>x.platformProductId);
// data.inputPlatformList.map(x=>{this.parentData.productIdSpudicts[x.platformProductId] = x.platformProductName})
// console.log(this.$parent.$parent.productBindingDialogData.productIdSpudicts)
// this.listParamsPlatformProduct.platformProductId = data.inputPlatformList[0].platformProductId
this.listParamsPlatformProduct.valuePlatform = data.valuePlatform;
this.sysRowForBinding = {};
this.tableDataPlatformProduct = [];
this.tableDataChoose = [];
this.searchPlatformForBinding();
this.searchSysForBinding();
},
},
};
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
<template>
<div>
<el-dialog
title="创建模板"
:visible.sync="dialogVisibleTemlate"
width="60%"
@close="cancelClick">
<div>
<div v-if="showInput"><span>模板名称:</span><el-input style="width:40%" size="small" v-model="templateName"></el-input></div>
<el-select v-model="templateValue" placeholder="选择模板" size="small" @change="templateSelect" v-else>
<el-option
v-for="item in templateOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div class="tab-content border5 m-bottom10 mt20">
<el-table
height="400"
:data="tableDataDetail"
row-key="countryName"
:tree-props="{children: 'children'}"
style="width: 100%">
<el-table-column
align="center"
width="150"
>
<template slot="header" slot-scope="scope">
<el-input
@input="searchClick"
v-model="searchCountry"
size="small"
placeholder="搜索国家"/>
</template>
<template slot-scope="scope">
<span>{{scope.row.countryName}}</span>
</template>
</el-table-column>
<el-table-column align="center">
<template slot="header" slot-scope="scope">
<span>运费及设置<el-tooltip content="使用基于产品运费增加,将按照「产品变种运费最高值基础」+「填写值」;如需减少可以输入负值;" placement="top" effect="light">
<i class="el-icon-question"/>
</el-tooltip>
</span>
<el-popover
v-model="visibleParities"
placement="bottom"
width="100"
trigger="hover">
<div class="parities-change">
<div class="poi" @click="priceChangeClick(1)">USD转换CNY</div>
<div class="poi" @click="priceChangeClick(2)">CNY转换USD</div>
<div style="background:#eee">汇率: <el-input placeholder="6-7" size="mini" v-model="paritiesVal" style="width:80px" @change="currencyConversion"/></div>
</div>
<span slot="reference" class="icon-color r poi">运费转换<i class="el-icon-arrow-down el-icon--right"/></span>
</el-popover>
</template>
<el-table-column
label="设置"
align="center"
width="180"
>
<template slot-scope="scope">
<el-select v-model="scope.row.type" placeholder="请选择" size="small">
<el-option
v-for="item in scope.row.isChildren?optionsChildren:options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column
align="center"
width="180"
>
<template slot="header" slot-scope="scope">
运费(USD)<i class="el-icon-edit-outline f18 poi gray-nine" @click="changeUsdClick(1)"/>
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.type==1||scope.row.type==3?'':scope.row.freightPriceUs" :disabled="scope.row.type==2||scope.row.type==4||scope.row.type==6?false:true" size="small" type="number" @input="(val)=>inputClick(val,scope.$index,'freightPriceUs')">
<template slot="append">USD</template>
</el-input>
</template>
</el-table-column>
<el-table-column
align="center"
width="180"
>
<template slot="header" slot-scope="scope">
本地运费 <i class="el-icon-edit-outline f18 poi gray-nine" @click="changeUsdClick(2)"/>
</template>
<template slot-scope="scope">
<el-input v-model="scope.row.type==1||scope.row.type==3?'':scope.row.freightPriceCh" :disabled="scope.row.type==2||scope.row.type==4||scope.row.type==6?false:true" size="small" type="number" @input="(val)=>inputClick(val,scope.$index,'freightPriceCh')">
<template slot="append">USD</template>
</el-input>
</template>
</el-table-column>
</el-table-column>
<el-table-column
prop="date"
label="操作"
align="center"
>
<template slot-scope="scope">
<div class="el-dropdown-link" @click="applyCountry(scope.row)" v-if="!scope.row.isChildren">应用给所有国家</div>
</template>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="sureSaveClick" :loading="loading">确 定</el-button>
<el-button @click="cancelClick">取 消</el-button>
</span>
</el-dialog>
<el-dialog
:title="priceType==1?'修改运费(USD)':'修改本地运费'"
:visible.sync="dialogVisiblePrice"
width="40%"
@close="dialogVisiblePrice = false">
<el-input
type="number"
style="width:50%"
placeholder="示例:1.00"
v-model="priceUs">
</el-input>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="surePrice">确 定</el-button>
<el-button @click="cancelPrice">取 消</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
dialogVisibleTemlate:{
type: Boolean,
default: false,
},
showInput: {
type: Boolean,
default: true,
},
editId:{
type:String,
default:''
},
tableDataAllDetail:{
type:Array,
default:[]
},
tableDataDetail:{
type:Array,
default:[]
},
templateName:{
type:String,
default:''
},
templateOptions:{
type:Array,
default:[]
},
id:{
type:String,
default:''
}
},
data() {
return {
options: [{
value: 1,
label: '使用产品运费'
}, {
value: 2,
label: '使用设置运费'
}, {
value: 3,
label: '不运送此国家'
}, {
value: 4,
label: '基于产品运费增加'
}],
optionsChildren:[{
value: 5,
label: '使用国家运费价格'
},
{
value: 6,
label: '使用地区运费价格'
}, {
value: 7,
label: '不运送此国家区域'
}],
templateValue:'',
visibleParities:false,
paritiesVal:7,
dialogVisiblePrice:false,
priceType:1,
priceUs:'',
searchCountry:'',
editId:'',
loading:false
}
},
methods:{
currencyConversion(val){
if(val<6){
this.$message({
message:'运费转换汇率不能小于6',
type:'error'
})
this.paritiesVal=6
return
}
},
inputClick(val,index,type){
if(val<0){
let absVal=Math.abs(val)
this.$set(this.tableDataDetail[index],type,absVal)
}
if(val>1000){
this.$set(this.tableDataDetail[index],type,1000)
}
},
templateSelect(val){
if(val=='add'){
let routeData = this.$router.resolve({
name: "templateList",
});
window.open(routeData.href, '_blank');
}else{
this.editId=val
this.axios({
url: 'assistant/product/freightTemplate/findById',
data:{
productReleaseId:this.id,
id:val
},
method: "post"
}).then(res => {
if(res.success){
// let shopArry=[]
// res.module.details.forEach((item)=>{
// if(item.type!=1){
// shopArry.push(item.countryName)
// }
// })
// this.templateTableData[0].countrys=shopArry.join(',')
this.tableDataDetail=res.module.details
this.tableDataAllDetail=res.module.details
}
})
}
},
cancelClick(){
this.$emit('cancelClick')
},
searchClick(){
const{searchCountry,tableDataAllDetail}=this
let isChild=false
this.tableDataDetail=tableDataAllDetail.filter(item=>{
if(item.children){
isChild=item.children.some(itemChild => {
return itemChild.countryName.indexOf(searchCountry)!=-1
});
}
if(item.countryName.indexOf(searchCountry)!=-1 || isChild) return item
})
console.log(tableDataAllDetail.length);
},
sureSaveClick(){
const{editId,templateName,tableDataDetail,tableDataAllDetail,showInput,templateValue,paritiesVal}=this
if(paritiesVal<6){
this.$message({
message:'运费转换汇率不能小于6',
type:'error'
})
return
}
if(showInput){
if(!templateName){
this.$message({
message:'模板名称不能为空',
type:'error'
})
return
}
this.loading=true
this.axios({
url: 'assistant/product/freightTemplate/save',
data:{
id:editId,
name:templateName,
details:JSON.stringify(tableDataAllDetail),
},
method: "post"
}).then(res => {
if(res.success){
this.loading=false
this.$emit('sureSaveClick')
}else{
this.loading=false
}
})
}else{
this.$emit('sureSaveClick',tableDataAllDetail)
this.templateValue=''
}
},
priceChangeClick(type){
const {tableDataDetail,paritiesVal}=this
tableDataDetail.map((item)=>{
if(item.type==2||item.type==4){
if(type==1){
this.$set(item,'freightPriceCh',(paritiesVal*item.freightPriceUs).toFixed(2))
}else{
this.$set(item,'freightPriceUs',(item.freightPriceCh/paritiesVal).toFixed(2))
}
}
if(item.children){
item.children.map((child)=>{
if(child.type==6){
if(type==1){
this.$set(child,'freightPriceCh',(paritiesVal*child.freightPriceUs).toFixed(2))
}else{
this.$set(child,'freightPriceUs',(child.freightPriceCh/paritiesVal).toFixed(2))
}
}
})
}
})
this.visibleParities=false
},
changeUsdClick(type){
this.priceType=type
this.dialogVisiblePrice=true
},
surePrice(){
const {priceType,priceUs,tableDataDetail}=this
tableDataDetail.map((item)=>{
if(item.type==2||item.type==4){
if(priceType==1){
this.$set(item,'freightPriceUs',priceUs)
}else{
this.$set(item,'freightPriceCh',priceUs)
}
}
})
this.cancelPrice()
},
cancelPrice(){
this.dialogVisiblePrice=false
this.priceUs=''
},
applyCountry(val){
this.tableDataDetail.map((item)=>{
this.$set(item,'type',val.type)
this.$set(item,'freightPriceUs',val.freightPriceUs)
this.$set(item,'freightPriceCh',val.freightPriceCh)
})
},
},
}
</script>
<style lang="less" scoped>
.el-dropdown-link {
cursor: pointer;
color: #367EE2;
font-size: 13px;
}
</style>
<template>
<div>
<el-dialog
:title="titleName?titleName:'同步状态'"
:visible.sync="syncPollingVisible"
:show-close="false"
width="35%"
:before-close="handleClose"
>
<div
v-loading="loading"
element-loading-text="进行中..."
element-loading-spinner="el-icon-loading"
></div>
<div v-html="msg" class="syncPollingMsg"></div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleClose()">关 闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
syncPollingVisible: {
type: Boolean,
default: false,
},
batchCode: {
type: String,
default: "",
},
titleName:{
type:String,
default:''
}
},
data() {
return {
batchCode: "",
completed: false, //异步是否完成
msg: "",
loading: true,
};
},
mounted() {},
methods: {
getPollSelectSyncStatus() {
this.axios({
url: "assistant/info/get/pollSelectSyncStatus",
params: {
batchCode: this.batchCode,
},
method: "post",
}).then((res) => {
if (res.success) {
this.msg = res.module.msg;
this.completed = res.module.code == 1 ? true : false;
if (res.module.code == 1) {
this.loading = false;
}
}
});
},
pollingQuery() {
let setTime;
var _this = this;
var i = 1;
setTime = setInterval(function () {
if (!_this.completed && _this.syncPollingVisible) {
//未完成且窗口打开则需要查询
console.log(
"第" +
i +
"次查询,完成" +
_this.completed +
",是否打开" +
_this.syncPollingVisible
);
_this.getPollSelectSyncStatus();
i++;
} else {
clearInterval(setTime);
}
}, 3000);
},
stopSync() {
console.log("停止同步,同步批次" + this.batchCode);
this.completed = false;
this.syncPollingVisible = false;
this.loading = true;
this.msg = '';
this.axios({
url: "assistant/info/get/stopSync",
params: {
batchCode: this.batchCode,
},
method: "post",
}).then((res) => {});
},
handleClose() {
if (this.completed) {
this.$emit("closeSync", false);
this.stopSync();
} else {
this.$confirm("确认关闭?将停止同步!")
.then((_) => {
this.$emit("closeSync", false);
this.stopSync();
})
.catch((_) => {});
}
},
},
};
</script>
<style lang="less" scoped>
.syncPollingMsg {
margin-top: 30px;
margin-left: 30px;
}
</style>
\ No newline at end of file
<template>
<el-table-column :label="coloumnHeader.label" :prop="coloumnHeader.label" align="center">
<template v-for="item in coloumnHeader.children">
<tableColumn v-if="item.children && item.children.length" :key="item.id" :coloumn-header="item"></tableColumn>
<el-table-column v-else :key="item.name" :label="item.label" :prop="item.prop" align="center"></el-table-column>
</template>
</el-table-column>
</template>
<script>
export default {
name: 'tableColumn',
props: {
coloumnHeader: {
type: Object,
required: true
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div :class="backIsShow?'crumbs-edit':'myj-crumbs'">
<span>当前位置:</span>
<span>{{firstCrumbs}} </span>
<span v-if="secondCrumbs" class="simsun">&gt;</span>
<span v-if="secondCrumbs">{{secondCrumbs}}</span>
<span v-if="thirdCrumbs" class="simsun">&gt;</span>
<span v-if="thirdCrumbs">{{thirdCrumbs}}</span>
</div>
</template>
<script>
export default {
props: {
backIsShow:{
type: Boolean,
default: false,
},
firstCrumbs: {
type: String,
default: '',
},
secondCrumbs: {
type: String,
default: '',
},
thirdCrumbs: {
type: String,
default: '',
},
},
data() {
return {
}
},
}
</script>
<style lang="less" scoped>
.crumbs-edit{
padding: 10px;
margin: 0 auto 10px;
background-color: #fff;
box-shadow: 0 0 4px 0 rgba(0, 34, 77, .15);
}
.myj-crumbs {
height: 33px;
line-height: 33px;
color: #000;
font-size: 13px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #ccc;
background-color: #eee;
.simsun {
font-family: simsun;
}
}
</style>
\ No newline at end of file
<template>
<div class="left-menu">
<div class="menu-top" v-for="(item,index) in getCurSide" :key="index">
<div class="first-title">{{item.name}}
<!-- <span v-if="item.name=='待发布产品'||item.name=='在线产品'" class="set-type" >设置</span> -->
</div>
<div class="third-title" v-if="item.allType&&item.allType.length>0">
<i class="fa fa-sort-desc fa-lg iconColor" v-if="item.allType[0].ifShow" @click="foldClick(index)"></i>
<i class="fa fa-caret-right fa-lg iconColor" v-else @click="foldClick(index)"></i>
<span :class="active==item.allType[0].id?'active':''" @click="typeClick(item.allType[0])">{{item.allType[0].name}}</span>
</div>
<div v-if="item.allType&&item.allType.length>0&&item.allType[0].ifShow">
<div v-if="item.unclassified&&item.unclassified.length>0" :class="active==item.unclassified[0].id?'four-title active':'four-title'" @click="typeClick(item.unclassified[0])">{{item.unclassified[0].name}}<span>{{item.unclassified[0].number>0?`(${item.unclassified[0].number})`:''}}</span></div>
<div class="four-title" v-for="(v,index2) in item.waitList" :key="v.pid" v-if="item.waitList&&item.waitList.length>0">
<span v-if="v.waitChildrenList&&v.waitChildrenList.length>0">
<i class="fa fa-sort-desc fa-lg iconColor" v-if="v.ifShow" @click="showChildrenClick(index,index2)"></i>
<i class="fa fa-caret-right fa-lg iconColor" v-else @click="showChildrenClick(index,index2)"></i>
</span>
<div :class="active==v.id?'active':''" style="display:inline" @click="typeClick(v)">{{v.name}}
<span>{{v.number>0?`(${v.number})`:''}}</span>
</div>
<div v-if="v.ifShow&&v.waitChildrenList" class="four-title" v-for="(m,index3) in v.waitChildrenList" :key="m.pid">
<span v-if="m.waitChildrenList&&m.waitChildrenList.length>0">
<i class="fa fa-sort-desc fa-lg iconColor" v-if="m.ifShow" @click="showTwoChildrenClick(index,index2,index3)"></i>
<i class="fa fa-caret-right fa-lg iconColor" v-else @click="showTwoChildrenClick(index,index2,index3)"></i>
</span>
<div :class="active==m.id?'active':''" style="display:inline" @click.prevent="typeClick(m)">{{m.name}}
<span>{{m.number>0?`(${m.number})`:''}}</span></div>
<div v-if="m.ifShow&&m.waitChildrenList" :class="active==l.id?'four-title active':'four-title'" v-for="l in m.waitChildrenList" :key="l.pid" @click.prevent="typeClick(l)">{{l.name}}
<span>{{l.number>0?`(${l.number})`:''}}</span>
</div>
</div>
</div>
</div>
<div v-for="itemChild in item.children" :key="itemChild.name" @click="leftMenuClick(itemChild)" :class="activeMenu == itemChild.name?'second-title activeMenu':'second-title'">{{itemChild.name}}<span>{{itemChild.number>0?`(${itemChild.number})`:''}}</span>
</div>
</div>
<el-dialog
title="管理分类"
:visible.sync="dialogVisible"
width="600px"
:before-close="handleClose">
<div class="pl20">
<!-- <ul class="ztree">
<li class="level0">
<span class="button level0 switch noline_open" ></span>
<a class="level0">
<span class="button ico_open" style="width:0px;height:0px;">
<i class="fa fa-sort-desc fa-lg iconColor" @click="foldClick"/><i class="fa fa-caret-right fa-lg iconColor" @click="foldClick"/>
</span>
<span class="leaves">所有分类</span>
<div class="btnGroup"><span class="button add glyphicon glyphicon-plus" style="margin-right: 60px;"></span></div>
</a>
<ul class="level0 " style="display:block">
<li class="level1">
<span class="button level1 switch noline_docu"></span>
<a class="level1">
<span class="button ico_docu" style="width:0px;height:0px;"></span>
<span class="leaves">未分类</span>
</a>
</li>
<li class="level1">
<span class="button level1 switch noline_open"></span>
<a class="level1">
<span class="button ico_open" style="width:0px;height:0px;"></span>
<span class="leaves">Hoodies【卫衣】</span>
<div class="btnGroup">
<span class="button add glyphicon glyphicon-plus" title="添加分类"></span>
<span class="button edit glyphicon glyphicon-edit" title="更改分类名"></span>
<span class="button remove glyphicon glyphicon-remove" title="删除分类"></span>
</div>
</a>
<ul class="level1 " style="display: block;">
<li class="level2">
<span class="button level2 switch noline_docu"></span>
<a class="level2 curSelectedNode">
<span class="button ico_docu" style="width:0px;height:0px;"></span>
<span class="leaves">11</span>
<div class="btnGroup">
<span class="button add glyphicon glyphicon-plus" title="添加分类"></span>
<span class="button edit glyphicon glyphicon-edit" title="更改分类名"></span>
<span class="button remove glyphicon glyphicon-remove"title="删除分类"></span>
</div>
</a>
</li>
</ul>
</li>
</ul>
</li>
</ul> -->
<div class="block">
<el-tree
:data="dataTree"
node-key="id"
default-expand-all
@current-change="SwitchNode"
:expand-on-click-node="false">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span v-if="!data.edit">{{ node.label }}</span>
<span v-else @click.stop><el-input v-model="data.label" size="mini" style="width:200px"/></span>
<span v-if="node.label!='未分类'">
<el-button
type="text"
size="mini"
@click="() => append(data)">
<i class="el-icon-plus add-type"/>
</el-button>
<el-button
v-if="node.label!='所有分类'"
type="text"
size="mini"
@click.stop="() => edit(node,data)">
<i class="el-icon-edit-outline add-type edit-type"/>
</el-button>
<el-button
v-if="node.label!='所有分类'"
type="text"
size="mini"
@click.stop="() => remove(node, data)">
<i class="el-icon-close add-type delete-type"/>
</el-button>
</span>
</span>
</el-tree>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="sureTypeClick"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
collapsed: {
type: Boolean,
default: true,
},
dynamicTags:{
type: Array,
default: [],
},
agentCode: '',
authCode:'',
},
data() {
return {
dialogVisible:false,
activeMenu:'wish',
active:'',
getCurSide:[],
showType:true,
showChildren:true,
showTwoChildren:true,
ids:[],
dataTree:[],
agentCode: ''
}
},
methods: {
getClassifyAndNum(type){
let url
if(this.$route.path.indexOf('systemProduct')!=-1){
url='assistant/info/get/queryProductGroupCount'
}else{
url='assistant/info/get/classificationQuantity'
}
this.axios({
url,
data:{
agentCode: this.agentCode
},
method: "post"
}).then(res => {
if(res.success){
this.getCurSide=res.module.resultList
// if(!type){
// this.leftActive()
// }
}
})
},
getClassify(){
this.axios({
url: 'assistant/dictionary/getClassificationList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisible=true
this.dataTree=res.module.dataTree
}
})
},
leftMenuClick(value){
// this.$router.push({path:value})
// this.$nextTick(() => {
this.activeMenu = value.name;
this.active=''
this.$emit('getCurrentLeft',value)
// })
},
typeClick(value){
this.active = value.id;
this.activeMenu=''
this.$emit('getCurrentLeft',value)
},
foldClick(index){
this.$set(this.getCurSide[index].allType[0],'ifShow',!this.getCurSide[index].allType[0].ifShow)
// this.showType=!this.showType
},
showChildrenClick(index,indexChild){
this.$set(this.getCurSide[index].waitList[indexChild],'ifShow',!this.getCurSide[index].waitList[indexChild].ifShow)
// this.showChildren=!this.showChildren
},
showTwoChildrenClick(index,indexChild,indexLast){
this.$set(this.getCurSide[index].waitList[indexChild].waitChildrenList[indexLast],'ifShow',!this.getCurSide[index].waitList[indexChild].waitChildrenList[indexLast].ifShow)
// this.showTwoChildren=!this.showTwoChildren
},
leftActive(){
let activeMenu = this.agentCode?this.agentCode:'wish'
let value={}
let id=this.$route.query.id
if((id==1||!id)&&this.$route.path.indexOf('productList')>-1){
// if(this.$route.path.indexOf('productList')>-1){
this.activeMenu=activeMenu
this.active=''
value={id: "31a12c85b7d6416689412ddf267f7c5b",ifShow: false,name: activeMenu,number: 6,path: "/product/productList",type: 1}
// }
// else{
// this.active = id;
// this.activeMenu='',
// value={id: `${id}`,ifShow: false,name: "所有分类",pid: "assistion_type",type: id}
// }
}else{
value={id: `${id}`,ifShow: false,name: "所有分类",pid: "assistion_type",type: id}
this.active = id;
this.activeMenu=''
}
this.$emit('getCurrentLeft',value)
},
setTypeClick(){
this.getClassify()
},
append(data) {
let id = 1000;
const newChild = { pid: '', label: '新分类',edit:true, children: [] };
if (!data.children) {
this.$set(data, 'children', []);
}
data.children.push(newChild);
},
edit(node,data){
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
this.$set(children[index],'edit',true)
},
SwitchNode(data,node){
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
this.$set(children[index],'edit',false)
},
remove(node, data) {
this.ids.push(data.pid)
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
},
sureTypeClick(){
const{dataTree,ids}=this
this.axios({
url: 'assistant/dictionary/addClassification',
data:{
dataTree:JSON.stringify(dataTree),
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.getClassifyAndNum()
this.ids=[]
this.dialogVisible=false
}
})
}
},
mounted() {
this.getClassifyAndNum()
this.leftActive()
},
watch: {
"$route": function() {
this.leftActive()
}
}
}
</script>
<style scoped lang="less">
.add-type{
color: #61BD50;
font-size: 18px;
font-weight: 1000;
}
.delete-type{
color:#EC5947
}
.edit-type{
color:#137ABF
}
.ztree {
margin: 0;
padding: 5px;
color: #333;
li{
padding: 0;
margin: 0;
list-style: none;
line-height: 14px;
text-align: left;
white-space: inherit !important;
position: relative;
outline: 0;
span{
margin-right: 2px;
}
a{
padding: 0 5px;
margin: 0;
color: #000 !important;
height: 26px !important;
width: 100%;
border-bottom: 1px solid #DDDDDD;
margin-top: 10px !important;
background-color: transparent;
text-decoration: none;
vertical-align: top;
display: inline-block;
.leaves {
line-height: 26px;
overflow-y: hidden;
height: 26px;
display: block;
float: left;
width: 80%;
word-break: break-all;
word-wrap: break-word;
padding-left:15px;
}
.btnGroup {
display: block;
float: right;
padding: 10px 0 5px 5px;
}
}
ul{
margin: 0;
padding: 0 0 0 18px;
}
}
}
ul {
list-style-type: none;
}
.left-menu {
width: 230px;
min-height: 450px;
max-height: 600px;
border: 1px solid #ccc;
background: #FFFFFF;
margin-right: 20px;
overflow:scroll;
overflow-x:hidden;
.menu-top{
text-align: left;
font-size: 16px;
color: #333333;
.set-type{
cursor: pointer;
color: #367EE2;
float: right;
margin-right: 10px
}
.iconColor{
color:#999;
padding-right: 10px;
}
.fa-sort-desc{
vertical-align: 5%;
}
.first-title{
height: 32px;
line-height: 32px;
color: #000;
vertical-align: top;
padding-left: 15px;
background-color: #eee;
border-bottom: 1px solid #dbdbdb;
font-weight: 700;
font-size: 13px
}
.second-title{
color: #000;
line-height: 28px;
vertical-align: top;
height: 28px;
border-bottom: 1px solid #dbdbdb;
cursor: pointer;
padding-left: 22px;
font-size: 13px;
span{
color: #999;
margin-left: 3px;
}
}
.third-title,.four-title{
font-size: 13px;
cursor: pointer;
font-weight: 400;
margin: 6px 0 6px 15px;
}
.four-title{
padding-left:10px;
width: max-content;
span{
color: #999;
margin-left: 3px;
}
}
.active{
background-color: #367EE2;
padding: 0 3px;
color: #fff;
span{
color:#fff
}
}
.activeMenu{
color: #fff;
background-color: #367EE2;
span{
color:#fff
}
}
}
}
</style>
\ No newline at end of file
<template>
<div class="left-menu">
<div class="menu-top" v-for="item in getCurSide" :key="item.name">
<div class="first-title">{{item.name}}</div>
<div>
<div v-for="itemChild in item.children" :key="itemChild.name" @click="leftMenuClick(itemChild.path)" :class="activeMenu == itemChild.path?'second-title activeMenu':'second-title'">{{itemChild.name}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
collapsed: {
type: Boolean,
default: true,
},
dynamicTags:{
type: Array,
default: [],
},
},
data() {
return {
activeMenu:'',
getCurSide:[],
path:''
}
},
methods: {
getLeftMenu(){
const {path}=this
let url
if(path.indexOf('order')>0){
url='assistant/info/get/getOrderQuantity'
}
if(path.indexOf('product')>0){
url='assistant/info/get/getGeneralService'
this.getCurSide=[
{
"name": "通用服务",
"children": [
{
"path": "/product/productList",
"name": "定制产品",
}
]
},
{
"name": "Wish",
"children": [
{
"path": "/product/1",
"name": "定制产品",
},
{
"path": "/product/2",
"name": "待发布",
},
{
"path": "/product/3",
"name": "在线产品",
},
]
},{
"name": "Shopify",
"children": [
{
"path": "/product/4",
"name": "定制产品",
},
{
"path": "/product/5",
"name": "待发布",
},
{
"path": "/product/6",
"name": "在线产品",
},
]
},{
"name": "Shopline",
"children": [
{
"path": "/product/7",
"name": "定制产品",
},
{
"path": "/product/8",
"name": "待发布",
},
{
"path": "/product/9",
"name": "在线产品",
},
]
}]
}
if(path.indexOf('customerService')>0){
url='assistant/tickets/questions/getSideBar'
}
this.activeMenu = this.$route.path;
},
leftMenuClick(value){
this.$router.push({path:value})
this.$nextTick(() => {
this.activeMenu = this.$route.path;
})
}
},
mounted() {
this.path=this.$route.path
this.getLeftMenu()
},
watch: {
"$route": function() {
this.path=this.$route.path
this.getLeftMenu()
}
}
}
</script>
<style scoped lang="less">
.left-menu {
width: 160px;
height: 410px;
border: 1px solid #ccc;
background: #FFFFFF;
margin-right: 20px;
.menu-top{
text-align: left;
// padding:32px 45px 0 45px;
font-size: 16px;
color: #333333;
.first-title{
height: 32px;
line-height: 32px;
color: #000;
vertical-align: top;
padding-left: 5px;
background-color: #eee;
border-bottom: 1px solid #dbdbdb;
font-weight: 700;
font-size: 13px
}
.second-title{
color: #000;
line-height: 28px;
vertical-align: top;
height: 28px;
border-bottom: 1px solid #dbdbdb;
cursor: pointer;
padding-left: 12px;
font-size: 13px
}
.second-title:nth-last-child(1){
border-bottom:none
}
.activeMenu{
color: #fff;
background-color: #367EE2
}
}
}
</style>
\ No newline at end of file
<template>
<div class="left-menu">
<div class="menu-top" v-for="item in getCurSide" :key="item.name">
<div class="first-title">{{item.name}}</div>
<div>
<div v-for="itemChild in item.children" :key="itemChild.name" @click="leftMenuClick(itemChild.type)" :class="activeMenu == itemChild.type?'second-title activeMenu':'second-title'">{{itemChild.name}} {{itemChild.number?`(${itemChild.number})`:''}}</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
collapsed: {
type: Boolean,
default: true,
},
dynamicTags:{
type: Array,
default: [],
},
},
data() {
return {
activeMenu:'',
getCurSide:[],
path:''
}
},
computed:{
// getCurSide() {
// return this.$store.state.global.menuTree.currentMenu || [];
// }
},
methods: {
getLeftMenu(){
const {path}=this
let url
let data = {};
let isSysOrder = path.indexOf('systemOrder') > 0;
let statusNum = {};
if(isSysOrder){
url='assistant/coOrders/statusGroupCount'
}
this.axios({
url: url,
data:data,
method: "post"
}).then(res => {
if(res.success){
if (isSysOrder) {
if(res.module){
let _data = res.module.data;
if(_data && _data.length){
for (let e of _data){
statusNum[e.key] = e.count;
}
}
}
}
// this.getCurSide=res.module.resultList
this.activeMenu = this.$route.query.id||2
// this.$emit('getCurrentLeft',this.activeMenu)
this.leftMenuClick(this.activeMenu)
}
}).finally(()=>{
let type2Num=Number(statusNum['PENDING'])+Number(statusNum['INTERRUPT']?statusNum['INTERRUPT']:0);
this.getCurSide = [
{name:'搜索',children:[{name:'全部订单',number:'',type:'1'}]},
{name:'订单',children:[{name:'待处理订单',number:type2Num?type2Num:'0',type:'2'},{name:'仓库已接单',number:statusNum['RECEIVED']?statusNum['RECEIVED']:'0',type:'3'},{name:'缺货',number:statusNum['OUTSTOCK']?statusNum['OUTSTOCK']:'0',type:'4'},{name:'仓库已发货',number:'',type:'5'}]},
{name:'已交运',children:[{name:'渠道已揽收',number:'',type:'6'},{name:'已妥投',number:'',type:'7'}]},
{name:'其它',children:[{name:'退款',number:'',type:'8'},{name:'已挂起',number:'',type:'9'},{name:'废弃订单',number:'',type:'10'},{name:'拦截',number:'',type:'11'}]}
];
})
},
leftMenuClick(value){
this.activeMenu = value
this.$emit('getCurrentLeft',value)
}
},
mounted() {
this.path=this.$route.path
this.getLeftMenu()
},
}
</script>
<style scoped lang="less">
// @import '../assets/css/variable.less';
.left-menu {
width: 160px;
height: 438px;
border: 1px solid #ccc;
background: #FFFFFF;
margin-right: 20px;
.menu-top{
text-align: left;
// padding:32px 45px 0 45px;
font-size: 16px;
color: #333333;
.first-title{
height: 32px;
line-height: 32px;
color: #000;
vertical-align: top;
padding-left: 5px;
background-color: #eee;
border-bottom: 1px solid #dbdbdb;
font-weight: 700;
font-size: 13px
}
.second-title{
color: #000;
line-height: 28px;
vertical-align: top;
height: 28px;
border-bottom: 1px solid #dbdbdb;
cursor: pointer;
padding-left: 12px;
font-size: 13px
}
.activeMenu{
color: #fff;
background-color: #367EE2
}
}
}
</style>
\ No newline at end of file
<template>
<div class="left-menu">
<div class="menu-top" v-for="item in getCurSide" :key="item.name">
<div class="first-title">{{item.name}}</div>
<div>
<div v-for="itemChild in item.children" :key="itemChild.name" @click="leftMenuClick(itemChild.path)"
:class="activeMenu == itemChild.path?'second-title activeMenu':'second-title'">{{itemChild.name}}
<div>
<div v-for="threeChild in itemChild.children"
:key="threeChild.name"
@click="leftMenuClick(threeChild.path)"
:class="activeMenu == threeChild.path?'third-title activeMenu':'third-title'"
>
{{threeChild.name}}
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
collapsed: {
type: Boolean,
default: true,
},
dynamicTags:{
type: Array,
default: [],
},
},
data() {
return {
activeMenu:'',
path:'',
thirdMenu:''
}
},
computed:{
getCurSide() {
let leftMenuArry = [
{
name: '综合分析',
children: [
{name: '数据汇总', path: '/dataReport/dataSummary', children: []}
]
},
{
name: '运营分析',
children: [
{
name: '店铺表现', children: [
{name: '店铺业绩', path: '/dataReport/storeAchievement',children:[]},
{name: '店铺健康度', path: '/dataReport/storeHealth',children:[]},
{name: '店铺罚款', path: '/dataReport/storeFine',children:[]}
]
},
{name: '产品表现', children: [
{name: '新品开发', path: '/dataReport/productsNew',children:[]},
{name: '销售统计', path: '/dataReport/productsSales',children:[]},
{name: '产品评分', path: '/dataReport/productsRate',children:[]}
]
},
{name: '订单表现', children: [
{name: '订单统计', path: '/dataReport/orderSummary',children:[]},
{name: '订单同步', path: '/dataReport/orderSynchro',children:[]}
]
}
]
}
]
return leftMenuArry
}
},
methods: {
leftMenuClick(value){
this.$router.push({path:value})
this.$nextTick(() => {
this.activeMenu = this.$route.path;
})
}
},
mounted() {
this.path=this.$route.path
this.activeMenu = this.$route.path;
},
}
</script>
<style scoped lang="less">
.left-menu {
width: 160px;
/*height: 180px;*/
border: 1px solid #ccc;
background: #FFFFFF;
margin-right: 20px;
.menu-top{
text-align: left;
// padding:32px 45px 0 45px;
font-size: 16px;
color: #333333;
.first-title{
height: 32px;
line-height: 32px;
color: #000;
vertical-align: top;
padding-left: 5px;
background-color: #eee;
border-bottom: 1px solid #dbdbdb;
font-weight: 700;
font-size: 13px
}
.second-title{
color: #000;
line-height: 28px;
vertical-align: top;
/*height: 28px;*/
border-bottom: 1px solid #dbdbdb;
cursor: pointer;
padding-left: 12px;
font-size: 13px
}
.third-title{
color: #000;
line-height: 24px;
vertical-align: top;
height: 28px;
/*border-bottom: 1px solid #dbdbdb;*/
cursor: pointer;
padding-left: 22px;
font-size: 13px
}
.activeMenu{
color: #fff;
background-color: #367EE2
}
}
}
</style>
\ No newline at end of file
let host = window.location.protocol + '//' + window.location.host + '/';
// host = 'http://'+process.env.env+'.rubansh.com/';
let protocol=window.location.protocol
let currenthost=window.location.host
console.log(window.location.host)
if (window.location.host === 'sit.rubansh.com:8088') host = 'http://sitsmallmi.rubansh.com/erp-assistant-service/';
export const devtools = true;
export const productionTip = true;
if(process.env.env=='dev'){
host = `${protocol}//sitsmallmi.rubansh.com/erp-assistant-service/`;
}
else if(process.env.env=='sit'){
host = `${protocol}//sitsmallmi.rubansh.com/erp-assistant-service/`;
}
else if(process.env.env=='www'){
host = `${protocol}//${currenthost}/erp-assistant-service/`;
}
export const rootUrl = host;
export const domain = process.env.env;
\ No newline at end of file
import babelpolyfill from 'babel-polyfill'
// import Vue from 'vue'
import App from './App'
// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/css/common.less'
// import '@/assets/css/alibaba.less'
// import './assets/theme/theme-green/index.css'
// import store from './vuex'
import store from './vuex/index'
import {router} from './router'
import './common/axiosSetting'
import CKEditor from '@ckeditor/ckeditor5-vue';
Vue.use( CKEditor );
// import 'font-awesome/css/font-awesome.min.css'
// Vue.use(ElementUI)
//引用富文本编辑器
// import VueQuillEditor from 'vue-quill-editor'
//引入富文本css
// require styles
// import 'quill/dist/quill.core.css'
// import 'quill/dist/quill.snow.css'
// import 'quill/dist/quill.bubble.css'
//富文本编辑器添加实例
// Vue.use(VueQuillEditor, /* { default global options } */)
ELEMENT.Dialog.props.lockScroll.default = false;
ELEMENT.Dialog.props.closeOnClickModal.default = false;
window.log = message => console.log(message)
let basicBtn=currentBtnName=>{
let eglishPermission=[]
if(currentBtnName.permissions.length>0){
currentBtnName.permissions[0].basic.map((v, i) => {
eglishPermission.push(v.btnName)
})
return eglishPermission
}
}
let specialBtn=currentBtnName=>{
let specialPermission=[]
if(currentBtnName.permissions.length>1){
currentBtnName.permissions[1].basic.map((v, i) => {
specialPermission.push(v.btnName)
})
}
return specialPermission
}
const hasPermission = userPermission => {
let permissionBtnArray = [];
let permissions = JSON.parse(localStorage.getItem('permissions'));
let path = router.history.current.path;
permissions.forEach(permission => {
if (permission.permissionPaths.indexOf(path) > -1) {
permissionBtnArray = permission.permissionBtnNameArray;
}
});
return permissionBtnArray.includes(userPermission);
}
//全局方法挂载
Vue.prototype.$_has = hasPermission
new Vue({
el: '#app',
template: '<App/>',
router,
store,
components: { App },
// render: h => h(App)
})
import product from './product/index'
import order from './order/index'
import logistics from './logistics/index'
import selectionProduct from './selectionProduct/index'
const login = resolve => require(['@/views/Login'], resolve);
const missing = resolve => require(['@/views/404'], resolve);
const Home = resolve => require(['@/views/Home'], resolve);//子页面
Vue.use(VueRouter);
const routes = [
{// 404
path: '*',
component: login
},
{
path: '/login',
component:login,
name: '',
hidden: true
},
// ...login,
// 通用页面
// {
// path: '/',
// redirect: '/login',
// component: parent,
// children: [].concat(login, UI),
// beforeEnter: (to, from, next) => {
// if ((localStorage.$getLocalStorageByName('user') || {}).personId) {
// store.commit('goHome');
// let home = store.state.navSide.homePage; //根据权限跳转至首页
// next(home ? home : {'name': 'platformSetInfoManage'});
// }else{
// next();
// }
// },
// },
// 主页面
{
path: '/home',
// redirect: '/',
name: 'home',
component: Home,
children: [].concat(product,order,logistics,selectionProduct)
},
].reverse();
export const router = new VueRouter({
routes,
mode: 'history',
})
router.beforeEach((to, from, next) => {
if (to.path == '/login') {
localStorage.removeItem('user');
}
let user = JSON.parse(localStorage.getItem('user'));
if (!user && to.path != '/login') {
next({ path: '/login' })
}else {
next()
}
})
const login = resolve => require(['@/views/Login'], resolve);
export default [
{
path: '/login',
name: 'login',
component: login,
meta: {
title: '登录页面'
}
}
]
const seventyonetTrack = resolve => require(['@/views/logistics/seventyonetTrack'], resolve);
export default [
{
path: '/logistics/seventyonetTrack',
name: 'seventyonetTrack',
component: seventyonetTrack,
meta: {
title: '71track'
}
}
]
const orderList = resolve => require(['@/views/order/orderList'], resolve);
export default [
{
path: '/order/orderList',
name: 'orderList',
component: orderList,
meta: {
title: '订单'
}
},
{
path: '/order/waitSend',
name: 'waitSend',
component: orderList,
meta: {
title: '待发货'
}
},
{
path: '/order/successSend',
name: 'waitSend',
component: orderList,
meta: {
title: '发货成功'
}
},
{
path: '/order/failSend',
name: 'waitSend',
component: orderList,
meta: {
title: '发货失败'
}
},
{
path: '/order/refunded',
name: 'refunded',
component: orderList,
meta: {
title: '已退款'
}
}
]
\ No newline at end of file
const productList = resolve => require(['@/views/product/productList'], resolve);
const createProduct = resolve => require(['@/views/product/createProduct'], resolve);
export default [
{
path: '/product/productList',
name: 'productList',
component: productList,
meta: {
title: '定制产品'
}
},
{
path: '/product/createProduct',
name: 'createProduct',
component: createProduct,
meta: {
title: '编辑'
}
},
]
const selectList = resolve => require(['@/views/selectionProduct/selectList'], resolve);
export default [
{
path: '/selectionProduct/selectList',
name: 'selectList',
component: selectList,
meta: {
title: '选品列表'
}
}
]
\ No newline at end of file
<template>
<p class="page-container">404 page not found</p>
</template>
<style lang="scss" scoped>
.page-container {
font-size: 20px;
text-align: center;
color: rgb(192, 204, 218);
}
</style>
\ No newline at end of file
<template>
<el-row class="container">
<el-col :span="24" class="header">
<el-col :span="6" class="logo poi">
<img src="~assets/img/logoImg.png" class="index_home"/>
<span @click="goIndex">智链互联跨境电商ERP</span>
</el-col>
<el-col :span="14" class="nav-list fl">
<ul class="list-tab">
<li v-on:mouseover="changeActive($event)" v-on:mouseout="removeActive($event)" v-for="menu in upstageMenu" :key="menu.name" @click.prevent="upstageMenuClick(menu.name)" :class="menu.name==currentMenu?'active':''">
<el-popover
v-if="menu.child.length>0"
placement="bottom"
width="500"
v-model="menu.visible"
trigger="hover">
<div class="general-function" v-for="item in menu.child" :key="item.name">
<div class="general-title">{{item.name}}</div>
<div class="general-type">
<a v-for="itemChild in item.child" :key="itemChild.name" v-on:mouseover="pointChange($event)" v-on:mouseout="removeActive($event)" @click.prevent="productClick(itemChild.path,itemChild.id)" target="_blank" :href="itemChild.path">{{itemChild.name}}
</a>
</div>
</div>
<div slot="reference">{{menu.name}}</div>
</el-popover>
<a v-else target="_blank" href="/order/orderList" style="color:white">{{menu.name}}</a>
</li>
</ul>
</el-col>
<el-col :span="4" class="userinfo pl10">
<!-- <el-dropdown trigger="hover"> -->
<span class="el-dropdown-link userinfo-inner f-blue lh40">
<i class="el-icon-user-solid f-blue"/>
<el-popover
placement="bottom"
width="400"
v-model="visible"
trigger="hover">
<div class="general-function" v-for="item in personalCenter" :key="item.name">
<div class="b">{{item.name}}</div>
<div class="general-type">
<a v-for="itemChild in item.child" :key="itemChild.name" v-on:mouseover="pointChange($event)" v-on:mouseout="removeActive($event)" @click.prevent="productClick(itemChild.path,itemChild.id)" target="_blank" :href="itemChild.path">{{itemChild.name}}
</a>
</div>
</div>
<div class="operate-center pt15">
<span>帮助中心</span>
<span class="pl20"><i class="el-icon-switch-button g3 b"/>退出</span>
</div>
<span slot="reference">
{{sysUserName}}
<i class="el-icon-arrow-down el-icon--right"/>
</span>
</el-popover>
<span>|</span>
<span class="rel">
<span class="abs car-num wh f12 tc">6</span>
<i class="el-icon-shopping-cart-2 f18"/>
</span>
</span>
<!-- <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="rightsManagement" v-if="iSrightsManagement">权限管理</el-dropdown-item>
<el-dropdown-item @click.native="logout">退出登录</el-dropdown-item>
</el-dropdown-menu> -->
<!-- </el-dropdown> -->
</el-col>
</el-col>
<section>
<transition name="fade" mode="out-in">
<router-view></router-view>
</transition>
<div class="footer-style">
<div class="footer-bottom">
<span>版权所有:杭州智链互联网络科技有限公司</span>
<span>Copyright2016-2019</span>
<span>公安备案号:沪ICP备16032655号-4</span>
</div>
</div>
</section>
</el-row>
</template>
<script>
import leftMenu from '@/components/leftMenu'
export default {
data() {
return{
collapsed:false,
sysUserName: '',
sysUserAvatar: '',
upstageMenu:[
{name:'首页',child:[],visible:false},
{name:'选品',child:[],visible:false},
{name:'设计',child:[],visible:false},
{name:'图库',child:[],visible:false},
{name:'产品',child:[
{name:'通用板块',child:[{name: "定制产品",path: "/product/productList"}]},
{name:'wish',child:[{name: "定制产品",path: "/product/productList"},{name: "待发布",path: "/product/productList"},{name: "在线产品",path: "/product/productList"},{name: "模板管理",path: "/product/productList"}]},
{name:'shopify',child:[{name: "定制产品",path: "/product/productList"},{name: "待发布",path: "/product/productList"},{name: "在线产品",path: "/product/productList"},{name: "模板管理",path: "/product/productList"}]},
{name:'shopline',child:[{name: "定制产品",path: "/product/productList"},{name: "待发布",path: "/product/productList"},{name: "在线产品",path: "/product/productList"},{name: "模板管理",path: "/product/productList"}]},
{name:'amazon',child:[{name: "定制产品",path: "/product/productList"},{name: "待发布",path: "/product/productList"},{name: "在线产品",path: "/product/productList"},{name: "模板管理",path: "/product/productList"}]},],visible:false},
{name:'订单',child:[{name:'订单管理',child:[{name: "全部订单",path: "/product/productList"},{name: "待付货款",path: "/product/productList"},{name: "待虚拟发货",path: "/product/productList"},{name: "发货成功",path: "/product/productList"},{name: "退款订单",path: "/product/productList"}]}],visible:false},
{name:'物流',child:[],visible:false},
{name:'数据',child:[{name:'财务',child:[{name: "支付记录",path: "/product/productList"}]},{name:'数据分析',child:[{name: "产品分析",path: "/product/productList"},{name: "店铺业绩",path: "/product/productList"}]}],visible:false}
],
personalCenter:[
{name:'账号管理',child:[{name: "我的账号",path: "/product/productList"},{name: "收货地址",path: "/product/productList"},{name: "修改密码",path: "/product/productList"}]},
{name:'平台授权',child:[{name: "定制产品",path: "/product/productList"},{name: "待发布",path: "/product/productList"},{name: "在线产品",path: "/product/productList"},{name: "模板管理",path: "/product/productList"},{name: "模板管理",path: "/product/productList"},{name: "模板管理",path: "/product/productList"}]},
],
currentMenu:'产品',
visible:false,
iSrightsManagement:false,
permissionsPath:'/systemManagement/rightsManagement'
}
},
components: {
leftMenu
},
// computed:{
// //顶部
// getCurTop() {
// return this.$store.state.global.topMenuTree || [];
// }
// },
created() {
let query = window.location.search.substring(1);
let vars = query.split("&");
for (let i=0;i<vars.length;i++) {
let pair = vars[i].split("=");
if(pair[0] === 'jumpType'){
if (2 === Number(pair[1])) {
this.currentMenu = '订单'
} else if (1 === Number(pair[1])) {
this.currentMenu = '产品'
} else if (3 === Number(pair[1])) {
this.currentMenu = '客服'
} else if (4 === Number(pair[1])) {
this.currentMenu = '物流'
} else if (5 === Number(pair[1])) {
this.currentMenu = '服务'
} else if (6 === Number(pair[1])) {
this.currentMenu = '数据'
}
}
}
},
methods: {
productClick(path,id){
console.log(path)
switch(path){
case '/product/productList':
this.$router.push({path})
break;
case '/product/productList?id=1':
case '/product/productList?id=2':
case '/product/productList?id=3':
this.$router.push({path})
break;
case '/product/createProduct':
this.$router.push({path})
break;
case '/product/templateList':
// localStorage.setItem('leftMenu','templateList');
// this.$store.commit('initSide', 'templateList');
this.$router.push({path})
break;
case '/advertising/activityManagement':
// localStorage.setItem('leftMenu','advertisingList');
// this.$store.commit('initSide', 'advertisingList');
this.$router.push({path})
break;
case '/epcManage/epcList':
// localStorage.setItem('leftMenu','epcList');
// this.$store.commit('initSide', 'epcList');
this.$router.push({path})
break;
case '/productManagement/systemProduct?id=1':
case '/productManagement/systemProduct?id=2':
case '/productManagement/systemProduct?id=3':
this.$router.push({path})
break;
case '/joom/createProductJoom':
let routeData = this.$router.resolve({
name: "createProductJoom",
query: {currentType: 2}
});
window.open(routeData.href, '_blank');
break;
default:
this.$router.push({path})
break;
}
this.visible=false
},
upstageMenuClick(value){
if(value=='产品'){
this.$router.push({path:'/product/productList'})
}
if(value=='选品'){
this.$router.push({path:'/selectionProduct/selectList'})
}
if(value=='订单'){
this.$router.push({path:'/order/orderList'})
}
if(value=='物流'){
this.$router.push({path:'/logistics/seventyonetTrack'})
}
},
changeActive($event){
$event.currentTarget.className="active";
},
removeActive($event){
if($event.target.innerText!=this.currentMenu){
$event.currentTarget.className="";
}
},
pointChange($event){
$event.currentTarget.className="activeMenu";
},
//退出登录
logout: function () {
var _this = this;
this.$confirm('确认退出吗?', '提示', {
type: 'warning'
}).then(() => {
this.axios({
url: "assistant/exit",
data: {},
method: "post"
}).then(res => {
localStorage.removeItem('user');
_this.$router.push('/login');
})
})
},
rightsManagement(){
// localStorage.setItem('leftMenu','systemList');
// this.$store.commit('initSide', 'systemList');
this.$router.push({path:this.permissionsPath})
},
toMenuChoose(){
let path=this.$route.path
if(path){
path=path.split("/")[1];
}
switch(path){
case 'index':
this.currentMenu='首页'
break;
case 'selectionProduct':
this.currentMenu='选品'
break;
case 'design':
this.currentMenu='设计'
break;
case 'photoGallery':
this.currentMenu='图库'
break;
case 'product':
this.currentMenu='产品'
break;
case 'order':
this.currentMenu='订单'
break;
case 'logistic':
this.currentMenu='物流'
break;
case 'dataShow':
this.currentMenu='数据'
break;
default:
this.currentMenu='选品'
break;
}
},
goIndex(){
localStorage.setItem('leftMenu','productList');
this.$router.push({name:'productList'})
},
},
mounted() {
let currentLeftMenu=localStorage.getItem('leftMenu')
if(currentLeftMenu){
this.$store.commit('initSide', currentLeftMenu);
}
var user = localStorage.getItem('user');
if (user) {
user = JSON.parse(user);
this.sysUserName = user.name || '';
this.sysUserAvatar = user.avatar || '';
}
this.toMenuChoose()
},
watch: {
"$route": function() {
this.toMenuChoose()
}
}
}
</script>
<style scoped lang="less" rel="stylesheet/scss">
// @import '../assets/css/variable.less';
.container {
position: absolute;
top: 0px;
bottom: 0px;
width: 100%;
font-size: 13px;
.header {
position: relative;
padding: 0 20px;
height: 60px;
background-color: #367EE2;
color:#fff;
min-width: 1280px;
.userinfo {
float: right;
margin-top: 20px;
background: #fff;
width: 180px;
height: 40px;
.userinfo-inner {
cursor: pointer;
font-size: 16px;
img {
width: 40px;
height: 40px;
border-radius: 20px;
margin: 10px 0px 10px 10px;
float: right;
}
}
}
.nav-list{
display: inline-block;
padding: 0 0 0 14px;
text-align: center;
.list-tab{
list-style: none;
margin-top: 22px;
margin-bottom: 0;
padding-left: 0;
height: 36px;
line-height: 36px;
li{
display: block;
float: left;
position: relative;
margin-bottom: -1px;
margin-left: 20px;
width: 70px;
border: 0;
font-size: 16px;
font-weight: 700;
cursor: pointer;
}
.active{
background-color:#337ab7;
}
}
}
.fl{
float: left;
// margin-left: 100px;
}
.logo {
line-height: 60px;
height:60px;
font-size: 20px;
padding-right:20px;
img {
width: 40px;
float: left;
margin: 10px 10px 10px 18px;
}
.txt {
color:#fff;
}
}
.logo-collapse-width{
width:60px
}
.tools{
padding: 5px 23px;
width:14px;
height: 50px;
line-height: 50px;
cursor: pointer;
.fa{
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
}
.fa-align-justify:before {
content: "\F039";
}
}
}
.footer-style{
width: 100%;
float: left;
margin-bottom: 10px;
border-top: 1px solid #d0d3d6;
padding: 10px 20px;
min-width: 1280px;
font-size: 13px;
line-height: 24px;
text-align: center;
color: #737679;
.footer-advantage{
display: flex;
justify-content: space-around;
align-items: center;
color: #FFFFFF;
margin-top:38px;
.footer-flex{
display: flex;
.footer-mark{font-size:12px}
}
.footer-ball{
width: 46px;
height: 46px;
border-radius: 46px;
background: #FFFFFF;
margin-right: 10px;
}
}
.footer-line{
opacity: 0.2;
border: 1px solid #EEEEEE;
margin-top: 34px;
}
.footer-server{
display:flex;
color:#FFFFFF;
margin-top: 30px;
justify-content: center;
opacity: 0.5;
font-size: 12px;
ul{
display: flex;
cursor: pointer;
li{
list-style:none;
line-height: 16px;
border-right: 1px solid #666666;
margin-right: 15px;
padding-right: 15px;
}
li:last-child{
margin-right: 0px;
padding-right: 0px;
border: none
}
}
}
.footer-bottom{
position: relative;
margin: 10px auto 0 auto;
width: 1020px;
span{
padding-right: 20px
}
}
}
}
.general-function{
display: flex;
margin:10px 0;
box-sizing: border-box;
div,a{
margin-left: 20px;
min-width: 64px;
height: 22px;
line-height: 22px;
cursor: pointer;
margin-bottom: 10px;
}
.general-type{
display: flex;
width: 370px;
flex-wrap: wrap;
div{
text-align: center
}
}
.general-title{
border-radius: 2px;
border: 1px solid #ddd;
color:#367EE2;
cursor: auto;
text-align:center;
width: 75px;
}
}
a{ text-decoration:none!important;color: #434649}
.activeMenu{
// margin-right: 10px;
border-radius: 2px;
padding: 2px 3px;
white-space: nowrap;
color: #fff;
background: #367EE2;
text-align: center
}
.car-num{
height:12px;
width: 12px;
border-radius: 12px;
background: #ec4339;
line-height: initial;
top: -5px;
right: -5px;
}
.operate-center{
border-top:1px dashed #ccc;
width:200px;
display:block;
margin-left:125px;
margin-top: 45px;
}
</style>
\ No newline at end of file
<template>
<div class="contain-area">
<div class="login-container df">
<div class="content-left">
<div class="company-name f20 wh">欢迎来到智链互联跨境电商ERP</div>
<div class="f12 wh ml30 mr30 lh22">【智链互联跨境电商ERP】是杭州智链互联网络科技有限公司旗下的跨境电商ERP系统。支持Wish、AliExpress、Joom、Shopee、Lazada等平台;提供同步产品、创建产品、同步订单、处理订单、WMS系统等整个流程主要功能,以及更多其他辅助功能。</div>
<img :src="loginIcon" class="login-icon"/>
</div>
<el-form
:model="ruleForm2"
:rules="rules2"
ref="ruleForm2"
label-position="left"
label-width="0px"
class="demo-ruleForm tc"
>
<div class="title">登录LOGIN</div>
<div class="f14 font-color mb40">专业一站式跨境ERP</div>
<el-form-item prop="account">
<el-input type="text" v-model="ruleForm2.account" placeholder="请输入账号" @change="acountChange" @keyup.enter.native="handleSubmit2" prefix-icon="el-icon-user"></el-input>
</el-form-item>
<el-form-item prop="checkPass">
<el-input type="password" v-model="ruleForm2.checkPass" placeholder="请输入密码" prefix-icon="el-icon-lock" @keyup.enter.native="handleSubmit2"></el-input>
</el-form-item>
<el-form-item prop="roleId" v-if="roleList.length>0">
<el-select v-model="ruleForm2.roleId" placeholder="请选择角色" class="wpt100">
<el-option :label="item.name" :value="item.id" v-for="(item,index) in roleList" :key="index"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button
type="primary"
class="mt15 wpt100 bg-blue"
@click.native.prevent="handleSubmit2"
:loading="logining"
>登 录</el-button>
</el-form-item>
</el-form>
</div>
<div class="footer-style">
<div class="footer-bottom">
<div>版权所有:杭州{{jieziman?'智链互联网络':'红茄'}}科技有限公司</div>
<!-- <span>Copyright2016-2019</span>
<span>公安备案号:沪ICP备16032655号-4</span> -->
</div>
</div>
</div>
</template>
<script>
import loginIcon from '@/assets/img/loginIcon.png';
export default {
data() {
return {
loginIcon,
logining: false,
ruleForm2: {
account: "",
checkPass: "",
roleId:""
},
rules2: {
account: [
{ required: true, message: "请输入账号", trigger: "blur" }
],
checkPass: [
{ required: true, message: "请输入密码", trigger: "blur" }
]
},
checked: true,
roleList:[],
jieziman:true
};
},
mounted(){
if(window.location.host.indexOf('printwe.net')>0){
this.jieziman=false
}else{
this.jieziman=true
}
},
methods: {
acountChange(val){
// this.roleList=[]
this.ruleForm2.roleId=''
},
handleSubmit2(ev) {
var _this = this;
this.$refs.ruleForm2.validate(valid => {
if (valid) {
this.logining = true;
const{ruleForm2}=this
this.axios({
url: "assistant/login",
data: {
account: ruleForm2.account,
password: ruleForm2.checkPass,
roleId:ruleForm2.roleId
},
method: "post"
}).then(res => {
if (!res.success) {
this.roleList=res.module.roleList
this.logining = false;
return false;
}
let user = {
name: res.module.account,
id: res.module.id,
};
localStorage.setItem("user", JSON.stringify(user));
this.$router.push({path:'product/productList'});
this.logining = false;
}).catch(() => {
this.logining = false;
});
} else {
return false;
}
});
}
}
};
</script>
<style lang="less" scoped>
.contain-area{
background: #F6F8FB;
position: absolute;
height: 100%;
width: 100%;
}
.login-container {
/*box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);*/
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-border-radius: 5px;
background-clip: padding-box;
margin: 140px auto;
width: 860px;
// padding: 35px 35px 15px 35px;
background: #fff;
border: 1px solid #eaeaea;
box-shadow: 0 0 25px #cac6c6;
.content-left{
width: 400px;
height: 500px;
background: #367EE2;
.company-name{margin: 64px 55px 20px}
.login-icon{margin: 40px 0 0 70px;}
}
.demo-ruleForm{
width: 460px;
padding: 60px
}
.mt15{margin-top: 15px}
.title {
margin: 4px 0 0;
font-size: 28px;
color: #367EE2;
}
}
.footer-style{
text-align: center;
color: #999999;
position: absolute;
bottom: 15px;
font-size: 12px;
width: 100%;
.footer-bottom{
position: relative;
margin: 10px auto 0 auto;
span{
padding-right: 20px
}
}
}
</style>
<template>
<section>
main
</section>
</template>
<script>
export default {
}
</script>
<style scoped>
</style>
\ No newline at end of file
<template>
<div class="content-height">
<div class="myorder-content">
<div class="contain-page">
<div class="content-top">
<topCrumbs :firstCrumbs="firstCrumbs" :secondCrumbs="secondCrumbs"></topCrumbs>
<div id="YQContainer"></div>
</div>
</div>
</div>
</div>
</template>
<script>
import topCrumbs from '@/components/business/topCrumbs'
export default {
data() {
return {
firstCrumbs:'物流',
secondCrumbs:'物流轨迹查询',
}
},
components: {
topCrumbs
},
mounted(){
YQV5.trackMulti({
YQ_ContainerId:"YQContainer",
YQ_Height:560,
YQ_Lang:"zh-CN"
});
},
}
</script>
<style lang="less" scoped>
.content-right{
.content-top{
background: #FFFFFF;
.container-o-box{
.default{
margin: 0;
width: 100%;
}
.com-block {
border: 1px solid #ccc;
width: 100%;
background-color: #fff;
box-shadow: 0 0 0 0;
}
}
.pull-right {
float: right!important;
}
.m-bottom10{
margin-bottom: 10px !important
}
.border4 {
border: 1px solid #ccc !important;
clear: both;
}
.tab-content>.active {
display: block;
visibility: visible;
}
.p-top10 {
padding-top: 10px!important;
}
.p30{
padding:38px 10px;
}
.btn-determine {
font-size: 13px;
border-color: #367EE2;
color: #fff;
background-color: #367EE2;
}
.btn-gray {
border-color: #d0d3d6;
font-size: 13px;
color: #434649;
background-color: #f2f2f2;
}
.m-left8 {
margin-left: 8px !important;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="content-height">
<div class="myorder-content">
<leftMenu></leftMenu>
<div class="content-right">
<div class="content-top">
<topCrumbs
:firstCrumbs="firstCrumbs"
:secondCrumbs="secondCrumbs"
></topCrumbs>
<div class="mt10 border-b">
<div class="item-collection">120天内订单</div>
</div>
<div>
<div class="container-o-box default">
<div class="com-block m-bottom10">
<div class="content search-tab p10 p-top5">
<table>
<tbody>
<!-- 平台渠道 -->
<tr>
<td class="p-right0 gray-c">平台渠道:</td>
<td>
<a
v-for="item in agentCodeList"
:key="item.name"
:class="
listParams.agentCode == item.id
? 'myj-aFocus myj-active'
: 'myj-aFocus'
"
@click="searchActive(item.id, 1)"
>{{ item.name }}</a
>
</td>
</tr>
<!-- 店铺账号: -->
<tr>
<td class="p-right0 gray-c">店铺账号:</td>
<td :class="showAllShops? 'account-list': 'account-list-all'">
<a
v-for="item in dataAccount"
:key="item.name"
:class="
listParams.authCode == item.id
? 'myj-aFocus myj-active'
: 'myj-aFocus'
"
@click="searchActive(item.id, 2)"
>{{ item.name }}</a
>
</td>
<td>
<el-input
@input="searchShop"
size="small"
class="w150 shop-search"
clearable
placeholder="店铺搜索"
suffix-icon="el-icon-search"
v-model="searchShopName">
</el-input>
<el-button class="more-btn" @click="showMoreShops">{{showAllShops?'更 多': '收 起'}}<i :class="showAllShops? 'el-icon-arrow-down':'el-icon-arrow-up'"></i></el-button>
</td>
</tr>
<!-- 国家区域: -->
<tr>
<td class="p-right0 gray-c">国家区域:</td>
<td>
<div v-if="showCheckResult" class="choosed-country">
<span
class="choose-country-list"
v-for="(item, index) in checkList"
:key="index"
>{{ item.name
}}{{
index == checkList.length - 1 ? "" : "、"
}}</span
>
<span
class="r pr10 icon-color poi"
@click="clearCheckCountry"
>清除多选 X</span
>
</div>
<!-- <div> -->
<a
v-for="item in dataCountry"
:key="item.name"
:class="
activeCountry == item.value
? 'myj-aFocus myj-active'
: 'myj-aFocus'
"
@click="searchActive(item.value, 3)"
v-if="!isShow && !checkBoxShow && !showCheckResult"
>{{ item.name }}
</a>
<!-- </div> -->
<div
:class="
checkBoxShow
? 'country-choose country-choose-checkbox'
: 'country-choose '
"
v-if="isShow || (checkBoxShow && !showCheckResult)"
>
<div class="tit">
<a
v-for="item in dataContinent"
:key="item.name"
:class="
activeContinent == item.id
? 'myj-aFocus myj-active country-tabs'
: 'myj-aFocus country-tabs'
"
@click="checkCountryArea(item.id)"
>{{ item.name }}</a
>
<el-input
clearable
suffix-icon="el-icon-search"
v-model="countryVal"
size="mini"
style="width: 200px"
@input="searchCountryClick"
/>
</div>
<div class="content">
<div v-if="!checkBoxShow">
<span
class="specific-country"
v-for="(item, index) in specificCountry"
:key="index"
@click="checkCurrentCountry(item)"
>{{ item.name }}
</span>
</div>
<el-checkbox-group v-model="checkList" v-else>
<el-checkbox :indeterminate="checkAllCountry1" v-model="checkAllCountry2" @change="handleCheckAllCountry">全选</el-checkbox>
<el-checkbox
@change="handleCheckedAllCountryChange"
v-for="(item, index) in specificCountry"
:key="index"
:label="item"
>
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</div>
<div class="p10 dis-flex" v-if="checkBoxShow">
<div style="width: 80px">已选国家:</div>
<el-checkbox-group v-model="checkList">
<el-checkbox
@change="handleCheckedAllCountryChange"
v-for="(item, index) in checkList"
:key="index"
:label="item"
>
{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</div>
<div v-if="checkBoxShow" class="tc p10">
<button
class="btn btn-primary"
type="button"
@click="sureCheckBoxClick"
>
确 认
</button>
<button
class="btn"
type="button"
@click="checkBoxShow = false"
>
取消
</button>
</div>
</div>
<span
class="show-more"
@click="checkBoxShow = true"
v-if="!isShow"
>多选<i class="el-icon-plus"
/></span>
<span
class="show-more"
@click="isShow = true"
v-if="!isShow && !checkBoxShow"
>更多<i class="el-icon-arrow-down"
/></span>
<span
class="show-more"
@click="isShow = false"
v-if="isShow && !checkBoxShow"
>收起<i class="el-icon-arrow-up"
/></span>
</td>
</tr>
<!-- 绑定系统产品 -->
<tr class="top-line showSearce">
<td class="p-right0 f-right gray-c white-space: nowrap">
绑定系统产品:
</td>
<td class="crawl-date">
<el-checkbox
v-model="checkAllisBind"
@change="(val)=>searchActive(val,4)"
style="margin-right: 25px"
>全选</el-checkbox
>
<el-checkbox-group
style="display: inline-block"
v-model="checkIsBindList"
@change="(val)=>searchActive(val,5)"
>
<el-checkbox
v-for="item in checkData"
:label="item.id"
:key="item"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</td>
</tr>
<!-- 排序类型: -->
<tr>
<td class="p-right0 gray-c border-dashed-top1">
排序类型:
</td>
<td class="crawl-date border-dashed-top1">
<a
v-for="item in dataTime"
:key="item.name"
:class="
listParams.sort == item.id
? 'myj-aFocus myj-active'
: 'myj-aFocus'
"
@click="searchActive(item.id, 6)"
>{{ item.name }}
<i
class="fa fa-sort-desc ml5"
v-if="
item.id == listParams.sort && !listParams.isAsc
" />
<i
class="fa fa-sort-up tp24 ml5"
v-if="
item.id == listParams.sort && listParams.isAsc
"
/></a>
</td>
</tr>
<!-- 搜索类型: -->
<tr>
<td class="p-right0 gray-c border-dashed-top1">
搜索类型:
</td>
<td class="border-dashed-top1">
<a
v-for="item in dataKind"
:key="item.name"
:class="
listParams.searchType == item.id
? 'myj-aFocus myj-active'
: 'myj-aFocus'
"
@click="searchActive(item.id, 7)"
>{{ item.name }}</a
>
</td>
</tr>
<!-- 搜索内容: -->
<tr>
<td class="p-right0 gray-c">搜索内容:</td>
<td class="tab-separate search-value">
<div class="productSearchGroup">
<input
class="form-control"
type="text"
style="width: 460px"
v-model="listParams.searchMsg"
/>
<button
class="btn btn-primary"
style="width: 52px"
@click="searchInputClick"
>
搜索
</button>
<span
class="f-blue poi"
@click="advancedSearch = !advancedSearch"
>高级搜索</span
>
</div>
<div
class="search-group-senior"
v-if="advancedSearch"
>
<table class="productListAdvancedSearch">
<tbody>
<tr>
<td>订单金额:</td>
<td>
<input
class="form-control2"
type="number"
v-model="listParams.orderTotalStart"
@input="
checkNum(
listParams.orderTotalStart,
'orderTotalStart'
)
"
/>
-
<input
class="form-control2"
type="number"
v-model="listParams.orderTotalEnd"
@input="
checkNum(
listParams.orderTotalEnd,
'orderTotalEnd'
)
"
/>
</td>
</tr>
<tr>
<td>下单时间:</td>
<td>
<el-date-picker
@change="changePlatformOrderDate"
size="mini"
v-model="listParams.platformOrderTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</td>
</tr>
<tr>
<td>付款时间:</td>
<td>
<el-date-picker
@change="changeTransactionDate"
size="mini"
v-model="listParams.transactionTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</td>
</tr>
<tr>
<td>发货时间:</td>
<td>
<el-date-picker
@change="changeShippingDate"
size="mini"
v-model="listParams.shippingTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</td>
</tr>
<tr>
<td>剩余发货:</td>
<td class="crawl-date border-dashed-top1">
<a
v-for="item in dataDate"
:key="item.name"
:class="
listParams.collectTime == item.id
? 'myj-aFocus myj-active'
: 'myj-aFocus'
"
@click="searchActive(item.id, 8)"
>{{ item.name }}</a
>
</td>
</tr>
<tr>
<td>物流方式:</td>
<td class="crawl-date border-dashed-top1">
<el-select
v-model="listParams.trackingProvider"
placeholder="---- 请选择 ----"
size="mini"
class="w200"
@change="reasonChange"
>
<el-option
:label="item.trackingProvider"
:value="item.trackingProvider"
v-for="(
item, index
) in logisticTypeOptions"
:key="index"
></el-option>
</el-select>
</td>
</tr>
<tr>
<td></td>
<td style="text-align: right">
<span
class="f-blue poi"
@click="iscancelClick"
>取消</span
>
<span
class="ml10 f-blue poi"
@click="resetClick"
>重置</span
>
<button
class="button btn-determine ml10"
@click="searchAdvanced"
>
搜索
</button>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br />
<div
class="content-button"
>
<el-dropdown @command="handleClickBatch">
<el-button type="primary">
同步订单<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">同步勾选订单</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="pull-right">
<el-pagination
@size-change="sizeChange"
@current-change="currentChange"
:current-page="listParams.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParams.total"
style="float: right; display: inline-block"
></el-pagination>
</div>
<div style="clear: both">
<div
v-if="listParams.isRefund == 1"
:class="
listParams.isVirtualDelivery === item.id
? 'item-collection'
: 'item-collection-white'
"
v-for="item in dataTabList"
:key="item.name"
@click="chooseTabs(item.id)"
>
{{ item.name }}
</div>
</div>
<div class="tab-content border5 m-bottom10">
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
border
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column align="center" type="selection" width="30">
</el-table-column>
<!-- <el-table-column
align="center"
prop="authCode"
label="ID"
>
</el-table-column> -->
<el-table-column label="商品信息" width="220" align="center">
<template slot-scope="scope">
<div class="table-content">
<div>
<el-popover
placement="top"
trigger="click"
v-if="scope.row.isBindSku"
width="500"
@show="getBindInfo(scope.row.id)"
>
<el-table :data="gridData">
<el-table-column
label="图片"
align="center"
width="80px"
>
<template slot-scope="_scope">
<img
:src="_scope.row.unitImageUrl"
width="50px"
/>
</template>
</el-table-column>
<el-table-column
property="skuName"
label="系统SKU名"
align="center"
></el-table-column>
<el-table-column
property="skuCode"
label="系统SKU编码"
width="100px"
align="center"
></el-table-column>
</el-table>
<div
slot="reference"
class="pointer"
style="background: green; color: white"
>
已绑定
</div>
</el-popover>
<div v-else style="background: red; color: white">
未绑定
</div>
<img :src="scope.row.ecOrderInfoSkuRespDTOList.length >0 ? scope.row.ecOrderInfoSkuRespDTOList[0].skuImageDetail:''" class="imgCss" />
<div class="f12">{{ scope.row.authCode }}</div>
<div class="g19 f12" v-if="scope.row.orderRemark">
备注:{{ scope.row.orderRemark }}
</div>
</div>
<div class="table-content-right">
<div class="icon-color">
<el-tooltip
effect="light"
:content="scope.row.ecOrderInfoSkuRespDTOList.length >0 ?scope.row.ecOrderInfoSkuRespDTOList[0].platformSku:''"
placement="top"
>
<a
class="el-dropdown-link break-two"
:href="scope.row.ecOrderInfoSkuRespDTOList.length >0 ?scope.row.ecOrderInfoSkuRespDTOList[0].productOnlineUrl:''"
target="_blank"
style="width: 150px"
>{{ scope.row.ecOrderInfoSkuRespDTOList.length >0 ?scope.row.ecOrderInfoSkuRespDTOList[0].platformSku:'' }}</a
>
</el-tooltip>
</div>
<div>
x
<span class="sku-number">{{
scope.row.ecOrderInfoSkuRespDTOList.length >0 ?scope.row.ecOrderInfoSkuRespDTOList[0].quantity:''
}}</span>
</div>
<!-- <div>-->
<!-- {{ scope.row.actualCurrency }}: {{ scope.row.price }}-->
<!-- </div>-->
<div>
<el-popover placement="bottom" trigger="click"
@show="getChildSkus(scope.row.ecOrderInfoSkuRespDTOList)">
<div slot="reference" class="g19 poi">展开</div>
<div>
<el-table
:data="tableDataGroup"
style="width: 100%;margin-top:10px"
>
<el-table-column
align="center"
width="100px"
label="图片"
>
<template slot-scope="scope">
<img width="30px" height="30px"
:src="scope.row.skuImageDetail"
class="imgCss"/>
</template>
</el-table-column>
<el-table-column prop="platformSku" align="center"
label="平台产品名"
width="160px">
<template slot-scope="scope">
<div>{{scope.row.platformSku}}</div>
</template>
</el-table-column>
<el-table-column prop="platformSku" align="center"
label="数量"
width="100px">
<template slot-scope="scope">
<div class="product-count-tag f-blue ">{{scope.row.quantity}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-popover>
</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
:label="
listParams.isVirtualDelivery
? '订单金额「运费」'
: '订单金额'
"
width="110"
>
<template slot-scope="scope">
<div>
{{ scope.row.actualCurrency }} {{ scope.row.orderAmount }}
</div>
<div v-if="listParams.isVirtualDelivery">
{{ scope.row.actualCurrency }}
{{ scope.row.packageFreight }}
</div>
</template>
</el-table-column>
<el-table-column
align="center"
prop="name"
label="收件人「国家」"
>
<template slot-scope="scope">
<div>
{{ scope.row.buyerName }}
{{ `「${scope.row.buyerCountry}」` }}
</div>
</template>
</el-table-column>
<el-table-column
:label="
listParams.isRefund == 1
? '平台订单号/退款原因'
: '平台订单号'
"
align="center"
width="180"
>
<template slot-scope="scope">
<div>
<a class="el-icon-document-copy" @click="copyUrl(scope.row.platformOrderId)"></a>
<a class="icon-color" @click="detailClick(scope.row.id, scope.row.status)">{{ scope.row.platformOrderId }}</a>
</div>
<div
class="squareSpan"
v-if="scope.row.requiresDeliveryConfirmation && scope.row.agentCode !='lazada'"
>
</div>
<div class="squareSpan" v-if="scope.row.effectivenessStatus =='GLOBAL_COLLECTION'">
GC
</div>
<div>{{ scope.row.refundReason }}</div>
</template>
</el-table-column>
<!-- <el-table-column-->
<!-- v-if="listParams.isVirtualDelivery !== 0"-->
<!-- align="center"-->
<!-- label="物流方式"-->
<!-- >-->
<!-- <template slot-scope="scope">-->
<!-- <div>{{ scope.row.trackingProvider }}</div>-->
<!-- <el-popover-->
<!-- placement="top-start"-->
<!-- trigger="hover"-->
<!-- width="50"-->
<!-- >-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- size="mini"-->
<!-- @click="copyUrl(scope.row.trackingNumber)"-->
<!-- >复制</el-button-->
<!-- >-->
<!-- <div slot="reference" class="icon-color">-->
<!-- {{ scope.row.trackingNumber }}-->
<!-- </div>-->
<!-- </el-popover>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="时间" align="center" width="185">
<template slot-scope="scope">
<div>下单:{{ scope.row.platformOrderDate }}</div>
<div>付款:{{scope.row.agentCode == 'lazada'?scope.row.platformOrderDate: scope.row.transactionDate }}</div>
<!-- <div v-if="scope.row.isVirtualDelivery">-->
<!-- 提交:{{ scope.row.commitDate }}-->
<!-- </div>-->
<div>到期时间: {{scope.row.fulfilDueDate}}</div>
<div
v-if="scope.row.status != 3 && scope.row.isVirtualDelivery ==0"
:class="scope.row.isVirtualDelivery ? '' : 'f-red'"
>
<!-- {{-->
<!-- scope.row.isVirtualDelivery ? "发货" : "剩余发货"-->
<!-- }}-->
剩余发货:{{ scope.row.remainingDeliveryTime }}
</div>
<div v-if="scope.row.refundDate">
退款:{{ scope.row.refundDate }}
</div>
</template>
</el-table-column>
<el-table-column
prop="buyerChooseLogistics"
label="买家指定"
align="center"
width="80"
>
</el-table-column>
<!-- <el-table-column
prop="authCode"
label="平台店铺"
align="center"
width="90"
>
</el-table-column> -->
<el-table-column
label="状态"
align="left"
width="150"
>
<template slot-scope="scope">
<div>
<p ><label >退款状态:</label><label style="margin-left: 5px;">{{scope.row.payStatusStr?scope.row.payStatusStr:'-'}}</label></p>
<p ><label >物流状态:</label><label style="margin-left: 5px;">{{scope.row.logisticsStatusStr?scope.row.logisticsStatusStr:'-'}}</label></p>
</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="80">
<template slot-scope="scope">
<div
class="el-dropdown-link"
@click="syncPClick(scope.row.platformOrderId,scope.row.agentCode,scope.row.authCode)"
>
同步订单
</div>
<!-- <div
class="el-dropdown-link"
@click="gotoBinding(scope.row.sku, scope.row.id)"
>
产品绑定
</div>
<div
class="el-dropdown-link"
@click="remarkClick(scope.row.id)"
v-if="!listParams.isRefund && $_has('edit')"
>
备注
</div> -->
</template>
</el-table-column>
</el-table>
</div>
<div class="pull-right">
<el-pagination
@size-change="sizeChange"
@current-change="currentChange"
:current-page="listParams.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParams.total"
style="float: right; display: inline-block"
></el-pagination>
</div>
</div>
</div>
</div>
</div>
<el-dialog
title="备注"
:visible.sync="dialogVisibleRemark"
width="40%"
@close="dialogVisibleRemark = false"
>
<el-input
type="textarea"
:rows="4"
placeholder="请输入备注内容"
v-model="textareaRemark"
>
</el-input>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="remarkSure"> </el-button>
</span>
</el-dialog>
<!-- 订单详情 -->
<el-dialog
title="订单详情"
:visible.sync="dialogVisibleOrderDetail"
width="65%"
@close="dialogVisibleOrderDetail = false"
>
<div>
<div class="detail-flex g0">
<span>订单号:{{ orderDetail.platformOrderId }}</span>
<span>卖家:{{ orderDetail.authCode }}</span>
<span>站点:{{ orderDetail.agentCode }}</span>
<span>包裹总额:{{ orderDetail.orderAmount }}</span>
</div>
<div class="logistic-detail mt10">
<div class="logistic-title g0">收货地址</div>
<div class="mt20 mb20 f12">
<el-form :inline="true" class="demo-form-inline" label-width="80px">
<el-form-item label="收件人:" class="pct33 ova">
{{ orderDetail.buyerName }}
</el-form-item>
<el-form-item label="电话:" class="pct33">
{{ orderDetail.buyerPhone }}
</el-form-item>
<el-form-item label="手机:" class="pct25">
{{ orderDetail.buyerMobile }}
</el-form-item>
<el-form-item label="国家/地区:" class="pct33">
{{ orderDetail.buyerCountry }}
</el-form-item>
<el-form-item label="省/州:" class="pct33">
{{ orderDetail.buyerPs }}
</el-form-item>
<el-form-item label="城市:" class="pct25">
{{ orderDetail.buyerCity }}
</el-form-item>
<el-form-item label="地址1:" class="pct33">
<el-tooltip
effect="dark"
:content="orderDetail.buyerAddress1"
placement="top"
>
<span class="ell w200 dib">{{
orderDetail.buyerAddress1
}}</span>
</el-tooltip>
</el-form-item>
<el-form-item label="地址2:" class="pct33">
<el-tooltip
effect="dark"
:content="orderDetail.buyerAddress2"
placement="top"
>
<span class="ell w200 dib">{{
orderDetail.buyerAddress2
}}</span>
</el-tooltip>
</el-form-item>
<el-form-item label="邮编:" class="pct25">
{{ orderDetail.buyerZipcode }}
</el-form-item>
</el-form>
</div>
</div>
<div class="logistic-detail mt10 border5">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="付 款" name="first"></el-tab-pane>
<el-tab-pane label="商品详情" name="second"></el-tab-pane>
<el-tab-pane label="物流信息" name="third"></el-tab-pane>
<el-tab-pane label="退 货" name="fourth"></el-tab-pane>
<el-tab-pane label="备 注" name="fifth"></el-tab-pane>
</el-tabs>
<el-table
ref="multipleTable"
:data="orderDetailList"
tooltip-effect="dark"
>
<el-table-column
prop="transactionDate"
v-if="activeName == 'first'"
label="日期"
align="center"
>
<template slot-scope="scope">
{{scope.row.transactionDate?scope.row.transactionDate: scope.row.platformOrderDate }}
</template>
</el-table-column>
<el-table-column
prop="payStatusStr"
v-if="activeName == 'first'"
label="状态"
align="left"
></el-table-column>
<el-table-column
align="center"
v-if="activeName == 'fourth'"
prop="refundReason"
label="退款理由"
></el-table-column>
<el-table-column
align="center"
v-if="activeName == 'fourth'"
prop="refundDate"
label="时间"
></el-table-column>
<el-table-column
v-if="activeName == 'fifth'"
align="center"
prop="orderRemark"
label="备注"
></el-table-column>
</el-table>
<!--商品详情-->
<el-table
v-if="activeName == 'second'"
ref="multipleTable"
:data="orderDetailSkuInfo"
tooltip-effect="dark"
>
<el-table-column label="产品信息" width="220" align="center" v-if="activeName == 'second'">
<template slot-scope="scope">
<div class="table-content">
<div>
<img :src="scope.row.skuImageDetail" class="imgCss" />
</div>
<div class="table-content-right">
<div>
<el-tooltip
effect="light"
:content="scope.row.platformSku"
placement="top"
>
<span class="break-two" style="width: 150px">{{
scope.row.platformSku
}}</span>
</el-tooltip>
</div>
<div>
x <span class="sku-number">{{ scope.row.quantity }}</span>
</div>
<div>USD {{ scope.row.price }}</div>
<div>Color: {{ scope.row.color }}</div>
<div>Size: {{ scope.row.size }}</div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="标题" align="center" v-if="activeName == 'second'">
<template slot-scope="scope">
<a
class="el-dropdown-link"
:href="scope.row.productOnlineUrl"
target="_blank"
style="width: 150px"
>{{ scope.row.skuName }}</a
>
</template>
</el-table-column>
<el-table-column prop="packageWeight" label="重量(g)" align="center" v-if="activeName == 'second'">
</el-table-column>
<el-table-column prop="systemSku" label="商品SKU" align="center" v-if="activeName == 'second'">
</el-table-column>
</el-table>
<!-- 物流信息 -->
<el-table
v-if="activeName == 'third'"
ref="multipleTable"
:data="logisticsAllDetails"
tooltip-effect="dark"
>
<el-table-column
v-if="activeName == 'third'"
align="center"
label="买家指定邮寄方式"
prop="buyerChooseLogistics"
>
</el-table-column>
<el-table-column
v-if="activeName == 'third'"
align="center"
prop="trackingProvider"
label="物流方式"
>
</el-table-column>
<el-table-column
v-if="activeName == 'third'"
align="center"
prop="trackingNumber"
label="跟踪号"
>
</el-table-column>
</el-table>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-tooltip
effect="light"
content="目前仅支持wish"
placement="top"
>
<el-button
type="primary"
@click="refundClick"
v-if="orderDetail.agentCode == 'wish' && $_has('refund')"
>退
</el-button>
</el-tooltip>
<el-button @click="cancelClick" type="info"> </el-button>
</span>
</el-dialog>
<el-dialog
title="退款"
:visible.sync="dialogVisibleRefund"
width="40%"
@close="dialogVisibleRefund = false"
>
<div>
退款原因:
<el-select
v-model="reasonCode"
placeholder="-----请选择退款原因-----"
size="small"
>
<el-option
v-for="item in reasonCodeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="mt20 dis-flex">
退款理由:
<el-input class="pct70" type="textarea" :rows="4" v-model="reasonNote">
</el-input>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="sureRefunedClick">确认退款</el-button>
<el-button @click="dialogVisibleRefund = false"> </el-button>
</span>
</el-dialog>
<el-dialog
title="选择店铺同步"
:visible.sync="dialogVisibleReleased"
width="50%"
@close="dialogVisibleReleased = false"
>
<div>
<div>
<div class="mb10" v-if="currentType == 1">
<span>选择时间:</span>
<el-date-picker
class="ml20"
size="mini"
v-model="customTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
<span>选择平台:</span>
<el-select
v-model="platformValue"
placeholder="请选择"
size="mini"
class="pl20"
style="width: 240px"
@change="handlePlatformChange"
>
<el-option
v-for="item in platformOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<el-checkbox
v-model="checkAll"
@change="handleCheckAllChange"
class="pl5 pt10"
>全选</el-checkbox
>
<el-input
@input="searchShopClick"
size="mini"
style="width: 200px; float: right"
placeholder="请输入店铺名称"
suffix-icon="el-icon-search"
v-model="shopName"
>
</el-input>
<el-checkbox-group
v-model="checkedCities"
@change="handleShopChange"
class="shop-list"
>
<el-checkbox
v-for="shop in shopAccount"
:label="shop.id"
:key="shop.id"
class="current-shop"
>{{ shop.name }}</el-checkbox
>
</el-checkbox-group>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="chooseShopClick"> </el-button>
<el-button @click="dialogVisibleReleased = false"> </el-button>
</span>
</el-dialog>
<el-dialog
title="绑定系统产品"
:visible.sync="dialogVisibleSku"
width="90%"
@opened="showMatching"
@close="dialogVisibleSku = false"
>
<productBindingDialog
ref="productBindingDialogRef"
></productBindingDialog>
<span slot="footer" class="tc">
<el-button type="primary" @click="dialogVisibleSku = false" size="small"
> </el-button
>
</span>
</el-dialog>
<syncPollingTemplate
:syncPollingVisible="syncPollingVisible"
:batchCode="syncBatchCode"
@closeSync="closeSync"
ref="syncFunction"
></syncPollingTemplate>
</div>
</template>
<script>
import leftMenu from "@/components/leftMenu";
import topCrumbs from "@/components/business/topCrumbs";
import productBindingDialog from "@/components/business/productBindingDialog";
import syncPollingTemplate from "@/components/business/syncPollingTemplate";
import util from "@/common/js/util";
export default {
data() {
return {
firstCrumbs: "平台订单",
secondCrumbs: "",
agentCodeList:[],//所有的平台
dataAccount: [{ name: "全部", id: 0 }],//店铺账户
showAllShops: true,
searchShopName: '',
dataCountry: [{ name: "全部", value: 0 }],//国家列表
activeCountry: 0,//选中单个
chooseCountryData: [],//选中多个
isShow: false,//正常展示国家列表
checkBoxShow: false,//是否显示国家多选框
showCheckResult: false,//是否展示更多
countryList: [],//国家列表 虚拟发货用
// 搜索类型
dataKind: [
{ name: "订单号", id: "platformOrderId" },
{ name: "运单号", id: "trackingNumber" },
{ name: "SKU", id: "sku" },
{ name: "买家指定渠道", id: "buyerChooseLogistics" },
{ name: "店长", id: "storeManagerName" },
{ name: "收件人", id: "buyerName" },
{ name: "电话", id: "buyerPhone" },
],
// 排序
dataTime: [
{ name: "按下单时间", id: "platformOrderDate" },
{ name: "按剩余发货时间", id: "deliveryDate" },
{ name: "按付款时间", id: "transactionDate" },
{ name: "按退款时间", id: "refundDate" },
],
dialogVisibleSku: false,
productBindingDialogData: {},
currentType: 1,
checkAllisBind: true,
checkIsBindList: [0, 1],
checkData: [
{ name: "是", id: 1 },
{ name: "否", id: 0 },
],
countryAllData: [], //所有大洲和国家
dataContinent: [], //大洲
allCountry: [], //全部国家
activeContinent: 1631,
specificCountry: [], //选中大洲后的国家
dataDate: [
{ name: "全部", id: "all" },
{ name: "到期", id: "expire" },
{ name: "1天内", id: "aDayAgo" },
{ name: "2天内", id: "twoDaysAgo" },
{ name: "3天内", id: "threeDaysAgo" },
{ name: "5天内", id: "fiveDaysAgo" },
{ name: "大于5天", id: "moreThanFiveDays" },
],
listParams: {
currentPage: 1,
pageSize: 50,
total: 0,
agentCode: 0,
authCode: 0,
sort: "platformOrderDate",
isAsc: false,
searchType: "platformOrderId",
searchMsg: "",
isVirtualDelivery: "",
isRefund: "",
buyerCountry: [],
collectTime: "all",
transactionDateStart: "",
transactionDateEnd: "",
platformOrderDateStart: "",
platformOrderDateEnd: "",
fulfilDueDateStart: "",
fulfilDueDateEnd: "",
shippingDateStart: "",
shippingDateEnd: "",
orderTotalStart: "",
orderTotalEnd: "",
trackingProvider: "",
isBindSku: "",
payStatusList:[],
},
tableData: [],
value1: "",
textareaRemark: "",
checkList: [],
advancedSearch: false,
customTime: "",
countryVal: "",
dialogVisibleRemark: false,
dataTabList: [
{ name: "全部", number: 0, id: "" },
{ name: "已发货退款", number: 0, id: 1 },
{ name: "未发货退款", number: 0, id: 0 },
],
id: "",
orderDetail: "",
logisticsAllDetails:[],
orderDetailSkuInfo:[],
orderDetailList:[],
dialogVisibleDetail: false,
activeTab: 1,
radioVal: "1",
isEdit: true,
logisticValue: "请点右上角「编辑」选择物流方式",
logisticTypeOptions: [],
logisticType: "",
logisticCountryOptions: [],
logisticCountry: "",
dialogVisibleRefund: false,
reasonCodeOptions: [
{
value: "1",
label: "商店无法完成订单,无法发货",
},
{
value: "25",
label: "物品损坏",
},
{
value: "32",
label: "项目已返回给发件人 ",
},
{
value: "-1",
label: "其它 ",
},
],
reasonCode: "",
reasonNote: "",
dialogVisibleReleased: false,
shopName: "",
checkAll: false,
allShop: [],
allShopList: [],
shopAccount: [],
checkedCities: [],
platformOptions:[],
tableDataGroup:[],
// platformOptions: [
// {
// value: "",
// label: "请选择",
// },
// {
// value: "wish",
// label: "wish",
// },
// {
// value: 'lazada',
// label: 'lazada'
// }
// ],
platformValue: "wish",
syncPollingVisible: false,
syncBatchCode: "",
activeName: "second",
dialogVisibleOrderDetail: false,
checkAllCountry1: false,
checkAllCountry2: false,
gridData: [],
platformOrderIds: [],
pickerOptions: {
disabledDate: (time) => {
return this.dealDisabledDate(time);
},
},
};
},
components: {
leftMenu,
topCrumbs,
syncPollingTemplate,
productBindingDialog,
},
methods: {
//根据路由选择侧边栏类型
leftActive(path) {
switch (path) {
case "/order/orderList":
this.secondCrumbs = "全部订单";
this.listParams.isVirtualDelivery = null;
this.listParams.payStatus = null;
break;
case "/order/waitSend":
this.secondCrumbs = "待虚拟发货";
this.listParams.isVirtualDelivery = 0;
this.listParams.payStatusList = null;
break;
case "/order/successSend":
this.secondCrumbs = "发货成功";
this.listParams.isVirtualDelivery = 1;
this.listParams.payStatusList = null;
break;
case "/order/failSend":
this.secondCrumbs = "发货失败";
this.listParams.isVirtualDelivery = 2;
this.listParams.payStatusList = null;
break;
case "/order/refunded":
this.secondCrumbs = "已退款";
this.listParams.isVirtualDelivery = null;
this.listParams.payStatusList = [210,220];
break;
default:
break;
}
this.getOrderList();
},
//查询国家列表 虚拟发货用 已废弃
getCountryList() {
this.axios({
url: "assistant/dictionary/countryList",
data: {},
method: "get",
}).then((res) => {
if (res.success) {
this.countryList = res.module;
}
});
},
//获取国家列表信息-用于搜索
getCountry() {
this.axios({
url: "assistant/info/get/selectCountryInfo",
data: {},
method: "post",
}).then((res) => {
if (res.success) {
res.module.map((item) => {
this.dataContinent.push({ name: item.name, id: item.id });
if (item.id == this.activeContinent) {
this.specificCountry = item.children;
}
if (item.id == 1632) {
this.allCountry = item.children;
}
});
this.countryAllData = res.module;
}
});
},
//查询平台订单列表
getOrderList() {
let { listParams, chooseCountryData } = this;
listParams.buyerCountry = JSON.stringify(chooseCountryData);
let url = "assistant/ecOrders/pageEcOrder"
console.log('listParams',listParams)
this.axios({
url,
data: listParams,
method: "post",
}).then((res) => {
if (res.success) {
let data = res.module;
this.tableData = data.result;
this.listParams.total = data.total;
}
});
},
//点击查询条件触发
searchActive(value, type) {
switch (type) {
case 1://选择平台
this.listParams.authCode=''
if(this.listParams.agentCode != value){//平台渠道不一致 重新获取店铺列表
this.dataAccount = [{name:'全部',id:''}];
if(!value){
this.allShopList.map((item)=>{
item.shopList.map((item2)=>{
this.dataAccount.push({name:item2.authCode,id:item2.authCode})
})
})
}else{
this.allShopList.filter(x=>x.agentCode.indexOf(value)>-1)
.map((item)=>{
item.shopList.map((item2)=>{
this.dataAccount.push({name:item2.authCode,id:item2.authCode})
})
})
}
this.listParams.agentCode = value;
}
break;
case 2://选择店铺
this.listParams.authCode = value;
break;
case 3://选择国家
this.activeCountry = value;
if (value != 0) {
this.chooseCountryData.splice(0, 1, value);
} else {
this.chooseCountryData = [];
}
break;
case 4://选择绑定系统产品-全选
let currentAccount = [];
this.checkData.map((item) => {
currentAccount.push(item.id);
});
this.checkIsBindList = value ? currentAccount : [];
this.listParams.isBindSku = "";
break;
case 5://选择绑定系统产品-勾选
let checkedCount = value.length;
this.checkAllisBind = checkedCount === this.checkData.length;
if (value.length == 2) {
this.listParams.isBindSku = "";
} else {
this.listParams.isBindSku = value.join(",");
}
break;
case 6://选择排序
this.listParams.sort = value;
this.listParams.isAsc = !this.listParams.isAsc;
break;
case 7://搜索类型搜索
this.listParams.searchType = value;
break;
case 8://高级搜索-日期搜索
this.listParams.collectTime = value;
break;
default:
break;
}
this.getOrderList();
},
//搜索国家-更多-选择国家区域
checkCountryArea(value){
this.activeContinent = value;
this.countryAllData.map((item) => {
if (item.id == value) {
this.specificCountry = item.children;
}
});
this.checkAllCountry1 = false
this.checkAllCountry2 = false
},
//搜索国家-更多-输入框搜索国家
searchCountryClick(val) {
this.specificCountry = [];
this.allCountry.map((item) => {
if (item.name.indexOf(val) > -1 && val) {
this.specificCountry.push(item);
}
});
if (!val) {
this.specificCountry = this.allCountry;
}
},
//搜索国家-更多-选中国家
checkCurrentCountry(val) {
this.chooseCountryData.splice(0, 1, val.value);
this.dataCountry.push({ name: val.name, value: val.value });
this.activeCountry = val.value;
this.isShow = false;
this.getOrderList();
},
//搜索国家-多选-选择确认
sureCheckBoxClick() {
(this.checkBoxShow = false), (this.showCheckResult = true);
this.chooseCountryData = this.checkList.map((item) => {
return item.value;
});
this.getOrderList();
},
//搜索国家-多选-选择确认-清除
clearCheckCountry(val){
this.showCheckResult = false;
this.chooseCountryData = [];
this.checkList = [];
this.activeCountry = 0;
this.checkAllCountry1 = false;
this.checkAllCountry2 = false;
this.getOrderList();
},
handleClickBatch(command) {
const { platformOrderIds } = this;
if (command == 1) {
if (platformOrderIds.length == 0) {
this.$message.error("请至少选中一个订单");
return;
}
}
switch (command) {
case "1":
this.syncPClick();
break;
case "2":
break;
default:
break;
}
},
syncPClick(platformOrderId,agentCode,authCode){
let platformOrderIds
if(platformOrderId){
// platformOrderIds=platformOrderId.split(',')
platformOrderIds= [{
platformOrderId,agentCode,authCode
}]
}else{
platformOrderIds=this.platformOrderIds
}
this.axios({
url:'assistant/ecOrderSync/syncByPlatformOrderId',
data:{
orderIdReqDTOS:JSON.stringify(platformOrderIds),
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '同步中请稍后查询结果',
type: 'success'
});
this.getOrderList()
}
})
},
dealDisabledDate(time) {
if (new Date(time).getTime() > new Date().getTime()) {
return time.getTime() >= new Date().getTime();
} else {
return time.getTime() < Date.now() - 15 * 8.64e7;
}
},
handleClick() {
console.log(this.activeName);
},
handlePlatformChange(val){
this.platformValue = val;
this.allShopList.map((item)=>{
if(item.agentCode.indexOf(val)>-1 && val!==""){
this.shopAccount = [];
item.shopList.map((item2)=>{
this.shopAccount.push({name:item2.authCode,id:item2.authCode})
})
}
})
},
handleCheckAllChange(val) {
let newArry = [];
if (val) {
this.shopAccount.map((item) => {
newArry.push(item.id);
});
}
this.checkedCities = newArry;
},
handleShopChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.shopAccount.length;
},
searchShopClick(val) {
let shopArry = [];
let platformValue = this.platformValue;
this.allShop.map((item) => {
if (item.name.indexOf(val) > -1 && item.agentCode==platformValue) {
shopArry.push(item);
}
});
this.shopAccount = shopArry;
},
//同步店铺订单
closeSync(val) {
this.syncPollingVisible = val;
this.getOrderList();
this.syncBatchCode = "";
},
handleSelectionChange(val) {
this.platformOrderIds = val.map((item) => {
return {
platformOrderId: item.platformOrderId,
agentCode: item.agentCode,
authCode: item.authCode
}
});
},
// chooseShopClick() {
// let { checkedCities, customTime, currentType } = this;
// let url;
// if (currentType == 1) {
// if (checkedCities.length > 5) {
// this.$message({
// message: "最多只能选择5个店铺哦~",
// type: "warning",
// });
// return;
// }
// url = "assistant/updateOrderStatus";
// } else {
// url = "assistant/syncOrder";
// }
// this.axios({
// url,
// data: {
// platformOrderDateStart: customTime[0],
// platformOrderDateEnd: customTime[1],
// shopIds: JSON.stringify(checkedCities),
// },
// method: "post",
// }).then((res) => {
// if (res.success) {
// this.dialogVisibleReleased = false;
// this.checkAll = false;
// this.checkedCities = [];
// this.shopName = "";
// this.shopAccount = this.allShop;
// this.syncBatchCode = res.module.batchCode;
// this.syncPollingVisible = true;
// this.$refs.syncFunction.pollingQuery();
// }
// });
// },
showMatching() {
console.log("---------", this.$refs.productBindingDialogRef);
this.$refs.productBindingDialogRef.onshow(this.productBindingDialogData);
console.log("2", this.productBindingDialogData);
},
chooseShopClick(){
let {checkedCities,customTime,currentType}=this
let url,data = {},agentWithAuthListReqDTOs = []
if(this.platformValue == 'lazada'){
if(currentType==1){
if(checkedCities.length>5){
this.$message({
message: '最多只能选择5个店铺哦~',
type: 'warning'
});
return
}
}
agentWithAuthListReqDTOs.push({platformOrderDateStart:customTime[0],platformOrderDateEnd :customTime[1],authCodeList:checkedCities,agentCode:this.platformValue})
data ={agentWithAuthListReqDTOs: agentWithAuthListReqDTOs}
url='assistant/ecOrderSync/sync'
this.getJSONPost(url,data)
}else{
if(currentType==1){
if(checkedCities.length>5){
this.$message({
message: '最多只能选择5个店铺哦~',
type: 'warning'
});
return
}
data= {platformOrderDateStart:customTime[0],platformOrderDateEnd :customTime[1],shopIds:JSON.stringify(checkedCities)}
url='assistant/updateOrderStatus'
this.getPost(url,data)
}else{
data= {platformOrderDateStart:customTime[0],platformOrderDateEnd :customTime[1],shopIds:JSON.stringify(checkedCities)}
url='assistant/syncOrder'
this.getPost(url,data)
}
}
},
getPost(url,data){
this.axios({
url:url,
data: data,
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleReleased=false
this.checkAll=false
this.checkedCities=[]
this.shopName=''
this.shopAccount=this.allShop
this.syncBatchCode=res.module.batchCode;
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
}
})
},
getJSONPost(url,data){
this.axios({
url:url,
data: data,
transformRequest: [(data) => JSON.stringify(data)],
headers: {"Content-Type": "application/json; charset=UTF-8"},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleReleased=false
this.checkAll=false
this.checkedCities=[]
this.shopName=''
this.shopAccount=this.allShop
this.syncBatchCode=res.module.batchCode;
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
}
})
},
getBindInfo(id) {
this.axios({
url: "assistant/bindSkuInfo",
params: {
id,
},
method: "get",
}).then((res) => {
if (res.success) {
this.gridData = res.module;
}
});
},
//查看详情
detailClick(id, status) {
this.id = id;
this.logisticsAllDetails=[];
this.orderDetailSkuInfo=[];
this.orderDetailList=[];
this.axios({
url: "assistant/getInfo",
params: {
id,
},
method: "get",
}).then((res) => {
if (res.success) {
let orderDetail = res.module;
this.orderDetail=res.module;
this.orderDetailList.push(res.module);
if(orderDetail.ecOrderInfoSkuRespDTOS){
this.orderDetailSkuInfo= res.module.ecOrderInfoSkuRespDTOS;
}
if(orderDetail.logisticsTrackingDetailsRespDTOS){
this.logisticsAllDetails=orderDetail.logisticsTrackingDetailsRespDTOS.map((item)=>{
return {
buyerChooseLogistics:orderDetail.buyerChooseLogistics,
trackingProvider:item.trackingProvider,
trackingNumber:item.trackingNumber,
packageFreight:item.packageFreight,
packageWeight:item.packageWeight,
details:item.logisticsDetails,
};
})
}else{
this.logisticsAllDetails.push({
buyerChooseLogistics:orderDetail.buyerChooseLogistics,
trackingProvider:orderDetail.trackingProvider,
trackingNumber:orderDetail.trackingNumber,
packageFreight:'-',
packageWeight:'-',
details:[],
});
}
}
});
this.dialogVisibleOrderDetail = true;
},
//编辑物流方式保存
saveLogisticClick() {
const { id, logisticType, orderDetail, logisticCountry } = this;
this.isEdit = true;
this.axios({
url: "assistant/deliver",
data: {
id,
trackingProvider: logisticType,
trackingNumber: orderDetail.trackingNumber,
originCountryCode: logisticCountry,
},
method: "post",
}).then((res) => {
if (res.success) {
this.$message({
message: "保存成功",
type: "success",
});
this.getOrderList();
this.textareaRemark = "";
this.dialogVisibleRemark = false;
}
this.logisticValue = logisticType + "(" + logisticCountry + ")";
});
},
refundClick() {
this.activeTab = 1;
this.dialogVisibleRefund = true;
},
gotoBinding(sku, id) {
this.axios({
url: "assistant/bindSkuInfo",
params: {
id,
skuIdOnly: true,
},
method: "get",
}).then((res) => {
let platformProductSkuIdList = [];
if (res.success && res.module.length) {
console.log("-----", res.module);
platformProductSkuIdList = res.module.map((x) => x.id);
}
this.dialogVisibleSku = true;
this.productBindingDialogData = {
inputPlatform: sku,
valuePlatform: "platformSku",
platformProductSkuIdList: platformProductSkuIdList,
};
});
},
cancelClick() {
this.activeTab = 1;
this.dialogVisibleDetail = false;
this.isEdit = true;
this.dialogVisibleOrderDetail = false;
},
checkNum(val, type) {
console.log(val, type);
if (val < 0) {
this.$set(this.listParams, type, Math.abs(val));
}
},
searchAdvanced() {
this.getOrderList();
},
changePlatformOrderDate(value) {
if (value) {
this.listParams.platformOrderDateStart = value[0];
this.listParams.platformOrderDateEnd = value[1];
} else {
this.listParams.platformOrderDateStart = "";
this.listParams.platformOrderDateEnd = "";
}
},
changeTransactionDate(value) {
if (value) {
this.listParams.transactionDateStart = value[0];
this.listParams.transactionDateEnd = value[1];
} else {
this.listParams.transactionDateStart = "";
this.listParams.transactionDateEnd = "";
}
},
changeShippingDate(value) {
if (value) {
this.listParams.shippingDateStart = value[0];
this.listParams.shippingDateEnd = value[1];
} else {
this.listParams.shippingDateStart = "";
this.listParams.shippingDateEnd = "";
}
},
resetClick() {
this.listParams.platformOrderDateStart = "";
this.listParams.platformOrderDateEnd = "";
this.listParams.transactionDateStart = "";
this.listParams.transactionDateEnd = "";
this.listParams.orderTotalStart = "";
this.listParams.orderTotalEnd = "";
this.listParams.shippingDateStart = "";
this.listParams.shippingDateEnd = "";
this.listParams.collectTime = "";
this.listParams.trackingProvider = "";
this.listParams.platformOrderTime = "";
this.listParams.transactionTime = "";
this.listParams.shippingTime = "";
this.getOrderList();
},
iscancelClick() {
this.resetClick();
this.advancedSearch = false;
},
reasonChange() {
this.getTrackingProviderList();
},
//订单退款
sureRefunedClick() {
const { id, reasonCode, reasonNote } = this;
this.axios({
url: "assistant/refund",
data: {
id,
reasonCode,
reasonNote,
},
method: "post",
}).then((res) => {
if (res.success) {
this.$message({
message: "退款成功",
type: "success",
});
this.dialogVisibleRefund = false;
this.dialogVisibleDetail = false;
}
});
},
remarkClick(id) {
this.dialogVisibleRemark = true;
this.id = id;
},
remarkSure() {
const { id, textareaRemark } = this;
this.axios({
url: "assistant/remark",
data: {
id,
remark: textareaRemark,
},
method: "post",
}).then((res) => {
if (res.success) {
this.$message({
message: "备注成功",
type: "success",
});
this.getOrderList();
this.textareaRemark = "";
this.dialogVisibleRemark = false;
}
});
},
searchInputClick() {
this.getOrderList();
},
getOnlineNum(listParams) {
this.axios({
url: "assistant/queryRefundOrderCount",
data: listParams,
method: "post",
}).then((res) => {
if (res.success) {
let data = res.module;
this.$set(this.dataTabList[0], "number", data.all);
this.$set(this.dataTabList[1], "number", data.isDeliveryCount);
this.$set(this.dataTabList[2], "number", data.unDeliveryCount);
}
});
},
chooseTabs(value) {
this.listParams.isVirtualDelivery = value;
this.getOrderList();
},
currentChange(val) {
this.listParams.currentPage = val;
this.getOrderList();
},
sizeChange(val) {
this.listParams.pageSize = val;
this.getOrderList();
},
getCommonfCountry() {
this.axios({
url: "assistant/queryCountry",
data: {},
method: "post",
}).then((res) => {
if (res.success) {
this.dataCountry = this.dataCountry.concat(res.module);
}
});
},
copyUrl(data) {
util.copyUrl(data);
},
//物流提供商列表查询
getTrackingProviderList() {
this.axios({
url: "assistant/info/get/trackingProviderList",
data: {},
method: "get",
}).then((res) => {
if (res.success) {
this.logisticTypeOptions = res.module;
}
});
},
getPlatformChannelsList(agentList){//根据登录账号获取平台渠道列表
this.agentCodeList=[];
this.agentCodeList.push({name:'全部',id:''})
agentList.map((item)=>{
this.agentCodeList.push({name:item.agentCode,id:item.agentCode})
this.platformOptions.push({value:item.agentCode,lable:item.agentCode});
})
},
//通过登录用户查询信息
getAccountDetail(type){
let user = JSON.parse(localStorage.getItem("user"));
this.axios({
url:'assistant/user/findByAccountId',
params:{
id:user.id,
},
method: "get"
}).then(res => {
if(res.success && res.module!=null){
let data=res.module
this.allShopData=[]
if(type==1){
this.account=data.account
this.name=data.name
this.roleList=data.roleList
this.checkList=[]
this.roleList.map((item)=>{
if(item.checked){
this.checkList.push(item.id)
}
})
}
data.agentList.map((item)=>{
let checkArry=[]
let checkAllArry=[]
let isCheck=false
item.shopList.map((v)=>{
checkAllArry.push(v.authCode)
})
let newItem=Object.assign({},item,{isCheck,checkArry,checkAllArry})
this.allShopData.push(newItem)
})
this.allShopList=JSON.parse(JSON.stringify(this.allShopData))//同步弹窗搜索是用到
this.getPlatformChannelsList(JSON.parse(JSON.stringify(this.allShopData)));
this.getDefualtPlatformChannelShop(JSON.parse(JSON.stringify(this.allShopData)));
}
})
},
getDefualtPlatformChannelShop(allShopData){//打开页面默认一个平台下的所有店铺
allShopData.map((item)=>{
item.shopList.map((item2)=>{
this.dataAccount.push({name:item2.authCode,id:item2.authCode})
this.allShop.push({name:item2.authCode,id:item2.authCode,agentCode: item.agentCode})
})
})
},
getChildSkus(skuDetail) {
this.tableDataGroup = skuDetail;
},
searchShop(val) {
this.dataAccount = [{ name: "全部", id: 0 }];
this.listParams.authCode = '';
this.allShop.map((item)=>{
if (this.listParams.agentCode == 0){
if(item.name.indexOf(val)>-1){
this.dataAccount.push(item)
}
}else {
if(item.name.indexOf(val)>-1 && this.listParams.agentCode == item.agentCode){
this.dataAccount.push(item)
}
}
})
},
showMoreShops() {
this.showAllShops = !this.showAllShops;
},
// 运单状态全选
handleCheckAllCountry() {
this.checkAllCountry1 = !this.checkAllCountry1
this.checkAllCountry2 = !this.checkAllCountry2
this.checkList = this.checkAllCountry2 ? this.specificCountry : [];
},
handleCheckedAllCountryChange() {
const flag = this.checkList.length !== 0
this.checkAllCountry1 = flag
this.checkAllCountry2 = flag
},
},
mounted() {
this.leftActive(this.$route.path);
this.getAccountDetail()//通过登录用户获取信息
this.getCountry();
this.getCommonfCountry();
this.getCountryList();
this.getTrackingProviderList();
},
watch: {
$route: function () {
this.leftActive(this.$route.path);
},
},
};
</script>
<style lang="less" scoped>
.shop-list {
display: flex;
margin: 20px 5px;
flex-wrap: wrap;
// justify-content:space-between;
max-height: 300px;
overflow: auto;
clear: both;
.current-shop {
width: 120px;
overflow: hidden;
}
}
.content-right {
.content-top {
background: #ffffff;
.border-b {
border-bottom: 1px solid #ccc;
overflow: hidden;
}
.btn {
display: inline-block;
vertical-align: middle;
height: 34px;
width: 80px;
// margin-right: 10px;
font-size: 13px;
}
.container-o-box {
.default {
margin: 0;
width: 100%;
}
.com-block {
border: 1px solid #ccc;
width: 100%;
background-color: #fff;
box-shadow: 0 0 0 0;
border-top: none;
.productSearchGroup input[type="text"] {
display: inline-block;
width: 410px;
vertical-align: middle;
margin-right: 10px;
padding-right: 90px;
}
.search-tab {
padding: 5px;
.border-dashed-top1 {
border-top: 1px dashed #ccc !important;
}
table {
width: 100%;
tbody > tr > td {
padding: 2px 5px;
line-height: 34px;
vertical-align: top;
}
tbody > tr > td:first-child {
width: 80px;
min-width: 80px;
max-width: 100px;
text-align: left;
color: #a0a3a6;
}
table > tbody > tr > td:nth-child(2) {
padding: 5px;
}
tbody > tr > td .tab-in > a {
padding: 0 3px;
cursor: pointer;
}
tbody > tr > td > a {
float: left;
margin: 5px 20px 5px 0;
padding: 0 3px;
}
.choosed-country {
overflow: auto;
display: inline-block;
background: #f2f2f2;
float: left;
line-height: 24px;
width: 80%;
padding-left: 10px;
}
a {
color: #367EE2;
text-decoration: none;
}
a.myj-aFocus {
display: flex;
padding: 2px 2px;
line-height: 18px;
vertical-align: middle;
}
a.country-tabs {
margin: 5px 20px 5px 0;
padding: 2px 5px;
background-color: #fff;
color: #333;
display: inline-block;
}
.country-choose {
border: 1px solid #199ed8;
background-color: #f2f2f2;
width: 770px;
// height: 174px;
float: left;
.tit {
margin: 5px 0;
padding: 0 10px;
}
.content {
background-color: #fff;
padding: 10px;
height: 126px;
overflow: auto;
.specific-country {
width: 80px;
line-height: 26px;
display: inline-block;
margin-right: 20px;
vertical-align: middle;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #367EE2;
cursor: pointer;
}
}
}
.country-choose-checkbox {
// height: 261px
}
.show-more {
display: inline-block;
width: 78px;
height: 25px;
border: 1px solid #ddd;
color: #333;
line-height: 25px;
text-align: center;
float: right;
margin-left: 10px;
cursor: pointer;
}
.tp24 {
padding-top: 4px;
}
.myj-active {
background-color: #367EE2 !important;
color: #fff !important;
}
.m-right15 {
margin-right: 15px !important;
}
.p-right0 {
padding-right: 0 !important;
}
.gray-c {
color: #737679 !important;
}
.account-list {
display: inline-block;
max-height: 100px;
overflow: hidden;
}
.account-list-all {
display: inline-block;
overflow: auto;
}
}
}
}
}
.pull-right {
float: right !important;
}
.post_divA {
padding-left: 19px;
background: url(../../assets/img/arrowgreen1.png) no-repeat left -128px;
}
.post_crawl .p_style3 {
background-position-y: -3px !important;
background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2%
0;
color: #666;
}
.post_divA p,
.post_divB p {
margin: 0;
height: 31px;
line-height: 21px;
font-size: 12px;
float: left;
text-align: center;
width: 25%;
}
.w120 {
width: 120px !important;
}
.h25 {
height: 25px !important;
}
.m-bottom10 {
margin-bottom: 10px !important;
}
.lh15-imp {
line-height: 25px !important;
}
.post_crawl .p_style4A {
background-position-y: -67px !important;
background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% -65px;
color: #666;
}
.border4 {
border: 1px solid #ccc !important;
clear: both;
}
.tab-content > .active {
display: block;
visibility: visible;
}
.form-control {
display: block;
width: 100%;
height: auto;
padding: 6px 12px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.form-control2 {
display: inline-block;
width: 170px;
height: 34px;
padding: 6px 12px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out 0.15s,
-webkit-box-shadow ease-in-out 0.15s;
-o-transition: border-color ease-in-out 0.15s,
box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
.p30 {
padding: 38px 10px;
}
.btn-determine {
font-size: 13px;
border-color: #367EE2;
color: #fff;
background-color: #367EE2;
}
.btn-gray {
border-color: #d0d3d6;
font-size: 13px;
color: #434649;
background-color: #f2f2f2;
}
.m-left8 {
margin-left: 8px !important;
}
.content-button {
display: flex;
flex-direction: row-reverse;
margin-bottom: 10px;
.el-button--primary {
background-color: #367EE2;
border-color: #367EE2;
}
}
}
}
.search-group-senior {
margin-top: 10px;
padding: 10px;
width: 605px;
background-color: #eee;
table tbody > tr > td[data-v-26d277f0]:first-child {
width: 100px;
}
.form-control {
display: inline-block;
width: 170px;
height: 34px;
padding: 6px 12px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out 0.15s,
-webkit-box-shadow ease-in-out 0.15s;
-o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
}
.variant-input-control {
text-align: center;
background-color: #f2f2f2;
.variant-update-input {
padding: 6px;
width: 100%;
height: 24px;
line-height: 24px;
display: inline-block;
}
.btn-edit-enter {
margin-right: 2px;
border-radius: 2px;
padding: 0;
width: 40px;
height: 20px;
line-height: 18px;
background-color: #5399d5;
color: #fff;
}
.btn-edit-restart {
border-radius: 2px;
padding: 0;
width: 40px;
height: 20px;
line-height: 18px;
background-color: #5399d5;
color: #fff;
}
}
.stand-handle {
border-radius: 2px;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
color: #fff;
background-color: #f40;
display: inline-block;
margin-top: 10px;
}
.detail-flex {
display: flex;
justify-content: space-between;
border: 1px solid #ccc;
height: 50px;
align-items: center;
padding: 5px;
}
.logistic-detail {
border: 1px solid #ccc;
min-height: 100px;
.logistic-title {
background-color: #eee;
text-align: center;
padding: 5px 0;
}
.logistic-btn {
background-color: #367EE2;
border: none;
color: #fff;
width: 130px;
height: 34px;
margin-bottom: 10px;
text-align: center;
line-height: 34px;
cursor: pointer;
}
.logistic-btn-white {
background-color: #fff;
color: #000;
border: 1px solid #ccc;
cursor: pointer;
}
}
.border5 {
clear: both;
.el-table--border,
.el-table--group {
border: 1px solid #ccc !important;
}
.el-table thead {
color: #333;
}
.el-dropdown-link {
cursor: pointer;
color: #367EE2;
font-size: 13px;
}
.squareSpan {
display: inline-block;
margin-right: 5px !important;
border-radius: 2px;
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
color: #fff;
background-color: #361c93;
}
.table-content {
display: flex;
.table-content-right {
text-align: left;
padding-left: 10px;
line-height: 16px;
.sku-number {
display: inline-block;
min-width: 24px;
height: 24px;
border-radius: 50%;
background-color: #999;
color: #fff;
text-align: center;
padding: 5px;
}
}
}
.imgCss {
width: 58px;
height: 58px;
}
.control-heightOpen {
overflow: hidden;
}
.control-heightUp {
max-height: 100px;
overflow: hidden;
}
.variant-input-control {
position: absolute;
top: 0;
left: 0;
text-align: center;
background-color: #f2f2f2;
z-index: 1;
width: 100px;
.variant-update-input {
padding: 6px;
width: 100%;
height: 24px;
line-height: 24px;
display: inline-block;
}
.btn-edit-enter {
margin-right: 2px;
border-radius: 2px;
padding: 0;
width: 29px;
height: 20px;
font-size: 12px;
line-height: 18px;
background-color: #5399d5;
}
.btn-edit-restart {
border-radius: 2px;
padding: 0;
width: 29px;
height: 20px;
font-size: 12px;
line-height: 18px;
background-color: #5399d5;
}
}
.custom-table-title {
span {
width: 80px;
display: inline-block;
padding-top: 7px;
}
}
.custom-table {
border-bottom: 1px solid #ebeef5;
span {
width: 80px;
display: inline-block;
cursor: pointer;
}
span:first-child {
cursor: auto;
}
.activeInput {
background: #ccc;
}
}
.custom-table:last-child {
border: none;
}
.unfold-show {
color: #367EE2;
text-align: right;
font-size: 13px;
}
}
.more-btn {
float: right;
border: 1px solid #dcdfe6;
}
.shop-search {
float: right;
margin-bottom: 5px;
margin-left: 5px;
}
</style>
<template>
<div class="content-height">
<div class="myorder-content">
<div class="contain-page">
<div class="content-top">
<topCrumbs :firstCrumbs="firstCrumbs" :secondCrumbs="secondCrumbs" :thirdCrumbs="thirdCrumbs" :backIsShow="backIsShow"></topCrumbs>
<div class="r mb10 mt10">
<el-dropdown @command="translationClick">
<el-button type="info">
一键翻译<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='1'>中文->英文</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button class="ml10" v-if="currentType!=3&&$_has('delete')" @click="clearUnitRespDTOListClick" type="info">
清空变种信息
</el-button>
<button class="button btn-orange ml10" type="button" @click="saveAllClick" v-if="currentType!=3||!id&&$_has('add')">保 存</button>
<button class="button btn-orange ml10" type="button" @click="handleClick(3)" v-if="currentType==1&&id&&$_has('publishP')">移入待发布</button>
<el-dropdown v-if="(currentType!=3||!id)&&$_has('publishP')" @command="handleClick">
<el-button type="success" class="ml10">
发 布<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='1'>立即发布</el-dropdown-item>
<el-dropdown-item command=2>定时发布</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button class="ml10" type="success" v-if="currentType==3&&id&&$_has('publishP')" @click="saveAllClick">
更新至Wish
</el-button>
</div>
<div class="product-info-module mb20">
<div class="product-info-module-tab">基本信息
</div>
<div class="product-info-module-content onlineProductInfo">
<table class="source-tab">
<tbody>
<tr v-if="!id">
<td class="firstTd"><span class="f-red">*</span>店铺:</td>
<td class="no-flex">
<el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<el-checkbox-group v-model="checkedCities" @change="handleShopChange" style="margin-top:8px;display:inline-block;margin-left:5px">
<el-checkbox v-for="shop in shopAccount" :label="shop.id" :key="shop.id">
<span style="width:160px;display: inline-block;overflow:auto;vertical-align: bottom;">{{shop.name}}</span>
</el-checkbox>
</el-checkbox-group>
</td>
</tr>
<tr>
<td class="firstTd"><span class="f-red">*</span>SPU:</td>
<td class="no-flex">
<el-input placeholder="可接受:BG00003GG" size="small" v-model="spu"></el-input>
</td>
</tr>
<tr>
<td class="firstTd">产品标题:</td>
<td class="no-flex">
<el-input placeholder="可接受:Nikon D5100 DSLR Camera (Body Only) USA MODEL" size="small" v-model="title" @input="titleToUpperCase"></el-input>
</td>
</tr>
<tr>
<td class="firstTd">产品描述:</td>
<td class="no-flex">
<el-input type="textarea" :rows="8" placeholder="可接受:Nikon D5100 DSLR Camera (Body Only) USA MODEL" v-model="description"></el-input>
</td>
</tr>
<tr>
<td class="firstTd">产品标签:</td>
<td class="no-flex">
<div class="label-show">
<div class="label-tags" v-for="(item,index) in tags" :key="index">
<span>{{item}}</span>
<i class="el-icon-close poi" @click="deleteLabel(index)"/>
</div>
<input placeholder="请输入标签名,输入回车完成添加,标签数不能少于两个" class="label-input" @keyup.enter="addLabel" v-model="labelValue"/>
</div>
</td>
</tr>
<tr>
<td class="firstTd"></td>
<td class="no-flex">
<el-dropdown @command="translationClick">
<el-button type="primary">
一键翻译<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='1'>中文->英文</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button type="primary">仿品检测</el-button> -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20">
<div class="product-info-module-tab">{{jieziman?'智链互联':'红茄'}}信息<span class="gray-nine ml10">(注:下列信息,仅在此系统生效)</span>
</div>
<div class="product-info-module-content onlineProductInfo" style='overflow: inherit;'>
<table class="source-tab">
<tbody>
<tr>
<td class="firstTd">{{jieziman?'智链互联':'红茄'}}分类</td>
<td class="secondTd">
<div style="position:relative">
<div class="tree-select poi" @click="treeShow=!treeShow">{{classificationType?classificationType:'请选择分类'}}</div>
<div class="tree-data" v-if="treeShow">
<el-tree
:data="treeData"
node-key="id"
ref="tree"
highlight-current
@current-change="SwitchNode"
>
</el-tree>
</div>
</div>
<!-- <i class="fa fa-plus fa-lg ml10 icon-color poi" @click="dialogVisible=true"></i>
<span class="icon-color ml5 poi f14" @click="dialogVisible=true">管理分类</span> -->
</td>
</tr>
<tr v-for="(item,index) in productFromUrl" :key="index">
<td class="firstTd">{{index==0?"来源URL:":''}}</td>
<td class="secondTd">
<el-input placeholder="用于记录供货渠道URL,方便采购。仅在此系统显示,不会同步到wish平台!" v-model="productFromUrl[index]" size="small">
<template slot="prepend">{{index+1}}</template>
<template slot="append">
<span class="opera-span" @click="visitUrlClick(productFromUrl[index])">访问</span>
</template>
</el-input>
<i class="fa fa-plus fa-lg ml10 icon-color poi" @click="addSource" v-if="index==0"></i>
<i class="fa fa-remove fa-lg ml10 poi" v-if="index!=0" @click="removeSource(index)"></i>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20" v-if="!id && checkedCities.length === 0">
<div class="product-info-module-tab">运费设置
</div>
<div class="product-info-module-tab2">未选择店铺,无法进行运输设置
</div>
</div>
<div class="product-info-module mb20" v-if="(currentType != 3 && templateTableData[0].shop) || (!id && checkedCities.length > 0)">
<div class="product-info-module-tab">运费设置
</div>
<div class="product-info-module-content onlineProductInfo" style='overflow: inherit;'>
<table class="source-tab">
<tbody>
<tr>
<el-select v-model="templateValue" placeholder="选择模板" size="small" class="mb10" @change="templateSelect" :disabled="shopChoose.length>0?false:true">
<el-option
v-for="item in templateOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-table
ref="multipleTableTemplate"
:data="templateTableData"
tooltip-effect="dark"
border
style="width: 100%"
@selection-change="handleShopChangeClick">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
label="店铺"
prop="shop"
>
</el-table-column>
<el-table-column
prop="countrys"
label="设置情况"
>
</el-table-column>
<el-table-column
prop="address"
label="操作"
>
<template slot-scope="scope">
<div class="el-dropdown-link" @click="setTemplateClick">设置</div>
<div>
<el-dropdown>
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="clearSetClick">清空设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20" v-if="currentType!=3||!id">
<div class="product-info-module-tab">价格和运送
<el-popover
v-model="visibleParities"
placement="bottom"
width="100"
trigger="hover">
<div class="parities-change">
<div class="poi" @click="priceChangeClick(3)">USD转换CNY</div>
<div class="poi" @click="priceChangeClick(4)">CNY转换USD</div>
<div style="background:#eee">汇率:<el-input placeholder="5-7" size="mini" v-model="paritiesVal" style="width:80px"/></div>
</div>
<span slot="reference" class="icon-color r poi">价格转换<i class="el-icon-arrow-down el-icon--right"/></span>
</el-popover>
</div>
<div class="product-info-module-content onlineProductInfo">
<table class="source-tab">
<tbody>
<tr>
<td class="firstTd">价格(USD):</td>
<td class="no-flex">
<el-input-number controls-position="right" type="number" :min="0" placeholder="可接受:90.99,货币单位为「美元」" v-model="sellPriceUs" size="small" class="sku-length mr10">
</el-input-number>
<el-tooltip content="将在 Wish.com 上显示的产品价格,不包含其它文字。这是顾客为产品支付的金额。" placement="top" effect="light">
<i class="el-icon-question"/>
</el-tooltip>
<span class="cny-price">本地价格(CNY):</span>
<el-input-number controls-position="right" type="number" :min="0" placeholder="可接受:4.00" v-model="sellPriceCn" size="small" class="sku-length mr10">
</el-input-number>
<el-tooltip content="以本币核算的产品价格。用户按照您的本币核算金额为这个产品支付货款。当地货币请参照您的当地货币代码,可在货币设置中找到。" placement="top" effect="light">
<i class="el-icon-question"/>
</el-tooltip>
</td>
</tr>
<tr>
<td class="firstTd">运费:</td>
<td class="no-flex">
<el-input-number controls-position="right" type="number" :min="0" placeholder="可接受:4.00,货币单位为「美元」" v-model="freightPriceUs" size="small" class="sku-length mr27">
</el-input-number>
<span class="cny-price">本地运费(CNY):</span>
<el-input-number controls-position="right" type="number" :min="0" placeholder="可接受:90.99" v-model="freightPriceCn" size="small" class="sku-length mr10">
</el-input-number>
<el-tooltip content="用当地货币核算的预估组运费。当地货币请参照您的当地货币代码,可在货币设置中找到。" placement="top" effect="light">
<i class="el-icon-question"/>
</el-tooltip>
</td>
</tr>
<tr>
<td class="firstTd">库存:</td>
<td class="no-flex">
<el-input-number controls-position="right" type="number" :min="1" placeholder="可接受:10" v-model="stock" size="small" class="sku-length mr27">
</el-input-number>
<span class="cny-price">运送时间:</span>
<el-popover
v-model="visible"
placement="bottom"
width="450"
trigger="click">
<div class="choose-send-time">选择运送时间</div>
<el-button class="date-button" type="primary" size="small" v-for="(item,index) in dateArry" :key="index" @click="getCurrentDate(item)">{{item}}</el-button>
<el-radio v-model="radioVal" label="1" class="ml10" @change="chooseDataClick">其它</el-radio>
<el-input-number controls-position="right" type="number" :min="1" v-model="deliveryMin" :disabled="radioVal? false:true" style="width:90px" size="small"/>
-
<el-input-number controls-position="right" type="number" :min="1" v-model="deliveryMax" :disabled="radioVal? false:true" style="width:90px" size="small"/>
<div style="text-align: right; margin: 0">
<el-button size="mini" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="sureDateClick">确定</el-button>
</div>
<el-button slot="reference" class="choose-data">{{deliveryTime}}<i class="fa fa-sort-desc icon-edit"/></el-button>
</el-popover>
</td>
</tr>
<tr>
<td class="firstTd">MSRP:</td>
<td class="no-flex">
<el-input-number controls-position="right" type="number" :min="0" placeholder="可接受:100.99, 货币单位为「美元」" v-model="msrpPrice" size="small" class="sku-length mr10">
</el-input-number>
<el-tooltip content="制造商的建议零售价。建议填写此字段,因为它将在 Wish 的产品销售价格上方显示为带删除线的价格。" placement="top" effect="light">
<i class="el-icon-question"/>
</el-tooltip>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20">
<div class="product-info-module-tab">图片信息</div>
<div class="product-info-module-content onlineProductInfo">
<table class="source-tab">
<tbody>
<tr>
<td class="firstTd" style="max-width:300px;vertical-align: top;">
<div style="border:1px solid #cccccc">
<div :class="(mainImageUrl&&mainImageUrl.hd)? 'background-mainPhoto clean':'background-mainPhoto'">
<img :src="mainImageUrl&&mainImageUrl.url" class="imgCss"/>
</div>
<div class="tl pl5">
<span class="f-blue poi" @click="setHDClick(100)">HD</span>
</div>
</div>
</td>
<td>
<div class="icon-color poi picture-show">
<div class="l">
<el-upload
:limit="id?20-variantImageUrlsData:21-variantImageUrlsData"
:on-exceed="handleExceed"
:http-request="(file)=>{return uploadFile(file,1,1)}"
:data="dataObj"
class="avatar-uploader"
multiple
:show-file-list="false"
:before-upload="beforeAvatarUpload"
>
<el-button class="button btn-primary ml10">
选择本地图片
</el-button>
</el-upload>
</div>
<div class="r poi" @click="downZipClick">
<i class="fa fa-download fa-lg icon-color mr5"></i>导出全部图片
</div>
<div style="clear:both">
<span class="img-remark">说明!</span>
<span class="gray-nine ml10">「附图和变种图最多选用<span class="f-red">20</span>张, 附图选用了<span class="g19">0</span>张,变种图选用了<span class="g19">0</span>张」</span>
</div>
<div class="img-show">
<div class="imgDivOut" v-for="(item,index) in variantImageUrls" :key="index">
<div :class="item.hd?'img-border clean':'img-border'">
<img :src="item.url" class="imgDivIn"/>
<div class="imgSize">{{item.width}} X {{item.height}}</div>
</div>
<div class="imgDivDown">
<i class="el-icon-s-home poi" @click="setMainPhotoClick(index)"/>
<span class="f-blue poi" @click="setHDClick(index)">HD</span>
<i class="el-icon-delete poi" @click="removeImgClick(index)"/>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20">
<div class="product-info-module-tab">颜色信息</div>
<div class="product-info-module-content onlineProductInfo">
<table class="source-tab">
<tbody>
<tr>
<div class="pt20 pb20">
<el-checkbox-group v-model="colorCode" @change="handleCheckedCitiesChange">
<el-checkbox v-for="(item,index) in colorArry" :key="index" :label="item.code" >
<div :class="item.code=='White'||item.code=='Cream'||item.code=='Khaki'||item.code=='Beige'||item.code=='Yellow'?'checkbox-color g0':'checkbox-color color-ful'" :style="{'background': item.value}" v-if="!item.customColors">{{item.name}}</div>
<div class="mb5 checkbox-width" v-else>
<el-input style="width:100px" size="small" v-model="item.name"></el-input>
<i class="fa fa-floppy-o" @click.stop.prevent="customEditClick(index,1)" v-if="item.isEdit"></i>
<i class="el-icon-close" v-if="item.isEdit" @click.stop.prevent="customDelClick(index,1)"></i>
<i class="el-icon-edit" @click.stop.prevent="customEditClick(index,1)" v-else></i>
</div>
</el-checkbox>
</el-checkbox-group>
<div class="mt10">
<el-input v-model="sizeInput" placeholder="可接受:其它颜色的英文单词" style="width:200px" size="small"></el-input>
<el-button type="primary" size="small" @click="addClick(1)">添加</el-button>
<span class="img-remark">说明!</span>
<span class="gray-nine">请务必按要求添加!双色支持格式:black&white;单色请参考:<a href="http://merchant.wish.com/documentation/colors" target="_blank" class="icon-color">wish官方颜色列表&gt;&gt;</a></span>
</div>
<div class="mt10" v-if="isColorClick">
<span class="gray-nine"><span class="gf5">颜色无效!</span>单色请参考:<a href="http://merchant.wish.com/documentation/colors" target="_blank" class="icon-color">wish官方颜色列表&gt;&gt;</a>; 双色支持格式:black&white;</span>
</div>
</div>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20">
<div class="product-info-module-tab">尺寸信息</div>
<div class="product-info-module-content onlineProductInfo">
<table class="source-tab">
<tbody>
<tr>
<div class="pt20 pb20">
<div :class="typeCode==item.code?'btn-size':'noCss'" v-for="(item,index) in typeArry" :key="index" @click="chooseSize(item.code)">{{item.name}}</div>
</div>
<dynamicTable :table-data="mulTableData" :table-header="tableConfig" :sizeCode="sizeCode" @getCurrentSize="handleSelectionChange" v-if="mulTableData&&mulTableData.length>0" :tableShow="tableShow"></dynamicTable>
<div v-if="!tableShow">
<el-checkbox-group v-model="otherSizeCodeNew" @change="handleSizeChange" class="checkbox-flex" >
<el-checkbox v-for="(item,index) in otherSizeCode" :key="index" :label="item.name">
<div class="checkbox-width" v-if="typeCode!='custom'">{{item.name}}</div>
<div class="mb5 checkbox-width" v-else>
<el-input style="width:100px" size="small" v-model="item.name"></el-input>
<i class="fa fa-floppy-o" @click.stop.prevent="customEditClick(index,2)" v-if="item.isEdit"></i>
<i class="el-icon-close" v-if="item.isEdit" @click.stop.prevent="customDelClick(index,2)"></i>
<i class="el-icon-edit" @click.stop.prevent="customEditClick(index,2)" v-else></i>
</div>
</el-checkbox>
</el-checkbox-group>
</div>
<div v-if="typeCode=='custom'">
<div class="mb10">例子:Hardcover,Cookies & Cream,12-Pack (max 50 characters)</div>
其它:
<el-input v-model="customInput" style="width:200px" size="small"></el-input>
<el-button type="primary" size="small" @click="addClick(2)">添加</el-button>
</div>
</tr>
</tbody>
</table>
</div>
</div>
<div class="product-info-module mb20">
<div class="product-info-module-tab">变种信息
<el-popover
v-model="visibleParities"
placement="bottom"
width="100"
trigger="hover">
<div class="parities-change">
<div class="poi" @click="priceChangeClick(1)" v-if="$_has('edit')">USD转换CNY</div>
<div class="poi" @click="priceChangeClick(2)" v-if="$_has('edit')">CNY转换USD</div>
<div style="background:#eee">汇率:<el-input placeholder="5-7" size="mini" v-model="paritiesVal" style="width:80px"/></div>
</div>
<span slot="reference" class="icon-color r poi">价格转换<i class="el-icon-arrow-down el-icon--right"/></span>
</el-popover>
</div>
<div class="r mt10 mb10 mr10">
<el-tooltip content="变种图片为非必填,没有特殊需求不建议设置变种图片。" placement="bottom" effect="light">
<el-checkbox v-model="checkedImg">显示变种图片</el-checkbox>
</el-tooltip>
</div>
<div class="product-info-module-content onlineProductInfo">
<table class="source-tab">
<tbody>
<tr>
<el-table
border
:data="unitRespDTOList"
style="width: 100%">
<el-table-column
v-if="currentType==3"
align="center"
label="状态"
width="35">
<template slot-scope="scope">
<div :class="scope.row.publishStatus?'g19':'f-red'">{{scope.row.publishStatus?'成功':scope.row.publishStatus==false?'失败':''}}</div>
</template>
</el-table-column>
<el-table-column
v-if="checkedImg"
align="center">
<template slot="header" slot-scope="scope">
<div>图片</div>
<div class="icon-color poi" @click="deleteImgAllClick">(清空)</div>
</template>
<template slot-scope="scope">
<el-upload
:http-request="(file)=>{return uploadFile(file,scope.$index,2)}"
:data="dataObj"
class="avatar-uploader"
:show-file-list="false"
>
<div class="rel">
<img :src="scope.row.mainImageUrl" v-if="scope.row.mainImageUrl" class="mainImage-Url"/>
<i class="el-icon-plus" v-else></i>
<i class="el-icon-error abs" @click.stop="deleteImgClick(scope.$index)" v-if="scope.row.mainImageUrl"></i>
</div>
</el-upload>
</template>
</el-table-column>
<el-table-column
align="center">
<template slot="header" slot-scope="scope">
<div>sku</div>
<div class="icon-color poi" @click="generationClick">(一键生成)</div>
</template>
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.sku"/>
</template>
</el-table-column>
<el-table-column
align="center"
:label="!sourceType?'尺寸':'平台尺寸'"
>
<template slot-scope="scope">
<span v-if="!sourceType">{{scope.row.sizeCode}}</span>
<el-input v-model="scope.row.sizeCode" size="small" v-else></el-input>
</template>
</el-table-column>
<el-table-column
align="center"
:label="!sourceType?'颜色':'平台颜色'"
>
<template slot-scope="scope">
<span v-if="!sourceType">{{scope.row.colorCode}}</span>
<el-input v-model="scope.row.colorCode" size="small" v-else @change="(value)=>{return checkColorClick(value,scope.$index)}"></el-input>
</template>
</el-table-column>
<el-table-column
v-if="sourceType==1"
align="center"
label="系统尺寸"
prop="sysSize"
>
</el-table-column>
<el-table-column
v-if="sourceType==1"
align="center"
label="系统颜色"
prop="sysColor"
>
</el-table-column>
<el-table-column
width="135"
align="center">
<template slot="header" slot-scope="scope">
<div>MSRP($)</div>
<div class="icon-color poi" @click="updateDataClick('msrpPrice')" v-if="$_has('edit')">{{currentType!=3?'(更新)':'(修改)'}}</div>
</template>
<template slot-scope="scope">
<!-- <el-input placeholder="" size="small" v-model="scope.row.msrpPrice"/> -->
<el-input-number controls-position="right" type="number" :min="0" v-model="scope.row.msrpPrice" size="small">
</el-input-number>
</template>
</el-table-column>
<el-table-column
width="135"
align="center"
>
<template slot="header" slot-scope="scope">
<div>价格(USD)</div>
<div class="icon-color poi" @click="updateDataClick('sellPriceUs')" v-if="$_has('edit')">{{currentType!=3?'(更新)':'(修改)'}}</div>
</template>
<template slot-scope="scope">
<!-- <el-input placeholder="" size="small" v-model="scope.row.sellPriceUs"/> -->
<el-input-number controls-position="right" type="number" :min="0" v-model="scope.row.sellPriceUs" size="small">
</el-input-number>
</template>
</el-table-column>
<el-table-column
align="center"
width="135"
>
<template slot="header" slot-scope="scope">
<div>本地价格</div>
<div class="icon-color poi" @click="updateDataClick('sellPriceCn')" v-if="$_has('edit')">{{currentType!=3?'(更新)':'(修改)'}}</div>
</template>
<template slot-scope="scope">
<!-- <el-input placeholder="" size="small" v-model="scope.row.sellPriceCn"/> -->
<el-input-number controls-position="right" type="number" :min="0" v-model="scope.row.sellPriceCn" size="small">
</el-input-number>
</template>
</el-table-column>
<el-table-column
width="135"
align="center"
>
<template slot="header" slot-scope="scope">
<div>库存</div>
<div class="icon-color poi" @click="updateDataClick('stock')" v-if="$_has('edit')">{{currentType!=3?'(更新)':'(修改)'}}</div>
</template>
<template slot-scope="scope">
<!-- <el-input placeholder="" size="small" v-model="scope.row.stock"/> -->
<el-input-number controls-position="right" type="number" :min="0" v-model="scope.row.stock" size="small">
</el-input-number>
</template>
</el-table-column>
<el-table-column
align="center"
width="180"
>
<template slot="header" slot-scope="scope">
<div>运输时间</div>
<div class="icon-color poi" @click="updateDataClick('deliveryMin')" v-if="$_has('edit')">{{currentType!=3?'(更新)':'(修改)'}}</div>
</template>
<template slot-scope="scope">
<el-input size="small" style="width:80px;" v-model="scope.row.deliveryMin"/>-<el-input size="small" style="width:80px;" v-model="scope.row.deliveryMax"/>
</template>
</el-table-column>
<el-table-column
width="60"
v-if="currentType==3"
align="center">
<template slot="header" slot-scope="scope">
<div>上架</div>
<el-dropdown @command="handleClickUpDown">
<span class="el-dropdown-link icon-color">批量<i class="el-icon-arrow-down el-icon--right"></i></span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">全部上架</el-dropdown-item>
<el-dropdown-item command="2">全部下架</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
<template slot-scope="scope">
<el-checkbox v-model="scope.row.ifShelf"></el-checkbox>
</template>
</el-table-column>
<el-table-column
align="center"
label="操作"
width="80"
>
<template slot-scope="scope">
<el-button class="el-dialog__header" @click="removeClick(scope.$index)" :disabled="currentType!=3||(currentType==3&&scope.row.remove)?false:true" v-if="$_has('delete')">移除</el-button>
</template>
</el-table-column>
</el-table>
</tr>
</tbody>
</table>
</div>
</div>
<div class="r mb10">
<el-dropdown @command="translationClick">
<el-button>
一键翻译<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='1'>中文->英文</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button class="ml10" v-if="currentType!=3&&$_has('delete')" @click="clearUnitRespDTOListClick">
清空变种信息
</el-button>
<button class="button btn-orange ml10" type="button" @click="saveAllClick" v-if="currentType!=3||!id&&$_has('add')">保 存</button>
<button class="button btn-orange ml10" type="button" @click="handleClick(3)" v-if="currentType==1&&id&&$_has('publishP')">移入待发布</button>
<el-dropdown v-if="currentType!=3||!id&&$_has('publishP')" @command="handleClick">
<el-button type="success" class="ml10">
发 布<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">立即发布</el-dropdown-item>
<el-dropdown-item command="2">定时发布</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button class="ml10" type="success" v-if="currentType==3&&id&&$_has('publishP')" @click="saveAllClick">
更新至Wish
</el-button>
</div>
</div>
</div>
<anchor :stepsArr="stepsArr"></anchor>
</div>
<el-dialog
title="管理分类"
:visible.sync="dialogVisible"
width="600px"
:before-close="handleClose">
<div class="pl20">
<div class="block">
<el-tree
:data="treeData"
node-key="id"
default-expand-all
@current-change="SwitchNode"
:expand-on-click-node="false">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span v-if="!data.edit">{{ node.label }}</span>
<span v-else @click.stop><el-input v-model="data.label" size="mini" style="width:200px"/></span>
<span v-if="node.label!='未分类'">
<el-button
type="text"
size="mini"
@click="() => append(data)">
<i class="el-icon-plus add-type"/>
</el-button>
<el-button
v-if="node.label!='所有分类'"
type="text"
size="mini"
@click.stop="() => edit(node,data)">
<i class="el-icon-edit-outline add-type edit-type"/>
</el-button>
<el-button
v-if="node.label!='所有分类'"
type="text"
size="mini"
@click.stop="() => remove(node, data)">
<i class="el-icon-close add-type delete-type"/>
</el-button>
</span>
</span>
</el-tree>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="sureTypeClick">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="发布"
:visible.sync="dialogVisibleReleased"
width="50%"
@close="dialogVisibleReleased = false">
<div v-if="currentType==1||!id">
<span>选择Wish店铺:</span>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<el-input
@input="searchShopClick"
size="mini"
style="width:200px;float:right"
placeholder="请输入店铺名称"
suffix-icon="el-icon-search"
v-model="shopName">
</el-input>
<el-checkbox-group v-model="checkedCities" @change="handleShopChange" class="shop-list">
<el-checkbox v-for="shop in shopAccount" :label="shop.id" :key="shop.id" class="current-shop">{{shop.name}}</el-checkbox>
</el-checkbox-group>
</div>
<div class="mt20" v-if="command==2||(!id&&command==2)">
<span>定时发布时间:</span>
<el-date-picker
size="small"
v-model="publishDate"
type="datetime"
:picker-options="pickerOptions"
placeholder="选择日期时间">
</el-date-picker>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="chooseShopClick">确 定</el-button>
<el-button @click="dialogVisibleReleased = false">取 消</el-button>
</span>
</el-dialog>
<el-dialog
:title="currentChangeType!='deliveryTime'?'修改价格':'批量修改运送时间'"
:visible.sync="dialogVisiblePrice"
width="40%"
@close="cancelClick">
<div class="modal-price" v-if="currentChangeType!='deliveryTime'">
<el-radio v-model="radio" label="1">在原有数量上增加(减少用负数)</el-radio>
<el-input v-model="editPriceAdd" style="width:35%" type="number"/>
</div>
<div class="mt20 modal-price" v-if="currentChangeType!='deliveryTime'">
<el-radio v-model="radio" label="2">直接修改</el-radio>
<el-input v-model="editPrice" style="width:35%" type="number"/>
</div>
<div class="mt20" v-else>
<span class="pr5">修改运送时间</span>
<el-input v-model="editStartTime" style="width:30%" type="number"/> 天 -
<el-input v-model="editEndTime" style="width:30%" type="number"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="cancelClick">取 消</el-button>
<el-button type="primary" @click="sureChangePrice">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="消息提示"
:visible.sync="dialogVisibleOnline"
width="40%"
@close="dialogVisibleOnline=false">
<!-- <div v-if="dialogMessage">-->
<!-- <div>详情:</div>-->
<!-- <div class="ml40">-->
<!-- 编辑Wish产品成功-->
<!-- </div>-->
<!-- </div>-->
<!-- <div v-if="!syncFalse&&!dialogMessage">正在更新到Wish...</div>-->
<div v-if="syncFalse&&!dialogMessage">页面信息填写不正确,请正确填写哦~</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleOnline=false">关闭</el-button>
</span>
</el-dialog>
<setTemplate :dialogVisibleTemlate="dialogVisibleTemlate" :showInput="false" :tableDataDetail="tableDataDetail" :tableDataAllDetail="tableDataAllDetail" :templateOptions="templateOptions" :id="id" @sureSaveClick="sureSaveClick" @cancelClick="cancelTemplateClick" v-if="currentType==2"></setTemplate>
<syncPollingTemplate :syncPollingVisible="syncPollingVisible" :batchCode="modifyBatchCode" @closeSync="closeSync" ref="syncFunction" :titleName="titleName"></syncPollingTemplate>
</div>
</template>
<script>
import topCrumbs from '@/components/business/topCrumbs'
import anchor from '@/components/business/anchor'
import util from "@/common/js/util";
import dynamicTable from '@/components/business/dynamicTable'
import setTemplate from '@/components/business/setTemplate'
import syncPollingTemplate from '@/components/business/syncPollingTemplate'
import { type } from 'os';
export default {
data() {
return {
id:'',
currentType:'',
treeShow:false,
visible:false,
firstCrumbs:'',
secondCrumbs:'',
thirdCrumbs: '',
spu:'',
title:'',
description:'',
labelValue:'',
tags:[],
productFromUrl:[''],
sellPriceUs: '',
sellPriceCn: '',
freightPriceUs: '',
freightPriceCn: '',
stock:'',
radioVal:'',
deliveryTime:'7-14',
msrpPrice:'',
deliveryMin:'',
deliveryMax:'',
mainImageUrl:{},
variantImageUrls:[],
variantImageUrlsData:0,
colorArry:[],
colorCode:[],
typeCode:'',
typeSize:'',
sizeCode:[],
sizeCodeNew:[],
otherSizeCode:[],
customSize:[],
otherSizeCodeNew:[],
unitRespDTOList:[],
onlineUnitRespDTOList:[],
sourceType:0,
checkedImg:true,
formData: new FormData(),
stepsArr: [
{ title: '基本信息' },
{ title: window.location.host.indexOf('printwe.net')>0?'红茄信息':'智链互联信息' },
{ title: '运费设置' },
{ title: '价格和运送' },
{ title: '图片信息' },
{ title: '颜色信息' },
{ title: '尺寸信息' },
{ title: '变种信息' },
],
timer: false,
value: '',
dateArry:['5-10','7-14','10-15','14-21','21-28'],
radio:'',
typeArry:[],
tableData: [],
visibleParities:false,
paritiesVal:7,
tempUrl: '',
dataObj: this.$store.state.global.dataObj,
baseAli: this.$store.state.global.baseAli,
progress:0,
tableShow:true,
// 表数据
mulTableData: [],
// 表头数据
tableConfig: [],
treeData:[],
classificationId:'',
classificationType:'',
dialogVisible:false,
ids:[],
dialogVisibleReleased:false,
allShop:[],
shopAccount:[],
checkedCities:[],
publishDate:'',
command:'',
checkAll:false,
sizeType:true,
md5Key:'',
currentChangeType:'',
dialogVisiblePrice:false,
radio:'1',
editPriceAdd:'',
editPrice:'',
editStartTime:'',
editEndTime:'',
tableType:'',
dialogVisibleOnline:false,
dialogMessage:false,
shopName:'',
templateOptions: [],
templateValue: '',
templateTableData: [{
shop: '',
countrys: '未进行运输设置',
}],
dialogVisibleTemlate:false,
tableDataDetail:[],
tableDataAllDetail:[],
editId:'',
shopChoose:[],
saveload:true,
customInput:'',
isSizeChange:false,
syncFalse:false,
syncPollingVisible:false,
isColorClick:false,
modifyBatchCode:'',
pickerOptions: {
disabledDate: (time) => {
return time.getTime() < new Date(new Date - 1000 * 60 * 60 * 24).getTime()
},
},
sizeInput:'',
titleName:'更新至Wish',
indexHD:'',
jieziman:true
};
},
components:{
anchor,topCrumbs,dynamicTable,setTemplate,syncPollingTemplate
},
mounted() {
if(window.location.host.indexOf('printwe.net')>0){
this.jieziman=false
}else{
this.jieziman=true
}
this.getShopList()
this.id=this.$route.query.id||''
this.currentType=this.$route.query.currentType||1
this.firstCrumbs = 'Wish产品';
this.secondCrumbs = this.currentType == 1 ? '采集箱' : this.currentType == 2 ? '待发布' : this.currentType == 3 ? '在线产品' : '';
this.thirdCrumbs = this.id ? '编辑' : '创建';
if(this.id){
this.getEditData(this.id)
} else{
this.getTpye()
this.getTemplateList()
this.getTemplateEdit()
}
this.getClassify()
this.getColor()
if(this.currentType==2){
this.getTemplateList()
this.getTemplateEdit()
}
if(this.currentType==1){
this.stepsArr.splice(2,1)
}
if(this.currentType==3){
this.stepsArr.splice(2,2)
}
},
methods: {
deleteImgAllClick(){
this.unitRespDTOList.map((item)=>{
item.mainImageUrl=''
})
// this.$set(this.unitRespDTOList[index],'mainImageUrl','')
},
deleteImgClick(index){
this.$set(this.unitRespDTOList[index],'mainImageUrl','')
},
titleToUpperCase(str){
this.title=str.toLowerCase().replace(/( |^)[a-z]/g, (L) => L.toUpperCase());
},
clearSetClick(){
this.templateTableData[0].countrys='未进行运输设置'
this.tableDataDetail.map((item)=>{
item.type=1
})
},
handleShopChangeClick(val){
this.shopChoose=val
},
sureSaveClick(val){
this.dialogVisibleTemlate=false
let shopArry=[]
val.forEach((item)=>{
if(item.type!=1){
shopArry.push(item.countryName)
}
})
this.templateTableData[0].countrys=shopArry.join(',')||'未进行运输设置'
this.tableDataDetail=val
},
templateSelect(val){
if(val=='add'){
let routeData = this.$router.resolve({
name: "templateList",
});
window.open(routeData.href, '_blank');
}else{
this.editId=val
this.axios({
url: 'assistant/product/freightTemplate/findById',
data:{
productReleaseId:this.id,
id:val
},
method: "post"
}).then(res => {
if(res.success){
let shopArry=[]
res.module.details.forEach((item)=>{
if(item.type!=1){
shopArry.push(item.countryName)
}
})
this.templateTableData[0].countrys=shopArry.join(',')
this.tableDataDetail=res.module.details
this.tableDataAllDetail=res.module.details
}
})
}
},
getTemplateList(){
this.axios({
url: 'assistant/product/freightTemplate/query',
data:{
currentPage: 1,
pageSize: 1000,
},
method: "post"
}).then(res => {
if(res.success){
this.templateOptions=[]
res.module.result.map((item)=>{
if(item.isOpen){
this.templateOptions.push({value:item.id,label:item.name})
}
})
this.templateOptions.push({value:'add',label:'+添加运费模板'})
}
})
},
setTemplateClick(){
this.dialogVisibleTemlate=true
// this.getTemplateEdit()
},
getTemplateEdit(){
const{editId,id}=this
this.axios({
url: 'assistant/product/freightTemplate/findById',
data:{
productReleaseId:id,
id:editId
},
method: "post"
}).then(res => {
if(res.success){
this.tableDataDetail=res.module.details
this.tableDataAllDetail=res.module.details
let shopArry=[]
this.tableDataDetail.forEach((item)=>{
if(item.type!=1){
shopArry.push(item.countryName)
}
})
this.templateTableData[0].countrys=shopArry.join(',')||'未进行运输设置'
}
})
},
cancelTemplateClick(){
this.dialogVisibleTemlate=false
},
handleCheckAllChange(val) {
let newArry=[]
if(val){
this.shopAccount.map((item)=>{
newArry.push(item.id)
})
}
this.checkedCities=newArry
},
handleShopChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.shopAccount.length;
},
handleClick(command){
this.command=command
if(this.id){
if(this.currentType==1){
this.dialogVisibleReleased=true
}else{
if(command==1){
this.chooseShopClick()
}else{
this.dialogVisibleReleased=true
}
}
}else{
this.dialogVisibleReleased=true
}
},
chooseShopClick(){
const {id,checkedCities,currentType,command,spu,title,description,tags,classificationId,deliveryTime,productFromUrl,sellPriceUs,sellPriceCn,freightPriceUs,freightPriceCn,stock,msrpPrice,mainImageUrl,variantImageUrls,colorCode,typeCode,sizeCodeNew,unitRespDTOList,tableDataDetail}=this
if(!spu){
this.$message({
message: 'spu不能为空',
type: 'error'
})
return
}
this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
let url
if(id){
if(currentType==1){
if(command==1){
url='assistant/product/collectBox/updateAndPublish'
}else if(command==2){
url='assistant/product/collectBox/updateAndTimePublish'
}
}else if(currentType==2){
if(command==1){
url='assistant/product/release/updateAndPublish'
}else{
url='assistant/product/release/updateAndTimePublish'
}
}
if(command==3){
url='assistant/product/collectBox/updateAndWaitPublish'
}
}else{
if(command==1){
url='assistant/product/online/createAndPublish'
}else{
url='assistant/product/online/createAndTimePublish'
}
}
this.axios({
url,
data:{
id:id,
shopIds:JSON.stringify(checkedCities),
publishDate:this.publishDate,
spu,
title,
description,
classificationId,
tags:JSON.stringify(tags),
productFromUrl:JSON.stringify(productFromUrl),
sellPriceUs,
sellPriceCn,
freightPriceUs,
freightPriceCn,
stock,
deliveryTime,
msrpPrice,
mainImageUrl:JSON.stringify(mainImageUrl),
variantImageUrls:JSON.stringify(variantImageUrls),
colorCode:JSON.stringify(colorCode),
typeCode:typeCode,
sizeCode:JSON.stringify(sizeCodeNew),
unitRespDTOList:JSON.stringify(unitRespDTOList),
details:JSON.stringify(tableDataDetail),
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleReleased=false
if(command==3){
this.$message({
message: '操作成功',
type: 'success'
});
this.$router.push({name:'productList',query:{id:currentType}})
}else{
let data=res.module.checkResultRespDTO
if(data.checkResult){
this.publishDate=''
this.checkAll=false
this.checkedCities=[]
this.$message({
message: '操作成功',
type: 'success'
});
this.$router.push({name:'productList',query:{id:currentType}})
}else{
this.$message({
message: data.productInfos[0].errorReason,
type: 'error'
});
}
}
this.shopName=''
this.shopAccount=this.allShop
}
})
},
getShopList(){
this.shopAccount=[]
this.axios({
url: 'assistant/getShops',
data:{
agentName:'wish'
},
method: "post"
}).then(res => {
if(res.success){
res.module.map((item)=>{
this.allShop.push({name:item.authCode,id:item.id})
this.shopAccount.push({name:item.authCode,id:item.id})
})
}
})
},
getClassify(){
this.axios({
url: 'assistant/dictionary/getClassificationList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.treeData=res.module.dataTree
}
})
},
append(data) {
let id = 1000;
const newChild = { pid: '', label: '新分类',edit:true, children: [] };
if (!data.children) {
this.$set(data, 'children', []);
}
data.children.push(newChild);
},
edit(node,data){
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
this.$set(children[index],'edit',true)
},
remove(node, data) {
this.ids.push(data.pid)
const parent = node.parent;
const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id);
children.splice(index, 1);
},
SwitchNode(data,node){
this.classificationId=data.pid
this.classificationType=data.label
this.treeShow=false
},
sureTypeClick(){
const{treeData,ids}=this
this.axios({
url: 'assistant/dictionary/addClassification',
data:{
dataTree:JSON.stringify(treeData),
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.getClassify()
this.ids=[]
this.dialogVisible=false
}
})
},
getEditData(id){
this.axios({
url: 'assistant/product/edit',
data:{
seriesType:this.currentType,
id,
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.spu=data.spu
this.title=data.title
this.description=data.description
this.tags=data.tags
this.classificationId=data.classificationId
this.classificationType=data.classificationType
this.productFromUrl=data.productFromUrl.length==0?['']:data.productFromUrl
this.sellPriceUs=data.sellPriceUs
this.sellPriceCn=data.sellPriceCn
this.freightPriceUs=data.freightPriceUs
this.freightPriceCn=data.freightPriceCn
this.stock=data.stock
this.deliveryTime=data.deliveryTime
this.msrpPrice=data.msrpPrice
this.mainImageUrl=data.mainImageUrl
this.variantImageUrls=data.variantImageUrls
this.variantImageUrlsData=data.variantImageUrls.length
this.colorCode=data.colorCode
this.typeCode=data.typeCode
this.sizeCode=data.sizeCode
this.unitRespDTOList=data.unitRespDTOList
this.md5Key=data.md5Key
this.onlineUnitRespDTOList=data.unitRespDTOList
this.templateTableData[0].shop=data.shopCode
this.sourceType=data.sourceType
if (data.sizeCode){
this.tableShow = false;
data.sizeCode.forEach(size => {
this.otherSizeCode.push({name:size,code:size,value:'',isEdit:false})
});
this.customSize = this.otherSizeCode;
}
this.otherSizeCodeNew=data.sizeCode
console.log(this.otherSizeCodeNew)
}
this.getTpye()
})
},
getColor(){
this.axios({
url: 'assistant/info/get/colorList',
data:{},
method: "post"
}).then(res => {
if(res.success){
// this.colorArry=res.module
this.colorArry=res.module.map((item)=>{
return item= Object.assign({}, item, { isEdit:false})
})
}
})
},
getTpye(){
this.axios({
url: 'assistant/info/get/typeList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.typeArry=res.module
this.typeCode=this.typeCode?this.typeCode:res.module[0].code
this.getSize()
}
})
},
getSize(){
const{typeCode,id}=this
if(typeCode=='custom'){
this.otherSizeCodeNew = [];
this.otherSizeCode = this.customSize;
this.tableShow = false;
return;
}
this.axios({
url: 'assistant/info/get/sizeList',
data:{
parentCode:typeCode,
id
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.tableShow=data.table
if(data.table){
this.mulTableData=data.mulTableData
this.tableConfig=data.tableConfigs
}else{
this.otherSizeCodeNew=[]
this.otherSizeCodeNew=this.sizeCode
if(typeCode=='custom'){
if(data.data){
this.otherSizeCode=data.data.map((item)=>{
return item= Object.assign({}, item, { isEdit:false})
})
}else{
this.otherSizeCode=[]
}
}else{
this.otherSizeCode=data.data
}
}
}
})
},
customEditClick(index,type){
if(type==1){
this.colorArry.map((item,indexItem)=>{
if(indexItem==index){
item.isEdit=!item.isEdit
}
})
}else{
this.otherSizeCode.map((item,indexItem)=>{
if(indexItem==index){
item.isEdit=!item.isEdit
}
})
this.customSize = this.otherSizeCode;
}
},
customDelClick(index,type){
if(type==1){
this.colorArry=this.colorArry.filter((item,indexItem)=>{
return indexItem!=index
})
}else{
this.otherSizeCode=this.otherSizeCode.filter((item,indexItem)=>{
return indexItem!=index
})
this.customSize = this.otherSizeCode;
}
},
addClick(type){
const{customInput,sizeInput}=this
if(type==1){
this.axios({
url: 'assistant/product/checkColor',
data:{
code:this.sizeInput
},
method: "post"
}).then(res => {
if(res.success&&res.module == true){
this.colorArry.push({name:sizeInput,code:sizeInput,value:'',isEdit:false,customColors:true});
this.sizeInput = '';
this.isColorClick = false;
}else {
this.isColorClick = true;
}
})
}else{
this.otherSizeCode.push({name:customInput,code:customInput,value:'',isEdit:false})
this.customSize = this.otherSizeCode;
}
},
removeClick(index){
this.unitRespDTOList.splice(index,1)
},
closeSync(val){
this.syncPollingVisible=val;
this.modifyBatchCode='';
// location.reload();
},
saveAllClick(){
const{id,checkedCities,spu,title,description,tags,classificationId,deliveryTime,productFromUrl,sellPriceUs,sellPriceCn,freightPriceUs,freightPriceCn,stock,msrpPrice,mainImageUrl,variantImageUrls,colorCode,typeCode,sizeCodeNew,otherSizeCodeNew,unitRespDTOList,currentType,md5Key,tableDataDetail}=this
console.log(unitRespDTOList)
if(!spu){
this.$message({
message: 'spu不能为空~',
type: 'error'
});
return
}
if(tags.length<2){
this.$message({
message: '标签数不能小于2个',
type: 'error'
});
return
}
if(!description){
this.$message({
message: '描述不能为空',
type: 'error'
});
return
}
if(currentType==3){
// this.dialogVisibleOnline=true
this.dialogMessage=false
this.syncFalse=false
}
let url
if(id){
if(currentType==1){
url='assistant/product/collectBox/updateAndSave'
}else if(currentType==2){
url='assistant/product/release/updateAndSave'
}else{
url='assistant/product/online/updateAndModify'
}
}else{
url='assistant/product/online/createAndSave'
}
if(this.saveload){
this.saveload=false
this.axios({
url,
data:{
id,
shopIds:JSON.stringify(checkedCities),
spu,
title,
description,
classificationId,
tags:JSON.stringify(tags),
productFromUrl:JSON.stringify(productFromUrl),
sellPriceUs,
sellPriceCn,
freightPriceUs,
freightPriceCn,
stock,
deliveryTime,
msrpPrice,
mainImageUrl:JSON.stringify(mainImageUrl),
variantImageUrls:JSON.stringify(variantImageUrls),
colorCode:JSON.stringify(colorCode),
typeCode:typeCode,
sizeCode:JSON.stringify(sizeCodeNew.length>0?sizeCodeNew:otherSizeCodeNew),
unitRespDTOList:JSON.stringify(unitRespDTOList),
MD5Key:md5Key,
details:JSON.stringify(tableDataDetail),
},
method: "post"
}).then(res => {
if(res.success){
if(currentType==3&&id){
this.dialogMessage=true
this.modifyBatchCode=res.module.batchCode
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
}else{
this.$message({
message: '保存成功',
type: 'success'
});
this.$router.push({name:'productList',query:{id:currentType}})
}
this.saveload=true
}else{
if(currentType==3){
this.syncFalse=true
}
this.saveload=true
}
})
}
},
addLabel(){
this.tags.push(this.labelValue)
this.labelValue=''
},
deleteLabel(index){
this.tags.splice(index,1)
},
addSource(){
this.productFromUrl.push('')
},
removeSource(index){
this.productFromUrl.splice(index,1)
},
chooseDataClick(val){
this.radioVal=val
},
getCurrentDate(val){
this.deliveryMin=val.match(/(\S*)-/)[1]
this.deliveryMax=val.match(/-(\S*)/)[1]
this.deliveryTime=val
this.visible=false
},
sureDateClick(){
if(this.radioVal&&(!this.deliveryMin||!this.deliveryMax)){
this.$message({
message:'运送时间不能为空~',
type:'error'
})
return
}
this.deliveryTime=this.deliveryMin+'-'+this.deliveryMax
this.visible=false
},
removeImgClick(index){
this.variantImageUrls.splice(index,1)
this.variantImageUrlsData -= 1;
},
setHDClick(index){
this.indexHD=index
let i=0;
if(index==100){
this.$set(this.mainImageUrl,'hd',true)
for (i = 0; i < this.variantImageUrls.length; i++) {
this.$set(this.variantImageUrls[i],'hd',false)
}
}else{
for (i = 0; i < this.variantImageUrls.length; i++) {
if(i == index){
this.$set(this.variantImageUrls[i],'hd',true)
}else{
this.$set(this.variantImageUrls[i],'hd',false)
}
}
this.$set(this.mainImageUrl,'hd',false)
}
},
setMainPhotoClick(index){
let newPhoto= this.mainImageUrl
this.mainImageUrl=this.variantImageUrls[index]
this.variantImageUrls.splice(index,1,newPhoto)
},
beforeAvatarUpload(file) {
let isUpload=true
if(this.variantImageUrls.length>=20){
this.$message.error('图片最多上传20张~')
isUpload=false
}
return isUpload;
},
handleExceed(files, fileList) {
this.$message.error(`图片最多上传20张`);
},
uploadFile(file,index,isList) {
const that = this
const tmpcnt = file.file.name.lastIndexOf(".")
const exname = file.file.name.substring(tmpcnt + 1)
const names = ['jpg', 'jpeg', 'webp', 'png','bmp']
if(names.indexOf(exname)< 0 ){
this.$message.error("不支持的格式!")
return
}
async function multipartUpload () {
const fileName = 'cloudStorage/' + file.file.uid
util.client(that.dataObj).put(fileName, file.file,
{
progress:function (p) {
that.progress = p*100
},
}).then(
result => {
// x-oss-process=image/resize,m_lfit,h_100,w_100
// that.tempUrl = 'http://'+result.bucket+'.'+that.baseAli+ '/' + result.name
that.tempUrl=result.url
if(isList==1){
// let width
// let height
// const _URL = window.URL || window.webkitURL;
// const img = new Image();
// img.onload = () => {
// width=img.width
// height=img.height
let objImg={url:that.tempUrl,width:200,height:200,hd:false}
if(JSON.stringify(that.mainImageUrl) == "{}"){
that.mainImageUrl=Object.assign({},that.mainImageUrl,objImg)
}else{
that.variantImageUrls.push(objImg)
}
// };
// img.src = _URL.createObjectURL(file.file)
}else{
that.$set(that.unitRespDTOList[index],'mainImageUrl',that.tempUrl)
}
}).catch(err => {
console.log("err:",err)
})
}
multipartUpload ()
},
handleCheckedCitiesChange(value){
this.colorCode=value
this.createProduct()
},
handleSizeChange(val){
this.sizeCodeNew=[]
this.sizeCode=[]
// if(this.isSizeChange){
// this.otherSizeCodeNew.splice(0,this.otherSizeCodeNew.length-1)
// this.isSizeChange=false
// }
console.log(this.otherSizeCodeNew)
this.createProduct()
},
handleSelectionChange(val) {
if(this.isSizeChange){
this.sizeCode=[]
}
this.sizeCodeNew=val.map((item=>{
return item.Type
}))
setTimeout(() => {
this.createProduct()
}, 1000);
this.otherSizeCodeNew=[]
},
createProduct(){
this.deliveryMin=this.deliveryTime&&this.deliveryTime.match(/(\S*)-/)[1]
this.deliveryMax=this.deliveryTime&&this.deliveryTime.match(/-(\S*)/)[1]
const{colorCode,sizeCodeNew,otherSizeCodeNew,spu,msrpPrice,sellPriceUs,sellPriceCn,stock,deliveryMin,deliveryMax,currentType,onlineUnitRespDTOList,isSizeChange}=this
let onlineLength=onlineUnitRespDTOList.length
let finallySizeCode=sizeCodeNew.length==0?otherSizeCodeNew:sizeCodeNew
let newUnitRespDTOListArry=[]
let colorLength=this.colorCode.length
let sizeLength=finallySizeCode.length
if(colorLength>0&&sizeLength>0){
colorCode.map((item)=>{
finallySizeCode.map((childItem)=>{
newUnitRespDTOListArry.push({sku:'',sizeCode:childItem,colorCode:item,sysSize:childItem,sysColor:item,msrpPrice,sellPriceUs,sellPriceCn,stock,deliveryMin,deliveryMax})
})
})
if(!isSizeChange){
onlineUnitRespDTOList.map((onlineItem)=>{
newUnitRespDTOListArry.map((newItem,index)=>{
if(onlineItem.sizeCode==newItem.sizeCode&&onlineItem.colorCode==newItem.colorCode){
this.$set(newUnitRespDTOListArry,index,onlineItem)
// console.log(onlineItem)
}
})
})
}
}
if(colorLength>0&&sizeLength==0){
colorCode.map((item)=>{
newUnitRespDTOListArry.push({sku:'',sizeCode:'',colorCode:item,sysSize:'',sysColor:item,msrpPrice,sellPriceUs,sellPriceCn,stock,deliveryMin,deliveryMax})
})
if(!isSizeChange){
onlineUnitRespDTOList.map((onlineItem)=>{
newUnitRespDTOListArry.map((newItem,index)=>{
if(onlineItem.colorCode==newItem.colorCode){
this.$set(newUnitRespDTOListArry,index,onlineItem)
}
})
})
}
}
if(colorLength==0&&sizeLength>0){
finallySizeCode.map((item)=>{
newUnitRespDTOListArry.push({sku:'',sizeCode:item,colorCode:'',sysSize:item,sysColor:'',msrpPrice,sellPriceUs,sellPriceCn,stock,deliveryMin,deliveryMax})
})
if(!isSizeChange){
onlineUnitRespDTOList.map((onlineItem)=>{
newUnitRespDTOListArry.map((newItem,index)=>{
if(onlineItem.sizeCode==newItem.sizeCode){
this.$set(newUnitRespDTOListArry,index,onlineItem)
}
})
})
}
}
if(currentType==3){
newUnitRespDTOListArry=newUnitRespDTOListArry.map((item)=>{
return Object.assign({},item,{msrpPrice:onlineLength>0?onlineUnitRespDTOList[0].msrpPrice:msrpPrice,sellPriceUs:onlineLength>0?onlineUnitRespDTOList[0].sellPriceUs:sellPriceUs,sellPriceCn:onlineLength>0?onlineUnitRespDTOList[0].sellPriceCn:sellPriceCn,stock:onlineLength>0?onlineUnitRespDTOList[0].stock:stock,deliveryMin:onlineLength>0?onlineUnitRespDTOList[0].deliveryMin:deliveryMin,deliveryMax:onlineLength>0?onlineUnitRespDTOList[0].deliveryMax:deliveryMax,remove:true})
})
this.unitRespDTOList=onlineUnitRespDTOList.concat(newUnitRespDTOListArry)
}else{
this.unitRespDTOList.map((item,index)=>{
if(index<newUnitRespDTOListArry.length){
this.$set(newUnitRespDTOListArry[index],'sku',item.sku)
}
})
this.unitRespDTOList=newUnitRespDTOListArry
}
},
updateDataClick(type){
this.tableType=type
this.changeCurrentType(type)
},
changeCurrentType(type){
const {unitRespDTOList,radio,editPrice,editPriceAdd,editStartTime,editEndTime,tableType,currentType,msrpPrice,sellPriceUs,sellPriceCn,stock,deliveryMin,deliveryMax}=this
if(currentType==3){
this.dialogVisiblePrice=true
}else{
this.dialogVisiblePrice=false
}
unitRespDTOList.map((item)=>{
switch (type) {
case 'msrpPrice':
if(currentType!=3){
this.$set(item,type,msrpPrice)
}else{
if(radio==1){
this.$set(item,type,item.msrpPrice+editPriceAdd*1)
}else{
this.$set(item,type,editPrice)
}
}
break;
case 'sellPriceUs':
if(currentType!=3){
this.$set(item,type,sellPriceUs)
}else{
if(radio==1){
this.$set(item,type,item.sellPriceUs+editPriceAdd*1)
}else{
this.$set(item,type,editPrice)
}
}
break;
case 'sellPriceCn':
if(currentType!=3){
this.$set(item,type,sellPriceCn)
}else{
if(radio==1){
this.$set(item,type,item.sellPriceCn+editPriceAdd*1)
}else{
this.$set(item,type,editPrice)
}
}
break;
case 'stock':
if(currentType!=3){
this.$set(item,type,stock)
}else{
if(radio==1){
this.$set(item,type,item.stock+editPriceAdd*1)
}else{
this.$set(item,type,editPrice)
}
}
break;
case 'deliveryMin':
if(currentType!=3){
this.$set(item,type,deliveryMin)
this.$set(item,'deliveryMax',deliveryMax)
}else{
this.currentChangeType='deliveryTime'
this.$set(item,type,editStartTime)
this.$set(item,'deliveryMax',editEndTime)
}
break;
default:
break;
}
})
this.editPriceAdd=''
this.editPrice=''
},
sureChangePrice(){
const {tableType}=this
this.changeCurrentType(tableType)
this.currentChangeType=''
this.dialogVisiblePrice=false
},
cancelClick(){
this.currentChangeType=''
this.dialogVisiblePrice=false
},
generationClick(){
const {spu,unitRespDTOList} = this
if(spu==''){
this.$message.error("错误:SPU为空,无法使用一键生成!")
return
}else{
unitRespDTOList.map((item)=>{
this.$set(item,'sku',spu+'-'+item.sizeCode+'-'+item.colorCode)
})
}
},
chooseSize(val){
if(this.typeCode!=val){
this.isSizeChange=true
}else{
this.isSizeChange=false
}
this.typeCode=val
this.getSize()
},
clearUnitRespDTOListClick(){
this.colorCode=[]
this.sizeCodeNew=[]
this.sizeCode=[]
this.unitRespDTOList=[]
if(this.tableShow){
this.tableShow=false
setTimeout(() => {
this.tableShow=true
this.$message({
message: '清空变种信息成功',
type: 'success'
});
}, 1000);
}
},
downZipClick(){
this.axios({
url: 'assistant/product/imageUrlsDownload',
data:{
seriesType:this.currentType,
productSeriesId:this.id
},
method: "post"
}).then(res => {
if(res.success){
window.location.href=res.module.zipFileUrl
}
})
},
visitUrlClick(url){
window.open(url);
},
handleClickUpDown(command){
if(command==1){
this.unitRespDTOList.map((item)=>{
item.ifShelf=true
})
}else{
this.unitRespDTOList.map((item)=>{
item.ifShelf=false
})
}
},
searchShopClick(val){
console.log(val)
let shopArry=[]
console.log(this.allShop)
this.allShop.map((item)=>{
if(item.name.indexOf(val)>-1){
shopArry.push(item)
}
})
this.shopAccount=shopArry
},
translationClick(val){
const{id,title,description,tags}=this
this.axios({
url: 'assistant/info/get/translate',
data:{
id,
title,
description,
tags:JSON.stringify(tags),
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.titleToUpperCase(data.title)
this.description=data.description
this.tags=data.tags
}
})
},
checkColorClick(val,index){
this.axios({
url: 'assistant/product/checkColor',
data:{
code:val
},
method: "post"
}).then(res => {
if(res.success&&res.module != true){
this.$message({
message: '请务必按要求添加!双色支持格式:black&white;单色请参考:wish官方颜色列表',
type: 'error'
});
this.$set(this.unitRespDTOList[index],'colorCode','')
}
})
},
priceChangeClick(type){
const{paritiesVal}=this
if(type==1){
this.unitRespDTOList.map((item)=>{
this.$set(item,'sellPriceCn',this.fomatFloat(item.sellPriceUs*paritiesVal))
})
}else if(type==2){
this.unitRespDTOList.map((item)=>{
this.$set(item,'sellPriceUs',this.fomatFloat(item.sellPriceCn/paritiesVal))
})
}else if(type==3){
this.sellPriceCn=this.fomatFloat(this.sellPriceUs*paritiesVal)
this.freightPriceCn=this.fomatFloat(this.freightPriceUs*paritiesVal)
}else{
this.sellPriceUs=this.fomatFloat(this.sellPriceCn/paritiesVal)
this.freightPriceUs=this.fomatFloat(this.freightPriceCn/paritiesVal)
}
},
fomatFloat(src){
return Math.round(src*Math.pow(10,2))/Math.pow(10,2);
}
}
}
</script>
<style scoped lang="less">
.shop-list{
display:flex;
margin:20px 5px;
flex-wrap:wrap;
justify-content:space-between;
max-height:300px;
overflow:auto;
clear:both;
.current-shop{
width:120px;
overflow:auto
}
}
.add-type{
color: #61BD50;
font-size: 18px;
font-weight: 1000;
}
.delete-type{
color:#EC5947
}
.edit-type{
color:#137ABF
}
.contain-page{
.label-show{
border: 1px solid#DCDFE6;
padding: 3px 10px;
border-radius: 4px;
.label-input{
height: 30px;
width: 100%;
border: none;
margin-top: 5px;
}
.label-tags{
margin-right: 3px;
margin-bottom: 3px;
padding: 6px;
display: block;
background-color: #5bc0de;
float: left!important;
font-weight: 700;
line-height: 1;
color: #fff;
text-align: center;
white-space: nowrap;
border-radius: .25em;
}
}
.btn-orange {
border-color: #f96;
font-size: 13px;
color: #fff;
background-color: #f96;
}
.product-info-module{
clear: both;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
.product-info-module-tab{
padding: 10px;
border-bottom: 1px solid #eee;
color: #434649;
background-color: #eee;
}
.product-info-module-tab2{
padding: 30px;
border-bottom: 1px solid #eee;
color: #434649;
background-color: #eee;
font-size: 15px;
font-weight:bold;
text-align: center;
}
.product-info-module-content {
padding-bottom: 20px;
padding: 10px;
width:100%;
overflow:auto;
.tree-select{
width:240px;
height:34px;
border:1px solid #ccc;
border-radius:4px;
padding: 6px 12px;
}
.tree-data{
position: absolute;
top: 34px;
z-index: 2;
border: 1px solid #eee;
min-width:240px;
max-height:350px;
overflow:auto;
}
table{
width:100%
}
table td {
padding: 10px 0;
font-size: 13px;
}
table td:first-child {
width: 90px;
min-width: 90px;
padding-right: 10px;
max-width: 100px;
text-align: right;
box-sizing: content-box;
}
table td:last-child {
text-align: left;
width: 750px;
display: flex;
align-items: center;
}
.mainImage-Url{
width:54px;
height:54px;
}
.noCss{
padding: 3px 6px;
min-width: 90px;
margin: 0 20px 10px 0;
border: 1px solid #09f;
border-radius: 4px;
text-align: center;
display:inline-block;
background-color: #fff;
color: #367EE2;
border-color: #fff;
box-shadow: none;
cursor:pointer;
}
.btn-size{
padding: 3px 6px;
min-width: 90px;
margin: 0 20px 10px 0;
background-color: #09f;
border: 1px solid #09f;
color: #fff;
border-radius: 4px;
text-align: center;
display:inline-block;
cursor:pointer;
}
.cny-price{
width: 170px;
text-align: right;
display: inline-block;
}
.choose-data{
background-color: #eee;
min-width: 120px;
}
.icon-edit{
position: absolute;
margin: 7px 0 0 5px;
}
.no-flex{
display: block!important;
width: 900px!important;
}
.background-mainPhoto{
background: url(../../assets/img/masterImg.png) repeat-x;
position: relative;
width: 278px;
height: 278px;
display: inline-block;
background-color: white;
border-bottom: 1px solid #cccccc;
}
.main-hd{
position: absolute;
bottom: 0;
width: 100%;
border:1px solid#cccccc;
height: 20px;
left: 0;
text-align: left;
}
.imgCss {
width: auto;
height: auto;
max-width: 100%;
max-height:100%;
padding: 1px;
margin: auto;
top: 0;
bottom: 0px;
left: 0;
right: 0;
position: absolute;
}
.img-remark{
background-color: #009999;
width: 54px;
color: #fff;
display: inline-block;
text-align: center;
margin-top: 30px;
}
.img-td{
text-align: left!important;
width: 900px!important;
display: flex!important;
align-items: center!important;
flex-wrap: wrap!important;
}
.opera-span{
color: #367EE2;
padding: 0 10px;
cursor: pointer;
}
.sku-length{
width: 300px;
}
.img-show{
display: flex;
flex-wrap: wrap;
margin-top: 10px;
}
.picture-show{
// display: flex;
// justify-content: space-between;
width: 100%;
// align-items: center;
}
.imgDivOut {
clear: both;
position: relative;
width: 122px;
height: auto;
margin-bottom: 0;
background-color: white;
margin: 5px 10px 5px 0;
.img-border{
position: relative;
width: 120px;
height: 120px;
background-color: white;
border: 1px solid #cccccc;
.imgSize {
position: absolute;
bottom: 0;
min-height: 20px;
width: 119px;
color: #fff;
background-color: rgba(0,0,0,.2);
line-height:20px;
}
}
.imgDivIn {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
padding: 1px;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
position: absolute;
background-color: white;
}
.imgDivDown {
font-size: 13px;
color: #4B60A8;
padding-left: 2px;
padding-right: 2px;
width: 120px;
border: 1px solid #ccc;
border-top: none;
padding: 2px;
text-align:right;
display:flex;
justify-content:space-between;
}
.remove-img{
float: right;
color: #4B60A8;
}
}
}
}
}
.choose-send-time{
padding: 10px;
background-color: #eee;
}
.date-button{
margin: 20px 7px;
}
.checkbox-color{
border: 1px solid #ddd;
padding: 3px 21px;
color:#fff;
margin-bottom: 10px;
}
.color-ful{
background: url(../../assets/img/colorful.png) repeat-y;
}
.g0{
color:#000;
}
.checkbox-flex{
display: flex;
flex-wrap: wrap;
// justify-content:space-between;
}
.checkbox-width{
width:250px;
margin-bottom:10px;
}
.parities-change{
line-height:30px;
color:#333;
margin:auto;
text-align:center;
}
.modal-price{
display: flex;
justify-content: space-between;
align-items: center;
}
.el-dropdown-link {
cursor: pointer;
color: #367EE2;
font-size: 13px;
}
</style>
<template>
<div class="content-height">
<div class="myorder-content">
<leftMenu ref="leftMenu"></leftMenu>
<div class="content-right">
<div class="content-top">
<topCrumbs :firstCrumbs="firstCrumbs" :secondCrumbs="secondCrumbs" :thirdCrumbs="thirdCrumbs"></topCrumbs>
<div>
<div class="container-o-box default">
<div class="com-block m-bottom10">
<div class="content search-tab p10 p-top5">
<table>
<tbody>
<tr v-if="currentType!=1">
<td class="p-right0 gray-c">账号:</td>
<td class="account-list">
<a v-for="item in dataAccount" :key="item.name" :class="listParams.authId==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,1)" >{{item.name}}</a>
</td>
</tr>
<tr>
<td class="p-right0 gray-c">搜索类型:</td>
<td>
<a v-for="item in dataType" :key="item.name" :class="activeType==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,2)" >{{item.name}}</a>
</td>
</tr>
<tr>
<td class="p-right0 gray-c">搜索内容:</td>
<td class="tab-separate search-value">
<div class="productSearchGroup">
<input class="form-control" style="width:460px;" type="text" v-model="searchContent">
<button class="btn btn-primary" style="width:52px;" @click="searchActive('',3)">搜索</button>
</div>
</td>
</tr>
<tr v-if="currentType==3">
<td class="p-right0 gray-c">审核状态:</td>
<td>
<el-checkbox-group v-model="checkBoxData" @change="searchActive('',4)">
<el-checkbox label="0">审核中</el-checkbox>
<el-checkbox label="1">已审核</el-checkbox>
<el-checkbox label="2">被拒绝</el-checkbox>
</el-checkbox-group>
</td>
</tr>
<tr v-if="currentType==3">
<td class="p-right0 gray-c">销售类型:</td>
<td class="account-list">
<a v-for="item in dataSalesType" :key="item.name" :class="listParams.promoted==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,6)" >{{item.name}}</a>
</td>
</tr>
<tr>
<td class="p-right0 gray-c border-dashed-top1">排序类型:</td>
<td class="crawl-date border-dashed-top1">
<a v-for="item in dataTime" :key="item.name" :class="listParams.orderType==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,5)" >{{item.name}}
<i class="fa fa-sort-desc " v-if="item.id==listParams.orderType&&!listParams.isAsc"/>
<i class="fa fa-sort-up tp24" v-if="item.id==listParams.orderType&&listParams.isAsc"/></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="content-button">
<div>
<el-dropdown v-if="listParams.publishStatus!=1" @command="handleClickBatch">
<el-button type="primary">
批量操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="4" v-if="$_has('delete')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">批量删除</el-dropdown-item>
<el-dropdown-item command="3" v-if="currentType==1&&currentName!='定时发布'&&$_has('publishP')">批量移入待发布</el-dropdown-item>
<el-dropdown-item command="1" v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">批量立即发布</el-dropdown-item>
<el-dropdown-item command="2" v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">批量定时发布</el-dropdown-item>
<el-tooltip effect="light" :content="batchModify" placement="top">
<el-dropdown-item command="5" divided v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改价格(USD)</el-dropdown-item>
</el-tooltip>
<el-dropdown-item command="6" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改本地价格</el-dropdown-item>
<el-dropdown-item command="8" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改库存</el-dropdown-item>
<el-dropdown-item command="9" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改运送时间</el-dropdown-item>
<el-dropdown-item command="10" v-if="currentType==3&&currentName!='定时发布'&&$_has('standUD')&&listParams.upShelfStatus==1">批量下架</el-dropdown-item>
<el-dropdown-item command="13" v-if="currentType==3&&currentName!='定时发布'&&$_has('standUD')&&listParams.upShelfStatus==0">批量上架</el-dropdown-item>
<el-dropdown-item command="11" v-if="currentName=='定时发布'&&$_has('edit')">批量取消定时</el-dropdown-item>
<el-dropdown-item command="12" v-if="currentType==3&&$_has('add')">运输设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-dropdown v-if="currentType!=1">
<el-button type="primary">
移动分类<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>所有分类</el-dropdown-item>
<el-dropdown-item>未分类</el-dropdown-item>
<el-dropdown-item>卫衣</el-dropdown-item>
<el-dropdown-item>夹克</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<div class="tree-type" v-if="currentType!=1&&listParams.publishStatus!=1&&listParams.publishStatus!=4">
<div class="tree-select poi" @click="treeShow=!treeShow">移动分类<i class="el-icon-arrow-down ml5"/></div>
<div class="tree-data" v-if="treeShow">
<el-tree
:data="treeData"
node-key="id"
ref="tree"
highlight-current
@current-change="SwitchNode"
>
</el-tree>
</div>
</div>
</div>
<div>
<button class="btn btn-primary" v-if="currentType==1&&hasDataBtn" @click="goIndex">采集数据</button>
<button class="btn btn-primary m-left10" @click="editClick('')" v-if="$_has('add')">创建产品</button>
<el-dropdown v-if="currentType==3&&$_has('syncP')" @command="handleProductClick">
<el-button type="primary">
同步产品<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">同步单个产品</el-dropdown-item>
<el-dropdown-item command="2">同步选中产品</el-dropdown-item>
<el-dropdown-item command="3">同步国家运费</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div :class="listParams.upShelfStatus==item.id?'item-collection':'item-collection-white'" v-for="item in dataTabList" :key="item.name" @click="chooseTabs(item.id)" v-if="currentType==3">{{item.name}}({{item.number}})</div>
<div class="pull-right">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="listParams.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParams.total"
style="float:right;display:inline-block"
></el-pagination>
</div>
<div class="tab-content border5 m-bottom10">
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
border
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="30">
</el-table-column>
<el-table-column
align="center"
label="图片"
width="75">
<template slot-scope="scope">
<img :src="scope.row.mainImageUrl" class="imgCss"/>
<div class="tl">
<span>来源</span>
<a class="el-dropdown-link" :href="scope.row.productFromUrl" target="_blank">{{scope.row.productFromCode}}</a>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
:label="currentType!=3?'标题':'标题/产品ID'"
width="180"
>
<template slot-scope="scope">
<div>
<el-tooltip effect="light" :content="scope.row.title" placement="top">
<div class="tl break-two" style="width:140px">{{scope.row.title}}</div>
</el-tooltip>
<div v-if="scope.row.remark" class="g19 tl mb5">备注:{{scope.row.remark}}</div>
<div v-if="scope.row.msg" class="g19 tl mb5">消息:{{scope.row.msg}}</div>
<el-popover
placement="top-start"
trigger="hover"
width="50"
v-if='scope.row.platformProductId'
>
<el-button type="primary" size="mini" @click="copyUrl(scope.row.platformProductId)">复制</el-button>
<div slot="reference" class="f-blue tl mb5" @click="openNewUrl(scope.row.productOnlineUrl)">{{scope.row.platformProductId}}</div>
</el-popover>
<span v-if='scope.row.auditStatus' class="audit-status tl mb5">{{scope.row.auditStatus}}</span>
<span v-if='scope.row.authCode' class="gray-nine tl mb5">{{scope.row.authCode}}</span>
<span v-if='scope.row.ratings' class="f-blue tl mb5">评分:{{scope.row.ratings}}</span>
<div v-if="scope.row.errorMsg" class="error-message p5">{{scope.row.errorMsg}}</div>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="描述"
width="150"
v-if="currentType==1"
>
<template slot-scope="scope">
<el-tooltip effect="light" :content="scope.row.description" placement="top">
<span class="el-dropdown-link break-two" style="width:150px">{{scope.row.description}}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
prop="collectCounts"
label="收藏"
align="center"
v-if="currentType==3"
width="50"
>
</el-table-column>
<el-table-column
prop="sellCounts"
label="出售"
align="center"
v-if="currentType==3"
width="50"
>
</el-table-column>
<el-table-column
prop="spu"
label="SPU名"
align="center"
>
</el-table-column>
<el-table-column
v-if="currentType==2||currentType==3"
align="center"
:width="currentType==2?520:420">
<template slot="header" slot-scope="scope">
<div class="custom-table-title">
<span>SKU</span>
<span>价格(USD)</span>
<span>本地价格</span>
<span>库存</span>
<span v-if="currentType==2">运费($)</span>
</div>
</template>
<template slot-scope="scope">
<div :class="currentIndex===scope.$index?'control-heightOpen':'control-heightUp'">
<div v-for="(item,indexTable) in scope.row.unitRespDTOS" :key="item.id" class="custom-table">
<span>{{item.sku}}<i class="gc f12" v-if="!item.ifShelf&&currentType==3&&listParams.upShelfStatus">(下架)</i></span>
<el-popover
placement="bottom"
width="160"
v-model="item.visiblea">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.sellPriceUs" :ref="'playBtna'+scope.$index+indexTable">
<div class="tl"><el-checkbox v-model="item.moneyChangeVal"><span class="f12">USD 转换 CNY</span></el-checkbox></div>
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`a${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'a',item.moneyChangeVal)">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'a')">取消</button>
</div>
<span slot="reference">{{item.sellPriceUs}}</span>
</el-popover>
<el-popover
placement="bottom"
width="160"
v-model="item.visibleb">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.sellPriceCn" :ref="'playBtnb'+scope.$index+indexTable">
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`b${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'b')">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'b')">取消</button>
</div>
<span slot="reference">{{item.sellPriceCn}}</span>
</el-popover>
<el-popover
placement="bottom"
width="160"
v-model="item.visiblec">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.stock" :ref="'playBtnc'+scope.$index+indexTable">
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`c${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'c')">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'c')">取消</button>
</div>
<span slot="reference">{{item.stock}}</span>
</el-popover>
<el-popover
v-if="currentType==2"
placement="bottom"
width="160"
v-model="item.visibled">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.freightPrice" :ref="'playBtnd'+scope.$index+indexTable">
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`d${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'d')">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'d')">取消</button>
</div>
<span slot="reference">{{item.freightPrice}}</span>
</el-popover>
</div>
</div>
<div v-if="scope.row.unitRespDTOS&&scope.row.unitRespDTOS.length>2">
<div class="unfold-show" @click="unfoldClick(scope.$index,scope.row.unfold,scope.row.id)" v-if="currentIndex!==scope.$index">+ 展开</div>
<div class="unfold-show" v-else @click="closeClick(scope.$index)">- 收起</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="freightPrice"
label="运费"
align="center"
v-if="currentType==3"
width="50"
>
<template slot-scope="scope">
<div class="tl">
<span>USD: {{scope.row.freightPrice}}</span>
</div>
<div class="tl">
<span>CNY: {{scope.row.freightPriceCn}}</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="sellPriceUs"
label="售价(USD)"
align="center"
v-if="currentType==1"
>
</el-table-column>
<el-table-column
prop="sellPriceCn"
label="本地价格"
align="center"
v-if="currentType==1"
>
</el-table-column>
<el-table-column
prop="stock"
label="库存"
align="center"
v-if="currentType==1"
>
</el-table-column>
<el-table-column
label="时间"
width="130"
align="center"
>
<template slot-scope="scope">
<div class="tl gray-nine">创建</div>
<div class="tl">{{scope.row.createDate}}</div>
<div class="tl gray-nine">更新</div>
<div class="tl">{{scope.row.modifyDate}}</div>
</template>
</el-table-column>
<el-table-column
label="操作"
width="70"
>
<template slot-scope="scope">
<div class="el-dropdown-link" v-if="currentType==1&&$_has('publishP')" @click="moveWaitRelease(scope.row.id,3)">移入待发布</div>
<div class="el-dropdown-link" @click="editClick(scope.row.spuId)" v-if="currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">编辑</div>
<div class="el-dropdown-link" @click="synchronizationClick(scope.row.id,1)" v-if="currentType==3&&$_has('syncP')">同步</div>
<div v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">
<el-dropdown @command="(command)=>handleClick(command,scope.row.id)">
<span class="el-dropdown-link">
发布<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='1'>立即发布</el-dropdown-item>
<el-dropdown-item command='2'>定时发布</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="el-dropdown-link" @click="cancelSetTimeClick(scope.row.id)" v-if="currentName=='定时发布'&&$_has('publishP')">取消定时</div>
<div v-if="listParams.publishStatus!=1&&listParams.publishStatus!=4">
<el-dropdown>
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="copyProdect(scope.row.id)" v-if="currentType==3&&$_has('add')">复制为新产品</el-dropdown-item>
<el-dropdown-item @click.native="downProdect(scope.row.id)" v-if="currentType==3&&$_has('standUD')&&listParams.upShelfStatus==1">下架</el-dropdown-item>
<el-dropdown-item @click.native="upProdect(scope.row.id)" v-if="currentType==3&&$_has('standUD')&&listParams.upShelfStatus==0">上架</el-dropdown-item>
<el-dropdown-item @click.native="gotoBinding(scope.row)" v-if="currentType==3">绑定系统产品</el-dropdown-item>
<el-dropdown-item @click.native="addRemark(scope.row.id)" v-if="$_has('add')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">添加备注</el-dropdown-item>
<el-dropdown-item @click.native="deleteProdect(scope.row.id)" v-if="$_has('delete')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">删除</el-dropdown-item>
<el-dropdown-item @click.native="freightSet(scope.row.id)" v-if="currentType==3&&$_has('add')">运费设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="pull-right">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="listParams.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParams.total"
style="float:right;display:inline-block"
></el-pagination>
</div>
</div>
</div>
</div>
</div>
<el-dialog
title="发布"
:visible.sync="dialogVisibleReleased"
width="50%"
@close="dialogVisibleReleased = false">
<div v-if="currentType!=2">
<span>选择Wish店铺:</span>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<el-input
@input="searchShopClick"
size="mini"
style="width:200px;float:right"
placeholder="请输入店铺名称"
suffix-icon="el-icon-search"
v-model="shopName">
</el-input>
<el-checkbox-group v-model="checkedCities" @change="handleShopChange" class="shop-list">
<el-checkbox v-for="shop in shopAccount" :label="shop.id" :key="shop.id" class="current-shop">{{shop.name}}</el-checkbox>
</el-checkbox-group>
</div>
<div class="mt20" v-if="command==2&&currentType!=3">
<span>定时发布时间:</span>
<el-date-picker
size="small"
v-model="publishDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</div>
<div class="ml20" v-if="currentType==2&&command!=2">
您确认要发布到wish吗?
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="chooseShopClick">确 定</el-button>
<el-button @click="dialogVisibleReleased = false">取 消</el-button>
</span>
</el-dialog>
<el-dialog
title="备注"
:visible.sync="dialogVisibleRemark"
width="40%"
@close="dialogVisibleRemark = false">
<el-input
type="textarea"
:rows="4"
placeholder="请输入备注内容,认领到平台采集箱时,备注不会认领过去"
v-model="textareaRemark">
</el-input>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="remarkSure">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="提示"
:visible.sync="dialogVisibleDelete"
width="40%"
@close="dialogVisibleDelete = false">
<span>您确定删除吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleDelete = false">取 消</el-button>
<el-button type="primary" @click="dialogVisibleDelete = false">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:title="currentChangeType=='stock'?'批量修改库存':currentChangeType=='deliveryTime'?'批量修改运送时间':'批量修改价格'"
:visible.sync="dialogVisiblePrice"
width="40%"
@close="dialogVisiblePrice = false">
<div class="modal-price" v-if="currentChangeType!='deliveryTime'">
<el-radio v-model="radio" label="1">在原有数量上增加(减少用负数)</el-radio>
<el-input v-model="editPriceAdd" style="width:35%"/>
</div>
<div class="mt20 modal-price" v-if="currentChangeType!='deliveryTime'">
<el-radio v-model="radio" label="2">直接修改</el-radio>
<el-input v-model="editPrice" style="width:35%"/>
</div>
<div class="mt20" v-else>
<span class="pr5">修改运送时间</span>
<el-input-number v-model="editStartTime" style="width:30%" :min="2" :max="65"/> 天 -
<el-input-number v-model="editEndTime" style="width:30%" :min="3" :max="65"/>
<div v-if="editEndTime <= editStartTime" class="f-red">开始时间必须小于结束时间,最大不超过65天</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisiblePrice = false">取 消</el-button>
<el-button type="primary" @click="sureChangePrice">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="从wish同步产品"
:visible.sync="dialogVisibleSynchronization"
width="40%"
@close="dialogVisibleSynchronization = false">
<div>状态: <span class="g19 pl5">{{orderStatus}}</span></div>
<div>详情:</div>
<!-- <div class="ml40" v-for="(item,index) in shopSyncOrderRespDTOS" :key="index" v-if="syncType==2">
yanxiangju,同步完成!共同步成功{{item.successNum}}条数据!
</div> -->
<!-- <div class="ml40" v-if="syncType==2||3">
后台程序正在同步中,请稍后刷新页面查看同步信息
</div> -->
<div v-if="syncType==1&&finishSync" class="ml40">
同步完成!共同步{{successNum}}条数据! <span class="f-red">同步失败{{errorNum}}条数据</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleSynchronization = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog
title="提示"
:visible.sync="dialogVisibleMessage"
width="40%"
@close="dialogVisibleMessage = false">
<div>校验通过:<span class="txt-blue">{{successNum}}</span></div>
<div>校验失败:<span class="f-red">{{errorNum}}</span></div>
<div>失败详情:</div>
<div class="ml40" v-for="(item,index) in errorMessage" :key="index">
ID:<span class="f-blue ml10 mr10 poi" @click="editClick(item.id)">{{item.id}}</span>{{item.errorReason}}
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleMessage = false">取 消</el-button>
<el-button type="primary" @click="dialogVisibleMessage = false">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="批量操作"
:visible.sync="dialogVisibleBatch"
width="40%"
@close="dialogVisibleBatch = false">
<div>状态: <span class="f-red pl5">已完成</span></div>
<!-- <div>详情:</div>
<div class="ml40">
已成功修改{{successProductNum}}个产品,{{successVariantNum}}个变种
</div> -->
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleBatch = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog
title="绑定系统产品"
:visible.sync="dialogVisibleSku"
width="80%"
@opened="showMatching"
@close="closeMatching"
top="10vh"
>
<productBindingByPlatformIdDialog
ref="productBindingDialogRef"
></productBindingByPlatformIdDialog>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleSku = false"
>确 认</el-button
>
</span>
</el-dialog>
<el-dialog
title="同步产品"
:visible.sync="dialogVisibleProductReleased"
width="60%"
:close-on-click-modal="false"
@close="dialogVisibleProductReleased = false">
<div>
<span>平台:{{agentCode}}</span>
<el-input
@input="searchShopProductClick"
size="mini"
style="width:200px;float:right"
placeholder="请输入店铺名称"
suffix-icon="el-icon-search"
v-model="shopProductName">
</el-input>
<br/>
</div>
<div v-if="redioType=='1'" class="mt20 account-list2">
<table>
<tr>
<td>
<el-radio-group v-model="selectedShops">
<el-radio v-for="shop in shopAccount" :label="shop.name" :key="shop.name" class="current-shop w210 account-list3">{{shop.name}}</el-radio>
</el-radio-group>
</td>
</tr>
</table>
</div>
<br>
<div v-if="redioType=='1'">
输入产品名id:<el-input v-model="syncProduct" class="pct50 ml10" size="mini"></el-input>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="chooseProdectClick">确 定</el-button>
<el-button @click="dialogVisibleProductReleased = false">取 消</el-button>
</span>
</el-dialog>
<setTemplate :dialogVisibleTemlate="dialogVisibleTemlate" :showInput="false" :tableDataDetail="tableDataDetail" :tableDataAllDetail="tableDataAllDetail" :templateOptions="templateOptions" :id="productReleaseId" @sureSaveClick="sureSaveClick" @cancelClick="cancelTemplateClick"></setTemplate>
<syncPollingTemplate :syncPollingVisible="syncPollingVisible" :batchCode="syncBatchCode" @closeSync="closeSync" ref="syncFunction"></syncPollingTemplate>
</div>
</template>
<script>
import leftMenu from '@/components/leftMenu'
import topCrumbs from '@/components/business/topCrumbs'
import util from "@/common/js/util";
import setTemplate from '@/components/business/setTemplate'
import syncPollingTemplate from '@/components/business/syncPollingTemplate'
import productBindingByPlatformIdDialog from "@/components/business/productBindingByPlatformIdDialog";
export default {
data() {
return {
currentType:1,
agentCode:'wish',
firstCrumbs: '',
secondCrumbs: '',
thirdCrumbs: '',
textareaUrl:'',
allShop:[],
shopAccount:[],
dataAccount:[{name:'全部',id:0}],
dataSalesType:[{name:'全部',id:null},{name:'加钻',id:true},{name:'不加钻',id:false}],
authId:0,
authIdArry:[],
dataType:[{name:'SPU',id:0},{name:'标题',id:2}],
activeType:0,
dataTime:[{name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'}],
listParams:{
currentPage: 1,
pageSize: 50,
total: 0,
agentCode:'',
spu:'',
sku:'',
title:'',
platFromProductId:'',
auditStatus:[],
authId:0,
upShelfStatus:1,
orderType:'createDate',
isAsc:false,
publishStatus:'',
classificationId:0,
promoted:null
},
searchContent:'',
checkBoxData:[],
tableData: [],
productIdSpudicts: [],
productBindingDialogData: null,
dialogVisibleSku: false,
dialogVisibleReleased:false,
dialogVisibleRemark:false,
dialogVisibleDelete:false,
dialogVisibleTime:false,
dialogVisiblePrice:false,
dialogVisibleSynchronization:false,
dialogVisibleBatch:false,
value1:'',
textareaRemark:'',
checkAll: false,
checkedCities: [],
currentIndex:'',
ids:[],
radio:'1',
editPriceAdd:'',
editPrice:'',
editStartTime:'',
editEndTime:'',
currentChangeType:'',
remarkId:'',
dataTabList:[{name:'在线',number:0,id:1},{name:'已下架',number:0,id:0}],
orderStatus:'正在同步产品中...',
id:'',
command:'',
publishDate:'',
publishIds:'',
shopSyncOrderRespDTOS:[],
syncType:1,
successNum:0,
errorNum:0,
finishSync:false,
dialogVisibleMessage:false,
errorMessage:[],
currentName:'',
batchModify:'若店铺币种为人民币,则对美元价格的修改不生效',
successProductNum:0,
successVariantNum:0,
shopName:'',
treeData:[],
treeShow:false,
dialogVisibleTemlate:false,
tableDataDetail:[],
tableDataAllDetail:[],
templateOptions:[],
productReleaseId:'',
hasDataBtn:false,
dialogVisibleProductReleased:false,
shopProductName:'',
checkProductAll: false,
checkedProductCities:[],
selectedShops:'',
platformOptions:[{
value: '',
label: '请选择'
}, {
value: 'wish',
label: 'wish'
}],
platformValue:'wish',
syncPollingVisible:false,
syncBatchCode:'',
redioType:'1',
syncProduct:''
}
},
components: {
leftMenu,topCrumbs,setTemplate,syncPollingTemplate, productBindingByPlatformIdDialog
},
methods:{
handleCheckAllProductChange(val) {
let newArry=[]
if(val){
this.shopAccount.map((item)=>{
newArry.push(item.id)
})
}
this.checkedProductCities=newArry
},
handleProductChange(value) {
let checkedCount = value.length;
this.checkProductAll = checkedCount === this.shopAccount.length;
},
searchShopProductClick(val){
let shopArry=[]
this.allShop.map((item)=>{
if(item.name.indexOf(val)>-1){
shopArry.push(item)
}
})
this.shopAccount=shopArry
},
//同步店铺订单
chooseProdectClick(){
if (this.redioType == '1') {
this.syncByPlatformProductId();
} else {
// if (this.checkedProductCities.length > 5) {
// this.$message({
// message: '最多只能选择5个店铺哦~',
// type: 'warning'
// });
// return
// }
// let {checkedProductCities}=this
// console.log(checkedProductCities)
// this.axios({
// url: 'assistant/syncOrder',
// params:{
// id,
// },
// method: "get"
// }).then(res => {
// if(res.success){
// this.dialogVisibleProductReleased=false
// this.checkProductAll=false
// this.checkedProductCities=[]
// this.shopProductName=''
// this.shopAccount=this.allShop
// }
// })
this.synchronizationClick('', this.syncType)
}
},
freightSet(id){
this.axios({
url: 'assistant/product/freightTemplate/findById',
data:{
productReleaseId:id,
},
method: "post"
}).then(res => {
if(res.success){
this.productReleaseId=id
this.tableDataDetail=res.module.details
this.tableDataAllDetail=res.module.details
this.dialogVisibleTemlate=true
}
})
},
getTemplateList(){
this.axios({
url: 'assistant/product/freightTemplate/query',
data:{
currentPage: 1,
pageSize: 1000,
},
method: "post"
}).then(res => {
if(res.success){
this.templateOptions=[]
res.module.result.map((item)=>{
if(item.isOpen){
this.templateOptions.push({value:item.id,label:item.name})
}
})
}
})
},
syncByPlatformProductId(){
this.axios({
url: 'assistant/product/online/syncByPlatformProductId',
data:{
agentCode:this.platformValue,
authCode:this.selectedShops,
platformProductId:this.syncProduct
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '同步中,请稍后查看',
type: 'success'
});
this.dialogVisibleProductReleased = false
this.getProductsList()
}
})
},
sureSaveClick(val){
const{productReleaseId,ids}=this
this.axios({
url: 'assistant/product/online/bindingFreightTemplate',
data:{
details:JSON.stringify(val),
ids: productReleaseId?JSON.stringify(productReleaseId.split(',')):JSON.stringify(ids),
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleTemlate=false
this.getProductsList()
}
})
},
cancelTemplateClick(){
this.dialogVisibleTemlate=false
},
searchActive(value,type){
switch (type) {
case 1:
this.listParams.authId=value
break;
case 2:
this.activeType=value
this.searchTypeChoose()
break;
case 3:
this.searchTypeChoose()
break;
case 4:
this.listParams.auditStatus=JSON.stringify(this.checkBoxData)
break;
case 5:
this.listParams.orderType=value
this.listParams.isAsc=!this.listParams.isAsc
break;
case 6:
this.listParams.promoted=value
break;
default:
break;
}
this.getProductsList()
},
gotoBinding(row){
console.log('绑定系统产品', row)
this.axios({
url: "assistant/product/online/querySpu",
data: {
"platformProductIds": [row.platformProductId],
"hasSku":false
},
method: "post"
}).then(res => {
console.log('res', res)
if (res.success) {
this.productDetails = res.module;
this.productDetails.forEach(element => {
this.productIdSpudicts = []
this.productIdSpudicts.push({
value: element.platformProductId,
label: element.platformSpu
})
});
console.log('productIdSpudicts', this.productIdSpudicts)
let platformProductSkuIdList = [];
row.unitRespDTOS.forEach(dto => {
platformProductSkuIdList.push(dto.platformProductSkuId);
})
this.productBindingDialogData = {
platformProductId: row.platformProductId,
productIdSpudicts:this.productIdSpudicts,
valuePlatform: "platformSku",
platformProductSkuIdList: platformProductSkuIdList,
platformProductIdList:[row]
};
this.dialogVisibleSku = true;
}
})
},
showMatching() {
this.$refs.productBindingDialogRef.listonshow(this.productBindingDialogData);
},
closeMatching(){
this.$refs.productBindingDialogRef.listParamsPlatformProduct.platformProductId = ""
this.productIdSpudicts = {}
this.dialogVisibleSku = false
},
searchTypeChoose(value){
const{activeType}=this
const{searchContent}=this
if(activeType==0){
this.listParams.spu=searchContent
this.listParams.sku=''
this.listParams.title=''
this.listParams.platFromProductId=''
}else if(activeType==1){
this.listParams.spu=''
this.listParams.sku=searchContent
this.listParams.title=''
this.listParams.platFromProductId=''
}else if(activeType==2){
this.listParams.spu=''
this.listParams.sku=''
this.listParams.title=searchContent
this.listParams.platFromProductId=''
}else{
this.listParams.spu=''
this.listParams.sku=''
this.listParams.title=''
this.listParams.platFromProductId=searchContent
}
},
chooseTabs(value){
this.listParams.upShelfStatus=value
this.getProductsList()
},
addRemark(id){
this.remarkId=id
this.dialogVisibleRemark=true
},
remarkSure(){
const{textareaRemark,remarkId,currentType}=this
let url
if(currentType==1){
url='assistant/product/collectBox/remark'
}else if(currentType==2){
url='assistant/product/release/remark'
}else{
url='assistant/product/online/remark'
}
this.axios({
url:url,
data:{
id:remarkId,
remark:textareaRemark
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleRemark=false
this.$message({
message: '备注成功',
type: 'success'
});
this.getProductsList()
}
})
},
handleCheckAllChange(val) {
let newArry=[]
if(val){
this.shopAccount.map((item)=>{
newArry.push(item.id)
})
}
this.checkedCities=newArry
},
handleShopChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.shopAccount.length;
},
handleClick(command,id){
this.ids=id.split(',')
this.command=command
if(this.currentType==2&&command==1){
this.chooseShopClick()
}else{
this.dialogVisibleReleased=true
}
},
getCurrentLeft(value){
this.currentName=value.name
this.currentType=value.type
this.firstCrumbs='Wish'
this.secondCrumbs=this.currentType == 1 ? '采集箱' : this.currentType == 2 ? '待发布产品' : '在线产品'
this.thirdCrumbs = this.currentType != 1 ? this.currentName : ''
this.listParams.publishStatus=value.name=='定时发布'?4:value.name=='发布中'?1:value.name=='发布失败'?3:''
if(this.listParams.publishStatus!=''){
this.listParams.classificationId=''
}else{
this.listParams.classificationId=value.pid=='assistion_type'?0:value.pid
}
this.dataType=[]
this.dataTime=[]
if(this.currentType==3){
this.dataType.push({name:'SPU',id:0},{name:'SKU',id:1},{name:'标题',id:2},{name:'产品ID',id:3})
this.dataTime.push({name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'},{name:'按收藏量',id:'collectCounts'},{name:'按出售量',id:'sellCounts'})
}else{
if(this.currentType==1){
this.dataType.push({name:'SPU',id:0},{name:'标题',id:2})
}else{
this.dataType.push({name:'SPU',id:0},{name:'SKU',id:1},{name:'标题',id:2})
}
this.dataTime.push({name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'})
}
this.getProductsList()
},
unfoldClick(index,isUnfold,id) {
const {currentType}=this
if(!isUnfold){
let url
if(currentType==2){
url='assistant/product/release/getReleaseProductInfo'
}
if(currentType==3){
url='assistant/product/online/getEcProductInfo'
}
this.axios({
url,
params:{id},
method: "get"
}).then(res => {
if(res.success){
this.tableData[index].unitRespDTOS=[]
res.module.map((item)=>{
this.tableData[index].unitRespDTOS.push(item)
})
this.$set(this.tableData[index], 'unfold',true)
}
})
}
this.currentIndex=index
},
closeClick(){
this.currentIndex=''
},
cancelClick(rowIndex,arrIndex,type){
this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], `visible${type}`,false)
},
//待发布直接编辑价格及库存
changeClick(id,item,rowIndex,arrIndex,type,moneyChangeVal){
let url
let value=this.$refs[`playBtn${item}`][0].value
let params={
id,
moneyChangeVal
}
if(type=='a'){
// if(moneyChangeVal){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceCn', value)
// }
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceUs', value)
params.sellPriceUs=value
}
if(type=='b'){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceCn', value)
params.sellPriceCn=value
}
if(type=='c'){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'stock', value)
params.stock=value
}
if(type=='d'){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'freightPrice', value)
params.freightPrice=value
}
if(this.currentType==2){
url='assistant/product/release/edit'
}else{
url='assistant/product/online/modifySku'
}
this.axios({
url,
data:params,
method: "post"
}).then(res => {
if(res.success){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], `visible${type}`,false)
this.getProductsList()
}
})
},
sureChangePrice(){
const {ids,currentChangeType,radio,editPrice,editPriceAdd,editStartTime,editEndTime,currentType}=this
let url;
let params={
ids:JSON.stringify(ids)
}
if (currentChangeType==='deliveryTime' && this.editEndTime <= this.editStartTime){
this.$message.warning("开始时间必须小于结束时间,最大不超过65")
return;
}
if(currentType==2){
if(radio==2||currentChangeType=='deliveryTime'){
url='assistant/product/release/batchDirectEdit'//直接
}else{
url='assistant/product/release/batchInDirectEdit'//间接
}
}else{
if(radio==2||currentChangeType=='deliveryTime'){
url='assistant/product/online/batchModifySku'//直接
}else{
url='assistant/product/online/batchModifySkuInDirect'//间接
}
}
switch(currentChangeType){
case 'sellPriceUs':
params.sellPriceUs=radio==2?editPrice:editPriceAdd
params.modifyType=2
break;
case 'sellPriceCn':
params.sellPriceCn=radio==2?editPrice:editPriceAdd
params.modifyType=1
break;
case 'freightPriceUs':
params.freightPriceUs=radio==2?editPrice:editPriceAdd
params.modifyType=3
break;
case 'stock':
params.stock=radio==2?editPrice:editPriceAdd
params.modifyType=4
break;
case 'deliveryTime':
params.deliveryTime=editStartTime+'-'+editEndTime
params.modifyType=5
break;
default:
break;
}
this.axios({
url: url,
data:params,
method: "post"
}).then(res => {
if(res.success){
this.dialogVisiblePrice=false
this.dialogVisibleBatch=true
this.syncBatchCode=res.module.batchCode;
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
// let data=res.module.batchProductUpdateRespDTO
// this.successProductNum=data.successProductNum
// this.successVariantNum=data.successVariantNum
this.getProductsList()
}
})
},
getProductsList(){
let{currentType,listParams}=this
let url
this.listParams.agentCode = this.agentCode;
if(currentType==1){
url='assistant/product/collectBox/query'
}
if(currentType==2){
url='assistant/product/release/query'
}
if(currentType==3){
url='assistant/product/online/query'
this.getOnlineNum(listParams)
}
this.axios({
url: url,
data:listParams,
method: "post"
}).then(res => {
if(res.success){
if(currentType!=3){
let data=res.module
this.tableData=data.result
this.listParams.total=data.total
}
else{
let data=res.module
this.tableData=data.page.result
this.listParams.total=data.page.total
}
}
})
},
getOnlineNum(listParams){
this.axios({
url: "assistant/product/online/queryShelfCount",
data:listParams,
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.$set(this.dataTabList[0],'number',data.upShelfCount)
this.$set(this.dataTabList[1],'number',data.downShelfCount)
}
})
},
cancelSetTimeClick(id){
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
this.$confirm('取消定时发布后,产品将移入到【待发布】页面。您确认要取消吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: 'assistant/product/release/cancelTimePublish',
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '取消定时成功',
type: 'success'
});
this.getProductsList()
// this.$refs.leftMenu.getClassifyAndNum();
}
})
})
},
moveWaitRelease(val,command){
this.dialogVisibleReleased=true
this.command=command
this.ids=[]
this.ids.push(val)
},
editClick(id){
const{currentType}=this
let routeData = this.$router.resolve({
name: "createProduct",
query:{id,currentType}
});
window.open(routeData.href, '_blank');
},
handleSelectionChange(val) {
this.ids=val.map((item=>{
return item.id
}))
},
downProdect(id){
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
this.$confirm('您确认要下架吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: 'assistant/product/online/batchDownShelf',
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '下架成功',
type: 'success'
});
this.getProductsList()
}
})
})
},
upProdect(id){
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
this.$confirm('您确认要上架吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: 'assistant/product/online/batchUpShelf',
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '上架成功',
type: 'success'
});
this.getProductsList()
}
})
})
},
deleteProdect(id){
const{currentType}=this
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
let url
if(currentType==1){
url='assistant/product/collectBox/delete'
}else if(currentType==2){
url='assistant/product/release/delete'
}else{
url='assistant/product/online/delete'
}
let message = '您确认要删除吗?'
if (currentType == 3){
message = '删除产品同时会删除平台上的产品,不可恢复,是否继续?'
}
this.$confirm(message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: url,
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '删除成功',
type: 'success'
});
this.getProductsList()
// this.$refs.leftMenu.getClassifyAndNum();
}
})
})
},
closeSync(val){
this.syncPollingVisible=val;
this.getProductsList();
this.syncBatchCode='';
},
synchronizationClick(id,type){
this.finishSync=false
this.syncType=type
this.orderStatus='正在同步产品中...'
this.dialogVisibleProductReleased=false
this.shopSyncOrderRespDTOS=[]
this.successNum=0
this.errorNum=0
let ids
let url
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
const{ listParams,authIdArry,checkedProductCities }=this
if(type==1){
url='assistant/product/online/syncProduct'
this.dialogVisibleSynchronization=true
}else if(type==2){
url='assistant/product/online/sync'
}else{
url='assistant/product/online/getProductsShipping'
}
this.axios({
url,
data:{
ids:JSON.stringify(ids),
// shopIds:listParams.authId==0?JSON.stringify(authIdArry):listParams.authId
shopIds:type!=1&&listParams.authId==0?JSON.stringify(checkedProductCities):listParams.authId
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
if (type == 2){
this.syncBatchCode=res.module.batchCode;
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
}else{
this.orderStatus='已完成!'
this.finishSync=true
this.successNum=data.successNum
this.errorNum=data.errorNum
}
this.getProductsList()
}
else{
this.dialogVisibleSynchronization=false
}
})
},
handleProductClick(command){
this.checkedProductCities=[]
let type=command==1?2:command==2?1:3
this.syncType=type
if((command==2 || command == 3) && this.ids.length==0){
this.$message.error('请至少选中一个产品')
return
}
if(command==1){
this.dialogVisibleProductReleased=true
}else{
this.synchronizationClick('',type)
}
},
handleClickBatch(command){
const{ids}=this
if(ids.length==0){
this.$message.error('请至少选中一个产品')
return
}
if(this.listParams.authId==0&&this.currentType!=3&&command==12){
this.$message.error('请选择店铺')
return
}
switch (command) {
case '1':
this.command=command
this.dialogVisibleReleased=true
break;
case '2':
this.command=command
this.dialogVisibleReleased=true
break;
case '3':
this.command=command
this.dialogVisibleReleased=true
break;
case '4':
this.deleteProdect()
break;
case '5':
this.dialogVisiblePrice=true
this.currentChangeType='sellPriceUs'
break;
case '6':
this.dialogVisiblePrice=true
this.currentChangeType='sellPriceCn'
break;
case '7':
this.dialogVisiblePrice=true
this.currentChangeType='freightPriceUs'
break;
case '8':
this.dialogVisiblePrice=true
this.currentChangeType='stock'
break;
case '9':
this.dialogVisiblePrice=true
this.currentChangeType='deliveryTime'
break;
case '10':
this.downProdect()
break;
case '11':
this.cancelSetTimeClick()
break;
case '12':
this.freightSet('')
this.productReleaseId=''
break;
case '13':
this.upProdect()
break;
default:
break;
}
},
copyProdect(id){
this.dialogVisibleReleased=true
this.id=id
},
chooseShopClick(){
const {ids,checkedCities,id,currentType,command}=this
let url
let that=this
if(currentType!=3){//wish采集箱定时或立即发布或移入待发布
if(currentType==1){
if(command==1){
url='assistant/product/collectBox/publish'
}else if(command==2){
this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
url='assistant/product/collectBox/timePublish'
}else if(command==3){
url='assistant/product/collectBox/toPublish'
}
}else{
if(command==1){
url='assistant/product/release/publish'
}else{
this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
url='assistant/product/release/timePublish'
}
}
this.axios({
url,
data:{
ids:JSON.stringify(ids),
shopIds:JSON.stringify(checkedCities),
publishDate:this.publishDate,
},
method: "post"
}).then(res => {
if(res.success){
// this.$refs.leftMenu.getClassifyAndNum();
this.getProductsList()
this.dialogVisibleReleased=false
this.checkAll=false
this.checkedCities=[]
if(command==3){
this.$message({
message: '操作成功',
type: 'success'
});
}else{
let data=res.module.checkResultRespDTO
if(data.checkResult){
this.$message({
message: '提交发布成功,请到【发布中】,【发布失败】,【在线产品】查看发布情况',
type: 'success'
});
let setTime
setTime=setInterval(function () {
if(that.$route.path=='/product/productList'&&that.$refs.leftMenu.getCurSide[1].children[1].number>0){
// that.$refs.leftMenu.getClassifyAndNum(1);
this.getProductsList()
}else{
clearInterval(setTime)
}
}, 3000);
}else{
this.dialogVisibleMessage=true
this.errorMessage=data.productInfos
this.errorNum=data.errorNum
this.successNum=data.successNum
}
}
this.shopName=''
this.shopAccount=this.allShop
}
})
}
if(currentType==3){//复制为新产品
this.axios({
url: 'assistant/product/online/copy',
data:{
id,
shopIds:JSON.stringify(checkedCities)
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleReleased=false
this.checkAll=false
this.checkedCities=[]
this.$message({
message: '复制为新产品成功',
type: 'success'
});
this.$refs.leftMenu.getClassifyAndNum();
}
})
}
},
getShopList(){
this.axios({
url: 'assistant/getShops',
data:{
agentName:'wish'
},
method: "post"
}).then(res => {
if(res.success){
res.module.map((item)=>{
this.allShop.push({name:item.authCode,id:item.id})
this.shopAccount.push({name:item.authCode,id:item.id})
this.dataAccount.push({name:item.authCode,id:item.id})
this.authIdArry.push(item.id)
})
}
})
},
handleSizeChange(val) {
this.listParams.pageSize = val;
this.getProductsList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.getProductsList();
},
goIndex(){
localStorage.setItem('leftMenu','dataCollection');
let routeData = this.$router.resolve({
name: "dataCollection",
});
window.open(routeData.href, '_blank');
},
copyUrl(data){
util.copyUrl(data)
},
searchShopClick(val){
let shopArry=[]
this.allShop.map((item)=>{
if(item.name.indexOf(val)>-1){
shopArry.push(item)
}
})
this.shopAccount=shopArry
},
getClassify(){
this.axios({
url: 'assistant/dictionary/getClassificationList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.treeData=res.module.dataTree
}
})
},
SwitchNode(data,node){
this.treeShow=false
if(this.ids.length==0){
this.$message({
message:"请至少选择一个产品",
type:"error"
})
return
}
this.axios({
url: this.currentType==2?'assistant/product/release/mobileClassification':'assistant/product/online/mobileClassification',
data:{
classificationId:data.pid,
ids:JSON.stringify(this.ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$refs.leftMenu.getClassifyAndNum();
this.getProductsList();
}
})
},
openNewUrl(url){
window.open(url, '_blank');
},
getTpye(){
this.axios({
url: 'assistant/info/get/typeList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.typeArry=res.module
this.typeCode=this.typeCode?this.typeCode:res.module[0].code
this.getSize()
}
})
},
getSize(){
const{typeCode,id}=this
this.axios({
url: 'assistant/info/get/sizeList',
data:{
parentCode:typeCode,
id
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.tableShow=data.table
if(data.table){
this.mulTableData=data.mulTableData
this.tableConfig=data.tableConfigs
}else{
this.otherSizeCodeNew=[]
this.otherSizeCodeNew=this.sizeCode
if(typeCode=='custom'){
if(data.data){
this.otherSizeCode=data.data.map((item)=>{
return item= Object.assign({}, item, { isEdit:false})
})
}else{
this.otherSizeCode=[]
}
}else{
this.otherSizeCode=data.data
}
}
}
})
},
},
mounted(){
this.currentType=this.$route.query.id||1
// this.getCurrentLeft({type:this.currentType,name:'',pid:0})
this.getShopList()
this.getClassify()
if(this.currentType==3){
this.getTemplateList()
}
if(this.currentType==1){
let btnPermissionList = JSON.parse(localStorage.getItem('permissionsArry'))
this.hasDataBtn=btnPermissionList.some((item)=>{
return item.title=='通用板块'
})
}
},
}
</script>
<style lang="less" scoped>
.shop-list{
display:flex;
margin:20px 5px;
flex-wrap:wrap;
// justify-content:space-between;
max-height:300px;
overflow:auto;
clear:both;
.current-shop{
width:120px;
overflow:hidden
}
}
.content-right{
width:85%;
.content-top{
background: #FFFFFF;
.btn {
display: inline-block;
vertical-align: middle;
height: 34px;
width: 80px;
margin-right: 10px;
font-size: 13px;
}
.container-o-box{
.default{
margin: 0;
width: 100%;
}
.com-block {
border: 1px solid #ccc;
width: 100%;
background-color: #fff;
box-shadow: 0 0 0 0;
border-top:none;
.productSearchGroup input[type="text"] {
display: inline-block;
width: 410px;
vertical-align: middle;
margin-right: 10px;
padding-right: 90px;
}
.search-tab {
padding: 5px;
.border-dashed-top1 {
border-top: 1px dashed #ccc !important;
}
table{
width:100%;
tbody > tr > td {
padding: 2px 5px;
line-height: 34px;
vertical-align: top;
}
tbody > tr > td:first-child {
width: 80px;
min-width: 80px;
max-width: 100px;
text-align: left;
color: #a0a3a6;
}
table > tbody > tr > td:nth-child(2) {
padding: 5px;
}
tbody > tr > td .tab-in > a {
padding: 0 3px;
cursor: pointer;
}
tbody > tr > td > a {
float: left;
margin: 5px 20px 5px 0;
padding: 0 3px;
}
a{
color: #367EE2;
text-decoration: none;
}
a.myj-aFocus {
display: flex;
padding: 2px 2px;
line-height: 18px;
vertical-align: middle;
}
.tp24{
padding-top:4px;
}
.myj-active {
background-color: #367EE2;
color: #fff;
}
.m-right15 {
margin-right: 15px !important;
}
.p-right0 {
padding-right: 0 !important;
}
.gray-c {
color: #737679 !important;
}
.account-list{
display: inline-block;
max-height: 300px;
overflow: auto;
}
}
}
}
}
.pull-right {
float: right!important;
// margin-bottom:10px;
}
.post_divA {
padding-left: 19px;
background: url(../../assets/img/arrowgreen1.png) no-repeat left -128px;
}
.post_crawl .p_style3 {
background-position-y: -3px !important;
background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% 0;
color: #666;
}
.post_divA p, .post_divB p {
margin: 0;
height: 31px;
line-height: 21px;
font-size: 12px;
float: left;
text-align: center;
width: 25%;
}
.w120 {
width: 120px !important;
}
.h25 {
height: 25px !important;
}
.m-bottom10{
margin-bottom: 10px !important
}
.lh15-imp {
line-height: 25px !important;
}
.post_crawl .p_style4A {
background-position-y: -67px !important;
background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% -65px;
color: #666;
}
.border4 {
border: 1px solid #ccc !important;
clear: both;
}
.tab-content>.active {
display: block;
visibility: visible;
}
.form-control {
display: block;
width: 100%;
height: auto;
padding: 6px 12px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
.p-top10 {
padding-top: 10px!important;
}
.p30{
padding:38px 10px;
}
.btn-determine {
font-size: 13px;
border-color: #367EE2;
color: #fff;
background-color: #367EE2;
}
.btn-gray {
border-color: #d0d3d6;
font-size: 13px;
color: #434649;
background-color: #f2f2f2;
}
.m-left8 {
margin-left: 8px !important;
}
.border5{
clear: both;
.el-table--border, .el-table--group {
border: 1px solid #ccc!important;
}
.el-table thead{
color: #333
}
.el-table thead tr th {
background-color: #eee!important;
}
.el-dropdown-link {
cursor: pointer;
color: #367EE2;
font-size: 13px;
}
.imgCss{
width: 71px;
height: 71px;
display: block;
border:1px solid #ccc
}
.control-heightOpen{
overflow: hidden;
}
.control-heightUp{
max-height: 141px;
overflow: hidden;
}
.variant-input-control{
position: absolute;
top: 0;
left: 0;
text-align: center;
background-color: #F2F2F2;
z-index: 1;
width: 100px;
.variant-update-input{
padding: 6px;
width: 100%;
height: 24px;
line-height: 24px;
display: inline-block;
}
.btn-edit-enter {
margin-right: 2px;
border-radius: 2px;
padding: 0;
width: 29px;
height: 20px;
font-size: 12px;
line-height: 18px;
background-color: #5399D5;
}
.btn-edit-restart {
border-radius: 2px;
padding: 0;
width: 29px;
height: 20px;
font-size: 12px;
line-height: 18px;
background-color: #5399D5;
}
}
.custom-table-title{
span{
width: 95px;
display: inline-block;
}
}
.custom-table{
border-bottom: 1px solid #EBEEF5;
span{
width: 95px;
display: inline-block;
cursor: pointer;
}
span:first-child{
cursor: auto;
}
.activeInput{
background: #ccc
}
}
.custom-table:last-child{
border:none
}
.unfold-show{
color: #367EE2;
text-align: right;
font-size: 13px;
}
}
.content-button{
display: flex;
justify-content: space-between;
margin:10px;
.el-button--primary{
background-color: #367EE2;
border-color: #367EE2;
}
}
}
}
.variant-input-control{
text-align: center;
background-color: #F2F2F2;
.variant-update-input{
padding: 6px;
width: 100%;
height: 24px;
line-height: 24px;
display: inline-block;
border: 1px solid #999;
}
.btn-edit-enter {
margin-right: 2px;
border-radius: 2px;
padding: 0;
width: 40px;
height: 20px;
line-height: 18px;
background-color: #5399D5;
color: #fff
}
.btn-edit-restart {
border-radius: 2px;
padding: 0;
width: 40px;
height: 20px;
line-height: 18px;
background-color: #5399D5;
color: #fff
}
}
.modal-price{
display: flex;
justify-content: space-between;
align-items: center;
}
.audit-status{
border: 1px solid #d6ad1a;
color: #d6ad1a;
width:20px;
height:20px;
border-radius:4px;
line-height:20px;
text-align:center
}
.error-message{
border-radius: 4px;
border: 1px solid #ccc;
color:#ec4339
}
.tree-type{
position:relative;
display: inline-block;
background-color: #367EE2;
border-radius: 4px;color: #FFF;
.tree-select{
min-width:100px;
height:34px;
border-color: #367EE2;
border-radius:4px;
padding: 6px 12px;
}
.tree-data{
position: absolute;
top: 34px;
z-index: 2;
border: 1px solid #eee;
min-width:240px;
max-height:350px;
overflow:auto;
}
}
.account-list2{
max-height: 200px;
overflow: auto;
}
.account-list3{
max-width: 250px;
overflow: auto;
}
</style>
<template>
<div class="content-height">
<div class="myorder-content">
<datacollectionLeft @getCurrentLeft='getCurrentLeft' ref="leftMenu" :agentCode="agentCode"></datacollectionLeft>
<div class="content-right">
<div class="content-top">
<topCrumbs :firstCrumbs="firstCrumbs" :secondCrumbs="secondCrumbs" :thirdCrumbs="thirdCrumbs"></topCrumbs>
<div>
<div class="container-o-box default">
<div class="com-block m-bottom10">
<div class="content search-tab p10 p-top5">
<table>
<tbody>
<tr v-if="currentType!=1">
<td class="p-right0 gray-c">账号:</td>
<td class="account-list">
<a v-for="item in dataAccount" :key="item.name" :class="listParams.authId==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,1)" >{{item.name}}</a>
</td>
</tr>
<tr>
<td class="p-right0 gray-c">搜索类型:</td>
<td>
<a v-for="item in dataType" :key="item.name" :class="activeType==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,2)" >{{item.name}}</a>
</td>
</tr>
<tr>
<td class="p-right0 gray-c">搜索内容:</td>
<td class="tab-separate search-value">
<div class="productSearchGroup">
<input class="form-control" style="width:460px;" type="text" v-model="searchContent">
<button class="btn btn-primary" style="width:52px;" @click="searchActive('',3)">搜索</button>
</div>
</td>
</tr>
<tr v-if="currentType==3">
<td class="p-right0 gray-c">审核状态:</td>
<td>
<el-checkbox-group v-model="checkBoxData" @change="searchActive('',4)">
<el-checkbox label="0">审核中</el-checkbox>
<el-checkbox label="1">已审核</el-checkbox>
<el-checkbox label="2">被拒绝</el-checkbox>
</el-checkbox-group>
</td>
</tr>
<tr v-if="currentType==3">
<td class="p-right0 gray-c">销售类型:</td>
<td class="account-list">
<a v-for="item in dataSalesType" :key="item.name" :class="listParams.promoted==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,6)" >{{item.name}}</a>
</td>
</tr>
<tr>
<td class="p-right0 gray-c border-dashed-top1">排序类型:</td>
<td class="crawl-date border-dashed-top1">
<a v-for="item in dataTime" :key="item.name" :class="listParams.orderType==item.id?'myj-aFocus myj-active':'myj-aFocus'" @click="searchActive(item.id,5)" >{{item.name}}
<i class="fa fa-sort-desc " v-if="item.id==listParams.orderType&&!listParams.isAsc"/>
<i class="fa fa-sort-up tp24" v-if="item.id==listParams.orderType&&listParams.isAsc"/></a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="content-button">
<div>
<el-dropdown v-if="listParams.publishStatus!=1" @command="handleClickBatch">
<el-button type="primary">
批量操作<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="4" v-if="$_has('delete')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">批量删除</el-dropdown-item>
<el-dropdown-item command="3" v-if="currentType==1&&currentName!='定时发布'&&$_has('publishP')">批量移入待发布</el-dropdown-item>
<el-dropdown-item command="1" v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">批量立即发布</el-dropdown-item>
<el-dropdown-item command="2" v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">批量定时发布</el-dropdown-item>
<el-tooltip effect="light" :content="batchModify" placement="top">
<el-dropdown-item command="5" divided v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改价格(USD)</el-dropdown-item>
</el-tooltip>
<el-dropdown-item command="6" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改本地价格</el-dropdown-item>
<el-dropdown-item command="8" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改库存</el-dropdown-item>
<el-dropdown-item command="9" v-if="currentType!=1&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">批量改运送时间</el-dropdown-item>
<el-dropdown-item command="10" v-if="currentType==3&&currentName!='定时发布'&&$_has('standUD')&&listParams.upShelfStatus==1">批量下架</el-dropdown-item>
<el-dropdown-item command="13" v-if="currentType==3&&currentName!='定时发布'&&$_has('standUD')&&listParams.upShelfStatus==0">批量上架</el-dropdown-item>
<el-dropdown-item command="11" v-if="currentName=='定时发布'&&$_has('edit')">批量取消定时</el-dropdown-item>
<el-dropdown-item command="12" v-if="currentType==3&&$_has('add')">运输设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-dropdown v-if="currentType!=1">
<el-button type="primary">
移动分类<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>所有分类</el-dropdown-item>
<el-dropdown-item>未分类</el-dropdown-item>
<el-dropdown-item>卫衣</el-dropdown-item>
<el-dropdown-item>夹克</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<div class="tree-type" v-if="currentType!=1&&listParams.publishStatus!=1&&listParams.publishStatus!=4">
<div class="tree-select poi" @click="treeShow=!treeShow">移动分类<i class="el-icon-arrow-down ml5"/></div>
<div class="tree-data" v-if="treeShow">
<el-tree
:data="treeData"
node-key="id"
ref="tree"
highlight-current
@current-change="SwitchNode"
>
</el-tree>
</div>
</div>
</div>
<div>
<button class="btn btn-primary" v-if="currentType==1&&hasDataBtn" @click="goIndex">采集数据</button>
<button class="btn btn-primary m-left10" @click="editClick('')" v-if="$_has('add')">创建产品</button>
<el-dropdown v-if="currentType==3&&$_has('syncP')" @command="handleProductClick">
<el-button type="primary">
同步产品<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="1">同步单个产品</el-dropdown-item>
<el-dropdown-item command="2">同步选中产品</el-dropdown-item>
<el-dropdown-item command="3">同步国家运费</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div :class="listParams.upShelfStatus==item.id?'item-collection':'item-collection-white'" v-for="item in dataTabList" :key="item.name" @click="chooseTabs(item.id)" v-if="currentType==3">{{item.name}}({{item.number}})</div>
<div class="pull-right">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="listParams.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParams.total"
style="float:right;display:inline-block"
></el-pagination>
</div>
<div class="tab-content border5 m-bottom10">
<el-table
ref="multipleTable"
:data="tableData"
tooltip-effect="dark"
border
style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="30">
</el-table-column>
<el-table-column
align="center"
label="图片"
width="75">
<template slot-scope="scope">
<img :src="scope.row.mainImageUrl" class="imgCss"/>
<div class="tl">
<span>来源</span>
<a class="el-dropdown-link" :href="scope.row.productFromUrl" target="_blank">{{scope.row.productFromCode}}</a>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
:label="currentType!=3?'标题':'标题/产品ID'"
width="180"
>
<template slot-scope="scope">
<div>
<el-tooltip effect="light" :content="scope.row.title" placement="top">
<div class="tl break-two" style="width:140px">{{scope.row.title}}</div>
</el-tooltip>
<div v-if="scope.row.remark" class="g19 tl mb5">备注:{{scope.row.remark}}</div>
<div v-if="scope.row.msg" class="g19 tl mb5">消息:{{scope.row.msg}}</div>
<el-popover
placement="top-start"
trigger="hover"
width="50"
v-if='scope.row.platformProductId'
>
<el-button type="primary" size="mini" @click="copyUrl(scope.row.platformProductId)">复制</el-button>
<div slot="reference" class="f-blue tl mb5" @click="openNewUrl(scope.row.productOnlineUrl)">{{scope.row.platformProductId}}</div>
</el-popover>
<span v-if='scope.row.auditStatus' class="audit-status tl mb5">{{scope.row.auditStatus}}</span>
<span v-if='scope.row.authCode' class="gray-nine tl mb5">{{scope.row.authCode}}</span>
<span v-if='scope.row.ratings' class="f-blue tl mb5">评分:{{scope.row.ratings}}</span>
<div v-if="scope.row.errorMsg" class="error-message p5">{{scope.row.errorMsg}}</div>
</div>
</template>
</el-table-column>
<el-table-column
align="center"
label="描述"
width="150"
v-if="currentType==1"
>
<template slot-scope="scope">
<el-tooltip effect="light" :content="scope.row.description" placement="top">
<span class="el-dropdown-link break-two" style="width:150px">{{scope.row.description}}</span>
</el-tooltip>
</template>
</el-table-column>
<el-table-column
prop="collectCounts"
label="收藏"
align="center"
v-if="currentType==3"
width="50"
>
</el-table-column>
<el-table-column
prop="sellCounts"
label="出售"
align="center"
v-if="currentType==3"
width="50"
>
</el-table-column>
<el-table-column
prop="spu"
label="SPU名"
align="center"
>
</el-table-column>
<el-table-column
v-if="currentType==2||currentType==3"
align="center"
:width="currentType==2?520:420">
<template slot="header" slot-scope="scope">
<div class="custom-table-title">
<span>SKU</span>
<span>价格(USD)</span>
<span>本地价格</span>
<span>库存</span>
<span v-if="currentType==2">运费($)</span>
</div>
</template>
<template slot-scope="scope">
<div :class="currentIndex===scope.$index?'control-heightOpen':'control-heightUp'">
<div v-for="(item,indexTable) in scope.row.unitRespDTOS" :key="item.id" class="custom-table">
<span>{{item.sku}}<i class="gc f12" v-if="!item.ifShelf&&currentType==3&&listParams.upShelfStatus">(下架)</i></span>
<el-popover
placement="bottom"
width="160"
v-model="item.visiblea">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.sellPriceUs" :ref="'playBtna'+scope.$index+indexTable">
<div class="tl"><el-checkbox v-model="item.moneyChangeVal"><span class="f12">USD 转换 CNY</span></el-checkbox></div>
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`a${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'a',item.moneyChangeVal)">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'a')">取消</button>
</div>
<span slot="reference">{{item.sellPriceUs}}</span>
</el-popover>
<el-popover
placement="bottom"
width="160"
v-model="item.visibleb">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.sellPriceCn" :ref="'playBtnb'+scope.$index+indexTable">
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`b${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'b')">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'b')">取消</button>
</div>
<span slot="reference">{{item.sellPriceCn}}</span>
</el-popover>
<el-popover
placement="bottom"
width="160"
v-model="item.visiblec">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.stock" :ref="'playBtnc'+scope.$index+indexTable">
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`c${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'c')">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'c')">取消</button>
</div>
<span slot="reference">{{item.stock}}</span>
</el-popover>
<el-popover
v-if="currentType==2"
placement="bottom"
width="160"
v-model="item.visibled">
<div class="variant-input-control">
<input class="variant-update-input" type="text" :value="item.freightPrice" :ref="'playBtnd'+scope.$index+indexTable">
<button class="button btn-determine btn-edit-enter pull-left editEnter" type="button" @click="changeClick(item.id,`d${scope.$index}`+`${indexTable}`,scope.$index,indexTable,'d')">更新</button>
<button class="button btn-determine btn-edit-restart pull-left editRestart" type="button" @click="cancelClick(scope.$index,indexTable,'d')">取消</button>
</div>
<span slot="reference">{{item.freightPrice}}</span>
</el-popover>
</div>
</div>
<div v-if="scope.row.unitRespDTOS&&scope.row.unitRespDTOS.length>2">
<div class="unfold-show" @click="unfoldClick(scope.$index,scope.row.unfold,scope.row.id)" v-if="currentIndex!==scope.$index">+ 展开</div>
<div class="unfold-show" v-else @click="closeClick(scope.$index)">- 收起</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="freightPrice"
label="运费"
align="center"
v-if="currentType==3"
width="50"
>
<template slot-scope="scope">
<div class="tl">
<span>USD: {{scope.row.freightPrice}}</span>
</div>
<div class="tl">
<span>CNY: {{scope.row.freightPriceCn}}</span>
</div>
</template>
</el-table-column>
<el-table-column
prop="sellPriceUs"
label="售价(USD)"
align="center"
v-if="currentType==1"
>
</el-table-column>
<el-table-column
prop="sellPriceCn"
label="本地价格"
align="center"
v-if="currentType==1"
>
</el-table-column>
<el-table-column
prop="stock"
label="库存"
align="center"
v-if="currentType==1"
>
</el-table-column>
<el-table-column
label="时间"
width="130"
align="center"
>
<template slot-scope="scope">
<div class="tl gray-nine">创建</div>
<div class="tl">{{scope.row.createDate}}</div>
<div class="tl gray-nine">更新</div>
<div class="tl">{{scope.row.modifyDate}}</div>
</template>
</el-table-column>
<el-table-column
label="操作"
width="70"
>
<template slot-scope="scope">
<div class="el-dropdown-link" v-if="currentType==1&&$_has('publishP')" @click="moveWaitRelease(scope.row.id,3)">移入待发布</div>
<div class="el-dropdown-link" @click="editClick(scope.row.spuId)" v-if="currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('edit')">编辑</div>
<div class="el-dropdown-link" @click="synchronizationClick(scope.row.id,1)" v-if="currentType==3&&$_has('syncP')">同步</div>
<div v-if="currentType!=3&&currentName!='定时发布'&&listParams.publishStatus!=1&&listParams.publishStatus!=4&&$_has('publishP')">
<el-dropdown @command="(command)=>handleClick(command,scope.row.id)">
<span class="el-dropdown-link">
发布<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command='1'>立即发布</el-dropdown-item>
<el-dropdown-item command='2'>定时发布</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="el-dropdown-link" @click="cancelSetTimeClick(scope.row.id)" v-if="currentName=='定时发布'&&$_has('publishP')">取消定时</div>
<div v-if="listParams.publishStatus!=1&&listParams.publishStatus!=4">
<el-dropdown>
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="copyProdect(scope.row.id)" v-if="currentType==3&&$_has('add')">复制为新产品</el-dropdown-item>
<el-dropdown-item @click.native="downProdect(scope.row.id)" v-if="currentType==3&&$_has('standUD')&&listParams.upShelfStatus==1">下架</el-dropdown-item>
<el-dropdown-item @click.native="upProdect(scope.row.id)" v-if="currentType==3&&$_has('standUD')&&listParams.upShelfStatus==0">上架</el-dropdown-item>
<el-dropdown-item @click.native="gotoBinding(scope.row)" v-if="currentType==3">绑定系统产品</el-dropdown-item>
<el-dropdown-item @click.native="addRemark(scope.row.id)" v-if="$_has('add')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">添加备注</el-dropdown-item>
<el-dropdown-item @click.native="deleteProdect(scope.row.id)" v-if="$_has('delete')&&listParams.publishStatus!=1&&listParams.publishStatus!=4">删除</el-dropdown-item>
<el-dropdown-item @click.native="freightSet(scope.row.id)" v-if="currentType==3&&$_has('add')">运费设置</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="pull-right">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="listParams.currentPage"
:page-sizes="[30, 50, 100, 300]"
:page-size="listParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="listParams.total"
style="float:right;display:inline-block"
></el-pagination>
</div>
</div>
</div>
</div>
</div>
<el-dialog
title="发布"
:visible.sync="dialogVisibleReleased"
width="50%"
@close="dialogVisibleReleased = false">
<div v-if="currentType!=2">
<span>选择Wish店铺:</span>
<el-checkbox v-model="checkAll" @change="handleCheckAllChange">全选</el-checkbox>
<el-input
@input="searchShopClick"
size="mini"
style="width:200px;float:right"
placeholder="请输入店铺名称"
suffix-icon="el-icon-search"
v-model="shopName">
</el-input>
<el-checkbox-group v-model="checkedCities" @change="handleShopChange" class="shop-list">
<el-checkbox v-for="shop in shopAccount" :label="shop.id" :key="shop.id" class="current-shop">{{shop.name}}</el-checkbox>
</el-checkbox-group>
</div>
<div class="mt20" v-if="command==2&&currentType!=3">
<span>定时发布时间:</span>
<el-date-picker
size="small"
v-model="publishDate"
type="datetime"
placeholder="选择日期时间">
</el-date-picker>
</div>
<div class="ml20" v-if="currentType==2&&command!=2">
您确认要发布到wish吗?
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="chooseShopClick">确 定</el-button>
<el-button @click="dialogVisibleReleased = false">取 消</el-button>
</span>
</el-dialog>
<el-dialog
title="备注"
:visible.sync="dialogVisibleRemark"
width="40%"
@close="dialogVisibleRemark = false">
<el-input
type="textarea"
:rows="4"
placeholder="请输入备注内容,认领到平台采集箱时,备注不会认领过去"
v-model="textareaRemark">
</el-input>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="remarkSure">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="提示"
:visible.sync="dialogVisibleDelete"
width="40%"
@close="dialogVisibleDelete = false">
<span>您确定删除吗?</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleDelete = false">取 消</el-button>
<el-button type="primary" @click="dialogVisibleDelete = false">确 定</el-button>
</span>
</el-dialog>
<el-dialog
:title="currentChangeType=='stock'?'批量修改库存':currentChangeType=='deliveryTime'?'批量修改运送时间':'批量修改价格'"
:visible.sync="dialogVisiblePrice"
width="40%"
@close="dialogVisiblePrice = false">
<div class="modal-price" v-if="currentChangeType!='deliveryTime'">
<el-radio v-model="radio" label="1">在原有数量上增加(减少用负数)</el-radio>
<el-input v-model="editPriceAdd" style="width:35%"/>
</div>
<div class="mt20 modal-price" v-if="currentChangeType!='deliveryTime'">
<el-radio v-model="radio" label="2">直接修改</el-radio>
<el-input v-model="editPrice" style="width:35%"/>
</div>
<div class="mt20" v-else>
<span class="pr5">修改运送时间</span>
<el-input-number v-model="editStartTime" style="width:30%" :min="2" :max="65"/> 天 -
<el-input-number v-model="editEndTime" style="width:30%" :min="3" :max="65"/>
<div v-if="editEndTime <= editStartTime" class="f-red">开始时间必须小于结束时间,最大不超过65天</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisiblePrice = false">取 消</el-button>
<el-button type="primary" @click="sureChangePrice">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="从wish同步产品"
:visible.sync="dialogVisibleSynchronization"
width="40%"
@close="dialogVisibleSynchronization = false">
<div>状态: <span class="g19 pl5">{{orderStatus}}</span></div>
<div>详情:</div>
<!-- <div class="ml40" v-for="(item,index) in shopSyncOrderRespDTOS" :key="index" v-if="syncType==2">
yanxiangju,同步完成!共同步成功{{item.successNum}}条数据!
</div> -->
<!-- <div class="ml40" v-if="syncType==2||3">
后台程序正在同步中,请稍后刷新页面查看同步信息
</div> -->
<div v-if="syncType==1&&finishSync" class="ml40">
同步完成!共同步{{successNum}}条数据! <span class="f-red">同步失败{{errorNum}}条数据</span>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleSynchronization = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog
title="提示"
:visible.sync="dialogVisibleMessage"
width="40%"
@close="dialogVisibleMessage = false">
<div>校验通过:<span class="txt-blue">{{successNum}}</span></div>
<div>校验失败:<span class="f-red">{{errorNum}}</span></div>
<div>失败详情:</div>
<div class="ml40" v-for="(item,index) in errorMessage" :key="index">
ID:<span class="f-blue ml10 mr10 poi" @click="editClick(item.id)">{{item.id}}</span>{{item.errorReason}}
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleMessage = false">取 消</el-button>
<el-button type="primary" @click="dialogVisibleMessage = false">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="批量操作"
:visible.sync="dialogVisibleBatch"
width="40%"
@close="dialogVisibleBatch = false">
<div>状态: <span class="f-red pl5">已完成</span></div>
<!-- <div>详情:</div>
<div class="ml40">
已成功修改{{successProductNum}}个产品,{{successVariantNum}}个变种
</div> -->
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleBatch = false">关闭</el-button>
</span>
</el-dialog>
<el-dialog
title="绑定系统产品"
:visible.sync="dialogVisibleSku"
width="80%"
@opened="showMatching"
@close="closeMatching"
top="10vh"
>
<productBindingByPlatformIdDialog
ref="productBindingDialogRef"
></productBindingByPlatformIdDialog>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisibleSku = false"
>确 认</el-button
>
</span>
</el-dialog>
<el-dialog
title="同步产品"
:visible.sync="dialogVisibleProductReleased"
width="60%"
:close-on-click-modal="false"
@close="dialogVisibleProductReleased = false">
<div>
<span>平台:{{agentCode}}</span>
<el-input
@input="searchShopProductClick"
size="mini"
style="width:200px;float:right"
placeholder="请输入店铺名称"
suffix-icon="el-icon-search"
v-model="shopProductName">
</el-input>
<br/>
</div>
<div v-if="redioType=='1'" class="mt20 account-list2">
<table>
<tr>
<td>
<el-radio-group v-model="selectedShops">
<el-radio v-for="shop in shopAccount" :label="shop.name" :key="shop.name" class="current-shop w210 account-list3">{{shop.name}}</el-radio>
</el-radio-group>
</td>
</tr>
</table>
</div>
<br>
<div v-if="redioType=='1'">
输入产品名id:<el-input v-model="syncProduct" class="pct50 ml10" size="mini"></el-input>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="chooseProdectClick">确 定</el-button>
<el-button @click="dialogVisibleProductReleased = false">取 消</el-button>
</span>
</el-dialog>
<setTemplate :dialogVisibleTemlate="dialogVisibleTemlate" :showInput="false" :tableDataDetail="tableDataDetail" :tableDataAllDetail="tableDataAllDetail" :templateOptions="templateOptions" :id="productReleaseId" @sureSaveClick="sureSaveClick" @cancelClick="cancelTemplateClick"></setTemplate>
<syncPollingTemplate :syncPollingVisible="syncPollingVisible" :batchCode="syncBatchCode" @closeSync="closeSync" ref="syncFunction"></syncPollingTemplate>
</div>
</template>
<script>
import datacollectionLeft from '@/components/datacollectionLeft'
import topCrumbs from '@/components/business/topCrumbs'
import util from "@/common/js/util";
import setTemplate from '@/components/business/setTemplate'
import syncPollingTemplate from '@/components/business/syncPollingTemplate'
import productBindingByPlatformIdDialog from "@/components/business/productBindingByPlatformIdDialog";
export default {
data() {
return {
currentType:1,
agentCode:'wish',
firstCrumbs: '',
secondCrumbs: '',
thirdCrumbs: '',
textareaUrl:'',
allShop:[],
shopAccount:[],
dataAccount:[{name:'全部',id:0}],
dataSalesType:[{name:'全部',id:null},{name:'加钻',id:true},{name:'不加钻',id:false}],
authId:0,
authIdArry:[],
dataType:[{name:'SPU',id:0},{name:'标题',id:2}],
activeType:0,
dataTime:[{name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'}],
listParams:{
currentPage: 1,
pageSize: 50,
total: 0,
agentCode:'',
spu:'',
sku:'',
title:'',
platFromProductId:'',
auditStatus:[],
authId:0,
upShelfStatus:1,
orderType:'createDate',
isAsc:false,
publishStatus:'',
classificationId:0,
promoted:null
},
searchContent:'',
checkBoxData:[],
tableData: [],
productIdSpudicts: [],
productBindingDialogData: null,
dialogVisibleSku: false,
dialogVisibleReleased:false,
dialogVisibleRemark:false,
dialogVisibleDelete:false,
dialogVisibleTime:false,
dialogVisiblePrice:false,
dialogVisibleSynchronization:false,
dialogVisibleBatch:false,
value1:'',
textareaRemark:'',
checkAll: false,
checkedCities: [],
currentIndex:'',
ids:[],
radio:'1',
editPriceAdd:'',
editPrice:'',
editStartTime:'',
editEndTime:'',
currentChangeType:'',
remarkId:'',
dataTabList:[{name:'在线',number:0,id:1},{name:'已下架',number:0,id:0}],
orderStatus:'正在同步产品中...',
id:'',
command:'',
publishDate:'',
publishIds:'',
shopSyncOrderRespDTOS:[],
syncType:1,
successNum:0,
errorNum:0,
finishSync:false,
dialogVisibleMessage:false,
errorMessage:[],
currentName:'',
batchModify:'若店铺币种为人民币,则对美元价格的修改不生效',
successProductNum:0,
successVariantNum:0,
shopName:'',
treeData:[],
treeShow:false,
dialogVisibleTemlate:false,
tableDataDetail:[],
tableDataAllDetail:[],
templateOptions:[],
productReleaseId:'',
hasDataBtn:false,
dialogVisibleProductReleased:false,
shopProductName:'',
checkProductAll: false,
checkedProductCities:[],
selectedShops:'',
platformOptions:[{
value: '',
label: '请选择'
}, {
value: 'wish',
label: 'wish'
}],
platformValue:'wish',
syncPollingVisible:false,
syncBatchCode:'',
redioType:'1',
syncProduct:''
}
},
components: {
datacollectionLeft,topCrumbs,setTemplate,syncPollingTemplate, productBindingByPlatformIdDialog
},
methods:{
handleCheckAllProductChange(val) {
let newArry=[]
if(val){
this.shopAccount.map((item)=>{
newArry.push(item.id)
})
}
this.checkedProductCities=newArry
},
handleProductChange(value) {
let checkedCount = value.length;
this.checkProductAll = checkedCount === this.shopAccount.length;
},
searchShopProductClick(val){
let shopArry=[]
this.allShop.map((item)=>{
if(item.name.indexOf(val)>-1){
shopArry.push(item)
}
})
this.shopAccount=shopArry
},
//同步店铺订单
chooseProdectClick(){
if (this.redioType == '1') {
this.syncByPlatformProductId();
} else {
// if (this.checkedProductCities.length > 5) {
// this.$message({
// message: '最多只能选择5个店铺哦~',
// type: 'warning'
// });
// return
// }
// let {checkedProductCities}=this
// console.log(checkedProductCities)
// this.axios({
// url: 'assistant/syncOrder',
// params:{
// id,
// },
// method: "get"
// }).then(res => {
// if(res.success){
// this.dialogVisibleProductReleased=false
// this.checkProductAll=false
// this.checkedProductCities=[]
// this.shopProductName=''
// this.shopAccount=this.allShop
// }
// })
this.synchronizationClick('', this.syncType)
}
},
freightSet(id){
this.axios({
url: 'assistant/product/freightTemplate/findById',
data:{
productReleaseId:id,
},
method: "post"
}).then(res => {
if(res.success){
this.productReleaseId=id
this.tableDataDetail=res.module.details
this.tableDataAllDetail=res.module.details
this.dialogVisibleTemlate=true
}
})
},
getTemplateList(){
this.axios({
url: 'assistant/product/freightTemplate/query',
data:{
currentPage: 1,
pageSize: 1000,
},
method: "post"
}).then(res => {
if(res.success){
this.templateOptions=[]
res.module.result.map((item)=>{
if(item.isOpen){
this.templateOptions.push({value:item.id,label:item.name})
}
})
}
})
},
syncByPlatformProductId(){
this.axios({
url: 'assistant/product/online/syncByPlatformProductId',
data:{
agentCode:this.platformValue,
authCode:this.selectedShops,
platformProductId:this.syncProduct
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '同步中,请稍后查看',
type: 'success'
});
this.dialogVisibleProductReleased = false
this.getProductsList()
}
})
},
sureSaveClick(val){
const{productReleaseId,ids}=this
this.axios({
url: 'assistant/product/online/bindingFreightTemplate',
data:{
details:JSON.stringify(val),
ids: productReleaseId?JSON.stringify(productReleaseId.split(',')):JSON.stringify(ids),
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleTemlate=false
this.getProductsList()
}
})
},
cancelTemplateClick(){
this.dialogVisibleTemlate=false
},
searchActive(value,type){
switch (type) {
case 1:
this.listParams.authId=value
break;
case 2:
this.activeType=value
this.searchTypeChoose()
break;
case 3:
this.searchTypeChoose()
break;
case 4:
this.listParams.auditStatus=JSON.stringify(this.checkBoxData)
break;
case 5:
this.listParams.orderType=value
this.listParams.isAsc=!this.listParams.isAsc
break;
case 6:
this.listParams.promoted=value
break;
default:
break;
}
this.getProductsList()
},
gotoBinding(row){
console.log('绑定系统产品', row)
this.axios({
url: "assistant/product/online/querySpu",
data: {
"platformProductIds": [row.platformProductId],
"hasSku":false
},
method: "post"
}).then(res => {
console.log('res', res)
if (res.success) {
this.productDetails = res.module;
this.productDetails.forEach(element => {
this.productIdSpudicts = []
this.productIdSpudicts.push({
value: element.platformProductId,
label: element.platformSpu
})
});
console.log('productIdSpudicts', this.productIdSpudicts)
let platformProductSkuIdList = [];
row.unitRespDTOS.forEach(dto => {
platformProductSkuIdList.push(dto.platformProductSkuId);
})
this.productBindingDialogData = {
platformProductId: row.platformProductId,
productIdSpudicts:this.productIdSpudicts,
valuePlatform: "platformSku",
platformProductSkuIdList: platformProductSkuIdList,
platformProductIdList:[row]
};
this.dialogVisibleSku = true;
}
})
},
showMatching() {
this.$refs.productBindingDialogRef.listonshow(this.productBindingDialogData);
},
closeMatching(){
this.$refs.productBindingDialogRef.listParamsPlatformProduct.platformProductId = ""
this.productIdSpudicts = {}
this.dialogVisibleSku = false
},
searchTypeChoose(value){
const{activeType}=this
const{searchContent}=this
if(activeType==0){
this.listParams.spu=searchContent
this.listParams.sku=''
this.listParams.title=''
this.listParams.platFromProductId=''
}else if(activeType==1){
this.listParams.spu=''
this.listParams.sku=searchContent
this.listParams.title=''
this.listParams.platFromProductId=''
}else if(activeType==2){
this.listParams.spu=''
this.listParams.sku=''
this.listParams.title=searchContent
this.listParams.platFromProductId=''
}else{
this.listParams.spu=''
this.listParams.sku=''
this.listParams.title=''
this.listParams.platFromProductId=searchContent
}
},
chooseTabs(value){
this.listParams.upShelfStatus=value
this.getProductsList()
},
addRemark(id){
this.remarkId=id
this.dialogVisibleRemark=true
},
remarkSure(){
const{textareaRemark,remarkId,currentType}=this
let url
if(currentType==1){
url='assistant/product/collectBox/remark'
}else if(currentType==2){
url='assistant/product/release/remark'
}else{
url='assistant/product/online/remark'
}
this.axios({
url:url,
data:{
id:remarkId,
remark:textareaRemark
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleRemark=false
this.$message({
message: '备注成功',
type: 'success'
});
this.getProductsList()
}
})
},
handleCheckAllChange(val) {
let newArry=[]
if(val){
this.shopAccount.map((item)=>{
newArry.push(item.id)
})
}
this.checkedCities=newArry
},
handleShopChange(value) {
let checkedCount = value.length;
this.checkAll = checkedCount === this.shopAccount.length;
},
handleClick(command,id){
this.ids=id.split(',')
this.command=command
if(this.currentType==2&&command==1){
this.chooseShopClick()
}else{
this.dialogVisibleReleased=true
}
},
getCurrentLeft(value){
this.currentName=value.name
this.currentType=value.type
this.firstCrumbs='Wish'
this.secondCrumbs=this.currentType == 1 ? '采集箱' : this.currentType == 2 ? '待发布产品' : '在线产品'
this.thirdCrumbs = this.currentType != 1 ? this.currentName : ''
this.listParams.publishStatus=value.name=='定时发布'?4:value.name=='发布中'?1:value.name=='发布失败'?3:''
if(this.listParams.publishStatus!=''){
this.listParams.classificationId=''
}else{
this.listParams.classificationId=value.pid=='assistion_type'?0:value.pid
}
this.dataType=[]
this.dataTime=[]
if(this.currentType==3){
this.dataType.push({name:'SPU',id:0},{name:'SKU',id:1},{name:'标题',id:2},{name:'产品ID',id:3})
this.dataTime.push({name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'},{name:'按收藏量',id:'collectCounts'},{name:'按出售量',id:'sellCounts'})
}else{
if(this.currentType==1){
this.dataType.push({name:'SPU',id:0},{name:'标题',id:2})
}else{
this.dataType.push({name:'SPU',id:0},{name:'SKU',id:1},{name:'标题',id:2})
}
this.dataTime.push({name:'按创建时间',id:'createDate'},{name:'按更新时间',id:'modifyDate'},{name:'按库存量',id:'stock'})
}
this.getProductsList()
},
unfoldClick(index,isUnfold,id) {
const {currentType}=this
if(!isUnfold){
let url
if(currentType==2){
url='assistant/product/release/getReleaseProductInfo'
}
if(currentType==3){
url='assistant/product/online/getEcProductInfo'
}
this.axios({
url,
params:{id},
method: "get"
}).then(res => {
if(res.success){
this.tableData[index].unitRespDTOS=[]
res.module.map((item)=>{
this.tableData[index].unitRespDTOS.push(item)
})
this.$set(this.tableData[index], 'unfold',true)
}
})
}
this.currentIndex=index
},
closeClick(){
this.currentIndex=''
},
cancelClick(rowIndex,arrIndex,type){
this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], `visible${type}`,false)
},
//待发布直接编辑价格及库存
changeClick(id,item,rowIndex,arrIndex,type,moneyChangeVal){
let url
let value=this.$refs[`playBtn${item}`][0].value
let params={
id,
moneyChangeVal
}
if(type=='a'){
// if(moneyChangeVal){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceCn', value)
// }
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceUs', value)
params.sellPriceUs=value
}
if(type=='b'){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'sellPriceCn', value)
params.sellPriceCn=value
}
if(type=='c'){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'stock', value)
params.stock=value
}
if(type=='d'){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], 'freightPrice', value)
params.freightPrice=value
}
if(this.currentType==2){
url='assistant/product/release/edit'
}else{
url='assistant/product/online/modifySku'
}
this.axios({
url,
data:params,
method: "post"
}).then(res => {
if(res.success){
// this.$set(this.tableData[rowIndex].unitRespDTOS[arrIndex], `visible${type}`,false)
this.getProductsList()
}
})
},
sureChangePrice(){
const {ids,currentChangeType,radio,editPrice,editPriceAdd,editStartTime,editEndTime,currentType}=this
let url;
let params={
ids:JSON.stringify(ids)
}
if (currentChangeType==='deliveryTime' && this.editEndTime <= this.editStartTime){
this.$message.warning("开始时间必须小于结束时间,最大不超过65")
return;
}
if(currentType==2){
if(radio==2||currentChangeType=='deliveryTime'){
url='assistant/product/release/batchDirectEdit'//直接
}else{
url='assistant/product/release/batchInDirectEdit'//间接
}
}else{
if(radio==2||currentChangeType=='deliveryTime'){
url='assistant/product/online/batchModifySku'//直接
}else{
url='assistant/product/online/batchModifySkuInDirect'//间接
}
}
switch(currentChangeType){
case 'sellPriceUs':
params.sellPriceUs=radio==2?editPrice:editPriceAdd
params.modifyType=2
break;
case 'sellPriceCn':
params.sellPriceCn=radio==2?editPrice:editPriceAdd
params.modifyType=1
break;
case 'freightPriceUs':
params.freightPriceUs=radio==2?editPrice:editPriceAdd
params.modifyType=3
break;
case 'stock':
params.stock=radio==2?editPrice:editPriceAdd
params.modifyType=4
break;
case 'deliveryTime':
params.deliveryTime=editStartTime+'-'+editEndTime
params.modifyType=5
break;
default:
break;
}
this.axios({
url: url,
data:params,
method: "post"
}).then(res => {
if(res.success){
this.dialogVisiblePrice=false
this.dialogVisibleBatch=true
this.syncBatchCode=res.module.batchCode;
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
// let data=res.module.batchProductUpdateRespDTO
// this.successProductNum=data.successProductNum
// this.successVariantNum=data.successVariantNum
this.getProductsList()
}
})
},
getProductsList(){
let{currentType,listParams}=this
let url
this.listParams.agentCode = this.agentCode;
if(currentType==1){
url='assistant/product/collectBox/query'
}
if(currentType==2){
url='assistant/product/release/query'
}
if(currentType==3){
url='assistant/product/online/query'
this.getOnlineNum(listParams)
}
this.axios({
url: url,
data:listParams,
method: "post"
}).then(res => {
if(res.success){
if(currentType!=3){
let data=res.module
this.tableData=data.result
this.listParams.total=data.total
}
else{
let data=res.module
this.tableData=data.page.result
this.listParams.total=data.page.total
}
}
})
},
getOnlineNum(listParams){
this.axios({
url: "assistant/product/online/queryShelfCount",
data:listParams,
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.$set(this.dataTabList[0],'number',data.upShelfCount)
this.$set(this.dataTabList[1],'number',data.downShelfCount)
}
})
},
cancelSetTimeClick(id){
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
this.$confirm('取消定时发布后,产品将移入到【待发布】页面。您确认要取消吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: 'assistant/product/release/cancelTimePublish',
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '取消定时成功',
type: 'success'
});
this.getProductsList()
// this.$refs.leftMenu.getClassifyAndNum();
}
})
})
},
moveWaitRelease(val,command){
this.dialogVisibleReleased=true
this.command=command
this.ids=[]
this.ids.push(val)
},
editClick(id){
const{currentType}=this
let routeData = this.$router.resolve({
name: "createProduct",
query:{id,currentType}
});
window.open(routeData.href, '_blank');
},
handleSelectionChange(val) {
this.ids=val.map((item=>{
return item.id
}))
},
downProdect(id){
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
this.$confirm('您确认要下架吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: 'assistant/product/online/batchDownShelf',
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '下架成功',
type: 'success'
});
this.getProductsList()
}
})
})
},
upProdect(id){
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
this.$confirm('您确认要上架吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: 'assistant/product/online/batchUpShelf',
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '上架成功',
type: 'success'
});
this.getProductsList()
}
})
})
},
deleteProdect(id){
const{currentType}=this
let ids
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
let url
if(currentType==1){
url='assistant/product/collectBox/delete'
}else if(currentType==2){
url='assistant/product/release/delete'
}else{
url='assistant/product/online/delete'
}
let message = '您确认要删除吗?'
if (currentType == 3){
message = '删除产品同时会删除平台上的产品,不可恢复,是否继续?'
}
this.$confirm(message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
url: url,
data:{
ids:JSON.stringify(ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$message({
message: '删除成功',
type: 'success'
});
this.getProductsList()
// this.$refs.leftMenu.getClassifyAndNum();
}
})
})
},
closeSync(val){
this.syncPollingVisible=val;
this.getProductsList();
this.syncBatchCode='';
},
synchronizationClick(id,type){
this.finishSync=false
this.syncType=type
this.orderStatus='正在同步产品中...'
this.dialogVisibleProductReleased=false
this.shopSyncOrderRespDTOS=[]
this.successNum=0
this.errorNum=0
let ids
let url
if(id){
ids=id.split(',')
}else{
ids=this.ids
}
const{ listParams,authIdArry,checkedProductCities }=this
if(type==1){
url='assistant/product/online/syncProduct'
this.dialogVisibleSynchronization=true
}else if(type==2){
url='assistant/product/online/sync'
}else{
url='assistant/product/online/getProductsShipping'
}
this.axios({
url,
data:{
ids:JSON.stringify(ids),
// shopIds:listParams.authId==0?JSON.stringify(authIdArry):listParams.authId
shopIds:type!=1&&listParams.authId==0?JSON.stringify(checkedProductCities):listParams.authId
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
if (type == 2){
this.syncBatchCode=res.module.batchCode;
this.syncPollingVisible=true;
this.$refs.syncFunction.pollingQuery();
}else{
this.orderStatus='已完成!'
this.finishSync=true
this.successNum=data.successNum
this.errorNum=data.errorNum
}
this.getProductsList()
}
else{
this.dialogVisibleSynchronization=false
}
})
},
handleProductClick(command){
this.checkedProductCities=[]
let type=command==1?2:command==2?1:3
this.syncType=type
if((command==2 || command == 3) && this.ids.length==0){
this.$message.error('请至少选中一个产品')
return
}
if(command==1){
this.dialogVisibleProductReleased=true
}else{
this.synchronizationClick('',type)
}
},
handleClickBatch(command){
const{ids}=this
if(ids.length==0){
this.$message.error('请至少选中一个产品')
return
}
if(this.listParams.authId==0&&this.currentType!=3&&command==12){
this.$message.error('请选择店铺')
return
}
switch (command) {
case '1':
this.command=command
this.dialogVisibleReleased=true
break;
case '2':
this.command=command
this.dialogVisibleReleased=true
break;
case '3':
this.command=command
this.dialogVisibleReleased=true
break;
case '4':
this.deleteProdect()
break;
case '5':
this.dialogVisiblePrice=true
this.currentChangeType='sellPriceUs'
break;
case '6':
this.dialogVisiblePrice=true
this.currentChangeType='sellPriceCn'
break;
case '7':
this.dialogVisiblePrice=true
this.currentChangeType='freightPriceUs'
break;
case '8':
this.dialogVisiblePrice=true
this.currentChangeType='stock'
break;
case '9':
this.dialogVisiblePrice=true
this.currentChangeType='deliveryTime'
break;
case '10':
this.downProdect()
break;
case '11':
this.cancelSetTimeClick()
break;
case '12':
this.freightSet('')
this.productReleaseId=''
break;
case '13':
this.upProdect()
break;
default:
break;
}
},
copyProdect(id){
this.dialogVisibleReleased=true
this.id=id
},
chooseShopClick(){
const {ids,checkedCities,id,currentType,command}=this
let url
let that=this
if(currentType!=3){//wish采集箱定时或立即发布或移入待发布
if(currentType==1){
if(command==1){
url='assistant/product/collectBox/publish'
}else if(command==2){
this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
url='assistant/product/collectBox/timePublish'
}else if(command==3){
url='assistant/product/collectBox/toPublish'
}
}else{
if(command==1){
url='assistant/product/release/publish'
}else{
this.publishDate=this.publishDate?(util.formatDate.format(new Date(this.publishDate), "yyyy-MM-dd hh:mm:ss")):''
url='assistant/product/release/timePublish'
}
}
this.axios({
url,
data:{
ids:JSON.stringify(ids),
shopIds:JSON.stringify(checkedCities),
publishDate:this.publishDate,
},
method: "post"
}).then(res => {
if(res.success){
// this.$refs.leftMenu.getClassifyAndNum();
this.getProductsList()
this.dialogVisibleReleased=false
this.checkAll=false
this.checkedCities=[]
if(command==3){
this.$message({
message: '操作成功',
type: 'success'
});
}else{
let data=res.module.checkResultRespDTO
if(data.checkResult){
this.$message({
message: '提交发布成功,请到【发布中】,【发布失败】,【在线产品】查看发布情况',
type: 'success'
});
let setTime
setTime=setInterval(function () {
if(that.$route.path=='/product/productList'&&that.$refs.leftMenu.getCurSide[1].children[1].number>0){
// that.$refs.leftMenu.getClassifyAndNum(1);
this.getProductsList()
}else{
clearInterval(setTime)
}
}, 3000);
}else{
this.dialogVisibleMessage=true
this.errorMessage=data.productInfos
this.errorNum=data.errorNum
this.successNum=data.successNum
}
}
this.shopName=''
this.shopAccount=this.allShop
}
})
}
if(currentType==3){//复制为新产品
this.axios({
url: 'assistant/product/online/copy',
data:{
id,
shopIds:JSON.stringify(checkedCities)
},
method: "post"
}).then(res => {
if(res.success){
this.dialogVisibleReleased=false
this.checkAll=false
this.checkedCities=[]
this.$message({
message: '复制为新产品成功',
type: 'success'
});
this.$refs.leftMenu.getClassifyAndNum();
}
})
}
},
getShopList(){
this.axios({
url: 'assistant/getShops',
data:{
agentName:'wish'
},
method: "post"
}).then(res => {
if(res.success){
res.module.map((item)=>{
this.allShop.push({name:item.authCode,id:item.id})
this.shopAccount.push({name:item.authCode,id:item.id})
this.dataAccount.push({name:item.authCode,id:item.id})
this.authIdArry.push(item.id)
})
}
})
},
handleSizeChange(val) {
this.listParams.pageSize = val;
this.getProductsList();
},
handleCurrentChange(val) {
this.listParams.currentPage = val;
this.getProductsList();
},
goIndex(){
localStorage.setItem('leftMenu','dataCollection');
let routeData = this.$router.resolve({
name: "dataCollection",
});
window.open(routeData.href, '_blank');
},
copyUrl(data){
util.copyUrl(data)
},
searchShopClick(val){
let shopArry=[]
this.allShop.map((item)=>{
if(item.name.indexOf(val)>-1){
shopArry.push(item)
}
})
this.shopAccount=shopArry
},
getClassify(){
this.axios({
url: 'assistant/dictionary/getClassificationList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.treeData=res.module.dataTree
}
})
},
SwitchNode(data,node){
this.treeShow=false
if(this.ids.length==0){
this.$message({
message:"请至少选择一个产品",
type:"error"
})
return
}
this.axios({
url: this.currentType==2?'assistant/product/release/mobileClassification':'assistant/product/online/mobileClassification',
data:{
classificationId:data.pid,
ids:JSON.stringify(this.ids)
},
method: "post"
}).then(res => {
if(res.success){
this.$refs.leftMenu.getClassifyAndNum();
this.getProductsList();
}
})
},
openNewUrl(url){
window.open(url, '_blank');
},
getTpye(){
this.axios({
url: 'assistant/info/get/typeList',
data:{},
method: "post"
}).then(res => {
if(res.success){
this.typeArry=res.module
this.typeCode=this.typeCode?this.typeCode:res.module[0].code
this.getSize()
}
})
},
getSize(){
const{typeCode,id}=this
this.axios({
url: 'assistant/info/get/sizeList',
data:{
parentCode:typeCode,
id
},
method: "post"
}).then(res => {
if(res.success){
let data=res.module
this.tableShow=data.table
if(data.table){
this.mulTableData=data.mulTableData
this.tableConfig=data.tableConfigs
}else{
this.otherSizeCodeNew=[]
this.otherSizeCodeNew=this.sizeCode
if(typeCode=='custom'){
if(data.data){
this.otherSizeCode=data.data.map((item)=>{
return item= Object.assign({}, item, { isEdit:false})
})
}else{
this.otherSizeCode=[]
}
}else{
this.otherSizeCode=data.data
}
}
}
})
},
},
mounted(){
this.currentType=this.$route.query.id||1
// this.getCurrentLeft({type:this.currentType,name:'',pid:0})
this.getShopList()
this.getClassify()
if(this.currentType==3){
this.getTemplateList()
}
if(this.currentType==1){
let btnPermissionList = JSON.parse(localStorage.getItem('permissionsArry'))
this.hasDataBtn=btnPermissionList.some((item)=>{
return item.title=='通用板块'
})
}
},
}
</script>
<style lang="less" scoped>
.shop-list{
display:flex;
margin:20px 5px;
flex-wrap:wrap;
// justify-content:space-between;
max-height:300px;
overflow:auto;
clear:both;
.current-shop{
width:120px;
overflow:hidden
}
}
.content-right{
width:85%;
.content-top{
background: #FFFFFF;
.btn {
display: inline-block;
vertical-align: middle;
height: 34px;
width: 80px;
margin-right: 10px;
font-size: 13px;
}
.container-o-box{
.default{
margin: 0;
width: 100%;
}
.com-block {
border: 1px solid #ccc;
width: 100%;
background-color: #fff;
box-shadow: 0 0 0 0;
border-top:none;
.productSearchGroup input[type="text"] {
display: inline-block;
width: 410px;
vertical-align: middle;
margin-right: 10px;
padding-right: 90px;
}
.search-tab {
padding: 5px;
.border-dashed-top1 {
border-top: 1px dashed #ccc !important;
}
table{
width:100%;
tbody > tr > td {
padding: 2px 5px;
line-height: 34px;
vertical-align: top;
}
tbody > tr > td:first-child {
width: 80px;
min-width: 80px;
max-width: 100px;
text-align: left;
color: #a0a3a6;
}
table > tbody > tr > td:nth-child(2) {
padding: 5px;
}
tbody > tr > td .tab-in > a {
padding: 0 3px;
cursor: pointer;
}
tbody > tr > td > a {
float: left;
margin: 5px 20px 5px 0;
padding: 0 3px;
}
a{
color: #367EE2;
text-decoration: none;
}
a.myj-aFocus {
display: flex;
padding: 2px 2px;
line-height: 18px;
vertical-align: middle;
}
.tp24{
padding-top:4px;
}
.myj-active {
background-color: #367EE2;
color: #fff;
}
.m-right15 {
margin-right: 15px !important;
}
.p-right0 {
padding-right: 0 !important;
}
.gray-c {
color: #737679 !important;
}
.account-list{
display: inline-block;
max-height: 300px;
overflow: auto;
}
}
}
}
}
.pull-right {
float: right!important;
// margin-bottom:10px;
}
.post_divA {
padding-left: 19px;
background: url(../../assets/img/arrowgreen1.png) no-repeat left -128px;
}
.post_crawl .p_style3 {
background-position-y: -3px !important;
background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% 0;
color: #666;
}
.post_divA p, .post_divB p {
margin: 0;
height: 31px;
line-height: 21px;
font-size: 12px;
float: left;
text-align: center;
width: 25%;
}
.w120 {
width: 120px !important;
}
.h25 {
height: 25px !important;
}
.m-bottom10{
margin-bottom: 10px !important
}
.lh15-imp {
line-height: 25px !important;
}
.post_crawl .p_style4A {
background-position-y: -67px !important;
background: #e4e4e4 url(../../assets/img/arrowgreen1.png) no-repeat 100.2% -65px;
color: #666;
}
.border4 {
border: 1px solid #ccc !important;
clear: both;
}
.tab-content>.active {
display: block;
visibility: visible;
}
.form-control {
display: block;
width: 100%;
height: auto;
padding: 6px 12px;
line-height: 1.42857143;
color: #555;
background-color: #fff;
background-image: none;
border: 1px solid #ccc;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}
.p-top10 {
padding-top: 10px!important;
}
.p30{
padding:38px 10px;
}
.btn-determine {
font-size: 13px;
border-color: #367EE2;
color: #fff;
background-color: #367EE2;
}
.btn-gray {
border-color: #d0d3d6;
font-size: 13px;
color: #434649;
background-color: #f2f2f2;
}
.m-left8 {
margin-left: 8px !important;
}
.border5{
clear: both;
.el-table--border, .el-table--group {
border: 1px solid #ccc!important;
}
.el-table thead{
color: #333
}
.el-table thead tr th {
background-color: #eee!important;
}
.el-dropdown-link {
cursor: pointer;
color: #367EE2;
font-size: 13px;
}
.imgCss{
width: 71px;
height: 71px;
display: block;
border:1px solid #ccc
}
.control-heightOpen{
overflow: hidden;
}
.control-heightUp{
max-height: 141px;
overflow: hidden;
}
.variant-input-control{
position: absolute;
top: 0;
left: 0;
text-align: center;
background-color: #F2F2F2;
z-index: 1;
width: 100px;
.variant-update-input{
padding: 6px;
width: 100%;
height: 24px;
line-height: 24px;
display: inline-block;
}
.btn-edit-enter {
margin-right: 2px;
border-radius: 2px;
padding: 0;
width: 29px;
height: 20px;
font-size: 12px;
line-height: 18px;
background-color: #5399D5;
}
.btn-edit-restart {
border-radius: 2px;
padding: 0;
width: 29px;
height: 20px;
font-size: 12px;
line-height: 18px;
background-color: #5399D5;
}
}
.custom-table-title{
span{
width: 95px;
display: inline-block;
}
}
.custom-table{
border-bottom: 1px solid #EBEEF5;
span{
width: 95px;
display: inline-block;
cursor: pointer;
}
span:first-child{
cursor: auto;
}
.activeInput{
background: #ccc
}
}
.custom-table:last-child{
border:none
}
.unfold-show{
color: #367EE2;
text-align: right;
font-size: 13px;
}
}
.content-button{
display: flex;
justify-content: space-between;
margin:10px;
.el-button--primary{
background-color: #367EE2;
border-color: #367EE2;
}
}
}
}
.variant-input-control{
text-align: center;
background-color: #F2F2F2;
.variant-update-input{
padding: 6px;
width: 100%;
height: 24px;
line-height: 24px;
display: inline-block;
border: 1px solid #999;
}
.btn-edit-enter {
margin-right: 2px;
border-radius: 2px;
padding: 0;
width: 40px;
height: 20px;
line-height: 18px;
background-color: #5399D5;
color: #fff
}
.btn-edit-restart {
border-radius: 2px;
padding: 0;
width: 40px;
height: 20px;
line-height: 18px;
background-color: #5399D5;
color: #fff
}
}
.modal-price{
display: flex;
justify-content: space-between;
align-items: center;
}
.audit-status{
border: 1px solid #d6ad1a;
color: #d6ad1a;
width:20px;
height:20px;
border-radius:4px;
line-height:20px;
text-align:center
}
.error-message{
border-radius: 4px;
border: 1px solid #ccc;
color:#ec4339
}
.tree-type{
position:relative;
display: inline-block;
background-color: #367EE2;
border-radius: 4px;color: #FFF;
.tree-select{
min-width:100px;
height:34px;
border-color: #367EE2;
border-radius:4px;
padding: 6px 12px;
}
.tree-data{
position: absolute;
top: 34px;
z-index: 2;
border: 1px solid #eee;
min-width:240px;
max-height:350px;
overflow:auto;
}
}
.account-list2{
max-height: 200px;
overflow: auto;
}
.account-list3{
max-width: 250px;
overflow: auto;
}
</style>
//test
export const increment = ({commit}) => {
commit('INCREMENT')
}
export const decrement = ({commit}) => {
commit('DECREMENT')
}
//test
export const getCount = state => {
return state.count
}
const state = {
dataObj: {
region: 'oss-cn-hangzhou',
accessKeyId: 'LTAI4Fopz6vz2f4ni8By4a2P',
accessKeySecret: 'mfzrmhqP5a8JwWP4WNNW2DDWUPZOQ3',
bucket: 'jzm-oss'
},
baseAli: 'oss-cn-hangzhou.aliyuncs.com',
count:10,
//顶部菜单树
topMenuTree:[
{
path: '/',
name: '产品',
children: [
{ path: '/product/dataCollection',name: '数据采集',leaf: true},
{
name: 'wish采集箱',
path: '/product/wishproductList',
leaf: true
},
{
path: '/',
name: '运费模板',
leaf: true
}
]
},
{
path: '/',
name: '订单',
leaf: true,
children: [
{ path: '/nav2/test2',name: '测试2-1',leaf: true},
{
path: '/',
name: '测试2-2',
children: [
{ path: '/nav2/test21', name: '测试2-2-1' }
]
}
]
},
{
path: '/',
name: '客服',
leaf: true,
children: [
{ path: '/nav3/test3',name: '测试3-1'}
]
}
],
// 左侧菜单树
menuTree:{
dataCollection:[
{
path: '/',
name: '通用服务',
children: [
{ path: '/product/dataCollection',name: '数据采集'}
]
},
{
path: '/',
name: '采集箱',
children: [
{ path: '/product/productList', name: 'wish(20)' }
]
}
],
templateList:[
{
path: '/',
name: '常用模板',
children: [
{ path: '/product/templateList',name: '运费模板'}
]
},
],
orderList:[
{
path: '/',
name: '订单',
children: [
{ path: '/order/orderList',name: '全部订单(20)'},
{ path: '/order/waitSend',name: '待审核(20)'},
{ path: '/order/failSend',name: '发货失败(40)'},
{ path: '/order/successSend',name: '发货成功(30)'}
]
}
],
shopList:[
{
path: '/',
name: '平台授权',
children: [
{ path: '/shopAuthorization/shopList',name: '店铺授权'},
]
}
],
serviceList:[
{
path: '/',
name: 'Wish客服',
children: [
{ path: '/service/serviceList',name: '未处理消息(33)'}
]
}
],
systemList:[
{
path: '/',
name: '系统管理',
children: [
{ path: '/systemManagement/rightsManagement',name: '权限管理'}
]
}
],
advertisingList:[
{
path: '/',
name: 'PB广告',
children: [
{ path: '/advertising/activityManagement',name: '广告管理'},
{ path: '/advertising/storePerformance',name: '店铺表现'},
{ path: '/advertising/activityPerformance',name: '活动表现'},
{ path: '/advertising/productPerformance',name: '产品表现'}
]
}
],
shortMessageList:[
{
path: '/',
name: '服务',
children: [
{ path: '/shortMessageService/textMessaging',name: '短信发送管理'},
{ path: '/shortMessageService/messageTemplate',name: '短信模板管理'},
{ path: '/shortMessageService/sendData',name: '发送数据'},
]
}
],
epcList:[
{
path: '/',
name: 'EPC管理',
children: [
{ path: '/epcManage/epcList',name: 'EPC服务'},
]
}
],
logisticsList:[
{
path: '/',
name: '物流',
children: [
{ path: '/logistics/logisticsQuery',name: '物流查询'},
{ path: '/logistics/logisticsWarning',name: '物流预警'},
]
}
],
currentMenu:[
{
path: '/',
name: '通用服务',
children: [
{ path: '/product/dataCollection',name: '数据采集'}
]
},
{
path: '/',
name: '采集箱',
children: [
{ path: '/product/productList', name: 'wish(20)' }
]
}
]
}
};
const getters={
count:state => {
return state.count
}
}
const mutations = {
initSide(state,newState){
state.menuTree['currentMenu']=state.menuTree[newState]
},
increment(state) {
state.count++
},
decrement(state) {
state.count--
}
}
export default {
state,mutations,getters
}
\ No newline at end of file
// import Vue from 'vue'
// import Vuex from 'vuex'
import global from './global'
Vue.use(Vuex);
export default new Vuex.Store({
modules: {
global
}
})
\ No newline at end of file
const local = {};
local.install = (Vue,)=>{
Vue.prototype.$getLocalStorageByName = local.$getLocalStorageByName;
Vue.prototype.$setLocalStorageByName = local.$setLocalStorageByName;
}
local.$getLocalStorageByName = (name) => {
if(!localStorage || !localStorage.getItem){
throw Error('浏览器不支持localStorage');
return;
}
let s = name ? localStorage.getItem(name) : localStorage;
try{
return JSON.parse(s);
}catch(e){
return s;
}
}
local.$setLocalStorageByName = (name,value) => {
if(!localStorage || !localStorage.setItem){
throw Error('浏览器不支持localStorage');
return;
}
localStorage.setItem(name,typeof value === 'object' ? JSON.stringify(value) : value);
// if(typeof name == 'object'){
// for(var k in name){
// if(typeof name[k] == 'undefined'){continue}
// localStorage.setItem(k,name[k]);
// }
// }else{
// localStorage.setItem(name,value);
// }
}
export default local;
export default{
state(){
return{
count:10
}
},
// getters:{
// count:state => {
// return state.count
// }
// },
mutations: {
increment(state) {
state.count++
},
decrement(state) {
state.count--
}
}
}
\ No newline at end of file
// import Vue from 'vue'
// import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'
Vue.use(Vuex)
// 应用初始状态
const state = {
count: 10
}
// 定义所需的 mutations
const mutations = {
INCREMENT(state) {
state.count++
},
DECREMENT(state) {
state.count--
}
}
// 创建 store 实例
export default new Vuex.Store({
actions,
getters,
state,
mutations
})
\ No newline at end of file
/*!
* @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CKEditor=e():t.CKEditor=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(1))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var i=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},r=n(0),o="object"==typeof self&&self&&self.Object===Object&&self,u=r.a||o||Function("return this")(),a=function(){return u.Date.now()},c=u.Symbol,s=Object.prototype,f=s.hasOwnProperty,l=s.toString,d=c?c.toStringTag:void 0;var p=function(t){var e=f.call(t,d),n=t[d];try{t[d]=void 0;var i=!0}catch(t){}var r=l.call(t);return i&&(e?t[d]=n:delete t[d]),r},v=Object.prototype.toString;var y=function(t){return v.call(t)},b="[object Null]",h="[object Undefined]",m=c?c.toStringTag:void 0;var g=function(t){return null==t?void 0===t?h:b:m&&m in Object(t)?p(t):y(t)};var j=function(t){return null!=t&&"object"==typeof t},O="[object Symbol]";var w=function(t){return"symbol"==typeof t||j(t)&&g(t)==O},x=NaN,$=/^\s+|\s+$/g,S=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,T=/^0o[0-7]+$/i,_=parseInt;var D=function(t){if("number"==typeof t)return t;if(w(t))return x;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace($,"");var n=E.test(t);return n||T.test(t)?_(t.slice(2),n?2:8):S.test(t)?x:+t},M="Expected a function",P=Math.max,N=Math.min;var F=function(t,e,n){var r,o,u,c,s,f,l=0,d=!1,p=!1,v=!0;if("function"!=typeof t)throw new TypeError(M);function y(e){var n=r,i=o;return r=o=void 0,l=e,c=t.apply(i,n)}function b(t){var n=t-f;return void 0===f||n>=e||n<0||p&&t-l>=u}function h(){var t=a();if(b(t))return m(t);s=setTimeout(h,function(t){var n=e-(t-f);return p?N(n,u-(t-l)):n}(t))}function m(t){return s=void 0,v&&r?y(t):(r=o=void 0,c)}function g(){var t=a(),n=b(t);if(r=arguments,o=this,f=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(h,e),d?y(t):c}(f);if(p)return clearTimeout(s),s=setTimeout(h,e),y(f)}return void 0===s&&(s=setTimeout(h,e)),c}return e=D(e)||0,i(n)&&(d=!!n.leading,u=(p="maxWait"in n)?P(D(n.maxWait)||0,e):u,v="trailing"in n?!!n.trailing:v),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=f=o=s=void 0},g.flush=function(){return void 0===s?c:m(a())},g};var U={name:"ckeditor",render(t){return t(this.tagName)},props:{editor:{type:Function,default:null},value:{type:String,default:""},config:{type:Object,default:()=>({})},tagName:{type:String,default:"div"},disabled:{type:Boolean,default:!1}},data:()=>({instance:null,$_lastEditorData:{type:String,default:""}}),mounted(){const t=Object.assign({},this.config);this.value&&(t.initialData=this.value),this.editor.create(this.$el,t).then(t=>{this.instance=t,t.isReadOnly=this.disabled,this.$_setUpEditorEvents(),this.$emit("ready",t)}).catch(t=>{console.error(t)})},beforeDestroy(){this.instance&&(this.instance.destroy(),this.instance=null),this.$emit("destroy",this.instance)},watch:{value(t,e){t!==e&&t!==this.$_lastEditorData&&this.instance.setData(t)},disabled(t){this.instance.isReadOnly=t}},methods:{$_setUpEditorEvents(){const t=this.instance;t.model.document.on("change:data",F(e=>{const n=this.$_lastEditorData=t.getData();this.$emit("input",n,e,t)},300)),t.editing.view.document.on("focus",e=>{this.$emit("focus",e,t)}),t.editing.view.document.on("blur",e=>{this.$emit("blur",e,t)})}}};const k={install(t){t.component("ckeditor",U)},component:U};e.default=k}]).default});
//# sourceMappingURL=ckeditor.js.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment