大转盘,成长值,用户上下级,用户账单,申请列表

This commit is contained in:
faiz 2024-10-25 11:20:07 +08:00
parent 43ff14adf8
commit 51b9d188cf
28 changed files with 6034 additions and 1141 deletions

View File

@ -3,11 +3,12 @@ ENV = 'development'
# http://192.168.1.43:8324/admin # http://192.168.1.43:8324/admin
# http://mer.crmeb.net/admin # http://mer.crmeb.net/admin
# base api # base api
# www.shop.xyz
VUE_APP_BASE_API = 'http://test.tropjoin.com' VUE_APP_BASE_API = 'http://test.tropjoin.com'
# VUE_APP_BASE_API = 'https://api.tropjoin.com' # VUE_APP_BASE_API = 'https://api.tropjoin.com'
# socket 连接地址 # socket 连接地址
VUE_APP_WS_URL = 'wss://test.tropjoin.com' VUE_APP_WS_URL = 'wss://www.shop.xyz'
# VUE_APP_WS_URL = 'ws://https://api.tropjoin.com' # VUE_APP_WS_URL = 'ws://https://api.tropjoin.com'
# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,

View File

@ -2,6 +2,6 @@
ENV = 'production' ENV = 'production'
# base api # base api
VUE_APP_BASE_API ='https://api.tropjoin.com' VUE_APP_BASE_API =''
# socket 连接地址 # socket 连接地址
VUE_APP_WS_URL ='wss://api.tropjoin.com' VUE_APP_WS_URL =''

32
src/api/lottery.js Normal file
View File

@ -0,0 +1,32 @@
import request from './request'
/**
* @description 抽奖配置 -- 列表
*/
export function lotteryFactor_info(factor) {
return request.get(`store/lottery/factor_info/${factor}`)
}
/**
* @description 修改抽奖数据 -- post
*/
export function lotteryEdit(id, data) {
return request.put(`store/lottery/edit/${id}`, data)
}
/**
* @description 删除抽奖数据 -- del
*/
export function lotteryDel(id, data) {
return request.delete(`store/lottery/del/prize/${id}`, data)
}
/**
* @description 修改抽奖 -- put
*/
export function lotteryEditPrize(id, data) {
return request.put(`store/lottery/edit/prize/${id}`, data)
}
/**
* @description 添加抽奖数据
*/
export function addLottery(data) {
return request.post(`store/lottery/add/prize`, data)
}

View File

@ -373,12 +373,24 @@ export function integralLogTitle() {
export function integralLogLst(data) { export function integralLogLst(data) {
return request.get(`user/integral/lst`, data) return request.get(`user/integral/lst`, data)
} }
/**
* @description 成长值 -- 列表
*/
export function brokerageLogLst(data) {
return request.get(`user/brokerage/lst/log`, data)
}
/** /**
* @description 积分日志 -- 导出 * @description 积分日志 -- 导出
*/ */
export function signLogExport(data) { export function signLogExport(data) {
return request.get(`user/integral/excel`, data) return request.get(`user/integral/excel`, data)
} }
/**
* @description 成长值 -- 导出
*/
export function brokerageLogExport(data) {
return request.get(`user/brokerage/excel`, data)
}
/** /**
* @description 签到配置 -- 列表 * @description 签到配置 -- 列表
*/ */

View File

@ -207,6 +207,12 @@ export function userSignLogApi(uid, data) {
export function userHistoryApi(uid, data) { export function userHistoryApi(uid, data) {
return request.get(`user/history/${uid}`, data) return request.get(`user/history/${uid}`, data)
} }
/**
* @description 下级 -- 邀请人列表
*/
export function spreadListApi(uid, data) {
return request.get(`user/spread/list/${uid}`, data)
}
/** /**
* @description 用户 -- 详情优惠券 * @description 用户 -- 详情优惠券
*/ */

View File

@ -39,6 +39,24 @@ const accountsRouter =
}, },
component: () => import('@/views/accounts/capital/index') component: () => import('@/views/accounts/capital/index')
}, },
{
path: 'userBill',
name: 'AccountsUserBill',
meta: {
title: '用户账单',
noCache: true
},
component: () => import('@/views/accounts/userBill/index')
},
{
path: 'applicationRecord',
name: 'AccountsApplicationRecord',
meta: {
title: '申请记录',
noCache: true
},
component: () => import('@/views/accounts/applicationRecord/index')
},
{ {
path: 'reconciliation', path: 'reconciliation',
name: 'AccountsReconciliation', name: 'AccountsReconciliation',

View File

@ -104,6 +104,29 @@ const marketingRouter =
} }
] ]
}, },
{
path: 'lottery',
name: 'lottery',
meta: {
title: '抽奖管理',
noCache: true,
},
// redirect: 'noRedirect',
component: () => import('@/views/marketing/lottery/create'),
children: [
{
path: 'create',
name: 'create',
meta: {
title: '抽奖配置',
noCache: true,
activeMenu: `${roterPre}/marketing/lottery/create`
},
component: () => import('@/views/marketing/lottery/create')
},
]
},
{ {
path: 'studio', path: 'studio',
name: 'Studio', name: 'Studio',

View File

@ -21,6 +21,15 @@ const promoterRouter =
}, },
component: () => import('@/views/promoter/config/index') component: () => import('@/views/promoter/config/index')
}, },
{
path: 'brokerage',
name: 'brokerage',
meta: {
title: '成长值列表',
noCache: true
},
component: () => import('@/views/promoter/brokerage/index')
},
{ {
path: 'user', path: 'user',
name: 'AccountsUser', name: 'AccountsUser',
@ -84,7 +93,6 @@ const promoterRouter =
}, },
component: () => import('@/views/promoter/distributionRules/index') component: () => import('@/views/promoter/distributionRules/index')
} }
] ]
} }

View File

@ -172,7 +172,7 @@ export default function createWorkBook(header, title, data, foot, filename, shee
return letter[number]; return letter[number];
} else { } else {
let n = number % 26 let n = number % 26
let l = Math.floor(number % 26) let l = Math.floor(number / 26) - 1
return letter[l] + letter[n] return letter[l] + letter[n]
} }
} }

View File

