Commit eb413807 authored by xiejb's avatar xiejb

初次代码提交

parents
Pipeline #432 failed with stages
{
"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
.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: '""',
// 正式
// HOST_URL: '"http://mobileportal.shaphar.com"',
// PORT: '":8028"',
// BASE_URL: '"/basservice"'
//NEW 正式
// HOST_URL: '"https://mobileportal.shaphar.com"',
// PORT: '":8443"',
// BASE_URL: '"/basservicenew"'
})
'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.149', // 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"',
// 体验版
// HOST_URL: '"http://mobileportal.shaphar.com:8028/basservicenew"',
// 测试版
HOST_URL: '"http://222.66.127.246:8020"',
// 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>上药ERP</title>
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=061c2a328572b71e2b26d9dc1a0cc703"></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.8.0",
"font-awesome": "^4.7.0",
"lib-flexible": "^0.3.2",
"vant": "^2.2.13-beta.0",
"vue": "^2.6.10",
"vue-amap": "^0.5.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.13.0",
"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="navBar.leftClick"
:right-text="navBar.rightText"
@click-right="navBar.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()
}
})
}
}
</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;
}
.van-nav-bar__text{
color: $txtGray;
font-size: 12px;
}
}
.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 getGoodsList(params) {
return fetch({
url: '/product/queryGoods_PS',
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
})
}
import { fetch } from '@/utils'
// 获取商品列表
export function getMyOrderList(params) {
return fetch({
url: '/product/queryGoods_PS',
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 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
})
}
/*-----------公共样式---------------------------开始*/
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;
}
/*-----------公共样式---------------------------结束*/
/*----------------------------修改框架的默认样式--------------------开始*/
.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;
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 '@/cgApi/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>
<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="仓库编号 名称 拼首"
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="0"
@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.comPartyId" />
</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 {getWareHouseList} from '../cgApi/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.comPartyId ? '' : this.customer.comPartyId
this.currentPage = 1
this.onLoad()
}
},
postShow (val) {
if (!val) {
this.$refs.scrollRef.scrollTop = 0
}
this.$emit('input', val)
}
},
methods: {
/// 标题拼接 <!-- 商品ID/操作码/商品名称/规格生产厂家-->
titleInitial(model) {
return model.comPartyId + '/(' + model.partyOpcode + ')' + model.partyName
},
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.onLoad()
},
onCancelClick() {
this.postShow = false
this.$emit('cancleclick')
},
onConfirmClick() {
if (!this.choosedPost.comPartyId) {
Dialog.alert({
title: '温馨提示',
message: '请选择仓库!'
}).then(() => {
})
return
}
this.postShow = false
this.$emit('confirmclick', {
page: 'wareHouse',
value: this.choosedPost
})
},
itemClick(item, index) {
this.checked = item.comPartyId
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': 'erp_ogg_shaphar', // this.linkInfo.sysDbSource
// 'invOwner': '608',
// 'erpUserId': '105100',
// 'pageNum': _this.currentPage,
// 'pageSize': _this.pageSize,
// 'store': _this.keywords
// }
let data = {
'dbSource': _this.linkInfo.sysDbSource,
'invOwner': _this.linkInfo.sysOrgId,
'erpUserId': _this.linkInfo.sysUserId,
'pageNum': _this.currentPage,
'pageSize': _this.pageSize,
'store': _this.keywords
}
getWareHouseList(data).then(rt => {
if (_this.currentPage === 1 && rt.entity) {
_this.searchNum = rt.entity.total + ''
this.postDataList = []
}
if (rt.code == '00000') {
if (this.isRefreshing) {
this.postDataList = rt.entity.storeList
} else if (!!rt.entity.storeList || rt.entity.storeList.length > 0) {
this.postDataList = this.postDataList.concat(rt.entity.storeList)
}
// _this.postDataListSetAction(rt.data)
// 重置刷新提示
_this.isRefreshing = false
// 重置加载更多提示
_this.loading = false
// 若当前加载的页数没有满足每页的数量代表完全加载
if (rt.entity.storeList.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-row class="cgtime-choose">
<van-col span="11" class="padding-10" style="padding-right: 3px">
<van-field v-model="start" @click.stop="chooseTime('start')" :clickable="true" :readonly="true" placeholder="开始日期" />
</van-col>
<van-col span="2" class="to"></van-col>
<van-col span="11" class="padding-10" style="padding-left: 3px">
<van-field v-model="end" @click.stop="chooseTime('end')" :clickable="true" :readonly="true" placeholder="结束日期" />
</van-col>
</van-row>
<van-popup
v-model="showTimeDialog"
get-container="body"
close-icon="close"
position="bottom"
>
<van-datetime-picker
v-model="currentDate"
type="date"
v-if="showTimeDialog"
@confirm="confirm"
@cancel="cancel"
:min-date="minDate"
:max-date="maxDate"
:formatter="formatter"
/>
</van-popup>
</div>
</template>
<script>
import { getFormateDate } from '@/utils/common'
export default {
name: 'CgTimeChoose',
data() {
return {
selector: '',
start: getFormateDate(new Date(), 'yyyy-MM-dd'),
end: getFormateDate(new Date(), 'yyyy-MM-dd'),
minDate: new Date(),
maxDate: new Date(),
showTimeDialog: false,
currentDate: new Date(),
startDate: new Date(),
endDate: new Date()
}
},
props: {
/*
* 时间选择器的可选最小时间
*/
min: {
type: Date,
default: () => new Date(new Date().getFullYear() - 10, 0, 1)
},
/*
* 时间选择器的可选最大时间
*/
max: {
type: Date,
default: () => new Date()
},
/*
* 时间选择器的重置开始时间
*/
startTime: {
type: String,
default: ''
},
/*
* 时间选择器的重置结束时间
*/
endTime: {
type: String,
default: ''
}
},
watch: {
startTime (val) {
if (!val) return false
this.start = val
},
endTime (val) {
if (!val) return false
this.end = val
}
},
mounted() {
// console.log(this.min)
},
methods: {
formatter(type, val) {
if (type === 'year') {
return `${val}年`
} else if (type === 'month') {
return `${val}月`
} else if (type === 'day') {
return `${val}日`
}
return val
},
confirm (data) {
this.showTimeDialog = false
let startTime = new Date();
let endTime = new Date();
if (this.selector === 'start') {
startTime = data
endTime = this.end
this.startDate = data
} else if (this.selector === 'end') {
startTime = this.start
endTime = data
this.endDate = data
}
// console.log(this.selector,startTime,endTime)
// console.log(this.timeIntervalNum(startTime,endTime))
this.timeAction(startTime,endTime,data)
this.$emit('confirm', {
start: this.start,
end: this.end
})
},
// 时间处理
timeAction(startTime,endTime,data) {
if (this.selector == 'start'){
if (this.timeIntervalNum(startTime,endTime) > 99) {
this[this.selector] = getFormateDate(new Date(data), 'yyyy-MM-dd')
this.end = this.addDateStr(startTime,100)
return
} else if (this.timeIntervalNum(startTime,endTime) < 0) {
this[this.selector] = getFormateDate(new Date(data), 'yyyy-MM-dd')
this.end = getFormateDate(new Date(data), 'yyyy-MM-dd')
return
}
// this.end = getFormateDate(new Date(data), 'yyyy-MM-dd')
}
this[this.selector] = getFormateDate(new Date(data), 'yyyy-MM-dd')
return
},
addDateStr(startTime,AddDayCount) {
var dd = startTime;
if (AddDayCount < 0) {
dd.setDate(dd.getDate()-AddDayCount);//获取AddDayCount天后的日期
} else {
dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
}
var y = dd.getFullYear();
var m = (dd.getMonth()+1)<10?"0"+(dd.getMonth()+1):(dd.getMonth()+1);//获取当前月份的日期,不足10补0
var d = dd.getDate()<10?"0"+dd.getDate():dd.getDate();//获取当前几号,不足10补0
return y+"-"+m+"-"+d;
},
getDay(time,day) {  
var today = new Date(time);
var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;  
today.setTime(targetday_milliseconds); //注意,这行是关键代码
  
var tYear = today.getFullYear();  
var tMonth = today.getMonth();  
var tDate = today.getDate();  
tMonth = this.doHandleMonth(tMonth + 1);  
tDate = this.doHandleMonth(tDate);  
return tYear + "-" + tMonth + "-" + tDate;
},
doHandleMonth(month) {  
var m = month;  
if (month.toString().length == 1) {  
m = "0" + month;  
}  
return m;
},
cancel () {
this.showTimeDialog = false
},
chooseTime (type) {
this.selector = type
this.currentDate = new Date(this[type])
this.showTimeDialog = true
if (type === 'end') {
let value = !this.start ? new Date() : new Date(this.start)
// this.minDate = value
if (this.start == getFormateDate(new Date(), 'yyyy-MM-dd')) {
this.maxDate = value
this.minDate = value
} else {
if (this.timeIntervalNum(this.start,this.end) > 99) {
this.maxDate = new Date(this.getDay(value,100))
} else if (this.timeIntervalNum(this.start,getFormateDate(new Date(), 'yyyy-MM-dd')) <= 99) {
this.maxDate = new Date()
} else {
this.maxDate = new Date(this.getDay(this.start,100))
}
this.minDate = value
}
} else if (type === 'start') {
// this.maxDate = !this.end ? new Date() : new Date(this.end)
// this.minDate = this.min
this.maxDate = this.max
this.minDate = this.min
}
},
// 判断间隔
judgmentInterval(start,end) {
let startTime = new Date(start); // 开始时间
let endTime = new Date(end); // 结束时间
let usedTime = endTime - startTime;
let days = Math.floor(usedTime / (24 * 3600 * 1000));
// console.log(days)
if (days > 100) {
this.$toast('时间间隔不能大于100天!')
return true
}
return false
},
// 判断间隔
timeIntervalNum(start,end) {
let startTime = new Date(start); // 开始时间
let endTime = new Date(end); // 结束时间
let usedTime = endTime - startTime;
let days = Math.floor(usedTime / (24 * 3600 * 1000));
return days
}
}
}
</script>
<style lang="scss" scoped>
.cgtime-choose {
.van-cell.van-field {
padding: 5px 6px;
background-color: #EFF5F9;
/deep/ input {
font-size: 14px;
text-align: center;
}
}
.to {
text-align: center;
line-height: 53px;
color: #B9B9BB;
}
}
</style>
<style lang="scss" scoped>
.nav-space {
height: 44px;
}
.placeholder {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
top: 0px;
left: 0px;
text-align: center;
background-color: $bc1;
height: 100%;
position: absolute;
.text {
margin-top: 10px;
font-size: 14px;
color: $tc3;
margin-bottom: 30px;
}
img {
width: 120px;
height: 120px;
display: inline-block;
}
}
</style>
<template>
<div>
<div class="placeholder" v-if="value === 0">
<img mode="widthFix" class="img"
:src="loadingImg || imgs[0]" />
<div class="text">加载中...</div>
</div>
<slot v-if="value === 1"></slot>
<slot v-if="value === 2" name="error">
<div class="placeholder" @click="reload">
<img :src="imgs[1]">
<div class="text">{{errorText}}</div>
<button v-if="actionText" @click.stop="action">{{actionText}}</button>
</div>
</slot>
<slot v-if="value === 3" name="empty">
<div class="placeholder" @click="reload">
<img :src="imgs[2]">
<div class="text">{{emptyText}}</div>
<button v-if="actionText" @click.stop="action">{{actionText}}</button>
</div>
</slot>
</div>
</template>
<script>
import defaultLoadingImg from '@/assets/img/common/loading.gif'
import defaultEmptyImg from '@/assets/img/common/load_error.png'
import defaultErrorImg from '@/assets/img/common/nodata.png'
export default {
name: 'Container',
props: {
value: {
type: Number,
default: 0
},
loadingImg: {
type: String,
default: ''
},
emptyText: {
type: String,
default: '暂无数据'
},
errorText: {
type: String,
default: '加载失败'
},
actionText: {
type: String
},
hasNav: {
type: Boolean,
default: true
}
},
data() {
return {
status: this.value,
imgs: [ defaultLoadingImg, defaultEmptyImg, defaultErrorImg ]
}
},
watch: {
value(val) {
this.status = val
}
},
methods: {
action() {
this.$emit('action', '')
},
reload() {
this.status = 0
this.$emit('reload', (e) => {
console.log(e)
})
this.$emit('input', this.status)
}
}
}
</script>
<template>
<div id="mapView">
<!-- <div id="container" style="width:100%;height:400px"></div> -->
<el-amap
:plugin="plugin"
:amap-manager="amapManager"
:zoom="zoom"
:center="center"
vid="amapDemo"
ref="reds"
style="width:100vw;height:80vh"
:events="events"
></el-amap>
</div>
</template>
<script>
import { AMapManager} from 'vue-amap';
import VueAMap from 'vue-amap'
let amapManager = new VueAMap.AMapManager();
// var map = amapManager.getMap();
import AMap from 'AMap'
//引入高德地图ui组件
import { lazyAMapApiLoaderInstance } from "vue-amap";
export default {
name: 'MapView',
props: {
value: {
type: Number,
default: 0
}
},
data() {
let _obj = this;
return {
status: this.value,
amapManager,
center: [116.379028, 39.865042],
plugin: [
{
pName: "Scale",
events: {
init(instance) {
console.log(instance);
}
}
}
],
zoom: 13,
events: {
init(o) {
// _obj.createMap();
o.setMapStyle('amap://styles/macaron'); //自定义的高德地图的样式,我选的是马卡龙
let marker = new AMap.Marker({ //点图标
position: [116.379028, 39.865042]
});
// o.setZoomAndCenter(16, [116.379028, 39.865042])
marker.setMap(o);
o.plugin(["AMap.Driving"], function() {
var driving = new AMap.Driving({
map: o,
showTraffic: false // 是否显示拥堵状态
})
//地点关键字+ 驾车路线规划
driving.search(new AMap.LngLat(116.379028, 39.865042), new AMap.LngLat(116.427281, 39.903719), function(status, result) {
// result 即是对应的驾车导航信息,相关数据结构文档请参考 https://lbs.amap.com/api/javascript-api/reference/route-search#m_DrivingResult
if (status === 'complete') {
console.log('绘制驾车路线完成');
} else {
console.log('获取驾车数据失败:' + result);
}
}
)
o.addControl(driving);
})
}
},
marker: {},
map: {} //保存地图对象
}
},
watch: {
value(val) {
this.status = val
}
},
mounted() {
this.createMapOne()
},
methods: {
// 创建地图
createMapOne() {
},
createMap() {
o.setMapStyle('amap://styles/macaron'); //自定义的高德地图的样式,我选的是马卡龙
let marker = new AMap.Marker({ //点图标
position: [116.379028, 39.865042]
});
},
action() {
this.$emit('action', '')
}
}
}
</script>
<style lang="scss" scoped>
#MapView {
// height: 44px;
}
</style>
\ No newline at end of file
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.
<template>
<div class="content"><span class="red-tips">{{resultNum}}</span> 条搜索结果</div>
</template>
<script>
export default {
name: 'SearchResult',
data() {
return {
num: 0
}
},
props: {
/**
* 搜索结果的数量
*/
resultNum: {
type: String,
default: '0'
}
}
}
</script>
<style lang="scss" scoped>
.content{
color: #9FA6B3;
font-size: 14px;
padding: 8px 10px;
background: #f5f5f5;
.red-tips {
color: #EB602F;
}
}
</style>
This diff is collapsed.
This diff is collapsed.
const filter = {
formatMoney(value) {
if (value) {
value = Number(value)
return value.toFixed(2)
}
},
// 千分位
separator (val, str, str2) {
str = !str ? '' : str
str2 = !str2 ? '' : str2
if (val) {
return str + (val + '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,') + str2
} else {
return str + '0.00' + str2
}
},
toFix(value, num) {
if (value) {
value = Number(value)
return value.toFixed(num)
} else {
let res = '0'
for (let i= 0 ;i <num;i++){
if(i===0){
res = res + ".0"
}else {
res = res + "0"
}
}
return res
}
},
// 将时间戳转日期格式的过滤器
dateFormat(dataStr) {
var time = new Date(dataStr);
function timeAdd0(str) {
if (str < 10) {
str = '0' + str;
}
return str
}
var y = time.getFullYear();
var m = time.getMonth() + 1;
var d = time.getDate();
var h = time.getHours();
var mm = time.getMinutes();
var s = time.getSeconds();
// return y + '-' + timeAdd0(m) + '-' + timeAdd0(d) + ' ' + timeAdd0(h) + ':' + timeAdd0(mm) + ':' + timeAdd0(s);
return timeAdd0(m) + '-' + timeAdd0(d) + ' ' + timeAdd0(h) + ':' + timeAdd0(mm);
}
}
export default filter
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import filter from './filters'
import 'lib-flexible'
import Container from '@/components/Container'
import './assets/styles/common_vant.scss'
import './assets/styles/common.scss'
import 'font-awesome/css/font-awesome.min.css'
//引入高德地图
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
key: '061c2a328572b71e2b26d9dc1a0cc703',
plugin: ['AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PlaceSearch', 'AMap.Geolocation', 'AMap.Geocoder'],
v: '1.4.4',
uiVersion: '1.0'
})
// import './assets/styles/variable.scss'
import { Button, Toast, Field, Row, Col, NavBar, Search, Uploader,
List, PullRefresh, Popup, Cell, CellGroup, Tab, Tabs, Collapse, Divider, IndexBar, IndexAnchor,
CollapseItem, Icon, Image, RadioGroup, Radio, DatetimePicker, Step, Steps, Card, Swipe, SwipeItem,
Slider, DropdownMenu, DropdownItem, Grid, GridItem, Tag, ImagePreview, Loading,Checkbox, CheckboxGroup, SwipeCell, Dialog, Stepper } from 'vant'
Vue.use(Button).use(Icon).use(Field).use(Row).use(Col).use(NavBar).use(CellGroup)
.use(Toast).use(Search).use(List).use(PullRefresh).use(Popup).use(Cell).use(Tab).use(Tabs)
.use(Collapse).use(CollapseItem).use(Image).use(RadioGroup).use(Radio).use(DatetimePicker)
.use(Steps).use(Step).use(Card).use(Swipe).use(SwipeItem).use(Slider).use(DropdownMenu)
.use(DropdownItem).use(Grid).use(GridItem).use(Tag).use(ImagePreview).use(Divider).use(Loading)
.use(Checkbox).use(CheckboxGroup).use(SwipeCell).use(IndexBar).use(IndexAnchor).use(Uploader).use(Dialog)
.use(Stepper)
Vue.use(Container)
Object.keys(filter).forEach(k => Vue.filter(k, filter[k]))
// import Vant from 'vant'
// import 'vant/lib/index.css'
// Vue.use(Vant)
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
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.
export { default as fetch } from './fetch'
export { default as bridge } from './bridge'
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