zhengnaiwen_citu 3 maanden geleden
bovenliggende
commit
b0fa7e5214

+ 2 - 4
src/store/modules/user.js

@@ -5,12 +5,11 @@ import Base from '@/utils/base64ToPassword'
 // import Vue from 'vue'
 // import { checkToken } from '@/api/system'
 
-const SET_SINGLE_SIGN_ON = localStorage.getItem('SET_SINGLE_SIGN_ON')
+const SINGLE_SIGN_ON = localStorage.getItem('SET_SINGLE_SIGN_ON')
 const USERINFO = localStorage.getItem('userInfo')
 const EMPLOYEE_INFO = localStorage.getItem('EMPLOYEE_INFO')
-
 const state = {
-  singleSignOn: SET_SINGLE_SIGN_ON !== '0', // 单点登录
+  singleSignOn: SINGLE_SIGN_ON === '1', // 单点登录
   userInfo: USERINFO ? JSON.parse(USERINFO) : {},
   employeeInfo: EMPLOYEE_INFO ? JSON.parse(EMPLOYEE_INFO) : {}
 }
@@ -76,7 +75,6 @@ const actions = {
     if (!state.singleSignOn) {
       // 普通退出
       router.push({ path: '/login-local' })
-      commit('SET_SINGLE_SIGN_ON', 1) // 重置为单点登录
       return
     }
     router.push({ path: '/reminder' })

+ 74 - 69
src/views/salary/solution/components/solutionDetails.vue

@@ -15,74 +15,80 @@
       </el-descriptions-item>
     </el-descriptions>
     <m-divider content-position="left">参数及公式</m-divider>
-    <m-card
-      v-for="item in rules"
-      :key="item.category"
-      shadow="never"
-    >
-      <template #header>
-        {{ item.category }}
-      </template>
-      <el-form label-width="100px">
-        <el-form-item label="系数">
-          <!-- <m-card shadow="never"> -->
-            <el-descriptions
-              :labelStyle="{ width: '180px'}"
-              :column="1"
-              border
-            >
-              <el-descriptions-item
-                v-for="(calculateConfiguration, index) in item.calculateConfigurations"
-                :key="index"
-                :label="calculateConfiguration.name"
-              >
-                <template v-if="calculateConfiguration.valueCategory === 0">
-                  <el-tag size="small">{{ calculateConfiguration.value }}</el-tag>
-                </template>
-                <template v-else>
-                  <m-table
-                    clearHeader
-                    shadow="never"
-                    :headers="[
-                      { label: '名称', prop: 'name' },
-                      { label: '值', prop: 'value' }
-                    ]"
-                    :items="calculateConfiguration.value"
+      <el-tabs v-model="activeNames" @tab-click="handleClick">
+        <!-- <template> -->
+          <el-tab-pane
+            v-for="(item, index) in rules"
+            :key="item.category"
+            :label="item.category"
+            :name="index"
+          >
+            <!-- <template> -->
+              <!-- <m-card shadow="never" > -->
+                <el-form label-width="100px">
+                  <el-form-item label="系数">
+                    <!-- <m-card shadow="never"> -->
+                      <el-descriptions
+                        :labelStyle="{ width: '180px'}"
+                        :column="1"
+                        border
+                      >
+                        <el-descriptions-item
+                          v-for="(calculateConfiguration, index) in item.calculateConfigurations"
+                          :key="index"
+                          :label="calculateConfiguration.name"
+                        >
+                          <template v-if="calculateConfiguration.valueCategory === 0">
+                            <el-tag size="small">{{ calculateConfiguration.value }}</el-tag>
+                          </template>
+                          <template v-else>
+                            <m-table
+                              clearHeader
+                              shadow="never"
+                              :headers="[
+                                { label: '名称', prop: 'name' },
+                                { label: '值', prop: 'value' }
+                              ]"
+                              :items="calculateConfiguration.value"
+                            >
+                            </m-table>
+                          </template>
+                        </el-descriptions-item>
+                      </el-descriptions>
+                    <!-- </m-card> -->
+                  </el-form-item>
+                  <!-- <el-form-item
+                    v-for="(calculateConfiguration, index) in item.calculateConfigurations"
+                    :key="index"
+                    :label="calculateConfiguration.name"
                   >