@ -10,7 +10,34 @@
export function isExternal(path) { export function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path) return /^(https?:|mailto:|tel:)/.test(path)
} }
export function formatDate(date, fmt) {
console.log(date, fmt);
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds(),
};
console.log(o);
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + '';
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : padLeftZero(str));
}
}
console.log(fmt);
return fmt;
}
function padLeftZero(str) {
return ('00' + str).substr(str.length);
}
/** /**
* @param {string} str * @param {string} str
* @returns {Boolean} * @returns {Boolean}

View File

@ -0,0 +1,935 @@
<template>
<div class="divBox">
<div class="selCard mb14">
<el-form
:model="tableFrom"
ref="searchForm"
size="small"
inline
label-width="85px"
>
<el-form-item label="时间选择:">
<el-date-picker
v-model="timeVal"
value-format="yyyy/MM/dd HH:mm:ss"
format="yyyy/MM/dd HH:mm:ss"
size="small"
type="datetimerange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 280px"
:picker-options="pickerOptions"
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="审核状态:" prop="status">
<el-select
v-model="tableFrom.status"
clearable
placeholder="请选择"
class="selWidth"
@change="getList(1)"
>
<el-option label="全部" value="" />
<el-option label="待审核" value="0" />
<el-option label="已审核" value="1" />
<el-option label="审核失败" value="-1" />
</el-select>
</el-form-item>
<el-form-item label="用户姓名:" prop="user_name">
<el-input
v-model="tableFrom.user_name"
placeholder="请输入用户姓名"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="用户电话:" prop="user_phone">
<el-input
v-model="tableFrom.user_phone"
placeholder="请输入用户电话"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="身份证号:" prop="user_number">
<el-input
v-model="tableFrom.user_number"
placeholder="请输入用户身份证号"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="用户ID" prop="user_id">
<el-input
v-model="tableFrom.user_id"
placeholder="请输入用户ID"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="转账状态:" prop="financial_status">
<el-select
v-model="tableFrom.financial_status"
placeholder="请选择"
class="selWidth"
clearable
@change="getList"
>
<el-option
v-for="item in arrivalStatusList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="关键字:" prop="keyword">
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入管理员姓名"
class="selWidth"
size="small"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<el-card>
<div class="mb20">
<el-button size="small" type="primary" @click="exports"
>导出列表</el-button
>
<el-button
size="small"
:disabled="multipleSelection.length == 0"
@click="batch"
>批量审核</el-button
>
<el-button
size="small"
:disabled="multipleSelection.length == 0"
@click="batTransferAdd"
>批量转账</el-button
>
</div>
<el-table
v-loading="listLoading"
tooltip-effect="dark"
:data="tableData.data"
size="small"
class="table"
@selection-change="handleSelectionChange"
>
<el-table-column key="2" type="selection" width="55" />
<!-- <el-table-column key="2" :selectable="selectable" type="selection" width="55" /> -->
<el-table-column label="序号" min-width="60">
<template scope="scope">
<span>{{
scope.$index + (tableFrom.page - 1) * tableFrom.limit + 1
}}</span>
</template>
</el-table-column>
<el-table-column prop="user_id" label="用户ID" min-width="120" />
<el-table-column prop="user_name" label="用户姓名" min-width="120" />
<el-table-column prop="user_phone" label="用户电话" min-width="120" />
<el-table-column
prop="user_number"
label="用户身份证号"
min-width="120"
/>
<el-table-column prop="create_time" label="申请时间" min-width="150" />
<el-table-column
prop="extract_money"
label="转账金额(元)"
min-width="120"
/>
<el-table-column
prop="admin_id"
label="平台管理员姓名"
min-width="120"
/>
<el-table-column label="收款方式" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.financial_type">{{
scope.row.financial_type == 1
? "银行"
: scope.row.financial_type == 2
? "微信"
: "支付宝"
}}</span>
<span v-else>--</span>
</template>
</el-table-column>
<el-table-column label="审核状态" min-width="120">
<template slot-scope="scope">
<span>{{
scope.row.status == 0
? "待审核"
: scope.row.status == 1
? "审核通过"
: "审核未通过"
}}</span>
<span v-if="scope.row.status === -1" style="font-size: 12px">
<br />
原因{{ scope.row.refusal }}
</span>
</template>
</el-table-column>
<el-table-column label="到账状态" min-width="120">
<template slot-scope="scope">
<span>{{
scope.row.financial_status == 1 ? "已到账" : "未到账"
}}</span>
</template>
</el-table-column>
<el-table-column
prop="mer_money"
label="商户余额(元)"
min-width="120"
/>
<el-table-column label="操作" min-width="180" fixed="right">
<template slot-scope="scope">
<el-button
v-if="scope.row.status == 0"
type="text"
size="small"
@click="transferDetail(scope.row.financial_id)"
>审核</el-button
>
<el-button
v-if="scope.row.status == 1 && scope.row.financial_status != 1"
type="text"
size="small"
@click="transferDetail(scope.row.financial_id, 1)"
>转账</el-button
>
<el-button
v-if="scope.row.status == 1 && scope.row.financial_status == 1"
type="text"
size="small"
@click="transferDetail(scope.row.financial_id, 0)"
>转账信息</el-button
>
<el-button
type="text"
size="small"
@click="transferMark(scope.row.financial_id)"
>备注</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
background
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
<!--转账信息-->
<el-dialog
:title="transferData.status == 0 ? '审核' : '转账信息'"
:visible.sync="dialogVisible"
width="700px"
v-if="dialogVisible"
>
<div class="box-container">
<el-form ref="ruleForm" size="small">
<div class="section" v-if="isShow">
<div class="title">商户信息</div>
<div class="list">
<div class="item">
<label class="name">商户名称</label
>{{ transferData.merchant && transferData.merchant.mer_name }}
</div>
<div class="item">
<label class="name">商户ID</label
>{{ transferData.merchant && transferData.merchant.mer_id }}
</div>
<div class="item">
<label class="name">商户余额</label
>{{ transferData.mer_money }}
</div>
<div class="item">
<label class="name">商户收款方式</label
>{{
transferData.financial_type == 1
? "银行卡"
: transferData.financial_type == 2
? "微信"
: "支付宝"
}}
</div>
<div class="item" v-if="transferData.financial_type == 1">
<label class="name">开户银行</label
>{{ transferData.financial_account.bank }}
</div>
<div class="item" v-if="transferData.financial_type == 1">
<label class="name">银行账号</label
>{{ transferData.financial_account.bank_code }}
</div>
<div class="item" v-if="transferData.financial_type == 1">
<label class="name">开户户名</label
>{{ transferData.financial_account.name }}
</div>
<div class="item" v-if="transferData.financial_type != 1">
<label class="name">真实姓名</label
>{{ transferData.financial_account.name }}
</div>
</div>
</div>
<div class="section">
<div class="title" v-if="isShow">收款信息</div>
<div class="list">
<div class="item" v-if="transferData.financial_type == 2">
<label class="name">微信号</label
>{{ transferData.financial_account.wechat }}
</div>
<div class="item image" v-if="transferData.financial_type == 2">
<label class="name">微信收款二维码</label
><img
style="max-width: 150px; height: 80px"
@click="
getPicture(transferData.financial_account.wechat_code);
return false;
"
:src="transferData.financial_account.wechat_code"
/>
</div>
<div class="item" v-if="transferData.financial_type == 3">
<label class="name">支付宝账号</label
>{{ transferData.financial_account.alipay }}
</div>
<div class="item image" v-if="transferData.financial_type == 3">
<label class="name">支付宝收款二维码</label
><img
style="max-width: 150px; height: 80px"
@click="
getPicture(transferData.financial_account.alipay_code);
return false;
"
:src="transferData.financial_account.alipay_code"
/>
</div>
<div class="item" v-if="isShow">
<label class="name">本次申请转账金额</label
><span class="font-red">{{ transferData.extract_money }}</span>
</div>
<div class="item" v-if="transferData.status != 0 && isShow">
<label class="name">审核状态</label
>{{ getStatus(transferData.status) }}
</div>
<div class="item" v-if="transferData.status == 1">
<label class="name">审核时间</label
>{{ transferData.status_time }}
</div>
<div class="item" v-if="transferData.status == -1 && isShow">
<label class="name">审核未通过原因</label
>{{ transferData.refusal }}
</div>
<el-form-item
label="审核状态:"
required
v-if="transferData.status == 0 || !isShow"
class="item"
>
<el-radio-group v-model="formValidate.status">
<el-radio :label="1" class="radio">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label="原因:"
required
v-if="formValidate.status == -1"
class="item"
>
<el-input
type="textarea"
v-model="formValidate.refusal"
></el-input>
</el-form-item>
<el-form-item
label="转账凭证:"
v-if="transferData.status == 1"
class="item"
>
<div class="acea-row">
<div
v-if="voucher_image.length > 0"
v-for="(item, index) in voucher_image"
:key="index"
class="pictrue"
>
<img :src="item" @click="getPicture(item)" />
<i
class="el-icon-error btndel"
@click="handleRemove(index)"
/>
</div>
<div class="upLoadPicBox" @click="modalPicTap('2')">
<div class="upLoad">
<i class="el-icon-camera" />
</div>
</div>
</div>
</el-form-item>
</div>
</div>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false">取消</el-button>
<el-button
v-if="transferData.status == 0 && isShow"
type="primary"
size="small"
@click="transferReview(transferData.financial_id)"
>提交</el-button
>
<el-button
v-if="!isShow"
type="primary"
size="small"
@click="transferReviewBatchApi()"
>提交</el-button
>
<el-button
v-if="transferData.status == 1"
type="primary"
size="small"
@click="onSubmit(transferData.financial_id)"
>提交</el-button
>
</span>
</el-dialog>
<!-- 转账 -->
<el-dialog
title="转账信息"
:visible.sync="transferVisible"
width="700px"
v-if="transferVisible"
>
<el-form ref="ruleForm" size="small">
<el-form-item label="转账状态:" required class="item">
<el-radio-group v-model="formValidate.status">
<el-radio :label="1" class="radio">通过</el-radio>
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="transferVisible = false"
>取消</el-button
>
<el-button type="primary" size="small" @click="transferBatchApi"
>提交</el-button
>
</span>
</el-dialog>
<!--查看二维码-->
<el-dialog
:visible.sync="pictureVisible"
width="700px"
v-if="pictureVisible"
>
<img :src="pictureUrl" class="pictures" />
</el-dialog>
<!--导出订单列表-->
<file-list ref="exportList" />
</div>
</template>
<script>
import { merSelectApi } from "@/api/product";
import {
transferBatchApi,
transferReviewBatchApi,
transferReviewFirstApi,
transferReviewSecondApi,
transferRecordApi,
transferDetailApi,
transferReviewApi,
transferEditApi,
transferMarkApi,
transferHeaderDataApi,
transferRecordsExportApi,
} from "@/api/accounts";
import cardsData from "@/components/cards/index";
import createWorkBook from "@/utils/newToExcel.js";
import fileList from "@/components/exportFile/fileList";
import timeOptions from "@/utils/timeOptions";
export default {
components: { cardsData, fileList },
name: "transferRecord",
data() {
return {
type: "",
pickerOptions: timeOptions,
tableData: {
data: [],
total: 0,
},
arrivalStatusList: [
{ label: "已到账", value: 1 },
{ label: "未到账", value: 0 },
],
listLoading: true,
isShow: false,
cardLists: [],
voucher_image: [],
transferVisible: false,
formValidate: {
status: 1,
refusal: "",
},
approvalStatus: 0,
tableFrom: {
date: "",
page: 1,
limit: 20,
mer_id: "",
financial_type: "",
keyword: "",
status: "",
is_trader: "",
},
orderChartType: {},
timeVal: [],
fromList: {
title: "选择时间",
custom: true,
fromTxt: [
{ text: "全部", val: "" },
{ text: "今天", val: "today" },
{ text: "昨天", val: "yesterday" },
{ text: "最近7天", val: "lately7" },
{ text: "最近30天", val: "lately30" },
{ text: "本月", val: "month" },
{ text: "本年", val: "year" },
],
},
merSelect: [],
multipleSelection: [],
OffId: [],
tableFromLog: {
page: 1,
limit: 20,
},
tableDataLog: {
data: [],
total: 0,
},
loading: false,
dialogVisible: false,
pictureVisible: false,
pictureUrl: "",
transferData: {
financial_account: {},
},
};
},
mounted() {
this.getList(1);
this.getMerSelect();
},
methods: {
getStatus(val) {
switch (val) {
case 0:
return "待审核";
case -1:
return "审核未通过";
}
},
/**重置 */
searchReset() {
this.timeVal = [];
this.tableFrom.date = "";
this.$refs.searchForm.resetFields();
this.getList(1);
},
transferBatchApi() {
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal,
ids: this.OffId,
};
transferBatchApi(parmas)
.then((res) => {
this.$message.success(res.message);
this.getList(1);
this.transferVisible = false;
})
.catch((res) => {
this.$message.error(res.message);
});
},
batTransferAdd() {
if (this.multipleSelection.length === 0)
return this.$message.warning("请先选择记录");
this.transferData = {};
this.transferVisible = true;
},
selectable(row, index) {
// return !row.status
},
handleSelectionChange(val) {
this.multipleSelection = val;
const data = [];
this.multipleSelection.map((item) => {
data.push(item.financial_id);
});
this.OffId = data;
console.log(this.OffId);
},
//
batch() {
if (this.multipleSelection.length === 0)
return this.$message.warning("请先选择记录");
this.isShow = false;
this.transferData = {};
this.dialogVisible = true;
},
transferReviewBatchApi() {
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal,
ids: this.OffId,
};
transferReviewBatchApi(parmas)
.then((res) => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
//
getMerSelect() {
merSelectApi()
.then((res) => {
this.merSelect = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
transferDetail(id, num) {
if (num) this.voucher_image = [];
transferDetailApi(id)
.then((res) => {
this.listLoading = false;
this.isShow = true;
this.dialogVisible = true;
this.transferData = res.data;
this.formValidate.status = res.data.status;
if (num) {
this.voucher_image = [];
} else {
this.voucher_image = res.data.image;
}
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
//
getPicture(url) {
this.pictureVisible = true;
this.pictureUrl = url;
},
//
transferReview(id) {
let parmas = {
status: this.formValidate.status,
refusal: this.formValidate.refusal,
};
transferReviewApi(id, parmas)
.then((res) => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
//
transferReviewApi(id, val) {
let parmas = {
status: 1,
refusal: this.formValidate.refusal,
};
transferReviewApi(id, parmas)
.then((res) => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
//
transferReviewFirstApi(id, val) {
let parmas = {
status: 10,
refusal: this.formValidate.refusal,
};
transferReviewFirstApi(id, parmas)
.then((res) => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
//
transferReviewSecondApi(id, val) {
let parmas = {
status: 11,
refusal: this.formValidate.refusal,
};
transferReviewSecondApi(id, parmas)
.then((res) => {
this.listLoading = false;
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
//
transferMark(id) {
this.$modalForm(transferMarkApi(id)).then(() => this.getList("1"));
},
//
onSubmit(id) {
if (this.voucher_image == 0) {
return this.$message.error("请上传转账凭证!");
} else {
transferEditApi(id, { image: this.voucher_image })
.then((res) => {
this.$message.success(res.message);
this.dialogVisible = false;
this.getList(1);
})
.catch((res) => {
this.$message.error(res.message);
});
}
},
//
modalPicTap(tit, num, i) {
const _this = this;
const attr = [];
this.$modalUpload(function (img) {
if (tit === "2" && !num) {
img.map((item) => {
attr.push(item.attachment_src);
_this.voucher_image.push(item);
if (_this.voucher_image.length > 6) {
_this.voucher_image.length = 6;
}
});
}
}, tit);
},
handleRemove(i) {
this.voucher_image.splice(i, 1);
},
//
onchangeTime(e) {
this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.getList(1);
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
data = [];
excelData.page = 1;
excelData.limit = 100;
let pageCount = 1;
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData);
pageCount = Math.ceil(lebData.count / excelData.limit);
if (lebData.export.length) {
data = data.concat(lebData.export);
excelData.page++;
}
}
createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
transferRecordsExportApi(excelData).then((res) => {
return resolve(res.data);
});
});
},
//
exportRecord() {
transferRecordsExportApi(this.tableFrom)
.then((res) => {
/*this.$message.success(res.message)
this.$refs.exportList.exportFileList()*/
const h = this.$createElement;
this.$msgbox({
title: "提示",
message: h("p", null, [
h("span", null, '文件正在生成中,请稍后点击"'),
h("span", { style: "color: teal" }, "导出记录"),
h("span", null, '"查看~ '),
]),
confirmButtonText: "我知道了",
}).then((action) => {});
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getExportFileList() {
this.$refs.exportList.exportFileList();
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
transferRecordApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.$message.error(res.message);
this.listLoading = false;
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList();
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList();
},
handleClose() {
this.dialogLogistics = false;
},
},
};
</script>
<style lang="scss" scoped>
.pictrue {
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.btndel {
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
.box-container {
overflow: hidden;
padding: 0 10px;
}
.section {
padding: 15px 0 30px;
border-bottom: 1px dashed #eeeeee;
&:last-child {
padding: 30px 0 0;
border-bottom: none;
}
.title {
padding-left: 10px;
border-left: 3px solid var(--prev-color-primary);
font-size: 14px;
line-height: 15px;
color: #303133;
font-weight: bold;
}
}
.box-container .list {
display: flex;
flex-wrap: wrap;
}
.box-container .item {
margin-top: 16px;
font-size: 13px;
display: flex;
flex: 0 0 calc(100% / 2);
color: #606266;
}
.box-container .list .info {
display: block;
.el-textarea {
margin-top: 10px;
}
}
.box-container .list.image {
margin: 20px 0;
position: relative;
}
.box-container .list.image img {
position: absolute;
top: -20px;
}
.box-container .list .name {
align-items: center;
display: inline-block;
color: #909399;
}
.pictures {
width: 100%;
max-width: 100%;
}
</style>

View File

@ -1,366 +1,492 @@
<template> <template>
<div class="divBox"> <div class="divBox">
<div class="selCard"> <div class="selCard">
<el-form :model="tableFrom" ref="searchForm" size="small" inline label-width="85px"> <el-form
<el-form-item label="时间选择:"> :model="tableFrom"
<el-date-picker v-model="timeVal" value-format="yyyy/MM/dd" format="yyyy/MM/dd" type="daterange" placement="bottom-end" placeholder="自定义时间" style="width: 280px;" :picker-options="pickerOptions" @change="onchangeTime" /> ref="searchForm"
</el-form-item> size="small"
<el-form-item label="提现状态:" prop="status"> inline
<el-select label-width="85px"
v-model="tableFrom.status" >
clearable <el-form-item label="时间选择:">
filterable <el-date-picker
placeholder="请选择" v-model="timeVal"
class="selWidth" value-format="yyyy/MM/dd"
@change="getList(1)" format="yyyy/MM/dd"
> type="daterange"
<el-option label="全部" value=""/> placement="bottom-end"
<el-option label="审核中" value="0"/> placeholder="自定义时间"
<el-option label="已提现" value="1"/> style="width: 280px"
<el-option label="已拒绝" value="-1"/> :picker-options="pickerOptions"
</el-select> @change="onchangeTime"
</el-form-item> />
<el-form-item label="提现方式:" prop="extract_type"> </el-form-item>
<el-select <el-form-item label="提现状态:" prop="status">
v-model="tableFrom.extract_type" <el-select
clearable v-model="tableFrom.status"
filterable clearable
placeholder="请选择" filterable
class="selWidth" placeholder="请选择"
@change="getList(1)" class="selWidth"
> @change="getList(1)"
<el-option label="全部" value=""/> >
<el-option label="银行卡" value="0"/> <el-option label="全部" value="" />
<el-option label="支付宝" value="2"/> <el-option label="审核中" value="0" />
<el-option label="微信" value="1"/> <el-option label="已提现" value="1" />
<el-option label="微信零钱" value="3"/> <el-option label="已拒绝" value="-1" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="关键字:" prop="keyword"> <el-form-item label="提现方式:" prop="extract_type">
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="姓名/支付宝账号/银行卡号" clearable class="selWidth" /> <el-select
</el-form-item> v-model="tableFrom.extract_type"
<el-form-item> clearable
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button> filterable
<el-button size="small" @click="searchReset()">重置</el-button> placeholder="请选择"
</el-form-item> class="selWidth"
</el-form> @change="getList(1)"
>
<el-option label="全部" value="" />
<el-option label="银行卡" value="0" />
<el-option label="支付宝" value="2" />
<el-option label="微信" value="1" />
<el-option label="微信零钱" value="3" />
</el-select>
</el-form-item>
<el-form-item label="关键字:" prop="keyword">
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="姓名/支付宝账号/银行卡号"
clearable
class="selWidth"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div> </div>
<el-card class="mt14"> <el-card class="mt14">
<div class="mb20"> <div class="mb20">
<el-button size="small" type="primary" @click="exports">导出列表</el-button> <el-button size="small" type="primary" @click="exports"
</div> >导出列表</el-button
<el-table v-loading="listLoading" :data="tableData.data" size="small" class="table" highlight-current-row> >
<el-table-column prop="extract_id" label="序号" width="60" /> </div>
<el-table-column label="二维码" min-width="80"> <el-table
<template slot-scope="scope"> v-loading="listLoading"
<div class="demo-image__preview"> :data="tableData.data"
<el-image v-if="scope.row.extract_pic" :src="scope.row.extract_pic" :preview-src-list="[scope.row.extract_pic]" /> size="small"
</div> class="table"
</template> highlight-current-row
</el-table-column> >
<el-table-column prop="user.nickname" label="用户信息" min-width="100" /> <el-table-column prop="extract_id" label="序号" width="60" />
<el-table-column prop="uid" label="用户UID" min-width="80" /> <el-table-column label="二维码" min-width="80">
<el-table-column prop="real_name" label="户名" min-width="100" /> <template slot-scope="scope">
<el-table-column prop="extract_price" label="提现金额" min-width="90" /> <div class="demo-image__preview">
<el-table-column label="提现方式" min-width="100"> <el-image
<template slot-scope="scope"> v-if="scope.row.extract_pic"
<span>{{ scope.row.extract_type | extractTypeFilter }}</span> :src="scope.row.extract_pic"
</template> :preview-src-list="[scope.row.extract_pic]"
</el-table-column> />
<el-table-column label="银行名称" min-width="100"> </div>
<template slot-scope="scope"> </template>
<span v-if="scope.row.extract_type === 0">{{ (scope.row.bank_name&&scope.row.bank_address) ? scope.row.bank_name+scope.row.bank_address : scope.row.bank_address }}</span> </el-table-column>
<span v-else>-</span> <el-table-column
</template> prop="user.nickname"
</el-table-column> label="用户信息"
<el-table-column label="账号" min-width="100"> min-width="100"
<template slot-scope="scope"> />
<span v-if="scope.row.extract_type==0">{{scope.row.bank_code }}</span> <el-table-column prop="uid" label="用户UID" min-width="80" />
<span v-else-if="scope.row.extract_type==2">{{scope.row.alipay_code }}</span> <el-table-column prop="real_name" label="户名" min-width="100" />
<span v-else-if="scope.row.extract_type==1">{{scope.row.wechat }}</span> <el-table-column prop="extract_price" label="提现金额" min-width="90" />
<span v-else></span> <el-table-column prop="tx_price" label="到账金额" min-width="90" />
</template> <el-table-column prop="ratio_price" label="手续费" min-width="90" />
</el-table-column> <el-table-column label="提现方式" min-width="100">
<el-table-column label="审核状态" min-width="90"> <template slot-scope="scope">
<template slot-scope="scope"> <span>{{ scope.row.extract_type | extractTypeFilter }}</span>
<span class="spBlock">{{ scope.row.status | extractStatusFilter }}</span> </template>
<!-- <template v-if="scope.row.status === 0"> </el-table-column>
<el-table-column label="银行名称" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.extract_type === 0">{{
scope.row.bank_name && scope.row.bank_address
? scope.row.bank_name + scope.row.bank_address
: scope.row.bank_address
}}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="账号" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.extract_type == 0">{{
scope.row.bank_code
}}</span>
<span v-else-if="scope.row.extract_type == 2">{{
scope.row.alipay_code
}}</span>
<span v-else-if="scope.row.extract_type == 1">{{
scope.row.wechat
}}</span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="审核状态" min-width="90">
<template slot-scope="scope">
<span class="spBlock">{{
scope.row.status | extractStatusFilter
}}</span>
<!-- <template v-if="scope.row.status === 0">
<el-button type="danger" icon="el-icon-close" size="mini" @click="onExamine(scope.row.extract_id)">未通过</el-button> <el-button type="danger" icon="el-icon-close" size="mini" @click="onExamine(scope.row.extract_id)">未通过</el-button>
<el-button type="primary" icon="el-icon-check" size="mini" @click="ok(scope.row.extract_id)">通过</el-button> <el-button type="primary" icon="el-icon-check" size="mini" @click="ok(scope.row.extract_id)">通过</el-button>
</template> --> </template> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="拒绝原因" min-width="120"> <el-table-column label="拒绝原因" min-width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="spBlock">{{ scope.row.fail_msg ? scope.row.fail_msg : '-' }}</span> <span class="spBlock">{{
</template> scope.row.fail_msg ? scope.row.fail_msg : "-"
</el-table-column> }}</span>
<el-table-column prop="create_time" label="添加时间" min-width="150" /> </template>
<el-table-column label="操作" min-width="80" fixed="right"> </el-table-column>
<template slot-scope="scope"> <el-table-column prop="create_time" label="添加时间" min-width="150" />
<el-button v-if="scope.row.status === 0" type="text" size="small" @click="onAudit(scope.row.extract_id)">审核</el-button> <el-table-column label="操作" min-width="80" fixed="right">
<el-button v-else type="text" size="small" @click="onDetails(scope.row.extract_id)">详情</el-button> <template slot-scope="scope">
</template> <el-button
</el-table-column> v-if="scope.row.status === 0"
</el-table> type="text"
<div class="block"> size="small"
<el-pagination background :page-size="tableFrom.limit" :current-page="tableFrom.page" layout="total, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange" @current-change="pageChange" /> @click="onAudit(scope.row.extract_id)"
</div> >审核</el-button
>
<el-button
v-else
type="text"
size="small"
@click="onDetails(scope.row.extract_id)"
>详情</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block">
<el-pagination
background
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card> </el-card>
<el-dialog v-if="dialogVisible" title="提现详情" center :visible.sync="dialogVisible" width="660px"> <el-dialog
<div v-loading="loading" style="margin-top: 5px;"> v-if="dialogVisible"
title="提现详情"
center
:visible.sync="dialogVisible"
width="660px"
>
<div v-loading="loading" style="margin-top: 5px">
<div class="box-container"> <div class="box-container">
<div class="list-count"> <div class="list-count">
<div class="title">用户信息</div> <div class="title">用户信息</div>
<div class="acea-row"> <div class="acea-row">
<div v-if="extractDetail.user" class="list"><label class="name">用户昵称</label>{{ extractDetail.user.nickname }}</div> <div v-if="extractDetail.user" class="list">
<div v-if="extractDetail.user" class="list"><label class="name">用户ID</label><span>{{ extractDetail.user.uid }}</span></div> <label class="name">用户昵称</label
<div class="list"><label class="name">提现金额</label>{{ extractDetail.extract_price }}</div> >{{ extractDetail.user.nickname }}
<div class="list"><label class="name">申请时间</label><span>{{ extractDetail.create_time }}</span></div> </div>
<div v-if="extractDetail.extract_type==0" class="list"><label class="name">开户人</label>{{ extractDetail.real_name }}</div> <div v-if="extractDetail.user" class="list">
<div v-if="extractDetail.extract_type==0" class="list"><label class="name">银行卡号</label>{{ extractDetail.bank_code }}</div> <label class="name">用户ID</label
<div v-if="extractDetail.extract_type==0" class="list"><label class="name">开户行</label>{{ extractDetail.bank_name }}</div> ><span>{{ extractDetail.user.uid }}</span>
<div v-if="extractDetail.extract_pic" class="list sp100 image"> </div>
<div class="list">
<label class="name">提现金额</label
>{{ extractDetail.extract_price }}
</div>
<div class="list">
<label class="name">到账金额</label
>{{ extractDetail.tx_price }}
</div>
<div class="list">
<label class="name">手续费</label
>{{ extractDetail.ratio_price }}
</div>
<div class="list">
<label class="name">申请时间</label
><span>{{ extractDetail.create_time }}</span>
</div>
<div v-if="extractDetail.extract_type == 0" class="list">
<label class="name">开户人</label
>{{ extractDetail.real_name }}
</div>
<div v-if="extractDetail.extract_type == 0" class="list">
<label class="name">银行卡号</label
>{{ extractDetail.bank_code }}
</div>
<div v-if="extractDetail.extract_type == 0" class="list">
<label class="name">开户行</label
>{{ extractDetail.bank_name }}
</div>
<div v-if="extractDetail.extract_pic" class="list sp100 image">
<label class="name">二维码</label> <label class="name">二维码</label>
<img <img
style="max-width: 150px; height: 80px;" style="max-width: 150px; height: 80px"
:src="extractDetail.extract_pic" :src="extractDetail.extract_pic"
> />
</div> </div>
</div> </div>
</div> </div>
<div class="list-count"> <div class="list-count">
<div class="title">提现方式</div> <div class="title">提现方式</div>
<div class="acea-row"> <div class="acea-row">
<div class="list"><label class="name">审核状态</label>{{ extractDetail.status | extractStatusFilter }}</div> <div class="list">
<div class="list"><label class="name">审核时间</label>{{ extractDetail.status_time }}</div> <label class="name">审核状态</label
<div v-if="extractDetail.status == -1" class="list sp100"><label class="name">拒绝原因</label>{{ extractDetail.fail_msg }}</div> >{{ extractDetail.status | extractStatusFilter }}
</div>
<div class="list">
<label class="name">审核时间</label
>{{ extractDetail.status_time }}
</div>
<div v-if="extractDetail.status == -1" class="list sp100">
<label class="name">拒绝原因</label
>{{ extractDetail.fail_msg }}
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<!--导出订单列表--> <!--导出订单列表-->
<file-list ref="exportList" /> <file-list ref="exportList" />
</div> </div>
</template> </template>
<script> <script>
import { import {
extractListApi, extractListApi,
extractStatusApi, extractStatusApi,
extractManageExportApi, extractManageExportApi,
extractManageAudit, extractManageAudit,
extractManageDetail extractManageDetail,
} from '@/api/accounts' } from "@/api/accounts";
import createWorkBook from '@/utils/newToExcel.js' import createWorkBook from "@/utils/newToExcel.js";
import { fromList } from '@/libs/constants.js' import { fromList } from "@/libs/constants.js";
import fileList from '@/components/exportFile/fileList' import fileList from "@/components/exportFile/fileList";
import timeOptions from '@/utils/timeOptions'; import timeOptions from "@/utils/timeOptions";
export default { export default {
components: { fileList }, components: { fileList },
name: 'AccountsExtract', name: "AccountsExtract",
data() { data() {
return { return {
pickerOptions: timeOptions, pickerOptions: timeOptions,
timeVal: [], timeVal: [],
tableData: { tableData: {
data: [], data: [],
total: 0 total: 0,
}, },
listLoading: true, listLoading: true,
loading: true, loading: true,
tableFrom: { tableFrom: {
extract_type: '', extract_type: "",
status: '', status: "",
date: '', date: "",
keyword: '', keyword: "",
page: 1, page: 1,
limit: 20 limit: 20,
}, },
fromList: fromList, fromList: fromList,
extractDetail: {}, extractDetail: {},
dialogVisible: false, dialogVisible: false,
} };
},
mounted() {
this.getList();
},
methods: {
/**重置 */
searchReset() {
this.timeVal = [];
this.tableFrom.date = "";
this.$refs.searchForm.resetFields();
this.getList(1);
}, },
mounted() { onExamine(id) {
this.getList() this.$prompt("未通过", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputErrorMessage: "请输入原因",
inputType: "textarea",
inputValue: "输入信息不完整或有误!",
inputPlaceholder: "请输入原因",
inputValidator: (value) => {
if (!value) {
return "请输入原因";
}
},
})
.then(({ value }) => {
extractStatusApi(id, {
status: -1,
fail_msg: value,
})
.then((res) => {
this.$message({
type: "success",
message: "提交成功",
});
this.getList();
})
.catch((res) => {
this.$message.error(res.message);
});
})
.catch(() => {
this.$message({
type: "info",
message: "取消输入",
});
});
}, },
methods: { ok(id) {
/**重置 */ this.$modalSure("审核通过吗").then(() => {
searchReset(){ extractStatusApi(id, {
this.timeVal = [] status: 1,
this.tableFrom.date = "" })
this.$refs.searchForm.resetFields() .then(({ message }) => {
this.getList(1) this.$message.success(message);
}, this.getList();
onExamine(id) { })
this.$prompt('未通过', { .catch(({ message }) => {
confirmButtonText: '确定', this.$message.error(message);
cancelButtonText: '取消', });
inputErrorMessage: '请输入原因', });
inputType: 'textarea', },
inputValue: '输入信息不完整或有误!', /**审核 */
inputPlaceholder: '请输入原因', onAudit(id) {
inputValidator: (value) => { this.$modalForm(extractManageAudit(id)).then(() => this.getList(1));
if (!value) { },
return '请输入原因' onDetails(id) {
} this.dialogVisible = true;
} extractManageDetail(id)
}).then(({ .then((res) => {
value this.loading = false;
}) => { this.extractDetail = res.data;
extractStatusApi(id, { })
status: -1, .catch((res) => {
fail_msg: value this.$message.error(res.message);
}).then(res => { this.loading = false;
this.$message({ });
type: 'success', },
message: '提交成功' //
}) selectChange(tab) {
this.getList() this.timeVal = [];
}).catch((res) => { this.tableFrom.date = tab;
this.$message.error(res.message) this.tableFrom.page = 1;
}) this.getList();
}).catch(() => { },
this.$message({ //
type: 'info', onchangeTime(e) {
message: '取消输入' this.timeVal = e;
}) this.tableFrom.date = e ? this.timeVal.join("-") : "";
}) this.tableFrom.page = 1;
}, this.getList();
ok(id) { },
this.$modalSure('审核通过吗').then(() => { async exports() {
extractStatusApi(id, { let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
status: 1 data = [];
}).then(({ excelData.page = 1;
message excelData.limit = 100;
}) => { let pageCount = 1;
this.$message.success(message) let lebData = {};
this.getList() for (let i = 0; i < pageCount; i++) {
}).catch(({ lebData = await this.downData(excelData);
message pageCount = Math.ceil(lebData.count / excelData.limit);
}) => { if (lebData.export.length) {
this.$message.error(message) data = data.concat(lebData.export);
}) excelData.page++;
})
},
/**审核 */
onAudit(id){
this.$modalForm(extractManageAudit(id)).then(() => this.getList(1));
},
onDetails(id){
this.dialogVisible = true
extractManageDetail(id).then(res => {
this.loading = false
this.extractDetail = res.data
}).catch((res) => {
this.$message.error(res.message)
this.loading = false
})
},
//
selectChange(tab) {
this.timeVal = []
this.tableFrom.date = tab
this.tableFrom.page = 1;
this.getList()
},
//
onchangeTime(e) {
this.timeVal = e
this.tableFrom.date = e ? this.timeVal.join('-') : ''
this.tableFrom.page = 1;
this.getList()
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
excelData.limit = 100
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count/excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot,lebData.filename);
return
},
/**体现管理 */
downData(excelData) {
return new Promise((resolve, reject) => {
extractManageExportApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
//
exportRecord() {
extractManageExportApi(this.tableFrom)
.then((res) => {
const h = this.$createElement;
this.$msgbox({
title: '提示',
message: h('p', null, [
h('span', null, '文件正在生成中,请稍后点击"'),
h('span', { style: 'color: teal' }, '导出记录'),
h('span', null, '"查看~ '),
]),
confirmButtonText: '我知道了',
}).then(action => {
});
})
.catch((res) => {
this.$message.error(res.message)
})
},
//
getExportFileList() {
this.$refs.exportList.exportFileList()
},
//
getList(num) {
this.listLoading = true
this.tableFrom.page = num ? num : this.tableFrom.page;
extractListApi(this.tableFrom).then(res => {
this.tableData.data = res.data.list
this.tableData.total = res.data.count
this.listLoading = false
}).catch((res) => {
this.$message.error(res.message)
this.listLoading = false
})
},
pageChange(page) {
this.tableFrom.page = page
this.getList()
},
handleSizeChange(val) {
this.tableFrom.limit = val
this.getList()
} }
} }
} createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
},
/**体现管理 */
downData(excelData) {
return new Promise((resolve, reject) => {
extractManageExportApi(excelData).then((res) => {
return resolve(res.data);
});
});
},
//
exportRecord() {
extractManageExportApi(this.tableFrom)
.then((res) => {
const h = this.$createElement;
this.$msgbox({
title: "提示",
message: h("p", null, [
h("span", null, '文件正在生成中,请稍后点击"'),
h("span", { style: "color: teal" }, "导出记录"),
h("span", null, '"查看~ '),
]),
confirmButtonText: "我知道了",
}).then((action) => {});
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getExportFileList() {
this.$refs.exportList.exportFileList();
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
extractListApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.$message.error(res.message);
this.listLoading = false;
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList();
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList();
},
},
};
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.box-container { .box-container {
overflow: hidden; overflow: hidden;
} }
.list-count{ .list-count {
padding:30px 0; padding: 30px 0;
&:first-child{ &:first-child {
padding-top: 0; padding-top: 0;
border-bottom: 1px dashed #f5f5f5; border-bottom: 1px dashed #f5f5f5;
} }
} }
.box-container .list { .box-container .list {
margin-top: 15px; margin-top: 15px;
@ -374,21 +500,20 @@ export default {
.box-container .list .name { .box-container .list .name {
display: inline-block; display: inline-block;
color: var(--prev-color-text-secondary); color: var(--prev-color-text-secondary);
} }
.box-container .list .blue { .box-container .list .blue {
color: var(--prev-color-primary); color: var(--prev-color-primary);
} }
.box-container .list.image { .box-container .list.image {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.labeltop{ .labeltop {
max-height: 280px; max-height: 280px;
overflow-y: auto; overflow-y: auto;
} }
.title{ .title {
color: #17233d; color: #17233d;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;

View File

@ -0,0 +1,260 @@
<template>
<div class="divBox">
<div class="selCard">
<el-form ref="searchForm" size="small" inline label-width="85px">
<el-form-item label="用户姓名:" prop="user_name">
<el-input
v-model="tableForm.user_name"
placeholder="请输入用户姓名"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="用户电话:" prop="user_phone">
<el-input
v-model="tableForm.user_phone"
placeholder="请输入用户电话"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="身份证号:" prop="user_number">
<el-input
v-model="tableForm.user_number"
placeholder="请输入用户身份证号"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="用户ID" prop="user_id">
<el-input
v-model="tableForm.user_id"
placeholder="请输入用户ID"
class="selWidth"
></el-input>
</el-form-item>
<el-form-item label="账单日期:" prop="date">
<el-date-picker
v-model="tableForm.date"
value-format="yyyy-MM"
format="yyyy-MM"
type="month"
clearable
style="width: 280px"
@change="getList(1)"
placeholder="选择日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<el-card class="mt14">
<el-button class="mb10" type="primary" size="small" @click="exports"
>导出列表</el-button
>
<el-table
v-loading="listLoading"
:data="tableData.data"
size="small"
class="table"
highlight-current-row
>
<el-table-column label="序号" min-width="90">
<template scope="scope">
<span>{{
scope.$index + (tableForm.page - 1) * tableForm.limit + 1
}}</span>
</template>
</el-table-column>
<el-table-column prop="user_id" label="用户ID" min-width="120" />
<el-table-column prop="user_name" label="用户姓名" min-width="120" />
<el-table-column prop="user_phone" label="用户电话" min-width="120" />
<el-table-column
prop="user_number"
label="用户身份证号"
min-width="120"
/>
<el-table-column prop="date" label="账单日期" min-width="120" />
<el-table-column prop="as_price" label="成长值" min-width="120" />
<el-table-column
prop="order_amount"
label="申请奖励金额"
min-width="120"
/>
<el-table-column label="操作" min-width="100" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="exports('download', scope.row.mer_id, scope.row.date)"
>下载明细</el-button
>
</template>
</el-table-column>
</el-table>
<div class="block mb20">
<el-pagination
background
:page-size="tableForm.limit"
:current-page="tableForm.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import {
merchantBillList,
exportInancialRecordApi,
exportmerDetailExportApi,
} from "@/api/accounts";
import { merSelectApi } from "@/api/product";
import { roterPre } from "@/settings";
import createWorkBook from "@/utils/newToExcel.js";
export default {
name: "MerchantBill",
data() {
return {
loading: false,
roterPre: roterPre,
timeVal: [],
listLoading: true,
tableData: {
data: [],
total: 0,
},
tableForm: {
page: 1,
limit: 10,
mer_id: "",
date: "",
},
merSelect: [],
ruleForm: {
status: "0",
},
dialogVisible: false,
rules: {
status: [
{ required: true, message: "请选择对账状态", trigger: "change" },
],
},
reconciliationId: 0,
accountDetails: {
date: "",
charge: {},
expend: {},
income: {},
},
};
},
computed: {},
mounted() {
this.getMerSelect();
this.getList("");
},
methods: {
/**重置 */
searchReset() {
this.timeVal = [];
this.tableFrom.date = "";
this.$refs.searchForm.resetFields();
this.getList(1);
},
//
getMerSelect() {
merSelectApi()
.then((res) => {
this.merSelect = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
async exports(type, id, date) {
let params = {
mer_id: id,
page: 1,
limit: 500,
date,
};
const excelData = JSON.parse(JSON.stringify(this.tableForm));
let data = [];
excelData.page = 1;
excelData.limit = 200;
// excelData.ids = this.checkedIds.toString()
let pageCount = 1;
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData =
type == "download"
? await this.exportmerDetailExportApi(params)
: await this.downOrderData(excelData);
pageCount = Math.ceil(lebData.count / excelData.limit);
if (lebData.export.length) {
data = data.concat(lebData.export);
excelData.page++;
}
}
createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
},
/** 订单 */
downOrderData(excelData) {
return new Promise((resolve, reject) => {
exportInancialRecordApi(excelData).then((res) => {
return resolve(res.data);
});
});
},
/** 下载订单 */
exportmerDetailExportApi(excelData) {
return new Promise((resolve, reject) => {
exportmerDetailExportApi(excelData).then((res) => {
return resolve(res.data);
});
});
},
//
getList(num) {
this.listLoading = true;
this.tableForm.page = num ? num : this.tableForm.page;
merchantBillList(this.tableForm)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
pageChange(page) {
this.tableForm.page = page;
this.getList("");
},
handleSizeChange(val) {
this.tableForm.limit = val;
this.chkName = "";
this.getList("");
},
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,571 @@
<template>
<div>
<el-form
ref="formValidate"
:model="formValidate"
:rules="ruleValidate"
label-width="90px"
>
<el-form-item label="奖品:" prop="type">
<el-radio-group v-model="formValidate.type">
<el-radio :label="1">未中奖</el-radio>
<el-radio :label="10">免单</el-radio>
<el-radio :label="11">实物</el-radio>
<!-- <el-radio :label="5">优惠券</el-radio> -->
<!-- <el-radio :label="2">铸源星</el-radio> -->
<!-- <el-radio :label="6">站内商品</el-radio> -->
<!-- <el-radio :label="4"></el-radio> -->
<!-- <el-radio :label="3">折扣券</el-radio> -->
</el-radio-group>
</el-form-item>
<el-form-item label="赠送优惠券:" v-if="formValidate.type == 5">
<el-input
v-model="formValidate.coupon_id"
:maxlength="10"
placeholder="请输入优惠券id"
style="width: 300px"
></el-input>
<!-- <div v-if="couponName.length" class="mb20">
<el-tag
closable
v-for="(item, index) in couponName"
:key="index"
@close="handleClose(item)"
>{{ item.title }}</el-tag
>
</div>
<el-button type="primary" @click="addCoupon" v-if="!couponName.length"
>添加优惠券</el-button
> -->
</el-form-item>
<el-form-item
:label="[3, 4].includes(formValidate.type) ? '金额信息' : '积分数量'"
prop="num"
v-if="[2, 3, 4].includes(formValidate.type)"
>
<el-input-number
:controls="false"
v-model="formValidate.num"
placeholder="请输入金额数量"
:max="9999999999"
:min="1"
style="width: 300px"
></el-input-number>
<div class="ml100 grey">
{{
formValidate.type == 3
? "用户领取余额后会自动到账余额账户"
: formValidate.type == 4
? "用户领取红包后会自动到账微信零钱,添加此奖品需开通微信支付,并且账户中金额不能小于1元"
: ""
}}
</div>
</el-form-item>
<el-form-item
v-if="formValidate.type == 6"
label="商品:"
prop="goods_image"
>
<template v-if="formValidate.goods_image">
<div class="upload-list">
<img :src="formValidate.goods_image" />
<i
class="el-icon-error"
@click="removeGoods()"
style="font-size: 16px"
></i>
</div>
</template>
<div
v-else
class="upLoad pictrueTab acea-row row-center-wrapper"
@click="changeGoods"
>
<i class="el-icon-picture-outline" style="font-size: 24px"></i>
</div>
</el-form-item>
<el-form-item label="奖品名称:" prop="name">
<el-input
v-model="formValidate.name"
:maxlength="10"
placeholder="请输入奖品名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item label="奖品图片:" prop="image">
<template v-if="formValidate.image">
<div class="upload-list">
<img :src="formValidate.image" />
<i
class="el-icon-error"
@click="remove()"
style="font-size: 16px"
></i>
</div>
</template>
<div
v-else
@click="modalPicTap('1')"
class="upLoad pictrueTab acea-row row-center-wrapper"
>
<i class="el-icon-picture-outline" style="font-size: 24px"></i>
</div>
<!-- <div class="info">选择商品</div> -->
</el-form-item>
<el-form-item label="奖品数量:" prop="total">
<el-input-number
:controls="false"
v-model="formValidate.total"
placeholder="请输入奖品数量"
:max="9999999999"
:min="0"
:precision="0"
style="width: 300px"
></el-input-number>
</el-form-item>
<el-form-item label="奖品权重:" prop="chance">
<el-input-number
:controls="false"
v-model="formValidate.chance"
placeholder="请输入奖品权重"
:max="100"
:min="1"
:precision="0"
style="width: 300px"
></el-input-number>
</el-form-item>
<el-form-item
label="中奖条件:"
prop="condition"
v-if="formValidate.type == 10 || formValidate.type == 11"
>
订单金额{{ formValidate.type == 10 ? "小于" : "大于" }}
<el-input
v-model="formValidate.condition"
:maxlength="15"
placeholder="请输入中奖条件"
style="width: 220px"
></el-input>
</el-form-item>
<el-form-item
label="免单金额:"
prop="amount"
v-if="formValidate.type == 10"
>
<el-input
v-model="formValidate.amount"
:maxlength="15"
placeholder="请输入免单金额"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item label="提示语:" prop="prompt">
<el-input
v-model="formValidate.prompt"
:maxlength="15"
placeholder="请输入提示语"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item label="排序:" prop="sort">
<el-input
v-model="formValidate.sort"
:maxlength="15"
placeholder="请输入排序"
style="width: 300px"
></el-input>
</el-form-item>
<!-- <div
v-for="(day, index) in formValidate.prizeNum"
:key="index"
class="day-item"
>
<el-form-item :label="day.date">
<el-input-number
:controls="false"
v-model="day.num"
placeholder="请输入奖品数量"
:max="9999999999"
:min="0"
:precision="0"
style="width: 300px"
></el-input-number>
</el-form-item>
</div> -->
<el-form-item>
<el-button type="primary" @click="handleSubmit('formValidate')"
>提交</el-button
>
</el-form-item>
</el-form>
<!-- 上传图片-->
<!-- <el-dialog
:visible.sync="modalPic"
:modal="false"
width="1024px"
title="上传图片"
:close-on-click-modal="false"
>
<uploadPictures
:isChoice="isChoice"
@getPic="getPic"
v-if="modalPic"
></uploadPictures>
</el-dialog> -->
<goods-list ref="goodslistf" @getProduct="getProduct"></goods-list>
<!-- <coupon-list
ref="couponTemplates"
:luckDraw="true"
@getCouponId="getCouponId"
></coupon-list> -->
<!--<coupon-list-->
<!--ref="couponTemplates"-->
<!--@nameId="nameId"-->
<!--:updateIds="updateIds"-->
<!--:updateName="updateName"-->
<!--&gt;</coupon-list>-->
</div>
</template>
<script>
// import couponList from '@/components/couponList';
import uploadPictures from "@/components/uploadPicture";
import goodsList from "./components/goodsList";
// import freightTemplate from '@/components/freightTemplate';
export default {
components: { uploadPictures, goodsList },
data() {
return {
modalPic: false,
modals: false,
isChoice: "单选",
updateIds: [],
updateName: [],
goodsData: {
pic: "",
product_id: "",
img: "",
coverImg: "",
},
formValidate: {
type: 1, // 12 3: 4 5: 6
name: "", //
num: 0, //
image: "", //
chance: 1, //
product_id: 0, //id
coupon_id: 0, //id
total: 0, //
// prizeNum: [], //
prompt: "", //
condition: "",
amount: "",
goods_image: "", //
coupon_title: "", //
sort: 0, //
},
couponName: [],
};
},
props: {
editData: {
type: Object,
default: () => {},
},
dateTime: {
type: Array,
},
},
watch: {
editData(data) {},
},
computed: {
ruleValidate() {
var conditionType = (rule, value, callback) => {
if (this.formValidate.type == 11) {
return callback();
}
if (!value) {
return callback(new Error("请输入中奖条件"));
}
};
return {
name: [
{
required: true,
message: "商品名称",
trigger: "blur",
},
],
goods_image: [
{
required: true,
message: "请添加商品",
trigger: "blur",
},
],
num: [
{
required: true,
type: "number",
message: "请输入金额数量",
trigger: "blur",
},
],
chance: [
{
required: true,
type: "number",
message: "请输入商品权重",
trigger: "blur",
},
],
image: [
{
required: true,
message: "请选择奖品图片",
trigger: "blur",
},
],
condition: [
{
required: this.formValidate.type == 11 ? false : true,
type: "number",
validator: conditionType,
trigger: "blur",
},
],
amount: [
{
required: true,
message: "请输入免得金额",
trigger: "blur",
},
],
prompt: [
{
required: true,
message: "请输入提示语",
trigger: "blur",
},
],
};
},
},
mounted() {
let keys = Object.keys(this.editData);
keys.forEach((item) => {
this.formValidate[item] = this.editData[item];
if (item === "coupon_title" && this.editData[item]) {
this.couponName.push({
title: this.editData[item],
id: this.editData.coupon_id,
});
}
});
// this.generateDaysArray();
},
methods: {
generateDaysArray() {
// Date
const start = new Date(this.dateTime[0]);
const end = new Date(this.dateTime[1]);
//
const diffInMilliseconds = end - start;
const diffInDays =
Math.floor(diffInMilliseconds / (1000 * 60 * 60 * 24)) + 1;
//
this.formValidate.prizeNum = this.formValidate.prizeNum.length
? this.formValidate.prizeNum
: [];
for (let i = 0; i < diffInDays; i++) {
const date = new Date(start);
date.setDate(start.getDate() + i + 1);
this.formValidate.prizeNum.push({
date: date.toISOString().split("T")[0], // YYYY-MM-DD
num: "", //
});
}
},
//
changeGoods() {
console.log(this.$refs["goodslistf"]);
this.$refs.goodslistf.dialogVisible = true;
},
getCouponId(e) {
this.formValidate.coupon_id = e.id;
this.formValidate.coupon_title = e.coupon_title;
let couponName = [];
couponName.push(e);
this.couponName = couponName;
},
handleSubmit(name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.$emit("addGoodsData", this.formValidate);
// this.$message.success("");
} else {
this.$message.warning("请完善数据");
}
});
},
//
getPic(pc) {
this.formValidate.image = pc.att_dir;
this.modalPic = false;
},
//
// modalPicTap() {
// this.modalPic = true;
// },
modalPicTap(tit, num, i) {
const _this = this;
const attr = [];
this.$modalUpload(function (img) {
if (tit === "1" && !num) {
_this.formValidate.image = img[0];
// _this.OneattrValue[0].image = img[0];
}
if (tit === "2" && !num) {
img.map((item) => {
attr.push(item.attachment_src);
_this.formValidate.slider_image.push(item);
if (_this.formValidate.slider_image.length > 10) {
_this.formValidate.slider_image.length = 10;
}
});
}
if (tit === "1" && num === "dan") {
_this.OneattrValue[0].image = img[0];
}
if (tit === "1" && num === "duo") {
_this.ManyAttrValue[i].image = img[0];
}
if (tit === "1" && num === "pi") {
_this.oneFormBatch[0].image = img[0];
}
}, tit);
},
cancel() {
this.modals = false;
},
//
getProduct(productList) {
console.log(productList);
// if (productList.length > 1) {
// this.$message.warning("");
// return;
// }
this.formValidate.product_id = productList.id;
this.formValidate.goods_image = productList.src;
console.log(this.formValidate.product_id);
// this.modals = false;
// productList.forEach((value) => {
// this.formValidate.product_id = value.product_id;
// this.formValidate.goods_image = value.image;
// });
},
removeGoods() {
this.formValidate.product_id = "";
this.formValidate.goods_image = "";
},
remove() {
this.formValidate.image = "";
},
//
addCoupon() {
this.$refs.couponTemplates.isTemplate = true;
this.$refs.couponTemplates.tableList();
},
handleClose(name) {
this.couponName.splice(0, 1);
this.formValidate.coupon_id = 0;
},
//
unique(arr) {
const res = new Map();
return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
},
},
};
</script>
<style scoped lang="scss">
.pictrueBox {
display: inline-block;
}
.pictrue {
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 15px;
display: inline-block;
position: relative;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
.btndel {
position: absolute;
z-index: 1;
width: 20px !important;
height: 20px !important;
left: 46px;
top: -4px;
}
}
.upload-list {
width: 58px;
height: 58px;
line-height: 58px;
border: 1px dotted rgba(0, 0, 0, 0.1);
border-radius: 4px;
background: rgba(0, 0, 0, 0.02);
cursor: pointer;
position: relative;
.el-icon-error {
position: absolute;
right: -8px;
top: -8px;
}
}
.upload-list img {
display: block;
width: 100%;
height: 100%;
}
.upLoad {
width: 58px;
height: 58px;
line-height: 58px;
border: 1px dotted rgba(0, 0, 0, 0.1);
border-radius: 4px;
background: rgba(0, 0, 0, 0.02);
cursor: pointer;
}
.ivu-icon-ios-close-circle {
position: absolute;
top: 0;
right: 0;
transform: translate(50%, -50%);
}
.grey {
color: #999;
}
</style>

View File

@ -0,0 +1,174 @@
<template>
<el-dialog
v-if="dialogVisible"
:close-on-click-modal="false"
append-to-body
title="商品信息"
:visible.sync="dialogVisible"
width="1000px"
>
<div class="divBox">
<div class="container">
<el-form size="small" inline label-width="85px">
<el-form-item label="商品分类:">
<el-cascader
v-model="tableFrom.pid"
:options="merCateList"
:props="{ checkStrictly: true, emitPath: false }"
clearable
@change="getList(1)"
class="selWidth"
/>
</el-form-item>
<el-form-item label="商品搜索:">
<el-input
v-model="tableFrom.keyword"
placeholder="请输入商品名称,关键字,编号"
class="selWidth"
clearable
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList"
>查询</el-button
>
</el-form-item>
</el-form>
</div>
<el-alert
title="注:添加为预售商品后,原普通商品会下架;如该商品已开启其它营销活动,请勿选择!"
type="warning"
v-if="resellShow"
show-icon
>
</el-alert>
<el-table
v-loading="listLoading"
:data="tableData.data"
style="width: 100%; margin-top: 10px"
size="mini"
>
<el-table-column width="55">
<template slot-scope="scope">
<el-radio
v-model="templateRadio"
:label="scope.row.product_id"
@change.native="getTemplateRow(scope.row)"
>&nbsp</el-radio
>
</template>
</el-table-column>
<el-table-column prop="product_id" label="ID" min-width="50" />
<el-table-column label="商品图" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 36px; height: 36px"
:src="scope.row.image"
:preview-src-list="[scope.row.image]"
/>
</div>
</template>
</el-table-column>
<el-table-column prop="store_name" label="商品名称" min-width="150" />
<el-table-column prop="stock" label="库存" min-width="80" />
</el-table>
<div class="block mb20">
<el-pagination
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</div>
</el-dialog>
</template>
<script>
import { merProductLstApi, categoryListApi } from "@/api/product";
import { roterPre } from "@/settings";
export default {
name: "GoodsList",
props: {
resellShow: {
type: Boolean,
default: false,
},
},
data() {
return {
dialogVisible: false,
templateRadio: 0,
merCateList: [],
roterPre: roterPre,
listLoading: true,
tableData: {
data: [],
total: 0,
},
tableFrom: {
page: 1,
limit: 10,
cate_id: "",
store_name: "",
keyword: "",
type: 1,
is_gift_bag: 0,
},
multipleSelection: {},
checked: [],
};
},
mounted() {
this.getList();
this.getCategorySelect();
window.addEventListener("unload", (e) => this.unloadHandler(e));
},
methods: {
getTemplateRow(row) {
this.multipleSelection = { src: row.image, id: row.product_id };
this.dialogVisible = false;
this.$emit("getProduct", this.multipleSelection);
},
//
getCategorySelect() {
categoryListApi()
.then((res) => {
this.merCateList = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num || this.tableFrom.page;
merProductLstApi(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList();
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList();
},
},
};
</script>
<style scoped lang="scss"></style>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,68 @@
const lotteryFrom = {
name: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
factor: [{ required: true, type: 'number', message: '请选择活动类型', trigger: 'change' }],
attends_user: [{ required: true, type: 'number', message: '请选择参与用户', trigger: 'change' }],
factor_num: [{ required: true, type: 'number', message: '请输入抽奖次数', trigger: 'blur' }],
// prize: [
// {
// required: true,
// type: 'array',
// message: '请添加抽奖奖品(8条)',
// trigger: 'change',
// },
// {
// type: 'array',
// min: 8,
// message: '请添加抽奖奖品(8条)',
// trigger: 'change',
// },
// ],
lottery_num: [
{
required: true,
type: 'number',
message: '请输入邀请新用户最多可获得抽奖多少次',
trigger: 'blur',
},
],
spread_num: [
{
required: true,
type: 'number',
message: '请输入关注额外抽多少次',
trigger: 'blur',
},
],
image: [
{
required: true,
message: '请上传活动背景图',
trigger: 'change',
},
],
content: [
{
required: true,
message: '请填写活动规则',
trigger: 'blur',
},
],
};
function validate(rule, value, callback) {
if (Array.isArray(value)) {
//格式为daterange、datetimerange检测
value.map(function (item) {
if (item === '') {
return callback('日期不能为空');
}
});
} else {
//格式为date、datetime、year、month 检测
if (value === '') {
return callback('日期不能为空');
}
}
return callback();
}
export { lotteryFrom };

View File

@ -0,0 +1,27 @@
const ruleShip = {
deliver_name: [
{
required: true,
type: 'string',
message: '请选择快递公司',
trigger: 'select',
},
],
deliver_number: [
{
required: true,
message: '请输入快递单号',
trigger: 'blur',
},
],
};
const ruleMark = {
mark: [
{
required: true,
message: '请输入备注信息',
trigger: 'blur',
},
],
};
export { ruleShip, ruleMark };

View File

@ -0,0 +1,320 @@
<template>
<div>
<el-card :bordered="false" shadow="never" class="ivu-mt">
<el-form
ref="tableFrom"
:model="tableFrom"
:label-width="labelWidth"
:label-position="labelPosition"
@submit.native.prevent
>
<el-scope.row :gutter="24">
<el-col>
<el-form-item label="活动类型:" clearable>
<el-select
style="width: 200px"
v-model="tableFrom.factor"
placeholder="请选择活动类型"
clearable
@change="userSearchs"
>
<el-option value="1" label="积分抽取"></el-option>
<!-- <el-option value="2">余额</el-option> -->
<el-option value="3" label="订单支付"></el-option>
<el-option value="4" label="订单评价"></el-option>
<!-- <el-option value="5">关注公众号</el-option> -->
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="活动状态:" clearable>
<el-select
style="width: 200px"
v-model="tableFrom.start_status"
placeholder="请选择"
clearable
@change="userSearchs"
>
<el-option value="0" label="未开始"></el-option>
<el-option value="1" label="进行中"></el-option>
<el-option value="-1" label="已结束"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="上架状态:">
<el-select
style="width: 200px"
placeholder="请选择"
v-model="tableFrom.status"
clearable
@change="userSearchs"
>
<el-option value="1" label="上架"></el-option>
<el-option value="0" label="下架"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="抽奖搜索:" label-for="store_name">
<el-input
search
enter-button
style="width: 200px"
placeholder="请输入抽奖名称ID"
v-model="tableFrom.store_name"
@on-search="userSearchs"
/>
</el-form-item>
</el-col>
</el-scope.row>
<el-scope.row class="mb20">
<el-button v-auth="['marketing-store_bargain-create']" type="primary" @click="add" class="mr10"
>添加抽奖</el-button
>
</el-scope.row>
</el-form>
<el-table
:data="tableList"
v-loading="loading"
highlight-scope.row
no-userFrom-text="暂无数据"
no-filtered-userFrom-text="暂无筛选结果"
>
<el-table-column label="ID" width="80">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column label="活动名称" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.name }}</span>
</template>
</el-table-column>
<el-table-column label="活动类型" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.lottery_type }}</span>
</template>
</el-table-column>
<el-table-column label="参与次数" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.lottery_all }}</span>
</template>
</el-table-column>
<el-table-column label="抽奖人数" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.lottery_people }}</span>
</template>
</el-table-column>
<el-table-column label="中奖人数" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.lottery_win }}</span>
</template>
</el-table-column>
<el-table-column label="活动状态" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.status_name }}</span>
</template>
</el-table-column>
<el-table-column label="上架状态" min-width="130">
<template slot-scope="scope">
<el-switch
class="defineSwitch"
:active-value="1"
:inactive-value="0"
v-model="scope.row.status"
:value="scope.row.status"
:disabled="scope.row.lottery_status == 2 ? true : false"
@change="onchangeIsShow(scope.row)"
size="large"
active-text="上架"
inactive-text="下架"
>
</el-switch>
</template>
</el-table-column>
<el-table-column label="活动时间" min-width="130">
<template slot-scope="scope">
<div>{{ scope.row.start_time || '--' }}</div>
<div>{{ scope.row.end_time || '--' }}</div>
</template>
</el-table-column>
<el-table-column label="活动状态" min-width="130">
<template slot-scope="scope">
<span>{{ scope.row.status_name }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="170">
<template slot-scope="scope">
<a @click="edit(scope.row)">编辑</a>
<el-divider direction="vertical"></el-divider>
<a @click="del(scope.row, '删除抽奖', scope.$index)">删除</a>
<el-divider direction="vertical"></el-divider>
<a @click="copy(scope.row)">复制</a>
<el-divider direction="vertical"></el-divider>
<a @click="getRecording(scope.row)">抽奖记录</a>
</template>
</el-table-column>
</el-table>
<div class="acea-row row-right page">
<pagination
v-if="total"
:total="total"
:page.sync="tableFrom.page"
:limit.sync="tableFrom.limit"
@pagination="getList"
/>
</div>
</el-card>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { lotteryListApi, lotteryStatusApi } from '@/api/lottery';
import { formatDate } from '@/utils/validate';
export default {
name: 'storeBargain',
filters: {
formatDate(time) {
if (time !== 0) {
let date = new Date(time * 1000);
return formatDate(date, 'yyyy-MM-dd hh:mm');
}
},
},
data() {
return {
loading: false,
tableList: [],
tableFrom: {
start_status: '',
status: '',
store_name: '',
export: 0,
page: 1,
factor: '',
limit: 15,
},
total: 0,
};
},
computed: {
...mapState('admin/layout', ['isMobile']),
labelWidth() {
return this.isMobile ? undefined : '80px';
},
labelPosition() {
return this.isMobile ? 'top' : 'right';
},
},
created() {
this.getList();
},
methods: {
//
add() {
this.$router.push({ path: this.$routeProStr + '/marketing/lottery/create' });
},
//
edit(row) {
this.$router.push({
name: 'marketing_create',
query: {
id: row.id,
},
});
},
//
copy(row) {
this.$router.push({
name: 'marketing_create',
query: {
id: row.id,
copy: 1,
},
});
},
//
del(row, tit, num) {
let delfromData = {
title: tit,
num: num,
url: `marketing/lottery/del/${row.id}`,
method: 'DELETE',
ids: '',
};
this.$modalSure(delfromData)
.then((res) => {
this.$message.success(res.msg);
this.tableList.splice(num, 1);
})
.catch((res) => {
this.$message.error(res.msg);
});
},
//
getRecording(row) {
this.$router.push({
path: this.$routeProStr + `/marketing/lottery/recording_list`,
query: {
id: row.id,
},
});
},
//
getList() {
this.loading = true;
this.tableFrom.start_status = this.tableFrom.start_status || '';
this.tableFrom.status = this.tableFrom.status || '';
lotteryListApi(this.tableFrom)
.then(async (res) => {
let data = res.data;
this.tableList = data.list;
this.total = res.data.count;
this.loading = false;
})
.catch((res) => {
this.loading = false;
this.$message.error(res.msg);
});
},
//
userSearchs() {
this.tableFrom.page = 1;
this.getList();
},
//
onchangeIsShow(row) {
let data = {
id: row.id,
status: row.status,
};
lotteryStatusApi(data)
.then(async (res) => {
this.$message.success(res.msg);
this.getList();
})
.catch((res) => {
this.$message.error(res.msg);
this.getList();
});
},
},
};
</script>
<style scoped lang="stylus">
.tabBox_img {
width: 36px;
height: 36px;
border-radius: 4px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
</style>

View File

@ -0,0 +1,376 @@
<template>
<div>
<el-card :bordered="false" shadow="never" class="ivu-mt" :body-style="{ padding: 0 }">
<div class="padding-add">
<el-form
ref="tableFrom"
:model="tableFrom"
:label-width="labelWidth"
label-position="right"
@submit.native.prevent
inline
>
<el-form-item label="活动类型:" clearable>
<el-select
type="button"
v-model="tableFrom.factor"
@change="selectChangeFactor"
class="form_content_width"
clearable
>
<el-option label="积分抽取" :value="1"></el-option>
<el-option label="订单支付" :value="3"></el-option>
<el-option label="订单评价" :value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item label="时间选择:">
<el-date-picker
clearable
v-model="timeVal"
type="daterange"
:editable="false"
@change="onchangeTime"
format="yyyy/MM/dd"
value-format="yyyy/MM/dd"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
style="width: 250px"
></el-date-picker>
</el-form-item>
<el-form-item label="奖品类型:">
<el-select type="button" v-model="tableFrom.type" @change="selectType" class="form_content_width" clearable>
<el-option v-for="(item, i) in typeList" :key="i" :label="item.text" :value="item.val"></el-option>
</el-select>
</el-form-item>
<el-form-item label="搜索用户:" label-for="store_name">
<el-input clearable placeholder="请输入用户信息" v-model="tableFrom.keyword" class="form_content_width" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="userSearchs">查询</el-button>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card :bordered="false" shadow="never" class="ivu-mt mt16">
<el-table
:data="tableList"
v-loading="loading"
highlight-current-row
no-userFrom-text="暂无数据"
no-filtered-userFrom-text="暂无筛选结果"
>
<el-table-column label="ID" width="80">
<template slot-scope="scope">
<div>{{ scope.row.id }}</div>
</template>
</el-table-column>
<el-table-column label="用户信息" min-width="90">
<template slot-scope="scope">
<span>{{ scope.row.user.nickname }} </span>
</template>
</el-table-column>
<el-table-column label="奖品信息" min-width="130">
<template slot-scope="scope">
<div class="prize">
<img :src="scope.row.prize.image" alt="" />
<span>{{ scope.row.prize.name }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="抽奖时间" min-width="100">
<template slot-scope="scope">
<div>{{ scope.row.add_time }}</div>
</template>
</el-table-column>
<el-table-column label="收货信息" min-width="100">
<template slot-scope="scope">
<div v-if="scope.row.receive_info.name">
<div>姓名{{ scope.row.receive_info.name }}</div>
<div>电话{{ scope.row.receive_info.phone }}</div>
<div>地址{{ scope.row.receive_info.address }}</div>
<div v-if="scope.row.receive_info.mark">备注{{ scope.row.receive_info.mark }}</div>
</div>
</template>
</el-table-column>
<el-table-column label="备注" min-width="100">
<template slot-scope="scope">
<span>{{ scope.row.deliver_info.mark }}</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="120">
<template slot-scope="scope">
<a @click="deliver(scope.row, 1)" v-if="scope.row.type == 6 && scope.row.is_deliver === 0">发货</a>
<a v-else-if="scope.row.type == 6 && scope.row.is_deliver === 1" @click="isDeliver(scope.row)">配送信息</a>
<el-divider direction="vertical" v-if="scope.row.type == 6" />
<a @click="deliver(scope.row, 2)">备注</a>
</template>
</el-table-column>
</el-table>
<div class="acea-row row-right page">
<pagination
v-if="total"
:total="total"
:page.sync="tableFrom.page"
:limit.sync="tableFrom.limit"
@pagination="getList"
/>
</div>
</el-card>
<!-- 发货-->
<el-dialog
:visible.sync="shipModel"
width="540px"
:title="!modelTitle ? (modelType === 1 ? '发货' : '备注') : modelTitle"
:close-on-click-modal="false"
>
<el-form
v-model="shipModel"
:ref="modelType === 1 ? 'shipForm' : 'markForm'"
:model="modelType === 1 ? shipForm : markForm"
:rules="modelType === 1 ? ruleShip : ruleMark"
label-width="90px"
>
<el-form-item v-if="modelType === 1" label="快递公司:" prop="deliver_name">
<el-select v-model="shipForm.deliver_name" class="w100">
<el-option v-for="item in locationList" :value="item.value" :key="item.id" :label="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="modelType === 1" label="快递单号:" prop="deliver_number">
<el-input v-model="shipForm.deliver_number" placeholder="请输入快递单号" class="w100"></el-input>
<div class="tips-info" v-if="shipForm.deliver_name == '顺丰速运'">
<p>顺丰请输入单号 :收件人或寄件人手机号后四位</p>
<p>例如SF000000000000:3941</p>
</div>
</el-form-item>
<el-form-item v-if="modelType === 2" label="备注:">
<el-input v-model="markForm.mark" placeholder="请输入备注" class="w100"></el-input>
</el-form-item>
<el-form-item>
<div class="acea-row row-right">
<el-button @click="cancel('formValidate')">关闭</el-button>
<el-button type="primary" @click="ok(modelType === 1 ? 'shipForm' : 'markForm')">提交</el-button>
</div>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { mapState } from 'vuex';
import { lotteryRecordList, lotteryRecordDeliver } from '@/api/lottery';
import { formatDate } from '@/utils/validate';
import { getExpressData } from '@/api/order';
import { ruleShip, ruleMark } from './formRule/ruleShip';
export default {
name: 'lotteryRecordList',
filters: {
formatDate(time) {
if (time !== 0) {
let date = new Date(time * 1000);
return formatDate(date, 'yyyy-MM-dd hh:mm');
}
},
},
data() {
return {
shipModel: false,
loading: false,
locationList: [],
shipForm: {
id: '',
deliver_name: '',
deliver_number: null,
},
markForm: {
id: '',
mark: '',
},
ruleShip: ruleShip,
ruleMark: ruleMark,
pickerOptions: this.$timeOptions,
typeList: [
{ text: '全部', val: '' },
{ text: '未中奖', val: '1' },
{ text: '积分', val: '2' },
{ text: '余额', val: '3' },
{ text: '红包', val: '4' },
{ text: '优惠券', val: '5' },
{ text: '商品', val: '6' },
],
tableList: [],
grid: {
xl: 7,
lg: 10,
md: 12,
sm: 24,
xs: 24,
},
tableFrom: {
keyword: '',
date: [],
page: 1,
limit: 15,
factor: '',
},
total: 0,
timeVal: [],
modelType: 1,
lottery_id: '',
modelTitle: '',
};
},
computed: {
...mapState('admin/layout', ['isMobile']),
labelWidth() {
return this.isMobile ? undefined : '80px';
},
labelPosition() {
return this.isMobile ? 'top' : 'right';
},
},
created() {
this.tableFrom.lottery_id = this.$route.query.id;
this.lottery_id = this.$route.query.id;
this.getList();
this.getExpressData();
},
methods: {
deliver(row, type) {
this.markForm.id = row.id;
this.shipForm.id = row.id;
this.shipForm.deliver_name = '';
this.shipForm.deliver_number = '';
this.markForm.mark = row.deliver_info.mark;
this.modelType = type;
this.shipModel = true;
},
isDeliver(row) {
this.markForm.id = row.id;
this.shipForm.id = row.id;
this.modelType = 1;
this.modelTitle = '配送信息';
this.shipModel = true;
this.shipForm.deliver_name = row.deliver_info.deliver_name;
this.shipForm.deliver_number = row.deliver_info.deliver_number;
},
ok(name) {
this.$refs[name].validate((valid) => {
lotteryRecordDeliver(this.modelType == 1 ? this.shipForm : this.markForm)
.then((res) => {
this.$message.success('操作成功');
this.shipModel = false;
this.getList();
this.shipForm = {
id: '',
deliver_name: '',
deliver_number: null,
};
this.modelTitle = '';
this.markForm = {
id: '',
mark: '',
};
})
.catch((err) => {
this.$message.error(err.msg);
});
});
},
cancel() {
this.modelType = 1;
this.modelTitle = '';
this.shipModel = false;
},
//
getExpressData() {
getExpressData()
.then(async (res) => {
this.locationList = res.data;
})
.catch((res) => {
this.$message.error(res.msg);
});
},
//
onchangeTime(e) {
this.timeVal = e || [];
this.tableFrom.data = this.timeVal[0] ? (this.timeVal ? this.timeVal.join('-') : '') : '';
this.tableFrom.page = 1;
this.getList();
},
//
selectChange(tab) {
this.tableFrom.page = 1;
this.tableFrom.date = tab;
this.timeVal = [];
this.getList();
},
selectType(type) {
this.tableFrom.page = 1;
this.timeVal = [];
this.getList();
},
selectChangeFactor() {
this.tableFrom.page = 1;
this.timeVal = [];
this.getList();
},
//
getList() {
this.loading = true;
lotteryRecordList(this.tableFrom)
.then(async (res) => {
let data = res.data;
this.tableList = data.list;
this.total = res.data.count;
this.loading = false;
})
.catch((res) => {
this.loading = false;
this.$message.error(res.msg);
});
},
//
userSearchs() {
this.tableFrom.page = 1;
this.getList();
},
},
};
</script>
<style scoped lang="stylus">
.tabBox_img {
width: 36px;
height: 36px;
border-radius: 4px;
cursor: pointer;
img {
width: 100%;
height: 100%;
}
}
.prize {
display: flex;
align-items: center;
}
.prize img {
width: 36px;
height: 36px;
border-radius: 4px;
cursor: pointer;
margin-right: 5px;
}
.trips {
color: #ccc;
}
.w414{
width 414px;
}
</style>

View File

@ -12,10 +12,18 @@
<div class="full"> <div class="full">
<img class="order_icon" :src="orderImg" alt="" /> <img class="order_icon" :src="orderImg" alt="" />
<div class="text"> <div class="text">
<div class="title">{{ orderDetailList.order_type == 0 ? '普通订单' : '核销订单' }}</div> <div class="title">
{{ orderDetailList.order_type == 0 ? "普通订单" : "核销订单" }}
</div>
<div> <div>
<span class="mr20">订单编号{{ orderDetailList.order_sn }}</span> <span class="mr20"
<span class="mr20">总订单号{{ orderDetailList.groupOrder.group_order_sn }}</span> >订单编号{{ orderDetailList.order_sn }}</span
>
<span class="mr20"
>总订单号{{
orderDetailList.groupOrder.group_order_sn
}}</span
>
</div> </div>
</div> </div>
</div> </div>
@ -23,12 +31,26 @@
<li class="item"> <li class="item">
<div class="title">订单状态</div> <div class="title">订单状态</div>
<div> <div>
<div v-if="!orderDetailList.pay_time" class="value1">待付款</div> <div v-if="!orderDetailList.pay_time" class="value1">
<div v-if="orderDetailList.order_type === 0 && orderDetailList.pay_time" class="value1"> 待付款
</div>
<div
v-if="
orderDetailList.order_type === 0 && orderDetailList.pay_time
"
class="value1"
>
<span>{{ orderDetailList.status | orderStatusFilter }}</span> <span>{{ orderDetailList.status | orderStatusFilter }}</span>
</div> </div>
<div v-if="orderDetailList.order_type === 1 && orderDetailList.pay_time" class="value1"> <div
<span>{{ orderDetailList.status | cancelOrderStatusFilter }}</span> v-if="
orderDetailList.order_type === 1 && orderDetailList.pay_time
"
class="value1"
>
<span>{{
orderDetailList.status | cancelOrderStatusFilter
}}</span>
</div> </div>
</div> </div>
</li> </li>
@ -56,17 +78,31 @@
<div>用户昵称</div> <div>用户昵称</div>
<div class="value"> <div class="value">
{{ {{
orderDetailList.user.real_name ? orderDetailList.user.real_name : orderDetailList.user.nickname orderDetailList.user.real_name
? orderDetailList.user.real_name
: orderDetailList.user.nickname
}} }}
</div> </div>
</li> </li>
<li class="item"> <li class="item">
<div>用户ID</div> <div>用户ID</div>
<div class="value">{{ orderDetailList.user.uid ? orderDetailList.user.uid : '-' }}</div> <div class="value">
{{
orderDetailList.user.uid
? orderDetailList.user.uid
: "-"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>绑定电话</div> <div>绑定电话</div>
<div class="value">{{ orderDetailList.user.phone ? orderDetailList.user.phone : '-' }}</div> <div class="value">
{{
orderDetailList.user.phone
? orderDetailList.user.phone
: "-"
}}
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -75,15 +111,33 @@
<ul class="list"> <ul class="list">
<li class="item"> <li class="item">
<div>收货人</div> <div>收货人</div>
<div class="value">{{ orderDetailList.real_name ? orderDetailList.real_name : '-' }}</div> <div class="value">
{{
orderDetailList.real_name
? orderDetailList.real_name
: "-"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>收货电话</div> <div>收货电话</div>
<div class="value">{{ orderDetailList.user_phone ? orderDetailList.user_phone : '-' }}</div> <div class="value">
{{
orderDetailList.user_phone
? orderDetailList.user_phone
: "-"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>收货地址</div> <div>收货地址</div>
<div class="value">{{ orderDetailList.user_address ? orderDetailList.user_address : '-' }}</div> <div class="value">
{{
orderDetailList.user_address
? orderDetailList.user_address
: "-"
}}
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -92,15 +146,34 @@
<ul class="list"> <ul class="list">
<li class="item"> <li class="item">
<div>创建时间</div> <div>创建时间</div>
<div class="value">{{ orderDetailList.create_time ? orderDetailList.create_time : '-' }}</div> <div class="value">
{{
orderDetailList.create_time
? orderDetailList.create_time
: "-"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>商品总数</div> <div>商品总数</div>
<div class="value">{{ orderDetailList.total_num ? orderDetailList.total_num : '-' }}</div> <div class="value">
{{
orderDetailList.total_num
? orderDetailList.total_num
: "-"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>实际支付</div> <div>实际支付</div>
<div class="value">{{ orderDetailList.finalOrder ? (parseFloat(orderDetailList.finalOrder.pay_price) + parseFloat(orderDetailList.pay_price)) : orderDetailList.pay_price }}</div> <div class="value">
{{
orderDetailList.finalOrder
? parseFloat(orderDetailList.finalOrder.pay_price) +
parseFloat(orderDetailList.pay_price)
: orderDetailList.pay_price
}}
</div>
</li> </li>
<!-- <li class="item"> <!-- <li class="item">
<div>优惠券金额</div> <div>优惠券金额</div>
@ -108,16 +181,34 @@
</li> --> </li> -->
<li v-if="orderDetailList.integral" class="item"> <li v-if="orderDetailList.integral" class="item">
<div>铸源星抵扣</div> <div>铸源星抵扣</div>
<div class="value">使用了{{ orderDetailList.integral }}个铸源星抵扣了{{ orderDetailList.integral_price }}</div> <div class="value">
使用了{{ orderDetailList.integral }}个铸源星抵扣了{{
orderDetailList.integral_price
}}
</div>
</li> </li>
<li v-if="orderDetailList.amount_price>0" class="item"> <li v-if="orderDetailList.amount_price > 0" class="item">
<div>折扣</div> <div>折扣</div>
<!-- <div v-if="orderDetailList.amount_price && orderDetailList.amount_price != 0" class="value">使用了{{ orderDetailList.amount_price }}个折扣抵扣了{{ orderDetailList.amount_price }}</div> --> <!-- <div v-if="orderDetailList.amount_price && orderDetailList.amount_price != 0" class="value">使用了{{ orderDetailList.amount_price }}个折扣抵扣了{{ orderDetailList.amount_price }}</div> -->
<div v-if="orderDetailList.amount_price && orderDetailList.amount_price != 0" class="value">-{{ orderDetailList.amount_price }}</div> <div
v-if="
orderDetailList.amount_price &&
orderDetailList.amount_price != 0
"
class="value"
>
-{{ orderDetailList.amount_price }}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>订单总价</div> <div>订单总价</div>
<div class="value">{{ orderDetailList.total_price ? orderDetailList.total_price : '-' }}</div> <div class="value">
{{
orderDetailList.total_price
? orderDetailList.total_price
: "-"
}}
</div>
</li> </li>
<!-- <li class="item" v-if="orderDetailList.svip_discount"> <!-- <li class="item" v-if="orderDetailList.svip_discount">
<div>会员商品优惠</div> <div>会员商品优惠</div>
@ -125,12 +216,31 @@
</li> --> </li> -->
<li class="item"> <li class="item">
<div>发货方式</div> <div>发货方式</div>
<div v-if="orderDetailList.order_type == 1" class="value">核销</div> <div v-if="orderDetailList.order_type == 1" class="value">
<div v-else class="value">{{ orderDetailList.delivery_type | sendWay }}</div> 核销
</div>
<div v-else class="value">
{{ orderDetailList.delivery_type | sendWay }}
</div>
</li> </li>
<li v-if="orderDetailList.platform_coupon_price>0" class="item"> <li
<div>活动折扣: </div> v-if="orderDetailList.platform_coupon_price > 0"
<div v-if="orderDetailList.platform_coupon_price && orderDetailList.platform_coupon_price != 0" class="value">使用了{{ orderDetailList.platform_coupon_price }}个折扣抵扣了{{ orderDetailList.platform_coupon_price }}</div> class="item"
>
<div>活动折扣:</div>
<div
v-if="
orderDetailList.platform_coupon_price &&
orderDetailList.platform_coupon_price != 0
"
class="value"
>
使用了{{
orderDetailList.platform_coupon_price
}}个折扣抵扣了{{
orderDetailList.platform_coupon_price
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>支付运费</div> <div>支付运费</div>
@ -160,11 +270,39 @@
</li> --> </li> -->
<li class="item"> <li class="item">
<div>商品类型</div> <div>商品类型</div>
<div class="value">{{ orderDetailList.is_virtual==1 ? '虚拟商品' : orderDetailList.is_virtual==2 ? '卡密商品' : '普通商品' }}</div> <div class="value">
{{
orderDetailList.is_virtual == 1
? "虚拟商品"
: orderDetailList.is_virtual == 2
? "卡密商品"
: "普通商品"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>活动类型</div> <div>活动类型</div>
<div class="value">{{ orderDetailList.activity_type == 1 ? '秒杀' : orderDetailList.activity_type == 2 ? '预售' : orderDetailList.activity_type == 3 ? '助力' : orderDetailList.activity_type == 4 ? '拼团' : '普通' }}</div> <div class="value">
{{
orderDetailList.activity_type == 1
? "秒杀"
: orderDetailList.activity_type == 2
? "预售"
: orderDetailList.activity_type == 3
? "助力"
: orderDetailList.activity_type == 4
? "拼团"
: "普通"
}}
</div>
</li>
<li class="item">
<div>自购成长值</div>
<div class="value">{{ orderDetailList.extension_one }}</div>
</li>
<li class="item">
<div>上级成长值</div>
<div class="value">{{ orderDetailList.extension_two }}</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -173,12 +311,26 @@
<ul class="list"> <ul class="list">
<li class="item acea-row row-middle"> <li class="item acea-row row-middle">
<div>快递公司</div> <div>快递公司</div>
<div class="value">{{ orderDetailList.delivery_name ? orderDetailList.delivery_name : '-' }}</div> <div class="value">
{{
orderDetailList.delivery_name
? orderDetailList.delivery_name
: "-"
}}
</div>
</li> </li>
<li class="item acea-row row-middle"> <li class="item acea-row row-middle">
<div>快递单号</div> <div>快递单号</div>
<div class="value">{{ orderDetailList.delivery_id ? orderDetailList.delivery_id : '-' }}</div> <div class="value">
<el-button type="text" size="small" @click="openLogistics">物流查询</el-button> {{
orderDetailList.delivery_id
? orderDetailList.delivery_id
: "-"
}}
</div>
<el-button type="text" size="small" @click="openLogistics"
>物流查询</el-button
>
</li> </li>
</ul> </ul>
</div> </div>
@ -186,7 +338,9 @@
<div class="title">买家留言</div> <div class="title">买家留言</div>
<ul class="list"> <ul class="list">
<li class="item"> <li class="item">
<div>{{ orderDetailList.mark ? orderDetailList.mark : '-' }}</div> <div>
{{ orderDetailList.mark ? orderDetailList.mark : "-" }}
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -194,12 +348,15 @@
<div class="title">商家备注</div> <div class="title">商家备注</div>
<ul class="list"> <ul class="list">
<li class="item"> <li class="item">
<div>{{ orderDetailList.remark ? orderDetailList.remark : '-' }}</div> <div>
{{
orderDetailList.remark ? orderDetailList.remark : "-"
}}
</div>
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="商品信息" name="goods"> <el-tab-pane label="商品信息" name="goods">
<template v-if="activeName == 'goods'"> <template v-if="activeName == 'goods'">
@ -208,7 +365,11 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab"> <div class="tab">
<div class="line1"> <div class="line1">
{{ scope.row.cart_info.productAttr.product_id ? scope.row.cart_info.productAttr.product_id : '-' }} {{
scope.row.cart_info.productAttr.product_id
? scope.row.cart_info.productAttr.product_id
: "-"
}}
</div> </div>
</div> </div>
</template> </template>
@ -217,7 +378,11 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab"> <div class="tab">
<div class="line1"> <div class="line1">
{{ scope.row.cart_info.productAttr.bar_code ? scope.row.cart_info.productAttr.bar_code : '-' }} {{
scope.row.cart_info.productAttr.bar_code
? scope.row.cart_info.productAttr.bar_code
: "-"
}}
</div> </div>
</div> </div>
</template> </template>
@ -228,14 +393,20 @@
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image <el-image
:src="scope.row.cart_info.product.image" :src="scope.row.cart_info.product.image"
:preview-src-list="[scope.row.cart_info.product.image]" :preview-src-list="[
scope.row.cart_info.product.image,
]"
/> />
</div> </div>
<div> <div>
<div class="line1">{{ scope.row.cart_info.product.store_name }}</div> <div class="line1">
{{ scope.row.cart_info.product.store_name }}
</div>
<div class="line1 gary"> <div class="line1 gary">
规格{{ 规格{{
scope.row.cart_info.productAttr.sku ? scope.row.cart_info.productAttr.sku : '默认' scope.row.cart_info.productAttr.sku
? scope.row.cart_info.productAttr.sku
: "默认"
}} }}
</div> </div>
</div> </div>
@ -246,25 +417,37 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab"> <div class="tab">
<div class="line1"> <div class="line1">
{{ scope.row.cart_info.productAttr.price ? scope.row.cart_info.productAttr.price : '-' }} {{
scope.row.cart_info.productAttr.price
? scope.row.cart_info.productAttr.price
: "-"
}}
</div> </div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成本价" min-width="90"> <el-table-column label="成本价" min-width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab"> <div class="tab">
<div class="line1"> <div class="line1">
{{ scope.row.cart_info.productAttr.cost ? scope.row.cart_info.productAttr.cost : '-' }} {{
scope.row.cart_info.productAttr.cost
? scope.row.cart_info.productAttr.cost
: "-"
}}
</div>
</div> </div>
</div> </template>
</template> </el-table-column>
</el-table-column>
<el-table-column label="实付金额" min-width="90"> <el-table-column label="实付金额" min-width="90">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tab"> <div class="tab">
<div class="line1"> <div class="line1">
{{ scope.row.product_price ? scope.row.product_price : '-' }} {{
scope.row.product_price
? scope.row.product_price
: "-"
}}
</div> </div>
</div> </div>
</template> </template>
@ -353,7 +536,14 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="block"> <div class="block">
<el-pagination :page-size="tableFromLog.limit" :current-page="tableFromLog.page" layout="prev, pager, next, jumper" :total="tableDataLog.total" @size-change="handleSizeChangeLog" @current-change="pageChangeLog" /> <el-pagination
:page-size="tableFromLog.limit"
:current-page="tableFromLog.page"
layout="prev, pager, next, jumper"
:total="tableDataLog.total"
@size-change="handleSizeChangeLog"
@current-change="pageChangeLog"
/>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="settlement" label="商户结算"> <el-tab-pane name="settlement" label="商户结算">
@ -365,20 +555,20 @@
class="table" class="table"
highlight-current-row highlight-current-row
> >
<el-table-column label="序号" min-width="90" prop="bill_id"></el-table-column>
<el-table-column <el-table-column
prop="title" label="序号"
label="标题" min-width="90"
min-width="150" prop="bill_id"
/> ></el-table-column>
<el-table-column <el-table-column prop="title" label="标题" min-width="150" />
prop="status" <el-table-column prop="status" label="订单状态" min-width="150">
label="订单状态"
min-width="150"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" type="success">未处理</el-tag> <el-tag v-if="scope.row.status === 0" type="success"
<el-tag v-if="scope.row.status === 1" type="danger">已处理</el-tag> >未处理</el-tag
>
<el-tag v-if="scope.row.status === 1" type="danger"
>已处理</el-tag
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -391,19 +581,23 @@
label="结算时间" label="结算时间"
min-width="150" min-width="150"
/> />
<el-table-column <el-table-column prop="mark" label="详情" min-width="150" />
prop="mark"
label="详情"
min-width="150"
/>
</el-table> </el-table>
</template> </template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane v-if="childOrder.length>0" label="关联订单" name="subOrder"> <el-tab-pane
v-if="childOrder.length > 0"
label="关联订单"
name="subOrder"
>
<template v-if="activeName == 'subOrder'"> <template v-if="activeName == 'subOrder'">
<el-table :data="childOrder" size="small"> <el-table :data="childOrder" size="small">
<el-table-column label="订单编号" prop="order_sn" min-width="150"> <el-table-column
<template slot-scope="scope"> label="订单编号"
prop="order_sn"
min-width="150"
>
<template slot-scope="scope">
<div>{{ scope.row.order_sn }}</div> <div>{{ scope.row.order_sn }}</div>
</template> </template>
</el-table-column> </el-table-column>
@ -420,15 +614,25 @@
:preview-src-list="[val.cart_info.product.image]" :preview-src-list="[val.cart_info.product.image]"
/> />
</div> </div>
<span <span class="tabBox_tit"
class="tabBox_tit" >{{ val.cart_info.product.store_name + " | "
>{{ val.cart_info.product.store_name + ' | ' }}{{ val.cart_info.productAttr.sku }}</span> }}{{ val.cart_info.productAttr.sku }}</span
>
<span class="tabBox_pice"> <span class="tabBox_pice">
{{ '¥'+ val.cart_info.productAttr.price + ' x '+ val.product_num }} {{
"¥" +
val.cart_info.productAttr.price +
" x " +
val.product_num
}}
<em <em
v-if="val.refund_num < val.product_num && val.refund_num > 0" v-if="
style="color: red;font-style: normal;" val.refund_num < val.product_num &&
>(-{{ val.product_num - val.refund_num }})</em> val.refund_num > 0
"
style="color: red; font-style: normal"
>(-{{ val.product_num - val.refund_num }})</em
>
</span> </span>
</div> </div>
</template> </template>
@ -438,10 +642,19 @@
<span>{{ scope.row.pay_price }}</span> <span>{{ scope.row.pay_price }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单生成时间" prop="create_time" min-width="120" /> <el-table-column
label="订单生成时间"
prop="create_time"
min-width="120"
/>
<el-table-column label="操作" min-width="50" fixed="right"> <el-table-column label="操作" min-width="50" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="getChildOrderDetail(scope.row.order_id)">详情</el-button> <el-button
type="text"
size="small"
@click="getChildOrderDetail(scope.row.order_id)"
>详情</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -451,22 +664,32 @@
<template v-if="activeName == 'merchant'"> <template v-if="activeName == 'merchant'">
<div class="section"> <div class="section">
<div class="title">店铺信息</div> <div class="title">店铺信息</div>
<ul v-if="orderDetailList.merchant" class="list"> <ul v-if="orderDetailList.merchant" class="list">
<li class="item"> <li class="item">
<div>商户名称</div> <div>商户名称</div>
<div class="value">{{ orderDetailList.merchant.mer_name }}</div> <div class="value">
{{ orderDetailList.merchant.mer_name }}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>商户类型</div> <div>商户类型</div>
<div class="value">{{ orderDetailList.merchant.type_name }}</div> <div class="value">
{{ orderDetailList.merchant.type_name }}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>商户类别</div> <div>商户类别</div>
<div class="value">{{ orderDetailList.merchant.is_trader ? '自营' : '非自营' }}</div> <div class="value">
{{
orderDetailList.merchant.is_trader ? "自营" : "非自营"
}}
</div>
</li> </li>
<li class="item"> <li class="item">
<div>店铺电话</div> <div>店铺电话</div>
<div class="value">{{ orderDetailList.merchant.service_phone }}</div> <div class="value">
{{ orderDetailList.merchant.service_phone }}
</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -482,16 +705,21 @@
v-if="dialogLogistics" v-if="dialogLogistics"
> >
<div class="logistics acea-row row-top"> <div class="logistics acea-row row-top">
<div class="logistics_img"><img src="@/assets/images/expressi.jpg"></div> <div class="logistics_img">
<img src="@/assets/images/expressi.jpg" />
</div>
<div class="logistics_cent"> <div class="logistics_cent">
<span>物流公司{{ orderDetailList.delivery_name }}</span> <span>物流公司{{ orderDetailList.delivery_name }}</span>
<span>物流单号{{ orderDetailList.delivery_id }}</span> <span>物流单号{{ orderDetailList.delivery_id }}</span>
</div> </div>
</div> </div>
<div v-if="result.length>0" class="acea-row row-column-around trees-coadd"> <div
v-if="result.length > 0"
class="acea-row row-column-around trees-coadd"
>
<div class="scollhide"> <div class="scollhide">
<el-timeline> <el-timeline>
<el-timeline-item v-for="(item,i) in result" :key="i"> <el-timeline-item v-for="(item, i) in result" :key="i">
<p class="time" v-text="item.time" /> <p class="time" v-text="item.time" />
<p class="content" v-text="item.status" /> <p class="content" v-text="item.status" />
</el-timeline-item> </el-timeline-item>
@ -502,15 +730,14 @@
</div> </div>
</template> </template>
<script> <script>
import { import {
getExpress, getExpress,
orderDeliveryApi, orderDeliveryApi,
orderDetailApi, orderDetailApi,
orderLogApi, orderLogApi,
getChildrenOrderApi, getChildrenOrderApi,
orderBillApi orderBillApi,
} from '@/api/order'; } from "@/api/order";
export default { export default {
props: { props: {
drawer: { drawer: {
@ -521,16 +748,16 @@ export default {
data() { data() {
return { return {
loading: true, loading: true,
listLoading:true, listLoading: true,
orderId: '', orderId: "",
direction: 'rtl', direction: "rtl",
activeName: 'detail', activeName: "detail",
goodsList: [], goodsList: [],
orderConfirm: false, orderConfirm: false,
sendGoods: false, sendGoods: false,
dialogLogistics: false, dialogLogistics: false,
confirmReceiptForm: { confirmReceiptForm: {
id: '', id: "",
}, },
orderData: [], orderData: [],
contentList: [], contentList: [],
@ -541,68 +768,69 @@ export default {
childOrder: [], childOrder: [],
tableDataLog: { tableDataLog: {
data: [], data: [],
total: 0 total: 0,
}, },
tableData: { tableData: {
data: [], data: [],
total: 0 total: 0,
}, },
tableFromLog: { tableFromLog: {
user_type: '', user_type: "",
date: [], date: [],
page: 1, page: 1,
limit: 10 limit: 10,
}, },
orderDetailList: { orderDetailList: {
user: { user: {
real_name: '', real_name: "",
}, },
groupOrder: { groupOrder: {
group_order_sn: '', group_order_sn: "",
}, },
}, },
orderImg: require('@/assets/images/order_icon.png'), orderImg: require("@/assets/images/order_icon.png"),
}; };
}, },
filters: { filters: {},
},
methods: { methods: {
// //
onchangeTime(e) { onchangeTime(e) {
this.timeVal = e this.timeVal = e;
this.tableFromLog.date = e ? this.timeVal.join('-') : '' this.tableFromLog.date = e ? this.timeVal.join("-") : "";
this.onOrderLog(this.orderId) this.onOrderLog(this.orderId);
}, },
orderBillApi(id){ orderBillApi(id) {
orderBillApi(id).then((res)=>{ orderBillApi(id)
this.tableData.data = res.data.list .then((res) => {
this.tableData.total = res.data.count this.tableData.data = res.data.list;
this.listLoading = false this.tableData.total = res.data.count;
}).catch((res)=>{ this.listLoading = false;
this.$message.error(res.message) })
this.listLoading = false .catch((res) => {
}) this.$message.error(res.message);
this.listLoading = false;
});
}, },
handleClose() { handleClose() {
this.activeName = 'detail'; this.activeName = "detail";
this.$emit('closeDrawer'); this.$emit("closeDrawer");
this.sendGoods = false; this.sendGoods = false;
this.orderRemark = false; this.orderRemark = false;
}, },
openLogistics() { openLogistics() {
this.getOrderData() this.getOrderData();
this.dialogLogistics = true this.dialogLogistics = true;
}, },
// //
getOrderData() { getOrderData() {
getExpress(this.orderId).then(async res => { getExpress(this.orderId)
this.result = res.data .then(async (res) => {
}).catch(res => { this.result = res.data;
this.result = [] })
this.$message.error(res.message) .catch((res) => {
}) this.result = [];
this.$message.error(res.message);
});
}, },
// //
toSendGoods() { toSendGoods() {
@ -618,27 +846,27 @@ export default {
this.$message.error(res.message); this.$message.error(res.message);
}); });
}, },
// //
getChildOrder() { getChildOrder() {
this.loading = true; this.loading = true;
getChildrenOrderApi(this.orderId) getChildrenOrderApi(this.orderId)
.then((res) => { .then((res) => {
this.activeName = 'detail' this.activeName = "detail";
this.childOrder = res.data this.childOrder = res.data;
setTimeout(()=>{ setTimeout(() => {
this.loading = false; this.loading = false;
},500) }, 500);
}) })
.catch((res) => { .catch((res) => {
this.$message.error(res.message) this.$message.error(res.message);
}) });
}, },
getChildOrderDetail(id){ getChildOrderDetail(id) {
this.getInfo(id); this.getInfo(id);
}, },
getInfo(id) { getInfo(id) {
this.loading = true; this.loading = true;
this.orderId = id this.orderId = id;
orderDetailApi(id) orderDetailApi(id)
.then((res) => { .then((res) => {
this.drawer = true; this.drawer = true;
@ -650,40 +878,40 @@ export default {
}); });
}, },
tabClick(tab) { tabClick(tab) {
if (tab.name === 'orderList') { if (tab.name === "orderList") {
this.onOrderLog(this.orderId) this.onOrderLog(this.orderId);
} }
if (tab.name === 'settlement') { if (tab.name === "settlement") {
this.orderBillApi(this.orderId) this.orderBillApi(this.orderId);
} }
}, },
onOrderLog(id){ onOrderLog(id) {
orderLogApi(id, this.tableFromLog).then((res) => { orderLogApi(id, this.tableFromLog).then((res) => {
this.tableDataLog.data = res.data.list this.tableDataLog.data = res.data.list;
this.tableDataLog.total = res.data.count this.tableDataLog.total = res.data.count;
}); });
}, },
pageChangeLog(page) { pageChangeLog(page) {
this.tableFromLog.page = page this.tableFromLog.page = page;
this.onOrderLog(this.orderId) this.onOrderLog(this.orderId);
}, },
handleSizeChangeLog(val) { handleSizeChangeLog(val) {
this.tableFromLog.limit = val this.tableFromLog.limit = val;
this.onOrderLog(this.orderId) this.onOrderLog(this.orderId);
}, },
operationType(type) { operationType(type) {
if (type == 0) { if (type == 0) {
return '系统'; return "系统";
} else if (type == 1) { } else if (type == 1) {
return '用户'; return "用户";
} else if (type == 2) { } else if (type == 2) {
return '平台'; return "平台";
} else if (type == 3) { } else if (type == 3) {
return '商户'; return "商户";
} else if (type == 4) { } else if (type == 4) {
return '商家客服'; return "商家客服";
} else { } else {
return '未知'; return "未知";
} }
}, },
}, },
@ -750,7 +978,7 @@ export default {
color: #1bbe6b; color: #1bbe6b;
} }
.value3 { .value3 {
color: #437FFD; color: #437ffd;
} }
.value4 { .value4 {
color: #6a7b9d; color: #6a7b9d;
@ -827,20 +1055,20 @@ export default {
.gary { .gary {
color: #aaa; color: #aaa;
} }
.logistics{ .logistics {
align-items: center; align-items: center;
padding: 10px 0px; padding: 10px 0px;
.logistics_img{ .logistics_img {
width: 45px; width: 45px;
height: 45px; height: 45px;
margin-right: 12px; margin-right: 12px;
img{ img {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.logistics_cent{ .logistics_cent {
span{ span {
display: block; display: block;
font-size: 12px; font-size: 12px;
} }

View File

@ -125,6 +125,20 @@
<el-input-number v-model="oneFormBatch[0].growth" :min="0" class="priceBox" controls-position="right"/> <el-input-number v-model="oneFormBatch[0].growth" :min="0" class="priceBox" controls-position="right"/>
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column
label="指定成长值"
min-width="100"
align="center"
>
<template slot-scope="scope">
<el-input-number
v-model="oneFormBatch[0].all_as_price"
:min="0"
class="priceBox"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column <el-table-column
label="商品编号" label="商品编号"
min-width="100" min-width="100"
@ -497,6 +511,8 @@ const defaultObj = {
third_agreement_price: "", third_agreement_price: "",
stock: 0, stock: 0,
// growth:0, // growth:0,
as_price: 0,
all_as_price: 0,
bar_code: "", bar_code: "",
third_product_item_id: "", third_product_item_id: "",
weight: 0, weight: 0,
@ -529,6 +545,12 @@ const objTitle = {
growth: { growth: {
title: "成长值", title: "成长值",
}, },
as_price: {
title: "成长值",
},
all_as_price: {
title: "指定成长值",
},
bar_code: { bar_code: {
title: "商品编号", title: "商品编号",
}, },
@ -677,6 +699,8 @@ export default {
proportion: 0.6, proportion: 0.6,
coupon: 0, coupon: 0,
growth: 0, growth: 0,
as_price: 0,
all_as_price: 0,
ot_price: 0, ot_price: 0,
stock: 0, stock: 0,
bar_code: "", bar_code: "",
@ -696,6 +720,8 @@ export default {
proportion: 0.6, proportion: 0.6,
coupon: 0, coupon: 0,
growth: 0, growth: 0,
as_price: 0,
all_as_price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
stock: 0, stock: 0,
@ -786,7 +812,7 @@ export default {
// console.log(arr) // console.log(arr)
}, },
isDisable(iii) { isDisable(iii) {
let arr = ["协议价", "编号"]; let arr = ["协议价", "编号", "成长值"];
let forbidden = [ let forbidden = [
"成本价", "成本价",
"市场价", "市场价",
@ -1006,6 +1032,9 @@ export default {
case "growth": case "growth":
val.growth = val.growth.replace(/[^\d]/g, ""); val.growth = val.growth.replace(/[^\d]/g, "");
break; break;
case "all_as_price":
val.all_as_price = val.all_as_price.replace(/[^\d]/g, "");
break;
case "proportion": case "proportion":
val.proportion = val.proportion.replace( val.proportion = val.proportion.replace(
/^([0-9-]\d*\.?\d{0,2})?.*$/, /^([0-9-]\d*\.?\d{0,2})?.*$/,
@ -1032,6 +1061,8 @@ export default {
proportion: 0.6, proportion: 0.6,
coupon: 0, coupon: 0,
growth: 0, growth: 0,
as_price: 0,
all_as_price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
stock: 0, stock: 0,
@ -1052,6 +1083,8 @@ export default {
this.$set(val, "weight", this.oneFormBatch[0].weight); this.$set(val, "weight", this.oneFormBatch[0].weight);
this.$set(val, "volume", this.oneFormBatch[0].volume); this.$set(val, "volume", this.oneFormBatch[0].volume);
this.$set(val, "growth", this.oneFormBatch[0].growth); this.$set(val, "growth", this.oneFormBatch[0].growth);
// this.$set(val, "as_price", this.oneFormBatch[0].as_price);
this.$set(val, "all_as_price", this.oneFormBatch[0].all_as_price);
this.$set(val, "proportion", this.oneFormBatch[0].proportion); this.$set(val, "proportion", this.oneFormBatch[0].proportion);
this.$set(val, "coupon", this.oneFormBatch[0].coupon); this.$set(val, "coupon", this.oneFormBatch[0].coupon);
this.$set(val, "extension_one", this.oneFormBatch[0].extension_one); this.$set(val, "extension_one", this.oneFormBatch[0].extension_one);
@ -1131,6 +1164,8 @@ export default {
coupon: "", coupon: "",
stock: 0, stock: 0,
growth: 0, growth: 0,
as_price: 0,
all_as_price: 0,
bar_code: "", bar_code: "",
weight: 0, weight: 0,
volume: 0, volume: 0,
@ -1165,6 +1200,8 @@ export default {
coupon: "", coupon: "",
stock: 0, stock: 0,
growth: 0, growth: 0,
as_price: 0,
all_as_price: 0,
bar_code: "", bar_code: "",
weight: 0, weight: 0,
volume: 0, volume: 0,
@ -1208,6 +1245,8 @@ export default {
proportion: 0.6, proportion: 0.6,
coupon: "", coupon: "",
growth: 0, growth: 0,
as_price: 0,
all_as_price: 0,
cost: 0, cost: 0,
ot_price: 0, ot_price: 0,
stock: 0, stock: 0,

View File

@ -373,6 +373,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="product_id" label="ID" min-width="60" /> <el-table-column prop="product_id" label="ID" min-width="60" />
<el-table-column prop="tag_name" label="标记" min-width="60" /> <el-table-column prop="tag_name" label="标记" min-width="60" />
<el-table-column prop="as_price" label="成长值" min-width="60" />
<el-table-column prop="audit_type" label="商品类型" min-width="80"> <el-table-column prop="audit_type" label="商品类型" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
{{ productTypeList[scope.row.audit_type].label }} {{ productTypeList[scope.row.audit_type].label }}

View File

@ -735,6 +735,7 @@ const defaultObj = {
proportion: 0.6, proportion: 0.6,
coupon: "", coupon: "",
stock: 0, stock: 0,
as_price: 0,
// growth: 0, // growth: 0,
bar_code: "", bar_code: "",
weight: null, weight: null,
@ -773,6 +774,9 @@ const objTitle = {
growth: { growth: {
title: "成长值", title: "成长值",
}, },
as_price: {
title: "成长值",
},
bar_code: { bar_code: {
title: "商品编号", title: "商品编号",
}, },

View File

@ -1219,6 +1219,7 @@ const defaultObj = {
third_agreement_price: "", third_agreement_price: "",
stock: 0, stock: 0,
// growth: 0, // growth: 0,
as_price: 0,
bar_code: "", bar_code: "",
third_product_item_id: "", third_product_item_id: "",
gist_url: null, gist_url: null,
@ -1260,6 +1261,9 @@ const objTitle = {
growth: { growth: {
title: "成长值", title: "成长值",
}, },
as_price: {
title: "成长值",
},
bar_code: { bar_code: {
title: "商品编号", title: "商品编号",
}, },

View File

@ -0,0 +1,225 @@
<template>
<div class="divBox">
<div class="selCard mb14">
<el-form
:model="tableFrom"
ref="searchForm"
inline
size="small"
label-width="85px"
>
<el-form-item label="选择时间:">
<el-date-picker
v-model="timeVal"
value-format="yyyy/MM/dd"
format="yyyy/MM/dd"
:picker-options="pickerOptions"
type="daterange"
placement="bottom-end"
placeholder="自定义时间"
style="width: 280px"
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="搜索:" prop="keyword">
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
placeholder="请输入用户ID用户昵称、标题"
class="selWidth"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)"
>搜索</el-button
>
<el-button size="small" @click="searchReset()">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- <cards-data v-if="cardLists.length > 0" :card-lists="cardLists" /> -->
<el-card>
<div class="mb20">
<el-button size="small" type="primary" @click="exports">导出</el-button>
</div>
<el-table v-loading="listLoading" :data="tableData.data" size="small">
<el-table-column prop="bill_id" label="ID" min-width="50" />
<el-table-column label="用户昵称" prop="nickname" min-width="150" />
<el-table-column label="成长值标题" prop="title" min-width="120" />
<el-table-column label="成长值变动" prop="number" min-width="90">
<template slot-scope="scope">
<span v-if="scope.row.pm == 1" style="color: #ff3b30"
>+{{ scope.row.number }}</span
>
<span v-if="scope.row.pm == 0" style="color: #82e493"
>-{{ scope.row.number }}</span
>
</template>
</el-table-column>
<el-table-column label="当前成长值额度" prop="balance" min-width="90" />
<el-table-column prop="mark" label="备注" min-width="150" />
<el-table-column prop="create_time" label="添加时间" min-width="90" />
</el-table>
<div class="block">
<el-pagination
background
:page-size="tableFrom.limit"
:current-page="tableFrom.page"
layout="total, prev, pager, next, jumper"
:total="tableData.total"
@size-change="handleSizeChange"
@current-change="pageChange"
/>
</div>
</el-card>
</div>
</template>
<script>
import {
integralLogTitle,
brokerageLogLst,
brokerageLogExport,
} from "@/api/marketing";
import fileList from "@/components/exportFile/fileList";
import cardsData from "@/components/cards/index";
import createWorkBook from "@/utils/newToExcel.js";
import { roterPre } from "@/settings";
import timeOptions from "@/utils/timeOptions";
export default {
name: "IntergralLog",
components: { fileList, cardsData },
data() {
return {
pickerOptions: timeOptions,
timeVal: [],
listLoading: true,
roterPre: roterPre,
tableData: {
data: [],
total: 0,
},
tableFrom: {
page: 1,
limit: 20,
keyword: "",
date: "",
},
loading: false,
cardLists: [],
};
},
watch: {},
mounted() {
this.getList("");
// this.getTitle();
},
methods: {
/**重置 */
searchReset() {
this.timeVal = [];
this.tableFrom.date = "";
this.$refs.searchForm.resetFields();
this.getList(1);
},
//
onchangeTime(e) {
this.timeVal = e;
this.tableFrom.date = e ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getList("");
},
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)),
data = [];
excelData.page = 1;
excelData.limit = 100;
let pageCount = 1;
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData);
pageCount = Math.ceil(lebData.count / excelData.limit);
if (lebData.export.length) {
data = data.concat(lebData.export);
excelData.page++;
}
}
createWorkBook(
lebData.header,
lebData.title,
data,
lebData.foot,
lebData.filename
);
return;
},
/**列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
brokerageLogExport(excelData).then((res) => {
return resolve(res.data);
});
});
},
//
exportRecord() {
brokerageLogExport(this.tableFrom)
.then((res) => {
const h = this.$createElement;
this.$msgbox({
title: "提示",
message: h("p", null, [
h("span", null, '文件正在生成中,请稍后点击"'),
h("span", { style: "color: teal" }, "导出记录"),
h("span", null, '"查看~ '),
]),
confirmButtonText: "我知道了",
}).then((action) => {
this.$router.push({ path: this.roterPre + "/group/exportList" });
});
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getTitle() {
integralLogTitle()
.then((res) => {
this.cardLists = res.data;
})
.catch((res) => {
this.$message.error(res.message);
});
},
//
getList(num) {
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
brokerageLogLst(this.tableFrom)
.then((res) => {
this.tableData.data = res.data.list;
this.tableData.total = res.data.count;
this.listLoading = false;
})
.catch((res) => {
this.listLoading = false;
this.$message.error(res.message);
});
},
pageChange(page) {
this.tableFrom.page = page;
this.getList("");
},
handleSizeChange(val) {
this.tableFrom.limit = val;
this.getList("");
},
},
};
</script>
<style scoped lang="scss">
.scollhide::-webkit-scrollbar {
display: none; /* Chrome Safari */
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -81,6 +81,9 @@ onmessage = (res) => {
} else { } else {
//不是数组 //不是数组
lcomunNow.getCell(getLetter(sk)).value = data[h][l]; lcomunNow.getCell(getLetter(sk)).value = data[h][l];
console.log(lcomunNow.getCell(getLetter(sk)).value);
console.log(data[h][l]);
console.log(h, l);
lcomunNow.getCell(getLetter(sk)).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } }; lcomunNow.getCell(getLetter(sk)).border = { top: { style: 'thin' }, left: { style: 'thin' }, bottom: { style: 'thin' }, right: { style: 'thin' } };
lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' }; lcomunNow.alignment = { vertical: 'middle', horizontal: 'center' };
sk++ sk++
@ -163,7 +166,7 @@ onmessage = (res) => {
return letter[number]; return letter[number];
} else { } else {
let n = number % 26 let n = number % 26
let l = Math.floor(number % 26) let l = Math.floor(number / 26) - 1
return letter[l] + letter[n] return letter[l] + letter[n]
} }
} }