Commit 786fc40a by zhouzy

init

0 parents
Showing 76 changed files with 4859 additions and 0 deletions
NODE_ENV='development'
# must start with VUE_APP_
VUE_APP_ENV = 'development'
VUE_APP_PORT = 6652
NODE_ENV='production'
# must start with VUE_APP_
VUE_APP_ENV = 'production'
\ No newline at end of file \ No newline at end of file
{
"root": true,
"env": {
"node": true
},
"extends": ["plugin:vue/essential", "@vue/prettier"],
"rules": {
"no-console": "off",
"no-unused-vars":"off",
"prettier.endOfLine": "crlf",
"endOfLine":"auto"
},
"parserOptions": {
"parser": "babel-eslint"
}
}
.DS_Store
node_modules
/dist
# 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?
{
"printWidth": 800,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false,
"wrap_line_length": 820,
"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"
}
# subapp-blog
微前端博客子应用
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
"# test"
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
[
"component",
{
libraryName: "element-ui",
styleLibraryName: "theme-chalk"
}
]
]
};
This diff could not be displayed because it is too large.
{
"name": "blog",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.4",
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.15.6",
"glsx-common": "^1.4.0",
"glsx-components": "^1.0.4",
"glsx-vue-components": "^1.0.15",
"jquery": "^3.6.0",
"vue": "^2.6.10",
"vue-bus": "^1.2.1",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
"@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-plugin-router": "^4.1.0",
"@vue/cli-plugin-vuex": "^4.1.0",
"@vue/cli-service": "^4.1.0",
"@vue/eslint-config-prettier": "^5.0.0",
"babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0",
"node-sass": "^4.14.1",
"prettier": "^1.19.1",
"sass-loader": "^8.0.0",
"vue-cli-plugin-element": "^1.0.1",
"vue-template-compiler": "^2.6.10"
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
No preview for this file type
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>微前端子应用:博客</title>
</head>
<body>
<noscript>
<strong>We're sorry but module-report doesn't work properly without JavaScript enabled. Please enable it to
continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
\ No newline at end of file \ No newline at end of file
var express = require('express')
// var history = require('connect-history-api-fallback')
var cors = require('cors')
var app = express()
// app.use(history())
app.use(cors())
app.use(express.static('./dist'))
app.get('/', function(req, res) {
res.send('Hello jq')
})
const port = 6652
app.listen(port)
console.log(`服务已运行:\r\n http://127.0.0.1:${port}`)
<template>
<div id="app">
<!-- <h2>
报表子应用
<span class="right">{{ gs }}</span>
</h2>
<div id="nav">
<span>切换路由:</span>
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/')">报表</el-button>
<el-button type="primary" size="medium" @click="routerChange('/about')">穿梭框</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1')">表格</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">日历</el-button>
<el-button type="primary" size="medium" @click="toAppReport('3-1')">aaaa</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<span>rxjs通信方案:{{ myMsg }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:{{ myMessage }}</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('default')">通知父应用收到</el-button>
</div>
<img src="./assets/logo.png" alt="" srcset="" />
</div> -->
<router-view />
</div>
</template>
<script>
export default {
name: 'report-app',
props: {
msg: String,
message: String
},
data() {
return {
myMsg: '',
gs: ''
}
},
created() {
this.myMsg = this.msg
this.myMessage = this.message
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</style>
>
/*
所有模块都定义在 modules
|-modules
|----demo.js
|----demo1.js
|----...
|-index.js ---动态对外暴露所有模块 无须手动添加
参考demo.js 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
*/
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce((modules, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
modules[moduleName] = value.default
return modules
}, {})
export default modules
import { http } from '@/main'
/** 更改汽车展示状态*/
const cardsDisplay = (params = {}) => {
params.method = 'scrm.api.equity.car.service.main.page.flag.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
})
}
/** 获取汽车权益列表*/
const getCarList = (params = { pageSize: 9999, pageNum: 1 }) => {
params.method = 'scrm.api.equity.car.service.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**置顶权益*/
const setTop = params => {
params.method = 'scrm.api.equity.car.service.set.top'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 修改汽车权益上架状态*/
const updateShelves = params => {
params.method = 'scrm.api.equity.car.service.shelves.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**新增汽车权益*/
const createEquity = params => {
params.method = 'scrm.api.equity.car.service.insert'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 更新汽车权益*/
const updateEquity = params => {
params.method = 'scrm.api.equity.car.service.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default {
getCarList,
setTop,
updateShelves,
createEquity,
updateEquity,
cardsDisplay
}
import { http } from '@/main'
const upLoadImg = (params = {}) => {
params.method = 'scrm.api.equity.common.upload.image'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll:true
})
}
export default {
upLoadImg
}
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
const GETLISTDEVICEFILEUNSTOCK = params => {
return window.$http({
url: 'deviceInfo/listDeviceFileUnstock',
method: 'POST',
data: params,
sign: true
})
}
const GETLISTDEVICEFILEUNSTOCK1 = params => {
return window.$http({
url: 'deviceInfo/listDeviceFileUnstock',
method: 'POST',
data: params,
sign: true
})
}
export default {
GETLISTDEVICEFILEUNSTOCK,
GETLISTDEVICEFILEUNSTOCK1
}
import { http } from '@/main'
/*获取权益卡管理列表*/
const getEquityCardList = params => {
params.method = 'scrm.api.equity.card.class.list.with.page'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/*新增权益卡*/
const newEquityCard = params => {
params.method = 'scrm.api.equity.card.class.insert'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/*编辑权益卡*/
const editEquityCard = params => {
params.method = 'scrm.api.equity.card.class.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/*权益卡批量生成*/
const generateMemberBatch = params => {
params.method = 'scrm.api.equity.card.batch.generate'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/*权益卡批次分页查询*/
const getEquityCardBatchList = params => {
params.method = 'scrm.api.equity.card.batch.list.with.page'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
// returnAll:true
})
}
/*权益卡领用记录分页查询*/
const getEquityCardCollectionList = params => {
params.method = 'scrm.api.equity.card.list.with.page'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
// returnAll:true
})
}
/*权益卡查询*/
const selectEquityCard = params => {
params.method = 'crm.api.equity.card.class.get.by.id'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/*获取新建门店列表*/
const getMerchantList = params => {
params.method = 'scrm.api.equity.goods.merchant.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/*导出*/
const cardExport = params => {
params.method = 'scrm.api.equity.card.export'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/*获取领用门店列表*/
const getCollectionMerchantList = params => {
params.method = 'scrm.api.equity.card.get.by.merchant.name'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/*获取推广信息*/
const getQrUrl = params => {
params.method = 'scrm.api.equity.card.class.generate.try.url'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default {
getEquityCardList,
newEquityCard,
editEquityCard,
generateMemberBatch,
getEquityCardBatchList,
getEquityCardCollectionList,
selectEquityCard,
getMerchantList,
cardExport,
getCollectionMerchantList,
getQrUrl
}
import { http } from '@/main'
/**获取商品权益列表*/
const getGoodsList = (params = {}) => {
params.method = 'scrm.api.equity.goods.group.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 商品首页展示*/
const goodsDisplay = (params = {}) => {
params.method = 'scrm.api.equity.goods.group.main.page.flag.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**获取商品权益分类列表*/
const getCategoryList = (params = { pageSize: 9999, pageNum: 1 }) => {
params.method = 'scrm.api.equity.goods.category.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 更新商品权益分类*/
const categoryUpdate = params => {
params.method = 'scrm.api.equity.goods.category.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/** 根据id获取商品权益分类*/
const getCategorySelect = params => {
params.method = 'scrm.api.equity.goods.category.get.by.id'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/** 删除商品权益分类*/
const categoryDelete = params => {
params.method = 'scrm.api.equity.goods.category.delete'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/** 新增商品权益分类*/
const createCategory = params => {
params.method = 'scrm.api.equity.goods.category.insert'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/**置顶权益*/
const setTop = params => {
params.method = 'scrm.api.equity.goods.group.set.top'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 修改商品权益上架状态*/
const updateShelves = params => {
params.method = 'scrm.api.equity.goods.group.shelves.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**新增商品权益*/
const createEquity = params => {
params.method = 'scrm.api.equity.goods.group.insert'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**更新商品权益*/
const updateEquity = params => {
params.method = 'scrm.api.equity.goods.group.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
})
}
/** 获取品牌列表*/
const getGoodsBrandList = (params = { supplier: 'HW' }) => {
params.method = 'scrm.api.equity.goods.brand.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/* 获取品牌下商品形态列表*/
const getAppearanceList = (params = {}) => {
params.method = 'scrm.api.equity.goods.appearance.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default {
getGoodsList,
getCategoryList,
categoryUpdate,
getCategorySelect,
categoryDelete,
createCategory,
setTop,
updateShelves,
createEquity,
updateEquity,
getGoodsBrandList,
getAppearanceList,
goodsDisplay
}
import { http } from '@/main'
/**获取财务管理列表*/
const getBalanceList = params => {
params.method = 'scrm.api.equity.order.balance.list.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 获取订单列表*/
const getOrderList = (params = {}) => {
params.method = 'scrm.api.equity.order.list.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 获取海威账户余额*/
const getHwAccount = (params = {}) => {
params.method = 'scrm.api.equity.order.hw.account.balance.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/**获取订单详情 */
const getOrderDetail = params => {
params.method = 'scrm.api.equity.order.detail.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 开启售后状态修改*/
const openRefund = params => {
params.method = 'scrm.api.equity.order.refund.open'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/** 获取售后订单列表*/
const getRefundList = params => {
params.method = 'scrm.api.equity.order.refund.list.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 获取售后详情*/
const getRefundDetail = params => {
params.method = 'scrm.api.equity.order.refund.list.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 获取e代驾订单列表*/
const getEDJOrderList = params => {
params.method = 'scrm.api.equity.edj.order.list'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 分页获取订单列表*/
const getOilOrderList = params => {
params.method = 'scrm.api.equity.oil.order.list.with.page'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**商品分页查询*/
const getGoodsList = params => {
params.method = 'scrm.api.equity.goods.list.with.page'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 商品上架下架/支持批量*/
const goodsShelves = (params = {}) => {
params.method = 'scrm.api.equity.goods.shelves'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**商品删除/支持批量*/
const deleteGoods = (params = {}) => {
params.method = 'scrm.api.equity.goods.delete'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 商品id获取商品信息*/
const getEquityGoodsById = (params = {}) => {
params.method = 'scrm.api.equity.goods.get.by.id'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 第三方商品分页查询*/
const getListWithPageOutGoods = (params = { supplier: 'HW',pageSize: 99999 }) => {
params.method = 'scrm.api.equity.goods.out.list.with.page'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**商品编号获取商品信息(第三方)*/
const getEquityOutGoodsBySupplierProductId = params => {
params.method = 'scrm.api.equity.goods.out.get'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 同渠道商品编码校验*/
const sameGoodsCheck = (params = {}) => {
params.method = 'scrm.api.equity.goods.same.check'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 库存与下架校验*/
const stockAndStatusCheck = (params = {}) => {
params.method = 'scrm.api.equity.goods.stock.status.check'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**商品新增*/
const createGoods = params => {
params.method = 'scrm.api.equity.goods.insert'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/** 商品修改*/
const updateGoods = (params = {}) => {
params.method = 'scrm.api.equity.goods.update'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
/**导出财务列表Excel*/
const exportBalanceList = params => {
params.method = 'scrm.api.equity.order.balance.list.export'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true
})
}
/** 获取渠道下所有品牌 */
const getAllBrandList = (params = { supplier: 'HW',pageNum: 1,pageSize: 9999 }) => {
params.method = 'scrm.api.equity.goods.brand.list.all'
return http({
url: 'router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default {
getBalanceList,
getOrderList,
getHwAccount,
getOrderDetail,
openRefund,
getRefundList,
getRefundDetail,
getEDJOrderList,
getOilOrderList,
getGoodsList,
goodsShelves,
deleteGoods,
getEquityGoodsById,
getListWithPageOutGoods,
getEquityOutGoodsBySupplierProductId,
sameGoodsCheck,
stockAndStatusCheck,
createGoods,
updateGoods,
exportBalanceList,
getAllBrandList
}
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
.left{float:left}.right{float:right}.align-right{text-align:right}
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
* {
margin: 0;
padding: 0;
}
img {
width: 100%;
height: 100%;
}
.layout {
padding-bottom: 20px;
margin: 20px;
}
.layout .search-box {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
.layout .search-box .top {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
margin-bottom: 10px;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
}
.layout .search-box .top .item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-size: 14px;
margin: 0 10px 10px 0;
}
.layout .search-box .bottom {
margin-right: auto;
}
.layout .search-box .top,
.layout .search-box .bottom {
width: 100%;
}
.layout .table-box .table-btn,
.layout .table-box .table-custom {
margin: 20px 0;
position: relative;
}
.layout .table-box .table-btn .table-price-box,
.layout .table-box .table-custom .table-price-box {
position: absolute;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
left: 600px;
display: -ms-grid;
display: grid;
/* -ms-grid-columns: (200px)[4]; */
grid-template-columns: repeat(4, 200px);
text-align: center;
}
.layout .box {
background-color: #fff;
margin: 20px 0;
-webkit-box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
padding: 20px;
}
.layout .box .title {
padding: 20px 0;
font-weight: 700;
}
.layout .box .el-form-item {
width: 500px;
}
.layout .box .el-form-item .el-input-group__prepend,
.layout .box .el-form-item .el-input-group__append {
background-color: transparent;
border: none;
}
.layout .box .el-form-item .el-input--suffix .el-input__inner {
padding-right: 45px;
}
.layout .box .el-form-item .el-input__suffix {
right: 20px;
}
.layout .box .editor {
width: 800px;
}
.layout .box .avatar-uploader {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
width: 148px;
height: 148px;
}
.layout .box .avatar-uploader-file {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
.layout .box .avatar-uploader:hover {
border-color: #409EFF;
}
.layout .box .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
}
.layout .box .avatar {
width: 148px;
height: 148px;
display: block;
}
.layout .box .grid {
display: -ms-grid;
display: grid;
padding: 20px 0;
/* -ms-grid-columns: (1fr)[3]; */
grid-template-columns: repeat(3, 1fr);
}
.layout .box .grid .grid-item .sub-title {
font-weight: 700;
margin-bottom: 10px;
}
.layout .box .grid .grid-item .item {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: start;
-ms-flex-align: start;
align-items: flex-start;
margin-bottom: 10px;
}
.layout .box .grid .grid-item .item .label {
width: 100px;
}
.layout .box .grid .grid-item .item .value {
width: calc(100% - 100px);
}
.layout .box .grid .grid-btn {
margin-top: 40px;
}
.layout .box .flex {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
/*# sourceMappingURL=tao.css.map */
\ No newline at end of file \ No newline at end of file
{
"version": 3,
"mappings": "AAAA,AAAA,CAAC,CAAC;EACA,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;CACX;;AAED,AAAA,GAAG,CAAC;EACF,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;CACb;;AAED,AAAA,OAAO,CAAC;EACN,cAAc,EAAE,IAAI;EACpB,MAAM,EAAE,IAAI;CAkIb;;AApID,AAGE,OAHK,CAGL,WAAW,CAAC;EACV,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;EACnB,cAAc,EAAE,MAAM;EACtB,cAAc,EAAE,IAAI;EACpB,aAAa,EAAE,cAAc;CAoB9B;;AA5BH,AASI,OATG,CAGL,WAAW,CAMT,IAAI,CAAC;EACH,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;EACnB,aAAa,EAAE,IAAI;EACnB,SAAS,EAAE,IAAI;CAOhB;;AApBL,AAcM,OAdC,CAGL,WAAW,CAMT,IAAI,CAKF,KAAK,CAAC;EACJ,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,MAAM;EACnB,SAAS,EAAE,IAAI;EACf,MAAM,EAAE,aAAa;CACtB;;AAnBP,AAqBI,OArBG,CAGL,WAAW,CAkBT,OAAO,CAAC;EACN,YAAY,EAAE,IAAI;CACnB;;AAvBL,AAwBI,OAxBG,CAGL,WAAW,CAqBT,IAAI;AAxBR,OAAO,CAGL,WAAW,CAsBT,OAAO,CAAC;EACN,KAAK,EAAE,IAAI;CACZ;;AA3BL,AA8BI,OA9BG,CA6BL,UAAU,CACR,UAAU;AA9Bd,OAAO,CA6BL,UAAU,CAER,aAAa,CAAC;EACZ,MAAM,EAAE,MAAM;EACd,QAAQ,EAAE,QAAQ;CAUnB;;AA3CL,AAkCM,OAlCC,CA6BL,UAAU,CACR,UAAU,CAIR,gBAAgB;AAlCtB,OAAO,CA6BL,UAAU,CAER,aAAa,CAGX,gBAAgB,CAAC;EACf,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,GAAG;EACR,SAAS,EAAE,gBAAgB;EAC3B,IAAI,EAAE,KAAK;EACX,OAAO,EAAE,IAAI;EACb,qBAAqB,EAAE,gBAAgB;EACvC,UAAU,EAAE,MAAM;CACnB;;AA1CP,AA6CE,OA7CK,CA6CL,IAAI,CAAC;EACH,gBAAgB,EAAE,IAAI;EACtB,MAAM,EAAE,MAAM;EACd,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB;EAC3C,OAAO,EAAE,IAAI;CAkFd;;AAnIH,AAkDI,OAlDG,CA6CL,IAAI,CAKF,MAAM,CAAC;EACL,OAAO,EAAE,MAAM;EACf,WAAW,EAAE,GAAG;CACjB;;AArDL,AAsDI,OAtDG,CA6CL,IAAI,CASF,aAAa,CAAC;EACZ,KAAK,EAAE,KAAK;CAYb;;AAnEL,AAwDM,OAxDC,CA6CL,IAAI,CASF,aAAa,CAEX,wBAAwB;AAxD9B,OAAO,CA6CL,IAAI,CASF,aAAa,CAGX,uBAAuB,CAAC;EACtB,gBAAgB,EAAE,WAAW;EAC7B,MAAM,EAAE,IAAI;CACb;;AA5DP,AA6DM,OA7DC,CA6CL,IAAI,CASF,aAAa,CAOX,iBAAiB,CAAC,gBAAgB,CAAC;EACjC,aAAa,EAAE,IAAI;CACpB;;AA/DP,AAgEM,OAhEC,CA6CL,IAAI,CASF,aAAa,CAUX,iBAAiB,CAAC;EAChB,KAAK,EAAE,IAAI;CACZ;;AAlEP,AAoEI,OApEG,CA6CL,IAAI,CAuBF,OAAO,CAAC;EACN,KAAK,EAAE,KAAK;CACb;;AAtEL,AAuEI,OAvEG,CA6CL,IAAI,CA0BF,gBAAgB,CAAC;EACf,MAAM,EAAE,kBAAkB;EAC1B,aAAa,EAAE,GAAG;EAClB,MAAM,EAAE,OAAO;EACf,QAAQ,EAAE,QAAQ;EAClB,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;CAoBd;;AAjGL,AA8EM,OA9EC,CA6CL,IAAI,CAiCC,qBAAK,CAAC;EACL,QAAQ,EAAE,QAAQ;EAClB,GAAG,EAAE,CAAC;EACN,IAAI,EAAE,CAAC;EACP,KAAK,EAAE,IAAI;EACX,MAAM,EAAE,IAAI;EACZ,OAAO,EAAE,CAAC;CACX;;AArFP,AAsFM,OAtFC,CA6CL,IAAI,CA0BF,gBAAgB,AAeb,MAAM,CAAC;EACN,YAAY,EAAE,OAAO;CACtB;;AAxFP,AAyFM,OAzFC,CA6CL,IAAI,CA4CC,qBAAK,CAAC;EACL,SAAS,EAAE,IAAI;EACf,KAAK,EAAE,OAAO;EACd,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,WAAW,EAAE,KAAK;EAClB,UAAU,EAAE,MAAM;CACnB;;AAhGP,AAkGI,OAlGG,CA6CL,IAAI,CAqDF,OAAO,CAAC;EACN,KAAK,EAAE,KAAK;EACZ,MAAM,EAAE,KAAK;EACb,OAAO,EAAE,KAAK;CACf;;AAtGL,AAuGI,OAvGG,CA6CL,IAAI,CA0DF,KAAK,CAAC;EACJ,OAAO,EAAE,IAAI;EACb,OAAO,EAAE,MAAM;EACf,qBAAqB,EAAE,cAAc;CAqBtC;;AA/HL,AA4GQ,OA5GD,CA6CL,IAAI,CA0DF,KAAK,CAIH,UAAU,CACR,UAAU,CAAC;EACT,WAAW,EAAE,GAAG;EAChB,aAAa,EAAE,IAAI;CACpB;;AA/GT,AAgHQ,OAhHD,CA6CL,IAAI,CA0DF,KAAK,CAIH,UAAU,CAKR,KAAK,CAAC;EACJ,OAAO,EAAE,IAAI;EACb,WAAW,EAAE,UAAU;EACvB,aAAa,EAAE,IAAI;CAOpB;;AA1HT,AAoHU,OApHH,CA6CL,IAAI,CA0DF,KAAK,CAIH,UAAU,CAKR,KAAK,CAIH,MAAM,CAAC;EACL,KAAK,EAAE,KAAK;CACb;;AAtHX,AAuHU,OAvHH,CA6CL,IAAI,CA0DF,KAAK,CAIH,UAAU,CAKR,KAAK,CAOH,MAAM,CAAC;EACL,KAAK,EAAE,kBAAkB;CAC1B;;AAzHX,AA4HM,OA5HC,CA6CL,IAAI,CA0DF,KAAK,CAqBH,SAAS,CAAC;EACR,UAAU,EAAE,IAAI;CACjB;;AA9HP,AAgII,OAhIG,CA6CL,IAAI,CAmFF,KAAK,CAAC;EACJ,OAAO,EAAE,IAAI;CACd",
"sources": [
"tao.scss"
],
"names": [],
"file": "tao.css"
}
\ No newline at end of file \ No newline at end of file
* {
margin: 0;
padding: 0;
}
img {
width: 100%;
height: 100%;
}
.layout {
padding-bottom: 20px;
margin: 20px;
.search-box {
display: flex;
align-items: center;
flex-direction: column;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
.top {
display: flex;
align-items: center;
margin-bottom: 10px;
flex-wrap: wrap;
.item {
display: flex;
align-items: center;
font-size: 14px;
margin: 0 10px 10px 0;
}
}
.bottom {
margin-right: auto;
}
.top,
.bottom {
width: 100%;
}
}
.table-box {
.table-btn,
.table-custom {
margin: 20px 0;
position: relative;
.table-price-box {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 600px;
display: grid;
grid-template-columns: repeat(4, 200px);
text-align: center;
}
}
}
.box {
background-color: #fff;
margin: 20px 0;
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.1);
padding: 20px;
.title {
padding: 20px 0;
font-weight: 700;
}
.el-form-item {
width: 500px;
.el-input-group__prepend,
.el-input-group__append {
background-color: transparent;
border: none;
}
.el-input--suffix .el-input__inner {
padding-right: 45px;
}
.el-input__suffix {
right: 20px;
}
}
.editor {
width: 800px;
}
.avatar-uploader {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
width: 148px;
height: 148px;
&-file {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
}
&:hover {
border-color: #409EFF;
}
&-icon {
font-size: 28px;
color: #8c939d;
width: 148px;
height: 148px;
line-height: 148px;
text-align: center;
}
}
.avatar {
width: 148px;
height: 148px;
display: block;
}
.grid {
display: grid;
padding: 20px 0;
grid-template-columns: repeat(3, 1fr);
.grid-item {
.sub-title {
font-weight: 700;
margin-bottom: 10px;
}
.item {
display: flex;
align-items: flex-start;
margin-bottom: 10px;
.label {
width: 100px;
}
.value {
width: calc(100% - 100px);
}
}
}
.grid-btn {
margin-top: 40px;
}
}
.flex {
display: flex;
}
}
}
\ No newline at end of file \ No newline at end of file
/**
* 根据路由匹配地址
* @param {*} data 路由数据
* @param {*} base 路由前缀
* @param {*} options 粗略的配置项
*/
function routeMatch(data, base, options = { url: 'url', name: 'name', id: 'id', permissions: 'permissions' }) {
if (!Array.isArray(data)) return []
// 主视图路由 正式项目需要区分登陆注册等
/* let userRouter = {
path: "/layout",
name: "layout",
component: () => import('@/views/layout/index.vue'),
redirect: '/index',
children: []
}; */
// 创建路由盒子
let routerBox = []
// 将菜单数据处理为一维函数 如果有多级菜单
// let menu = flattenDeep(data, 'children');
let menu = data
// 遍历处理路由
menu.forEach(item => {
if (!item[options.url]) return
let _url = item[options.url].replace(base, '')
try {
let routerItem = {
path: _url, // 路由路径名
name: item[options.name] || item[options.id], // 命名路由 用于配合菜单简洁跳转
meta: {
purview: item[options.permissions]
}, // 路由元信息 定义路由时即可携带的参数,可用来管理每个路由的按钮操作权限
component: () => import(`@/views${_url}/index.vue`) // 路由映射真实视图路径
}
routerBox.push(routerItem)
} catch (err) {
item[options.url] = '/err-404'
}
})
// 推入需要授权后等异步加载的,非服务端获取的功能性页面
// routerBox.push(...nextRouter);
let errorBox = {
path: '*',
redirect: '/err-404'
}
routerBox.push(errorBox)
return routerBox
}
export default routeMatch
<!-- 表格+分页 -->
<template>
<div class="d2-table">
<el-table
:ref="tableParams.mutiSelectName + 'MutiTable' || 'mutiTable'"
:data="getListApi ? data : tableData"
:row-key="tableParams.mutiSelectUniqueKey || ''"
v-loading="loading"
border
:highlight-current-row="true"
:stripe="true"
@sort-change="sortChange"
@selection-change="handleSelect"
size="medium"
:show-summary="tableParams.showSummary"
:summary-method="tableParams.summaryMethod"
:row-class-name="tableParams.rowClassName"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
type="selection"
width="55"
:reserve-selection="true"
>
</el-table-column>
<el-table-column
v-if="hasNum"
align="center"
width="60px"
label="序号"
type='index'
:index="index=>index+(page.currentPage - 1) * page.pageSize + 1"
></el-table-column>
<template v-for="(item, index) in tableParams.tableColumns">
<el-table-column
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:min-width="item.minWidth"
:align="item.align||'center'"
:sortable="item.sortable"
:render-header="item.renderHeader"
>
<template slot-scope="scope">
<slot
v-if="item.addHtml"
:name="item.addHtml"
:scope="scope.row"
:prop="item.prop"
:width="item.width"
></slot>
<template v-else-if="item.tagLabel">
<el-tag
v-if="!item.tagName"
:type="tableParams.tag.type[scope.row[item.prop]]"
v-text="tableParams.tag.label[scope.row[item.prop]]"
>
</el-tag>
<el-tag
v-else
:type="tableParams[item.tagName].type[scope.row[item.prop]]"
v-text="tableParams[item.tagName].label[scope.row[item.prop]]"
></el-tag>
</template>
<template v-else-if="item.formatter">
<div v-html="item.formatter(scope.row)"></div>
</template>
<template v-else-if="getListApi">
<span v-text="scope.row[item.prop]"></span>
</template>
<template v-else>
<span v-text="tableData[scope.$index][item.prop]"></span>
</template>
<template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span>
</template>
</template>
</el-table-column>
</template>
<el-table-column
v-if="tableParams.tableOption"
label="操作"
:align="tableParams.tableOption.align||'center'"
:width="tableParams.tableOption.width||'200'"
fixed="right"
>
<template slot-scope="scope">
<slot
name="auth-button"
:scope="scope.row"
></slot>
</template>
</el-table-column>
</el-table>
<template v-if="$slots.custom">
<slot name="custom"></slot>
</template>
<el-pagination
v-if="hasPage"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[10,20,30,40]"
:page-size="page.pageSize"
:total="getListApi ? total : tableTotal"
:layout="layout"
>
</el-pagination>
</div>
</template>
<script>
export default {
name: 'd2-table',
data () {
return {
loading: false,
data: [],
// 页码
page: {
pageSize: 10,
// pageNum: 1
currentPage: 1
},
total: 10,
// 排序
sortColum: '',
sort: '',
// 多选数组
mutiSelectArr: {}
}
},
props: {
// 搜索条件
searchForm: {
type: Object,
default: () => { }
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
tableTotal: {
type: Number,
default: 0
},
// 获取列表接口
getListApi: {
type: Function,
default: null
},
// 搜索前操作
beforeSearchFn: {
type: Function,
default: () => {
return new Promise((resolve, reject) => {
resolve()
})
}
},
// 分页,默认有
hasPage: {
type: Boolean,
default: true
},
// 分页组件配置
layout: {
type: String,
default: 'sizes,total,->,prev,pager,next,jumper'
},
// 序号,默认有
hasNum: {
type: Boolean,
default: true
},
tableParams: {
type: Object,
default: () => {
return {
// 多选-判断来自哪个页面
// mutiSelectName: {
// type: String,
// default: ''
// },
// 多选-唯一标识
// mutiSelectUniqueKey: {
// type: String,
// default: ''
// },
// 搜索按钮id;new Date().getTime() + parseInt(Math.random() * 1000)
// btnId: {
// type: String,
// default: ''
// },
// 后端返回列表参数名
listName: {
type: String,
default: ''
},
// 标签-默认标签名为tag;若有多个,那么需要在表格栏的列中加“tagName”
// tag: {
// type: Array,
// default: () => []
// },
// 表格操作,默认没有
// tableOption: {
// type: Object,
// default: null
// },
// 表格栏
tableColumns: {
type: Array,
default: () => []
}
}
}
}
},
mounted () {
const btn = document.getElementById(this.tableParams.btnId)
btn && btn.addEventListener('click', this.refreshEmit)
this.getListApi && this.refreshTable()
},
methods: {
// 排序
sortChange ({ column, prop, order }) {
this.sortColum = order ? prop : ''
this.sort = order
this.refreshTable()
},
// 多选
handleSelect (val) {
this.mutiSelectArr[this.tableParams.mutiSelectName] = val
},
// 清空多选
clearMutiSelect () {
this.mutiSelectArr[this.tableParams.mutiSelectName] = []
this.$refs[this.tableParams.mutiSelectName + 'MutiTable'].clearSelection()
},
// 发布事件,以期查询条件改变后,页面图表需要刷新
refreshEmit () {
this.$emit('searchChange')
this.refreshTable(true, true)
},
refreshTable (clearMuti = true, resetCurrentPage = false, callBack) {
this.beforeSearchFn().then(res => {
// console.log(res)
// 清空多选
clearMuti && this.clearMutiSelect()
this.loading = true
resetCurrentPage && (this.page.currentPage = 1)
var params = {
pageNum: this.page.currentPage,
pageStart: (this.page.currentPage - 1) * this.page.pageSize,
...this.page,
...this.searchForm
}
if (this.sort) {
params.sortColum = this.sortColum
params.sort = this.sort === 'descending' ? 1 : 0
}
Object.keys(params).map(key => {
if (!params[key]) delete params[key]
})
// console.log(params)
this.getListApi(params).then(({ data }) => {
console.log(this.data);
this.data = data[this.tableParams.listName]
this.total = data.total
this.loading = false
if (callBack && typeof callBack == 'function') callBack()
}).catch(() => {
this.loading = false
})
}).catch(() => { })
},
// 每页条数
handleSizeChange (value) {
this.page.pageSize = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
},
// 页码
handleCurrentChange (value) {
this.page.currentPage = value
this.getListApi ? this.refreshTable(false) : this.$emit('refreshTable', this.page)
}
}
}
</script>
<style>
.a-click {
cursor: pointer;
}
.el-table .cell {
line-height: 14px;
white-space: pre-line;
}
.d2-table p {
margin: 10px 0;
}
.test {
width: 50px;
height: 100%;
}
</style>
<template>
<div class="equity-dialog">
<el-dialog
:title=" type == 1?'汽车权益' : '商品权益'"
:visible.sync="show"
:show-close="false"
:close-on-press-escape="false"
:close-on-click-modal="false"
>
<el-form
:model="form"
:rules="rules"
ref="ruleForm"
>
<el-form-item
v-if="type==1"
label="服务提供方"
prop="supplier"
>
<el-select
v-model="form.supplier"
@change="changeSupplier"
>
<el-option
v-for="item in supplierList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<template v-if="type==2">
<el-form-item
label="产品提供方"
prop="supplier"
>
<el-select v-model="form.supplier">
<el-option
label="海威"
value="HW"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="选择品牌"
prop="brandName"
>
<el-select
v-model="form.brandName"
@change="changeBrandName"
filterable
>
<el-option
v-for="item in brandList"
:key="item.brandName"
:value="item.brandName"
:label="item.brandName"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="商品形态"
prop="appearance"
v-if="form.brandName"
>
<el-select v-model="form.appearance">
<el-option
v-for="item in appearanceList"
:key="item.appearance"
:value="item.label"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
</template>
<div class="flex">
<el-form-item
label="权益名称"
prop="equityName"
>
<el-input
v-model="form.equityName"
:maxlength="type==1?8:6"
></el-input>
</el-form-item>
<el-form-item
label="描述"
prop="equityDesc"
>
<el-input
v-model="form.equityDesc"
:maxlength="type==1?8:6"
></el-input>
</el-form-item>
</div>
<div>
<el-form-item
label="图标"
required
prop="equityIcon"
>
<el-upload
action="#"
class="avatar-uploader"
:show-file-list="false"
:before-upload="upLoadImg"
>
<img
v-if="form.equityIcon"
:src="form.equityIcon"
class="avatar"
>
<i
v-else
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</div>
</el-form>
<div
slot="footer"
class="dialog-footer"
>
<el-button @click="close">取 消</el-button>
<el-button
type="primary"
@click="submit(type)"
>确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
const validatorgoodsImage = (rule, value, callback) => {
if (!value) {
callback('请上传图标')
} else {
callback()
}
}
export default {
name: 'equity-dialog',
data () {
return {
form: {
appearance: ''
},
brandList: [],
appearanceList: [],
supplierList: [
{
label: '广联-加油',
value: 'GL_OIL'
},
{
label: '广联-道路救援',
value: 'GL_ROAD_RESCUE'
},
{
label: '广联-轮胎保障',
value: 'GL_TIRE_PROTECTION'
},
{
label: '广联-盗抢无忧',
value: 'GL_ROBBERY_PROTECTION'
},
{
label: '广联-碰撞维修',
value: 'GL_COLLISION_REPAIR'
},
{
label: '广联-整车全损',
value: 'GL_CAR_TOTAL_LOSS'
},
{
label: 'e代驾',
value: 'EDJ'
}
],
rules: {
supplier: [
{ required: true, message: '请选择提供方', trigger: 'change' }
],
brandName: [
{ required: true, message: '请选择品牌', trigger: 'change' }
],
appearance: [
{ required: true, message: '请选择商品形态', trigger: 'change' }
],
equityName: [
{ required: true, message: '请输入权益名称', trigger: 'blur' }
],
equityDesc: [
{ required: true, message: '请输入描述', trigger: 'blur' }
],
equityIcon: [
{ validator: validatorgoodsImage },
],
}
}
},
props: {
show: {
type: Boolean,
default: false
},
type: Number,
isEdit: Boolean,
data: {
type: Object,
default: () => { }
}
},
mounted () {
this.$apis.goodsEquityManageApi.getGoodsBrandList().then(({ data }) => {
this.brandList = data
})
},
watch: {
'isEdit' (n) {
if (n) {
this.form = JSON.parse(JSON.stringify(this.$parent.editData))
if (this.type == 2) {
this.form.appearance = { 1: '卡券', 2: '直充' }[this.$parent.editData.appearance]
}
}
},
},
methods: {
close () {
this.form = {}
this.$emit('update:show', false)
this.$emit('update:isEdit', false)
this.$refs.ruleForm.resetFields()
},
upLoadImg (file) {
let fileName = file.name
if (file.name.lastIndexOf('.') === -1) {
this.$message.info('路径不正确')
return false
}
let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName + '|') === -1) {
this.$message.info('图片格式不正确')
return false
}
// if (fileSize < 3145728) {
if (window.FileReader) {
let reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = (img) => {
console.log(file)
let type = fileName.split('.')[1]
let imgUrl = img.target.result.split(',')[1]
this.$apis.commonApi.upLoadImg({
file: `${type}@${imgUrl}`
}).then(({ code, message, data }) => {
if (code == 0) {
console.log(data);
this.$set(this.form, 'equityIcon', data)
} else {
this.$message.error(message)
}
})
}
}
},
changeSupplier (e) {
console.log(e)
this.supplierList.map(i => {
if (i.value == e) {
this.form.equityName = i.label
}
})
},
getAppearanceList (brandName) {
this.$apis.goodsEquityManageApi.getAppearanceList({ brandName,supplier: 'HW' }).then(({ data }) => {
console.log(data)
data.map(i => i.label = { 1: '卡券', 2: '直充' }[i.appearance])
this.appearanceList = data
this.form.appearance = ''
})
},
changeBrandName (e) {
this.getAppearanceList(e)
},
submit (type) {
console.log(this.form)
let { form, isEdit } = this
let target = type == 1 ? this.$apis.carEquityManageApi : this.$apis.goodsEquityManageApi
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (type == 2) {
this.form.goodsCategoryId = this.$parent.goodsCategoryId
this.form.appearance = form.appearance == '直充' ? 2 : 1
}
let apiName = 'createEquity'
if (isEdit) apiName = 'updateEquity'
target[apiName](this.form).then(({ code, data, message }) => {
if (code == 0) {
this.close()
type == 1 ? this.$parent.getCarList() : this.$parent.getCategoryList()
} else {
this.$message.error(message)
}
})
} else {
return
}
})
}
}
}
</script>
<style scope>
.flex {
display: flex;
align-items: center;
justify-content: space-between;
}
.avatar-uploader {
box-sizing: border-box;
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
width: 80px;
height: 80px;
margin-left: 80px;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
}
.avatar {
width: 80px;
height: 80px;
display: block;
}
</style>
\ No newline at end of file \ No newline at end of file
/**
* type : primary,success,default,error,danger
* size: 按钮大小,参照elementui
* id: 权限判断id
* mode:按钮类型 是a标签还是button,可选值为:button、link
*/
import { Button, Link } from 'element-ui'
// 权限校验
function judgePermissions(options) {
if (!options) {
return false
}
let _list = options.parent.permissions || []
let _o = options.props
let idx = _list.findIndex(k => k == _o.id)
// 如果没有权限,则返回空标签
if (idx < 0) {
return ''
}
if (_o.mode == 'link') {
return 'a'
}
return 'button'
}
// 获取class
function getClass(context) {
let o = context.props
let _class = []
_class.push('el-' + o.mode)
_class.push('el-' + o.mode + '--' + o.type)
if (o.size) {
_class.push('el-' + o.mode + '--' + o.size)
}
if (o.class) {
_class.push(o.class)
}
return _class
}
export default {
functional: true,
props: {
type: {
type: String,
default: 'default'
},
size: {
type: String,
default: 'medium'
},
id: {
type: [String, Number]
},
mode: {
type: String,
default: 'button'
},
class: {
type: String,
default: ''
}
},
render: function(createElement, context) {
let _props = context.props
let options = {
props: _props,
attrs: context.props,
class: getClass(context),
on: {
click: event => {
context.listeners.click('click', event)
}
}
}
return createElement(judgePermissions(context), options, context.children)
}
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-06 10:10:44
* @LastEditors: limin
* @LastEditTime: 2021-09-06 10:11:49
* @FilePath: \scrm\scrm-sub-blog\src\components\index.js
*/
import Vue from 'vue'
// 导入权限按钮
import _button from '@/components/glsx-button/index'
Vue.component('glsx-button', _button)
Vue.component('d2-table', () =>
import ('./d2-table/index.vue'))
Vue.component('equity-dialog', () =>
import ('./equity-dialog/index.vue'))
Vue.component('table-tooltip', () =>
import ('./table-tooltip/index.vue'))
<template>
<div class="table-tooltip">
<el-popover
placement="top"
width="200"
trigger="hover"
:content="content"
>
<el-button
slot="reference"
icon="el-icon-warning"
circle
></el-button>
</el-popover>
</div>
</template>
<script>
export default {
name: 'table-tooltip',
props: {
content: {
type: String,
default: ''
}
},
}
</script>
<style scope>
.table-tooltip {
padding-right: 0 !important;
}
.table-tooltip .el-button {
border: none !important;
}
.table-tooltip .el-button.is-circle {
padding: 0 !important;
}
.table-tooltip .el-button:focus,
.table-tooltip .el-button:hover {
background-color: transparent;
}
.table-tooltip .el-button:focus {
color: initial;
}
</style>
\ 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.NODE_ENV || 'production'
let config = require('./env.' + environment)
module.exports = config
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-06 17:38:28
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
code_message_map: {}
},
request: {
baseURL: 'http://192.168.1.82:7226/rop-scrm-equity',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
module.exports = {
title: 'scrm-sub-blog',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'returnCode',
code_success_value: '0',
code_message_map: {}
},
request: {
baseURL: 'http://192.168.2.106:8083/scrm-wechat',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
app_key: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
/*
* @Descripttion:
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2021-09-07 14:38:52
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:31
* @FilePath: \scrm\scrm-sub-blog\src\main.js
*/
import Vue from 'vue'
import apis from './api'
import './public-path'
import { start } from '@/setup'
//引入富文本css
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
import './utils/util.js'
export default {
data() {
return {
carTableData: [],
carTableParams: {
tableOption: true,
rowClassName: ({ row, rowIndex }) => {
return row.status == 0 ? 'opacity' : ''
},
tableColumns: [{
label: '权益名称',
prop: 'equityName',
minWidth: '200',
},
{
label: '权益描述',
prop: 'equityDesc',
minWidth: '200',
},
{
label: '权益图标\n(80*80,支持JPG、PNG、GIF',
minWidth: '200',
formatter: (cell) => {
return `<img class="equity-icon" src="${cell.equityIcon}" />`
}
},
{
label: '服务提供方',
minWidth: '200',
formatter: (cell) => {
return {
GL_OIL: '广联-加油',
GL_ROAD_RESCUE: '广联-道路救援',
GL_TIRE_PROTECTION: '广联-轮胎保障',
GL_ROBBERY_PROTECTION: '广联-盗抢无忧',
GL_COLLISION_REPAIR: '广联-碰撞维修',
GL_CAR_TOTAL_LOSS: '广联-整车全损',
EDJ: 'e代驾'
}[cell.supplier]
}
},
{
label: '排序展示',
prop: 'mainPageFlag',
minWidth: '200',
addHtml: 'mainPageFlag'
},
]
},
}
},
mounted() {
},
methods: {
/**汽车权益列表 */
getCarList() {
this.$apis.carEquityManageApi.getCarList().then(({ data }) => {
this.carTableData = data.list || []
})
},
}
}
\ No newline at end of file \ No newline at end of file
export default {
data() {
return {
goodsCategoryId: '',
inputValue: '',
tagInputValue: '',
inputVisible: false,
tags: [],
goodsTableData: [],
goodsTableParams: {
rowClassName: ({ row, rowIndex }) => {
return row.status == 0 ? 'opacity' : ''
},
tableOption: true,
tableColumns: [{
label: '权益名称',
prop: 'equityName',
minWidth: '200',
},
{
label: '权益描述',
prop: 'equityDesc',
minWidth: '200',
},
{
label: '权益图标\n(80*80,支持JPG、PNG、GIF)',
minWidth: '200',
formatter: (cell) => {
return `<img class="equity-icon" src="${cell.equityIcon}" />`
}
},
{
label: '品牌名称',
prop: 'brandName',
minWidth: '200',
},
{
label: '产品提供方',
// prop: 'supplier',
minWidth: '200',
formatter: (cell) => {
return '海威'
},
},
{
label: '排序展示',
prop: 'mainPageFlag',
minWidth: '200',
addHtml: 'mainPageFlag'
}
]
}
}
},
mounted() {
},
methods: {
/**获取商品分类列表 */
getCategoryList() {
this.$apis.goodsEquityManageApi.getCategoryList().then(({ data }) => {
let { goodsCategoryId } = this
let { list } = data
let id = ''
if (goodsCategoryId) {
list.map(e => {
e.active = false
if (e.id == goodsCategoryId) {
e.active = true
id = goodsCategoryId
}
})
} else {
list[0].active = true
id = list[0].id
}
this.tags = list || []
this.getGoodsList(id)
this.goodsCategoryId = id
})
},
/**商品权益列表 */
getGoodsList(goodsCategoryId, callBack) {
this.$apis.goodsEquityManageApi.getGoodsList({ goodsCategoryId,pageSize: 9999, pageNum: 1 }).then(({ data }) => {
if (!callBack) {
this.goodsTableData = data.list || []
} else {
return callBack(data.list)
}
})
},
/**切换分类 */
changeGoodsCategory({ id, index }) {
this.tags.map(e => e.active = false)
this.tags[index].active = true
this.getGoodsList(id)
this.goodsCategoryId = id
},
showInput(index, val) {
this.inputValue = val
this.$refs[`tag-input-${index}`][0].$el.classList.add('input-tag-show')
this.$refs[`tag-input-${index}`][0].$refs.input.focus()
},
changeTagName({ id, index }) {
let goodsCategory = this.inputValue
if (!goodsCategory) {
this.$refs[`tag-input-${index}`][0].$el.classList.remove('input-tag-show')
return
}
this.$apis.goodsEquityManageApi.categoryUpdate({ id, goodsCategory }).then(({ code, message }) => {
if (code == 0) {
this.getCategoryList()
} else {
this.$message.error(message)
}
this.$refs[`tag-input-${index}`][0].$el.classList.remove('input-tag-show')
})
},
/**删除分类 */
categoryDelete(id) {
this.getGoodsList(id, res => {
if (res.length) {
this.$message.error('请先删除该分类下的商品权益')
} else {
this.$apis.goodsEquityManageApi.categoryDelete({ id }).then(_res => {
if (_res.code == 0) {
this.getCategoryList()
} else {
this.$message.error(_res.message)
}
})
}
})
},
showAddInput() {
this.inputVisible = true;
this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus()
})
},
handleInputConfirm() {
let inputValue = this.tagInputValue
if (inputValue) {
this.$apis.goodsEquityManageApi.createCategory({ goodsCategory: inputValue }).then(({ code, message }) => {
if (code == 0) {
this.getCategoryList()
} else {
this.$message.error(message)
}
})
}
this.inputVisible = false
this.tagInputValue = ''
}
}
}
\ No newline at end of file \ No newline at end of file
import orderMixin from './orderMixin'
import searchMixin from './searchMixin'
import carMixin from './carMixin'
import goodsMixin from './goodsMixin'
export {
orderMixin,
searchMixin,
goodsMixin,
carMixin
}
\ No newline at end of file \ No newline at end of file
export default {
data() {
return {
statusEnum: {
0: '未支付',
1: '已支付',
2: '待收货',
3: '已完成',
4: '售后中',
5: '退款失败',
6: '已退款',
},
qb_statusEnum: {
3: '充值成功',
6: '充值失败',
2: '充值中'
},
channlList: [{
label: '海威',
value: 'HW'
}],
statusList: [{
label: '待收货',
value: [1, 2]
}, {
label: '已完成',
value: [3]
}, {
label: '已退款',
value: [6]
},
{
label: '售后中',
value: [4]
}
],
appereanceList: [{
label: '卡券',
value: 1
}, {
label: '直充',
value: 2
}],
}
},
watch: {
'date' (n) {
let [orderDateStart, orderDateEnd] = n
console.log(orderDateStart)
this.searchObj.orderDateStart = orderDateStart ? `${orderDateStart} 00:00:00` : ''
this.searchObj.orderDateEnd = orderDateEnd ? `${orderDateEnd} 23:59:59` : ''
}
},
methods: {
handleClick({ name, $parent: { $el } }) {
let { target } = $el.dataset
let orderStatus = name ? name.split(',').map(e => Number(e)) : ''
this.searchObj[target] = orderStatus
this.$nextTick(() => {
this.search()
})
},
jump(query, name) {
console.log('2222222',query)
let parent = name == 'order' ? '/order/detail' : '/sale/detail'
// window.location.href = `./detail.html?orderCode=${orderCode}`
// let target = ['嘀加权益卡管理平台', '运营平台', '权益', parent, '*详情']
// if (window.$config.axios.environment) {
// let arr = name == 'order' ? ['订单管理', '*权益订单详情'] : ['售后管理', '售后详情']
// target = ['权益卡管理平台', '运营平台', 'SCRM权益平台', ...arr]
// }
// console.log(target, { orderCode: query.orderCode })
// this.$root.to(target, { orderCode: query.orderCode })
this.$router.push({ path: parent, query })
},
},
}
\ No newline at end of file \ No newline at end of file
export default {
data() {
return {
date: '',
brandList: [],
searchObj: {},
}
},
mounted() {
this.getGoodsBrandList()
let that = this
document.onkeydown = () => {
let key = window.event.keyCode
if (key == 13) {
that.search()
}
}
},
methods: {
getGoodsBrandList() {
this.$apis.orderApi.getAllBrandList({}).then(({ data }) => {
this.brandList = data
})
},
search(callBack) {
this.$refs.table.refreshTable(true, false, callBack)
},
reset() {
this.date = ''
this.searchObj = {}
this.$nextTick(() => {
this.search()
})
},
},
}
\ No newline at end of file \ No newline at end of file
import VueQuillEditor from 'vue-quill-editor'
import '@/components'
import VueBus from 'vue-bus'
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Dialog, Tabs, TabPane, Table, TableColumn, Pagination, RadioButton, Upload, Image, Loading, InputNumber } from 'element-ui'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
// Vue.use(Button)
// Vue.use(ButtonGroup)
// Vue.use(Form)
// Vue.use(FormItem)
// Vue.use(Input)
// Vue.use(Radio)
// Vue.use(RadioGroup)
// Vue.use(Checkbox)
// Vue.use(CheckboxGroup)
// Vue.use(Switch)
// Vue.use(Select)
// Vue.use(Option)
// Vue.use(TimePicker)
// Vue.use(Col)
// Vue.use(DatePicker)
// Vue.use(Dialog)
// Vue.use(Tabs)
// Vue.use(TabPane)
// Vue.use(Table)
// Vue.use(TableColumn)
// Vue.use(Pagination)
// Vue.use(RadioButton)
// Vue.use(Upload)
Vue.use(GLTable)
Vue.use(VueQuillEditor)
Vue.use(VueBus)
// Vue.use(Image)
// Vue.use(Loading)
// Vue.use(InputNumber)
import ElementUI from 'element-ui'
Vue.use(ElementUI)
export const message = Message
if (window.__POWERED_BY_QIANKUN__) {
// eslint-disable-next-line no-undef
__webpack_public_path__ = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
}
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './routes'
Vue.use(VueRouter)
// 处理重复点击同一个路由报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
// function getRoutes({ name, id, routesData }) {
// const routes = []
// if (routesData && name && id) {
// for (let i = 0, length = routesData.length; i < length; i += 1) {
// const element = routesData[i]
// if (element && element.path && element.path.includes(name) && element.meta && element.meta.id && element.meta.id.startsWith(id)) {
// const path = element.path.slice(name.length + 1)
// element.path = path
// element.component = () => import('@/views' + path + '.vue')
// routes.push(element)
// }
// }
// }
// return routes
// }
function getRoutes(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.path + '.vue') })
return routes
}, [])
}
export { VueRouter, routes, getRoutes }
const staticRoutes = Object.freeze([
{
name: 'Home',
path: '/',
meta: {},
component: resolve => require([`@/views/home/index.vue`], resolve)
},
{
name: 'About',
path: '/about',
component: resolve => require([`@/views/about/index.vue`], resolve),
meta: {}
},
{//领用管理
name: 'Collection',
path: '/collection/index',
component: resolve => require([`@/views/collection/index.vue`], resolve),
meta: {}
},
{//e代驾订单
name: 'EManagement',
path: '/eManagement/index',
component: resolve => require([`@/views/eManagement/index.vue`], resolve),
meta: {}
},
{//财务管理
name: 'Financial',
path: '/financial/index',
component: resolve => require([`@/views/financial/index.vue`], resolve),
meta: {}
},
{//加油订单
name: 'Gas',
path: '/gas/index',
component: resolve => require([`@/views/gas/index.vue`], resolve),
meta: {}
},
{//商品管理
name: 'Goods',
path: '/goods/index',
component: resolve => require([`@/views/goods/index.vue`], resolve),
meta: {}
},
{
name: 'Goods',
path: '/goods/addGoods',
component: resolve => require([`@/views/goods/addGoods.vue`], resolve),
meta: {}
},
{//权益管理
name: 'List',
path: '/list/index',
component: resolve => require([`@/views/list/index.vue`], resolve),
meta: {}
},
{
name: 'Order',
path: '/order/detail',
component: resolve => require([`@/views/order/detail.vue`], resolve),
meta: {}
},
{//订单管理
name: 'Order',
path: '/order/index',
component: resolve => require([`@/views/order/index.vue`], resolve),
meta: {}
},
{//权益卡管理
name: 'RightsCard',
path: '/rightsCard/index',
component: resolve => require([`@/views/rightsCard/index.vue`], resolve),
meta: {}
},
{
name: 'Sale',
path: '/sale/detail',
component: resolve => require([`@/views/sale/detail.vue`], resolve),
meta: {}
},
{//售后管理
name: 'Sale',
path: '/sale/index',
component: resolve => require([`@/views/sale/index.vue`], resolve),
meta: {}
},
])
export default staticRoutes
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:31:52
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:09
* @FilePath: \scrm\scrm-sub-blog\src\setup\index.js
*/
import { bootstrap, mount, unmount } from './qiankun'
import { start } from './single'
export { bootstrap, mount, unmount, start }
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import render from './render'
import 'glsx-components/dist/glsx-components.css'
let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
Vue.use(GLButton,GLTable, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers)
// routes = getRoutes({ name, id, routesData })
routes = getRoutes(routesData)
subscribe({ messenger })
}
export async function mount(props) {
const insts = render(props.routerBase, routes)
router = insts.router
instance = insts.vm
}
export async function unmount() {
instance.$destroy()
instance.$el.innerHTML = ''
instance = null
router = null
}
function subscribe({ messenger }) {
messenger.subscribe(v => {
console.log(`监听到子应用${v.from}发来消息:`, v)
})
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:04:32
* @LastEditors: limin
* @LastEditTime: 2021-09-23 20:34:32
* @FilePath: \scrm\scrm-sub-blog\src\qiankun\render.js
*/
import App from '../App.vue'
import Vue from 'vue'
import store from '@/store'
import { VueRouter } from '@/router'
const render = (base, routes) => {
const router = new VueRouter({
base,
routes,
mode: 'history'
})
const vm = new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
window.vm = vm
return { router, vm }
}
export default render
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-09-23 19:02:23
* @LastEditors: limin
* @LastEditTime: 2021-09-24 10:41:17
* @FilePath: \scrm\scrm-sub-blog\src\setup\single.js
*/
import Vue from 'vue'
import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton,GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
import 'glsx-components/dist/glsx-components.css'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: '1112223333444' } })
Vue.use(GLButton,GLTable, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
}
/*
* @Descripttion:
* @version: 1.0.0
* @Author: limin
* @Date: 2021-08-13 14:12:11
* @LastEditors: limin
* @LastEditTime: 2021-08-25 14:14:44
* @FilePath: \scrm\scrm-base\src\store\index.js
*/
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const modulesFiles = require.context('./modules', true, /\.js$/)
const modules = modulesFiles.keys().reduce(
(result, modulePath) => {
const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1')
const value = modulesFiles(modulePath)
result.getters[moduleName] = state => state[moduleName]
result.modules[moduleName] = value.default
return result
},
{ modules: {}, getters: {} }
)
const store = new Vuex.Store(modules)
export default store
export default {
namespaced: true,
state: {
size: 10, // 分页 页大小
token: ''
},
mutations: {
// 设置分页大小
SET_PAGE_SIZE(state, data) {
state.size = data
},
// 设置token
SET_TOKEN(state, data) {
state.token = data
}
},
actions: {
// 设置分页大小
setPageSize({ commit }, data) {
commit('SET_PAGE_SIZE', data)
},
// 设置token
setToken({ commit }, data) {
commit('SET_TOKEN', data)
}
}
}
export default {
namespaced: true,
state: {},
mutations: {},
actions: {}
}
/**
* 日期格式化
* 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 getParams = (str = window.location.href) => {
let params = str.split('?')
if (params.length < 2) return {}
let param = params[1].split('&')
let obj = {}
for (let i = 0; i < param.length; i++) {
let paramsA = param[i].split('=')
let key = paramsA[0]
let value = paramsA[1]
obj[key] = value
}
return obj
}
/**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow
}
import Vue from 'vue'
const utils = {
getParams,
decimal
}
Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key]
})
\ No newline at end of file \ No newline at end of file
<template>
<div class="report-about">
<h4>穿梭框1</h4>
<h4 class="align-center">
<label>请打开f12查看移动数据</label>
<el-button size="medium" type="info" @click="changeMode">当前模式:{{ mode }}</el-button>
<el-button size="medium" @click="clearChecked()">清除选中</el-button>
</h4>
<div class="box">
<!-- lazy -->
<!-- :lazyFn="lazyFn" -->
<tree-transfer ref="wl-tree-transfer" filter high-light default-transfer :mode="mode" :title="title" :to_data="toData" :from_data="fromData" :filterNode="filterNode" :defaultProps="defaultProps" :defaultCheckedKeys="defaultCheckedKeys" :defaultExpandedKeys="[2, 3]" @right-check-change="rightCheckChange" @left-check-change="leftCheckChange" @removeBtn="remove" @addBtn="add" height="540px" node_key="id">
<span slot="title-right" class="my-title-right" @click="handleTitleRight">自定义内容</span>
</tree-transfer>
</div>
</div>
</template>
<script>
import treeTransfer from 'el-tree-transfer'
export default {
name: 'App',
components: { treeTransfer },
data() {
return {
mode: 'transfer', // transfer addressList
defaultProps: { label: 'name', children: 'children' },
fromData: [
{
id: 1,
pid: 0,
name: '测试左侧',
children: [
{
id: 2,
pid: 1,
name: '水电费是打发斯蒂芬斯蒂芬gas噶水电费噶地方死光光',
disabled: true,
children: []
},
{
id: 3,
pid: 1,
name: '11-3',
children: []
},
{
id: 4,
pid: 1,
name: '11-4',
children: [
{
id: 5,
pid: 4,
name: '11-5',
children: [
{
id: 111,
pid: 5,
name: '11-111'
}
]
},
{
id: 6,
pid: 4,
name: '11-6',
children: []
}
]
}
]
},
{
id: 7127,
pid: 0,
name: 'debug',
children: [
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
]
}
], // 穿梭框 - 源数据 - 树形
toData: [],
fromArray: [
{
id: '1',
name: '1',
pid: '0'
},
{
id: '2',
name: '2',
pid: '0'
},
{
id: '1-1',
name: '1-1',
pid: '1'
},
{
id: '1-2',
name: '1-2',
pid: '1'
},
{
id: '1-1-1',
name: '1-1-1',
pid: '1-1'
},
{
id: '1-1-1-1',
name: '1-1-1-1',
pid: '1-1-1'
},
{
id: '2-1',
name: '2-1',
pid: '2'
},
{
id: '2-2',
name: '2-2',
pid: '2'
}
],
toArray: [],
defaultCheckedKeys: [] // 左侧默认选中数据
}
},
created() {},
mounted() {
this.$apis.demo.GETLISTDEVICEFILEUNSTOCK({ k: 2, kdj: 5 }).then(res => {})
// 测试延迟默认选中
setTimeout(() => {
this.defaultCheckedKeys = [1]
}, 1000)
},
methods: {
// 清除选中
clearChecked() {
this.$refs['wl-tree-transfer'].clearChecked()
},
// 自定义筛选函数
filterNode(value, data, where) {
console.log(value, data, where)
if (!value) return true
return data[this.defaultProps.label].indexOf(value) !== -1
},
// 懒加载回调
lazyFn(node, resolve) {
setTimeout(() => {
resolve([
{
id: 71272,
pid: 7127,
name: 'debug22',
// disabled: true,
children: []
},
{
id: 71273,
pid: 7127,
name: 'debug11',
children: []
}
])
}, 500)
},
// 切换模式 现有树形穿梭框模式transfer 和通讯录模式addressList
changeMode() {
if (this.mode == 'transfer') {
this.mode = 'addressList'
} else {
this.mode = 'transfer'
}
},
// 添加按钮
add(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 移除按钮
remove(fromData, toData, obj) {
// 树形穿梭框模式transfer时,返回参数为左侧树移动后数据、右侧树移动后数据、移动的{keys,nodes,halfKeys,halfNodes}对象
// 通讯录模式addressList时,返回参数为右侧收件人列表、右侧抄送人列表、右侧密送人列表
console.log('fromData:', fromData)
console.log('toData:', toData)
console.log('obj:', obj)
},
// 左侧源数据选中事件
leftCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 右侧目标数据选中事件
rightCheckChange(nodeObj, treeObj, checkAll) {
console.log(nodeObj)
console.log(treeObj)
console.log(checkAll)
},
// 自定义节点 仅树形结构支持
renderContent(h, { node, data }) {
return (
<span class="custom-tree-node">
<span>{node.label}</span>
<span>
<el-button size="mini" type="text" on-click={() => this.append(data)}>
Append
</el-button>
<el-button size="mini" type="text" on-click={() => this.remove(node, data)}>
Delete
</el-button>
</span>
</span>
)
},
// 标题自定义区点击事件
handleTitleRight() {
alert('标题自定义区点击事件')
}
},
computed: {
title() {
if (this.mode == 'transfer') {
return ['源列表', '目标列表']
} else {
return ['通讯录', '收件人', '抄送人', '密送人']
}
}
}
}
</script>
<style>
.align-center {
text-align: center;
}
.box {
width: 600px;
margin: 0 auto;
text-align: left;
}
.btn {
border: 1px solid #ebeef5;
padding: 5px 10px;
background-color: #f5f7fa;
outline: none;
}
.my-title-right {
float: right;
font-size: 12px;
cursor: pointer;
}
</style>
<template>
<div class="layout">
<div class="search-box">
<div class="top">
<div class="item">
日期:
<el-date-picker v-model="date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" value-format="yyyy-MM-dd"></el-date-picker>
</div>
<div class="item">
订单号:
<div class="input">
<el-input v-model="searchObj.orderId" placeholder="" size="small"></el-input>
</div>
</div>
<div class="item">
用户信息:
<div class="input">
<el-input v-model="searchObj.phone" placeholder="" size="small"></el-input>
</div>
</div>
<div class="item">
订单状态:
<el-select v-model="searchObj.orderStatus" placeholder="请选择">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item">
<el-button-group>
<el-button type="primary" @click="search">查询</el-button>
<el-button type="default" @click="reset">重置</el-button>
</el-button-group>
</div>
</div>
</div>
<div class="table-box">
<d2-table v-if="flag" ref="table" :searchForm="searchObj" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false"></d2-table>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
function date_format(date) {
var date2 = new Date(date)
var YY = date2.getFullYear() + '-'
var MM = (date2.getMonth() + 1 < 10 ? '0' + (date2.getMonth() + 1) : date2.getMonth() + 1) + '-'
var DD = date2.getDate() < 10 ? '0' + date2.getDate() : date2.getDate()
var hh = (date2.getHours() < 10 ? '0' + date2.getHours() : date2.getHours()) + ':'
var mm = (date2.getMinutes() < 10 ? '0' + date2.getMinutes() : date2.getMinutes()) + ':'
var ss = date2.getSeconds() < 10 ? '0' + date2.getSeconds() : date2.getSeconds()
return YY + MM + DD + ' ' + hh + mm + ss
}
import { searchMixin } from '@/mixins'
export default {
name: '',
mixins: [searchMixin],
data() {
return {
date_format,
flag: true,
statusList: [
{
label: '已结算',
value: '0'
},
{
label: '待结算',
value: '1'
},
{
label: '已失效',
value: '2'
}
],
tableParams: {
listName: 'list',
getListApi: this.$apis.orderApi.getEDJOrderList,
tableColumns: [
{
label: '日期',
minWidth: '200',
formatter: cell => {
return this.date_format(cell.callTime)
}
},
{
label: '用户信息',
prop: 'phone',
minWidth: '200'
},
{
label: '订单里程',
minWidth: '200',
formatter: cell => {
return `${cell.distance}km`
}
},
{
label: '实付金额',
prop: 'price',
minWidth: '200'
},
{
label: '订单总额',
prop: 'income',
minWidth: '200'
},
{
label: '订单号',
prop: 'orderId',
minWidth: '200'
},
{
label: '司机工号',
prop: 'driverId',
minWidth: '200'
},
{
label: '订单状态',
prop: 'status',
formatter: cell => {
return ['已结算', '待结算', '已失效'][cell.orderStatus]
},
minWidth: '200'
}
]
}
}
},
watch: {
date(n) {
let [callDateStart, callDateEnd] = n
this.searchObj.callDateStart = callDateStart || ''
this.searchObj.callDateEnd = callDateEnd || ''
}
},
mounted() {},
methods: {}
}
</script>
<style src="@a/css/tao.css"></style>
<template>
<div class="layout">
<div class="search-box">
<div class="top">
<div class="item">
日期:
<el-date-picker
v-model="date"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
size="small"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<div class="item">
品牌名称:
<div class="input">
<el-select
v-model="searchObj.brandName"
filterable
size="small"
placeholder="请选择"
>
<el-option
v-for="item in brandList"
:key="item.brandId"
:label="item.brandName"
:value="item.brandName"
>
</el-option>
</el-select>
</div>
</div>
<div class="item">
商品名称:
<div class="input">
<el-input
v-model="searchObj.productName"
placeholder=""
size="small"
></el-input>
</div>
</div>
<div class="item">
商品形态:
<el-select
v-model="searchObj.appereance"
placeholder="请选择"
>
<el-option
v-for="item in appereanceList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<!-- <div class="item">
渠道:
<el-select
v-model="searchObj.channl"
placeholder="请选择"
>
<el-option
v-for="item in channlList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div> -->
<div class="item">
门店名称:
<div class="input">
<el-input
v-model="searchObj.merchantName"
placeholder=""
size="small"
></el-input>
</div>
</div>
<div class="item">
订单状态:
<el-select
v-model="searchObj.orderStatus"
placeholder="请选择"
>
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</div>
<div class="bottom">
<el-button-group>
<el-button
type="primary"
@click="search"
>查询</el-button>
<el-button
type="default"
@click="reset"
>重置</el-button>
</el-button-group>
</div>
</div>
<div class="table-box">
<div class="table-btn">
账户余额:{{price}}元
<el-button
type="primary"
@click="getHwAccount"
>刷新余额</el-button>
</div>
<d2-table
v-if="flag"
ref="table"
:searchForm="searchObj"
:tableParams="tableParams"
:getListApi="tableParams.getListApi"
:hasNum="false"
>
<template slot='custom'>
<div class="table-custom">
<el-button
type="primary"
@click="exportExcel"
>导出</el-button>
</div>
</template>
</d2-table>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { orderMixin, searchMixin } from '@/mixins'
export default {
name: '',
mixins: [orderMixin, searchMixin],
data () {
return {
flag: true,
price: 0,
tableParams: {
listName: 'list',
showSummary: true,
getListApi: this.$apis.orderApi.getBalanceList,
summaryMethod ({ columns, data }) {
let sums = []
columns.forEach((column, index) => {
if (index == 0) {
sums[index] = '合计'
return
}
const values = data.map(item => {
if (column.property == 'costPrices' || column.property == 'orderPrices' || column.property == 'discount') {
return Number(item[column.property])
}
return NaN
})
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0);
sums[index] = `${this.decimal(sums[index], 2).toFixed(2)}元`
} else {
sums[index] = ''
}
})
return sums
},
tableColumns: [
{
label: '订单编号',
prop: 'orderCode',
minWidth: '200'
},
{
label: '品牌名称',
prop: 'brandName',
minWidth: '200',
},
{
label: '商品形态',
prop: 'appearanceDesc',
minWidth: '100',
},
{
label: '商品名称',
minWidth: '200',
formatter (cell) {
return cell.appearance == 2 ? `${cell.productName}${cell.denomination}` : cell.productName
}
},
{
label: '订单成本金额',
prop: 'costPrices',
minWidth: '200',
},
{
label: '订单支付金额',
prop: 'orderPrices',
minWidth: '200'
},
{
label: '销售差额',
prop: 'discount',
minWidth: '200',
},
{
label: '下单渠道',
minWidth: '200',
formatter (cell) {
return `${cell.merchantName || ''}${cell.merchantName ? '-' : ''}${cell.channelName}`
}
},
{
label: '订单状态',
minWidth: '200',
formatter: (cell)=>{
return cell.appearance == 1 ? this.statusEnum[cell.orderStatus] : this.qb_statusEnum[cell.orderStatus]
}
},
{
label: '下单时间',
prop: 'orderDate',
minWidth: '200',
formatter (cell) {
return cell.orderDate ? new Date(cell.orderDate).format('yyyy-MM-dd hh:mm:ss') : '- -'
}
},
]
}
}
},
mounted () {
this.getHwAccount()
},
methods: {
getHwAccount () {
this.$apis.orderApi.getHwAccount().then(({ code, data }) => {
if (code == 0) {
this.price = data
}
})
},
exportExcel () {
this.$apis.orderApi.exportBalanceList(this.searchObj).then(({ code, data, message }) => {
if (code == 0) {
let a = document.createElement('a')
a.setAttribute('href', data)
a.setAttribute('target', '_blank')
a.setAttribute("download", '权益订单统计数据.xlsx')
a.click()
} else {
this.$message.error(message)
}
})
}
}
}
</script>
<style src="@a/css/tao.css"></style>
<template>
<div class="layout">
<div class="search-box">
<div class="top">
<div class="item">
加油日期:
<el-date-picker
v-model="date"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
size="small"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</div>
<div class="item">
加油供应商:
<el-select :value="'团油'">
<el-option
label="团油"
value="团油"
>
</el-option>
</el-select>
</div>
<div class="item">
供应商订单号:
<div class="input">
<el-input
v-model="searchObj.orderId"
placeholder=""
size="small"
></el-input>
</div>
</div>
<div class="item">
加油用户:
<div class="input">
<el-input
v-model="searchObj.phone"
placeholder=""
size="small"
></el-input>
</div>
</div>
<div class="item">
订单状态:
<el-select
v-model="searchObj.orderStatus"
placeholder="请选择"
>
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</div>
<div class="bottom">
<el-button-group>
<el-button
type="primary"
@click="search"
>查询</el-button>
<el-button
type="default"
@click="reset"
>重置</el-button>
</el-button-group>
</div>
</div>
<div class="table-box">
<d2-table
v-if="flag"
ref="table"
:searchForm="searchObj"
:tableParams="tableParams"
:getListApi="tableParams.getListApi"
:hasNum="false"
>
</d2-table>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { searchMixin } from '@/mixins'
export default {
name: '',
mixins: [searchMixin],
data () {
return {
flag: true,
statusList: [{
label: '已支付',
value: 1
}, {
label: '退款申请中',
value: 4
}, {
label: '已退款',
value: 5
}, {
label: '退款失败',
value: 6
}],
tableParams: {
listName: 'list',
getListApi: this.$apis.orderApi.getOilOrderList,
tableColumns: [
{
label: '加油时间',
prop: 'orderTime',
minWidth: '200',
},
{
label: '供应商',
minWidth: '200',
formatter: (cell) => {
return '团油'
}
},
{
label: '加油油站',
prop: 'gasName',
minWidth: '200',
},
{
label: '油号',
minWidth: '200',
prop: 'oilName'
},
{
label: '加油升数(L)',
prop: 'litre',
minWidth: '200'
},
{
label: '实付金额',
prop: 'amountPay',
minWidth: '200',
},
{
label: '订单总额',
prop: 'amountGun',
minWidth: '200',
},
{
label: '优惠金额',
prop: 'amountDiscounts',
minWidth: '200',
},
{
label: '订单状态',
prop: 'orderStatusName',
minWidth: '200'
},
{
label: '用户信息',
prop: 'phone',
minWidth: '200',
},
{
label: '供应商订单号',
prop: 'orderId',
minWidth: '200',
},
]
}
}
},
watch: {
'date' (n) {
let [beginTime, endTime] = n
this.searchObj.beginTime = beginTime || ''
this.searchObj.endTime = endTime || ''
}
},
mounted () {
},
methods: {
}
}
</script>
<style src="@a/css/tao.css/"></style>
<style >
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="layout">
<div class="search-box">
<div class="top">
<div class="item">
商品名称:
<div class="input">
<el-input v-model="searchObj.productName" placeholder="" size="small"></el-input>
</div>
</div>
<div class="item">
商品ID:
<div class="input">
<el-input v-model="searchObj.id" placeholder="" size="small"></el-input>
</div>
</div>
<div class="item">
商品编码:
<div class="input">
<el-input v-model="searchObj.productId" placeholder="" size="small"></el-input>
</div>
</div>
<div class="item">
提供方:
<el-select v-model="searchObj.supplier">
<el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item">
商品状态:
<el-select v-model="searchObj.status">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item">
品牌名称:
<el-select v-model="searchObj.brandName" filterable>
<el-option v-for="item in goodsBrandList" :key="item.id" :label="item.brandName" :value="item.brandName"></el-option>
</el-select>
</div>
</div>
<div class="bottom">
<el-button-group>
<el-button type="primary" @click="search">查询</el-button>
<el-button type="default" @click="reset">重置</el-button>
</el-button-group>
</div>
</div>
<div class="table-box">
<div class="table-btn">
<el-button type="primary" @click="jump">新增商品</el-button>
</div>
<d2-table v-if="flag" ref="table" :searchForm="searchObj" :tableParams="tableParams" :getListApi="tableParams.getListApi">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope)">编辑</el-button>
<el-button type="text" @click="copy(scope.scope)">复制</el-button>
</span>
<template slot="custom">
<div class="table-custom">
<el-button-group>
<el-button type="primary" @click="toggleAll">全选</el-button>
<el-button type="primary" @click="batchOperation(1)">上架</el-button>
<el-button type="primary" @click="batchOperation(2)">下架</el-button>
<el-button type="primary" @click="batchOperation(-1)">删除</el-button>
</el-button-group>
</div>
</template>
</d2-table>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { searchMixin } from '@/mixins'
export default {
name: '',
mixins: [searchMixin],
data() {
return {
flag: true,
supplierList: [
{
label: '海威',
value: 'HW'
}
],
statusList: [
{
label: '上架',
value: '1'
},
{
label: '下架',
value: '2'
},
{
label: '待上架',
value: '0'
}
],
tableParams: {
listName: 'list',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: true,
getListApi: this.$apis.orderApi.getGoodsList,
tableColumns: [
{
label: '提供方',
minWidth: '200',
formatter: cell => {
return '海威'
}
},
{
label: '商品SKU',
minWidth: '200',
formatter: cell => {
return cell.appearance == 1 ? `${cell.brandName || ''}${cell.productName || ''}` : `<div>${cell.brandName || ''}${cell.productName || ''}</div><div>${cell.denomination || ''}</div>`
}
},
{
label: '会员价(元)',
prop: 'salesPrice',
minWidth: '200'
},
{
prop: 'sales',
minWidth: '200',
sortable: true,
renderHeader: h => {
return h('div', { class: 'table-header' }, [
h('span', '销量'),
h('table-tooltip', {
props: { content: '该商品的历史总销量,订单发生退款、换货历史销量均不变' }
})
])
}
},
{
label: '库存',
minWidth: '200',
sortable: true,
formatter: cell => {
return cell.stock == -1 ? '无限制' : cell.stock
}
},
{
label: '商品状态',
minWidth: '200',
formatter: cell => {
return ['待上架', '上架', '下架'][cell.status]
}
}
]
},
goodsBrandList: [],
selectStatus: false
}
},
mounted() {
this.getAllBrandList()
},
methods: {
getAllBrandList() {
this.$apis.orderApi.getAllBrandList().then(res => {
console.log(res)
this.goodsBrandList = res.data || []
})
},
jump({ id, status }) {
// let params = {}
// if (id) params.id = id
// if (status == 0) params.edit = true
// let target = ['嘀加权益卡管理平台', '运营平台', '权益', '商品管理', '*商品']
// if (window.$config.axios.environment) {
// target = ['权益卡管理平台', '运营平台', 'SCRM权益平台', '商品管理', '*商品详情']
// }
// console.log(target)
let query = {}
if (id) query.id = id
if (status == 0) query.edit = true
this.$router.push({ path: '/goods/addGoods', query })
},
copy({ id }) {
this.$apis.orderApi.getEquityGoodsById({ id }).then(({ code, data, message }) => {
if (code == 0) {
this.$apis.orderApi.createGoods(data).then(res => {
console.log(res)
if (res.code == 0) {
this.$message({
message: '复制成功!',
type: 'success'
})
this.search(() => {
let [target] = this.$refs.table.data
this.jump(target)
})
} else {
this.$message.error(res.message)
}
})
} else {
this.$message.error(message)
}
})
},
toggleAll() {
let { goodsIndexMutiTable } = this.$refs.table.$refs
let { data } = goodsIndexMutiTable
this.selectStatus = !this.selectStatus
data.map(row => {
goodsIndexMutiTable.toggleRowSelection(row, this.selectStatus)
})
},
// ['待上架', '上架', '下架'] //
batchOperation(status) {
let { goodsIndexMutiTable } = this.$refs.table.$refs
let { selection } = goodsIndexMutiTable
if (!selection.length) return
let ids = []
try {
selection.map(e => {
if (status == 1) {
if (e.status == 1) throw '仅能上架待上架和下架商品'
} else if (status == 2) {
if (e.status != 1) throw '仅能下架上架商品'
} else if (status == -1) {
if (e.status != 0) throw '仅能删除待上架商品'
}
ids.push(e.id)
})
} catch (error) {
this.$message.error(error)
return
}
let content = {
'-1': '是否批量删除',
1: '是否批量上架',
2: '是否批量下架'
}
this.$confirm(content[status], '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning',
center: true
})
.then(() => {
let target = 'deleteGoods'
let params = { ids }
if (status != -1) {
target = 'goodsShelves'
params.status = status
}
this.$apis.orderApi[target](params).then(({ code, message }) => {
if (code == 0) {
this.$message({
message: '操作成功!',
type: 'success'
})
this.search()
} else {
this.$message.error(message)
}
})
})
.catch(() => {})
}
}
}
</script>
<style src="@a/css/tao.css"></style>
<style >
.table-header {
display: inline-flex !important;
align-items: center;
justify-content: center;
padding: 0 !important;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="report-home">
HOME
<glsx-button type="danger" @click="test()" class="test555" id="1211" mode="link">权限按钮测试</glsx-button>
<glsx-button type="success" size="small" @click="test()" id="1211" class="test">权限按钮测试2</glsx-button>
<el-button class="test" @click="test()">东方网分</el-button>
</div>
</template>
<script>
export default {
name: 'home',
methods: {
test() {
console.log('点击了按钮')
this.$messenger.send({ message: { from: 11, message: '11111' } })
}
}
}
</script>
<template>
<div class="report-home">
<h2>
子应用2
</h2>
<div id="nav">
<el-button-group class="right">
<el-button type="primary" size="medium" @click="routerChange('/about')">应用内跳转</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-1-1')">子应用1-ui测试-组件测试</el-button>
<el-button type="primary" size="medium" @click="toAppReport('1-2')">子应用1-关于子应用</el-button>
<el-button type="primary" size="medium" @click="toAppReport({ path: 'sub01/changeData' })">不存在的路由</el-button>
</el-button-group>
</div>
<div class="parent-child-communication">
<h3>父子应用通信:</h3>
<div style="margin-bottom: 20px;">
<el-button class="right" type="primary" size="medium" @click="callParentChange()">给登录用户改个名</el-button>
</div>
<img src="../assets/logo.png" alt="" srcset="" />
</div>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
<div>31</div>
<div>32</div>
<div>33</div>
<div>34</div>
<div>35</div>
<div>36</div>
<div>37</div>
<div>38</div>
<div>39</div>
<div>40</div>
<div>41</div>
<div>42</div>
<div>43</div>
<div>44</div>
<div>45</div>
<div>46</div>
<div>47</div>
<div>48</div>
<div>49</div>
<div>50</div>
<div>51</div>
<div>52</div>
<div>53</div>
<div>54</div>
<div>55</div>
<div>56</div>
<div>57</div>
<div>58</div>
<div>59</div>
<div>60</div>
<div>61</div>
<div>62</div>
<div>63</div>
<div>64</div>
<div>65</div>
<div>66</div>
<div>67</div>
<div>68</div>
<div>69</div>
<div>70</div>
<div>71</div>
<div>72</div>
<div>73</div>
<div>74</div>
<div>75</div>
<div>76</div>
<div>77</div>
<div>78</div>
<div>79</div>
<div>80</div>
<div>81</div>
<div>82</div>
<div>83</div>
<div>84</div>
<div>85</div>
<div>86</div>
<div>87</div>
<div>88</div>
<div>89</div>
<div>90</div>
<div>91</div>
<div>92</div>
<div>93</div>
<div>94</div>
<div>95</div>
<div>96</div>
<div>97</div>
<div>98</div>
<div>99</div>
<div>100</div>
</div>
</template>
<script>
export default {
name: 'report-home',
data() {
return {}
},
methods: {
/**
* 路由切换
* url 路由地址
*/
routerChange(url) {
this.$router.push(url).catch(err => {
console.log(err)
})
},
/**
* 外部路由跳转
* this.$history.push(menu)
* menu 支持:1.string 视为id (每一个路由都有一个唯一id)
* 2.对象 {path:'sub1/home',id:'1-1-1'} 以id为准 跳转对应模块
* 3.对象 {path:'sub1/home'} 以path为准 跳转对应模块
* 以上三种情况都跳转到对应的模块
*/
toAppReport(menu) {
this.$history.push(menu)
},
callParentChange() {
this.$messenger.send({
userInfo: { name: '张三,来自子系统2' }
})
}
}
}
</script>
<style lang="scss">
.parent-child-communication {
padding: 20px 0;
line-height: 36px;
}
</style>
<template>
<div class="layout">
<div class="box">
<div class="equity-title">汽车权益</div>
<div class="add-box">
<el-button type="primary" @click="addEquity(1)">添加</el-button>
</div>
<div class="table-box">
<d2-table ref="carTable" :tableParams="carTableParams" :tableData="carTableData" :hasPage="false" :hasNum="false">
<div slot="mainPageFlag" slot-scope="scope">
<el-button type="text" @click="carsDisplay(scope.scope)">{{ scope.scope.mainPageFlag == 1 ? '取消首页展示' : '首页展示' }}</el-button>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="editEquity(scope.scope, 1)">编辑</el-button>
<el-button type="text" @click="updateShelves(scope.scope, 'car')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</el-button>
<el-button type="text" @click="setTop(scope.scope.id, 'car')">置顶</el-button>
</span>
</d2-table>
</div>
</div>
<div class="box">
<div class="equity-title">商品权益</div>
<div class="tags-box">
<template v-for="(item, index) in tags">
<el-tag :key="index" effect="dark" :type="item.active ? '' : 'info'" @click.native="changeGoodsCategory({ id: item.id, index })" :ref="`tag-${index}`" @dblclick.native="showInput(index, item.goodsCategory)">
<i class="del el-icon-error" @click.stop="categoryDelete(item.id)"></i>
{{ item.goodsCategory }}
<el-input class="input-tag" v-model="inputValue" :ref="`tag-input-${index}`" size="small" @keyup.enter.native="changeTagName({ id: item.id, index })" @blur="changeTagName({ id: item.id, index })"></el-input>
</el-tag>
</template>
<el-input class="input-new-tag" v-if="inputVisible" v-model="tagInputValue" ref="saveTagInput" size="small" @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm" maxlength="8"></el-input>
<el-button class="addTag" size="small" @click="showAddInput" v-else>添加分类</el-button>
</div>
<div class="add-box">
<el-button type="primary" @click="addEquity(2)">添加</el-button>
</div>
<div class="table-box">
<d2-table ref="carTable" :tableParams="goodsTableParams" :tableData="goodsTableData" :hasPage="false" :hasNum="false">
<div slot="mainPageFlag" slot-scope="scope">
<el-button type="text" @click="goodsDisplay(scope.scope)">{{ scope.scope.mainPageFlag == 1 ? '取消首页展示' : '首页展示' }}</el-button>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="updateShelves(scope.scope, 'goods')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</el-button>
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="updateShelves(scope.scope, 'goods')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</el-button>
<el-button type="text" @click="setTop(scope.scope.id, 'goods')">置顶</el-button>
</span>
</d2-table>
</div>
</div>
<equity-dialog :show.sync="showDialog" :type="dialogType" :isEdit.sync="isEdit"></equity-dialog>
</div>
</template>
<script type='text/ecmascript-6'>
import { goodsMixin, carMixin } from '@/mixins'
export default {
name: '',
mixins: [carMixin, goodsMixin],
data() {
return {
showDialog: false,
isEdit: false,
dialogType: 1,
editData: {}
}
},
mounted() {
this.init()
},
methods: {
/*更改汽车展示状态 */
carsDisplay(row) {
if (row.mainPageFlag == 0) {
this.$apis.carEquityManageApi.cardsDisplay({ id: row.id, mainPageFlag: 1 }).then(res => {
this.getCarList()
})
} else {
this.$apis.carEquityManageApi.cardsDisplay({ id: row.id, mainPageFlag: 0 }).then(res => {
this.getCarList()
})
}
},
/*改变商品展示状态 */
goodsDisplay(row) {
if (row.mainPageFlag == 0) {
this.$apis.goodsEquityManageApi.goodsDisplay({ id: row.id, mainPageFlag: 1 }).then(res => {
this.getCategoryList()
})
} else {
this.$apis.goodsEquityManageApi.goodsDisplay({ id: row.id, mainPageFlag: 0 }).then(res => {
this.getCategoryList()
})
}
},
init() {
this.getCarList()
this.getCategoryList()
},
addEquity(type) {
this.dialogType = type
this.showDialog = true
},
setTop(id, type) {
let target = type == 'car' ? this.$apis.carEquityManageApi : this.$apis.goodsEquityManageApi
target.setTop({ id }).then(({ code, message }) => {
console.log(code)
if (code == 0) {
if (type == 'car') this.getCarList()
else this.getCategoryList()
} else {
this.$message.error(message)
}
})
},
editEquity(data, type) {
this.editData = data
this.isEdit = true
this.addEquity(type)
},
updateShelves({ id, status }, type) {
let target = type == 'car' ? this.$apis.carEquityManageApi : this.$apis.goodsEquityManageApi
status = status == 1 ? 0 : 1
const callBack = () => {
target.updateShelves({ id, status }).then(({ code, message }) => {
console.log(message)
if (code == 0) {
if (type == 'car') this.getCarList()
else this.getCategoryList()
} else {
this.$message.error(message)
}
})
}
if (status == 0) {
this.$confirm('是否下架权益', '提示', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
center: true
}).then(() => {
callBack()
})
} else {
callBack()
}
}
}
}
</script>
<style src="@a/css/tao.css"></style>
<style >
.equity-title {
height: 44px;
line-height: 44px;
background-color: rgb(242, 242, 242);
padding-left: 40px;
}
.add-box,
.tags-box {
padding: 20px 0 10px;
}
.el-tag + .el-tag {
margin-left: 10px;
}
.el-tag {
position: relative;
cursor: pointer;
user-select: none;
}
.el-tag .del {
position: absolute;
right: -6px;
top: -6px;
}
.el-tag--info .del {
display: none;
}
.input-tag {
display: none !important;
position: absolute !important;
width: 100% !important;
height: 100%;
left: 0;
top: 0;
z-index: 22;
}
.input-new-tag {
width: 90px !important;
margin-left: 10px;
vertical-align: bottom;
}
.input-tag-show {
display: block !important;
}
.tag-hover .mask {
display: flex !important;
}
.el-tag .mask span:hover {
color: #409eff;
}
.addTag {
margin-left: 10px !important;
}
.equity-icon {
width: 40px;
height: 40px;
}
.opacity {
opacity: 0.5;
}
.el-button {
padding: 12px 0px;
font-size: 14px;
border-radius: 4px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="layout">
<div class="box">
<!-- <back /> -->
<div class="grid">
<div class="grid-item">订单编号:{{detailInfo.orderCode}}</div>
<div class="grid-item">下单时间: {{detailInfo.time}}</div>
</div>
</div>
<div class="box">
<div class="grid">
<template v-for="(item,index) in detailInfoObj">
<div
class="grid-item"
:key="index"
>
<div class="sub-title">{{item.title}}</div>
<template v-for="(i,ind) in item.list">
<div
class="item"
:key="ind"
>
<div class="label">{{i.label}}:</div>
<div class="value">
<template v-if="i.format">
{{i.format(detailInfo)}}
</template>
<template v-else>
{{detailInfo[i.key] || ''}}
</template>
</div>
</div>
</template>
<template v-if="item.btn">
<div class="grid-btn">
售后:
<template v-if="detailInfo.openRefund == 0">
<el-button
type="primary"
@click="openRefund"
>开启</el-button>
</template>
<template v-else>
<span>已开启</span>
</template>
</div>
</template>
</div>
</template>
</div>
</div>
<d2-table
:tableParams="tableParams"
:tableData="tableData"
:hasNum="false"
:hasPage="false"
>
</d2-table>
<div class="price-box">
<div class="price-item">
<div class="label">商品总价:</div>
<div class="value">{{detailInfo.orderPrices}}元</div>
</div>
<div class="price-item">
<div class="label">优惠:</div>
<div class="value">0元</div>
</div>
<div class="price-item">
<div class="label">实收金额:</div>
<div class="value">{{detailInfo.orderPrices}}元</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import Vue from 'vue'
import { orderMixin } from '@/mixins'
export default {
name: '',
mixins: [orderMixin],
data () {
return {
eventBus: new Vue(),
detailInfo: {},
detailInfoObj: [
{
title: '支付信息',
list: [
{
label: '付款状态',
key: 'payStatus'
},
{
label: '付款金额',
format (cell) {
return `${cell.orderPrices}元`
}
},
{
label: '付款方式',
key: 'payType'
},
{
label: '付款时间',
key: 'time'
}
]
},
{
title: '用户信息',
list: [
{
label: '用户名称',
key: 'accountName'
},
{
label: '用户手机号',
key: 'mobile'
},
],
btn: true
},
{
title: '门店',
list: [
{
label: '关联门店',
key: 'merchantName'
},
{
label: '门店地址',
key: 'merchantAddress'
},
]
}
],
tableData: [],
tableParams: {
tableColumns: [
{
label: '商品信息',
minWidth: '300',
formatter: (cell) => {
let str = cell.appearance == 2 ? `<div>${cell.productName}${cell.denomination}</div>` : `<div>${cell.productName}</div>`
return `<div class="goods">
<div class="goods-img">
<img src="${cell.goodsImage}" >
</div>
<div class="goods-info">
<div>${cell.brandName}</div>
${str}
</div>
</div>`
}
},
{
label: '商品形态',
prop: 'appearanceDesc',
minWidth: '200',
},
{
label: '单价/元',
prop: 'orderPrices',
minWidth: '200',
},
{
label: '数量',
minWidth: '200',
formatter: () => {
return 1
}
},
{
label: '小计/元',
prop: 'orderPrices',
minWidth: '200',
},
{
label: '订单状态',
minWidth: '200',
formatter: (cell) => {
return cell.appearance == 1 ? this.statusEnum[cell.orderStatus] : this.qb_statusEnum[cell.orderStatus]
}
},
]
},
params: {}
}
},
mounted () {
// console.log(this.$route,'11111111');
let params = { orderCode: this.$route.query.orderCode }
this.getDetail(params)
},
methods: {
getDetail (params) {
this.$apis.orderApi.getOrderDetail(params).then(({ code, data }) => {
if (code == 0) {
data.payStatus = '已付款'
data.payType = '微信支付'
data.time = data.orderDate ? new Date(data.orderDate).format('yyyy-MM-dd hh:mm:ss') : ''
this.detailInfo = data
this.tableData = [data]
}
})
},
openRefund () {
this.$apis.orderApi.openRefund(this.params).then(({ code, message }) => {
if (code == 0) {
this.$message({
showClose: true,
message: '开启成功',
type: 'success'
})
this.getDetail(this.params)
} else {
this.$message({
showClose: true,
message,
type: 'error'
})
}
})
}
}
}
</script>
<style src="@a/css/tao.css"></style>
<style >
.price-box {
margin-left: 800px;
margin-top: 10px;
}
.price-item {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.price-item .label {
width: 100px;
}
.goods {
display: flex;
}
.goods-img {
width: 100px !important;
height: 100px !important;
margin-right: 10px;
}
.goods-info {
width: calc(100% - 110px);
}
</style>
\ 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!