大宝管理后台代码
123
dcc
2024-07-16 7bea4880ad378d6a0ffef45f2bb15f92f7b80bd0
src/views/product/markettrading.vue
@@ -43,14 +43,9 @@
                </span>
              </a-form-item> -->
            <a-button
              type="primary"
              icon="plus"
              style="margin-left: 8px"
              @click=";(addUserdialog = true), (currentdetail = '')"
            >
              添加盘前</a-button
            >
            <a-button type="primary" icon="plus" style="margin-left: 8px"
              @click=";(addUserdialog = true), (currentdetail = '')">
              添加盘前</a-button>
          </a-col>
        </a-row>
        <!-- </a-form> -->
@@ -58,15 +53,9 @@
    </a-card>
    <a-card :bordered="false">
      <a-table
        bordered
        :loading="loading"
        :pagination="pagination"
        :columns="columns"
        :data-source="datalist"
        rowKey="newlistId"
      >
        <span slot="type" slot-scope="text, record">
      <a-table bordered :loading="loading" :pagination="pagination" :columns="columns" :data-source="datalist"
        rowKey="newlistId">
        <!-- <span slot="type" slot-scope="text, record">
          <template>
            <div>
              <a-tag>
@@ -74,7 +63,7 @@
              </a-tag>
            </div>
          </template>
        </span>
        </span> -->
        <template slot="action" slot-scope="text, record">
          <a slot="action" href="javascript:;" @click="geteditStock(record)">{{ '修改盘前' }}</a>
@@ -84,40 +73,28 @@
      </a-table>
    </a-card>
    <a-modal
      :title="currentdetail ? '修改盘前' : '添加盘前'"
      :width="700"
      :visible="addUserdialog"
      :confirmLoading="addUserDialogloading"
      @ok="OkaddUserdialog"
      @cancel="CanceladdUserdialog"
    >
    <a-modal :title="currentdetail ? '修改盘前' : '添加盘前'" :width="700" :visible="addUserdialog"
      :confirmLoading="addUserDialogloading" @ok="OkaddUserdialog" @cancel="CanceladdUserdialog">
      <a-form :form="addUserform" ref="addUserform">
        <a-row :gutter="48">
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="股票代码" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票代码"
                v-decorator="['stockCode', { rules: [{ required: true, message: '请输入股票代码' }] }]"
              />
              <a-input 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: '请输入股票名称' }] }]"
              />
              <a-input placeholder="请输入股票名称"
                v-decorator="['stockName', { rules: [{ required: true, message: '请输入股票名称' }] }]" />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="48">
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="盘前价格" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入盘前价格"
                v-decorator="['price', { rules: [{ required: true, message: '请输入盘前价格' }] }]"
              />
              <a-input placeholder="请输入盘前价格"
                v-decorator="['price', { rules: [{ required: true, message: '请输入盘前价格' }] }]" />
            </a-form-item>
          </a-col>
          <!-- <a-col :md="12" :lg="12" :sm="12">
@@ -134,20 +111,40 @@
          </a-col> -->
        </a-row>
        <a-row :gutter="48">
          <a-col :md="12" :lg="12" :sm="12">
          <!-- <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="股票开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票调价开始时间"
              <a-time-picker :needConfirm="true" placeholder="请选择时间"
              @change="getstartTime"
                v-decorator="['startTime', { rules: [{ required: true, message: '请输入股票调价开始时间' }] }]"
              />
                 format="HH:mm:ss" />
            </a-form-item>
          </a-col>
          <a-col :md="12" :lg="12" :sm="12">
            <a-form-item label="股票结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-input
                placeholder="请输入股票结束时间"
              <a-time-picker placeholder="请选择时间" :needConfirm="true"
              @change="getendTime"
                v-decorator="['endTime', { rules: [{ required: true, message: '请输入股票结束时间' }] }]"
              />
                 format="HH:mm:ss" />
            </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 :needConfirm="true" @change="changeStartTime"
                           v-model:value="startTime" format="YYYY-MM-DD HH:mm:ss" />
<!--             <a-input-->
<!--                placeholder="请输入时间 例 12:00"-->
<!--                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="请输入时间 例 12:00"-->
<!--                v-decorator="['endTime', { rules: [{ required: true, message: '请输入股票结束时间' }] }]"-->
<!--              />-->
              <a-date-picker show-time :needConfirm="true" @change="changeEndTime"
                             v-model:value="endTime" format="YYYY-MM-DD HH:mm:ss" />
            </a-form-item>
          </a-col>
        </a-row>
@@ -156,15 +153,19 @@
  </page-header-wrapper>
</template>
<script>
import { 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 {
  name: 'Shares',
  data() {
    return {
      columns: [
        {
        columns: [{
          title: '股票代码',
          dataIndex: 'stockCode',
          align: 'center',
@@ -184,12 +185,14 @@
          dataIndex: 'endTime',
          align: 'center',
        },
        {
          title: '类型',
          dataIndex: 'type',
          align: 'center',
          scopedSlots: { customRender: 'type' },
        },
          // {
          //   title: '类型',
          //   dataIndex: 'type',
          //   align: 'center',
          //   scopedSlots: {
          //     customRender: 'type'
          //   },
          // },
        {
          title: '金额',
          dataIndex: 'price',
@@ -253,7 +256,8 @@
      addUserform: this.$form.createForm(this),
      addUserdialog: false,
      addUserDialogloading: false,
        endTime:'',
        startTime:'',
      fields: ['stockCode', 'stockName', 'startTime', 'endTime', 'type', 'price'],
      currentdetail: '',
      subscribeTime: '',
@@ -264,6 +268,12 @@
    this.getlist()
  },
  methods: {
      changeEndTime(time,timeString){
        this.endTime = timeString
      },
      changeStartTime(time,timeString){
        this.startTime = timeString
      },
    getdeleteStock(val) {
      var that = this
      this.$confirm({
@@ -292,6 +302,14 @@
        },
      })
    },
      getendTime(date, dateString) {
        console.log(date, dateString);
        this.endTime = dateString
      },
      getstartTime(date, dateString) {
        this.startTime = dateString
      },
    getsubscribeTime(date, dateString) {
      this.subscribeTime = dateString
    },
@@ -312,6 +330,14 @@
      this.addUserform.setFieldsValue({
        subscribeTime: moment(val.subscribeTime ? val.subscribeTime : currentTime).format('YYYY-MM-DD HH:mm:ss'),
      })
        // this.addUserform.setFieldsValue({
        //   endTime: moment(val.endTime ? val.endTime : currentTime).format('HH:mm:ss'),
        //   // endTime: moment(currentTime).format('YYYY-MM-DD HH:mm:ss')
        // })
        // this.addUserform.setFieldsValue({
        //   startTime: moment(val.startTime ? val.startTime : currentTime).format('HH:mm:ss'),
        // })
    },
    CanceladdUserdialog() {
      this.addUserdialog = false
@@ -327,9 +353,10 @@
          if (this.currentdetail != '') {
            this.addUserDialogloading = true
            values.id = this.currentdetail.id
            // values.subscriptionTime = this.subscriptionTime
            // values.subscribeTime = this.subscribeTime
              values.endTime = this.endTime
              values.startTime = this.startTime
              // values.subscriptionTime = this.endTime
              // values.subscribeTime = this.startTime
            stockupdata(values).then((res) => {
              if (res.status == 0) {
                this.addUserdialog = false
@@ -343,6 +370,8 @@
            })
          } else {
            this.addUserDialogloading = true
              values.endTime = this.endTime
              values.startTime = this.startTime
            stockadd(values).then((res) => {
              if (res.status == 0) {
                this.addUserdialog = false