Commit 0972ee66 authored by xiejb's avatar xiejb

初始化分支

parent 8187a000
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": [
"transform-vue-jsx",
"transform-runtime",
["import", {
"libraryName": "vant",
"libraryDirectory": "es",
"style": true
}]
],
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
}
}
}
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
/build/
/config/
/dist/
/*.js
/test/unit/coverage/
// https://eslint.org/docs/user-guide/configuring
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
},
extends: [
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
'plugin:vue/essential',
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
'standard'
],
// required to lint *.vue files
plugins: [
'vue'
],
// add your custom rules here
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
"space-before-function-paren": 'off',
"camelcase": 'off',
}
}
.DS_Store
node_modules/
/dll
/dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
/test/unit/coverage/
# Editor directories and files
.idea
.prettierrc
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
// https://github.com/michael-ciniawsky/postcss-load-config
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
// to edit target browsers: use "browserslist" field in package.json
"autoprefixer": {},
'postcss-pxtorem': {
rootValue: 37.5,
propList: ['*']
}
}
}
# bas_pms
#### Description
{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**}
#### Software Architecture
Software architecture description
#### Installation
1. xxxx
2. xxxx
3. xxxx
#### Instructions
1. xxxx
2. xxxx
3. xxxx
#### Contribution
1. Fork the repository
2. Create Feat_xxx branch
3. Commit your code
4. Create Pull Request
#### Gitee Feature
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
4. The most valuable open source project [GVP](https://gitee.com/gvp)
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
\ No newline at end of file
# basi
> BASI
## Build Setup
``` bash
# install dependencies
npm install
npm run build:dll
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
# run unit tests
npm run unit
# run all tests
npm test
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
'use strict'
require('./check-versions')()
process.env.NODE_ENV = 'production'
const ora = require('ora')
const rm = require('rimraf')
const path = require('path')
const chalk = require('chalk')
const webpack = require('webpack')
const config = require('../config')
const webpackConfig = require('./webpack.prod.conf')
const spinner = ora('building for production...')
spinner.start()
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
if (err) throw err
webpack(webpackConfig, (err, stats) => {
spinner.stop()
if (err) throw err
process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
chunks: false,
chunkModules: false
}) + '\n\n')
if (stats.hasErrors()) {
console.log(chalk.red(' Build failed with errors.\n'))
process.exit(1)
}
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'
))
})
})
'use strict'
const chalk = require('chalk')
const semver = require('semver')
const packageConfig = require('../package.json')
const shell = require('shelljs')
function exec (cmd) {
return require('child_process').execSync(cmd).toString().trim()
}
const 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 () {
const warnings = []
for (let i = 0; i < versionRequirements.length; i++) {
const 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 (let i = 0; i < warnings.length; i++) {
const warning = warnings[i]
console.log(' ' + warning)
}
console.log()
process.exit(1)
}
}
'use strict'
const path = require('path')
const config = require('../config')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const packageConfig = require('../package.json')
exports.assetsPath = function (_path) {
const assetsSubDirectory = process.env.NODE_ENV === 'production'
? config.build.assetsSubDirectory
: config.dev.assetsSubDirectory
return path.posix.join(assetsSubDirectory, _path)
}
exports.cssLoaders = function (options) {
options = options || {}
const cssLoader = {
loader: 'css-loader',
options: {
sourceMap: options.sourceMap
}
}
const postcssLoader = {
loader: 'postcss-loader',
options: {
sourceMap: options.sourceMap
}
}
// generate loader string to be used with extract text plugin
function generateLoaders (loader, loaderOptions) {
const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
if (loader) {
loaders.push({
loader: loader + '-loader',
options: Object.assign({}, loaderOptions, {
sourceMap: options.sourceMap
})
})
// SASS 配置
if (loader === 'sass' || loader === 'scss') {
loaders.push({
loader: 'sass-resources-loader',
options: {
// it need a absolute path
resources: path.resolve(__dirname, '../src/assets/styles/variable.scss')
}
})
}
}
// 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',
publicPath: '../../'
})
} 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) {
const output = []
const loaders = exports.cssLoaders(options)
for (const extension in loaders) {
const loader = loaders[extension]
output.push({
test: new RegExp('\\.' + extension + '$'),
use: loader
})
}
return output
}
exports.createNotifierCallback = () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || '',
icon: path.join(__dirname, 'logo.png')
})
}
}
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
const loaders = utils.cssLoaders({
sourceMap: sourceMapEnabled,
extract: isProduction
})
loaders.js = 'happypack/loader?id=babel'
module.exports = {
loaders: loaders,
cssSourceMap: sourceMapEnabled,
cacheBusting: config.dev.cacheBusting,
transformToRequire: {
video: ['src', 'poster'],
source: 'src',
img: 'src',
image: 'xlink:href'
}
}
'use strict'
const os = require('os');
const path = require('path')
const utils = require('./utils')
const config = require('../config')
const vueLoaderConfig = require('./vue-loader.conf')
const HappyPack = require('happypack');
const happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length });
function resolve (dir) {
return path.join(__dirname, '..', dir)
}
// const createLintingRule = () => ({
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter'),
// emitWarning: !config.dev.showEslintErrorsInOverlay
// }
// })
module.exports = {
externals: {
'AMap': 'AMap'
},
context: path.resolve(__dirname, '../'),
entry: {
app: './src/main.js'
},
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'),
}
},
module: {
rules: [
// ...(config.dev.useEslint ? [createLintingRule()] : []),
{
test: /\.vue$/,
loader: 'vue-loader',
options: vueLoaderConfig
},
{
test: /\.js$/,
loader: 'happypack/loader?id=babel',
include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]')
}
},
{
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('media/[name].[hash:7].[ext]')
}
},
{
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
loader: 'url-loader',
options: {
limit: 10000,
name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
}
}
]
},
node: {
// prevent webpack from injecting useless setImmediate polyfill because Vue
// source contains it (although only uses it if it's native).
setImmediate: false,
// prevent webpack from injecting mocks to Node native modules
// that does not make sense for the client
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty'
},
plugins: [
new HappyPack({ id: 'babel', threadPool: happyThreadPool, loaders: ['babel-loader?cacheDirectory=true'] })
]
}
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const AddAssetHtmlPlugin = require('add-asset-html-webpack-plugin');
const portfinder = require('portfinder')
const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)
const devWebpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
},
// cheap-module-eval-source-map is faster for development
devtool: config.dev.devtool,
// these devServer options should be customized in /config/index.js
devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
proxy: config.dev.proxyTable,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': require('../config/dev.env')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DllReferencePlugin({
context: __dirname,
manifest: require(path.join(__dirname, '..', '/dll', '/manifest.json'))
}),
// https://github.com/ampedandwired/html-webpack-plugin
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'index.html',
inject: true
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.dev.assetsSubDirectory,
ignore: ['.*']
}
]),
new AddAssetHtmlPlugin([{
filepath: path.join(__dirname, '..', '/dll', '/vendor.js'),
includeSourcemap: false,
hash: true
}]),
]
})
module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.dev.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
devWebpackConfig.devServer.port = port
// Add FriendlyErrorsPlugin
devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
},
onErrors: config.dev.notifyOnErrors
? utils.createNotifierCallback()
: undefined
}))
resolve(devWebpackConfig)
}
})
})
const os = require('os');
const path = require('path');
const chalk = require('chalk');
const webpack = require("webpack");
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const {
BundleAnalyzerPlugin
} = require('webpack-bundle-analyzer')
const dllPath = path.join(__dirname, '../dll');
module.exports = {
entry: {
vendor: [
'vue',
'vue-router',
'vuex',
'axios'
]
},
output: {
path: dllPath,
filename: "[name].js",
library: "_dll_[name]"
},
plugins: [
new webpack.DllPlugin({
name: "_dll_[name]",
path: path.join(__dirname, '../dll','manifest.json'),
context: __dirname
}),
new BundleAnalyzerPlugin({
analyzerMode: 'static'
}),
new UglifyJsPlugin({
uglifyOptions: {
ie8: false,
ecma: 8,
mangle: true,
output: { comments: false },
compress: { warnings: false }
},
sourceMap: false,
cache: true,
parallel: os.cpus().length * 2
})
]
}
'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const env = process.env.NODE_ENV === 'testing'
? require('../config/test.env')
: require('../config/prod.env')
const webpackConfig = merge(baseWebpackConfig, {
module: {
rules: utils.styleLoaders({
sourceMap: config.build.productionSourceMap,
extract: true,
usePostCSS: true
})
},
devtool: config.build.productionSourceMap ? config.build.devtool : 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 UglifyJsPlugin({
uglifyOptions: {
compress: {
warnings: false, //删除无用代码时不输出警告
drop_console: true, //删除所有console语句,可以兼容IE
collapse_vars: true, //内嵌已定义但只使用一次的变量
reduce_vars: true, //提取使用多次但没定义的静态值到变量
},
output: {
beautify: false, //最紧凑的输出,不保留空格和制表符
comments: false, //删除所有注释
}
},
sourceMap: config.build.productionSourceMap,
parallel: true
}),
// extract css into its own file
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'),
// Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
// increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
allChunks: true,
}),
// Compress extracted CSS. We are using this plugin so that possible
// duplicated CSS from different components can be deduped.
new OptimizeCSSPlugin({
cssProcessorOptions: config.build.productionSourceMap
? { safe: true, map: { inline: false } }
: { 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: process.env.NODE_ENV === 'testing'
? 'index.html'
: 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'
}),
// keep module.id stable when vendor modules does not change
new webpack.HashedModuleIdsPlugin(),
// enable scope hoisting
new webpack.optimize.ModuleConcatenationPlugin(),
// split vendor js into its own file
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks (module) {
// 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',
minChunks: Infinity
}),
// This instance extracts shared chunks from code splitted chunks and bundles them
// in a separate chunk, similar to the vendor chunk
// see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
new webpack.optimize.CommonsChunkPlugin({
name: 'app',
async: 'vendor-async',
children: true,
minChunks: 3
}),
// copy custom static assets
new CopyWebpackPlugin([
{
from: path.resolve(__dirname, '../static'),
to: config.build.assetsSubDirectory,
ignore: ['.*']
}
])
]
})
if (config.build.productionGzip) {
const CompressionWebpackPlugin = require('compression-webpack-plugin')
webpackConfig.plugins.push(
new CompressionWebpackPlugin({
filename: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp(
'\\.(' +
config.build.productionGzipExtensions.join('|') +
')$'
),
threshold: 10240,
minRatio: 0.8
})
)
}
if (config.build.bundleAnalyzerReport) {
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
webpackConfig.plugins.push(new BundleAnalyzerPlugin())
}
module.exports = webpackConfig
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
// 测试
HOST_URL: '"http://222.66.127.246"',
PORT: '":8020"',
BASE_URL: '""',
appRealDb: '"app_test_shaphar"',
// 正式
// HOST_URL: '"http://mobileportal.shaphar.com"',
// PORT: '":8028"',
// BASE_URL: '"/basservice"',
// appRealDb: '"app_real_shaphar"',
//NEW 正式
// HOST_URL: '"https://mobileportal.shaphar.com"',
// PORT: '":8443"',
// BASE_URL: '"/basservicenew"',
// appRealDb: '"app_real_shaphar"'
})
'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
const path = require('path')
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://api.ucmd.cn/renren-api/',
changeOrigin: true
}
},
// Various Dev Server settings
host: '0.0.0.0', // can be overwritten by process.env.HOST
// host: '192.168.1.150', // can be overwritten by process.env.HOST
port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
disableHostCheck: true,
errorOverlay: true,
notifyOnErrors: true,
poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
// Use Eslint Loader?
// If true, your code will be linted during bundling and
// linting errors and warnings will be shown in the console.
useEslint: true,
// If true, eslint errors and warnings will also be shown in the error overlay
// in the browser.
showEslintErrorsInOverlay: false,
/**
* Source Maps
*/
// https://webpack.js.org/configuration/devtool/#development
devtool: 'cheap-module-eval-source-map',
// If you have problems debugging vue-files in devtools,
// set this to false - it *may* help
// https://vue-loader.vuejs.org/en/options.html#cachebusting
cacheBusting: true,
cssSourceMap: true
},
build: {
// Template for index.html
index: path.resolve(__dirname, '../dist/index.html'),
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: './',
/**
* Source Maps
*/
productionSourceMap: false,
// https://webpack.js.org/configuration/devtool/#production
devtool: '#source-map',
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: true,
productionGzipExtensions: ['js', 'css'],
// Run the build command with an extra argument to
// View the bundle analyzer report after build finishes:
// `npm run build --report`
// Set to `true` or `false` to always turn it on or off
bundleAnalyzerReport: process.env.npm_config_report
}
}
'use strict'
module.exports = {
NODE_ENV: '"production"',
// 正式版
// HOST_URL: '"https://mobileportal.shaphar.com:8443/basservicenew"',
// appRealDb: '"app_real_shaphar"',
// 体验版
// HOST_URL: '"http://mobileportal.shaphar.com:8028/basservicenew"',
// 测试版
HOST_URL: '"http://222.66.127.246:8020"',
appRealDb: '"app_test_shaphar"',
// HOST_URL: '"http://192.168.1.139:8020"'
PORT: '""',
BASE_URL: '""',
}
\ No newline at end of file
'use strict'
const merge = require('webpack-merge')
const devEnv = require('./dev.env')
module.exports = merge(devEnv, {
NODE_ENV: '"testing"'
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<title>上药移动</title>
<script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=061c2a328572b71e2b26d9dc1a0cc703&plugin=AMap.GraspRoad"></script>
</head>
<body>
<div id="app"></div>
</body>
</html>
This diff is collapsed.
{
"name": "basi",
"version": "1.0.0",
"description": "BASI",
"author": "tuc",
"private": true,
"scripts": {
"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 0.0.0.0",
"start": "npm run dev",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"test": "npm run unit",
"lint": "eslint --ext .js,.vue src test/unit",
"build": "node build/build.js",
"build:dll": "webpack --config build/webpack.dll.config.js"
},
"dependencies": {
"axios": "^0.18.1",
"crypto-js": "^4.0.0",
"echarts": "^4.9.0",
"font-awesome": "^4.7.0",
"lib-flexible": "^0.3.2",
"vant": "^2.12.10",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vue-template-compiler": "^2.6.10",
"vuex": "^3.1.1"
},
"devDependencies": {
"add-asset-html-webpack-plugin": "^2.1.3",
"autoprefixer": "^7.1.2",
"babel-core": "^6.22.1",
"babel-eslint": "^8.2.1",
"babel-helper-vue-jsx-merge-props": "^2.0.3",
"babel-jest": "^21.0.2",
"babel-loader": "^7.1.1",
"babel-plugin-dynamic-import-node": "^1.2.0",
"babel-plugin-import": "^1.11.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
"babel-plugin-transform-runtime": "^6.22.0",
"babel-plugin-transform-vue-jsx": "^3.5.0",
"babel-preset-env": "^1.3.2",
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"compression-webpack-plugin": "^1.1.12",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-loader": "^1.7.1",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.2.0",
"eslint-plugin-promise": "^3.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-vue": "^4.0.0",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"friendly-errors-webpack-plugin": "^1.6.1",
"happypack": "^5.0.1",
"html-webpack-plugin": "^2.30.1",
"jest": "^22.0.4",
"jest-serializer-vue": "^0.3.0",
"node-notifier": "^5.1.2",
"node-sass": "^4.14.1",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-pxtorem": "^4.0.1",
"postcss-url": "^7.2.1",
"rimraf": "^2.6.0",
"sass-loader": "^7.1.0",
"sass-resources-loader": "^2.0.0",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-jest": "^1.0.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8",
"ios >= 8",
"android >= 4.0"
]
}
<template>
<div id="app">
<van-nav-bar
id="nav-bar"
v-if="navBar.show"
:left-arrow="navBar.leftArrow"
@click-left="leftClick"
:right-text="navBar.rightText"
:left-text="navBar.leftText"
@click-right="rightClick"
:fixed="navBar.fixed"
:title="navBar.title">
<template #right>
<van-icon style="color:#1989fa" v-if="navBar.rightIcon" name="search" size="18" />
</template>
<!-- <img v-if="navBar.rightIcon" :src="navBar.rightIcon" slot="right" class="right-icon"/> -->
</van-nav-bar>
<div v-if="navBar.show && navBar.fixed" class="app-nav-space"></div>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"/>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"/>
</div>
</template>
<script>
export default {
name: 'App',
computed: {
navBar() {
return this.$store.state.navBar
}
},
mounted() {
this.$store.commit('setNavBar', {
leftClick: () => {
this.$router.back()
}
})
},
methods: {
leftClick() {
this.navBar.leftClick()
},
rightClick() {
this.navBar.rightClick()
}
}
}
</script>
<style lang="scss">
html,body{
width: 100%;
height: 100%;
background: $bc2;
}
#app{
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
#nav-bar{
background-color: white;
.van-nav-bar__title{
color: $txtBlack;
font-weight: 600;
font-size: 15px;
}
.van-icon{
// color: $arrowC;
font-size: 22px;
}
.van-nav-bar__text{
//color: $txtGray;
//font-size: 12px;
color: $txtBlack;
font-weight: 600;
font-size: 15px;
}
}
.app-nav-space {
height: 44px;
}
.right-icon {
width: 30px;
height: 30px;
vertical-align: middle;
}
}
</style>
import { fetch } from '@/utils'
// 获取客户列表
export function getCustomerList(params) {
return fetch({
url: '/customer/queryCustomer_PS',
method: 'post',
data: params,
loading: true
})
}
// 获取采购商品列表
export function getCgGoodsList(params) {
return fetch({
url: '/purchaseCommon/queryAllGoods',
method: 'post',
data: params,
loading: true
})
}
// 获取商品列表
export function getGoodsList(params) {
return fetch({
url: '/product/queryGoods_PS',
method: 'post',
data: params,
loading: true
})
}
// 获取供应商列表
export function getCgSupplyList(params) {
return fetch({
url: '/purchaseCommon/querySupply',
method: 'post',
data: params,
loading: true
})
}
// 获取订单来源列表
export function getOrderOrigin(params) {
return fetch({
url: '/orders/queryOrderSource',
// url: '/newErp/queryOrderSource',
method: 'post',
data: params,
loading: true
})
}
// 获取订单状态列表
export function getOrderState(params) {
return fetch({
url: '/orders/queryOrderStatus',
method: 'post',
data: params,
loading: true
})
}
// ====================采购api====================
// 获取生产厂家列表
export function getFactoryList(params) {
return fetch({
url: '/purchaseCommon/queryFactory',
method: 'post',
data: params,
loading: true
})
}
// 获取商品集合列表
export function getGoodsSetList(params) {
return fetch({
url: '/purchaseCommon/queryGoodsSet',
method: 'post',
data: params,
loading: true
})
}
// ====================高级搜索====================
// 获取货主列表
// export function getConsignorSetList(params) {
// return fetch({
// url: '/RoleCompanyName/EmployeeOrgQuery',
// method: 'post',
// data: params,
// loading: true
// })
// }
export function getConsignorSetList(params) {
return fetch({
url: '/CompanyOrderLife/EmployeeOrgQuery',
method: 'post',
data: params,
loading: true
})
}
// 获取供应商
export function getEmployeeOrgQueryList(params) {
return fetch({
url: '/CompanyOrderLife/checkCompanyNum',
method: 'post',
data: params,
loading: true
})
}
// 获取商品集合列表
export function getOrderGoodsSetList(params) {
return fetch({
url: '/CompanyOrderLife/queryGoods_PS',
method: 'post',
data: params,
loading: true
})
}
// 获取客户集合列表
export function getOrderCustomerSetList(params) {
return fetch({
url: '/CompanyOrderLife/queryCustomer_PS',
method: 'post',
data: params,
loading: true
})
}
// 获取王老板供应商
export function getQuerySalesRefList(params) {
return fetch({
url: '/OrderLife/querySalesRef',
method: 'post',
data: params,
loading: true
})
}
\ No newline at end of file
import { fetch } from '@/utils'
// 获取发票列表
export function getMyInvoiceList(params) {
return fetch({
url: '/OrderLife/Invoice',
method: 'post',
data: params,
loading: true
})
}
// 新获取发票列表
export function getNewMyInvoiceList(params) {
return fetch({
url: '/OrderLife/newInvoice',
method: 'post',
data: params,
loading: true
})
}
\ No newline at end of file
import { fetch } from '@/utils'
// 获取订单列表
export function getMyOrderList(params) {
return fetch({
url: '/OrderLife/queryOrder',
method: 'post',
data: params,
loading: true
})
}
// 多选订单列表
export function getMoreMyOrderList(params) {
return fetch({
url: '/CompanyOrderLife/queryOrder',
method: 'post',
data: params,
loading: true
})
}
// 获取订单详情
export function getMyOrderDetail(params) {
return fetch({
url: '/OrderLife/queryOrderDetail',
method: 'post',
data: params,
loading: true
})
}
// 配送信息查询
export function getDeliveryOrder(params) {
return fetch({
url: '/OrderLife/DeliveryOrder',
method: 'post',
data: params,
loading: true
})
}
// 获取订单发票列表
export function getOrderInvoiceList(params) {
return fetch({
url: '/OrderLife/Invoice',
method: 'post',
data: params,
loading: true
})
}
// 获取物流追踪信息
export function getTrackInfo(params) {
return fetch({
url: '/OrderLife/TrackInfo',
method: 'post',
data: params,
loading: true
})
}
// 获取商品详情列表
export function getGoodInfoList(params) {
return fetch({
url: '/OrderLife/GoodsInfo',
method: 'post',
data: params,
loading: true
})
}
// 获取请货单
export function getOrderClearanceList(params) {
return fetch({
url: '/OrderLife/ReqOrder',
method: 'post',
data: params,
loading: true
})
}
// 获取运单信息
export function getShippingInfo(params) {
return fetch({
url: '/OrderLife/ShIppOrder',
method: 'post',
data: params,
loading: true
})
}
// 地图点
export function getGpsMapPoint(params) {
return fetch({
url: '/OrderLife/GisMapInfo',
method: 'post',
data: params,
loading: false
})
}
// 获取温度
export function getColdTemperatureList(params) {
return fetch({
url: '/OrderLife/TempRecord',
method: 'post',
data: params,
loading: true
})
}
import { fetch } from '@/utils'
// 检查当前登录人员类型
export function getUserType(data) {
return fetch({
url: '/sell/checkSubSaler',
// url: '/newErp/checkSubSaler',
method: 'post',
data,
loading: true
})
}
// 汇总接口
export function getSummary(data) {
return fetch({
url: '/sell/querySubSaler',
// url: '/newErp/querySubSaler',
method: 'post',
data,
loading: true
})
}
// 销售员
export function saleInfo(data) {
return fetch({
url: '/sell/querySaleTotalBySaler_PS',
// url: '/newErp/querySaleTotalBySaler_PS',
method: 'post',
data,
loading: true
})
}
// 获取客户列表
export function getCustomerList(data) {
return fetch({
url: '/customer/queryClientTotalBySaler_PS',
// url: '/newErp/queryClientTotalBySaler_PS',
method: 'post',
data,
loading: true
})
}
// 获取资信详情
export function getCWNData(data) {
return fetch({
url: '/customer/queryClientCredit',
// url: '/newErp/queryClientCredit',
method: 'post',
data,
loading: true
})
}
// 获取客户订单
export function getOrderList(data) {
return fetch({
url: '/orders/queryOrderInfoByClient_PS',
// url: '/newErp/queryOrderInfoByClient_PS',
method: 'post',
data,
loading: true
})
}
// 获取商品
export function getGoodsList(data) {
return fetch({
url: '/orders/queryLinesInfoByOrder_PS',
// url: '/newErp/queryLinesInfoByOrder_PS',
method: 'post',
data,
loading: true
})
}
// 获取物流信息
export function getLogStepList(data) {
return fetch({
url: '/orders/queryOrderLogisticsInfo_PS',
// url: '/newErp/queryOrderLogisticsInfo_PS',
method: 'post',
data,
loading: true
})
}
// 获取批号信息
export function getLotData(data) {
return fetch({
url: '/orders/queryLotsInfoByOrderlines_PS',
// url: '/newErp/queryLotsInfoByOrderlines_PS',
method: 'post',
data,
loading: true
})
}
import { fetch } from '@/utils'
// 获取下载链接
export function activityQueryDocList(params) {
return fetch({
url: '/enterprise/activity/queryDoc',
method: 'post',
data: params,
loading: true
})
}
import { fetch } from '@/utils'
// 获取列表
export function getTodoList(params) {
return fetch({
url: '/appMobile/getAgency',
method: 'post',
data: params,
loading: true
})
}
// 获取待办详情
export function getTodoDetail(params) {
return fetch({
url: '/appMobile/returnResult',
method: 'post',
data: params,
loading: true
})
}
// 获取审批意见
export function getTodoOpinion(params) {
return fetch({
url: '/appMobile/getOpinion',
method: 'post',
data: params,
loading: true
})
}
// 获取详情更多
export function getTodoMore(params) {
return fetch({
url: '/appMobile/returnMore',
method: 'post',
data: params,
loading: true
})
}
// 获取流程图
export function getTodoFlow(params) {
return fetch({
url: '/appMobile/getFlow',
method: 'post',
data: params,
loading: true
})
}
// 提交审批
export function commitTodoData(params) {
return fetch({
url: '/appMobile/submitApproval',
method: 'post',
data: params,
loading: true
})
}
// 根据用户获取用户职位信息
export function getUserPost(params) {
return fetch({
url: '/appMobile/getPosition',
method: 'post',
data: params,
loading: true
})
}
// 获取高级搜索客户列表
export function getClientHttpList(params) {
return fetch({
url: '/appMobile/getCustomers',
method: 'post',
data: params,
loading: true
})
}
<svg t="1605582752344" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16315" width="200" height="200"><path d="M862.040816 192.261224c-4.702041-5.22449-9.404082-10.971429-14.106122-15.673469-76.8-76.8-198.008163-81.502041-280.555102-14.106122-5.22449 4.702041-10.971429 9.404082-15.67347 14.106122L349.518367 377.730612l-173.453061 173.453061C136.881633 590.367347 114.938776 643.134694 114.938776 699.559184c0 55.902041 21.942857 108.669388 61.12653 148.37551 40.75102 40.75102 94.563265 61.126531 148.37551 61.12653 53.812245 0 107.102041-20.37551 148.375511-61.12653l173.453061-173.453061 201.665306-201.665306c40.75102-40.75102 61.126531-94.563265 61.12653-148.375511 0-47.020408-15.673469-94.040816-47.020408-132.179592z" fill="#F9D7DF" p-id="16316"></path><path d="M646.269388 673.959184L349.518367 377.730612l201.665306-201.665306c81.502041-81.502041 214.726531-81.502041 296.228572 0 81.502041 81.502041 81.502041 214.726531 0 296.228572L646.269388 673.959184z" fill="#E5404F" p-id="16317"></path><path d="M645.746939 334.889796c-5.22449 0-9.926531-2.089796-14.106123-5.746939l-75.755102-75.755102c-7.836735-7.836735-7.836735-20.37551 0-28.212245 7.836735-7.836735 20.37551-7.836735 28.212245 0l75.755102 75.755102c7.836735 7.836735 7.836735 20.37551 0 28.212245-3.657143 4.179592-8.881633 5.746939-14.106122 5.746939zM569.991837 411.167347c-5.22449 0-9.926531-2.089796-14.106123-5.746939L480.130612 329.665306c-7.836735-7.836735-7.836735-20.37551 0-28.212245 7.836735-7.836735 20.37551-7.836735 28.212245 0l75.755102 75.755102c7.836735 7.836735 7.836735 20.37551 0 28.212245-4.179592 3.657143-9.404082 5.746939-14.106122 5.746939z" fill="#FFEEF0" p-id="16318"></path></svg>
<svg t="1605588774716" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="33867" width="200" height="200"><path d="M0 521.386667a33.792 33.792 0 1 1 67.640889 0.113777A33.792 33.792 0 0 1 0 521.386667z m809.415111-98.759111a32.540444 32.540444 0 0 1 31.516445 32.995555c0 18.090667-14.222222 32.711111-31.516445 32.597333L482.417778 486.001778a32.540444 32.540444 0 0 1-31.573334-32.995556c0-18.090667 14.222222-32.711111 31.573334-32.597333l326.997333 2.218667zM482.417778 235.690667l270.108444 2.218666a32.540444 32.540444 0 0 1 31.516445 32.995556c0 18.090667-14.222222 32.711111-31.516445 32.597333L482.417778 301.283556a32.540444 32.540444 0 0 1-31.573334-32.995556c0-18.090667 14.222222-32.711111 31.573334-32.597333z m326.997333 377.344a32.540444 32.540444 0 0 1 31.516445 33.052444c0 18.090667-14.222222 32.824889-31.516445 32.597333l-326.997333-2.218666a32.540444 32.540444 0 0 1-31.573334-32.995556c0-18.090667 14.222222-32.711111 31.573334-32.597333l326.997333 2.161778zM810.552889 0L1024 219.477333v511.943111c0 80.440889-63.715556 146.261333-141.596444 146.261334h-71.850667c0 80.497778-63.715556 146.318222-141.596445 146.318222H141.653333C63.658667 1024 0 958.179556 0 877.681778v-146.602667c0-20.252444 16.042667-36.693333 35.726222-36.693333 19.683556 0 35.612444 16.440889 35.612445 36.693333v146.375111c0 40.220444 31.857778 73.159111 70.769777 73.159111h526.848c38.912 0 70.656-32.654222 70.769778-72.931555h-282.168889c-77.824 0-141.539556-65.820444-141.539555-146.261334V219.591111H142.108444c-38.912 0-70.769778 32.881778-70.769777 73.102222v146.090667c0 20.252444-15.928889 36.693333-35.612445 36.693333a36.010667 36.010667 0 0 1-35.612444-36.579555V292.579556c0-80.440889 63.715556-146.261333 141.596444-146.261334h174.307556C316.017778 65.820444 379.733333 0 457.614222 0h352.938667z m0.113778 72.476444h-0.227556v73.500445c0 40.220444 31.857778 73.159111 70.769778 73.159111h70.656L810.666667 72.476444z m70.769777 732.615112c38.912 0 70.769778-32.881778 70.769778-73.102223V291.555556h-72.078222c-77.937778 0-141.596444-65.820444-141.596444-146.261334v-72.817778H456.590222c-38.912 0-70.769778 32.881778-70.769778 73.159112v586.353777c0 40.220444 31.857778 73.102222 70.769778 73.102223h424.846222z" p-id="33868" fill="#1296db"></path></svg>
<svg t="1605584423913" class="icon" viewBox="0 0 1041 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="22349" width="200" height="200"><path d="M819.415076 783.586486c135.91783-155.327169 128.626213-391.570298-20.799467-537.638688-143.445506-139.74724-365.892267-147.353603-518.071975-25.494428l538.871442 563.133116zM228.951513 270.786506c-134.396557 155.405855-126.659051 390.39 22.242053 535.881356 142.44881 139.196435 364.003791 147.222458 516.262186 26.937015L228.951513 270.786506z" fill="#7dc5eb" p-id="22350"></path></svg>
/*-----------公共样式---------------------------开始*/
body{
font-size: 14px;
color: $tc1;
font-family: "Microsoft YaHei",'微软雅黑','sans-serif';
//padding: 0 14px;
}
* {
box-sizing: border-box;
}
.remove-padding{
padding: 0!important;
}
.remove-padding-t{
padding-top: 0!important;
}
.remove-padding-b{
padding-bottom: 0!important;
}
.remove-padding-l{
padding-left: 0!important;
}
.remove-padding-r{
padding-right: 0!important;
}
.remove-margin{
margin: 0!important;
}
.remove-margin-t{
margin-top: 0!important;
}
.remove-margin-b{
margin-bottom: 0!important;
}
.remove-margin-l{
margin-left: 0!important;
}
.remove-margin-r{
margin-right: 0!important;
}
.remove-border{
border: 0!important;
}
.remove-border-l{
border-left: 0!important;
}
.remove-border-r{
border-right: 0!important;
}
.remove-border-t{
border-top: 0!important;
}
.remove-border-b{
border-bottom: 0!important;
}
/*公共的padding*/
.padding-16{
padding: 16px;
}
.padding-10{
padding: 10px;
}
.padding-rl14{
padding: 0 14px;
}
/*公共的margin*/
.margin-t5 {
margin-top: 5px;
}
.margin-l5 {
margin-left: 5px;
}
.margin-l10 {
margin-left: 10px;
}
/* item间距 */
.margin-t8{
margin-top: 8px;
}
.margin-b8{
margin-bottom: 8px;
}
/*flex布局*/
.flex {
display: flex;
}
.flex-column {
flex-direction: column;
}
.flex1 {
flex: 1;
}
/*公共字体样式*/
.font18{
font-size: 18px;
}
.font16{
font-size: 16px;
}
.font15 {
font-size: 15px;
}
.font14{
font-size: 14px;
}
.font13 {
font-size: 13px;
}
.font12{
font-size: 12px;
}
.font-normal{
font-weight: 500;
}
.font-w400{
font-weight: 400;
}
.text-center{
text-align: center;
}
.text-right{
text-align: right;
}
.line-height24 {
height: 24px;
}
.main-text-size {
font-size: 16px;
}
.font-bold{
font-weight: 700;
}
.font-red {
color: $tc5;
}
.font-blue {
color: rgb(25, 137, 250);
}
.font-green {
color: rgb(42, 193, 9);
}
.font-gray {
color: #808995;
}
/*宽度*/
.w100 {
width: 100%;
}
.h300px {
height: 300px;
}
/*高度*/
.h100{
height: 100%;
}
/*浮动*/
.float-l {
float: left;
}
.float-r {
float: right;
}
/*定位方式*/
.pos-relative {
position: relative;
.van-cell__title{
font-weight: bolder;
}
font-size: 14px;
}
/*浅色小字体样式 例:共多少数据*/
.light-small-font{
color: $tc3;
font-size: 12px;
}
/*中色中字体样式*/
.normal-normal-font{
color: $tc2;
}
/*浅色中字体样式*/
.light-normal-font{
color: $tc3;
}
/*深色大字体样式*/
.deep-large-font{
color: $tc1;
font-size: 16px;
}
/*浅色大字体样式*/
.light-large-font{
color: $tc3;
font-size: 16px;
}
/*item字体右 默认是右侧样式*/
/*item的通用样式*/
.item{
padding: 10px 14px;
margin-bottom: 8px;
background-color: $bc1;
.van-row {
padding-top: 4px;
padding-bottom: 4px;
}
}
/*item的横线*/
.item-line {
border-bottom:solid #EDF0F4 1px
}
/**/
.item-info-btn {
height: 40px;
font-size: 11px;
color: rgb(47, 120, 237);
display: flex;
align-items: center;
justify-content: center;
.van-icon {
margin-left: 10px;
}
}
.font-16 {
font-size: 16px;
}
// 高级搜索的星号提示
.red-tip {
color: $tc5;
vertical-align: middle;
}
// 上边距3px
.pt3 {
padding-top: 3px;
}
// 列表底部提示
.no-more {
text-align: center;
height: 50px;
line-height: 50px;
color: #969799;
}
.order-type-tip-cold {
border-radius: 10px;
color: $orderCold;
border: 1px solid $orderCold;
display: inline-block;
text-align: center;
font-size: 10px;
min-width:20px;
}
.order-type-tip-return {
border-radius: 10px;
color: $orderReturn;
border: 1px solid $orderReturn;
display: inline-block;
text-align: center;
font-size: 10px;
min-width:20px;
}
.order-type-tip-jm {
border-radius: 10px;
color: $orderJm;
border: 1px solid $orderJm;
display: inline-block;
font-size: 10px;
text-align: center;
min-width:20px;
}
.empty-tips {
height: 70px;
text-align: center;
line-height: 70px;
font-size: 13px;
color: $txtGrayL;
}
.amap-logo{
display: none !important;//去掉高德地图logo
}
.amap-copyright {
display: none !important;//去掉高德的版本号
}
/*-----------公共样式---------------------------结束*/
/*----------------------------修改框架的默认样式--------------------开始*/
.van-tabs__line {
background-color: #1989fa;
}
/*----------------------------修改框架的默认样式--------------------结束*/
/*--------------修改框架默认样式---------------------开始*/
.van-button--primary {
background: #1989fa;
border-color: #1989fa;
}
.van-nav-bar {
&.van-nav-bar--fixed{
z-index: 100!important;
}
.van-icon {
color: $main1;
}
}
.van-tab {
font-size: 16px;
}
.van-cell {
font-size: 16px;
}
//div {
// font-size: 16px;
//}
.van-nav-bar__title {
font-size: 16px;
}
.van-button--primary {
background: #1989fa;
border-color: #1989fa;
}
/*搜索框统一*/
.van-search{
padding-left: 15px;
background-color: #fff;
.van-field__control {
font-size: 14px;
}
.van-cell{
padding: 8px 8px 8px 0;
.van-field__left-icon {
margin-right: 10px;
}
.fa.fa-search {
font-size: 18px;
color: #1989fa;
}
}
.van-search__action {
color: #1989fa;
padding: 0 10px;
}
}
/*带有高级的按钮搜索*/
.van-search.hightSearch{
.van-search__action {
.common {
padding: 0 5px;
&:active{
background-color: #f2f3f5;
}
}
&:active{
background-color: transparent;
}
}
}
/*tab部分*/
.van-tabs__line{
border-radius: 0!important;
}
.van-tab {
font-size: 14px;
color: #707985;
}
.van-tab--active {
font-size: 15px;
color: #23262A;
font-weight: 600;
}
/*立即下单的提交按钮的样式*/
.submit {
border: 0;
border-radius: 0;
background: linear-gradient(to right, #02BAF4 0%, #5341E7 100%);
}
/*操作按钮的样式*/
.more-btn {
line-height: 27px;
font-size: 15px;
width: 80px;
color: $tc4 !important;
border: 1px solid rgba(47, 120, 237, 1) !important;
}
/*高级搜索中的输入框样式*/
.high-info .van-cell__value .van-field__body {
border: solid #BCC1CC 1px;
border-radius: 3px;
}
/*--------------修改框架默认样式---------------------开始*/
// 文字
$tc1: #31363F;//深色
$tc2: #677282;//中
$tc3: #9FA6B3;//浅
$tc4: #2F78ED;//操纵色
$tc5: #E0613A;//醒目提示红色
$tcLeft:#677282;
$tcRight:#31363F;
// 背景
$bc1: #FFFFFF;
$bc2: #F5F5F5;
$bc3: #1556A8;
$bc4: #fb1c1c;
// 分割线
$dc1: #dedede;
//主色
$main1:#1989fa;
//按钮颜色
$buttonC:$tc4;
//箭头灰色
$arrowC:#747782;
//标题颜色
$txtBlack:#23262A;
$txtGray:#8792A4;
// 线颜色
$line: #eeeeee;
// 文字色
$txtGray9: #999999;
$txtGrayL: #D3D3D3;
//订单状态颜色
$orderReturn:#D9001B;
$orderJm:#4b7902;
$orderCold:#02a7f0;
<template>
<div id="aMapContainer"></div>
</template>
<script>
export default {
name: 'AMapView',
data () {
return {
icons: {
startIcon: require('@/assets/img/start.png'),
currentIcon: require('@/assets/img/sph_car.png'),
endIcon: require('@/assets/img/end.png')
}
}
},
props: {
transport: {
type: Boolean,
default: false
},
pointList: {
type: Array,
default: () => {
return []
}
},
drivePoint: {
type: Object,
default: () => {
return {
startPoint: {
address: '',
longitude: 0,
latitude: 0
},
endPoint: {
address: '',
longitude: 0,
latitude: 0
}
}
}
}
},
mounted () {
this.initAMap()
},
methods: {
initAMap() {
let map = new AMap.Map('aMapContainer', {
resizeEnable: true,
zoom: 11,
zooms: [5, 15]
})
if (this.transport) {
console.log('=======')
this.drawExelState(map)
} else {
console.log('11111111111')
this.drawPointLine(map)
}
},
/* 根据点数组画线 */
drawPointLine(map) {
let _this = this
let pathParam = []
_this.pointList.forEach(point => {
pathParam.push({
'x': parseFloat(point.longitude),
'y': parseFloat(point.latitude),
'sp': parseInt(point.speed),
'ag': parseInt(point.direction),
'tm': point.tm
})
})
let pathLength = pathParam.length
// 由于高德地图对每次数据数量500的限制,需要将数据进行每500分段
// 按500分组时先计算有多少组,不足500的同样为一组,故向上取整
let group = Math.ceil(pathLength / 490)
console.log(group)
// 定义高德 数据纠偏 对象
let graspRoad = new AMap.GraspRoad()
// 定义一个二维数组,开始对每组数据进行操作
let tdGroup = []
for (let i = 0; i < group; i++) {
// 每500一组切割,塞入二维数组中
tdGroup.push(pathParam.slice(i * 490, (i + 1) * 490))
}
console.log(tdGroup)
// 遍历二维数组,对数组中的每个一维数组进行高德点转换
tdGroup.forEach((itemArr, tdIndex) => {
// 用于转换的高德定位临时数组
let aMapTemp = []
itemArr.forEach(item => {
let aMapLngLat = new AMap.LngLat(item.x, item.y)
aMapTemp.push(aMapLngLat)
})
// gps定位数据转换为高德数据
AMap.convertFrom(aMapTemp, 'gps', function (status, result) {
if (result.info === 'ok') {
let aMapLngLat = result.locations
// 转换成高德数据后,替换源数据
aMapLngLat.forEach((lngLat, i) => {
itemArr[i].x = lngLat.lng
itemArr[i].y = lngLat.lat
})
// 绘制起点
if (tdIndex === 0) {
let startMarker = new AMap.Marker({
position: aMapLngLat[0],
offset: new AMap.Pixel(-15, -38),
icon: _this.icons.startIcon
})
startMarker.setLabel({
offset: new AMap.Pixel(4, 0), // 设置文本标注偏移量
content: `<div class='marker'>${_this.drivePoint.startPoint.address}</div>`, // 设置文本标注内容
direction: 'right' // 设置文本标注方位
})
map.add(startMarker)
}
// 绘制终点
if (tdIndex === tdGroup.length - 1) {
let endMarker = new AMap.Marker({
position: aMapLngLat[aMapLngLat.length - 1],
offset: new AMap.Pixel(-15, -38),
icon: _this.icons.endIcon
})
endMarker.setLabel({
offset: new AMap.Pixel(4, 0), // 设置文本标注偏移量
content: `<div class='marker'>${_this.drivePoint.endPoint.address}</div>`, // 设置文本标注内容
direction: 'right' // 设置文本标注方位
})
map.add(endMarker)
}
// 开始进行对轨迹纠偏
if (!graspRoad) {
graspRoad = new AMap.GraspRoad()
}
graspRoad.driving(pathParam, function(error, result) {
if (!error) {
let path2 = []
let newPath = result.data.points
for (let i = 0; i < newPath.length; i += 1) {
path2.push([newPath[i].x, newPath[i].y])
}
// 绘制线数据到地图上
let newLine = new AMap.Polyline({
path: path2,
strokeWeight: 8,
strokeOpacity: 0.8,
strokeColor: '#0091ea',
showDir: true
})
map.add(newLine)
map.setFitView()
} else {
console.log(error)
}
})
}
})
})
},
/* 绘制起点和终点,并绘制车的位置 */
drawExelState(map) {
let _this = this
// 获取Gis点数据的最后一位
let currentItem = _this.pointList.slice(-1)[0]
let startPoint = new AMap.LngLat(_this.drivePoint.startPoint.longitude, _this.drivePoint.startPoint.latitude)
let currentPoint = new AMap.LngLat(currentItem.longitude, currentItem.latitude)
let endPoint = new AMap.LngLat(_this.drivePoint.endPoint.longitude, _this.drivePoint.endPoint.latitude)
// 塞入临时数据
let aMapTemp = [startPoint, currentPoint, endPoint]
console.log(currentItem)
// 转换成高德点
AMap.convertFrom(aMapTemp, 'gps', function (status, result) {
if (result.info === 'ok') {
let aMapLngLat = result.locations
console.log(aMapLngLat)
// 开始绘制起点
let startMarker = new AMap.Marker({
position: aMapLngLat[0],
icon: _this.icons.startIcon,
offset: new AMap.Pixel(-15, -38)
})
startMarker.setLabel({
offset: new AMap.Pixel(4, 0), // 设置文本标注偏移量
content: `<div class='marker'>${_this.drivePoint.startPoint.address}</div>`, // 设置文本标注内容
direction: 'right' // 设置文本标注方位
})
map.add(startMarker)
// 开始绘制车辆位置
let currentMarker = new AMap.Marker({
position: aMapLngLat[1],
// angle: parseInt(currentItem.direction),
offset: new AMap.Pixel(-15, -20),
content: `<div class="markerlabel"><img src="${_this.icons.currentIcon}" style="width: 35px;transform:rotate(${currentItem.direction}deg)"><div class="marker">${currentItem.roadInfo}</div></div>`
// autoRotation: true,
// icon: new AMap.Icon({
// image: _this.icons.currentIcon,
// size: new AMap.Size(52, 52), // 图标大小
// imageSize: new AMap.Size(30, 40)
// })
})
// currentMarker.setLabel({
// offset: new AMap.Pixel(4, 0), // 设置文本标注偏移量
// content: `<div style="transform:rotate(273deg)" class='marker'>${currentItem.roadInfo}</div>`, // 设置文本标注内容
// direction: 'right' // 设置文本标注方位
// })
map.add(currentMarker)
// 开始绘制终点
let endMarker = new AMap.Marker({
position: aMapLngLat[2],
icon: _this.icons.endIcon,
offset: new AMap.Pixel(-15, -38)
})
endMarker.setLabel({
offset: new AMap.Pixel(4, 0), // 设置文本标注偏移量
content: `<div class='marker'>${_this.drivePoint.endPoint.address}</div>`, // 设置文本标注内容
direction: 'right' // 设置文本标注方位
})
map.add(endMarker)
}
})
}
}
}
</script>
<style lang="scss" >
#aMapContainer{
height: 300px;
width: 100%;
}
.amap-marker-label{
border: 0;
background-color: transparent;
}
.markerlabel{
white-space: nowrap;
}
.marker{
border-radius: 2px;
padding: 3px 4px;
background-color: #fff;
width: auto;
box-shadow: 0 2px 6px 0 rgb(114,124,245 / 50%);
}
</style>
This diff is collapsed.
This diff is collapsed.
<template>
<div class="h100">
<van-popup
id="bmpPopup"
v-model="show"
show-action
closeable
@close="bmpClose"
position="bottom"
:style="{ height: '100%' }"
>
<van-nav-bar title="审批人列表"/>
<van-search
v-model="bmpSearch"
placeholder="请输入工号姓名"
show-action
@search="onSearchBmp"
class="hightSearch"
>
<i slot="left-icon" class="fa fa-search"></i>
<template slot="action">
<div class="font14 float-l common" @click="onSearchBmp">搜索</div>
</template>
</van-search>
<search-result :result-num="bmpNum"></search-result>
<van-pull-refresh class="list" v-model="isRefreshing" @refresh="onRefresh" v-if="newBmp">
<van-list
v-model="isLoading"
:finished="finished"
:finished-text="finishedText"
:error.sync="error"
error-text="请求失败,点击重新加载"
@load="onLoad"
>
<van-radio-group v-model="bmpCkecked">
<van-cell-group>
<van-cell
clickable
@click="itemClick(item)"
v-for="(item,index) in BmpList"
:key="index"
>
<template #title>
<span class="empuid">{{item.empid}}</span>
<span>{{item.cnname}}</span>
</template>
<template #right-icon>
<van-radio :name="item"/>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</van-list>
</van-pull-refresh>
<van-radio-group v-model="bmpCkecked" v-if="!newBmp">
<van-cell-group class="list" v-show="init">
<van-cell clickable @click="itemClick(item)" v-for="(item,index) in BmpList" :key="index">
<template #title>
<span class="empuid">{{item.EMPUID}}</span>
<span>{{item.CNNAME}}</span>
</template>
<template #right-icon>
<van-radio :name="item"/>
</template>
</van-cell>
</van-cell-group>
<div class="no-more" v-show="!init">未查询到数据</div>
</van-radio-group>
</van-popup>
</div>
</template>
<script>
import SearchResult from "@/components/SearchResult";
import { searchBpmUser, newSearchBpmUser } from "@/api/clientprofile";
export default {
name: "BmpUser",
components: { SearchResult },
data() {
return {
newBmp: false,
show: false,
bmpSearch: "",
bmpNum: "0",
bmpCkecked: "",
BmpList: [],
pagerNum: 1,
pagerSize: 10,
isLoading: false,
isRefreshing: false,
loading: false,
finished: false,
finishedText: "没有更多了",
error: false,
init: false
};
},
computed: {
linkInfo() {
return this.$store.state.linkInfo;
}
},
props: {
value: {
type: Boolean,
default: false
}
},
watch: {
value(val) {
this.show = val;
}
},
created() {
if (
this.linkInfo.sysCompanyName == "上药控股有限公司" ||
this.linkInfo.sysCompanyName == "上药康德乐罗达(上海)医药有限公司" ||
this.linkInfo.sysCompanyName == "上药科泽(上海)医药有限公司" ||
this.linkInfo.sysCompanyName == "上药闵行(上海)医药有限公司(合并)"
) {
this.newBmp = false;
} else {
this.newBmp = true;
}
},
methods: {
onSearchBmp() {
this.onRefresh();
},
getMainData() {
if (this.newBmp) {
let param = {
attr: {
username: this.bmpSearch,
pageNo: this.pagerNum,
pageSize: this.pagerSize
}
};
newSearchBpmUser(param)
.then(rt => {
this.finished = false;
if (rt.status == 200) {
if (rt.data.total == 0) {
if (this.pagerNum == 1) {
this.finishedText = "未查询到数据";
this.bmpNum = "0";
this.BmpList = [];
}
this.finished = true;
} else {
this.finishedText = "没有更多了";
this.bmpNum = rt.data.total + "";
if (this.pagerNum == 1) {
this.BmpList = rt.data.taskInfos;
} else {
this.BmpList = this.BmpList.concat(rt.data.taskInfos);
}
if (rt.data.length < this.pagerSize || this.bmpNum == this.BmpList.length) {
this.finished = true;
} else {
this.pagerNum++;
}
}
} else {
this.error = true;
}
this.isLoading = false;
this.isRefreshing = false;
})
.catch(e => {
console.log(e);
this.isLoading = false;
this.isRefreshing = false;
this.error = true;
});
} else {
if (!this.bmpSearch) {
this.$toast("请输入工号姓名!");
} else {
let param = {
attr: {
searchText: this.bmpSearch
}
};
searchBpmUser(param).then(rt => {
if (rt.code == 1) {
if(rt.userList == ''){
this.init = false
} else {
this.BmpList = rt.userList;
this.bmpNum = rt.userList.length + "";
this.init = true
}
} else {
this.$toast("查询失败");
}
});
}
}
},
onRefresh() {
this.pagerNum = 1;
this.getMainData();
},
onLoad() {
this.getMainData();
},
itemClick(item) {
this.show = false;
this.bmpCkecked = item;
this.bmpUser = item.CNNAME;
},
bmpClose(data) {
this.$emit("bmpUserClose", false);
this.$emit("getBmpUser", this.bmpCkecked);
}
}
};
</script>
<style lang="scss" scoped>
#bmpPopup {
.empuid {
margin-right: 20px;
}
background-color: $bc2;
.van-nav-bar__title {
color: $txtBlack;
font-weight: 600;
font-size: 15px;
}
.content {
padding: 10px 14px;
}
.van-cell-group {
.van-cell {
padding: 18px;
}
}
.list {
height: calc(100vh - 147px);
overflow: scroll;
}
}
</style>
<template>
<div>
<van-popup
v-model="postShow"
class="cgSearchChannel bg-gray"
position="right"
get-container="body"
>
<div class="title-layout">渠道号</div>
<van-search
v-model="keywords"
placeholder="请输入编码或名称"
show-action
shape="round"
@search="onSearch"
>
<div slot="action" @click="onSearch">搜索</div>
</van-search>
<search-result :result-num="searchNum"></search-result>
<div class="w100 listHeight" ref="scrollRef">
<van-pull-refresh
v-model="isRefreshing"
@refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
:error.sync="error"
:offset="10"
@load="onLoad">
<van-radio-group v-model="checked">
<van-cell-group>
<van-cell :title="titleInitial(item)" clickable @click="itemClick(item,index)" v-for="(item,index) in postDataList"
:key="index">
<van-radio slot="right-icon" :name="item.channelId"/>
</van-cell>
</van-cell-group>
</van-radio-group>
</van-list>
</van-pull-refresh>
</div>
<div class="action-bottom">
<van-button type="default" @click="onCancelClick">取消</van-button>
<van-button class="submit" type="info" @click="onConfirmClick">确定</van-button>
</div>
</van-popup>
</div>
</template>
<script>
import {getCgChannelList} from '@/cgApi/common'
// import {getResListNum} from '../utils/common'
import SearchResult from './SearchResult'
export default {
name: 'CgSearchChannel',
components: {SearchResult},
data() {
return {
postShow: false,
keywords: '',
isRefreshing: false,
loading: false,
finished: false,
error: false,
currentPage: 1,
pageSize: 10,
postDataList: [],
checked: '',
searchNum: '0',
choosedPost: {}
}
},
props: {
value: {
type: Boolean,
default: false
},
customer: {
type: Object,
default: () => {}
},
chinfo: {
type: Object,
default: ()=> {
return {
goodsId: '',
supplier: ''
}
}
}
},
computed: {
linkInfo () {
return this.$store.state.linkInfo
}
},
watch: {
value(val) {
this.postShow = val
if (val) {
this.postDataList = []
this.keywords = ''
console.log(this.customer)
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
this.checked = !this.customer.channelId ? '' : this.customer.channelId
this.currentPage = 1
this.onLoad()
}
},
postShow (val) {
if (!val) {
this.$refs.scrollRef.scrollTop = 0
}
this.$emit('input', val)
}
},
methods: {
/// 标题拼接 <!-- -->
titleInitial(model) {
let titleStr = model.channelId + '/(' + model.channelOpcode + ')/' + model.channelName + '/' + model.venderName
return titleStr
},
onSearch () {
this.keywords = this.keywords.replace(/\s+/g,"")
this.$refs.scrollRef.scrollTop = 0
this.currentPage = 1
this.finished = false
this.onLoad()
},
onCancelClick() {
this.postShow = false
this.$emit('cancleclick')
},
onConfirmClick() {
this.postShow = false
let item = {
page: 'channel',
value: this.choosedPost
}
this.$emit('confirmclick', item)
},
itemClick(item, index) {
this.checked = item.channelId
this.choosedPost = item
},
onRefresh() {
// 刷新接口
// this.postDataList = []
this.currentPage = 1
this.isRefreshing = true
this.finished = false
this.getPostData()
},
onLoad() {
this.loading = true
this.getPostData()
},
getPostData() {
let _this = this
let data = {
'channel': _this.keywords,
'dbSource': this.linkInfo.sysDbSource, // 数据源'-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
'invOwner': this.linkInfo.sysOrgId, //部门id
'erpUserId': this.linkInfo.sysUserId,
'pageNum': _this.currentPage,
'pageSize': _this.pageSize,
'goodsId': _this.chinfo.goodsId,
'supplyId': _this.chinfo.supplier
}
// let data = {
// 'channel': _this.keywords,
// 'dbSource': 'erp_ogg_shaphar', // 数据源'-' + this.linkInfo.appRealDb + '-' + this.linkInfo.sysOrgId,
// 'invOwner': '608', //部门id
// 'erpUserId': '25194',
// 'pageNum': _this.currentPage,
// 'pageSize': _this.pageSize,
// 'goodsId': '',
// 'supplyId': ''
// }
getCgChannelList(data).then(rt => {
if (_this.currentPage === 1) {
_this.searchNum = rt.entity.total + ''
this.postDataList = []
}
if (rt.code === '00000') {
if (this.isRefreshing) {
this.postDataList = rt.entity.channelList
}
else if (!!rt.entity.channelList || rt.entity.channelList.length > 0) {
this.postDataList = this.postDataList.concat(rt.entity.channelList)
}
// _this.postDataListSetAction(rt.data)
// 重置刷新提示
_this.isRefreshing = false
// 重置加载更多提示
_this.loading = false
// 若当前加载的页数没有满足每页的数量代表完全加载
if (rt.entity.channelList.length < 10) {
_this.finished = true
} else {
// 加载成功后下一页自增1
_this.currentPage++
}
} else {
_this.$toast(rt.message)
// _this.$toast('列表获取失败')
_this.isRefreshing = false
_this.error = true
_this.finished = true
}
// 加载状态结束
_this.loading = false
}).catch(e => {
_this.$toast('列表获取失败')
_this.isRefreshing = false
_this.loading = false
_this.error = true
_this.finished = true
})
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
return true
}
return false
}
}
}
</script>
<style lang="scss" scoped>
.cgSearchChannel{
width: 75%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
.title-layout {
height: 45px;
line-height: 45px;
text-align: center;
background: white;
font-size:16px;
font-weight:bold;
color: #23262A;
}
.listHeight {
flex: 1;
overflow-x: hidden;
overflow-y: auto;
}
.num-tip {
font-size:16px;
padding: 10px;
}
.item-layout {
height: 40px;
line-height: 40px;
background: white;
border-bottom: #dedede 1px solid;
padding-left: 10px;
}
.action-bottom {
width: 100%;
display: flex;
button {
flex: 1;
}
}
.red-tips {
color: #fb1c1c;
font-weight: bold;
}
}
</style>
<template>
<div>
<van-popup
v-model="postShow"
class="more-search bg-gray"
position="right"
get-container="body"
>
<div class="title-layout font-bold font-16">商品</div>
<van-search
v-model="keywords"
placeholder="商品ID 编号 名称 拼首"
show-action
@search="onSearch"
>
<i slot="left-icon" class="fa fa-search"></i>
<div slot="action" class="font14" @click="onSearch">搜索</div>
</van-search>
<search-result :result-num="searchNum"></search-result>
<div class="w100 listHeight" ref="scrollRef">
<van-pull-refresh
v-model="isRefreshing"
@refresh="onRefresh">
<van-list
v-model="loading"
:finished="finished"
finished-text="没有更多了"
:error.sync="error"
:offset="10"
@load="onLoad">
<van-radio-group v-model="checked">
<van-cell-group>
<van-cell :title="titleInitial(item)" clickable @click="itemClick(item,index)" v-for="(item,index) in postDataList"
:key="index">
<template #right-icon>
<van-radio :name="item.comGoodsId" />
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</van-list>
</van-pull-refresh>
</div>
<div class="action-bottom">
<van-button type="default" @click="onCancelClick">取消</van-button>
<van-button type="info" class="submit" @click="onConfirmClick">确定</van-button>
</div>
</van-popup>
</div>
</template>
<script>
import {getCgGoodsList} from '@/api/common'
import {getResListNum} from '../utils/common'
import SearchResult from './SearchResult'
import { Dialog } from 'vant'
export default {
name: 'SearchGoods',
components: {SearchResult},
data() {
return {
postShow: false,
keywords: '',
isRefreshing: false,
loading: false,
finished: false,
error: false,
searchNum: '0',
currentPage: 1,
pageSize: 10,
postDataList: [],
checked: '',
choosedPost: {}
}
},
computed: {
linkInfo () {
return this.$store.state.linkInfo
}
},
props: {
value: {
type: Boolean,
default: false
},
customer: {
type: Object,
default: () => {}
},
channelType: {
type: Object,
default: () => {
return {
value: ''
}
}
}
},
watch: {
value(val) {
this.postShow = val
if (val) {
this.postDataList = []
this.choosedPost = JSON.parse(JSON.stringify(this.customer))
this.checked = !this.customer.comGoodsId ? '' : this.customer.comGoodsId
this.currentPage = 1
this.finished = false
this.searchNum = '0'
this.onLoad()
}
},
postShow (val) {
if (!val) {
this.$refs.scrollRef.scrollTop = 0
}
this.$emit('input', val)
}
},
methods: {
/// 标题拼接 <!-- 商品ID/操作码/商品名称/规格生产厂家-->
titleInitial(model) {
let titleStr = model.comGoodsId + '/(' + model.goodsOpcode + ')' + model.goodsName + '/' + model.goodsDesc + '/' + model.productLocation + '/' + model.packageNum + '/' + model.unitName
return titleStr
},
onSearch () {
// if (!this.isJudgeStrNull(this.keywords)) {
// Dialog.alert({
// title: '温馨提示',
// message: '搜索内容为空!'
// }).then(() => {
// })
// return
// }
this.keywords = this.keywords.replace(/\s+/g,"")
this.$refs.scrollRef.scrollTop = 0
this.currentPage = 1
this.finished = false
this.onRefresh()
},
onCancelClick() {
this.postShow = false
this.$emit('cancleclick')
},
onConfirmClick() {
if (!this.choosedPost.comGoodsId) {
Dialog.alert({
title: '温馨提示',
message: '请选择商品!'
}).then(() => {
})
return
}
this.postShow = false
this.$emit('confirmclick', {
page: 'goods',
value: this.choosedPost
})
},
itemClick(item, index) {
this.checked = item.comGoodsId
this.choosedPost = item
},
onRefresh() {
// 刷新接口
// this.postDataList = []
this.currentPage = 1
this.isRefreshing = true
this.finished = false
this.getPostData()
},
onLoad() {
this.loading = true
this.getPostData()
},
getPostData() {
let _this = this
let data = {
'dbSource': this.linkInfo.sysDbSource, // 数据源 + '-' + this.linkInfo.appRealDb
'invOwner': this.linkInfo.sysOrgId, //部门id
'erpUserId': this.linkInfo.sysUserId,
'pageNum': _this.currentPage,
'pageSize': _this.pageSize,
'goods': _this.keywords,
'channelld': '', // 渠道商ID, 非渠道可为空,渠道不可为空
'isChannel': _this.channelType.value, //渠道:1 非渠道:0
}
// let data = {
// 'dbSource': 'erp_ogg_shaphar',
// 'invOwner': '608',
// 'erpUserId': '25194',
// 'pageNum': _this.currentPage,
// 'pageSize': _this.pageSize,
// 'goods': _this.keywords,
// // 'channelId': '4763',
// 'channelId': '',
// 'isChannel': _this.channelType.value
// }
getCgGoodsList(data).then(rt => {
if (_this.currentPage === 1) {
_this.searchNum = rt.entity.total + ''
this.postDataList = []
}
if (rt.code == '00000') {
if (this.isRefreshing) {
this.postDataList = rt.entity.goodsList
}
else if (!!rt.entity.goodsList || rt.entity.goodsList.length > 0) {
this.postDataList = this.postDataList.concat(rt.entity.goodsList)
}
// _this.postDataListSetAction(rt.data)
// 重置刷新提示
_this.isRefreshing = false
// 重置加载更多提示
_this.loading = false
// _this.finished = false
// 若当前加载的页数没有满足每页的数量代表完全加载
if (rt.entity.goodsList.length < 10) {
_this.finished = true
} else {
// 加载成功后下一页自增1
_this.currentPage++
}
} else {
_this.$toast(rt.message)
// _this.$toast('列表获取失败')
_this.isRefreshing = false
_this.error = true
_this.finished = true
}
// 加载状态结束
_this.loading = false
}).catch(e => {
_this.$toast('列表获取失败')
_this.isRefreshing = false
_this.loading = false
_this.error = true
_this.finished = true
})
},
// 数据处理
postDataListSetAction(array) {
array.forEach((res)=>{
this.postDataList.push({
assigneeFactoryId: res.assigneeFactoryId,
catagory: res.catagory,
comGoodsFormId: res.comGoodsFormId,
comGoodsId: res.comGoodsId,
comGoodsVarietyId: res.comGoodsVarietyId,
comUnitId: res.comUnitId,
defaultExpireDate: res.defaultExpireDate,
factoryId: res.factoryId,
goodsDesc: res.goodsDesc,
goodsName: res.goodsName,
goodsOpcode: res.goodsOpcode,
goodsSpell: res.goodsSpell,
goodsStatus: res.goodsStatus,
midPacknum: res.midPacknum,
packageNum: res.packageNum,
partyName: res.partyName,
partyName1: res.partyName1,
partyOpcode: res.partyOpcode,
productLocation: res.productLocation,
unitName: res.unitName,
goodsForm: res.goodsForm,
partyOpcode1: res.partyOpcode1,
priceCode: res.priceCode,
retailPrice: res.retailPrice,
taxRate: res.taxRate,
varietyName: res.varietyName,
})
})
},
/// 判断数值是否为空
isJudgeStrNull(val) {
if (val !== null && val !== undefined && val !== '') {
return true
}
return false
}
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #F5F5F5;
}
.more-search {
width: 75%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
.title-layout {
height: 45px;
line-height: 45px;
text-align: center;
background: white;
font-size:17px;
font-weight:500;
color: #23262A;
}
.listHeight {
flex: 1;
overflow-x: hidden;
overflow-y: auto;
}
.num-tip {
padding: 10px;
}
.item-layout {
height: 40px;
line-height: 40px;
background: white;
border-bottom: #dedede 1px solid;
padding-left: 10px;
}
.action-bottom {
width: 100%;
display: flex;
button {
flex: 1;
}
}
.red-tips {
color: #fb1c1c;
font-weight: bold;
}
</style>
<template>
<div>
<van-popup v-model="postShow" class="more-search bg-gray" position="right" get-container="body">
<div class="title-layout">锁定状态</div>
<!-- <van-search placeholder="请输入编码或者名称" show-action>-->
<!-- <i slot="left-icon" class="fa fa-search"></i>-->
<!-- <div slot="action" class="font14">搜索</div>-->
<!-- </van-search>-->
<!-- <search-result :result-num="'3'"></search-result>-->
<div class="w100 listHeight" ref="scrollRef">
<van-radio-group v-model="checked">
<van-cell-group>
<van-cell title="加锁" clickable @click="itemClick('LOCK')">
<template #right-icon>
<van-radio name="LOCK"/>
</template>
</van-cell>
<van-cell title="解锁" clickable @click="itemClick('UNLOCK')">
<template #right-icon>
<van-radio name="UNLOCK"/>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</div>
<div class="action-bottom">
<van-button type="default" @click="onCancelClick">取消</van-button>
<van-button type="info" class="submit" @click="onConfirmClick">确定</van-button>
</div>
</van-popup>
</div>
</template>
<script>
import SearchResult from './SearchResult'
export default {
name: 'CgSearchLockType',
components: { SearchResult },
data() {
return {
postShow: false,
checked: ''
}
},
props: {
value: {
type: Boolean,
default: false
}
},
watch: {
value(val) {
this.postShow = val
},
postShow (val) {
if (!val) {
this.$refs.scrollRef.scrollTop = 0
}
this.$emit('input', val)
}
},
methods: {
onCancelClick() {
this.checked = ''
this.postShow = false
this.$emit('cancleclick')
},
onConfirmClick() {
if (!this.checked) {
this.$dialog.alert({
title: '温馨提示',
message: '请选择锁定状态!'
}).then(() => {})
return
}
this.postShow = false
this.$emit('confirmclick', {
page: 'lockType',
value: this.checked
})
},
itemClick(data) {
this.checked = data
}
}
}
</script>
<style lang="scss" scoped>
.content {
background-color: #f5f5f5;
}
.more-search {
width: 75%;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
}
.title-layout {
height: 45px;
line-height: 45px;
text-align: center;
background: white;
font-size: 16px;
font-weight: bold;
color: #23262a;
}
.listHeight {
flex: 1;
overflow-x: hidden;
overflow-y: auto;
}
.num-tip {
padding: 10px;
}
.item-layout {
height: 40px;
line-height: 40px;
background: white;
border-bottom: #dedede 1px solid;
padding-left: 10px;
}
.action-bottom {
width: 100%;
display: flex;
button {
flex: 1;
}
}
.red-tips {
color: #fb1c1c;
font-weight: bold;
}
</style>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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