Commit 785bb1e8 by 前端

提交部分23.0需求代码

1 parent 256e86ce
......@@ -8,74 +8,74 @@
<link rel="icon" href="<%= BASE_URL %>icon.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>
<%= VUE_APP_TITLE %>
</title>
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
width: 100%;
}
<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>
<%= VUE_APP_TITLE %>
</title>
<style>
html,
body,
#app {
height: 100%;
margin: 0px;
padding: 0px;
width: 100%;
}
.d2-home {
background-color: #2A343D;
height: 100%;
display: flex;
flex-direction: column;
}
.d2-home {
background-color: #2A343D;
height: 100%;
display: flex;
flex-direction: column;
}
.d2-home__main {
user-select: none;
width: 100%;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.d2-home__main {
user-select: none;
width: 100%;
flex-grow: 1;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.d2-home__footer {
width: 100%;
flex-grow: 0;
text-align: center;
padding: 1em 0;
}
.d2-home__footer {
width: 100%;
flex-grow: 0;
text-align: center;
padding: 1em 0;
}
.d2-home__footer>a {
font-size: 12px;
color: #fff;
text-decoration: none;
}
.d2-home__footer>a {
font-size: 12px;
color: #fff;
text-decoration: none;
}
.d2-home__loading {
height: 32px;
width: 32px;
margin-bottom: 20px;
}
.d2-home__loading {
height: 32px;
width: 32px;
margin-bottom: 20px;
}
.d2-home__title {
color: #FFF;
font-size: 20px;
margin-bottom: 10px;
}
.d2-home__title {
color: #FFF;
font-size: 20px;
margin-bottom: 10px;
}
.d2-home__sub-title {
color: #fff;
font-size: 14px;
}
</style>
<!-- <script>
.d2-home__sub-title {
color: #fff;
font-size: 14px;
}
</style>
<!-- <script>
var _hmt = _hmt || [];
var hmid = "1dfa88d0c8571eef2d383070cb3e5ca1";
(function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?" + hmid; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})();
......@@ -109,11 +109,12 @@
</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>
<% } %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %>
</body>
<script>
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=1.4.15&key=44cc16e43ad7ed3358df507bd0618181&plugin=AMap.Geocoder&plugin=AMap.PlaceSearch&plugin=AMap.Geolocation">
</script>
</script>
</html>
\ No newline at end of file
import request from "./request"
const path = "dj.api.smartcarlife."
// 分页查询店面配置列表
export function shopSettingList(data) {
data.method = `${path}serviceMerchant.shopSettingList`
return request(data)
}
// 店铺设置保存
export function shopSetting(data) {
data.method = `${path}serviceMerchant.shopSetting`
return request(data)
}
// 获取店铺设置
export function getShopSetting(data) {
data.method = `${path}serviceMerchant.getShopSetting`
return request(data)
}
// 根据商户号年份查询产值
export function listByMerchantIdAndYear(data) {
data.method = `${path}workbench.listByMerchantIdAndYear`
return request(data)
}
// 查询员工分页列表
export function findStaffByPage(data) {
data.method = `merchants.api.staff.findStaffByPage`
return request(data)
}
// 根据商户名称和渠道类型查询商户列表
export function findMerchantList(data) {
data.method = `merchants.api.open.findMerchantList`
return request(data)
}
......@@ -637,3 +637,27 @@ export const applyStatus = [
{ confId: 2, confName: "已审核" },
{ confId: 3, confName: "已驳回" }
]
//店面配置 业务性质
export const businessNature = [
{ confId: 1, confName: "直营渠道" },
{ confId: 2, confName: "直营4S店" }
]
//店面配置 门店类型
export const storeType = [
{ confId: 1, confName: "嘀加" },
{ confId: 2, confName: "广汇" },
{ confId: 3, confName: "直营" }
]
//店面配置 部署场景
export const sceneForShop = [
{ confId: 1, confValue: "1.1精品升级" },
{ confId: 2, confValue: "1.2次新车升配" },
{ confId: 3, confValue: "1.3售后众筹" },
{ confId: 0, confValue: "2.1会员权益/升级" },
{ confId: 4, confValue: "2.2续保膨胀金" }
]
//店面配置 员工类型
export const staffBusinessType = [
{ confId: 0, confValue: "驻店人员" },
{ confId: 1, confValue: "门店销售" }
]
......@@ -99,3 +99,19 @@ export const rangePickerOptions_year_2023 = {
return false
}
}
/**
* 时间控件-单年份选择时限制年份
*/
export const rangePickerOptions_year = {
disabledDate(date) {
// console.log(date)
// console.log(date.getFullYear())
// console.log(new Date())
if (date.getFullYear() >= new Date().getFullYear()) {
return true
}
return false
}
}
......@@ -617,5 +617,115 @@ export const routerName = {
}
],
component: _import("systemConfig/OpenshopProcess/index")
},
90619: {
path: "/shopConfig",
name: "shopConfig",
meta: {
title: "店面配置",
authId: "90619",
parentId: "906",
cache: false
},
auth: [
{
authId: "9061901",
parentId: "90619",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
},
{
authId: "9061902",
parentId: "90619",
label: "导入更新",
category: "Button",
type: "primary",
handle: "handleImport"
},
{
authId: "9061903",
parentId: "90619",
label: "收款码",
handle: "collectionQRcode"
},
{
authId: "9061904",
parentId: "90619",
label: "工单设置",
handle: "handleSet",
addRoutePath: [
{
authId: "9061905",
name: "工单设置页面",
parentId: "9061904"
}
]
},
{
authId: "9061906",
parentId: "90619",
label: "店铺设置",
handle: "handleShopSet",
addRoutePath: [
{
authId: "9061907",
name: "店铺设置页面",
parentId: "9061906"
}
]
},
{
authId: "9061908",
parentId: "90619",
label: "人员管理",
handle: "handlePersonnelManage",
addRoutePath: [
{
authId: "9061909",
name: "人员管理页面",
parentId: "9061908"
}
]
}
],
component: _import("systemConfig/ShopConfig/index")
},
9061905: {
path: "/setWorkorderDetail",
name: "setWorkorderDetail",
meta: {
title: "配置详情",
authId: "9061905",
parentId: "9061904",
cache: false,
activePath: "/setWorkorderDetail"
},
component: _import("systemConfig/ShopConfig/setWorkorderDetail")
},
9061907: {
path: "/shopSet",
name: "shopSet",
meta: {
title: "店铺设置",
authId: "9061907",
parentId: "9061906",
cache: false,
activePath: "/shopSet"
},
component: _import("systemConfig/ShopConfig/shopSet")
},
9061909: {
path: "/personnelManagement",
name: "personnelManagement",
meta: {
title: "人员管理",
authId: "9061909",
parentId: "9061908",
cache: false,
activePath: "/personnelManagement"
},
component: _import("systemConfig/ShopConfig/personnelManagement")
}
}
......@@ -250,9 +250,9 @@ export default {
})
},
handleSearch() {
this.$refs.recordTable.refreshTable()
},
// handleSearch() {
// this.$refs.recordTable.refreshTable()
// },
handleReset() {
this.searchForm = {
merchantName: '',
......
<template>
<d2-dialog title="收款二维码" :is-visible="qRcodeVisible" class="qRcodeDailog" width="750px" btn-ok-label="全部下载"
@closeDialog="handleClose" @confirmDialog="handleAddConfirm">
<div class="qrcon">
<div class="wxcon">
<div class="codeDiv" id="wxview">
<img style="width:100%;height:100%" src="../../images/code3.png">
<!-- v-if="qrCodeURL" <div class="imgDiv"> -->
<img v-if="qrCodeURL" class="qrImg" crossorigin="anonymous" :src="qrCodeURL">
<!-- crossorigin="anonymous" -->
<div v-if="!qrCodeURL" class="el-icon-loading loadingIcon" />
<!-- </div> -->
<div class="merchantNameDiv">{{ info.merchantName }}</div>
</div>
<el-button style="marginTop:20px" type="primary "
@click="takeScreenshot('wxview', `${info.merchantName}微信支付收款码`)">下载</el-button>
</div>
<div class="alicon">
<div class="codeDiv" id="aliview">
<img style="width:100%;height:100%" src="../../images/alipay.png">
<!-- <img v-if="aliqrCodeURL"
class="qrImg imgs"
:src="aliqrCodeURL"
crossorigin="anonymous"> -->
<div id="qrcodeDiv" class="qrImg" />
<!-- -->
<!-- :src="aliqrCodeURL"> -->
<div v-if="!aliqrCodeURL" class="el-icon-loading loadingIcon" />
<!-- </div> -->
<div class="merchantNameDiv">{{ info.merchantName }}</div>
</div>
<el-button style="marginTop:20px" type="primary "
@click="takeScreenshot('aliview', `${info.merchantName}支付宝支付收款码`)">下载
</el-button>
</div>
</div>
</d2-dialog>
</template>
<script>
// alipayQrcode
import { createWeappQrcode } from '@api/serviceManage'
import { baseConfig } from '@/main'
import html2canvas from 'html2canvas'
import QRCode from "qrcodejs2"
export default {
name: 'QRcodeDialog',
data() {
return {
infoForm: {
merchantType: '',
merchant: [],
payStartDate: '',
payEndDate: '',
reportType: '1'
},
// 基本数据
baseData: {
merchantList: []
},
qrCodeURL: '',
aliqrCodeURL: '',
defaultImg: require('../../images/defaultImg.png')
}
},
props: {
qRcodeVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: null
}
},
watch: {
},
created() {
},
components: {},
mounted() {
this.createQrcodeImage()
this.alipayQrcode()
},
methods: {
/**
* @description: 图片转base64
* @param {String} url 需要转换的图片原链接(http://....jpg)
* @param {String} outputFormat 转换出来的图片的类型(canvas支持jpg/png格式)
* @return: 返回图片对应的base64编码
*/
getBas64(url, outputFormat = 'image/png') {
return new Promise(function (resolve, reject) {
let canvas = document.createElement('CANVAS')
const ctx = canvas.getContext('2d')
const img = new Image()
img.crossOrigin = 'Anonymous' // 重点!设置image对象可跨域请求
img.onload = function () {
canvas.height = img.height
canvas.width = img.width
ctx.drawImage(img, 0, 0)
const dataURL = canvas.toDataURL(outputFormat)
canvas = null
resolve(dataURL)
}
// img.src = url; // 旧的方式
img.src = url + '?t=' + new Date().valueOf() // 防止oss的缓存问题
})
},
createQrcodeImage() {
const oParams = {}
oParams.channelType = 1
oParams.appId = 'wx06d1198e751435d1'
// oParams.appId = 'wx902f0b9c4b2c669d'
oParams.qrcodeType = 'QR_WXA_UNLIMIT'
oParams.path = 'packagesPayment/pages/QRPayment/QRPayment'
// oParams.scene = `merchantId=${this.info.yqMerchantId}&merchantName=${this.info.yqMerchantName}`
oParams.scene = `shopMerchantId=${this.info.merchantId}&shopMerchantName=${this.info.merchantName}`
createWeappQrcode(oParams).then(res => {
this.qrCodeURL = res
// function getBase64(imgUrl) {
// window.URL = window.URL || window.webkitURL
// var xhr = new XMLHttpRequest()
// xhr.open('get', imgUrl, true)
// xhr.responseType = 'blob'
// xhr.onload = function () {
// if (this.status == 200) {
// // 得到一个blob对象
// var blob = this.response
// console.log('blob', blob)
// // 至关重要
// const oFileReader = new FileReader()
// oFileReader.onloadend = function (e) {
// // 此处拿到的已经是base64的图片了,可以赋值做相应的处理
// console.log(e.target.result)
// }
// oFileReader.readAsDataURL(blob)
// }
// }
// xhr.send()
// }
// console.log(getBase64(res))
// getBase64('需要转成base64的图片url')
})
},
// 下载保存图片
takeScreenshot(eleId, name) {
// const opts = {
// useCORS: true
// }
const that = this
html2canvas(document.getElementById(eleId), {
backgroundColor: null,
allowTaint: true, // 允许污染
taintTest: true, // 在渲染前测试图片(没整明白有啥用)
useCORS: true // 使用跨域(当allowTaint为true时这段代码没什么用,下面解释)
}).then(canvas => {
that.convertCanvasToImg(canvas, name)
// setTimeout(() => {
// })
})
},
// 转换图片格式
convertCanvasToImg(canvas, name) {
// canvas base64 转 blob
var myBlob = this.dataURLtoBlob(canvas.toDataURL('img/png', 0.92))
// blob转URL对象
const myUrl = URL.createObjectURL(myBlob)
// 创建a标签,下载图片
this.downImg(myUrl, name)
},
// base64 转 blob
dataURLtoBlob(dataurl) {
var arr = dataurl.split(','); var mime = arr[0].match(/:(.*?);/)[1]
var bstr = atob(arr[1]); var n = bstr.length; var u8arr = new Uint8Array(n)
while (n--) {
u8arr[n] = bstr.charCodeAt(n)
}
return new Blob([u8arr], { type: mime })
},
// 下载图片 filename是图片名称
downImg(url, name) {
// 创建a标签 并设置其相关属性,最后触发其点击事件
const a = document.createElement('a')
const clickEvent = document.createEvent('MouseEvents')
a.setAttribute('href', url)
a.setAttribute('download', name)
a.setAttribute('target', '_blank')
clickEvent.initEvent('click', true, true)
a.dispatchEvent(clickEvent)
},
// 生成支付宝中间二维码
alipayQrcode() {
// this
// const that = this
// let shareUrl = `https://www.baidu.com/`;
const shareUrl = `${baseConfig.alipayPath}?shopMerchantId=${this.info.merchantId}&shopMerchantName=${this.info.merchantName}`
console.log(baseConfig.alipayPath)
console.log(shareUrl)
setTimeout(() => {
console.log(document.getElementById('qrcodeDiv'))
const qrcode = new QRCode("qrcodeDiv", {
text: shareUrl,
width: 150, // 图像宽度
height: 150 // 图像高度
})
qrcode.clear() // 清除二维码
qrcode.makeCode(shareUrl) // 生成另一个新的二维码
this.aliqrCodeURL = qrcode
}, 500)
// this.$nextTick(() => {
// const qrcode = new QRCode('qrcodeDiv', {
// text,
// width: 150,
// height: 150,
// colorDark: '#000000',
// colorLight: '#ffffff',
// correctLevel: QRCode.CorrectLevel.H
// })
// console.log(qrcode)
// }, 2000)
// const params = {
// path: baseConfig.alipayPath,
// yqMerchantId: this.info.yqMerchantId,
// yqMerchantName: this.info.yqMerchantName
// }
// alipayQrcode(params).then((result) => {
// console.log(result)
// this.aliqrCodeURL = result
// this.$nextTick(() => {
// that.combinedPoster(result)
// // that.getBase64Image(result, document.querySelector('.imgs'))
// })
// }).catch((err) => {
// console.log(err)
// })
},
handleAddConfirm() {
this.takeScreenshot('wxview', `${this.info.yqMerchantName}微信支付收款码`)
setTimeout(() => {
this.takeScreenshot('aliview', `${this.info.yqMerchantName}支付宝支付收款码`)
}, 2000)
// this.takeScreenshot()
},
handleClose() {
this.$emit('dialogClose', true)
}
}
}
</script>
<style scoped>
.qrcon {
display: flex;
}
.wxcon,
.alicon {
text-align: center;
}
.wxcon {
margin-right: 20px;
}
.codeDiv {
width: 345px;
height: 468px;
margin: 0px auto;
position: relative;
/* background-image: url('./images/code3.png'); */
}
.qrImg {
position: absolute;
width: 150px;
height: 150px;
left: 50%;
top: 42%;
/* transform: translateX(-50%); */
transform: translate(-50%, -50%);
/* background-color: #d8d8d8; */
z-index: 2;
object-fit: contain;
/* transform: scale(0.95); */
}
.loadingIcon {
position: absolute;
/* width: 44px;
height: 44px; */
font-size: 30px;
/* top: 60px;
left: 60px; */
/* transform: translate(-50%, -50%); */
/* width: 150px;
height: 150px; */
position: absolute;
left: 46%;
top: 40%;
transform: translate(-50%, -50%);
}
.merchantNameDiv {
width: 150px;
/* height: 20px; */
position: absolute;
left: 50%;
top: 63%;
transform: translate(-50%, -50%);
text-align: center;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 17px;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
/* 自定义行数 */
-webkit-line-clamp: 2;
}
</style>
<!-- 人员管理 -->
<template>
<div>
<d2-container>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
labelWidth="100px"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { findStaffByPage, findMerchantList } from '@/api/shopConfig.js'
import { sceneForShop, staffBusinessType } from '@/common/constants.js'
export default {
name: 'PersonnelManagement',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
searchForm: {
merchantName: '',
partnerMerchantName: '',
merchantId: '',
sence: '',
businessType: '',
reviewStatus: ''
},
searchFormSearch: {},
showFormData: [{
label: '联系人/员工',
name: 'merchantName',
type: 'input',
maxlength: '20',
isClear: true
},
{
label: '手机号',
name: 'partnerMerchantName',
type: 'input',
inputType: "number",
maxlength: '11',
isClear: true
}, {
label: '场景标签',
name: 'sence',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'sceneForShop'
},
{
label: '来源商户',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'sceneForShop'
},
{
label: '商户号',
name: 'partnerMerchantName',
type: 'input',
inputType: "number",
maxlength: '9',
isClear: true
}, {
label: '类型',
name: 'businessType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'staffBusinessType'
}, {
label: '角色',
name: 'reviewStatus',
type: 'input',
maxlength: '20',
isClear: true
}],
getListApi: findStaffByPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '员工',
prop: 'merchantName',
width: '200px'
}, {
label: '手机号',
prop: 'phone',
width: '120px'
}, {
label: '角色',
prop: 'contactName',
width: '150px'
}, {
label: '部门',
prop: 'contactName',
width: '150px'
},
// {
// label: '类型',
// prop: 'merchantType',
// width: '100px',
// formatter: (cellValue) => {
// return {
// 1: '服务中心',
// 2: '客户'
// }[cellValue.merchantType]
// }
// },
{
label: '来源商户',
prop: 'yqMerchantName',
width: '150px'
}, {
label: '业务场景标签',
prop: 'partnerMerchantName',
width: '150px'
}, {
label: '更新时间',
prop: 'createdDate',
width: '150px',
formatter: (cellValue) => {
return cellValue.createdDate ? Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') : ''
}
}
]
},
baseData: {
sceneForShop: sceneForShop,
// staffBusinessType: staffBusinessType,
merchantList: []
},
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
this.findMerchantList()
this.getBaseData()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.getOptionsList()
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.deliveryDate) {
this.searchFormSearch.deliveryDateStart = Util.dateFormate(this.searchFormSearch.deliveryDate[0], 'YYYY-MM-DD 00:00:00')
this.searchFormSearch.deliveryDateEnd = Util.dateFormate(this.searchFormSearch.deliveryDate[1], 'YYYY-MM-DD 23:59:59')
delete this.searchFormSearch.deliveryDate
}
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
//来源商户
findMerchantList() {
findMerchantList({
channelType: 1
}).then(res => {
this.merchantList = res || []
})
},
handleSearch() {
this.$refs.recordTable.refreshTable()
},
handleReset() {
this.searchForm = {
merchantName: '',
partnerMerchantName: '',
reviewStatus: ''
}
this.$refs.recordTable.refreshTable()
},
}
}
</script>
<style lang="scss" scoped>
.reject-dialog {
margin: 65px 0;
.reject-input .el-textarea__inner {
height: 79px;
width: 432px;
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
}
.footer {
display: flex;
justify-content: end;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!