Commit 25c2ff1d by zhangquan

Merge branch 'v3.22.1' of http://192.168.3.233:8090/saas/scrm-micro-points into v3.22.1

2 parents 9baba007 10074c6e
......@@ -2241,6 +2241,11 @@
"integrity": "sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==",
"dev": true
},
"adler-32": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A=="
},
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
......@@ -3314,6 +3319,15 @@
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
"dev": true
},
"cfb": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
"requires": {
"adler-32": "~1.3.0",
"crc-32": "~1.2.0"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
......@@ -3648,6 +3662,11 @@
"integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==",
"dev": true
},
"codepage": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA=="
},
"collection-visit": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
......@@ -4099,6 +4118,11 @@
}
}
},
"crc-32": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="
},
"create-ecdh": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
......@@ -6124,6 +6148,11 @@
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"dev": true
},
"frac": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
......@@ -12122,6 +12151,14 @@
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"dev": true
},
"ssf": {
"version": "0.11.2",
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
"requires": {
"frac": "~1.1.2"
}
},
"sshpk": {
"version": "1.17.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz",
......@@ -14216,6 +14253,16 @@
"dayjs": "^1.8.25"
}
},
"wmf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="
},
"word": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
......@@ -14292,6 +14339,20 @@
"async-limiter": "~1.0.0"
}
},
"xlsx": {
"version": "0.18.5",
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
"requires": {
"adler-32": "~1.3.0",
"cfb": "~1.2.1",
"codepage": "~1.15.0",
"crc-32": "~1.2.1",
"ssf": "~0.11.2",
"wmf": "~1.0.1",
"word": "~0.3.0"
}
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
......
......@@ -18,7 +18,8 @@
"glsx-components": "^1.5.7",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2"
"vuex": "^3.1.2",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0",
......
......@@ -111,4 +111,28 @@ const getDetails = params => {
sign: true
})
}
export default { getList, getAdmin, orderExport, integralpay, integralApprove, integralOut, getSms, getMerchantList, getAllpayAmount, getDetails }
// 普通提现导入
const uploadXlsx = params => {
params.method = 'scrm.api.shopmall.integral.transfer.out.import'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll:true
})
}
// 根据批次号更新普通提现导入为成功状态
const handleSaveImport =params => {
params.method = `scrm.api.shopmall.integral.transfer.out.import.confirm`
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default { getList, getAdmin, orderExport, integralpay, integralApprove, integralOut, getSms, getMerchantList, getAllpayAmount, getDetails,uploadXlsx,handleSaveImport }
......@@ -94,12 +94,18 @@ function aToExport(url) {
document.body.appendChild(a)
a.click()
}
function getArrayIsSubset (arr2, arr1) {
return arr2.every(item => {
console.log(arr1.includes(item))
return arr1.includes(item)
})
}
export default {
debounce,
dateFormat,
checkPhone,
getOptionsList,
secondConfirm,
aToExport
aToExport,
getArrayIsSubset
}
......@@ -4,10 +4,26 @@
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<h2>积分提现列表</h2>
<!-- <div class="statistics">
累计结算金额:熠轩
<span class="price">xxx.xx</span>
元,拓博
<span class="price">xxx.xx</span>
元,远行
<span class="price">xxx.xx</span>
元;账户余额:熠轩
<span class="price">xxx.xx</span>
元,拓博
<span class="price">xxx.xx</span>
元,远行
<span class="price">xxx.xx</span>
元;
</div> -->
<div>
<div class="flex">
<el-button size="small" @click="handleCheck()" type="primary" plain>批量审核</el-button>
<el-button size="small" @click="handlePay()">批量付款</el-button>
<el-button size="small" @click="handleImport">提现导入</el-button>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
</div>
......@@ -41,6 +57,13 @@
<!-- 付款 -->
<GLDialog class="gl-form-page gl-form-min" title="付款" mode="mid" :visible.sync="isPay" :close-on-click-modal="false" :before-close="cancelPay">
<glsx-combi-form formRef="payChildRef" defaultWidth="284px" ref="payFormRef" :formObj="payForm" :formData="payFormData" :formRules="payRule">
<tempalte slot="money">
<div class="channelMoney">
可用余额:
<span class="price">xx.xx</span>
元
</div>
</tempalte>
<template slot="captcha">
<div class="captcha-wrap">
<el-input v-model="payForm.captcha" placeholder="请输入"></el-input>
......@@ -55,17 +78,60 @@
<el-button type="primary" size="small" :loading="loading" @click="comfirmPay">确定</el-button>
</span>
</GLDialog>
<!-- 提现导入 -->
<GLDialog class="gl-form-page gl-form-min" title="提现导入" mode="mid" :visible.sync="isImport" :close-on-click-modal="false" :before-close="cancelImport">
<template v-if="importForm.isLoading == 0">
<el-form ref="form" :model="importForm" label-width="154px" :rules="importRule">
<el-form-item label="上传文件:" prop="fileName">
<el-input v-model="importForm.fileName" placeholder="请选择文件" disabled></el-input>
<div class="import-btn">
<i class="el-icon-plus"></i>
选择文件
<input id="fileUpload" type="file" style="opacity: 0" ref="file" class="import-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel" @change="e => uploadFile(e)" />
</div>
<a class="download-url" href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/提现导入模版.xlsx">下载模版</a>
</el-form-item>
</el-form>
</template>
<div class="middle" v-if="importForm.isLoading == 1">
<i class="el-icon el-icon-loading"></i>
<div class="resulttip">正在处理中</div>
<div class="state">说明:系统正在加急导入中,请耐心等待;导入过程中,请不要退出当前操作,否则将导致本次提现导入无效。</div>
</div>
<div class="middle" v-if="importForm.isSuccess == 1">
<i class="el-icon el-icon-success"></i>
<div class="resulttip">处理成功</div>
<div class="state">已自动为您导入{{ importForm.successCount }}条提现记录,可返回列表查看。</div>
</div>
<div class="middle" v-if="importForm.isSuccess == 2">
<i class="el-icon el-icon-error"></i>
<div class="resulttip">处理失败</div>
<div class="state">
可点击
<a class="err-url" :href="importForm.errorUrl">下载失败模版</a>
查看失败原因。
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" class="btn-three" @click="cancelImport">取消</el-button>
<el-button type="primary" size="small" :loading="checkLoading" @click="comfirmImport">确定</el-button>
</span>
</GLDialog>
<!-- 详情 -->
<detail-dialog :detail-visible="detailVisible" :id="id" @dialogClose="dialogClose"></detail-dialog>
</div>
</template>
<script>
import * as XLSX from 'xlsx'
import DetailDialog from './detail.vue'
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import util from '@/utils/index'
const tableStatus = ['待审核', '已审核', '第三方处理', '成功', '失败', '驳回']
const colors = ['#FDB757', '#2CCA74', '#5850FF', '#2CCA74', '#999999', '#EB4E4E']
const tabelHeaderModel = ['商户名称', '商户号', '客户名称', '客户手机号', '提现金额', '收款人姓名', '收款人身份证', '收款银行卡号', '收款银行', '收款人手机号']
export default {
components: {
DetailDialog
......@@ -85,7 +151,8 @@ export default {
customerPhone: '',
status: '',
channel: '',
merchantName: ''
merchantName: '',
transferType: ''
},
hasFooter: false,
tableSearchForm: {},
......@@ -135,6 +202,15 @@ export default {
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '付款渠道',
name: 'channel',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'channelList'
},
{
label: '所属门店',
name: 'merchantName',
type: 'select',
......@@ -144,13 +220,13 @@ export default {
optionsName: 'merchantList'
},
{
label: '付款渠道',
name: 'channel',
label: '提现类型',
name: 'transferType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'channelList'
optionsName: 'withdrawalTypeList'
}
],
tableButtonList: [
......@@ -348,6 +424,16 @@ export default {
confId: 'TXIAT',
confLabel: '熠轩'
}
],
withdrawalTypeList: [
{
confId: '0',
confLabel: '积分提现'
},
{
confId: '1',
confLabel: '普通提现'
}
]
},
showPassDialog: false,
......@@ -382,16 +468,18 @@ export default {
optionId: 'id',
optionLabel: 'text',
optionList: [
// {
// text: '拓博',
// id: 'LG'
// },
{
text: '熠轩',
id: 'TXIAT'
confId: 'TXIAT',
confLabel: '熠轩'
}
]
},
// {
// label: '',
// name: 'admin',
// type: 'input',
// addHtml: 'money'
// },
{
label: '管理员',
name: 'admin',
......@@ -414,7 +502,21 @@ export default {
payRule: {
channel: [{ required: true, message: '请选择付款渠道', trigger: 'change' }],
captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }]
}
},
importRule:{
fileName: [{ required: true, message: '请选择', trigger: 'blur' }],
},
importForm: {
isLoading: 0,
isSuccess: 0,
result: '',
fileName: '',
fileUrl: '',
successCount: '',
batchNo: '',
errorUrl: ''
},
isImport: false
}
},
watch: {
......@@ -486,6 +588,144 @@ export default {
this.$utils.aToExport(res)
})
},
async uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const header = await this.compareHeader(file)
if (!util.getArrayIsSubset(header, tabelHeaderModel)) {
this.$refs.file.value = ''
this.$message.error('模版错误')
} else {
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.importForm.fileUrl = file.name.split('.')[1] + '@' + arrBase64[1]
this.importForm.fileName = file.name
}
}
},
compareHeader(file) {
return new Promise(resolve => {
const reader = new FileReader()
reader.onload = event => {
/* 解析数据 */
const bstr = event.target.result
const wb = XLSX.read(bstr, { type: 'binary' })
/* 获取文件的第一个工作表(WorkSheet) */
const wsname = wb.SheetNames[0]
let ws = wb.Sheets[wsname]
if (!ws['!ref']) {
this.$message.error('格式错误')
return
}
ws = this.handleStartTd(ws, 'A9')
const data = this.getHeaderRow(ws)
resolve(data)
}
reader.readAsBinaryString(file)
})
},
handleStartTd(worksheet, start) {
let old = worksheet['!ref']
old = old.split(':')
worksheet['!ref'] = start + ':' + old[1]
return worksheet
},
getHeaderRow(sheet) {
console.log(sheet)
const headers = []
/* sheet['!ref']表示所有单元格的范围,例如从A1到F8则记录为 A1:F8*/
const range = XLSX.utils.decode_range(sheet['!ref'])
let C,
R = range.s.r /* 从第一行开始 */
/* 按列进行数据遍历 */
for (C = range.s.c; C <= range.e.c; ++C) {
/* 查找第一行中的单元格 */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
let hdr = 'UNKNOWN ' + C // <-- 进行默认值设置
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
if (!hdr.includes('UNKNOWN')) {
headers.push(hdr)
}
}
return headers
},
handleSaveImport(data) {
let params = {
batchNo: data.batchNo
}
this.$apis.withdraw.handleSaveImport(params).then(res => {
if (res.code == 0) {
}
})
},
//提现导入
handleImport() {
this.isImport = true
},
clearFile() {
this.importForm = {
isLoading: 0,
isSuccess: 0,
result: '',
fileName: '',
fileUrl: '',
successCount: '',
batchNo: '',
errorUrl: ''
}
},
comfirmImport() {
let {
importForm: { isSuccess,fileName ,isLoading},
isImport
} = this
if(fileName==''&&isLoading == 0){
this.$message({
message: '请先选择文件',
type: 'error'
})
return
}
if (isImport && isSuccess != 0) {
this.isImport = false
this.clearFile()
return
}
this.importForm.isLoading = 1
this.$apis.withdraw.uploadXlsx({ file: this.importForm.fileUrl }).then(res => {
if (res.code == 0) {
this.importForm.isLoading = 2
if (res.data.importStatue == 0) {
this.importForm.successCount = res.data.successCount
this.importForm.isSuccess = 1 //处理成功
this.handleSaveImport(res.data)
} else {
this.importForm.errorUrl = res.data.errorUrl
this.importForm.isSuccess = 2 //处理失败
}
} else {
this.importForm.isLoading = 0
this.$message({
message: res.message,
type: 'error'
})
}
})
},
cancelImport() {
this.isImport = false
this.clearFile()
},
//获取复选table数据
selectionTable(val) {
this.ids = val.map(item => item.id)
......@@ -497,7 +737,7 @@ export default {
this.ids = isRefuse == 0 ? [row.id] : row.id
this.$refs.withdrawRef.clearMutiSelect()
} else {
if (!this.ids||this.ids.length == 0) {
if (!this.ids || this.ids.length == 0) {
this.$message({
message: '请选择待审核的提现记录',
type: 'error'
......@@ -516,7 +756,7 @@ export default {
this.payForm.payMoney = (row.payAmount / 100).toFixed(2)
this.$refs.withdrawRef.clearMutiSelect()
} else {
if (!this.ids||this.ids.length == 0) {
if (!this.ids || this.ids.length == 0) {
this.$message({
message: '请选择已审核的提现记录',
type: 'error'
......@@ -647,28 +887,6 @@ export default {
}
</script>
<style scoped lang='scss'>
.import-btn {
position: relative;
width: 116px;
height: 32px;
text-align: center;
background: #5850ff;
border-radius: 4px;
color: #ffffff;
font-size: 14px;
margin-right: 8px;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
.describe {
font-size: 12px;
color: #999999;
......@@ -694,9 +912,100 @@ export default {
text-align: right;
}
}
.table-header{
.el-button+.el-button {
.table-header {
.el-button + .el-button {
margin-left: 10px;
}
}
.price {
color: #5850ff;
}
.statistics {
font-size: 14px;
color: #999999;
}
.channelMoney {
position: relative;
font-size: 12px;
color: #999999;
right: 322px;
top: 35px;
margin-bottom: 20px;
.price {
color: #333333;
}
}
.import-btn {
position: relative;
width: 116px;
height: 32px;
text-align: center;
border-radius: 4px;
color: #666666;
font-size: 14px;
margin-left: 8px;
border: 1px solid #00000026;
line-height: 32px;
display: inline-block;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 32px;
cursor: pointer;
font-size: 0;
}
.download-url {
margin-top: 7px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
display: block;
}
.err-url{
margin-top: 7px;
font-size: 14px;
font-weight: 400;
color: #5850ff;
line-height: 20px;
display: inline-block;
}
.middle {
margin: 0 auto;
.el-icon {
font-size: 48px;
text-align: center;
position: relative;
left: 50%;
margin-left: -24px;
}
.el-icon-success {
color: #2dca75;
}
.el-icon-error {
color: #ec4f4f;
}
.resulttip {
font-weight: 600;
font-size: 16px;
color: #000000;
margin: 12px 0;
text-align: center;
}
.state {
font-size: 14px;
color: #666666;
text-align: center;
margin: 0 67px;
line-height: 20px;
}
}
.gl-form-page /deep/ .el-dialog__footer {
text-align: center !important;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!