Commit 761a6351 by wangql

v4.8.0功能代码提交

1 parent 9dd42abb
......@@ -29,8 +29,10 @@
"flex.css": "^1.1.7",
"fuse.js": "^3.4.4",
"hotkeys-js": "^3.6.2",
"html2canvas": "^1.4.1",
"js-cookie": "^2.2.0",
"js-md5": "^0.7.3",
"jspdf": "^2.5.1",
"lodash": "^4.17.11",
"lowdb": "^1.0.0",
"nprogress": "^0.2.0",
......
......@@ -22,3 +22,21 @@ export function getOrderCount(data) {
data.method = `${path2}ordermanage.count`
return request(data)
}
//待补录订单统计(交易记录条数,已补录数,待补录数)
export function waitinputorderCount(data) {
data.method = `${path2}waitinputorder.count`
return request(data)
}
//待补录订单导出
export function waitinputorderExport(data) {
data.method = `${path2}waitinputorder.export`
return request(data)
}
//分页查询待补录订单
export function waitinputorderPage(data) {
data.method = `${path2}waitinputorder.page`
return request(data)
}
......@@ -48,3 +48,9 @@ export function UPDATEYQMERCHANTCONFIG(data) {
data.method = `dj.api.smarcarlife.yqMerchantConfig.modify`
return request(data, 'post')
}
// 生成小程序码
export function createWeappQrcode(data) {
data.method = `dj.api.smartcarlife.common.createWeappQrcode.new`
return request(data, 'post')
}
......@@ -513,6 +513,8 @@ export const resources = {
authId: '9040103',
parentId: '90401',
label: '待补录订单',
category: 'Button',
type: 'primary',
handle: 'handlMakeUpOrder',
addRoutePath: [
{
......@@ -782,6 +784,12 @@ export const resources = {
parentId: '90608',
label: '编辑',
handle: 'handleDetail'
},
{
authId: '9060802',
parentId: '90608',
label: '收款二维码',
handle: 'collectionQRcode'
}
],
component: _import('systemConfig/yqStoreManage')
......
......@@ -857,7 +857,8 @@ export default {
const apiName = this.userInfo.beSuper ? 'getList' : 'getYqList'
// console.log(params)
api[apiName](params).then(res => {
// api[apiName](params).then(res => {
api.getList(params).then(res => {
let temp = 1
this.tableData = res.list.map((item, index) => {
this.isSubOrder = !item.hasOwnProperty('subOrderProfitAllocations')
......
......@@ -19,17 +19,19 @@
<div class="d2-container-content">
<d2-table-header>
<span slot="left">累计订单金额:¥{{totalCount}}元</span>
<!-- <el-button type="primary"
<el-button type="primary"
size="mini"
class="orderTips"
icon="el-icon-download"
@click="handlMakeUpOrder"
v-if="jurisdictionFlag"
style="padding:0px 13px;height:30px;margin-top:6px">待补录订单
<span class="tipsNum"
v-show="waitOrderNum">{{waitOrderNum}}</span>
</el-button>&nbsp; -->
</el-button>
<!-- @click="downloadAccount" -->
<auth-button category="Button"></auth-button>
<!-- <auth-button category="Button"></auth-button> -->
<auth-button :showBtnIds="['9040101']"
category="Button"></auth-button>
</d2-table-header>
<el-table :data="tableData"
v-loading="$store.state.d2admin.loading.value"
......@@ -168,7 +170,7 @@
<script>
import { Util } from '@/common/util'
import { getList, exportFile, getOrderCount } from '@api/order'
import { getList, exportFile, getOrderCount, waitinputorderCount } from '@api/order'
import { mapActions } from 'vuex'
import { getServiceStore, getParkStore } from '@api/editCustomer'
export default {
......@@ -339,7 +341,8 @@ export default {
pageNum: 1,
pageSize: 20
},
totalCount: ''
totalCount: '',
jurisdictionFlag: false //待补录按钮权限标识
}
},
......@@ -356,6 +359,13 @@ export default {
this.showFormData = this.showFormData.filter(item => item.name !== 'yqMerchantId')
this.getServiceStore(this.userInfo.detail.merchantId)
}
const $store = this.$store.getters['d2admin/auth/curBtns']
const btnId = '9040103' //待补录订单权限ID
const _item = $store.find(i => (i.authId === btnId))
if (_item) {
this.jurisdictionFlag = true //是否有待补录订单按钮权限
this.getWaitinputorderCount()
}
this.getList()
this.getOrderCount()
},
......@@ -460,8 +470,6 @@ export default {
// 跳转订单补录
handlMakeUpOrder(data) {
console.log('跳转订单补录')
// console.log(data.row)
this.close({ tagName: '/orderDetail' })
this.$router.push({
name: 'orderSupplement'
// params: {
......@@ -479,7 +487,14 @@ export default {
handleCurrentChange(value) {
this.page.pageNum = value
this.getList()
}
},
//待补录订单数
getWaitinputorderCount() {
waitinputorderCount({}).then(res => {
this.waitOrderNum = res.waitInputCount
})
},
}
}
......
<!-- 下载对账单 -->
<template>
<d2-dialog title="收款二维码"
:isVisible="qRcodeVisible"
class="qRcodeDailog"
width="40%"
btnOkLabel="下载二维码"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm">
<div class="codeDiv"
id="view">
<img style="width:100%;height:100%"
src="./images/code3.png">
<div class="imgDiv">
<img style="width:100%;height:100%"
:src="qrCodeURL?qrCodeURL:defaultImg">
</div>
<div class="merchantNameDiv">{{info.yqMerchantName}}</div>
</div>
</d2-dialog>
</template>
<script>
import { createWeappQrcode } from '@api/serviceManage'
import html2canvas from 'html2canvas'
export default {
name: 'qRcodeDialog',
data() {
return {
infoForm: {
merchantType: '',
merchant: [],
payStartDate: '',
payEndDate: '',
reportType: '1'
},
// 基本数据
baseData: {
merchantList: []
},
qrCodeURL: '',
defaultImg: require('./images/defaultImg.png')
}
},
props: {
qRcodeVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: null
},
},
watch: {
},
created() {
},
components: {},
mounted() {
this.createQrcodeImage()
},
methods: {
createQrcodeImage() {
let oParams = {}
oParams.channelType = 1
oParams.appId = 'wx06d1198e751435d1'
oParams.qrcodeType = 'QR_WXA_UNLIMIT'
// oParams.path = 'packagesPayment/pages/QRPayment/QRPayment'
oParams.path = 'packagesPayment/pages/payment/index'
oParams.scene = `merchantId=${this.info.yqMerchantId}&merchantName=${this.info.yqMerchantName}`
createWeappQrcode(oParams).then(res => {
this.qrCodeURL = res
})
},
//下载保存图片
takeScreenshot() {
html2canvas(document.getElementById('view')).then(canvas => {
this.convertCanvasToImg(canvas)
});
},
//转换图片格式
convertCanvasToImg(canvas) {
// canvas base64 转 blob
var myBlob = this.dataURLtoBlob(canvas.toDataURL('img/png', 0.92))
// blob转URL对象
let myUrl = URL.createObjectURL(myBlob)
// 创建a标签,下载图片
this.downImg(myUrl)
},
//base64 转 blob
dataURLtoBlob(dataurl) {
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type: mime });
},
//下载图片 filename是图片名称
downImg(url) {
// 创建a标签 并设置其相关属性,最后触发其点击事件
let a = document.createElement("a")
let clickEvent = document.createEvent("MouseEvents");
a.setAttribute("href", url)
a.setAttribute("download", "filename")
a.setAttribute("target", '_blank')
clickEvent.initEvent('click', true, true)
a.dispatchEvent(clickEvent);
},
handleAddConfirm() {
this.takeScreenshot()
},
handleClose() {
this.$emit('dialogClose', true)
}
}
}
</script>
<style>
.dateItem {
display: flex;
}
.dateItem .el-form-item__content {
display: flex;
margin-left: 0 !important;
}
.codeDiv {
width: 345px;
height: 468px;
margin: 0px auto;
position: relative;
/* background-image: url('./images/code3.png'); */
}
.imgDiv {
width: 150px;
height: 150px;
position: absolute;
left: 50%;
top: 42%;
transform: translate(-50%, -50%);
background-color: #d8d8d8;
}
.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;
}
</style>
......@@ -28,8 +28,17 @@
:beforeSearchFn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope"></auth-button>
:data="scope.scope">
<!-- <el-button type="text"
size="mini"
style="margin-right: 10px;"
@click="collectionQRcode(scope.row)">收款二维码</el-button> -->
</auth-button>
</d2-table>
<qrcode-dialog :qRcodeVisible="qRcodeVisible"
:info="recordInfo"
v-if="qRcodeVisible"
@dialogClose="dialogClose"></qrcode-dialog>
</div>
</d2-container>
</template>
......@@ -46,7 +55,8 @@ import {
import { mapActions } from 'vuex'
import { BaseData } from '@/common/constants.js'
// import { sendSms, getAdminInfo } from '@api/merchant'
import { getParkStore } from '@api/editCustomer'
// import { getParkStore } from '@api/editCustomer'
import qrcodeDialog from './qRcodeDialog'
export default {
name: 'serviceManage',
data() {
......@@ -180,11 +190,15 @@ export default {
8: '虚拟园区店',
9: '供应商'
}
}
},
qRcodeVisible: false,
recordInfo: {}
}
},
components: {},
components: {
qrcodeDialog
},
mounted() {
this.getBaseData()
......@@ -242,7 +256,17 @@ export default {
)
}
})
}
},
collectionQRcode(row) {
this.recordInfo = row
this.qRcodeVisible = !this.qRcodeVisible
},
dialogClose() {
this.qRcodeVisible = !this.qRcodeVisible
},
}
}
</script>
......
......@@ -126,9 +126,9 @@ module.exports = {
cacheDirectory: assets(__dirname, 'cache'),
// 解决报错问题
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/
}),
})
// new SpeedMeasurePlugin(),
new CopyDir() // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new CopyDir() // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new AsyncRomveDir()
)
config.plugins = [...config.plugins, ...plugins]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!