From 69ff731fbacf2f2ae16f98a355506bfeb01dd567 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Sun, 07 Apr 2024 21:47:08 +0800
Subject: [PATCH] ne1
---
src/views/newshares/dazonglist.vue | 453
src/views/capital/agentcomponents/editCapitalAgentdialog.vue | 120
src/views/interesttreasure/agentcomponents/editCapitalAgentdialog.vue | 120
src/views/position/components/futures-flat.vue | 567 +-
src/views/newshares/newshareslist.vue | 572 +-
src/views/newshares/newsharesrecord.vue | 498 +
src/views/product/shares.vue | 580 +-
src/views/product/baseCurrency.vue | 382
src/views/risksetting/spreadsetting.vue | 371
src/views/allotment/securities.vue | 376
src/views/userlist/components/editUserbankdialog.vue | 143
src/views/userlist/agentcomponents/addagentdialog.vue | 122
src/views/product/components/addindexdialog.vue | 149
src/views/product/markettrading.vue | 526 +-
src/views/risksetting/productsetting.vue | 219
src/views/userlist/components/adduserdialog.vue | 124
src/views/product/components/addfuturesdialog.vue | 202
src/views/risksetting/futuressetting.vue | 244
src/views/userlist/components/editCapitaluserdialog.vue | 30
src/views/userlist/agentcomponents/EditAgentinfodialog.vue | 142
src/views/position/components/financing-flat.vue | 570 +-
src/views/userlist/components/EditUserinfodialog.vue | 127
src/views/userlist/agentcomponents/editCapitalAgentdialog.vue | 120
src/views/allotment/allotmentlist.vue | 415
src/views/userlist/index.vue | 91
src/views/allotment/transactionAccount.vue | 403
src/views/risksetting/indexsetting.vue | 233
src/views/capital/withdrawallist.vue | 4
src/views/position/components/financing-hold.vue | 633 +-
src/views/allsetting/bannersetting.vue | 439
src/views/allsetting/noticesetting.vue | 436
src/views/product/components/editfuturesdialog.vue | 243
src/views/position/createFinancing.vue | 304
src/views/userlist/components/audituserdialog.vue | 7
src/views/position/components/index-hold.vue | 583 +-
src/views/risksetting/sharessetting.vue | 406 +
src/views/managesettings/managelist.vue | 401
src/views/allotment/leversetting.vue | 315
src/views/position/components/index-flat.vue | 517 +-
src/views/capital/rechargelist.vue | 12
src/views/allsetting/paysetting.vue | 80
src/views/account/settings/BasicSetting.vue | 2
src/views/account/settings/Security.vue | 45
src/views/allotment/allotmentSetting.vue | 253
src/views/allotment/brokerMechanism.vue | 321
src/views/allotment/expand.vue | 543 +-
src/views/position/components/futures-hold.vue | 617 +-
src/views/product/components/editindexdialog.vue | 146
src/views/loanmanage/agentcomponents/editCapitalAgentdialog.vue | 120
src/views/userlist/agentlist.vue | 77
50 files changed, 7,407 insertions(+), 6,996 deletions(-)
diff --git a/src/views/account/settings/BasicSetting.vue b/src/views/account/settings/BasicSetting.vue
index 32c9173..aeef6a8 100644
--- a/src/views/account/settings/BasicSetting.vue
+++ b/src/views/account/settings/BasicSetting.vue
@@ -108,7 +108,7 @@
form.resetFields()
this.getsetting()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
})
}
diff --git a/src/views/account/settings/Security.vue b/src/views/account/settings/Security.vue
index 50b4689..e753da9 100644
--- a/src/views/account/settings/Security.vue
+++ b/src/views/account/settings/Security.vue
@@ -1,39 +1,37 @@
<template>
<div class="account-settings-info-view">
-
<a-form layout="vertical" :form="addUserform" ref="addUserform">
<a-row :gutter="16" type="flex" justify="center">
<a-col :order="isMobile ? 2 : 1" :md="24" :lg="16">
-
<a-form-item label="昵称">
<a-input
placeholder="请输入您的昵称"
- v-decorator="['adminName', { rules: [{ required: false, message: '请输入您的昵称', }] }]"
+ v-decorator="['adminName', { rules: [{ required: false, message: '请输入您的昵称' }] }]"
/>
</a-form-item>
<a-form-item label="ID">
<a-input
placeholder="请输入您的ID"
- v-decorator="['id', { rules: [{ required: true, message: '请输入您的ID', }] }]"
- disabled />
+ v-decorator="['id', { rules: [{ required: true, message: '请输入您的ID' }] }]"
+ disabled
+ />
</a-form-item>
<a-form-item label="新密码">
<a-input
placeholder="请输入您的新密码"
- v-decorator="['adminPwd', { rules: [{ required: true, message: '请输入您的新密码', }] }]" />
+ v-decorator="['adminPwd', { rules: [{ required: true, message: '请输入您的新密码' }] }]"
+ />
</a-form-item>
<a-form-item>
<a-button type="primary" @click="saveinfo">保存基本信息</a-button>
</a-form-item>
-
</a-col>
</a-row>
</a-form>
<avatar-modal ref="modal" @ok="setavatar" />
-
</div>
</template>
@@ -45,9 +43,9 @@
export default {
mixins: [baseMixin],
components: {
- AvatarModal
+ AvatarModal,
},
- data () {
+ data() {
return {
// cropper
preview: {},
@@ -64,47 +62,46 @@
fixedBox: true,
// 开启宽度和高度比例
fixed: true,
- fixedNumber: [1, 1]
+ fixedNumber: [1, 1],
},
settingdetail: {},
addUserform: this.$form.createForm(this),
- fields: ['id', 'adminPwd', 'adminName']
+ fields: ['id', 'adminPwd', 'adminName'],
}
},
- mounted () {
+ mounted() {
this.getnowuser()
},
methods: {
- getnowuser () {
- adminlist().then(res => {
- var index = res.data.list.findIndex(item => item.adminPhone == window.localStorage.getItem('phones'))
+ getnowuser() {
+ adminlist().then((res) => {
+ var index = res.data.list.findIndex((item) => item.adminPhone == window.localStorage.getItem('phones'))
this.addUserform.setFieldsValue({
id: res.data.list[index].id,
- adminName: res.data.list[index].adminName
-
+ adminName: res.data.list[index].adminName,
})
})
},
- setavatar (url) {
+ setavatar(url) {
this.option.img = url
},
- saveinfo () {
+ saveinfo() {
const form = this.$refs.addUserform.form
form.validateFields((errors, values) => {
if (!errors) {
- adminupdate(values).then(res => {
+ adminupdate(values).then((res) => {
if (res.status == 0) {
this.$message.success({ content: '修改成功', duration: 2 })
form.resetFields()
this.getnowuser()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
})
}
})
- }
- }
+ },
+ },
}
</script>
diff --git a/src/views/allotment/allotmentSetting.vue b/src/views/allotment/allotmentSetting.vue
index 488c926..ce9dffb 100644
--- a/src/views/allotment/allotmentSetting.vue
+++ b/src/views/allotment/allotmentSetting.vue
@@ -11,7 +11,7 @@
</a-col>
<a-col :xl="{ span: 7, offset: 1 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="24">
<a-form-item label="保证金最大值(例:10000,单位元)">
- <a-input placeholder="请输入保证金最大值" v-decorator="['marginMax',{}]" />
+ <a-input placeholder="请输入保证金最大值" v-decorator="['marginMax', {}]" />
</a-form-item>
</a-col>
</a-row>
@@ -21,35 +21,29 @@
<a-row class="form-row" :gutter="16">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item label="免息杠杆(例:1,填倍数)">
- <a-input
- placeholder="请输入免息杠杆倍数"
- v-decorator="[
- 'interestFreeLever',{}]" />
+ <a-input placeholder="请输入免息杠杆倍数" v-decorator="['interestFreeLever', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 7, offset: 1 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="24">
<a-form-item label="免息天数(例:5,单位天)">
- <a-input placeholder="请输入免息天数" v-decorator="['interestFreeDays',{}]" />
+ <a-input placeholder="请输入免息天数" v-decorator="['interestFreeDays', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 9, offset: 1 }" :lg="{ span: 10 }" :md="{ span: 24 }" :sm="24">
<a-form-item label="免息盈利(例:0.85,百分比)">
- <a-input
- placeholder="请输入免息盈利"
- v-decorator="['interestFreeProfit',{}
- ]" />
+ <a-input placeholder="请输入免息盈利" v-decorator="['interestFreeProfit', {}]" />
</a-form-item>
</a-col>
</a-row>
<a-row class="form-row" :gutter="16">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item label="免息预警线(例:0.75)">
- <a-input placeholder="请输入免息预警线" v-decorator="['interestFreeWarning',{}]" />
+ <a-input placeholder="请输入免息预警线" v-decorator="['interestFreeWarning', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 7, offset: 1 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="24">
<a-form-item label="免息平仓线(例:0.82)">
- <a-input placeholder="请输入免息平仓线" v-decorator="['interestFreeUnwind',{}]" />
+ <a-input placeholder="请输入免息平仓线" v-decorator="['interestFreeUnwind', {}]" />
</a-form-item>
</a-col>
</a-row>
@@ -59,32 +53,17 @@
<a-row class="form-row" :gutter="16">
<a-col :lg="6" :md="12" :sm="24">
<a-form-item label="使用期限(例:2|3)">
- <a-input
- placeholder="请输入使用期限"
- v-decorator="[
- 'daysUsePeriod',
- {}
- ]" />
+ <a-input placeholder="请输入使用期限" v-decorator="['daysUsePeriod', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 7, offset: 1 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="24">
<a-form-item label="按天预警线(例:0.75,百分比">
- <a-input
- placeholder="请输入按天预警线"
- v-decorator="[
- 'daysWarning',
- {}
- ]" />
+ <a-input placeholder="请输入按天预警线" v-decorator="['daysWarning', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 9, offset: 1 }" :lg="{ span: 10 }" :md="{ span: 24 }" :sm="24">
<a-form-item label="按天平仓线(例:0.82,百分比)">
- <a-input
- placeholder="请输入按天平仓线"
- v-decorator="[
- 'daysUnwind',
- {}
- ]" />
+ <a-input placeholder="请输入按天平仓线" v-decorator="['daysUnwind', {}]" />
</a-form-item>
</a-col>
</a-row>
@@ -94,51 +73,28 @@
<a-row class="form-row" :gutter="16">
<a-col :lg="5" :md="12" :sm="24">
<a-form-item label="交易佣金费率(例:0.75,百分比)">
- <a-input
- placeholder="请输入交易佣金费率"
- v-decorator="[
- 'tradingCommissionRate',
- {}
- ]" />
+ <a-input placeholder="请输入交易佣金费率" v-decorator="['tradingCommissionRate', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 5, offset: 1 }" :lg="{ span: 8 }" :md="{ span: 12 }" :sm="24">
<a-form-item label="每笔最低费用(例:5,单位元)">
- <a-input
- placeholder="请输入每笔最低费用"
- v-decorator="[
- 'stampDutyRate',
- {}
- ]" />
+ <a-input placeholder="请输入每笔最低费用" v-decorator="['stampDutyRate', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 5, offset: 1 }" :lg="{ span: 10 }" :md="{ span: 24 }" :sm="24">
<a-form-item label="盈利分成比例(例:0.85,百分比)">
- <a-input
- placeholder="请输入盈利分成比例"
- v-decorator="[
- 'profitSharingRatio',
- {}
- ]" />
+ <a-input placeholder="请输入盈利分成比例" v-decorator="['profitSharingRatio', {}]" />
</a-form-item>
</a-col>
<a-col :xl="{ span: 5, offset: 1 }" :lg="{ span: 10 }" :md="{ span: 24 }" :sm="24">
<a-form-item label="提前终止利息(例:0.25,百分比)">
- <a-input
- placeholder="请输入提前终止利息"
- v-decorator="[
- 'earlyTerminationInterest',
- {}
- ]" />
+ <a-input placeholder="请输入提前终止利息" v-decorator="['earlyTerminationInterest', {}]" />
</a-form-item>
</a-col>
</a-row>
-
</a-card>
<footer-tool-bar>
- <a-button type="primary" html-type="submit">
- 修改提交
- </a-button>
+ <a-button type="primary" html-type="submit"> 修改提交 </a-button>
</footer-tool-bar>
</a-form>
</page-header-wrapper>
@@ -148,109 +104,124 @@
import { getFundsSetting, saveFundsSetting } from '@/api/allotment'
import pick from 'lodash.pick'
export default {
- name: 'Setting',
- components: {
- FooterToolBar
- },
- data () {
- return {
- form: this.$form.createForm(this),
- loading: false,
- id: '',
- details: {},
- fields: ['marginMin', 'marginMax', 'interestFreeLever', 'interestFreeDays', 'interestFreeProfit', 'interestFreeWarning', 'interestFreeUnwind', 'daysUsePeriod', 'daysWarning', 'daysUnwind', 'tradingCommissionRate', 'stampDutyRate', 'profitSharingRatio', 'earlyTerminationInterest']
- }
- },
- mounted () {
- this.getdetail()
- },
- methods: {
- handleSubmit (e) {
- e.preventDefault()
- this.form.validateFields((err, values) => {
- var that = this
- var formitem = values
- formitem.id = that.id
- saveFundsSetting(formitem).then(res => {
- if (res.status == 0) {
- that.$message.loading({ content: 'Loading...' })
- setTimeout(() => {
- that.$message.success({ content: '提交成功', duration: 2 })
- that.getdetail()
- }, 2000)
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- })
- },
- getdetail () {
- var that = this
- this.loading = true
- getFundsSetting().then(res => {
- that.id = res.data.id
- this.fields.forEach(v => this.form.getFieldDecorator(v))
- this.form.setFieldsValue(pick(res.data, this.fields))
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- }
+ name: 'Setting',
+ components: {
+ FooterToolBar,
+ },
+ data() {
+ return {
+ form: this.$form.createForm(this),
+ loading: false,
+ id: '',
+ details: {},
+ fields: [
+ 'marginMin',
+ 'marginMax',
+ 'interestFreeLever',
+ 'interestFreeDays',
+ 'interestFreeProfit',
+ 'interestFreeWarning',
+ 'interestFreeUnwind',
+ 'daysUsePeriod',
+ 'daysWarning',
+ 'daysUnwind',
+ 'tradingCommissionRate',
+ 'stampDutyRate',
+ 'profitSharingRatio',
+ 'earlyTerminationInterest',
+ ],
}
+ },
+ mounted() {
+ this.getdetail()
+ },
+ methods: {
+ handleSubmit(e) {
+ e.preventDefault()
+ this.form.validateFields((err, values) => {
+ var that = this
+ var formitem = values
+ formitem.id = that.id
+ saveFundsSetting(formitem).then((res) => {
+ if (res.status == 0) {
+ that.$message.loading({ content: 'Loading...' })
+ setTimeout(() => {
+ that.$message.success({ content: '提交成功', duration: 2 })
+ that.getdetail()
+ }, 2000)
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ })
+ },
+ getdetail() {
+ var that = this
+ this.loading = true
+ getFundsSetting().then((res) => {
+ that.id = res.data.id
+ this.fields.forEach((v) => this.form.getFieldDecorator(v))
+ this.form.setFieldsValue(pick(res.data, this.fields))
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
.card {
- margin-bottom: 24px;
+ margin-bottom: 24px;
}
/deep/ .ant-pro-global-footer {
- margin: 0 0 48px 0 !important;
+ margin: 0 0 48px 0 !important;
}
.popover-wrapper {
- :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
+ :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
+ min-width: 256px;
+ max-height: 290px;
+ padding: 0;
+ overflow: auto;
+ }
}
.antd-pro-pages-forms-style-errorIcon {
- user-select: none;
- margin-right: 24px;
- color: #f5222d;
- cursor: pointer;
+ user-select: none;
+ margin-right: 24px;
+ color: #f5222d;
+ cursor: pointer;
- i {
- margin-right: 4px;
- }
+ i {
+ margin-right: 4px;
+ }
}
.antd-pro-pages-forms-style-errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid #e8e8e8;
- cursor: pointer;
- transition: all .3s;
+ padding: 8px 16px;
+ list-style: none;
+ border-bottom: 1px solid #e8e8e8;
+ cursor: pointer;
+ transition: all 0.3s;
- &:hover {
- background: #e6f7ff;
- }
+ &:hover {
+ background: #e6f7ff;
+ }
- .antd-pro-pages-forms-style-errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: #f5222d;
- }
+ .antd-pro-pages-forms-style-errorIcon {
+ float: left;
+ margin-top: 4px;
+ margin-right: 12px;
+ padding-bottom: 22px;
+ color: #f5222d;
+ }
- .antd-pro-pages-forms-style-errorField {
- margin-top: 2px;
- color: rgba(0, 0, 0, .45);
- font-size: 12px;
- }
+ .antd-pro-pages-forms-style-errorField {
+ margin-top: 2px;
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ }
}
</style>
diff --git a/src/views/allotment/allotmentlist.vue b/src/views/allotment/allotmentlist.vue
index c431169..825d970 100644
--- a/src/views/allotment/allotmentlist.vue
+++ b/src/views/allotment/allotmentlist.vue
@@ -11,10 +11,7 @@
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="配资状态">
- <a-select
- v-model="queryParam.status"
- placeholder="请选择用户类型"
- :default-value="{ key: '0' }">
+ <a-select v-model="queryParam.status" placeholder="请选择用户类型" :default-value="{ key: '0' }">
<a-select-option :value="0">待审核</a-select-option>
<a-select-option :value="1">操盘中</a-select-option>
<a-select-option :value="2">未通过</a-select-option>
@@ -26,11 +23,8 @@
<a-col :md="6" :sm="24">
<a-form-item>
<span class="table-page-search-submitButtons">
- <a-button type="primary" icon="search" @click="queryParam.pageNum = 1, getlist()">查询
- </a-button>
- <a-button style="margin-left: 8px" @click="getqueryParam" icon="redo">
- 重置</a-button>
-
+ <a-button type="primary" icon="search" @click=";(queryParam.pageNum = 1), getlist()">查询 </a-button>
+ <a-button style="margin-left: 8px" @click="getqueryParam" icon="redo"> 重置</a-button>
</span>
</a-form-item>
</a-col>
@@ -46,21 +40,26 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="status" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="status" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.status == 0 ? 'green' : 'red'">{{ record.status | statusFilter }}
- </a-tag>
+ <a-tag :color="record.status == 0 ? 'green' : 'red'">{{ record.status | statusFilter }} </a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a
slot="action"
href="javascript:;"
- @click="currentDetails = record; addUserdialog = true"
- v-if="record.status == 0">配资审核</a>
+ @click="
+ currentDetails = record
+ addUserdialog = true
+ "
+ v-if="record.status == 0"
+ >配资审核</a
+ >
</template>
</a-table>
</a-card>
@@ -70,12 +69,14 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="审核状态">
<a-select
placeholder="请选择审核状态"
- v-decorator="['status', { rules: [{ required: true, message: '请选择审核状态', }] }]">
+ v-decorator="['status', { rules: [{ required: true, message: '请选择审核状态' }] }]"
+ >
<a-select-option value="1">审核通过</a-select-option>
<a-select-option value="2">未通过</a-select-option>
</a-select>
@@ -83,22 +84,20 @@
<a-form-item label="子账户" v-if="addUserform.getFieldValue('status') == 1">
<a-select
placeholder="请选择子账户"
- v-decorator="['subaccountNumber', { rules: [{ required: true, message: '请选择子账户', }] }]"
+ v-decorator="['subaccountNumber', { rules: [{ required: true, message: '请选择子账户' }] }]"
@focus="getEnabledAccount"
- :loading="Accountloading">
- <a-select-option
- v-for="(item, index) in accountList"
- :key="index"
- :value="item.subaccountNumber">{{
- item.subaccountNumber
- }}
+ :loading="Accountloading"
+ >
+ <a-select-option v-for="(item, index) in accountList" :key="index" :value="item.subaccountNumber"
+ >{{ item.subaccountNumber }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="审核意见">
<a-input
placeholder="请输入审核意见"
- v-decorator="['auditOpinion', { rules: [{ required: true, message: '请输入审核意见', }] }]" />
+ v-decorator="['auditOpinion', { rules: [{ required: true, message: '请输入审核意见' }] }]"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -108,193 +107,193 @@
import { getApplyList, getTradingAccountList, fundsapplyauditApply } from '@/api/allotment'
import moment from 'moment'
export default {
- name: 'Allotmentlist',
- data () {
- return {
- columns: [
- {
- title: '订单号',
- dataIndex: 'orderNumber',
- align: 'center'
- },
- {
- title: '配资人',
- dataIndex: 'userName',
- align: 'center'
- },
- {
- title: '子账号',
- dataIndex: 'subaccountNumber',
- align: 'center'
- },
- {
- title: '手机号',
- dataIndex: 'userPhone',
- align: 'center'
- },
- {
- title: '保证金',
- dataIndex: 'margin',
- align: 'center'
- },
- {
- title: '配资金额',
- dataIndex: 'fundsAmount',
- align: 'center'
- },
- {
- title: '总操盘金额',
- dataIndex: 'totalTradingAmount',
- align: 'center'
- },
- {
- title: '操盘期限',
- dataIndex: 'tradersCycle',
- align: 'center'
- },
- {
- title: '申请时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '开始时间',
- dataIndex: 'beginTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '结束时间',
- dataIndex: 'endTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '配资状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- 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: {
- keyword: '',
- status: 0,
- pageNum: 1,
- pageSize: 10
- },
- datalist: [],
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false,
- accountList: [],
- Accountloading: false,
- currentDetails: {}
- }
- },
- created () {
- this.getlist()
- },
- filters: {
- statusFilter (status) {
- const statusMap = {
- 0: '待审核',
- 1: '操盘中',
- 2: '未通过',
- 3: '已到期',
- 4: '已结束'
- }
- return statusMap[status]
- }
- },
- methods: {
- // 点击子账户调用交易账户管理列表 status 0 未用 1 已用
- getEnabledAccount () {
- this.Accountloading = true
- getTradingAccountList({ status: 0 }).then(res => {
- if (res.status == 0) {
- this.accountList = res.data.data.list
- this.Accountloading = false
- }
- })
+ name: 'Allotmentlist',
+ data() {
+ return {
+ columns: [
+ {
+ title: '订单号',
+ dataIndex: 'orderNumber',
+ align: 'center',
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '配资人',
+ dataIndex: 'userName',
+ align: 'center',
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- values.id = this.currentDetails.id
- values.tradersCycle = this.currentDetails.tradersCycle
- fundsapplyauditApply(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '子账号',
+ dataIndex: 'subaccountNumber',
+ align: 'center',
},
- getqueryParam () {
- this.queryParam = {
- keyword: '',
- status: 0,
- pageNum: 1,
- pageSize: 10
- }
+ {
+ title: '手机号',
+ dataIndex: 'userPhone',
+ align: 'center',
},
- getlist () {
- var that = this
- this.loading = true
- getApplyList(this.queryParam).then(res => {
- this.datalist = res.data.data.list
- this.pagination.total = res.data.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
+ {
+ title: '保证金',
+ dataIndex: 'margin',
+ align: 'center',
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '配资金额',
+ dataIndex: 'fundsAmount',
+ align: 'center',
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '总操盘金额',
+ dataIndex: 'totalTradingAmount',
+ align: 'center',
+ },
+ {
+ title: '操盘期限',
+ dataIndex: 'tradersCycle',
+ align: 'center',
+ },
+ {
+ title: '申请时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '开始时间',
+ dataIndex: 'beginTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '结束时间',
+ dataIndex: 'endTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '配资状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ 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: {
+ keyword: '',
+ status: 0,
+ pageNum: 1,
+ pageSize: 10,
+ },
+ datalist: [],
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
+ accountList: [],
+ Accountloading: false,
+ currentDetails: {},
}
+ },
+ created() {
+ this.getlist()
+ },
+ filters: {
+ statusFilter(status) {
+ const statusMap = {
+ 0: '待审核',
+ 1: '操盘中',
+ 2: '未通过',
+ 3: '已到期',
+ 4: '已结束',
+ }
+ return statusMap[status]
+ },
+ },
+ methods: {
+ // 点击子账户调用交易账户管理列表 status 0 未用 1 已用
+ getEnabledAccount() {
+ this.Accountloading = true
+ getTradingAccountList({ status: 0 }).then((res) => {
+ if (res.status == 0) {
+ this.accountList = res.data.data.list
+ this.Accountloading = false
+ }
+ })
+ },
+ 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) {
+ this.addUserDialogloading = true
+ values.id = this.currentDetails.id
+ values.tradersCycle = this.currentDetails.tradersCycle
+ fundsapplyauditApply(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
+ })
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ keyword: '',
+ status: 0,
+ pageNum: 1,
+ pageSize: 10,
+ }
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ getApplyList(this.queryParam).then((res) => {
+ this.datalist = res.data.data.list
+ this.pagination.total = res.data.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/allotment/brokerMechanism.vue b/src/views/allotment/brokerMechanism.vue
index d3ebf6e..1dc7be0 100644
--- a/src/views/allotment/brokerMechanism.vue
+++ b/src/views/allotment/brokerMechanism.vue
@@ -9,28 +9,33 @@
<a-input
v-model="queryParam.keyword"
style="width: 100%"
- placeholder="请填写券商ID/券商名称/客户端版本号" />
+ placeholder="请填写券商ID/券商名称/客户端版本号"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item>
<span class="table-page-search-submitButtons">
- <a-button @click="getqueryParam" icon="redo">
- 重置</a-button>
+ <a-button @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true; currentDetails = ''">
- 添加券商</a-button>
-
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >
+ 添加券商</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -46,16 +51,16 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="status" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="status" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '停用' : '启用' }}
- </a-tag>
+ <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '停用' : '启用' }} </a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditbroker(record)">修改券商机构</a>
</template>
</a-table>
@@ -67,34 +72,40 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="券商ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入券商ID"
- v-decorator="['dealerNumber', { rules: [{ required: true, message: '请输入券商ID', }] }]" />
+ v-decorator="['dealerNumber', { rules: [{ required: true, message: '请输入券商ID' }] }]"
+ />
<span>券商ID,如:27代表银河证券</span>
</a-form-item>
<a-form-item label="券商名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入券商名称"
- v-decorator="['dealerName', { rules: [{ required: true, message: '请输入券商名称', }] }]" />
+ v-decorator="['dealerName', { rules: [{ required: true, message: '请输入券商名称' }] }]"
+ />
<span>券商名称,如:银河证券</span>
</a-form-item>
<a-form-item label="客户端版本号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入客户端版本号"
- v-decorator="['clientVersionNumber', { rules: [{ required: true, message: '请输入客户端版本号', }] }]" />
+ v-decorator="['clientVersionNumber', { rules: [{ required: true, message: '请输入客户端版本号' }] }]"
+ />
</a-form-item>
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea
placeholder="请输入备注"
- v-decorator="['remarks', { rules: [{ required: true, message: '请输入备注', }] }]" />
+ v-decorator="['remarks', { rules: [{ required: true, message: '请输入备注' }] }]"
+ />
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择状态"
- v-decorator="['status', { rules: [{ required: true, message: '请选择状态', }] }]">
+ 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>
@@ -108,149 +119,149 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Setting',
- data () {
- return {
- columns: [
- {
- title: '券商ID',
- dataIndex: 'dealerNumber',
- align: 'center'
- },
- {
- title: '券商名称',
- dataIndex: 'dealerName',
- align: 'center'
- },
- {
- title: '客户端版本号',
- dataIndex: 'clientVersionNumber',
- align: 'center'
- },
- {
- title: '备注',
- dataIndex: 'remarks',
- align: 'center'
- },
- {
- title: '状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- 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,
- keyword: ''
- },
- datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- fields: ['dealerNumber', 'dealerName', 'clientVersionNumber', 'remarks', 'status'],
- currentDetails: ''
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- geteditbroker (val) {
- this.currentDetails = val
- this.addUserdialog = true
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(val, this.fields))
+ name: 'Setting',
+ data() {
+ return {
+ columns: [
+ {
+ title: '券商ID',
+ dataIndex: 'dealerNumber',
+ align: 'center',
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '券商名称',
+ dataIndex: 'dealerName',
+ align: 'center',
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- } else {
- values.id = 0
- }
- saveDealerInstitutions(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.data.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '客户端版本号',
+ dataIndex: 'clientVersionNumber',
+ align: 'center',
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- keyword: ''
- }
+ {
+ title: '备注',
+ dataIndex: 'remarks',
+ align: 'center',
},
- getlist () {
- var that = this
- this.loading = true
- getDealerInstitutionsList(this.queryParam).then(res => {
- this.datalist = res.data.data.list
- this.pagination.total = res.data.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
+ {
+ title: '状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ 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,
+ keyword: '',
+ },
+ datalist: [],
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ fields: ['dealerNumber', 'dealerName', 'clientVersionNumber', 'remarks', 'status'],
+ currentDetails: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ geteditbroker(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ } else {
+ values.id = 0
+ }
+ saveDealerInstitutions(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: res.data.msg, duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ keyword: '',
+ }
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ getDealerInstitutionsList(this.queryParam).then((res) => {
+ this.datalist = res.data.data.list
+ this.pagination.total = res.data.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/allotment/expand.vue b/src/views/allotment/expand.vue
index bf51ac3..98df86a 100644
--- a/src/views/allotment/expand.vue
+++ b/src/views/allotment/expand.vue
@@ -11,12 +11,13 @@
</a-col>
<a-col :md="12" :xxl="7" :sm="24">
<a-form-item label="类型选择">
- <div style="display:flex;">
+ <div style="display: flex">
<a-select
v-model="queryParam.appendType"
style="width: 140px"
placeholder="类型"
- :default-value="{ key: '1' }">
+ :default-value="{ key: '1' }"
+ >
<a-select-option :value="1">扩大配资</a-select-option>
<a-select-option :value="2">追加保证金</a-select-option>
<a-select-option :value="3">续期</a-select-option>
@@ -24,9 +25,10 @@
</a-select>
<a-select
v-model="queryParam.status"
- style="width: 140px;margin-left: 10px;"
+ style="width: 140px; margin-left: 10px"
placeholder="类型"
- :default-value="{ key: '0' }">
+ :default-value="{ key: '0' }"
+ >
<a-select-option :value="0">申请列表</a-select-option>
<a-select-option :value="1">记录列表</a-select-option>
</a-select>
@@ -36,20 +38,15 @@
<template>
<a-col :md="24" :xxl="6" :sm="24">
<a-form-item>
- <span class="table-page-search-submitButtons" style="white-space:wrap">
- <a-button
- type="primary"
- icon="search"
- @click="queryParam.pageNum = 1, getlist()">查询
+ <span class="table-page-search-submitButtons" style="white-space: wrap">
+ <a-button type="primary" icon="search" @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
- <a-button @click="getqueryParam" style="margin-left: 8px" icon="redo">
- 重置</a-button>
-
+ <a-button @click="getqueryParam" style="margin-left: 8px" icon="redo"> 重置</a-button>
</span>
</a-form-item>
</a-col>
</template>
-
</a-row>
</a-form>
</div>
@@ -63,48 +60,55 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2400 }">
- <span slot="fundsType" slot-scope="text,record">
+ :scroll="{ x: 2400 }"
+ >
+ <span slot="fundsType" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.fundsType == 0 ? 'blue' : record.fundsType == 1 ? 'green' : 'red'">{{
- record.fundsType | statusFilter
- }}
+ <a-tag :color="record.fundsType == 0 ? 'blue' : record.fundsType == 1 ? 'green' : 'red'"
+ >{{ record.fundsType | statusFilter }}
</a-tag>
</div>
</template>
</span>
- <span slot="status" slot-scope="text,record">
+ <span slot="status" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.status == 0 ? 'blue' : record.status == 1 ? 'green' : 'red'">{{
- record.status == 0 ? '审核中' : record.status == 1 ? '已通过' : '未通过'
- }}
+ <a-tag :color="record.status == 0 ? 'blue' : record.status == 1 ? 'green' : 'red'"
+ >{{ record.status == 0 ? '审核中' : record.status == 1 ? '已通过' : '未通过' }}
</a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a
slot="action"
href="javascript:;"
@click="onUser(record)"
- v-if="record.status == 0 && record.appendType == 1">扩大资金修改</a>
+ v-if="record.status == 0 && record.appendType == 1"
+ >扩大资金修改</a
+ >
<a
slot="action"
href="javascript:;"
@click="onUser(record)"
- v-if="record.status == 0 && record.appendType == 2">追加保证金修改</a>
+ v-if="record.status == 0 && record.appendType == 2"
+ >追加保证金修改</a
+ >
<a
slot="action"
href="javascript:;"
@click="onUser(record)"
- v-if="record.status == 0 && record.appendType == 3">续期修改</a>
+ v-if="record.status == 0 && record.appendType == 3"
+ >续期修改</a
+ >
<a
slot="action"
href="javascript:;"
@click="onUser(record)"
- v-if="record.status == 0 && record.appendType == 4">终止操盘修改</a>
+ v-if="record.status == 0 && record.appendType == 4"
+ >终止操盘修改</a
+ >
</template>
</a-table>
</a-card>
@@ -114,29 +118,21 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-descriptions bordered :column="{ xxl: 3, xl: 3, lg: 3, md: 3, sm: 2, xs: 1 }">
- <a-descriptions-item label="用户应交总费用">
- ¥{{ modeldetail.payAmount }}
- </a-descriptions-item>
- <a-descriptions-item label="审核前配资金额">
- ¥{{ modeldetail.fundsAmount }}
- </a-descriptions-item>
- <a-descriptions-item label="审核后配资金额">
- ¥{{ modeldetail.fundsAmount }}
- </a-descriptions-item>
- <a-descriptions-item label="审核前操盘总金额">
- ¥{{ modeldetail.totalTradingAmount }}
- </a-descriptions-item>
- <a-descriptions-item label="审核后操盘总金额">
- ¥{{ modeldetail.totalTradingAmount }}
- </a-descriptions-item>
+ <a-descriptions-item label="用户应交总费用"> ¥{{ modeldetail.payAmount }} </a-descriptions-item>
+ <a-descriptions-item label="审核前配资金额"> ¥{{ modeldetail.fundsAmount }} </a-descriptions-item>
+ <a-descriptions-item label="审核后配资金额"> ¥{{ modeldetail.fundsAmount }} </a-descriptions-item>
+ <a-descriptions-item label="审核前操盘总金额"> ¥{{ modeldetail.totalTradingAmount }} </a-descriptions-item>
+ <a-descriptions-item label="审核后操盘总金额"> ¥{{ modeldetail.totalTradingAmount }} </a-descriptions-item>
</a-descriptions>
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="审核状态">
<a-select
placeholder="请选择审核状态"
- v-decorator="['status', { rules: [{ required: true, message: '请选择审核状态', }] }]">
+ v-decorator="['status', { rules: [{ required: true, message: '请选择审核状态' }] }]"
+ >
<a-select-option value="1">审核通过</a-select-option>
<a-select-option value="2">未通过</a-select-option>
</a-select>
@@ -149,244 +145,243 @@
import { getAppendList, applygetAppendDetail, applysaveAppendApply } from '@/api/allotment'
import moment from 'moment'
export default {
- name: 'Setting',
- data () {
- return {
- columns: [
- {
- title: '配资人',
- dataIndex: 'userName',
- align: 'center',
- width: 150,
- fixed: 'left'
- },
- {
- title: '手机号',
- dataIndex: 'userPhone',
- align: 'center',
- width: 150,
- fixed: 'left'
- },
- {
- title: '申请时长(天)',
- dataIndex: 'appendCycle',
- align: 'center',
- customRender: (text, row, index) => {
- return this.queryParam.appendType == 3 ? text : '--'
- }
- },
- {
- title: '申请服务费',
- dataIndex: 'appendServiceFee',
- align: 'center',
- customRender: (text, row, index) => {
- return (this.queryParam.appendType != 2) ? text : '--'
- }
- },
- {
- title: '原保证金',
- dataIndex: 'margin',
- align: 'center'
- },
- {
- title: '追加保证金',
- dataIndex: 'appendMargin',
- align: 'center',
- customRender: (text, row, index) => {
- return this.queryParam.appendType == 2 ? text : '--'
- }
- },
- {
- title: '原操盘金额',
- dataIndex: 'totalTradingAmount',
- align: 'center'
- },
- {
- title: '配资倍数',
- dataIndex: 'lever',
- align: 'center'
- },
+ name: 'Setting',
+ data() {
+ return {
+ columns: [
+ {
+ title: '配资人',
+ dataIndex: 'userName',
+ align: 'center',
+ width: 150,
+ fixed: 'left',
+ },
+ {
+ title: '手机号',
+ dataIndex: 'userPhone',
+ align: 'center',
+ width: 150,
+ fixed: 'left',
+ },
+ {
+ title: '申请时长(天)',
+ dataIndex: 'appendCycle',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return this.queryParam.appendType == 3 ? text : '--'
+ },
+ },
+ {
+ title: '申请服务费',
+ dataIndex: 'appendServiceFee',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return this.queryParam.appendType != 2 ? text : '--'
+ },
+ },
+ {
+ title: '原保证金',
+ dataIndex: 'margin',
+ align: 'center',
+ },
+ {
+ title: '追加保证金',
+ dataIndex: 'appendMargin',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return this.queryParam.appendType == 2 ? text : '--'
+ },
+ },
+ {
+ title: '原操盘金额',
+ dataIndex: 'totalTradingAmount',
+ align: 'center',
+ },
+ {
+ title: '配资倍数',
+ dataIndex: 'lever',
+ align: 'center',
+ },
- {
- title: '配资金额',
- dataIndex: 'fundsAmount',
- align: 'center'
- },
- {
- title: '预警线',
- dataIndex: 'lineWarning',
- align: 'center'
- },
- {
- title: '止损线',
- dataIndex: 'lineUnwind',
- align: 'center'
- },
- {
- title: '使用时长',
- dataIndex: 'tradersCycle',
- align: 'center'
- },
- {
- title: '配资类型',
- dataIndex: 'fundsType',
- align: 'center',
- scopedSlots: { customRender: 'fundsType' }
- },
- {
- title: '状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '申请时间',
- dataIndex: 'addTime',
- align: 'center',
- width: 200,
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '终止时间',
- dataIndex: 'endTime',
- align: 'center',
- width: 200,
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- width: 150,
- fixed: 'right',
- 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,
- keyword: '',
- status: 0,
- appendType: 1
- },
- datalist: [],
- currentDetails: '',
- auditTitle: '',
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false,
- modeldetail: ''
- }
- },
- created () {
- this.getlist()
- },
- watch: {
- currentDetails (val) {
- if (this.currentDetails.appendType == 2) {
- this.auditTitle = '追加保证金审核'
- } else if (this.currentDetails.appendType == 3) {
- this.auditTitle = '续期审核'
- } else if (this.currentDetails.appendType == 4) {
- this.auditTitle = '终止操盘审核'
- } else {
- this.auditTitle = '扩大配资审核'
- }
- }
- },
- filters: {
- statusFilter (status) {
- return status == 2 ? '按周配资' : status == 3 ? '按月配资' : '按天配资'
- }
- },
- methods: {
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
- this.currentDetails = ''
- this.modeldetail = ''
+ {
+ title: '配资金额',
+ dataIndex: 'fundsAmount',
+ align: 'center',
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- values.id = this.currentDetails.id
- values.applyId = this.currentDetails.applyId
- applysaveAppendApply(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '预警线',
+ dataIndex: 'lineWarning',
+ align: 'center',
},
- onUser (val) {
- this.currentDetails = val
- this.applydetail()
+ {
+ title: '止损线',
+ dataIndex: 'lineUnwind',
+ align: 'center',
},
- applydetail () {
- var data = {
- id: this.currentDetails.id
- }
- applygetAppendDetail(data).then(res => {
- if (res.status == 0) {
- this.modeldetail = res.data
- this.addUserdialog = true
- }
- })
+ {
+ title: '使用时长',
+ dataIndex: 'tradersCycle',
+ align: 'center',
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- keyword: '',
- status: 0,
- appendType: 1
- }
+ {
+ title: '配资类型',
+ dataIndex: 'fundsType',
+ align: 'center',
+ scopedSlots: { customRender: 'fundsType' },
},
- getlist () {
- var that = this
- this.loading = true
- getAppendList(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
+ {
+ title: '状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '申请时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ width: 200,
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '终止时间',
+ dataIndex: 'endTime',
+ align: 'center',
+ width: 200,
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ width: 150,
+ fixed: 'right',
+ 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,
+ keyword: '',
+ status: 0,
+ appendType: 1,
+ },
+ datalist: [],
+ currentDetails: '',
+ auditTitle: '',
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
+ modeldetail: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ watch: {
+ currentDetails(val) {
+ if (this.currentDetails.appendType == 2) {
+ this.auditTitle = '追加保证金审核'
+ } else if (this.currentDetails.appendType == 3) {
+ this.auditTitle = '续期审核'
+ } else if (this.currentDetails.appendType == 4) {
+ this.auditTitle = '终止操盘审核'
+ } else {
+ this.auditTitle = '扩大配资审核'
+ }
+ },
+ },
+ filters: {
+ statusFilter(status) {
+ return status == 2 ? '按周配资' : status == 3 ? '按月配资' : '按天配资'
+ },
+ },
+ methods: {
+ CanceladdUserdialog() {
+ this.addUserdialog = false
+ const form = this.$refs.addUserform.form
+ form.resetFields()
+ this.currentDetails = ''
+ this.modeldetail = ''
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ values.id = this.currentDetails.id
+ values.applyId = this.currentDetails.applyId
+ applysaveAppendApply(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
+ })
+ }
+ })
+ },
+ onUser(val) {
+ this.currentDetails = val
+ this.applydetail()
+ },
+ applydetail() {
+ var data = {
+ id: this.currentDetails.id,
+ }
+ applygetAppendDetail(data).then((res) => {
+ if (res.status == 0) {
+ this.modeldetail = res.data
+ this.addUserdialog = true
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ keyword: '',
+ status: 0,
+ appendType: 1,
+ }
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ getAppendList(this.queryParam).then((res) => {
+ this.datalist = res.data.list
+ this.pagination.total = res.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/allotment/leversetting.vue b/src/views/allotment/leversetting.vue
index 7f634f4..a0e45bb 100644
--- a/src/views/allotment/leversetting.vue
+++ b/src/views/allotment/leversetting.vue
@@ -2,7 +2,15 @@
<page-header-wrapper>
<a-card :bordered="false">
<div class="table-operator">
- <a-button type="primary" icon="plus" @click="addUserdialog = true; currentDetails = ''">添加杠杆</a-button>
+ <a-button
+ type="primary"
+ icon="plus"
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >添加杠杆</a-button
+ >
</div>
</a-card>
@@ -13,26 +21,25 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="cycle_type" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="cycle_type" slot-scope="text, record">
<template>
<div>
- <a-tag
- :color="record.cycle_type == 2 ? 'green' : record.cycle_type == 3 ? 'orange' : 'blue'">
+ <a-tag :color="record.cycle_type == 2 ? 'green' : record.cycle_type == 3 ? 'orange' : 'blue'">
{{ record.cycle_type | statusFilter }}
</a-tag>
</div>
</template>
</span>
- <span slot="status" slot-scope="text,record">
+ <span slot="status" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '停用' : '启用' }}
- </a-tag>
+ <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '停用' : '启用' }} </a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditganggan(record)">修改杠杆</a>
</template>
</a-table>
@@ -44,19 +51,22 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="配置周期类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择配置周期类型"
- v-decorator="['cycleType', { rules: [{ required: true, message: '请选择配置周期类型', }] }]">
+ v-decorator="['cycleType', { rules: [{ required: true, message: '请选择配置周期类型' }] }]"
+ >
<a-select-option :value="1">按天配置</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="杠杆" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择杠杆"
- v-decorator="['lever', { rules: [{ required: true, message: '请选择杠杆', }] }]">
+ v-decorator="['lever', { rules: [{ required: true, message: '请选择杠杆' }] }]"
+ >
<a-select-option :value="1">1倍</a-select-option>
<a-select-option :value="2">2倍</a-select-option>
<a-select-option :value="3">3倍</a-select-option>
@@ -73,19 +83,22 @@
<a-form-item label="管理费率" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入管理费率"
- v-decorator="['manageRate', { rules: [{ required: true, message: '请输入管理费率', }] }]" />
+ v-decorator="['manageRate', { rules: [{ required: true, message: '请输入管理费率' }] }]"
+ />
<span>管理费率%,如:0.25</span>
</a-form-item>
<a-form-item label="单股持仓比例" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入单股持仓比例"
- v-decorator="['singleHoldingRatio', { rules: [{ required: true, message: '请输入单股持仓比例', }] }]" />
+ v-decorator="['singleHoldingRatio', { rules: [{ required: true, message: '请输入单股持仓比例' }] }]"
+ />
<span>单股持仓比例,如:0.85</span>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择配置周期类型"
- v-decorator="['status', { rules: [{ required: true, message: '请选择配置周期类型', }] }]">
+ 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>
@@ -99,147 +112,147 @@
import pick from 'lodash.pick'
import moment from 'moment'
export default {
- name: 'Leversetting',
- data () {
- return {
- columns: [
- {
- title: '杠杆(倍数)',
- dataIndex: 'lever',
- align: 'center'
- },
- {
- title: '管理费率(%)',
- dataIndex: 'manageRate',
- align: 'center'
- },
- {
- title: '单股持仓比例(%)',
- dataIndex: 'singleHoldingRatio',
- align: 'center'
- },
- {
- title: '周期类型',
- dataIndex: 'cycle_type',
- align: 'center',
- scopedSlots: { customRender: 'cycle_type' }
- },
- {
- title: '配资状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- 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
- },
- datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- fields: ['cycleType', 'lever', 'manageRate', 'singleHoldingRatio', 'status'],
- currentDetails: ''
- }
- },
- created () {
- this.getlist()
- },
- filters: {
- statusFilter (status) {
- return status == 2 ? '按周配资' : status == 3 ? '按月配资' : '按天配资'
- }
- },
- methods: {
- geteditganggan (val) {
- this.currentDetails = val
- this.addUserdialog = true
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(val, this.fields))
+ name: 'Leversetting',
+ data() {
+ return {
+ columns: [
+ {
+ title: '杠杆(倍数)',
+ dataIndex: 'lever',
+ align: 'center',
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '管理费率(%)',
+ dataIndex: 'manageRate',
+ align: 'center',
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- } else {
- values.id = 0
- }
- fundssaveFundsLever(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.data.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '单股持仓比例(%)',
+ dataIndex: 'singleHoldingRatio',
+ align: 'center',
},
- getlist () {
- var that = this
- this.loading = true
- getFundsLeverList(this.queryParam).then(res => {
- this.datalist = res.data.data.list
- this.pagination.total = res.data.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
+ {
+ title: '周期类型',
+ dataIndex: 'cycle_type',
+ align: 'center',
+ scopedSlots: { customRender: 'cycle_type' },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '配资状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ 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,
+ },
+ datalist: [],
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ fields: ['cycleType', 'lever', 'manageRate', 'singleHoldingRatio', 'status'],
+ currentDetails: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ filters: {
+ statusFilter(status) {
+ return status == 2 ? '按周配资' : status == 3 ? '按月配资' : '按天配资'
+ },
+ },
+ methods: {
+ geteditganggan(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ } else {
+ values.id = 0
+ }
+ fundssaveFundsLever(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: res.data.msg, duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ getFundsLeverList(this.queryParam).then((res) => {
+ this.datalist = res.data.data.list
+ this.pagination.total = res.data.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/allotment/securities.vue b/src/views/allotment/securities.vue
index 8b80435..7f4fcee 100644
--- a/src/views/allotment/securities.vue
+++ b/src/views/allotment/securities.vue
@@ -6,31 +6,32 @@
<a-row :gutter="48">
<a-col :md="6" :sm="24">
<a-form-item label="关键词查询">
- <a-input
- v-model="queryParam.keyword"
- style="width: 100%"
- placeholder="证券公司/证券营业部/证券账户" />
+ <a-input v-model="queryParam.keyword" style="width: 100%" placeholder="证券公司/证券营业部/证券账户" />
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item>
<span class="table-page-search-submitButtons">
- <a-button @click="getqueryParam" icon="redo">
- 重置</a-button>
+ <a-button @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true; currentDetails = ''">
- 添加证券信息</a-button>
-
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >
+ 添加证券信息</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -46,16 +47,16 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="status" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="status" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '停用' : '启用' }}
- </a-tag>
+ <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '停用' : '启用' }} </a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditbroker(record)">修改证券信息</a>
</template>
</a-table>
@@ -67,13 +68,15 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="证券机构" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择证券机构"
- v-decorator="['dealerInstitutionsName', { rules: [{ required: true, message: '请选择证券机构', }] }]"
- @change="getdealerchange">
+ v-decorator="['dealerInstitutionsName', { rules: [{ required: true, message: '请选择证券机构' }] }]"
+ @change="getdealerchange"
+ >
<a-select-option v-for="item in dealerList" :key="item.id" :value="item.dealerName">
{{ item.dealerName }}
</a-select-option>
@@ -82,42 +85,50 @@
<a-form-item label="证券营业部" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入证券营业部"
- v-decorator="['salesDepartment', { rules: [{ required: true, message: '请输入证券营业部', }] }]" />
+ v-decorator="['salesDepartment', { rules: [{ required: true, message: '请输入证券营业部' }] }]"
+ />
</a-form-item>
<a-form-item label="证券账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入证券账户"
- v-decorator="['accountName', { rules: [{ required: true, message: '请输入证券账户', }] }]" />
+ v-decorator="['accountName', { rules: [{ required: true, message: '请输入证券账户' }] }]"
+ />
</a-form-item>
<a-form-item label="交易通账户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入交易通账户"
- v-decorator="['transactAccount', { rules: [{ required: true, message: '请输入交易通账户', }] }]" />
+ v-decorator="['transactAccount', { rules: [{ required: true, message: '请输入交易通账户' }] }]"
+ />
</a-form-item>
<a-form-item label="交易通密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入交易通密码"
- v-decorator="['transactPassword', { rules: [{ required: true, message: '请输入交易通密码', }] }]" />
+ v-decorator="['transactPassword', { rules: [{ required: true, message: '请输入交易通密码' }] }]"
+ />
</a-form-item>
<a-form-item label="通讯密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入通讯密码"
- v-decorator="['communicationPassword', { rules: [{ required: true, message: '请输入通讯密码', }] }]" />
+ v-decorator="['communicationPassword', { rules: [{ required: true, message: '请输入通讯密码' }] }]"
+ />
</a-form-item>
<a-form-item label="佣金比例" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入佣金比例"
- v-decorator="['commissionRatio', { rules: [{ required: true, message: '佣金比例,0.005代表千分之五', }] }]" />
+ v-decorator="['commissionRatio', { rules: [{ required: true, message: '佣金比例,0.005代表千分之五' }] }]"
+ />
</a-form-item>
<a-form-item label="最低佣金" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入最低佣金"
- v-decorator="['minimumCommissions', { rules: [{ required: true, message: '请输入最低佣金', }] }]" />
+ v-decorator="['minimumCommissions', { rules: [{ required: true, message: '请输入最低佣金' }] }]"
+ />
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择状态"
- v-decorator="['status', { rules: [{ required: true, message: '请选择状态', }] }]">
+ 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>
@@ -131,163 +142,176 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Setting',
- data () {
- return {
- columns: [
- {
- title: '证券机构名称',
- dataIndex: 'dealerInstitutionsName',
- align: 'center'
- },
- {
- title: '证券营业部',
- dataIndex: 'salesDepartment',
- align: 'center'
- },
- {
- title: '证券账户',
- dataIndex: 'accountName',
- align: 'center'
- },
- {
- title: '交易通账户',
- dataIndex: 'transactAccount',
- align: 'center'
- },
- {
- title: '状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- 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,
- keyword: ''
- },
- datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- fields: ['dealerInstitutionsName', 'dealerInstitutionsId', 'salesDepartment', 'accountName', 'transactAccount', 'transactPassword', 'communicationPassword', 'commissionRatio', 'minimumCommissions', 'status'],
- currentDetails: '',
- dealerList: [],
- dealerInstitutionsId: ''
- }
- },
- created () {
- this.getlist()
- this.getDealerlist()
- },
- methods: {
- getdealerchange (value, option) {
- this.dealerInstitutionsId = option.key
+ name: 'Setting',
+ data() {
+ return {
+ columns: [
+ {
+ title: '证券机构名称',
+ dataIndex: 'dealerInstitutionsName',
+ align: 'center',
},
- getDealerlist () {
- getDealerInstitutionsList({ status: 1 }).then(res => {
- if (res.status == 0) {
- this.dealerList = res.data.data.list
- }
- })
+ {
+ title: '证券营业部',
+ dataIndex: 'salesDepartment',
+ align: 'center',
},
- geteditbroker (val) {
- this.currentDetails = val
- this.addUserdialog = true
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(val, this.fields))
+ {
+ title: '证券账户',
+ dataIndex: 'accountName',
+ align: 'center',
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '交易通账户',
+ dataIndex: 'transactAccount',
+ align: 'center',
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- } else {
- values.id = 0
- }
- this.dealerInstitutionsId ? values.dealerInstitutionsId = this.dealerInstitutionsId : values.dealerInstitutionsId
- saveSecuritiesInfo(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.data.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- keyword: ''
- }
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
},
- getlist () {
- var that = this
- this.loading = true
- getSecuritiesInfoList(this.queryParam).then(res => {
- this.datalist = res.data.data.list
- this.pagination.total = res.data.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: { customRender: 'action' },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
- },
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ ],
+ // 表头
+ 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,
+ keyword: '',
+ },
+ datalist: [],
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ fields: [
+ 'dealerInstitutionsName',
+ 'dealerInstitutionsId',
+ 'salesDepartment',
+ 'accountName',
+ 'transactAccount',
+ 'transactPassword',
+ 'communicationPassword',
+ 'commissionRatio',
+ 'minimumCommissions',
+ 'status',
+ ],
+ currentDetails: '',
+ dealerList: [],
+ dealerInstitutionsId: '',
}
+ },
+ created() {
+ this.getlist()
+ this.getDealerlist()
+ },
+ methods: {
+ getdealerchange(value, option) {
+ this.dealerInstitutionsId = option.key
+ },
+ getDealerlist() {
+ getDealerInstitutionsList({ status: 1 }).then((res) => {
+ if (res.status == 0) {
+ this.dealerList = res.data.data.list
+ }
+ })
+ },
+ geteditbroker(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ } else {
+ values.id = 0
+ }
+ this.dealerInstitutionsId
+ ? (values.dealerInstitutionsId = this.dealerInstitutionsId)
+ : values.dealerInstitutionsId
+ saveSecuritiesInfo(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: res.data.msg, duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ keyword: '',
+ }
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ getSecuritiesInfoList(this.queryParam).then((res) => {
+ this.datalist = res.data.data.list
+ this.pagination.total = res.data.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/allotment/transactionAccount.vue b/src/views/allotment/transactionAccount.vue
index 34ddfe3..00475b3 100644
--- a/src/views/allotment/transactionAccount.vue
+++ b/src/views/allotment/transactionAccount.vue
@@ -6,27 +6,24 @@
<a-row :gutter="48">
<a-col :md="6" :sm="24">
<a-form-item label="关键词查询">
- <a-input
- v-model="queryParam.keyword"
- style="width: 100%"
- placeholder="请输入子账户名称/证券机构名称" />
+ <a-input v-model="queryParam.keyword" style="width: 100%" placeholder="请输入子账户名称/证券机构名称" />
</a-form-item>
</a-col>
<a-col :md="12" :sm="24">
<a-form-item>
<span class="table-page-search-submitButtons">
- <a-button @click="getqueryParam" icon="redo">
- 重置</a-button>
+ <a-button @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
<a-button type="primary" icon="plus" style="margin-left: 8px" @click="getaddjiaoyi">
- 添加交易账户</a-button>
-
+ 添加交易账户</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -42,21 +39,17 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="status" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="status" slot-scope="text, record">
<template>
<div>
- <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '未用' : '已用' }}
- </a-tag>
+ <a-tag :color="record.status == 0 ? 'red' : 'green'">{{ record.status == 0 ? '未用' : '已用' }} </a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
- <a
- slot="action"
- href="javascript:;"
- @click="geteditbroker(record)"
- v-if="record.status == 0">修改交易账户</a>
+ <template slot="action" slot-scope="text, record">
+ <a slot="action" href="javascript:;" @click="geteditbroker(record)" v-if="record.status == 0">修改交易账户</a>
</template>
</a-table>
</a-card>
@@ -67,13 +60,15 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="证券机构" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择证券机构"
- v-decorator="['dealerInstitutionsId', { rules: [{ required: true, message: '请选择证券机构', }] }]"
- @change="getdealerchange">
+ v-decorator="['dealerInstitutionsId', { rules: [{ required: true, message: '请选择证券机构' }] }]"
+ @change="getdealerchange"
+ >
<a-select-option v-for="item in dealerList" :key="item.id" :value="item.id">
{{ item.dealerInstitutionsName }}
</a-select-option>
@@ -82,27 +77,29 @@
<a-form-item label="证券账户名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请先选择证券机构"
- v-decorator="['accountName', { rules: [{ required: true, message: '请先选择证券机构', }] }]"
- disabled />
+ v-decorator="['accountName', { rules: [{ required: true, message: '请先选择证券机构' }] }]"
+ disabled
+ />
</a-form-item>
<a-form-item label="子账户名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入子账户名称"
- v-decorator="['subaccountNumber', { rules: [{ required: true, message: '请输入子账户名称', }] }]"
- disabled />
- <span>
- 系统自动生成不允许修改
- </span>
+ v-decorator="['subaccountNumber', { rules: [{ required: true, message: '请输入子账户名称' }] }]"
+ disabled
+ />
+ <span> 系统自动生成不允许修改 </span>
</a-form-item>
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea
placeholder="请输入备注"
- v-decorator="['remarks', { rules: [{ required: true, message: '请输入备注', }] }]" />
+ v-decorator="['remarks', { rules: [{ required: true, message: '请输入备注' }] }]"
+ />
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择状态"
- v-decorator="['status', { rules: [{ required: true, message: '请选择状态', }] }]">
+ 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>
@@ -112,180 +109,194 @@
</page-header-wrapper>
</template>
<script>
-import { getTradingAccountList, getSecuritiesEnabledList, saveTradingAccount, dealergetMaxNumber } from '@/api/allotment'
+import {
+ getTradingAccountList,
+ getSecuritiesEnabledList,
+ saveTradingAccount,
+ dealergetMaxNumber,
+} from '@/api/allotment'
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Setting',
- data () {
- return {
- columns: [
- {
- title: '证券机构名称',
- dataIndex: 'dealerInstitutionsName',
- align: 'center'
- },
- {
- title: '证券账户名',
- dataIndex: 'accountName',
- align: 'center'
- },
- {
- title: '子账户名称',
- dataIndex: 'subaccountNumber',
- align: 'center'
- },
- {
- title: '状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- 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,
- keyword: ''
- },
- datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- fields: ['dealerInstitutionsId', 'dealerInstitutionsName', 'accountName', 'subaccountNumber', 'status', 'remarks'],
- currentDetails: '',
- dealerList: []
- }
- },
- created () {
- this.getlist()
- this.getDealerlist()
- },
- methods: {
- getaddjiaoyi () {
- this.addUserdialog = true
- this.currentDetails = ''
- dealergetMaxNumber().then(res => {
- if (res.status == 0) {
- this.addUserform.setFieldsValue({ subaccountNumber: res.data })
- }
- })
+ name: 'Setting',
+ data() {
+ return {
+ columns: [
+ {
+ title: '证券机构名称',
+ dataIndex: 'dealerInstitutionsName',
+ align: 'center',
},
- getdealerchange (value, option) {
- console.log(value, option)
- this.dealerInstitutionsId = option.key
- var index = this.dealerList.findIndex(item => {
- if (item.id == option.key) {
- return true
- }
- })
- this.dealerInstitutionsName = this.dealerList[index].dealerInstitutionsName
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick({ dealerInstitutionsName: this.dealerList[index].dealerInstitutionsName }, this.fields))
- this.addUserform.setFieldsValue(pick({ accountName: this.dealerList[index].accountName }, this.fields))
+ {
+ title: '证券账户名',
+ dataIndex: 'accountName',
+ align: 'center',
},
- getDealerlist () {
- getSecuritiesEnabledList().then(res => {
- if (res.status == 0) {
- this.dealerList = res.data.data.list
- }
- })
+ {
+ title: '子账户名称',
+ dataIndex: 'subaccountNumber',
+ align: 'center',
},
- geteditbroker (val) {
- this.currentDetails = val
- this.addUserdialog = true
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(val, this.fields))
+ {
+ title: '状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- } else {
- values.id = 0
- values.dealerInstitutionsName = this.dealerInstitutionsName
- }
- saveTradingAccount(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.data.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: { customRender: 'action' },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- keyword: ''
- }
- },
- getlist () {
- var that = this
- this.loading = true
- getTradingAccountList(this.queryParam).then(res => {
- this.datalist = res.data.data.list
- this.pagination.total = res.data.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- },
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
- },
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ ],
+ // 表头
+ 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,
+ keyword: '',
+ },
+ datalist: [],
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ fields: [
+ 'dealerInstitutionsId',
+ 'dealerInstitutionsName',
+ 'accountName',
+ 'subaccountNumber',
+ 'status',
+ 'remarks',
+ ],
+ currentDetails: '',
+ dealerList: [],
}
+ },
+ created() {
+ this.getlist()
+ this.getDealerlist()
+ },
+ methods: {
+ getaddjiaoyi() {
+ this.addUserdialog = true
+ this.currentDetails = ''
+ dealergetMaxNumber().then((res) => {
+ if (res.status == 0) {
+ this.addUserform.setFieldsValue({ subaccountNumber: res.data })
+ }
+ })
+ },
+ getdealerchange(value, option) {
+ console.log(value, option)
+ this.dealerInstitutionsId = option.key
+ var index = this.dealerList.findIndex((item) => {
+ if (item.id == option.key) {
+ return true
+ }
+ })
+ this.dealerInstitutionsName = this.dealerList[index].dealerInstitutionsName
+ this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
+ this.addUserform.setFieldsValue(
+ pick({ dealerInstitutionsName: this.dealerList[index].dealerInstitutionsName }, this.fields)
+ )
+ this.addUserform.setFieldsValue(pick({ accountName: this.dealerList[index].accountName }, this.fields))
+ },
+ getDealerlist() {
+ getSecuritiesEnabledList().then((res) => {
+ if (res.status == 0) {
+ this.dealerList = res.data.data.list
+ }
+ })
+ },
+ geteditbroker(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ } else {
+ values.id = 0
+ values.dealerInstitutionsName = this.dealerInstitutionsName
+ }
+ saveTradingAccount(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: res.data.msg, duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ keyword: '',
+ }
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ getTradingAccountList(this.queryParam).then((res) => {
+ this.datalist = res.data.data.list
+ this.pagination.total = res.data.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/allsetting/bannersetting.vue b/src/views/allsetting/bannersetting.vue
index d259e2b..64332cd 100644
--- a/src/views/allsetting/bannersetting.vue
+++ b/src/views/allsetting/bannersetting.vue
@@ -11,8 +11,13 @@
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true; currentDetails = ''">
- 添加轮播图</a-button>
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >
+ 添加轮播图</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -28,11 +33,11 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
-
+ rowKey="id"
+ >
<span slot="bannerUrl" slot-scope="text">
<template>
- <img :src="text" alt="" style="width:120px;height: 50px;">
+ <img :src="text" alt="" style="width: 120px; height: 50px" />
</template>
</span>
<span slot="isPc" slot-scope="text">
@@ -54,7 +59,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditbaseCurrency(record)">修改轮播图</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="deletebaseCurrency(record.id)">删除轮播图</a>
@@ -68,40 +73,32 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入排序"
- v-decorator="['isOrder', { rules: [{ required: true, message: '排序值越大显示越靠前', }] }]" />
+ v-decorator="['isOrder', { rules: [{ required: true, message: '排序值越大显示越靠前' }] }]"
+ />
</a-form-item>
<a-form-item label="标题" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input
- placeholder="请输入标题"
- v-decorator="['banTitle', { }]" />
+ <a-input placeholder="请输入标题" v-decorator="['banTitle', {}]" />
</a-form-item>
<a-form-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input
- placeholder="请输入描述"
- v-decorator="['banDesc', { }]" />
+ <a-input placeholder="请输入描述" v-decorator="['banDesc', {}]" />
</a-form-item>
<a-form-item label="链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input
- placeholder="请输入链接"
- v-decorator="['targetUrl', {}]" />
+ <a-input placeholder="请输入链接" v-decorator="['targetUrl', {}]" />
</a-form-item>
<a-form-item label="PC端是否显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select
- placeholder="请选择显示状态"
- v-decorator="['isPc', { }]">
+ <a-select placeholder="请选择显示状态" v-decorator="['isPc', {}]">
<a-select-option :value="0">显示</a-select-option>
<a-select-option :value="1">隐藏</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="移动端是否显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select
- placeholder="请选择显示状态"
- v-decorator="['isM', {}]">
+ <a-select placeholder="请选择显示状态" v-decorator="['isM', {}]">
<a-select-option :value="0">显示</a-select-option>
<a-select-option :value="1">隐藏</a-select-option>
</a-select>
@@ -110,13 +107,17 @@
<a-upload
name="avatar"
list-type="picture-card"
- style="width: 200px;"
+ style="width: 200px"
accept=".jpg,.jpeg,.png"
class="avatar-uploader"
- v-decorator="['bannerUrl', { valuePropName: 'file',rules: [{ required: true, message: '请上传轮播图图片', }] }]"
+ v-decorator="[
+ 'bannerUrl',
+ { valuePropName: 'file', rules: [{ required: true, message: '请上传轮播图图片' }] },
+ ]"
:showUploadList="false"
- :customRequest="customRequest">
- <img v-if="bannerUrl" :src="bannerUrl" alt="avatar" style="width: 100%;" />
+ :customRequest="customRequest"
+ >
+ <img v-if="bannerUrl" :src="bannerUrl" alt="avatar" style="width: 100%" />
<div v-else>
<a-icon :type="imgloading ? 'loading' : 'plus'" />
</div>
@@ -131,207 +132,207 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Basecurrency',
- data () {
- return {
- columns: [
- {
- title: '图片',
- dataIndex: 'bannerUrl',
- align: 'center',
- scopedSlots: { customRender: 'bannerUrl' }
- },
- {
- title: '排序',
- dataIndex: 'isOrder',
- align: 'center'
- },
- {
- title: 'PC是否显示',
- dataIndex: 'isPc',
- align: 'center',
- scopedSlots: { customRender: 'isPc' }
- },
- {
- title: '移动端是否显示',
- dataIndex: 'isM',
- align: 'center',
- scopedSlots: { customRender: 'isM' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- 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: 200,
- 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
- },
- datalist: [],
+ name: 'Basecurrency',
+ data() {
+ return {
+ columns: [
+ {
+ title: '图片',
+ dataIndex: 'bannerUrl',
+ align: 'center',
+ scopedSlots: { customRender: 'bannerUrl' },
+ },
+ {
+ title: '排序',
+ dataIndex: 'isOrder',
+ align: 'center',
+ },
+ {
+ title: 'PC是否显示',
+ dataIndex: 'isPc',
+ align: 'center',
+ scopedSlots: { customRender: 'isPc' },
+ },
+ {
+ title: '移动端是否显示',
+ dataIndex: 'isM',
+ align: 'center',
+ scopedSlots: { customRender: 'isM' },
+ },
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ 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: 200,
+ 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,
+ },
+ datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 5 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 18 }
- },
- fields: ['bannerUrl', 'isOrder', 'isPc', 'isM', 'banDesc', 'banTitle', 'targetUrl'],
- currentDetails: '',
- bannerUrl: '',
- imgloading: false
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- deletebaseCurrency (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除轮播图?此操作不可恢复',
- onOk () {
- var data = {
- id: val
- }
- bannersdelete(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
- },
- customRequest (data) {
- this.imgloading = true
- var formData = new FormData()
- formData.append('upload_file', data.file)
- adminupload(formData).then(res => {
- if (res.status == 0) {
- this.bannerUrl = res.data.url
- this.addUserform.setFieldsValue(({
- bannerUrl: res.data.url
- }))
- } else {
- this.$message.error({ content: '上传失败请检查图片类型!' })
- }
- this.imgloading = false
- })
- },
- geteditbaseCurrency (val) {
- this.currentDetails = val
- this.bannerUrl = val.bannerUrl
- this.addUserdialog = true
- 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()
- this.bannerUrl = ''
- },
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- console.log(values)
- bannersupdate(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '修改成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- } else {
- values.id = 0
- bannersadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '添加成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- this.bannerUrl = ''
- }
- })
- },
- getlist () {
- this.loading = true
- bannerslist(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()
- }
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 5 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 18 },
+ },
+ fields: ['bannerUrl', 'isOrder', 'isPc', 'isM', 'banDesc', 'banTitle', 'targetUrl'],
+ currentDetails: '',
+ bannerUrl: '',
+ imgloading: false,
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ deletebaseCurrency(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除轮播图?此操作不可恢复',
+ onOk() {
+ var data = {
+ id: val,
+ }
+ bannersdelete(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ customRequest(data) {
+ this.imgloading = true
+ var formData = new FormData()
+ formData.append('upload_file', data.file)
+ adminupload(formData).then((res) => {
+ if (res.status == 0) {
+ this.bannerUrl = res.data.url
+ this.addUserform.setFieldsValue({
+ bannerUrl: res.data.url,
+ })
+ } else {
+ this.$message.error({ content: '上传失败请检查图片类型!' })
+ }
+ this.imgloading = false
+ })
+ },
+ geteditbaseCurrency(val) {
+ this.currentDetails = val
+ this.bannerUrl = val.bannerUrl
+ this.addUserdialog = true
+ 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()
+ this.bannerUrl = ''
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ console.log(values)
+ bannersupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '修改成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ } else {
+ values.id = 0
+ bannersadd(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '添加成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ this.bannerUrl = ''
+ }
+ })
+ },
+ getlist() {
+ this.loading = true
+ bannerslist(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 lang="less">
.greens {
- color: #52c41a;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
-/deep/ .ant-upload.ant-upload-select-picture-card{
- width: 200px !important;
+/deep/ .ant-upload.ant-upload-select-picture-card {
+ width: 200px !important;
}
</style>
diff --git a/src/views/allsetting/noticesetting.vue b/src/views/allsetting/noticesetting.vue
index 4e16d55..3e7fc21 100644
--- a/src/views/allsetting/noticesetting.vue
+++ b/src/views/allsetting/noticesetting.vue
@@ -11,8 +11,13 @@
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true; currentDetails = ''">
- 添加公告</a-button>
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >
+ 添加公告</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -28,11 +33,11 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
-
+ rowKey="id"
+ >
<span slot="artImg" slot-scope="text">
<template>
- <img :src="text" alt="" style="width:80px">
+ <img :src="text" alt="" style="width: 80px" />
</template>
</span>
<span slot="isShow" slot-scope="text">
@@ -45,7 +50,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditbaseCurrency(record)">修改公告</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="deletebaseCurrency(record.id)">删除公告</a>
@@ -59,27 +64,32 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="公告标题" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入公告标题"
- v-decorator="['artTitle', { rules: [{ required: true, message: '请输入公告标题', }] }]" />
+ v-decorator="['artTitle', { rules: [{ required: true, message: '请输入公告标题' }] }]"
+ />
</a-form-item>
<a-form-item label="公告类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入公告类型"
- v-decorator="['artType', { rules: [{ required: true, message: '请输入公告类型', }] }]" />
+ v-decorator="['artType', { rules: [{ required: true, message: '请输入公告类型' }] }]"
+ />
</a-form-item>
<a-form-item label="公告来源" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入公告来源"
- v-decorator="['author', { rules: [{ required: true, message: '请输入公告来源', }] }]" />
+ v-decorator="['author', { rules: [{ required: true, message: '请输入公告来源' }] }]"
+ />
</a-form-item>
<a-form-item label="是否显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择是否显示"
- v-decorator="['isShow', { rules: [{ required: true, message: '请选择是否显示', }] }]">
+ v-decorator="['isShow', { rules: [{ required: true, message: '请选择是否显示' }] }]"
+ >
<a-select-option :value="0">显示</a-select-option>
<a-select-option :value="1">不显示</a-select-option>
</a-select>
@@ -88,19 +98,22 @@
<a-textarea
placeholder="请输入公告摘要"
:auto-size="{ minRows: 2, maxRows: 6 }"
- v-decorator="['artSummary', { rules: [{ required: true, message: '请输入公告摘要', }] }]" />
+ v-decorator="['artSummary', { rules: [{ required: true, message: '请输入公告摘要' }] }]"
+ />
</a-form-item>
<a-form-item label="公告内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea
placeholder="请输入公告内容"
:auto-size="{ minRows: 4, maxRows: 6 }"
- v-decorator="['artCnt', { rules: [{ required: true, message: '请输入公告内容', }] }]" />
+ v-decorator="['artCnt', { rules: [{ required: true, message: '请输入公告内容' }] }]"
+ />
</a-form-item>
<a-form-item label="公告链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea
placeholder="请输入公告链接"
:auto-size="{ minRows: 4, maxRows: 6 }"
- v-decorator="['spiderUrl', {}]" />
+ v-decorator="['spiderUrl', {}]"
+ />
</a-form-item>
<a-form-item label="公告图片" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-upload
@@ -110,8 +123,9 @@
class="avatar-uploader"
v-decorator="['artImg', { valuePropName: 'file' }]"
:showUploadList="false"
- :customRequest="customRequest">
- <img v-if="artImg" :src="artImg" alt="avatar" style="width: 100%;"/>
+ :customRequest="customRequest"
+ >
+ <img v-if="artImg" :src="artImg" alt="avatar" style="width: 100%" />
<div v-else>
<a-icon :type="imgloading ? 'loading' : 'plus'" />
</div>
@@ -126,211 +140,211 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Basecurrency',
- data () {
- return {
- columns: [
- {
- title: '公告id',
- dataIndex: 'id',
- align: 'center'
- },
- {
- title: '图片',
- dataIndex: 'artImg',
- align: 'center',
- scopedSlots: { customRender: 'artImg' }
- },
- {
- title: '公告标题',
- dataIndex: 'artTitle',
- align: 'center'
- },
- {
- title: '来源',
- dataIndex: 'author',
- align: 'center'
- },
- {
- title: '是否显示',
- dataIndex: 'isShow',
- align: 'center',
- scopedSlots: { customRender: 'isShow' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- 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: 180,
- 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
- },
- datalist: [],
+ name: 'Basecurrency',
+ data() {
+ return {
+ columns: [
+ {
+ title: '公告id',
+ dataIndex: 'id',
+ align: 'center',
+ },
+ {
+ title: '图片',
+ dataIndex: 'artImg',
+ align: 'center',
+ scopedSlots: { customRender: 'artImg' },
+ },
+ {
+ title: '公告标题',
+ dataIndex: 'artTitle',
+ align: 'center',
+ },
+ {
+ title: '来源',
+ dataIndex: 'author',
+ align: 'center',
+ },
+ {
+ title: '是否显示',
+ dataIndex: 'isShow',
+ align: 'center',
+ scopedSlots: { customRender: 'isShow' },
+ },
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ 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: 180,
+ 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,
+ },
+ datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 5 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 18 }
- },
- fields: ['artTitle', 'artType', 'author', 'artSummary', 'artCnt', 'spiderUrl', 'isShow', 'artImg'],
- currentDetails: '',
- artImg: '',
- imgloading: false
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- deletebaseCurrency (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除公告?此操作不可恢复',
- onOk () {
- var data = {
- artId: val
- }
- artdelArt(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
- },
- customRequest (data) {
- this.imgloading = true
- var formData = new FormData()
- formData.append('upload_file', data.file)
- adminupload(formData).then(res => {
- if (res.status == 0) {
- this.artImg = res.data.url
- this.addUserform.setFieldsValue(({
- artImg: res.data.url
- }))
- } else {
- this.$message.error({ content: '上传失败请检查图片类型!' })
- }
- this.imgloading = false
- })
- },
- geteditbaseCurrency (val) {
- this.currentDetails = val
- this.artImg = val.artImg
- this.addUserdialog = true
- 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()
- this.artImg = ''
- },
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- console.log(values)
- artupdate(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '修改成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- } else {
- values.id = 0
- artadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '添加成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- }
- })
- },
- getlist () {
- this.loading = true
- artlist(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()
- }
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 5 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 18 },
+ },
+ fields: ['artTitle', 'artType', 'author', 'artSummary', 'artCnt', 'spiderUrl', 'isShow', 'artImg'],
+ currentDetails: '',
+ artImg: '',
+ imgloading: false,
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ deletebaseCurrency(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除公告?此操作不可恢复',
+ onOk() {
+ var data = {
+ artId: val,
+ }
+ artdelArt(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ customRequest(data) {
+ this.imgloading = true
+ var formData = new FormData()
+ formData.append('upload_file', data.file)
+ adminupload(formData).then((res) => {
+ if (res.status == 0) {
+ this.artImg = res.data.url
+ this.addUserform.setFieldsValue({
+ artImg: res.data.url,
+ })
+ } else {
+ this.$message.error({ content: '上传失败请检查图片类型!' })
+ }
+ this.imgloading = false
+ })
+ },
+ geteditbaseCurrency(val) {
+ this.currentDetails = val
+ this.artImg = val.artImg
+ this.addUserdialog = true
+ 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()
+ this.artImg = ''
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ console.log(values)
+ artupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '修改成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ } else {
+ values.id = 0
+ artadd(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '添加成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ }
+ })
+ },
+ getlist() {
+ this.loading = true
+ artlist(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 lang="less" scoped>
.greens {
- color: #52c41a;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
-/deep/ .ant-upload.ant-upload-select-picture-card{
- width: 200px !important;
+/deep/ .ant-upload.ant-upload-select-picture-card {
+ width: 200px !important;
}
</style>
diff --git a/src/views/allsetting/paysetting.vue b/src/views/allsetting/paysetting.vue
index 88bc4ee..cb40da5 100644
--- a/src/views/allsetting/paysetting.vue
+++ b/src/views/allsetting/paysetting.vue
@@ -18,7 +18,7 @@
icon="search"
style="margin-left: 8px"
@click=";(queryParam.pageNum = 1), getlist()"
- >查询</a-button
+ >查询</a-button
>
<a-button
type="primary"
@@ -234,50 +234,50 @@
import pick from 'lodash.pick'
export default {
name: 'Basecurrency',
- data () {
+ data() {
return {
columns: [
{
title: '通道类型',
dataIndex: 'channelType',
- align: 'center'
+ align: 'center',
},
{
title: '图片',
dataIndex: 'channelImg',
align: 'center',
- scopedSlots: { customRender: 'channelImg' }
+ scopedSlots: { customRender: 'channelImg' },
},
{
title: '通道名字',
dataIndex: 'channelName',
- align: 'center'
+ align: 'center',
},
{
title: '账号',
dataIndex: 'channelAccount',
- align: 'center'
+ align: 'center',
},
{
title: '描述',
dataIndex: 'channelDesc',
- align: 'center'
+ align: 'center',
},
{
title: '最小充值金额',
dataIndex: 'channelMinLimit',
- align: 'center'
+ align: 'center',
},
{
title: '最大充值金额',
dataIndex: 'channelMaxLimit',
- align: 'center'
+ align: 'center',
},
{
title: '是否显示',
dataIndex: 'isShow',
align: 'center',
- scopedSlots: { customRender: 'isShow' }
+ scopedSlots: { customRender: 'isShow' },
},
{
title: '操作',
@@ -285,8 +285,8 @@
align: 'center',
fixed: 'right',
width: 200,
- scopedSlots: { customRender: 'action' }
- }
+ scopedSlots: { customRender: 'action' },
+ },
],
// 表头
pagination: {
@@ -296,13 +296,13 @@
pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
- showTotal: (total) => `共有 ${total} 条数据` // 分页中显示总的数据
+ showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据
},
loading: false,
queryParam: {
pageNum: 1,
pageSize: 10,
- channelType: ''
+ channelType: '',
},
datalist: [],
@@ -311,11 +311,11 @@
addUserform: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
- sm: { span: 6 }
+ sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
- sm: { span: 18 }
+ sm: { span: 18 },
},
fields: [
'channelType',
@@ -330,41 +330,41 @@
'assetsType',
'channelImg',
'code',
- 'formUrl'
+ 'formUrl',
],
currentDetails: '',
channelImg: '',
- imgloading: false
+ imgloading: false,
}
},
- created () {
+ created() {
this.getlist()
},
methods: {
- deletebaseCurrency (val) {
+ deletebaseCurrency(val) {
var that = this
this.$confirm({
title: '提示',
content: '确认删除该支付渠道?此操作不可恢复',
- onOk () {
+ onOk() {
var data = {
- cId: val
+ cId: val,
}
paydel(data).then((res) => {
if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
+ that.$message.success(res.msg)
that.getlist()
} else {
- that.$message.error({ content: res.msg })
+ that.$message.error(res.msg)
}
})
},
- onCancel () {
+ onCancel() {
console.log('Cancel')
- }
+ },
})
},
- customRequest (data) {
+ customRequest(data) {
this.imgloading = true
var formData = new FormData()
formData.append('upload_file', data.file)
@@ -372,7 +372,7 @@
if (res.status == 0) {
this.channelImg = res.data.url
this.addUserform.setFieldsValue({
- channelImg: res.data.url
+ channelImg: res.data.url,
})
} else {
this.$message.error({ content: '上传失败请检查图片类型!' })
@@ -380,20 +380,20 @@
this.imgloading = false
})
},
- geteditbaseCurrency (val) {
+ geteditbaseCurrency(val) {
this.currentDetails = val
this.channelImg = val.channelImg
this.addUserdialog = true
this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
this.addUserform.setFieldsValue(pick(val, this.fields))
},
- CanceladdUserdialog () {
+ CanceladdUserdialog() {
this.addUserdialog = false
const form = this.$refs.addUserform.form
form.resetFields()
this.channelImg = ''
},
- OkaddUserdialog () {
+ OkaddUserdialog() {
const form = this.$refs.addUserform.form
form.validateFields((errors, values) => {
if (!errors) {
@@ -408,7 +408,7 @@
form.resetFields()
this.getlist()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.addUserDialogloading = false
})
@@ -422,7 +422,7 @@
form.resetFields()
this.getlist()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.addUserDialogloading = false
})
@@ -431,14 +431,14 @@
}
})
},
- getqueryParam () {
+ getqueryParam() {
this.queryParam = {
pageNum: 1,
pageSize: 10,
- channelType: ''
+ channelType: '',
}
},
- getlist () {
+ getlist() {
this.loading = true
paylist(this.queryParam).then((res) => {
this.datalist = res.data.list
@@ -446,16 +446,16 @@
this.loading = false
})
},
- onPageChange (page, pageSize) {
+ onPageChange(page, pageSize) {
this.queryParam.pageNum = page
this.getlist()
},
- onSizeChange (current, pageSize) {
+ onSizeChange(current, pageSize) {
this.queryParam.pageNum = current
this.queryParam.pageSize = pageSize
this.getlist()
- }
- }
+ },
+ },
}
</script>
<style scoped>
diff --git a/src/views/capital/agentcomponents/editCapitalAgentdialog.vue b/src/views/capital/agentcomponents/editCapitalAgentdialog.vue
index 6eb296e..366847b 100644
--- a/src/views/capital/agentcomponents/editCapitalAgentdialog.vue
+++ b/src/views/capital/agentcomponents/editCapitalAgentdialog.vue
@@ -6,7 +6,8 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="用户id" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入用户id" disabled v-decorator="['agentId', {}]" />
@@ -14,12 +15,14 @@
<a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入金额"
- v-decorator="['amt', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['amt', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
</a-form-item>
<a-form-item label="扣入款" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择扣入款"
- v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款', }] }]">
+ v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款' }] }]"
+ >
<a-select-option value="1">扣款</a-select-option>
<a-select-option value="0">入款</a-select-option>
</a-select>
@@ -32,63 +35,62 @@
import { agentupdateAgentAmt } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['amt', 'direction', 'agentId'],
- currentDetails: {}
- }
- },
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
- },
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editUserDialogloading = true
- agentupdateAgentAmt(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['amt', 'direction', 'agentId'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
+ },
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editUserDialogloading = true
+ agentupdateAgentAmt(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/capital/rechargelist.vue b/src/views/capital/rechargelist.vue
index 774b9c9..f0d24d7 100644
--- a/src/views/capital/rechargelist.vue
+++ b/src/views/capital/rechargelist.vue
@@ -378,11 +378,11 @@
.then((res) => {
if (res.status == 0) {
this.addOrderdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
+ this.$message.success(res.msg)
form.resetFields()
this.getlist()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.addOrderDialogloading = false
})
@@ -408,11 +408,11 @@
.then((res) => {
if (res.status == 0) {
this.editOrderdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
+ this.$message.success(res.msg)
form.resetFields()
this.getlist()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.editOrderDialogloading = false
})
@@ -440,10 +440,10 @@
}
rechargedel(data).then((res) => {
if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
+ that.$message.success(res.msg)
that.getlist()
} else {
- that.$message.error({ content: res.msg })
+ that.$message.error(res.msg)
}
})
},
diff --git a/src/views/capital/withdrawallist.vue b/src/views/capital/withdrawallist.vue
index 7879f14..7522196 100644
--- a/src/views/capital/withdrawallist.vue
+++ b/src/views/capital/withdrawallist.vue
@@ -334,11 +334,11 @@
withdrawupdateState(values)
.then((res) => {
if (res.status == 0) {
- this.$message.success({ content: res.msg, duration: 2 })
+ this.$message.success(res.msg)
form.resetFields()
this.getlist()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.editOrderdialog = false
this.editOrderDialogloading = false
diff --git a/src/views/interesttreasure/agentcomponents/editCapitalAgentdialog.vue b/src/views/interesttreasure/agentcomponents/editCapitalAgentdialog.vue
index 6eb296e..366847b 100644
--- a/src/views/interesttreasure/agentcomponents/editCapitalAgentdialog.vue
+++ b/src/views/interesttreasure/agentcomponents/editCapitalAgentdialog.vue
@@ -6,7 +6,8 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="用户id" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入用户id" disabled v-decorator="['agentId', {}]" />
@@ -14,12 +15,14 @@
<a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入金额"
- v-decorator="['amt', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['amt', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
</a-form-item>
<a-form-item label="扣入款" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择扣入款"
- v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款', }] }]">
+ v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款' }] }]"
+ >
<a-select-option value="1">扣款</a-select-option>
<a-select-option value="0">入款</a-select-option>
</a-select>
@@ -32,63 +35,62 @@
import { agentupdateAgentAmt } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['amt', 'direction', 'agentId'],
- currentDetails: {}
- }
- },
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
- },
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editUserDialogloading = true
- agentupdateAgentAmt(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['amt', 'direction', 'agentId'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
+ },
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editUserDialogloading = true
+ agentupdateAgentAmt(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/loanmanage/agentcomponents/editCapitalAgentdialog.vue b/src/views/loanmanage/agentcomponents/editCapitalAgentdialog.vue
index 6eb296e..366847b 100644
--- a/src/views/loanmanage/agentcomponents/editCapitalAgentdialog.vue
+++ b/src/views/loanmanage/agentcomponents/editCapitalAgentdialog.vue
@@ -6,7 +6,8 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="用户id" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入用户id" disabled v-decorator="['agentId', {}]" />
@@ -14,12 +15,14 @@
<a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入金额"
- v-decorator="['amt', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['amt', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
</a-form-item>
<a-form-item label="扣入款" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择扣入款"
- v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款', }] }]">
+ v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款' }] }]"
+ >
<a-select-option value="1">扣款</a-select-option>
<a-select-option value="0">入款</a-select-option>
</a-select>
@@ -32,63 +35,62 @@
import { agentupdateAgentAmt } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['amt', 'direction', 'agentId'],
- currentDetails: {}
- }
- },
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
- },
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editUserDialogloading = true
- agentupdateAgentAmt(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['amt', 'direction', 'agentId'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
+ },
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editUserDialogloading = true
+ agentupdateAgentAmt(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/managesettings/managelist.vue b/src/views/managesettings/managelist.vue
index 895a99a..d920e6e 100644
--- a/src/views/managesettings/managelist.vue
+++ b/src/views/managesettings/managelist.vue
@@ -17,20 +17,17 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
- <a-button
- type="primary"
- icon="plus"
- style="margin-left: 8px"
- @click="addUserdialog = true">
- 添加管理</a-button>
+ <a-button type="primary" icon="plus" style="margin-left: 8px" @click="addUserdialog = true">
+ 添加管理</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -46,8 +43,9 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="isLock" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="isLock" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.isLock == 0 ? 'green' : record.isLock == 1 ? 'red' : ''">
@@ -57,10 +55,9 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
- <a slot="action" href="javascript:;" @click="getisLock(record.id, record.isLock)">{{ record.isLock
- == 0 ? '锁定用户' :
- '解锁用户'
+ <template slot="action" slot-scope="text, record">
+ <a slot="action" href="javascript:;" @click="getisLock(record.id, record.isLock)">{{
+ record.isLock == 0 ? '锁定用户' : '解锁用户'
}}</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="geteditStock(record)">修改密码</a>
@@ -74,27 +71,32 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="管理员名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入管理员名"
- v-decorator="['adminName', { rules: [{ required: true, message: '请输入管理员名', }] }]" />
+ v-decorator="['adminName', { rules: [{ required: true, message: '请输入管理员名' }] }]"
+ />
</a-form-item>
<a-form-item label="管理员手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入管理员手机号"
- v-decorator="['adminPhone', { rules: [{ required: true, message: '请输入管理员手机号', }] }]" />
+ v-decorator="['adminPhone', { rules: [{ required: true, message: '请输入管理员手机号' }] }]"
+ />
</a-form-item>
<a-form-item label="管理员密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入管理员密码"
- v-decorator="['adminPwd', { rules: [{ required: true, message: '请输入管理员密码', }] }]" />
+ v-decorator="['adminPwd', { rules: [{ required: true, message: '请输入管理员密码' }] }]"
+ />
</a-form-item>
<a-form-item label="管理员状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择管理员状态"
- v-decorator="['isLock', { rules: [{ required: true, message: '请选择管理员状态', }] }]">
+ v-decorator="['isLock', { rules: [{ required: true, message: '请选择管理员状态' }] }]"
+ >
<a-select-option value="0">正常</a-select-option>
<a-select-option value="1">锁定</a-select-option>
</a-select>
@@ -108,18 +110,21 @@
:visible="editStockdialog"
:confirmLoading="editStockdialogloading"
@ok="OkeditStockdialog"
- @cancel="CanceleditStockdialog">
+ @cancel="CanceleditStockdialog"
+ >
<a-form :form="editStockform" ref="editStockform">
<a-form-item label="用户ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入用户ID"
disabled
- v-decorator="['id', { rules: [{ required: true, message: '请输入用户ID', }] }]" />
+ v-decorator="['id', { rules: [{ required: true, message: '请输入用户ID' }] }]"
+ />
</a-form-item>
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入密码"
- v-decorator="['adminPwd', { rules: [{ required: true, message: '请输入密码', }] }]" />
+ v-decorator="['adminPwd', { rules: [{ required: true, message: '请输入密码' }] }]"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -129,183 +134,183 @@
import { adminlist, adminupdateLock, adminadd, adminupdate } from '@/api/managesettings'
import moment from 'moment'
export default {
- name: 'Shares',
- data () {
- return {
- columns: [
- {
- title: 'id',
- dataIndex: 'id',
- align: 'center'
- },
- {
- title: '管理员姓名',
- dataIndex: 'adminName',
- align: 'center'
- },
- {
- title: '管理员手机号',
- dataIndex: 'adminPhone',
- align: 'center'
- },
- {
- title: '管理员状态',
- dataIndex: 'isLock',
- align: 'center',
- scopedSlots: { customRender: 'isLock' }
- },
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: 'id',
+ dataIndex: 'id',
+ align: 'center',
+ },
+ {
+ title: '管理员姓名',
+ dataIndex: 'adminName',
+ align: 'center',
+ },
+ {
+ title: '管理员手机号',
+ dataIndex: 'adminPhone',
+ align: 'center',
+ },
+ {
+ title: '管理员状态',
+ dataIndex: 'isLock',
+ align: 'center',
+ scopedSlots: { customRender: 'isLock' },
+ },
- {
- title: '注册时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- 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,
- adminName: '',
- adminPhone: ''
- },
- datalist: [],
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false,
+ {
+ title: '注册时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ 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,
+ adminName: '',
+ adminPhone: '',
+ },
+ datalist: [],
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
- editStockdialog: false,
- editStockdialogloading: false,
- editStockform: this.$form.createForm(this),
- fields: ['id', 'adminPwd']
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- geteditStock (val) {
- this.editStockdialog = true
- this.fields.forEach(v => this.editStockform.getFieldDecorator(v))
- this.editStockform.setFieldsValue(({ id: val.id }))
- },
- CanceleditStockdialog () {
- this.editStockdialog = false
- const form = this.$refs.editStockform.form
- form.resetFields()
- },
- OkeditStockdialog () {
- const form = this.$refs.editStockform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editStockdialogloading = true
- values.adminPwd = this.editStockform.getFieldValue('adminPwd')
- adminupdate(values).then(res => {
- if (res.status == 0) {
- this.editStockdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editStockdialogloading = false
- })
- }
- })
- },
- // 新增用户取消弹窗
- 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) {
- this.addUserDialogloading = true
- adminadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- },
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- adminName: '',
- adminPhone: ''
- }
- },
- getlist () {
- this.loading = true
- adminlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
- },
- // 股票的锁定解锁
- getisLock (idval, isLockval) {
- adminupdateLock({ adminId: idval }).then(res => {
- if (res.status === 0) {
- this.getlist()
- if (isLockval == 0) {
- this.$message.success({ content: '锁定成功', duration: 2 })
- } else {
- this.$message.success({ content: '解锁成功', duration: 2 })
- }
- } else {
- this.$message.error({ content: res.msg, duration: 2 })
- }
- })
- },
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
- },
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ editStockdialog: false,
+ editStockdialogloading: false,
+ editStockform: this.$form.createForm(this),
+ fields: ['id', 'adminPwd'],
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ geteditStock(val) {
+ this.editStockdialog = true
+ this.fields.forEach((v) => this.editStockform.getFieldDecorator(v))
+ this.editStockform.setFieldsValue({ id: val.id })
+ },
+ CanceleditStockdialog() {
+ this.editStockdialog = false
+ const form = this.$refs.editStockform.form
+ form.resetFields()
+ },
+ OkeditStockdialog() {
+ const form = this.$refs.editStockform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editStockdialogloading = true
+ values.adminPwd = this.editStockform.getFieldValue('adminPwd')
+ adminupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.editStockdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editStockdialogloading = false
+ })
+ }
+ })
+ },
+ // 新增用户取消弹窗
+ 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) {
+ this.addUserDialogloading = true
+ adminadd(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
+ })
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ adminName: '',
+ adminPhone: '',
+ }
+ },
+ getlist() {
+ this.loading = true
+ adminlist(this.queryParam).then((res) => {
+ this.datalist = res.data.list
+ this.pagination.total = res.data.total
+ this.loading = false
+ })
+ },
+ // 股票的锁定解锁
+ getisLock(idval, isLockval) {
+ adminupdateLock({ adminId: idval }).then((res) => {
+ if (res.status === 0) {
+ this.getlist()
+ if (isLockval == 0) {
+ this.$message.success({ content: '锁定成功', duration: 2 })
+ } else {
+ this.$message.success({ content: '解锁成功', duration: 2 })
+ }
+ } else {
+ this.$message.error({ content: res.msg, duration: 2 })
+ }
+ })
+ },
+ onPageChange(page, pageSize) {
+ this.queryParam.pageNum = page
+ this.getlist()
+ },
+ onSizeChange(current, pageSize) {
+ this.queryParam.pageNum = current
+ this.queryParam.pageSize = pageSize
+ this.getlist()
+ },
+ },
}
</script>
diff --git a/src/views/newshares/dazonglist.vue b/src/views/newshares/dazonglist.vue
index b014ea0..92b7dd3 100644
--- a/src/views/newshares/dazonglist.vue
+++ b/src/views/newshares/dazonglist.vue
@@ -12,20 +12,22 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, pagination.current = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), (pagination.current = 1), getlist()"
+ >查询
</a-button>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true, currentdetail = ''">
- 添加大宗交易</a-button>
+ @click=";(addUserdialog = true), (currentdetail = '')"
+ >
+ 添加大宗交易</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -41,19 +43,19 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="realName" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="realName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.realName }}({{ record.userId }})</span>
+ <span style="margin-right: 10px">{{ record.realName }}({{ record.userId }})</span>
</div>
</template>
</span>
- <span slot="stockType" slot-scope="text,record">
+ <span slot="stockType" slot-scope="text, record">
<template>
<div>
- <a-tag
- :color="record.stockType == 'sh' ? 'purple' : record.stockType == 'sz' ? 'blue' : 'orange'">
+ <a-tag :color="record.stockType == 'sh' ? 'purple' : record.stockType == 'sz' ? 'blue' : 'orange'">
<!-- {{ record.stockType == 'sz' ? '深股' : record.stockType == 'sh' ? '沪股' : '京股' }} -->
{{ record.stockGid }}
</a-tag>
@@ -61,7 +63,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <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>
@@ -76,21 +78,24 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-row :gutter="48">
<a-col :md="12" :lg="12" :sm="12" v-if="!currentdetail">
<a-form-item label="股票代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入股票代码"
- v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票代码', }] }]" />
+ v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票代码' }] }]"
+ />
</a-form-item>
</a-col>
- <a-col :md="12" :lg="12" :sm="12" >
+ <a-col :md="12" :lg="12" :sm="12">
<a-form-item label="最小买入数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入最小买入数量"
- v-decorator="['stockNum', { rules: [{ required: true, message: '请输入最小买入数量', }] }]" />
+ v-decorator="['stockNum', { rules: [{ required: true, message: '请输入最小买入数量' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -99,14 +104,16 @@
<a-form-item label="交易密钥" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入交易密钥"
- v-decorator="['password', { rules: [{ required: true, message: '请输入交易密钥', }] }]" />
+ v-decorator="['password', { 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="请输入折扣(例:0.8)"
- v-decorator="['discount', { rules: [{ required: true, message: '请输入折扣', }] }]" />
+ v-decorator="['discount', { rules: [{ required: true, message: '请输入折扣' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -115,10 +122,11 @@
<a-form-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker
show-time
- style="width:100%"
+ style="width: 100%"
@change="getstartTime"
- v-decorator="['startTime', { rules: [{ required: true, message: '请填写开始时间', }] }]"
- format="YYYY-MM-DD HH:mm:ss">
+ v-decorator="['startTime', { rules: [{ required: true, message: '请填写开始时间' }] }]"
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-date-picker>
</a-form-item>
</a-col>
@@ -126,10 +134,11 @@
<a-form-item label="结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker
show-time
- style="width:100%"
+ style="width: 100%"
@change="getendTime"
- v-decorator="['endTime', { rules: [{ required: true, message: '请填写结束时间', }] }]"
- format="YYYY-MM-DD HH:mm:ss">
+ v-decorator="['endTime', { rules: [{ required: true, message: '请填写结束时间' }] }]"
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-date-picker>
</a-form-item>
</a-col>
@@ -143,211 +152,213 @@
import pick from 'lodash.pick'
import moment from 'moment'
export default {
- name: 'Shares',
- data () {
- return {
- columns: [
- {
- title: '新股名称',
- dataIndex: 'stockName',
- align: 'center'
- },
- {
- title: '新股代码',
- dataIndex: 'stockCode',
- align: 'center'
- },
- {
- title: '最小购买数量',
- dataIndex: 'stockNum',
- align: 'center'
- },
- {
- title: '折扣',
- dataIndex: 'discount',
- align: 'center'
- },
- {
- title: '股票类型',
- dataIndex: 'stockType',
- align: 'center',
- scopedSlots: { customRender: 'stockType' }
- },
- {
- title: '开始时间',
- dataIndex: 'startTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '- -'
- }
- },
- {
- title: '结束时间',
- dataIndex: 'endTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '- -'
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- scopedSlots: { customRender: 'action' }
- }
- ],
- // 表头
- 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,
- keywords: ''
- },
- datalist: [],
- labelCol: {
- xs: { span: 9 },
- sm: { span: 9 },
- md: { span: 9 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false,
- fields: ['stockCode', 'stockNum', 'password', 'startTime', 'endTime', 'discount'],
- currentdetail: '',
- startTime: '',
- endTime: ''
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- getstartTime (date, dateString) {
- this.startTime = dateString
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: '新股名称',
+ dataIndex: 'stockName',
+ align: 'center',
},
- getendTime (date, dateString) {
- this.endTime = dateString
+ {
+ title: '新股代码',
+ dataIndex: 'stockCode',
+ align: 'center',
},
- getdeleteStock (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除该大宗股票吗?此操作不可恢复!',
- onOk () {
- var data = {
- id: val.id
- }
- deleteByAdmin(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: '删除成功', duration: 2 })
- that.getinit()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '最小购买数量',
+ dataIndex: 'stockNum',
+ align: 'center',
},
- geteditStock (val) {
- this.currentdetail = val
- this.addUserdialog = true
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(val, this.fields))
- this.addUserform.setFieldsValue({ startTime: val.startTime ? moment(val.startTime).format('YYYY-MM-DD HH:mm:ss') : '' })
- this.addUserform.setFieldsValue({ endTime: val.endTime ? moment(val.endTime).format('YYYY-MM-DD HH:mm:ss') : '' })
- this.endTime = moment(val.endTime).format('YYYY-MM-DD HH:mm:ss')
- this.startTime = moment(val.startTime).format('YYYY-MM-DD HH:mm:ss')
+ {
+ title: '折扣',
+ dataIndex: 'discount',
+ align: 'center',
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '股票类型',
+ dataIndex: 'stockType',
+ align: 'center',
+ scopedSlots: { customRender: 'stockType' },
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- values.startTime = this.startTime
- values.endTime = this.endTime
- if (this.currentdetail != '') {
- values.id = this.currentdetail.id
- updateByAdmin(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '修改成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- } else {
- addByAdmin(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- }
- })
+ {
+ title: '开始时间',
+ dataIndex: 'startTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '- -'
+ },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- keywords: ''
- }
+ {
+ title: '结束时间',
+ dataIndex: 'endTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '- -'
+ },
},
- getinit () {
- this.getqueryParam()
- this.pagination.current = 1
- this.getlist()
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: { customRender: 'action' },
},
- getlist () {
- this.loading = true
- getDzListByAdmin(this.queryParam).then(res => {
- this.datalist = res.data
- // 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()
- }
+ ],
+ // 表头
+ 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,
+ keywords: '',
+ },
+ datalist: [],
+ labelCol: {
+ xs: { span: 9 },
+ sm: { span: 9 },
+ md: { span: 9 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
+ fields: ['stockCode', 'stockNum', 'password', 'startTime', 'endTime', 'discount'],
+ currentdetail: '',
+ startTime: '',
+ endTime: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ getstartTime(date, dateString) {
+ this.startTime = dateString
+ },
+ getendTime(date, dateString) {
+ this.endTime = dateString
+ },
+ getdeleteStock(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除该大宗股票吗?此操作不可恢复!',
+ onOk() {
+ var data = {
+ id: val.id,
+ }
+ deleteByAdmin(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success({ content: '删除成功', duration: 2 })
+ that.getinit()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ geteditStock(val) {
+ this.currentdetail = val
+ this.addUserdialog = true
+ this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
+ this.addUserform.setFieldsValue(pick(val, this.fields))
+ this.addUserform.setFieldsValue({
+ startTime: val.startTime ? moment(val.startTime).format('YYYY-MM-DD HH:mm:ss') : '',
+ })
+ this.addUserform.setFieldsValue({ endTime: val.endTime ? moment(val.endTime).format('YYYY-MM-DD HH:mm:ss') : '' })
+ this.endTime = moment(val.endTime).format('YYYY-MM-DD HH:mm:ss')
+ this.startTime = moment(val.startTime).format('YYYY-MM-DD HH:mm:ss')
+ },
+ 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) {
+ this.addUserDialogloading = true
+ values.startTime = this.startTime
+ values.endTime = this.endTime
+ if (this.currentdetail != '') {
+ values.id = this.currentdetail.id
+ updateByAdmin(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '修改成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ } else {
+ addByAdmin(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,
+ keywords: '',
+ }
+ },
+ getinit() {
+ this.getqueryParam()
+ this.pagination.current = 1
+ this.getlist()
+ },
+ getlist() {
+ this.loading = true
+ getDzListByAdmin(this.queryParam).then((res) => {
+ this.datalist = res.data
+ // 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/newshares/newshareslist.vue b/src/views/newshares/newshareslist.vue
index c4acec4..9a8e867 100644
--- a/src/views/newshares/newshareslist.vue
+++ b/src/views/newshares/newshareslist.vue
@@ -33,26 +33,26 @@
</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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, pagination.current = page,getlist()">查询
+ @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>
-
+ @click=";(addUserdialog = true), (currentdetail = '')"
+ >
+ 添加新股</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -68,17 +68,17 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="newlistId">
- <span slot="name" slot-scope="text,record">
+ 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>
+ <span style="margin-right: 10px">{{ record.name }}</span>
+ <a-tag color="green">{{ record.code }} </a-tag>
</div>
</template>
</span>
- <span slot="zt" slot-scope="text,record">
+ <span slot="zt" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.zt == 0 ? 'green' : record.zt == 1 ? 'red' : ''">
@@ -87,7 +87,7 @@
</div>
</template>
</span>
- <span slot="type" slot-scope="text,record">
+ <span slot="type" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.type == 1 ? 'purple' : record.type == 2 ? 'blue' : ''">
@@ -96,20 +96,17 @@
</div>
</template>
</span>
- <span slot="stockType" slot-scope="text,record">
+ <span slot="stockType" slot-scope="text, record">
<template>
<div>
- <a-tag
- :color="record.stockType == 'sh' ? 'purple' : record.stockType == 'sz' ? 'blue' : ''">
- {{ record.stockType == 'sh' ? '沪股' : record.stockType == 'sz' ? '深股' :
- record.stockType
- }}
+ <a-tag :color="record.stockType == 'sh' ? 'purple' : record.stockType == 'sz' ? 'blue' : ''">
+ {{ record.stockType == 'sh' ? '沪股' : record.stockType == 'sz' ? '深股' : record.stockType }}
</a-tag>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <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> -->
@@ -123,21 +120,24 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @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="['name', { rules: [{ required: true, message: '请输入新股名称', }] }]" />
+ v-decorator="['name', { 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="['code', { rules: [{ required: true, message: '请输入新股代码', }] }]" />
+ v-decorator="['code', { rules: [{ required: true, message: '请输入新股代码' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -146,14 +146,16 @@
<a-form-item label="新股价格" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入新股价格"
- v-decorator="['price', { rules: [{ required: true, message: '请输入新股价格', }] }]" />
+ v-decorator="['price', { 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="['orderNumber', { rules: [{ required: true, message: '请输入最大购买数量', }] }]" />
+ v-decorator="['orderNumber', { rules: [{ required: true, message: '请输入最大购买数量' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -162,7 +164,8 @@
<a-form-item label="股票类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择股票类型"
- v-decorator="['stockType', { rules: [{ required: true, message: '请选择股票类型', }] }]">
+ v-decorator="['stockType', { rules: [{ required: true, message: '请选择股票类型' }] }]"
+ >
<a-select-option :value="'nse'">nse</a-select-option>
<a-select-option :value="'bse'">bse</a-select-option>
</a-select>
@@ -172,7 +175,8 @@
<a-form-item label="新股模式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择新股模式"
- v-decorator="['type', { rules: [{ required: true, message: '请选择新股模式', }] }]">
+ v-decorator="['type', { rules: [{ required: true, message: '请选择新股模式' }] }]"
+ >
<a-select-option :value="1">新股申购</a-select-option>
<a-select-option :value="2">线下配售</a-select-option>
</a-select>
@@ -184,7 +188,8 @@
<a-form-item label="显示状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择显示状态"
- v-decorator="['zt', { rules: [{ required: true, message: '请选择显示状态', }] }]">
+ v-decorator="['zt', { rules: [{ required: true, message: '请选择显示状态' }] }]"
+ >
<a-select-option :value="0">显示</a-select-option>
<a-select-option :value="1">隐藏</a-select-option>
</a-select>
@@ -194,10 +199,11 @@
<a-form-item label="申购时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker
show-time
- style="width:100%"
+ style="width: 100%"
@change="getsubscribeTime"
- v-decorator="['subscribeTime', { rules: [{ required: true, message: '请填写申购时间', }] }]"
- format="YYYY-MM-DD HH:mm:ss">
+ v-decorator="['subscribeTime', { rules: [{ required: true, message: '请填写申购时间' }] }]"
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-date-picker>
</a-form-item>
</a-col>
@@ -207,10 +213,11 @@
<a-form-item label="认缴时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker
show-time
- style="width:100%"
+ style="width: 100%"
@change="getsubscriptionTime"
- v-decorator="['subscriptionTime', { rules: [{ required: true, message: '请填写认缴时间', }] }]"
- format="YYYY-MM-DD HH:mm:ss">
+ v-decorator="['subscriptionTime', { rules: [{ required: true, message: '请填写认缴时间' }] }]"
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-date-picker>
</a-form-item>
</a-col>
@@ -231,246 +238,265 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Shares',
- data () {
- return {
- columns: [
- {
- title: '新股名称 / 新股代码',
- dataIndex: 'name',
- align: 'center',
- scopedSlots: { customRender: 'name' }
- },
- {
- title: '最大购买数量',
- dataIndex: 'orderNumber',
- align: 'center'
- },
- // {
- // title: '预估价格',
- // dataIndex: 'pe',
- // align: 'center'
- // },
- {
- title: '价格',
- dataIndex: 'price',
- align: 'center'
- },
- {
- title: '是否显示',
- dataIndex: 'zt',
- align: 'center',
- scopedSlots: { customRender: 'zt' }
- },
- {
- title: '新股模式',
- dataIndex: 'type',
- align: 'center',
- scopedSlots: { customRender: 'type' }
- },
- {
- title: '股票类型',
- dataIndex: 'stockType',
- align: 'center',
- scopedSlots: { customRender: 'stockType' }
- },
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: '新股名称 / 新股代码',
+ dataIndex: 'name',
+ align: 'center',
+ scopedSlots: { customRender: 'name' },
+ },
+ {
+ title: '最大购买数量',
+ dataIndex: 'orderNumber',
+ align: 'center',
+ },
+ // {
+ // title: '预估价格',
+ // dataIndex: 'pe',
+ // align: 'center'
+ // },
+ {
+ title: '价格',
+ dataIndex: 'price',
+ align: 'center',
+ },
+ {
+ title: '是否显示',
+ dataIndex: 'zt',
+ align: 'center',
+ scopedSlots: { customRender: 'zt' },
+ },
+ {
+ title: '新股模式',
+ dataIndex: 'type',
+ align: 'center',
+ scopedSlots: { customRender: 'type' },
+ },
+ {
+ title: '股票类型',
+ dataIndex: 'stockType',
+ align: 'center',
+ scopedSlots: { customRender: 'stockType' },
+ },
- {
- title: '申购时间',
- dataIndex: 'subscribeTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '认缴时间',
- dataIndex: 'subscriptionTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- }, {
- title: '上市时间',
- dataIndex: 'listDate',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- 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,
- code: '',
- name: '',
- zt: undefined,
- type: 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,
+ {
+ title: '申购时间',
+ dataIndex: 'subscribeTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '认缴时间',
+ dataIndex: 'subscriptionTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '上市时间',
+ dataIndex: 'listDate',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ 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,
+ code: '',
+ name: '',
+ zt: undefined,
+ type: 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: ['name', 'code', 'price', 'orderNumber', 'zt', 'subscribeTime', 'subscriptionTime', 'type', 'stockType', 'code', 'pe', 'listDate'],
- currentdetail: '',
- subscribeTime: '',
- subscriptionTime: ''
-
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- getdeleteStock (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除该新股吗?此操作不可恢复!',
- onOk () {
- var data = {
- id: val.newlistId
- }
- subscribedel(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getinit()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
- },
- getsubscribeTime (date, dateString) {
- this.subscribeTime = 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))
- this.addUserform.setFieldsValue({ subscriptionTime: moment(val.subscriptionTime ? val.subscriptionTime : currentTime).format('YYYY-MM-DD HH:mm:ss') })
- this.addUserform.setFieldsValue({ subscribeTime: moment(val.subscribeTime ? val.subscribeTime : currentTime).format('YYYY-MM-DD HH:mm:ss') })
- // this.subscribeTime = moment(val.subscribeTime).format('YYYY-MM-DD HH:mm:ss')
- // this.subscriptionTime = moment(val.subscriptionTime).format('YYYY-MM-DD HH:mm:ss')
- },
- 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.newlistId = this.currentdetail.newlistId
- values.subscriptionTime = this.subscriptionTime
- values.subscribeTime = this.subscribeTime
- subscribeupdate(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- } else {
- this.addUserDialogloading = true
- values.subscriptionTime = this.subscriptionTime
- values.subscribeTime = this.subscribeTime
- subscribeadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- }
- })
- },
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- code: '',
- name: '',
- zt: undefined,
- type: undefined
- }
- },
- getinit () {
- this.getqueryParam()
- this.pagination.current = 1
- this.getlist()
- },
- getlist () {
- this.loading = true
- subscribelist(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.pagination.current = page
- this.getlist()
- },
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.pagination.current = page
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ fields: [
+ 'name',
+ 'code',
+ 'price',
+ 'orderNumber',
+ 'zt',
+ 'subscribeTime',
+ 'subscriptionTime',
+ 'type',
+ 'stockType',
+ 'code',
+ 'pe',
+ 'listDate',
+ ],
+ currentdetail: '',
+ subscribeTime: '',
+ subscriptionTime: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ getdeleteStock(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除该新股吗?此操作不可恢复!',
+ onOk() {
+ var data = {
+ id: val.newlistId,
+ }
+ subscribedel(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
+ },
+ 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))
+ this.addUserform.setFieldsValue({
+ subscriptionTime: moment(val.subscriptionTime ? val.subscriptionTime : currentTime).format(
+ 'YYYY-MM-DD HH:mm:ss'
+ ),
+ })
+ this.addUserform.setFieldsValue({
+ subscribeTime: moment(val.subscribeTime ? val.subscribeTime : currentTime).format('YYYY-MM-DD HH:mm:ss'),
+ })
+ // this.subscribeTime = moment(val.subscribeTime).format('YYYY-MM-DD HH:mm:ss')
+ // this.subscriptionTime = moment(val.subscriptionTime).format('YYYY-MM-DD HH:mm:ss')
+ },
+ 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.newlistId = this.currentdetail.newlistId
+ values.subscriptionTime = this.subscriptionTime
+ values.subscribeTime = this.subscribeTime
+ subscribeupdate(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
+ values.subscriptionTime = this.subscriptionTime
+ values.subscribeTime = this.subscribeTime
+ subscribeadd(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: '',
+ zt: undefined,
+ type: undefined,
+ }
+ },
+ getinit() {
+ this.getqueryParam()
+ this.pagination.current = 1
+ this.getlist()
+ },
+ getlist() {
+ this.loading = true
+ subscribelist(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.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/newshares/newsharesrecord.vue b/src/views/newshares/newsharesrecord.vue
index 1f07534..121ad73 100644
--- a/src/views/newshares/newsharesrecord.vue
+++ b/src/views/newshares/newsharesrecord.vue
@@ -12,20 +12,22 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, pagination.current = 1,getlist()">查询
+ @click=";(queryParam.pageNum = 1), (pagination.current = 1), getlist()"
+ >查询
</a-button>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true, currentdetail = ''">
- 添加记录</a-button>
+ @click=";(addUserdialog = true), (currentdetail = '')"
+ >
+ 添加记录</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -41,30 +43,52 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="realName" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="realName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.realName }}({{ record.userId }})</span>
+ <span style="margin-right: 10px">{{ record.realName }}({{ record.userId }})</span>
</div>
</template>
</span>
- <span slot="status" slot-scope="text,record">
+ <span slot="status" slot-scope="text, record">
<template>
<div>
<a-tag
- style="margin-right:10px"
- :color="record.status == 1 ? 'pink' : record.status == 2 ? 'red'
- : record.status == 3 ? 'green' : record.status == 4 ? 'blue' : record.status == 5 ? 'purple' : 'orange'">
- {{ record.status == 1 ?
- '已认购' : record.status == 2 ? '未中签'
- : record.status == 3 ? '已中签' : record.status == 4 ? '已缴纳' : record.status == 5 ? '已转持仓'
- : ''
- }}</a-tag>
+ style="margin-right: 10px"
+ :color="
+ record.status == 1
+ ? 'pink'
+ : record.status == 2
+ ? 'red'
+ : record.status == 3
+ ? 'green'
+ : record.status == 4
+ ? 'blue'
+ : record.status == 5
+ ? 'purple'
+ : 'orange'
+ "
+ >
+ {{
+ record.status == 1
+ ? '已认购'
+ : record.status == 2
+ ? '未中签'
+ : record.status == 3
+ ? '已中签'
+ : record.status == 4
+ ? '已缴纳'
+ : record.status == 5
+ ? '已转持仓'
+ : ''
+ }}</a-tag
+ >
</div>
</template>
</span>
- <span slot="type" slot-scope="text,record">
+ <span slot="type" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.type == 1 ? 'purple' : record.type == 2 ? 'blue' : ''">
@@ -74,13 +98,12 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <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>
<a-divider type="vertical" />
- <a slot="action" href="javascript:;" @click="getzhuan(record)" v-if="record.status == 4">{{ '转持仓'
- }}</a>
+ <a slot="action" href="javascript:;" @click="getzhuan(record)" v-if="record.status == 4">{{ '转持仓' }}</a>
</template>
</a-table>
</a-card>
@@ -91,21 +114,24 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @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="['phone', { rules: [{ required: true, message: '请输入用户手机号', }] }]" />
+ v-decorator="['phone', { 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="['newCode', { rules: [{ required: true, message: '请输入新股代码', }] }]" />
+ v-decorator="['newCode', { rules: [{ required: true, message: '请输入新股代码' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -114,7 +140,8 @@
<a-form-item label="买入数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入买入数量"
- v-decorator="['applyNums', { rules: [{ required: true, message: '请输入买入数量', }] }]" />
+ v-decorator="['applyNums', { rules: [{ required: true, message: '请输入买入数量' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="12" :sm="12">
@@ -128,7 +155,8 @@
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择状态"
- v-decorator="['status', { rules: [{ required: true, message: '请选择状态', }] }]">
+ v-decorator="['status', { rules: [{ required: true, message: '请选择状态' }] }]"
+ >
<a-select-option :value="1">已认购</a-select-option>
<a-select-option :value="2">未中签</a-select-option>
<a-select-option :value="3">已中签</a-select-option>
@@ -146,224 +174,224 @@
import { getStockSubscribeList, saveStockSubscribe, delStockSubscribe, addUserPosition } from '@/api/newshares'
import pick from 'lodash.pick'
export default {
- name: 'Shares',
- data () {
- return {
- columns: [
- {
- title: '用户名称(ID)',
- dataIndex: 'realName',
- align: 'center',
- scopedSlots: { customRender: 'realName' }
- },
- {
- title: '用户手机号',
- dataIndex: 'phone',
- align: 'center'
- },
- {
- title: '新股名称',
- dataIndex: 'newName',
- align: 'center'
- },
- {
- title: '新股代码',
- dataIndex: 'newCode',
- align: 'center'
- },
- {
- title: '买入价格',
- dataIndex: 'buyPrice',
- align: 'center'
- },
- {
- title: '保证金',
- dataIndex: 'bond',
- align: 'center'
- },
- {
- title: '买入数量',
- dataIndex: 'applyNums',
- align: 'center'
- },
- {
- title: '中签数量',
- dataIndex: 'applyNumber',
- align: 'center'
- },
- {
- title: '申购时间',
- dataIndex: 'addTime',
- align: 'center'
- },
- {
- title: '状态',
- dataIndex: 'status',
- align: 'center',
- scopedSlots: { customRender: 'status' }
- },
- {
- title: '新股模式',
- dataIndex: 'type',
- align: 'center',
- scopedSlots: { customRender: 'type' }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- scopedSlots: { customRender: 'action' }
- }
- ],
- // 表头
- 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,
- keyword: ''
- },
- 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: ['phone', 'newCode', 'applyNums', 'applyNumber', 'status'],
- currentdetail: ''
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- getzhuan (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认转入持仓吗?此操作不可恢复!',
- onOk () {
- var data = {
- id: val.id
- }
- addUserPosition(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'realName',
+ align: 'center',
+ scopedSlots: { customRender: 'realName' },
},
- getdeleteStock (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除该新股吗?此操作不可恢复!',
- onOk () {
- var data = {
- id: val.id
- }
- delStockSubscribe(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getinit()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '用户手机号',
+ dataIndex: 'phone',
+ align: 'center',
},
- geteditStock (val) {
- this.currentdetail = val
- this.addUserdialog = true
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(val, this.fields))
+ {
+ title: '新股名称',
+ dataIndex: 'newName',
+ align: 'center',
},
- CanceladdUserdialog () {
- this.addUserdialog = false
- const form = this.$refs.addUserform.form
- form.resetFields()
+ {
+ title: '新股代码',
+ dataIndex: 'newCode',
+ align: 'center',
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- if (this.currentdetail != '') {
- values.id = this.currentdetail.id
- }
- this.addUserDialogloading = true
- saveStockSubscribe(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
+ {
+ title: '买入价格',
+ dataIndex: 'buyPrice',
+ align: 'center',
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- keyword: ''
- }
+ {
+ title: '保证金',
+ dataIndex: 'bond',
+ align: 'center',
},
- getinit () {
- this.getqueryParam()
- this.pagination.current = 1
- this.getlist()
+ {
+ title: '买入数量',
+ dataIndex: 'applyNums',
+ align: 'center',
},
- getlist () {
- this.loading = true
- getStockSubscribeList(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
+ {
+ title: '中签数量',
+ dataIndex: 'applyNumber',
+ align: 'center',
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.pagination.current = page
- this.getlist()
+ {
+ title: '申购时间',
+ dataIndex: 'addTime',
+ align: 'center',
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.pagination.current = page
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '状态',
+ dataIndex: 'status',
+ align: 'center',
+ scopedSlots: { customRender: 'status' },
+ },
+ {
+ title: '新股模式',
+ dataIndex: 'type',
+ align: 'center',
+ scopedSlots: { customRender: 'type' },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: { customRender: 'action' },
+ },
+ ],
+ // 表头
+ 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,
+ keyword: '',
+ },
+ 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: ['phone', 'newCode', 'applyNums', 'applyNumber', 'status'],
+ currentdetail: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ getzhuan(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认转入持仓吗?此操作不可恢复!',
+ onOk() {
+ var data = {
+ id: val.id,
+ }
+ addUserPosition(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ getdeleteStock(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除该新股吗?此操作不可恢复!',
+ onOk() {
+ var data = {
+ id: val.id,
+ }
+ delStockSubscribe(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getinit()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ geteditStock(val) {
+ this.currentdetail = val
+ this.addUserdialog = true
+ 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 != '') {
+ values.id = this.currentdetail.id
+ }
+ this.addUserDialogloading = true
+ saveStockSubscribe(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
+ })
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ keyword: '',
+ }
+ },
+ getinit() {
+ this.getqueryParam()
+ this.pagination.current = 1
+ this.getlist()
+ },
+ getlist() {
+ this.loading = true
+ getStockSubscribeList(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.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/position/components/financing-flat.vue b/src/views/position/components/financing-flat.vue
index 31827bb..c356357 100644
--- a/src/views/position/components/financing-flat.vue
+++ b/src/views/position/components/financing-flat.vue
@@ -19,7 +19,8 @@
v-model="queryParam.agentId"
placeholder="请选择下级代理"
@focus="getagentlist"
- :loading="agentloading">
+ :loading="agentloading"
+ >
<a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">
{{ item.agentName }}
</a-select-option>
@@ -45,7 +46,8 @@
style="width: 100%"
v-model="times"
@change="onChangeRangeDate"
- format="YYYY-MM-DD HH:mm:ss">
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-range-picker>
</a-form-item>
</a-col>
@@ -53,13 +55,13 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
</span>
</a-form-item>
@@ -75,20 +77,30 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2800 }">
- <span slot="stockName" slot-scope="text,record">
+ :scroll="{ x: 2800 }"
+ >
+ <span slot="stockName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.stockName }}</span>
+ <span style="margin-right: 10px">{{ record.stockName }}</span>
<a-tag
- :color="record.stockPlate == '科创' ? 'blue' : !record.stockPlate ? 'orange' : record.stockPlate == '创业' ? 'pink' : 'purple'">
+ :color="
+ record.stockPlate == '科创'
+ ? 'blue'
+ : !record.stockPlate
+ ? 'orange'
+ : record.stockPlate == '创业'
+ ? 'pink'
+ : 'purple'
+ "
+ >
{{ record.stockPlate == '科创' ? '科创' : !record.stockPlate ? '股票' : record.stockPlate }}
</a-tag>
<p>({{ record.stockCode }})</p>
</div>
</template>
</span>
- <span slot="positionType" slot-scope="text,record">
+ <span slot="positionType" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
@@ -97,7 +109,7 @@
</div>
</template>
</span>
- <span slot="orderDirection" slot-scope="text,record">
+ <span slot="orderDirection" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
@@ -125,7 +137,7 @@
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="getFlatdetails(record)">查看详情</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getDelflat(record.id)">删除</a>
@@ -138,7 +150,16 @@
</a-descriptions-item>
<a-descriptions-item label="股票类型">
<a-tag
- :color="clickitem.stockPlate == '科创' ? 'blue' : !clickitem.stockPlate ? 'orange' : clickitem.stockPlate == '创业' ? 'pink' : 'purple'">
+ :color="
+ clickitem.stockPlate == '科创'
+ ? 'blue'
+ : !clickitem.stockPlate
+ ? 'orange'
+ : clickitem.stockPlate == '创业'
+ ? 'pink'
+ : 'purple'
+ "
+ >
{{ clickitem.stockPlate == '科创' ? '科创' : !clickitem.stockPlate ? 'A股' : clickitem.stockPlate }}
</a-tag>
</a-descriptions-item>
@@ -158,14 +179,20 @@
</span>
</a-descriptions-item>
<a-descriptions-item label="总盈亏">
- <span
- :class="clickitem.allProfitAndLose > 0 ? 'reds' : clickitem.allProfitAndLose < 0 ? 'greens' : ''">
+ <span :class="clickitem.allProfitAndLose > 0 ? 'reds' : clickitem.allProfitAndLose < 0 ? 'greens' : ''">
{{ clickitem.allProfitAndLose }}
</span>
</a-descriptions-item>
<a-descriptions-item label="当前价格" v-if="clickitem.now_price">
<span
- :class="clickitem.now_price - clickitem.buyOrderPrice > 0 ? 'reds' : clickitem.now_price - clickitem.buyOrderPrice < 0 ? 'greens' : ''">
+ :class="
+ clickitem.now_price - clickitem.buyOrderPrice > 0
+ ? 'reds'
+ : clickitem.now_price - clickitem.buyOrderPrice < 0
+ ? 'greens'
+ : ''
+ "
+ >
{{ clickitem.now_price }}
</span>
</a-descriptions-item>
@@ -250,278 +277,275 @@
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
- name: 'Financingflat',
- data () {
- return {
- columns: [
- {
- title: '融资名称',
- dataIndex: 'stockName',
- align: 'center',
- width: 180,
- scopedSlots: { customRender: 'stockName' }
- },
- {
- title: '账户类型',
- dataIndex: 'positionType',
- align: 'center',
- scopedSlots: { customRender: 'positionType' }
- },
- {
- title: '用户名称(ID)',
- dataIndex: 'nickName',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.nickName}(${row.userId})`
- }
-
- },
- {
- title: '持仓订单号(ID)',
- dataIndex: 'positionSn',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.positionSn}(${row.id})`
- }
-
- },
- {
- title: '买卖方向',
- dataIndex: 'orderDirection',
- align: 'center',
- scopedSlots: { customRender: 'orderDirection' }
- },
- {
- title: '买入价',
- dataIndex: 'buyOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '卖出价',
- dataIndex: 'sellOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '浮动盈亏',
- dataIndex: 'profitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'profitAndLose' }
- },
- {
- title: '总盈亏',
- dataIndex: 'allProfitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'allProfitAndLose' }
- },
- {
- title: '数量(股)',
- dataIndex: 'orderNum',
- align: 'center'
- },
- {
- title: '总市值',
- dataIndex: 'orderTotalPrice',
- align: 'center'
- },
- {
- title: '杠杆倍数',
- dataIndex: 'orderLever',
- 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: 'buyOrderTime',
- align: 'center',
- width: 180,
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '卖出时间',
- dataIndex: 'sellOrderTime',
- 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,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- },
- datalist: [],
- agentlist: [],
- agentloading: false,
- times: [],
- finacingDialog: false,
- clickitem: {},
- agentqueryParam: {
- pageNum: 1,
- pageSize: 100
- }
- }
- },
- created () {
- },
- methods: {
- getFlatdetails (item) {
- this.clickitem = item
- this.finacingDialog = true
+ name: 'Financingflat',
+ data() {
+ return {
+ columns: [
+ {
+ title: '融资名称',
+ dataIndex: 'stockName',
+ align: 'center',
+ width: 180,
+ scopedSlots: { customRender: 'stockName' },
},
- getDelflat (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除平仓单吗?此操作不可恢复',
- onOk () {
- var data = {
- positionId: val
- }
- positiondel(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '账户类型',
+ dataIndex: 'positionType',
+ align: 'center',
+ scopedSlots: { customRender: 'positionType' },
},
- getinit () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- }
- this.times = []
- this.getlist()
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'nickName',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.nickName}(${row.userId})`
+ },
},
- onChangeRangeDate (value, dateString) {
- this.queryParam.beginTime = dateString[0]
- this.queryParam.endTime = dateString[1]
+ {
+ title: '持仓订单号(ID)',
+ dataIndex: 'positionSn',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.positionSn}(${row.id})`
+ },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- }
- this.times = []
+ {
+ title: '买卖方向',
+ dataIndex: 'orderDirection',
+ align: 'center',
+ scopedSlots: { customRender: 'orderDirection' },
},
- getagentlist () {
- var that = this
- this.agentloading = true
- nextagent(this.agentqueryParam).then(res => {
- this.agentlist = res.data.list
- setTimeout(() => {
- that.agentloading = false
- }, 500)
- })
+ {
+ title: '买入价',
+ dataIndex: 'buyOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- getlist () {
- var that = this
- this.loading = true
- positionlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
+ {
+ title: '卖出价',
+ dataIndex: 'sellOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '浮动盈亏',
+ dataIndex: 'profitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'profitAndLose' },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '总盈亏',
+ dataIndex: 'allProfitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'allProfitAndLose' },
+ },
+ {
+ title: '数量(股)',
+ dataIndex: 'orderNum',
+ align: 'center',
+ },
+ {
+ title: '总市值',
+ dataIndex: 'orderTotalPrice',
+ align: 'center',
+ },
+ {
+ title: '杠杆倍数',
+ dataIndex: 'orderLever',
+ 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: 'buyOrderTime',
+ align: 'center',
+ width: 180,
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '卖出时间',
+ dataIndex: 'sellOrderTime',
+ 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,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ },
+ datalist: [],
+ agentlist: [],
+ agentloading: false,
+ times: [],
+ finacingDialog: false,
+ clickitem: {},
+ agentqueryParam: {
+ pageNum: 1,
+ pageSize: 100,
+ },
}
+ },
+ created() {},
+ methods: {
+ getFlatdetails(item) {
+ this.clickitem = item
+ this.finacingDialog = true
+ },
+ getDelflat(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除平仓单吗?此操作不可恢复',
+ onOk() {
+ var data = {
+ positionId: val,
+ }
+ positiondel(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ getinit() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ }
+ this.times = []
+ this.getlist()
+ },
+ onChangeRangeDate(value, dateString) {
+ this.queryParam.beginTime = dateString[0]
+ this.queryParam.endTime = dateString[1]
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ }
+ this.times = []
+ },
+ getagentlist() {
+ var that = this
+ this.agentloading = true
+ nextagent(this.agentqueryParam).then((res) => {
+ this.agentlist = res.data.list
+ setTimeout(() => {
+ that.agentloading = false
+ }, 500)
+ })
+ },
+ getlist() {
+ var that = this
+ this.loading = true
+ positionlist(this.queryParam).then((res) => {
+ this.datalist = res.data.list
+ this.pagination.total = res.data.total
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ 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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/position/components/financing-hold.vue b/src/views/position/components/financing-hold.vue
index 0822613..c554f35 100644
--- a/src/views/position/components/financing-hold.vue
+++ b/src/views/position/components/financing-hold.vue
@@ -19,7 +19,8 @@
v-model="queryParam.agentId"
placeholder="请选择下级代理"
@focus="getagentlist"
- :loading="agentloading">
+ :loading="agentloading"
+ >
<a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">
{{ item.agentName }}
</a-select-option>
@@ -41,15 +42,14 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
-
</span>
</a-form-item>
</a-col>
@@ -64,21 +64,30 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2800 }">
-
- <span slot="stockName" slot-scope="text,record">
+ :scroll="{ x: 2800 }"
+ >
+ <span slot="stockName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.stockName }}</span>
+ <span style="margin-right: 10px">{{ record.stockName }}</span>
<a-tag
- :color="record.stockPlate == '科创' ? 'blue' : !record.stockPlate ? 'orange' : record.stockPlate == '创业' ? 'pink' : 'purple'">
+ :color="
+ record.stockPlate == '科创'
+ ? 'blue'
+ : !record.stockPlate
+ ? 'orange'
+ : record.stockPlate == '创业'
+ ? 'pink'
+ : 'purple'
+ "
+ >
{{ record.stockPlate == '科创' ? '科创' : !record.stockPlate ? '股票' : record.stockPlate }}
</a-tag>
<p>({{ record.stockCode }})</p>
</div>
</template>
</span>
- <span slot="positionType" slot-scope="text,record">
+ <span slot="positionType" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
@@ -87,7 +96,7 @@
</div>
</template>
</span>
- <span slot="orderDirection" slot-scope="text,record">
+ <span slot="orderDirection" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
@@ -96,11 +105,18 @@
</div>
</template>
</span>
- <span slot="now_price" slot-scope="text,record">
+ <span slot="now_price" slot-scope="text, record">
<template>
<div>
<p
- :class="Number(record.now_price) - record.buyOrderPrice < 0 ? 'greens' : Number(record.now_price) - record.buyOrderPrice > 0 ? 'reds' : ''">
+ :class="
+ Number(record.now_price) - record.buyOrderPrice < 0
+ ? 'greens'
+ : Number(record.now_price) - record.buyOrderPrice > 0
+ ? 'reds'
+ : ''
+ "
+ >
{{ record.now_price }}
</p>
</div>
@@ -125,12 +141,17 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a
slot="action"
href="javascript:;"
- @click="Lockvisibledialog = true; clickpositionId = record.id"
- v-if="record.isLock == 0">锁仓</a>
+ @click="
+ Lockvisibledialog = true
+ clickpositionId = record.id
+ "
+ v-if="record.isLock == 0"
+ >锁仓</a
+ >
<a slot="action" href="javascript:;" @click="getLockopen(record.id)" v-else>解锁</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getCompulsoryclosing(record.positionSn)">强制平仓</a>
@@ -142,12 +163,14 @@
:visible="Lockvisibledialog"
:confirmLoading="Lockvisibleloading"
@ok="getDialogok"
- @cancel="handleCancel">
+ @cancel="handleCancel"
+ >
<a-form :form="Lockvisibleform" ref="createModal">
<a-form-item>
<a-input
v-decorator="['lockMsg', { rules: [{ required: true, message: '请输入锁仓原因!', whitespace: true }] }]"
- placeholder="请输入锁仓原因!" />
+ placeholder="请输入锁仓原因!"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -158,307 +181,309 @@
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
- name: 'Financinghold',
- data () {
- return {
- columns: [
- {
- title: '融资名称',
- dataIndex: 'stockName',
- align: 'center',
- width: 180,
- scopedSlots: { customRender: 'stockName' }
- },
- {
- title: '账户类型',
- dataIndex: 'positionType',
- align: 'center',
- scopedSlots: { customRender: 'positionType' }
- },
- {
- title: '用户名称(ID)',
- dataIndex: 'nickName',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.nickName}(${row.userId})`
- }
-
- },
- {
- title: '持仓订单号(ID)',
- dataIndex: 'positionSn',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.positionSn}(${row.id})`
- }
-
- },
- {
- title: '买卖方向',
- dataIndex: 'orderDirection',
- align: 'center',
- scopedSlots: { customRender: 'orderDirection' }
- },
- {
- title: '买入价',
- dataIndex: 'buyOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '现价',
- dataIndex: 'now_price',
- align: 'center',
- scopedSlots: { customRender: 'now_price' }
- },
- {
- title: '浮动盈亏',
- dataIndex: 'profitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'profitAndLose' }
- },
- {
- title: '总盈亏',
- dataIndex: 'allProfitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'allProfitAndLose' }
- },
- {
- title: '数量(股)',
- dataIndex: 'orderNum',
- align: 'center'
- },
- {
- title: '总市值',
- dataIndex: 'orderTotalPrice',
- align: 'center'
- },
- {
- title: '杠杆倍数',
- dataIndex: 'orderLever',
- 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: 'buyOrderTime',
- 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,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- },
- datalist: [],
- agentlist: [],
- agentloading: false,
- Lockvisibledialog: false,
- Lockvisibleloading: false,
- Lockvisibleform: this.$form.createForm(this),
- clickpositionId: '',
- agentqueryParam: {
- pageNum: 1,
- pageSize: 100
- }
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- 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({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: '平仓失败' })
- }
- }).catch(error => {
- that.$message.error({ content: '平仓失败' })
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ name: 'Financinghold',
+ data() {
+ return {
+ columns: [
+ {
+ title: '融资名称',
+ dataIndex: 'stockName',
+ align: 'center',
+ width: 180,
+ scopedSlots: { customRender: 'stockName' },
},
- 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({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '账户类型',
+ dataIndex: 'positionType',
+ align: 'center',
+ scopedSlots: { customRender: 'positionType' },
},
- handleCancel () {
- this.Lockvisibledialog = false
- const form = this.$refs.createModal.form
- form.resetFields()
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'nickName',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.nickName}(${row.userId})`
+ },
},
- 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({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.Lockvisibleloading = false
- }).catch(error => {
- reject(error)
- })
- }
- })
+ {
+ title: '持仓订单号(ID)',
+ dataIndex: 'positionSn',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.positionSn}(${row.id})`
+ },
},
- getinit () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- }
- this.getlist()
+ {
+ title: '买卖方向',
+ dataIndex: 'orderDirection',
+ align: 'center',
+ scopedSlots: { customRender: 'orderDirection' },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- }
+ {
+ title: '买入价',
+ dataIndex: 'buyOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- getagentlist () {
- var that = this
- this.agentloading = true
- nextagent(this.agentqueryParam).then(res => {
- this.agentlist = res.data.list
- setTimeout(() => {
- that.agentloading = false
- }, 500)
- })
+ {
+ title: '现价',
+ dataIndex: 'now_price',
+ align: 'center',
+ scopedSlots: { customRender: 'now_price' },
},
- getlist () {
- this.loading = true
- positionlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
+ {
+ title: '浮动盈亏',
+ dataIndex: 'profitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'profitAndLose' },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '总盈亏',
+ dataIndex: 'allProfitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'allProfitAndLose' },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '数量(股)',
+ dataIndex: 'orderNum',
+ align: 'center',
+ },
+ {
+ title: '总市值',
+ dataIndex: 'orderTotalPrice',
+ align: 'center',
+ },
+ {
+ title: '杠杆倍数',
+ dataIndex: 'orderLever',
+ 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: 'buyOrderTime',
+ 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,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ },
+ datalist: [],
+ agentlist: [],
+ agentloading: false,
+ Lockvisibledialog: false,
+ Lockvisibleloading: false,
+ Lockvisibleform: this.$form.createForm(this),
+ clickpositionId: '',
+ agentqueryParam: {
+ pageNum: 1,
+ pageSize: 100,
+ },
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ 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: 0,
+ }
+ this.getlist()
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ }
+ },
+ 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
+ positionlist(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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/position/components/futures-flat.vue b/src/views/position/components/futures-flat.vue
index a347c25..1c00086 100644
--- a/src/views/position/components/futures-flat.vue
+++ b/src/views/position/components/futures-flat.vue
@@ -19,7 +19,8 @@
v-model="queryParam.agentId"
placeholder="请选择下级代理"
@focus="getagentlist"
- :loading="agentloading">
+ :loading="agentloading"
+ >
<a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">
{{ item.agentName }}
</a-select-option>
@@ -45,22 +46,22 @@
v-model="times"
style="width: 100%"
@change="onChangeRangeDate"
- format="YYYY-MM-DD HH:mm:ss">
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-range-picker>
</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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
-
</span>
</a-form-item>
</a-col>
@@ -75,9 +76,9 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2800 }">
-
- <span slot="positionType" slot-scope="text,record">
+ :scroll="{ x: 2800 }"
+ >
+ <span slot="positionType" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
@@ -86,7 +87,7 @@
</div>
</template>
</span>
- <span slot="orderDirection" slot-scope="text,record">
+ <span slot="orderDirection" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
@@ -95,28 +96,24 @@
</div>
</template>
</span>
- <span slot="profitAndLose" slot-scope="text,record">
+ <span slot="profitAndLose" slot-scope="text, record">
<template>
<div>
- <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">
- {{ text }}{{ record.coinCode }}
- </p>
+ <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">{{ text }}{{ record.coinCode }}</p>
<P>≈{{ (record.profitAndLose * record.coinRate).toFixed(2) }} CNY</P>
</div>
</template>
</span>
- <span slot="allProfitAndLose" slot-scope="text,record">
+ <span slot="allProfitAndLose" slot-scope="text, record">
<template>
<div>
- <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">
- {{ text }}{{ record.coinCode }}
- </p>
+ <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">{{ text }}{{ record.coinCode }}</p>
<P>≈{{ (record.allProfitAndLose * record.coinRate).toFixed(2) }} CNY</P>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="getFuturesdetails(record)">查看详情</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getDelflat(record.id)">删除</a>
@@ -139,22 +136,26 @@
</a-descriptions-item>
<a-descriptions-item label="浮动盈亏">
<span :class="clickitem.profitAndLose > 0 ? 'reds' : clickitem.profitAndLose < 0 ? 'greens' : ''">
- {{ clickitem.profitAndLose }}{{ clickitem.coinCode }} ≈ {{ (clickitem.profitAndLose *
- clickitem.coinRate).toFixed(2)
- }} CNY
+ {{ clickitem.profitAndLose }}{{ clickitem.coinCode }} ≈
+ {{ (clickitem.profitAndLose * clickitem.coinRate).toFixed(2) }} CNY
</span>
</a-descriptions-item>
<a-descriptions-item label="总盈亏">
- <span
- :class="clickitem.allProfitAndLose > 0 ? 'reds' : clickitem.allProfitAndLose < 0 ? 'greens' : ''">
- {{ clickitem.allProfitAndLose }}{{ clickitem.coinCode }} ≈ {{ (clickitem.allProfitAndLose *
- clickitem.coinRate).toFixed(2)
- }} CNY
+ <span :class="clickitem.allProfitAndLose > 0 ? 'reds' : clickitem.allProfitAndLose < 0 ? 'greens' : ''">
+ {{ clickitem.allProfitAndLose }}{{ clickitem.coinCode }} ≈
+ {{ (clickitem.allProfitAndLose * clickitem.coinRate).toFixed(2) }} CNY
</span>
</a-descriptions-item>
<a-descriptions-item label="当前价格" v-if="clickitem.now_price">
<span
- :class="clickitem.now_price - clickitem.buyOrderPrice > 0 ? 'reds' : clickitem.now_price - clickitem.buyOrderPrice < 0 ? 'greens' : ''">
+ :class="
+ clickitem.now_price - clickitem.buyOrderPrice > 0
+ ? 'reds'
+ : clickitem.now_price - clickitem.buyOrderPrice < 0
+ ? 'greens'
+ : ''
+ "
+ >
{{ clickitem.now_price }}
</span>
</a-descriptions-item>
@@ -190,15 +191,12 @@
</a-descriptions-item>
<a-descriptions-item label="手续费">
<span>
- {{ clickitem.orderFee }}{{ clickitem.coinCode }} ≈ {{ (clickitem.orderFee *
- clickitem.coinRate).toFixed(2)
- }} CNY
+ {{ clickitem.orderFee }}{{ clickitem.coinCode }} ≈
+ {{ (clickitem.orderFee * clickitem.coinRate).toFixed(2) }} CNY
</span>
</a-descriptions-item>
<a-descriptions-item label="当前汇率">
- <span>
- 1 {{ clickitem.coinCode }} ≈ {{ clickitem.coinRate }} CNY
- </span>
+ <span> 1 {{ clickitem.coinCode }} ≈ {{ clickitem.coinRate }} CNY </span>
</a-descriptions-item>
<a-descriptions-item label="买入时间">
<span>
@@ -225,273 +223,270 @@
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
- name: 'Setting',
- data () {
- return {
- columns: [
- {
- title: '期货名称',
- dataIndex: 'futuresName',
- align: 'center',
- width: 180,
- customRender: (text, row, index) => {
- return `${row.futuresName}(${row.futuresCode})`
- }
- },
- {
- title: '账户类型',
- dataIndex: 'positionType',
- align: 'center',
- scopedSlots: { customRender: 'positionType' }
- },
- {
- title: '用户名称(ID)',
- dataIndex: 'realName',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.realName}(${row.userId})`
- }
-
- },
- {
- title: '持仓订单号(ID)',
- dataIndex: 'positionSn',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.positionSn}(${row.id})`
- }
-
- },
- {
- title: '买卖方向',
- dataIndex: 'orderDirection',
- align: 'center',
- scopedSlots: { customRender: 'orderDirection' }
- },
- {
- title: '买入点数',
- dataIndex: 'buyOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '卖出点数',
- dataIndex: 'sellOrderPrice',
- align: 'center'
- },
- {
- title: '保证金(CNY)',
- dataIndex: 'allDepositAmt',
- align: 'center'
- },
- {
- title: '浮动盈亏',
- dataIndex: 'profitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'profitAndLose' }
- },
- {
- title: '总盈亏',
- dataIndex: 'allProfitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'allProfitAndLose' }
- },
- {
- title: '数量(手)',
- dataIndex: 'orderNum',
- align: 'center'
- },
- {
- title: '每标准手',
- dataIndex: 'futuresStandard',
- align: 'center',
- customRender: (text, row, index) => {
- return row.futuresStandard + row.futuresUnit
- }
- },
- {
- title: '手续费',
- dataIndex: 'orderFee',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.orderFee} ${row.coinCode} ≈ ${(row.orderFee * row.coinRate).toFixed(2)} CNY`
- }
- },
- {
- title: '当前汇率',
- dataIndex: 'coinCode',
- align: 'center',
- customRender: (text, row, index) => {
- return `1${row.coinCode} ≈ ${row.coinRate}CNY`
- }
- },
- {
- title: '锁定原因',
- dataIndex: 'lockMsg',
- align: 'center'
- },
- {
- title: '买入时间',
- dataIndex: 'buyOrderTime',
- align: 'center',
- width: 180,
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '卖出时间',
- dataIndex: 'sellOrderTime',
- 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,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- },
- datalist: [],
- agentlist: [],
- agentloading: false,
- times: [],
- futuresDialog: false,
- clickitem: {},
- agentqueryParam: {
- pageNum: 1,
- pageSize: 100
- }
- }
- },
- created () {
- },
- methods: {
- getFuturesdetails (item) {
- this.clickitem = item
- this.futuresDialog = true
+ name: 'Setting',
+ data() {
+ return {
+ columns: [
+ {
+ title: '期货名称',
+ dataIndex: 'futuresName',
+ align: 'center',
+ width: 180,
+ customRender: (text, row, index) => {
+ return `${row.futuresName}(${row.futuresCode})`
+ },
},
- getDelflat (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除平仓单吗?此操作不可恢复',
- onOk () {
- var data = {
- positionId: val
- }
- futurespositiondel(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '账户类型',
+ dataIndex: 'positionType',
+ align: 'center',
+ scopedSlots: { customRender: 'positionType' },
},
- getinit () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- }
- this.times = []
- this.getlist()
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'realName',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.realName}(${row.userId})`
+ },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- }
- this.times = []
+ {
+ title: '持仓订单号(ID)',
+ dataIndex: 'positionSn',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.positionSn}(${row.id})`
+ },
},
- onChangeRangeDate (value, dateString) {
- this.queryParam.beginTime = dateString[0]
- this.queryParam.endTime = dateString[1]
+ {
+ title: '买卖方向',
+ dataIndex: 'orderDirection',
+ align: 'center',
+ scopedSlots: { customRender: 'orderDirection' },
},
- getagentlist () {
- var that = this
- this.agentloading = true
- nextagent(this.agentqueryParam).then(res => {
- this.agentlist = res.data.list
- setTimeout(() => {
- that.agentloading = false
- }, 500)
- })
+ {
+ title: '买入点数',
+ dataIndex: 'buyOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- getlist () {
- this.loading = true
- futurespositionlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
+ {
+ title: '卖出点数',
+ dataIndex: 'sellOrderPrice',
+ align: 'center',
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '保证金(CNY)',
+ dataIndex: 'allDepositAmt',
+ align: 'center',
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '浮动盈亏',
+ dataIndex: 'profitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'profitAndLose' },
+ },
+ {
+ title: '总盈亏',
+ dataIndex: 'allProfitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'allProfitAndLose' },
+ },
+ {
+ title: '数量(手)',
+ dataIndex: 'orderNum',
+ align: 'center',
+ },
+ {
+ title: '每标准手',
+ dataIndex: 'futuresStandard',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return row.futuresStandard + row.futuresUnit
+ },
+ },
+ {
+ title: '手续费',
+ dataIndex: 'orderFee',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.orderFee} ${row.coinCode} ≈ ${(row.orderFee * row.coinRate).toFixed(2)} CNY`
+ },
+ },
+ {
+ title: '当前汇率',
+ dataIndex: 'coinCode',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `1${row.coinCode} ≈ ${row.coinRate}CNY`
+ },
+ },
+ {
+ title: '锁定原因',
+ dataIndex: 'lockMsg',
+ align: 'center',
+ },
+ {
+ title: '买入时间',
+ dataIndex: 'buyOrderTime',
+ align: 'center',
+ width: 180,
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '卖出时间',
+ dataIndex: 'sellOrderTime',
+ 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,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ },
+ datalist: [],
+ agentlist: [],
+ agentloading: false,
+ times: [],
+ futuresDialog: false,
+ clickitem: {},
+ agentqueryParam: {
+ pageNum: 1,
+ pageSize: 100,
+ },
}
+ },
+ created() {},
+ methods: {
+ getFuturesdetails(item) {
+ this.clickitem = item
+ this.futuresDialog = true
+ },
+ getDelflat(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除平仓单吗?此操作不可恢复',
+ onOk() {
+ var data = {
+ positionId: val,
+ }
+ futurespositiondel(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ getinit() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ }
+ this.times = []
+ this.getlist()
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ }
+ this.times = []
+ },
+ onChangeRangeDate(value, dateString) {
+ this.queryParam.beginTime = dateString[0]
+ this.queryParam.endTime = dateString[1]
+ },
+ 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
+ futurespositionlist(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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/position/components/futures-hold.vue b/src/views/position/components/futures-hold.vue
index f396833..8bc85f1 100644
--- a/src/views/position/components/futures-hold.vue
+++ b/src/views/position/components/futures-hold.vue
@@ -19,7 +19,8 @@
v-model="queryParam.agentId"
placeholder="请选择下级代理"
@focus="getagentlist"
- :loading="agentloading">
+ :loading="agentloading"
+ >
<a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">
{{ item.agentName }}
</a-select-option>
@@ -41,15 +42,14 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
-
</span>
</a-form-item>
</a-col>
@@ -64,9 +64,9 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2800 }">
-
- <span slot="positionType" slot-scope="text,record">
+ :scroll="{ x: 2800 }"
+ >
+ <span slot="positionType" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
@@ -75,7 +75,7 @@
</div>
</template>
</span>
- <span slot="orderDirection" slot-scope="text,record">
+ <span slot="orderDirection" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
@@ -84,43 +84,51 @@
</div>
</template>
</span>
- <span slot="nowPrice" slot-scope="text,record">
+ <span slot="nowPrice" slot-scope="text, record">
<template>
<div>
<p
- :class="Number(record.nowPrice) - record.buyOrderPrice < 0 ? 'greens' : Number(record.nowPrice) - record.buyOrderPrice > 0 ? 'reds' : ''">
+ :class="
+ Number(record.nowPrice) - record.buyOrderPrice < 0
+ ? 'greens'
+ : Number(record.nowPrice) - record.buyOrderPrice > 0
+ ? 'reds'
+ : ''
+ "
+ >
{{ Number(record.nowPrice).toFixed(2) }}
</p>
</div>
</template>
</span>
- <span slot="profitAndLose" slot-scope="text,record">
+ <span slot="profitAndLose" slot-scope="text, record">
<template>
<div>
- <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">
- {{ text }}{{ record.coinCode }}
- </p>
+ <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">{{ text }}{{ record.coinCode }}</p>
<P>≈{{ (record.profitAndLose * record.coinRate).toFixed(2) }} CNY</P>
</div>
</template>
</span>
- <span slot="allProfitAndLose" slot-scope="text,record">
+ <span slot="allProfitAndLose" slot-scope="text, record">
<template>
<div>
- <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">
- {{ text }}{{ record.coinCode }}
- </p>
+ <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">{{ text }}{{ record.coinCode }}</p>
<P>≈{{ (record.allProfitAndLose * record.coinRate).toFixed(2) }} CNY</P>
</div>
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a
slot="action"
href="javascript:;"
- @click="Lockvisibledialig = true; clickpositionId = record.id"
- v-if="record.isLock == 0">锁仓</a>
+ @click="
+ Lockvisibledialig = true
+ clickpositionId = record.id
+ "
+ v-if="record.isLock == 0"
+ >锁仓</a
+ >
<a slot="action" href="javascript:;" @click="getLockopen(record.id)" v-else>解锁</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getCompulsoryclosing(record.positionSn)">强制平仓</a>
@@ -132,12 +140,14 @@
:visible="Lockvisibledialig"
:confirmLoading="Lockvisibleloading"
@ok="getDialogok"
- @cancel="handleCancel">
+ @cancel="handleCancel"
+ >
<a-form :form="Lockvisibleform" ref="createModal">
<a-form-item>
<a-input
v-decorator="['lockMsg', { rules: [{ required: true, message: '请输入锁仓原因!', whitespace: true }] }]"
- placeholder="请输入锁仓原因!" />
+ placeholder="请输入锁仓原因!"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -148,303 +158,300 @@
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
- name: 'FuturesHold',
- data () {
- return {
- columns: [
- {
- title: '期货名称',
- dataIndex: 'futuresName',
- align: 'center',
- width: 180,
- customRender: (text, row, index) => {
- return `${row.futuresName}(${row.futuresCode})`
- }
- },
- {
- title: '账户类型',
- dataIndex: 'positionType',
- align: 'center',
- scopedSlots: { customRender: 'positionType' }
- },
- {
- title: '用户名称(ID)',
- dataIndex: 'realName',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.realName}(${row.userId})`
- }
-
- },
- {
- title: '持仓订单号(ID)',
- dataIndex: 'positionSn',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.positionSn}(${row.id})`
- }
-
- },
- {
- title: '买卖方向',
- dataIndex: 'orderDirection',
- align: 'center',
- scopedSlots: { customRender: 'orderDirection' }
- },
- {
- title: '买入点数',
- dataIndex: 'buyOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '最新点数',
- dataIndex: 'nowPrice',
- align: 'center',
- scopedSlots: { customRender: 'nowPrice' }
- },
- {
- title: '保证金(CNY)',
- dataIndex: 'allDepositAmt',
- align: 'center'
- },
- {
- title: '浮动盈亏',
- dataIndex: 'profitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'profitAndLose' }
- },
- {
- title: '总盈亏',
- dataIndex: 'allProfitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'allProfitAndLose' }
- },
- {
- title: '数量(手)',
- dataIndex: 'orderNum',
- align: 'center'
- },
- {
- title: '每标准手',
- dataIndex: 'futuresStandard',
- align: 'center',
- customRender: (text, row, index) => {
- return row.futuresStandard + row.futuresUnit
- }
- },
- {
- title: '手续费',
- dataIndex: 'orderFee',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.orderFee} ${row.coinCode} ≈ ${(row.orderFee * row.coinRate).toFixed(2)} CNY`
- }
- },
- {
- title: '当前汇率',
- dataIndex: 'coinCode',
- align: 'center',
- customRender: (text, row, index) => {
- return `1${row.coinCode} ≈ ${row.coinRate}CNY`
- }
- },
- {
- title: '锁定原因',
- dataIndex: 'lockMsg',
- align: 'center'
- },
- {
- title: '买入时间',
- dataIndex: 'buyOrderTime',
- 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,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- },
- datalist: [],
- agentlist: [],
- agentloading: false,
- Lockvisibledialig: false,
- Lockvisibleloading: false,
- Lockvisibleform: this.$form.createForm(this),
- clickpositionId: '',
- agentqueryParam: {
- pageNum: 1,
- pageSize: 100
- }
- }
- },
- created () {
- },
- methods: {
- getCompulsoryclosing (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认要强制平仓吗?',
- onOk () {
- var data = {
- positionSn: val
- }
- futurespositionsell(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: '平仓失败' })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ name: 'FuturesHold',
+ data() {
+ return {
+ columns: [
+ {
+ title: '期货名称',
+ dataIndex: 'futuresName',
+ align: 'center',
+ width: 180,
+ customRender: (text, row, index) => {
+ return `${row.futuresName}(${row.futuresCode})`
+ },
},
- getLockopen (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认要解锁该持仓单?',
- onOk () {
- var data = {
- state: 0,
- positionId: val
- }
- futurespositionlock(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '账户类型',
+ dataIndex: 'positionType',
+ align: 'center',
+ scopedSlots: { customRender: 'positionType' },
},
- handleCancel () {
- this.Lockvisibledialig = false
- const form = this.$refs.createModal.form
- form.resetFields()
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'realName',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.realName}(${row.userId})`
+ },
},
- 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
- }
- futurespositionlock(data).then(res => {
- if (res.status == 0) {
- this.Lockvisibledialig = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.Lockvisibleloading = false
- })
- }
- })
+ {
+ title: '持仓订单号(ID)',
+ dataIndex: 'positionSn',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.positionSn}(${row.id})`
+ },
},
- getinit () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- }
- this.getlist()
+ {
+ title: '买卖方向',
+ dataIndex: 'orderDirection',
+ align: 'center',
+ scopedSlots: { customRender: 'orderDirection' },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- }
+ {
+ title: '买入点数',
+ dataIndex: 'buyOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- getagentlist () {
- var that = this
- this.agentloading = true
- nextagent(this.agentqueryParam).then(res => {
- this.agentlist = res.data.list
- setTimeout(() => {
- that.agentloading = false
- }, 500)
- })
+ {
+ title: '最新点数',
+ dataIndex: 'nowPrice',
+ align: 'center',
+ scopedSlots: { customRender: 'nowPrice' },
},
- getlist () {
- this.loading = true
- futurespositionlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
+ {
+ title: '保证金(CNY)',
+ dataIndex: 'allDepositAmt',
+ align: 'center',
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '浮动盈亏',
+ dataIndex: 'profitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'profitAndLose' },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '总盈亏',
+ dataIndex: 'allProfitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'allProfitAndLose' },
+ },
+ {
+ title: '数量(手)',
+ dataIndex: 'orderNum',
+ align: 'center',
+ },
+ {
+ title: '每标准手',
+ dataIndex: 'futuresStandard',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return row.futuresStandard + row.futuresUnit
+ },
+ },
+ {
+ title: '手续费',
+ dataIndex: 'orderFee',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.orderFee} ${row.coinCode} ≈ ${(row.orderFee * row.coinRate).toFixed(2)} CNY`
+ },
+ },
+ {
+ title: '当前汇率',
+ dataIndex: 'coinCode',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `1${row.coinCode} ≈ ${row.coinRate}CNY`
+ },
+ },
+ {
+ title: '锁定原因',
+ dataIndex: 'lockMsg',
+ align: 'center',
+ },
+ {
+ title: '买入时间',
+ dataIndex: 'buyOrderTime',
+ 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,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ },
+ datalist: [],
+ agentlist: [],
+ agentloading: false,
+ Lockvisibledialig: false,
+ Lockvisibleloading: false,
+ Lockvisibleform: this.$form.createForm(this),
+ clickpositionId: '',
+ agentqueryParam: {
+ pageNum: 1,
+ pageSize: 100,
+ },
}
+ },
+ created() {},
+ methods: {
+ getCompulsoryclosing(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认要强制平仓吗?',
+ onOk() {
+ var data = {
+ positionSn: val,
+ }
+ futurespositionsell(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error({ content: '平仓失败' })
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ getLockopen(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认要解锁该持仓单?',
+ onOk() {
+ var data = {
+ state: 0,
+ positionId: val,
+ }
+ futurespositionlock(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.Lockvisibledialig = 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,
+ }
+ futurespositionlock(data).then((res) => {
+ if (res.status == 0) {
+ this.Lockvisibledialig = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.Lockvisibleloading = false
+ })
+ }
+ })
+ },
+ getinit() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ }
+ this.getlist()
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ }
+ },
+ 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
+ futurespositionlist(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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/position/components/index-flat.vue b/src/views/position/components/index-flat.vue
index d7ffad2..b8776a3 100644
--- a/src/views/position/components/index-flat.vue
+++ b/src/views/position/components/index-flat.vue
@@ -19,7 +19,8 @@
v-model="queryParam.agentId"
placeholder="请选择下级代理"
@focus="getagentlist"
- :loading="agentloading">
+ :loading="agentloading"
+ >
<a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">
{{ item.agentName }}
</a-select-option>
@@ -45,22 +46,22 @@
style="width: 100%"
v-model="times"
@change="onChangeRangeDate"
- format="YYYY-MM-DD HH:mm:ss">
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-range-picker>
</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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
-
</span>
</a-form-item>
</a-col>
@@ -75,17 +76,17 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2800 }">
-
- <span slot="indexName" slot-scope="text,record">
+ :scroll="{ x: 2800 }"
+ >
+ <span slot="indexName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.indexName }}</span>
+ <span style="margin-right: 10px">{{ record.indexName }}</span>
<p>({{ record.indexCode }})</p>
</div>
</template>
</span>
- <span slot="positionType" slot-scope="text,record">
+ <span slot="positionType" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
@@ -94,7 +95,7 @@
</div>
</template>
</span>
- <span slot="orderDirection" slot-scope="text,record">
+ <span slot="orderDirection" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
@@ -103,11 +104,18 @@
</div>
</template>
</span>
- <span slot="now_price" slot-scope="text,record">
+ <span slot="now_price" slot-scope="text, record">
<template>
<div>
<p
- :class="Number(record.now_price) - record.buyOrderPrice < 0 ? 'greens' : Number(record.now_price) - record.buyOrderPrice > 0 ? 'reds' : ''">
+ :class="
+ Number(record.now_price) - record.buyOrderPrice < 0
+ ? 'greens'
+ : Number(record.now_price) - record.buyOrderPrice > 0
+ ? 'reds'
+ : ''
+ "
+ >
{{ Number(record.now_price).toFixed(2) }}
</p>
</div>
@@ -132,7 +140,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="getIndexdetails(record)">查看详情</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getDelflat(record.id)">删除</a>
@@ -159,14 +167,20 @@
</span>
</a-descriptions-item>
<a-descriptions-item label="总盈亏">
- <span
- :class="clickitem.allProfitAndLose > 0 ? 'reds' : clickitem.allProfitAndLose < 0 ? 'greens' : ''">
+ <span :class="clickitem.allProfitAndLose > 0 ? 'reds' : clickitem.allProfitAndLose < 0 ? 'greens' : ''">
{{ clickitem.allProfitAndLose }}
</span>
</a-descriptions-item>
<a-descriptions-item label="当前价格" v-if="clickitem.now_price">
<span
- :class="clickitem.now_price - clickitem.buyOrderPrice > 0 ? 'reds' : clickitem.now_price - clickitem.buyOrderPrice < 0 ? 'greens' : ''">
+ :class="
+ clickitem.now_price - clickitem.buyOrderPrice > 0
+ ? 'reds'
+ : clickitem.now_price - clickitem.buyOrderPrice < 0
+ ? 'greens'
+ : ''
+ "
+ >
{{ clickitem.now_price }}
</span>
</a-descriptions-item>
@@ -235,256 +249,253 @@
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
- name: 'IndexFlat',
- data () {
- return {
- columns: [
- {
- title: '指数名称',
- dataIndex: 'indexName',
- align: 'center',
- width: 180,
- scopedSlots: { customRender: 'indexName' }
- },
- {
- title: '账户类型',
- dataIndex: 'positionType',
- align: 'center',
- scopedSlots: { customRender: 'positionType' }
- },
- {
- title: '用户名称(ID)',
- dataIndex: 'realName',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.realName}(${row.userId})`
- }
-
- },
- {
- title: '持仓订单号(ID)',
- dataIndex: 'positionSn',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.positionSn}(${row.id})`
- }
-
- },
- {
- title: '买卖方向',
- dataIndex: 'orderDirection',
- align: 'center',
- scopedSlots: { customRender: 'orderDirection' }
- },
- {
- title: '买入点数',
- dataIndex: 'buyOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '卖出点数',
- dataIndex: 'sellOrderPrice',
- align: 'center',
- scopedSlots: { customRender: 'sellOrderPrice' }
- },
- {
- title: '保证金',
- dataIndex: 'allDepositAmt',
- align: 'center'
- },
- {
- title: '浮动盈亏',
- dataIndex: 'profitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'profitAndLose' }
- },
- {
- title: '总盈亏',
- dataIndex: 'allProfitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'allProfitAndLose' }
- },
- {
- title: '数量(手)',
- dataIndex: 'orderNum',
- align: 'center'
- },
- {
- title: '点浮动价',
- dataIndex: 'eachPoint',
- align: 'center'
- },
- {
- title: '手续费',
- dataIndex: 'orderFee',
- align: 'center'
- },
- {
- title: '锁定原因',
- dataIndex: 'lockMsg',
- align: 'center'
- },
- {
- title: '买入时间',
- dataIndex: 'buyOrderTime',
- align: 'center',
- width: 180,
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '卖出时间',
- dataIndex: 'sellOrderTime',
- 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,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- },
- datalist: [],
- agentlist: [],
- agentloading: false,
- times: [],
- indexDialog: false,
- clickitem: {},
- agentqueryParam: {
- pageNum: 1,
- pageSize: 100
- }
- }
- },
- created () {
- },
- methods: {
- getIndexdetails (item) {
- this.clickitem = item
- this.indexDialog = true
+ name: 'IndexFlat',
+ data() {
+ return {
+ columns: [
+ {
+ title: '指数名称',
+ dataIndex: 'indexName',
+ align: 'center',
+ width: 180,
+ scopedSlots: { customRender: 'indexName' },
},
- getDelflat (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除平仓单吗?此操作不可恢复',
- onOk () {
- var data = {
- positionId: val
- }
- indexpositiondel(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '账户类型',
+ dataIndex: 'positionType',
+ align: 'center',
+ scopedSlots: { customRender: 'positionType' },
},
- getinit () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1,
- beginTime: '',
- endTime: ''
- }
- this.times = []
- this.getlist()
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'realName',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.realName}(${row.userId})`
+ },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 1
- }
- this.times = []
+ {
+ title: '持仓订单号(ID)',
+ dataIndex: 'positionSn',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.positionSn}(${row.id})`
+ },
},
- onChangeRangeDate (value, dateString) {
- this.queryParam.beginTime = dateString[0]
- this.queryParam.endTime = dateString[1]
+ {
+ title: '买卖方向',
+ dataIndex: 'orderDirection',
+ align: 'center',
+ scopedSlots: { customRender: 'orderDirection' },
},
- getagentlist () {
- var that = this
- this.agentloading = true
- nextagent(this.agentqueryParam).then(res => {
- this.agentlist = res.data.list
- setTimeout(() => {
- that.agentloading = false
- }, 500)
- })
+ {
+ title: '买入点数',
+ dataIndex: 'buyOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- getlist () {
- this.loading = true
- indexpositionlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
+ {
+ title: '卖出点数',
+ dataIndex: 'sellOrderPrice',
+ align: 'center',
+ scopedSlots: { customRender: 'sellOrderPrice' },
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '保证金',
+ dataIndex: 'allDepositAmt',
+ align: 'center',
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '浮动盈亏',
+ dataIndex: 'profitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'profitAndLose' },
+ },
+ {
+ title: '总盈亏',
+ dataIndex: 'allProfitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'allProfitAndLose' },
+ },
+ {
+ title: '数量(手)',
+ dataIndex: 'orderNum',
+ align: 'center',
+ },
+ {
+ title: '点浮动价',
+ dataIndex: 'eachPoint',
+ align: 'center',
+ },
+ {
+ title: '手续费',
+ dataIndex: 'orderFee',
+ align: 'center',
+ },
+ {
+ title: '锁定原因',
+ dataIndex: 'lockMsg',
+ align: 'center',
+ },
+ {
+ title: '买入时间',
+ dataIndex: 'buyOrderTime',
+ align: 'center',
+ width: 180,
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '卖出时间',
+ dataIndex: 'sellOrderTime',
+ 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,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ },
+ datalist: [],
+ agentlist: [],
+ agentloading: false,
+ times: [],
+ indexDialog: false,
+ clickitem: {},
+ agentqueryParam: {
+ pageNum: 1,
+ pageSize: 100,
+ },
}
+ },
+ created() {},
+ methods: {
+ getIndexdetails(item) {
+ this.clickitem = item
+ this.indexDialog = true
+ },
+ getDelflat(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除平仓单吗?此操作不可恢复',
+ onOk() {
+ var data = {
+ positionId: val,
+ }
+ indexpositiondel(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success(res.msg)
+ that.getlist()
+ } else {
+ that.$message.error(res.msg)
+ }
+ })
+ },
+ onCancel() {
+ console.log('Cancel')
+ },
+ })
+ },
+ getinit() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ beginTime: '',
+ endTime: '',
+ }
+ this.times = []
+ this.getlist()
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 1,
+ }
+ this.times = []
+ },
+ onChangeRangeDate(value, dateString) {
+ this.queryParam.beginTime = dateString[0]
+ this.queryParam.endTime = dateString[1]
+ },
+ 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
+ indexpositionlist(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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/position/components/index-hold.vue b/src/views/position/components/index-hold.vue
index 56ad684..324c97b 100644
--- a/src/views/position/components/index-hold.vue
+++ b/src/views/position/components/index-hold.vue
@@ -19,7 +19,8 @@
v-model="queryParam.agentId"
placeholder="请选择下级代理"
@focus="getagentlist"
- :loading="agentloading">
+ :loading="agentloading"
+ >
<a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">
{{ item.agentName }}
</a-select-option>
@@ -41,15 +42,14 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
-
</span>
</a-form-item>
</a-col>
@@ -64,17 +64,17 @@
:columns="columns"
:data-source="datalist"
rowKey="id"
- :scroll="{ x: 2800 }">
-
- <span slot="indexName" slot-scope="text,record">
+ :scroll="{ x: 2800 }"
+ >
+ <span slot="indexName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.indexName }}</span>
+ <span style="margin-right: 10px">{{ record.indexName }}</span>
<p>({{ record.indexCode }})</p>
</div>
</template>
</span>
- <span slot="positionType" slot-scope="text,record">
+ <span slot="positionType" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
@@ -83,7 +83,7 @@
</div>
</template>
</span>
- <span slot="orderDirection" slot-scope="text,record">
+ <span slot="orderDirection" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
@@ -92,11 +92,18 @@
</div>
</template>
</span>
- <span slot="now_price" slot-scope="text,record">
+ <span slot="now_price" slot-scope="text, record">
<template>
<div>
<p
- :class="Number(record.now_price) - record.buyOrderPrice < 0 ? 'greens' : Number(record.now_price) - record.buyOrderPrice > 0 ? 'reds' : ''">
+ :class="
+ Number(record.now_price) - record.buyOrderPrice < 0
+ ? 'greens'
+ : Number(record.now_price) - record.buyOrderPrice > 0
+ ? 'reds'
+ : ''
+ "
+ >
{{ Number(record.now_price).toFixed(2) }}
</p>
</div>
@@ -121,12 +128,17 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a
slot="action"
href="javascript:;"
- @click="Lockvisibledialig = true; clickpositionId = record.id"
- v-if="record.isLock == 0">锁仓</a>
+ @click="
+ Lockvisibledialig = true
+ clickpositionId = record.id
+ "
+ v-if="record.isLock == 0"
+ >锁仓</a
+ >
<a slot="action" href="javascript:;" @click="getLockopen(record.id)" v-else>解锁</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getCompulsoryclosing(record.positionSn)">强制平仓</a>
@@ -138,12 +150,14 @@
:visible="Lockvisibledialig"
:confirmLoading="Lockvisibleloading"
@ok="getDialogok"
- @cancel="handleCancel">
+ @cancel="handleCancel"
+ >
<a-form :form="Lockvisibleform" ref="createModal">
<a-form-item>
<a-input
v-decorator="['lockMsg', { rules: [{ required: true, message: '请输入锁仓原因!', whitespace: true }] }]"
- placeholder="请输入锁仓原因!" />
+ placeholder="请输入锁仓原因!"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -154,289 +168,288 @@
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
- name: 'IndexHold',
- data () {
- return {
- columns: [
- {
- title: '指数名称',
- dataIndex: 'indexName',
- align: 'center',
- width: 180,
- scopedSlots: { customRender: 'indexName' }
- },
- {
- title: '账户类型',
- dataIndex: 'positionType',
- align: 'center',
- scopedSlots: { customRender: 'positionType' }
- },
- {
- title: '用户名称(ID)',
- dataIndex: 'realName',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.realName}(${row.userId})`
- }
-
- },
- {
- title: '持仓订单号(ID)',
- dataIndex: 'positionSn',
- align: 'center',
- customRender: (text, row, index) => {
- return `${row.positionSn}(${row.id})`
- }
-
- },
- {
- title: '买卖方向',
- dataIndex: 'orderDirection',
- align: 'center',
- scopedSlots: { customRender: 'orderDirection' }
- },
- {
- title: '买入点数',
- dataIndex: 'buyOrderPrice',
- align: 'center',
- customRender: (text, row, index) => {
- return text.toFixed(2)
- }
- },
- {
- title: '最新点数',
- dataIndex: 'now_price',
- align: 'center',
- scopedSlots: { customRender: 'now_price' }
- },
- {
- title: '保证金',
- dataIndex: 'allDepositAmt',
- align: 'center'
- },
- {
- title: '浮动盈亏',
- dataIndex: 'profitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'profitAndLose' }
- },
- {
- title: '总盈亏',
- dataIndex: 'allProfitAndLose',
- align: 'center',
- scopedSlots: { customRender: 'allProfitAndLose' }
- },
- {
- title: '数量(手)',
- dataIndex: 'orderNum',
- align: 'center'
- },
- {
- title: '点浮动价',
- dataIndex: 'eachPoint',
- align: 'center'
- },
- {
- title: '双边手续费',
- dataIndex: 'orderFee',
- align: 'center'
- },
- {
- title: '锁定原因',
- dataIndex: 'lockMsg',
- align: 'center'
- },
- {
- title: '买入时间',
- dataIndex: 'buyOrderTime',
- 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,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- },
- datalist: [],
- agentlist: [],
- agentloading: false,
- Lockvisibledialig: false,
- Lockvisibleloading: false,
- Lockvisibleform: this.$form.createForm(this),
- clickpositionId: '',
- agentqueryParam: {
- pageNum: 1,
- pageSize: 100
- }
- }
- },
- created () {
- },
- methods: {
- getCompulsoryclosing (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认要强制平仓吗?',
- onOk () {
- var data = {
- positionSn: val
- }
- indexpositionsell(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: '平仓失败' })
- }
- }).catch(error => {
- that.$message.error({ content: '平仓失败' })
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ name: 'IndexHold',
+ data() {
+ return {
+ columns: [
+ {
+ title: '指数名称',
+ dataIndex: 'indexName',
+ align: 'center',
+ width: 180,
+ scopedSlots: { customRender: 'indexName' },
},
- getLockopen (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认要解锁该持仓单?',
- onOk () {
- var data = {
- state: 0,
- positionId: val
- }
- indexpositionlock(data).then(res => {
- if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
- that.getlist()
- } else {
- that.$message.error({ content: res.msg })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
+ {
+ title: '账户类型',
+ dataIndex: 'positionType',
+ align: 'center',
+ scopedSlots: { customRender: 'positionType' },
},
- handleCancel () {
- this.Lockvisibledialig = false
- const form = this.$refs.createModal.form
- form.resetFields()
+ {
+ title: '用户名称(ID)',
+ dataIndex: 'realName',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.realName}(${row.userId})`
+ },
},
- 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
- }
- indexpositionlock(data).then(res => {
- if (res.status == 0) {
- this.Lockvisibledialig = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.Lockvisibleloading = false
- })
- }
- })
+ {
+ title: '持仓订单号(ID)',
+ dataIndex: 'positionSn',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return `${row.positionSn}(${row.id})`
+ },
},
- getinit () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- }
- this.getlist()
+ {
+ title: '买卖方向',
+ dataIndex: 'orderDirection',
+ align: 'center',
+ scopedSlots: { customRender: 'orderDirection' },
},
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- positionType: '',
- agentId: undefined,
- userId: '',
- positionSn: '',
- state: 0
- }
+ {
+ title: '买入点数',
+ dataIndex: 'buyOrderPrice',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text.toFixed(2)
+ },
},
- getagentlist () {
- var that = this
- this.agentloading = true
- nextagent(this.agentqueryParam).then(res => {
- this.agentlist = res.data.list
- setTimeout(() => {
- that.agentloading = false
- }, 500)
- })
+ {
+ title: '最新点数',
+ dataIndex: 'now_price',
+ align: 'center',
+ scopedSlots: { customRender: 'now_price' },
},
- getlist () {
- this.loading = true
- indexpositionlist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.loading = false
- })
+ {
+ title: '保证金',
+ dataIndex: 'allDepositAmt',
+ align: 'center',
},
- onPageChange (page, pageSize) {
- this.queryParam.pageNum = page
- this.getlist()
+ {
+ title: '浮动盈亏',
+ dataIndex: 'profitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'profitAndLose' },
},
- onSizeChange (current, pageSize) {
- this.queryParam.pageNum = current
- this.queryParam.pageSize = pageSize
- this.getlist()
- }
+ {
+ title: '总盈亏',
+ dataIndex: 'allProfitAndLose',
+ align: 'center',
+ scopedSlots: { customRender: 'allProfitAndLose' },
+ },
+ {
+ title: '数量(手)',
+ dataIndex: 'orderNum',
+ align: 'center',
+ },
+ {
+ title: '点浮动价',
+ dataIndex: 'eachPoint',
+ align: 'center',
+ },
+ {
+ title: '双边手续费',
+ dataIndex: 'orderFee',
+ align: 'center',
+ },
+ {
+ title: '锁定原因',
+ dataIndex: 'lockMsg',
+ align: 'center',
+ },
+ {
+ title: '买入时间',
+ dataIndex: 'buyOrderTime',
+ 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,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ },
+ datalist: [],
+ agentlist: [],
+ agentloading: false,
+ Lockvisibledialig: false,
+ Lockvisibleloading: false,
+ Lockvisibleform: this.$form.createForm(this),
+ clickpositionId: '',
+ agentqueryParam: {
+ pageNum: 1,
+ pageSize: 100,
+ },
}
+ },
+ created() {},
+ methods: {
+ getCompulsoryclosing(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认要强制平仓吗?',
+ onOk() {
+ var data = {
+ positionSn: val,
+ }
+ indexpositionsell(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,
+ }
+ indexpositionlock(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.Lockvisibledialig = 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,
+ }
+ indexpositionlock(data).then((res) => {
+ if (res.status == 0) {
+ this.Lockvisibledialig = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.Lockvisibleloading = false
+ })
+ }
+ })
+ },
+ getinit() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ }
+ this.getlist()
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ positionType: '',
+ agentId: undefined,
+ userId: '',
+ positionSn: '',
+ state: 0,
+ }
+ },
+ 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
+ indexpositionlist(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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/position/createFinancing.vue b/src/views/position/createFinancing.vue
index 9f98952..76a6ab6 100644
--- a/src/views/position/createFinancing.vue
+++ b/src/views/position/createFinancing.vue
@@ -9,7 +9,8 @@
placeholder="输入用户id查询用户信息"
enter-button
@search="getUsersearch"
- v-decorator="['userId', { rules: [{ required: true, message: '请输入用户ID', }] }]" />
+ v-decorator="['userId', { rules: [{ required: true, message: '请输入用户ID' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -39,14 +40,15 @@
</div>
</a-col>
</a-row>
- <a-row class="form-row" :gutter="48" style="margin-top:20px;">
+ <a-row class="form-row" :gutter="48" style="margin-top: 20px">
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="选择股票">
<a-input-search
placeholder="输入股票代码查询股票信息"
enter-button
@search="getstockdetail"
- v-decorator="['stockCode', { rules: [{ required: true, message: '输入股票代码查询股票信息', }] }]" />
+ v-decorator="['stockCode', { rules: [{ required: true, message: '输入股票代码查询股票信息' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -61,26 +63,25 @@
{{ stockInfo.code }}
</a-descriptions-item>
<a-descriptions-item label="股票现价:">
- <span :class="stockInfo.hcrate < 0 ? 'greens' : 'reds'">{{ stockInfo.nowPrice
- }}</span>
+ <span :class="stockInfo.hcrate < 0 ? 'greens' : 'reds'">{{ stockInfo.nowPrice }}</span>
</a-descriptions-item>
<a-descriptions-item label="涨跌:">
- <span :class="stockInfo.hcrate < 0 ? 'greens' : 'reds'">{{ stockInfo.hcrate
- }}</span>
+ <span :class="stockInfo.hcrate < 0 ? 'greens' : 'reds'">{{ stockInfo.hcrate }}</span>
</a-descriptions-item>
</a-descriptions>
</div>
</a-col>
</a-row>
- <a-row class="form-row" :gutter="48" style="margin-top:20px;">
+ <a-row class="form-row" :gutter="48" style="margin-top: 20px">
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="买入时间">
<a-date-picker
show-time
- style="width:100%"
+ style="width: 100%"
@change="onChangeRangeDate"
- v-decorator="['buyTime', { rules: [{ required: true, message: '请填写买入时间', }] }]"
- format="YYYY-MM-DD HH:mm:ss">
+ v-decorator="['buyTime', { rules: [{ required: true, message: '请填写买入时间' }] }]"
+ format="YYYY-MM-DD HH:mm:ss"
+ >
</a-date-picker>
</a-form-item>
</a-col>
@@ -88,49 +89,50 @@
<a-form-item label="买入价格">
<a-input
placeholder="输入所选择时间点对应的价格"
- v-decorator="['buyPrice', { rules: [{ required: true, message: '请填写买入价格', }] }]" />
+ v-decorator="['buyPrice', { rules: [{ required: true, message: '请填写买入价格' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="杠杆倍数">
<a-input
placeholder="输入买入杠杆倍数"
- v-decorator="['lever', { rules: [{ required: true, message: '输入买入杠杆倍数', }] }]" />
+ v-decorator="['lever', { rules: [{ required: true, message: '输入买入杠杆倍数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="买入方向">
<a-select
placeholder="请选择买入方向"
- v-decorator="['buyType', { rules: [{ required: true, message: '请选择买入方向', }] }]">
+ v-decorator="['buyType', { 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-row class="form-row" :gutter="48" style="margin-top:20px;">
+ <a-row class="form-row" :gutter="48" style="margin-top: 20px">
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="买入数量">
<a-input-number
placeholder="请输入买入数量"
:min="details.buyMinNum"
:max="details.buyMaxNum"
- style="width:100%"
- v-decorator="['buyNum', { rules: [{ required: true, message: '请输入买入数量', }] }]" />
+ style="width: 100%"
+ v-decorator="['buyNum', { rules: [{ required: true, message: '请输入买入数量' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
</a-card>
</a-form>
<div class="bottomfixed">
- <div style="float:right">
- <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading">
- 保存当前设置
- </a-button>
+ <div style="float: right">
+ <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading"> 保存当前设置 </a-button>
</div>
</div>
-
</page-header-wrapper>
</template>
<script>
@@ -138,164 +140,164 @@
import { userdetail, stockgetSingleStock, positioncreate } from '@/api/position'
import pick from 'lodash.pick'
export default {
- name: 'Sharessetting',
- data () {
- return {
- addUserform: this.$form.createForm(this),
- loading: false,
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 16 }
- },
- addUserDialogloading: false,
- details: {},
- userInfo: {},
- stockInfo: {}
- }
- },
- mounted () {
- this.getdetail()
- },
- methods: {
- getdetail () {
- var that = this
- this.loading = true
- admingetSetting().then(res => {
- this.details = res.data
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- },
- getUsersearch () {
- userdetail({ userId: this.addUserform.getFieldValue('userId') }).then(res => {
- if (res.status === 0) {
- if (res.data) {
- this.userInfo = res.data
- } else {
- this.$message.error({ content: '没有该用户!' })
- this.userInfo = ''
- }
- } else {
- this.$message.error({ content: res.msg })
- this.userInfo = ''
- }
- })
- },
- getstockdetail () {
- stockgetSingleStock({ code: this.addUserform.getFieldValue('stockCode') }).then(res => {
- if (res.status === 0) {
- this.stockInfo = res.data.stock
- } else {
- this.$message.error({ content: res.msg })
- this.stockInfo = ''
- }
- })
- },
- onChangeRangeDate (value, dateString) {
- this.buyTime = dateString
- // this.addUserform.setFieldsValue(({buyTime: dateString }))
- },
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- values.buyTime = this.buyTime
- positioncreate(values).then(res => {
- if (res.status == 0) {
- this.$message.success({ content: '生成模拟持仓成功', duration: 2 })
- this.getdetail()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- }
+ name: 'Sharessetting',
+ data() {
+ return {
+ addUserform: this.$form.createForm(this),
+ loading: false,
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 16 },
+ },
+ addUserDialogloading: false,
+ details: {},
+ userInfo: {},
+ stockInfo: {},
}
+ },
+ mounted() {
+ this.getdetail()
+ },
+ methods: {
+ getdetail() {
+ var that = this
+ this.loading = true
+ admingetSetting().then((res) => {
+ this.details = res.data
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ getUsersearch() {
+ userdetail({ userId: this.addUserform.getFieldValue('userId') }).then((res) => {
+ if (res.status === 0) {
+ if (res.data) {
+ this.userInfo = res.data
+ } else {
+ this.$message.error({ content: '没有该用户!' })
+ this.userInfo = ''
+ }
+ } else {
+ this.$message.error(res.msg)
+ this.userInfo = ''
+ }
+ })
+ },
+ getstockdetail() {
+ stockgetSingleStock({ code: this.addUserform.getFieldValue('stockCode') }).then((res) => {
+ if (res.status === 0) {
+ this.stockInfo = res.data.stock
+ } else {
+ this.$message.error(res.msg)
+ this.stockInfo = ''
+ }
+ })
+ },
+ onChangeRangeDate(value, dateString) {
+ this.buyTime = dateString
+ // this.addUserform.setFieldsValue(({buyTime: dateString }))
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ values.buyTime = this.buyTime
+ positioncreate(values).then((res) => {
+ if (res.status == 0) {
+ this.$message.success({ content: '生成模拟持仓成功', duration: 2 })
+ this.getdetail()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
.greens {
- color: #52c41a;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
.bottomfixed {
- position: fixed;
- right: 0;
- bottom: 0;
- z-index: 9;
- width: 100%;
- height: 56px;
- padding: 0 24px;
- line-height: 56px;
- background: #fff;
- border-top: 1px solid #e8e8e8;
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ z-index: 9;
+ width: 100%;
+ height: 56px;
+ padding: 0 24px;
+ line-height: 56px;
+ background: #fff;
+ border-top: 1px solid #e8e8e8;
}
.card {
- margin-bottom: 24px;
+ margin-bottom: 24px;
}
/deep/ .ant-pro-global-footer {
- margin: 0 0 48px 0 !important;
+ margin: 0 0 48px 0 !important;
}
.popover-wrapper {
- :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
+ :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
+ min-width: 256px;
+ max-height: 290px;
+ padding: 0;
+ overflow: auto;
+ }
}
.antd-pro-pages-forms-style-errorIcon {
- user-select: none;
- margin-right: 24px;
- color: #f5222d;
- cursor: pointer;
+ user-select: none;
+ margin-right: 24px;
+ color: #f5222d;
+ cursor: pointer;
- i {
- margin-right: 4px;
- }
+ i {
+ margin-right: 4px;
+ }
}
.antd-pro-pages-forms-style-errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid #e8e8e8;
- cursor: pointer;
- transition: all .3s;
+ padding: 8px 16px;
+ list-style: none;
+ border-bottom: 1px solid #e8e8e8;
+ cursor: pointer;
+ transition: all 0.3s;
- &:hover {
- background: #e6f7ff;
- }
+ &:hover {
+ background: #e6f7ff;
+ }
- .antd-pro-pages-forms-style-errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: #f5222d;
- }
+ .antd-pro-pages-forms-style-errorIcon {
+ float: left;
+ margin-top: 4px;
+ margin-right: 12px;
+ padding-bottom: 22px;
+ color: #f5222d;
+ }
- .antd-pro-pages-forms-style-errorField {
- margin-top: 2px;
- color: rgba(0, 0, 0, .45);
- font-size: 12px;
- }
+ .antd-pro-pages-forms-style-errorField {
+ margin-top: 2px;
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ }
}
</style>
diff --git a/src/views/product/baseCurrency.vue b/src/views/product/baseCurrency.vue
index 2f0cce9..80f70fe 100644
--- a/src/views/product/baseCurrency.vue
+++ b/src/views/product/baseCurrency.vue
@@ -17,22 +17,26 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true; currentDetails = ''">
- 添加基础货币</a-button>
-
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >
+ 添加基础货币</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -48,9 +52,9 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
-
- <span slot="dynamicRate" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="dynamicRate" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.dynamicRate == 1 ? 'blue' : 'green'">
@@ -60,7 +64,7 @@
</template>
</span>
- <span slot="isUse" slot-scope="text,record">
+ <span slot="isUse" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.isUse == 1 ? 'green' : 'red'">
@@ -70,7 +74,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditbaseCurrency(record)">修改基础货币</a>
</template>
</a-table>
@@ -82,27 +86,32 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="基币名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入基币名称"
- v-decorator="['coinName', { rules: [{ required: true, message: '请输入基币名称', }] }]" />
+ v-decorator="['coinName', { rules: [{ required: true, message: '请输入基币名称' }] }]"
+ />
</a-form-item>
<a-form-item label="基币代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入基币代码"
- v-decorator="['coinCode', { rules: [{ required: true, message: '请输入基币代码', }] }]" />
+ v-decorator="['coinCode', { rules: [{ required: true, message: '请输入基币代码' }] }]"
+ />
</a-form-item>
<a-form-item label="默认汇率" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入默认汇率"
- v-decorator="['defaultRate', { rules: [{ required: true, message: '请输入默认汇率', }] }]" />
+ v-decorator="['defaultRate', { rules: [{ required: true, message: '请输入默认汇率' }] }]"
+ />
</a-form-item>
<a-form-item label="启用动态行情" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择启用动态行情"
- v-decorator="['dynamicRate', { rules: [{ required: true, message: '请选择启用动态行情', }] }]">
+ v-decorator="['dynamicRate', { rules: [{ required: true, message: '请选择启用动态行情' }] }]"
+ >
<a-select-option :value="0">启用动态汇率值</a-select-option>
<a-select-option :value="1">使用默认汇率值</a-select-option>
</a-select>
@@ -110,7 +119,8 @@
<a-form-item label="是否可用" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择是否可用"
- v-decorator="['isUse', { rules: [{ required: true, message: '请选择是否可用', }] }]">
+ v-decorator="['isUse', { rules: [{ required: true, message: '请选择是否可用' }] }]"
+ >
<a-select-option :value="0">不可用</a-select-option>
<a-select-option :value="1">可用</a-select-option>
</a-select>
@@ -124,183 +134,183 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Basecurrency',
- data () {
- return {
- columns: [
- {
- title: '基础货币名称 / 代码',
- dataIndex: 'name',
- align: 'center',
- width: 200,
- customRender: (text, row, index) => {
- return `${row.coinName}(${row.coinCode})`
- }
- },
- {
- title: '基础货币Gid',
- dataIndex: 'coinGid',
- align: 'center'
- },
- {
- title: '当前汇率',
- dataIndex: 'nowPrice',
- align: 'center'
- },
- {
- title: '默认汇率',
- dataIndex: 'defaultRate',
- align: 'center'
- },
- {
- title: '汇率使用',
- dataIndex: 'dynamicRate',
- align: 'center',
- scopedSlots: { customRender: 'dynamicRate' }
- },
- {
- title: '是否可用',
- dataIndex: 'isUse',
- align: 'center',
- scopedSlots: { customRender: 'isUse' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- 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,
- coinCode: '',
- coinName: ''
- },
- datalist: [],
+ name: 'Basecurrency',
+ data() {
+ return {
+ columns: [
+ {
+ title: '基础货币名称 / 代码',
+ dataIndex: 'name',
+ align: 'center',
+ width: 200,
+ customRender: (text, row, index) => {
+ return `${row.coinName}(${row.coinCode})`
+ },
+ },
+ {
+ title: '基础货币Gid',
+ dataIndex: 'coinGid',
+ align: 'center',
+ },
+ {
+ title: '当前汇率',
+ dataIndex: 'nowPrice',
+ align: 'center',
+ },
+ {
+ title: '默认汇率',
+ dataIndex: 'defaultRate',
+ align: 'center',
+ },
+ {
+ title: '汇率使用',
+ dataIndex: 'dynamicRate',
+ align: 'center',
+ scopedSlots: { customRender: 'dynamicRate' },
+ },
+ {
+ title: '是否可用',
+ dataIndex: 'isUse',
+ align: 'center',
+ scopedSlots: { customRender: 'isUse' },
+ },
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ 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,
+ coinCode: '',
+ coinName: '',
+ },
+ datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- fields: ['coinName', 'coinCode', 'defaultRate', 'dynamicRate', 'isUse'],
- currentDetails: ''
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- geteditbaseCurrency (val) {
- this.currentDetails = val
- this.addUserdialog = true
- 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) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- coinupdate(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- } else {
- values.id = 0
- values.coinGid = 'fx_s' + this.addUserform.getFieldValue('coinCode') + 'cny',
- coinadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- }
- })
- },
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- coinCode: '',
- coinName: ''
- }
- },
- getlist () {
- this.loading = true
- coinlist(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()
- }
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ fields: ['coinName', 'coinCode', 'defaultRate', 'dynamicRate', 'isUse'],
+ currentDetails: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ geteditbaseCurrency(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ coinupdate(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 {
+ values.id = 0
+ ;(values.coinGid = 'fx_s' + this.addUserform.getFieldValue('coinCode') + 'cny'),
+ coinadd(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
+ })
+ }
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ coinCode: '',
+ coinName: '',
+ }
+ },
+ getlist() {
+ this.loading = true
+ coinlist(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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/product/components/addfuturesdialog.vue b/src/views/product/components/addfuturesdialog.vue
index e5bb055..8121538 100644
--- a/src/views/product/components/addfuturesdialog.vue
+++ b/src/views/product/components/addfuturesdialog.vue
@@ -6,7 +6,8 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<p>该期货交易规则的设置信息,请根据您的设置仿照示例填写,价格单位为元,数量单位为手</p>
<a-row :gutter="48">
@@ -14,14 +15,16 @@
<a-form-item label="期货名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入期货名称"
- v-decorator="['futuresName', { rules: [{ required: true, message: '请输入期货名称', }] }]" />
+ v-decorator="['futuresName', { rules: [{ required: true, message: '请输入期货名称' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="期货代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入期货代码"
- v-decorator="['futuresCode', { rules: [{ required: true, message: '请输入期货代码', }] }]" />
+ v-decorator="['futuresCode', { rules: [{ required: true, message: '请输入期货代码' }] }]"
+ />
</a-form-item>
</a-col>
@@ -29,7 +32,8 @@
<a-form-item label="每手手续费" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入每手手续费"
- v-decorator="['transFee', { rules: [{ required: true, message: '请输入每手手续费', }] }]" />
+ v-decorator="['transFee', { rules: [{ required: true, message: '请输入每手手续费' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -38,7 +42,8 @@
<a-form-item label="是否可交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择交易状态"
- v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态', }] }]">
+ v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态' }] }]"
+ >
<a-select-option value="0">不可交易</a-select-option>
<a-select-option value="1">可交易</a-select-option>
</a-select>
@@ -48,7 +53,8 @@
<a-form-item label="是否首页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="首页显示状态"
- v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态', }] }]">
+ v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态' }] }]"
+ >
<a-select-option value="0">不显示</a-select-option>
<a-select-option value="1">显示</a-select-option>
</a-select>
@@ -58,7 +64,8 @@
<a-form-item label="是否列表页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="列表页显示状态"
- v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态', }] }]">
+ v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态' }] }]"
+ >
<a-select-option value="0">不显示</a-select-option>
<a-select-option value="1">显示</a-select-option>
</a-select>
@@ -70,12 +77,14 @@
<a-form-item label="买入手数限制" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="请输入最小手数"
- v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小手数', }] }]" />
+ v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小手数' }] }]"
+ />
手
<span class="separator">~ </span>
<a-input
placeholder="请输入最大手数"
- v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大手数', }] }]" />
+ v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大手数' }] }]"
+ />
手
</a-form-item>
</a-col>
@@ -83,10 +92,12 @@
<a-form-item label="每手保证金" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="请输入金额"
- v-decorator="['futuresStandard', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['futuresStandard', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
<a-select
placeholder="请选择基础货币单位"
- v-decorator="['coinCode', { rules: [{ required: true, message: '请选择基础货币单位', }] }]">
+ v-decorator="['coinCode', { rules: [{ required: true, message: '请选择基础货币单位' }] }]"
+ >
<a-select-option v-for="(item, index) in coinlist" :key="index" :value="item.coinCode">
{{ item.coinName }}
</a-select-option>
@@ -99,12 +110,14 @@
<a-form-item label="上午" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="例:1:00"
- v-decorator="['transAmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:1:00', }] }]" />
+ v-decorator="['transAmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:1:00' }] }]"
+ />
点
<span class="separator">~ </span>
<a-input
placeholder="例:12:00"
- v-decorator="['transAmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00', }] }]" />
+ v-decorator="['transAmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00' }] }]"
+ />
点
</a-form-item>
</a-col>
@@ -112,12 +125,14 @@
<a-form-item label="下午" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="例:12:00"
- v-decorator="['transPmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00', }] }]" />
+ v-decorator="['transPmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00' }] }]"
+ />
点
<span class="separator">~ </span>
<a-input
placeholder="例:23:00"
- v-decorator="['transPmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:23:00', }] }]" />
+ v-decorator="['transPmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:23:00' }] }]"
+ />
点
</a-form-item>
</a-col>
@@ -125,17 +140,21 @@
<a-row :gutter="48">
<a-col :md="24" :lg="24" :sm="24">
<a-form-item label="每标准手规格" :labelCol="labelCol2" :wrapperCol="wrapperCol1">
- <div style="display:flex;width: 100%;margin-top: 5px;">
- <span style="width:300px;margin-left: 10px;line-height: 30px;align-items: center;">1标准手 =</span>
+ <div style="display: flex; width: 100%; margin-top: 5px">
+ <span style="width: 300px; margin-left: 10px; line-height: 30px; align-items: center">1标准手 =</span>
<a-input
placeholder="每标准手数量"
- v-decorator="['depositAmt', { rules: [{ required: true, message: '每标准手数量', }] }]" />
+ v-decorator="['depositAmt', { rules: [{ required: true, message: '每标准手数量' }] }]"
+ />
/
<span class="separator">~ </span>
<a-input
placeholder="单位"
- v-decorator="['futuresUnit', { rules: [{ required: true, message: '单位', }] }]" />
- <span style="width:800px;margin-left: 10px;line-height: 30px;align-items: center;">例如美原油:1标准手 = 1000桶</span>
+ v-decorator="['futuresUnit', { rules: [{ required: true, message: '单位' }] }]"
+ />
+ <span style="width: 800px; margin-left: 10px; line-height: 30px; align-items: center"
+ >例如美原油:1标准手 = 1000桶</span
+ >
</div>
</a-form-item>
</a-col>
@@ -147,85 +166,84 @@
<script>
import { futuresadd } from '@/api/product'
export default {
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- },
- coinlist: {
- type: Array,
- default: function () {
- return []
- }
- }
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- labelCol1: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 6 }
- },
- wrapperCol1: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 18 }
- },
- labelCol2: {
- xs: { span: 4 },
- sm: { span: 4 },
- md: { span: 4 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false
- }
+ coinlist: {
+ type: Array,
+ default: function () {
+ return []
+ },
},
- methods: {
- // 新增用户取消弹窗
- 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) {
- this.addUserDialogloading = true
- values.futuresGid = 'hf_' + this.addUserform.getFieldValue('futuresCode'),
- futuresadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ labelCol1: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 6 },
+ },
+ wrapperCol1: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 18 },
+ },
+ labelCol2: {
+ xs: { span: 4 },
+ sm: { span: 4 },
+ md: { span: 4 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
+ }
+ },
+ methods: {
+ // 新增用户取消弹窗
+ 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) {
+ this.addUserDialogloading = true
+ ;(values.futuresGid = 'hf_' + this.addUserform.getFieldValue('futuresCode')),
+ futuresadd(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
})
}
- }
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
/deep/ .ant-form-item-children {
- display: flex;
- align-items: center;
+ display: flex;
+ align-items: center;
}
</style>
diff --git a/src/views/product/components/addindexdialog.vue b/src/views/product/components/addindexdialog.vue
index c079aa6..2f58a52 100644
--- a/src/views/product/components/addindexdialog.vue
+++ b/src/views/product/components/addindexdialog.vue
@@ -6,7 +6,8 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<p>指数ID填写规范,例: 上证指数 为 "sh + 股票代码",深圳指数 为 "sz + 股票代码"</p>
<a-row :gutter="48">
@@ -14,21 +15,24 @@
<a-form-item label="指数名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入指数名称"
- v-decorator="['indexName', { rules: [{ required: true, message: '请输入指数名称', }] }]" />
+ v-decorator="['indexName', { rules: [{ required: true, message: '请输入指数名称' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="指数代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入指数代码"
- v-decorator="['indexCode', { rules: [{ required: true, message: '请输入指数代码', }] }]" />
+ v-decorator="['indexCode', { rules: [{ required: true, message: '请输入指数代码' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="指数ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入指数ID"
- v-decorator="['indexGid', { rules: [{ required: true, message: '请输入指数ID', }] }]" />
+ v-decorator="['indexGid', { rules: [{ required: true, message: '请输入指数ID' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -38,21 +42,24 @@
<a-form-item label="每手保证金" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="每手保证金(例:10000)"
- v-decorator="['depositAmt', { rules: [{ required: true, message: '请输入每手保证金', }] }]" />
+ v-decorator="['depositAmt', { rules: [{ required: true, message: '请输入每手保证金' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="双边手续费" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="双边手续费(例:200)"
- v-decorator="['transFee', { rules: [{ required: true, message: '请输入双边手续费', }] }]" />
+ v-decorator="['transFee', { rules: [{ required: true, message: '请输入双边手续费' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="每点浮动价" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="每点浮动价(例:300)"
- v-decorator="['eachPoint', { rules: [{ required: true, message: '请输入每点浮动价', }] }]" />
+ v-decorator="['eachPoint', { rules: [{ required: true, message: '请输入每点浮动价' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -61,21 +68,24 @@
<a-form-item label="最大买入手数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="最大买入手数(例:200)"
- v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大买入手数', }] }]" />
+ v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大买入手数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="最小买入手数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="最小买入手数(例:1)"
- v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小买入手数', }] }]" />
+ v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小买入手数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="是否可交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择交易状态"
- v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态', }] }]">
+ v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态' }] }]"
+ >
<a-select-option value="0">不可交易</a-select-option>
<a-select-option value="1">可交易</a-select-option>
</a-select>
@@ -87,7 +97,8 @@
<a-form-item label="是否首页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="首页显示状态"
- v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态', }] }]">
+ v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态' }] }]"
+ >
<a-select-option value="0">不显示</a-select-option>
<a-select-option value="1">显示</a-select-option>
</a-select>
@@ -97,7 +108,8 @@
<a-form-item label="是否列表页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="列表页显示状态"
- v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态', }] }]">
+ v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态' }] }]"
+ >
<a-select-option value="0">不显示</a-select-option>
<a-select-option value="1">显示</a-select-option>
</a-select>
@@ -111,64 +123,63 @@
<script>
import { indexaddIndex, querySingleIndex } from '@/api/product'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false
- }
- },
- methods: {
- // 新增用户取消弹窗
- 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) {
- querySingleIndex({ indexCode: this.addUserform.getFieldValue('indexGid') }).then(res => {
- if (res.data.name == null || res.data.name === '') {
- this.$message.error('您输入的指数不正确,请添加正确的指数')
- } else {
- this.addUserDialogloading = true
- indexaddIndex(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
}
+ },
+ methods: {
+ // 新增用户取消弹窗
+ 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) {
+ querySingleIndex({ indexCode: this.addUserform.getFieldValue('indexGid') }).then((res) => {
+ if (res.data.name == null || res.data.name === '') {
+ this.$message.error('您输入的指数不正确,请添加正确的指数')
+ } else {
+ this.addUserDialogloading = true
+ indexaddIndex(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
+ })
+ }
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/product/components/editfuturesdialog.vue b/src/views/product/components/editfuturesdialog.vue
index 1fbacfa..ee79d76 100644
--- a/src/views/product/components/editfuturesdialog.vue
+++ b/src/views/product/components/editfuturesdialog.vue
@@ -6,7 +6,8 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<p>该期货交易规则的设置信息,请根据您的设置仿照示例填写,价格单位为元,数量单位为手</p>
<a-row :gutter="48">
@@ -15,21 +16,21 @@
<a-input
placeholder="请输入期货名称"
disabled
- v-decorator="['futuresName', { rules: [{ required: true, message: '请输入期货名称', }] }]" />
+ v-decorator="['futuresName', { rules: [{ required: true, message: '请输入期货名称' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="双边手续费" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入双边手续费(例:200)"
- v-decorator="['transFee', { rules: [{ required: true, message: '请输入双边手续费(例:200)', }] }]" />
+ v-decorator="['transFee', { rules: [{ required: true, message: '请输入双边手续费(例:200)' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="8" :lg="8" :sm="12">
<a-form-item label="每点浮动价" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input
- placeholder="(单位:USD)"
- v-decorator="['eachPoint', {}]" />
+ <a-input placeholder="(单位:USD)" v-decorator="['eachPoint', {}]" />
</a-form-item>
</a-col>
</a-row>
@@ -38,7 +39,8 @@
<a-form-item label="是否可交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择交易状态"
- v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态', }] }]">
+ v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态' }] }]"
+ >
<a-select-option :value="0">不可交易</a-select-option>
<a-select-option :value="1">可交易</a-select-option>
</a-select>
@@ -48,7 +50,8 @@
<a-form-item label="是否首页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="首页显示状态"
- v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态', }] }]">
+ v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态' }] }]"
+ >
<a-select-option :value="0">不显示</a-select-option>
<a-select-option :value="1">显示</a-select-option>
</a-select>
@@ -58,7 +61,8 @@
<a-form-item label="是否列表页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="列表页显示状态"
- v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态', }] }]">
+ v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态' }] }]"
+ >
<a-select-option :value="0">不显示</a-select-option>
<a-select-option :value="1">显示</a-select-option>
</a-select>
@@ -70,12 +74,14 @@
<a-form-item label="买入手数限制" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="请输入最小手数"
- v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小手数', }] }]" />
+ v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小手数' }] }]"
+ />
手
<span class="separator">~ </span>
<a-input
placeholder="请输入最大手数"
- v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大手数', }] }]" />
+ v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大手数' }] }]"
+ />
手
</a-form-item>
</a-col>
@@ -83,10 +89,12 @@
<a-form-item label="每手保证金" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="请输入金额"
- v-decorator="['futuresStandard', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['futuresStandard', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
<a-select
placeholder="请选择基础货币单位"
- v-decorator="['coinCode', { rules: [{ required: true, message: '请选择基础货币单位', }] }]">
+ v-decorator="['coinCode', { rules: [{ required: true, message: '请选择基础货币单位' }] }]"
+ >
<a-select-option v-for="(item, index) in coinlist" :key="index" :value="item.coinCode">
{{ item.coinName }}
</a-select-option>
@@ -99,12 +107,14 @@
<a-form-item label="上午" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="例:1:00"
- v-decorator="['transAmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:1:00', }] }]" />
+ v-decorator="['transAmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:1:00' }] }]"
+ />
点
<span class="separator">~ </span>
<a-input
placeholder="例:12:00"
- v-decorator="['transAmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00', }] }]" />
+ v-decorator="['transAmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00' }] }]"
+ />
点
</a-form-item>
</a-col>
@@ -112,12 +122,14 @@
<a-form-item label="下午" :labelCol="labelCol1" :wrapperCol="wrapperCol1">
<a-input
placeholder="例:12:00"
- v-decorator="['transPmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00', }] }]" />
+ v-decorator="['transPmBegin', { rules: [{ required: true, message: '请输入上午开始时间 例:12:00' }] }]"
+ />
点
<span class="separator">~ </span>
<a-input
placeholder="例:23:00"
- v-decorator="['transPmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:23:00', }] }]" />
+ v-decorator="['transPmEnd', { rules: [{ required: true, message: '请输入上午开始时间 例:23:00' }] }]"
+ />
点
</a-form-item>
</a-col>
@@ -125,20 +137,21 @@
<a-row :gutter="48">
<a-col :md="24" :lg="24" :sm="24">
<a-form-item label="每标准手规格" :labelCol="labelCol2" :wrapperCol="wrapperCol1">
- <div style="display:flex;width: 100%;margin-top: 5px;">
- <span style="width:300px;margin-left: 10px;line-height: 30px;align-items: center;">1标准手
- =</span>
+ <div style="display: flex; width: 100%; margin-top: 5px">
+ <span style="width: 300px; margin-left: 10px; line-height: 30px; align-items: center">1标准手 =</span>
<a-input
placeholder="每标准手数量"
- v-decorator="['depositAmt', { rules: [{ required: true, message: '每标准手数量', }] }]" />
+ v-decorator="['depositAmt', { rules: [{ required: true, message: '每标准手数量' }] }]"
+ />
/
<span class="separator">~ </span>
<a-input
placeholder="单位"
- v-decorator="['futuresUnit', { rules: [{ required: true, message: '单位', }] }]" />
- <span
- style="width:800px;margin-left: 10px;line-height: 30px;align-items: center;">例如美原油:1标准手
- = 1000桶</span>
+ v-decorator="['futuresUnit', { rules: [{ required: true, message: '单位' }] }]"
+ />
+ <span style="width: 800px; margin-left: 10px; line-height: 30px; align-items: center"
+ >例如美原油:1标准手 = 1000桶</span
+ >
</div>
</a-form-item>
</a-col>
@@ -151,94 +164,110 @@
import { futuresupdate } from '@/api/product'
import pick from 'lodash.pick'
export default {
- props: {
- getlist: {
- type: Function,
- default: function () {
- }
- },
- coinlist: {
- type: Array,
- default: function () {
- return []
- }
- }
+ props: {
+ getlist: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- labelCol1: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 6 }
- },
- wrapperCol1: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 18 }
- },
- labelCol2: {
- xs: { span: 4 },
- sm: { span: 4 },
- md: { span: 4 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false,
- fields: ['futuresName', 'depositAmt', 'transFee', 'futuresUnit', 'maxNum', 'minNum', 'homeShow', 'listShow', 'transState', 'futuresStandard', 'coinCode', 'transAmBegin', 'transAmEnd', 'transPmBegin', 'transPmEnd', 'eachPoint'],
- currentDetails: {}
- }
+ coinlist: {
+ type: Array,
+ default: function () {
+ return []
+ },
},
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.addUserdialog = true
- 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) {
- this.addUserDialogloading = true
- values.id = this.currentDetails.id
- values.futuresName = undefined
- futuresupdate(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ labelCol1: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 6 },
+ },
+ wrapperCol1: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 18 },
+ },
+ labelCol2: {
+ xs: { span: 4 },
+ sm: { span: 4 },
+ md: { span: 4 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
+ fields: [
+ 'futuresName',
+ 'depositAmt',
+ 'transFee',
+ 'futuresUnit',
+ 'maxNum',
+ 'minNum',
+ 'homeShow',
+ 'listShow',
+ 'transState',
+ 'futuresStandard',
+ 'coinCode',
+ 'transAmBegin',
+ 'transAmEnd',
+ 'transPmBegin',
+ 'transPmEnd',
+ 'eachPoint',
+ ],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ values.id = this.currentDetails.id
+ values.futuresName = undefined
+ futuresupdate(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
+ })
+ }
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
/deep/ .ant-form-item-children {
- display: flex;
- align-items: center;
+ display: flex;
+ align-items: center;
}
</style>
diff --git a/src/views/product/components/editindexdialog.vue b/src/views/product/components/editindexdialog.vue
index 16e7d4f..63b8133 100644
--- a/src/views/product/components/editindexdialog.vue
+++ b/src/views/product/components/editindexdialog.vue
@@ -6,37 +6,44 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="每手保证金" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="每手保证金(例:10000)"
- v-decorator="['depositAmt', { rules: [{ required: true, message: '请输入每手保证金', }] }]" />
+ v-decorator="['depositAmt', { rules: [{ required: true, message: '请输入每手保证金' }] }]"
+ />
</a-form-item>
<a-form-item label="双边手续费" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="双边手续费(例:200)"
- v-decorator="['transFee', { rules: [{ required: true, message: '请输入双边手续费', }] }]" />
+ v-decorator="['transFee', { rules: [{ required: true, message: '请输入双边手续费' }] }]"
+ />
</a-form-item>
<a-form-item label="每点浮动价" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="每点浮动价(例:300)"
- v-decorator="['eachPoint', { rules: [{ required: true, message: '请输入每点浮动价', }] }]" />
+ v-decorator="['eachPoint', { rules: [{ required: true, message: '请输入每点浮动价' }] }]"
+ />
</a-form-item>
<a-form-item label="最大买入手数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="最大买入手数(例:200)"
- v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大买入手数', }] }]" />
+ v-decorator="['maxNum', { rules: [{ required: true, message: '请输入最大买入手数' }] }]"
+ />
</a-form-item>
<a-form-item label="最小买入手数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="最小买入手数(例:1)"
- v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小买入手数', }] }]" />
+ v-decorator="['minNum', { rules: [{ required: true, message: '请输入最小买入手数' }] }]"
+ />
</a-form-item>
<a-form-item label="是否可交易" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择交易状态"
- v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态', }] }]">
+ v-decorator="['transState', { rules: [{ required: true, message: '请选择交易状态' }] }]"
+ >
<a-select-option :value="0">不可交易</a-select-option>
<a-select-option :value="1">可交易</a-select-option>
</a-select>
@@ -44,7 +51,8 @@
<a-form-item label="是否首页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="首页显示状态"
- v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态', }] }]">
+ v-decorator="['homeShow', { rules: [{ required: true, message: '请选择首页显示状态' }] }]"
+ >
<a-select-option :value="0">不显示</a-select-option>
<a-select-option :value="1">显示</a-select-option>
</a-select>
@@ -52,7 +60,8 @@
<a-form-item label="是否列表页显示" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="列表页显示状态"
- v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态', }] }]">
+ v-decorator="['listShow', { rules: [{ required: true, message: '请选择列表页显示状态' }] }]"
+ >
<a-select-option :value="0">不显示</a-select-option>
<a-select-option :value="1">显示</a-select-option>
</a-select>
@@ -65,68 +74,67 @@
import { indexupdateIndex } from '@/api/product'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- },
- agentlist: {
- type: Array
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['depositAmt', 'transFee', 'eachPoint', 'maxNum', 'minNum', 'homeShow', 'listShow', 'transState'],
- currentDetails: {}
- }
+ agentlist: {
+ type: Array,
},
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- },
- // 新增用户取消弹窗
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- // 新增用户确定
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- values.id = this.currentDetails.id
- this.editUserDialogloading = true
- indexupdateIndex(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['depositAmt', 'transFee', 'eachPoint', 'maxNum', 'minNum', 'homeShow', 'listShow', 'transState'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ },
+ // 新增用户取消弹窗
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ // 新增用户确定
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ values.id = this.currentDetails.id
+ this.editUserDialogloading = true
+ indexupdateIndex(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/product/markettrading.vue b/src/views/product/markettrading.vue
index c596ce8..24741eb 100644
--- a/src/views/product/markettrading.vue
+++ b/src/views/product/markettrading.vue
@@ -33,7 +33,6 @@
</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">
@@ -48,11 +47,13 @@
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true, currentdetail = ''">
- 添加盘前</a-button>
+ @click=";(addUserdialog = true), (currentdetail = '')"
+ >
+ 添加盘前</a-button
+ >
</a-col>
</a-row>
- </a-form>
+ <!-- </a-form> -->
</div>
</a-card>
@@ -63,9 +64,9 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="newlistId">
-
- <span slot="type" slot-scope="text,record">
+ rowKey="newlistId"
+ >
+ <span slot="type" slot-scope="text, record">
<template>
<div>
<a-tag>
@@ -75,7 +76,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <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>
@@ -89,21 +90,24 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-row :gutter="48">
<a-col :md="12" :lg="12" :sm="12">
- <a-form-item label="股票code" :labelCol="labelCol" :wrapperCol="wrapperCol">
+ <a-form-item label="股票代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
- placeholder="请输入股票code"
- v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票code', }] }]" />
+ placeholder="请输入股票代码"
+ v-decorator="['stockCode', { 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="['stockName', { rules: [{ required: true, message: '请输入股票名称', }] }]" />
+ v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -112,17 +116,19 @@
<a-form-item label="盘前价格" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入盘前价格"
- v-decorator="['price', { rules: [{ required: true, message: '请输入盘前价格', }] }]" />
+ v-decorator="['price', { 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
+ :value="typeValue"
placeholder="请选择金额模式"
- v-decorator="['type', { rules: [{ required: true, message: '请选择金额模式', }] }]"
+ v-decorator="['type', { rules: [{ required: true, message: '请选择金额模式' }] }]"
>
- <a-select-option :value="0">价格</a-select-option>
- <a-select-option :value="1">百分比</a-select-option>
+ <a-select-option value="0">价格</a-select-option>
+ <a-select-option value="1">百分比</a-select-option>
</a-select>
</a-form-item>
</a-col>
@@ -132,14 +138,16 @@
<a-form-item label="股票开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入股票调价开始时间"
- v-decorator="['startTime', { rules: [{ required: true, message: '请输入股票调价开始时间', }] }]" />
+ v-decorator="['startTime', { 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="['endTime', { rules: [{ required: true, message: '请输入股票结束时间', }] }]" />
+ v-decorator="['endTime', { rules: [{ required: true, message: '请输入股票结束时间' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -148,270 +156,240 @@
</page-header-wrapper>
</template>
<script>
- import {
- subscribelist,
- subscribeadd,
- subscribeupdate,
- subscribedel
- } from '@/api/newshares'
- import {
- paylist,
- payupdate,
- payadd,
- paydel,
- adminupload,
- queryAll,
- updatetime,
- SettingqueryAll,
- stockupdata,
- stockadd,
- stockdelete
- } from '@/api/allsetting'
- import moment from 'moment'
- import pick from 'lodash.pick'
- export default {
- name: 'Shares',
- data () {
- return {
- columns: [
- {
- title: '股票代码',
- dataIndex: 'stockCode',
- align: 'center'
+import { SettingqueryAll, stockupdata, stockadd, stockdelete } from '@/api/allsetting'
+import moment from 'moment'
+import pick from 'lodash.pick'
+export default {
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: '股票代码',
+ dataIndex: 'stockCode',
+ align: 'center',
+ },
+ {
+ title: '股票名称',
+ dataIndex: 'stockName',
+ align: 'center',
+ },
+ {
+ title: '股票开始时间',
+ dataIndex: 'startTime',
+ align: 'center',
+ },
+ {
+ title: '股票结束时间',
+ dataIndex: 'endTime',
+ align: 'center',
+ },
+ {
+ title: '类型',
+ dataIndex: 'type',
+ align: 'center',
+ scopedSlots: { customRender: 'type' },
+ },
+ {
+ title: '金额/百分比',
+ dataIndex: 'price',
+ align: 'center',
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: {
+ customRender: 'action',
},
- {
- title: '股票名称',
- dataIndex: 'stockName',
- align: 'center'
- },
- {
- title: '股票开始时间',
- dataIndex: 'startTime',
- align: 'center'
- },
- {
- title: '股票结束时间',
- dataIndex: 'endTime',
- align: 'center'
- },
- {
- title: '类型',
- dataIndex: 'type',
- align: 'center',
- scopedSlots: { customRender: 'type' }
- },
- {
- title: '金额/百分比',
- dataIndex: 'price',
- align: 'center'
- },
+ },
+ ],
+ 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,
+ typeValue: 0,
+ queryParam: {
+ pageNum: 1,
+ pageSize: 10,
+ code: '',
+ name: '',
+ zt: undefined,
+ type: 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,
- {
- title: '操作',
- key: 'action',
- align: 'center',
- scopedSlots: {
- customRender: 'action'
+ fields: ['stockCode', 'stockName', 'startTime', 'endTime', 'type', 'price'],
+ currentdetail: '',
+ subscribeTime: '',
+ subscriptionTime: '',
+ }
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ getdeleteStock(val) {
+ var that = this
+ this.$confirm({
+ title: '提示',
+ content: '确认删除该盘前吗?此操作不可恢复!',
+ onOk() {
+ var data = {
+ id: val.id,
+ }
+ stockdelete(data).then((res) => {
+ if (res.status == 0) {
+ that.$message.success({
+ content: res.msg,
+ duration: 2,
+ })
+ that.getinit()
+ } else {
+ that.$message.error({
+ content: res.msg,
+ })
}
- }
- ],
- 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,
- code: '',
- name: '',
- zt: undefined,
- type: undefined
+ onCancel() {
+ console.log('Cancel')
},
- 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,
+ })
+ },
+ getsubscribeTime(date, dateString) {
+ this.subscribeTime = 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))
+ this.addUserform.setFieldsValue({
+ subscriptionTime: moment(val.subscriptionTime ? val.subscriptionTime : currentTime).format(
+ 'YYYY-MM-DD HH:mm:ss'
+ ),
+ })
+ this.addUserform.setFieldsValue({
+ subscribeTime: moment(val.subscribeTime ? val.subscribeTime : currentTime).format('YYYY-MM-DD HH:mm:ss'),
+ })
+ },
+ CanceladdUserdialog() {
+ this.addUserdialog = false
+ const form = this.$refs.addUserform.form
+ form.resetFields()
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
- fields: ['stockCode', 'stockName', 'startTime', 'endTime', 'type', 'price' ],
- currentdetail: '',
- subscribeTime: '',
- subscriptionTime: ''
-
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ if (this.currentdetail != '') {
+ this.addUserDialogloading = true
+ values.id = this.currentdetail.id
+ // values.subscriptionTime = this.subscriptionTime
+ // values.subscribeTime = this.subscribeTime
+ stockupdata(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
+ stockadd(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: '',
+ zt: undefined,
+ type: undefined,
}
},
- created () {
+ getinit() {
+ this.getqueryParam()
+ this.pagination.current = 1
this.getlist()
},
- methods: {
- getdeleteStock (val) {
- var that = this
- this.$confirm({
- title: '提示',
- content: '确认删除该盘前吗?此操作不可恢复!',
- onOk () {
- var data = {
- id: val.id
- }
- stockdelete(data).then(res => {
- if (res.status == 0) {
- that.$message.success({
- content: res.msg,
- duration: 2
- })
- that.getinit()
- } else {
- that.$message.error({
- content: res.msg
- })
- }
- })
- },
- onCancel () {
- console.log('Cancel')
- }
- })
- },
- getsubscribeTime (date, dateString) {
- this.subscribeTime = 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))
- this.addUserform.setFieldsValue({
- subscriptionTime: moment(val.subscriptionTime ? val.subscriptionTime : currentTime).format(
- 'YYYY-MM-DD HH:mm:ss')
- })
- this.addUserform.setFieldsValue({
- subscribeTime: moment(val.subscribeTime ? val.subscribeTime : currentTime).format('YYYY-MM-DD HH:mm:ss')
- })
- // this.subscribeTime = moment(val.subscribeTime).format('YYYY-MM-DD HH:mm:ss')
- // this.subscriptionTime = moment(val.subscriptionTime).format('YYYY-MM-DD HH:mm:ss')
- },
- 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
- // values.subscriptionTime = this.subscriptionTime
- // values.subscribeTime = this.subscribeTime
- stockupdata(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({
- content: res.msg,
- duration: 2
- })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({
- content: res.msg
- })
- }
- this.addUserDialogloading = false
- })
- } else {
- this.addUserDialogloading = true
- stockadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({
- content: res.msg,
- duration: 2
- })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({
- content: res.msg
- })
- }
- this.addUserDialogloading = false
- })
- }
- }
- })
- },
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- code: '',
- name: '',
- zt: undefined,
- type: undefined
- }
- },
- getinit () {
- this.getqueryParam()
- this.pagination.current = 1
- this.getlist()
- },
- getlist () {
- this.loading = true
- SettingqueryAll(this.queryParam).then(res => {
- this.datalist = res.data
- 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()
- }
- }
- }
+ getlist() {
+ this.loading = true
+ SettingqueryAll(this.queryParam).then((res) => {
+ this.datalist = res.data
+ 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/product/shares.vue b/src/views/product/shares.vue
index e303d97..04978c8 100644
--- a/src/views/product/shares.vue
+++ b/src/views/product/shares.vue
@@ -55,13 +55,13 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, pagination.current = 1,getlist()">查询
+ @click=";(queryParam.pageNum = 1), (pagination.current = 1), getlist()"
+ >查询
</a-button>
<!-- <a-button
@@ -70,7 +70,6 @@
style="margin-left: 8px"
@click="addUserdialog = true">
添加股票</a-button> -->
-
</span>
</a-form-item>
</a-col>
@@ -86,35 +85,47 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
- <span slot="stockName" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="stockName" slot-scope="text, record">
<template>
<div>
- <span style="margin-right:10px">{{ record.stockName }}</span>
- <a-tag color="green">{{ record.stockCode }}
+ <span style="margin-right: 10px">{{ record.stockName }}</span>
+ <a-tag color="green">{{ record.stockCode }} </a-tag>
+ </div>
+ </template>
+ </span>
+ <span slot="stockType" slot-scope="text, record">
+ <template>
+ <div>
+ <a-tag color="red"
+ >{{
+ record.stockType == 'sz'
+ ? '深股'
+ : record.stockType == 'sh'
+ ? '沪股'
+ : record.stockType == 'bj'
+ ? '京股'
+ : record.stockType == 'hk'
+ ? '港股'
+ : record.stockType == 'us'
+ ? '美股'
+ : ''
+ }}
</a-tag>
</div>
</template>
</span>
- <span slot="stockType" slot-scope="text,record">
+ <span slot="nowPrice" slot-scope="text, record">
<template>
<div>
- <a-tag color="red">{{ record.stockType == 'sz' ? '深股' : record.stockType == 'sh' ? '沪股' : record.stockType == 'bj' ? '京股' : record.stockType == 'hk' ? '港股' : record.stockType == 'us' ? '美股' : '' }}
+ <a-tag :color="record.hcrate < 0 ? 'green' : record.hcrate > 0 ? 'red' : ''"
+ >{{ Number(record.nowPrice).toFixed(2) }}
</a-tag>
</div>
</template>
</span>
- <span slot="nowPrice" slot-scope="text,record">
- <template>
- <div>
- <a-tag :color="record.hcrate < 0 ? 'green' : record.hcrate > 0 ? 'red' : ''">{{
- Number(record.nowPrice).toFixed(2)
- }}
- </a-tag>
- </div>
- </template>
- </span>
- <span slot="hcrate" slot-scope="text,record">
+ <span slot="hcrate" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.hcrate < 0 ? 'green' : record.hcrate > 0 ? 'red' : ''">
@@ -123,7 +134,7 @@
</div>
</template>
</span>
- <span slot="day3Rate" slot-scope="text,record">
+ <span slot="day3Rate" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.day3Rate < 0 ? 'green' : record.day3Rate > 0 ? 'red' : ''">
@@ -132,7 +143,7 @@
</div>
</template>
</span>
- <span slot="spreadRate" slot-scope="text,record">
+ <span slot="spreadRate" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.spreadRate < 0 ? 'green' : record.spreadRate > 0 ? 'red' : ''">
@@ -141,7 +152,7 @@
</div>
</template>
</span>
- <span slot="isShow" slot-scope="text,record">
+ <span slot="isShow" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.isShow == 0 ? 'green' : record.isShow == 1 ? 'red' : ''">
@@ -150,7 +161,7 @@
</div>
</template>
</span>
- <span slot="isLock" slot-scope="text,record">
+ <span slot="isLock" slot-scope="text, record">
<template>
<div>
<a-tag :color="record.isLock == 0 ? 'green' : record.isLock == 1 ? 'red' : ''">
@@ -160,16 +171,13 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
- <a slot="action" href="javascript:;" @click="getisShow(record.id, record.isShow)">{{ record.isShow
- ==
- 0 ? '隐藏股票' :
- '显示股票'
+ <template slot="action" slot-scope="text, record">
+ <a slot="action" href="javascript:;" @click="getisShow(record.id, record.isShow)">{{
+ record.isShow == 0 ? '隐藏股票' : '显示股票'
}}</a>
<a-divider type="vertical" />
- <a slot="action" href="javascript:;" @click="getisLock(record.id, record.isLock)">{{ record.isLock
- == 0 ? '锁定股票' :
- '解锁股票'
+ <a slot="action" href="javascript:;" @click="getisLock(record.id, record.isLock)">{{
+ record.isLock == 0 ? '锁定股票' : '解锁股票'
}}</a>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="geteditStock(record)">{{ '修改股票' }}</a>
@@ -183,22 +191,26 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="股票名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入股票名称"
- v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称', }] }]" />
+ v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称' }] }]"
+ />
</a-form-item>
<a-form-item label="股票代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入股票代码"
- v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票代码', }] }]" />
+ v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票代码' }] }]"
+ />
</a-form-item>
<a-form-item label="股票类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择股票类型"
- v-decorator="['stockType', { rules: [{ required: true, message: '请选择股票类型', }] }]">
+ v-decorator="['stockType', { rules: [{ required: true, message: '请选择股票类型' }] }]"
+ >
<a-select-option value="sh">沪股</a-select-option>
<a-select-option value="sz">深股</a-select-option>
<a-select-option value="bj">京股</a-select-option>
@@ -209,7 +221,8 @@
<a-form-item label="科创板股票" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择科创板股票"
- v-decorator="['stockPlate', { rules: [{ required: true, message: '请选择科创板股票', }] }]">
+ v-decorator="['stockPlate', { rules: [{ required: true, message: '请选择科创板股票' }] }]"
+ >
<a-select-option value="A股">否</a-select-option>
<a-select-option value="科创">是</a-select-option>
</a-select>
@@ -217,7 +230,8 @@
<a-form-item label="锁定状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择锁定状态"
- v-decorator="['isLock', { rules: [{ required: true, message: '请选择锁定状态', }] }]">
+ v-decorator="['isLock', { rules: [{ required: true, message: '请选择锁定状态' }] }]"
+ >
<a-select-option value="0">未锁定</a-select-option>
<a-select-option value="1">锁定</a-select-option>
</a-select>
@@ -225,7 +239,8 @@
<a-form-item label="显示状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择显示状态"
- v-decorator="['isShow', { rules: [{ required: true, message: '请选择显示状态', }] }]">
+ v-decorator="['isShow', { rules: [{ required: true, message: '请选择显示状态' }] }]"
+ >
<a-select-option value="0">显示</a-select-option>
<a-select-option value="1">不显示</a-select-option>
</a-select>
@@ -239,17 +254,20 @@
:visible="editStockdialog"
:confirmLoading="editStockdialogloading"
@ok="OkeditStockdialog"
- @cancel="CanceleditStockdialog">
+ @cancel="CanceleditStockdialog"
+ >
<a-form :form="editStockform" ref="editStockform">
<a-form-item label="股票名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入股票名称"
- v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称', }] }]" />
+ v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称' }] }]"
+ />
</a-form-item>
<a-form-item label="点差费率" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入点差费率"
- v-decorator="['spreadRate', { rules: [{ required: true, message: '请输入点差费率', }] }]" />
+ v-decorator="['spreadRate', { rules: [{ required: true, message: '请输入点差费率' }] }]"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -260,245 +278,245 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Shares',
- data () {
- return {
- columns: [
- {
- title: '股票名称 / 股票代码',
- dataIndex: 'stockName',
- align: 'center',
- scopedSlots: { customRender: 'stockName' }
- },
- // {
- // title: '沪深京股',
- // dataIndex: 'stockType',
- // align: 'center',
- // scopedSlots: { customRender: 'stockType' }
- // },
- {
- title: '现价',
- dataIndex: 'nowPrice',
- align: 'center',
- scopedSlots: { customRender: 'nowPrice' }
- },
- {
- title: '涨跌幅',
- dataIndex: 'hcrate',
- align: 'center',
- scopedSlots: { customRender: 'hcrate' }
- },
- // {
- // title: '最近3天涨跌',
- // dataIndex: 'day3Rate',
- // align: 'center',
- // scopedSlots: { customRender: 'day3Rate' }
- // },
- // {
- // title: '点差费率',
- // dataIndex: 'spreadRate',
- // align: 'center',
- // scopedSlots: { customRender: 'spreadRate' }
- // },
- {
- title: '显示状态',
- dataIndex: 'isShow',
- align: 'center',
- scopedSlots: { customRender: 'isShow' }
- },
- {
- title: '股票状态',
- dataIndex: 'isLock',
- align: 'center',
- scopedSlots: { customRender: 'isLock' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- align: 'center',
- customRender: (text, row, index) => {
- return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
- }
- },
- {
- title: '操作',
- key: 'action',
- align: 'center',
- scopedSlots: { customRender: 'action' }
- }
- ],
- // 表头
- 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,
- code: '',
- name: '',
- stockPlate: 'A股',
- stockType: undefined,
- showState: undefined,
- lockState: undefined
- },
- datalist: [],
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false,
+ name: 'Shares',
+ data() {
+ return {
+ columns: [
+ {
+ title: '股票名称 / 股票代码',
+ dataIndex: 'stockName',
+ align: 'center',
+ scopedSlots: { customRender: 'stockName' },
+ },
+ // {
+ // title: '沪深京股',
+ // dataIndex: 'stockType',
+ // align: 'center',
+ // scopedSlots: { customRender: 'stockType' }
+ // },
+ {
+ title: '现价',
+ dataIndex: 'nowPrice',
+ align: 'center',
+ scopedSlots: { customRender: 'nowPrice' },
+ },
+ {
+ title: '涨跌幅',
+ dataIndex: 'hcrate',
+ align: 'center',
+ scopedSlots: { customRender: 'hcrate' },
+ },
+ // {
+ // title: '最近3天涨跌',
+ // dataIndex: 'day3Rate',
+ // align: 'center',
+ // scopedSlots: { customRender: 'day3Rate' }
+ // },
+ // {
+ // title: '点差费率',
+ // dataIndex: 'spreadRate',
+ // align: 'center',
+ // scopedSlots: { customRender: 'spreadRate' }
+ // },
+ {
+ title: '显示状态',
+ dataIndex: 'isShow',
+ align: 'center',
+ scopedSlots: { customRender: 'isShow' },
+ },
+ {
+ title: '股票状态',
+ dataIndex: 'isLock',
+ align: 'center',
+ scopedSlots: { customRender: 'isLock' },
+ },
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ align: 'center',
+ customRender: (text, row, index) => {
+ return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
+ },
+ },
+ {
+ title: '操作',
+ key: 'action',
+ align: 'center',
+ scopedSlots: { customRender: 'action' },
+ },
+ ],
+ // 表头
+ 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,
+ code: '',
+ name: '',
+ stockPlate: 'A股',
+ stockType: undefined,
+ showState: undefined,
+ lockState: undefined,
+ },
+ datalist: [],
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
- editStockdialog: false,
- editStockdialogloading: false,
- editStockform: this.$form.createForm(this),
- fields: ['stockName', 'spreadRate'],
- currentid: ''
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- geteditStock (val) {
- this.currentid = val.id
- this.editStockdialog = true
- this.fields.forEach(v => this.editStockform.getFieldDecorator(v))
- this.editStockform.setFieldsValue(pick(val, this.fields))
- },
- CanceleditStockdialog () {
- this.editStockdialog = false
- const form = this.$refs.editStockform.form
- form.resetFields()
- },
- OkeditStockdialog () {
- const form = this.$refs.editStockform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editStockdialogloading = true
- values.id = this.currentid
- stockupdateStock(values).then(res => {
- if (res.status == 0) {
- this.editStockdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editStockdialogloading = false
- })
- }
- })
- },
- // 新增用户取消弹窗
- 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) {
- this.addUserDialogloading = true
- values.stockPlate == 'A股' ? values.stockPlate = '' : values.stockPlate
- stockadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- },
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- code: '',
- name: '',
- stockPlate: 'A股',
- stockType: undefined,
- showState: undefined,
- lockState: undefined
- }
- },
- getinit () {
- this.getqueryParam()
- this.pagination.current = 1
- this.getlist()
- },
- getlist () {
- this.loading = true
- this.queryParam.stockPlate == 'A股' ? this.queryParam.stockPlate = '' : this.queryParam.stockPlate
- stocklist(this.queryParam).then(res => {
- this.datalist = res.data.list
- this.pagination.total = res.data.total
- this.queryParam.stockPlate == '' ? this.queryParam.stockPlate = 'A股' : this.queryParam.stockPlate
- this.loading = false
- })
- },
- // 股票的显示隐藏
- getisShow (idval, isShowval) {
- updateShow({ stockId: idval }).then(res => {
- if (res.status === 0) {
- this.getlist()
- if (isShowval == 0) {
- this.$message.success({ content: '隐藏成功', duration: 2 })
- } else {
- this.$message.success({ content: '显示成功', duration: 2 })
- }
- } else {
- this.$message.error({ content: res.msg, duration: 2 })
- }
- })
- },
- // 股票的锁定解锁
- getisLock (idval, isLockval) {
- updateLock({ stockId: idval }).then(res => {
- if (res.status === 0) {
- this.getlist()
- if (isLockval == 0) {
- this.$message.success({ content: '锁定成功', duration: 2 })
- } else {
- this.$message.success({ content: '解锁成功', duration: 2 })
- }
- } else {
- this.$message.error({ content: res.msg, duration: 2 })
- }
- })
- },
- 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()
- }
+ editStockdialog: false,
+ editStockdialogloading: false,
+ editStockform: this.$form.createForm(this),
+ fields: ['stockName', 'spreadRate'],
+ currentid: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ geteditStock(val) {
+ this.currentid = val.id
+ this.editStockdialog = true
+ this.fields.forEach((v) => this.editStockform.getFieldDecorator(v))
+ this.editStockform.setFieldsValue(pick(val, this.fields))
+ },
+ CanceleditStockdialog() {
+ this.editStockdialog = false
+ const form = this.$refs.editStockform.form
+ form.resetFields()
+ },
+ OkeditStockdialog() {
+ const form = this.$refs.editStockform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editStockdialogloading = true
+ values.id = this.currentid
+ stockupdateStock(values).then((res) => {
+ if (res.status == 0) {
+ this.editStockdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editStockdialogloading = false
+ })
+ }
+ })
+ },
+ // 新增用户取消弹窗
+ 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) {
+ this.addUserDialogloading = true
+ values.stockPlate == 'A股' ? (values.stockPlate = '') : values.stockPlate
+ stockadd(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: '',
+ stockPlate: 'A股',
+ stockType: undefined,
+ showState: undefined,
+ lockState: undefined,
+ }
+ },
+ getinit() {
+ this.getqueryParam()
+ this.pagination.current = 1
+ this.getlist()
+ },
+ getlist() {
+ this.loading = true
+ this.queryParam.stockPlate == 'A股' ? (this.queryParam.stockPlate = '') : this.queryParam.stockPlate
+ stocklist(this.queryParam).then((res) => {
+ this.datalist = res.data.list
+ this.pagination.total = res.data.total
+ this.queryParam.stockPlate == '' ? (this.queryParam.stockPlate = 'A股') : this.queryParam.stockPlate
+ this.loading = false
+ })
+ },
+ // 股票的显示隐藏
+ getisShow(idval, isShowval) {
+ updateShow({ stockId: idval }).then((res) => {
+ if (res.status === 0) {
+ this.getlist()
+ if (isShowval == 0) {
+ this.$message.success({ content: '隐藏成功', duration: 2 })
+ } else {
+ this.$message.success({ content: '显示成功', duration: 2 })
+ }
+ } else {
+ this.$message.error({ content: res.msg, duration: 2 })
+ }
+ })
+ },
+ // 股票的锁定解锁
+ getisLock(idval, isLockval) {
+ updateLock({ stockId: idval }).then((res) => {
+ if (res.status === 0) {
+ this.getlist()
+ if (isLockval == 0) {
+ this.$message.success({ content: '锁定成功', duration: 2 })
+ } else {
+ this.$message.success({ content: '解锁成功', duration: 2 })
+ }
+ } else {
+ this.$message.error({ content: res.msg, duration: 2 })
+ }
+ })
+ },
+ 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/risksetting/futuressetting.vue b/src/views/risksetting/futuressetting.vue
index 209ff30..71c5e1f 100644
--- a/src/views/risksetting/futuressetting.vue
+++ b/src/views/risksetting/futuressetting.vue
@@ -9,24 +9,33 @@
<a-form-item label="最大买入比例(例:0.8)">
<a-input
placeholder="请输入最大买入比例"
- v-decorator="['buyMaxPercent', { rules: [{ required: true, message: '请输入最大买入比例', }] }]" />
+ v-decorator="['buyMaxPercent', { rules: [{ required: true, message: '请输入最大买入比例' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
- <p>期货强平设置(百分比均采用小数来表示,例:0.8表示80% 强制平仓线计算规则:可用资金 + (冻结保证金 * 强制平仓比例))</p>
+ <p>
+ 期货强平设置(百分比均采用小数来表示,例:0.8表示80% 强制平仓线计算规则:可用资金 + (冻结保证金 *
+ 强制平仓比例))
+ </p>
<a-row class="form-row" :gutter="48">
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="强平比例(例:0.8)">
<a-input
placeholder="请输入强平比例"
- v-decorator="['forceSellPercent', { rules: [{ required: true, message: '请输入强平比例', }] }]" />
+ v-decorator="['forceSellPercent', { rules: [{ required: true, message: '请输入强平比例' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="强制平仓提醒比例(例:0.5)">
<a-input
placeholder="请输入强制平仓提醒比例"
- v-decorator="['forceStopRemindRatio', { rules: [{ required: true, message: '请输入强制平仓提醒比例', }] }]" />
+ v-decorator="[
+ 'forceStopRemindRatio',
+ { rules: [{ required: true, message: '请输入强制平仓提醒比例' }] },
+ ]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -36,12 +45,14 @@
<a-input-number
placeholder="请输入分钟数"
style="width: 300px"
- v-decorator="['buySameTimes', { rules: [{ required: true, message: '请输入分钟数', }] }]" />
+ v-decorator="['buySameTimes', { rules: [{ required: true, message: '请输入分钟数' }] }]"
+ />
分钟内同一只股票不得下单
<a-input-number
placeholder="请输入下单次数"
style="width: 300px"
- v-decorator="['buySameNums', { rules: [{ required: true, message: '请输入下单次数', }] }]" />
+ v-decorator="['buySameNums', { rules: [{ required: true, message: '请输入下单次数' }] }]"
+ />
次
</a-form-item>
</a-col>
@@ -51,154 +62,161 @@
<a-input-number
placeholder="请输入分钟数"
style="width: 300px"
- v-decorator="['buyNumTimes', { rules: [{ required: true, message: '请输入分钟数', }] }]" />
+ v-decorator="['buyNumTimes', { rules: [{ required: true, message: '请输入分钟数' }] }]"
+ />
分钟内交易手数不得超过
<a-input-number
placeholder="请输入下单手数"
style="width: 300px"
- v-decorator="['buyNumLots', { rules: [{ required: true, message: '请输入下单手数', }] }]" />
+ v-decorator="['buyNumLots', { rules: [{ required: true, message: '请输入下单手数' }] }]"
+ />
手
</a-form-item>
</a-col>
</a-card>
</a-form>
<div class="bottomfixed">
- <div style="float:right">
- <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading">
- 保存当前设置
- </a-button>
+ <div style="float: right">
+ <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading"> 保存当前设置 </a-button>
</div>
</div>
-
</page-header-wrapper>
</template>
<script>
import { admingetFuturesSetting, sitefuturesupdate } from '@/api/risksetting'
import pick from 'lodash.pick'
export default {
- name: 'Sharessetting',
- data () {
- return {
- addUserform: this.$form.createForm(this),
- loading: false,
- fields: ['buyMaxPercent', 'forceSellPercent', 'buySameTimes', 'buySameNums', 'buyNumTimes', 'buyNumLots', 'forceStopRemindRatio' ],
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- addUserDialogloading: false,
- details: {}
- }
- },
- mounted () {
- this.getdetail()
- },
- methods: {
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- this.loading = true
- values.id = this.details.id
- sitefuturesupdate(values).then(res => {
- if (res.status == 0) {
- this.$message.success({ content: res.msg, duration: 2 })
- this.getdetail()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- },
- getdetail () {
- var that = this
- this.loading = true
- admingetFuturesSetting().then(res => {
- this.details = res.data
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(res.data, this.fields))
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- }
+ name: 'Sharessetting',
+ data() {
+ return {
+ addUserform: this.$form.createForm(this),
+ loading: false,
+ fields: [
+ 'buyMaxPercent',
+ 'forceSellPercent',
+ 'buySameTimes',
+ 'buySameNums',
+ 'buyNumTimes',
+ 'buyNumLots',
+ 'forceStopRemindRatio',
+ ],
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserDialogloading: false,
+ details: {},
}
+ },
+ mounted() {
+ this.getdetail()
+ },
+ methods: {
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ this.loading = true
+ values.id = this.details.id
+ sitefuturesupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.$message.success(res.msg)
+ this.getdetail()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getdetail() {
+ var that = this
+ this.loading = true
+ admingetFuturesSetting().then((res) => {
+ this.details = res.data
+ this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
+ this.addUserform.setFieldsValue(pick(res.data, this.fields))
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
.bottomfixed {
- position: fixed;
- right: 0;
- bottom: 0;
- z-index: 9;
- width: 100%;
- height: 56px;
- padding: 0 24px;
- line-height: 56px;
- background: #fff;
- border-top: 1px solid #e8e8e8;
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ z-index: 9;
+ width: 100%;
+ height: 56px;
+ padding: 0 24px;
+ line-height: 56px;
+ background: #fff;
+ border-top: 1px solid #e8e8e8;
}
.card {
- margin-bottom: 24px;
+ margin-bottom: 24px;
}
/deep/ .ant-pro-global-footer {
- margin: 0 0 48px 0 !important;
+ margin: 0 0 48px 0 !important;
}
.popover-wrapper {
- :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
+ :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
+ min-width: 256px;
+ max-height: 290px;
+ padding: 0;
+ overflow: auto;
+ }
}
.antd-pro-pages-forms-style-errorIcon {
- user-select: none;
- margin-right: 24px;
- color: #f5222d;
- cursor: pointer;
+ user-select: none;
+ margin-right: 24px;
+ color: #f5222d;
+ cursor: pointer;
- i {
- margin-right: 4px;
- }
+ i {
+ margin-right: 4px;
+ }
}
.antd-pro-pages-forms-style-errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid #e8e8e8;
- cursor: pointer;
- transition: all .3s;
+ padding: 8px 16px;
+ list-style: none;
+ border-bottom: 1px solid #e8e8e8;
+ cursor: pointer;
+ transition: all 0.3s;
- &:hover {
- background: #e6f7ff;
- }
+ &:hover {
+ background: #e6f7ff;
+ }
- .antd-pro-pages-forms-style-errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: #f5222d;
- }
+ .antd-pro-pages-forms-style-errorIcon {
+ float: left;
+ margin-top: 4px;
+ margin-right: 12px;
+ padding-bottom: 22px;
+ color: #f5222d;
+ }
- .antd-pro-pages-forms-style-errorField {
- margin-top: 2px;
- color: rgba(0, 0, 0, .45);
- font-size: 12px;
- }
+ .antd-pro-pages-forms-style-errorField {
+ margin-top: 2px;
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ }
}
</style>
diff --git a/src/views/risksetting/indexsetting.vue b/src/views/risksetting/indexsetting.vue
index 73a9d82..137c859 100644
--- a/src/views/risksetting/indexsetting.vue
+++ b/src/views/risksetting/indexsetting.vue
@@ -77,7 +77,10 @@
</a-form-item>
</a-col>
</a-row>
- <p>指数强平设置 (百分比均采用小数来表示,例:0.8表示80% 强制平仓线计算规则:可用资金 + (冻结保证金 * 强制平仓比例))</p>
+ <p>
+ 指数强平设置 (百分比均采用小数来表示,例:0.8表示80% 强制平仓线计算规则:可用资金 + (冻结保证金 *
+ 强制平仓比例))
+ </p>
<a-row class="form-row" :gutter="48">
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="强平比例(例:0.8)">
@@ -90,7 +93,7 @@
</a-form-item>
</a-col>
</a-row>
- <p> 指数涨跌停限制 (百分比均采用小数来表示,例:0.1表示10%)</p>
+ <p>指数涨跌停限制 (百分比均采用小数来表示,例:0.1表示10%)</p>
<p>在买涨的情况下,当该指数涨幅达到涨停限制的时候,用户不能买入; 当该指数涨幅达到跌停限制的时候,用户不能卖出.</p>
<p>在买跌的情况下,当该指数涨幅达到跌停限制的时候,用户不能买入; 当该指数涨幅达到涨停限制的时候,用户不能卖出.</p>
<a-row class="form-row" :gutter="48">
@@ -108,143 +111,157 @@
</a-card>
</a-form>
<div class="bottomfixed">
- <div style="float:right">
- <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading">
- 保存当前设置
- </a-button>
+ <div style="float: right">
+ <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading"> 保存当前设置 </a-button>
</div>
</div>
-
</page-header-wrapper>
</template>
<script>
import { admingetIndexSetting, siteindexupdate } from '@/api/risksetting'
import pick from 'lodash.pick'
export default {
- name: 'Sharessetting',
- data () {
- return {
- addUserform: this.$form.createForm(this),
- loading: false,
- fields: ['buyMaxPercent', 'forceSellPercent', 'transAmBegin', 'transAmEnd', 'transPmBegin', 'transPmEnd', 'transAmBeginUs', 'transAmEndUs', 'transPmBeginUs', 'transPmEndUs',
- 'transAmBeginhk', 'transAmEndhk', 'transPmBeginhk', 'transPmEndhk', 'downLimit', 'riseLimit', 'forceStopRemindRatio'],
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- addUserDialogloading: false,
- details: {}
- }
- },
- mounted () {
- this.getdetail()
- },
- methods: {
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- this.loading = true
- values.id = this.details.id
- siteindexupdate(values).then(res => {
- if (res.status == 0) {
- this.$message.success({ content: res.msg, duration: 2 })
- this.getdetail()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- },
- getdetail () {
- var that = this
- this.loading = true
- admingetIndexSetting().then(res => {
- this.details = res.data
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(res.data, this.fields))
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- }
+ name: 'Sharessetting',
+ data() {
+ return {
+ addUserform: this.$form.createForm(this),
+ loading: false,
+ fields: [
+ 'buyMaxPercent',
+ 'forceSellPercent',
+ 'transAmBegin',
+ 'transAmEnd',
+ 'transPmBegin',
+ 'transPmEnd',
+ 'transAmBeginUs',
+ 'transAmEndUs',
+ 'transPmBeginUs',
+ 'transPmEndUs',
+ 'transAmBeginhk',
+ 'transAmEndhk',
+ 'transPmBeginhk',
+ 'transPmEndhk',
+ 'downLimit',
+ 'riseLimit',
+ 'forceStopRemindRatio',
+ ],
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserDialogloading: false,
+ details: {},
}
+ },
+ mounted() {
+ this.getdetail()
+ },
+ methods: {
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ this.loading = true
+ values.id = this.details.id
+ siteindexupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.$message.success(res.msg)
+ this.getdetail()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getdetail() {
+ var that = this
+ this.loading = true
+ admingetIndexSetting().then((res) => {
+ this.details = res.data
+ this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
+ this.addUserform.setFieldsValue(pick(res.data, this.fields))
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
.bottomfixed {
- position: fixed;
- right: 0;
- bottom: 0;
- z-index: 9;
- width: 100%;
- height: 56px;
- padding: 0 24px;
- line-height: 56px;
- background: #fff;
- border-top: 1px solid #e8e8e8;
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ z-index: 9;
+ width: 100%;
+ height: 56px;
+ padding: 0 24px;
+ line-height: 56px;
+ background: #fff;
+ border-top: 1px solid #e8e8e8;
}
.card {
- margin-bottom: 24px;
+ margin-bottom: 24px;
}
/deep/ .ant-pro-global-footer {
- margin: 0 0 48px 0 !important;
+ margin: 0 0 48px 0 !important;
}
.popover-wrapper {
- :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
+ :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
+ min-width: 256px;
+ max-height: 290px;
+ padding: 0;
+ overflow: auto;
+ }
}
.antd-pro-pages-forms-style-errorIcon {
- user-select: none;
- margin-right: 24px;
- color: #f5222d;
- cursor: pointer;
+ user-select: none;
+ margin-right: 24px;
+ color: #f5222d;
+ cursor: pointer;
- i {
- margin-right: 4px;
- }
+ i {
+ margin-right: 4px;
+ }
}
.antd-pro-pages-forms-style-errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid #e8e8e8;
- cursor: pointer;
- transition: all .3s;
+ padding: 8px 16px;
+ list-style: none;
+ border-bottom: 1px solid #e8e8e8;
+ cursor: pointer;
+ transition: all 0.3s;
- &:hover {
- background: #e6f7ff;
- }
+ &:hover {
+ background: #e6f7ff;
+ }
- .antd-pro-pages-forms-style-errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: #f5222d;
- }
+ .antd-pro-pages-forms-style-errorIcon {
+ float: left;
+ margin-top: 4px;
+ margin-right: 12px;
+ padding-bottom: 22px;
+ color: #f5222d;
+ }
- .antd-pro-pages-forms-style-errorField {
- margin-top: 2px;
- color: rgba(0, 0, 0, .45);
- font-size: 12px;
- }
+ .antd-pro-pages-forms-style-errorField {
+ margin-top: 2px;
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ }
}
</style>
diff --git a/src/views/risksetting/productsetting.vue b/src/views/risksetting/productsetting.vue
index 49b0f5f..4d63df1 100644
--- a/src/views/risksetting/productsetting.vue
+++ b/src/views/risksetting/productsetting.vue
@@ -104,145 +104,152 @@
</a-col>
</a-row>
</a-card> -->
-
</a-form>
<div class="bottomfixed">
- <div style="float:right">
- <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading">
- 保存当前设置
- </a-button>
+ <div style="float: right">
+ <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading"> 保存当前设置 </a-button>
</div>
</div>
-
</page-header-wrapper>
</template>
<script>
import { getProductSetting, productupdate } from '@/api/risksetting'
import pick from 'lodash.pick'
export default {
- name: 'Productsetting',
- data () {
- return {
- addUserform: this.$form.createForm(this),
- loading: false,
- fields: ['stockDisplay', 'kcStockDisplay', 'indexDisplay', 'futuresDisplay', 'realNameDisplay', 'fundsDisplay', 'delayDisplay', 'expandDisplay', 'marginDisplay', 'endDisplay'],
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- addUserDialogloading: false,
- details: {}
- }
- },
- mounted () {
- this.getdetail()
- },
- methods: {
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- this.loading = true
- values.id = this.details.id
- productupdate(values).then(res => {
- if (res.status == 0) {
- this.$message.success({ content: res.msg, duration: 2 })
- this.getdetail()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- },
- getdetail () {
- var that = this
- this.loading = true
- getProductSetting().then(res => {
- this.details = res.data
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(res.data, this.fields))
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- }
+ name: 'Productsetting',
+ data() {
+ return {
+ addUserform: this.$form.createForm(this),
+ loading: false,
+ fields: [
+ 'stockDisplay',
+ 'kcStockDisplay',
+ 'indexDisplay',
+ 'futuresDisplay',
+ 'realNameDisplay',
+ 'fundsDisplay',
+ 'delayDisplay',
+ 'expandDisplay',
+ 'marginDisplay',
+ 'endDisplay',
+ ],
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
+ },
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserDialogloading: false,
+ details: {},
}
+ },
+ mounted() {
+ this.getdetail()
+ },
+ methods: {
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ this.loading = true
+ values.id = this.details.id
+ productupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.$message.success(res.msg)
+ this.getdetail()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getdetail() {
+ var that = this
+ this.loading = true
+ getProductSetting().then((res) => {
+ this.details = res.data
+ this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
+ this.addUserform.setFieldsValue(pick(res.data, this.fields))
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
.bottomfixed {
- position: fixed;
- right: 0;
- bottom: 0;
- z-index: 9;
- width: 100%;
- height: 56px;
- padding: 0 24px;
- line-height: 56px;
- background: #fff;
- border-top: 1px solid #e8e8e8;
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ z-index: 9;
+ width: 100%;
+ height: 56px;
+ padding: 0 24px;
+ line-height: 56px;
+ background: #fff;
+ border-top: 1px solid #e8e8e8;
}
.card {
- margin-bottom: 24px;
+ margin-bottom: 24px;
}
/deep/ .ant-pro-global-footer {
- margin: 0 0 48px 0 !important;
+ margin: 0 0 48px 0 !important;
}
.popover-wrapper {
- :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
+ :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
+ min-width: 256px;
+ max-height: 290px;
+ padding: 0;
+ overflow: auto;
+ }
}
.antd-pro-pages-forms-style-errorIcon {
- user-select: none;
- margin-right: 24px;
- color: #f5222d;
- cursor: pointer;
+ user-select: none;
+ margin-right: 24px;
+ color: #f5222d;
+ cursor: pointer;
- i {
- margin-right: 4px;
- }
+ i {
+ margin-right: 4px;
+ }
}
.antd-pro-pages-forms-style-errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid #e8e8e8;
- cursor: pointer;
- transition: all .3s;
+ padding: 8px 16px;
+ list-style: none;
+ border-bottom: 1px solid #e8e8e8;
+ cursor: pointer;
+ transition: all 0.3s;
- &:hover {
- background: #e6f7ff;
- }
+ &:hover {
+ background: #e6f7ff;
+ }
- .antd-pro-pages-forms-style-errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: #f5222d;
- }
+ .antd-pro-pages-forms-style-errorIcon {
+ float: left;
+ margin-top: 4px;
+ margin-right: 12px;
+ padding-bottom: 22px;
+ color: #f5222d;
+ }
- .antd-pro-pages-forms-style-errorField {
- margin-top: 2px;
- color: rgba(0, 0, 0, .45);
- font-size: 12px;
- }
+ .antd-pro-pages-forms-style-errorField {
+ margin-top: 2px;
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ }
}
</style>
diff --git a/src/views/risksetting/sharessetting.vue b/src/views/risksetting/sharessetting.vue
index c3347ae..2152004 100644
--- a/src/views/risksetting/sharessetting.vue
+++ b/src/views/risksetting/sharessetting.vue
@@ -8,28 +8,32 @@
<a-form-item label="上午开始交易时间(例:9:30)">
<a-input
placeholder="请输入上午开始交易时间"
- v-decorator="['transAmBegin', { rules: [{ required: true, message: '请输入上午开始交易时间', }] }]" />
+ v-decorator="['transAmBegin', { rules: [{ required: true, message: '请输入上午开始交易时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="上午结束交易时间(例:10:30)">
<a-input
placeholder="请输入上午结束交易时间"
- v-decorator="['transAmEnd', { rules: [{ required: true, message: '请输入上午结束交易时间', }] }]" />
+ v-decorator="['transAmEnd', { rules: [{ required: true, message: '请输入上午结束交易时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="下午开始交易时间(例:13:30)">
<a-input
placeholder="请输入下午开始交易时间"
- v-decorator="['transPmBegin', { rules: [{ required: true, message: '请输入下午开始交易时间', }] }]" />
+ v-decorator="['transPmBegin', { rules: [{ required: true, message: '请输入下午开始交易时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="下午结束交易时间(例:15:00)">
<a-input
placeholder="请输入下午结束交易时间"
- v-decorator="['transPmEnd', { rules: [{ required: true, message: '请输入下午结束交易时间', }] }]" />
+ v-decorator="['transPmEnd', { rules: [{ required: true, message: '请输入下午结束交易时间' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -38,28 +42,32 @@
<a-form-item label="大宗交易 上午开始交易时间(例:9:30)">
<a-input
placeholder="请输入上午开始交易时间"
- v-decorator="['transAmBeginUs', { rules: [{ required: true, message: '请输入上午开始交易时间', }] }]" />
+ v-decorator="['transAmBeginUs', { rules: [{ required: true, message: '请输入上午开始交易时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="大宗交易 上午结束交易时间(例:10:30)">
<a-input
placeholder="请输入上午结束交易时间"
- v-decorator="['transAmEndUs', { rules: [{ required: true, message: '请输入上午结束交易时间', }] }]" />
+ v-decorator="['transAmEndUs', { rules: [{ required: true, message: '请输入上午结束交易时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="大宗交易 下午开始交易时间(例:13:30)">
<a-input
placeholder="请输入下午开始交易时间"
- v-decorator="['transPmBeginUs', { rules: [{ required: true, message: '请输入下午开始交易时间', }] }]" />
+ v-decorator="['transPmBeginUs', { rules: [{ required: true, message: '请输入下午开始交易时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="大宗交易 下午结束交易时间(例:15:00)">
<a-input
placeholder="请输入下午结束交易时间"
- v-decorator="['transPmEndUs', { rules: [{ required: true, message: '请输入下午结束交易时间', }] }]" />
+ v-decorator="['transPmEndUs', { rules: [{ required: true, message: '请输入下午结束交易时间' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -98,14 +106,16 @@
<a-form-item label="提现开始时间(例:9)">
<a-input
placeholder="请输入提现开始时间"
- v-decorator="['withTimeBegin', { rules: [{ required: true, message: '请输入提现开始时间', }] }]" />
+ v-decorator="['withTimeBegin', { rules: [{ required: true, message: '请输入提现开始时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="提现结束时间(例:18)">
<a-input
placeholder="请输入提现结束时间"
- v-decorator="['withTimeEnd', { rules: [{ required: true, message: '请输入提现结束时间', }] }]" />
+ v-decorator="['withTimeEnd', { rules: [{ required: true, message: '请输入提现结束时间' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -117,28 +127,32 @@
<a-form-item label="买入手续费(例:0.001)">
<a-input
placeholder="请输入买入手续费"
- v-decorator="['buyFee', { rules: [{ required: true, message: '请输入买入手续费', }] }]" />
+ v-decorator="['buyFee', { rules: [{ required: true, message: '请输入买入手续费' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="卖出手续费(例:0.001)">
<a-input
placeholder="请输入卖出手续费"
- v-decorator="['sellFee', { rules: [{ required: true, message: '请输入卖出手续费', }] }]" />
+ v-decorator="['sellFee', { rules: [{ required: true, message: '请输入卖出手续费' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="留仓费(例:0.001)">
<a-input
placeholder="请输入留仓费"
- v-decorator="['stayFee', { rules: [{ required: true, message: '请输入留仓费', }] }]" />
+ v-decorator="['stayFee', { rules: [{ required: true, message: '请输入留仓费' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="印花税(例:0.001)">
<a-input
placeholder="请输入印花税"
- v-decorator="['dutyFee', { rules: [{ required: true, message: '请输入印花税', }] }]" />
+ v-decorator="['dutyFee', { rules: [{ required: true, message: '请输入印花税' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -150,28 +164,32 @@
<a-form-item label="最小购买金额(例:1000)">
<a-input
placeholder="请输入最小购买金额"
- v-decorator="['buyMinAmt', { rules: [{ required: true, message: '请输入最小购买金额', }] }]" />
+ v-decorator="['buyMinAmt', { rules: [{ required: true, message: '请输入最小购买金额' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="最大买入比例(例:0.8)">
<a-input
placeholder="请输入最大买入比例"
- v-decorator="['buyMaxAmtPercent', { rules: [{ required: true, message: '请输入最大买入比例', }] }]" />
+ v-decorator="['buyMaxAmtPercent', { rules: [{ required: true, message: '请输入最大买入比例' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="最小购买股数(例:5000)">
<a-input
placeholder="请输入最小购买股数"
- v-decorator="['buyMinNum', { rules: [{ required: true, message: '请输入最小购买股数', }] }]" />
+ v-decorator="['buyMinNum', { rules: [{ required: true, message: '请输入最小购买股数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="最大买入股数(例:1000000)">
<a-input
placeholder="请输入最大买入股数"
- v-decorator="['buyMaxNum', { rules: [{ required: true, message: '请输入最大买入股数', }] }]" />
+ v-decorator="['buyMaxNum', { rules: [{ required: true, message: '请输入最大买入股数' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -180,7 +198,8 @@
<a-form-item label="杠杆倍数(例:100/50/30)">
<a-input
placeholder="请输入杠杆倍数"
- v-decorator="['siteLever', { rules: [{ required: true, message: '请输入杠杆倍数', }] }]" />
+ v-decorator="['siteLever', { rules: [{ required: true, message: '请输入杠杆倍数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
@@ -188,14 +207,16 @@
<a-input-number
placeholder="请输入时间"
style="width: 100%"
- v-decorator="['cantSellTimes', { rules: [{ required: true, message: '请输入时间', }] }]" />
+ v-decorator="['cantSellTimes', { rules: [{ required: true, message: '请输入时间' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="VIP抢筹密钥">
<a-input
placeholder="请输入VIP抢筹密钥"
- v-decorator="['vipPassword', { rules: [{ required: true, message: '请输入VIP抢筹密钥', }] }]" />
+ v-decorator="['vipPassword', { rules: [{ required: true, message: '请输入VIP抢筹密钥' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
@@ -205,7 +226,7 @@
@mousewheel.native.prevent
@DOMMouseScroll.native.prevent
placeholder="请输入大宗交易赠送比例"
- v-decorator="['dzSongP', { rules: [{ required: true, message: '请输入大宗交易赠送比例', }] }]"
+ v-decorator="['dzSongP', { rules: [{ required: true, message: '请输入大宗交易赠送比例' }] }]"
@keydown.native="handleInputlimit"
/>
</a-form-item>
@@ -217,7 +238,7 @@
@mousewheel.native.prevent
@DOMMouseScroll.native.prevent
placeholder="请输入大宗交易最低"
- v-decorator="['dzMinByCount', { rules: [{ required: true, message: '请输入大宗交易最低', }] }]"
+ v-decorator="['dzMinByCount', { rules: [{ required: true, message: '请输入大宗交易最低' }] }]"
@keydown.native="handleInputlimit"
/>
</a-form-item>
@@ -229,12 +250,14 @@
<a-input-number
placeholder="请输入分钟数"
style="width: 300px"
- v-decorator="['buySameTimes', { rules: [{ required: true, message: '请输入分钟数', }] }]" />
+ v-decorator="['buySameTimes', { rules: [{ required: true, message: '请输入分钟数' }] }]"
+ />
分钟内同一只股票不得下单
<a-input-number
placeholder="请输入下单次数"
style="width: 300px"
- v-decorator="['buySameNums', { rules: [{ required: true, message: '请输入下单次数', }] }]" />
+ v-decorator="['buySameNums', { rules: [{ required: true, message: '请输入下单次数' }] }]"
+ />
次
</a-form-item>
</a-col>
@@ -245,12 +268,14 @@
<a-input-number
placeholder="请输入分钟数"
style="width: 300px"
- v-decorator="['buyNumTimes', { rules: [{ required: true, message: '请输入分钟数', }] }]" />
+ v-decorator="['buyNumTimes', { rules: [{ required: true, message: '请输入分钟数' }] }]"
+ />
分钟内交易手数不得超过
<a-input-number
placeholder="请输入下单手数"
style="width: 300px"
- v-decorator="['buyNumLots', { rules: [{ required: true, message: '请输入下单手数', }] }]" />
+ v-decorator="['buyNumLots', { rules: [{ required: true, message: '请输入下单手数' }] }]"
+ />
手
</a-form-item>
</a-col>
@@ -262,12 +287,14 @@
<a-input-number
placeholder="请输入天数"
style="width: 300px"
- v-decorator="['stockDays', { rules: [{ required: true, message: '请输入天数', }] }]" />
+ v-decorator="['stockDays', { rules: [{ required: true, message: '请输入天数' }] }]"
+ />
天 内涨幅超过
<a-input-number
placeholder="请输入下单次数"
style="width: 300px"
- v-decorator="['stockRate', { rules: [{ required: true, message: '请输入下单次数', }] }]" />
+ v-decorator="['stockRate', { rules: [{ required: true, message: '请输入下单次数' }] }]"
+ />
次不能买入(同一用户)
</a-form-item>
</a-col>
@@ -278,7 +305,8 @@
<a-input-number
placeholder="请输入点数"
style="width: 300px"
- v-decorator="['creaseMaxPercent', { rules: [{ required: true, message: '请输入点数', }] }]" />
+ v-decorator="['creaseMaxPercent', { rules: [{ required: true, message: '请输入点数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
@@ -286,42 +314,49 @@
<a-input-number
placeholder="请输入点数"
style="width: 300px"
- v-decorator="['kcCreaseMaxPercent', { rules: [{ required: true, message: '请输入点数', }] }]" />
+ v-decorator="['kcCreaseMaxPercent', { rules: [{ required: true, message: '请输入点数' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card class="card" title="强制平仓设置" :bordered="false" :loading="loading">
- <span slot="extra">请按照括号中的示例填写,比例均采用小数来表示 强制平仓线计算规则:可用资金 + (冻结保证金 *
- 强制平仓比例)</span>
+ <span slot="extra"
+ >请按照括号中的示例填写,比例均采用小数来表示 强制平仓线计算规则:可用资金 +
+ (冻结保证金 * 强制平仓比例)</span
+ >
<a-row class="form-row" :gutter="48">
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="强制平仓比例(例:0.7)">
<a-input
placeholder="请输入强制平仓比例"
- v-decorator="['forceStopPercent', { rules: [{ required: true, message: '请输入强制平仓比例', }] }]" />
+ v-decorator="['forceStopPercent', { rules: [{ required: true, message: '请输入强制平仓比例' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="连续涨停强制平仓(例:0.2)">
<a-input
placeholder="请输入连续涨停强制平仓比例"
- v-decorator="['hightAndLow', { rules: [{ required: true, message: '请输入连续涨停强制平仓比例', }] }]" />
+ v-decorator="['hightAndLow', { rules: [{ required: true, message: '请输入连续涨停强制平仓比例' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="最大留仓天数(例:15)">
<a-input
placeholder="请输入最大留仓天数"
- v-decorator="['stayMaxDays', { rules: [{ required: true, message: '请输入最大留仓天数', }] }]" />
+ v-decorator="['stayMaxDays', { rules: [{ required: true, message: '请输入最大留仓天数' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="强制平仓手续费(例:0.001)">
<a-input
placeholder="请输入强制平仓手续费"
- v-decorator="['forceStopFee', { rules: [{ required: true, message: '请输入强制平仓手续费', }] }]" />
+ v-decorator="['forceStopFee', { rules: [{ required: true, message: '请输入强制平仓手续费' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -330,7 +365,11 @@
<a-form-item label="强制平仓提醒比例(例:0.5)">
<a-input
placeholder="请输入强制平仓提醒比例"
- v-decorator="['forceStopRemindRatio', { rules: [{ required: true, message: '请输入强制平仓提醒比例', }] }]" />
+ v-decorator="[
+ 'forceStopRemindRatio',
+ { rules: [{ required: true, message: '请输入强制平仓提醒比例' }] },
+ ]"
+ />
</a-form-item>
</a-col>
</a-row>
@@ -343,130 +382,175 @@
<a-form-item label="最小充值金额(例:1000)">
<a-input
placeholder="请输入最小充值金额"
- v-decorator="['chargeMinAmt', { rules: [{ required: true, message: '请输入最小充值金额', }] }]" />
+ v-decorator="['chargeMinAmt', { rules: [{ required: true, message: '请输入最小充值金额' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="最小提现金额(例:1000)">
<a-input
placeholder="请输入最小提现金额"
- v-decorator="['withMinAmt', { rules: [{ required: true, message: '请输入最小提现金额', }] }]" />
+ v-decorator="['withMinAmt', { rules: [{ required: true, message: '请输入最小提现金额' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="提现单笔手续费(例:5)">
<a-input
placeholder="请输入提现单笔手续费"
- v-decorator="['withFeeSingle', { rules: [{ required: true, message: '请输入提现单笔手续费', }] }]" />
+ v-decorator="['withFeeSingle', { rules: [{ required: true, message: '请输入提现单笔手续费' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="提现手续费百分比(例:0.005)">
<a-input
placeholder="请输入提现手续费百分比"
- v-decorator="['withFeePercent', { rules: [{ required: true, message: '请输入提现手续费百分比', }] }]" />
+ v-decorator="['withFeePercent', { rules: [{ required: true, message: '请输入提现手续费百分比' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="提现通道设置">
<a-input
placeholder="提现通道设置"
- v-decorator="['withdraw', { rules: [{ required: true, message: '请输入提现手续费百分比', }] }]" />
+ v-decorator="['withdraw', { rules: [{ required: true, message: '请输入提现手续费百分比' }] }]"
+ />
</a-form-item>
</a-col>
<a-col :md="12" :lg="6" :sm="12">
<a-form-item label="汇率设置(美元)">
<a-input
placeholder="请输入汇率设置"
- v-decorator="['exchangeRate', { rules: [{ required: true, message: '请输入汇率设置', }] }]" />
+ v-decorator="['exchangeRate', { rules: [{ required: true, message: '请输入汇率设置' }] }]"
+ />
</a-form-item>
</a-col>
</a-row>
</a-card>
-
</a-form>
<div class="bottomfixed">
- <div style="float:right">
- <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading">
- 保存当前设置
- </a-button>
+ <div style="float: right">
+ <a-button type="primary" @click="OkaddUserdialog" :loading="addUserDialogloading"> 保存当前设置 </a-button>
</div>
</div>
-
</page-header-wrapper>
</template>
<script>
import { admingetSetting, setupdate } from '@/api/risksetting'
import pick from 'lodash.pick'
export default {
- name: 'Sharessetting',
- data () {
- return {
- addUserform: this.$form.createForm(this),
- loading: false,
- fields: ['buyFee', 'sellFee', 'stayFee', 'dutyFee', 'stayMaxDays', 'buyMinAmt', 'chargeMinAmt', 'buyMinNum', 'forceStopFee', 'buyMaxAmtPercent', 'forceStopPercent', 'hightAndLow', 'withMinAmt', 'creaseMaxPercent', 'kcCreaseMaxPercent', 'buyMaxNum', 'cantSellTimes', 'buySameTimes', 'buySameNums', 'buyNumTimes', 'buyNumLots', 'stockDays', 'stockRate', 'withTimeBegin', 'withTimeEnd',
- 'transAmBegin', 'transAmEnd', 'transPmBegin', 'transPmEnd',
- 'transAmBeginUs', 'transAmEndUs', 'transPmBeginUs', 'transPmEndUs',
- 'transAmBeginhk', 'transAmEndhk', 'transPmBeginhk', 'transPmEndhk', 'withdraw', 'exchangeRate',
- 'withFeeSingle', 'withFeePercent', 'siteLever', 'forceStopRemindRatio', 'vipPassword', 'dzSongP', 'dzMinByCount'],
- labelCol: {
- xs: { span: 10 },
- sm: { span: 10 },
- md: { span: 10 }
- },
- wrapperCol: {
- xs: { span: 14 },
- sm: { span: 14 },
- md: { span: 14 }
- },
- addUserDialogloading: false,
- details: {}
- }
- },
- mounted () {
- this.getdetail()
- },
- methods: {
- // 禁止输入e, -
- handleInputlimit (e) {
- if (e.key === 'e' || e.key === '-') {
- e.returnValue = false
- return false
- }
- return true
+ name: 'Sharessetting',
+ data() {
+ return {
+ addUserform: this.$form.createForm(this),
+ loading: false,
+ fields: [
+ 'buyFee',
+ 'sellFee',
+ 'stayFee',
+ 'dutyFee',
+ 'stayMaxDays',
+ 'buyMinAmt',
+ 'chargeMinAmt',
+ 'buyMinNum',
+ 'forceStopFee',
+ 'buyMaxAmtPercent',
+ 'forceStopPercent',
+ 'hightAndLow',
+ 'withMinAmt',
+ 'creaseMaxPercent',
+ 'kcCreaseMaxPercent',
+ 'buyMaxNum',
+ 'cantSellTimes',
+ 'buySameTimes',
+ 'buySameNums',
+ 'buyNumTimes',
+ 'buyNumLots',
+ 'stockDays',
+ 'stockRate',
+ 'withTimeBegin',
+ 'withTimeEnd',
+ 'transAmBegin',
+ 'transAmEnd',
+ 'transPmBegin',
+ 'transPmEnd',
+ 'transAmBeginUs',
+ 'transAmEndUs',
+ 'transPmBeginUs',
+ 'transPmEndUs',
+ 'transAmBeginhk',
+ 'transAmEndhk',
+ 'transPmBeginhk',
+ 'transPmEndhk',
+ 'withdraw',
+ 'exchangeRate',
+ 'withFeeSingle',
+ 'withFeePercent',
+ 'siteLever',
+ 'forceStopRemindRatio',
+ 'vipPassword',
+ 'dzSongP',
+ 'dzMinByCount',
+ ],
+ labelCol: {
+ xs: { span: 10 },
+ sm: { span: 10 },
+ md: { span: 10 },
},
- OkaddUserdialog () {
- const form = this.$refs.addUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.addUserDialogloading = true
- this.loading = true
- values.id = this.details.id
- setupdate(values).then(res => {
- if (res.status === 0) {
- this.$message.success({ content: res.msg, duration: 2 })
- this.getdetail()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- },
- getdetail () {
- var that = this
- this.loading = true
- admingetSetting().then(res => {
- this.details = res.data
- this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
- this.addUserform.setFieldsValue(pick(res.data, this.fields))
- setTimeout(() => {
- that.loading = false
- }, 500)
- })
- }
+ wrapperCol: {
+ xs: { span: 14 },
+ sm: { span: 14 },
+ md: { span: 14 },
+ },
+ addUserDialogloading: false,
+ details: {},
}
+ },
+ mounted() {
+ this.getdetail()
+ },
+ methods: {
+ // 禁止输入e, -
+ handleInputlimit(e) {
+ if (e.key === 'e' || e.key === '-') {
+ e.returnValue = false
+ return false
+ }
+ return true
+ },
+ OkaddUserdialog() {
+ const form = this.$refs.addUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.addUserDialogloading = true
+ this.loading = true
+ values.id = this.details.id
+ setupdate(values).then((res) => {
+ if (res.status === 0) {
+ this.$message.success(res.msg)
+ this.getdetail()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ })
+ },
+ getdetail() {
+ var that = this
+ this.loading = true
+ admingetSetting().then((res) => {
+ this.details = res.data
+ this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
+ this.addUserform.setFieldsValue(pick(res.data, this.fields))
+ setTimeout(() => {
+ that.loading = false
+ }, 500)
+ })
+ },
+ },
}
</script>
<style lang="less" scoped>
@@ -481,69 +565,69 @@
display: none;
}
.bottomfixed {
- position: fixed;
- right: 0;
- bottom: 0;
- z-index: 9;
- width: 100%;
- height: 56px;
- padding: 0 24px;
- line-height: 56px;
- background: #fff;
- border-top: 1px solid #e8e8e8;
+ position: fixed;
+ right: 0;
+ bottom: 0;
+ z-index: 9;
+ width: 100%;
+ height: 56px;
+ padding: 0 24px;
+ line-height: 56px;
+ background: #fff;
+ border-top: 1px solid #e8e8e8;
}
.card {
- margin-bottom: 24px;
+ margin-bottom: 24px;
}
/deep/ .ant-pro-global-footer {
- margin: 0 0 48px 0 !important;
+ margin: 0 0 48px 0 !important;
}
.popover-wrapper {
- :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
- min-width: 256px;
- max-height: 290px;
- padding: 0;
- overflow: auto;
- }
+ :deep(.antd-pro-pages-forms-style-errorPopover .ant-popover-inner-content) {
+ min-width: 256px;
+ max-height: 290px;
+ padding: 0;
+ overflow: auto;
+ }
}
.antd-pro-pages-forms-style-errorIcon {
- user-select: none;
- margin-right: 24px;
- color: #f5222d;
- cursor: pointer;
+ user-select: none;
+ margin-right: 24px;
+ color: #f5222d;
+ cursor: pointer;
- i {
- margin-right: 4px;
- }
+ i {
+ margin-right: 4px;
+ }
}
.antd-pro-pages-forms-style-errorListItem {
- padding: 8px 16px;
- list-style: none;
- border-bottom: 1px solid #e8e8e8;
- cursor: pointer;
- transition: all .3s;
+ padding: 8px 16px;
+ list-style: none;
+ border-bottom: 1px solid #e8e8e8;
+ cursor: pointer;
+ transition: all 0.3s;
- &:hover {
- background: #e6f7ff;
- }
+ &:hover {
+ background: #e6f7ff;
+ }
- .antd-pro-pages-forms-style-errorIcon {
- float: left;
- margin-top: 4px;
- margin-right: 12px;
- padding-bottom: 22px;
- color: #f5222d;
- }
+ .antd-pro-pages-forms-style-errorIcon {
+ float: left;
+ margin-top: 4px;
+ margin-right: 12px;
+ padding-bottom: 22px;
+ color: #f5222d;
+ }
- .antd-pro-pages-forms-style-errorField {
- margin-top: 2px;
- color: rgba(0, 0, 0, .45);
- font-size: 12px;
- }
+ .antd-pro-pages-forms-style-errorField {
+ margin-top: 2px;
+ color: rgba(0, 0, 0, 0.45);
+ font-size: 12px;
+ }
}
</style>
diff --git a/src/views/risksetting/spreadsetting.vue b/src/views/risksetting/spreadsetting.vue
index 95282c2..0a32e79 100644
--- a/src/views/risksetting/spreadsetting.vue
+++ b/src/views/risksetting/spreadsetting.vue
@@ -17,21 +17,26 @@
<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 @click="getqueryParam" icon="redo"> 重置</a-button>
<a-button
type="primary"
icon="search"
style="margin-left: 8px"
- @click="queryParam.pageNum = 1, getlist()">查询
+ @click=";(queryParam.pageNum = 1), getlist()"
+ >查询
</a-button>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
- @click="addUserdialog = true; currentDetails = ''">
- 添加点差</a-button>
+ @click="
+ addUserdialog = true
+ currentDetails = ''
+ "
+ >
+ 添加点差</a-button
+ >
</span>
</a-form-item>
</a-col>
@@ -47,17 +52,15 @@
:pagination="pagination"
:columns="columns"
:data-source="datalist"
- rowKey="id">
-
- <span slot="zhi" slot-scope="text,record">
+ rowKey="id"
+ >
+ <span slot="zhi" slot-scope="text, record">
<template>
- <div>
- ≤ X <
- </div>
+ <div>≤ X <</div>
</template>
</span>
- <span slot="spreadRate" slot-scope="text,record">
+ <span slot="spreadRate" slot-scope="text, record">
<template>
<div>
<span :class="record.spreadRate < 0 ? 'greens' : 'reds'">
@@ -67,7 +70,7 @@
</template>
</span>
- <template slot="action" slot-scope="text,record">
+ <template slot="action" slot-scope="text, record">
<a slot="action" href="javascript:;" @click="geteditbaseCurrency(record)">修改点差</a>
</template>
</a-table>
@@ -79,12 +82,14 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="点差类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择点差类型"
- v-decorator="['typeName', { rules: [{ required: true, message: '请选择点差类型', }] }]">
+ v-decorator="['typeName', { rules: [{ required: true, message: '请选择点差类型' }] }]"
+ >
<a-select-option :value="'涨跌幅'">涨跌幅</a-select-option>
<a-select-option :value="'成交额'">成交额</a-select-option>
<a-select-option :value="'开头收取'">开头收取</a-select-option>
@@ -94,22 +99,26 @@
<a-form-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入单位"
- v-decorator="['unit', { rules: [{ required: true, message: '请输入单位', }] }]" />
+ v-decorator="['unit', { rules: [{ required: true, message: '请输入单位' }] }]"
+ />
</a-form-item>
<a-form-item label="开始区间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入开始区间"
- v-decorator="['startInterval', { rules: [{ required: true, message: '请输入开始区间', }] }]" />
+ v-decorator="['startInterval', { rules: [{ required: true, message: '请输入开始区间' }] }]"
+ />
</a-form-item>
<a-form-item label="结束区间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入结束区间"
- v-decorator="['endInterval', { rules: [{ required: true, message: '请输入结束区间', }] }]" />
+ v-decorator="['endInterval', { rules: [{ required: true, message: '请输入结束区间' }] }]"
+ />
</a-form-item>
<a-form-item label="点差费率" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入点差费率"
- v-decorator="['spreadRate', { rules: [{ required: true, message: '请输入点差费率', }] }]" />
+ v-decorator="['spreadRate', { rules: [{ required: true, message: '请输入点差费率' }] }]"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -120,176 +129,176 @@
import moment from 'moment'
import pick from 'lodash.pick'
export default {
- name: 'Basecurrency',
- data () {
- return {
- columns: [
- {
- title: '类型名称',
- dataIndex: 'typeName',
- align: 'center'
- },
- {
- title: '单位',
- dataIndex: 'unit',
- align: 'center'
- },
- {
- title: '开始区间',
- dataIndex: 'startInterval',
- align: 'center'
- },
- {
- title: '值',
- dataIndex: 'zhi',
- align: 'center',
- scopedSlots: { customRender: 'zhi' }
- },
- {
- title: '结束区间',
- dataIndex: 'endInterval',
- align: 'center'
- },
- {
- title: '点差费率',
- dataIndex: 'spreadRate',
- align: 'center',
- scopedSlots: { customRender: 'spreadRate' }
- },
- {
- title: '添加时间',
- dataIndex: 'addTime',
- 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,
- typeName: undefined
- },
- datalist: [],
+ name: 'Basecurrency',
+ data() {
+ return {
+ columns: [
+ {
+ title: '类型名称',
+ dataIndex: 'typeName',
+ align: 'center',
+ },
+ {
+ title: '单位',
+ dataIndex: 'unit',
+ align: 'center',
+ },
+ {
+ title: '开始区间',
+ dataIndex: 'startInterval',
+ align: 'center',
+ },
+ {
+ title: '值',
+ dataIndex: 'zhi',
+ align: 'center',
+ scopedSlots: { customRender: 'zhi' },
+ },
+ {
+ title: '结束区间',
+ dataIndex: 'endInterval',
+ align: 'center',
+ },
+ {
+ title: '点差费率',
+ dataIndex: 'spreadRate',
+ align: 'center',
+ scopedSlots: { customRender: 'spreadRate' },
+ },
+ {
+ title: '添加时间',
+ dataIndex: 'addTime',
+ 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,
+ typeName: undefined,
+ },
+ datalist: [],
- addUserdialog: false,
- addUserDialogloading: false,
- addUserform: this.$form.createForm(this),
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- fields: ['typeName', 'unit', 'startInterval', 'endInterval', 'spreadRate'],
- currentDetails: ''
- }
- },
- created () {
- this.getlist()
- },
- methods: {
- geteditbaseCurrency (val) {
- this.currentDetails = val
- this.addUserdialog = true
- 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) {
- this.addUserDialogloading = true
- if (this.currentDetails != '') {
- values.id = this.currentDetails.id
- adminupdateSiteSpread(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '修改成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- } else {
- values.id = 0
- adminaddSiteSpread(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: '添加成功', duration: 2 })
- form.resetFields()
- this.getlist()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- }
- })
- },
- getqueryParam () {
- this.queryParam = {
- pageNum: 1,
- pageSize: 10,
- typeName: undefined
- }
- },
- getlist () {
- this.loading = true
- admingetSiteSpreadList(this.queryParam).then(res => {
- this.datalist = res.data.data.list
- this.pagination.total = res.data.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()
- }
+ addUserdialog: false,
+ addUserDialogloading: false,
+ addUserform: this.$form.createForm(this),
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ fields: ['typeName', 'unit', 'startInterval', 'endInterval', 'spreadRate'],
+ currentDetails: '',
}
+ },
+ created() {
+ this.getlist()
+ },
+ methods: {
+ geteditbaseCurrency(val) {
+ this.currentDetails = val
+ this.addUserdialog = true
+ 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) {
+ this.addUserDialogloading = true
+ if (this.currentDetails != '') {
+ values.id = this.currentDetails.id
+ adminupdateSiteSpread(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '修改成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ } else {
+ values.id = 0
+ adminaddSiteSpread(values).then((res) => {
+ if (res.status == 0) {
+ this.addUserdialog = false
+ this.$message.success({ content: '添加成功', duration: 2 })
+ form.resetFields()
+ this.getlist()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.addUserDialogloading = false
+ })
+ }
+ }
+ })
+ },
+ getqueryParam() {
+ this.queryParam = {
+ pageNum: 1,
+ pageSize: 10,
+ typeName: undefined,
+ }
+ },
+ getlist() {
+ this.loading = true
+ admingetSiteSpreadList(this.queryParam).then((res) => {
+ this.datalist = res.data.data.list
+ this.pagination.total = res.data.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;
+ color: #52c41a;
}
.reds {
- color: #f5222d;
+ color: #f5222d;
}
</style>
diff --git a/src/views/userlist/agentcomponents/EditAgentinfodialog.vue b/src/views/userlist/agentcomponents/EditAgentinfodialog.vue
index 24bf876..cbfcca5 100644
--- a/src/views/userlist/agentcomponents/EditAgentinfodialog.vue
+++ b/src/views/userlist/agentcomponents/EditAgentinfodialog.vue
@@ -6,7 +6,8 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="代理ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入代理ID" disabled v-decorator="['id', {}]" />
@@ -15,23 +16,35 @@
<a-input placeholder="请输入代理名称" v-decorator="['agentName', {}]" />
</a-form-item> -->
<a-form-item label="代理手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input placeholder="请输入代理手机号" v-decorator="['agentPhone', {rules: [{ required: true, message: '请输入代理手机号', }] }]" />
+ <a-input
+ placeholder="请输入代理手机号"
+ v-decorator="['agentPhone', { rules: [{ required: true, message: '请输入代理手机号' }] }]"
+ />
</a-form-item>
<a-form-item label="真实姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input placeholder="请输入真实姓名" v-decorator="['agentRealName', {rules: [{ required: true, message: '请输入真实姓名', }] }]" />
+ <a-input
+ placeholder="请输入真实姓名"
+ v-decorator="['agentRealName', { rules: [{ required: true, message: '请输入真实姓名' }] }]"
+ />
</a-form-item>
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入密码" v-decorator="['agentPwd', {}]" />
</a-form-item>
<a-form-item label="客服链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input placeholder="请输入客服链接" v-decorator="['onLineServices', {rules: [{ required: true, message: '请输入客服链接', }] }]" />
+ <a-input
+ placeholder="请输入客服链接"
+ v-decorator="['onLineServices', { rules: [{ required: true, message: '请输入客服链接' }] }]"
+ />
</a-form-item>
<a-form-item label="杠杆倍数" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入杠杆倍数" v-decorator="['siteLever', {}]" />
<span>(例:100/50)</span>
</a-form-item>
<a-form-item label="代理状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select placeholder="请选择代理状态" v-decorator="['isLock', {rules: [{ required: true, message: '请选择代理状态', }]}]">
+ <a-select
+ placeholder="请选择代理状态"
+ v-decorator="['isLock', { rules: [{ required: true, message: '请选择代理状态' }] }]"
+ >
<a-select-option :value="0">正常</a-select-option>
<a-select-option :value="1">锁定</a-select-option>
</a-select>
@@ -44,68 +57,67 @@
import { agentupdate } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- },
- agentlist: {
- type: Array
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['id', 'agentPhone', 'agentRealName', 'agentPwd', 'onLineServices', 'siteLever', 'isLock'],
- currentDetails: {}
- }
+ agentlist: {
+ type: Array,
},
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- this.editUserform.setFieldsValue(pick({ agentPwd: '' }, this.fields))
- },
- // 新增用户取消弹窗
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- // 新增用户确定
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editUserDialogloading = true
- agentupdate(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['id', 'agentPhone', 'agentRealName', 'agentPwd', 'onLineServices', 'siteLever', 'isLock'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ this.editUserform.setFieldsValue(pick({ agentPwd: '' }, this.fields))
+ },
+ // 新增用户取消弹窗
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ // 新增用户确定
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editUserDialogloading = true
+ agentupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/userlist/agentcomponents/addagentdialog.vue b/src/views/userlist/agentcomponents/addagentdialog.vue
index e0540b5..8c6d819 100644
--- a/src/views/userlist/agentcomponents/addagentdialog.vue
+++ b/src/views/userlist/agentcomponents/addagentdialog.vue
@@ -6,39 +6,46 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="上级代理" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择上级代理"
- v-decorator="['parentId', { rules: [{ required: true, message: '请选择上级代理', }] }]">
+ v-decorator="['parentId', { rules: [{ required: true, message: '请选择上级代理' }] }]"
+ >
<a-select-option value="0">总代理</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="代理名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入代理名称"
- v-decorator="['agentName', { rules: [{ required: true, message: '请输入代理名称', }] }]" />
+ v-decorator="['agentName', { rules: [{ required: true, message: '请输入代理名称' }] }]"
+ />
</a-form-item>
<a-form-item label="代理手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入代理手机号"
- v-decorator="['agentPhone', { rules: [{ required: true, message: '请输入代理手机号', }] }]" />
+ v-decorator="['agentPhone', { rules: [{ required: true, message: '请输入代理手机号' }] }]"
+ />
</a-form-item>
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入密码"
- v-decorator="['agentPwd', { rules: [{ required: true, message: '请输入密码', }] }]" />
+ v-decorator="['agentPwd', { rules: [{ required: true, message: '请输入密码' }] }]"
+ />
</a-form-item>
<a-form-item label="真实姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入真实姓名"
- v-decorator="['agentRealName', { rules: [{ required: true, message: '请输入真实姓名', }] }]" />
+ v-decorator="['agentRealName', { rules: [{ required: true, message: '请输入真实姓名' }] }]"
+ />
</a-form-item>
<a-form-item label="客服链接" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入客服链接"
- v-decorator="['onLineServices', { rules: [{ required: true, message: '请输入客服链接', }] }]" />
+ v-decorator="['onLineServices', { rules: [{ required: true, message: '请输入客服链接' }] }]"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -47,59 +54,58 @@
<script>
import { agentadd } from '@/api/home'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- },
- agentlist: {
- type: Array
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false
- }
+ agentlist: {
+ type: Array,
},
- methods: {
- // 新增用户取消弹窗
- 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) {
- this.addUserDialogloading = true
- agentadd(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
}
+ },
+ methods: {
+ // 新增用户取消弹窗
+ 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) {
+ this.addUserDialogloading = true
+ agentadd(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
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/userlist/agentcomponents/editCapitalAgentdialog.vue b/src/views/userlist/agentcomponents/editCapitalAgentdialog.vue
index 6eb296e..366847b 100644
--- a/src/views/userlist/agentcomponents/editCapitalAgentdialog.vue
+++ b/src/views/userlist/agentcomponents/editCapitalAgentdialog.vue
@@ -6,7 +6,8 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="用户id" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入用户id" disabled v-decorator="['agentId', {}]" />
@@ -14,12 +15,14 @@
<a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入金额"
- v-decorator="['amt', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['amt', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
</a-form-item>
<a-form-item label="扣入款" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择扣入款"
- v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款', }] }]">
+ v-decorator="['direction', { rules: [{ required: true, message: '请选择扣入款' }] }]"
+ >
<a-select-option value="1">扣款</a-select-option>
<a-select-option value="0">入款</a-select-option>
</a-select>
@@ -32,63 +35,62 @@
import { agentupdateAgentAmt } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['amt', 'direction', 'agentId'],
- currentDetails: {}
- }
- },
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
- },
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- this.editUserDialogloading = true
- agentupdateAgentAmt(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['amt', 'direction', 'agentId'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ this.editUserform.setFieldsValue(pick({ agentId: val.id }, this.fields))
+ },
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ this.editUserDialogloading = true
+ agentupdateAgentAmt(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/userlist/agentlist.vue b/src/views/userlist/agentlist.vue
index c06d5c2..3031201 100644
--- a/src/views/userlist/agentlist.vue
+++ b/src/views/userlist/agentlist.vue
@@ -36,13 +36,10 @@
type="primary"
icon="search"
@click=";(agentqueryParam.pageNum = 1), (pagination.current = 1), getagentlist()"
- >查询
+ >查询
</a-button>
- <a-button
- style="margin-left: 8px"
- @click="() => (this.agentqueryParam = {})"
- icon="redo"
- >重置</a-button
+ <a-button style="margin-left: 8px" @click="() => (this.agentqueryParam = {})" icon="redo"
+ >重置</a-button
>
</span>
</a-form-item>
@@ -107,42 +104,42 @@
components: {
editCapitalAgentdialog,
EditAgentinfodialog,
- addagentdialog
+ addagentdialog,
},
- data () {
+ data() {
return {
columns: [
{
title: '所属代理(Id)',
scopedSlots: { customRender: 'agentName' },
- align: 'center'
+ align: 'center',
},
{
title: '代理编码',
dataIndex: 'agentCode',
- align: 'center'
+ align: 'center',
},
{
title: '上级代理',
dataIndex: 'parentName',
align: 'center',
- scopedSlots: { customRender: 'parentName' }
+ scopedSlots: { customRender: 'parentName' },
},
{
title: '代理手机号',
dataIndex: 'agentPhone',
- align: 'center'
+ align: 'center',
},
{
title: '真实姓名',
dataIndex: 'agentRealName',
- align: 'center'
+ align: 'center',
},
{
title: '客服链接',
dataIndex: 'onLineServices',
- align: 'center'
+ align: 'center',
},
{
title: '总资金',
@@ -150,13 +147,13 @@
align: 'center',
customRender: (text, row, index) => {
return text
- }
+ },
},
{
title: '代理状态',
dataIndex: 'isLock',
align: 'center',
- scopedSlots: { customRender: 'isLock' }
+ scopedSlots: { customRender: 'isLock' },
},
{
title: '注册时间',
@@ -164,14 +161,14 @@
align: 'center',
customRender: (text, row, index) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
- }
+ },
},
{
title: '操作',
key: 'action',
align: 'center',
- scopedSlots: { customRender: 'action' }
- }
+ scopedSlots: { customRender: 'action' },
+ },
],
// 表头
pagination: {
@@ -182,7 +179,7 @@
pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
- showTotal: (total) => `共有 ${total} 条数据` // 分页中显示总的数据
+ showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据
},
loading: false,
agentqueryParam: {
@@ -190,55 +187,55 @@
phone: '',
realName: '',
pageNum: 1,
- pageSize: 10
+ pageSize: 10,
},
agentloading: false,
agentlist: [],
- clickagentlist: []
+ clickagentlist: [],
}
},
- created () {
+ created() {
this.getagentlist()
},
methods: {
- getDelagent (val) {
+ getDelagent(val) {
var that = this
this.$confirm({
title: '提示',
content: '确认删除代理?此操作不可恢复',
- onOk () {
+ onOk() {
var data = {
- agentId: val.id
+ agentId: val.id,
}
agentdelAgent(data).then((res) => {
if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
+ that.$message.success(res.msg)
that.getinit()
} else {
- that.$message.error({ content: res.msg })
+ that.$message.error(res.msg)
}
})
},
- onCancel () {
+ onCancel() {
console.log('Cancel')
- }
+ },
})
},
- getinit () {
+ getinit() {
this.queryParam = {
id: undefined,
phone: '',
realName: '',
pageNum: 1,
- pageSize: 10
+ pageSize: 10,
}
this.pagination.current = 1
this.getagentlist()
},
- geteditinit () {
+ geteditinit() {
this.getagentlist()
},
- getagentlist () {
+ getagentlist() {
var that = this
this.loading = true
nextagent(this.agentqueryParam).then((res) => {
@@ -249,12 +246,12 @@
}, 500)
})
},
- getclickagentlist () {
+ getclickagentlist() {
var that = this
this.agentloading = true
var data = {
pageNum: 1,
- pageSize: 100
+ pageSize: 100,
}
nextagent(data).then((res) => {
this.clickagentlist = res.data.list
@@ -263,17 +260,17 @@
}, 500)
})
},
- onPageChange (page, pageSize) {
+ onPageChange(page, pageSize) {
this.agentqueryParam.pageNum = page
this.pagination.current = page
this.getagentlist()
},
- onSizeChange (current, pageSize) {
+ onSizeChange(current, pageSize) {
this.agentqueryParam.pageNum = current
this.pagination.current = page
this.agentqueryParam.pageSize = pageSize
this.getagentlist()
- }
- }
+ },
+ },
}
</script>
diff --git a/src/views/userlist/components/EditUserinfodialog.vue b/src/views/userlist/components/EditUserinfodialog.vue
index a3060b5..08343ba 100644
--- a/src/views/userlist/components/EditUserinfodialog.vue
+++ b/src/views/userlist/components/EditUserinfodialog.vue
@@ -6,13 +6,13 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="所属代理" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择所属代理" v-decorator="['agentId', {}]">
- <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">{{
- item.agentName
- }}
+ <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id"
+ >{{ item.agentName }}
</a-select-option>
</a-select>
</a-form-item>
@@ -48,68 +48,67 @@
import { userupdate } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- },
- agentlist: {
- type: Array
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['agentId', 'phone', 'realName', 'pwd', 'idCard', 'isLogin', 'isLock'],
- currentDetails: {}
- }
+ agentlist: {
+ type: Array,
},
- methods: {
- getEditorder (val) {
- this.currentDetails = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- },
- // 新增用户取消弹窗
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- // 新增用户确定
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- values.id = this.currentDetails.id
- this.editUserDialogloading = true
- userupdate(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['agentId', 'phone', 'realName', 'pwd', 'idCard', 'isLogin', 'isLock'],
+ currentDetails: {},
}
+ },
+ methods: {
+ getEditorder(val) {
+ this.currentDetails = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ },
+ // 新增用户取消弹窗
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ // 新增用户确定
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ values.id = this.currentDetails.id
+ this.editUserDialogloading = true
+ userupdate(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/userlist/components/adduserdialog.vue b/src/views/userlist/components/adduserdialog.vue
index 1228958..f36164e 100644
--- a/src/views/userlist/components/adduserdialog.vue
+++ b/src/views/userlist/components/adduserdialog.vue
@@ -6,22 +6,24 @@
:visible="addUserdialog"
:confirmLoading="addUserDialogloading"
@ok="OkaddUserdialog"
- @cancel="CanceladdUserdialog">
+ @cancel="CanceladdUserdialog"
+ >
<a-form :form="addUserform" ref="addUserform">
<a-form-item label="所属代理" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择所属代理"
- v-decorator="['agentId', { rules: [{ required: true, message: '请选择所属代理', }] }]">
- <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id">{{
- item.agentName
- }}
+ v-decorator="['agentId', { rules: [{ required: true, message: '请选择所属代理' }] }]"
+ >
+ <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id"
+ >{{ item.agentName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="账号类型" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择账号类型"
- v-decorator="['accountType', { rules: [{ required: true, message: '请选择账号类型', }] }]">
+ v-decorator="['accountType', { rules: [{ required: true, message: '请选择账号类型' }] }]"
+ >
<a-select-option value="0">正式</a-select-option>
<a-select-option value="1">模拟</a-select-option>
</a-select>
@@ -29,17 +31,20 @@
<a-form-item label="手机号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入手机号"
- v-decorator="['phone', { rules: [{ required: true, message: '请输入手机号', }] }]" />
+ v-decorator="['phone', { rules: [{ required: true, message: '请输入手机号' }] }]"
+ />
</a-form-item>
<a-form-item label="密码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入密码"
- v-decorator="['pwd', { rules: [{ required: true, message: '请输入密码', }] }]" />
+ v-decorator="['pwd', { rules: [{ required: true, message: '请输入密码' }] }]"
+ />
</a-form-item>
<a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入金额"
- v-decorator="['amt', { rules: [{ required: true, message: '请输入金额', }] }]" />
+ v-decorator="['amt', { rules: [{ required: true, message: '请输入金额' }] }]"
+ />
</a-form-item>
</a-form>
</a-modal>
@@ -48,59 +53,58 @@
<script>
import { useraddSimulatedAccount } from '@/api/home'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- },
- agentlist: {
- type: Array
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- addUserform: this.$form.createForm(this),
- addUserdialog: false,
- addUserDialogloading: false
- }
+ agentlist: {
+ type: Array,
},
- methods: {
- // 新增用户取消弹窗
- 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) {
- this.addUserDialogloading = true
- useraddSimulatedAccount(values).then(res => {
- if (res.status == 0) {
- this.addUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.addUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ addUserform: this.$form.createForm(this),
+ addUserdialog: false,
+ addUserDialogloading: false,
}
+ },
+ methods: {
+ // 新增用户取消弹窗
+ 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) {
+ this.addUserDialogloading = true
+ useraddSimulatedAccount(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
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/userlist/components/audituserdialog.vue b/src/views/userlist/components/audituserdialog.vue
index 6ce26ce..b63007b 100644
--- a/src/views/userlist/components/audituserdialog.vue
+++ b/src/views/userlist/components/audituserdialog.vue
@@ -55,7 +55,6 @@
:preview-src-list="[currentDetails.img1Key]"
>
</el-image>
-
</a-descriptions-item>
<a-descriptions-item label="身份证背面">
<el-image
@@ -135,11 +134,11 @@
userauthByAdmin(values).then((res) => {
if (res.status == 0) {
this.bohuidialog = false
- this.$message.success({ content: res.msg, duration: 2 })
+ this.$message.success(res.msg)
form.resetFields()
this.getinit()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.bohuidialogloading = false
})
@@ -161,7 +160,7 @@
this.userDialog = false
this.getinit()
} else {
- this.$message.error({ content: res.msg })
+ this.$message.error(res.msg)
}
this.userDialog = false
})
diff --git a/src/views/userlist/components/editCapitaluserdialog.vue b/src/views/userlist/components/editCapitaluserdialog.vue
index 5efa897..298ddee 100644
--- a/src/views/userlist/components/editCapitaluserdialog.vue
+++ b/src/views/userlist/components/editCapitaluserdialog.vue
@@ -47,7 +47,7 @@
export default {
components: {},
filters: {
- formatDate (value) {
+ formatDate(value) {
switch (value.accectType) {
case 'US':
return `美元(${value.symbol} ${value.availableBalance})`
@@ -57,49 +57,49 @@
default:
break
}
- }
+ },
},
props: {
getinit: {
type: Function,
- default: function () {}
+ default: function () {},
},
activeArr: {
type: Array,
- default: []
- }
+ default: [],
+ },
},
- data () {
+ data() {
return {
labelCol: {
xs: { span: 24 },
- sm: { span: 7 }
+ sm: { span: 7 },
},
wrapperCol: {
xs: { span: 24 },
- sm: { span: 13 }
+ sm: { span: 13 },
},
editUserform: this.$form.createForm(this),
editUserdialog: false,
editUserDialogloading: false,
fields: ['amt', 'direction', 'userId'],
- currentDetails: {}
+ currentDetails: {},
}
},
methods: {
- getEditorder (val) {
+ getEditorder(val) {
this.currentDetails = val
this.editUserdialog = true
this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
this.editUserform.setFieldsValue(pick(val, this.fields))
this.editUserform.setFieldsValue(pick({ userId: val.id }, this.fields))
},
- CanceleditUserdialog () {
+ CanceleditUserdialog() {
this.editUserdialog = false
const form = this.$refs.editUserform.form
form.resetFields()
},
- OkeditUserdialog () {
+ OkeditUserdialog() {
const form = this.$refs.editUserform.form
form.validateFields((errors, values) => {
console.log(values, 'from')
@@ -110,7 +110,7 @@
updateMoney({ id: arr[0].id, amt: amt }).then((res) => {
if (res.status == 0) {
this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
+ this.$message.success(res.msg)
form.resetFields()
this.getinit()
} else {
@@ -122,7 +122,7 @@
console.log(3333)
}
})
- }
- }
+ },
+ },
}
</script>
diff --git a/src/views/userlist/components/editUserbankdialog.vue b/src/views/userlist/components/editUserbankdialog.vue
index 38a28fd..ac28f65 100644
--- a/src/views/userlist/components/editUserbankdialog.vue
+++ b/src/views/userlist/components/editUserbankdialog.vue
@@ -6,7 +6,8 @@
:visible="editUserdialog"
:confirmLoading="editUserDialogloading"
@ok="OkeditUserdialog"
- @cancel="CanceleditUserdialog">
+ @cancel="CanceleditUserdialog"
+ >
<a-form :form="editUserform" ref="editUserform">
<a-form-item label="银行名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入银行名称" v-decorator="['bankName', {}]" />
@@ -25,78 +26,76 @@
import { userupdateBank, usergetBank } from '@/api/home'
import pick from 'lodash.pick'
export default {
- components: {},
- props: {
- getinit: {
- type: Function,
- default: function () {
- }
- }
+ components: {},
+ props: {
+ getinit: {
+ type: Function,
+ default: function () {},
},
- data () {
- return {
- labelCol: {
- xs: { span: 24 },
- sm: { span: 7 }
- },
- wrapperCol: {
- xs: { span: 24 },
- sm: { span: 13 }
- },
- editUserform: this.$form.createForm(this),
- editUserdialog: false,
- editUserDialogloading: false,
- fields: ['bankName', 'bankAddress', 'bankNo'],
- currentDetails: {},
- bankdetail: ''
- }
- },
- methods: {
- getbankinfo (val) {
- this.currentDetails = val
- const data = {
- userId: val.id
- }
- usergetBank(data).then(res => {
- if (res.status == 0) {
- this.getEditorder(res.data)
- } else {
-
- }
- })
- },
- getEditorder (val) {
- this.bankdetail = val
- this.editUserdialog = true
- this.fields.forEach(v => this.editUserform.getFieldDecorator(v))
- this.editUserform.setFieldsValue(pick(val, this.fields))
- },
- CanceleditUserdialog () {
- this.editUserdialog = false
- const form = this.$refs.editUserform.form
- form.resetFields()
- },
- OkeditUserdialog () {
- const form = this.$refs.editUserform.form
- form.validateFields((errors, values) => {
- if (!errors) {
- // values.id = this.currentDetails.id
- values.id = this.bankdetail.id
- this.editUserDialogloading = true
- userupdateBank(values).then(res => {
- if (res.status == 0) {
- this.editUserdialog = false
- this.$message.success({ content: res.msg, duration: 2 })
- form.resetFields()
- this.getinit()
- } else {
- this.$message.error({ content: res.msg })
- }
- this.editUserDialogloading = false
- })
- }
- })
- }
+ },
+ data() {
+ return {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 13 },
+ },
+ editUserform: this.$form.createForm(this),
+ editUserdialog: false,
+ editUserDialogloading: false,
+ fields: ['bankName', 'bankAddress', 'bankNo'],
+ currentDetails: {},
+ bankdetail: '',
}
+ },
+ methods: {
+ getbankinfo(val) {
+ this.currentDetails = val
+ const data = {
+ userId: val.id,
+ }
+ usergetBank(data).then((res) => {
+ if (res.status == 0) {
+ this.getEditorder(res.data)
+ } else {
+ }
+ })
+ },
+ getEditorder(val) {
+ this.bankdetail = val
+ this.editUserdialog = true
+ this.fields.forEach((v) => this.editUserform.getFieldDecorator(v))
+ this.editUserform.setFieldsValue(pick(val, this.fields))
+ },
+ CanceleditUserdialog() {
+ this.editUserdialog = false
+ const form = this.$refs.editUserform.form
+ form.resetFields()
+ },
+ OkeditUserdialog() {
+ const form = this.$refs.editUserform.form
+ form.validateFields((errors, values) => {
+ if (!errors) {
+ // values.id = this.currentDetails.id
+ values.id = this.bankdetail.id
+ this.editUserDialogloading = true
+ userupdateBank(values).then((res) => {
+ if (res.status == 0) {
+ this.editUserdialog = false
+ this.$message.success(res.msg)
+ form.resetFields()
+ this.getinit()
+ } else {
+ this.$message.error(res.msg)
+ }
+ this.editUserDialogloading = false
+ })
+ }
+ })
+ },
+ },
}
</script>
diff --git a/src/views/userlist/index.vue b/src/views/userlist/index.vue
index 358408c..c3bf913 100644
--- a/src/views/userlist/index.vue
+++ b/src/views/userlist/index.vue
@@ -16,11 +16,8 @@
<a-col :md="12" :lg="6" :sm="24">
<a-form-item label="下级代理">
<a-select v-model="queryParam.agentId" placeholder="请选择下级代理">
- <a-select-option
- v-for="(item, index) in agentlist"
- :key="index"
- :value="item.id"
- >{{ item.agentName }}
+ <a-select-option v-for="(item, index) in agentlist" :key="index" :value="item.id"
+ >{{ item.agentName }}
</a-select-option>
</a-select>
</a-form-item>
@@ -48,14 +45,14 @@
icon="search"
style="margin-left: 8px"
@click=";(queryParam.pageNum = 1), (pagination.current = 1), getuserList()"
- >查询</a-button
+ >查询</a-button
>
<a-button
type="primary"
icon="plus"
style="margin-left: 8px"
@click="$refs.adduserdialog.addUserdialog = true"
- >添加账户</a-button
+ >添加账户</a-button
>
</span>
</a-form-item>
@@ -107,7 +104,7 @@
currentDetails = record
$refs.detailuserdialog.userDialog = true
"
- >用户详情</a
+ >用户详情</a
>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="$refs.EditUserinfodialog.getEditorder(record)">编辑</a>
@@ -123,7 +120,7 @@
currentDetails = record
$refs.audituserdialog.userDialog = true
"
- >实名审核</a
+ >实名审核</a
>
<a-divider type="vertical" />
<a slot="action" href="javascript:;" @click="getDeluser(record)">删除</a>
@@ -159,9 +156,9 @@
EditUserinfodialog,
editUserbankdialog,
editCapitaluserdialog,
- audituserdialog
+ audituserdialog,
},
- data () {
+ data() {
return {
queryParam: {
agentId: undefined,
@@ -169,44 +166,44 @@
phone: '',
pageNum: 1,
pageSize: 10,
- accountType: 0
+ accountType: 0,
},
labelCol: {
xs: { span: 24 },
- sm: { span: 7 }
+ sm: { span: 7 },
},
wrapperCol: {
xs: { span: 24 },
- sm: { span: 13 }
+ sm: { span: 13 },
},
columns: [
{
title: '用户ID',
dataIndex: 'id',
- align: 'center'
+ align: 'center',
},
{
title: '所属代理(Id)',
scopedSlots: { customRender: 'agentName' },
- align: 'center'
+ align: 'center',
},
{
title: '手机号',
dataIndex: 'phone',
- align: 'center'
+ align: 'center',
},
{
title: '真实姓名',
dataIndex: 'realName',
- align: 'center'
+ align: 'center',
},
{
title: '总资金',
dataIndex: 'userAmt',
align: 'center',
customRender: (text, row, index) => {
- return text.toFixed(2)
- }
+ return text ? text.toFixed(2) : '0'
+ },
},
{
title: '认证信息',
@@ -214,19 +211,19 @@
align: 'center',
customRender: (text, row, index) => {
return text == 0 ? '待认证' : text == 1 ? '待审核' : text == 2 ? '认证成功' : text == 3 ? '驳回' : ''
- }
+ },
},
{
title: '交易状态',
dataIndex: 'isLock',
align: 'center',
- scopedSlots: { customRender: 'isLock' }
+ scopedSlots: { customRender: 'isLock' },
},
{
title: '登录状态',
dataIndex: 'isLogin',
align: 'center',
- scopedSlots: { customRender: 'isLogin' }
+ scopedSlots: { customRender: 'isLogin' },
},
{
title: '注册时间',
@@ -234,14 +231,14 @@
align: 'center',
customRender: (text, row, index) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
- }
+ },
},
{
title: '操作',
key: 'action',
align: 'center',
- scopedSlots: { customRender: 'action' }
- }
+ scopedSlots: { customRender: 'action' },
+ },
], // 表头
dataList: [],
pagination: {
@@ -252,25 +249,25 @@
pageSizeOptions: ['10', '20', '50', '100'], // 每页中显示的数据
onShowSizeChange: (current, pageSize) => this.onSizeChange(current, pageSize), // 改变每页数量时更新显示
onChange: (page, pageSize) => this.onPageChange(page, pageSize), // 点击页码事件
- showTotal: (total) => `共有 ${total} 条数据` // 分页中显示总的数据
+ showTotal: (total) => `共有 ${total} 条数据`, // 分页中显示总的数据
},
loading: false,
agentqueryParam: {
pageNum: 1,
- pageSize: 100
+ pageSize: 100,
},
agentlist: [],
currentDetails: {},
- activeArr: []
+ activeArr: [],
}
},
- created () {
+ created() {
this.getuserList()
this.getagentlist()
},
methods: {
- getMoneyzj (record) {
+ getMoneyzj(record) {
console.log(record.id)
getMoney({ userId: record.id }).then((res) => {
if (res.status === 0) {
@@ -281,45 +278,45 @@
})
},
- getDeluser (val) {
+ getDeluser(val) {
var that = this
this.$confirm({
title: '提示',
content: '确认删除该用户吗?此操作不可恢复,将删除该用户所有的充值、提现与持仓记录!',
- onOk () {
+ onOk() {
var data = {
- userId: val.id
+ userId: val.id,
}
userdelete(data).then((res) => {
if (res.status == 0) {
- that.$message.success({ content: res.msg, duration: 2 })
+ that.$message.success(res.msg)
that.getinit()
} else {
- that.$message.error({ content: res.msg })
+ that.$message.error(res.msg)
}
})
},
- onCancel () {
+ onCancel() {
console.log('Cancel')
- }
+ },
})
},
- getinit () {
+ getinit() {
this.queryParam = {
agentId: undefined,
realName: '',
phone: '',
pageNum: 1,
pageSize: 10,
- accountType: 0
+ accountType: 0,
}
this.pagination.current = 1
this.getuserList()
},
- geteditinit () {
+ geteditinit() {
this.getuserList()
},
- getuserList () {
+ getuserList() {
var that = this
this.loading = true
usermanag(this.queryParam).then((res) => {
@@ -330,23 +327,23 @@
}, 500)
})
},
- getagentlist () {
+ getagentlist() {
nextagent(this.agentqueryParam).then((res) => {
this.agentlist = res.data.list
})
},
- onPageChange (page, pageSize) {
+ onPageChange(page, pageSize) {
this.queryParam.pageNum = page
this.pagination.current = page
this.getuserList()
},
- onSizeChange (current, pageSize) {
+ onSizeChange(current, pageSize) {
this.queryParam.pageNum = current
this.pagination.current = page
this.queryParam.pageSize = pageSize
this.getuserList()
},
- handleTableChange () {}
- }
+ handleTableChange() {},
+ },
}
</script>
--
Gitblit v1.9.3