|
@@ -1,348 +0,0 @@
|
|
-<template>
|
|
|
|
- <div class="app-container">
|
|
|
|
- <el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
|
|
|
- <!-- <el-form-item label="" prop="companyId">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.companyId"
|
|
|
|
- placeholder="请输入"
|
|
|
|
- clearable
|
|
|
|
- size="small"
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="分值id" prop="orderId">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.orderId"
|
|
|
|
- placeholder="请输入分值id"
|
|
|
|
- clearable
|
|
|
|
- size="small"
|
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
|
- />
|
|
|
|
- </el-form-item> -->
|
|
|
|
- <el-form-item label="用户" prop="userName">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.userName"
|
|
|
|
- placeholder="请输入编号"
|
|
|
|
- clearable
|
|
|
|
- size="small"
|
|
|
|
- @keyup.enter.native="handleQuery" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
-
|
|
|
|
- </el-form-item></el-form>
|
|
|
|
-
|
|
|
|
- <el-table v-loading="loading" :data="transactionList">
|
|
|
|
- <!-- <el-table-column label="" align="center" prop="id" />
|
|
|
|
- <el-table-column label="" align="center" prop="companyId" /> -->
|
|
|
|
- <!-- <el-table-column label="分值id" align="center" prop="orderId" /> -->
|
|
|
|
- <el-table-column label="用户名" align="center" prop="userName" />
|
|
|
|
- <el-table-column label="浏览器" align="center" prop="browser" />
|
|
|
|
- <el-table-column label="登录ip" align="center" prop="ipaddr" />
|
|
|
|
- <el-table-column label="登录时间" align="center" prop="collection" width="180">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <span>{{ parseTime(scope.row.loginTime) }}</span>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <pagination
|
|
|
|
- v-show="total > 0"
|
|
|
|
- :total="total"
|
|
|
|
- :page.sync="queryParams.pageNum"
|
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
|
- @pagination="getList" />
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-import { uploadPath } from '@/api/storage'
|
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
|
-
|
|
|
|
-import { loginRecord } from '@/api/gubi/transaction'
|
|
|
|
-
|
|
|
|
-export default {
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- first: [],
|
|
|
|
- second: [],
|
|
|
|
- tertiary: [],
|
|
|
|
- value1: '',
|
|
|
|
- value2: '',
|
|
|
|
- value3: '',
|
|
|
|
- dialogFormVisible1: false,
|
|
|
|
- imgsFileList: [],
|
|
|
|
- uploadPath,
|
|
|
|
- data: [],
|
|
|
|
- newList: [],
|
|
|
|
- defaultProps: {
|
|
|
|
- children: 'children',
|
|
|
|
- label: 'typeName'
|
|
|
|
- },
|
|
|
|
- formLabelWidth: '120px',
|
|
|
|
- dialogFormVisible: false,
|
|
|
|
- // 遮罩层
|
|
|
|
- loading: true,
|
|
|
|
- // 选中数组
|
|
|
|
- ids: [],
|
|
|
|
- // 非单个禁用
|
|
|
|
- single: true,
|
|
|
|
- // 非多个禁用
|
|
|
|
- multiple: true,
|
|
|
|
- // 总条数
|
|
|
|
- total: 0,
|
|
|
|
- // 交易记录表格数据
|
|
|
|
- transactionList: [],
|
|
|
|
- threeList: [],
|
|
|
|
- // 弹出层标题
|
|
|
|
- title: '',
|
|
|
|
- // 是否显示弹出层
|
|
|
|
- open: false,
|
|
|
|
- // 查询参数
|
|
|
|
- queryParams: {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- userName: ''
|
|
|
|
- },
|
|
|
|
- // 表单参数
|
|
|
|
- form: {},
|
|
|
|
- orderName: '',
|
|
|
|
- // 表单校验
|
|
|
|
- rules: {
|
|
|
|
- deleteFlag: [
|
|
|
|
- { required: true, message: '0:否(默认) 1:是不能为空', trigger: 'blur' }
|
|
|
|
- ]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- headers() {
|
|
|
|
- return {
|
|
|
|
- accessToken: getToken()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- created() {
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- sx() {
|
|
|
|
- this.dialogFormVisible1 = true
|
|
|
|
- },
|
|
|
|
- uploadOverrun: function() {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'error',
|
|
|
|
- message: '上传文件个数超出限制!最多上传2张图片!'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- handleimgsUrl(response, file, fileList) {
|
|
|
|
- if (response.errno === 200) {
|
|
|
|
- this.form.urlPath.push(response.url)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- handleRemove: function(file, fileList) {
|
|
|
|
- for (var i = 0; i < this.form.urlPath.length; i++) {
|
|
|
|
- // 这里存在两种情况
|
|
|
|
- // 1. 如果所删除图片是刚刚上传的图片,那么图片地址是file.response.url
|
|
|
|
- // 此时的file.url虽然存在,但是是本机地址,而不是远程地址。
|
|
|
|
- // 2. 如果所删除图片是后台返回的已有图片,那么图片地址是file.url
|
|
|
|
- var url
|
|
|
|
- if (file.response === undefined) {
|
|
|
|
- url = file.url
|
|
|
|
- } else {
|
|
|
|
- url = file.response.url
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (this.form.urlPath[i] === url) {
|
|
|
|
- this.form.urlPath.splice(i, 1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (this.form.urlPath.length > 0) {
|
|
|
|
- this.form.pictureUrl = this.form.urlPath[0]
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- handleNodeClick(data) {
|
|
|
|
- console.log(data)
|
|
|
|
- this.form.orderId = data.id
|
|
|
|
- this.orderName = data.typeName
|
|
|
|
- this.urlPath = data.urlPath.split(',')
|
|
|
|
- },
|
|
|
|
- handleNodeClick1(data) {
|
|
|
|
- console.log(data)
|
|
|
|
- this.queryParams.grade = data.typeId
|
|
|
|
- },
|
|
|
|
- typeConfirm() {
|
|
|
|
- this.dialogFormVisible = false
|
|
|
|
- },
|
|
|
|
- typeConfirm1() {
|
|
|
|
- this.dialogFormVisible1 = false
|
|
|
|
- this.handleQuery()
|
|
|
|
- },
|
|
|
|
- selectType() {
|
|
|
|
- this.dialogFormVisible = true
|
|
|
|
- },
|
|
|
|
- type1(e) {
|
|
|
|
- this.value2=''
|
|
|
|
- this.value3=''
|
|
|
|
- console.log(e)
|
|
|
|
- listSecond({
|
|
|
|
- page: 1,
|
|
|
|
- limit: 100,
|
|
|
|
- typeId: e
|
|
|
|
- }, ).then(response => {
|
|
|
|
- this.second = response.data.data.items
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- type2(e) {
|
|
|
|
- console.log(e)
|
|
|
|
- this.value3=''
|
|
|
|
- listThree({
|
|
|
|
- page: 1,
|
|
|
|
- limit: 100,
|
|
|
|
- secondId: e
|
|
|
|
- }, ).then(response => {
|
|
|
|
- this.tertiary = response.data.data.items
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- type3(e) {
|
|
|
|
- console.log(e)
|
|
|
|
- this.queryParams.orderId = e
|
|
|
|
- },
|
|
|
|
- type33(e) {
|
|
|
|
- console.log(e)
|
|
|
|
- this.form.orderId = e
|
|
|
|
- },
|
|
|
|
- /** 查询交易记录列表 */
|
|
|
|
- getList() {
|
|
|
|
- this.loading = true
|
|
|
|
- loginRecord(this.queryParams).then(response => {
|
|
|
|
- this.transactionList = response.data.data.items
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 取消按钮
|
|
|
|
- cancel() {
|
|
|
|
- this.open = false
|
|
|
|
- this.reset()
|
|
|
|
- },
|
|
|
|
- // 表单重置
|
|
|
|
- reset() {
|
|
|
|
- this.form = {
|
|
|
|
- id: undefined,
|
|
|
|
- companyId: undefined,
|
|
|
|
- orderId: undefined,
|
|
|
|
- number: undefined,
|
|
|
|
- grade: undefined,
|
|
|
|
- collection: undefined,
|
|
|
|
- price: undefined,
|
|
|
|
- status: '',
|
|
|
|
- urlPath: [],
|
|
|
|
- deleteFlag: undefined,
|
|
|
|
- gmtCreate: undefined,
|
|
|
|
- gmtUpdate: undefined,
|
|
|
|
- userId: undefined,
|
|
|
|
- adminId: undefined
|
|
|
|
- }
|
|
|
|
- this.resetForm('form')
|
|
|
|
- },
|
|
|
|
- /** 搜索按钮操作 */
|
|
|
|
- handleQuery() {
|
|
|
|
- this.queryParams.pageNum = 1
|
|
|
|
- this.getList()
|
|
|
|
- },
|
|
|
|
- /** 重置按钮操作 */
|
|
|
|
- resetQuery() {
|
|
|
|
- this.queryParams.orderId = ''
|
|
|
|
- this.resetForm('queryForm')
|
|
|
|
- this.handleQuery()
|
|
|
|
- },
|
|
|
|
- // 多选框选中数据
|
|
|
|
- handleSelectionChange(selection) {
|
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
|
- this.single = selection.length != 1
|
|
|
|
- this.multiple = !selection.length
|
|
|
|
- },
|
|
|
|
- /** 新增按钮操作 */
|
|
|
|
- handleAdd() {
|
|
|
|
- this.reset()
|
|
|
|
- this.open = true
|
|
|
|
- this.title = '添加交易记录'
|
|
|
|
- },
|
|
|
|
- /** 修改按钮操作 */
|
|
|
|
- handleUpdate(row) {
|
|
|
|
- this.reset()
|
|
|
|
- this.imgsFileList = []
|
|
|
|
- const id = row.id || this.ids.join(',')
|
|
|
|
- getTransaction(id).then(response => {
|
|
|
|
- this.form = response.data.data
|
|
|
|
- if (this.form.urlPath) {
|
|
|
|
- this.form.urlPath = this.form.urlPath.split(',')
|
|
|
|
- } else {
|
|
|
|
- this.form.urlPath = []
|
|
|
|
- }
|
|
|
|
- this.form.collection = new Date(response.data.data.collection)
|
|
|
|
- this.open = true
|
|
|
|
- this.title = '修改交易记录'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 提交按钮 */
|
|
|
|
- submitForm: function () {
|
|
|
|
- this.$refs['form'].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- console.log()
|
|
|
|
- this.form.urlPath = this.form.urlPath.toString()
|
|
|
|
- if (this.form.id != undefined) {
|
|
|
|
- updateTransaction(this.form).then(response => {
|
|
|
|
- if (response.data) {
|
|
|
|
- this.msgSuccess('修改成功')
|
|
|
|
- this.open = false
|
|
|
|
- this.getList()
|
|
|
|
- } else {
|
|
|
|
- this.msgError(response.msg)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- addTransaction(this.form).then(response => {
|
|
|
|
- if (response.data) {
|
|
|
|
- this.msgSuccess('新增成功')
|
|
|
|
- this.open = false
|
|
|
|
- this.getList()
|
|
|
|
- } else {
|
|
|
|
- this.msgError(response.msg)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 删除按钮操作 */
|
|
|
|
- handleDelete(row) {
|
|
|
|
- const ids = row.id || this.ids.join(',')
|
|
|
|
- this.$confirm('是否确认删除交易记录编号为"' + ids + '"的数据项?', '警告', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(function () {
|
|
|
|
- return delTransaction(ids)
|
|
|
|
- }).then(() => {
|
|
|
|
- this.getList()
|
|
|
|
- this.msgSuccess('删除成功')
|
|
|
|
- }).catch(function () { })
|
|
|
|
- },
|
|
|
|
- /** 导出按钮操作 */
|
|
|
|
- handleExport() {
|
|
|
|
- const queryParams = this.queryParams
|
|
|
|
- this.$confirm('是否确认导出所有交易记录数据项?', '警告', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(function () {
|
|
|
|
- return exportTransaction(queryParams)
|
|
|
|
- }).then(response => {
|
|
|
|
- this.download(response.data.data)
|
|
|
|
- }).catch(function () { })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</script>
|
|
|