zhengnaiwen_citu 3 meses atrás
pai
commit
f1130f5583

+ 2 - 2
src/views/salary/solution/components/solutionDetails.vue

@@ -15,7 +15,7 @@
       </el-descriptions-item>
     </el-descriptions>
     <m-divider content-position="left">参数及公式</m-divider>
-      <el-tabs v-model="activeNames" @tab-click="handleClick">
+      <el-tabs v-model="activeNames">
         <!-- <template> -->
           <el-tab-pane
             v-for="(item, index) in rules"
@@ -79,7 +79,7 @@
                     </template>
                   </el-form-item> -->
                   <el-form-item label="计算公式">
-                    <m-card shadow="never">
+                    <m-card shadow="never" :bodyStyle="{ maxHeight: '300px', overflow: 'auto' }">
                       <div v-html="item.calculateFormulas?.[0]?.content"></div>
                     </m-card>
                   </el-form-item>

+ 5 - 1
src/views/sandbox/sandboxCalculate.vue

@@ -18,7 +18,11 @@
         <el-button type="orange" @click="onDetails">查看结果</el-button>
       </template>
     </el-result>
-    <SandboxResult ref="sandboxResultRefs" append-to-body></SandboxResult>
+    <SandboxResult ref="sandboxResultRefs" append-to-body>
+      <template #button>
+        <m-button type="orange" @click="$emit('issue', itemData)">发布</m-button>
+      </template>
+    </SandboxResult>
   </m-dialog>
 </template>
 

+ 7 - 1
src/views/sandbox/sandboxDetails.vue

@@ -1,5 +1,8 @@
 <template>
-  <m-dialog title="规则详情" ref="dialog" v-bind="$attrs" @sure="$emit('sure', itemData)" :option="{ textSure: '系数导向' }">
+  <m-dialog title="规则详情" ref="dialog" v-bind="$attrs">
+    <template #button-after>
+      <slot name="button" :row="itemData"></slot>
+    </template>
     <SolutionDetails :item-data="itemData" v-loading="loading"></SolutionDetails>
   </m-dialog>
 </template>
@@ -47,6 +50,9 @@ export default {
       } finally {
         this.loading = false
       }
+    },
+    onOpen (ref) {
+      this.$refs[ref]?.open && this.$refs[ref].open(this.itemData)
     }
   }
 }

+ 1 - 0
src/views/sandbox/sandboxHistory.vue

@@ -17,6 +17,7 @@
       <template #actions="{ row }">
         <m-button text type="primary" @click="onDetails(row)">查看规则</m-button>
         <m-button text type="primary" @click="onResult(row)">查看结果</m-button>
+        <m-button text type="success" @click="$emit('issue', row)">发布</m-button>
       </template>
     </m-table>
     <SandboxResult ref="sandboxResultRefs" append-to-body></SandboxResult>

+ 16 - 9
src/views/sandbox/sandboxList.vue

@@ -19,15 +19,21 @@
       </template> -->
       <template #actions="{ row }">
         <m-button text type="primary" size="small" @click="onOpen('sandboxDetailsRefs', row)">查看规则</m-button>
-        <m-button text type="primary" size="small" @click="onOpen('sandboxParamRefs', row)">系数导向</m-button>
-        <!-- <m-button text type="success" size="small" @click="onOpen('sandboxCalculateRefs', row)">开始测算</m-button>
-        <m-button text type="primary" size="small" @click="onOpen('sandboxHistoryRefs', row)">测算历史</m-button>
-        <m-button text type="success" size="small" @click="onSend(row)">发布</m-button> -->
+        <!-- <m-button text type="primary" size="small" @click="onOpen('sandboxParamRefs', row)">系数导向</m-button> -->
+        <!-- <m-button text type="success" size="small" @click="onOpen('sandboxCalculateRefs', row)">开始测算</m-button> -->
+        <!-- <m-button text type="primary" size="small" @click="onOpen('sandboxHistoryRefs', row)">测算历史</m-button> -->
+        <!-- <m-button text type="success" size="small" @click="onSend(row)">发布</m-button> -->
       </template>
     </m-table>
-    <SandboxDetails ref="sandboxDetailsRefs" append-to-body @sure="onOpen('sandboxParamRefs', $event)"></SandboxDetails>
-    <SandboxParam ref="sandboxParamRefs" append-to-body @refresh="getList"></SandboxParam>
-    <SandboxHistory ref="sandboxHistoryRefs" append-to-body></SandboxHistory>
+    <SandboxDetails ref="sandboxDetailsRefs" append-to-body @sure="onOpen('sandboxParamRefs', $event)">
+      <template #button="{ row }">
+        <m-button type="orange" @click="onOpen('sandboxParamRefs', row)">系数导向</m-button>
+        <m-button type="orange" @click="onOpen('sandboxHistoryRefs', row)">测算历史</m-button>
+      </template>
+    </SandboxDetails>
+    <SandboxParam ref="sandboxParamRefs" append-to-body @refresh="getList" @issue="onIssue"></SandboxParam>
+    <SandboxHistory ref="sandboxHistoryRefs" append-to-body @issue="onIssue"></SandboxHistory>
+
   </m-dialog>
 </template>
 
@@ -104,12 +110,13 @@ export default {
     onOpen (ref, item) {
       this.$refs[ref]?.open && this.$refs[ref].open(item)
     },
-    async onSend (row) {
+    // 发布
+    async onIssue (row) {
       this.loading = true
       try {
         await sendSalaryRelease({ performanceSolutionId: row.performanceSolutionId })
         this.$message.success('发布成功')
-        this.onInit()
+        // this.onInit()
       } catch (error) {
         this.$message.error(error)
       } finally {

+ 1 - 1
src/views/sandbox/sandboxParam.vue

@@ -62,7 +62,7 @@
         </m-card>
       </el-form-item>
     </el-form>
-    <SandboxCalculate ref="sandboxCalculateRefs" append-to-body></SandboxCalculate>
+    <SandboxCalculate ref="sandboxCalculateRefs" append-to-body @issue="$emit('issue', $event)"></SandboxCalculate>
   </m-dialog>
 </template>
 

+ 3 - 0
src/views/sandbox/sandboxResult.vue

@@ -1,5 +1,8 @@
 <template>
   <m-dialog title="计算结果" ref="dialog" v-bind="$attrs" width="1200px">
+    <template #button-after>
+      <slot name="button"></slot>
+    </template>
     <div v-loading="loading">
       <m-card shadow="never">
         <el-radio-group v-model="choose" @input="getList">