From 66c2da0469cfd5a5c462019561a02fad5b6e00e1 Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Mon, 21 Jul 2025 10:59:31 +0800
Subject: [PATCH] 1
---
src/views/addSmart/addSmartlist.vue | 352 +++++++++++++++++++
src/views/addSmart/addSmartrecord.vue | 614 ++++++++++++++++++++++++++++++++++
src/api/newshares.js | 65 +++
src/config/router.config.js | 32 +
4 files changed, 1,062 insertions(+), 1 deletions(-)
diff --git a/src/api/newshares.js b/src/api/newshares.js
index e492e4b..ef51797 100644
--- a/src/api/newshares.js
+++ b/src/api/newshares.js
@@ -15,7 +15,14 @@
deleteByAdmin: '/admin/stockDz/deleteByAdmin.do', // 折扣交易删除
getdazongshlist: '/api/dzCheck/getList.do', // 折扣交易审核列表
dazongshcheck:'/api/dzCheck/check.do',//折扣交易审核
-
+ addSmart:'/admin/smart/addSmart.do',// 添加日内产品
+ listSmart:'/admin/smart/listSmart.do',//日内列表
+ updateSmart:'/admin/smart/updateSmart.do',//修改日内
+ deleteSmart:'/admin/smart/deleteSmart.do',//删除日内
+ listIntraday:'/admin/smart/listIntraday.do',//日内审核列表
+ updateIntraday:'/admin/smart/updateIntraday.do',//日内审核
+ deleteIntraday:'/admin/smart/deleteIntraday.do',//删除日内
+ getStockByKeyWords:'/admin/smart/getStockByKeyWords.do' //股票编码查询
}
/**
@@ -30,6 +37,62 @@
* @returns {*}
*/
+ export function getStockByKeyWords(parameter) {
+ return request({
+ url: userApi.getStockByKeyWords,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+ export function deleteIntraday(parameter) {
+ return request({
+ url: userApi.deleteIntraday,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+ export function updateIntraday(parameter) {
+ return request({
+ url: userApi.updateIntraday,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+ export function listIntraday(parameter) {
+ return request({
+ url: userApi.listIntraday,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+ export function deleteSmart(parameter) {
+ return request({
+ url: userApi.deleteSmart,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+ export function updateSmart(parameter) {
+ return request({
+ url: userApi.updateSmart,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+ export function listSmart(parameter) {
+ return request({
+ url: userApi.listSmart,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+ }
+export function addSmart(parameter) {
+ return request({
+ url: userApi.addSmart,
+ method: 'post',
+ data: qs.stringify(parameter),
+ })
+}
export function dazongshcheck(parameter) {
return request({
url: userApi.dazongshcheck,
diff --git a/src/config/router.config.js b/src/config/router.config.js
index 3e5ab5e..43d0f46 100644
--- a/src/config/router.config.js
+++ b/src/config/router.config.js
@@ -212,6 +212,38 @@
},
],
},
+ {
+ path: '/addSmart ',
+ redirect: '/addSmart/addSmartlist',
+ component: RouteView,
+ meta: { title: '智能日内', icon: 'sliders', permission: ['addSmartlist'] },
+ children: [
+ {
+ path: '/addSmart/addSmartlist',
+ name: 'addSmartlist',
+ component: () => import('@/views/addSmart/addSmartlist'),
+ meta: { title: '日内配置', keepAlive: true, permission: ['addSmartlist'] },
+ },
+ {
+ path: '/addSmart/addSmartrecord',
+ name: 'addSmartrecord',
+ component: () => import('@/views/addSmart/addSmartrecord'),
+ meta: { title: '日内订单', keepAlive: true, permission: ['addSmartrecord'] },
+ },
+ // {
+ // path: '/newshares/dazonglist',
+ // name: 'dazonglist',
+ // component: () => import('@/views/newshares/dazonglist'),
+ // meta: { title: '折扣交易列表', keepAlive: true, permission: ['dazonglist'] },
+ // },
+ // {
+ // path: '/newshares/dazongshlist',
+ // name: 'dazongshlist',
+ // component: () => import('@/views/newshares/dazongshlist'),
+ // meta: { title: '折扣交易审核列表', keepAlive: true, permission: ['dazongshlist'] },
+ // },
+ ],
+ },
// 资金管理
{
path: '/capital',
diff --git a/src/views/addSmart/addSmartlist.vue b/src/views/addSmart/addSmartlist.vue
new file mode 100644
index 0000000..8d3df8b
--- /dev/null
+++ b/src/views/addSmart/addSmartlist.vue
@@ -0,0 +1,352 @@
+<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="状态">
+ <a-select v-model="queryParam.status" placeholder="请选择显示状态">
+ <a-select-option :value="0">隐藏</a-select-option>
+ <a-select-option :value="1">显示</a-select-option>
+ </a-select>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ <a-row :gutter="48">
+ <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), (pagination.current = page), getlist()"
+ >查询
+ </a-button>
+
+ <a-button
+ type="primary"
+ icon="plus"
+ style="margin-left: 8px"
+ @click=";(addUserdialog = true), (currentdetail = '')"
+ >
+ 添加日内</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="newlistId"
+ >
+ <span slot="name" slot-scope="text, record">
+ <template>
+ <div>
+ <span style="margin-right: 10px">{{ record.name }}</span>
+ <a-tag color="green">{{ record.code }} </a-tag>
+ </div>
+ </template>
+ </span>
+ <span slot="status" slot-scope="text, record">
+ <template>
+ <div>
+ <a-tag :color="record.status == 0 ? 'red' : record.status == 1 ? 'green' : ''">
+ {{ record.status == 0 ? '隐藏' : '显示' }}
+ </a-tag>
+ </div>
+ </template>
+ </span>
+
+
+ <template slot="action" slot-scope="text, record">
+ <a slot="action" href="javascript:;" @click="geteditStock(record)">{{ '修改日内' }}</a>
+ <a-divider type="vertical" />
+ <a slot="action" href="javascript:;" @click="getdeleteStock(record)">{{ '删除日内' }}</a>
+ </template>
+ </a-table>
+ </a-card>
+
+ <a-modal
+ :title="currentdetail ? '修改日内' : '添加日内'"
+ :width="700"
+ :visible="addUserdialog"
+ :confirmLoading="addUserDialogloading"
+ @ok="OkaddUserdialog"
+ @cancel="CanceladdUserdialog"
+ >
+ <a-form :form="addUserform" ref="addUserform">
+ <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="['depositName', { 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="请输入盈利(%)"
+ v-decorator="['profit', { rules: [{ required: true, message: '请输入盈利(%)' }] }]"
+ />
+ </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="['minAmount', { 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="请输入最大金额"
+ v-decorator="['maxAmount', { rules: [{ required: true, message: '请输入最大金额' }] }]"
+ />
+ </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-select
+ placeholder="请选择显示状态"
+ v-decorator="['status', { rules: [{ required: true, message: '请选择显示状态' }] }]"
+ >
+ <a-select-option :value="0">隐藏</a-select-option>
+ <a-select-option :value="1">显示</a-select-option>
+ </a-select>
+ </a-form-item>
+ </a-col>
+ </a-row>
+ </a-form>
+ </a-modal>
+ </page-header-wrapper>
+</template>
+<script>
+import { subscribelist, subscribeadd, subscribeupdate, subscribedel ,addSmart,listSmart,updateSmart,deleteSmart } from '@/api/newshares'
+import moment from 'moment'
+import pick from 'lodash.pick'
+export default {
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: '日内名称',
+ dataIndex: 'depositName',
+ align: 'center',
+ scopedSlots: { customRender: 'depositName' },
+ },
+ {
+ title: '最大购买金额',
+ dataIndex: 'maxAmount',
+ align: 'center',
+ },
+ {
+ title: '盈利百分比',
+ dataIndex: 'profit',
+ align: 'center'
+ },
+ {
+ title: '最小购买金额',
+ dataIndex: 'minAmount',
+ align: 'center',
+ },
+ {
+ title: '是否显示',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: { customRender: 'action' },
+ },
+ ],
+ disabledDate: true,
+ // 表头
+ pagination: {
+ total: 0,
+ current: 1,
+ 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,
+ status: undefined,
+ },
+ datalist: [],
+ labelCol: {
+ xs: { span: 8 },
+ sm: { span: 8 },
+ md: { span: 8 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
+
+ fields: [
+ 'depositName',
+ 'profit',
+ 'status',
+ 'minAmount',
+ 'maxAmount',
+ ],
+ currentdetail: '',
+ subscribeTime: '',
+ subscriptionTime: '',
+ listDate: '',
+ }
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ getdeleteStock(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除该日内吗?此操作不可恢复!',
+ onOk() {
+ var data = {
+ id: val.id,
+ }
+ deleteSmart(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getinit()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ getsubscribeTime(date, dateString) {
+ this.subscribeTime = dateString
+ },
+ getlistDate(date, dateString) {
+ this.listDate = dateString
+ },
+ getsubscriptionTime(date, dateString) {
+ this.subscriptionTime = 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))
+ },
+ CanceladdUserdialog() {
+ this.addUserdialog = false
+ const form = this.$refs.addUserform.form
+ form.resetFields()
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ if (this.currentdetail != '') {
+ this.addUserDialogloading = true
+ values.id = this.currentdetail.id
+ updateSmart(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ } else {
+ this.addUserDialogloading = true
+ addSmart(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ code: '',
+ name: '',
+ status: undefined,
+ type: undefined,
+ }
+ },
+ getinit() {
+ this.getqueryParam()
+ this.pagination.current = 1
+ this.getlist()
+ },
+ getlist() {
+ this.loading = true
+ listSmart(this.queryParam).then((res) => {
+ this.datalist = res.data.records
+ this.pagination.total = res.data.total
+ this.loading = false
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.pagination.current = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.pagination.current = page
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
+}
+</script>
diff --git a/src/views/addSmart/addSmartrecord.vue b/src/views/addSmart/addSmartrecord.vue
new file mode 100644
index 0000000..d843ed8
--- /dev/null
+++ b/src/views/addSmart/addSmartrecord.vue
@@ -0,0 +1,614 @@
+<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>
+
--
Gitblit v1.9.3