大宝管理后台代码
xxx
dcc
2024-05-07 abcf89c0931fc453f4fd8e1d4d48b8b469d0f3c7
src/views/newshares/newshareslist.vue
@@ -42,7 +42,7 @@
                    icon="search"
                    style="margin-left: 8px"
                    @click=";(queryParam.pageNum = 1), (pagination.current = page), getlist()"
                    >查询
                  >查询
                  </a-button>
                  <a-button
@@ -221,6 +221,18 @@
              </a-date-picker>
            </a-form-item>
          </a-col>
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="上市时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-date-picker
                show-time
                style="width: 100%"
                @change="getListDate"
                v-decorator="['listDate', { rules: [{ required: true, message: '请填写上市时间' }] }]"
                format="YYYY-MM-DD HH:mm:ss"
              >
              </a-date-picker>
            </a-form-item>
          </a-col>
          <!-- <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="预估价格" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
@@ -239,19 +251,19 @@
import pick from 'lodash.pick'
export default {
  name: 'Shares',
  data() {
  data () {
    return {
      columns: [
        {
          title: '新股名称 / 新股代码',
          dataIndex: 'name',
          align: 'center',
          scopedSlots: { customRender: 'name' },
          scopedSlots: { customRender: 'name' }
        },
        {
          title: '最大购买数量',
          dataIndex: 'orderNumber',
          align: 'center',
          align: 'center'
        },
        // {
        //     title: '预估价格',
@@ -261,25 +273,25 @@
        {
          title: '价格',
          dataIndex: 'price',
          align: 'center',
          align: 'center'
        },
        {
          title: '是否显示',
          dataIndex: 'zt',
          align: 'center',
          scopedSlots: { customRender: 'zt' },
          scopedSlots: { customRender: 'zt' }
        },
        {
          title: '新股模式',
          dataIndex: 'type',
          align: 'center',
          scopedSlots: { customRender: 'type' },
          scopedSlots: { customRender: 'type' }
        },
        {
          title: '股票类型',
          dataIndex: 'stockType',
          align: 'center',
          scopedSlots: { customRender: 'stockType' },
          scopedSlots: { customRender: 'stockType' }
        },
        {
@@ -288,7 +300,7 @@
          align: 'center',
          customRender: (text, row, index) => {
            return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
          },
          }
        },
        {
          title: '认缴时间',
@@ -296,7 +308,7 @@
          align: 'center',
          customRender: (text, row, index) => {
            return text ? moment(text).format('YYYY-MM-DD HH:mm:ss') : ''
          },
          }
        },
        {
          title: '上市时间',
@@ -304,14 +316,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' }
        }
      ],
      disabledDate: true,
      // 表头
@@ -323,7 +335,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: {
@@ -332,18 +344,18 @@
        code: '',
        name: '',
        zt: undefined,
        type: undefined,
        type: undefined
      },
      datalist: [],
      labelCol: {
        xs: { span: 8 },
        sm: { span: 8 },
        md: { span: 8 },
        md: { span: 8 }
      },
      wrapperCol: {
        xs: { span: 14 },
        sm: { span: 14 },
        md: { span: 14 },
        md: { span: 14 }
      },
      addUserform: this.$form.createForm(this),
      addUserdialog: false,
@@ -361,25 +373,25 @@
        'stockType',
        'code',
        'pe',
        'listDate',
        'listDate'
      ],
      currentdetail: '',
      subscribeTime: '',
      subscriptionTime: '',
      subscriptionTime: ''
    }
  },
  created() {
  created () {
    this.getlist()
  },
  methods: {
    getdeleteStock(val) {
    getdeleteStock (val) {
      var that = this
      this.$confirm({
        title: '提示',
        content: '确认删除该新股吗?此操作不可恢复!',
        onOk() {
        onOk () {
          var data = {
            id: val.newlistId,
            id: val.newlistId
          }
          subscribedel(data).then((res) => {
            if (res.status == 0) {
@@ -390,18 +402,21 @@
            }
          })
        },
        onCancel() {
        onCancel () {
          console.log('Cancel')
        },
        }
      })
    },
    getsubscribeTime(date, dateString) {
    getsubscribeTime (date, dateString) {
      this.subscribeTime = dateString
    },
    getsubscriptionTime(date, dateString) {
    getsubscriptionTime (date, dateString) {
      this.subscriptionTime = dateString
    },
    geteditStock(val) {
    getListDate (date, dateString) {
      this.listDate = dateString
    },
    geteditStock (val) {
      this.currentdetail = val
      this.addUserdialog = true
      var currentTime = new Date()
@@ -410,20 +425,25 @@
      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'),
        listDate: moment(val.listDate ? val.listDate : 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() {
    CanceladdUserdialog () {
      this.addUserdialog = false
      const form = this.$refs.addUserform.form
      form.resetFields()
    },
    OkaddUserdialog() {
    OkaddUserdialog () {
      const form = this.$refs.addUserform.form
      form.validateFields((errors, values) => {
@@ -432,6 +452,7 @@
            this.addUserDialogloading = true
            values.newlistId = this.currentdetail.newlistId
            values.subscriptionTime = this.subscriptionTime
            values.listDate = this.listDate
            values.subscribeTime = this.subscribeTime
            subscribeupdate(values).then((res) => {
              if (res.status == 0) {
@@ -447,6 +468,7 @@
          } else {
            this.addUserDialogloading = true
            values.subscriptionTime = this.subscriptionTime
            values.listDate = this.listDate
            values.subscribeTime = this.subscribeTime
            subscribeadd(values).then((res) => {
              if (res.status == 0) {
@@ -463,22 +485,22 @@
        }
      })
    },
    getqueryParam() {
    getqueryParam () {
      this.queryParam = {
        pageNum: 1,
        pageSize: 10,
        code: '',
        name: '',
        zt: undefined,
        type: undefined,
        type: undefined
      }
    },
    getinit() {
    getinit () {
      this.getqueryParam()
      this.pagination.current = 1
      this.getlist()
    },
    getlist() {
    getlist () {
      this.loading = true
      subscribelist(this.queryParam).then((res) => {
        this.datalist = res.data.list
@@ -486,17 +508,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>