zhengnaiwen_citu 3 månader sedan
förälder
incheckning
4781918f8b

+ 11 - 16
src/views/salary/sandbox/index.vue

@@ -7,12 +7,7 @@
           ref="Solution"
           ref="Solution"
           @history="onHistory"
           @history="onHistory"
         >
         >
-          <template #tool>
-            <m-button type="orange" size="small" icon="el-icon-plus" @click="onOpen('salarySolutionEditRefs')" >新增</m-button>
-          </template>
           <template #actions="{ row }">
           <template #actions="{ row }">
-            <m-button text type="primary" size="small" @click="onOpen('salarySolutionEditRefs', row)">编辑</m-button>
-            <m-button text type="primary" size="small" @click="onOpen('salarySolutionRulesRefs', row)">规则配置</m-button>
             <m-button text type="success" size="small" @click="onCalculate(row)">计算</m-button>
             <m-button text type="success" size="small" @click="onCalculate(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>
           </template>
@@ -25,7 +20,7 @@
         <History label="历史记录" ref="History" @history="onHistory"></History>
         <History label="历史记录" ref="History" @history="onHistory"></History>
       </el-tab-pane>
       </el-tab-pane>
     </el-tabs>
     </el-tabs>
-    <el-drawer
+    <!-- <el-drawer
       :title="itemData.title"
       :title="itemData.title"
       :visible.sync="show"
       :visible.sync="show"
       direction="rtl"
       direction="rtl"
@@ -33,19 +28,19 @@
       <div class="pa-3" v-loading="loading">
       <div class="pa-3" v-loading="loading">
         <SolutionDetails :item-data="itemData"></SolutionDetails>
         <SolutionDetails :item-data="itemData"></SolutionDetails>
       </div>
       </div>
-    </el-drawer>
-    <SalarySolutionEdit ref="salarySolutionEditRefs" @refresh="$refs.Solution.onInit()"></SalarySolutionEdit>
-    <SalarySandboxRules ref="salarySandboxRulesRefs" @refresh="$refs.Solution.onInit()"></SalarySandboxRules>
+    </el-drawer> -->
+    <!-- <SalarySolutionEdit ref="salarySolutionEditRefs" @refresh="$refs.Solution.onInit()"></SalarySolutionEdit>
+    <SalarySandboxRules ref="salarySandboxRulesRefs" @refresh="$refs.Solution.onInit()"></SalarySandboxRules> -->
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import Solution from '../solution/salarySolution'
 import Solution from '../solution/salarySolution'
-import SalarySolutionEdit from './salarySandboxEdit.vue'
-import SalarySandboxRules from './salarySandboxRules.vue'
+// import SalarySolutionEdit from './salarySandboxEdit.vue'
+// import SalarySandboxRules from './salarySandboxRules.vue'
 import Coefficient from '../solution/salaryCoefficient'
 import Coefficient from '../solution/salaryCoefficient'
 import History from '../solution/salarySolutionHistory'
 import History from '../solution/salarySolutionHistory'
