浏览代码

查看方案

zhengnaiwen_citu 4 月之前
父节点
当前提交
f013e807f1
共有 1 个文件被更改,包括 73 次插入21 次删除
  1. 73 21
      src/views/salary/solution/salarySolution/salarySolutionDetails.vue

+ 73 - 21
src/views/salary/solution/salarySolution/salarySolutionDetails.vue

@@ -1,23 +1,57 @@
 <template>
   <m-dialog title="规则详情" ref="dialog">
-    <el-descriptions class="margin-top" :column="1" :size="size" border>
-      <el-descriptions-item>
-        <template slot="label">方案名称</template>
-        {{ itemData.title }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label">方案名称</template>
-        {{ itemData.title }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label">方案名称</template>
-        {{ itemData.title }}
-      </el-descriptions-item>
-      <el-descriptions-item>
-        <template slot="label">方案名称</template>
-        {{ itemData.title }}
+    <el-descriptions class="margin-top" :column="1" border>
+      <el-descriptions-item
+        v-for="header in columnHeaders"
+        :key="header.prop"
+      >
+        <template slot="label">{{ header.name }}</template>
+        <template v-if="header.prop === 'postNames'">
+          <span>{{ itemData[header.prop] && itemData[header.prop].join('、') }}</span>
+        </template>
+        <template v-else>
+          {{ itemData[header.prop] }}
+        </template>
       </el-descriptions-item>
     </el-descriptions>
+    <el-divider content-position="left">参数及公式</el-divider>
+    <m-card
+      v-for="item in rules"
+      :key="item.category"
+      shadow="never"
+    >
+      <template #header>
+        {{ item.category }}
+      </template>
+      <el-form label-width="150px">
+        <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>
   </m-dialog>
 </template>
 
@@ -29,17 +63,22 @@ export default {
   name: 'salarySolutionDetails',
   data () {
     return {
+      activeNames: null,
       loading: false,
       columnHeaders: [
         { name: '方案名称', prop: 'title' },
-        { name: '方案描述', prop: 'title' },
-        { name: '绩效机构', prop: 'title' },
-        { name: '方案名称', prop: 'title' },
-        { name: '方案名称', prop: 'title' }
+        { name: '方案描述', prop: 'tag' },
+        { name: '绩效机构', prop: 'organizationName' },
+        { name: '绩效职务', prop: 'postNames' }
       ],
       itemData: {}
     }
   },
+  computed: {
+    rules () {
+      return this.itemData.performanceSolutionDetailRespCategoryVos || []
+    }
+  },
   methods: {
     async open (item) {
       this.$refs.dialog.open()
@@ -48,7 +87,20 @@ export default {
         const { data } = await getSolutionDetails({
           performanceSolutionId: item.performanceSolutionId
         })
-        this.itemData = data
+        data.performanceSolutionDetailRespCategoryVos = data.performanceSolutionDetailRespCategoryVos.map(e => {
+          e.calculateConfigurations = e.calculateConfigurations.map(item => {
+            if (item.valueCategory !== 0) {
+              item.value = JSON.parse(item.value)
+              return item
+            }
+            return item
+          })
+          return e
+        })
+        this.itemData = {
+          ...data.entity,
+          ...data
+        }
       } catch (error) {
         this.$message.error(error)
       } finally {