<template>
|
<page-header-wrapper>
|
<a-card :bordered="false">
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline">
|
<a-row :gutter="48">
|
<a-col :md="12" :lg="6" :sm="24">
|
<a-form-item label="用户ID">
|
<a-input v-model="queryParam.userId" style="width: 100%" placeholder="请输入用户ID" />
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="6" :sm="24">
|
<a-form-item label="用户手机号">
|
<a-input v-model="queryParam.phone" style="width: 100%" placeholder="请输入用户手机号" />
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="6" :sm="24">
|
<a-form-item label="股票名称">
|
<a-input v-model="queryParam.stockName" style="width: 100%" placeholder="请输入股票名称" />
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="6" :sm="24">
|
<a-form-item label="股票GID">
|
<a-input v-model="queryParam.stockGid" style="width: 100%" placeholder="请输入日内代码" />
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="6" :sm="24">
|
<a-form-item label="审核状态">
|
<a-select v-model="queryParam.status" placeholder="请选择审核状态">
|
<a-select-option :value="''">全部</a-select-option>
|
<a-select-option :value="2">已拒绝</a-select-option>
|
<a-select-option :value="1">已通过</a-select-option>
|
<a-select-option :value="0">待审核</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="6" :sm="24">
|
<a-form-item>
|
<span class="table-page-search-submitButtons">
|
<a-button @click="getqueryParam" icon="redo"> 重置</a-button>
|
<a-button
|
type="primary"
|
icon="search"
|
style="margin-left: 8px"
|
@click=";(queryParam.pageNum = 1), getlist()"
|
>查询
|
</a-button>
|
</span>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
</a-card>
|
<a-card :bordered="false">
|
<a-table
|
bordered
|
:loading="loading"
|
:pagination="pagination"
|
:columns="columns"
|
:data-source="datalist"
|
rowKey="id"
|
>
|
|
<span slot="auditStatus" slot-scope="text, record">
|
<template>
|
<div>
|
<span v-if="record.auditStatus==0">待审核</span>
|
<span v-if="record.auditStatus==1">成功</span>
|
<span v-if="record.auditStatus==2">失败</span>
|
</div>
|
</template>
|
</span>
|
<template slot="action" slot-scope="text, record">
|
<a slot="action" href="javascript:;" v-if="record.auditStatus==0" @click="geteditStock(record)">{{ '审核' }}</a>
|
<a-divider type="vertical" v-if="record.auditStatus==0" />
|
<a slot="action" href="javascript:;" @click="getdeleteStock(record,2)">{{ '删除' }}</a>
|
</template>
|
</a-table>
|
</a-card>
|
|
<a-modal
|
title="日内审核"
|
:width="700"
|
:visible="addUserdialog"
|
:confirmLoading="addUserDialogloading"
|
@ok="OkaddUserdialog"
|
@cancel="addUserdialog = false"
|
>
|
<a-form :form="addUserform" ref="addUserform">
|
<a-row :gutter="48">
|
<a-col :md="48" :lg="48" :sm="48">
|
<a-form-item label="股票编码">
|
<a-input-search
|
placeholder="输入股票代码查询股票信息"
|
enter-button
|
@search="getstockdetail"
|
v-decorator="['stockCode']"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="48">
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="股票GID" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入股票GID"
|
:disabled="true"
|
v-model="stockInfo.stockGid"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="股票名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入股票名称"
|
v-model="stockInfo.stockName"
|
:disabled="true"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="48">
|
<a-col :md="12" :lg="12" :sm="12" >
|
<a-form-item label="用户ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入用户ID"
|
:disabled="true"
|
v-decorator="['userId', { rules: [{ required: true, message: '请输入用户ID' }] }]"
|
/>
|
</a-form-item>
|
</a-col>
|
<!-- <a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="持仓类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入持仓类型"
|
:disabled="true"
|
v-decorator="['stockNum', { rules: [{ required: true, message: '请输入持仓类型' }] }]"
|
/>
|
</a-form-item>
|
</a-col> -->
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="涨跌类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-select
|
placeholder="请选择涨跌类型"
|
v-decorator="['priceType', { rules: [{ required: true, message: '请选择涨跌类型' }] }]"
|
>
|
<a-select-option :value="1">买涨</a-select-option>
|
<a-select-option :value="2">买跌</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="48">
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="股票价格" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入股票价格"
|
v-decorator="['stockPrice', { rules: [{ required: true, message: '请输入股票价格' }] }]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="订单金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入订单金额"
|
:disabled="true"
|
v-decorator="['orderAmount', { rules: [{ required: true, message: '请输入订单金额' }] }]"
|
/>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row>
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="股票数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-input
|
placeholder="请输入股票数量"
|
v-decorator="['stockQuantity', { rules: [{ required: true, message: '请输入股票数量' }] }]"
|
/>
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="审核状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-select
|
placeholder="请选择审核状态"
|
v-decorator="['auditStatus', { rules: [{ required: true, message: '请选择审核状态' }] }]"
|
>
|
<a-select-option :value="1">通过</a-select-option>
|
<a-select-option :value="2">驳回</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
|
<a-row :gutter="48">
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="下单时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-date-picker
|
show-time
|
style="width: 100%"
|
@change="getendTime"
|
v-decorator="['orderTime', { rules: [{ required: true, message: '请选择结束日期' }] }]"
|
format="YYYY-MM-DD HH:mm:ss"
|
>
|
</a-date-picker>
|
</a-form-item>
|
</a-col>
|
<a-col :md="12" :lg="12" :sm="12">
|
<a-form-item label="是否锁仓" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-select
|
placeholder="请选择是否锁仓"
|
v-decorator="['isLocked', { rules: [{ required: true, message: '请选择是否锁仓' }] }]"
|
>
|
<a-select-option :value="1">锁仓</a-select-option>
|
<a-select-option :value="0">开仓</a-select-option>
|
</a-select>
|
</a-form-item>
|
</a-col>
|
</a-row>
|
</a-row>
|
</a-form>
|
</a-modal>
|
</page-header-wrapper>
|
</template>
|
<script>
|
import { getdazongshlist,dazongshcheck,listIntraday,updateIntraday,deleteIntraday,getStockByKeyWords } from '@/api/newshares'
|
import { nextagent } from '@/api/home'
|
import pick from 'lodash.pick'
|
import moment from 'moment'
|
export default {
|
name: 'Financinghold',
|
data() {
|
return {
|
columns: [
|
{
|
title: '用户ID',
|
dataIndex: 'userId',
|
align: 'center',
|
// customRender: (text, row, index) => {
|
// return `${row.nickName}(${row.userId})`
|
// },
|
scopedSlots: { customRender: 'userId' },
|
},
|
{
|
title: '股票名称',
|
dataIndex: 'stockName',
|
align: 'center',
|
width: 180,
|
scopedSlots: { customRender: 'stockName' },
|
},
|
{
|
title: '股票GID',
|
dataIndex: 'stockGid',
|
align: 'center',
|
scopedSlots: { customRender: 'stockGid' },
|
},
|
{
|
title: '股票价格',
|
dataIndex: 'stockPrice',
|
align: 'center',
|
customRender: (text, row, index) => {
|
return text.toFixed(2)
|
},
|
},
|
{
|
title: '数量',
|
dataIndex: 'stockQuantity',
|
align: 'center',
|
},
|
{
|
title: '参与金额',
|
dataIndex: 'orderAmount',
|
align: 'center',
|
scopedSlots: { customRender: 'orderAmount' },
|
},
|
{
|
title: '股票类型',
|
dataIndex: 'stockType',
|
align: 'center',
|
scopedSlots: { customRender: 'stockType' },
|
},
|
{
|
title: '持仓订单',
|
dataIndex: 'positionOrder',
|
align: 'center',
|
},
|
{
|
title: '订单状态',
|
dataIndex: 'auditStatus',
|
align: 'center',
|
},
|
{
|
title: '涨跌类型',
|
dataIndex: 'priceType',
|
align: 'center',
|
},
|
// {
|
// title: '手续费',
|
// dataIndex: 'orderFee',
|
// align: 'center',
|
// },
|
// {
|
// title: '印花税',
|
// dataIndex: 'orderSpread',
|
// align: 'center',
|
// },
|
// {
|
// title: '留仓费',
|
// dataIndex: 'orderStayFee',
|
// align: 'center',
|
// },
|
// {
|
// title: '留仓天数',
|
// dataIndex: 'orderStayDays',
|
// align: 'center',
|
// },
|
// {
|
// title: '锁定原因',
|
// dataIndex: 'lockMsg',
|
// align: 'center',
|
// },
|
{
|
title: '创建时间',
|
dataIndex: 'orderTime',
|
align: 'center',
|
width: 180,
|
customRender: (text, row, index) => {
|
return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
|
},
|
},
|
{
|
title: '操作',
|
key: 'action',
|
align: 'center',
|
fixed: 'right',
|
width: 150,
|
scopedSlots: { customRender: 'action' },
|
},
|
],
|
// 表头
|
pagination: {
|
total: 0,
|
pageSize: 10, // 每页中显示10条数据
|
showSizeChanger: true,
|
pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
|
onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
|
onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
|
showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据
|
},
|
loading: false,
|
queryParam: {
|
pageNum: 1,
|
pageSize: 10,
|
userId: '',
|
phone: '',
|
stockName:'',
|
stockGid:'',
|
status:'',
|
},
|
labelCol: {
|
xs: { span: 8 },
|
sm: { span: 8 },
|
md: { span: 8 },
|
},
|
wrapperCol: {
|
xs: { span: 14 },
|
sm: { span: 14 },
|
md: { span: 14 },
|
},
|
id:'',
|
datalist: [],
|
fields: [
|
'userId',
|
'stockNum',
|
'stockPrice',
|
'orderAmount',
|
'stockCode',
|
'stockName',
|
'stockGid',
|
'switchType',
|
'stockQuantity',
|
'auditStatus',
|
'orderTime',
|
'isLocked'
|
],
|
addUserdialog: false,
|
addUserDialogloading: false,
|
agentlist: [],
|
agentloading: false,
|
addUserform: false,
|
addUserform: false,
|
addUserform: this.$form.createForm(this),
|
clickpositionId: '',
|
num:'',
|
ordertime:'',
|
stockInfo: {},
|
agentqueryParam: {
|
pageNum: 1,
|
pageSize: 100,
|
},
|
}
|
},
|
created() {
|
this.getlist()
|
},
|
methods: {
|
getstockdetail() {
|
getStockByKeyWords({ keyWords: this.addUserform.getFieldValue('stockCode') }).then((res) => {
|
if (res.data) {
|
this.stockInfo = res.data
|
} else {
|
this.$message.error(res.msg)
|
this.stockInfo = ''
|
}
|
})
|
},
|
getendTime(date, dateString) {
|
this.ordertime = dateString
|
},
|
geteditStock(val) {
|
this.currentdetail = val
|
this.addUserdialog = true
|
var currentTime = new Date()
|
this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
|
this.addUserform.setFieldsValue(pick(val, this.fields))
|
},
|
OkaddUserdialog(item,e){
|
const form = this.$refs.addUserform.form
|
form.validateFields((errors, values) => {
|
if (!errors) {
|
this.addUserDialogloading = true
|
values.orderTime = this.ordertime
|
values.id = this.currentdetail.id
|
updateIntraday(values).then((res) => {
|
if (res.status == 0) {
|
this.$message.success({ content: '审核完成', duration: 2 })
|
this.getlist()
|
} else {
|
this.$message.error(res.msg)
|
}
|
this.addUserdialog = false
|
this.addUserDialogloading = false
|
})
|
}
|
})
|
},
|
getdeleteStock(item,e){
|
this.id = item.id
|
var data = {
|
id: item.id,
|
}
|
deleteIntraday(data)
|
.then((res) => {
|
if (res.status == 0) {
|
this.$message.success(res.msg)
|
this.getlist()
|
} else {
|
this.$message.error({ content: res.msg })
|
}
|
})
|
.catch((error) => {
|
this.$message.error({ content: 'res.msg' })
|
}).finally(()=>{
|
})
|
},
|
getCompulsoryclosing(val) {
|
var that = this
|
this.$confirm({
|
title: '提示',
|
content: '确认要强制平仓吗?',
|
onOk() {
|
var data = {
|
positionSn: val,
|
}
|
positionsell(data)
|
.then((res) => {
|
if (res.status == 0) {
|
that.$message.success(res.msg)
|
that.getlist()
|
} else {
|
that.$message.error({ content: '平仓失败' })
|
}
|
})
|
.catch((error) => {
|
that.$message.error({ content: '平仓失败' })
|
})
|
},
|
onCancel() {
|
console.log('Cancel')
|
},
|
})
|
},
|
getLockopen(val) {
|
var that = this
|
this.$confirm({
|
title: '提示',
|
content: '确认要解锁该持仓单?',
|
onOk() {
|
var data = {
|
state: 0,
|
positionId: val,
|
}
|
positionlock(data).then((res) => {
|
if (res.status == 0) {
|
that.$message.success(res.msg)
|
that.getlist()
|
} else {
|
that.$message.error(res.msg)
|
}
|
})
|
},
|
onCancel() {
|
console.log('Cancel')
|
},
|
})
|
},
|
handleCancel() {
|
this.Lockvisibledialog = false
|
const form = this.$refs.createModal.form
|
form.resetFields()
|
},
|
getDialogok() {
|
const form = this.$refs.createModal.form
|
form.validateFields((errors, values) => {
|
if (!errors) {
|
this.Lockvisibleloading = true
|
var data = {
|
state: 1,
|
lockMsg: values.lockMsg,
|
positionId: this.clickpositionId,
|
}
|
positionlock(data)
|
.then((res) => {
|
if (res.status == 0) {
|
this.Lockvisibledialog = false
|
this.$message.success(res.msg)
|
form.resetFields()
|
this.getlist()
|
} else {
|
this.$message.error(res.msg)
|
}
|
this.Lockvisibleloading = false
|
})
|
.catch((error) => {
|
reject(error)
|
})
|
}
|
})
|
},
|
getinit() {
|
this.queryParam = {
|
pageNum: 1,
|
pageSize: 10,
|
positionType: '',
|
agentId: undefined,
|
userId: '',
|
positionSn: '',
|
state:'',
|
phone: '',
|
}
|
this.getlist()
|
},
|
getqueryParam() {
|
this.queryParam = {
|
pageNum: 1,
|
pageSize: 10,
|
userId: '',
|
phone: '',
|
stockName:'',
|
stockGid:'',
|
status:'',
|
}
|
},
|
getagentlist() {
|
var that = this
|
this.agentloading = true
|
nextagent(this.agentqueryParam).then((res) => {
|
this.agentlist = res.data.list
|
setTimeout(() => {
|
that.agentloading = false
|
}, 500)
|
})
|
},
|
getlist() {
|
this.loading = true
|
listIntraday(this.queryParam).then((res) => {
|
this.datalist = res.data.list
|
this.pagination.total = res.data.total
|
this.loading = false
|
})
|
},
|
onPageChange(page, pageSize) {
|
this.queryParam.pageNum = page
|
this.getlist()
|
},
|
onSizeChange(current, pageSize) {
|
this.queryParam.pageNum = current
|
this.queryParam.pageSize = pageSize
|
this.getlist()
|
},
|
},
|
}
|
</script>
|
<style scoped>
|
.greens {
|
color: #52c41a;
|
}
|
|
.reds {
|
color: #f5222d;
|
}
|
</style>
|