-import SolutionDetails from '../solution/components/solutionDetails.vue'
+// import SolutionDetails from '../solution/components/solutionDetails.vue'
 
 
 import {
 import {
   sendSalaryRelease,
   sendSalaryRelease,
@@ -59,12 +54,12 @@ export default {
     }
     }
   },
   },
   components: {
   components: {
-    SalarySolutionEdit,
-    SalarySandboxRules,
+    // SalarySolutionEdit,
+    // SalarySandboxRules,
     Solution,
     Solution,
     Coefficient,
     Coefficient,
-    History,
-    SolutionDetails
+    History
+    // SolutionDetails
   },
   },
   data () {
   data () {
     return {
     return {

+ 28 - 12
src/views/salary/solution/components/solutionDetails.vue

@@ -24,22 +24,38 @@
         {{ item.category }}
         {{ item.category }}
       </template>
       </template>
       <el-form label-width="100px">
       <el-form label-width="100px">
-        <!-- <el-form-item label="系数">
-          <m-card shadow="never">
+        <el-form-item label="系数">
+          <!-- <m-card shadow="never"> -->
             <el-descriptions
             <el-descriptions
-              v-for="(calculateConfiguration, index) in item.calculateConfigurations"
-              :key="index"
-              :label="calculateConfiguration.name"
-              :column="2"
+              :labelStyle="{ width: '180px'}"
+              :column="1"
               border
               border
             >
             >
-              <el-descriptions-item>
-                kooriookami
+              <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-item>
             </el-descriptions>
             </el-descriptions>
-          </m-card>
-        </el-form-item> -->
-        <el-form-item
+          <!-- </m-card> -->
+        </el-form-item>
+        <!-- <el-form-item
           v-for="(calculateConfiguration, index) in item.calculateConfigurations"
           v-for="(calculateConfiguration, index) in item.calculateConfigurations"
           :key="index"
           :key="index"
           :label="calculateConfiguration.name"
           :label="calculateConfiguration.name"
@@ -59,7 +75,7 @@
             >
             >
             </m-table>
             </m-table>
           </template>
           </template>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="计算公式">
         <el-form-item label="计算公式">
           <m-card shadow="never">
           <m-card shadow="never">
             <div v-html="item.calculateFormulas?.[0]?.content"></div>
             <div v-html="item.calculateFormulas?.[0]?.content"></div>

+ 32 - 2
src/views/salary/solution/salarySolution/index.vue

@@ -2,16 +2,20 @@
   <div>
   <div>
     <ListTemplate ref="listTemplateRefs" :card-title="$attrs.label" v-loading="loading">
     <ListTemplate ref="listTemplateRefs" :card-title="$attrs.label" v-loading="loading">
       <template #tool>
       <template #tool>
-        <slot name="tool"></slot>
+        <m-button type="orange" size="small" icon="el-icon-plus" @click="onOpen('salarySolutionEditRefs')" >新增</m-button>
       </template>
       </template>
       <template #actions="{ row }">
       <template #actions="{ row }">
         <m-button text type="primary" size="small" @click="onOpen('salarySolutionDetailsRefs', row)">查看</m-button>
         <m-button text type="primary" size="small" @click="onOpen('salarySolutionDetailsRefs', row)">查看</m-button>
+        <m-button text type="primary" size="small" @click="onOpen('salarySolutionEditRefs', row)">编辑</m-button>
+        <m-button text type="primary" size="small" @click="onOpen('salarySolutionRulesRefs', row)">规则配置</m-button>
         <slot name="actions" :row="row"></slot>
         <slot name="actions" :row="row"></slot>
         <m-button text type="primary" size="small" @click="onOpen('salarySolutionHistory', row)">版本记录</m-button>
         <m-button text type="primary" size="small" @click="onOpen('salarySolutionHistory', row)">版本记录</m-button>
         <m-button text type="danger" size="small" @click="onDelete(row)">删除</m-button>
         <m-button text type="danger" size="small" @click="onDelete(row)">删除</m-button>
       </template>
       </template>
     </ListTemplate>
     </ListTemplate>
     <SalarySolutionDetails ref="salarySolutionDetailsRefs"></SalarySolutionDetails>
     <SalarySolutionDetails ref="salarySolutionDetailsRefs"></SalarySolutionDetails>
+    <SalarySolutionEdit ref="salarySolutionEditRefs" @refresh="onInit"></SalarySolutionEdit>
+    <SalarySolutionRules ref="salarySolutionRulesRefs" @refresh="onInit"></SalarySolutionRules>
     <SalarySolutionHistory ref="salarySolutionHistory">
     <SalarySolutionHistory ref="salarySolutionHistory">
       <template #actions="{ row }">
       <template #actions="{ row }">
         <m-button type="primary" text @click="$emit('history', row)" size="small">查看规则配置</m-button>
         <m-button type="primary" text @click="$emit('history', row)" size="small">查看规则配置</m-button>
@@ -22,15 +26,26 @@
 
 
 <script>
 <script>
 import {
 import {
-  deleteSolution
+  deleteSolution,
+  sendSalaryRelease
 } from '@/api/salary'
 } from '@/api/salary'
 import ListTemplate from '../components/ListTemplate.vue'
 import ListTemplate from '../components/ListTemplate.vue'
+import SalarySolutionEdit from './salarySolutionEdit.vue'
+import SalarySolutionRules from './salarySolutionRules.vue'
 import SalarySolutionHistory from './salarySolutionHistory.vue'
 import SalarySolutionHistory from './salarySolutionHistory.vue'
 import SalarySolutionDetails from './salarySolutionDetails.vue'
 import SalarySolutionDetails from './salarySolutionDetails.vue'
 export default {
 export default {
   name: 'salary-solution-list',
   name: 'salary-solution-list',
+  props: {
+    permission: {
+      type: Array,
+      default: () => []
+    }
+  },
   components: {
   components: {
     ListTemplate,
     ListTemplate,
+    SalarySolutionEdit,
+    SalarySolutionRules,
     SalarySolutionHistory,
     SalarySolutionHistory,
     SalarySolutionDetails
     SalarySolutionDetails
   },
   },
@@ -46,8 +61,23 @@ export default {
     onInit () {
     onInit () {
       this.$refs.listTemplateRefs.onInit()
       this.$refs.listTemplateRefs.onInit()
     },
     },
+    async onSend (row) {
+      this.loading = true
+      try {
+        await sendSalaryRelease({ performanceSolutionId: row.performanceSolutionId })
+        this.$message.success('发布成功')
+        this.$refs.listTemplateRefs.onInit()
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
     onOpen (ref, item) {
     onOpen (ref, item) {
       this.$refs[ref]?.open && this.$refs[ref].open(item)
       this.$refs[ref]?.open && this.$refs[ref].open(item)
+    },
+    onCalculate () {
+
     },
     },
     onDelete (item) {
     onDelete (item) {
       this.$confirm(`确定删除${item.title}吗?`, '提示').then(async () => {
       this.$confirm(`确定删除${item.title}吗?`, '提示').then(async () => {

+ 0 - 0
src/views/salary/sandbox/salarySandboxEdit.vue → src/views/salary/solution/salarySolution/salarySolutionEdit.vue


+ 2 - 2
src/views/salary/sandbox/salarySandboxRules.vue → src/views/salary/solution/salarySolution/salarySolutionRules.vue

@@ -38,14 +38,14 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import SalarySolutionRulesEdit from './salarySandboxRulesEdit.vue'
+import SalarySolutionRulesEdit from './salarySolutionRulesEdit.vue'
 import {
 import {
   saveSolution,
   saveSolution,
   getSolutionDetails
   getSolutionDetails
 } from '@/api/salary'
 } from '@/api/salary'
 
 
 export default {
 export default {
-  name: 'salarySandboxRules',
+  name: 'salarySolutionRules',
   components: {
   components: {
     SalarySolutionRulesEdit
     SalarySolutionRulesEdit
   },
   },

+ 3 - 3
src/views/salary/sandbox/salarySandboxRulesEdit.vue → src/views/salary/solution/salarySolution/salarySolutionRulesEdit.vue

@@ -60,12 +60,12 @@
 <script>
 <script>
 import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
 import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
 import '@wangeditor/editor/dist/css/style.css'
 import '@wangeditor/editor/dist/css/style.css'
-import SalarySolutionRulesEditParam from './salarySandboxRulesEditParam.vue'
+import SalarySolutionRulesEditParam from './salarySolutionRulesEditParam.vue'
 import {
 import {
   DICT_CATEGORY
   DICT_CATEGORY
-} from '../solution/utils/Dict'
+} from '../utils/Dict'
 export default {
 export default {
-  name: 'salarySandboxRulesEdit',
+  name: 'salarySolutionRulesRulesEdit',
   components: { Editor, Toolbar, SalarySolutionRulesEditParam },
   components: { Editor, Toolbar, SalarySolutionRulesEditParam },
   props: {
   props: {
     item: {
     item: {

+ 1 - 1
src/views/salary/sandbox/salarySandboxRulesEditParam.vue → src/views/salary/solution/salarySolution/salarySolutionRulesEditParam.vue

@@ -28,7 +28,7 @@
 <script>
 <script>
 import {
 import {
   DICT_CATEGORY
   DICT_CATEGORY
-} from '../solution/utils/Dict'
+} from '../utils/Dict'
 export default {
 export default {
   name: 'salarySolutionRulesEditParam',
   name: 'salarySolutionRulesEditParam',
   data () {
   data () {