From 52e4976e00a512c7cfe554330517559c4e919aba Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Wed, 29 May 2024 19:49:38 +0800
Subject: [PATCH] 123

---
 src/views/product/markettrading.vue |   98 +++++++++++++++++++++++++------------------------
 1 files changed, 50 insertions(+), 48 deletions(-)

diff --git a/src/views/product/markettrading.vue b/src/views/product/markettrading.vue
index 24741eb..acf0147 100644
--- a/src/views/product/markettrading.vue
+++ b/src/views/product/markettrading.vue
@@ -120,7 +120,7 @@
               />
             </a-form-item>
           </a-col>
-          <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-select
                 :value="typeValue"
@@ -131,7 +131,7 @@
                 <a-select-option value="1">百分比</a-select-option>
               </a-select>
             </a-form-item>
-          </a-col>
+          </a-col> -->
         </a-row>
         <a-row :gutter="48">
           <a-col :md="12" :lg="12" :sm="12">
@@ -161,39 +161,39 @@
 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: '金额/百分比',
+          title: '金额',
           dataIndex: 'price',
-          align: 'center',
+          align: 'center'
         },
 
         {
@@ -201,9 +201,9 @@
           key: 'action',
           align: 'center',
           scopedSlots: {
-            customRender: 'action',
-          },
-        },
+            customRender: 'action'
+          }
+        }
       ],
       disabledDate: true,
       // 表头
@@ -215,7 +215,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,
       typeValue: 0,
@@ -225,30 +225,30 @@
         code: '',
         name: '',
         zt: undefined,
-        type: undefined,
+        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,
@@ -257,48 +257,48 @@
       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()
@@ -307,31 +307,33 @@
       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) => {
+        values.type = 0
         if (!errors) {
           if (this.currentdetail != '') {
             this.addUserDialogloading = true
             values.id = this.currentdetail.id
+
             // values.subscriptionTime = this.subscriptionTime
             // values.subscribeTime = this.subscribeTime
             stockupdata(values).then((res) => {
               if (res.status == 0) {
                 this.addUserdialog = false
-                this.$message.success(res.msg)
+                this.$message.success('修改成功')
                 form.resetFields()
                 this.getlist()
               } else {
@@ -356,22 +358,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
       SettingqueryAll(this.queryParam).then((res) => {
         this.datalist = res.data
@@ -379,17 +381,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>

--
Gitblit v1.9.3