Commit d44510c3 by wangzhihui

企微模板

1 parent 0e4aba57
> 1%
last 2 versions
# http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file \ No newline at end of file
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'staging'
build/*.js
src/assets
src/config
public
dist
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', 'eslint:recommended'],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'vue/max-attributes-per-line': [
2,
{
singleline: 10,
multiline: {
max: 1,
allowFirstLine: false
}
}
],
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/name-property-casing': ['error', 'PascalCase'],
'vue/no-v-html': 'off',
'accessor-pairs': 2,
'arrow-spacing': [
2,
{
before: true,
after: true
}
],
'block-spacing': [2, 'always'],
'brace-style': [
2,
'1tbs',
{
allowSingleLine: true
}
],
camelcase: [
0,
{
properties: 'always'
}
],
'comma-dangle': [2, 'never'],
'comma-spacing': [
2,
{
before: false,
after: true
}
],
'comma-style': [2, 'last'],
'constructor-super': 2,
curly: [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
eqeqeq: ['error', 'always', { null: 'ignore' }],
'generator-star-spacing': [
2,
{
before: true,
after: true
}
],
'handle-callback-err': [2, '^(err|error)$'],
indent: [
2,
2,
{
SwitchCase: 1
}
],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [
2,
{
beforeColon: false,
afterColon: true
}
],
'keyword-spacing': [
2,
{
before: true,
after: true
}
],
'new-cap': [
2,
{
newIsCap: true,
capIsNew: false
}
],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [
2,
{
allowLoop: false,
allowSwitch: false
}
],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [
2,
{
max: 1
}
],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [
2,
{
defaultAssignment: false
}
],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [
2,
{
vars: 'all',
args: 'none'
}
],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [
2,
{
initialized: 'never'
}
],
'operator-linebreak': [
2,
'after',
{
overrides: {
'?': 'before',
':': 'before'
}
}
],
'padded-blocks': [2, 'never'],
quotes: [
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [2, 'never'],
'semi-spacing': [
2,
{
before: false,
after: true
}
],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [
2,
{
words: true,
nonwords: false
}
],
'spaced-comment': [
2,
'always',
{
markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}
],
'template-curly-spacing': [2, 'never'],
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
yoda: [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [
2,
'always',
{
objectsInObjects: false
}
],
'array-bracket-spacing': [2, 'never']
}
}
.DS_Store
node_modules
/dist
/docs
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
package-lock.json
yarn.lock
\ No newline at end of file \ No newline at end of file
// // https://github.com/michael-ciniawsky/postcss-load-config
module.exports = ({file}) => {
console.log(file)
// const Adaptive = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|WebOS|Symbian|Windows Phone)/i,
// isMobile = (Adaptive.exec(avigator.userAgent))
return {
plugins: {
autoprefixer: {
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
},
'postcss-px-to-viewport': {
viewportWidth: 375, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750
unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除)
viewportUnit: 'vw', // 指定需要转换成的视窗单位,建议使用vw
selectorBlackList: ['.ignore', '.hairlines', 'ign-','pc-'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名
minPixelValue: 1, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值
mediaQuery: false, // 允许在媒体查询中转换`px`
exclude: [
/node_modules/,
/src\/views\/pc/,
],
}
}
}
}
{
"printWidth": 200,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 120,
"wrap_attributes": "auto",
"proseWrap": "always",
"arrowParens": "avoid",
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"jsxBracketSameLine": true,
"files.insertFinalNewline": true,
"useTabs": false,
"eslintIntegration": true,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
],
"endOfLine": "auto"
}
File mode changed
// 获取 VUE_APP_ENV 非 NODE_ENV,测试环境依然 console
const IS_PROD = ['production', 'prod'].includes(process.env.VUE_APP_ENV)
const plugins = [
[
'import',
{
libraryName: 'vant',
libraryDirectory: 'es',
style: true
},
'vant'
]
]
// 去除 console.log
if (IS_PROD) {
plugins.push('transform-remove-console')
}
module.exports = {
presets: [['@vue/cli-plugin-babel/preset', { useBuiltIns: 'usage', corejs: 3 }]],
plugins
}
{
"name": "gh-hall",
"version": "1.0.0",
"description": "GH Hall By Work WeChat",
"author": "limin <limin.mail@qq.com>",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
"build": "vue-cli-service build",
"stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint --fix",
"dev": "npm run serve"
},
"dependencies": {
"autoprefixer": "^8.0.0",
"core-js": "^3.6.4",
"dayjs": "^1.10.5",
"glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2",
"postcss-loader": "^6.2.0",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"vant": "^2.12.21",
"vconsole": "^3.7.0",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"webpack-spritesmith": "^1.1.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"babel-plugin-import": "^1.13.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"node-sass": "^4.14.1",
"postcss-px-to-viewport": "^1.1.1",
"postcss-pxtorem": "^5.1.1",
"sass-loader": "^8.0.2",
"script-ext-html-webpack-plugin": "^2.1.4",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.6.11",
"webpack-bundle-analyzer": "^3.8.0"
}
}
No preview for this file type
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no,viewport-fit=cover">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<title>
<%= webpackConfig.name %>
</title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it
to continue.</strong>
</noscript>
<div id="app"></div>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
<!-- built files will be auto injected -->
</body>
</html>
<template>
<div id="app">
<template v-if="showWindow">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
</keep-alive>
</transition>
<transition name="fade">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
</template>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
}
},
watch: {
watchFlag: {
immediate: true,
handler(newval) {
this.showWindow = newval
this.hideLoading()
}
}
},
computed: {
watchFlag() {
return this.$store.state.app.showWindow
}
},
mounted() {
},
methods: {}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:API 统一外部调用入口
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-17 18:23:27
*/
import indexApi from './indexApi'
export {
indexApi,
}
\ No newline at end of file \ No newline at end of file
const url = '/rop-dj-pad/router'
export default {
/**获取ai智能体入口 */
getAiMenu(data = {}) {
data.method = 'dj.pad.api.aiagent.get.entry.list'
data.ownerShipType = 0
return window.$HTTP({
url,
data,
returnAll:true
})
},
}
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-20 10:20:52
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-20 14:02:16
* @FilePath: \wx-notification\src\api\purchase.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
const url = '/rop-dj-smartcarlife/router'
export default {
/**采购发货-详情 */
purchaseOrderDetail(data = {}) {
data.method = 'dj.api.smarcarlife.purchaseOrder.h5.detail'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**采购发货-驳回 */
shipmentReject(data = {}) {
data.method = 'dj.api.smarcarlife.purchaseOrder.shipmentReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**商务驳回-驳回 */
businessReject(data = {}) {
data.method = 'dj.api.smarcarlife.businessreview.businessReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**运营驳回 */
operatorReject(data = {}){
data.method = 'dj.api.smarcarlife.operatorreview.operatorReject'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**查看审核记录 */
operatorreview(data = {}) {
data.method = 'dj.api.smarcarlife.operatorreview.view'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**运营审核 */
operatorAudit(data = {}) {
data.method = 'dj.api.smarcarlife.operatorreview.operatorAudit'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**商务审核 */
businessAudit(data = {}) {
data.method = 'dj.api.smarcarlife.businessreview.businessAudit'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**发货主体 */
selectShippingEntityInfoAll(data = {}) {
data.method = 'dj.smartcarlife.api.yqPartnerMerchant.selectShippingEntityInfoAll'
return window.$HTTP({
url,
data,
returnAll: true
})
}
}
.layout {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgb(246, 246, 255);
box-sizing: border-box;
padding: 0 16px 60px;
overflow-y: scroll;
.tips-box {
display: flex;
flex-direction: column;
align-items: center;
padding: 60px 0 64px;
.icon {
width: 100px;
height: 53px;
}
.title {
font-size: 16px;
color: #3975c6;
padding: 15px 0 4px;
font-weight: 500;
}
.tips {
font-size: 12px;
color: #999999;
}
}
> .title {
font-size: 15px;
color: #333333;
span {
position: relative;
&::after {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
bottom: 0;
left: 0;
content: '';
z-index: -1;
border-top: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid rgba($color: #539cff, $alpha: 0.55);
border-left: 6px solid transparent;
}
}
}
.box {
padding-top: 17px;
.item {
margin-bottom: 16px;
background: #ffffff;
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.05);
border-radius: 4px;
box-sizing: border-box;
padding: 24px 16px 16px 16px;
display: flex;
font-size: 12px;
color: #333333;
.title {
width: 60px;
flex-shrink: 0;
position: relative;
padding-left: 10px;
&::after {
position: absolute;
top: 6px;
left: 0;
background: var(--themeColor);
width: 6px;
height: 6px;
border-radius: 100%;
content: '';
}
}
.value {
.text {
display: flex;
align-items: center;
.icon {
width: 20px;
height: 20px;
margin-left: 16px;
}
}
.tips {
color: #999999;
margin-top: 8px;
line-height: 20px;
}
}
.qr-box {
display: flex;
flex-direction: column;
align-items: center;
.qr {
width: 140px;
height: 140px;
}
.tips {
margin-top: 8px;
color: #666666;
}
}
}
.column {
flex-direction: column;
.title {
margin-bottom: 8px;
}
.phone {
color: #666666;
background: #f8f8f8;
border-radius: 1px;
height: 32px;
box-sizing: border-box;
padding: 0 16px;
display: flex;
align-items: center;
justify-content: space-between;
.icon {
height: 20px;
width: 20px;
}
}
}
> .tips {
font-size: 12px;
color: #fc9153;
text-align: center;
}
}
}
@import './normalize.scss';
@import './sprite.scss';
html,
body .app {
color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: #FFF;
-webkit-overflow-scrolling: touch;
height: 100%;
// overflow: hidden;
--themeColor: #3975C6;
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
}
img {
width: 100%;
height: 100%;
vertical-align: top;
}
.flex {
display: flex;
align-items: center;
}
.text-hide {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.text-two-line {
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
display: -webkit-box;
-webkit-box-orient: vertical;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.x-center {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
.y-center {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.box-center{
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
}
.box-ce
.list-box {
padding: 16px;
}
.btn {
padding: 0 12px;
height: 24px;
background: var(--themeColor);
border-radius: 12px;
color: #ffffff;
margin-left: auto;
font-size: 10px;
}
.sprite-icon { background-image: url(../images/sprite.png);background-size: 80px 80px;}
.icon-logo { width: 80px; height: 80px; background-position: 0px 0px;}
\ No newline at end of file \ No newline at end of file
No preview for this file type
No preview for this file type
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-08 19:20:13
* @LastEditors: limin
* @LastEditTime: 2021-06-25 18:09:28
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
Vue.component(component.name, component)
})
// export default [Icon, NavBar, TabBar, Organization, CustomerList, CustomerDetail, OrderList, OrderDetail, TimerTabs, CarType, RadioCell, CheckBoxCell, ValidateField]
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-08 16:55:43
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
const environment = process.env.VUE_APP_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
// 本地环境配置
module.exports = {
}
\ No newline at end of file \ No newline at end of file
module.exports = {
}
\ No newline at end of file \ No newline at end of file
module.exports = {
}
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-21 17:37:04
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
// if (isEnv) {
// let { request } = config
// Object.assign(request, { timeout })
// return Promise.resolve(config)
// }
let url = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=wx-notification'
return window.fetch(url, {}).then(res => res.json())
}
export const cfg = {
install (vue, config) {
vue.prototype.$config = config
}
}
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-19 15:54:19
*/
// 兼容 IE
// https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpolyfill
// import 'core-js/stable'
// import 'regenerator-runtime/runtime'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import api from './api'
import { fetchConfig, cfg } from '@/config'
import '@/assets/css/index.scss'
import { bus, tools, store as local, util } from './utils'
import './utils/util'
import 'components'
Vue.prototype.api = api
Vue.prototype.bus = bus
Vue.prototype.tools = tools
Vue.prototype.local = local
Vue.prototype.to = function (name, params) {
if (name === -1) {
router.go(-1)
return
}
router.push({ name, params })
}
// 移动端适配 rem
// import 'lib-flexible/flexible.js'
import { components } from './plugins/vant'
components.forEach(component => Vue.use(component))
Vue.config.productionTip = false
import VConsole from 'vconsole'
const isMock = ['prod','production'].includes(process.env.NODE_ENV)
fetchConfig(!isMock).then(res => {
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue.use(cfg)
window.$fetchConfig = res
if (res.vconsole) new VConsole()
/**登录过期 重新登录 */
window.reLogin = () => {
util.removeLocalStorage('ww_userInfo')
util.clearSessionId()
store.dispatch('navigation')
}
window.vm = new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
})
import menuMinxin from './menuMinxin'
export {
menuMinxin
}
/*
* @Author: yangming@didihu.com.cn yangming@didihu.com.cn
* @Date: 2025-05-13 10:52:26
* @LastEditors: yangming@didihu.com.cn yangming@didihu.com.cn
* @LastEditTime: 2025-05-13 14:06:00
* @FilePath: \ww-ai-market\src\mixins\menuMinxin.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
import { indexApi } from '@/api'
import { Notify } from 'vant'
export default {
data() {
return {
menuList: [],
userInfo: {}
}
},
computed: {
userId() {
let userInfo = this.getLocalStorage('ww_userInfo') || {}
this.userInfo = userInfo || {}
return userInfo.userId
}
},
mounted() {
this.getAiMenu()
},
methods: {
async getAiMenu() {
try {
let { userId } = this
const { code, data, message } = await indexApi.getAiMenu({
userId
})
if (code == 0) {
this.menuList = data
} else throw message
} catch (error) {
Notify(typeof error == 'string' ? error : '获取失败')
}
},
handleClick(e) {
const { ownerPost, agentUrl, domainName, presuppositionProblem, accountPhone } = e
if (agentUrl)
window.location.href = `${agentUrl}?one_id=${this.userId}&platformType=0&phone=${accountPhone}&position=${ownerPost}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}`
else Notify('获取链接失败')
}
}
}
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-18 14:23:31
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-20 17:40:59
* @FilePath: \wx-notification\src\plugins\vant.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
// 按需全局引入 vant组件
import {
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Lazyload,
Toast,
Search,
ActionSheet,
CellGroup,
Image as VanImage,
Tag,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog
} from 'vant'
export const components = [
Button,
List,
Cell,
Tabbar,
TabbarItem,
NavBar,
Search,
ActionSheet,
CellGroup,
VanImage,
Tag,
Toast,
Field,
Stepper,
Divider,
Step,
Steps,
NoticeBar,
RadioGroup,
Radio,
Uploader,
Tab,
Tabs,
DropdownMenu,
DropdownItem,
Grid,
GridItem,
Popup,
Calendar,
Cascader,
Checkbox,
CheckboxGroup,
Notify,
Icon,
Empty,
PullRefresh,
Picker,
Dialog
]
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-09 17:11:43
*/
import router from './router'
import { keeps } from './routes'
export const keepAlives = keeps
export default router
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-09 10:59:50
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-20 14:35:31
*/
import Vue from 'vue'
import Router from 'vue-router'
import routes from './routes'
import store from '@/store'
const originalPush = Router.prototype.push
Router.prototype.push = function push (location, onResolve, onReject) {
if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)
console.log(routes,'routes')
const router = createRouter()
function createRouter () {
return new Router({
// mode: 'history', // 如果是 history模式 需要配置vue.config.js publicPath
base: process.env.BASE_URL,
scrollBehavior: function (to, from, savedPosition) {
return savedPosition || { x: 0, y: 0 }
},
routes
})
}
router.beforeEach((to, from, next) => {
/* 路由发生变化修改页面title */
store.dispatch('setPageMeta', to.meta)
/* 路由发生变化修改页面背景色 */
document.documentElement.style.backgroundColor = to.meta.backgroundColor || '#fff'
to.matched.forEach(recode => {
console.log(recode)
})
if (to.matched.some(recode => recode.meta.noAuth)) {
console.log('noAuth')
store.dispatch('registerHttp')
store.state.app.showWindow = true
} else {
console.log('navigation')
store.dispatch('navigation', to)
}
next()
})
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () {
const newRouter = createRouter()
router.matcher = newRouter.matcher // reset router
}
export default router
\ No newline at end of file \ No newline at end of file
/*
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-18 14:23:31
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-18 17:00:07
* @FilePath: \wx-notification\src\router\routes.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A
*/
const keepAlives = []
const pages = {
purchase: [
{
name: 'index',
meta: {
keepAlive: true,
title: '采购订单审核',
noAuth: true,
backgroundColor: '#f7f8fa',
showAction: true
}
}
]
}
let routes = [
{
path: '/',
redirect: '/purchase'
}
]
Object.keys(pages).map(parent => {
pages[parent].map(val => {
let childrenPath = `${parent}/${val.name}`
let { meta } = val
const path = `/${val.name == 'index' ? parent : childrenPath}`
const name = val.name == 'index' ? parent : childrenPath.replace('/', '.')
if (meta && meta.keepAlive) keepAlives.push(name)
let route = {
component: resolve => require([`views/${childrenPath}.vue`], resolve),
path,
name,
meta
}
routes.push(route)
})
})
export const keeps = keepAlives
export default routes
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:54
* @FilePath: \gh-hall\src\store\getters.js
*/
const getters = {
app: state => state.app
}
export default getters
import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
// import createPersistedState from "vuex-persistedstate"
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
app
},
getters
// plugins: [createPersistedState({
// //指定存储模式
// storage: window.sessionStorage
// })]
})
export default store
import { util } from 'utils'
import { Http } from 'glsx-common'
import { Notify } from 'vant'
const state = {
showWindow: false
}
import router from '@/router'
const mutations = {
SET_PAGE_META (state, meta) {
state.pageMeta = meta
},
}
const actions = {
setPageMeta ({ commit }, meta) {
document.title = meta.title || '企微通知模板'
commit('SET_PAGE_META', meta)
},
registerHttp ({ }, sessionId = '') {
window.$HTTP = new Http({ ...window.$fetchConfig, alert: Notify, headers: { token: sessionId } })
},
login ({ dispatch }) {
const { corpId, agentId } = util.getLocalStorage('ww_storage_info'),
{ loginUrl } = window.$fetchConfig
window.location.href = `${loginUrl}?redirect_uri=${encodeURIComponent(window.location.href)}&corpId=${corpId}&agentId=${agentId}`
},
navigation ({ dispatch }, to) {
let { corpId, agentId } = getParams()
let userInfo = util.getLocalStorage('ww_userInfo')
dispatch('registerHttp')
if (corpId) {
let ww_storage_info = {}
ww_storage_info.corpId = corpId
if (agentId && agentId != 'undefined') ww_storage_info.agentId = agentId
util.setLocalStorage('ww_storage_info', ww_storage_info)
}
if (userInfo) {
state.showWindow = true
} else {
util.showLoading()
dispatch('login')
}
},
}
const getParams = name => {
let [url, paramsList] = window.location.href.split('?')
if (!paramsList) return name ? null : {}
let param = paramsList.split('&')
let obj = {}
param.map(e => {
let [key, value] = e.split('=')
obj[key] = value
})
return name ? obj[name] : obj
}
export default {
state,
mutations,
actions
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-15 14:41:02
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-20 14:16:12
*/
export const STORE_USER_KEY = 'STORE_USER_KEY'
// 发货模式
export const purchasingPatternOptions = [
{
confId: 1,
confValue: "直营"
},
{
confId: 2,
confValue: "批发"
},
{
confId: 3,
confValue: "代销"
}
]
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-06-09 17:01:55
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:18
* @FilePath: \gh-hall\src\utils\eventBus.js
*/
/**
* eventBus,事件总线,可以在任意组件之间实现事件通信
* 使用方法,使用下面的两行代码即可创建一个 eventBus,创建好以后在 main,js 中引入
* 并通过 Vue.prototype.bus = bus 将 eventBus 挂载到 vue 的原型上就可以全局使用 eventBus 了
*
* 发送事件:在触发事件的地方使用 $emit 来发送事件
* this.bus.$emit(‘事件名’,eventData)
*
* 接收事件:在需要接收事件的地方使用 $on 来接收事件
* this.bus.$on(‘事件名’,(eventData)=>{
console.log(eventData)
})
*
* 注销事件:$emit 定义的事件必须要在组件销毁之前注销,不然事件会一直触发
* beforeDestroy() {
this.bus.$off(‘事件名’);
},
*/
import Vue from 'vue'
export default new Vue()
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:11
*/
import bus from './eventBus'
import util from './util'
import * as tool from './tools'
const { debounce, throttle, ...tools } = tool
import * as constants from './constants'
import store from './store'
export { bus, tools, debounce, throttle, constants, store, util }
\ No newline at end of file \ No newline at end of file
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-15 14:46:31
* @LastEditors: limin
* @LastEditTime: 2021-06-20 12:49:04
*/
import store from 'storejs'
export default {
...store,
exp: {
set: function(key, val, exp = 24 * 60 * 60 * 1000) {
store.set(key, { val: val, exp: exp, time: new Date().getTime() })
},
get: function(key) {
var info = store.get(key)
if (!info) {
return null
}
if (new Date().getTime() - info.time > info.exp) {
store.remove(key)
return null
}
return info.val
}
},
consts: {
USER_KEY: 'USER_KEY',
}
}
\ No newline at end of file \ No newline at end of file
/**
* Parse the time to string
* @param {(Object|string|number)} time
* @param {string} cFormat
* @returns {string}
*/
export function parseTime(time, cFormat) {
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
time = parseInt(time)
}
if (typeof time === 'number' && time.toString().length === 10) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') {
return ['日', '一', '二', '三', '四', '五', '六'][value]
}
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
/**
* @param {number} time
* @param {string} option
* @returns {string}
*/
export function formatTime(time, option) {
if (('' + time).length === 10) {
time = parseInt(time) * 1000
} else {
time = +time
}
const d = new Date(time)
const now = Date.now()
const diff = (now - d) / 1000
if (diff < 30) {
return '刚刚'
} else if (diff < 3600) {
// less 1 hour
return Math.ceil(diff / 60) + '分钟前'
} else if (diff < 3600 * 24) {
return Math.ceil(diff / 3600) + '小时前'
} else if (diff < 3600 * 24 * 2) {
return '1天前'
}
if (option) {
return parseTime(time, option)
} else {
return d.getMonth() + 1 + '月' + d.getDate() + '日' + d.getHours() + '时' + d.getMinutes() + '分'
}
}
/**
* @param {string} url
* @returns {Object}
*/
export function param2Obj(url) {
const search = url.split('?')[1]
if (!search) {
return {}
}
return JSON.parse(
'{"' +
decodeURIComponent(search)
.replace(/"/g, '\\"')
.replace(/&/g, '","')
.replace(/=/g, '":"')
.replace(/\+/g, ' ') +
'"}'
)
}
export function debounce(fn, delay = 500) {
// timer 是在闭包中的
let timer = null
return function() {
clearTimeout(timer)
timer = setTimeout(() => {
fn.apply(this, arguments)
}, delay)
}
}
export function throttle(fn, delay = 500) {
let timer = null
return function(e) {
if (timer) {
return
}
timer = setTimeout(() => {
fn.apply(this, arguments)
// fn(e)
timer = null
}, delay)
}
}
/**
* 深拷贝
* @param {} target
*/
export function deepClone(target) {
// 定义一个变量
let result
// 如果当前需要深拷贝的是一个对象的话
if (typeof target === 'object') {
// 如果是一个数组的话
if (Array.isArray(target)) {
result = [] // 将result赋值为一个数组,并且执行遍历
for (let i in target) {
// 递归克隆数组中的每一项
result.push(deepClone(target[i]))
}
// 判断如果当前的值是null的话;直接赋值为null
} else if (target === null) {
result = null
// 判断如果当前的值是一个RegExp对象的话,直接赋值
} else if (target.constructor === RegExp) {
result = target
} else {
// 否则是普通对象,直接for in循环,递归赋值对象的所有值
result = {}
for (let i in target) {
result[i] = deepClone(target[i])
}
}
// 如果不是对象的话,就是基本数据类型,那么直接赋值
} else {
result = target
}
// 返回最终结果
return result
}
export function fixed(num, decimal) {
num = num.toString()
let index = num.indexOf('.')
if (index !== -1) {
num = num.substring(0, decimal + index + 1)
} else {
num = num.substring(0)
}
return parseFloat(num).toFixed(decimal)
}
/**
* 四舍五入,保留指定小数位数,当原始数据不满足长度时,补 0
* @param number [Number | String] 原始数据,支持字符串和数值型
* @param i [Number] 保留的小数个数 >= 0
* @returns [Number] 转换后的数据
*/
export function transformDecimal(number, i) {
let decimalNum = null
// 先转换为数值型
let num = Number(number)
// 判断是否为数值型
if (!isNaN(num)) {
// 切分整数与小数
let arr = num.toString().split('.')
// 是小数且小数位大于保留个数
if (arr.length > 1 && arr[1].length > i) {
// 小数部分字符串
let decimal = arr[1].slice(i, i + 1)
// toFixed 有 bug,四舍六入五随机
// 当四舍五入的数为 5,给其 + 1
if (decimal === '5') {
// 这里可能会存在 0.1 ** 5 = 0.000010000000000000003 但不影响四舍五入
num += Math.pow(0.1, i + 1)
}
decimalNum = num.toFixed(i)
} else {
decimalNum = num
}
decimalNum = Number(decimalNum).toFixed(i)
}
return decimalNum
}
\ No newline at end of file \ No newline at end of file
import Vue from 'vue'
import {
Toast,
Dialog
} from 'vant'
/**
* 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/
Date.prototype.format = function(fmt) {
let o = {
'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日
'h+': this.getHours(), //小时
'm+': this.getMinutes(), //分
's+': this.getSeconds(), //秒
//季度
'q+': Math.floor((this.getMonth() + 3) / 3),
'S': this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
}
}
return fmt
}
const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
let _lastTime = null
return function() {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments)
_lastTime = _nowTime
}
}
}
/**防止重复点击 */
const showLoading = (title = '加载中...', callBack, custom) => {
Toast({
type: 'loading',
message: title,
forbidClick: true,
duration: 0
})
if (callBack && typeof callBack == 'function') {
if (!custom) Toast.clear()
callBack()
}
}
const hideLoading = () => {
Toast.clear()
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
const showToast = (message = '', callBack) => {
let params = {
message,
forbidClick: true,
duration: 1500
}
Toast(params)
if (callBack && typeof callBack == 'function') {
setTimeout(() => {
callBack()
}, 1500)
}
}
/**触摸样式 */
const touchstart = e => {
e.target.classList.add('btn-on-leave')
}
const touchend = e => {
e.target.classList.remove('btn-on-leave')
}
const setLocalStorage = (key, item) => {
window.localStorage.setItem(key, JSON.stringify(item))
// sessionStorage.setItem(key, JSON.stringify(item))
}
const getLocalStorage = key => {
return JSON.parse(window.localStorage.getItem(key))
// return JSON.parse(sessionStorage.getItem(key))
}
const removeLocalStorage = key => {
window.localStorage.removeItem(key)
// sessionStorage.removeItem(key)
}
const dialog = (params = {}) => {
if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
return Dialog.confirm(params)
}
/**拨打电话 */
const makePhoneCall = phoneNumber => {
window.location.href = `tel://${phoneNumber}`
}
/**是否全面屏 */
const isFullSucreen = () => {
let result = false;
const rate = window.screen.height / window.screen.width
let limit = window.screen.height == window.screen.availHeight ? 1.8 : 1.65 // 临界判断值
result = rate > limit
return result
}
const jumpChildrenPage = (to, params) => {
let { name } = window.vm._route
window.vm.$router.push({ name: `${name}.${to}`, params })
}
/**拷贝 */
const setClipboardData = data => {
let transfer = document.createElement('input')
document.body.appendChild(transfer)
transfer.value = data
transfer.focus()
transfer.select()
if (document.execCommand('copy')) document.execCommand('copy')
transfer.blur()
Toast('内容已复制')
document.body.removeChild(transfer)
}
/**接口请求时失败让用户刷新 */
const refreshPage = (message = '系统异常') => {
return Dialog.alert({
message,
theme: 'round-button',
confirmButtonText: '点击重试',
confirmButtonColor: '#FF7336'
})
}
const toTop = () => {
let bodySrcollTop = document.body.scrollTop
if (bodySrcollTop !== 0) {
document.body.scrollTop = 0
return
}
let docSrcollTop = document.documentElement.scrollTop
if (docSrcollTop !== 0) {
document.documentElement.scrollTop = 0
}
}
const getParams = () => {
return window.vm.$route.params
}
const getQuery = (name) => {
let [url, paramsList] = window.location.href.split('?')
if (!paramsList) return name ? null : {}
let param = paramsList.split('&')
let obj = {}
param.map(e => {
let [key, value] = e.split('=')
obj[key] = value
})
return name ? obj[name] : obj
}
const closeWindow = () => {
wx.closeWindow()
}
const debounce=(fn, delay, triggerNow)=> {
var t = null;
var debounced = function () {
var _self = this,
args = arguments;
if (t) {
clearTimeout(t);
}
if (triggerNow) {
var exec = !t;
t = setTimeout(function () {
t = null;
}, delay);
console.log(exec,'exec')
if (exec) {
fn.apply(_self, args);
}
} else {
t = setTimeout(function () {
fn.apply(_self, args);
}, delay);
}
};
debounced.cancel = function () {
clearTimeout(t);
t = null;
};
return debounced;
}
const utils = {
removeLocalStorage,
setClipboardData,
jumpChildrenPage,
setLocalStorage,
getLocalStorage,
makePhoneCall,
isFullSucreen,
showLoading,
closeWindow,
hideLoading,
refreshPage,
touchstart,
showToast,
getParams,
getQuery,
touchend,
throttle,
decimal,
dialog,
toTop,
debounce
}
Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key]
})
export default utils
\ No newline at end of file \ No newline at end of file
<!--
* @Author: 'wangzhihui' '1733904062@qq.com'
* @Date: 2025-11-19 16:39:10
* @LastEditors: 'wangzhihui' '1733904062@qq.com'
* @LastEditTime: 2025-11-21 16:02:32
* @FilePath: \wx-notification\src\views\purchase\components\approveComp.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="cell" @click="handleSelect" v-if="staffType == 2">
<div class="label">
发货主体
<span class="require">*</span>
</div>
<van-cell is-link :value="approveForm.sendOutMerchantName" />
</div>
<div class="line-feed">
<div class="label">备注</div>
<van-field class="textarea" v-model="approveForm.remark" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入备注" show-word-limit />
</div>
<div class="explain" v-if="staffType==2">说明:订单审核后自动流转至商务进行复审。</div>
<div class="explain" v-if="staffType==3">说明:订单审核后会自动流转至供应商进行确认并发货。</div>
</div>
<send-out-comp :isVisible="sendOutVisible" v-if="sendOutVisible" @cancel="handleSendCancel" @submit="handleSendSumit" :sendOutMerchantId="approveForm.sendOutMerchantId"></send-out-comp>
</h-dialog>
</template>
<script>
import { Toast } from 'vant'
import hDialog from './dialog'
import sendOutComp from './sendOutComp'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog, sendOutComp },
data() {
return {
name: this.$route.query.name,
staffType: this.$route.query.staffType,
sendOutVisible: false,
title: '通过',
approveForm: {
remark: '',
sendOutMerchantId: '',
sendOutMerchantName: '深圳广联赛讯股份有限公司'
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
infoData: {
type: Object,
default: () => ({})
}
},
watch: {
infoData: {
handler(val) {
this.initData(val)
},
immediate: true,
deep: true
}
},
methods: {
handleSendCancel() {
this.sendOutVisible = false
},
handleSendSumit(data) {
this.approveForm.sendOutMerchantName = data.shippingEntity
this.approveForm.sendOutMerchantId = data.shippingEntityId
this.handleSendCancel()
},
initData(val) {
this.approveForm.sendOutMerchantName = val.sendOutMerchantName
this.approveForm.sendOutMerchantId = val.sendOutMerchantId
},
handleSelect() {
console.log('handleSelect')
// this.$emit('handleSelect')
this.sendOutVisible = true
},
validateRequiredFields() {
let validators = {
sendOutMerchantId: () => {
Toast('请选择发货主体')
}
}
for (let key in validators) {
if (!this.approveForm[key]) {
validators[key]()
return false
}
}
return true
},
getMethodByStaffType() {
const methodMap = {
2: 'operatorAudit',
3: 'businessAudit'
}
return methodMap[this.staffType]
},
async handleSubmit() {
const isValid = this.validateRequiredFields()
if (!isValid) return
const methodName = this.getMethodByStaffType()
if (!methodName) {
Toast('当前角色不支持此操作')
return
}
try {
this.$refs.myDialog.startLoading()
const params = {
orderCode: this.infoData.orderCode,
operatorName: this.name,
...this.approveForm
}
//运营审核有该字段,商户审核没有2-运营审核 3-商务审核
if (this.staffType == 3) {
delete params.sendOutMerchantName
delete params.sendOutMerchantId
}
const result = await purchaseApi[methodName](params)
if (result.code == 0) {
Toast.success('操作成功')
setTimeout(() => {
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
}, 500)
} else {
this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败')
}
} catch (error) {
this.$refs.myDialog.stopLoading()
Toast.fail('系统异常,请稍后再试')
console.error(error)
}
// this.$refs.myDialog.stopLoading();
},
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 12px;
font-size: 14px;
.cell {
display: flex;
align-items: center;
height: 52px;
border-bottom: 1px solid #eff0f2;
}
.label {
color: #333333;
font-size: 14px;
margin-right: 18px;
display: flex;
align-items: center;
white-space: nowrap;
line-height: 20px;
.require {
color: #f24724;
font-size: 14px;
margin-left: 4px;
line-height: 52px;
margin-top: 5px;
}
}
.line-feed {
.label {
line-height: 52px;
}
.textarea {
border-radius: 8px;
border: 1px solid #eff0f2;
// height: 220px;
}
}
.explain {
color: #999999;
font-size: 14px;
margin-top: 10px;
}
::v-deep .van-cell__value--alone {
text-align: right;
color: #333333;
font-size: 14px;
width: 300px;
}
}
</style>
<template>
<van-popup
round
v-model="isShow"
position="bottom"
:style="{ height: '75%' }"
class="popup"
@close="onClose"
:close-on-click-overlay="false"
>
<div class="title">{{ title }}</div>
<div class="content">
<slot></slot>
</div>
<div class="btn-group">
<div class="btn cancel" @click="handleCancel">取消</div>
<div
class="btn confirm"
@click="handleConfirm"
:class="{ disabled: loading }"
>
{{ loading ? '提交中...' : '确定' }}
</div>
</div>
</van-popup>
</template>
<script>
export default {
data() {
return {
isShow: this.isVisible,
loading: false,
confirmPromise: null // 保存最近一次 confirm promise
};
},
props: {
title: {
type: String,
default: '驳回'
},
isVisible: {
type: Boolean,
default: true
}
},
watch: {
isVisible(val) {
this.isShow = val;
}
},
methods: {
async handleConfirm() {
if (this.loading) return; // 避免重复点击
this.$emit('confirm');
},
handleCancel() {
this.$emit('cancel');
this.isShow = false;
},
onClose() {
this.$emit('update:visible', false);
},
/**
* 公开方法:允许外部手动停止 loading 状态
*/
stopLoading() {
this.loading = false;
},
/**
* 公开方法:允许外部手动开始 loading 状态
*/
startLoading() {
this.loading = true;
}
}
};
</script>
<style scoped lang="scss">
.popup {
.title {
height: 55px;
line-height: 55px;
box-shadow: inset 0 -0.5px 0 0 #e8e8ea;
color: #333333;
font-size: 16px;
text-align: center;
border-bottom: 1px solid #eff0f2;
}
.content {
height: calc(100% - 111px);
overflow-y: scroll;
}
.btn-group {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 16px;
.btn {
flex: 1;
border-radius: 6px;
height: 41px;
line-height: 41px;
font-size: 16px;
cursor: pointer;
&.disabled {
opacity: 0.6;
pointer-events: none;
}
}
.cancel {
border: 1px solid #dee0e3;
background: #f4f5f7;
color: #292d33;
text-align: center;
}
.confirm {
background: #347bff;
color: #ffffff;
text-align: center;
margin-left: 11px;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="cell">
<div class="label">
驳回节点
<span class="require">*</span>
</div>
<van-radio-group v-model="rejectForm.rejectNode" direction="horizontal">
<van-radio v-for="item in dynamicNodeList" :key="item.value" :name="item.value" icon-size="16px">
{{ item.label }}
</van-radio>
</van-radio-group>
</div>
<div class="line-feed">
<div class="label">
驳回原因
<span class="require">*</span>
</div>
<van-field class="textarea" v-model="rejectForm.rejectCause" rows="8" :autosize="{ maxHeight: 220 }" label="" type="textarea" maxlength="200" placeholder="请输入驳回原因" show-word-limit />
</div>
<div class="explain" v-if="staffType == 4">说明:驳回后,整个采购订单进行驳回,无法再重新进行发货操作。</div>
</div>
</h-dialog>
</template>
<script>
import hDialog from './dialog'
import { Toast } from 'vant'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog },
data() {
return {
name: this.$route.query.name,
staffType: this.$route.query.staffType, //(2-运营审核 3-商务审核 4-采购发货审核)
title: '驳回',
rejectForm: {
rejectNode: '',
rejectCause: ''
}
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
infoData: {
type: Object,
default: () => ({})
}
},
computed: {
/**
* 根据 staffType 动态生成驳回节点列表
*/
dynamicNodeList() {
const baseOptions = [
{ label: '采购商户', value: '1' },
{ label: '运营审核', value: '2' },
{ label: '商务审核', value: '3' }
]
switch (this.staffType) {
case '2': // 运营审核
return [baseOptions[0]] // 只返回采购审核
case '3': // 商务审核
return baseOptions.slice(0, 2) // 返回采购审核、运营审核
case '4': // 采购发货审核
return baseOptions // 返回全部
default:
return [] // 默认无选项
}
}
},
methods: {
validateRequiredFields() {
let validators = {
rejectNode: () => {
Toast('请选择驳回节点')
},
rejectCause: () => {
Toast('请输入驳回原因')
}
}
for (let key in validators) {
if (!this.rejectForm[key]) {
validators[key]()
return false
}
}
return true
},
getRejectMethodByStaffType() {
const methodMap = {
2: 'operatorReject',
3: 'businessReject',
4: 'shipmentReject'
}
return methodMap[this.staffType]
},
async handleSubmit() {
const isValid = this.validateRequiredFields()
if (!isValid) return
const methodName = this.getRejectMethodByStaffType()
if (!methodName) {
Toast('当前角色不支持此操作')
return
}
try {
this.$refs.myDialog.startLoading()
const params = {
orderCode: this.infoData.orderCode,
operatorName: this.name,
...this.rejectForm
}
const result = await purchaseApi[methodName](params)
if (result.code == 0) {
Toast.success('操作成功')
setTimeout(() => {
this.$refs.myDialog.stopLoading()
this.handleCancel()
this.$emit('success')
}, 500)
} else {
this.$refs.myDialog.stopLoading()
Toast.fail(result.message || '请求失败')
}
} catch (error) {
this.$refs.myDialog.stopLoading()
Toast.fail('系统异常,请稍后再试')
console.error(error)
}
// this.$refs.myDialog.stopLoading();
},
handleCancel() {
this.$emit('cancel')
// this.isVisible = false
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 12px;
font-size: 14px;
.cell {
display: flex;
align-items: center;
height: 52px;
border-bottom: 1px solid #eff0f2;
}
.label {
color: #333333;
font-size: 14px;
margin-right: 18px;
display: flex;
align-items: center;
white-space: nowrap;
line-height: 20px;
.require {
color: #f24724;
font-size: 14px;
margin-left: 4px;
line-height: 52px;
margin-top: 5px;
}
}
.line-feed {
.label {
line-height: 52px;
}
.textarea {
border-radius: 8px;
border: 1px solid #eff0f2;
// height: 220px;
}
}
.explain {
color: #999999;
font-size: 14px;
margin-top: 10px;
}
}
</style>
<template>
<h-dialog ref="myDialog" :title="title" :isVisible="isVisible" @confirm="handleSubmit" @cancel="handleCancel">
<div class="formObj">
<div class="search-pop-input">
<van-field v-model="keyword" placeholder="搜索" left-icon="https://img02.glsx.com.cn/weapp/resource/saas/scrm/search-icon.png" @input="onSearch" />
</div>
<template v-if="shippingEntityList.length > 0">
<div class="lists-wrap">
<template v-for="(item, index) in shippingEntityList">
<div :class="['list', item.checked ? 'active' : '']" @click="handleCheck(index)" :key="index">
{{ item.shippingEntity }}
<img v-if="item.checked" src="@/assets/images/mark.png" alt="" class="icon-mark" />
</div>
</template>
</div>
</template>
<div v-else class="no-data">
<img src="@/assets/images/no-data.png" />
<span class="no-data-text">暂无数据</span>
</div>
</div>
</h-dialog>
</template>
<script>
import hDialog from './dialog'
import utils from '@/utils/util'
import purchaseApi from '@/api/purchase'
export default {
components: { hDialog },
data() {
return {
title: '发货主体选择',
keyword: '',
originalShippingEntityList: [],
shippingEntityList: [
{
id: 1,
shippingEntityId: 1,
shippingEntity: '深圳广联赛讯股份有限公司',
createdBy: 'glsadmin',
createdDate: 1683708732000,
updatedBy: 'glsadmin',
updatedDate: 1683708738000,
deletedFlag: 'N',
checked: false
},
{
id: 2,
shippingEntityId: 2,
shippingEntity: '深圳广联数科科技有限公司',
createdBy: 'glsadmin',
createdDate: 1683708761000,
updatedBy: 'glsadmin',
updatedDate: 1683708773000,
deletedFlag: 'N',
checked: false
}
],
selectSendOutMerchantId: ''
}
},
props: {
isVisible: {
type: Boolean,
default: false
},
sendOutMerchantId: {
type: String,
default: ''
}
},
created() {
this.selectSendOutMerchantId = this.sendOutMerchantId
console.log('created', this.sendOutMerchantId)
this.selectShippingEntityInfoAll()
},
methods: {
onSearch(val) {
const debouncedSearch = utils.debounce(
val => {
this.handleSearch(val)
},
200,
true
)
// 调用防抖函数
debouncedSearch(val)
},
handleSearch(val) {
console.log('handleSearch', val)
// 如果搜索值为空,显示全部数据
if (!val || val.trim() === '') {
this.shippingEntityList = this.originalShippingEntityList || this.shippingEntityList
return
}
// 进行模糊搜索,匹配 shippingEntity 字段
const filteredList = this.shippingEntityList.filter(item => {
return item.shippingEntity.toLowerCase().includes(val.toLowerCase())
})
// 更新列表数据
this.shippingEntityList = filteredList
if (this.shippingEntityList.length) {
this.handleFindIdAttribute()
}
},
async selectShippingEntityInfoAll() {
let result = await purchaseApi.selectShippingEntityInfoAll()
console.log(result)
if (result.code == 0) {
result.data.forEach(item => {
item.checked = false
})
this.shippingEntityList = result.data
this.originalShippingEntityList = [...this.shippingEntityList]
this.handleFindIdAttribute()
}
},
handleFindIdAttribute() {
this.shippingEntityList.forEach(item => {
item.checked = false
})
this.shippingEntityList.forEach(item => {
console.log(item.shippingEntityId == this.selectSendOutMerchantId,item.shippingEntityId,this.selectSendOutMerchantId)
if (item.shippingEntityId == this.selectSendOutMerchantId) {
item.checked = true
}
})
},
handleCheck(index) {
this.shippingEntityList.forEach(item => {
item.checked = false
})
this.shippingEntityList[index].checked = true
this.selectSendOutMerchantId = this.shippingEntityList[index].shippingEntityId
console.log(this.selectSendOutMerchantId)
},
handleSubmit() {
let data = this.originalShippingEntityList.find(item => item.shippingEntityId == this.selectSendOutMerchantId) || {}
console.log(data)
this.$emit('submit', data)
// this.$refs.myDialog.stopLoading();
},
handleCancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
.formObj {
margin: 0 16px;
font-size: 14px;
.lists-wrap {
box-sizing: border-box;
overflow: scroll;
height: calc(100% - 52px);
.list {
display: inline-block;
height: 46px;
line-height: 46px;
color: #292d33;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #eff0f2;
}
.active {
color: #347bff;
}
.icon-mark {
width: 16px;
height: 16px;
}
}
.search-pop-input {
margin: 8px 0;
position: relative;
z-index: 99;
width: 343px;
::v-deep(.van-cell) {
width: 100%;
background: #f2f3f5;
height: 36px;
border-radius: 253px;
}
::v-deep(.van-field__left-icon) {
position: absolute;
width: 16px;
height: 16px;
margin: 4px 6px 8px 12px;
z-index: 999;
.van-icon {
color: #999ea8;
}
}
::v-deep(.van-field__body) {
position: absolute;
width: 343px;
border-radius: 16px;
left: 0;
}
::v-deep(.van-field__control) {
padding-left: 33px;
font-size: 14px;
}
}
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-items: center;
img {
width: 72px;
height: 72px;
}
.no-data-text {
color: #999ea8;
font-size: 12px;
margin-top: 16px;
}
}
}
</style>
<!-- 采购发货 -->
<template>
<div class="layout">
<div class="purchase" :style="{height:isHeight?'calc(100vh - 58px)' : '100%'}">
<!-- 订单基本信息 -->
<div class="info-section">
<div class="title">
订单基本信息
<div class="status">
<span :style="{ color: getStepText('orderStatusOpts', purchaseOrderInfo.status, 'color') }">{{ getStepText('orderStatusOpts', purchaseOrderInfo.status, 'label') }}</span>
|
<span :style="{ color: getStepText('deliveryStatusOpts', purchaseOrderInfo.deliveryStatus, 'color') }">
{{ getStepText('deliveryStatusOpts', purchaseOrderInfo.deliveryStatus, 'label') }}
</span>
</div>
</div>
<div v-for="(item, index) in orderBasicInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span>
<span class="value" v-if="item.formatter">{{ item.formatter(purchaseOrderInfo) }}</span>
<span class="value" v-else>{{ purchaseOrderInfo[item.value]||'--' }}</span>
</div>
</div>
<!-- 收件信息 -->
<div class="info-section">
<div class="title">收件信息</div>
<div v-for="(item, index) in receiverInfoList" :key="index" class="info-item">
<span>{{ item.label }}</span>
<span>{{ purchaseOrderInfo[item.value] }}</span>
</div>
</div>
<!-- 审核流程进度 -->
<div class="info-section">
<div class="title">审核流程进度</div>
<review-status :infoData="purchaseOrderInfo"></review-status>
</div>
<!-- 审核记录 -->
<div class="info-section">
<div class="title">审核记录</div>
<record :recordList="purchaseOrderInfo.auditDetailList"></record>
</div>
</div>
<div class="footer">
<div
class="reject btn"
@click="handleReject"
v-if="
(purchaseOrderInfo.status === 1 && staffType == 2) ||
(purchaseOrderInfo.status === 2 && staffType == 3) ||
(purchaseOrderInfo.deliveryStatus === 1 && staffType == 4 && purchaseOrderInfo.status == 5)
"
>
驳回
</div>
<div class="approve btn" @click="handleApprove" v-if="(purchaseOrderInfo.status === 1 && staffType == 2) || (purchaseOrderInfo.status === 2 && staffType == 3)">通过</div>
</div>
<reject-comp :isVisible="rejectVisible" v-if="rejectVisible" :infoData="purchaseOrderInfo" @cancel="handleCancel" @success="handleSuccess"></reject-comp>
<approve-comp :isVisible="approveVisible" v-if="approveVisible" :infoData="purchaseOrderInfo" @cancel="handleApproveCancel" @success="handleApproveSuccess"></approve-comp>
</div>
</template>
<script type="text/ecmascript-6">
import { getLocalStorage } from '@/utils/util'
import { deepClone } from '@/utils/tools'
import { purchasingPatternOptions } from '@/utils/constants'
import reviewStatus from './reviewStatus.vue'
import record from './record.vue'
import rejectComp from './components/rejectComp.vue'
import ApproveComp from './components/approveComp.vue'
import purchaseApi from '@/api/purchase'
export default {
components: { reviewStatus, record, rejectComp, ApproveComp },
name: '',
data() {
return {
staffType: this.$route.query.staffType, // (2-运营审核 3-商务审核 4-采购发货审核)
orderCode: this.$route.query.orderCode,
purchaseOrderInfo: {},
approveVisible: false,
rejectVisible: false,
orderBasicInfoList: [
{ label: '订单编号', value: 'orderCode' },
{ label: '下单门店', value: 'merchantName' },
{ label: '发货主体', value: 'sendOutMerchantName' },
{
label: '订单总价/元',
value: 'totalPrice',
formatter: cellValue => {
return '¥' + cellValue.totalPrice
}
},
{
label: '采购模式',
value: 'purchasingPattern',
formatter: cellValue => {
const statusItem = this.getStatusItem(this.baseData, 'purchasingPatternOptions', cellValue, 'purchasingPattern')
return statusItem ? statusItem.confValue : '--'
}
},
{ label: '下单时间', value: 'orderTime' },
{
label: '当前审核节点',
value: '商务审核',
formatter: cellValue => {
return cellValue.status == 1 ? '运营审核' : cellValue.status == 2 ? '商务审核' : '--'
}
}
],
receiverInfoList: [
{ label: '收货人', value: 'contactName' },
{ label: '收货人电话', value: 'contactPhone' },
{ label: '收货地址', value: 'contactAddress' }
],
deliveryStatusOpts: {
1: {
label: '未发货',
color: '#999999'
},
2: {
label: '全部发货',
color: '#35C376'
},
3: {
label: '部分发货',
color: '#FF9D0A'
},
4: {
label: '结束发货',
color: '#F24724'
}
},
// 订单状态 1.待审核,2运营已审核,3.已取消,4.运营已驳回,5.商务已审核,6.商务已驳回,7.发货已驳回
orderStatusOpts: {
1: {
label: '待审核',
color: '#FF9D0A'
},
2: {
label: '待审核',
color: '#FF9D0A'
},
3: {
label: '已取消',
color: '#999999'
},
4: {
label: '已驳回',
color: '#F24724'
},
5: {
label: '已审核',
color: '#35C376'
},
6: {
label: '已驳回',
color: '#F24724'
},
7: {
label: '已驳回',
color: '#F24724'
}
},
baseData: {
purchasingPatternOptions: deepClone(purchasingPatternOptions)
}
}
},
created() {
this.purchaseOrderDetailData()
},
computed: {
isHeight() {
const { status, deliveryStatus } = this.purchaseOrderInfo || {}
const staffType = this.staffType
return (
(status === 1 && staffType == 2) ||
(status === 2 && staffType == 3) ||
(deliveryStatus === 1 && staffType == 4 && status == 5)
)
}
},
mounted() {},
methods: {
handleApproveCancel() {
this.approveVisible = false
},
handleCancel() {
this.rejectVisible = false
},
handleSuccess() {
this.handleCancel()
this.purchaseOrderDetailData()
},
handleApproveSuccess() {
this.handleApproveCancel()
this.purchaseOrderDetailData()
},
getStepText(opts, status, key) {
const mapping = this[opts][status]
return mapping ? mapping[key] : ''
},
getStatusItem(baseData, optKey, row, rowKey) {
if (!baseData || !baseData[optKey] || !row) return null
return baseData[optKey].find(
item => item.confId == row[rowKey] // 使用严格相等
)
},
handleSelect() {
this.sendOutVisible = true
},
async purchaseOrderDetailData() {
let result = await purchaseApi.purchaseOrderDetail({ orderCode: this.orderCode })
if (result.code == 0) {
this.purchaseOrderInfo = result.data
}
},
//驳回
handleReject() {
this.rejectVisible = true
},
//通过
handleApprove() {
this.approveVisible = true
}
}
}
</script>
<style scoped lang="scss">
.layout {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
.footer {
display: flex;
align-items: center;
justify-content: space-between;
margin: 7px 16px 10px;
.btn {
flex: 1;
border-radius: 6px;
height: 41px;
line-height: 41px;
font-size: 16px;
}
.reject {
border: 1px solid #dee0e3;
background: #f4f5f7;
color: #292d33;
text-align: center;
}
.approve {
background: #347bff;
color: #ffffff;
text-align: center;
margin-left: 11px;
}
}
}
.purchase {
width: 100vw;
padding: 12px 10px;
box-sizing: border-box;
height: calc(100% - 58px);
overflow: scroll;
.info-section {
padding: 16px 16px 6px;
border-radius: 8px;
font-size: 14px;
background: #ffffff;
box-sizing: border-box;
margin-bottom: 12px;
.title {
color: #333333;
font-size: 15px;
margin-bottom: 10px;
position: relative;
font-weight: 600;
.status {
font-size: 13px;
position: absolute;
right: 0px;
font-weight: normal;
top: 0px;
}
}
}
.info-item {
margin-bottom: 10px;
display: flex;
}
.info-item :nth-child(1) {
display: inline-block;
width: 88px;
color: #999999;
margin-right: 12px;
}
.info-item :nth-child(2) {
color: #292d33;
width: 223px;
white-space: wrap;
display: inline-block;
}
}
</style>
<template>
<div class="record-layout">
<div class="timeline" v-if="recordList.length">
<div v-for="(item, index) in recordList" :key="index" class="timeline-item">
<!-- 内容 -->
<div class="step">
{{ getStepText(item.status, 'text') }}
<div class="status" :style="{ color: examineStatusClass[item.status] }">
{{ getStepText(item.status, 'status') }}
</div>
</div>
<div class="details">
<div class="detail-row" v-if="item.rejectCause">
<span>驳回原因:</span>
<span>{{ item.rejectCause }}</span>
</div>
<div class="detail-row">
<span>审核人:</span>
<span>{{ item.reviewedBy }}</span>
</div>
<div class="detail-row">
<span>审核时间:</span>
<span>{{ item.reviewedDate }}</span>
</div>
<div v-if="item.remark" class="detail-row">
<span>备注:</span>
<span class="remark">{{ item.remark }}</span>
</div>
</div>
<!-- 圆点 -->
<div class="dot" v-if="index != 0"></div>
<img class="highlight" v-else src="https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/equity/highlight.png" />
<!-- 线 -->
<div class="line" v-if="index < recordList.length - 1"></div>
</div>
</div>
<div v-else class="no-data">
<img src="@/assets/images/no-data.png" />
<span class="no-data-text">暂无数据</span>
</div>
</div>
</template>
<script>
import { parseTime } from '@/utils/tools.js'
export default {
name: 'record',
props: {
recordList: {
type: Array,
default: () => {}
}
},
data() {
return {
statusForShow: {
2: { text: '运营审核', status: '通过' },
4: { text: '运营审核', status: '驳回' },
5: { text: '商务审核', status: '通过' },
6: { text: '商务审核', status: '驳回' },
7: { text: '采购驳回', status: '驳回' }
},
examineStatusClass: {
2: '#35C376',
4: '#F24724',
5: '#35C376',
6: '#F24724',
7: '#F24724'
}
}
},
methods: {
getStepText(status, key) {
const mapping = this.statusForShow[status]
return mapping ? mapping[key] : ''
},
formatReviewTime(timestamp) {
if (!timestamp) return '-'
return parseTime(timestamp, '{y}-{m}-{d} {h}:{i}:{s}')
},
// 可添加接口请求逻辑
fetchRecordData() {
// 示例:axios.get('/api/audit/record')
// .then(res => {
// this.recordList = res.data;
// });
}
},
mounted() {
// this.fetchRecordData();
}
}
</script>
<style scoped lang="scss">
.record-layout {
// padding: 0 20px 20px;
.no-data {
display: flex;
flex-direction: column;
align-items: center;
justify-items: center;
img {
width: 72px;
height: 72px;
}
.no-data-text {
color: #999ea8;
font-size: 12px;
margin-top: 16px;
}
}
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #8eb2fb;
position: absolute;
left: 0px;
top: 9px;
z-index: 99;
}
.highlight {
width: 16px;
height: 16px;
position: absolute;
left: -3px;
top: 9px;
z-index: 99;
}
.line {
position: absolute;
top: 16px;
left: 4.5px;
width: 1.5px;
height: 94%;
background-color: #d6e4ff;
}
.timeline-item {
padding: 4px 0 12px 30px;
font-size: 14px;
position: relative;
}
.step {
font-weight: bold;
color: #333333;
margin-bottom: 8px;
}
.status {
margin-left: 8px;
display: inline-block;
}
.detail-row {
display: flex;
margin-bottom: 8px;
font-size: 14px;
color: #666;
}
.detail-row :nth-child(1) {
display: inline-block;
width: 84px;
color: #999999;
}
.detail-row :nth-child(2) {
color: #333333;
width: calc(100% - 84px);
}
</style>
<template>
<div class="status-wrap">
<div class="status-item" v-for="(item, index) in statusList" :key="index">
<div :class="['info', item.active && item.type == 1 ? 'active' : '']">
<div class="circle-box">
<div class="circle">
<img v-if="item.active" class="status-img" :src="IMG_URL + 'equity/review_icon.png'" />
<img v-if="item.type == 2" class="status-img" :src="IMG_URL + 'equity/review_success_icon.png'" />
<img v-if="item.active && item.type == 3" class="status-img" :src="IMG_URL + 'equity/review_error_icon.png'" />
<div v-if="!item.active && item.type < 2" class="circle_text">{{ index + 1 }}</div>
</div>
</div>
<div class="name" :style="{ color: item.active || item.type > 1 ? '#292D33' : '#999EA8' }">{{ item.name }}</div>
<!-- <template>
<div v-if="(index == 1 || index == 2) && item.type > 1" class="status-text" :style="{ color: item.type == 2 ? '#292D33' : '#E75E58' }">{{ item.type == 2 ? '通过' : '不通过' }}</div>
<div style="height: var(--fontSize32)" v-else>{{ ' ' }}</div>
</template> -->
</div>
<div :class="['line', item.type == 2 ? 'line_color' : '']" v-if="index != statusList.length - 1"></div>
</div>
</div>
</template>
<script>
export default {
props: {
infoData: {
type: Object,
default: () => {}
},
status: {
type: Number,
default: 0
}
},
watch: {
infoData(val) {
this.updateSatus(val)
}
},
data() {
return {
staffType: this.$route.query.staffType,// (2-运营审核 3-商务审核 4-采购发货审核)
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/',
statusList: [
{ name: '运营审核', active: false, type: 1 },
{ name: '商务审核', active: false, type: 1 },
{ name: '采购发货审核', active: false, type: 1 }
]
}
},
methods: {
updateSatus(val) {
this.statusList.forEach(item => {
item.active = false
item.type=1
})
if (val.status == 1) {
this.statusList[0].active = true
this.statusList[0].type = 1
if (this.staffType == 2) {
this.statusList[0].active = true
}
} else if (val.status == 2) {
this.statusList[0].type = 2
this.statusList[1].active = true
this.statusList[1].type = 1
// if (this.staffType == 3) {
// this.statusList[1].active = true
// }
} else if (val.status == 5) {
this.statusList.forEach(item => {
item.active = true
item.type = 2
})
this.statusList[2].active = true
this.statusList[2].type = 1
// if (this.staffType == 4) {
// this.statusList[2].active = true
// }
} else {
this.statusList.forEach(item => {
item.active = false
})
}
}
}
}
</script>
<style lang="scss" scoped>
.status-wrap {
display: flex;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
margin: 16px 0;
.status-item {
display: flex;
flex-wrap: nowrap;
font-size: 12px;
font-weight: 500;
color: #999ea8;
.info {
display: flex;
flex-direction: column;
align-items: center;
width: 80rpx;
.circle-box {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.circle {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 12px;
font-weight: 500;
.circle_text {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
border-radius: 50%;
background: #dee0e3;
}
}
.status-img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
width: 28px;
height: 28px;
}
}
.name {
margin-top: 10px;
font-weight: 500;
white-space: nowrap;
color: #7a8299;
margin-bottom: 2px;
}
}
.line {
margin: 12px 4px 0;
width: 50px;
height: 4px;
background: #dee0e3;
border-radius: 4px;
}
.line_color {
background: #347bff1a;
}
}
}
</style>
'use strict'
const path = require('path')
const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const resolve = dir => path.join(__dirname, dir)
// page title
const name = defaultSettings.title || '登录中...'
// 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
/**
* 雪碧图插件
*/
const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => {
let { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}`
let perSprite = sprites.map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
}).join('\n')
return `${shared}\n${perSprite}`
}
module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-test/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router history模式使用 微信开发环境需打开
outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: !IS_PROD,
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
disableHostCheck: true,
port: 9527,
open: false, // 启动后打开浏览器.
public:'http://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-test/#/',
overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
warnings: false,
errors: true
}
// proxy: {
// //配置跨域
// '/api': {
// target: "https://test.xxx.com",
// // ws:true,
// changOrigin:true,
// pathRewrite:{
// '^/api':'/'
// }
// }
// }
},
css: {
extract: IS_PROD, // 是否将组件中的 CSS 提取至一个独立的 CSS 文件中 (而不是动态注入到 JavaScript 中的 inline 代码)。
sourceMap: false,
loaderOptions: {
scss: {
// 向全局sass样式传入共享的全局变量, $src可以配置图片cdn前缀
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
prependData: `
$cdn: "${defaultSettings.cdn}";
`
}
}
},
configureWebpack: config => {
config.name = name
config.resolve.modules = ['node_modules', './src/assets/spritesmith']
const Plugins = [
new SpritesmithPlugin({
// 引入图片文件夹
src: {
cwd: path.resolve(__dirname, './src/assets/spritesmith'),
glob: ['*.png', '*.jpg']
},
// 生成图片的路径
target: {
image: path.resolve(__dirname, './src/assets/images/sprite.png'),
// 生成SCSS
css: [
[path.resolve(__dirname, './src/assets/css/sprite.scss'), {
format: 'function_based_template'
}]
]
},
customTemplates: {
'function_based_template': spritesmithFunction,
},
//background引用路径
apiOptions: {
cssImageRef: '../images/sprite.png'
},
// 每个图片间距
spritesmithOptions: {
padding: 20
}
})
]
config.plugins = [...config.plugins, ...Plugins]
// 为生产环境修改配置...
// if (IS_PROD) {
// // externals
// config.externals = externals
// }
},
chainWebpack: config => {
config.plugins.delete('preload') // TODO: need test
config.plugins.delete('prefetch') // TODO: need test
// 别名 alias
config.resolve.alias
.set('@', resolve('src'))
.set('assets', resolve('src/assets'))
.set('api', resolve('src/api'))
.set('views', resolve('src/views'))
.set('components', resolve('src/components'))
.set('plugins', resolve('src/components'))
.set('utils', resolve('src/utils'))
/**
* 设置保留空格
*/
config.module
.rule('vue')
.use('vue-loader')
.loader('vue-loader')
.tap(options => {
options.compilerOptions.preserveWhitespace = true
return options
})
.end()
/**
* 打包分析
*/
if (IS_PROD) {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [{
analyzerMode: 'static'
}])
}
config
// https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map'))
config.when(IS_PROD, config => {
config
.plugin('ScriptExtHtmlWebpackPlugin')
.after('html')
.use('script-ext-html-webpack-plugin', [{
// 将 runtime 作为内联引入不单独存在
inline: /runtime\..*\.js$/
}])
.end()
config.optimization.splitChunks({
chunks: 'all',
cacheGroups: {
// cacheGroups 下可以可以配置多个组,每个组根据test设置条件,符合test条件的模块
commons: {
name: 'chunk-commons',
test: resolve('src/components'),
minChunks: 3, // 被至少用三次以上打包分离
priority: 5, // 优先级
reuseExistingChunk: true // 表示是否使用已有的 chunk,如果为 true 则表示如果当前的 chunk 包含的模块已经被抽取出去了,那么将不会重新生成新的。
},
node_vendors: {
name: 'chunk-libs',
chunks: 'initial', // 只打包初始时依赖的第三方
test: /[\\/]node_modules[\\/]/,
priority: 10
},
vantUI: {
name: 'chunk-vantUI', // 单独将 vantUI 拆包
priority: 20, // 数字大权重到,满足多个 cacheGroups 的条件时候分到权重高的
test: /[\\/]node_modules[\\/]_?vant(.*)/
}
}
})
config.optimization.runtimeChunk('single')
})
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!