Commit 744c16a3 by wangql

解决冲突

2 parents 3d4eb3a1 47d6c383
[defaults] auth.token=45d2be625091494b9a0de35af25bb273c0a471650575471096d60dd61f6995e6
url = 'http://sentry.glsx.com.cn'
org = sentry defaults.url = http://sentry.glsx.com.cn
project = dj-car-life-system defaults.org = sentry
[auth] defaults.project =dj-carlife-web
token = 2d992c92b53b40b9869313a353c037d1208ee8bfcc1d418eaec1777f846401b6
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"hard-source-webpack-plugin": "^0.13.1", "hard-source-webpack-plugin": "^0.13.1",
"html-webpack-plugin": "4",
"sass": "^1.18.0", "sass": "^1.18.0",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"script-loader": "^0.7.2", "script-loader": "^0.7.2",
......
...@@ -40,3 +40,19 @@ export function waitinputorderPage(data) { ...@@ -40,3 +40,19 @@ export function waitinputorderPage(data) {
data.method = `${path2}waitinputorder.page` data.method = `${path2}waitinputorder.page`
return request(data) return request(data)
} }
// 订单导入
export function orderImport(data) {
data.method = `${path2}order.import`
return request(data, 'post', ['file'])
}
// 订单导入结果查询
export function getImportResult(data) {
data.method = `${path2}order.getImportResult`
return request(data, 'post')
}
export function downloadTemplate(data) {
data.method = `${path2}order.downloadTemplate`
return request(data, 'post')
}
...@@ -67,3 +67,9 @@ export function getAreaInfoByOpenAccBankTypeApi(data) { ...@@ -67,3 +67,9 @@ export function getAreaInfoByOpenAccBankTypeApi(data) {
data.method = `${djPath}yseMerchantOffline.getAreaInfoByOpenAccBankType` data.method = `${djPath}yseMerchantOffline.getAreaInfoByOpenAccBankType`
return request(data, 'post') return request(data, 'post')
} }
// 分账规则历史记录
export function getHistoryRecord(data) {
data.method = `${djPath}smartcarlife.divisionRuleEffectRecord.getHistoryRecord`
return request(data, 'post')
}
...@@ -9,17 +9,22 @@ import axios from '@/plugin/axios' ...@@ -9,17 +9,22 @@ import axios from '@/plugin/axios'
import sign from './sign' import sign from './sign'
import RequestMethods from './request.methods' import RequestMethods from './request.methods'
import util from '@/libs/util.js' import util from '@/libs/util.js'
import { baseConfig } from '@/main'
const request = ( const request = (
params = {}, params = {},
method = RequestMethods.GET, method = RequestMethods.GET,
noSignAttr = [], noSignAttr = [],
options options
) => { ) => {
// console.log(baseConfig)
// params.source = 'glsx' // params.source = 'glsx'
// params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022' // params.appKey = 'd7ffc3346fc9a45bccaaa35300d59022'
params.appKey = window.location.href.includes('dj.glsx.com.cn') params.appKey = baseConfig?.axios?.appkey
? 'd7ffc3346fc9a45bccaaa35300d59022' // clg
: '48e5e13229b82c1b4e6e8c96151f0637' // console.log(params.appKey)
// params.appKey = window.location.href.includes('dj.glsx.com.cn')
// ? 'd7ffc3346fc9a45bccaaa35300d59022'
// : '48e5e13229b82c1b4e6e8c96151f0637'
params.timestamp = new Date().getTime() params.timestamp = new Date().getTime()
params.v = '1.0.0' params.v = '1.0.0'
params.format = 'json' params.format = 'json'
......
...@@ -6,13 +6,21 @@ ...@@ -6,13 +6,21 @@
*/ */
import sha1 from 'sha1' import sha1 from 'sha1'
import qs from 'qs' import qs from 'qs'
const secret = window.location.href.includes('dj.glsx.com.cn') import { baseConfig } from '@/main'
? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' // // 等后面再处理
: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' // console.log(baseConfig)
// const secret = !window.location.href.includes('dj.glsx.com.cn')
// ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353' // // const secret =
// : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' // // window.location.href.includes('dj.glsx.com.cn') ||
// // window.location.href.includes('dj.beta.glsx.com.cn')
// // ? '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
// // : 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const sign = (params, noSignAttr = []) => { const sign = (params, noSignAttr = []) => {
// console.log(baseConfig)
// 写里面取值解决一开始导入就被确定值导致后面无法改动
const secret = baseConfig?.axios?.secret
// console.log(secret)
delete params.sign delete params.sign
var objStr = qs.stringify(_.cloneDeep(params), { var objStr = qs.stringify(_.cloneDeep(params), {
arrayFormat: 'indices', arrayFormat: 'indices',
......
...@@ -63,5 +63,10 @@ export function commonConfigApi(data) { ...@@ -63,5 +63,10 @@ export function commonConfigApi(data) {
// Excel异步导出 // Excel异步导出
export function asyncExportEecel(data) { export function asyncExportEecel(data) {
data.method = `${path}common.async.exportExcel` data.method = `${path}common.async.exportExcel`
}
// 获取Excel异步导出查询导出结果
export function exportExcel(data) {
data.method = `${path}common.query.async.exportExcel`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
/* eslint-disable */ /* eslint-disable */
require('script-loader!file-saver') require('script-loader!file-saver')
require('./Blob') require('./Blob')
require('script-loader!xlsx/dist/xlsx.core.min') // require('script-loader!xlsx/dist/xlsx.core.min')
// import * as XLSX from 'xlsx' // 数据导出导入所需要的依赖 import * as XLSX from 'xlsx' // 数据导出导入所需要的依赖
function generateArray(table) { function generateArray(table) {
var out = [] var out = []
var rows = table.querySelectorAll('tr') var rows = table.querySelectorAll('tr')
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.header-datetime{ .header-datetime {
font-size: 12px; font-size: 12px;
transform: translateX(-10px); transform: translateX(-10px);
} }
......
// Vue // Vue
import Vue from 'vue' import Vue from 'vue'
import axios from 'axios' // import axios from 'axios'
// import i18n from './i18n' // import i18n from './i18n'
import App from './App' import App from './App'
// 核心插件 // 核心插件
...@@ -20,22 +20,18 @@ import router from './router' ...@@ -20,22 +20,18 @@ import router from './router'
import 'default-passive-events' import 'default-passive-events'
import notice from '@/common/notice' import notice from '@/common/notice'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import ElementUI from 'element-ui'
// d2Admin 已导入
// import ElementUI from 'element-ui'
// Vue.use(ElementUI)
// import menuHeader from '@/menu/header' // import menuHeader from '@/menu/header'
// import menuAside from '@/menu/aside' // import menuAside from '@/menu/aside'
// import { frameInRoutes } from '@/router/routes' // import { frameInRoutes } from '@/router/routes'
// import Vue2OrgTree from 'vue2-org-tree'
Vue.use(chaining)
Vue.use(ElementUI)
// import VRM from 'vue-role-manager'
// Vue.use(VRM, {
// router,
// redirect: '403',
// enabled: false
// })
// 核心插件 // 核心插件
Vue.use(d2Admin) Vue.use(d2Admin)
Vue.use(chaining)
Vue.prototype.notice = notice Vue.prototype.notice = notice
const isProd = process.env.NODE_ENV === 'production' const isProd = process.env.NODE_ENV === 'production'
...@@ -48,7 +44,7 @@ if (!isProd) { ...@@ -48,7 +44,7 @@ if (!isProd) {
process.env.NODE_ENV === 'production' && process.env.NODE_ENV === 'production' &&
Sentry.init({ Sentry.init({
Vue, Vue,
dsn: 'http://c130dfd99792456ca835ca54680a8bbf@sentry.glsx.com.cn/14', dsn: 'https://39bc80d3bb0a419a8d7d9bf5a39678e3@sentry.glsx.com.cn/24',
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4', // dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [ integrations: [
new BrowserTracing({ new BrowserTracing({
...@@ -64,25 +60,31 @@ process.env.NODE_ENV === 'production' && ...@@ -64,25 +60,31 @@ process.env.NODE_ENV === 'production' &&
}) })
// console.log(test) // console.log(test)
// Vue.use(D2Crud) // Vue.use(D2Crud)
var baseConfig = '' var baseConfig = {
axios({ axios: {
// baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config-test', appkey: 'd7ffc3346fc9a45bccaaa35300d59022',
baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config', secret: '4bc07f8868374c49a4661d603377e3106fc9a45bccaaa353'
// baseURL: }
// 'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config', }
// 'http://config-center-front.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config', // 使用fetch 解决axios提前实例化导致sign里面的secret不能通过配置中心动态获取
method: 'get' fetch(
}).then(res => { 'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config'
const { data, status, code } = res )
// const { status, code } = res.data .then(
// console.log(res) response => {
if (code == '200' || status == '200') { // 处理http响应
baseConfig = data return response.json()
},
error => {
// 处理错误
console.log(error)
} }
console.log(baseConfig) )
// baseConfig = data.data .then(response => {
// 先本地切换到测试环境接口 // console.log(response)
// data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router' const { code, data } = response
code == '200' && (baseConfig = data)
// console.log('data', data)
new Vue({ new Vue({
router, router,
store, store,
...@@ -117,6 +119,64 @@ axios({ ...@@ -117,6 +119,64 @@ axios({
}, },
mounted() {} mounted() {}
}).$mount('#app') }).$mount('#app')
}) })
// axios({
// // baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config-test',
// // baseURL: process.env.VUE_APP_REPO + '/dj-car-life-system-config',
// baseURL:
// 'http://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=dj-car-life-system-config',
// method: 'get'
// // }).then(({ data }) => {
// }).then(({ data }) => {
// // console.log(data)
// // let {data} = res
// console.log(data)
// baseConfig = data
// // 新配置中心写法
// const { data: config, code } = data
// code == '200' && (baseConfig = config)
// // console.log(data)
// // // debugger
// console.log(baseConfig)
// // baseConfig = data.data
// // 先本地切换到测试环境接口
// // data.axios.baseURL = 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// new Vue({
// router,
// store,
// // i18n,
// render: h => {
// // data.axios.baseURL =
// // 'http://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// Vue.prototype.baseConfig = data
// return h(App)
// },
// // created () {
// // 处理路由 得到每一级的路由设置
// // this.$store.commit('d2admin/page/init', frameInRoutes)
// // 设置顶栏菜单 (暂时不需要)
// // this.$store.commit('d2admin/menu/headerSet', menuHeader)
// // 设置侧边栏菜单 (TODO 进行过滤)
// // this.$store.commit('d2admin/menu/asideSet', menuAside)
// // 初始化菜单搜索功能
// // this.$store.commit('d2admin/search/init', menuHeader)
// // },
// created() {
// // 系统配置
// Vue.config.devtools = true
// // 展示系统信息
// this.$store.commit('d2admin/releases/versionShow')
// // 用户登录后从数据库加载一系列的设置
// this.$store.dispatch('d2admin/account/load')
// // 获取并记录用户 UA
// this.$store.commit('d2admin/ua/get')
// // 初始化全屏监听
// this.$store.dispatch('d2admin/fullscreen/listen')
// },
// mounted() {}
// }).$mount('#app')
// })
export { baseConfig } export { baseConfig }
...@@ -115,6 +115,7 @@ service.interceptors.request.use( ...@@ -115,6 +115,7 @@ service.interceptors.request.use(
// 响应拦截器 // 响应拦截器
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
// console.log(response)
store.commit('d2admin/loading/set', false) store.commit('d2admin/loading/set', false)
// dataAxios 是 axios 返回数据中的 data // dataAxios 是 axios 返回数据中的 data
const dataAxios = response.data const dataAxios = response.data
...@@ -124,6 +125,7 @@ service.interceptors.response.use( ...@@ -124,6 +125,7 @@ service.interceptors.response.use(
var goBackArr = ['20', '21'] var goBackArr = ['20', '21']
if (goBackArr.includes(dataAxios[ruleResult.code_key])) { if (goBackArr.includes(dataAxios[ruleResult.code_key])) {
// await store.dispatch('d2admin/account/logout') // await store.dispatch('d2admin/account/logout')
store.dispatch('d2admin/user/clear')
util.cookies.remove('token') util.cookies.remove('token')
router.replace('/login') router.replace('/login')
return return
......
...@@ -59,7 +59,7 @@ router.beforeEach(async (to, from, next) => { ...@@ -59,7 +59,7 @@ router.beforeEach(async (to, from, next) => {
if (from.name === null && to.path !== '/login' && !source) { if (from.name === null && to.path !== '/login' && !source) {
// 页面刷新 动态路由会失效 初始化路由与左侧菜单栏 // 页面刷新 动态路由会失效 初始化路由与左侧菜单栏
await store.dispatch('d2admin/auth/init') await store.dispatch('d2admin/auth/init')
await store.dispatch('d2admin/account/load') // await store.dispatch('d2admin/account/load')
next(to.path) next(to.path)
} else { } else {
if (store.state.d2admin.user.info) { if (store.state.d2admin.user.info) {
......
...@@ -489,6 +489,14 @@ export const resources = { ...@@ -489,6 +489,14 @@ export const resources = {
}, },
auth: [ auth: [
{ {
authId: '9040104',
parentId: '90401',
label: '导入订单',
category: 'Button',
type: 'primary',
handle: 'handleImport'
},
{
authId: '9040101', authId: '9040101',
parentId: '90401', parentId: '90401',
label: '导出', label: '导出',
...@@ -723,12 +731,12 @@ export const resources = { ...@@ -723,12 +731,12 @@ export const resources = {
} }
] ]
}, },
// { {
// authId: '9060304', authId: '9060304',
// parentId: '90603', parentId: '90603',
// label: '分账', label: '历史记录',
// handle: 'handleAccount' handle: 'handleRecord'
// }, },
{ {
authId: '9060305', authId: '9060305',
parentId: '90603', parentId: '90603',
......
...@@ -149,6 +149,13 @@ export default { ...@@ -149,6 +149,13 @@ export default {
return new Promise(async resolve => { return new Promise(async resolve => {
// DB -> store 加载用户名 // DB -> store 加载用户名
await dispatch('d2admin/user/load', null, { root: true }) await dispatch('d2admin/user/load', null, { root: true })
// DB -> store 加载下载列表
await dispatch('d2admin/user/downLoadListLoad', 'dowloadList', {
root: true
})
await dispatch('d2admin/user/downLoadListLoad', 'updateList', {
root: true
})
// DB -> store 加载主题 // DB -> store 加载主题
await dispatch('d2admin/theme/load', null, { root: true }) await dispatch('d2admin/theme/load', null, { root: true })
// DB -> store 加载页面过渡效果设置 // DB -> store 加载页面过渡效果设置
......
...@@ -30,7 +30,7 @@ export default { ...@@ -30,7 +30,7 @@ export default {
init({ state, dispatch, commit }) { init({ state, dispatch, commit }) {
return new Promise(async resolve => { return new Promise(async resolve => {
Promise.all([getChannelType({}), getProductType({})]).then( Promise.all([getChannelType({}), getProductType({})]).then(
async([channelType, productType]) => { async ([channelType, productType]) => {
state.channelType = channelType.slice(0, 2) state.channelType = channelType.slice(0, 2)
state.productType = productType state.productType = productType
await dispatch('save2db', { await dispatch('save2db', {
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
resolve(state) resolve(state)
} }
) )
resolve()
}) })
}, },
// 重置 // 重置
......
const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-info` const SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${
const ACCOUNT_SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${process.env.VUE_APP_VERSION}-account` process.env.VUE_APP_VERSION
}-info`
const ACCOUNT_SESSION_NAME = `${process.env.VUE_APP_STORAGE_PREFIX}-${
process.env.VUE_APP_VERSION
}-account`
export default { export default {
namespaced: true, namespaced: true,
...@@ -27,24 +31,84 @@ export default { ...@@ -27,24 +31,84 @@ export default {
**/ **/
info: { info: {
detail: {} detail: {}
},
/** 异步下载excel列表 */
dowloadList: [
// {
// name: '下载测试',
// ifSuccess: false,
// uuid: 'c445931e-c711-417b-b0cf-125497369e32',
// status: 'loading',
// type: 'downloads',
// labelText: '导出中'
// }
],
updateList: [
// {
// name: 'xxx店订单补录2022-02-04test',
// ifSuccess: false,
// id: 1,
// status: 'loading',
// type: 'upload',
// labelText: '成功上传0条, 导入失败1条'
// }
],
updateRefesh: false
},
mutations: {
setDownloadList(state, { list, type }) {
// console.log(list)
// return
// state[type] = state[type].push(list)
state[type] = list
// console.log(state[`${type}`])
// console.log(state[type])
},
setUpdateRefesh(state, data) {
state.updateRefesh = data
} }
}, },
actions: { actions: {
/** /**
* @description 修改下载记录
* @param {Object} state state
*/
actionSetDownloadList({ commit, dispatch, state }, { list, type }) {
// console.log(list, type)
commit('setDownloadList', { list, type })
// console.log()
// console.log(dispatch)
// console.log(state[type])
// console.log(`state.${type}`)
// 持久化
dispatch(
'd2admin/db/set',
{
dbName: 'sys',
path: `user.${type}`,
value: state[type],
// state.dowloadList,
user: true
},
{ root: true }
)
},
/**
* @description 设置用户数据 * @description 设置用户数据
* @param {Object} context * @param {Object} context
* @param {*} info info * @param {*} info info
*/ */
set({ set({ state, dispatch }, { info, accountInfo }) {
state,
dispatch
}, { info, accountInfo }) {
return new Promise(async resolve => { return new Promise(async resolve => {
// store 赋值 // store 赋值
state.info = info state.info = info
state.accountInfo = accountInfo state.accountInfo = accountInfo
sessionStorage.setItem(SESSION_NAME, escape(JSON.stringify(info))) sessionStorage.setItem(SESSION_NAME, escape(JSON.stringify(info)))
sessionStorage.setItem(ACCOUNT_SESSION_NAME, escape(JSON.stringify(accountInfo))) sessionStorage.setItem(
ACCOUNT_SESSION_NAME,
escape(JSON.stringify(accountInfo))
)
resolve() resolve()
}) })
}, },
...@@ -52,39 +116,53 @@ export default { ...@@ -52,39 +116,53 @@ export default {
* @description 从数据库取用户数据 * @description 从数据库取用户数据
* @param {Object} context * @param {Object} context
*/ */
load({ load({ state, dispatch }) {
state,
dispatch
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
state.info = JSON.parse(unescape(sessionStorage.getItem(SESSION_NAME))) state.info = JSON.parse(unescape(sessionStorage.getItem(SESSION_NAME)))
resolve(state.info) resolve(state.info)
}) })
}, },
/**
loadAcocunt({ * 从持久化数据读下载记录
state, * @param {Object} context
dispatch */
}) { downLoadListLoad({ state, dispatch }, type) {
return new Promise(async resolve => {
// store 赋值
state[type] = await dispatch(
'd2admin/db/get',
{
dbName: 'sys',
path: `user.${type}`,
defaultValue: [],
user: true
},
{ root: true }
)
console.log(type, state[type])
resolve()
})
},
loadAcocunt({ state, dispatch }) {
return new Promise(async resolve => { return new Promise(async resolve => {
state.accountInfo = JSON.parse(unescape(sessionStorage.getItem(ACCOUNT_SESSION_NAME))) state.accountInfo = JSON.parse(
unescape(sessionStorage.getItem(ACCOUNT_SESSION_NAME))
)
resolve(state.accountInfo) resolve(state.accountInfo)
}) })
}, },
clear({ clear({ state, dispatch }) {
state
}) {
return new Promise(async resolve => { return new Promise(async resolve => {
state.info = null state.info = null
sessionStorage.removeItem(SESSION_NAME) sessionStorage.removeItem(SESSION_NAME)
sessionStorage.removeItem(ACCOUNT_SESSION_NAME) sessionStorage.removeItem(ACCOUNT_SESSION_NAME)
dispatch('actionSetDownloadList', { list: [], type: 'updateList' })
dispatch('actionSetDownloadList', { list: [], type: 'dowloadList' })
resolve() resolve()
}) })
}, },
reset({ reset({ dispatch }) {
dispatch
}) {
dispatch('clear') dispatch('clear')
} }
} }
......
<!-- 预录客户列表 --> <!-- 预录客户列表 -->
<template> <template>
<d2-container class="record-list"> <d2-container class="record-list">
<div <div class="header"
class="header" slot="header">
slot="header" <d2-search ref="showSearch"
>
<d2-search
ref="showSearch"
class="show-search" class="show-search"
:searchForm="searchForm" :searchForm="searchForm"
:formData="showFormData" :formData="showFormData">
>
<!-- <p class="custom-input"> <!-- <p class="custom-input">
<el-input <el-input
size="small" size="small"
...@@ -21,113 +17,79 @@ ...@@ -21,113 +17,79 @@
</p> --> </p> -->
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button :id="tableParams.btnId"
:id="tableParams.btnId"
size="small" size="small"
type="primary" type="primary">查询</el-button>
>查询</el-button> <el-button size="small"
<el-button @click="handleReset">重置</el-button>
size="small"
@click="handleReset"
>重置</el-button>
</div> </div>
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<span slot="left"> <span slot="left">
<auth-button <auth-button category="Button"
category="Button"
style="{display: inline-block}" style="{display: inline-block}"
showBtnIds="['9020201']" :showBtnIds="['9020201']"></auth-button>
></auth-button>
<span class="table-header-left-txt">已预录客户列表{{total}}条记录。</span> <span class="table-header-left-txt">已预录客户列表{{total}}条记录。</span>
</span> </span>
<span> <span>
<span class="btn-tips"><img src="../../assets/icon-warn.png">所有号码已启用隐私号码保护功能!</span> <span class="btn-tips"><img src="../../assets/icon-warn.png">所有号码已启用隐私号码保护功能!</span>
<auth-button <auth-button category="Button"
category="Button" :showBtnIds="['9020202']"></auth-button>
showBtnIds="['9020202']"
></auth-button>
</span> </span>
</d2-table-header> </d2-table-header>
<d2-table <d2-table ref="recordTable"
ref="recordTable"
:searchForm="tableSearchForm" :searchForm="tableSearchForm"
:tableParams="tableParams" :tableParams="tableParams"
:getListApi="getListApi" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn" :beforeSearchFn="beforeSearchFn">
> <span slot="baseGoodsStr"
<span slot-scope="scope">
slot="baseGoodsStr" <p v-for="(item, index) in scope.scope.baseGoodsStr ? scope.scope.baseGoodsStr.split(',') : []"
slot-scope="scope" :key="index">{{item}}</p>
>
<p
v-for="(item, index) in scope.scope.baseGoodsStr ? scope.scope.baseGoodsStr.split(',') : []"
:key="index"
>{{item}}</p>
</span> </span>
<auth-button <auth-button slot="auth-button"
slot="auth-button"
slot-scope="scope" slot-scope="scope"
:data="scope.scope" :data="scope.scope"></auth-button>
></auth-button>
</d2-table> </d2-table>
</div> </div>
<d2-dialog <d2-dialog :title="'上传文件'"
:title="'上传文件'"
:isVisible="fileVisible" :isVisible="fileVisible"
@closeDialog="handleImport" @closeDialog="handleImport"
@confirmDialog="handleConfirmImport" @confirmDialog="handleConfirmImport">
>
<slot> <slot>
<el-form <el-form :model="fileForm"
:model="fileForm"
ref="fileRuleForm" ref="fileRuleForm"
:rules="fileRules" :rules="fileRules"
label-width="120px" label-width="120px">
> <el-form-item v-if="userInfo.beSuper"
<el-form-item
v-if="userInfo.beSuper"
label="园区店:" label="园区店:"
prop="yqMerchantId" prop="yqMerchantId">
>
<el-select v-model="fileForm.yqMerchantId"> <el-select v-model="fileForm.yqMerchantId">
<el-option <el-option v-for="item in baseData.parkServiceList.filter(i => i.merchantName !== '全部')"
v-for="item in baseData.parkServiceList.filter(i => i.merchantName !== '全部')"
:key="item.merchantId" :key="item.merchantId"
:value="item.merchantId" :value="item.merchantId"
:label="item.merchantName" :label="item.merchantName"></el-option>
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="导入文件:"
label="导入文件:" prop="fileName">
prop="fileName"
>
<el-col :span="16"> <el-col :span="16">
<el-input <el-input readonly
readonly v-model="fileForm.fileName"></el-input>
v-model="fileForm.fileName"
></el-input>
</el-col> </el-col>
<el-col <el-col :span="4"
:span="4" class="m-l-md">
class="m-l-md"
>
<el-button class="import-btn">导入文件 <el-button class="import-btn">导入文件
<input <input type="file"
type="file"
id="fileUpload" id="fileUpload"
class="import-input" class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
@change="importFile($event)" @change="importFile($event)" />
/> <el-link href="http://img01.glsx.com.cn/upload/salesexcel/预录订单导入模板.xlsx"
<el-link
href="http://img01.glsx.com.cn/upload/salesexcel/预录订单导入模板.xlsx"
type="primary" type="primary"
class="import-template" class="import-template"
icon="el-icon-link" icon="el-icon-link">模版下载</el-link>
>模版下载</el-link>
</el-button> </el-button>
</el-col> </el-col>
</el-form-item> </el-form-item>
...@@ -348,6 +310,7 @@ export default { ...@@ -348,6 +310,7 @@ export default {
...mapActions({ ...mapActions({
close: 'd2admin/page/close' close: 'd2admin/page/close'
}), }),
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = _.cloneDeep(this.searchForm) this.tableSearchForm = _.cloneDeep(this.searchForm)
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<div class="summary_total"> <div class="summary_total">
<span class="summary_total_label">总订单收入</span> <span class="summary_total_label">总订单收入</span>
<span class="summary_total_value">{{ <span class="summary_total_value">{{
summayData.totalIncomeMoney summayData.totalIncomeMoney||0
}}</span> }}</span>
</div> </div>
<div class="summary_list"> <div class="summary_list">
...@@ -681,7 +681,8 @@ export default { ...@@ -681,7 +681,8 @@ export default {
}, },
{ {
label: '交易参考号', label: '交易参考号',
name: 'tradeNo' // name: 'tradeNo'
name: 'outTradeNo'
} }
], ],
handleSelectChange: value => { handleSelectChange: value => {
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
effect="dark" effect="dark"
content="存在多笔销售订单,请与门店确认并点击退库此订单。" content="存在多笔销售订单,请与门店确认并点击退库此订单。"
placement="right"> placement="right">
<span class="el-icon-info"></span> <span class="el-icon-info"
style="font-size: 18px;"></span>
</el-tooltip> </el-tooltip>
<div> <div>
<span <span
...@@ -117,7 +118,8 @@ ...@@ -117,7 +118,8 @@
<el-tooltip effect="dark" <el-tooltip effect="dark"
content="请选择项目号对应出库产品提交出库。" content="请选择项目号对应出库产品提交出库。"
placement="right"> placement="right">
<span class="el-icon-info"></span> <span class="el-icon-info"
style="font-size: 18px;"></span>
</el-tooltip> </el-tooltip>
<span>销售订单号:{{erpOrderResponse_orderNo}}</span> <span>销售订单号:{{erpOrderResponse_orderNo}}</span>
</div> </div>
...@@ -202,12 +204,19 @@ ...@@ -202,12 +204,19 @@
<div class="footer_btn"> <div class="footer_btn">
<span <span
v-if="['2', '5'].includes(orderInfo.order.outboundStatus) && orderInfo.erpOrderResponse && jurisdictionBtn"> v-if="['2', '5'].includes(orderInfo.order.outboundStatus) && orderInfo.erpOrderResponse && jurisdictionBtn">
<el-tooltip effect="dark"
v-if="orderInfo.order.outboundStatus == '5'"
:content="errContent"
placement="right">
<span class="el-icon-warning"
style="color:red;font-size: 20px;"></span>
</el-tooltip>
<span class="captchaMsg"
v-if="orderInfo.order.outboundStatus == '5'">
出库失败,请重新出库!</span>
<el-button type="primary" <el-button type="primary"
@click="handleConfirm" @click="handleConfirm"
:loading="$store.state.d2admin.loading.value">确认出库</el-button> :loading="$store.state.d2admin.loading.value">确认出库</el-button>
<p class="captchaMsg"
v-if="orderInfo.order.outboundStatus == '5'">
出库失败,请重新出库!失败原因:{{orderInfo.order.outboundMsg}}</p>
</span> </span>
<span v-else-if="orderInfo.order.outboundStatus == '3' && orderInfo.erpOrderResponse"> <span v-else-if="orderInfo.order.outboundStatus == '3' && orderInfo.erpOrderResponse">
<el-button type="primary">出库中...</el-button> <el-button type="primary">出库中...</el-button>
...@@ -245,7 +254,8 @@ export default { ...@@ -245,7 +254,8 @@ export default {
goodsList: [], // 替换产品下拉框 goodsList: [], // 替换产品下拉框
selectedOptions: [], selectedOptions: [],
btnOkLabel: '确认出库', btnOkLabel: '确认出库',
Util: Util Util: Util,
errContent: '失败原因:'
} }
}, },
...@@ -314,6 +324,7 @@ export default { ...@@ -314,6 +324,7 @@ export default {
} }
}) })
this.objList.unshift({ optionId: '-1', optionLabel: '空' }) this.objList.unshift({ optionId: '-1', optionLabel: '空' })
this.errContent = this.errContent + this.orderInfo.order.outboundMsg
}) })
}, },
...@@ -339,8 +350,10 @@ export default { ...@@ -339,8 +350,10 @@ export default {
params.orderCode = this.orderInfo.order.orderCode params.orderCode = this.orderInfo.order.orderCode
params.merchantId = this.orderInfo.order.merchantId params.merchantId = this.orderInfo.order.merchantId
getErpOrderDetail(params).then(res => { getErpOrderDetail(params).then(res => {
console.log(res)
this.getInfo(this.orderInfoId) this.getInfo(this.orderInfoId)
}).catch(err => { }).catch(err => {
console.log(err)
this.getInfo(this.orderInfoId) this.getInfo(this.orderInfoId)
}) })
}, },
......
...@@ -67,11 +67,6 @@ export default { ...@@ -67,11 +67,6 @@ export default {
} }
}, },
mounted() { mounted() {
const test = {
a: 1
}
// console.log('11')
console.log(test?.b)
}, },
methods: { methods: {
exportDailyReport() { exportDailyReport() {
......
...@@ -451,6 +451,7 @@ export default { ...@@ -451,6 +451,7 @@ export default {
if (this.userInfo.beSuper) { if (this.userInfo.beSuper) {
this.isBeSuper = true this.isBeSuper = true
getParkStore({}).then(res => { getParkStore({}).then(res => {
if (typeof res === 'object') {
res.unshift({ res.unshift({
merchantNo: '', merchantNo: '',
merchantName: '全部' merchantName: '全部'
...@@ -460,16 +461,20 @@ export default { ...@@ -460,16 +461,20 @@ export default {
}) })
this.parkServiceList = res this.parkServiceList = res
this.id = this.parkServiceList[0].merchantId this.id = this.parkServiceList[0].merchantId
}
resolve() resolve()
}) })
} else if (this.userInfo.detail.accountType === 7) { } else if (this.userInfo.detail.accountType === 7) {
this.isBeSuper = true this.isBeSuper = true
getPartnerYqListApi({}).then(res => { getPartnerYqListApi({}).then(res => {
if (typeof res === 'object') {
res.unshift({ res.unshift({
yqMerchantId: '', yqMerchantId: '',
yqMerchantName: '全部' yqMerchantName: '全部'
}) })
this.parkServiceList = res this.parkServiceList = res
}
resolve() resolve()
}) })
} else { } else {
......
...@@ -13,8 +13,15 @@ ...@@ -13,8 +13,15 @@
:inline="true"> :inline="true">
<el-form-item label="订单单号:">{{detail.orderCode}}</el-form-item> <el-form-item label="订单单号:">{{detail.orderCode}}</el-form-item>
<el-form-item label="订单状态:">{{statusOpts[detail.status]}}</el-form-item> <el-form-item label="订单状态:">{{statusOpts[detail.status]}}</el-form-item>
<el-form-item label="订单来源:">{{detail.source==7 ? '系统导入' : '小程序订单'}}</el-form-item>
<el-form-item style="width:400px"
label="交易流水:">{{detail.outTradeNo}}</el-form-item>
<el-form-item v-if="detail.source==7"
label="订单导入时间:">{{detail.createdDate}}
</el-form-item>
<el-form-item label="支付方式:">{{payTypeOpts[detail.payType]}}</el-form-item> <el-form-item label="支付方式:">{{payTypeOpts[detail.payType]}}</el-form-item>
<el-form-item label="交易流水:">{{detail.outTradeNo}}</el-form-item>
<el-form-item label="施工状态:">{{constructioOpts[detail.constructionFlag]}}</el-form-item> <el-form-item label="施工状态:">{{constructioOpts[detail.constructionFlag]}}</el-form-item>
<el-form-item label="支付状态:">{{payStatusOpts[detail.payStatus]}}</el-form-item> <el-form-item label="支付状态:">{{payStatusOpts[detail.payStatus]}}</el-form-item>
<el-form-item label="收款凭证:"> <el-form-item label="收款凭证:">
...@@ -53,7 +60,7 @@ ...@@ -53,7 +60,7 @@
<p class="edit-sub-title">订单商品</p> <p class="edit-sub-title">订单商品</p>
<el-table :data="detail.subOrderList" <el-table :data="detail.subOrderList"
border border
header-cell-style="text-align:center; background-color:#fafafa" :header-cell-style="{'text-align':'center', 'background-color':'#fafafa'}"
show-summary show-summary
:summary-method="getSummaries" :summary-method="getSummaries"
style="width: 100%"> style="width: 100%">
...@@ -112,9 +119,10 @@ ...@@ -112,9 +119,10 @@
</div> </div>
<div class="form_table_gp"> <div class="form_table_gp">
<p class="edit-sub-title">订单进度</p> <p class="edit-sub-title">订单进度</p>
<!-- header-cell-style="text-align:center; background-color:#fafafa" -->
<el-table :data="detail.logs" <el-table :data="detail.logs"
border border
header-cell-style="text-align:center; background-color:#fafafa" :header-cell-style="{'text-align':'center','background-color':'#fafafa'}"
style="width: 100%"> style="width: 100%">
<el-table-column prop="createdDateStr" <el-table-column prop="createdDateStr"
align="center" align="center"
...@@ -156,6 +164,8 @@ ...@@ -156,6 +164,8 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import signRefundDialog from './signRefundDialog' import signRefundDialog from './signRefundDialog'
// import { getOrderDetail } from '@api/order'
import dayjs from 'dayjs'
export default { export default {
name: 'orderDetail', name: 'orderDetail',
components: { components: {
...@@ -216,6 +226,10 @@ export default { ...@@ -216,6 +226,10 @@ export default {
this.signRefundFlag = this.$route.params.signRefundFlag this.signRefundFlag = this.$route.params.signRefundFlag
console.log(this.signRefundFlag); console.log(this.signRefundFlag);
if (this.detail.source == 7) {
this.detail.createdDate = dayjs(this.detail.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
console.log(this.detail)
}, },
methods: { methods: {
......
...@@ -3,56 +3,47 @@ ...@@ -3,56 +3,47 @@
<dialog-reg :isVisible="registerDialogVisible" /> <dialog-reg :isVisible="registerDialogVisible" />
<div class="page-login--layer page-login--layer-area"> <div class="page-login--layer page-login--layer-area">
<ul class="circles"> <ul class="circles">
<li <li v-for="n in 10"
v-for="n in 10" :key="n"></li>
:key="n"
></li>
</ul> </ul>
</div> </div>
<div <div class="page-login--layer page-login--layer-time"
class="page-login--layer page-login--layer-time" flex="main:center cross:center">{{time}}</div>
flex="main:center cross:center"
>{{time}}</div>
<div class="page-login--layer"> <div class="page-login--layer">
<div <div class="page-login--content"
class="page-login--content" flex="dir:top main:justify cross:stretch box:justify">
flex="dir:top main:justify cross:stretch box:justify"
>
<div class="page-login--content-header"> <div class="page-login--content-header">
<p class="page-login--content-header-motto"></p> <p class="page-login--content-header-motto"></p>
</div> </div>
<div <div class="page-login--content-main"
class="page-login--content-main" flex="dir:top main:center cross:center">
flex="dir:top main:center cross:center"
>
<!-- form --> <!-- form -->
<div class="page-login--form-box" @click="handleReturnLogin"> <div class="page-login--form-box"
<div class="page-login--form" v-show="!isMutiAccount"> @click="handleReturnLogin">
<div class="page-login--form"
v-show="!isMutiAccount">
<div class="form-left"> <div class="form-left">
<el-form <el-form ref="loginForm"
ref="loginForm"
label-position="top" label-position="top"
:rules="rules" :rules="rules"
:model="formLogin" :model="formLogin"
size="default" size="default">
>
<div class="title-wrap"> <div class="title-wrap">
<!-- <span class="form-title">{{systemName}}</span> --> <!-- <span class="form-title">{{systemName}}</span> -->
<span class="form-title"> <span class="form-title">
<img src="./image/title.png" alt="D+智享车生活"/> <img src="./image/title.png"
alt="D+智享车生活" />
</span> </span>
<span class="form-sub">{{systemSubName}}</span> <span class="form-sub">{{systemSubName}}</span>
</div> </div>
<div class="input-wrap"> <div class="input-wrap">
<el-form-item prop="userName"> <el-form-item prop="userName">
<el-input <el-input type="text"
type="text"
v-on:keyup.native.13="submit" v-on:keyup.native.13="submit"
v-model="formLogin.userName" v-model="formLogin.userName"
placeholder="用户名" placeholder="用户名"
clearable clearable
v-focus v-focus>
>
<!-- <d2-el-icon <!-- <d2-el-icon
slot="prepend" slot="prepend"
name="user" name="user"
...@@ -60,13 +51,11 @@ ...@@ -60,13 +51,11 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item prop="password"> <el-form-item prop="password">
<el-input <el-input type="password"
type="password"
v-model="formLogin.password" v-model="formLogin.password"
v-on:keyup.native.13="submit" v-on:keyup.native.13="submit"
clearable clearable
placeholder="密码" placeholder="密码">
>
<!-- <d2-el-icon <!-- <d2-el-icon
slot="prepend" slot="prepend"
name="key" name="key"
...@@ -74,19 +63,15 @@ ...@@ -74,19 +63,15 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item class="form-action"> <el-form-item class="form-action">
<el-button <el-button @click="submit"
@click="submit"
type="primary" type="primary"
:loading="$store.state.d2admin.loading.value" :loading="$store.state.d2admin.loading.value"
class="button-login" class="button-login"
:style="{'width': hasReg ? '' : '100%' }" :style="{'width': hasReg ? '' : '100%' }">登录</el-button>
>登录</el-button> <el-button v-if="hasReg"
<el-button
v-if="hasReg"
@click.prevent="registerDialogVisible = true" @click.prevent="registerDialogVisible = true"
plain plain
class="button-reg" class="button-reg">注册</el-button>
>注册</el-button>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -96,16 +81,22 @@ ...@@ -96,16 +81,22 @@
<div class="img-bg"></div> <div class="img-bg"></div>
</div> </div>
</div> </div>
<div class="page-login--muti-form" v-show="isMutiAccount"> <div class="page-login--muti-form"
v-show="isMutiAccount">
<div class="muti-title">请选择登陆商户号</div> <div class="muti-title">请选择登陆商户号</div>
<div class="muti-form-box"> <div class="muti-form-box">
<div class="muti-merchant-item" v-for="(item, index) in accountInfo.accountList" :key="index" @click.stop.prevent="handleSelectAccount(index)"> <div class="muti-merchant-item"
v-for="(item, index) in accountInfo.accountList"
:key="index"
@click.stop.prevent="handleSelectAccount(index)">
<i class="muti-dot"></i> <i class="muti-dot"></i>
<div class="muti-merchant-info"> <div class="muti-merchant-info">
<p class="muti-merchant-name">{{ item.merchantName }}</p> <p class="muti-merchant-name">{{ item.merchantName }}</p>
<p class="muti-merchant-code">商户编号:{{ item.merchantNo }}</p> <p class="muti-merchant-code">商户编号:{{ item.merchantNo }}</p>
</div> </div>
<p class="muti-merchant-level">{{ baseData.accountLevelList.find(k => +k.confId == item.accountLevel).confName }}</p> <p class="muti-merchant-level">
{{ baseData.accountLevelList.find(k => +k.confId == item.accountLevel).confName }}
</p>
<i class="muti-arrow el-icon-arrow-right"></i> <i class="muti-arrow el-icon-arrow-right"></i>
</div> </div>
</div> </div>
...@@ -225,7 +216,7 @@ export default { ...@@ -225,7 +216,7 @@ export default {
} }
}) })
userInfo.merchantAccountLevel = userInfo.detail.merchantAccountLevel userInfo.merchantAccountLevel = userInfo.detail.merchantAccountLevel
this.getAuth({ userInfo: userInfo, accountInfo: this.accountInfo }).then(async() => { this.getAuth({ userInfo: userInfo, accountInfo: this.accountInfo }).then(async () => {
const _current = userInfo.detail.accountType !== 7 ? await this.current() : '/onlineAccountList' const _current = userInfo.detail.accountType !== 7 ? await this.current() : '/onlineAccountList'
await this.initBaseData() await this.initBaseData()
this.$router.replace(this.$route.query.redirect || _current) this.$router.replace(this.$route.query.redirect || _current)
...@@ -244,7 +235,7 @@ export default { ...@@ -244,7 +235,7 @@ export default {
// 注意 这里的演示没有传验证码 // 注意 这里的演示没有传验证码
// 具体需要传递的数据请自行修改代码 // 具体需要传递的数据请自行修改代码
this.login(_p) this.login(_p)
.then(async({ isMutiAccount, accountInfo, userInfo }) => { .then(async ({ isMutiAccount, accountInfo, userInfo }) => {
if (isMutiAccount) { if (isMutiAccount) {
this.isMutiAccount = isMutiAccount this.isMutiAccount = isMutiAccount
this.accountInfo = accountInfo this.accountInfo = accountInfo
...@@ -387,9 +378,9 @@ export default { ...@@ -387,9 +378,9 @@ export default {
.muti-dot { .muti-dot {
width: 12px; width: 12px;
height: 12px; height: 12px;
background-color: #2A58AD; background-color: #2a58ad;
margin: 4px 6px 0 0; margin: 4px 6px 0 0;
transform: scale(.5); transform: scale(0.5);
border-radius: 100%; border-radius: 100%;
} }
.muti-merchant-info { .muti-merchant-info {
...@@ -463,7 +454,7 @@ export default { ...@@ -463,7 +454,7 @@ export default {
width: 280px; width: 280px;
height: 52px; height: 52px;
} }
.form-title img{ .form-title img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
...@@ -502,7 +493,13 @@ export default { ...@@ -502,7 +493,13 @@ export default {
.button-login { .button-login {
// background-color: #3D6FE4 !important; // background-color: #3D6FE4 !important;
// color: #FFF; // color: #FFF;
background-image: linear-gradient(148deg, #0BCDFE 0%, #36B2E6 28%, #0947C6 100%, #0947C6 100%); background-image: linear-gradient(
148deg,
#0bcdfe 0%,
#36b2e6 28%,
#0947c6 100%,
#0947c6 100%
);
letter-spacing: 2px; letter-spacing: 2px;
float: left; float: left;
border: none; border: none;
......
<!-- 历史财务规则 -->
<template>
<div class="account-detail"
ref="accountDetail">
<!-- v-resize="resetTableHeight"
:ref="'resize' + index" -->
<div v-if="formArray&&formArray.length">
<div v-for="(formItem,index) in formArray"
v-resize="resetTableHeight"
:ref="'resize' + index"
:key="index">
<p class="edit-sub-title "
:class="{'sub-border':!formItem.show}">
<span class="label">
<span>{{formItem.formatEffectStartDate}}</span>
<span v-if="formItem.formatEffectStartDate"> - </span>
<span
:class="{'labelColor':!formItem.formatEffectEndDate}">{{formItem.formatEffectStartDate?formItem.formatEffectEndDate?formItem.formatEffectEndDate:'生效中':'待生效'}}</span>
</span>
<span class="updatedInfo">
操作人: {{formItem.updatedBy}} 操作时间: {{formItem.formatUpdatedDate}}
</span>
<span class="collapse"
@click="collapseItem(index)">
<i :class="{'move':!formItem.show}"
class="arrow el-icon-arrow-down"></i>
{{formItem.show?'收起':'展开'}} </span>
</p>
<el-collapse-transition>
<viewDetail :isGetDetail='false'
v-if="formItem.show"
:merchantInfo="formItem"
:viewDetailVisible="formItem.show"></viewDetail>
</el-collapse-transition>
</div>
</div>
<div v-else
class="nothingtips">
<img style="height: 109px; width: 109px;"
src="../images/empty.png" />
<p class="title">暂无财务规则</p>
<p class="tips">快去设置看看~ </p>
</div>
</div>
</template>
<script>
import dayjs from 'dayjs'
import { getHistoryRecord } from '@api/publicAccount'
import viewDetail from './viewDetail'
import resize from '@/common/resize'
export default {
name: 'financialRulesDetail',
// 在vue自定义指令中添加该指令
directives: {
resize
},
components: {
// Collapse
viewDetail
},
props: {
accountDetailVisible: {
type: Boolean,
default: false
},
merchantId: {
type: [String, Number],
default: '44209883'
},
merchantRow: {
type: Object,
default: () => { }
}
},
data() {
return {
formArray: []
}
},
watch: {
accountDetailVisible(newVal) {
if (newVal) {
this.merchantId = this.merchantRow.merchantId
// this.getDetail()
}
}
},
mounted() {
this.getDetail()
},
methods: {
collapseItem(SelectIndex) {
// return
this.formArray.forEach((element, index) => {
if (SelectIndex == index) {
element.show = !element.show
} else {
element.show = false
}
})
},
getDetail() {
getHistoryRecord({ merchantId: this.merchantId }).then(res => {
// console.log(res)
// dayjs(this.summaryDate).startOf('month').format('YYYY-MM-DD')
// const timeLabele = {
// }
// let financialRulesList = res
// 财务规则有三个模式 待生效 生效中 历史
// 根据effectEndDate 和 effectStartDate
// console.log(res)
this.formArray = res.map((item) => {
const format = 'YYYY/MM/DD HH:mm'
const createdDate = item.createdDate
item.merchant = item?.divisionRule?.realityDivisionMerchant
item = Object.assign(item, item.settleRule, item.divisionRule)
// 这个值强制取item里面的
item.createdDate = createdDate
item.formatEffectEndDate = item.effectEndDate ? dayjs(item.effectEndDate).format(format) : ''
item.formatEffectStartDate = item.effectStartDate ? dayjs(item.effectStartDate).format(format) : ''
// console.log('item.createdDate', item.createdDate)
item.formatUpdatedDate = dayjs(item.createdDate).format(format)
item.show = false
return item
})
})
},
resetTableHeight() {
function getClientHeight() {
let clientHeight = 0
if (document.body.clientHeight && document.documentElement.clientHeight) {
clientHeight = (document.body.clientHeight < document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
} else {
clientHeight = (document.body.clientHeight > document.documentElement.clientHeight) ? document.body.clientHeight : document.documentElement.clientHeight
}
return clientHeight
}
const windowHeight = getClientHeight() - 221
const that = this
// const list = ['resize0', 'resize1', 'resize2', 'resize3']
const listHeight = this.formArray.reduce((num, item, index) => {
// console.log(that.$refs[item])
num = num + (that.$refs[`resize${index}`][0].offsetHeight) || 0
return num
}, 0)
// console.log(listHeight)
const height = windowHeight > listHeight ? listHeight : windowHeight
// console.log(height + 'height')
this.$refs.accountDetail.style.height = height + 'px'
// console.log(this.$refs.resize0[0].offsetHeight)
}
}
}
</script>
<style scoped lang="scss">
.account-detail {
// height: 400px;
height: calc(100vh - 200px);
padding-right: 15px;
overflow-y: scroll;
overflow-x: hidden;
}
.edit-sub-title {
padding: 17px 0;
margin: 0;
display: flex;
justify-content: space-between;
font-size: 14px;
&::before {
top: 50%;
transform: translateY(-50%);
}
.label {
padding-left: 8px;
width: 37%;
}
.labelColor {
color: #0947c6;
}
.updatedInfo {
width: 40%;
text-align: left;
}
.collapse {
padding-right: 20px;
color: #0947c6;
cursor: pointer;
.arrow {
transition: all 1s;
}
.move {
transform: rotate(-180deg);
}
}
}
.sub-border {
animation: border-delay 1s forwards;
}
@keyframes border-delay {
0% {
/* opacity: 0; */
/* right: -100%; */
}
100% {
border-bottom: 1px solid #d8d8d8;
}
}
.account-detail .detail-img {
width: 180px;
height: 104px;
margin-right: 40px;
transition: width 0.3s;
border-radius: 4px;
overflow: hidden;
cursor: pointer;
margin-right: 100px;
}
// .account-detail .detail-img:hover {
// margin-right: 0px;
// width: 90%;
// height: 90%;
// }
// .account-detail .detail-img:hover + .imageLabel {
// width: 90%;
// }
.itemContainer {
padding: 30px 0;
background: #f4f6fc;
border-radius: 2px;
}
.imageContainer {
// style="display: inline-block;"
// max-height: 50%;
position: relative;
max-width: 50%;
box-sizing: border-box;
display: inline-block;
// display: flex;
// flex-wrap: wrap;
// justify-content: space-between;
}
.imageLabel {
line-height: 14px;
width: 137px;
// width: 50%;
text-align: center;
color: #999999;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
}
.img-btns {
display: none;
position: absolute;
width: 180px;
height: 104px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
cursor: pointer;
background: rgba(0, 0, 0, 0.5);
}
.img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.imageContainer:hover .img-btns {
display: block;
}
/* .transition-box {
margin-bottom: 10px;
width: 200px;
height: 100px;
border-radius: 4px;
background-color: #409eff;
text-align: center;
color: #fff;
padding: 40px 20px;
box-sizing: border-box;
margin-right: 20px;
} */
.link {
color: blue;
cursor: pointer;
// /* 鼠标样式*/
}
.link:link {
color: #06f;
text-decoration: none;
// /* 未访问的链接 */
}
.link:visited {
color: #999;
text-decoration: line-through;
// /* 已访问的链接 */
}
.link:hover {
color: #f00;
//* 鼠标移动到链接上 */
text-decoration: underline;
}
.link:active {
// /* 选定的链接 */
color: #f0f;
}
.nothingtips {
// align-items: center;
text-align: center;
font-size: 16px;
padding-top: 40px;
.title {
font-size: 20px;
color: #666;
margin: 16px 0;
}
.tips {
font-size: 12px;
color: #999;
}
}
</style>
...@@ -111,11 +111,15 @@ ...@@ -111,11 +111,15 @@
:disabled="true">配置管理</el-tab-pane> :disabled="true">配置管理</el-tab-pane>
</el-tabs> </el-tabs>
</d2-dialog> </d2-dialog>
<!-- <division-rule <baseDialog :isShow.sync="financialRulesDetailVisible"
:divisionRuleVisible="divisionRuleVisible" :config="dialogConfig.setting"
:merchantInfo="merchantInfo" :dialogConfig="dialogConfig.config"
@handleRuleClose="handleRuleClose" @closeDialog="handleDetailClose">
></division-rule> --> <financialRulesDetail v-if="financialRulesDetailVisible"
:merchantId="merchantInfo.merchantId"
:accountDetailVisible="financialRulesDetailVisible">
</financialRulesDetail>
</baseDialog>
</d2-container> </d2-container>
</template> </template>
...@@ -123,7 +127,8 @@ ...@@ -123,7 +127,8 @@
import { Util } from '@/common/util' import { Util } from '@/common/util'
import _ from 'lodash' import _ from 'lodash'
import viewDetail from './viewDetail' import viewDetail from './viewDetail'
// import divisionRule from './divisionRule' import financialRulesDetail from './financialRulesDetail'
import baseDialog from '@/components/baseDialog/baseDialog'
import { getList, deleteMerchant, serviceGetMerchantList, addServiceMerchant, getPartnerByYq } from '@api/merchant' import { getList, deleteMerchant, serviceGetMerchantList, addServiceMerchant, getPartnerByYq } from '@api/merchant'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { getParkStore } from '@api/editCustomer' import { getParkStore } from '@api/editCustomer'
...@@ -131,9 +136,31 @@ import { BaseData, userTypeList, ghUserTypeList, merchantClassifyList } from '@/ ...@@ -131,9 +136,31 @@ import { BaseData, userTypeList, ghUserTypeList, merchantClassifyList } from '@/
import relateStoreMerDialog from './components/relateStoreMerDialog' import relateStoreMerDialog from './components/relateStoreMerDialog'
export default { export default {
name: 'merchantManage', name: 'merchantManage',
components: {
viewDetail,
relateStoreMerDialog,
financialRulesDetail,
baseDialog
// divisionRule
},
data() { data() {
return { return {
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
financialRulesDetailVisible: false,
dialogConfig: {
setting: {
showClose: true,
appendToBody: false,
// width: '900px',
btnList: [
]
},
config: {
title: '查看详情',
width: '900px'
}
},
searchForm: { searchForm: {
merchantType: '', merchantType: '',
channelType: '', channelType: '',
...@@ -185,7 +212,9 @@ export default { ...@@ -185,7 +212,9 @@ export default {
tableParams: { tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: 'list',
tableOption: true, tableOption: {
width: '200px'
},
tableColumns: [{ tableColumns: [{
label: '导流方编号', label: '导流方编号',
prop: 'merchantId', prop: 'merchantId',
...@@ -268,7 +297,8 @@ export default { ...@@ -268,7 +297,8 @@ export default {
formatter: (cellValue) => { formatter: (cellValue) => {
return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss') return Util.dateFormate(cellValue.updatedDate, 'YYYY-MM-DD HH:mm:ss')
} }
}] }
]
}, },
// 关联门店 // 关联门店
storeSearchForm: { storeSearchForm: {
...@@ -287,9 +317,7 @@ export default { ...@@ -287,9 +317,7 @@ export default {
storeApi: serviceGetMerchantList, storeApi: serviceGetMerchantList,
sourcePage: 'serviceStore', sourcePage: 'serviceStore',
storeSelected: [], storeSelected: [],
// 分账
// divisionRuleVisible: false,
// merchantInfo: {},
// 查看详情 // 查看详情
detailActiveName: 'first', detailActiveName: 'first',
viewDetailVisible: false, viewDetailVisible: false,
...@@ -309,12 +337,6 @@ export default { ...@@ -309,12 +337,6 @@ export default {
} }
}, },
components: {
viewDetail,
relateStoreMerDialog
// divisionRule
},
mounted() { mounted() {
this.userInfo.beSuper && getParkStore({}).then(res => { this.userInfo.beSuper && getParkStore({}).then(res => {
res.forEach(item => { res.forEach(item => {
...@@ -334,6 +356,9 @@ export default { ...@@ -334,6 +356,9 @@ export default {
this.baseData.channelTypeList = await this.get(BaseData.channelType) this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList() this.getOptionsList()
}, },
handleDetailClose() {
this.financialRulesDetailVisible = false
},
keyDowmGetList() { keyDowmGetList() {
this.$refs.merchantTable.refreshTable() this.$refs.merchantTable.refreshTable()
}, },
...@@ -440,14 +465,14 @@ export default { ...@@ -440,14 +465,14 @@ export default {
this.viewDetailData = _.cloneDeep(row) this.viewDetailData = _.cloneDeep(row)
this.handleViewClose() this.handleViewClose()
}, },
// 分账 // 历史记录
// handleAccount(row) { handleRecord(row) {
// this.merchantInfo = row this.merchantInfo = row
// this.handleRuleClose() this.handleRuleClose()
// }, },
// handleRuleClose() { handleRuleClose() {
// this.divisionRuleVisible = !this.divisionRuleVisible this.financialRulesDetailVisible = !this.financialRulesDetailVisible
// }, },
// 删除 // 删除
handleDelete(row) { handleDelete(row) {
this.$confirm('是否要进行删除操作?', '提示', { this.$confirm('是否要进行删除操作?', '提示', {
......
...@@ -143,10 +143,7 @@ ...@@ -143,10 +143,7 @@
<p class="desc-title">POS机扫码获取订单信息</p> <p class="desc-title">POS机扫码获取订单信息</p>
<div class="txt-box" <div class="txt-box"
v-if="merchantInfo.goodsOrder"> v-if="merchantInfo.goodsOrder">
<!-- <img
class="middle"
src="./images/code.png"
/> -->
<vue-qr class="middle" <vue-qr class="middle"
:margin="0" :margin="0"
width="134" width="134"
...@@ -291,14 +288,14 @@ ...@@ -291,14 +288,14 @@
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import vueQr from 'vue-qr' // import vueQr from 'vue-qr'
import { limitPrice } from '@/common/constants' import { limitPrice } from '@/common/constants'
import { moneyValidApi, getWsUrlApi } from '@api/merchant' import { moneyValidApi, getWsUrlApi } from '@api/merchant'
import vue2OrgTree from 'vue2-org-tree' import vue2OrgTree from 'vue2-org-tree'
export default { export default {
name: 'stepThree', name: 'stepThree',
components: { components: {
vueQr, // vueQr,
vue2OrgTree vue2OrgTree
}, },
data() { data() {
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
class="blue">{{merchantInfo.marketingCostPartnerMerchant ? merchantInfo.marketingCostPartnerMerchant.merchantName : ''}}{{merchantInfo.marketingCostPartnerMerchant ? ( '(' + merchantInfo.marketingCostPartnerMerchant.merchantId + ')') : ''}}:</span> class="blue">{{merchantInfo.marketingCostPartnerMerchant ? merchantInfo.marketingCostPartnerMerchant.merchantName : ''}}{{merchantInfo.marketingCostPartnerMerchant ? ( '(' + merchantInfo.marketingCostPartnerMerchant.merchantId + ')') : ''}}:</span>
{{divisionList.marketingCostPartnerMerchant.join(',')}} {{divisionList.marketingCostPartnerMerchant.join(',')}}
</p> </p>
<p v-show="divisionList.realityShopMerchantName.length"> <!-- v-show="divisionList.realityShopMerchantName.length" -->
<p>
<span <span
class="blue">{{divisionForm.realityShopMerchantName}}:</span>{{divisionList.realityShopMerchantName.join(',')}} class="blue">{{divisionForm.realityShopMerchantName}}:</span>{{divisionList.realityShopMerchantName.join(',')}}
</p> </p>
...@@ -61,7 +62,8 @@ ...@@ -61,7 +62,8 @@
<tr> <tr>
<th>商户编号:{{merchantInfo.merchantId}}</th> <th>商户编号:{{merchantInfo.merchantId}}</th>
<th class="ellipsis w-298" <th class="ellipsis w-298"
:title="merchantInfo.merchantName">商户名称:{{merchantInfo.merchantName}}</th> :title="$$(merchantInfo.merchant,'merchantName')">
商户名称:{{$$(merchantInfo.merchant,'merchantName')}}</th>
<th class="w-140">联系人:{{merchantInfo.merchant ? merchantInfo.merchant.contactName : ''}} <th class="w-140">联系人:{{merchantInfo.merchant ? merchantInfo.merchant.contactName : ''}}
</th> </th>
<th>联系电话:{{merchantInfo.merchant ? merchantInfo.merchant.phone : ''}}</th> <th>联系电话:{{merchantInfo.merchant ? merchantInfo.merchant.phone : ''}}</th>
...@@ -73,10 +75,10 @@ ...@@ -73,10 +75,10 @@
<tr> <tr>
<td>登录账户:{{merchantInfo.merchant ? merchantInfo.merchant.accountName : ''}}</td> <td>登录账户:{{merchantInfo.merchant ? merchantInfo.merchant.accountName : ''}}</td>
<td> <td>
商户类型:{{baseData[merchantInfo.channelType === 2 ? 'ghUserTypeList' : 'userTypeList'][merchantInfo.userType]}} 商户类型:{{baseData[$$(merchantInfo.merchant,'channelType') === 2 ? 'ghUserTypeList' : 'userTypeList'][merchantInfo.merchant.userType]}}
</td> </td>
<td> <td>
商户分类:{{merchantInfo.merchantType ? baseData.merchantClassifyList.find(item => item.confId === merchantInfo.merchantType).confLabel : ''}} 商户分类:{{$$(merchantInfo.merchant,'merchantType') ? baseData.merchantClassifyList.find(item => item.confId === merchantInfo.merchant.merchantType).confLabel : ''}}
</td> </td>
<td class="dateContainer noPddingRight">入驻日期: <td class="dateContainer noPddingRight">入驻日期:
<el-date-picker v-model="needTransformObj.entryDate" <el-date-picker v-model="needTransformObj.entryDate"
...@@ -90,7 +92,8 @@ ...@@ -90,7 +92,8 @@
</el-date-picker> </el-date-picker>
<div>{{needTransformObj.entryDate}}</div> <div>{{needTransformObj.entryDate}}</div>
<div class="date"> <div class="date"
v-if="isGetDetail">
<div class="dateBtn" <div class="dateBtn"
@click="chooseDate">编辑</div> @click="chooseDate">编辑</div>
</div> </div>
...@@ -138,9 +141,8 @@ ...@@ -138,9 +141,8 @@
<td>创建时间:{{needTransformObj.yqCreatedDate}}</td> <td>创建时间:{{needTransformObj.yqCreatedDate}}</td>
</tr> </tr>
</table> </table>
<div v-show="merchantInfo.partnerMerchants"> <!-- <div v-show="merchantInfo.partnerMerchants"> -->
<p class="edit-sub-title m-t-10">关联的服务商基础信息</p> <p class="edit-sub-title m-t-10">关联的服务商基础信息</p>
<table cellpadding='0' <table cellpadding='0'
cellspacing='0' cellspacing='0'
style="border-width: 0px 0px 1px 1px;"> style="border-width: 0px 0px 1px 1px;">
...@@ -244,11 +246,11 @@ ...@@ -244,11 +246,11 @@
</table> </table>
</div> </div>
</div> </div>
</div> <!-- </div> -->
</template> </template>
<script> <script>
import { Util } from '@/common/util' import { Util, deepClone } from '@/common/util'
import { getAccountRule, getDivisionRuleApi, entrydateUpdate } from '@api/merchant' import { getAccountRule, getDivisionRuleApi, entrydateUpdate } from '@api/merchant'
// deductChargeFlagObj // deductChargeFlagObj
import { userType, ghUserType, merchantClassifyList, partnerDeductChargeFlagObj, shop4sDeductChargeFlagObj } from '@/common/constants' import { userType, ghUserType, merchantClassifyList, partnerDeductChargeFlagObj, shop4sDeductChargeFlagObj } from '@/common/constants'
...@@ -262,6 +264,10 @@ export default { ...@@ -262,6 +264,10 @@ export default {
merchantInfo: { merchantInfo: {
type: Object, type: Object,
default: () => { } default: () => { }
},
isGetDetail: {
type: Boolean,
default: true
} }
}, },
data() { data() {
...@@ -378,12 +384,33 @@ export default { ...@@ -378,12 +384,33 @@ export default {
}, },
mounted() { mounted() {
console.log(this.isGetDetail)
this.setNeedTransformObj()
if (this.isGetDetail) {
this.getDetail() this.getDetail()
} else {
this.setAccountRule(this.merchantInfo.settleRule)
this.setDivisionRule(deepClone(this.merchantInfo.divisionRule))
// const res = Object.assign(this.merchantInfo.settleRule, this.merchantInfo.divisionRule)
// this.setDivisionRule(res)
}
}, },
methods: { methods: {
getDetail() { getDetail() {
// console.log(this.merchantInfo) console.log(this.merchantInfo)
// console.log(Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD'))
getDivisionRuleApi({ merchantId: this.merchantInfo.merchantId }).then(res => {
// console.log(res)
// this.hasDivision = !!res
this.setDivisionRule(res)
})
getAccountRule({ 'merchantId': this.merchantInfo.merchantId }).then(res => {
this.setAccountRule(res)
})
},
setNeedTransformObj() {
this.needTransformObj = { this.needTransformObj = {
addr: this.merchantInfo.merchant ? ((this.merchantInfo.merchant.provinceName || '') + (this.merchantInfo.merchant.cityName || '') + (this.merchantInfo.merchant.areaName || '') + (this.merchantInfo.merchant.address || '')) : '', addr: this.merchantInfo.merchant ? ((this.merchantInfo.merchant.provinceName || '') + (this.merchantInfo.merchant.cityName || '') + (this.merchantInfo.merchant.areaName || '') + (this.merchantInfo.merchant.address || '')) : '',
createdDate: this.merchantInfo.merchant ? (this.merchantInfo.merchant.createdDate ? Util.dateFormate(this.merchantInfo.merchant.createdDate, 'YYYY-MM-DD HH:mm:ss') : '') : '', createdDate: this.merchantInfo.merchant ? (this.merchantInfo.merchant.createdDate ? Util.dateFormate(this.merchantInfo.merchant.createdDate, 'YYYY-MM-DD HH:mm:ss') : '') : '',
...@@ -393,11 +420,11 @@ export default { ...@@ -393,11 +420,11 @@ export default {
parentCreatedDate: this.merchantInfo.singlePartnerMerchant ? (this.merchantInfo.singlePartnerMerchant.createdDate ? Util.dateFormate(this.merchantInfo.singlePartnerMerchant.createdDate, 'YYYY-MM-DD HH:mm:ss') : '') : '', parentCreatedDate: this.merchantInfo.singlePartnerMerchant ? (this.merchantInfo.singlePartnerMerchant.createdDate ? Util.dateFormate(this.merchantInfo.singlePartnerMerchant.createdDate, 'YYYY-MM-DD HH:mm:ss') : '') : '',
entryDate: this.merchantInfo.merchant ? (this.merchantInfo.merchant.entryDate ? Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD') : '') : '' entryDate: this.merchantInfo.merchant ? (this.merchantInfo.merchant.entryDate ? Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD') : '') : ''
} }
// console.log(Util.dateFormate(this.merchantInfo.merchant.entryDate, 'YYYY-MM-DD')) },
getDivisionRuleApi({ merchantId: this.merchantInfo.merchantId }).then(res => { setDivisionRule(res) {
// console.log(res) this.hasDivision = res ?? ''
this.hasDivision = !!res
this.divisionForm = res || {} this.divisionForm = res || {}
console.log(this.divisionForm)
Object.assign(this.form, res) Object.assign(this.form, res)
var flagList = Object.keys(this.flagTodivisionObj) var flagList = Object.keys(this.flagTodivisionObj)
...@@ -415,12 +442,13 @@ export default { ...@@ -415,12 +442,13 @@ export default {
// console.log(numToDivisionList[res[item]]) // console.log(numToDivisionList[res[item]])
numToDivisionList[res[item]] && this.divisionList[numToDivisionList[res[item]]].push(this.flagTodivisionObj[item]) numToDivisionList[res[item]] && this.divisionList[numToDivisionList[res[item]]].push(this.flagTodivisionObj[item])
}) })
}) },
getAccountRule({ 'merchantId': this.merchantInfo.merchantId }).then(res => { setAccountRule(res) {
Object.assign(this.merchantInfo, res) Object.assign(this.merchantInfo, res)
// console.log(res) // console.log(this.settleRuleList)
if (res) { if (res) {
this.settleRuleList = res.goodsTypeSettleRuleList this.settleRuleList = deepClone(res.goodsTypeSettleRuleList)
// console.log(res.goodsTypeSettleRuleList)
this.merchantInfo.deductChargeFlag = res.deductChargeFlag this.merchantInfo.deductChargeFlag = res.deductChargeFlag
this.settleRuleList.unshift({ this.settleRuleList.unshift({
goodsTypeName: '全部', goodsTypeName: '全部',
...@@ -429,9 +457,8 @@ export default { ...@@ -429,9 +457,8 @@ export default {
partnerProfitPer: res.partnerProfitPer partnerProfitPer: res.partnerProfitPer
}) })
} }
}) // console.log(this.settleRuleList)
}, },
chooseDate() { chooseDate() {
this.$refs.datePicker.focus() this.$refs.datePicker.focus()
}, },
......
...@@ -2,21 +2,25 @@ const VueFilenameInjector = require('./tools/vue-filename-injector') ...@@ -2,21 +2,25 @@ const VueFilenameInjector = require('./tools/vue-filename-injector')
const ThemeColorReplacer = require('webpack-theme-color-replacer') const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI') const forElementUI = require('webpack-theme-color-replacer/forElementUI')
const HardPlugin = require('hard-source-webpack-plugin') // 使用缓存,优化启动速度 const HardPlugin = require('hard-source-webpack-plugin') // 使用缓存,优化启动速度
// const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const SentryWebpackPlugin = require('@sentry/webpack-plugin') const SentryWebpackPlugin = require('@sentry/webpack-plugin')
// const CopyDir = require('./plugins/copyDir') const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
// const AsyncRomveDir = require('./plugins/removeDir') const CopyDir = require('./plugins/copyDir')
const AsyncRomveDir = require('./plugins/removeDir')
const { resolve: assets } = require('path') const { resolve: assets } = require('path')
const os = require('os') const os = require('os')
/** /**
* 获取当前机器的ip地址 * 获取当前机器的ip地址
*/ */
function getIpAddress() { function getIpAddress() {
var ifaces = os.networkInterfaces() var ifaces = os.networkInterfaces()
for (var dev in ifaces) { for (var dev in ifaces) {
const iface = ifaces[dev] const iface = ifaces[dev]
for (let i = 0; i < iface.length; i++) { for (let i = 0; i < iface.length; i++) {
const { family, address, internal } = iface[i] const { family, address, internal } = iface[i]
if (family === 'IPv4' && address !== '127.0.0.1' && !internal) { if (family === 'IPv4' && address !== '127.0.0.1' && !internal) {
return address return address
} }
...@@ -25,20 +29,21 @@ function getIpAddress() { ...@@ -25,20 +29,21 @@ function getIpAddress() {
} }
// 拼接路径 // 拼接路径
const resolve = dir => require('path').join(__dirname, dir) const resolve = dir => require('path').join(__dirname, dir)
// 增加环境变量 // 增加环境变量
process.env.VUE_APP_VERSION = require('./package.json').version process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss') process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
const isDev = process.env.NODE_ENV !== 'development' const isDev = process.env.NODE_ENV !== 'development'
// 基础路径 注意发布之前要先修改这里 // 基础路径 注意发布之前要先修改这里
const publicPath = '/dj-carlife-web/' const publicPath = '/dj-carlife-web/'
// const publicPath = '/' // const publicPath = '/'
// const CDN_DOMAIN = 'https://cdn.bootcss.com' // const CDN_DOMAIN = 'https://cdn.bootcss.com'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web' const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web'
const cdn = { const cdn = {
css: [ css: [`${CDN_DOMAIN}/nprogress.min.css`, `${CDN_DOMAIN}/element-ui.min.css`],
// `${CDN_DOMAIN}/element-ui/2.15.0/theme-chalk/index.css`,
`${CDN_DOMAIN}/nprogress.min.css`
],
js: [ js: [
`${CDN_DOMAIN}/vue.min.js`, `${CDN_DOMAIN}/vue.min.js`,
`${CDN_DOMAIN}/vue-router.min.js`, `${CDN_DOMAIN}/vue-router.min.js`,
...@@ -49,17 +54,25 @@ const cdn = { ...@@ -49,17 +54,25 @@ const cdn = {
`${CDN_DOMAIN}/echarts.min.js`, `${CDN_DOMAIN}/echarts.min.js`,
`${CDN_DOMAIN}/lodash.min.js`, `${CDN_DOMAIN}/lodash.min.js`,
`${CDN_DOMAIN}/qs.min.js`, `${CDN_DOMAIN}/qs.min.js`,
`${CDN_DOMAIN}/ua-parser.min.js` `${CDN_DOMAIN}/ua-parser.min.js`,
// `${CDN_DOMAIN}/element-ui/2.15.0/index.js`, `${CDN_DOMAIN}/html2canvas.min.js`,
// `${CDN_DOMAIN}/core-js/2.6.9/core.min.js`, `${CDN_DOMAIN}/element-ui.min.js`,
// `${CDN_DOMAIN}/vue-i18n/8.14.0/vue-i18n.esm.js`, // `${CDN_DOMAIN}/better-scroll.min.js`,
// `https://cdn.bootcdn.net/ajax/libs/better-scroll/2.4.2/better-scroll.min.js`,
`https://img01.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/better-scroll.min.js`,
`${CDN_DOMAIN}/dayjs.min.js`,
`${CDN_DOMAIN}/vue-qr.js`,
`${CDN_DOMAIN}/xlsx.min.js`
// `${CDN_DOMAIN}/flex.css`
] ]
} }
module.exports = { module.exports = {
publicPath, // 根据你的实际情况更改这里 publicPath, // 根据你的实际情况更改这里
// outputDir: 'copyDirTarget', outputDir: 'copyDirTarget',
lintOnSave: false, // productionSourceMap: false,
lintOnSave: true,
devServer: { devServer: {
// port: 8082,
// publicPath, // 和 publicPath 保持一致 // publicPath, // 和 publicPath 保持一致
https: false, https: false,
host: getIpAddress() host: getIpAddress()
...@@ -74,6 +87,7 @@ module.exports = { ...@@ -74,6 +87,7 @@ module.exports = {
}, },
configureWebpack: config => { configureWebpack: config => {
if (isDev) { if (isDev) {
// if (!isDev) {
config.externals = { config.externals = {
vue: 'Vue', vue: 'Vue',
'vue-router': 'VueRouter', 'vue-router': 'VueRouter',
...@@ -84,13 +98,23 @@ module.exports = { ...@@ -84,13 +98,23 @@ module.exports = {
echarts: 'echarts', echarts: 'echarts',
lodash: '_', lodash: '_',
'ua-parser-js': 'UAParser', 'ua-parser-js': 'UAParser',
qs: 'Qs' qs: 'Qs',
// 'element-ui': 'ELEMENT', html2canvas: 'html2canvas',
// 'vue-i18n':'vue-i18n', 'element-ui': 'ELEMENT',
// 'better-scroll': 'BScroll', dayjs: 'dayjs',
// 'core-js': 'core-js' 'vue-qr': 'vue-qr',
xlsx: 'XLSX',
// BScroll: 'better-scroll'
'better-scroll': 'BScroll'
} }
} }
// html2canvas: 'html2canvas',
// 'element-ui': 'ELEMENT',
// 'better-scroll': 'BScroll',
// xlsx: 'xlsx',
// 'vue-qr': 'vue-qr',
// dayjs: 'dayjs',
// 'flex.css': 'flex.css'
// 非开发环境 // 非开发环境
if (isDev) { if (isDev) {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
...@@ -101,6 +125,7 @@ module.exports = { ...@@ -101,6 +125,7 @@ module.exports = {
] ]
} }
// console.log(config) // console.log(config)
// const Plugins = [ // const Plugins = [
// new MiniCssExtractPlugin({ // new MiniCssExtractPlugin({
// // Options similar to the same options in webpackOptions.output // // Options similar to the same options in webpackOptions.output
...@@ -109,6 +134,7 @@ module.exports = { ...@@ -109,6 +134,7 @@ module.exports = {
// chunkFilename: devMode ? 'css/[id].css' : 'css/[id].[hash].css', // chunkFilename: devMode ? 'css/[id].css' : 'css/[id].[hash].css',
// })] // })]
// config.plugins = [...config.plugins, ...Plugins] // config.plugins = [...config.plugins, ...Plugins]
const plugins = [] const plugins = []
plugins.push( plugins.push(
new HardPlugin({ new HardPlugin({
...@@ -116,27 +142,35 @@ module.exports = { ...@@ -116,27 +142,35 @@ module.exports = {
// 解决报错问题 // 解决报错问题
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/ test: /mini-css-extract-plugin[\\/]dist[\\/]loader/
}) })
)
if (isDev) {
plugins.push(new CopyDir()) // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new AsyncRomveDir() //不能移除默认输出文件夹因为打包出来的文件会提示超过默认值
// 解决方法是不启用这个这个插件或者吧默认值配置大
// new SpeedMeasurePlugin(), // new SpeedMeasurePlugin(),
// new CopyDir() // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new AsyncRomveDir() // new AsyncRomveDir()
) }
config.plugins = [...config.plugins, ...plugins] config.plugins = [...config.plugins, ...plugins]
// sentry 配置 // sentry 配置
// process.env.NODE_ENV === 'production' && process.env.NODE_ENV === 'production' &&
// Object.assign(config, { Object.assign(config, {
// plugins: [ plugins: [
// ...config.plugins, ...config.plugins,
// new SentryWebpackPlugin({ new SentryWebpackPlugin({
// // webpack specific configuration // webpack specific configuration
// release: '0.0.1', release: '0.0.1',
// include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件 include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件
// ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加 ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加
// configFile: '.sentryclirc', configFile: '.sentryclirc',
// urlPrefix: '~/dj-carlife-web/' urlPrefix: '~/dj-carlife-web/'
// }) })
// ] ]
// }) })
}, },
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js // 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack: config => { chainWebpack: config => {
/** /**
...@@ -146,6 +180,9 @@ module.exports = { ...@@ -146,6 +180,9 @@ module.exports = {
* 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的 * 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的
*/ */
config.plugins.delete('prefetch').delete('preload') config.plugins.delete('prefetch').delete('preload')
// config
// .plugin('webpack-bundle-analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
// 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559 // 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559
config.resolve.symlinks(true) config.resolve.symlinks(true)
config.plugin('theme-color-replacer').use(ThemeColorReplacer, [ config.plugin('theme-color-replacer').use(ThemeColorReplacer, [
...@@ -204,7 +241,9 @@ module.exports = { ...@@ -204,7 +241,9 @@ module.exports = {
config.resolve.alias config.resolve.alias
.set('@', resolve('src')) .set('@', resolve('src'))
.set('@api', resolve('src/api')) .set('@api', resolve('src/api'))
if (isDev) { if (isDev) {
// if (!isDev) {
config.plugin('html').tap(args => { config.plugin('html').tap(args => {
// args[0].minify.removeComments = false; // args[0].minify.removeComments = false;
args[0].cdn = cdn args[0].cdn = cdn
...@@ -220,5 +259,14 @@ module.exports = { ...@@ -220,5 +259,14 @@ module.exports = {
localeDir: 'locales', localeDir: 'locales',
enableInSFC: true enableInSFC: true
} }
},
pwa: {
iconPaths: {
favicon32: 'favicon.ico',
favicon16: 'favicon.ico',
appleTouchIcon: 'favicon.ico',
maskIcon: 'favicon.ico',
msTileImage: 'favicon.ico'
}
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!