大宝管理后台代码
xxx
dcc
2024-05-07 abcf89c0931fc453f4fd8e1d4d48b8b469d0f3c7
src/views/position/components/futures-hold.vue
@@ -48,7 +48,7 @@
                    icon="search"
                    style="margin-left: 8px"
                    @click=";(queryParam.pageNum = 1), getlist()"
                    >查询
                  >查询
                  </a-button>
                </span>
              </a-form-item>
@@ -92,8 +92,8 @@
                Number(record.nowPrice) - record.buyOrderPrice < 0
                  ? 'greens'
                  : Number(record.nowPrice) - record.buyOrderPrice > 0
                  ? 'reds'
                  : ''
                    ? 'reds'
                    : ''
              "
            >
              {{ Number(record.nowPrice).toFixed(2) }}
@@ -127,7 +127,7 @@
            clickpositionId = record.id
          "
          v-if="record.isLock == 0"
          >锁仓</a
        >锁仓</a
        >
        <a slot="action" href="javascript:;" @click="getLockopen(record.id)" v-else>解锁</a>
        <a-divider type="vertical" />
@@ -159,7 +159,7 @@
import moment from 'moment'
export default {
  name: 'FuturesHold',
  data() {
  data () {
    return {
      columns: [
        {
@@ -169,13 +169,13 @@
          width: 180,
          customRender: (text, row, index) => {
            return `${row.futuresName}(${row.futuresCode})`
          },
          }
        },
        {
          title: '账户类型',
          dataIndex: 'positionType',
          align: 'center',
          scopedSlots: { customRender: 'positionType' },
          scopedSlots: { customRender: 'positionType' }
        },
        {
          title: '用户名称(ID)',
@@ -183,7 +183,7 @@
          align: 'center',
          customRender: (text, row, index) => {
            return `${row.realName}(${row.userId})`
          },
          }
        },
        {
          title: '持仓订单号(ID)',
@@ -191,13 +191,13 @@
          align: 'center',
          customRender: (text, row, index) => {
            return `${row.positionSn}(${row.id})`
          },
          }
        },
        {
          title: '买卖方向',
          dataIndex: 'orderDirection',
          align: 'center',
          scopedSlots: { customRender: 'orderDirection' },
          scopedSlots: { customRender: 'orderDirection' }
        },
        {
          title: '买入点数',
@@ -205,35 +205,35 @@
          align: 'center',
          customRender: (text, row, index) => {
            return text.toFixed(2)
          },
          }
        },
        {
          title: '最新点数',
          dataIndex: 'nowPrice',
          align: 'center',
          scopedSlots: { customRender: 'nowPrice' },
          scopedSlots: { customRender: 'nowPrice' }
        },
        {
          title: '保证金(CNY)',
          dataIndex: 'allDepositAmt',
          align: 'center',
          align: 'center'
        },
        {
          title: '浮动盈亏',
          dataIndex: 'profitAndLose',
          align: 'center',
          scopedSlots: { customRender: 'profitAndLose' },
          scopedSlots: { customRender: 'profitAndLose' }
        },
        {
          title: '总盈亏',
          dataIndex: 'allProfitAndLose',
          align: 'center',
          scopedSlots: { customRender: 'allProfitAndLose' },
          scopedSlots: { customRender: 'allProfitAndLose' }
        },
        {
          title: '数量(手)',
          dataIndex: 'orderNum',
          align: 'center',
          align: 'center'
        },
        {
          title: '每标准手',
@@ -241,7 +241,7 @@
          align: 'center',
          customRender: (text, row, index) => {
            return row.futuresStandard + row.futuresUnit
          },
          }
        },
        {
          title: '手续费',
@@ -249,7 +249,7 @@
          align: 'center',
          customRender: (text, row, index) => {
            return `${row.orderFee} ${row.coinCode} ≈ ${(row.orderFee * row.coinRate).toFixed(2)} CNY`
          },
          }
        },
        {
          title: '当前汇率',
@@ -257,12 +257,12 @@
          align: 'center',
          customRender: (text, row, index) => {
            return `1${row.coinCode} ≈ ${row.coinRate}CNY`
          },
          }
        },
        {
          title: '锁定原因',
          dataIndex: 'lockMsg',
          align: 'center',
          align: 'center'
        },
        {
          title: '买入时间',
@@ -271,7 +271,7 @@
          width: 180,
          customRender: (text, row, index) => {
            return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
          },
          }
        },
        {
          title: '操作',
@@ -279,8 +279,8 @@
          align: 'center',
          fixed: 'right',
          width: 150,
          scopedSlots: { customRender: 'action' },
        },
          scopedSlots: { customRender: 'action' }
        }
      ],
      // 表头
      pagination: {
@@ -290,7 +290,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,
      queryParam: {
@@ -300,7 +300,7 @@
        agentId: undefined,
        userId: '',
        positionSn: '',
        state: 0,
        state: 0
      },
      datalist: [],
      agentlist: [],
@@ -311,20 +311,20 @@
      clickpositionId: '',
      agentqueryParam: {
        pageNum: 1,
        pageSize: 100,
      },
        pageSize: 100
      }
    }
  },
  created() {},
  created () {},
  methods: {
    getCompulsoryclosing(val) {
    getCompulsoryclosing (val) {
      var that = this
      this.$confirm({
        title: '提示',
        content: '确认要强制平仓吗?',
        onOk() {
        onOk () {
          var data = {
            positionSn: val,
            positionSn: val
          }
          futurespositionsell(data).then((res) => {
            if (res.status == 0) {
@@ -335,20 +335,20 @@
            }
          })
        },
        onCancel() {
        onCancel () {
          console.log('Cancel')
        },
        }
      })
    },
    getLockopen(val) {
    getLockopen (val) {
      var that = this
      this.$confirm({
        title: '提示',
        content: '确认要解锁该持仓单?',
        onOk() {
        onOk () {
          var data = {
            state: 0,
            positionId: val,
            positionId: val
          }
          futurespositionlock(data).then((res) => {
            if (res.status == 0) {
@@ -359,17 +359,17 @@
            }
          })
        },
        onCancel() {
        onCancel () {
          console.log('Cancel')
        },
        }
      })
    },
    handleCancel() {
    handleCancel () {
      this.Lockvisibledialig = false
      const form = this.$refs.createModal.form
      form.resetFields()
    },
    getDialogok() {
    getDialogok () {
      const form = this.$refs.createModal.form
      form.validateFields((errors, values) => {
        if (!errors) {
@@ -377,7 +377,7 @@
          var data = {
            state: 1,
            lockMsg: values.lockMsg,
            positionId: this.clickpositionId,
            positionId: this.clickpositionId
          }
          futurespositionlock(data).then((res) => {
            if (res.status == 0) {
@@ -393,7 +393,7 @@
        }
      })
    },
    getinit() {
    getinit () {
      this.queryParam = {
        pageNum: 1,
        pageSize: 10,
@@ -401,11 +401,11 @@
        agentId: undefined,
        userId: '',
        positionSn: '',
        state: 0,
        state: 0
      }
      this.getlist()
    },
    getqueryParam() {
    getqueryParam () {
      this.queryParam = {
        pageNum: 1,
        pageSize: 10,
@@ -413,10 +413,10 @@
        agentId: undefined,
        userId: '',
        positionSn: '',
        state: 0,
        state: 0
      }
    },
    getagentlist() {
    getagentlist () {
      var that = this
      this.agentloading = true
      nextagent(this.agentqueryParam).then((res) => {
@@ -426,7 +426,7 @@
        }, 500)
      })
    },
    getlist() {
    getlist () {
      this.loading = true
      futurespositionlist(this.queryParam).then((res) => {
        this.datalist = res.data.list
@@ -434,16 +434,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>