| | |
| | | import pick from 'lodash.pick' |
| | | export default { |
| | | name: 'Shares', |
| | | data() { |
| | | data () { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: '股票代码', |
| | | dataIndex: 'stockCode', |
| | | align: 'center', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '股票名称', |
| | | dataIndex: 'stockName', |
| | | align: 'center', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '股票开始时间', |
| | | dataIndex: 'startTime', |
| | | align: 'center', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '股票结束时间', |
| | | dataIndex: 'endTime', |
| | | align: 'center', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '类型', |
| | | dataIndex: 'type', |
| | | align: 'center', |
| | | scopedSlots: { customRender: 'type' }, |
| | | scopedSlots: { customRender: 'type' } |
| | | }, |
| | | { |
| | | title: '金额', |
| | | dataIndex: 'price', |
| | | align: 'center', |
| | | align: 'center' |
| | | }, |
| | | |
| | | { |
| | |
| | | key: 'action', |
| | | align: 'center', |
| | | scopedSlots: { |
| | | customRender: 'action', |
| | | }, |
| | | }, |
| | | customRender: 'action' |
| | | } |
| | | } |
| | | ], |
| | | disabledDate: true, |
| | | // 表头 |
| | |
| | | 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, |
| | | typeValue: 0, |
| | |
| | | code: '', |
| | | name: '', |
| | | zt: undefined, |
| | | type: 0, |
| | | type: 0 |
| | | }, |
| | | datalist: [], |
| | | labelCol: { |
| | | xs: { |
| | | span: 8, |
| | | span: 8 |
| | | }, |
| | | sm: { |
| | | span: 8, |
| | | span: 8 |
| | | }, |
| | | md: { |
| | | span: 8, |
| | | }, |
| | | span: 8 |
| | | } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { |
| | | span: 14, |
| | | span: 14 |
| | | }, |
| | | sm: { |
| | | span: 14, |
| | | span: 14 |
| | | }, |
| | | md: { |
| | | span: 14, |
| | | }, |
| | | span: 14 |
| | | } |
| | | }, |
| | | addUserform: this.$form.createForm(this), |
| | | addUserdialog: false, |
| | |
| | | fields: ['stockCode', 'stockName', 'startTime', 'endTime', 'type', 'price'], |
| | | 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.id, |
| | | id: val.id |
| | | } |
| | | stockdelete(data).then((res) => { |
| | | if (res.status == 0) { |
| | | that.$message.success({ |
| | | content: res.msg, |
| | | duration: 2, |
| | | duration: 2 |
| | | }) |
| | | that.getinit() |
| | | } else { |
| | | that.$message.error({ |
| | | content: res.msg, |
| | | content: res.msg |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | 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) { |
| | | geteditStock (val) { |
| | | this.currentdetail = val |
| | | this.addUserdialog = true |
| | | var currentTime = new Date() |
| | |
| | | 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'), |
| | | subscribeTime: moment(val.subscribeTime ? val.subscribeTime : currentTime).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) => { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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 |
| | | SettingqueryAll(this.queryParam).then((res) => { |
| | | this.datalist = res.data |
| | |
| | | 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> |