大宝管理后台代码
dcc
2024-07-10 bfd4f0e5ac1c8da2b997c2fee7738e9f4bb976da
涨停板审核
3 files modified
2 files added
479 ■■■■■ changed files
src/api/position.js 18 ●●●●● patch | view | raw | blame | history
src/config/router.config.js 6 ●●●●● patch | view | raw | blame | history
src/views/position/components/dailyPriceLimitReview-hold.vue 410 ●●●●● patch | view | raw | blame | history
src/views/position/dailyPriceLimitReview.vue 32 ●●●●● patch | view | raw | blame | history
src/views/vip/components/VIPScramble-hold.vue 13 ●●●● patch | view | raw | blame | history
src/api/position.js
@@ -2,6 +2,8 @@
import qs from 'qs'
const userApi = {
    orderList: '/admin/pending/orderList.do', //现价交易
    purchaseList : '/admin/purchase/list.do', // 列表
    purchaseExamine : '/admin/purchase/examine.do', //审核通过
    sitevipList: '/admin/sitevip/list.do', //vip
    sitevipAdd: '/admin/sitevip/add.do', //vip sitevipUpdate
    sitevipUpdate: '/admin/sitevip/update.do', //vip
@@ -44,6 +46,22 @@
    })
}
export function purchaseList (parameter) {
    return request({
        url: userApi.purchaseList,
        method: 'get',
        params: parameter
    })
}
export function purchaseExamine (parameter) {
    return request({
        url: userApi.purchaseExamine,
        method: 'post',
        data: qs.stringify(parameter)
    })
}
export function orderList (parameter) {
    return request({
        url: userApi.orderList,
src/config/router.config.js
@@ -177,6 +177,12 @@
            component: () => import('@/views/position/currentPriceReview'),
            meta: { title: '现价审核', keepAlive: true, permission: ['financing'] },
          },
          {
            path: '/position/dailyPriceLimitReview',
            name: 'dailyPriceLimitReview',
            component: () => import('@/views/position/dailyPriceLimitReview'),
            meta: { title: '涨停板审核', keepAlive: true, permission: ['financing'] },
          },
          // {
          //   path: '/position/createfinancing',
          //   name: 'createfinancing',
src/views/position/components/dailyPriceLimitReview-hold.vue
New file
@@ -0,0 +1,410 @@
<template>
  <div>
    <a-card :bordered="false">
      <div class="table-page-search-wrapper">
        <a-form layout="inline">
          <a-row :gutter="48">
            <a-col :md="12" :lg="6" :sm="24">
              <a-form-item label="搜索关键次">
                <a-input v-model="queryParam.keywords" style="width: 100%" placeholder="请输入搜索关键次" />
              </a-form-item>
            </a-col>
            <a-col :md="12" :lg="6" :sm="24">
              <a-form-item label="状态">
                <a-select v-model="queryParam.status" placeholder="请选择状态">
                  <a-select-option :value="''">全部</a-select-option>
                  <a-select-option :value="0">待审核</a-select-option>
                  <a-select-option :value="1">买入成功</a-select-option>
                  <a-select-option :value="2">买入失败</a-select-option>
                </a-select>
              </a-form-item>
            </a-col>
          </a-row>
          <a-row :gutter="48">
            <a-col :md="12" :lg="6" :sm="24">
              <a-form-item>
                <span class="table-page-search-submitButtons">
                  <a-button @click="getqueryParam" icon="redo"> 重置</a-button>
                  <a-button
                    type="primary"
                    icon="search"
                    style="margin-left: 8px"
                    @click=";(queryParam.pageNum = 1), getlist()"
                    >查询
                  </a-button>
                </span>
              </a-form-item>
            </a-col>
          </a-row>
        </a-form>
      </div>
    </a-card>
    <a-table
      bordered
      :loading="loading"
      :pagination="pagination"
      :columns="columns"
      :data-source="datalist"
      rowKey="id"
    >
      <span slot="stockName" slot-scope="text, record">
        <template>
          <div>
            <span style="margin-right: 10px">{{ record.stockName }}</span>
            <a-tag
              :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">
        <template>
          <div>
            <a-tag :color="record.positionType == 1 ? 'blue' : 'green'">
              {{ record.positionType == 1 ? '模拟持仓' : '正式持仓' }}
            </a-tag>
          </div>
        </template>
      </span>
      <span slot="status" slot-scope="text, record">
        <template>
          <div>
            <a-tag v-if="record.status == 0"> 待审核 </a-tag>
            <a-tag v-if="record.status == 1"> 买入成功 </a-tag>
            <a-tag v-if="record.status == 2"> 买入失败 </a-tag>
          </div>
        </template>
      </span>
      <span slot="orderDirection" slot-scope="text, record">
        <template>
          <div>
            <a-tag :color="record.orderDirection == '买涨' ? 'red' : 'green'">
              {{ record.orderDirection }}
            </a-tag>
          </div>
        </template>
      </span>
      <span slot="nowPrice" slot-scope="text, record">
        <template>
          <div>
            <p
              :class="
                Number(record.nowPrice) - record.targetPrice < 0
                  ? 'greens'
                  : Number(record.nowPrice) - record.targetPrice > 0
                  ? 'reds'
                  : ''
              "
            >
              {{ record.nowPrice }}
            </p>
          </div>
        </template>
      </span>
      <span slot="profitAndLose" slot-scope="text">
        <template>
          <div>
            <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">
              {{ text }}
            </p>
          </div>
        </template>
      </span>
      <span slot="allProfitAndLose" slot-scope="text">
        <template>
          <div>
            <p :class="text < 0 ? 'greens' : text > 0 ? 'reds' : ''">
              {{ text }}
            </p>
          </div>
        </template>
      </span>
      <template slot="action" slot-scope="text, record"  v-if="record.status == 0">
        <a slot="action" href="javascript:;" @click="getLockopen(record.id)">审核通过</a>
      </template>
    </a-table>
    <a-modal
      title="锁仓"
      :width="640"
      :visible="Lockvisibledialog"
      :confirmLoading="Lockvisibleloading"
      @ok="getDialogok"
      @cancel="handleCancel"
    >
      <a-form :form="Lockvisibleform" ref="createModal">
        <a-form-item>
          <a-input
            v-decorator="['lockMsg', { rules: [{ required: true, message: '请输入锁仓原因!', whitespace: true }] }]"
            placeholder="请输入锁仓原因!"
          />
        </a-form-item>
      </a-form>
    </a-modal>
  </div>
</template>
<script>
import { positionlist, positionlock, positionsell, purchaseList, purchaseExamine } from '@/api/position'
import { nextagent } from '@/api/home'
import moment from 'moment'
export default {
  name: 'Financinghold',
  data() {
    return {
      columns: [
        {
          title: 'ID',
          dataIndex: 'id',
          align: 'center',
        },
        {
          title: '用户ID',
          dataIndex: 'userId',
          align: 'center',
        },
        {
          title: '股票ID',
          dataIndex: 'stockCode',
          align: 'center',
        },
        {
          title: '数量',
          dataIndex: 'buyNum',
          align: 'center',
        },
        // {
        //   title: '类型',
        //   dataIndex: 'buyType',
        //   align: 'center',
        // },
        // {
        //   title: '止盈',
        //   dataIndex: 'profitTarget',
        //   align: 'center',
        // },
        // {
        //   title: '止损',
        //   dataIndex: 'stopTarget',
        //   align: 'center',
        // },
        {
          title: '现价',
          dataIndex: 'nowPrice',
          align: 'center',
          scopedSlots: { customRender: 'nowPrice' },
        },
        // {
        //   title: '目标价格',
        //   dataIndex: 'targetPrice',
        //   align: 'center',
        // },
        {
          title: '状态',
          dataIndex: 'status',
          align: 'center',
          scopedSlots: { customRender: 'status' },
        },
        {
          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,
        keywords: '',
        status: '',
      },
      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 = {
            id: val,
          }
          purchaseExamine(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,
        keywords: '',
        status: '',
      }
      this.getlist()
    },
    getqueryParam() {
      this.queryParam = {
        pageNum: 1,
        pageSize: 10,
        keywords: '',
        status: '',
      }
    },
    getagentlist() {
      var that = this
      this.agentloading = true
      nextagent(this.agentqueryParam).then((res) => {
        this.agentlist = res.data.list
        setTimeout(() => {
          that.agentloading = false
        }, 500)
      })
    },
    getlist() {
      this.loading = true
      console.log(this.queryParam)
      purchaseList(this.queryParam).then((res) => {
        console.log(res)
        this.datalist = res.data.records
        this.pagination.total = res.data.total
        this.loading = false
      })
    },
    onPageChange(page, pageSize) {
      this.queryParam.pageNum = page
      this.getlist()
    },
    onSizeChange(current, pageSize) {
      this.queryParam.pageNum = current
      this.queryParam.pageSize = pageSize
      this.getlist()
    },
  },
}
</script>
<style scoped>
.greens {
  color: #52c41a;
}
.reds {
  color: #f5222d;
}
</style>
src/views/position/dailyPriceLimitReview.vue
New file
@@ -0,0 +1,32 @@
<template>
    <page-header-wrapper>
      <a-card>
        <dailyPriceLimitReviewHold ref="dailyPriceLimitReviewHold"></dailyPriceLimitReviewHold>
      </a-card>
    </page-header-wrapper>
  </template>
  <script>
  import dailyPriceLimitReviewHold from './components/dailyPriceLimitReview-hold'
  export default {
      name: 'dailyPriceLimitReview',
      components: {
        dailyPriceLimitReviewHold,
      },
      data () {
          return {
          }
      },
      methods: {
      }
  }
  </script>
  <style lang="less" scoped>
  /deep/ .ant-tabs-nav-scroll {
      display: flex;
      justify-content: center;
  }
  </style>
src/views/vip/components/VIPScramble-hold.vue
@@ -374,11 +374,9 @@
      })
    },
    geteditStock(val) {
      console.log(val);
      this.currentdetail = val
      this.Lockvisibledialog = true
      this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
      console.log(this.fields);
      this.addUserform.setFieldsValue(pick(val, this.fields))
    },
    getLockopen(val) {
@@ -422,7 +420,7 @@
        console.log(values);
        if (!errors) {
          if (this.currentdetail != '') {
            this.Lockvisibledialog = true
            this.Lockvisibleloading = true
            values.id = this.currentdetail.id
            // values.subscriptionTime = this.subscriptionTime
@@ -437,10 +435,10 @@
              } else {
                this.$message.error(res.msg)
              }
              this.Lockvisibledialog = false
              this.Lockvisibleloading = false
            })
          } else {
            this.addUserDialogloading = true
            this.Lockvisibleloading = true
            sitevipAdd(values).then((res) => {
              if (res.status == 0) {
                this.Lockvisibledialog = false
@@ -450,7 +448,7 @@
              } else {
                this.$message.error(res.msg)
              }
              this.addUserDialogloading = false
              this.Lockvisibleloading = false
            })
          }
        }
@@ -462,6 +460,7 @@
      form.validateFields((errors, values) => {
        if (!errors) {
          values.id = this.details.id
          this.keyvisibleloading = true
          setupdate(values).then((res) => {
              if (res.status == 0) {
                this.visibledialog = false
@@ -471,7 +470,7 @@
              } else {
                this.$message.error(res.msg)
              }
              this.visibledialog = false
              this.keyvisibleloading = false
            })
        }
      })