zhengnaiwen_citu hace 2 meses
padre
commit
075795b5d9
Se han modificado 3 ficheros con 37 adiciones y 44 borrados
  1. 2 1
      src/views/sandbox/index.vue
  2. 31 29
      src/views/sandbox/sandboxAdd.vue
  3. 4 14
      src/views/sandbox/sandboxList.vue

+ 2 - 1
src/views/sandbox/index.vue

@@ -24,7 +24,7 @@
     <SandboxResult ref="sandboxResultRefs"></SandboxResult>
     <SandboxDetails :only-param="true" ref="sandboxDetailsRefs"></SandboxDetails>
     <SandboxComparison ref="sandboxComparisonRefs"></SandboxComparison>
-    <SandboxAdd ref="sandboxAddRefs"></SandboxAdd>
+    <SandboxAdd ref="sandboxAddRefs" @close="onInit"></SandboxAdd>
   </div>
 </template>
 
@@ -109,6 +109,7 @@ export default {
   // },
   methods: {
     async onInit () {
+      console.log('init')
     },
     onAdd () {
       this.$refs.sandboxAddRefs.open()

+ 31 - 29
src/views/sandbox/sandboxAdd.vue

@@ -1,5 +1,5 @@
 <template>
-  <m-dialog title="新增测算" ref="dialog" v-bind="$attrs" width="1200px">
+  <m-dialog title="新增测算" ref="dialog" v-bind="$attrs" width="1200px" v-on="$listeners">
     <template #button-after>
       <m-button :disabled="active === 0" @click="onPrev">上一步</m-button>
       <m-button v-if="active === items.length - 1" type="success" @click="onIssue">发布</m-button>
@@ -32,6 +32,33 @@ import SandboxResultDetails from './sandboxResultDetails.vue'
 import {
   sendSalaryRelease
 } from '@/api/salary'
+const _data = {
+  0: {
+    name: null,
+    id: null,
+    ref: 'sandboxRulesRefs'
+  },
+  1: {
+    name: null,
+    id: null,
+    ref: 'sandboxListRefs'
+  },
+  2: {
+    name: null,
+    id: null,
+    ref: 'sandboxParamRefs'
+  },
+  3: {
+    name: null,
+    id: null,
+    ref: 'sandboxDateRefs'
+  },
+  4: {
+    name: null,
+    id: null,
+    ref: 'sandboxResultDetailsRefs'
+  }
+}
 export default {
   name: 'sandboxAdd',
   components: {
@@ -44,33 +71,7 @@ export default {
   data () {
     return {
       active: 0,
-      descriptionValues: {
-        0: {
-          name: null,
-          id: null,
-          ref: 'sandboxRulesRefs'
-        },
-        1: {
-          name: null,
-          id: null,
-          ref: 'sandboxListRefs'
-        },
-        2: {
-          name: null,
-          id: null,
-          ref: 'sandboxParamRefs'
-        },
-        3: {
-          name: null,
-          id: null,
-          ref: 'sandboxDateRefs'
-        },
-        4: {
-          name: null,
-          id: null,
-          ref: 'sandboxResultDetailsRefs'
-        }
-      }
+      descriptionValues: JSON.parse(JSON.stringify(_data))
     }
   },
   computed: {
@@ -79,7 +80,7 @@ export default {
         { title: '点击表格选择规则', subtitle: '已选规则:', description: this.descriptionValues[0].name },
         { title: '点击表格选择版本', subtitle: '已选版本:', description: this.descriptionValues[1].name },
         { title: '系数导向', subtitle: '', description: '' },
-        { title: '数据日期', subtitle: '', description: '' },
+        { title: '数据日期', subtitle: '已选日期:', description: this.descriptionValues[3].name },
         { title: '计算结果', subtitle: '', description: '' }
       ]
     },
@@ -90,6 +91,7 @@ export default {
   methods: {
     open () {
       this.active = 0
+      this.descriptionValues = JSON.parse(JSON.stringify(_data))
       this.$refs.dialog.open()
     },
     assignDescription (item) {

+ 4 - 14
src/views/sandbox/sandboxList.vue

@@ -83,9 +83,9 @@ export default {
       this.searchValues = {}
       this.items = []
       this.total = 0
+      this.$emit('row-click', {})
       this.getList()
       this.error = false
-      this.$emit('row-click', {})
     },
     validate () {
       if (!this.clickItem) {
@@ -122,19 +122,6 @@ export default {
     onOpen (ref, item) {
       this.$refs[ref]?.open && this.$refs[ref].open(item)
     },
-    // 发布
-    // async onIssue (row) {
-    //   this.loading = true
-    //   try {
-    //     await sendSalaryRelease({ performanceSolutionId: row.performanceSolutionId })
-    //     this.$message.success('发布成功')
-    //     this.getList()
-    //   } catch (error) {
-    //     this.$message.error(error)
-    //   } finally {
-    //     this.loading = false
-    //   }
-    // },
     onSearch () {
       this.pageInfo.current = 1
       this.getList()
@@ -148,6 +135,9 @@ export default {
       this.getList()
     },
     onCurrentChange (item) {
+      if (!item) {
+        return
+      }
       this.clickItem = item
       this.error = false
       this.$emit('row-click', {