大宝管理后台代码
ne1
zzzz
2024-04-07 69ff731fbacf2f2ae16f98a355506bfeb01dd567
src/views/product/markettrading.vue
@@ -33,7 +33,6 @@
            </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">
@@ -48,11 +47,13 @@
              type="primary"
              icon="plus"
              style="margin-left: 8px"
              @click="addUserdialog = true, currentdetail = ''">
              添加盘前</a-button>
              @click=";(addUserdialog = true), (currentdetail = '')"
            >
              添加盘前</a-button
            >
          </a-col>
        </a-row>
        </a-form>
        <!-- </a-form> -->
      </div>
    </a-card>
@@ -63,8 +64,8 @@
        :pagination="pagination"
        :columns="columns"
        :data-source="datalist"
        rowKey="newlistId">
        rowKey="newlistId"
      >
        <span slot="type" slot-scope="text,record">
          <template>
            <div>
@@ -89,21 +90,24 @@
      :visible="addUserdialog"
      :confirmLoading="addUserDialogloading"
      @ok="OkaddUserdialog"
      @cancel="CanceladdUserdialog">
      @cancel="CanceladdUserdialog"
    >
      <a-form :form="addUserform" ref="addUserform">
        <a-row :gutter="48">
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="股票code" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <a-form-item label="股票代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票code"
                v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票code', }] }]" />
                placeholder="请输入股票代码"
                v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票代码' }] }]"
              />
            </a-form-item>
          </a-col>
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="股票名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票名称"
                v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称', }] }]" />
                v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称' }] }]"
              />
            </a-form-item>
          </a-col>
        </a-row>
@@ -112,17 +116,19 @@
            <a-form-item label="盘前价格" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入盘前价格"
                v-decorator="['price', { rules: [{ required: true, message: '请输入盘前价格', }] }]" />
                v-decorator="['price', { rules: [{ required: true, message: '请输入盘前价格' }] }]"
              />
            </a-form-item>
          </a-col>
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="金额模式" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-select
                :value="typeValue"
                placeholder="请选择金额模式"
                v-decorator="['type', { rules: [{ required: true, message: '请选择金额模式', }] }]"
                v-decorator="['type', { rules: [{ required: true, message: '请选择金额模式' }] }]"
              >
                <a-select-option :value="0">价格</a-select-option>
                <a-select-option :value="1">百分比</a-select-option>
                <a-select-option value="0">价格</a-select-option>
                <a-select-option value="1">百分比</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
@@ -132,14 +138,16 @@
            <a-form-item label="股票开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票调价开始时间"
                v-decorator="['startTime', { rules: [{ required: true, message: '请输入股票调价开始时间', }] }]" />
                v-decorator="['startTime', { rules: [{ required: true, message: '请输入股票调价开始时间' }] }]"
              />
            </a-form-item>
          </a-col>
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="股票结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票结束时间"
                v-decorator="['endTime', { rules: [{ required: true, message: '请输入股票结束时间', }] }]" />
                v-decorator="['endTime', { rules: [{ required: true, message: '请输入股票结束时间' }] }]"
              />
            </a-form-item>
          </a-col>
        </a-row>
@@ -148,25 +156,7 @@
  </page-header-wrapper>
</template>
<script>
  import {
    subscribelist,
    subscribeadd,
    subscribeupdate,
    subscribedel
  } from '@/api/newshares'
  import {
    paylist,
    payupdate,
    payadd,
    paydel,
    adminupload,
    queryAll,
    updatetime,
    SettingqueryAll,
    stockupdata,
    stockadd,
    stockdelete
  } from '@/api/allsetting'
import { SettingqueryAll, stockupdata, stockadd, stockdelete } from '@/api/allsetting'
  import moment from 'moment'
  import pick from 'lodash.pick'
  export default {
@@ -177,34 +167,33 @@
          {
            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',
          },
          {
@@ -212,9 +201,9 @@
            key: 'action',
            align: 'center',
            scopedSlots: {
              customRender: 'action'
            }
          }
            customRender: 'action',
          },
        },
        ],
        disabledDate: true,
        // 表头
@@ -226,39 +215,40 @@
          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,
        queryParam: {
          pageNum: 1,
          pageSize: 10,
          code: '',
          name: '',
          zt: undefined,
          type: undefined
        type: undefined,
        },
        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,
@@ -267,8 +257,7 @@
        fields: ['stockCode', 'stockName', 'startTime', 'endTime', 'type', 'price' ],
        currentdetail: '',
        subscribeTime: '',
        subscriptionTime: ''
      subscriptionTime: '',
      }
    },
    created () {
@@ -282,25 +271,25 @@
          content: '确认删除该盘前吗?此操作不可恢复!',
          onOk () {
            var data = {
              id: val.id
            id: val.id,
            }
            stockdelete(data).then(res => {
          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 () {
            console.log('Cancel')
          }
        },
        })
      },
      getsubscribeTime (date, dateString) {
@@ -313,17 +302,16 @@
        this.currentdetail = val
        this.addUserdialog = true
        var currentTime = new Date()
        this.fields.forEach(v => this.addUserform.getFieldDecorator(v))
      this.fields.forEach((v) => this.addUserform.getFieldDecorator(v))
        this.addUserform.setFieldsValue(pick(val, this.fields))
        this.addUserform.setFieldsValue({
          subscriptionTime: moment(val.subscriptionTime ? val.subscriptionTime : currentTime).format(
            'YYYY-MM-DD HH:mm:ss')
          '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'),
        })
        // 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 () {
        this.addUserdialog = false
@@ -340,37 +328,27 @@
              values.id = this.currentdetail.id
              // values.subscriptionTime = this.subscriptionTime
              // values.subscribeTime = this.subscribeTime
              stockupdata(values).then(res => {
            stockupdata(values).then((res) => {
                if (res.status == 0) {
                  this.addUserdialog = false
                  this.$message.success({
                    content: res.msg,
                    duration: 2
                  })
                this.$message.success(res.msg)
                  form.resetFields()
                  this.getlist()
                } else {
                  this.$message.error({
                    content: res.msg
                  })
                this.$message.error(res.msg)
                }
                this.addUserDialogloading = false
              })
            } else {
              this.addUserDialogloading = true
              stockadd(values).then(res => {
            stockadd(values).then((res) => {
                if (res.status == 0) {
                  this.addUserdialog = false
                  this.$message.success({
                    content: res.msg,
                    duration: 2
                  })
                this.$message.success(res.msg)
                  form.resetFields()
                  this.getinit()
                } else {
                  this.$message.error({
                    content: res.msg
                  })
                this.$message.error(res.msg)
                }
                this.addUserDialogloading = false
              })
@@ -385,7 +363,7 @@
          code: '',
          name: '',
          zt: undefined,
          type: undefined
        type: undefined,
        }
      },
      getinit () {
@@ -395,7 +373,7 @@
      },
      getlist () {
        this.loading = true
        SettingqueryAll(this.queryParam).then(res => {
      SettingqueryAll(this.queryParam).then((res) => {
          this.datalist = res.data
          this.pagination.total = res.data.total
          this.loading = false
@@ -411,7 +389,7 @@
        this.pagination.current = page
        this.queryParam.pageSize = pageSize
        this.getlist()
      }
    }
    },
  },
  }
</script>