Bladeren bron

优化调整

zhengnaiwen_citu 6 maanden geleden
bovenliggende
commit
6713fa6e4b

+ 7 - 4
src/components/AutoComponents/MSearch/index.vue

@@ -6,8 +6,8 @@
       ref="form"
       label-width="80px"
       size="small"
-      :show-message="false"
       inline-message
+      class="-mb-15px"
       @submit.native.prevent
     >
 
@@ -123,10 +123,13 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-::v-deep .el-form-item {
-  margin: 0 !important;
-}
+// ::v-deep .el-form-item {
+//   margin: 0 !important;
+// }
 .flex ::v-deep .el-form-item__content{
   display: flex;
 }
+.-mb-15px {
+  margin-bottom: -15px;
+}
 </style>

+ 1 - 2
src/views/humanResources/panorama/dynamic/salary/payroll.vue

@@ -1,8 +1,7 @@
 <template>
   <div>
-    <m-search class="mb-3" shadow="never" v-model="searchValues" :items="searchItems" @search="onSearch"></m-search>
+    <m-search class="mb-3" v-model="searchValues" :items="searchItems" @search="onSearch"></m-search>
     <m-table
-      shadow="never"
       v-loading="loading"
       :headers="headers"
       :items="items"

+ 4 - 29
src/views/humanResources/welfare/index.vue

@@ -7,37 +7,10 @@
         :label="item.label"
         :name="item.name"
       >
-        <component :is="item.component" :ref="item.name" @mounted="onComponentMounted" @history="onHistory"></component>
+        <component :is="item.component" :ref="item.name" @hook:mounted="onComponentMounted" @history="onHistory"></component>
       </el-tab-pane>
     </el-tabs>
     <DrawerHistory ref="drawerHistoryRefs" :get-page="getPage">
-      <div class="pa-4">
-        <!-- <el-form label-position="right" class="m-form" label-width="100px">
-          <el-form-item label="福利名称">
-            <el-tag>{{ itemData.subsidyName }}</el-tag>
-          </el-form-item>
-          <el-form-item label="创建时间">
-            <el-tag>{{ itemData.createDate }}</el-tag>
-          </el-form-item>
-          <el-form-item label="规则配置">
-            <el-form label-position="right" class="m-form" label-width="100px">
-            <el-form-item label="配置机构">
-              <div>
-                <el-tag v-for="(_name, i) in item.subsidyOrganizationNames" :key="i" type="primary" class="mr-3">
-                  {{ _name }}
-                </el-tag>
-              </div>
-            </el-form-item>
-            <el-form-item label="福利薪资">
-              <el-tag type="primary">{{ item.subsidySalary }}</el-tag>
-            </el-form-item>
-            <el-form-item label="描述">
-              <span>{{ item.subsidyCheck }}</span>
-            </el-form-item>
-          </el-form>
-        </el-form-item>
-      </el-form> -->
-      </div>
       <template #panel="{ item }">
         <el-form label-position="right" class="m-form" label-width="100px">
           <el-form-item label="福利名称">
@@ -137,5 +110,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
+::v-deep .el-tabs__content  {
+  overflow: visible !important;
+}
 </style>

+ 0 - 3
src/views/humanResources/welfare/welfareHistory/index.vue