-                  </m-table>
-                </template>
-              </el-descriptions-item>
-            </el-descriptions>
-          <!-- </m-card> -->
-        </el-form-item>
-        <!-- <el-form-item
-          v-for="(calculateConfiguration, index) in item.calculateConfigurations"
-          :key="index"
-          :label="calculateConfiguration.name"
-        >
-          <template v-if="calculateConfiguration.valueCategory === 0">
-            <el-tag>{{ calculateConfiguration.value }}</el-tag>
-          </template>
-          <template v-else>
-            <m-table
-              clearHeader
-              shadow="never"
-              :headers="[
-                { label: '名称', prop: 'name' },
-                { label: '值', prop: 'value' }
-              ]"
-              :items="calculateConfiguration.value"
-            >
-            </m-table>
-          </template>
-        </el-form-item> -->
-        <el-form-item label="计算公式">
-          <m-card shadow="never">
-            <div v-html="item.calculateFormulas?.[0]?.content"></div>
-          </m-card>
-        </el-form-item>
-      </el-form>
-    </m-card>
+                    <template v-if="calculateConfiguration.valueCategory === 0">
+                      <el-tag>{{ calculateConfiguration.value }}</el-tag>
+                    </template>
+                    <template v-else>
+                      <m-table
+                        clearHeader
+                        shadow="never"
+                        :headers="[
+                          { label: '名称', prop: 'name' },
+                          { label: '值', prop: 'value' }
+                        ]"
+                        :items="calculateConfiguration.value"
+                      >
+                      </m-table>
+                    </template>
+                  </el-form-item> -->
+                  <el-form-item label="计算公式">
+                    <m-card shadow="never">
+                      <div v-html="item.calculateFormulas?.[0]?.content"></div>
+                    </m-card>
+                  </el-form-item>
+                </el-form>
+              <!-- </m-card> -->
+            <!-- </template> -->
+          </el-tab-pane>
+        <!-- </template> -->
+      </el-tabs>
     <m-empty v-if="rules.length === 0"></m-empty>
   </div>
 </template>
