大宝管理后台代码
xxx
dcc
2024-05-07 abcf89c0931fc453f4fd8e1d4d48b8b469d0f3c7
src/views/newshares/dazonglist.vue
@@ -18,7 +18,7 @@
                    icon="search"
                    style="margin-left: 8px"
                    @click=";(queryParam.pageNum = 1), (pagination.current = 1), getlist()"
                    >查询
                  >查询
                  </a-button>
                  <a-button
                    type="primary"
@@ -153,34 +153,34 @@
import moment from 'moment'
export default {
  name: 'Shares',
  data() {
  data () {
    return {
      columns: [
        {
          title: '新股名称',
          dataIndex: 'stockName',
          align: 'center',
          align: 'center'
        },
        {
          title: '新股代码',
          dataIndex: 'stockCode',
          align: 'center',
          align: 'center'
        },
        {
          title: '最小购买数量',
          dataIndex: 'stockNum',
          align: 'center',
          align: 'center'
        },
        {
          title: '折扣',
          dataIndex: 'discount',
          align: 'center',
          align: 'center'
        },
        {
          title: '股票类型',
          dataIndex: 'stockType',
          align: 'center',
          scopedSlots: { customRender: 'stockType' },
          scopedSlots: { customRender: 'stockType' }
        },
        {
          title: '开始时间',
@@ -188,7 +188,7 @@
          align: 'center',
          customRender: (text, row, index) => {
            return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : '- -'
          },
          }
        },
        {
          title: '结束时间',
@@ -196,14 +196,14 @@
          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' },
        },
          scopedSlots: { customRender: 'action' }
        }
      ],
      // 表头
      pagination: {
@@ -214,24 +214,24 @@
        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,
        keywords: '',
        keywords: ''
      },
      datalist: [],
      labelCol: {
        xs: { span: 9 },
        sm: { span: 9 },
        md: { span: 9 },
        md: { span: 9 }
      },
      wrapperCol: {
        xs: { span: 14 },
        sm: { span: 14 },
        md: { span: 14 },
        md: { span: 14 }
      },
      addUserform: this.$form.createForm(this),
      addUserdialog: false,
@@ -239,27 +239,27 @@
      fields: ['stockCode', 'stockNum', 'password', 'startTime', 'endTime', 'discount'],
      currentdetail: '',
      startTime: '',
      endTime: '',
      endTime: ''
    }
  },
  created() {
  created () {
    this.getlist()
  },
  methods: {
    getstartTime(date, dateString) {
    getstartTime (date, dateString) {
      this.startTime = dateString
    },
    getendTime(date, dateString) {
    getendTime (date, dateString) {
      this.endTime = dateString
    },
    getdeleteStock(val) {
    getdeleteStock (val) {
      var that = this
      this.$confirm({
        title: '提示',
        content: '确认删除该大宗股票吗?此操作不可恢复!',
        onOk() {
        onOk () {
          var data = {
            id: val.id,
            id: val.id
          }
          deleteByAdmin(data).then((res) => {
            if (res.status == 0) {
@@ -270,29 +270,29 @@
            }
          })
        },
        onCancel() {
        onCancel () {
          console.log('Cancel')
        },
        }
      })
    },
    geteditStock(val) {
    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') : '',
        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() {
    CanceladdUserdialog () {
      this.addUserdialog = false
      const form = this.$refs.addUserform.form
      form.resetFields()
    },
    OkaddUserdialog() {
    OkaddUserdialog () {
      const form = this.$refs.addUserform.form
      form.validateFields((errors, values) => {
        if (!errors) {
@@ -328,19 +328,19 @@
        }
      })
    },
    getqueryParam() {
    getqueryParam () {
      this.queryParam = {
        pageNum: 1,
        pageSize: 10,
        keywords: '',
        keywords: ''
      }
    },
    getinit() {
    getinit () {
      this.getqueryParam()
      this.pagination.current = 1
      this.getlist()
    },
    getlist() {
    getlist () {
      this.loading = true
      getDzListByAdmin(this.queryParam).then((res) => {
        this.datalist = res.data
@@ -348,17 +348,17 @@
        this.loading = false
      })
    },
    onPageChange(page, pageSize) {
    onPageChange (page, pageSize) {
      this.queryParam.pageNum = page
      this.pagination.current = page
      this.getlist()
    },
    onSizeChange(current, pageSize) {
    onSizeChange (current, pageSize) {
      this.queryParam.pageNum = current
      this.pagination.current = page
      this.queryParam.pageSize = pageSize
      this.getlist()
    },
  },
    }
  }
}
</script>