@@ -15,9 +15,6 @@ export default {
   components: {
     ListTemplate
   },
-  mounted () {
-    this.$emit('mounted')
-  },
   methods: {
     onInit () {
       this.$refs.listTemplateRefs.onInit()

+ 0 - 3
src/views/humanResources/welfare/welfareList/index.vue

@@ -37,9 +37,6 @@ export default {
     WelfareRules,
     HistoryDialog
   },
-  mounted () {
-    this.$emit('mounted')
-  },
   methods: {
     onInit () {
       this.$refs.listTemplateRefs.onInit()

+ 41 - 226
src/views/salary/comparison/index.vue

@@ -1,252 +1,67 @@
 <template>
   <div class="white pa-3">
-    <m-search :items="searchItems" v-model="searchValues" class="mb-3" @search="onSearch">
-      <template #button>
-        <el-upload class="el-button pa-0" action="#" :show-file-list="false" :http-request="onImport">
-          <m-button type="primary" icon="el-icon-upload2" :loading="importLoading">导入手工数据</m-button>
-        </el-upload>
-        <m-button type="primary" icon="el-icon-download" :loading="downloadLoading" @click="onExport">导出手工数据模板</m-button>
-        <!-- <m-button type="primary" icon="el-icon-check" :loading="submitLoading" :disable="checked" @click="onSubmit">薪酬对比确认</m-button> -->
-      </template>
-    </m-search>
-    <m-table
-      :items="items"
-      :headers="headers"
-      :loading="loading"
-      :total="total"
-      :page-size="pageInfo.size"
-      :page-current="pageInfo.current"
-      :row-class-name="rowClassName"
-      @page-change="onPageChange"
-      @expand-change="onExpandChange"
-    >
-      <template #expand="{ row }">
-        <el-form label-position="left" inline class="demo-table-expand">
-          <m-card shadow="nerve">
-            <el-timeline>
-              <el-timeline-item
-                :hide-timestamp="true">
-                <el-row>
-                  <el-col :span="4">月份</el-col>
-                  <el-col :span="4">绩效薪资</el-col>
-                  <el-col :span="4">数据来源</el-col>
-                  <el-col :span="4">写入时间</el-col>
-                  <el-col :span="4">操作</el-col>
-                </el-row>
-              </el-timeline-item>
-              <el-timeline-item
-                v-for="(list, index) in row.childrenList"
-                :key="index"
-                :hide-timestamp="true">
-                <el-row>
-                  <el-col class="col" :span="4">{{ list.month }}</el-col>
-                  <el-col class="col" :span="4">{{ list.performanceSalary || '暂无' }}</el-col>
-                  <el-col class="col" :span="4">{{ list.dataType === 1 ? '手工录入' : '系统数据'}}</el-col>
-                  <el-col class="col" :span="4">{{ list.createDate }}</el-col>
-                  <el-col class="col" :span="4">
-                    <m-button v-if="checked"  type="text" size="small" icon="el-icon-check" disabled>已使用当前版本</m-button>
-                    <m-button
-                      v-else
-                      type="primary"
-                      size="small"
-                      @click="onConfirm(list)"
-                    >确认使用该版本</m-button>
-                  </el-col>
-                </el-row>
-              </el-timeline-item>
-            </el-timeline>
-          </m-card>
-        </el-form>
-      </template>
-    </m-table>
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane
+        v-for="item in items"
+        :key="item.name"
+        :label="item.label"
+        :name="item.name"
+      >
+        <component :is="item.component" :ref="item.name" @hook:mounted="onComponentMounted" @history="onHistory"></component>
+      </el-tab-pane>
+    </el-tabs>
   </div>
 </template>
 
 <script>
-import {
-  getComparisonPage,
-  uploadComparisonTemplate,
-  downloadComparisonTemplate,
-  getComparisonByEmployee,
-  getComparisonConfirm,
-  confirmComparisonVersion
-} from '@/api/salary'
-import { dateFormat } from '@/utils/date'
-import { downloadFile } from '@/utils'
 export default {
   name: 'salary-comparison',
   data () {
     return {
-      expandRow: [],
-      importLoading: false,
-      downloadLoading: false,
-      submitLoading: false,
-      searchItems: [
-        {
-          label: '月份',
-          prop: 'month',
-          type: 'datePicker',
-          option: {
-            editable: false,
-            clearable: false,
-            placeholder: '请选择月份',
-            type: 'month',
-            valueFormat: 'yyyy-MM',
-            format: 'yyyy 年 MM 月'
-          }
-        },
-        { label: '部门', prop: 'organizationName', type: 'input', option: { placeholder: '请输入部门' } },
-        { label: '姓名', prop: 'employeeName', type: 'input', option: { placeholder: '请输入姓名' } }
-      ],
-      searchValues: {
-        month: dateFormat('YYYY-mm', new Date()),
-        organizationName: null,
-        employeeName: null
-      },
-      headers: [
-        { type: 'expand', prop: 'expand' },
-        { label: '机构', prop: 'organizationName' },
-        { label: '姓名', prop: 'employeeName' },
-        { label: '统一认证号', prop: 'unifiedCertificationNumber' },
-        { label: '月份', prop: 'month' }
-        // { label: '操作', prop: 'action', align: 'center', width: 100 }
-      ],
-      items: [
-      ],
-      loading: false,
-      total: 0,
-      pageInfo: {
-        current: 1,
-        size: 10
-      },
-      checked: false
+      activeName: '',
+      items: [],
+      itemData: {}
     }
   },
   created () {
-    this.init()
+    this.items = this.$route.meta.roles.filter(e => e.hidden === 1).sort((a, b) => b - a).map(e => {
+      return {
+        name: e.name,
+        label: e.label,
+        component: () => import(`./${e.component}/index.vue`)
+      }
+    })
+    if (this.$route.query.name) {
+      this.activeName = this.$route.query.name
+    } else {
+      this.activeName = this.items[0].name
+    }
   },
   methods: {
-    async init () {
-      try {
-        const { data } = await getComparisonPage({
-          page: this.pageInfo,
-          ...this.searchValues
-        })
-        // 确认是否已经确认方案
-        const { data: _data } = await getComparisonConfirm({
-          page: {
-            size: 10,
-            current: 1
-          },
-          month: this.searchValues.month
-        })
-        this.checked = _data.records[0]?.version ?? false
-        this.items = data.records.map(e => {
-          return {
-            ...e,
-            childrenList: []
-          }
-        })
-        this.total = data.total
-      } catch (error) {
-        this.$message.error(error)
-      }
-    },
-    rowClassName ({ row, rowIndex }) {
-      console.log(111, row)
-      return this.expandRow.includes(row.unifiedCertificationNumber) ? 'grey' : null
-    },
-    onSearch () {
-      this.pageInfo.current = 1
-      this.init()
-    },
-    async onImport (response) {
-      this.importLoading = true
-      const formData = new FormData()
-      formData.append('file', response.file)
-      try {
-        await uploadComparisonTemplate(formData)
-        this.$message.success('导入成功')
-        this.init()
-      } catch (error) {
-        this.$message.error(error)
-      } finally {
-        this.importLoading = false
-      }
+    handleClick () {
+      this.$router.push(`${this.$route.path}?name=${this.activeName}`)
+      this.$nextTick(() => {
+        this.$refs[this.activeName][0].onInit()
+      })
     },
-    async onExport () {
-      this.downloadLoading = true
-      try {
-        const { data, name } = await downloadComparisonTemplate()
-        downloadFile(data, name)
-      } catch (error) {
-        this.$message.error(error)
-      } finally {
-        this.downloadLoading = false
-      }
-    },
-    async onExpandChange (row, expandedRows) {
-      this.expandRow = expandedRows.map(e => e.unifiedCertificationNumber)
-      if (row.childrenList.length) {
-        return
-      }
-      try {
-        const { data } = await getComparisonByEmployee({
-          page: {
-            size: 999,
-            current: 1
-          },
-          entity: {
-            unifiedCertificationNumber: row.unifiedCertificationNumber,
-            month: row.month
-          }
-        })
-        row.childrenList = data.records
-      } catch (error) {
-        this.$message.error(error)
-      }
+    onComponentMounted () {
+      this.$refs[this.activeName] && this.$refs[this.activeName][0].onInit()
     },
-    onConfirm (item) {
-      const h = this.$createElement
-      this.$confirm(h('div', null, [
-        h('p', undefined, '确认后将无法修改,是否确认?'),
-        h('p', { style: 'color: #ff5555' }, '注:版本确认之后所有人将同步使用当前选择的版本')
-      ]), '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(async () => {
-        try {
-          await confirmComparisonVersion({
-            employeePerformanceConfirmation: {
-              month: item.month,
-              version: item.version
-            }
-          })
-          this.$message.success('确认成功')
-          this.checked = true
-        } catch (error) {
-          this.$message.error(error)
-        }
-      }).catch(_ => {})
+    onHistory (row) {
+      this.itemData = row
+      this.$refs.drawerHistoryRefs.open(`${row.title} 历史记录`)
     },
-    onSubmit () {
-      this.submitLoading = true
-    },
-    onPageChange (page) {
-      this.pageInfo.current = page
-      this.init()
+    async getPage () {
+      return new Promise((resolve, reject) => {
+
+      })
     }
   }
 }
 </script>
 
 <style lang="scss" scoped>
-.col {
-  height: 32px;
-  line-height: 30px;
-}
-::v-deep .grey {
-  background-color: #f0f0f0;
+::v-deep .el-tabs__content  {
+  overflow: visible !important;
 }
 </style>

+ 248 - 0
src/views/salary/comparison/salaryEmployeeComparison/index.vue

@@ -0,0 +1,248 @@
+<template>
+  <div>
+    <m-search :items="searchItems" v-model="searchValues" class="mb-3" @search="onSearch">
+      <template #button>
+        <el-upload class="el-button pa-0" action="#" :show-file-list="false" :http-request="onImport">
+          <m-button type="primary" icon="el-icon-upload2" :loading="importLoading">导入手工数据</m-button>
+        </el-upload>
+        <m-button type="primary" icon="el-icon-download" :loading="downloadLoading" @click="onExport">导出手工数据模板</m-button>
+        <!-- <m-button type="primary" icon="el-icon-check" :loading="submitLoading" :disable="checked" @click="onSubmit">薪酬对比确认</m-button> -->
+      </template>
+    </m-search>
+    <m-table
+      :items="items"
+      :headers="headers"
+      :loading="loading"
+      :total="total"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      :row-class-name="rowClassName"
+      @page-change="onPageChange"
+      @expand-change="onExpandChange"
+    >
+      <template #expand="{ row }">
+        <el-form label-position="left" inline class="demo-table-expand">
+          <m-card shadow="nerve">
+            <el-timeline>
+              <el-timeline-item
+                :hide-timestamp="true">
+                <el-row>
+                  <el-col :span="4">月份</el-col>
+                  <el-col :span="4">绩效薪资</el-col>
+                  <el-col :span="4">数据来源</el-col>
+                  <el-col :span="4">写入时间</el-col>
+                  <el-col :span="4">操作</el-col>
+                </el-row>
+              </el-timeline-item>
+              <el-timeline-item
+                v-for="(list, index) in row.childrenList"
+                :key="index"
+                :hide-timestamp="true">
+                <el-row>
+                  <el-col class="col" :span="4">{{ list.month }}</el-col>
+                  <el-col class="col" :span="4">{{ list.performanceSalary || '暂无' }}</el-col>
+                  <el-col class="col" :span="4">{{ list.dataType === 1 ? '手工录入' : '系统数据'}}</el-col>
+                  <el-col class="col" :span="4">{{ list.createDate }}</el-col>
+                  <el-col class="col" :span="4">
+                    <m-button v-if="checked"  type="text" size="small" icon="el-icon-check" disabled>已使用当前版本</m-button>
+                    <m-button
+                      v-else
+                      type="primary"
+                      size="small"
+                      @click="onConfirm(list)"
+                    >确认使用该版本</m-button>
+                  </el-col>
+                </el-row>
+              </el-timeline-item>
+            </el-timeline>
+          </m-card>
+        </el-form>
+      </template>
+    </m-table>
+  </div>
+</template>
+
+<script>
+import {
+  getComparisonPage,
+  uploadComparisonTemplate,
+  downloadComparisonTemplate,
+  getComparisonByEmployee,
+  getComparisonConfirm,
+  confirmComparisonVersion
+} from '@/api/salary'
+import { dateFormat } from '@/utils/date'
+import { downloadFile } from '@/utils'
+export default {
+  name: 'salary-employee-comparison',
+  data () {
+    return {
+      expandRow: [],
+      importLoading: false,
+      downloadLoading: false,
+      submitLoading: false,
+      searchItems: [
+        {
+          label: '月份',
+          prop: 'month',
+          type: 'datePicker',
+          option: {
+            editable: false,
+            clearable: false,
+            placeholder: '请选择月份',
+            type: 'month',
+            valueFormat: 'yyyy-MM',
+            format: 'yyyy 年 MM 月'
+          }
+        },
+        { label: '部门', prop: 'organizationName', type: 'input', option: { placeholder: '请输入部门' } },
+        { label: '姓名', prop: 'employeeName', type: 'input', option: { placeholder: '请输入姓名' } }
+      ],
+      searchValues: {
+        month: dateFormat('YYYY-mm', new Date()),
+        organizationName: null,
+        employeeName: null
+      },
+      headers: [
+        { type: 'expand', prop: 'expand' },
+        { label: '机构', prop: 'organizationName' },
+        { label: '姓名', prop: 'employeeName' },
+        { label: '统一认证号', prop: 'unifiedCertificationNumber' },
+        { label: '月份', prop: 'month' }
+        // { label: '操作', prop: 'action', align: 'center', width: 100 }
+      ],
+      items: [
+      ],
+      loading: false,
+      total: 0,
+      pageInfo: {
+        current: 1,
+        size: 10
+      },
+      checked: false
+    }
+  },
+  methods: {
+    async onInit () {
+      try {
+        const { data } = await getComparisonPage({
+          page: this.pageInfo,
+          ...this.searchValues
+        })
+        // 确认是否已经确认方案
+        const { data: _data } = await getComparisonConfirm({
+          page: {
+            size: 10,
+            current: 1
+          },
+          month: this.searchValues.month
+        })
+        this.checked = _data.records[0]?.version ?? false
+        this.items = data.records.map(e => {
+          return {
+            ...e,
+            childrenList: []
+          }
+        })
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      }
+    },
+    rowClassName ({ row, rowIndex }) {
+      return this.expandRow.includes(row.unifiedCertificationNumber) ? 'grey' : null
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.onInit()
+    },
+    async onImport (response) {
+      this.importLoading = true
+      const formData = new FormData()
+      formData.append('file', response.file)
+      try {
+        await uploadComparisonTemplate(formData)
+        this.$message.success('导入成功')
+        this.onInit()
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.importLoading = false
+      }
+    },
+    async onExport () {
+      this.downloadLoading = true
+      try {
+        const { data, name } = await downloadComparisonTemplate()
+        downloadFile(data, name)
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.downloadLoading = false
+      }
+    },
+    async onExpandChange (row, expandedRows) {
+      this.expandRow = expandedRows.map(e => e.unifiedCertificationNumber)
+      if (row.childrenList.length) {
+        return
+      }
+      try {
+        const { data } = await getComparisonByEmployee({
+          page: {
+            size: 999,
+            current: 1
+          },
+          entity: {
+            unifiedCertificationNumber: row.unifiedCertificationNumber,
+            month: row.month
+          }
+        })
+        row.childrenList = data.records
+      } catch (error) {
+        this.$message.error(error)
+      }
+    },
+    onConfirm (item) {
+      const h = this.$createElement
+      this.$confirm(h('div', null, [
+        h('p', undefined, '确认后将无法修改,是否确认?'),
+        h('p', { style: 'color: #ff5555' }, '注:版本确认之后所有人将同步使用当前选择的版本')
+      ]), '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          await confirmComparisonVersion({
+            employeePerformanceConfirmation: {
+              month: item.month,
+              version: item.version
+            }
+          })
+          this.$message.success('确认成功')
+          this.checked = true
+        } catch (error) {
+          this.$message.error(error)
+        }
+      }).catch(_ => {})
+    },
+    onSubmit () {
+      this.submitLoading = true
+    },
+    onPageChange (page) {
+      this.pageInfo.current = page
+      this.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.col {
+  height: 32px;
+  line-height: 30px;
+}
+::v-deep .grey {
+  background-color: #f0f0f0;
+}
+</style>

+ 15 - 0
src/views/salary/comparison/salaryMechanismComparison/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'salary-mechanism-comparison'
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 15 - 0
src/views/salary/comparison/salaryOptionComparison/index.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'salary-option-comparison'
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 4 - 2
src/views/salary/solution/index.vue

@@ -7,7 +7,7 @@
         :label="item.label"
         :name="item.name"
       >
-        <component :is="item.component" :ref="item.name" @mounted="onComponentMounted" @history="onHistory"></component>
+        <component :is="item.component" :ref="item.name" @hook:mounted="onComponentMounted" @history="onHistory"></component>
       </el-tab-pane>
     </el-tabs>
     <DrawerHistory ref="drawerHistoryRefs" :get-page="getPage">
@@ -96,5 +96,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-
+::v-deep .el-tabs__content  {
+  overflow: visible !important;
+}
 </style>

+ 1 - 1
src/views/salary/solution/salarySolution/salarySolutionRules.vue

@@ -44,7 +44,7 @@ export default {
         items: []
       },
       headers: [
-        { label: '参数名称', prop: 'name', align: 'right', width: '200px' },
+        { label: '参数名称', prop: 'name', align: 'right', width: '500px' },
         { label: '数值', prop: 'value' }
       ],
       itemData: {},

+ 2 - 1
src/views/salary/solution/salarySolutionParameter/configEdit.vue

@@ -1,5 +1,5 @@
 <template>
-  <m-dialog ref="editDialog" v-bind="$attrs" @sure="handleSaveEdit">
+  <m-dialog ref="editDialog" :title="query.calculateConfigurationId ? '编辑参数' : '新增参数'" v-bind="$attrs" @sure="handleSaveEdit">
     <m-form ref="formRefs" :items="items" v-model="query"></m-form>
   </m-dialog>
 </template>
@@ -43,6 +43,7 @@ export default {
           prop: 'category',
           type: 'autocomplete',
           options: {
+            clearable: true,
             placeholder: '请选择分类',
             fetchSuggestions: this.fetchSuggestions,
             handles: {

+ 2 - 5
src/views/salary/solution/salarySolutionParameter/index.vue

@@ -20,7 +20,7 @@
         <m-button text type="danger" @click="onDelete(row)" size="small">删除</m-button>
       </template>
     </m-table>
-    <config-edit ref="editRefs" :title="title" @refresh="onInit"></config-edit>
+    <config-edit ref="editRefs" @refresh="onInit"></config-edit>
   </div>
 </template>
 
@@ -37,7 +37,6 @@ export default {
   components: { ConfigEdit },
   data () {
     return {
-      title: '',
       searchItems: [
         { label: '关键词', prop: 'keyword', type: 'input', option: { placeholder: '请输入关键词' } },
         {
@@ -45,6 +44,7 @@ export default {
           prop: 'category',
           type: 'autocomplete',
           option: {
+            clearable: true,
             placeholder: '请输入分类',
             fetchSuggestions: this.fetchSuggestions
           }
@@ -105,14 +105,11 @@ export default {
       this.onInit()
     },
     onAdd () {
-      this.title = '新增配置'
       this.$refs.editRefs.open()
     },
     async onEdit (item) {
       try {
         const { data } = await getConfig(item.calculateConfigurationId)
-
-        this.title = '编辑配置'
         this.$refs.editRefs.open(data)
       } catch (error) {
         this.$message.error(error)