@@ -98,8 +104,7 @@ export default {
   },
   data () {
     return {
-
-      activeNames: null,
+      activeNames: 0,
       columnHeaders: [
         { name: '规则名称', prop: 'title' },
         { name: '规则描述', prop: 'tag' },

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

@@ -14,7 +14,7 @@
       @sort-change="onSortChange"
     >
       <template #actions="{ row }">
-        <m-button text type="primary" size="small" @click="onOpen('sandboxListRefs', row)">选择规则</m-button>
+        <m-button text type="primary" size="small" @click="onOpen('sandboxListRefs', row)">规则版本选择</m-button>
       </template>
     </m-table>
     <SandboxList ref="sandboxListRefs"></SandboxList>

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

@@ -7,7 +7,7 @@
         placeholder="请选择数据月份">
       </el-date-picker>
       <div>* 请选择数据所在月份进行测算</div>
-      <m-button :disabled="loading" type="orange" class="mt-3" @click="onStart">
+      <m-button :disabled="loading" type="success" class="mt-3" @click="onStart">
         {{ loading ? '正在测算中,请稍后...' : '开始测算'}}
       </m-button>
     </div>

+ 2 - 2
src/views/sandbox/sandboxDetails.vue

@@ -1,6 +1,6 @@
 <template>
-  <m-dialog title="规则详情" ref="dialog" v-bind="$attrs">
-    <SolutionDetails :item-data="itemData"></SolutionDetails>
+  <m-dialog title="规则详情" ref="dialog" v-bind="$attrs" @sure="$emit('sure', itemData)" :option="{ textSure: '系数导向' }">
+    <SolutionDetails :item-data="itemData" v-loading="loading"></SolutionDetails>
   </m-dialog>
 </template>
 

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

@@ -12,17 +12,21 @@
       @page-change="onPageChange"
       @sort-change="onSortChange"
     >
+      <!-- <template #testStatus="{ row }">
+        <el-tag size="small" :type="row.testStatus === 1 ? 'success' : 'info'">
+          {{ row.testStatus === 1 ? '已测算' : '未测算' }}
+        </el-tag>
+      </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="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="success" size="small" @click="onSend(row)">发布</m-button> -->
       </template>
     </m-table>
-    <SandboxDetails ref="sandboxDetailsRefs" append-to-body></SandboxDetails>
+    <SandboxDetails ref="sandboxDetailsRefs" append-to-body @sure="onOpen('sandboxParamRefs', $event)"></SandboxDetails>
     <SandboxParam ref="sandboxParamRefs" append-to-body @refresh="getList"></SandboxParam>
-    <SandboxCalculate ref="sandboxCalculateRefs" append-to-body></SandboxCalculate>
     <SandboxHistory ref="sandboxHistoryRefs" append-to-body></SandboxHistory>
   </m-dialog>
 </template>
@@ -30,7 +34,6 @@
 <script>
 import SandboxDetails from './sandboxDetails.vue'
 import SandboxParam from './sandboxParam.vue'
-import SandboxCalculate from './sandboxCalculate.vue'
 import SandboxHistory from './sandboxHistory.vue'
 import {
   getSolutionPage,
@@ -42,7 +45,6 @@ export default {
 
     SandboxDetails,
     SandboxParam,
-    SandboxCalculate,
     SandboxHistory
   },
   data () {
@@ -50,6 +52,7 @@ export default {
       headers: [
         { label: '名称', prop: 'title' },
         { label: '修改说明', prop: 'versionTag' },
+        // { label: '是否已经测算', prop: 'testStatus', align: 'center' },
         { label: '创建日期', prop: 'createDate' },
         { label: '操作', prop: 'actions', width: 400, fixed: 'right' }
       ],

+ 33 - 19
src/views/sandbox/sandboxParam.vue

@@ -1,5 +1,8 @@
 <template>
-  <m-dialog ref="dialog" title="系数管理" v-bind="$attrs" @sure="onSure">
+  <m-dialog ref="dialog" title="系数管理" v-bind="$attrs">
+    <template #button-after>
+      <m-button type="success" @click="onOpen('sandboxCalculateRefs')">选择数据开始测算</m-button>
+    </template>
     <el-form v-loading="loading" label-width="100px">
       <el-form-item label="名称">
         <el-tag color="primary">{{ itemData.title }}</el-tag>
@@ -59,16 +62,22 @@
         </m-card>
       </el-form-item>
     </el-form>
+    <SandboxCalculate ref="sandboxCalculateRefs" append-to-body></SandboxCalculate>
   </m-dialog>
 </template>
 
 <script>
+import SandboxCalculate from './sandboxCalculate.vue'
 import {
-  getSolutionDetails,
-  saveSolution
+  getSolutionDetails
+  // saveSolution
 } from '@/api/salary'
 export default {
   name: 'salarySolutionParam',
+  components: {
+
+    SandboxCalculate
+  },
   data () {
     return {
       activeNames: null,
@@ -107,27 +116,32 @@ export default {
         this.activeNames = this.items[0]?.category
       } catch (error) {
         this.$message.error(error)
+        this.$refs.dialog.close()
       } finally {
         this.loading = false
       }
     },
-    async onSure () {
-      const query = {
-        entity: {
-          performanceSolutionId: this.itemData.performanceSolutionId,
-          env: 1
-        },
-        performanceSolutionDetailRespCategoryVos: this.items
-      }
-      try {
-        await saveSolution(query)
-        this.$refs.dialog.close()
-        this.$emit('refresh')
-        this.$message.success('保存成功')
-      } catch (error) {
-        this.$message.error(error)
-      }
+    onOpen (ref) {
+      this.$refs[ref]?.open && this.$refs[ref].open(this.itemData)
     }
+    // async onSure () {
+    //   const query = {
+    //     entity: {
+    //       performanceSolutionId: this.itemData.performanceSolutionId,
+    //       env: 1,
+    //       testStatus: 0
+    //     },
+    //     performanceSolutionDetailRespCategoryVos: this.items
+    //   }
+    //   try {
+    //     await saveSolution(query)
+    //     this.$refs.dialog.close()
+    //     this.$emit('refresh')
+    //     this.$message.success('保存成功')
+    //   } catch (error) {
+    //     this.$message.error(error)
+    //   }
+    // }
   }
 }
 </script>