Commit a62a383e by 前端

Merge branch 'develop' into 'master'

Develop

See merge request !3
2 parents 80cab9e0 05228015
Showing 85 changed files with 4854 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
{
"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/).
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": "ordermanage",
"version": "1.0.0",
"description": "A Vue.js project",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.4.4",
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^2.1.0",
"glsx-components": "^1.2.5",
"rfdc": "^1.3.0",
"vue": "^2.6.10",
"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">
<meta name="referrer" content="never">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<!-- 使用CDN的CSS文件 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="preload" as="style" />
<link href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" rel="stylesheet" />
<% } %>
<!-- 使用CDN的JS文件 预加载 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<link href="<%= htmlWebpackPlugin.options.cdn.js[i] %>" rel="preload" as="script" />
<% } %>
<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 -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
</html>
\ 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"></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通信方案:</span>
<el-button class="right" type="primary" size="medium" @click="callParentChange('rxjs')">通知父应用变天了</el-button>
</div>
<div>
<span>官方通信方案:</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;
}
#app {
padding: 0px 20px 20px 40px;
// overflow-y: auto;
height: 100%;
}
</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 path = 'dj.api.'
const path2 = 'dj.api.smartcarlife.'
// 获取有关联关系的4s店列表
const listShop4sByRef = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}scenemerchantref.listShop4sByRef`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 根据4S店商户号查询二级流量方
const getDiversionMerchantRef = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}diversionMerchant.getDiversionMerchantRef`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { listShop4sByRef, getDiversionMerchantRef }
import { http } from '@/main'
const path = 'dj.api.smartcarlife.'
const path2 = 'scrm.api.shopmall.'
const path3 = 'dj.api.quotation.smartcarlife.'
const getList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}ordermanage.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getOrderDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}advanceOrder.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getOrderCount = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}ordermanage.count`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 众筹活动订单查询列表
const shopmallOrderList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}shopmallOrder.pageList`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 订单详情
const goodsOrderDetail = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsOrder.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//根据园区店商户号获取4s列表
const getServiceStore = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//众筹订单列表
const getListApi = params => {
params.method = `${path2}order.noSessionPage`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/** 获取众筹活动名称&门店 */
const getCrowdfundingParams = params => {
params.method = 'scrm.api.shopmall.crowdfunding.activity.parameter.list'
/** 1秒杀 2直播间活动 3众筹 4膨胀金 */
params.marketingType = 3
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const getCountApi = params => {
params.method = 'scrm.api.shopmall.order.noSessionCount'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**众筹导出 */
const orderExportApi = params => {
params.method = 'scrm.api.shopmall.order.noSessionExport'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const getOrderDetailApi = params => {
params.method = 'scrm.api.shopmall.order.noSessionDetail'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
//车损订单
const getQuotationPageApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}quotation.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询报价单基本录入信息
const quotationFindByIdApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}quotation.detail`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 1.1和2.0的订单导出
const exportOrderApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.ordermanage.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 车损订单导出
const quotationExportApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}quotation.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 打印,返回报价单图片url
const quotationPrintApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}quotation.print`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 打印 返回权益合同PDF文件Url
const contractExportApi = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.vd.equity.order.print`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getList, getOrderDetail, getOrderCount, shopmallOrderList, goodsOrderDetail, getServiceStore, getListApi, getCrowdfundingParams, getCountApi, orderExportApi, getOrderDetailApi, getQuotationPageApi, quotationFindByIdApi, exportOrderApi, quotationExportApi, quotationPrintApi, contractExportApi }
import { http } from '@/main'
const path = 'dj.api.'
const path2 = 'dj.smartcarlife.api.'
// 获取素材详情
const getProductInfo = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.get.byId`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取场景下类目
const getProductTypeBySceneId = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsCategoryConfiguration.queryGoodsCategoryBySceneId`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 查询产品列表
const getGoodsList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}goodsinfo.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getGoodsList,getProductInfo, getProductTypeBySceneId }
import { http } from '@/main'
// const path = 'dj.api.smartcarlife.'
const path2 = 'dj.api.'
/** 获取园区店列表 - 园区店 */
const getParkStore = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.smartcarlife.api.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
/** 获取园区店列表 - 流量来源 */
const getServiceStore = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}servicemerchantref.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取渠道列表
const getChannelType = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}channel.type.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getParkStore, getServiceStore, getChannelType }
import { http } from '@/main'
const path = 'dj.api.smarcarlife.'
const path2 = 'dj.api.goodsInfo.'
const path3 = 'dj.api.smartcarlife.'
// 分页查询采购订单
const getPurchaseOrderList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 采购订单取消/审核
const purchaseOrderCancelOrCheck = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.cancelOrCheck`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查看采购订单
const purchaseOrderDetail = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.view`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 分页查询采购商城素材信息
const listWithPagePurchaseInfo = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}listWithPage.purchaseInfo`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取当前登录园区店商户收货地址
const addressGet = (params = {}) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.get`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 保存园区店商户收货地址
const addressSave = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.save`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 按商品类目分组获取购物车列表
const listGroupByGoodsType = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.listGroupByGoodsType`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 更新购物车商品选中标识
const updateSelectedFlag = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateSelectedFlag`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 移除购物车商品
const shoppingCarRemove = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.remove`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 添加到购物车
const shoppingCarAdd = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 修改购物车商品数量
export function shoppingCarUpdateNumber(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateNumber`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params
})
}
// 添加采购订单
export function purchaseOrderAdd(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export function exportExcel(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 采购订单入库
export function purchaseOrderPutIn(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.putIn`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取下单/入库门店
export function getMerchantList(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}permission.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 确认发货
// export function purchaseOrderConfirmDelivery(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path}purchaseOrder.confirmDelivery`
// return http(data)
// }
export default { getMerchantList,purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file
import { http,http_common } from '@/main'
const path = "dj.api."
const defaultPath = 'scrm.api.carlife.'
// 获取不同场景的商品分类
const getGoodsCategoryConfiguration = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.currentPage = 1
params.pageSize = 999999
params.routerMethod = `${path}goodsCategoryConfiguration.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 视频上传
const uploadVideo = params => {
params.method = `${defaultPath}common.uploadVideo`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadImg = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default { getGoodsCategoryConfiguration, uploadImg, uploadVideo }
.left {
float: left;
}
.right {
float: right;
}
.align-right {
text-align: right;
}
.left{float:left}.right{float:right}.align-right{text-align:right}
$color-yellow:#fdb757;
$color-green:#2cca74;
$color-gray:#999;
//背景图片 100%
@mixin bkgMaxSize($url) {
background-image: url($url);
background-repeat: no-repeat;
background-size: 100% 100%;
}
@mixin font-setting-group($font-size,$font-family,$font-weight,$color,$line-height){
font-size: $font-size;
font-family: $font-family;
font-weight: $font-weight;
color: $color;
line-height: $line-height;
}
//边框圆角
@mixin borderRadius($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
-ms-border-radius: $radius;
-o-border-radius: $radius;
border-radius: $radius;
}
//定位上下左右居中
@mixin positionCenter {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
//定位上下居中
@mixin ct {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
//定位左右居中
@mixin cl {
position: absolute;
left: 50%;
transform: translateX(-50%);
}
//定位全屏
@mixin allcover {
position: absolute;
top: 0;
right: 0;
}
//相对定位
@mixin my-absolute($left, $top,$z) {
position: absolute;
z-index: $z;
margin-left: $left;
margin-top: $top;
}
//宽高-不同
@mixin widthHeightN($width, $height){
width: $width;
height: $height;
}
//宽高-相同
@mixin widthHeightY($number){
width: $number;
height: $number;
}
//字体大小,颜色
@mixin sizeColor($size, $color){
font-size: $size;
color: $color;
}
//flex布局
@mixin center_none{
display: flex;
justify-content: center;
align-items: center;
}
@mixin center_center{
display: flex;
justify-content: center;
align-items: center;
}
@mixin flex-start_center{
display: flex;
justify-content: flex-start;
align-items: center;
}
@mixin space-between_center{
display: flex;
justify-content: space-between;
align-items: center;
}
@mixin space-around_center{
display: flex;
justify-content: space-around;
align-items: center;
}
@mixin flex-end_center{
display: flex;
justify-content: flex-end;
align-items: center;
}
@mixin wrap_flex-start{
display: flex;
flex-wrap:wrap;
align-content:flex-start;
}
@mixin flex-start_column{
display: flex;
justify-content: flex-start;
flex-direction: column;
}
@mixin none_center_column{
display: flex;
align-items: center;
flex-direction: column;
}
@mixin center_center_column{
display: flex;
align-items: center;
justify-content: flex-start;
flex-direction: column;
}
//圆点
@mixin dot{
width: 6px;
height: 6px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
}
/**
* 根据路由匹配地址
* @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
// 订单状态
export const orderStatusList = [
{
confId: 1,
confLabel: '待升级'
},
{
confId: 2,
confLabel: '战败'
},
{
confId: 3,
confLabel: '待支付'
},
{
confId: 4,
confLabel: '已支付'
},
/* {
confId: 5,
confLabel: '已退款'
}, */ {
confId: 6,
confLabel: '已评价'
},
{
confId: 9,
confLabel: '已撤销'
},
{
confId: 10,
confLabel: '已关闭'
},
{
confId: 11,
confLabel: '错误订单'
},
{
confId: 12,
confLabel: '已退款'
}
]
// 升级状态
export const upgradeList = [
{
confId: 'Y',
confLabel: '已升级'
},
{
confId: 'N',
confLabel: '不升级'
}
]
// 施工状态
export const constructionList = [
{
confId: 'Y',
confLabel: '已施工'
},
{
confId: 'N',
confLabel: '未施工'
}
]
// 分账状态
export const profitAllocationStatusList = [
{
confId: 1,
confLabel: '未分账'
},
{
confId: 2,
confLabel: '已分账'
},
{
confId: 4,
confLabel: '待分账'
}
]
// 订单来源
export const sourceList = [
{
confId: '1',
confLabel: '小程序订单'
},
{
confId: '7',
confLabel: '系统导入'
}
]
export const payType = {
1: '微信支付',
2: '4S店支付',
3: 'POS机收款',
4: '支付宝支付'
}
export const businessType = [
{
optionId: 1,
optionLabel: '1.2'
},
{
optionId: 2,
optionLabel: '1.3'
},
{
optionId: 3,
optionLabel: '2.0'
}
]
export const orderManageStatusList = [
{ confId: '1', confName: '待付款' },
{ confId: '2', confName: '已支付' },
{ confId: '3', confName: '已失效' },
// { confId: '21', confName: '待收货(待核销)' },
{ confId: '21', confName: '待核销' },
{ confId: '22', confName: '已核销' },
// { confId: '22', confName: '已收货(已核销)' },
{ confId: '6', confName: '待发货' },
// { confId: '7', confName: '待核销' },
// { confId: '8', confName: '已核销' },
{ confId: '9', confName: '售后中' },
{ confId: '10', confName: '售后完成' },
{ confId: '11', confName: '待审批' }
]
export const afterSaleStatusList = [
{ confId: '1', confName: '待审核' },
{ confId: '2', confName: '审核成功' },
{ confId: '3', confName: '审核失败' },
{ confId: '4', confName: '待确认' },
{ confId: '5', confName: '退款中' },
{ confId: '6', confName: '已退款' },
{ confId: '7', confName: '退款失败' }
]
export const orderSourceList = [
{ confId: '1', confName: '商城订单' },
{ confId: '2', confName: '直播订单' },
{ confId: '3', confName: '活动订单' },
{ confId: '4', confName: '众筹订单' }
]
export const deliveryTypeList = [
{ confId: '1', confName: '到店核销' },
{ confId: '2', confName: '快递到家' }
]
function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
// 园区店模式/经营模式
export const manageTypeList = [
{ confId: 0, confLabel: '园区店' },
{ confId: 1, confLabel: '驻店' }
]
export const exportFn = url => {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
}
// 获取最近n个月,默认6个月
export function getCurrentSixMonth(n = 5) {
return [new Date(new Date().setMonth(new Date().getMonth() - n)), new Date()]
}
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
export function limitPrice(
newValue,
oldValue,
intergerDigit,
pointDigit,
minValue,
maxValue,
regRule
) {
var reg = {
priceReg: /^\d[\d\.]*$/, // eslint-disable-line
numReg: /^[1-9]\d*$/
}
regRule = regRule || "priceReg"
if (
newValue &&
((minValue && newValue < minValue) || (maxValue && newValue > maxValue))
) {
return oldValue || ""
}
if (newValue && reg[regRule].test(newValue + "")) {
if (/\./.test(newValue)) {
newValue = newValue + ""
var interger = newValue.split(".")[0]
var point = newValue.split(".")[1]
var intergerNum =
interger.length > intergerDigit ? oldValue.split(".")[0] : interger
var pointNum =
point.length > pointDigit ? point.slice(0, pointDigit) : point
newValue = pointDigit
? intergerNum + "." + pointNum
: newValue.split(".")[0]
} else {
newValue =
newValue.length > intergerDigit
? oldValue.slice(0, intergerDigit)
: newValue
}
return newValue
} else {
return newValue ? oldValue : ""
}
}
/**
* 时间控件-限制月份
*/
export const rangePickerOptions = {
disabledDate(date) {
console.log(date)
console.log(new Date())
if (date > new Date()) {
return true
}
return false
}
}
/**
* 时间控件-(0-30天内的日期)
*/
export const appointDays = 35
export const afterTodayOptions = {
disabledDate(date) {
if (
date < new Date(new Date().toLocaleDateString()) ||
date >
new Date(new Date().setDate(new Date().getDate() + (appointDays - 1)))
) {
return true
}
return false
}
}
/**
* 时间控件-单年份选择时限制年份
*/
export const rangePickerOptions_year_2023 = {
disabledDate(date) {
// console.log(date)
// console.log(date.getFullYear())
// console.log(new Date())
if (
date.getFullYear() > new Date().getFullYear() ||
date.getFullYear() < 2023
) {
return true
}
return false
}
}
// import Vue from 'vue'
import { Message, MessageBox, Loading } from 'element-ui'
// import moment from 'moment'
import dayjs from 'dayjs'
let loadingInstance = ''
export const Util = {
/**
* 简单alert
* title 标题
* message 内容
* className 自定义class
* showCancelButton 是否展示取消按钮
* confirmButtonText 确认按钮文案
* cancelButtonText 取消按钮文案
* confirmButtonColor 确认按钮颜色
* cancelButtonColor 取消按钮颜色
*/
msg: function(options) {
MessageBox({
title: options.title || '',
type: options.type || 'error',
message: options.message || '',
className: options.className || '',
showCancelButton: options.showCancelButton || false,
confirmButtonText: options.confirmButtonText || '确认',
cancelButtonText: options.cancelButtonText || '取消',
confirmButtonColor: options.confirmButtonColor || '#1989fa',
cancelButtonColor: options.cancelButtonColor || '#000',
dangerouslyUseHTMLString: true,
callback: function(action, done) {
if (action == 'confirm') {
if (options.success) {
options.success(done)
}
} else {
console.log(done)
// done()
}
}
})
/* Vue.$vux.alert.show({
title: options.title||'',
content: options.message||'',
onShow() {
options.onShow?(options.onShow)():'';
},
onHide() {
options.onHide?(options.onHide)():'';
}
}) */
},
/**
* 提示框
*/
Info: function(options) {
Message({
message: options.message || '提示',
type: options.type || 'error',
duration: options.time || 2000,
onClose: options.onClose || ''
})
},
/**
* 轻提示
*/
Tips: function(options) {
Message({
message: options.message || '提示',
duration: options.duration || 3000,
type: options.type || 'text',
icon: options.icon || ''
})
},
/**
* loading
*/
loading: function(message) {
loadingInstance = Loading.service({
text: message || '加载中...'
})
},
/**
* 关闭loading
*/
closeLoading: function() {
loadingInstance.close()
},
/**
* 校验手机号码格式
*/
checkPhone: function(mobile) {
const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile)
},
/**
* 校验固定电话
*/
validationTel: function(tel) {
const reg = /^0[\d]{2,3}-[\d]{7,8}$/
return reg.test(tel)
},
/**
* 是否特殊字符
*/
isSpecialLetter: function(str) {
const reg = new RegExp("[`~!@#$^&*=|{}':;',\\[\\]<>?~!@#¥……&*——|{}【】‘;:”“'。,、? ]")
return reg.test(str)
},
/**
* 只能输入英文字母和数字,不能输入中文
*/
validationInput: function(str) {
const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str)
},
/**
* 获取当前时间
*/
getCurrentDate: function() {
const time = new Date()
const y = time.getFullYear()
const m = time.getMonth() + 1
const d = time.getDate()
return {
date: y + '/' + m + '/' + d
}
},
/**
* 获取浏览器参数
*/
getUrlParams: function(name) {
const vars = []
let hash
const oParams = {}
const hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&')
for (let i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=')
vars.push(hash[0])
oParams[hash[0]] = hash[1]
}
console.log(vars)
if (name) {
return oParams[name]
} else {
return oParams
}
},
/**
* 根据当前时间,计算往后30天的日期
*/
getAfterDate: function(day) {
const date1 = new Date()
const date2 = new Date(date1)
let time = 30
if (day) {
time = day
}
date2.setDate(date1.getDate() + time)
const _date = date2.getFullYear() + '-' + (date2.getMonth() + 1) + '-' + date2.getDate()
return {
date: _date,
year: date2.getFullYear(),
month: date2.getMonth() + 1,
day: date2.getDate()
}
},
/**
* 日期格式转换
*/
dateFormate: function(str, type) {
let txt = 'YYYY-MM-DD'
if (type) {
txt = type
}
const m = dayjs(str).format(txt)
return m
},
/**
* 字段截取
*/
cutStr: function(str, num) {
if (!str) {
return ''
}
let m = 10
let n = str
if (num) {
m = num
}
if (str.length > m) {
n = str.slice(0, m) + '...'
}
return n
},
// /**
// * 深克隆 所有原型链上的对象和属性
// * 例: const bar=deepClone(foo)
// * console.log(bar===foo) false
// * @param {*} obj
// */
deepClone: function(obj) {
const clone = require('rfdc')({ proto: false, circles: false })
return clone(obj)
},
// deepClone: function (obj) {
// // Handle the 3 simple types, and null or undefined or function
// if (obj == null || typeof obj !== "object") return obj
// // Handle Date
// if (obj instanceof Date) {
// const copy = new Date()
// copy.setTime(obj.getTime())
// return copy
// }
// // Handle Array or Object
// if ((obj instanceof Array) | (obj instanceof Object)) {
// const copy = obj instanceof Array ? [] : {}
// for (var attr in obj) {
// // if (Object.prototype.hasOwnProperty.call(attr)) {
// if (obj.hasOwnProperty(attr)) {
// copy[attr] = Util.deepClone(obj[attr])
// // console.log("copy[attr] ", copy[attr])
// }
// }
// return copy
// }
// throw new Error("Unable to clone obj! Its type isn't supported.")
// },
/**
* url下载文件
*
*/
downLoadFile: function(url) {
// console.log(row)
// return
const Temp = document.createElement('a')
// Temp.href = process.env.VUE_APP_BASE_URL + '/article/export.do?articleId=' + row.id
Temp.href = url + '?timestamp=' + new Date().getTime()
// console.log(url)
// console.log(Temp.href)
document.body.append(Temp)
Temp.click()
document.body.removeChild(Temp)
},
/**
* @param {Object} json
* @param {Object} type: 默认不传 ==>全部小写;传1 ==>全部大写;传2 ==>首字母大写
* 将json的key值进行大小写转换
*/
jsonKeysToCase: function(json, type) {
if (typeof json == 'object') {
var tempJson = JSON.parse(JSON.stringify(json))
toCase(tempJson)
return tempJson
} else {
return json
}
function toCase(json) {
if (typeof json == 'object') {
if (Array.isArray(json)) {
json.forEach(function(item) {
toCase(item)
})
} else {
for (var key in json) {
var item = json[key]
if (typeof item == 'object') {
toCase(item)
}
delete json[key]
switch (type) {
case 1:
// key值全部大写
json[key.toLocaleUpperCase()] = item
break
case 2:
// key值首字母大写,其余小写
json[key.substring(0, 1).toLocaleUpperCase() + key.substring(1).toLocaleLowerCase()] = item
break
default:
// 默认key值全部小写
json[key.toLocaleLowerCase()] = item
break
}
}
}
}
}
},
// 判断字段为空时显示
fieldShow: function(field, show) {
return field || show
},
// 整数补零显示两位小数
returnFloat: function(num) {
num = num.toString()
if (num.indexOf('.') != -1) {
let newVal = num.split('.')
if (newVal[1].length == 1) {
newVal = newVal.join('.')
newVal += '0'
num = newVal
}
} else {
num += '.00'
}
return num
}
}
export const showModal = Util.msg
export const showToast = Util.Info
export const showLoading = Util.loading
export const hideLoading = Util.closeLoading
export const deepClone = Util.deepClone
export const downLoadFile = Util.downLoadFile
export const returnFloat = Util.returnFloat
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<template>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
<script>
let map, marker, placeSearch
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
cursor: 'move'
})
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
},
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
_this.adrList = result.poiList.pois
}
})
},
addMarker(lnglat) {
let position
if (lnglat.lng) {
position = [lnglat.lng, lnglat.lat]
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let position
if (e.type == 'click') {
position = e.lnglat
} else {
let { lng, lat } = e
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
}
}
</script>
<style scoped lang="scss">
.map-box {
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
\ No newline at end of file
<template>
<div v-if="provinceView">
<el-form ref="provinceForm" :model="provinceForm" inline="true" class="province" style="padding-left: 0;">
<el-select size="small" v-model="provinceForm.provinceName" clearable :disabled="isDisabled" placeholder="选择省份" :style="{ width: defaultWidth }" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select size="small" v-model="provinceForm.cityName" clearable :disabled="isDisabled" placeholder="选择市" :style="{ width: defaultWidth }" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectCity(item)"></el-option>
</el-select>
<el-select v-if="subdistrict == 3" size="small" v-model="provinceForm.townName" clearable :disabled="isDisabled" placeholder="选择区" :style="{ width: defaultWidth }" @change="selectTown" class="select-padding">
<el-option v-for="item in townList" :key="item.adcode" :label="item.name" :value="item.name" @click.native="selectTown(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
export default {
name: 'GLProvince',
props: {
// 省市级别,2--只显示省市,3--显示省市区,默认只显示省市
subdistrict: {
type: Number,
default: 2
},
// 省市下拉组件宽度
defaultWidth: {
type: String,
default: '150px'
},
// 组件是否展示,默认展示
provinceView: {
type: Boolean,
default: true
},
isDisabled: {
type: Boolean,
default: false
}
},
data() {
return {
// 所有数据
AllData: [],
// 城市列表
cityList: [],
// 地区列表
townList: [],
provinceForm: {
// 省份名称
provinceName: '',
// 城市名称
cityName: '',
// 地区名称
townName: '',
// 省份代码
provinceCode: '',
// 城市代码
cityCode: '',
// 地区代码
townCode: ''
}
}
},
mounted() {
this.provinceList()
},
methods: {
/*
* @params:传入的为一个key-value的对象
1、keywords --查询关键字,只支持单个关键词语搜索关键词支持:行政区名称、citycode、adcode
列如:this.provinceList({keywords: '山东省'}),这样就可以筛选出山东省下的市、区信息
2、subdistrict --设置显示下级行政区级数,0:不返回下级行政区;1:返回下一级行政区;2:返回下两级行政区;3:返回下三级行政区;
不传的话默认为2,可以在组件中穿,也可以在调用方法的时候传,如果需要展示省市组件,传值最小为2
3、page --最外层的districts最多会返回20个数据,若超过限制,请用page请求下一页数据。
例如page=2;page=3。默认page=1
4、extensions --控制行政区信息中返回行政区边界坐标点; 可选值:base、all;
base:不返回行政区边界坐标点;(默认)
all:只返回当前查询district的边界值,不返回子节点的边界值;目前不能返回乡镇/街道级别的边界值
5、filter -- 按照指定行政区划进行过滤,填入后则只返回该省/直辖市信息,需填入adcode,为了保证数据的正确,强烈建议填入此参数
6、callback -- callback值是用户定义的函数名称,此参数只在output=JSON时有效
7、output --返回数据格式类型,可选值:JSON,XML(默认JSON)
* @return:返回的是一个promise对象,如果不需要展示组件,只需要获取值,可以直接调用方法,异步获取返回值
列如:
const p = this.$refs.provinceForm.provinceList({xxxx(可传值,传值可参考上文params描述) })
p.then(r => {
// r 为返回结果
console.log(r)
})
**/
// 获取省市信息
provinceList(params = {}) {
params ? (params.subdistrict ? '' : (params.subdistrict = this.subdistrict)) : (params.subdistrict = this.subdistrict)
let data = ''
for (let key in params) {
data += '&' + key + '=' + params[key]
}
let path = `https://restapi.amap.com/v3/config/district?key=d22348363c34c266f772ae9b635eef2a`
path = path + data
const pro = fetch(path).then(res => {
return res.json()
})
if (this.provinceView) {
pro.then(r => {
this.AllData = r.districts[0].districts
})
}
return pro
},
// 省市回显
init(province, city, town) {
this.provinceForm = {
provinceName: province,
cityName: city,
townName: town
}
if (province) {
this.AllData.map(item => {
if (item.name.indexOf(province) != -1) {
this.provinceForm.provinceName = item.name
this.cityList = item.districts
this.provinceForm.provinceCode = item.adcode
if (city) {
this.cityList.map(itm => {
if (itm.name.indexOf(city) != -1) {
this.provinceForm.cityCode = itm.adcode
this.provinceForm.cityName = itm.name
this.townList = itm.districts
if (town) {
this.townList.map(itmx => {
if (itmx.name.indexOf(town) != -1) {
this.provinceForm.townCode = itmx.adcode
this.provinceForm.townName = itmx.name
}
})
}
}
})
}
}
})
}
},
// 选择省
selectProvince(val) {
this.provinceForm.cityName = ''
this.provinceForm.townName = ''
this.cityList = val.districts
this.$emit('selectProvince', { provinceName: val.name, provinceCode: val.adcode })
},
// 选择市
selectCity(val) {
this.provinceForm.townName = ''
this.townList = val.districts
this.$emit('selectCity', { cityName: val.name, cityCode: val.adcode })
},
// 选择区
selectTown(val) {
this.$emit('selectTown', { townName: val.name, townCode: val.adcode })
}
}
}
</script>
<style lang="scss">
.province {
display: inline-flex;
.el-select .el-input {
width: auto !important;
}
}
.select-padding {
margin-right: 10px;
}
</style>
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
<!-- 弹窗 -->
<template>
<div>
<el-dialog
:title="title"
:visible.sync="isVisible"
:show-close="showClose"
:before-close="handleClose"
:close-on-click-modal="false"
:modal-append-to-body="false"
:width="width"
class="app-dialog"
>
<el-scrollbar v-if="hasScroll">
<span slot="title">
<span class="main-title"></span>
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
</el-scrollbar>
<template v-if="!hasScroll">
<span slot="title">
<span class="main-title"></span>
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
</template>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button
:type="typeName"
v-if="!noClose"
:size="btnSize"
@click="handleClose"
></el-button>
<el-button
type="default"
v-if="!noCancel"
:size="btnSize"
@click="handleClose"
></el-button>
<el-button
type="primary"
v-if="!noBtnOk"
:size="btnSize"
@click="handleConfirm"
></el-button>
<slot name="btn-middle"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'glsx-dialog',
data() {
return {}
},
props: {
hasScroll: {
type: Boolean,
default: true
},
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: false
},
btnCloseLabel: {
type: String,
default: '关闭'
},
btnOkLabel: {
type: String,
default: '确定'
},
btnCancelLabel: {
type: String,
default: '取消'
},
noBtnOk: {
type: Boolean,
default: false
},
noCancel: {
type: Boolean,
default: false
},
noClose: {
type: Boolean,
default: true
},
typeName: {
type: String,
default: 'default'
},
width: {
type: String,
default: '580px'
},
btnSize: {
type: String,
default: 'small'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style lang="scss">
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
/*
* @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 glsxDialog from '@/components/glsx-dialog/index.vue'
import GlsxCombiForm from '@/components/glsx-combi-form/index.vue'
Vue.component('glsx-dialog', glsxDialog)
Vue.component('GlsxCombiForm', GlsxCombiForm)
\ 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-18 11:51:29
*/
// 本地环境配置
module.exports = {
title: 'scrm-sub-marketing',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '48e5e13229b82c1b4e6e8c96151f0637',
v: '1.0.0',
format: 'json',
source: ''
},
secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
cdn: 'https://www.xxx.cn/static'
}
module.exports = {
title: 'scrm-sub-marketing',
response: {
data_key: 'data',
message_key: 'message',
code_key: 'code',
code_success_value: '0',
errId_logout_value: '21',
code_message_map: {}
},
request: {
baseURL: 'http://scrm.test.glsx.com.cn/',
// 设置超时时间
timeout: 180000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
},
sign: {
appKey: '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')
import { Http, utils } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
let params = { moduleName: 'ordermanage', mockUrl: 'https://oss-config.glsx.com.cn/mock/64560a989bfdc8942feaa6f1/ordermanage/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res)
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
import Vue from 'vue'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, tableData } from '@/utils/constants.js'
// 发货状态
Vue.filter('deliveryStatus', (id, formatString) => {
const text = '--'
for (let i = 0; i < defaultDeliveryStatusOptions.length; i++) {
if (defaultDeliveryStatusOptions[i].id === id) {
return defaultDeliveryStatusOptions[i].label
}
}
return text
})
// 入库状态
Vue.filter('putStatus', (id, formatString) => {
const text = '--'
for (let i = 0; i < defaultPutStatusOptions.length; i++) {
if (defaultPutStatusOptions[i].id === id) {
return defaultPutStatusOptions[i].label
}
}
return text
})
// 订单状态状态
Vue.filter('orderStatus', (id, formatString) => {
const text = '--'
for (let i = 0; i < defaultStatusOptions.length; i++) {
if (defaultStatusOptions[i].id === id) {
return defaultStatusOptions[i].label
}
}
return text
})
No preview for this file type
No preview for this file type
No preview for this file type
/*
* @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 {optionalChaining} from './utils/chaining'
import './public-path'
import '@/assets/css/public.scss'
import '@/components'
import '@/filter'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
Vue.config.productionTip = false
Vue.prototype.$apis = apis
Vue.prototype.$$ = optionalChaining
Vue.prototype.size = 'small'
Vue.prototype.$EventBus = new Vue()
start()
export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
File mode changed
import Vue from 'vue'
import { Message, Button, ButtonGroup, Form, FormItem, Input, Radio, RadioGroup, Checkbox, CheckboxGroup, Switch, Select, Option, TimePicker, Col, DatePicker, Tree, Card, Table, TableColumn, Pagination, Loading, Dialog, MessageBox, Upload, Tooltip, Tabs, TabPane, Container } from 'element-ui'
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(Tree)
Vue.use(Card)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Loading)
Vue.use(Dialog)
Vue.use(Upload)
Vue.use(Tooltip)
Vue.use(Tabs)
Vue.use(TabPane)
export const message = Message
export const messageBox = MessageBox
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(routesData) {
return routesData.reduce((routes, route) => {
routes.push({ ...route, component: () => import('@/views' + route.compath + '.vue') })
return routes
}, [])
}
export { VueRouter, routes, getRoutes }
const staticRoutes = Object.freeze([
{
name: 'default',
path: '/'
},
{
name: 'orderManage',
path: '/orderManage/index',
component: resolve => require([`@/views/orderManage/index.vue`], resolve),
meta: {}
},
//精品升级订单详情
{
name: 'orderDetail',
path: '/orderManage/orderDetail',
component: resolve => require([`@/views/orderManage/orderDetail.vue`], resolve),
meta: {}
},
//众筹订单详情
{
name: 'orderDetail',
path: '/orderManage/crowdDetail',
component: resolve => require([`@/views/orderManage/crowdDetail.vue`], resolve),
meta: {}
},
//车损订单详情
{
name: 'carDamageDetail',
path: '/orderManage/carDamageDetail',
component: resolve => require([`@/views/orderManage/carDamageDetail.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, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
import { GLButton, GLTable } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router'
import ElementUI from 'element-ui'
import render from './render'
let routes = []
let router = null
let instance = null
Vue.use(ElementUI)
Vue.use(GLTable)
import 'glsx-components/dist/glsx-components.css'
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig()
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
Vue.prototype.$common = common
Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$http_common = new common.Http({ response, signWay: 'md5', request: request_common, sign: sign_common, secret, alert: ElementUI.Message.error, headers: { TGT: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
const routesData = common.utils.deepClone(globalState.routers)
routes = getRoutes(routesData)
subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase })
}
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-10-14 16:30:47
* @FilePath: \scrm\scrm-sub-blog\src\setup\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')
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 } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { Http, utils } from 'glsx-common'
import render from './render'
import { routes } from '@/router'
export async function start() {
if (window.__POWERED_BY_QIANKUN__) return
const { response, request, sign, secret } = await fetchConfig()
var urlParams = {}
// window.location.href
// .split('?')[1]
// .split('&')
// .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1]
// })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-53e870b5-80d5-483e-8277-cdc4dec0ad80-rop'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { 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: {}
}
export const optionalChaining = (obj, ...rest) => {
return rest.reduce((newObj, key) => newObj?.[key], obj)
// let tmp = obj
// for (const key in rest) {
// const name = rest[key]
// tmp = tmp?.[name]
// }
// return tmp || ''
}
export function debounce(func, wait = 200) {
let timeout;
return function (event) {
clearTimeout(timeout)
timeout = setTimeout(() => {
func.call(this, event)
}, wait)
}
}
export function dateFormat(dateTime, format = 'YYYY-MM-DD HH:mm') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: date.getMonth() + 1, //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: date.getDate(),
HH: date.getHours(),
mm: date.getMinutes(),
ss: date.getSeconds()
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
/**
* 校验手机号码格式
*/
export function checkPhone(mobile) {
const myreg =
/^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile)
}
<!-- 报价单详情 -->
<template>
<d2-container class="order-detail">
<div class="d2-container-content">
<!-- <p class="edit-title">
报价单详情
</p> -->
<div class="form_gp">
<p class="edit-sub-title">
车辆信息
</p>
<el-form class="edit-sub-block" :inline="true">
<el-form-item label="车架号:">
{{ $$(detail, 'ownerDTO', 'carVin') }}
</el-form-item>
<el-form-item label="座位数:">
{{ $$(detail, 'ownerDTO', 'seat') }}
</el-form-item>
<el-form-item label="车辆发票价/元:">
{{ $$(detail, 'ownerDTO', 'price') / 100 }}
</el-form-item>
</el-form>
</div>
<div class="form_gp">
<p class="edit-sub-title">
车主信息
</p>
<el-form class="edit-sub-block" :inline="true">
<el-form-item label="姓名:">
{{ $$(detail, 'ownerDTO', 'owner') }}
</el-form-item>
<el-form-item label="手机号:">
{{ $$(detail, 'ownerDTO', 'phone') }}
</el-form-item>
<el-form-item label="证件号:">
{{ $$(detail, 'ownerDTO', 'certificateNo') }}
</el-form-item>
</el-form>
</div>
<div class="form_table_gp">
<p class="edit-sub-title">
商业险信息
</p>
<el-table :data="commerceInsureList" border
:header-cell-style="{ 'text-align': 'center', 'background-color': '#fafafa' }" style="width: 100%">
<el-table-column prop="company" align="center" label="保险公司" />
<el-table-column prop="base" align="center" label="基础车损险">
<template slot-scope="scope">{{ scope.row.base / 100 }}元</template>
</el-table-column>
<el-table-column prop="three" align="center" label="第三方责任险" />
<el-table-column prop="threePremium" align="center" label="保费">
<template slot-scope="scope">{{ scope.row.threePremium / 100 }}元</template>
</el-table-column>
<el-table-column prop="driver" align="center" label="车上人员责任险(司机)" />
<el-table-column prop="carInsidePremium" align="center" label="保费">
<template slot-scope="scope">{{ scope.row.carInsidePremium / 100 }}元</template>
</el-table-column>
<el-table-column prop="passenger" align="center" label="车上人员责任险(乘客)" />
<el-table-column prop="passengerPremium" align="center" label="保费">
<template slot-scope="scope">{{ scope.row.passengerPremium / 100 }}元</template>
</el-table-column>
</el-table>
</div>
<div class="form_gp">
<p class="edit-sub-title">
其他商业险
</p>
<el-table :data="otherInsuranceList" border
:header-cell-style="{ 'text-align': 'center', 'background-color': '#fafafa' }" style="width: 100%">
<el-table-column prop="typeName" align="center" label="商业险名称" />
<el-table-column prop="compensation" align="center" label="险种保额" />
<el-table-column prop="payPrice" align="center" label="保费">
<template slot-scope="scope">{{ scope.row.payPrice | divideByHundred }}元</template>
</el-table-column>
</el-table>
</div>
<div class="form_gp">
<p class="edit-sub-title">
交强和车船税
</p>
<el-form class="edit-sub-block" :inline="true">
<el-form-item label="交强险:">{{ $$(compulsoryInsure, 'compensation') }} / 保费:{{ $$(compulsoryInsure, 'payPrice') /
100 }}元</el-form-item>
<el-form-item label="车船税:">{{ $$(vehicleInsure, 'compensation') }}年 / 保费:{{ $$(compulsoryInsure, 'payPrice') /
100 }}元</el-form-item>
</el-form>
</div>
<div class="form_gp">
<p class="edit-sub-title">
增值车损险服务
</p>
<el-form class="edit-sub-block" :inline="true">
<el-form-item label="商品:" class="goods">
<img v-if="$$(detail, 'quotationGoodsInfo', 'titlePictureUrl')" class="order-img"
:src="$$(detail, 'quotationGoodsInfo', 'titlePictureUrl')" @click="handleEnlargeImg" />
{{ $$(detail, 'quotationGoodsInfo', 'goodsName') }}
</el-form-item>
<el-form-item label="增值权益价格/元:" style="width:450px">
{{ detail.quotedPriceUpdate / 100 }}
</el-form-item>
</el-form>
</div>
<!-- <p style="text-align:left; padding-left: 30px; margin: 0 0 16px 0;">
<el-button type="primary"
@click="handleClose">
返回
</el-button>
</p> -->
</div>
<el-dialog :visible="imgVisible" :before-close="handleEnlargeImg">
<img width="100%" :src="$$(detail, 'quotationGoodsInfo', 'titlePictureUrl') || ''" alt="图片" />
</el-dialog>
</d2-container>
</template>
<script>
import { deepClone } from '@/common/util'
import { payType } from '@/common/constant.js'
import dayjs from 'dayjs'
// import { quotationFindById } from "@api/vehicleDamage"
export default {
name: 'VehicleDamageDetail',
components: {},
filters: {
// 除以100保留两位小数点
divideByHundred: str => {
let floatVal = parseFloat(str)
if (isNaN(floatVal)) {
return 0
}
floatVal = Math.round(str * 100) / 10000
let strVal = floatVal.toString()
let searchVal = strVal.indexOf('.')
if (searchVal < 0) {
searchVal = strVal.length
strVal += '.'
}
while (strVal.length <= searchVal + 2) {
strVal += '0'
}
return parseFloat(strVal)
},
// 乘以100保留两位小数点
multipliedByHundred: str => {
let floatVal = parseFloat(str)
if (isNaN(floatVal)) {
return 0
}
floatVal = Math.round(str * 10000) / 100
let strVal = floatVal.toString()
let searchVal = strVal.indexOf('.')
if (searchVal < 0) {
searchVal = strVal.length
strVal += '.'
}
while (strVal.length <= searchVal + 2) {
strVal += '0'
}
return parseFloat(strVal)
}
},
data() {
return {
imgVisible: false,
detail: {},
commerceInsureList: [], //商业险
compulsoryInsure: {}, //交强险
vehicleInsure: {}, //车船税
otherInsuranceList: []
}
},
computed: {},
mounted() {
this.detail = this.$route.query
this.quotationFindById()
},
methods: {
handleEnlargeImg() {
this.imgVisible = !this.imgVisible
},
handleClose() {
this.$router.push({ name: 'vehicleDamageList' })
this.close({ tagName: '/vehicleDamageDetail' })
},
quotationFindById() {
this.$apis.order.quotationFindByIdApi({ id: this.detail.id }).then(res => {
this.detail = res
if (this.detail.insureDTOList && this.detail.insureDTOList.length > 0) {
this.detail.insureDTOList.forEach(item => {
//保险类型(0-商业,1-交强,2-车船,3-增值车损,4-other)
if (item.type == 0) {
this.commerceInsureList.push(item)
} else if (item.type == 1) {
this.compulsoryInsure = item
} else if (item.type == 2) {
this.vehicleInsure = item
} else if (item.type == 4) {
this.otherInsuranceList.push(item)
}
})
}
})
}
}
}
</script>
<style scoped lang="scss">
.order-detail {
.d2-container-content {
margin-top: 0 !important;
background-color: #fff;
}
.edit-title {
// padding-left: 0;
}
.form_gp {
color: #333333;
padding: 20px 30px;
border-bottom: 1px solid #eee;
// h4{
// margin: 0 0 10px;
// }
.edit-sub-title {
font-weight: bold;
margin-bottom: 10px;
}
.edit-sub-block {
padding: 0 16px;
}
.el-form-item {
width: 400px;
margin-bottom: 0px;
}
.goods {
height: 100px;
// display: flex;
}
.order-img {
width: 80px;
height: 80px;
cursor: pointer;
vertical-align: middle;
}
}
.form_table_gp {
padding: 20px 30px;
margin-bottom: 20px;
}
}
.signRefundBtn {
margin-left: 10px;
.signRefundIcon {
width: 12px;
margin-right: 5px;
}
span {
display: flex;
align-items: center;
justify-content: center;
}
}</style>
<template>
<div>
<div>
<el-form ref="form"
:model="company"
label-width="154px"></el-form>
</div>
<div class="member-wrapper">
<div class="member-left">
<div class="member-content">
<div class="member-content-head">
<el-checkbox :indeterminate="isIndeterminate"
v-model="checkAll"
@change="handleCheckAllChange">全选</el-checkbox>
</div>
<div class="table-content">
<el-input size="medium"
v-model="filterText"
suffix-icon="el-icon-search"
clearable
placeholder="请输入搜索关键字"></el-input>
<el-tree :data="departmentList"
:default-expanded-keys="expandedKeys"
show-checkbox
ref="tree"
node-key="id"
:props="defaultProps"
@check="handleNodeClick"
:filter-node-method="filterNode"></el-tree>
</div>
</div>
</div>
<div class="member-right">
<div class="member-name member-content-head">
<div>已选名称</div>
<div class="blue"
@click="clear">清空</div>
</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(label, idx) in userList"
:key="idx"
type="info"
closable
:disable-transitions="false"
@close="remove(idx)">
{{ label.name }}
</el-tag>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
newArr: [],
filterText: '',
userList: [],
isIndeterminate: false,
checkAll: false,
ids: [],
selectIds: [],
expandedKeys: [],
defaultIds: [],
departmentList: [],
defaultProps: {
children: 'children',
label: 'name'
}
}
},
props: {
merchantId: {
type: String,
default: ''
},
selectlist: {
type: Array,
default: () => []
}
},
created() {
this.getDepartmentTree()
},
watch: {
filterText(val) {
console.log(val)
this.$refs.tree.filter(val)
},
selectlist(val) {
this.defaultData()
}
},
methods: {
clear() {
this.userList = []
this.$refs.tree.setCheckedKeys([])
this.handleNodeClick()
},
handleCheckAllChange(val) {
// console.log(this.ids)
val ? this.$refs.tree.setCheckedKeys(this.ids) : this.$refs.tree.setCheckedKeys([])
this.handleNodeClick()
this.isIndeterminate = false
},
defaultData() {
this.defaultIds = this.selectlist.map(item => item.staffId)
this.$refs.tree.setCheckedKeys(this.defaultIds)
this.handleNodeClick()
},
getMerchantList() {
this.$apis.battle.getMerchantList({}).then(res => {
this.merchantList = res
this.merchantId = this.merchantList[0].merchantId
this.merchantName = this.merchantList[0].merchantName
})
},
async getDepartmentTree() {
let params = { addChildrensFlag: true, queryMerchantId: this.merchantId }
// let params = { addChildrensFlag: true, queryMerchantId: '44210895' }
let data = await this.$apis.battle.getlistDepartmentTree(params)
this.ids = []
this.departmentList = data
await this.initData(this.departmentList)
this.expandedKeys = [this.departmentList[0].id]
this.$nextTick(() => {
if (this.selectlist.length > 0) {
this.defaultData()
}
})
},
initData(data) {
data.forEach((item, index) => {
this.$set(item, 'name', item.staffName ? item.staffName : item.departmentName)
let entmicroStaffResponses = this.$common.utils.deepClone(item.entmicroStaffResponses) || []
entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
}
})
let child = this.$common.utils.deepClone(item.children) || []
child = child.filter((staff, idx) => {
if (staff.staffName) {
this.$set(staff, 'name', staff.staffName)
} else {
this.$set(staff, 'name', staff.departmentName)
}
if (staff.staffId && !this.ids.includes(staff.staffId)) {
this.ids.push(staff.staffId)
return true
} else if (staff.staffId && this.ids.includes(staff.staffId)) {
return false
} else if (staff.entmicroStaffResponses) {
staff.staffId = staff.id
return true
}
})
const children = [...child, ...entmicroStaffResponses]
item.children = children
//清除没有员工的部门
if (!item.staffName && item.entmicroStaffResponses === null) {
data.splice(index, 1)
}
children.length && this.initData(children)
})
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
search() { },
handleNodeClick() {
this.userList = this.$refs.tree.getCheckedNodes().filter(item => item.children && item.children.length == 0)
this.isIndeterminate = this.userList.length > 0 && this.userList.length < this.ids.length
this.checkAll = this.userList.length === this.ids.length
},
remove(index) {
this.userList.splice(index, 1)
let ids = this.userList.map(item => item.staffId)
this.$refs.tree.setCheckedKeys(ids)
this.isIndeterminate = ids.length < this.ids.length
}
}
}
</script>
<style scoped lang="scss">
.member-wrapper {
display: flex;
.member-left {
width: 400px;
.member-content {
border: 1px solid #eee;
.member-content-head {
height: 44px;
line-height: 44px;
padding: 0 16px;
}
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
.el-input {
margin: 20px 20px 6px 20px;
width: 360px;
height: 36px;
box-sizing: border-box;
}
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 264px;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 44px;
height: 44px;
border: 1px solid #eee;
display: flex;
justify-content: space-between;
align-items: center;
.blue {
color: #5850ff;
cursor: pointer;
}
}
}
}
.table-content {
max-height: 456px;
overflow: auto;
border: 1px solid #eee;
}
.table-content .el-tree {
margin: 0 20px 20px;
}
.member-right {
width: 300px;
margin-left: 14px;
}
.member-name {
font-size: 14px;
color: #333;
line-height: 60px;
height: 60px;
padding: 0 20px;
border: 1px solid #eee;
}
.input-tag-wrapper {
max-height: 456px;
overflow: scroll;
}
.tag-box {
margin: 12px 8px;
.el-tag {
margin-right: 4px;
margin-bottom: 4px;
background-color: #fff !important;
font-weight: 400;
font-size: 14px;
color: #666666;
line-height: 20px;
padding: 3px 8px;
height: auto;
}
}
</style>
<!-- 车损升级订单 -->
<template>
<div class="purchase">
<div class="container">
<GLCombiForm ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="showFormData"
@handleOk="handleSearch"
@handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<el-button type="primary"
class="btn"
size="small"
@click="exportExcel">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="orderRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div class="table-btns"
slot="auth-button"
slot-scope="scope">
<el-button type="text"
v-if="[1, 2, 3, -1, 5].includes(scope.scope.orderStatus) || [2].includes(scope.scope.equityOrderStatus)"
@click="handlePrint(scope.scope)">打印</el-button>
<el-button type="text"
v-if="[2].includes(scope.scope.equityOrderStatus) && [3, 5].includes(scope.scope.orderStatus)"
@click="handlePrintContract(scope.scope)">打印合同</el-button>
<el-button type="text"
@click="handleDetail(scope.scope)">详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { Util, downLoadFile } from '@/common/util'
import { manageTypeList } from '@/common/constant.js'
export default {
name: 'CarDamage',
components: {
},
data() {
return {
sessionInfo: this.$globalState.session,
size: 'small',
url: url,
searchForm: {
orderStatus: "",
merchantName: "",
goodsName: "",
createTime: ""
},
showFormData: [
{
label: "客户姓名",
name: "customerName",
type: "input",
isClear: true
},
{
label: "服务状态",
name: "orderStatus",
type: "select",
optionList: [],
optionId: "severType",
optionLabel: "severName",
optionsName: "severTypeList"
},
{
label: "商户名称",
name: "merchantName",
type: "input",
maxlength: "20",
isClear: true
},
{
label: "商品名称",
name: "goodsName",
type: "input",
maxlength: "20",
isClear: true
},
{
label: "车架号",
name: "carVin",
type: "input",
isClear: true
},
{
label: "创建时间",
name: "createTime",
type: "datePicker",
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
],
tableSearchForm: {},
// 表格
getListApi: this.$apis.order.getQuotationPageApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: "报价单号",
prop: "orderId",
minWidth: "200"
},
{
label: "客户姓名",
prop: "customerName",
width: "200px"
},
{
label: "车架号",
prop: "carVin",
width: "250px"
},
{
label: "保险公司",
prop: "insuranceCompany",
minWidth: 100
},
{
label: "状态",
prop: "orderStatus",
width: "100",
formatter: (cellValue) => {
if (cellValue.orderStatus == 4) {
return "已支付"
} else {
return this.baseData.severTypeList
.map((item) => item.severType)
.includes(cellValue.orderStatus)
? this.baseData.severTypeList.find(
(item) => item.severType === cellValue.orderStatus
).severName
: "-"
}
}
},
{
label: "备注",
prop: "remark"
},
{
label: "商品名称",
prop: "goodsName",
width: "200px"
},
{
label: "报价金额/元",
prop: "quotedPrice",
width: "200px"
},
{
label: "预计权益金额/元",
prop: "estEquityPrice",
width: "250px"
},
{
label: "实际权益金额/元",
prop: "equityPrice",
width: "250px"
},
{
label: "商户名称",
prop: "merchantName",
minWidth: 150
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 基本数据
baseData: {
severTypeList: [
{ severName: "待报价", severType: 0 },
{ severName: "待确认", severType: 1 },
{ severName: "待支付", severType: 2 },
{ severName: "已支付", severType: 3 },
{ severName: "战败", severType: -1 },
{ severName: "已完成", severType: 5 }
]
},
}
},
created() {
},
mounted() {
this.getOptionsList()
},
watch: {
},
methods: {
getParams() {
var params = Util.deepClone(this.searchForm)
if (this.searchForm.createTime?.length) {
params.minCreateTime = Util.dateFormate(this.searchForm.createTime[0], 'YYYY-MM-DD HH:mm:ss')
params.maxCreateTime = Util.dateFormate(this.searchForm.createTime[1], 'YYYY-MM-DD') + ' 23:59:59'
}
delete params.createTime
return params
},
beforeSearchFn() {
return new Promise((resolve) => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createTime
resolve()
})
},
getOptionsList(formName = 'showFormData', hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
handleSearch() {
this.$refs.orderRef.refreshTable()
},
handleReset() {
this.searchForm = {
orderStatus: "",
merchantName: "",
goodsName: "",
createTime: ""
}
this.handleSearch()
},
// 查看详情
handleDetail(row) {
this.$router.push({
path: '/orderManage/carDamageDetail',
query: row
})
},
exportExcel() {
var params = this.getParams()
this.$apis.order.quotationExportApi(params).then(res => {
downLoadFile(res)
})
},
// 打印报价单
handlePrint(row) {
this.$apis.order.quotationPrintApi({ id: row.id }).then((res) => {
console.log(res)
const oWin = window.open(res)
oWin.document.fn = function () {
if (oWin) {
oWin.print()
oWin.close()
}
}
const html =
'<div style="height: 100%;width: 100%;">' +
`<img src="${res}" onload="fn()" style="max-height:100%;max-width: 100%;" />` +
"</div>"
oWin.document.open()
oWin.document.write(html)
oWin.document.close()
})
},
// 打印权益合同
handlePrintContract(row) {
// 获取权益合同PDF
this.$apis.order.contractExportApi({ orderId: row.orderId }).then((res) => {
window.open(res)
})
},
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.purchase {
.table-header {
display: flex;
align-items: center;
margin-bottom: 25px;
margin-top: 20px;
h2 {
font-weight: 600;
font-size: 16px;
color: #333;
}
.glbtn {
left: 46px;
position: absolute;
}
.btn {
right: 47px;
position: absolute;
}
}
.greenSpot {
@include dot;
background: $color-green;
}
.yellowSpot {
@include dot;
background: $color-yellow;
}
.ashSpot {
@include dot;
background: $color-gray;
}
.table-btns /deep/.el-button--text {
min-width: 0 !important;
padding: 0;
}
.priceSpan {
font-size: 14px;
color: #909399;
}
}
</style>
<template>
<div class="el-select-dropdown el-popper group-select" :style="groupStyle">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'ElSelectDropdown',
props: {
appendToBody: {
type: Boolean,
default: true
},
domEl: {
type: Object,
default: () => {}
}
},
componentName: 'selectyy',
data() {
return {
groupStyle: '',
includeData:['el-input__inner','placeholder','el-select__caret el-input__icon el-icon-arrow-up']
}
},
mounted() {
if (this.appendToBody) document.body.appendChild(this.$el)
this.getBoundingClientRect()
window.addEventListener('resize', this.getBoundingClientRect)
document.addEventListener('click', e => {
if (!this.includeData.includes(e.target.className)) {
this.removeEl()
}
})
},
methods: {
getBoundingClientRect() {
let { left, top } = this.domEl.getBoundingClientRect()
this.groupStyle = { left: left + 'px', top: top + 45 + 'px' }
},
removeEl() {
document.body.contains(this.$el) && document.body.removeChild(this.$el)
this.$emit('changeStatu')
}
},
beforeDestroy() {
this.removeEl()
}
}
</script>
<style lang="scss" scoped>
.group-select {
min-width: 284px;
transform-origin: center top;
z-index: 10000;
position: fixed;
top: 740px;
left: 600px;
/deep/ .el-select-dropdown__item {
width: 236px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
</style>
<!-- 采购商城 -->
<template>
<div class="mallContainer">
<div class="bg header addressCon" slot="header">
<div class="addressTitle">
<img src="@/images/addressIcon.webp" alt="" class="icon" />
<span class="title">{{ $$(addressInfo, 'yqMerchantName') }}</span>
<span class="edit pointer" @click="addressComVisible = true">
<img src="@/images/editAddressIcon.webp" alt="" class="editIcon" />
修改
</span>
</div>
<div class="addressInfo">
<!-- 收货人:白敬亭 -->
<span class="name">
收货人:
<span class="label">{{ $$(addressInfo, 'contactName') }}</span>
</span>
<span class="phone">
电话:
<span class="label">{{ $$(addressInfo, 'contactPhone') }}</span>
</span>
<span class="address">
收货地址:
<span class="label">{{ $$(addressInfo, 'contactAddress') }}</span>
</span>
</div>
</div>
<div class="d2-container-content shopMallCon">
<!-- :stretch="false" -->
<div class="classifyContainer">
<el-tabs v-model="searchForm.goodsType" @tab-click="handleSearch" type="card">
<el-tab-pane v-for="(item, i) in navList" :key="i" class="tabItem" :label="item.goodsTypeName" :name="item.goodsType"></el-tab-pane>
</el-tabs>
</div>
<div class="searchCon">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleRest"></GLCombiForm>
</div>
<div class="goodsCon">
<div class="goodsItemCon" v-for="(item, index) in purchaseList" :class="[{ active: item.active }, { last: index === purchaseList.length - 1 }]" :key="index" >
<!-- 图片{{ item.thumbUrl }} -->
<img :src="item.thumbUrl" class="img" alt="" />
<span class="goodsName one-line-ellipsis">{{ item.goodsName }}</span>
<!-- 名称{{ item.goodsName }} -->
<span class="purchaseOrderCount">成交量/笔:{{ item.purchaseOrderCount }}</span>
<!-- 成交量{{ item.purchaseOrderCount }} -->
<span class="viewPurchase pointer" @click="handleDetail(item, index)">查看购买</span>
</div>
<div class="emptyCom" v-show="!purchaseList.length">
<img :src="emptyImgUrl" class="emptyImg" alt="" />
<span class="tips">暂无数据</span>
</div>
</div>
<div class="pageCon">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNum" :page-sizes="[10, 20, 30, 40]" :page-size="page.pageSize" :total="total" layout="->,prev,pager,next" />
</div>
</div>
<!-- 购物车组件 -->
<shoppingCartCom ref="shoppingCartCom" :address-info="addressInfo" @editAddress="orderFrom" />
<addressCom :visible.sync="addressComVisible" @handleConfirmAddress="addressGet" :address-info="addressInfo" />
<goodsDetailCom :visible.sync="goodsDetailComVisible" :goods-id="selectItem.id" />
</div>
</template>
<script>
import shoppingCartCom from './components/shoppingCartCom'
import addressCom from './components/addressCom'
import goodsDetailCom from './components/goodsDetailCom'
export default {
name: 'PurchasingMall',
components: {
shoppingCartCom,
addressCom,
goodsDetailCom
},
data() {
return {
// userInfo: this.$store.state.d2admin.user.info,
addressComVisible: false,
goodsDetailComVisible: false,
emptyImgUrl: require('@/assets/empty.png'),
showFormData: [
{
name: 'goodsName',
type: 'input',
placeholder: '商品名称/系列',
width: '282px'
}
],
searchForm: {
goodsType: '',
goodsName: ''
},
total: 0,
page: {
pageNum: 1,
pageSize: 12
},
navList: [],
purchaseList: [],
addressInfo: {
contactName: '',
contactPhone: '',
contactAddress: '',
yqMerchantName: '',
yqMerchantId: ''
},
productType: [],
selectItem: {},
showOrderCom: false
}
},
created() {
this.getGoodsCategoryConfiguration()
this.listWithPagePurchaseInfo()
this.addressGet()
},
mounted() {},
methods: {
orderFrom() {
this.addressComVisible = true
this.showOrderCom = true
},
handleSearch() {
this.page.pageNum = 1
this.listWithPagePurchaseInfo()
},
handleRest() {
this.searchForm.goodsName = ''
this.page.pageNum = 1
this.listWithPagePurchaseInfo()
},
handleDetail(item, index) {
this.selectItem = item
this.goodsDetailComVisible = true
const list = this.$common.utils.deepClone(this.purchaseList)
this.purchaseList = list.map((item, itemIndex) => {
item.active = itemIndex == index
return item
})
},
listWithPagePurchaseInfo() {
const params = {
...this.page,
goodsType: +this.searchForm.goodsType || '',
goodsName: this.searchForm.goodsName
}
this.$apis.purchaseShopping
.listWithPagePurchaseInfo(params)
.then(result => {
const { list, total } = result
this.purchaseList = list
this.total = total
})
.catch(err => {
console.log(err)
})
},
// 获取类目列表
getGoodsCategoryConfiguration() {
this.$apis.sysBase.getGoodsCategoryConfiguration({ sceneType: 1, shoppingMallFlag: true }).then(result => {
const { list } = result
if (list.length) {
const navList = list.map(({ categoryType, categoryName }) => {
return {
goodsType: categoryType.toString(),
goodsTypeName: categoryName
}
})
this.navList = [{ goodsType: '', goodsTypeName: '所有' }, ...navList]
}
})
},
addressGet() {
this.$apis.purchaseShopping
.addressGet()
.then(result => {
if (result) {
this.addressInfo = result
}
if (this.showOrderCom) {
this.showOrderCom = false
this.$refs.shoppingCartCom.validateGoodsNumber()
}
})
.catch(err => {
console.log(err)
})
},
// 每页条数
handleSizeChange(value) {
// this.page.pageSize = value
// this.getList()
},
// 页码
handleCurrentChange(value) {
this.page.pageNum = value
this.listWithPagePurchaseInfo()
}
},
beforeDestroy() {
// this.$EventBus.$off('updateCarShopping')
}
}
</script>
<style lang="scss" scoped>
::v-deep.mallContainer {
max-width: 1350px;
margin: 0 auto;
overflow: scroll;
.bg {
background: #fff;
}
.d2-header-switch {
display: none;
}
.d2-container-content {
margin: 20px auto;
background: #fff;
}
.shopMallCon {
padding: 0 0 20px !important;
}
.goodsCon {
box-sizing: border-box;
padding: 0 40px;
display: flex;
// justify-content: space-between;
flex-wrap: wrap;
.goodsItemCon {
box-sizing: border-box;
width: 177px;
height: 272px;
display: flex;
flex-direction: column;
background: #f9f9f9;
border-radius: 4px;
// margin-bottom: 16px;
margin: 0 16px 16px;
overflow: hidden;
padding: 8px 8px 16px;
&:hover{
border: 1px solid #5850ff;
}
&.active {
border: 1px solid #5850ff;
}
.img {
width: 157px;
height: 157px;
margin-bottom: 8px;
}
.goodsName {
font-weight: 600;
color: #333333;
margin-bottom: 8px;
}
.purchaseOrderCount {
font-size: 12px;
color: #666666;
margin-bottom: 16px;
}
.viewPurchase {
font-size: 14px;
color: #5850ff;
}
}
.last {
margin-right: auto;
}
}
.emptyCom {
display: flex;
flex-direction: column;
margin: 75px auto;
text-align: center;
.tips {
font-size: 20px;
color: #666;
margin: 16px 0;
}
}
.d2-container-full__body {
overflow-x: hidden !important;
}
}
.addressCon {
padding: 10px 20px;
.addressTitle {
display: flex;
align-items: center;
.title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
}
.edit {
display: flex;
align-items: center;
margin-left: auto;
font-size: 14px;
color: #5850ff;
}
.editIcon {
width: 20px;
height: 20px;
}
}
.icon {
width: 32px;
height: 32px;
margin-right: 8px;
}
.addressInfo {
display: flex;
box-sizing: border-box;
flex-wrap: wrap;
// align-items: space-between;
align-items: center;
// justify-content: space-between;
width: 100%;
// height: 36px;
padding: 15px 20px 0;
margin-top: 10px;
background: #f9f9f9;
font-size: 14px;
color: #666666;
> span {
margin-right: 25px;
margin-bottom: 15px;
}
.label {
color: #333333;
// margin-left: 0px;
}
.address {
min-width: 500px;
}
}
}
.searchCon {
height: 65px;
.show-search {
width: 670px !important;
min-width: 670px;
}
/deep/ .name {
width: 20px !important;
}
}
::v-deep.classifyContainer {
width: 100%;
.el-tabs__nav {
border-top: none !important;
}
}
</style>
<template>
<el-drawer class="shoppingCartDrawerCon" title="收货地址管理" size="500px" :visible.sync="dialogShow" :direction="direction">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="100px" default-width="350px"
:form-ref="editChildRef" :form-obj="editForm" :form-data="editFormData" :form-rules="editRule"></glsx-combi-form>
<div class="footer-btn">
<el-button @click="submit" type="primary">保存</el-button>
<el-button @click="dialogShow = false">取消</el-button>
</div>
</el-drawer>
</template>
<script>
import { checkPhone as validPhone } from '@/utils/index'
export default {
name: 'AddressCom',
props: {
visible: {
type: Boolean,
default: false
},
addressInfo: {
type: Object,
default: () => {
return {}
}
}
},
data() {
function checkPhone(rule, value, callback) {
if (!validPhone(value)) {
callback(new Error('请输入正确的手机号码'))
return false
}
callback()
}
return {
direction: 'rtl',
editFormData: [
{
label: '收货人',
name: 'contactName',
type: 'input',
maxlength: 10,
placeholder: '请输入姓名'
},
{
label: '收货人电话',
name: 'contactPhone',
type: 'input',
maxlength: 20,
placeholder: '请输入电话号码'
},
{
label: '收货地址',
name: 'contactAddress',
type: 'input',
maxlength: 50,
placeholder: '请输入收货地址',
inputType: 'textarea'
// tips: '如XX店车主关怀活动'
}
],
editForm: {
contactName: '',
contactPhone: '',
contactAddress: ''
},
editRule: {
contactName: [{ required: true, message: '请输入姓名', trigger: 'change' }],
contactPhone: [{ required: true, message: '请输入电话号码', trigger: 'change' },
{ validator: checkPhone, trigger: 'blur' }],
contactAddress: [{ required: true, message: '请输入收货地址', trigger: 'change' }]
},
editChildRef: 'editChildRef'
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
watch: {
visible(val) {
if (val) {
this.editForm = this.addressInfo ? this.$common.utils.deepClone(this.addressInfo) : {}
}
}
},
methods: {
handleDetailClose() {
},
handleOkFn() {
// console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
},
submit() {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
const params = this.$common.utils.deepClone(this.editForm)
this.$apis.purchaseShopping.addressSave(params).then((result) => {
this.$notify({
type: 'success',
title: '保存成功'
})
this.dialogShow = false
this.$emit('handleConfirmAddress')
}).catch((err) => {
})
}
})
},
navBack() {
}
}
}
</script>
<style lang="scss" scoped>
.shoppingCartDrawerCon {
// position: relative;
::v-deep .el-drawer__header {
border-bottom: 1px solid #e7eaec;
margin-bottom: 20px;
padding-bottom: 10px;
font-weight: 600;
font-size: 20px;
}
.footer-btn {
text-align: center;
}
}
</style>
<template>
<!-- <div>商品详情</div> -->
<GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情" :close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose">
<div class="detail-content">
<!-- 商品详情 -->
<div class="goodsInfoCom">
<div class="goodsInfoCom__left">
<img :src="goodsInfo.thumbUrl" alt="" />
</div>
<div class="goodsInfoCom__right">
<p class="title two-line-ellipsis">{{ goodsInfo.goodsName }}</p>
<div class="priceCon">
<span class="price">
价格:
<span class="priceNum">¥{{ handleItemInfo.purchasePrice }}</span>
</span>
<span class="turnover">
成交量:
<span class="num">{{ goodsInfo.purchaseOrderCount || 0 }}笔</span>
</span>
</div>
<div class="skuCon">
<div class="label">规格:</div>
<div class="itemCon">
<div
class="skuItem one-line-ellipsis pointer"
:class="{ active: index === selectIndex }"
v-for="(item, index) in goodsInfo.upgradeGoodsList"
:key="index"
@click="
selectIndex = index
setHandleItemInfo(item)
"
>
{{ item.upgradeGoodsName }}
</div>
</div>
</div>
<div class="munCom">
<div class="label">数量:</div>
<div class="munItem">
<el-input-number v-model="handleItemInfo.goodsNumber" :min="1" :max="9999"></el-input-number>
</div>
<div class="tips">
<!-- goodsItem.goodsType == 1 -->
{{ membraneTypeList.includes(goodsInfo.goodsType) ? `卷(1卷=${goodsInfo.convertedValue || 30}米)` : '件' }}
</div>
</div>
<el-button class="carBtn" icon="carIcon" type="primary" @click="updateCarShopping">加入购物车</el-button>
</div>
<!-- <i class="carIcon"></i> -->
</div>
<h3 style="margin-top:20px;">产品详情</h3>
<div class="goodsDescList">
<div class="goodsDescItem" v-for="(item, index) in goodsInfo.goodsDescList" :key="index">
<img :src="item.content" v-if="item.resType == 1" class="productDetailsImg" alt="" />
<!-- <div class="goodsDescItem__title">{{ item.title }}</div> -->
<div v-if="item.resType == 2" class="goodsDescItem__content" v-html="item.content"></div>
</div>
</div>
</div>
</GLDialog>
</template>
<script>
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'GoodsDetailCom',
props: {
visible: {
type: Boolean,
default: false
},
selectItemInfo: {
type: Object,
default: () => {}
},
goodsId: {
type: [String, Number]
// required: true
// default: '24'
}
},
data() {
return {
// dialogShow: false,
membraneTypeList,
goodsInfo: {},
selectIndex: 0,
handleItemInfo: {
goodsNumber: 1,
upgradeGoodsId: '',
purchasePrice: 0
}
}
},
computed: {
dialogShow: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
// selectItemInfo(){
// // this.goodsInfo[]
// if (this.goodsInfo.upgradeGoodsList.length) {
// let item = this.goodsInfo.upgradeGoodsList[this.selectIndex]
// return {
// goodsNumber: this.goodsInfo.num,
// upgradeGoodsId: item.id
// }
// }
// // return this.selectItemInfo
// }
},
watch: {
visible(val) {
if (val) {
this.handleItemInfo.goodsNumber = 1
this.getGoodsDetail()
}
}
},
methods: {
getGoodsDetail() {
this.$apis.product.getProductInfo({ id: this.goodsId }).then(res => {
this.goodsInfo = res
// 调试用
// for (let index = 0; index < 12; index++) {
// this.goodsInfo.upgradeGoodsList[index] = this.goodsInfo.upgradeGoodsList[0]
// }
// 默认选中第一个
const item = this.goodsInfo.upgradeGoodsList[0]
// console.log(item)
item && this.setHandleItemInfo(item)
})
},
setHandleItemInfo(item) {
console.log(item)
const { id, purchasePrice } = item
this.handleItemInfo = Object.assign(this.handleItemInfo, {
upgradeGoodsId: id,
purchasePrice
})
},
handleDetailClose() {
this.dialogShow = false
},
updateCarShopping() {
const params = {
goodsNumber: this.handleItemInfo.goodsNumber,
upgradeGoodsId: this.handleItemInfo.upgradeGoodsId
}
// 判断是否有值
params.upgradeGoodsId &&
this.$apis.purchaseShopping.shoppingCarAdd(params).then(res => {
// console.log(res)
this.$message.success('加入购物车成功')
this.$EventBus.$emit('updateCarShopping')
this.dialogShow = false
})
// this.$message.success('加入购物车成功')
// this.$EventBus.$emit('updateCarShopping')
}
}
}
</script>
<style lang="scss" scoped>
.goodsInfoCom {
display: flex;
.goodsInfoCom__left {
width: 400px;
height: 400px;
img {
width: 100%;
height: 100%;
}
}
.goodsInfoCom__right {
flex: 1;
margin-left: 20px;
.title {
margin: 0;
font-weight: 600;
font-size: 20px;
color: #333333;
}
.priceCon {
box-sizing: border-box;
width: 100%;
height: 65px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 10px;
margin: 16px 0 20px;
background: #f2f5fb;
border-radius: 2px;
color: #666666;
.price {
display: flex;
align-items: center;
margin-left: 8px;
}
.num {
margin-left: 8px;
}
.priceNum {
font-weight: 600;
font-size: 30px;
color: #ee3040;
margin-left:8px;
}
}
.skuCon {
display: flex;
// flex-wrap: wrap;
// align-items: center;
.itemCon {
flex: 1;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.skuItem {
box-sizing: border-box;
width: 234px;
height: 36px;
background: #ffffff;
border: 1px solid #e7edf9;
border-radius: 2px;
color: #333333;
text-align: center;
line-height: 36px;
padding: 0 10px;
margin-bottom: 16px;
&.active {
border: 1px solid #5850ff;
}
}
}
.label {
box-sizing: border-box;
width: 60px;
height: 36px;
text-align: center;
padding-left: 18px;
line-height: 36px;
color: #666666;
}
}
}
.productDetailsImg {
max-width: fit-content;
}
.munCom {
display: flex;
margin-bottom: 20px;
.tips {
height: 36px;
line-height: 36px;
margin-left: 8px;
font-size: 12px;
color: #666666;
}
}
.carBtn {
display: flex;
align-items: center;
width: 168px;
height: 40px;
margin-left:18px;
background: #5850ff;
border-radius: 4px;
}
</style>
<template>
<GLDialog v-if="dialogShow" bigTitle="详细信息" mode="big" :visible.sync="dialogShow" :close-on-click-modal="false" @onOk="dialogShow = false" @onCancel="dialogShow = false">
<div class="detail-content" v-if="dialogShow">
<div class="addressTitle">
<img src="@/images/addressIcon.webp" alt="" class="icon" />
<span class="title">{{ paramsObj.merchantName }}</span>
</div>
<div class="address-info">
<span class="name">
收货人:
<span class="label">{{ detailInfo.contactName }}</span>
</span>
<span class="phone">
电话:
<span class="label">{{ detailInfo.contactPhone }}</span>
</span>
<span class="address">
收货地址:
<span class="label">{{ detailInfo.contactAddress }}</span>
</span>
</div>
<div class="table-class">
<GLTable ref="purchaseOrderDetailTable" :tableParams="tableParams" @refreshTable="refreshTable" :tableData="detailInfo.tableData" :pageConf="pageConf" :tableTotal="detailInfo.tableTotal"></GLTable>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="dialogShow = false">关闭</el-button>
</span>
</GLDialog>
</template>
<script>
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'OrderDetailDialog',
props: {
visible: {
type: Boolean,
default: false
},
paramsObj: {
type: Object,
default: () => {}
}
},
computed: {
dialogShow: {
get() {
if (this.visible) {
this.getDetail({ currentPage: 1, pageSize: 20 })
}
return this.visible
},
set(val) {
this.$emit('update:visible', val)
}
}
},
data() {
return {
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '商品名称',
prop: 'upgradeGoodsName'
},
{
label: '系列',
prop: 'goodsName'
},
{
label: '所属分类',
prop: 'goodsTypeName'
},
{
label: '采购数量',
prop: 'goodsNumber',
formatter: cellValue => {
return membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷/${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
}
},
{
label: '采购总价/元',
prop: 'goodsTotalPrice',
formatter: cellValue => {
return '¥' + cellValue.goodsTotalPrice
}
}
]
},
detailInfo: {}
}
},
methods: {
handleDetailClose() {
this.dialogShow = false
},
refreshTable(pageObj) {
this.getDetail(pageObj)
},
getDetail(pageObj) {
this.$apis.purchaseShopping.purchaseOrderDetail({ orderCode: this.paramsObj.orderCode, pageSize: pageObj.pageSize, currentPage: pageObj.currentPage }).then(res => {
this.detailInfo = res
this.detailInfo.tableData = res.pagination.list
this.detailInfo.tableTotal = res.pagination.total
})
}
}
}
</script>
<style lang="scss" scoped>
.addressTitle {
display: flex;
align-items: center;
.title {
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
}
.icon {
width: 28px;
height: 28px;
margin-right: 8px;
}
}
.address-info {
display: flex;
box-sizing: border-box;
align-items: center;
// justify-content: space-between;
flex-wrap: wrap;
width: 100%;
// height: 36px;
padding: 0 20px;
margin-top: 10px;
font-size: 14px;
color: #666666;
> span {
margin-right: 20px;
margin-bottom: 10px;
}
.label {
color: #333333;
}
.address {
min-width: 500px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!